mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 17:54:20 +02:00
commit
4c10f6f23b
3 changed files with 12 additions and 2 deletions
|
@ -60,11 +60,9 @@ Script.update.connect(function(deltaTime) {
|
|||
}
|
||||
|
||||
if ((leftFrame != lastLeftFrame) && leftHandAnimation.length){
|
||||
MyAvatar.stopAnimation(leftHandAnimation);
|
||||
MyAvatar.startAnimation(leftHandAnimation, 30.0, 1.0, false, true, leftFrame, leftFrame);
|
||||
}
|
||||
if ((rightFrame != lastRightFrame) && rightHandAnimation.length) {
|
||||
MyAvatar.stopAnimation(rightHandAnimation);
|
||||
MyAvatar.startAnimation(rightHandAnimation, 30.0, 1.0, false, true, rightFrame, rightFrame);
|
||||
}
|
||||
|
||||
|
|
|
@ -74,6 +74,7 @@ void AnimationHandle::setRunning(bool running) {
|
|||
}
|
||||
} else {
|
||||
_model->_runningAnimations.removeOne(_self);
|
||||
restoreJoints();
|
||||
replaceMatchingPriorities(0.0f);
|
||||
}
|
||||
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 applyFrame(float frameIndex);
|
||||
void replaceMatchingPriorities(float newPriority);
|
||||
void restoreJoints();
|
||||
|
||||
Model* _model;
|
||||
WeakAnimationHandlePointer _self;
|
||||
|
|
Loading…
Reference in a new issue