Skip to content

Commit 998e4fc

Browse files
In raycaster update, call setDirty only if objects property changed, 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)
1 parent 9436d4b commit 998e4fc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎src/components/raycaster.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ module.exports.Component = registerComponent('raycaster', {
131131

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

134-
this.setDirty();
134+
if (data.objects !== oldData.objects) {
135+
this.setDirty();
136+
}
135137
},
136138

137139
play: function () {

0 commit comments

Comments
 (0)