Struct heron::rapier_plugin::rapier3d::geometry::ColliderSet [−]
pub struct ColliderSet { /* fields omitted */ }
Expand description
A set of colliders that can be handled by a physics World
.
Implementations
impl ColliderSet
impl ColliderSet
pub fn new() -> ColliderSet
pub fn new() -> ColliderSet
Create a new empty set of colliders.
pub fn invalid_handle() -> ColliderHandle
pub fn invalid_handle() -> ColliderHandle
An always-invalid collider handle.
pub fn iter(&self) -> impl ExactSizeIterator
pub fn iter(&self) -> impl ExactSizeIterator
Iterate through all the colliders on this set.
Iterates mutably through all the colliders on this set.
pub fn contains(&self, handle: ColliderHandle) -> bool
pub fn contains(&self, handle: ColliderHandle) -> bool
Is this collider handle valid?
pub fn insert(&mut self, coll: Collider) -> ColliderHandle
pub fn insert(&mut self, coll: Collider) -> ColliderHandle
Inserts a new collider to this set and retrieve its handle.
pub fn insert_with_parent(
&mut self,
coll: Collider,
parent_handle: RigidBodyHandle,
bodies: &mut RigidBodySet
) -> ColliderHandle
pub fn insert_with_parent(
&mut self,
coll: Collider,
parent_handle: RigidBodyHandle,
bodies: &mut RigidBodySet
) -> ColliderHandle
Inserts a new collider to this set, attach it to the given rigid-body, and retrieve its handle.
pub fn remove(
&mut self,
handle: ColliderHandle,
islands: &mut IslandManager,
bodies: &mut RigidBodySet,
wake_up: bool
) -> Option<Collider>
pub fn remove(
&mut self,
handle: ColliderHandle,
islands: &mut IslandManager,
bodies: &mut RigidBodySet,
wake_up: bool
) -> Option<Collider>
Remove a collider from this set and update its parent accordingly.
If wake_up
is true
, the rigid-body the removed collider is attached to
will be woken up.
pub fn get_unknown_gen(&self, i: u32) -> Option<(&Collider, ColliderHandle)>
pub fn get_unknown_gen(&self, i: u32) -> Option<(&Collider, ColliderHandle)>
Gets the collider with the given handle without a known generation.
This is useful when you know you want the collider 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 collider 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 Collider, ColliderHandle)>
pub fn get_unknown_gen_mut(
&mut self,
i: u32
) -> Option<(&mut Collider, ColliderHandle)>
Gets a mutable reference to the collider with the given handle without a known generation.
This is useful when you know you want the collider 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 collider 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: ColliderHandle) -> Option<&Collider>
pub fn get(&self, handle: ColliderHandle) -> Option<&Collider>
Get the collider with the given handle.
pub fn get_mut(&mut self, handle: ColliderHandle) -> Option<&mut Collider>
pub fn get_mut(&mut self, handle: ColliderHandle) -> Option<&mut Collider>
Gets a mutable reference to the collider with the given handle.
Trait Implementations
impl Clone for ColliderSet
impl Clone for ColliderSet
pub fn clone(&self) -> ColliderSet
pub fn clone(&self) -> ColliderSet
Returns a copy of the value. Read more
Performs copy-assignment from source
. Read more
impl ComponentSet<ColliderBroadPhaseData> for ColliderSet
impl ComponentSet<ColliderBroadPhaseData> for ColliderSet
impl ComponentSet<ColliderChanges> for ColliderSet
impl ComponentSet<ColliderChanges> for ColliderSet
impl ComponentSet<ColliderFlags> for ColliderSet
impl ComponentSet<ColliderFlags> for ColliderSet
impl ComponentSet<ColliderMassProps> for ColliderSet
impl ComponentSet<ColliderMassProps> for ColliderSet
impl ComponentSet<ColliderMaterial> for ColliderSet
impl ComponentSet<ColliderMaterial> for ColliderSet
impl ComponentSet<ColliderPosition> for ColliderSet
impl ComponentSet<ColliderPosition> for ColliderSet
impl ComponentSet<ColliderType> for ColliderSet
impl ComponentSet<ColliderType> for ColliderSet
impl ComponentSetMut<ColliderBroadPhaseData> for ColliderSet
impl ComponentSetMut<ColliderBroadPhaseData> for ColliderSet
pub fn set_internal(&mut self, handle: Index, val: ColliderBroadPhaseData)
pub fn set_internal(&mut self, handle: Index, val: ColliderBroadPhaseData)
Set the value of this element.
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut ColliderBroadPhaseData) -> Result
) -> Option<Result>
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut ColliderBroadPhaseData) -> Result
) -> Option<Result>
Applies the given closure to the element associated to the given handle
. Read more
impl ComponentSetMut<ColliderChanges> for ColliderSet
impl ComponentSetMut<ColliderChanges> for ColliderSet
pub fn set_internal(&mut self, handle: Index, val: ColliderChanges)
pub fn set_internal(&mut self, handle: Index, val: ColliderChanges)
Set the value of this element.
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut ColliderChanges) -> Result
) -> Option<Result>
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut ColliderChanges) -> Result
) -> Option<Result>
Applies the given closure to the element associated to the given handle
. Read more
impl ComponentSetMut<ColliderFlags> for ColliderSet
impl ComponentSetMut<ColliderFlags> for ColliderSet
pub fn set_internal(&mut self, handle: Index, val: ColliderFlags)
pub fn set_internal(&mut self, handle: Index, val: ColliderFlags)
Set the value of this element.
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut ColliderFlags) -> Result
) -> Option<Result>
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut ColliderFlags) -> Result
) -> Option<Result>
Applies the given closure to the element associated to the given handle
. Read more
impl ComponentSetMut<ColliderMassProps> for ColliderSet
impl ComponentSetMut<ColliderMassProps> for ColliderSet
pub fn set_internal(&mut self, handle: Index, val: ColliderMassProps)
pub fn set_internal(&mut self, handle: Index, val: ColliderMassProps)
Set the value of this element.
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut ColliderMassProps) -> Result
) -> Option<Result>
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut ColliderMassProps) -> Result
) -> Option<Result>
Applies the given closure to the element associated to the given handle
. Read more
impl ComponentSetMut<ColliderMaterial> for ColliderSet
impl ComponentSetMut<ColliderMaterial> for ColliderSet
pub fn set_internal(&mut self, handle: Index, val: ColliderMaterial)
pub fn set_internal(&mut self, handle: Index, val: ColliderMaterial)
Set the value of this element.
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut ColliderMaterial) -> Result
) -> Option<Result>
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut ColliderMaterial) -> Result
) -> Option<Result>
Applies the given closure to the element associated to the given handle
. Read more
impl ComponentSetMut<ColliderPosition> for ColliderSet
impl ComponentSetMut<ColliderPosition> for ColliderSet
pub fn set_internal(&mut self, handle: Index, val: ColliderPosition)
pub fn set_internal(&mut self, handle: Index, val: ColliderPosition)
Set the value of this element.
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut ColliderPosition) -> Result
) -> Option<Result>
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut ColliderPosition) -> Result
) -> Option<Result>
Applies the given closure to the element associated to the given handle
. Read more
impl ComponentSetMut<ColliderType> for ColliderSet
impl ComponentSetMut<ColliderType> for ColliderSet
pub fn set_internal(&mut self, handle: Index, val: ColliderType)
pub fn set_internal(&mut self, handle: Index, val: ColliderType)
Set the value of this element.
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut ColliderType) -> Result
) -> Option<Result>
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut ColliderType) -> Result
) -> Option<Result>
Applies the given closure to the element associated to the given handle
. Read more
pub fn set_internal(&mut self, handle: Index, val: SharedShape)
pub fn set_internal(&mut self, handle: Index, val: SharedShape)
Set the value of this element.
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut SharedShape) -> Result
) -> Option<Result>
pub fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut SharedShape) -> Result
) -> Option<Result>
Applies the given closure to the element associated to the given handle
. Read more
pub fn get(&self, handle: Index) -> Option<&ColliderBroadPhaseData>
pub fn get(&self, handle: Index) -> Option<&ColliderBroadPhaseData>
Get the element associated to the given handle
, if there is one.
impl ComponentSetOption<ColliderChanges> for ColliderSet
impl ComponentSetOption<ColliderChanges> for ColliderSet
pub fn get(&self, handle: Index) -> Option<&ColliderChanges>
pub fn get(&self, handle: Index) -> Option<&ColliderChanges>
Get the element associated to the given handle
, if there is one.
impl ComponentSetOption<ColliderFlags> for ColliderSet
impl ComponentSetOption<ColliderFlags> for ColliderSet
pub fn get(&self, handle: Index) -> Option<&ColliderFlags>
pub fn get(&self, handle: Index) -> Option<&ColliderFlags>
Get the element associated to the given handle
, if there is one.
impl ComponentSetOption<ColliderMassProps> for ColliderSet
impl ComponentSetOption<ColliderMassProps> for ColliderSet
pub fn get(&self, handle: Index) -> Option<&ColliderMassProps>
pub fn get(&self, handle: Index) -> Option<&ColliderMassProps>
Get the element associated to the given handle
, if there is one.
impl ComponentSetOption<ColliderMaterial> for ColliderSet
impl ComponentSetOption<ColliderMaterial> for ColliderSet
pub fn get(&self, handle: Index) -> Option<&ColliderMaterial>
pub fn get(&self, handle: Index) -> Option<&ColliderMaterial>
Get the element associated to the given handle
, if there is one.
impl ComponentSetOption<ColliderParent> for ColliderSet
impl ComponentSetOption<ColliderParent> for ColliderSet
pub fn get(&self, handle: Index) -> Option<&ColliderParent>
pub fn get(&self, handle: Index) -> Option<&ColliderParent>
Get the element associated to the given handle
, if there is one.
impl ComponentSetOption<ColliderPosition> for ColliderSet
impl ComponentSetOption<ColliderPosition> for ColliderSet
pub fn get(&self, handle: Index) -> Option<&ColliderPosition>
pub fn get(&self, handle: Index) -> Option<&ColliderPosition>
Get the element associated to the given handle
, if there is one.
impl ComponentSetOption<ColliderType> for ColliderSet
impl ComponentSetOption<ColliderType> for ColliderSet
pub fn get(&self, handle: Index) -> Option<&ColliderType>
pub fn get(&self, handle: Index) -> Option<&ColliderType>
Get the element associated to the given handle
, if there is one.
pub fn get(&self, handle: Index) -> Option<&SharedShape>
pub fn get(&self, handle: Index) -> Option<&SharedShape>
Get the element associated to the given handle
, if there is one.
impl Index<ColliderHandle> for ColliderSet
impl Index<ColliderHandle> for ColliderSet
impl Index<Index> for ColliderSet
impl Index<Index> for ColliderSet
impl IndexMut<ColliderHandle> for ColliderSet
impl IndexMut<ColliderHandle> for ColliderSet
pub fn index_mut(&mut self, handle: ColliderHandle) -> &mut Collider
pub fn index_mut(&mut self, handle: ColliderHandle) -> &mut Collider
Performs the mutable indexing (container[index]
) operation. Read more
Auto Trait Implementations
impl !RefUnwindSafe for ColliderSet
impl Send for ColliderSet
impl Sync for ColliderSet
impl Unpin for ColliderSet
impl !UnwindSafe for ColliderSet
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