aboutsummaryrefslogtreecommitdiff
path: root/src/dynamics
diff options
context:
space:
mode:
authorSébastien Crozet <developer@crozet.re>2022-04-28 13:05:00 +0200
committerSébastien Crozet <developer@crozet.re>2022-04-28 13:05:00 +0200
commit8ffb0d1658d448074f5ca2b77aee33f755761e24 (patch)
tree13cf800b8b4e755ec29a4e73a55bee82624a7f15 /src/dynamics
parentfd12d76102884150a40b24ca812fffe35d26d09d (diff)
downloadrapier-8ffb0d1658d448074f5ca2b77aee33f755761e24.tar.gz
rapier-8ffb0d1658d448074f5ca2b77aee33f755761e24.tar.bz2
rapier-8ffb0d1658d448074f5ca2b77aee33f755761e24.zip
Take round shapes into account in 2D debug render
Diffstat (limited to 'src/dynamics')
-rw-r--r--src/dynamics/joint/multibody_joint/multibody_joint_set.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/dynamics/joint/multibody_joint/multibody_joint_set.rs b/src/dynamics/joint/multibody_joint/multibody_joint_set.rs
index 748530f..06dff5d 100644
--- a/src/dynamics/joint/multibody_joint/multibody_joint_set.rs
+++ b/src/dynamics/joint/multibody_joint/multibody_joint_set.rs
@@ -299,10 +299,20 @@ impl MultibodyJointSet {
}
/// Gets a mutable reference to the multibody identified by its `handle`.
+ pub fn get_mut(&mut self, handle: MultibodyJointHandle) -> Option<(&mut Multibody, usize)> {
+ let link = self.rb2mb.get(handle.0)?;
+ let multibody = self.multibodies.get_mut(link.multibody.0)?;
+ Some((multibody, link.id))
+ }
+
+ /// Gets a mutable reference to the multibody identified by its `handle`.
+ ///
+ /// This method will bypass any modification-detection automatically done by the MultibodyJointSet.
pub fn get_mut_internal(
&mut self,
handle: MultibodyJointHandle,
) -> Option<(&mut Multibody, usize)> {
+ // TODO: modification tracking?
let link = self.rb2mb.get(handle.0)?;
let multibody = self.multibodies.get_mut(link.multibody.0)?;
Some((multibody, link.id))