voxolith
API reference@voxolith/gen-terrainFunctions

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

ParameterTypeDescription
terrainTerrainThe terrain, after any levelling.

Returns

TerrainInit

Structured-clonable data; generateTerrain(init.params, init.seed, { heights: init.heights }) rebuilds it.

On this page