@@ -619,13 +619,18 @@ setTimeout(function () {
619
619
}
620
620
xrHand . enabled = 1 ;
621
621
if ( inputSource . hand . values ) {
622
- frame . fillPoses ( inputSource . hand . values ( ) , refSpace , xrHand . poses ) ;
622
+ if ( ! frame . fillPoses ( inputSource . hand . values ( ) , refSpace , xrHand . poses ) ) {
623
+ xrHand . enabled = 0 ;
624
+ continue ;
625
+ }
623
626
frame . fillJointRadii ( inputSource . hand . values ( ) , xrHand . radii ) ;
624
627
} else {
625
- frame . fillPoses ( inputSource . hand , refSpace , xrHand . poses ) ;
628
+ if ( ! frame . fillPoses ( inputSource . hand , refSpace , xrHand . poses ) ) {
629
+ xrHand . enabled = 0 ;
630
+ continue ;
631
+ }
626
632
frame . fillJointRadii ( inputSource . hand , xrHand . radii ) ;
627
633
}
628
- var jointsCount = 0 ;
629
634
for ( var j = 0 ; j < 25 ; j ++ ) {
630
635
xrHand . jointIndex = j * 16 ;
631
636
if ( ! isNaN ( xrHand . poses [ xrHand . jointIndex ] ) ) {
@@ -641,19 +646,6 @@ setTimeout(function () {
641
646
if ( ! isNaN ( xrHand . radii [ j ] ) ) {
642
647
xrHand . joints [ j ] . radius = xrHand . radii [ j ] ;
643
648
}
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 ++ ;
657
649
}
658
650
}
659
651
} else if ( inputSource . gripSpace ) {
0 commit comments