Browse Source

Fixing far interactions

rickfromwork 4 years ago
parent
commit
0e7247a2aa

+ 2 - 4
gui/src/3D/controls/touchButton3D.ts

@@ -49,8 +49,6 @@ export class TouchButton3D extends Button3D {
     constructor(name?: string, collisionMesh?: Mesh) {
     constructor(name?: string, collisionMesh?: Mesh) {
         super(name);
         super(name);
 
 
-       // this._buttonState = ButtonState.None;
-
         if (collisionMesh) {
         if (collisionMesh) {
             this.collisionMesh = collisionMesh;
             this.collisionMesh = collisionMesh;
         }
         }
@@ -68,9 +66,9 @@ export class TouchButton3D extends Button3D {
         }
         }
 
 
         this._collisionMesh = collisionMesh;
         this._collisionMesh = collisionMesh;
-        this._collidableFrontDirection = collisionMesh.forward;
+        this._collisionMesh.metadata = this;
 
 
-        this._updateDistances();
+        this.collidableFrontDirection = collisionMesh.forward;
 
 
         this._collidableInitialized = true;
         this._collidableInitialized = true;
     }
     }

+ 1 - 1
src/XR/features/WebXRControllerPointerSelection.ts

@@ -512,7 +512,7 @@ export class WebXRControllerPointerSelection extends WebXRAbstractFeature {
 
 
             if (controllerData.pick) {
             if (controllerData.pick) {
             // TODO find out why this causes a crash when hand data passes through here
             // TODO find out why this causes a crash when hand data passes through here
-           //     this._scene.simulatePointerMove(controllerData.pick, { pointerId: controllerData.id });
+                this._scene.simulatePointerMove(controllerData.pick, { pointerId: controllerData.id });
             }
             }
         });
         });
         if (xrController.inputSource.gamepad) {
         if (xrController.inputSource.gamepad) {