Struct rapier3d::dynamics::RigidBodySet
source · [−]pub struct RigidBodySet { /* private fields */ }
Expand description
A set of rigid bodies that can be handled by a physics pipeline.
Implementations
sourceimpl RigidBodySet
impl RigidBodySet
sourcepub fn contains(&self, handle: RigidBodyHandle) -> bool
pub fn contains(&self, handle: RigidBodyHandle) -> bool
Is the given body handle valid?
sourcepub fn insert(&mut self, rb: RigidBody) -> RigidBodyHandle
pub fn insert(&mut self, rb: RigidBody) -> RigidBodyHandle
Insert a rigid body into this set and retrieve its handle.
sourcepub fn remove(
&mut self,
handle: RigidBodyHandle,
islands: &mut IslandManager,
colliders: &mut ColliderSet,
joints: &mut JointSet
) -> Option<RigidBody>
pub fn remove(
&mut self,
handle: RigidBodyHandle,
islands: &mut IslandManager,
colliders: &mut ColliderSet,
joints: &mut JointSet
) -> Option<RigidBody>
Removes a rigid-body, and all its attached colliders and joints, from these sets.
sourcepub fn get_unknown_gen(&self, i: u32) -> Option<(&RigidBody, RigidBodyHandle)>
pub fn get_unknown_gen(&self, i: u32) -> Option<(&RigidBody, RigidBodyHandle)>
Gets the rigid-body with the given handle without a known generation.
This is useful when you know you want the rigid-body at position i
but
don’t know what is its current generation number. Generation numbers are
used to protect from the ABA problem because the rigid-body 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 get_unknown_gen_mut(
&mut self,
i: u32
) -> Option<(&mut RigidBody, RigidBodyHandle)>
pub fn get_unknown_gen_mut(
&mut self,
i: u32
) -> Option<(&mut RigidBody, RigidBodyHandle)>
Gets a mutable reference to the rigid-body with the given handle without a known generation.
This is useful when you know you want the rigid-body at position i
but
don’t know what is its current generation number. Generation numbers are
used to protect from the ABA problem because the rigid-body position i
are recycled between two insertion and a removal.
Using this is discouraged in favor of self.get_mut(handle)
which does not
suffer form the ABA problem.
sourcepub fn get(&self, handle: RigidBodyHandle) -> Option<&RigidBody>
pub fn get(&self, handle: RigidBodyHandle) -> Option<&RigidBody>
Gets the rigid-body with the given handle.
sourcepub fn get_mut(&mut self, handle: RigidBodyHandle) -> Option<&mut RigidBody>
pub fn get_mut(&mut self, handle: RigidBodyHandle) -> Option<&mut RigidBody>
Gets a mutable reference to the rigid-body with the given handle.
Trait Implementations
sourceimpl Clone for RigidBodySet
impl Clone for RigidBodySet
sourcefn clone(&self) -> RigidBodySet
fn clone(&self) -> RigidBodySet
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl ComponentSet<RigidBodyCcd> for RigidBodySet
impl ComponentSet<RigidBodyCcd> for RigidBodySet
sourceimpl ComponentSet<RigidBodyChanges> for RigidBodySet
impl ComponentSet<RigidBodyChanges> for RigidBodySet
sourceimpl ComponentSet<RigidBodyColliders> for RigidBodySet
impl ComponentSet<RigidBodyColliders> for RigidBodySet
sourceimpl ComponentSet<RigidBodyDamping> for RigidBodySet
impl ComponentSet<RigidBodyDamping> for RigidBodySet
sourceimpl ComponentSet<RigidBodyDominance> for RigidBodySet
impl ComponentSet<RigidBodyDominance> for RigidBodySet
sourceimpl ComponentSet<RigidBodyForces> for RigidBodySet
impl ComponentSet<RigidBodyForces> for RigidBodySet
sourceimpl ComponentSet<RigidBodyIds> for RigidBodySet
impl ComponentSet<RigidBodyIds> for RigidBodySet
sourceimpl ComponentSet<RigidBodyMassProps> for RigidBodySet
impl ComponentSet<RigidBodyMassProps> for RigidBodySet
sourceimpl ComponentSet<RigidBodyPosition> for RigidBodySet
impl ComponentSet<RigidBodyPosition> for RigidBodySet
sourceimpl ComponentSet<RigidBodyType> for RigidBodySet
impl ComponentSet<RigidBodyType> for RigidBodySet
sourceimpl ComponentSet<RigidBodyVelocity> for RigidBodySet
impl ComponentSet<RigidBodyVelocity> for RigidBodySet
sourceimpl ComponentSetMut<RigidBodyActivation> for RigidBodySet
impl ComponentSetMut<RigidBodyActivation> for RigidBodySet
sourcefn set_internal(&mut self, handle: Index, val: RigidBodyActivation)
fn set_internal(&mut self, handle: Index, val: RigidBodyActivation)
Set the value of this element.
sourcefn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyActivation) -> Result
) -> Option<Result>
fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyActivation) -> Result
) -> Option<Result>
Applies the given closure to the element associated to the given handle
. Read more
sourceimpl ComponentSetMut<RigidBodyCcd> for RigidBodySet
impl ComponentSetMut<RigidBodyCcd> for RigidBodySet
sourcefn set_internal(&mut self, handle: Index, val: RigidBodyCcd)
fn set_internal(&mut self, handle: Index, val: RigidBodyCcd)
Set the value of this element.
sourcefn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyCcd) -> Result
) -> Option<Result>
fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyCcd) -> Result
) -> Option<Result>
Applies the given closure to the element associated to the given handle
. Read more
sourceimpl ComponentSetMut<RigidBodyChanges> for RigidBodySet
impl ComponentSetMut<RigidBodyChanges> for RigidBodySet
sourcefn set_internal(&mut self, handle: Index, val: RigidBodyChanges)
fn set_internal(&mut self, handle: Index, val: RigidBodyChanges)
Set the value of this element.
sourcefn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyChanges) -> Result
) -> Option<Result>
fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyChanges) -> Result
) -> Option<Result>
Applies the given closure to the element associated to the given handle
. Read more
sourceimpl ComponentSetMut<RigidBodyColliders> for RigidBodySet
impl ComponentSetMut<RigidBodyColliders> for RigidBodySet
sourcefn set_internal(&mut self, handle: Index, val: RigidBodyColliders)
fn set_internal(&mut self, handle: Index, val: RigidBodyColliders)
Set the value of this element.
sourcefn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyColliders) -> Result
) -> Option<Result>
fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyColliders) -> Result
) -> Option<Result>
Applies the given closure to the element associated to the given handle
. Read more
sourceimpl ComponentSetMut<RigidBodyDamping> for RigidBodySet
impl ComponentSetMut<RigidBodyDamping> for RigidBodySet
sourcefn set_internal(&mut self, handle: Index, val: RigidBodyDamping)
fn set_internal(&mut self, handle: Index, val: RigidBodyDamping)
Set the value of this element.
sourcefn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyDamping) -> Result
) -> Option<Result>
fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyDamping) -> Result
) -> Option<Result>
Applies the given closure to the element associated to the given handle
. Read more
sourceimpl ComponentSetMut<RigidBodyDominance> for RigidBodySet
impl ComponentSetMut<RigidBodyDominance> for RigidBodySet
sourcefn set_internal(&mut self, handle: Index, val: RigidBodyDominance)
fn set_internal(&mut self, handle: Index, val: RigidBodyDominance)
Set the value of this element.
sourcefn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyDominance) -> Result
) -> Option<Result>
fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyDominance) -> Result
) -> Option<Result>
Applies the given closure to the element associated to the given handle
. Read more
sourceimpl ComponentSetMut<RigidBodyForces> for RigidBodySet
impl ComponentSetMut<RigidBodyForces> for RigidBodySet
sourcefn set_internal(&mut self, handle: Index, val: RigidBodyForces)
fn set_internal(&mut self, handle: Index, val: RigidBodyForces)
Set the value of this element.
sourcefn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyForces) -> Result
) -> Option<Result>
fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyForces) -> Result
) -> Option<Result>
Applies the given closure to the element associated to the given handle
. Read more
sourceimpl ComponentSetMut<RigidBodyIds> for RigidBodySet
impl ComponentSetMut<RigidBodyIds> for RigidBodySet
sourcefn set_internal(&mut self, handle: Index, val: RigidBodyIds)
fn set_internal(&mut self, handle: Index, val: RigidBodyIds)
Set the value of this element.
sourcefn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyIds) -> Result
) -> Option<Result>
fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyIds) -> Result
) -> Option<Result>
Applies the given closure to the element associated to the given handle
. Read more
sourceimpl ComponentSetMut<RigidBodyMassProps> for RigidBodySet
impl ComponentSetMut<RigidBodyMassProps> for RigidBodySet
sourcefn set_internal(&mut self, handle: Index, val: RigidBodyMassProps)
fn set_internal(&mut self, handle: Index, val: RigidBodyMassProps)
Set the value of this element.
sourcefn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyMassProps) -> Result
) -> Option<Result>
fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyMassProps) -> Result
) -> Option<Result>
Applies the given closure to the element associated to the given handle
. Read more
sourceimpl ComponentSetMut<RigidBodyPosition> for RigidBodySet
impl ComponentSetMut<RigidBodyPosition> for RigidBodySet
sourcefn set_internal(&mut self, handle: Index, val: RigidBodyPosition)
fn set_internal(&mut self, handle: Index, val: RigidBodyPosition)
Set the value of this element.
sourcefn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyPosition) -> Result
) -> Option<Result>
fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyPosition) -> Result
) -> Option<Result>
Applies the given closure to the element associated to the given handle
. Read more
sourceimpl ComponentSetMut<RigidBodyType> for RigidBodySet
impl ComponentSetMut<RigidBodyType> for RigidBodySet
sourcefn set_internal(&mut self, handle: Index, val: RigidBodyType)
fn set_internal(&mut self, handle: Index, val: RigidBodyType)
Set the value of this element.
sourcefn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyType) -> Result
) -> Option<Result>
fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyType) -> Result
) -> Option<Result>
Applies the given closure to the element associated to the given handle
. Read more
sourceimpl ComponentSetMut<RigidBodyVelocity> for RigidBodySet
impl ComponentSetMut<RigidBodyVelocity> for RigidBodySet
sourcefn set_internal(&mut self, handle: Index, val: RigidBodyVelocity)
fn set_internal(&mut self, handle: Index, val: RigidBodyVelocity)
Set the value of this element.
sourcefn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyVelocity) -> Result
) -> Option<Result>
fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyVelocity) -> Result
) -> Option<Result>
Applies the given closure to the element associated to the given handle
. Read more
sourceimpl ComponentSetOption<RigidBodyActivation> for RigidBodySet
impl ComponentSetOption<RigidBodyActivation> for RigidBodySet
sourcefn get(&self, handle: Index) -> Option<&RigidBodyActivation>
fn get(&self, handle: Index) -> Option<&RigidBodyActivation>
Get the element associated to the given handle
, if there is one.
sourceimpl ComponentSetOption<RigidBodyCcd> for RigidBodySet
impl ComponentSetOption<RigidBodyCcd> for RigidBodySet
sourcefn get(&self, handle: Index) -> Option<&RigidBodyCcd>
fn get(&self, handle: Index) -> Option<&RigidBodyCcd>
Get the element associated to the given handle
, if there is one.
sourceimpl ComponentSetOption<RigidBodyChanges> for RigidBodySet
impl ComponentSetOption<RigidBodyChanges> for RigidBodySet
sourcefn get(&self, handle: Index) -> Option<&RigidBodyChanges>
fn get(&self, handle: Index) -> Option<&RigidBodyChanges>
Get the element associated to the given handle
, if there is one.
sourceimpl ComponentSetOption<RigidBodyColliders> for RigidBodySet
impl ComponentSetOption<RigidBodyColliders> for RigidBodySet
sourcefn get(&self, handle: Index) -> Option<&RigidBodyColliders>
fn get(&self, handle: Index) -> Option<&RigidBodyColliders>
Get the element associated to the given handle
, if there is one.
sourceimpl ComponentSetOption<RigidBodyDamping> for RigidBodySet
impl ComponentSetOption<RigidBodyDamping> for RigidBodySet
sourcefn get(&self, handle: Index) -> Option<&RigidBodyDamping>
fn get(&self, handle: Index) -> Option<&RigidBodyDamping>
Get the element associated to the given handle
, if there is one.
sourceimpl ComponentSetOption<RigidBodyDominance> for RigidBodySet
impl ComponentSetOption<RigidBodyDominance> for RigidBodySet
sourcefn get(&self, handle: Index) -> Option<&RigidBodyDominance>
fn get(&self, handle: Index) -> Option<&RigidBodyDominance>
Get the element associated to the given handle
, if there is one.
sourceimpl ComponentSetOption<RigidBodyForces> for RigidBodySet
impl ComponentSetOption<RigidBodyForces> for RigidBodySet
sourcefn get(&self, handle: Index) -> Option<&RigidBodyForces>
fn get(&self, handle: Index) -> Option<&RigidBodyForces>
Get the element associated to the given handle
, if there is one.
sourceimpl ComponentSetOption<RigidBodyIds> for RigidBodySet
impl ComponentSetOption<RigidBodyIds> for RigidBodySet
sourcefn get(&self, handle: Index) -> Option<&RigidBodyIds>
fn get(&self, handle: Index) -> Option<&RigidBodyIds>
Get the element associated to the given handle
, if there is one.
sourceimpl ComponentSetOption<RigidBodyMassProps> for RigidBodySet
impl ComponentSetOption<RigidBodyMassProps> for RigidBodySet
sourcefn get(&self, handle: Index) -> Option<&RigidBodyMassProps>
fn get(&self, handle: Index) -> Option<&RigidBodyMassProps>
Get the element associated to the given handle
, if there is one.
sourceimpl ComponentSetOption<RigidBodyPosition> for RigidBodySet
impl ComponentSetOption<RigidBodyPosition> for RigidBodySet
sourcefn get(&self, handle: Index) -> Option<&RigidBodyPosition>
fn get(&self, handle: Index) -> Option<&RigidBodyPosition>
Get the element associated to the given handle
, if there is one.
sourceimpl ComponentSetOption<RigidBodyType> for RigidBodySet
impl ComponentSetOption<RigidBodyType> for RigidBodySet
sourcefn get(&self, handle: Index) -> Option<&RigidBodyType>
fn get(&self, handle: Index) -> Option<&RigidBodyType>
Get the element associated to the given handle
, if there is one.
sourceimpl ComponentSetOption<RigidBodyVelocity> for RigidBodySet
impl ComponentSetOption<RigidBodyVelocity> for RigidBodySet
sourcefn get(&self, handle: Index) -> Option<&RigidBodyVelocity>
fn get(&self, handle: Index) -> Option<&RigidBodyVelocity>
Get the element associated to the given handle
, if there is one.
sourceimpl Index<Index> for RigidBodySet
impl Index<Index> for RigidBodySet
sourceimpl Index<RigidBodyHandle> for RigidBodySet
impl Index<RigidBodyHandle> for RigidBodySet
sourceimpl IndexMut<RigidBodyHandle> for RigidBodySet
impl IndexMut<RigidBodyHandle> for RigidBodySet
sourcefn index_mut(&mut self, handle: RigidBodyHandle) -> &mut RigidBody
fn index_mut(&mut self, handle: RigidBodyHandle) -> &mut RigidBody
Performs the mutable indexing (container[index]
) operation. Read more
Auto Trait Implementations
impl RefUnwindSafe for RigidBodySet
impl Send for RigidBodySet
impl Sync for RigidBodySet
impl Unpin for RigidBodySet
impl UnwindSafe for RigidBodySet
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert 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
. Read more
sourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
sourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
sourceimpl<T> DowncastSync for T where
T: Any + Send + Sync,
impl<T> DowncastSync for T where
T: Any + Send + Sync,
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
sourcefn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
sourcefn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
sourcefn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
sourcefn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more