bevy/crates/bevy_render
Patrick Walton d80b809ea1
Only use the AABB center for mesh visibility range testing if specified. (#16468)
PR #15164 made Bevy consider the center of the mesh to be the center of
the axis-aligned bounding box (AABB). Unfortunately, this breaks
crossfading in many cases. LODs may have different AABBs and so the
center of the AABB may differ for different LODs of the same mesh. The
crossfading, however, relies on all LODs having *precisely* the same
position.

To address this problem, this PR adds a new field, `use_aabb`, to
`VisibilityRange`, which makes the AABB center point behavior opt-in.

@BenjaminBrienen first noticed this issue when reviewing PR #16286. That
PR contains a video showing the effects of this regression on the
`visibility_range` example. This commit fixes that example.

## Migration Guide

* The `VisibilityRange` component now has an extra field, `use_aabb`.
Generally, you can safely set it to false.
2024-11-22 18:18:20 +00:00
..
macros Don't reëxport bevy_image from bevy_render (#16163) 2024-11-10 06:54:38 +00:00
src Only use the AABB center for mesh visibility range testing if specified. (#16468) 2024-11-22 18:18:20 +00:00
Cargo.toml Fix detailed_trace! (#16452) 2024-11-20 22:01:33 +00:00
README.md Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00

Bevy Render

License Crates.io Downloads Docs Discord