Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

TrackSurfaceOptions

What buildTrackSurface builds from.

Property Type Default value Description
lift? (across, along, point) => number undefined Metres to raise the surface at a point, straight up: snow, drifts, a hillside. It is handed the point’s track coordinates and the world point before the raise, which it must not change. A side cut short by another leg ends at that leg’s height instead.
paint? (across, along) => ArrayLike<number> undefined The vertex colour at a point, as linear red, green and blue from 0 to 1. Left out, the surface has no vertex colours.
section TrackSectionPoint[] undefined The cross-section, left to right.
spacing? number 0.5 Metres between the cross-sections laid along the track.
terrain? TrackTerrain undefined Land round the surface out to the horizon: sunk under it, leaving its outline at the outline’s height, then climbing into mountains. It draws as the last zone, "terrain", with smooth normals, uvs of world x and z over tile, and white vertex colours when painted. Left out, the surface ends at its rims.
tile? number 1 Metres of surface one repeat of a texture covers: the uvs are metres across and along over this.
track Track undefined The track the section runs along.
zones? string[] [], one group The zones, in the order of the geometry’s material groups. A strip goes to the zone its track points weigh more than half, and to the first zone when none does.