Selaa lähdekoodia

Merge pull request #4107 from TrevorDev/vrCameraStretchAndMinZ

resize engine when exiting vr, ensure devicevrcamera minz is that of …
sebavan 7 vuotta sitten
vanhempi
commit
c54863cf32
1 muutettua tiedostoa jossa 6 lisäystä ja 0 poistoa
  1. 6 0
      src/Cameras/VR/babylon.vrExperienceHelper.ts

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

@@ -799,6 +799,9 @@ module BABYLON {
             }
             else if (this._vrDeviceOrientationCamera) {
                 this._vrDeviceOrientationCamera.position = this._position;
+                if(this._scene.activeCamera){
+                    this._vrDeviceOrientationCamera.minZ = this._scene.activeCamera.minZ
+                }
                 this._scene.activeCamera = this._vrDeviceOrientationCamera;
                 this._scene.getEngine().switchFullscreen(true);
                 this.updateButtonVisibility();
@@ -849,6 +852,9 @@ module BABYLON {
             if (this._interactionsEnabled) {
                 this._scene.unregisterBeforeRender(this.beforeRender);
             }
+
+            // resize to update width and height when exiting vr exits fullscreen
+            this._scene.getEngine().resize();
         }
 
         /**