Sfoglia il codice sorgente

revert getforwardray change to continue to use left eye's forward instead

Trevor Baron 7 anni fa
parent
commit
279fdd57f9
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      src/Cameras/VR/babylon.webVRCamera.ts

+ 2 - 2
src/Cameras/VR/babylon.webVRCamera.ts

@@ -244,8 +244,8 @@ module BABYLON {
         
         public getForwardRay(length = 100): Ray {
             if (this.leftCamera) {
-                this.deviceRotationQuaternion.toRotationMatrix(this._workingMatrix);
-                return super.getForwardRay(length, this._workingMatrix, this.devicePosition); // Need the actual rendered camera
+                // Use left eye to avoid computation to compute center on every call
+                return super.getForwardRay(length, this.leftCamera.getWorldMatrix(), this.leftCamera.globalPosition); // Need the actual rendered camera
             }
             else {
                 return super.getForwardRay(length);