From 94829fd8525fd19e3acaefac57b2f62e18b77dec Mon Sep 17 00:00:00 2001 From: Rafal Harabien Date: Wed, 18 Oct 2023 15:08:41 +0200 Subject: [PATCH 1/2] Fix enabling disabled collider If collider was enabled and no other attributes were changed its collisions were not detected. This was the result of `needs_broad_phase_update` function not handling case of changed enabled status. Fixes dimforge/bevy_rapier#435 --- src/geometry/collider_components.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/geometry/collider_components.rs b/src/geometry/collider_components.rs index 98ddbb77b..fb0830985 100644 --- a/src/geometry/collider_components.rs +++ b/src/geometry/collider_components.rs @@ -79,7 +79,7 @@ impl ColliderChanges { /// Do these changes justify a broad-phase update? pub fn needs_broad_phase_update(self) -> bool { self.intersects( - ColliderChanges::PARENT | ColliderChanges::POSITION | ColliderChanges::SHAPE, + ColliderChanges::PARENT | ColliderChanges::POSITION | ColliderChanges::SHAPE | ColliderChanges::ENABLED_OR_DISABLED, ) } From bc287a9895b354c44542852c92465d4d15d5142f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Sun, 29 Oct 2023 18:00:52 +0100 Subject: [PATCH 2/2] cargo fmt --- src/geometry/collider_components.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/geometry/collider_components.rs b/src/geometry/collider_components.rs index fb0830985..b71a7ed99 100644 --- a/src/geometry/collider_components.rs +++ b/src/geometry/collider_components.rs @@ -79,7 +79,10 @@ impl ColliderChanges { /// Do these changes justify a broad-phase update? pub fn needs_broad_phase_update(self) -> bool { self.intersects( - ColliderChanges::PARENT | ColliderChanges::POSITION | ColliderChanges::SHAPE | ColliderChanges::ENABLED_OR_DISABLED, + ColliderChanges::PARENT + | ColliderChanges::POSITION + | ColliderChanges::SHAPE + | ColliderChanges::ENABLED_OR_DISABLED, ) }