[−][src]Struct oxygengine_physics_2d::prelude::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.
Implementations
impl<N> DefaultBodySet<N> where
N: RealField,
[src]
N: RealField,
pub fn new() -> DefaultBodySet<N>
[src]
Creates an empty set.
pub fn insert(&mut self, body: impl Body<N>) -> Index
[src]
Adds a body to this set.
pub fn insert_boxed(&mut self, body: Box<dyn Body<N> + 'static>) -> Index
[src]
Adds a body (represented as a boxed trait-object) to this set.
pub fn remove(&mut self, to_remove: Index) -> Option<Box<dyn Body<N> + 'static>>
[src]
Removes a body from this set.
pub fn get(&self, handle: Index) -> Option<&(dyn Body<N> + 'static)>
[src]
Gets a reference to the body identified by handle
.
pub fn get_mut(&mut self, handle: Index) -> Option<&mut (dyn Body<N> + 'static)>
[src]
Gets a mutable reference to the body identified by handle
.
pub fn iter(&self) -> impl Iterator<Item = (Index, &(dyn Body<N> + 'static))>
[src]
Iterate through all the bodies and their handles.
pub fn iter_mut(
&mut self
) -> impl Iterator<Item = (Index, &mut (dyn Body<N> + 'static))>
[src]
&mut self
) -> impl Iterator<Item = (Index, &mut (dyn Body<N> + 'static))>
Mutably iterate through all the bodies and their handles.
pub fn rigid_body(&self, handle: Index) -> 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: Index) -> 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: Index) -> 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: Index) -> 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> BodySet<N> for DefaultBodySet<N> where
N: RealField,
[src]
N: RealField,
type Handle = Index
Type of a body handle identifying a body in this set.
fn get(
&self,
handle: <DefaultBodySet<N> as BodySet<N>>::Handle
) -> Option<&(dyn Body<N> + 'static)>
[src]
&self,
handle: <DefaultBodySet<N> as BodySet<N>>::Handle
) -> Option<&(dyn Body<N> + 'static)>
fn get_mut(
&mut self,
handle: <DefaultBodySet<N> as BodySet<N>>::Handle
) -> Option<&mut (dyn Body<N> + 'static)>
[src]
&mut self,
handle: <DefaultBodySet<N> as BodySet<N>>::Handle
) -> Option<&mut (dyn Body<N> + 'static)>
fn contains(&self, handle: <DefaultBodySet<N> as BodySet<N>>::Handle) -> bool
[src]
fn foreach(
&self,
f: &mut dyn FnMut(<DefaultBodySet<N> as BodySet<N>>::Handle, &(dyn Body<N> + 'static))
)
[src]
&self,
f: &mut dyn FnMut(<DefaultBodySet<N> as BodySet<N>>::Handle, &(dyn Body<N> + 'static))
)
fn foreach_mut(
&mut self,
f: &mut dyn FnMut(<DefaultBodySet<N> as BodySet<N>>::Handle, &mut (dyn Body<N> + 'static))
)
[src]
&mut self,
f: &mut dyn FnMut(<DefaultBodySet<N> as BodySet<N>>::Handle, &mut (dyn Body<N> + 'static))
)
fn pop_removal_event(
&mut self
) -> Option<<DefaultBodySet<N> as BodySet<N>>::Handle>
[src]
&mut self
) -> Option<<DefaultBodySet<N> as BodySet<N>>::Handle>
fn get_pair(
&self,
handle1: Self::Handle,
handle2: Self::Handle
) -> (Option<&(dyn Body<N> + 'static)>, Option<&(dyn Body<N> + 'static)>)
[src]
&self,
handle1: Self::Handle,
handle2: Self::Handle
) -> (Option<&(dyn Body<N> + 'static)>, Option<&(dyn Body<N> + 'static)>)
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> Any for T where
T: Any,
T: Any,
fn get_type_id(&self) -> TypeId
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,
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Send + Sync + Any,
T: Send + Sync + Any,
impl<T> Event for T where
T: Send + Sync + 'static,
T: Send + Sync + 'static,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Resource for T where
T: Any,
T: Any,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
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>,