Skip to content

Interface: BodyRingsConfig

Input configuration for buildBodyRings. Couples the ring geometry (radii derived from the planet radius), the deterministic variation (archetype + profile + colours) and the planet's world-space position used for shadow rays.

Time scrubbing (pause / speed multiplier) is intentionally absent — the caller scales the dt it passes to tick() instead, which keeps playback control where it belongs (with the time source).

Properties

radius

ts
radius: number;

Planet visual radius (world units). Ring radii are radius × innerRatio/outerRatio.


rotationSpeed

ts
rotationSpeed: number;

Ring self-rotation speed around its own normal (rad/s).


variation

ts
variation: RingVariation;

Deterministic ring variation (archetype + profile + colors).


planetWorldPos

ts
planetWorldPos: Vector3;

Mutable world-space position of the planet — read by the shadow shader on every render. The caller owns the vector and mutates it each frame (e.g. props.group.getWorldPosition(planetWorldPos)); the lib never reassigns it. Wired directly into the shader uniform so no per-frame copy is needed.


sunLight?

ts
optional sunLight?: 
  | PointLight
  | DirectionalLight
  | null;

Light source illuminating the rings. Each tick(), the lib reads sunLight.getWorldPosition() and pushes it into the ring shader (drives backlight halo + shadow ray).

When omitted (or null), tick() auto-discovers the dominant PointLight / DirectionalLight under the mesh's scene root via findDominantLightWorldPos — handy for simple scenes with a single light. Multi-star scenes pass the resolved light explicitly.

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