Struct rapier2d::geometry::ColliderSet
source · [−]pub struct ColliderSet { /* private fields */ }
Expand description
A set of colliders that can be handled by a physics World
.
Implementations
An always-invalid collider handle.
Iterate through all the colliders on this set.
Iterates mutably through all the colliders on this set.
Is this collider handle valid?
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.
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.
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.
Get the collider with the given handle.
Gets a mutable reference to the collider with the given handle.
Trait Implementations
Set the value of this element.
fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut ColliderBroadPhaseData) -> Result
) -> Option<Result>
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
Set the value of this element.
fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut ColliderChanges) -> Result
) -> Option<Result>
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
Set the value of this element.
fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut ColliderFlags) -> Result
) -> Option<Result>
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
Set the value of this element.
fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut ColliderMassProps) -> Result
) -> Option<Result>
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
Set the value of this element.
fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut ColliderMaterial) -> Result
) -> Option<Result>
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
Set the value of this element.
fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut ColliderPosition) -> Result
) -> Option<Result>
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
Set the value of this element.
fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut ColliderType) -> Result
) -> Option<Result>
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
Set the value of this element.
fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut ColliderShape) -> Result
) -> Option<Result>
fn map_mut_internal<Result>(
&mut self,
handle: Index,
f: impl FnOnce(&mut ColliderShape) -> Result
) -> Option<Result>
Applies the given closure to the element associated to the given handle
. Read more
Get the element associated to the given handle
, if there is one.
Get the element associated to the given handle
, if there is one.
Get the element associated to the given handle
, if there is one.
Get the element associated to the given handle
, if there is one.
Get the element associated to the given handle
, if there is one.
Get the element associated to the given handle
, if there is one.
Get the element associated to the given handle
, if there is one.
Get the element associated to the given handle
, if there is one.
Get the element associated to the given handle
, if there is one.
Returns the “default value” for a type. Read more
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
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
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
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
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
Checks if self
is actually part of its subset T
(and can be converted to it).
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
The inclusion map: converts self
to the equivalent element of its superset.