Function: resolveTerrainLevelCount()
ts
function resolveTerrainLevelCount(
radius,
coreRadiusRatio,
atmosphereThickness?): number;Resolves the band count N for a body. Deterministic, pure function of (radius, coreRadiusRatio, atmosphereThickness?) — there is no caller override: the staircase geometry is a direct consequence of the radial partition, so the backend (simulation) and the frontend (rendering) agree on N without negotiating additional fields over the wire.
The sol band — where the staircase lives — spans (1 - coreRadiusRatio - atmosphereThickness) × radius. Passing the atmosphere thickness shrinks the staircase proportionally so the sol band ends at solOuterRadius instead of radius. Omit it (or pass 0) for legacy callers that treat the whole shell as sol.
Derivation: N = round(solShell / DEFAULT_TERRAIN_STEP), clamped to MIN_TERRAIN_LEVEL_COUNT.
Parameters
| Parameter | Type |
|---|---|
radius | number |
coreRadiusRatio | number |
atmosphereThickness? | number |
Returns
number