Explorar o código

right handed system support

Raanan Weber %!s(int64=5) %!d(string=hai) anos
pai
achega
5621d7d0b8
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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;
     }
 }