fix(effects-manager): sync selection outlines with object transforms #793
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.
Description
I'm fixing a visual bug where the selection outlines (the rainbow highlights) would detach and float in empty space if a user scaled the physics objects.
Previously, when you selected an object like a Jet, we created a static copy of its position and added the outline to the main scene. If you then used the "Jets Scale" slider to resize or move those jets, the outline stayed frozen in the old spot. This made the visualization look broken and confusing.
The Fix
I updated the
EffectsManagerto use the Three.js scene graph more effectively.Instead of adding the outline helper to the root scene, I am now adding it as a child of the selected mesh itself. This means the outline automatically inherits all transformations—if the parent jet moves or scales, the outline follows it perfectly without us needing to manually sync them in the render loop.
How to Test
Expected Result: The rainbow outline should expand and move exactly along with the Jet geometry, rather than getting left behind.