Struct bevy_rapier3d::pipeline::ContactForceEvent
source · pub struct ContactForceEvent {
pub collider1: Entity,
pub collider2: Entity,
pub total_force: Vect,
pub total_force_magnitude: Real,
pub max_force_direction: Vect,
pub max_force_magnitude: Real,
}
Expand description
Event occurring when the sum of the magnitudes of the contact forces
between two colliders exceed a threshold ([ContactForceEventThreshold
]).
This will only get triggered if the entity has the
[ActiveEvent::CONTACT_FORCE_EVENTS
] flag enabled.
Fields§
§collider1: Entity
The first collider involved in the contact.
collider2: Entity
The second collider involved in the contact.
total_force: Vect
The sum of all the forces between the two colliders.
total_force_magnitude: Real
The sum of the magnitudes of each force between the two colliders.
Note that this is not the same as the magnitude of self.total_force
.
Here we are summing the magnitude of all the forces, instead of taking
the magnitude of their sum.
max_force_direction: Vect
The world-space (unit) direction of the force with strongest magnitude.
max_force_magnitude: Real
The magnitude of the largest force at a contact point of this contact pair.
Trait Implementations§
source§impl Clone for ContactForceEvent
impl Clone for ContactForceEvent
source§fn clone(&self) -> ContactForceEvent
fn clone(&self) -> ContactForceEvent
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ContactForceEvent
impl Debug for ContactForceEvent
source§impl PartialEq for ContactForceEvent
impl PartialEq for ContactForceEvent
source§fn eq(&self, other: &ContactForceEvent) -> bool
fn eq(&self, other: &ContactForceEvent) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for ContactForceEvent
impl Event for ContactForceEvent
impl StructuralPartialEq for ContactForceEvent
Auto Trait Implementations§
impl RefUnwindSafe for ContactForceEvent
impl Send for ContactForceEvent
impl Sync for ContactForceEvent
impl Unpin for ContactForceEvent
impl UnwindSafe for ContactForceEvent
Blanket Implementations§
§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T
[ShaderType
] for self
. When used in [AsBindGroup
]
derives, it is safe to assume that all images in self
exist.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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.