File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
- OnXRChange is called from the Update loop.
12
12
13
13
### Fixed
14
- - User scaling issue in FullView WebGLTemplates
14
+ - User scaling issue in FullView WebGLTemplates.
15
+ - Issue with disabling hand when not tracking.
15
16
16
17
## [ 0.9.0] - 2021-04-16
17
18
### Added
Original file line number Diff line number Diff line change @@ -625,6 +625,7 @@ setTimeout(function () {
625
625
frame . fillPoses ( inputSource . hand , refSpace , xrHand . poses ) ;
626
626
frame . fillJointRadii ( inputSource . hand , xrHand . radii ) ;
627
627
}
628
+ var jointsCount = 0 ;
628
629
for ( var j = 0 ; j < 25 ; j ++ ) {
629
630
xrHand . jointIndex = j * 16 ;
630
631
if ( ! isNaN ( xrHand . poses [ xrHand . jointIndex ] ) ) {
@@ -640,6 +641,19 @@ setTimeout(function () {
640
641
if ( ! isNaN ( xrHand . radii [ j ] ) ) {
641
642
xrHand . joints [ j ] . radius = xrHand . radii [ j ] ;
642
643
}
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 ++ ;
643
657
}
644
658
}
645
659
} else if ( inputSource . gripSpace ) {
You can’t perform that action at this time.
0 commit comments