Skip to content

Commit

Permalink
Add handler for experimental sessiongranted event enabling WebXR imme…
Browse files Browse the repository at this point in the history
…rsive navigation (fix #4445)
  • Loading branch information
dmarcos committed May 5, 2020
1 parent e41651c commit 62617e2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/scene/a-scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,9 @@ module.exports.AScene = registerElement('a-scene', {
var vrManager = this.renderer.xr;
AEntity.prototype.play.call(this); // .play() *before* render.

// WebXR Immersive navigation handler.
navigator.xr.addEventListener('sessiongranted', function () { sceneEl.enterVR(); });

if (sceneEl.renderStarted) { return; }
sceneEl.resize();

Expand Down

0 comments on commit 62617e2

Please sign in to comment.