Trait nphysics3d::joint::JointConstraintSet [−][src]
pub trait JointConstraintSet<N: RealField + Copy, Handle: BodyHandle> { type JointConstraint: ?Sized + JointConstraint<N, Handle>; type Handle: Copy; fn get(&self, handle: Self::Handle) -> Option<&Self::JointConstraint>; fn get_mut(
&mut self,
handle: Self::Handle
) -> Option<&mut Self::JointConstraint>; fn contains(&self, handle: Self::Handle) -> bool; fn foreach(&self, f: impl FnMut(Self::Handle, &Self::JointConstraint)); fn foreach_mut(
&mut self,
f: impl FnMut(Self::Handle, &mut Self::JointConstraint)
); fn pop_insertion_event(
&mut self
) -> Option<(Self::Handle, BodyPartHandle<Handle>, BodyPartHandle<Handle>)>; fn pop_removal_event(
&mut self
) -> Option<(Self::Handle, BodyPartHandle<Handle>, BodyPartHandle<Handle>)>; fn remove(&mut self, to_remove: Self::Handle); }
Expand description
Trait implemented by sets of constraint-based joints.
A set of constraint-based joints maps a joint handle to a joint instance. In addition, it must maintain a set of
joint handle of joints that have been inserted removed (see the pop_insertion_event
and pop_removal_event
methods for details).
Associated Types
type JointConstraint: ?Sized + JointConstraint<N, Handle>
type JointConstraint: ?Sized + JointConstraint<N, Handle>
Type of a constraint-based joints stored in this set.
Required methods
fn get(&self, handle: Self::Handle) -> Option<&Self::JointConstraint>
fn get(&self, handle: Self::Handle) -> Option<&Self::JointConstraint>
Gets a reference to the joint identified by handle
.
fn get_mut(
&mut self,
handle: Self::Handle
) -> Option<&mut Self::JointConstraint>
fn get_mut(
&mut self,
handle: Self::Handle
) -> Option<&mut Self::JointConstraint>
Gets a mutable reference to the joint identified by handle
.
Check if this set contains a joint identified by handle
.
fn foreach(&self, f: impl FnMut(Self::Handle, &Self::JointConstraint))
fn foreach(&self, f: impl FnMut(Self::Handle, &Self::JointConstraint))
Iterate through all the bodies on this set, applying the closure f
on them.
fn foreach_mut(
&mut self,
f: impl FnMut(Self::Handle, &mut Self::JointConstraint)
)
fn foreach_mut(
&mut self,
f: impl FnMut(Self::Handle, &mut Self::JointConstraint)
)
Mutable iterates through all the bodies on this set, applying the closure f
on them.
fn pop_insertion_event(
&mut self
) -> Option<(Self::Handle, BodyPartHandle<Handle>, BodyPartHandle<Handle>)>
fn pop_insertion_event(
&mut self
) -> Option<(Self::Handle, BodyPartHandle<Handle>, BodyPartHandle<Handle>)>
Gets the handle of one joint that has been inserted.
A joint set must keep track (using typically a stack or a queue) of every joint that has been inserted into it. This is used by nphysics to perform some internal setup actions, or physical actions like waking bodies attached to this joint.
This method should return a removed joint handle only once.
fn pop_removal_event(
&mut self
) -> Option<(Self::Handle, BodyPartHandle<Handle>, BodyPartHandle<Handle>)>
fn pop_removal_event(
&mut self
) -> Option<(Self::Handle, BodyPartHandle<Handle>, BodyPartHandle<Handle>)>
Gets the handle of one joint that has been removed.
A joint set must keep track (using typically a stack or a queue) of every joint that has been removed from it. This is used by nphysics to perform some internal cleanup actions, or physical actions like waking bodies that were attached to this joint.