Fix shape modification not updating graphics in testbed (#708)

* Fix shape modification not updating graphics in testbed

* Add update collider to Testbed

* chore: lint shape_modifications3

* chore: simplify GraphicsManager::remove_collider_nodes

---------

Co-authored-by: Sébastien Crozet <sebcrozet@dimforge.com>
This commit is contained in:
Austin J. Garrett
2025-01-08 12:03:01 -05:00
committed by GitHub
parent 2ed1934756
commit 552cfebab0
3 changed files with 52 additions and 11 deletions

View File

@@ -83,13 +83,16 @@ impl GraphicsManager {
) {
let body = body.unwrap_or(RigidBodyHandle::invalid());
if let Some(sns) = self.b2sn.get_mut(&body) {
for sn in sns.iter_mut() {
sns.retain(|sn| {
if let Some(sn_c) = sn.collider {
if sn_c == collider {
commands.entity(sn.entity).despawn();
return false;
}
}
}
true
});
}
}