Skip to content

Function: resolveTileHeight()

ts
function resolveTileHeight(
   config, 
   elevation, 
   paletteOverride?): number;

Resolves the visual height of a tile from the terrain palette. Falls back to a default tile height (0.06) when the palette returns no usable height for the elevation (empty palette, missing/non-finite height).

Parameters

ParameterTypeDescription
configBodyConfigPlanet body config (needed to choose the palette).
elevationnumberTile elevation — integer band index [0, N-1].
paletteOverride?TerrainLevel[]Optional render-time palette override; see choosePalette. When omitted, the palette is auto-derived from config.type.

Returns

number

Resolved tile height for building placement.

Distribué sous la licence indiquée dans le dépôt.