Browse Source

make sure scene renders when xr not available

Raanan Weber 5 years ago
parent
commit
39d060e549

+ 1 - 1
src/Cameras/XR/webXRDefaultExperience.ts

@@ -118,7 +118,7 @@ export class WebXRDefaultExperience {
         }).then(() => {
             return result;
         }).catch((error) => {
-            Logger.Error("Error initializing XR.");
+            Logger.Error("Error initializing XR");
             Logger.Error(error);
             return result;
         });

+ 3 - 1
src/Cameras/XR/webXRExperienceHelper.ts

@@ -166,7 +166,9 @@ export class WebXRExperienceHelper implements IDisposable {
         this.onStateChangedObservable.clear();
         this.onInitialXRPoseSetObservable.clear();
         this.sessionManager.dispose();
-        this.scene.activeCamera = this._nonVRCamera;
+        if (this._nonVRCamera) {
+            this.scene.activeCamera = this._nonVRCamera;
+        }
     }
 
     private _nonXRToXRCamera() {