Reduced-scope version of detaching unused pool elements from scene graph #5188
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updated set of changes as per feedback in PR #5186.
However I am concerned about the performance characteristics of updating raycasters in this way.
A querySelectorAll() call on an attribute selector
[raycaster]
is potentially an expensive operation as it requires traversal of the entire HTML graph.However the alternative of caching the set of raycaster entities in the scene is also problematic, as you'd have to figure out when to refresh that cache...
Hence I think it would be better to stick with emitting events, as per #5186, to keep the performance overhead of adding to / removing from pools to a minimum.
@dmarcos - for now, leaving the code as per your request in #5186, pending your feedback. Happy to update this PR to include emitting the events if you agree that would be better from a performance pov. Let me know...