David Catuhe 7 年 前
コミット
69ac575216
2 ファイル変更7016 行追加7015 行削除
  1. 7009 7009
      dist/preview release/babylon.d.ts
  2. 7 6
      src/Cameras/VR/babylon.vrExperienceHelper.ts

ファイルの差分が大きいため隠しています
+ 7009 - 7009
dist/preview release/babylon.d.ts


+ 7 - 6
src/Cameras/VR/babylon.vrExperienceHelper.ts

@@ -228,9 +228,9 @@ module BABYLON {
                 }
                 if (this._btnVR) {
                     this._btnVR.addEventListener("click", () => {
-                        if(!this.isInVRMode){
+                        if (!this.isInVRMode) {
                             this.enterVR();
-                        }else{
+                        } else {
                             this.exitVR();
                         }
                     });
@@ -414,10 +414,6 @@ module BABYLON {
          * Otherwise, will use the fullscreen API.
          */
         public enterVR() {
-            if (this._scene.activeCamera) {
-                this._position = this._scene.activeCamera.position.clone();
-            }
-
             if (this.onEnteringVR) {
                 try {
                     this.onEnteringVR.notifyObservers(this);
@@ -426,6 +422,11 @@ module BABYLON {
                     Tools.Warn("Error in your custom logic onEnteringVR: " + err);
                 }
             }
+
+            if (this._scene.activeCamera) {
+                this._position = this._scene.activeCamera.position.clone();
+            }
+
             if (this._webVRrequesting)
                 return;