Browse Source

Parent camera's word matrix is correct

Raanan Weber 8 years ago
parent
commit
88f240f07d
2 changed files with 5 additions and 4 deletions
  1. 1 1
      src/Cameras/VR/babylon.webVRCamera.ts
  2. 4 3
      src/Cameras/babylon.camera.ts

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

@@ -230,7 +230,7 @@ module BABYLON {
             return this._webvrViewMatrix;
         }
 
-        protected _updateCameraRotationMatrix() {
+        public _updateWebVRCameraRotationMatrix() {
             this._webvrViewMatrix.getRotationMatrixToRef(this._cameraRotationMatrix);
         }
 

+ 4 - 3
src/Cameras/babylon.camera.ts

@@ -620,7 +620,7 @@
                         this._rigCameras[0].getProjectionMatrix = this._getWebVRProjectionMatrix;
                         this._rigCameras[0]._getViewMatrix = this._getWebVRViewMatrix;
                         this._rigCameras[0]._isSynchronizedViewMatrix = this._isSynchronizedViewMatrix;
-                        this._rigCameras[0]._updateCameraRotationMatrix = this._updateCameraRotationMatrix;
+                        this._rigCameras[0]._updateCameraRotationMatrix = WebVRFreeCamera.prototype._updateWebVRCameraRotationMatrix;
 
                         //Right eye
                         this._rigCameras[1].viewport = new Viewport(0.5, 0, 0.5, 1.0);
@@ -631,7 +631,7 @@
                         this._rigCameras[1].getProjectionMatrix = this._getWebVRProjectionMatrix;
                         this._rigCameras[1]._getViewMatrix = this._getWebVRViewMatrix;
                         this._rigCameras[1]._isSynchronizedViewMatrix = this._isSynchronizedViewMatrix;
-                        this._rigCameras[1]._updateCameraRotationMatrix = this._updateCameraRotationMatrix;
+                        this._rigCameras[1]._updateCameraRotationMatrix = WebVRFreeCamera.prototype._updateWebVRCameraRotationMatrix;
                     }
                     break;
 
@@ -649,8 +649,9 @@
         }
 
         protected _updateCameraRotationMatrix() {
-            // only here for webvr
+            //Here for WebVR
         }
+
         /**
          * This function MUST be overwritten by the different WebVR cameras available.
          * The context in which it is running is the RIG camera. So 'this' is the TargetCamera, left or right.