Browse Source

Merge pull request #6216 from TrevorDev/allowCameraInputAfterExitVR

Allow camera input after exit vr
David Catuhe 6 years ago
parent
commit
47682149a1
2 changed files with 7 additions and 1 deletions
  1. 1 1
      dist/preview release/what's new.md
  2. 6 0
      src/Cameras/VR/vrExperienceHelper.ts

+ 1 - 1
dist/preview release/what's new.md

@@ -198,7 +198,7 @@
 - Context loss causing unexpected results with dynamic textures, geometries with the same name and reflectionTextures ([TrevorDev](https://github.com/TrevorDev))
 - CreateScreenshotUsingRenderTarget stretches mirror textures when setting both width and height ([TrevorDev](https://github.com/TrevorDev))
 - VR helper only updating vr cameras position when entering vr, rotation was missing, laser distance stopped working ([TrevorDev](https://github.com/TrevorDev))
-- Fix VR controllers after gltfLoader transformNode change ([TrevorDev](https://github.com/TrevorDev))
+- Fix VR controllers after gltfLoader transformNode was changed ([TrevorDev](https://github.com/TrevorDev))
 - Bounding Box fixedDragMeshScreenSize stopped working and allow rotating through bounding box ([TrevorDev](https://github.com/TrevorDev))
 - VR helper would rotate non vr camera while in VR ([TrevorDev](https://github.com/TrevorDev))
 - PointerDragBahavior using Mesh as base type, causing type-checking problems with AbstractMesh ([Poolminer](https://github.com/Poolminer/))

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

@@ -1114,6 +1114,12 @@ export class VRExperienceHelper {
             });
 
             this._hasEnteredVR = false;
+
+            // Update engine state to re enable non-vr camera input
+            var engine = this._scene.getEngine();
+            if (engine._onVrDisplayPresentChange) {
+                engine._onVrDisplayPresentChange();
+            }
         }
     }