diff options
Diffstat (limited to 'src/dynamics/joint/impulse_joint')
| -rw-r--r-- | src/dynamics/joint/impulse_joint/impulse_joint_set.rs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/dynamics/joint/impulse_joint/impulse_joint_set.rs b/src/dynamics/joint/impulse_joint/impulse_joint_set.rs index 1cd177d..0309cff 100644 --- a/src/dynamics/joint/impulse_joint/impulse_joint_set.rs +++ b/src/dynamics/joint/impulse_joint/impulse_joint_set.rs @@ -69,15 +69,23 @@ impl ImpulseJointSet { &self.joint_graph } - /// Iterates through all the impulse_joints attached to the given rigid-body. - pub fn joints_with<'a>( + /// Iterates through all the impulse joints attached to the given rigid-body. + pub fn attached_joints<'a>( &'a self, body: RigidBodyHandle, - ) -> impl Iterator<Item = (RigidBodyHandle, RigidBodyHandle, &'a ImpulseJoint)> { + ) -> impl Iterator< + Item = ( + RigidBodyHandle, + RigidBodyHandle, + ImpulseJointHandle, + &'a ImpulseJoint, + ), + > { self.rb_graph_ids .get(body.0) .into_iter() .flat_map(move |id| self.joint_graph.interactions_with(*id)) + .map(|inter| (inter.0, inter.1, inter.2.handle, inter.2)) } /// Is the given joint handle valid? |
