pub struct MultibodyJointSet { /* private fields */ }
Expand description
A set of rigid bodies that can be handled by a physics pipeline.
Implementations§
Source§impl MultibodyJointSet
impl MultibodyJointSet
Sourcepub fn iter(
&self,
) -> impl Iterator<Item = (MultibodyJointHandle, &MultibodyLinkId, &Multibody, &MultibodyLink)>
pub fn iter( &self, ) -> impl Iterator<Item = (MultibodyJointHandle, &MultibodyLinkId, &Multibody, &MultibodyLink)>
Iterates through all the multibody joints from this set.
Sourcepub fn insert_kinematic(
&mut self,
body1: RigidBodyHandle,
body2: RigidBodyHandle,
data: impl Into<GenericJoint>,
wake_up: bool,
) -> Option<MultibodyJointHandle>
pub fn insert_kinematic( &mut self, body1: RigidBodyHandle, body2: RigidBodyHandle, data: impl Into<GenericJoint>, wake_up: bool, ) -> Option<MultibodyJointHandle>
Inserts a new kinematic multibody joint into this set.
Sourcepub fn insert(
&mut self,
body1: RigidBodyHandle,
body2: RigidBodyHandle,
data: impl Into<GenericJoint>,
wake_up: bool,
) -> Option<MultibodyJointHandle>
pub fn insert( &mut self, body1: RigidBodyHandle, body2: RigidBodyHandle, data: impl Into<GenericJoint>, wake_up: bool, ) -> Option<MultibodyJointHandle>
Inserts a new multibody joint into this set.
Sourcepub fn remove(&mut self, handle: MultibodyJointHandle, wake_up: bool)
pub fn remove(&mut self, handle: MultibodyJointHandle, wake_up: bool)
Removes a multibody_joint from this set.
Sourcepub fn remove_multibody_articulations(
&mut self,
handle: RigidBodyHandle,
wake_up: bool,
)
pub fn remove_multibody_articulations( &mut self, handle: RigidBodyHandle, wake_up: bool, )
Removes all the multibody_joints from the multibody the given rigid-body is part of.
Sourcepub fn remove_joints_attached_to_rigid_body(
&mut self,
rb_to_remove: RigidBodyHandle,
)
pub fn remove_joints_attached_to_rigid_body( &mut self, rb_to_remove: RigidBodyHandle, )
Removes all the multibody joints attached to a rigid-body.
Sourcepub fn rigid_body_link(&self, rb: RigidBodyHandle) -> Option<&MultibodyLinkId>
pub fn rigid_body_link(&self, rb: RigidBodyHandle) -> Option<&MultibodyLinkId>
Returns the link of this multibody attached to the given rigid-body.
Returns None
if rb
isn’t part of any rigid-body.
Sourcepub fn get_multibody(&self, index: MultibodyIndex) -> Option<&Multibody>
pub fn get_multibody(&self, index: MultibodyIndex) -> Option<&Multibody>
Gets a reference to a multibody, based on its temporary index.
Sourcepub fn get_multibody_mut(
&mut self,
index: MultibodyIndex,
) -> Option<&mut Multibody>
pub fn get_multibody_mut( &mut self, index: MultibodyIndex, ) -> Option<&mut Multibody>
Gets a mutable reference to a multibody, based on its temporary index.
MultibodyJointSet
.
Sourcepub fn get_multibody_mut_internal(
&mut self,
index: MultibodyIndex,
) -> Option<&mut Multibody>
pub fn get_multibody_mut_internal( &mut self, index: MultibodyIndex, ) -> Option<&mut Multibody>
Gets a mutable reference to a multibody, based on its temporary index.
This method will bypass any modification-detection automatically done by the
MultibodyJointSet
.
Sourcepub fn get(&self, handle: MultibodyJointHandle) -> Option<(&Multibody, usize)>
pub fn get(&self, handle: MultibodyJointHandle) -> Option<(&Multibody, usize)>
Gets a reference to the multibody identified by its handle
.
Sourcepub fn get_mut(
&mut self,
handle: MultibodyJointHandle,
) -> Option<(&mut Multibody, usize)>
pub fn get_mut( &mut self, handle: MultibodyJointHandle, ) -> Option<(&mut Multibody, usize)>
Gets a mutable reference to the multibody identified by its handle
.
Sourcepub fn get_mut_internal(
&mut self,
handle: MultibodyJointHandle,
) -> Option<(&mut Multibody, usize)>
pub fn get_mut_internal( &mut self, handle: MultibodyJointHandle, ) -> Option<(&mut Multibody, usize)>
Gets a mutable reference to the multibody identified by its handle
.
This method will bypass any modification-detection automatically done by the MultibodyJointSet.
Sourcepub fn get_unknown_gen(
&self,
i: u32,
) -> Option<(&Multibody, usize, MultibodyJointHandle)>
pub fn get_unknown_gen( &self, i: u32, ) -> Option<(&Multibody, usize, MultibodyJointHandle)>
Gets the joint with the given handle without a known generation.
This is useful when you know you want the joint at index i
but
don’t know what is its current generation number. Generation numbers are
used to protect from the ABA problem because the joint position i
are recycled between two insertion and a removal.
Using this is discouraged in favor of self.get(handle)
which does not
suffer form the ABA problem.
Sourcepub fn joint_between(
&self,
rb1: RigidBodyHandle,
rb2: RigidBodyHandle,
) -> Option<(MultibodyJointHandle, &Multibody, &MultibodyLink)>
pub fn joint_between( &self, rb1: RigidBodyHandle, rb2: RigidBodyHandle, ) -> Option<(MultibodyJointHandle, &Multibody, &MultibodyLink)>
Returns the joint between two rigid-bodies (if it exists).
Sourcepub fn attached_joints(
&self,
rb: RigidBodyHandle,
) -> impl Iterator<Item = (RigidBodyHandle, RigidBodyHandle, MultibodyJointHandle)> + '_
pub fn attached_joints( &self, rb: RigidBodyHandle, ) -> impl Iterator<Item = (RigidBodyHandle, RigidBodyHandle, MultibodyJointHandle)> + '_
Iterates through all the joints attached to the given rigid-body.
Sourcepub fn attached_bodies(
&self,
body: RigidBodyHandle,
) -> impl Iterator<Item = RigidBodyHandle> + '_
pub fn attached_bodies( &self, body: RigidBodyHandle, ) -> impl Iterator<Item = RigidBodyHandle> + '_
Iterate through the handles of all the rigid-bodies attached to this rigid-body by a multibody_joint.
Sourcepub fn bodies_attached_with_enabled_joint(
&self,
body: RigidBodyHandle,
) -> impl Iterator<Item = RigidBodyHandle> + '_
pub fn bodies_attached_with_enabled_joint( &self, body: RigidBodyHandle, ) -> impl Iterator<Item = RigidBodyHandle> + '_
Iterate through the handles of all the rigid-bodies attached to this rigid-body by an enabled multibody_joint.
Sourcepub fn multibodies(&self) -> impl Iterator<Item = &Multibody>
pub fn multibodies(&self) -> impl Iterator<Item = &Multibody>
Iterates through all the multibodies on this set.
Trait Implementations§
Source§impl Clone for MultibodyJointSet
impl Clone for MultibodyJointSet
Source§fn clone(&self) -> MultibodyJointSet
fn clone(&self) -> MultibodyJointSet
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for MultibodyJointSet
impl Debug for MultibodyJointSet
Source§impl Default for MultibodyJointSet
impl Default for MultibodyJointSet
Source§fn default() -> MultibodyJointSet
fn default() -> MultibodyJointSet
Source§impl Index<MultibodyIndex> for MultibodyJointSet
impl Index<MultibodyIndex> for MultibodyJointSet
Auto Trait Implementations§
impl Freeze for MultibodyJointSet
impl RefUnwindSafe for MultibodyJointSet
impl Send for MultibodyJointSet
impl Sync for MultibodyJointSet
impl Unpin for MultibodyJointSet
impl UnwindSafe for MultibodyJointSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.