Skip to main content

integrate_semi_implicit

Function integrate_semi_implicit 

Source
pub fn integrate_semi_implicit(
    state: &RigidBodyState,
    force: [f64; 3],
    torque: [f64; 3],
    dt: f64,
) -> RigidBodyState
Expand description

Integrate a single RigidBodyState using the semi-implicit Euler method.

The velocity is updated first (using forces/torques at time t), then the position / orientation is updated using the new velocity at time t + dt. This is symplectic, energy-preserving in the absence of dissipation, and is the standard method used in real-time physics engines.