mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 01:53:10 +02:00
Lower left and right hands independently when no longer being tracked
This commit is contained in:
parent
b4592aceb6
commit
c7b34b4f54
2 changed files with 12 additions and 3 deletions
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue