mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 03:58:15 +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;
|
leftHandInactiveCount = 0;
|
||||||
} else {
|
} else {
|
||||||
leftHandInactiveCount += 1;
|
leftHandInactiveCount += 1;
|
||||||
|
|
||||||
|
if (leftHandInactiveCount === MAX_HAND_INACTIVE_COUNT) {
|
||||||
|
MyAvatar.clearJointData("LeftHand");
|
||||||
|
MyAvatar.clearJointData("LeftForeArm");
|
||||||
|
MyAvatar.clearJointData("LeftArm");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rightHand.isActive()) {
|
if (rightHand.isActive()) {
|
||||||
|
@ -237,10 +243,12 @@ var leapHands = (function () {
|
||||||
rightHandInactiveCount = 0;
|
rightHandInactiveCount = 0;
|
||||||
} else {
|
} else {
|
||||||
rightHandInactiveCount += 1;
|
rightHandInactiveCount += 1;
|
||||||
}
|
|
||||||
|
|
||||||
if (leftHandInactiveCount >= MAX_HAND_INACTIVE_COUNT && rightHandInactiveCount >= MAX_HAND_INACTIVE_COUNT) {
|
if (rightHandInactiveCount === MAX_HAND_INACTIVE_COUNT) {
|
||||||
MyAvatar.clearJointsData();
|
MyAvatar.clearJointData("RightHand");
|
||||||
|
MyAvatar.clearJointData("RightForeArm");
|
||||||
|
MyAvatar.clearJointData("RightArm");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -997,6 +997,7 @@ void MyAvatar::clearJointData(int index) {
|
||||||
if (QThread::currentThread() == thread()) {
|
if (QThread::currentThread() == thread()) {
|
||||||
// HACK: ATM only JS scripts call clearJointData() on MyAvatar so we hardcode the priority
|
// HACK: ATM only JS scripts call clearJointData() on MyAvatar so we hardcode the priority
|
||||||
_skeletonModel.setJointState(index, false, glm::quat(), 0.0f);
|
_skeletonModel.setJointState(index, false, glm::quat(), 0.0f);
|
||||||
|
_skeletonModel.clearJointAnimationPriority(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue