hubs
hubs copied to clipboard
Code that determines which objects can be targetted by cursor is slow.
This is not new, but I recently moved the code that determines which object3D's are valid cursor targets from cursor-controller to CursorTargettingSystem and noticed/remembered that the way we do this is quite slow and the entire array will be rebuilt whenever basically anything in the dom changes. We should speed this up - I suspect it is a non-trivial amount of the work we do whenever an object it is created, and it gets worse the more objects are in the scene. (I have not yet profiled.)
https://github.com/mozilla/hubs/blob/997d893296b8760509789372d3bdfaa773bf24a6/src/systems/cursor-targetting-system.js#L30