five-on-it / packages/sim/src/world / MAX_PHYSICS_SUBSTEPS
Variable: MAX_PHYSICS_SUBSTEPS
constMAX_PHYSICS_SUBSTEPS:4=4
Defined in: packages/sim/src/world.ts:50
The most physics steps a tick takes (240 Hz): when two moving bodies may meet within the tick faster than one step's contacts hold them apart, the tick is cut into as many steps as it takes for them to close at most CONTACT_PREDICTION a step (substeps.ts). A car closes a gap of a quarter of a tick's travel at most between two searches for contacts (12 cm at 100 km/h against a parked car), so two cars meet with their contact points in hand instead of found already half a metre into each other, and a car turned by a blow is caught by the next search before a corner of it swings deep into the other. The systems still run once a tick: the inputs, the vehicle controllers' suspension and tyres, the characters' walking.