Struct heron::rapier_plugin::rapier2d::prelude::RigidBodySet [−]
pub struct RigidBodySet { /* fields omitted */ }
Expand description
A set of rigid bodies that can be handled by a physics pipeline.
Implementations
impl RigidBodySet
impl RigidBodySet
pub fn new() -> RigidBodySet
pub fn new() -> RigidBodySet
Create a new empty set of rigid bodies.
pub fn contains(&self, handle: RigidBodyHandle) -> bool
pub fn contains(&self, handle: RigidBodyHandle) -> bool
Is the given body handle valid?
pub 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.
pub 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.
pub 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.
pub 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.
pub fn get(&self, handle: RigidBodyHandle) -> Option<&RigidBody>
pub fn get(&self, handle: RigidBodyHandle) -> Option<&RigidBody>
Gets the rigid-body with the given handle.
pub 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.
Iterates through all the rigid-bodies on this set.
Trait Implementations
impl Clone for RigidBodySet
impl Clone for RigidBodySet
pub fn clone(&self) -> RigidBodySet
pub fn clone(&self) -> RigidBodySet
Returns a copy of the value. Read more
Performs copy-assignment from source
. Read more
impl ComponentSet<RigidBodyActivation> for RigidBodySet
impl ComponentSet<RigidBodyActivation> for RigidBodySet
impl ComponentSet<RigidBodyCcd> for RigidBodySet
impl ComponentSet<RigidBodyCcd> for RigidBodySet
impl ComponentSet<RigidBodyChanges> for RigidBodySet
impl ComponentSet<RigidBodyChanges> for RigidBodySet
impl ComponentSet<RigidBodyColliders> for RigidBodySet
impl ComponentSet<RigidBodyColliders> for RigidBodySet
impl ComponentSet<RigidBodyDamping> for RigidBodySet
impl ComponentSet<RigidBodyDamping> for RigidBodySet
impl ComponentSet<RigidBodyDominance> for RigidBodySet
impl ComponentSet<RigidBodyDominance> for RigidBodySet
impl ComponentSet<RigidBodyForces> for RigidBodySet
impl ComponentSet<RigidBodyForces> for RigidBodySet
impl ComponentSet<RigidBodyIds> for RigidBodySet
impl ComponentSet<RigidBodyIds> for RigidBodySet
impl ComponentSet<RigidBodyMassProps> for RigidBodySet
impl ComponentSet<RigidBodyMassProps> for RigidBodySet
impl ComponentSet<RigidBodyPosition> for RigidBodySet
impl ComponentSet<RigidBodyPosition> for RigidBodySet
impl ComponentSet<RigidBodyType> for RigidBodySet
impl ComponentSet<RigidBodyType> for RigidBodySet
impl ComponentSet<RigidBodyVelocity> for RigidBodySet
impl ComponentSet<RigidBodyVelocity> for RigidBodySet
impl ComponentSetMut<RigidBodyActivation> for RigidBodySet
impl ComponentSetMut<RigidBodyActivation> for RigidBodySet
pub fn set_internal(&mut self, handle: Index, val: RigidBodyActivation)
pub fn set_internal(&mut self, handle: Index, val: RigidBodyActivation)
Set the value of this element.
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyActivation) -> Result
) -> Option<Result>
pub 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
impl ComponentSetMut<RigidBodyCcd> for RigidBodySet
impl ComponentSetMut<RigidBodyCcd> for RigidBodySet
pub fn set_internal(&mut self, handle: Index, val: RigidBodyCcd)
pub fn set_internal(&mut self, handle: Index, val: RigidBodyCcd)
Set the value of this element.
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyCcd) -> Result
) -> Option<Result>
pub 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
impl ComponentSetMut<RigidBodyChanges> for RigidBodySet
impl ComponentSetMut<RigidBodyChanges> for RigidBodySet
pub fn set_internal(&mut self, handle: Index, val: RigidBodyChanges)
pub fn set_internal(&mut self, handle: Index, val: RigidBodyChanges)
Set the value of this element.
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyChanges) -> Result
) -> Option<Result>
pub 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
impl ComponentSetMut<RigidBodyColliders> for RigidBodySet
impl ComponentSetMut<RigidBodyColliders> for RigidBodySet
pub fn set_internal(&mut self, handle: Index, val: RigidBodyColliders)
pub fn set_internal(&mut self, handle: Index, val: RigidBodyColliders)
Set the value of this element.
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyColliders) -> Result
) -> Option<Result>
pub 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
impl ComponentSetMut<RigidBodyDamping> for RigidBodySet
impl ComponentSetMut<RigidBodyDamping> for RigidBodySet
pub fn set_internal(&mut self, handle: Index, val: RigidBodyDamping)
pub fn set_internal(&mut self, handle: Index, val: RigidBodyDamping)
Set the value of this element.
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyDamping) -> Result
) -> Option<Result>
pub 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
impl ComponentSetMut<RigidBodyDominance> for RigidBodySet
impl ComponentSetMut<RigidBodyDominance> for RigidBodySet
pub fn set_internal(&mut self, handle: Index, val: RigidBodyDominance)
pub fn set_internal(&mut self, handle: Index, val: RigidBodyDominance)
Set the value of this element.
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyDominance) -> Result
) -> Option<Result>
pub 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
impl ComponentSetMut<RigidBodyForces> for RigidBodySet
impl ComponentSetMut<RigidBodyForces> for RigidBodySet
pub fn set_internal(&mut self, handle: Index, val: RigidBodyForces)
pub fn set_internal(&mut self, handle: Index, val: RigidBodyForces)
Set the value of this element.
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyForces) -> Result
) -> Option<Result>
pub 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
impl ComponentSetMut<RigidBodyIds> for RigidBodySet
impl ComponentSetMut<RigidBodyIds> for RigidBodySet
pub fn set_internal(&mut self, handle: Index, val: RigidBodyIds)
pub fn set_internal(&mut self, handle: Index, val: RigidBodyIds)
Set the value of this element.
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyIds) -> Result
) -> Option<Result>
pub 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
impl ComponentSetMut<RigidBodyMassProps> for RigidBodySet
impl ComponentSetMut<RigidBodyMassProps> for RigidBodySet
pub fn set_internal(&mut self, handle: Index, val: RigidBodyMassProps)
pub fn set_internal(&mut self, handle: Index, val: RigidBodyMassProps)
Set the value of this element.
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyMassProps) -> Result
) -> Option<Result>
pub 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
impl ComponentSetMut<RigidBodyPosition> for RigidBodySet
impl ComponentSetMut<RigidBodyPosition> for RigidBodySet
pub fn set_internal(&mut self, handle: Index, val: RigidBodyPosition)
pub fn set_internal(&mut self, handle: Index, val: RigidBodyPosition)
Set the value of this element.
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyPosition) -> Result
) -> Option<Result>
pub 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
impl ComponentSetMut<RigidBodyType> for RigidBodySet
impl ComponentSetMut<RigidBodyType> for RigidBodySet
pub fn set_internal(&mut self, handle: Index, val: RigidBodyType)
pub fn set_internal(&mut self, handle: Index, val: RigidBodyType)
Set the value of this element.
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyType) -> Result
) -> Option<Result>
pub 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
impl ComponentSetMut<RigidBodyVelocity> for RigidBodySet
impl ComponentSetMut<RigidBodyVelocity> for RigidBodySet
pub fn set_internal(&mut self, handle: Index, val: RigidBodyVelocity)
pub fn set_internal(&mut self, handle: Index, val: RigidBodyVelocity)
Set the value of this element.
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut RigidBodyVelocity) -> Result
) -> Option<Result>
pub 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
pub fn get(&self, handle: Index) -> Option<&RigidBodyActivation>
pub fn get(&self, handle: Index) -> Option<&RigidBodyActivation>
Get the element associated to the given handle
, if there is one.
impl ComponentSetOption<RigidBodyCcd> for RigidBodySet
impl ComponentSetOption<RigidBodyCcd> for RigidBodySet
pub fn get(&self, handle: Index) -> Option<&RigidBodyCcd>
pub fn get(&self, handle: Index) -> Option<&RigidBodyCcd>
Get the element associated to the given handle
, if there is one.
impl ComponentSetOption<RigidBodyChanges> for RigidBodySet
impl ComponentSetOption<RigidBodyChanges> for RigidBodySet
pub fn get(&self, handle: Index) -> Option<&RigidBodyChanges>
pub fn get(&self, handle: Index) -> Option<&RigidBodyChanges>
Get the element associated to the given handle
, if there is one.
impl ComponentSetOption<RigidBodyColliders> for RigidBodySet
impl ComponentSetOption<RigidBodyColliders> for RigidBodySet
pub fn get(&self, handle: Index) -> Option<&RigidBodyColliders>
pub fn get(&self, handle: Index) -> Option<&RigidBodyColliders>
Get the element associated to the given handle
, if there is one.
impl ComponentSetOption<RigidBodyDamping> for RigidBodySet
impl ComponentSetOption<RigidBodyDamping> for RigidBodySet
pub fn get(&self, handle: Index) -> Option<&RigidBodyDamping>
pub fn get(&self, handle: Index) -> Option<&RigidBodyDamping>
Get the element associated to the given handle
, if there is one.
impl ComponentSetOption<RigidBodyDominance> for RigidBodySet
impl ComponentSetOption<RigidBodyDominance> for RigidBodySet
pub fn get(&self, handle: Index) -> Option<&RigidBodyDominance>
pub fn get(&self, handle: Index) -> Option<&RigidBodyDominance>
Get the element associated to the given handle
, if there is one.
impl ComponentSetOption<RigidBodyForces> for RigidBodySet
impl ComponentSetOption<RigidBodyForces> for RigidBodySet
pub fn get(&self, handle: Index) -> Option<&RigidBodyForces>
pub fn get(&self, handle: Index) -> Option<&RigidBodyForces>
Get the element associated to the given handle
, if there is one.
impl ComponentSetOption<RigidBodyIds> for RigidBodySet
impl ComponentSetOption<RigidBodyIds> for RigidBodySet
pub fn get(&self, handle: Index) -> Option<&RigidBodyIds>
pub fn get(&self, handle: Index) -> Option<&RigidBodyIds>
Get the element associated to the given handle
, if there is one.
impl ComponentSetOption<RigidBodyMassProps> for RigidBodySet
impl ComponentSetOption<RigidBodyMassProps> for RigidBodySet
pub fn get(&self, handle: Index) -> Option<&RigidBodyMassProps>
pub fn get(&self, handle: Index) -> Option<&RigidBodyMassProps>
Get the element associated to the given handle
, if there is one.
impl ComponentSetOption<RigidBodyPosition> for RigidBodySet
impl ComponentSetOption<RigidBodyPosition> for RigidBodySet
pub fn get(&self, handle: Index) -> Option<&RigidBodyPosition>
pub fn get(&self, handle: Index) -> Option<&RigidBodyPosition>
Get the element associated to the given handle
, if there is one.
impl ComponentSetOption<RigidBodyType> for RigidBodySet
impl ComponentSetOption<RigidBodyType> for RigidBodySet
pub fn get(&self, handle: Index) -> Option<&RigidBodyType>
pub fn get(&self, handle: Index) -> Option<&RigidBodyType>
Get the element associated to the given handle
, if there is one.
impl ComponentSetOption<RigidBodyVelocity> for RigidBodySet
impl ComponentSetOption<RigidBodyVelocity> for RigidBodySet
pub fn get(&self, handle: Index) -> Option<&RigidBodyVelocity>
pub fn get(&self, handle: Index) -> Option<&RigidBodyVelocity>
Get the element associated to the given handle
, if there is one.
impl Index<Index> for RigidBodySet
impl Index<Index> for RigidBodySet
impl Index<RigidBodyHandle> for RigidBodySet
impl Index<RigidBodyHandle> for RigidBodySet
impl IndexMut<RigidBodyHandle> for RigidBodySet
impl IndexMut<RigidBodyHandle> for RigidBodySet
pub fn index_mut(&mut self, handle: RigidBodyHandle) -> &mut RigidBody
pub 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
Mutably borrows from an owned value. Read more
impl<'a, T, A, B, C, D, E, F> BundleSet<'a, (&'a A, &'a B, &'a C, &'a D, &'a E, &'a F)> for T where
T: ComponentSet<A> + ComponentSet<B> + ComponentSet<C> + ComponentSet<D> + ComponentSet<E> + ComponentSet<F>,
impl<'a, T, A, B, C, D, E, F> BundleSet<'a, (&'a A, &'a B, &'a C, &'a D, &'a E, &'a F)> for T where
T: ComponentSet<A> + ComponentSet<B> + ComponentSet<C> + ComponentSet<D> + ComponentSet<E> + ComponentSet<F>,
impl<'a, T, A, B, C, D, E> BundleSet<'a, (&'a A, &'a B, &'a C, &'a D, &'a E)> for T where
T: ComponentSet<A> + ComponentSet<B> + ComponentSet<C> + ComponentSet<D> + ComponentSet<E>,
impl<'a, T, A, B, C, D, E> BundleSet<'a, (&'a A, &'a B, &'a C, &'a D, &'a E)> for T where
T: ComponentSet<A> + ComponentSet<B> + ComponentSet<C> + ComponentSet<D> + ComponentSet<E>,
impl<'a, T, A, B, C, D> BundleSet<'a, (&'a A, &'a B, &'a C, &'a D)> for T where
T: ComponentSet<A> + ComponentSet<B> + ComponentSet<C> + ComponentSet<D>,
impl<'a, T, A, B, C, D> BundleSet<'a, (&'a A, &'a B, &'a C, &'a D)> for T where
T: ComponentSet<A> + ComponentSet<B> + ComponentSet<C> + ComponentSet<D>,
impl<'a, T, A, B, C> BundleSet<'a, (&'a A, &'a B, &'a C)> for T where
T: ComponentSet<A> + ComponentSet<B> + ComponentSet<C>,
impl<'a, T, A, B, C> BundleSet<'a, (&'a A, &'a B, &'a C)> for T where
T: ComponentSet<A> + ComponentSet<B> + ComponentSet<C>,
impl<'a, T, A, B> BundleSet<'a, (&'a A, &'a B)> for T where
T: ComponentSet<A> + ComponentSet<B>,
impl<'a, T, A, B> BundleSet<'a, (&'a A, &'a B)> for T where
T: ComponentSet<A> + ComponentSet<B>,
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
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
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub 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
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub 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
impl<T> Pointable for T
impl<T> Pointable for T
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
pub fn clone_type_data(&self) -> Box<dyn TypeData + 'static, Global>
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more