|
@@ -113,6 +113,17 @@ module BABYLON {
|
|
this._deviceOrientationCamera = new BABYLON.DeviceOrientationCamera("deviceOrientationVRHelper", this._position, scene);
|
|
this._deviceOrientationCamera = new BABYLON.DeviceOrientationCamera("deviceOrientationVRHelper", this._position, scene);
|
|
this._deviceOrientationCamera.minZ = this._scene.activeCamera.minZ;
|
|
this._deviceOrientationCamera.minZ = this._scene.activeCamera.minZ;
|
|
this._deviceOrientationCamera.maxZ = this._scene.activeCamera.maxZ;
|
|
this._deviceOrientationCamera.maxZ = this._scene.activeCamera.maxZ;
|
|
|
|
+ // Set rotation from previous camera
|
|
|
|
+ if(this._scene.activeCamera instanceof TargetCamera){
|
|
|
|
+ var targetCamera = this._scene.activeCamera;
|
|
|
|
+ if(targetCamera.rotationQuaternion && targetCamera.rotation){
|
|
|
|
+ this._deviceOrientationCamera.rotationQuaternion.copyFrom(targetCamera.rotationQuaternion);
|
|
|
|
+ this._deviceOrientationCamera.rotation = targetCamera.rotation.clone();
|
|
|
|
+ }else if(targetCamera.rotation){
|
|
|
|
+ this._deviceOrientationCamera.rotationQuaternion.copyFrom(Quaternion.RotationYawPitchRoll(targetCamera.rotation.y, targetCamera.rotation.x, targetCamera.rotation.z));
|
|
|
|
+ this._deviceOrientationCamera.rotation = targetCamera.rotation.clone();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
this._scene.activeCamera = this._deviceOrientationCamera;
|
|
this._scene.activeCamera = this._deviceOrientationCamera;
|
|
this._canvas = scene.getEngine().getRenderingCanvas();
|
|
this._canvas = scene.getEngine().getRenderingCanvas();
|