Fix scene_viewer setup retry when mesh AABBs are missing - #25667
Open
fmterrors wants to merge 1 commit into
Open
Fix scene_viewer setup retry when mesh AABBs are missing#25667fmterrors wants to merge 1 commit into
fmterrors wants to merge 1 commit into
Conversation
Signed-off-by: fmterrors <fmterrors@outlook.com>
Contributor
|
Welcome, new contributor! Please make sure you've read our contributing guide, as well as our policy regarding AI usage, and we look forward to reviewing your pull request shortly ✨ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Objective
Ensure that
scene_viewerinitializes its controllable camera and default light even when loaded scene meshes do not haveAabbcomponents on the first setup attempt.When
SceneHandle::is_loadedbecomes true, mesh bounds may still be pending. The setup system currently marks its local setup state before checking for missingAabbcomponents. If any mesh is missing anAabb, the system returns and permanently skips the camera and light initialization.Solution
Set the local setup flag only after the scene bounds have been calculated and the camera and light initialization logic has completed.
This allows the system to retry on subsequent frames while any mesh is still waiting for its
Aabb.Testing
cargo +nightly-2026-09-01 check --example scene_viewer --features free_camera,bevy_dev_toolsrustfmt --edition 2024 --check examples/tools/scene_viewer/main.rsgit diff --checkShowcase
While a showcase should aim to be brief and digestible, you can use a toggleable section to save space on longer showcases:
Click to view showcase