Skip to content

Commit

Permalink
Stop the light probe only if this was set up in the first place (#5429)
Browse files Browse the repository at this point in the history
* Stop the light probe only if this was set up in the first place

* Compact idiom

---------

Co-authored-by: Antonio Pisano <apisano@wu.ac.at>
  • Loading branch information
Elettrotecnica and Antonio Pisano committed Jan 12, 2024
1 parent 298b1c9 commit 1691837
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/scene/reflection.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module.exports.Component = register('reflection', {
});

this.el.addEventListener('exit-vr', function () {
self.stopLightProbe();
if (self.xrLightProbe) { self.stopLightProbe(); }
});

this.el.object3D.environment = this.cubeRenderTarget.texture;
Expand Down

0 comments on commit 1691837

Please sign in to comment.