diff options
| author | Sébastien Crozet <developer@crozet.re> | 2022-04-28 18:24:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-28 18:24:01 +0200 |
| commit | 488aad0af3f772e14fd85b27bfff6c1db5d23829 (patch) | |
| tree | 4c19f613750fcd8779714915dbb752ce369a4173 /src/dynamics/joint | |
| parent | 21a31bc1026d17d30b3a5ac35e6bb716dc66be6e (diff) | |
| parent | 7dc038aec66783d72abda446d6251385e6ad30f4 (diff) | |
| download | rapier-488aad0af3f772e14fd85b27bfff6c1db5d23829.tar.gz rapier-488aad0af3f772e14fd85b27bfff6c1db5d23829.tar.bz2 rapier-488aad0af3f772e14fd85b27bfff6c1db5d23829.zip | |
Merge pull request #315 from dimforge/debug-renderer
Add a basic lines-based debug-renderer
Diffstat (limited to 'src/dynamics/joint')
| -rw-r--r-- | src/dynamics/joint/multibody_joint/multibody_joint_set.rs | 10 |
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)) |
