浏览代码

update webVROption to be vrExperienceOptions when creating from scene, fix enter vr button not appearing when using createDeviceOrientationCamera: false

Trevor Baron 7 年之前
父节点
当前提交
b2271bd236
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 2 2
      src/Cameras/VR/babylon.vrExperienceHelper.ts
  2. 1 1
      src/babylon.scene.ts

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

@@ -148,6 +148,7 @@ module BABYLON {
 
 
         constructor(scene: Scene, public webVROptions: VRExperienceHelperOptions = {}) {
         constructor(scene: Scene, public webVROptions: VRExperienceHelperOptions = {}) {
             this._scene = scene;
             this._scene = scene;
+            this._canvas = scene.getEngine().getRenderingCanvas();
 
 
             this._defaultHeight = webVROptions.defaultHeight || 1.7;
             this._defaultHeight = webVROptions.defaultHeight || 1.7;
             
             
@@ -180,8 +181,7 @@ module BABYLON {
                         this._deviceOrientationCamera.rotation = targetCamera.rotation.clone();
                         this._deviceOrientationCamera.rotation = targetCamera.rotation.clone();
                     }
                     }
                 }
                 }
-                this._scene.activeCamera = this._deviceOrientationCamera;
-                this._canvas = scene.getEngine().getRenderingCanvas();
+                this._scene.activeCamera = this._deviceOrientationCamera;                
                 if (this._canvas) {
                 if (this._canvas) {
                     this._scene.activeCamera.attachControl(this._canvas);
                     this._scene.activeCamera.attachControl(this._canvas);
                 }
                 }

+ 1 - 1
src/babylon.scene.ts

@@ -4475,7 +4475,7 @@
             return null;
             return null;
         }
         }
 
 
-        public createDefaultVRExperience(webVROptions: WebVROptions = {}): VRExperienceHelper {
+        public createDefaultVRExperience(webVROptions: VRExperienceHelperOptions = {}): VRExperienceHelper {
             return new BABYLON.VRExperienceHelper(this, webVROptions);
             return new BABYLON.VRExperienceHelper(this, webVROptions);
         }
         }