[][src]Struct nphysics3d::object::BodySet

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

A set containing all the bodies added to the world.

Methods

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

pub fn new() -> Self[src]

Create a new empty set of bodies.

pub fn len(&self) -> usize[src]

The number of bodies in this set.

pub fn add_body<B: BodyDesc<N>>(
    &mut self,
    desc: &B,
    cworld: &mut ColliderWorld<N>
) -> &mut B::Body
[src]

Adds a body to the world.

pub fn remove_body(&mut self, body: BodyHandle)[src]

Remove a body from this set.

If body identify a mutibody link, the whole multibody is removed.

pub fn contains(&self, handle: BodyHandle) -> bool[src]

Returns true if the given body exists.

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

Reference to the body identified by body.

Returns None if the body is not found.

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

Mutable reference to the body identified by body.

Returns None if the body is not found.

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

Iterator yielding all the bodies on this set.

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

Mutable iterator yielding all the bodies on this set.

Auto Trait Implementations

impl<N> Send for BodySet<N>

impl<N> Sync for BodySet<N>

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

impl<T, U> TryInto 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> BorrowMut for T where
    T: ?Sized
[src]

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

impl<T> Downcast for T where
    T: Any
[src]

impl<SS, SP> SupersetOf for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T> Same for T

type Output = T

Should always be Self