Skip to content

Commit

Permalink
In raycaster update, call setDirty only if objects property changed, …
Browse files Browse the repository at this point in the history
…and not on every mouse move (setAttribute('raycaster', {origin, direction}) is called by the cursor component in onMouseMove triggering refreshObjects on each tick with the default raycaster refresh interval that is 0) (#5542)
  • Loading branch information
vincentfretin authored Jun 18, 2024
1 parent 9436d4b commit 998e4fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/raycaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ module.exports.Component = registerComponent('raycaster', {

if (oldData.enabled && !data.enabled) { this.clearAllIntersections(); }

this.setDirty();
if (data.objects !== oldData.objects) {
this.setDirty();
}
},

play: function () {
Expand Down

0 comments on commit 998e4fc

Please sign in to comment.