Bläddra i källkod

Merge pull request #4874 from atulyar/gaze-tracker-fix

Fixed issue where gaze trackers appear even after leaving VR.
David Catuhe 7 år sedan
förälder
incheckning
d9163e2a3f
2 ändrade filer med 8 tillägg och 0 borttagningar
  1. 1 0
      dist/preview release/what's new.md
  2. 7 0
      src/Cameras/VR/babylon.vrExperienceHelper.ts

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

@@ -146,6 +146,7 @@
 - Initializing gamepadManager should register the gamepad update events ([TrevorDev](https://github.com/TrevorDev))
 - Do not generate mipmaps for RawCubeTexture if OES_texture_float_linear and/or EXT_color_buffer_float extensions are not supported ([PeapBoy](https://github.com/NicolasBuecher))
 - Do not modify passed camera array parameter when creating a default pipeline ([TrevorDev](https://github.com/TrevorDev))
+- Fixed issue where gaze trackers were appearing even after leaving VR ([atulyar](https://github.com/atulyar))
 - AdvancedDynamicTexture should not overwrite skipOnPointerObservable to false ([TrevorDev](https://github.com/TrevorDev))
 - Fixed issue where VRExperienceHelper.onExitingVR observable was being fired twice ([atulyar](https://github.com/atulyar))
 

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

@@ -906,6 +906,13 @@ module BABYLON {
 
             if (this._interactionsEnabled) {
                 this._scene.unregisterBeforeRender(this.beforeRender);
+                this._cameraGazer._gazeTracker.isVisible = false;
+                if (this.leftController) {
+                    this.leftController._gazeTracker.isVisible = false;
+                }
+                if (this.rightController) {
+                    this.rightController._gazeTracker.isVisible = false;
+                }
             }
 
             // resize to update width and height when exiting vr exits fullscreen