Skip to content

Commit

Permalink
don't try to use Hit Test in VR (#5005)
Browse files Browse the repository at this point in the history
* don't try to use Hit Test in VR

* Convert if statement into one liner

Co-authored-by: Diego Marcos Segura <diego.marcos@gmail.com>
  • Loading branch information
AdaRoseCannon and dmarcos authored Feb 3, 2022
1 parent e2cea0c commit 33d25a3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/scene/ar-hit-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ module.exports.Component = register('ar-hit-test', {
}.bind(this));

this.el.sceneEl.renderer.xr.addEventListener('sessionstart', function () {
// Don't request Hit Test unless AR (breaks WebXR Emulator)
if (!this.el.is('ar-mode')) { return; }

var renderer = this.el.sceneEl.renderer;
var session = this.session = renderer.xr.getSession();
this.hasPosedOnce = false;
Expand Down

0 comments on commit 33d25a3

Please sign in to comment.