diff options
| author | Austin J. Garrett <agarrett777@gmail.com> | 2025-01-08 12:03:01 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-08 18:03:01 +0100 |
| commit | 552cfebab06f33290a9593fd3e2f5d835ee0dc72 (patch) | |
| tree | 6b86c26395483e14afd86dc0643c359759dcc43c /src_testbed/graphics.rs | |
| parent | 2ed19347563f2f8b9dabcf4f818805dede148135 (diff) | |
| download | rapier-552cfebab06f33290a9593fd3e2f5d835ee0dc72.tar.gz rapier-552cfebab06f33290a9593fd3e2f5d835ee0dc72.tar.bz2 rapier-552cfebab06f33290a9593fd3e2f5d835ee0dc72.zip | |
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>
Diffstat (limited to 'src_testbed/graphics.rs')
| -rw-r--r-- | src_testbed/graphics.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src_testbed/graphics.rs b/src_testbed/graphics.rs index 076ef29..355f80f 100644 --- a/src_testbed/graphics.rs +++ b/src_testbed/graphics.rs @@ -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 + }); } } |
