Skip to main content

contact_speed

Function contact_speed 

Source
fn contact_speed(
    physics: &PhysicsWorld,
    events: &PhysicsEvents,
    one: ColliderHandle,
    two: ColliderHandle,
) -> f32
Expand description

The speed two colliders close at along their contact normal, from the velocities sampled before the step that reported the contact.

Rapier reports the normal in the first collider’s local frame, so it is rotated into world space before the relative velocity is projected onto it. The result is negative while the pair is separating.