浏览代码

save cpu and copt from abs pos

Raanan Weber 5 年之前
父节点
当前提交
bf565b8cdf
共有 1 个文件被更改,包括 2 次插入2 次删除
  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;
     }