mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 15:49:24 +02:00
Restore joints state on stopAnimation
This commit is contained in:
parent
2108cac38e
commit
f84f6e9b66
2 changed files with 12 additions and 0 deletions
|
@ -74,6 +74,7 @@ void AnimationHandle::setRunning(bool running) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_model->_runningAnimations.removeOne(_self);
|
_model->_runningAnimations.removeOne(_self);
|
||||||
|
restoreJoints();
|
||||||
replaceMatchingPriorities(0.0f);
|
replaceMatchingPriorities(0.0f);
|
||||||
}
|
}
|
||||||
emit runningChanged(isRunning());
|
emit runningChanged(isRunning());
|
||||||
|
@ -173,3 +174,13 @@ void AnimationHandle::replaceMatchingPriorities(float newPriority) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AnimationHandle::restoreJoints() {
|
||||||
|
for (int i = 0; i < _jointMappings.size(); i++) {
|
||||||
|
int mapping = _jointMappings.at(i);
|
||||||
|
if (mapping != -1) {
|
||||||
|
JointState& state = _model->_jointStates[mapping];
|
||||||
|
state.restoreRotation(1.0f, state._animationPriority);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,6 +92,7 @@ private:
|
||||||
void simulate(float deltaTime);
|
void simulate(float deltaTime);
|
||||||
void applyFrame(float frameIndex);
|
void applyFrame(float frameIndex);
|
||||||
void replaceMatchingPriorities(float newPriority);
|
void replaceMatchingPriorities(float newPriority);
|
||||||
|
void restoreJoints();
|
||||||
|
|
||||||
Model* _model;
|
Model* _model;
|
||||||
WeakAnimationHandlePointer _self;
|
WeakAnimationHandlePointer _self;
|
||||||
|
|
Loading…
Reference in a new issue