Skip to content

five-on-it / apps/client/src/renderer/slip

apps/client/src/renderer/slip ​

How much each tyre of a car slides, read from its motion: what lays tyre marks and throws up smoke. The same reading serves the player's predicted car and everyone else's (drawn from snapshots), so no snapshot carries a per-wheel slip: a snapshot already holds the chassis's linear and angular velocity, the handbrake, the wheels' contact and both axles' grip, and that is all it takes.

  • Sideways: the tyre's contact point moves at the chassis's velocity plus its spin about the chassis centre (v + ω × r); what of it runs along the car's left axis is the tyre sliding sideways (the simulation's drift slip, read at every wheel instead of at the rear axle alone). It counts from 1 m/s and in full from 5 m/s.
  • Wheelspin: a driven axle whose tyres spin loses side grip toward the class's wheelspinGrip (vehicle.ts), so how far its grip sits below the class's own says how hard it spins: a burnout smokes standing still.
  • Locked: the handbrake locks the rear tyres, which drag along the road while the car rolls.

A wheel off the ground slides on nothing.

Interfaces ​

Functions ​