Skip to content

five-on-it / packages/world/src/ground-probe

packages/world/src/ground-probe ​

What a tyre rolls on, for the effects: how high the surface is under a wheel and whether it is loose ground (dust and brown ruts) or paved (light grey tyre smoke and black marks). A road decides first: within half its width of its centre line and near the wheel's height, its own surface (dirt is loose, a paved road is not) at its own height, which the ribbons and their paint are drawn over (roads.ts). Off the roads the level's triangles decide (supportAt in @foi/world: the ground, or a deck just under the wheel) by their colour: earthy and green colours (grass, earth, gravel, sand) are loose, greys (asphalt, a pavement, concrete, rock) and bright paint are not. The level's plane, which the test levels drive on, is paved.

The client's effects ask it (wheel-effects.ts), and so does the simulation, for the grip of a tyre on wet or snowy ground (packages/sim/src/weather.ts): groundProbe is the level's own, built once.

Type Aliases ​

Functions ​