Struct oxygengine_physics_2d::prelude::ColliderData [−][src]
pub struct ColliderData<N, Handle> where
Handle: BodyHandle,
N: RealField, { /* fields omitted */ }
Data stored in each collider.
This is needed by nphysics.
Implementations
impl<N, Handle> ColliderData<N, Handle> where
Handle: BodyHandle,
N: RealField,
[src]
impl<N, Handle> ColliderData<N, Handle> where
Handle: BodyHandle,
N: RealField,
[src]pub fn new(
margin: N,
density: N,
anchor: ColliderAnchor<N, Handle>,
body_status_dependent_ndofs: usize,
material: MaterialHandle<N>
) -> ColliderData<N, Handle>
[src]
margin: N,
density: N,
anchor: ColliderAnchor<N, Handle>,
body_status_dependent_ndofs: usize,
material: MaterialHandle<N>
) -> ColliderData<N, Handle>
Initializes data for a collider.
pub fn user_data(&self) -> Option<&(dyn Any + 'static + Sync + Send)>
[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 + 'static + Sync + Send)>
[src]
&mut self
) -> Option<&mut (dyn Any + 'static + Sync + Send)>
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 + 'static + Sync + Send, Global>>
) -> Option<Box<dyn Any + 'static + Sync + Send, Global>>
[src]
&mut self,
data: Option<Box<dyn Any + 'static + Sync + Send, Global>>
) -> Option<Box<dyn Any + 'static + Sync + Send, Global>>
Sets the user-defined data attached to this object.
pub fn take_user_data(
&mut self
) -> Option<Box<dyn Any + 'static + Sync + Send, Global>>
[src]
&mut self
) -> Option<Box<dyn Any + 'static + Sync + Send, Global>>
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) -> Handle
[src]
Handle to the body this collider is attached to.
pub fn anchor(&self) -> &ColliderAnchor<N, Handle>
[src]
The anchor attaching this collider with a body part or deformable body.
pub fn density(&self) -> N
[src]
The density of this collider.
pub fn position_wrt_body(&self) -> Isometry<N, U2, Unit<Complex<N>>>
[src]
The position of this collider geometry wrt. the body it is attached to.
pub fn body_part(&self, subshape_id: usize) -> BodyPartHandle<Handle>
[src]
Handle to the body part containing the given subshape of this collider’s shape.
pub fn material(&self) -> &(dyn Material<N> + 'static)
[src]
The material of this collider.
pub fn material_mut(&mut self) -> &mut (dyn Material<N> + 'static)
[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 calls
the Arc::make_mut
method to get a copy-on-write behavior).
Auto Trait Implementations
impl<N, Handle> !RefUnwindSafe for ColliderData<N, Handle>
impl<N, Handle> !RefUnwindSafe for ColliderData<N, Handle>
impl<N, Handle> Send for ColliderData<N, Handle>
impl<N, Handle> Send for ColliderData<N, Handle>
impl<N, Handle> Sync for ColliderData<N, Handle>
impl<N, Handle> Sync for ColliderData<N, Handle>
impl<N, Handle> Unpin for ColliderData<N, Handle> where
Handle: Unpin,
N: Unpin,
impl<N, Handle> Unpin for ColliderData<N, Handle> where
Handle: Unpin,
N: Unpin,
impl<N, Handle> !UnwindSafe for ColliderData<N, Handle>
impl<N, Handle> !UnwindSafe for ColliderData<N, Handle>
Blanket Implementations
impl<T> Any for T where
T: Any,
impl<T> Any for T where
T: Any,
pub fn get_type_id(&self) -> TypeId
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
impl<T> Same<T> for 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>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub fn to_subset_unchecked(&self) -> SS
pub fn from_subset(element: &SS) -> SP
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,