bevy/crates/bevy_render
Jonathan Nilsson 0ebd7fcdf4
Visibility range takes the model aabb into acount (#15164)
# Objective

I'm building a game where i generate a set of meshes where the transform
is identity, and in each mesh the vertices are offset to where the model
is. When adding visibility ranges to the models i noticed that they only
switched when the distance to the origin changed over the threshold and
all at the same time.

## Solution

I believe that each mesh gets a Aabb generated for use with visibility
testing. So we can use that aabb to calculate a more representative
distance to the mesh.

The code to transform the aabb is taken from the visibility sysyem.

## Testing
I tested the changes locally in my project.

Would you like me to write an example or a test somewhere?
Is there any other code that uses the visibility range, that i should
also update?
2024-09-23 20:38:26 +00:00
..
macros Allow to expect (adopted) (#15301) 2024-09-20 19:16:42 +00:00
src Visibility range takes the model aabb into acount (#15164) 2024-09-23 20:38:26 +00:00
Cargo.toml Update `glam to 0.29, encase` to 0.10. (#15249) 2024-09-23 19:44:02 +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