Browse Source

Merge pull request #1007 from Korreca/master

Fixed camera rotation with Oculus DK2
David Catuhe 9 years ago
parent
commit
8aaa16d76e
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/Cameras/VR/babylon.webVRCamera.ts

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

@@ -54,9 +54,9 @@ module BABYLON {
                 this._cacheQuaternion.copyFromFloats(this._cacheState.orientation.x, this._cacheState.orientation.y, this._cacheState.orientation.z, this._cacheState.orientation.w);
                 this._cacheQuaternion.copyFromFloats(this._cacheState.orientation.x, this._cacheState.orientation.y, this._cacheState.orientation.z, this._cacheState.orientation.w);
                 this._cacheQuaternion.toEulerAnglesToRef(this._cacheRotation);
                 this._cacheQuaternion.toEulerAnglesToRef(this._cacheRotation);
 
 
-                this.rotation.x = -this._cacheRotation.z;
+                this.rotation.x = -this._cacheRotation.x;
                 this.rotation.y = -this._cacheRotation.y;
                 this.rotation.y = -this._cacheRotation.y;
-                this.rotation.z = this._cacheRotation.x;
+                this.rotation.z = this._cacheRotation.z;
             }
             }
 
 
             super._checkInputs();
             super._checkInputs();
@@ -82,4 +82,4 @@ module BABYLON {
             return "WebVRFreeCamera";
             return "WebVRFreeCamera";
         }
         }
     }
     }
-}
+}