[−][src]Struct nphysics3d::object::DefaultBodySet
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]
&mut self,
to_remove: DefaultBodyHandle
) -> Option<Box<dyn Body<N>>>
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]
&mut self
) -> impl Iterator<Item = (DefaultBodyHandle, &mut dyn Body<N>)>
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]
&mut self,
handle: DefaultBodyHandle
) -> Option<&mut RigidBody<N>>
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]
&mut self,
handle: DefaultBodyHandle
) -> Option<&mut Multibody<N>>
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.
fn get(&self, handle: Self::Handle) -> Option<&dyn Body<N>>
[src]
fn get_mut(&mut self, handle: Self::Handle) -> Option<&mut dyn Body<N>>
[src]
fn contains(&self, handle: Self::Handle) -> bool
[src]
fn foreach(&self, f: &mut dyn FnMut(Self::Handle, &dyn Body<N>))
[src]
fn foreach_mut(&mut self, f: &mut dyn FnMut(Self::Handle, &mut dyn Body<N>))
[src]
fn pop_removal_event(&mut self) -> Option<Self::Handle>
[src]
fn get_pair(
&self,
handle1: Self::Handle,
handle2: Self::Handle
) -> (Option<&dyn Body<N>>, Option<&dyn Body<N>>)
[src]
&self,
handle1: Self::Handle,
handle2: Self::Handle
) -> (Option<&dyn Body<N>>, Option<&dyn Body<N>>)
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
[src]
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
fn as_any(&self) -> &(dyn Any + 'static)
[src]
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> DowncastSync for T where
T: Send + Sync + Any,
[src]
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
[src]
fn is_in_subset(&self) -> bool
[src]
unsafe fn to_subset_unchecked(&self) -> SS
[src]
fn from_subset(element: &SS) -> SP
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,