Skip to main content

initialize_contacts

Function initialize_contacts 

Source
pub fn initialize_contacts(
    bodies: &[Option<RigidBody>],
    contacts: &mut [Contact],
    restitution_threshold: f32,
)
Expand description

Pre-compute solver data for each contact: velocity bias (restitution) and tangent direction. Must be called ONCE per frame before warm starting and solver iterations. This follows the Box2D approach: bias and tangent are fixed for the entire solve.