From c46f52f45102dee47c4f6839a7f2bfc9c8c13ee9 Mon Sep 17 00:00:00 2001 From: Sébastien Crozet Date: Mon, 30 May 2022 17:48:31 +0200 Subject: Rename JointSet::joints_with to attached_joints --- src/dynamics/joint/impulse_joint/impulse_joint_set.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/dynamics/joint/impulse_joint') 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 { + ) -> 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? -- cgit