Skip to content

Interface: RenderableBody

Minimal rendering contract consumed by the scene-level <Body> component.

Any object that produces a Three.js group + a per-frame tick + the deterministic variation handle can be rendered, independently of how it was produced (solar-system pipeline, standalone useBody() call, an editor, a unit test scene, …). This interface deliberately excludes every consumer-specific concern (overlays, application-level callbacks) so that <Body> remains reusable in any runtime that speaks the same rendering contract.

A full handle returned by useBody() (see Body) satisfies this contract structurally — the scene components read the subset they need.

Properties

group

ts
group: Group;

Root THREE group — meshes and shells attach under it.


config

ts
config: BodyConfig;

Physical + display parameters (radius, atmosphere, axial tilt, …).


variation

ts
variation: BodyVariation;

Deterministic visual variation (ring config, shader params).


palette?

ts
optional palette?: TerrainLevel[];

Effective terrain palette used by this body — forwarded by useBody so consumers of the rendering contract (shell anchors, overlay shaders) can read the same palette the internal meshes use.


tick

ts
tick: (dt) => void;

Per-frame tick driven by the scene's render loop.

Parameters

ParameterType
dtnumber

Returns

void


shadowUniforms?

ts
optional shadowUniforms?: ShadowUniforms;

Optional shadow uniforms — when present, a child body can cast an eclipse shadow on this body via ShadowUpdater.


hoverChannel?

ts
optional hoverChannel?: HoverChannel;

Optional per-body hover/pin channel. Forwarded by useBody; surfaced here so <Body> can wire the projectors without leaking the underlying handle.


graphicsUniforms?

ts
optional graphicsUniforms?: GraphicsUniforms;

Optional per-body graphics uniform bag. Forwarded by useBody; surfaced here so <Body> can pass it down to the cloud shell.


interactive?

ts
optional interactive?: BodyInteractive;

Interactive mode + raycast queries. Optional so lightweight consumers (editors, tests) can satisfy the interface without mounting a tile-picking mesh.


hover?

ts
optional hover?: BodyHover;

Controlled tile hover / pin / body-hover setters (scene-controller driven).


liquid?

ts
optional liquid?: BodyLiquid;

Surface liquid controls. Absent on dry bodies and stars.


view?

ts
optional view?: BodyView;

View toggle ('surface' vs 'atmosphere'). Absent on stars.


getCoreRadius?

ts
optional getCoreRadius?: () => number;

Returns the world radius of the opaque inner core sphere. Present on all non-stellar bodies.

Returns

number


getSurfaceRadius?

ts
optional getSurfaceRadius?: () => number;

Returns the world radius of the outer surface (= config.radius). Present on all non-stellar bodies; kept symmetric with getCoreRadius.

Returns

number

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