From d2ebb25c227e239aa283b989cf560bf3739a1c39 Mon Sep 17 00:00:00 2001 From: Sébastien Crozet Date: Sun, 15 Jan 2023 12:23:32 +0100 Subject: Add accessor to get the locked axes of a rigid-body --- src/dynamics/rigid_body.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/dynamics/rigid_body.rs') diff --git a/src/dynamics/rigid_body.rs b/src/dynamics/rigid_body.rs index 78132b2..b850f66 100644 --- a/src/dynamics/rigid_body.rs +++ b/src/dynamics/rigid_body.rs @@ -184,6 +184,12 @@ impl RigidBody { } } + /// The axes along which this rigid-body cannot translate or rotate. + #[inline] + pub fn locked_axes(&self) -> LockedAxes { + self.mprops.flags + } + #[inline] /// Locks or unlocks all the rotations of this rigid-body. pub fn lock_rotations(&mut self, locked: bool, wake_up: bool) { -- cgit From 89fc31f996b43a274337b1632673e6142e1fe621 Mon Sep 17 00:00:00 2001 From: Sébastien Crozet Date: Sun, 15 Jan 2023 12:23:16 +0100 Subject: Give access to the world-space mass properties of rigid-bodies --- src/dynamics/rigid_body.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/dynamics/rigid_body.rs') diff --git a/src/dynamics/rigid_body.rs b/src/dynamics/rigid_body.rs index b850f66..cd1a0dc 100644 --- a/src/dynamics/rigid_body.rs +++ b/src/dynamics/rigid_body.rs @@ -158,8 +158,8 @@ impl RigidBody { /// The mass-properties of this rigid-body. #[inline] - pub fn mass_properties(&self) -> &MassProperties { - &self.mprops.local_mprops + pub fn mass_properties(&self) -> &RigidBodyMassProps { + &self.mprops } /// The dominance group of this rigid-body. -- cgit