Skip to main content

cap_accel

Function cap_accel 

Source
pub fn cap_accel(a: Vec2, cap: f64) -> Vec2
Expand description

Clamp the magnitude of an acceleration vector to cap.

Applied to every agent’s net acceleration before Euler integration to keep the stiff Helbing repulsion numerically stable. See Params::max_accel for the full rationale.