[−][src]Struct oxygengine_physics_2d::prelude::Collider
A geometric entity that can be attached to a body so it can be affected by contacts and proximity queries.
Implementations
impl<N, Handle> Collider<N, Handle> where
Handle: BodyHandle,
N: RealField,
[src]
Handle: BodyHandle,
N: RealField,
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 + 'static + Sync + Send)>
[src]
The user-data attached to this collider.
pub fn user_data_mut(
&mut self
) -> Option<&mut (dyn Any + 'static + Sync + Send)>
[src]
&mut self
) -> Option<&mut (dyn Any + 'static + Sync + Send)>
Mutable reference to the user-data attached to this collider.
pub fn set_user_data(
&mut self,
data: Option<Box<dyn Any + 'static + Sync + Send>>
) -> Option<Box<dyn Any + 'static + Sync + Send>>
[src]
&mut self,
data: Option<Box<dyn Any + 'static + Sync + Send>>
) -> Option<Box<dyn Any + 'static + Sync + Send>>
Sets the user-data attached to this collider.
pub fn take_user_data(&mut self) -> Option<Box<dyn Any + 'static + Sync + Send>>
[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, 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).
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<NodeIndex<usize>>
[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<NodeIndex<usize>>)
[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, U2, Unit<Complex<N>>>
[src]
The collider position.
pub fn set_position(&mut self, pos: Isometry<N, U2, Unit<Complex<N>>>)
[src]
Sets the position of the collider.
pub fn set_position_with_prediction(
&mut self,
position: Isometry<N, U2, Unit<Complex<N>>>,
prediction: Isometry<N, U2, Unit<Complex<N>>>
)
[src]
&mut self,
position: Isometry<N, U2, Unit<Complex<N>>>,
prediction: Isometry<N, U2, Unit<Complex<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> + 'static)
[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, Handle> CollisionObjectRef<N> for Collider<N, Handle> where
Handle: BodyHandle,
N: RealField,
[src]
Handle: BodyHandle,
N: RealField,
fn graph_index(&self) -> Option<NodeIndex<usize>>
[src]
fn proxy_handle(&self) -> Option<BroadPhaseProxyHandle>
[src]
fn position(&self) -> &Isometry<N, U2, Unit<Complex<N>>>
[src]
fn predicted_position(&self) -> Option<&Isometry<N, U2, Unit<Complex<N>>>>
[src]
fn shape(&self) -> &(dyn Shape<N> + 'static)
[src]
fn collision_groups(&self) -> &CollisionGroups
[src]
fn query_type(&self) -> GeometricQueryType<N>
[src]
fn update_flags(&self) -> CollisionObjectUpdateFlags
[src]
fn compute_aabb(&self) -> AABB<N>
[src]
fn compute_swept_aabb(&self) -> AABB<N>
[src]
Auto Trait Implementations
impl<N, Handle> !RefUnwindSafe for Collider<N, Handle>
impl<N, Handle> Send for Collider<N, Handle> where
N: Scalar,
N: Scalar,
impl<N, Handle> Sync for Collider<N, Handle> where
N: Scalar,
N: Scalar,
impl<N, Handle> Unpin for Collider<N, Handle> where
Handle: Unpin,
N: Scalar + Unpin,
Handle: Unpin,
N: Scalar + Unpin,
impl<N, Handle> !UnwindSafe for Collider<N, Handle>
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>,