Function impact_velocity

Source
pub fn impact_velocity(
    velocity: Vec3,
    normal: Vec3,
    restitution: f32,
    slide: f32,
) -> Option<Vec3>
Expand description

Change only an incoming velocity’s normal component and retain a chosen amount of tangential speed. Glancing contacts can slide without stopping. Invalid parameters/zero normals return None; separating velocities are intact.