Kaynağa Gözat

save cpu and copt from abs pos

Raanan Weber 5 yıl önce
ebeveyn
işleme
bf565b8cdf
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 2 2
      src/Cameras/XR/webXRController.ts

+ 2 - 2
src/Cameras/XR/webXRController.ts

@@ -116,11 +116,11 @@ export class WebXRController {
      */
     public getWorldPointerRayToRef(result: Ray) {
         // Force update to ensure picked point is synced with ray
-        let worldMatrix = this.pointer.computeWorldMatrix(true);
+        let worldMatrix = this.pointer.computeWorldMatrix();
         worldMatrix.decompose(undefined, this._tmpQuaternion, undefined);
         this._tmpVector.set(0, 0, 1);
         this._tmpVector.rotateByQuaternionToRef(this._tmpQuaternion, this._tmpVector);
-        result.origin = this.pointer.absolutePosition;
+        result.origin.copyFrom(this.pointer.absolutePosition);
         result.direction.copyFrom(this._tmpVector);
         result.length = 1000;
     }