-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Description
Bevy version: 0.6
OS & graphic stack: ArchLinux kernel 5.16.2
Problem
When using https://github.com/aevyrie/bevy_mod_raycast which relies on bevy's Aabb, and I update an entity's mesh, either by (1) changing it's Handle<Mesh>
or (2) updating the mesh itself in the Assets<Mesh>
, the plugin doesn't account for the change in mesh value.
This is because bevy never updates the Aabb
of an entity after the initial spawn of a mesh.
Solution
It is legitimate to expect the Aabb
s would be updated with the meshes or mesh handles of entities (certainly the documentation doesn't mention that). Either this should be documented as expected behavior or the code amended to update Aabb
s based on the current mesh.
Technical solution
It seems the problematic system is bevy_render::view::visibility::calculate_bounds
. ( crates/bevy_render/src/view/visibility/mod.rs
line 112 on 024d984).
#5489 has a few discussions around potential fixes.
Current Workaround
Manually update the Aabb
after updating the mesh.