Skip to content

Function: resolveCoreRadiusRatio()

ts
function resolveCoreRadiusRatio(config): number;

Resolves the effective coreRadiusRatio for a body, in priority order:

  1. explicit coreRadiusRatio on the config — user opt-in override
  2. derivation from gasMassFraction via deriveCoreRadiusRatio
  3. DEFAULT_CORE_RADIUS_RATIO

The result is then clamped so that coreRatio + atmosphereThickness ≤ 1 − MIN_SOL_BAND_FRACTION. The sol band is the part of the radius that carries the playable terrain prisms; collapsing it to zero (or worse, negative) would leave the layered mesh with no room for the sol layer — this clamp keeps the radial partition [core | sol | atmo] valid.

Parameters

ParameterType
config{ type?: BodyType; coreRadiusRatio?: number; gasMassFraction?: number; atmosphereThickness?: number; }
config.type?BodyType
config.coreRadiusRatio?number
config.gasMassFraction?number
config.atmosphereThickness?number

Returns

number

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