Skip to content

Commit 5293eb8

Browse files
committed
Fixed issue with disabling hand when not tracking
1 parent 629abf1 commit 5293eb8

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Packages/webxr/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
- OnXRChange is called from the Update loop.
1212

1313
### Fixed
14-
- User scaling issue in FullView WebGLTemplates
14+
- User scaling issue in FullView WebGLTemplates.
15+
- Issue with disabling hand when not tracking.
1516

1617
## [0.9.0] - 2021-04-16
1718
### Added

Packages/webxr/Runtime/Plugins/WebGL/webxr.jspre

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,7 @@ setTimeout(function () {
625625
frame.fillPoses(inputSource.hand, refSpace, xrHand.poses);
626626
frame.fillJointRadii(inputSource.hand, xrHand.radii);
627627
}
628+
var jointsCount = 0;
628629
for (var j = 0; j < 25; j++) {
629630
xrHand.jointIndex = j*16;
630631
if (!isNaN(xrHand.poses[xrHand.jointIndex])) {
@@ -640,6 +641,19 @@ setTimeout(function () {
640641
if (!isNaN(xrHand.radii[j])) {
641642
xrHand.joints[j].radius = xrHand.radii[j];
642643
}
644+
// Ugly hack(?) to disable hand when not tracking
645+
if (jointsCount == 0
646+
&& xrHand.joints[j].position[0] == 0
647+
&& xrHand.joints[j].position[1] == 0
648+
&& xrHand.joints[j].position[2] == 0
649+
&& xrHand.joints[j].rotation[0] == 0
650+
&& xrHand.joints[j].rotation[1] == 0
651+
&& xrHand.joints[j].rotation[2] == 0
652+
&& xrHand.joints[j].rotation[3] == 0.5) {
653+
xrHand.enabled = 0;
654+
break;
655+
}
656+
jointsCount++;
643657
}
644658
}
645659
} else if (inputSource.gripSpace) {

0 commit comments

Comments
 (0)