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
radius: number;Visual radius in world units. Also drives the terrain band count via resolveTerrainLevelCount.
rotationSpeed
rotationSpeed: number;Self-rotation speed (rad/s).
axialTilt
axialTilt: number;Axial tilt from the orbital plane (radians).
mass?
optional mass?: number;Body mass in Earth masses. Optional — defaults are derived from type + radius when omitted.
coreRadiusRatio?
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:
- explicit
coreRadiusRatio(this field) — user override - derivation from
gasMassFraction+ density references (planets only) DEFAULT_CORE_RADIUS_RATIO(0.55)