Torque Valley: Driving, Drift and Crash Sandbox
README.md
surfaces (driveSurfaces.surfaces)
The table of driving surfaces and the per-wheel lookup. Fourteen surfaces in a fixed order (tarmac, wetTarmac, concrete, cobbles, gravel, dirt, mud, grass, sand, snow, ice, rumble, puddle, oil; the index is the driving contract's car.surfaceId), each with grip, slide grip, stiffness, rolling resistance, bogging drag, roughness, dust colour, skid sound, tyre class and the material it wears. sample(hitEntityId, position) answers the surface under a wheel contact: a SurfacePatch zone there first, else the Surface component on the hit entity or its nearest ancestor, else tarmac, cached per entity id so it costs about 0.25 µs. Also names, list, get, byId, ofEntity, patchAt, material, and authoring helpers paint(entity, kind), pad(kind, position, opts), patch(kind, position, opts) and gallery(parent). Called by torqueCars' cars per wheel per physics tick, and by anything that wants to know the ground (skid sounds, dust, AI caution).