bevy_mod_raycast icon indicating copy to clipboard operation
bevy_mod_raycast copied to clipboard

Mesh collisions are not updated after mutating an entity's mesh

Open nicopap opened this issue 3 years ago • 0 comments

bevy_mod_raycast version: 0.3 Bevy version: 0.6 OS & graphic stack: ArchLinux kernel 5.16.2

Problem

This is a copy of an upstream bug reported in bevyengine/bevy#4294.

When 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.

Current Workaround

As a user of this library, manually update the Aabb after updating the mesh, by setting the Aabb component of you rmesh entity to the result of the Mesh::compute_aabb method.

nicopap avatar Mar 23 '22 10:03 nicopap