瀏覽代碼

Projection matrix - correctly calculated.

Raanan Weber 8 年之前
父節點
當前提交
b8d98d4918
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      src/Cameras/VR/babylon.webVRCamera.ts

+ 4 - 3
src/Cameras/VR/babylon.webVRCamera.ts

@@ -281,13 +281,14 @@ module BABYLON {
 
         protected _getWebVRProjectionMatrix(): Matrix {
             var projectionArray = this._cameraRigParams["left"] ? this._cameraRigParams["frameData"].leftProjectionMatrix : this._cameraRigParams["frameData"].rightProjectionMatrix;
+            Matrix.FromArrayToRef(projectionArray, 0, this._projectionMatrix);
+
             //babylon compatible matrix
             if (!this.getScene().useRightHandedSystem) {
-                [8, 9, 10, 11].forEach(function (num) {
-                    projectionArray[num] *= -1;
+                [8, 9, 10, 11].forEach((num) => {
+                    this._projectionMatrix.m[num] *= -1;
                 });
             }
-            Matrix.FromArrayToRef(projectionArray, 0, this._projectionMatrix);
             return this._projectionMatrix;
         }