Struct heron::rapier_plugin::rapier::geometry::ColliderSet[]

pub struct ColliderSet { /* fields omitted */ }

A set of colliders that can be handled by a physics World.

Implementations

impl ColliderSet

pub fn new() -> ColliderSet

Create a new empty set of colliders.

pub fn invalid_handle() -> Index

An always-invalid collider handle.

pub fn iter(&self) -> impl ExactSizeIterator

Iterate through all the colliders on this set.

pub fn len(&self) -> usize

The number of colliders on this set.

pub fn contains(&self, handle: Index) -> bool

Is this collider handle valid?

pub fn insert(
    &mut self,
    coll: Collider,
    parent_handle: Index,
    bodies: &mut RigidBodySet
) -> Index

Inserts a new collider to this set and retrieve its handle.

pub fn remove(
    &mut self,
    handle: Index,
    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: usize) -> Option<(&Collider, Index)>

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: usize
) -> Option<(&mut Collider, Index)>

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: Index) -> Option<&Collider>

Get the collider with the given handle.

pub fn get_mut(&mut self, handle: Index) -> Option<&mut Collider>

Gets a mutable reference to the collider with the given handle.

Trait Implementations

impl Clone for ColliderSet

impl Index<Index> for ColliderSet

type Output = Collider

The returned type after indexing.

impl IndexMut<Index> for ColliderSet

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CloneAny for T where
    T: Clone + Any

impl<T> Component for T where
    T: 'static + Send + Sync

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Resource for T where
    T: 'static + Send + Sync

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> TypeData for T where
    T: 'static + Send + Sync + Clone

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,