[−][src]Struct nphysics2d::object::Collider
A geometric entity that can be attached to a body so it can be affected by contacts and proximity queries.
Implementations
impl<N: RealField, Handle: BodyHandle> Collider<N, Handle>
[src]
pub fn removal_data(&self) -> Option<ColliderRemovalData<N, Handle>>
[src]
Computes the data that needs to be returned once this collider has been removed from a collider set.
pub fn user_data(&self) -> Option<&(dyn Any + Send + Sync)>
[src]
The user-data attached to this collider.
pub fn user_data_mut(&mut self) -> Option<&mut (dyn Any + Send + Sync)>
[src]
Mutable reference to the user-data attached to this collider.
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-data attached to this collider.
pub fn take_user_data(&mut self) -> Option<Box<dyn Any + Send + Sync>>
[src]
Replaces the user-data of this collider by None
and returns the old value.
pub fn margin(&self) -> N
[src]
The collision margin surrounding this collider.
pub fn set_margin(&mut self, margin: N)
[src]
Sets the marging on this collider's shapes.
pub fn clear_update_flags(&mut self)
[src]
Clears all the internal flags tracking changes made to this collider.
pub fn density(&self) -> N
[src]
The density of 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 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<Handle>
[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 calls
the Arc::make_mut
method to get a copy-on-write behavior).
pub fn is_sensor(&self) -> bool
[src]
Returns true
if this collider is a sensor.
pub fn is_ccd_enabled(&self) -> bool
[src]
Returns true
if this collider is subjected to Continuous Collision Detection (CCD).
pub fn enable_ccd(&mut self, enabled: bool)
[src]
Enables or disables Continuous Collision Detection (CCD) for this collider.
pub fn graph_index(&self) -> Option<CollisionObjectGraphIndex>
[src]
This collider's non-stable graph index.
This index may change whenever a collider is removed from the world.
pub fn set_graph_index(&mut self, index: Option<CollisionObjectGraphIndex>)
[src]
Sets the collider unique but non-stable graph index.
pub fn proxy_handle(&self) -> Option<BroadPhaseProxyHandle>
[src]
The collider's broad phase proxy unique identifier.
pub fn set_proxy_handle(&mut self, handle: Option<BroadPhaseProxyHandle>)
[src]
Sets the collider's broad phase proxy unique identifier.
pub fn position(&self) -> &Isometry<N>
[src]
The collider position.
pub fn set_position(&mut self, pos: Isometry<N>)
[src]
Sets the position of the collider.
pub fn set_position_with_prediction(
&mut self,
position: Isometry<N>,
prediction: Isometry<N>
)
[src]
&mut self,
position: Isometry<N>,
prediction: Isometry<N>
)
Sets the position of the collider.
pub fn set_deformations(&mut self, coords: &[N])
[src]
Deforms the underlying shape if possible.
Panics if the shape is not deformable.
pub fn shape(&self) -> &dyn Shape<N>
[src]
This collider's shape.
pub fn shape_handle(&self) -> &ShapeHandle<N>
[src]
This collider's shape.
pub fn set_shape(&mut self, shape: ShapeHandle<N>)
[src]
Sets this collider's shape.
pub fn collision_groups(&self) -> &CollisionGroups
[src]
The collision groups of the collider.
pub fn set_collision_groups(&mut self, groups: CollisionGroups)
[src]
Sets the collision groups of this collider.
pub fn query_type(&self) -> GeometricQueryType<N>
[src]
Returns the kind of queries this collider is expected to emit.
pub fn set_query_type(&mut self, query_type: GeometricQueryType<N>)
[src]
Sets the GeometricQueryType
of the collider.
Use CollisionWorld::set_query_type
to use this method.
Trait Implementations
impl<N: RealField, Handle: BodyHandle> CollisionObjectRef<N> for Collider<N, Handle>
[src]
pub fn graph_index(&self) -> Option<CollisionObjectGraphIndex>
[src]
pub fn proxy_handle(&self) -> Option<BroadPhaseProxyHandle>
[src]
pub fn position(&self) -> &Isometry<N>
[src]
pub fn predicted_position(&self) -> Option<&Isometry<N>>
[src]
pub fn shape(&self) -> &dyn Shape<N>
[src]
pub fn collision_groups(&self) -> &CollisionGroups
[src]
pub fn query_type(&self) -> GeometricQueryType<N>
[src]
pub fn update_flags(&self) -> CollisionObjectUpdateFlags
[src]
pub fn compute_aabb(&self) -> AABB<N>
[src]
pub fn compute_swept_aabb(&self) -> AABB<N>
[src]
Auto Trait Implementations
impl<N, Handle> !RefUnwindSafe for Collider<N, Handle>
[src]
impl<N, Handle> Send for Collider<N, Handle> where
N: Scalar,
[src]
N: Scalar,
impl<N, Handle> Sync for Collider<N, Handle> where
N: Scalar,
[src]
N: Scalar,
impl<N, Handle> Unpin for Collider<N, Handle> where
Handle: Unpin,
N: Scalar + Unpin,
[src]
Handle: Unpin,
N: Scalar + Unpin,
impl<N, Handle> !UnwindSafe for Collider<N, Handle>
[src]
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
[src]
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
pub fn as_any(&self) -> &(dyn Any + 'static)
[src]
pub 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>,
pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]
pub 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.
pub 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.
pub 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>,