[][src]Struct nphysics3d::object::DefaultBodySet

pub struct DefaultBodySet<N: RealField> { /* fields omitted */ }

The default set containing all the bodies added to the world.

It is based on an arena using generational indices to avoid the ABA problem.

Methods

impl<N: RealField> DefaultBodySet<N>[src]

pub fn new() -> Self[src]

Creates an empty set.

pub fn insert(&mut self, body: impl Body<N>) -> DefaultBodyHandle[src]

Adds a body to this set.

pub fn insert_boxed(&mut self, body: Box<dyn Body<N>>) -> DefaultBodyHandle[src]

Adds a body (represented as a boxed trait-object) to this set.

pub fn remove(
    &mut self,
    to_remove: DefaultBodyHandle
) -> Option<Box<dyn Body<N>>>
[src]

Removes a body from this set.

pub fn get(&self, handle: DefaultBodyHandle) -> Option<&dyn Body<N>>[src]

Gets a reference to the body identified by handle.

pub fn get_mut(&mut self, handle: DefaultBodyHandle) -> Option<&mut dyn Body<N>>[src]

Gets a mutable reference to the body identified by handle.

pub fn iter(&self) -> impl Iterator<Item = (DefaultBodyHandle, &dyn Body<N>)>[src]

Iterate through all the bodies and their handles.

pub fn iter_mut(
    &mut self
) -> impl Iterator<Item = (DefaultBodyHandle, &mut dyn Body<N>)>
[src]

Mutably iterate through all the bodies and their handles.

pub fn rigid_body(&self, handle: DefaultBodyHandle) -> Option<&RigidBody<N>>[src]

Gets the rigid body identified by handle.

Returns None if the body does not exists, of if it exists but is not a rigid body.

pub fn rigid_body_mut(
    &mut self,
    handle: DefaultBodyHandle
) -> Option<&mut RigidBody<N>>
[src]

Gets a mutable reference to the rigid body identified by handle.

Returns None if the body does not exists, of if it exists but is not a rigid body.

pub fn multibody(&self, handle: DefaultBodyHandle) -> Option<&Multibody<N>>[src]

Gets the multibody identified by handle.

Returns None if the body does not exists, of if it exists but is not a multibody.

pub fn multibody_mut(
    &mut self,
    handle: DefaultBodyHandle
) -> Option<&mut Multibody<N>>
[src]

Gets a mutable reference to the multibody identified by handle.

Returns None if the body does not exists, of if it exists but is not a multibody.

Trait Implementations

impl<N: RealField> BodySet<N> for DefaultBodySet<N>[src]

type Handle = DefaultBodyHandle

Type of a body handle identifying a body in this set.

Auto Trait Implementations

impl<N> !RefUnwindSafe for DefaultBodySet<N>

impl<N> Send for DefaultBodySet<N>

impl<N> Sync for DefaultBodySet<N>

impl<N> Unpin for DefaultBodySet<N>

impl<N> !UnwindSafe for DefaultBodySet<N>

Blanket Implementations

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

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

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

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, U> Into<U> for T where
    U: From<T>, 
[src]

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, 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<V, T> VZip<V> for T where
    V: MultiLane<T>,