From 998e4fcf05919fa7aa2d9ab819f24e7f633ada1c Mon Sep 17 00:00:00 2001 From: Vincent Fretin Date: Tue, 18 Jun 2024 22:52:56 +0200 Subject: [PATCH] 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) --- src/components/raycaster.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/raycaster.js b/src/components/raycaster.js index b8a44ce9319..0f82970b07c 100644 --- a/src/components/raycaster.js +++ b/src/components/raycaster.js @@ -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 () {