fix lock_rotations doesn't work both ways

This commit is contained in:
Triuman
2023-08-10 09:29:11 +02:00
parent f7b02f2a1d
commit fd0c8d3dc7

View File

@@ -193,7 +193,7 @@ impl RigidBody {
#[inline] #[inline]
/// Locks or unlocks all the rotations of this rigid-body. /// Locks or unlocks all the rotations of this rigid-body.
pub fn lock_rotations(&mut self, locked: bool, wake_up: bool) { 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 { if self.is_dynamic() && wake_up {
self.wake_up(true); self.wake_up(true);
} }