Struct heron::rapier_plugin::rapier3d::geometry::ColliderSet
pub struct ColliderSet { /* private fields */ }
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.
pub fn iter_mut(
&mut self
) -> impl Iterator<Item = (ColliderHandle, &mut Collider)>
pub fn iter_mut(
&mut self
) -> impl Iterator<Item = (ColliderHandle, &mut Collider)>
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: impl Into<Collider>) -> ColliderHandle
pub fn insert(&mut self, coll: impl Into<Collider>) -> ColliderHandle
Inserts a new collider to this set and retrieve its handle.
pub fn insert_with_parent(
&mut self,
coll: impl Into<Collider>,
parent_handle: RigidBodyHandle,
bodies: &mut RigidBodySet
) -> ColliderHandle
pub fn insert_with_parent(
&mut self,
coll: impl Into<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 set_parent(
&mut self,
handle: ColliderHandle,
new_parent_handle: Option<RigidBodyHandle>,
bodies: &mut RigidBodySet
)
pub fn set_parent(
&mut self,
handle: ColliderHandle,
new_parent_handle: Option<RigidBodyHandle>,
bodies: &mut RigidBodySet
)
Sets the parent of the given collider.
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
fn clone(&self) -> ColliderSet
fn clone(&self) -> ColliderSet
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreimpl Default for ColliderSet
impl Default for ColliderSet
fn default() -> ColliderSet
fn default() -> ColliderSet
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
fn index_mut(&mut self, handle: ColliderHandle) -> &mut Collider
fn index_mut(&mut self, handle: ColliderHandle) -> &mut Collider
container[index]
) operation. Read moreAuto Trait Implementations
impl !RefUnwindSafe for ColliderSet
impl Send for ColliderSet
impl Sync for ColliderSet
impl Unpin for ColliderSet
impl !UnwindSafe for ColliderSet
Blanket Implementations
impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
fn as_bind_group_shader_type(
&self,
_images: &HashMap<Handle<Image>, <Image as RenderAsset>::PreparedAsset, RandomState, Global>
) -> U
fn as_bind_group_shader_type(
&self,
_images: &HashMap<Handle<Image>, <Image as RenderAsset>::PreparedAsset, RandomState, Global>
) -> U
T
[ShaderType
] for self
. When used in [AsBindGroup
]
derives, it is safe to assume that all images in self
exist. Read moresourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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 morefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read morefn 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. Read morefn 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. Read moreimpl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Self
using data from the given [World]sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read morefn 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).fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.