-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Fix panic in mesh picking when a mesh is RENDER_WORLD only
#22356
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 panic in mesh picking when a mesh is RENDER_WORLD only
#22356
Conversation
|
Adding to the 0.18 milestone - the reporting issue is tagged as 0.18, and the bug it fixes is a panic introduced in 0.18. |
kfc35
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for correctness, checked out this branch and verified that the example does not crash with this code
|
code is fine. to consider it properly closed i think we should or |
## Objective Fix a panic in mesh picking if a mesh is `RenderAssetUsages::RENDER_WORLD` only. The panic was reported in #22206, although that issue is framed as a broader concern and so is not resolved by this PR. The problem was introduced in #21732. ## Solution Changed mesh accesses to use the non-panicking `try_` variants. This means extracted meshes are silently ignored as before. I also did a quick scan to see if could spot any other engine crates that might have the same issue - didn't see any but could easily have missed one. ## Testing Tested by modifying the `mesh_picking` example: ```diff + let mut p = Mesh::from(Cuboid::default()); + p.asset_usage = bevy_asset::RenderAssetUsages::RENDER_WORLD; let shapes = [ - meshes.add(Cuboid::default()), + meshes.add(p), ```
Objective
Fix a panic in mesh picking if a mesh is
RenderAssetUsages::RENDER_WORLDonly. The panic was reported in #22206, although that issue is framed as a broader concern and so is not resolved by this PR. The problem was introduced in #21732.Solution
Changed mesh accesses to use the non-panicking
try_variants. This means extracted meshes are silently ignored as before.I also did a quick scan to see if could spot any other engine crates that might have the same issue - didn't see any but could easily have missed one.
Testing
Tested by modifying the
mesh_pickingexample: