From f7b02f2a1d7f219cba668d6681b5c2803f294c50 Mon Sep 17 00:00:00 2001 From: Triuman Date: Thu, 10 Aug 2023 09:26:27 +0200 Subject: [PATCH 1/2] fix lock_translations doesn't work both ways --- src/dynamics/rigid_body.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dynamics/rigid_body.rs b/src/dynamics/rigid_body.rs index 97974d9da..060b77773 100644 --- a/src/dynamics/rigid_body.rs +++ b/src/dynamics/rigid_body.rs @@ -255,7 +255,7 @@ impl RigidBody { #[inline] /// Locks or unlocks all the rotations of this rigid-body. pub fn lock_translations(&mut self, locked: bool, wake_up: bool) { - if !self.mprops.flags.contains(LockedAxes::TRANSLATION_LOCKED) { + if locked != self.mprops.flags.contains(LockedAxes::TRANSLATION_LOCKED) { if self.is_dynamic() && wake_up { self.wake_up(true); } From fd0c8d3dc77854dd5f0465d394fc1a948fb17cac Mon Sep 17 00:00:00 2001 From: Triuman Date: Thu, 10 Aug 2023 09:29:11 +0200 Subject: [PATCH 2/2] fix lock_rotations doesn't work both ways --- src/dynamics/rigid_body.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dynamics/rigid_body.rs b/src/dynamics/rigid_body.rs index 060b77773..3228d9bb3 100644 --- a/src/dynamics/rigid_body.rs +++ b/src/dynamics/rigid_body.rs @@ -193,7 +193,7 @@ impl RigidBody { #[inline] /// Locks or unlocks all the rotations of this rigid-body. pub fn lock_rotations(&mut self, locked: bool, wake_up: bool) { - if !self.mprops.flags.contains(LockedAxes::ROTATION_LOCKED) { + if locked != self.mprops.flags.contains(LockedAxes::ROTATION_LOCKED) { if self.is_dynamic() && wake_up { self.wake_up(true); }