Struct ncollide2d::events::ProximityEvent
source · pub struct ProximityEvent {
pub collider1: CollisionObjectHandle,
pub collider2: CollisionObjectHandle,
pub prev_status: Proximity,
pub new_status: Proximity,
}
Expand description
Events occuring when two collision objects start or stop being in close proximity, contact, or disjoint.
Fields§
§collider1: CollisionObjectHandle
The first collider to which the proximity event applies.
collider2: CollisionObjectHandle
The second collider to which the proximity event applies.
prev_status: Proximity
The previous state of proximity between the two collision objects.
new_status: Proximity
The new state of proximity between the two collision objects.
Implementations§
source§impl ProximityEvent
impl ProximityEvent
sourcepub fn new(
collider1: CollisionObjectHandle,
collider2: CollisionObjectHandle,
prev_status: Proximity,
new_status: Proximity
) -> ProximityEvent
pub fn new(
collider1: CollisionObjectHandle,
collider2: CollisionObjectHandle,
prev_status: Proximity,
new_status: Proximity
) -> ProximityEvent
Instaciates a new proximity event.
Panics if prev_status
is equal to new_status
.
Trait Implementations§
source§impl Clone for ProximityEvent
impl Clone for ProximityEvent
source§fn clone(&self) -> ProximityEvent
fn clone(&self) -> ProximityEvent
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ProximityEvent
impl Debug for ProximityEvent
impl Copy for ProximityEvent
Auto Trait Implementations§
impl RefUnwindSafe for ProximityEvent
impl Send for ProximityEvent
impl Sync for ProximityEvent
impl Unpin for ProximityEvent
impl UnwindSafe for ProximityEvent
Blanket Implementations§
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.