Skip to content

Interface: BodyPhysicsCore

Physical fields shared by every body type — geometry + motion + optional mass and core split. Backend physics models can compute these and ship them to the frontend as-is.

The lib is chemistry- and climate-agnostic: it never reads a temperature field to derive a visual or a phase. Callers that want a climate-driven look (lava colour, ocean tint, gas turbulence) compute those values from their own thermal model and push them via the type-specific visual profile and BodyVariation overrides (render layer).

Extended by

Properties

radius

ts
radius: number;

Visual radius in world units. Also drives the terrain band count via resolveTerrainLevelCount.


rotationSpeed

ts
rotationSpeed: number;

Self-rotation speed (rad/s).


axialTilt

ts
axialTilt: number;

Axial tilt from the orbital plane (radians).


mass?

ts
optional mass?: number;

Body mass in Earth masses. Optional — defaults are derived from type + radius when omitted.


coreRadiusRatio?

ts
optional coreRadiusRatio?: number;

Ratio of solid core radius to the visual surface radius. The core sphere sits at radius * coreRadiusRatio; the shell above hosts the sol + atmosphere layers (planets only — stars expose the same field for the inner sphere mesh used by core-shell transparencies).

Resolution order when building a body:

  1. explicit coreRadiusRatio (this field) — user override
  2. derivation from gasMassFraction + density references (planets only)
  3. DEFAULT_CORE_RADIUS_RATIO (0.55)

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