diff --git a/examples/leapHands.js b/examples/leapHands.js index 5af3e72756..71f4c4449b 100644 --- a/examples/leapHands.js +++ b/examples/leapHands.js @@ -208,6 +208,12 @@ var leapHands = (function () { leftHandInactiveCount = 0; } else { leftHandInactiveCount += 1; + + if (leftHandInactiveCount === MAX_HAND_INACTIVE_COUNT) { + MyAvatar.clearJointData("LeftHand"); + MyAvatar.clearJointData("LeftForeArm"); + MyAvatar.clearJointData("LeftArm"); + } } if (rightHand.isActive()) { @@ -237,10 +243,12 @@ var leapHands = (function () { rightHandInactiveCount = 0; } else { rightHandInactiveCount += 1; - } - if (leftHandInactiveCount >= MAX_HAND_INACTIVE_COUNT && rightHandInactiveCount >= MAX_HAND_INACTIVE_COUNT) { - MyAvatar.clearJointsData(); + if (rightHandInactiveCount === MAX_HAND_INACTIVE_COUNT) { + MyAvatar.clearJointData("RightHand"); + MyAvatar.clearJointData("RightForeArm"); + MyAvatar.clearJointData("RightArm"); + } } } diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 48d58fb02c..1da046d5fc 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -997,6 +997,7 @@ void MyAvatar::clearJointData(int index) { if (QThread::currentThread() == thread()) { // HACK: ATM only JS scripts call clearJointData() on MyAvatar so we hardcode the priority _skeletonModel.setJointState(index, false, glm::quat(), 0.0f); + _skeletonModel.clearJointAnimationPriority(index); } }