aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Crozet <developer@crozet.re>2023-09-09 12:58:38 +0200
committerGitHub <noreply@github.com>2023-09-09 12:58:38 +0200
commit7d2111d0b959cb0532eb9ad43a6354ae31970d17 (patch)
tree02d412e8587d9702066e8d45afe617dddd279abd /src
parent04e05d93368f3b1c6ce51019c03e4765c763114b (diff)
parentfd0c8d3dc77854dd5f0465d394fc1a948fb17cac (diff)
downloadrapier-7d2111d0b959cb0532eb9ad43a6354ae31970d17.tar.gz
rapier-7d2111d0b959cb0532eb9ad43a6354ae31970d17.tar.bz2
rapier-7d2111d0b959cb0532eb9ad43a6354ae31970d17.zip
Merge pull request #511 from Triuman/master
fix lock_translations & lock_rotations doesn't work both ways
Diffstat (limited to 'src')
-rw-r--r--src/dynamics/rigid_body.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dynamics/rigid_body.rs b/src/dynamics/rigid_body.rs
index 42e4f88..064087c 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);
}
@@ -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);
}