terrainInit()
A terrain as plain data, to rebuild the same Terrain elsewhere (a worker) without regenerating it: its complete params, seed and a copy of its current heights (so the init can be transferred while the terrain stays usable).
function terrainInit(terrain: Terrain): TerrainInit;Defined in: index.ts:451
Parameters
| Parameter | Type | Description |
|---|---|---|
terrain | Terrain | The terrain, after any levelling. |
Returns
Structured-clonable data; generateTerrain(init.params, init.seed, { heights: init.heights })
rebuilds it.
terrainHeightsBand()
Sample the rows z0 <= z < z1 of the height map, the unedited values generateTerrain samples into heights there. Bands are independent, so workers can each sample one and the host stitches them (heights.set(band, z0 width)) and passes the result to generateTerrain(params, seed, { heights }): byte...
terrainSize()
The map size generateTerrain builds for complete params: width and depth rounded, at least 8 columns each.