Selaa lähdekoodia

right handed system support

Raanan Weber 5 vuotta sitten
vanhempi
commit
5621d7d0b8
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3 0
      src/XR/features/WebXRControllerPointerSelection.ts

+ 3 - 0
src/XR/features/WebXRControllerPointerSelection.ts

@@ -546,6 +546,9 @@ export class WebXRControllerPointerSelection extends WebXRAbstractFeature {
     private _updatePointerDistance(_laserPointer: AbstractMesh, distance: number = 100) {
         _laserPointer.scaling.y = distance;
         // a bit of distance from the controller
+        if (this._scene.useRightHandedSystem) {
+            distance *= -1;
+        }
         _laserPointer.position.z = (distance / 2) + 0.05;
     }
 }