|
@@ -29,7 +29,7 @@ Object.assign( WebXRController.prototype, {
|
|
|
|
|
|
if ( window.XRHand ) {
|
|
if ( window.XRHand ) {
|
|
|
|
|
|
- for ( let i = 0; i <= XRHand.LITTLE_PHALANX_TIP; i ++ ) {
|
|
|
|
|
|
+ for ( let i = 0; i <= window.XRHand.LITTLE_PHALANX_TIP; i ++ ) {
|
|
|
|
|
|
// The transform of this joint will be updated with the joint pose on each frame
|
|
// The transform of this joint will be updated with the joint pose on each frame
|
|
let joint = new Group();
|
|
let joint = new Group();
|
|
@@ -142,7 +142,7 @@ Object.assign( WebXRController.prototype, {
|
|
if ( inputSource.hand ) {
|
|
if ( inputSource.hand ) {
|
|
|
|
|
|
handPose = true;
|
|
handPose = true;
|
|
- for ( let i = 0; i <= XRHand.LITTLE_PHALANX_TIP; i ++ ) {
|
|
|
|
|
|
+ for ( let i = 0; i <= window.XRHand.LITTLE_PHALANX_TIP; i ++ ) {
|
|
|
|
|
|
if ( inputSource.hand[ i ] ) {
|
|
if ( inputSource.hand[ i ] ) {
|
|
|
|
|
|
@@ -163,8 +163,8 @@ Object.assign( WebXRController.prototype, {
|
|
// Custom events
|
|
// Custom events
|
|
|
|
|
|
// Check pinch
|
|
// Check pinch
|
|
- const indexTip = hand.joints[ XRHand.INDEX_PHALANX_TIP ];
|
|
|
|
- const thumbTip = hand.joints[ XRHand.THUMB_PHALANX_TIP ];
|
|
|
|
|
|
+ const indexTip = hand.joints[ window.XRHand.INDEX_PHALANX_TIP ];
|
|
|
|
+ const thumbTip = hand.joints[ window.XRHand.THUMB_PHALANX_TIP ];
|
|
const distance = indexTip.position.distanceTo( thumbTip.position );
|
|
const distance = indexTip.position.distanceTo( thumbTip.position );
|
|
|
|
|
|
const distanceToPinch = 0.02;
|
|
const distanceToPinch = 0.02;
|