pub struct ContactEvent {
pub a: Entity,
pub b: Option<Entity>,
pub point: [f32; 3],
pub normal: [f32; 3],
pub impulse: f32,
}Expand description
Runtime-only event published by the physics system when two bodies collide
hard enough to pass the world’s contact impulse threshold. a is always a
simulated prop entity; b is the other side’s entity, or None when the
other body has no entity (terrain, the floor slab, a character capsule).
normal points from a’s surface toward b; impulse is the contact’s
total impulse magnitude (mass times velocity change). World authors never
declare this type directly.
Fields§
§a: EntityThe simulated prop entity on one side of the contact.
b: Option<Entity>The other side’s entity, or None when that body has none.
point: [f32; 3]World-space contact point.
normal: [f32; 3]Contact normal, pointing from a’s surface toward b.
impulse: f32Total contact impulse magnitude (mass times velocity change).
Trait Implementations§
Source§impl Clone for ContactEvent
impl Clone for ContactEvent
Source§fn clone(&self) -> ContactEvent
fn clone(&self) -> ContactEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ContactEvent
Auto Trait Implementations§
impl Freeze for ContactEvent
impl RefUnwindSafe for ContactEvent
impl Send for ContactEvent
impl Sync for ContactEvent
impl Unpin for ContactEvent
impl UnsafeUnpin for ContactEvent
impl UnwindSafe for ContactEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more