[−][src]Struct nphysics2d::object::ColliderData
Data stored into each collider.
Those are needed by nphysics.
Methods
impl<N: Real> ColliderData<N>
[src]
pub fn new(
name: String,
margin: N,
anchor: ColliderAnchor<N>,
body_status_dependent_ndofs: usize,
material: MaterialHandle<N>
) -> Self
[src]
name: String,
margin: N,
anchor: ColliderAnchor<N>,
body_status_dependent_ndofs: usize,
material: MaterialHandle<N>
) -> Self
Initializes data for a collider.
pub fn user_data(&self) -> Option<&(dyn Any + Send + Sync)>
[src]
Retrieves a reference to the user-defined user-data attached to this object.
pub fn user_data_mut(&mut self) -> Option<&mut (dyn Any + Send + Sync)>
[src]
Retrieves a mutable reference to the user-defined user-data attached to this object.
pub fn set_user_data(
&mut self,
data: Option<Box<dyn Any + Send + Sync>>
) -> Option<Box<dyn Any + Send + Sync>>
[src]
&mut self,
data: Option<Box<dyn Any + Send + Sync>>
) -> Option<Box<dyn Any + Send + Sync>>
Sets the user-defined data attached to this object.
pub fn take_user_data(&mut self) -> Option<Box<dyn Any + Send + Sync>>
[src]
Replace by None
the user-defined data attached to this object and returns the old value.
pub fn margin(&self) -> N
[src]
The collision margin surrounding this collider.
pub fn body(&self) -> BodyHandle
[src]
Handle to the body this collider is attached to.
pub fn anchor(&self) -> &ColliderAnchor<N>
[src]
The anchor attaching this collider with a body part or deformable body.
pub fn position_wrt_body(&self) -> Isometry<N>
[src]
The position of this collider geometry wrt. the body it is attached to.
pub fn body_part(&self, subshape_id: usize) -> BodyPartHandle
[src]
Handle to the body part containing the given subshape of this collider's shape.
pub fn material(&self) -> &dyn Material<N>
[src]
The material of this collider.
pub fn material_mut(&mut self) -> &mut dyn Material<N>
[src]
A mutable reference to this collider's material.
If the material is shared, then an internal clone is performed
before returning the mutable reference (this effectively call
the Arc::make_mut
method to get a copy-on-write behavior).
Auto Trait Implementations
impl<N> Send for ColliderData<N> where
N: Scalar,
N: Scalar,
impl<N> Sync for ColliderData<N> where
N: Scalar,
N: Scalar,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut 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 as_any(&self) -> &(dyn Any + 'static)
[src]
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<SS, SP> SupersetOf 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> Same for T
type Output = T
Should always be Self