Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dynamic bounding boxes in viewport #852

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

SYBIOTE
Copy link
Contributor

@SYBIOTE SYBIOTE commented Dec 17, 2024

Correct the handling of dynamic bounding boxes by ensuring the bounding box updates appropriately when the transform changes. This improves the accuracy of the bounding box representation in the viewport.

@SYBIOTE SYBIOTE requested a review from SamMazerIR as a code owner December 17, 2024 04:25
speigg
speigg previously requested changes Dec 17, 2024
Copy link
Contributor

@speigg speigg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we are updating the bounding box when the debugEnabled flag is set to true. Shouldn't the behavior of the bounding box be decoupled from whether or not the debug mode enabled? The debugEnabled flag should only control whether or not the bounding box is visible, not when it is updated.

@HexaField
Copy link
Member

It looks like we are updating the bounding box when the debugEnabled flag is set to true. Shouldn't the behavior of the bounding box be decoupled from whether or not the debug mode enabled? The debugEnabled flag should only control whether or not the bounding box is visible, not when it is updated.

updateBoundingBox is called in the transform system too, so it shouldn't be necessary here at all

@SYBIOTE
Copy link
Contributor Author

SYBIOTE commented Dec 19, 2024

It looks like we are updating the bounding box when the debugEnabled flag is set to true. Shouldn't the behavior of the bounding box be decoupled from whether or not the debug mode enabled? The debugEnabled flag should only control whether or not the bounding box is visible, not when it is updated.

hmm, ok, then ill move the code around , but as @HexaField said, its already updated when we move the object

@SYBIOTE
Copy link
Contributor Author

SYBIOTE commented Dec 19, 2024

It looks like we are updating the bounding box when the debugEnabled flag is set to true. Shouldn't the behavior of the bounding box be decoupled from whether or not the debug mode enabled? The debugEnabled flag should only control whether or not the bounding box is visible, not when it is updated.

updateBoundingBox is called in the transform system too, so it shouldn't be necessary here at all

the bounding box is updated after the condition here because the without the helper entity being set, the update is not performed
next,
when we just add an object to the scene by drag and drop and haven't moved it, the transforms need to be appropriately calculated, so, I mark as dirty so the transform would be updated

bounding box would be recalculated with the appropriate transforms
when u trigger the debug visible, it is also updated when the object itself is moved too

@SYBIOTE SYBIOTE requested a review from speigg December 20, 2024 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants