Skip to content

Commit

Permalink
Start the light probe only when entering ar-mode (#5384)
Browse files Browse the repository at this point in the history
  • Loading branch information
Elettrotecnica authored Nov 16, 2023
1 parent 9d739bb commit 75d5092
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/scene/reflection.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ module.exports.Component = register('reflection', {
}

this.el.addEventListener('enter-vr', function () {
if (!self.el.is('ar-mode')) { return; }
var renderer = self.el.renderer;
var session = renderer.xr.getSession();
if (
session.requestLightProbe && self.el.is('ar-mode')
) {
if (session.requestLightProbe) {
self.startLightProbe();
}
});
Expand Down

0 comments on commit 75d5092

Please sign in to comment.