Skip to content

Interface: PlanetBody

Handle returned by useBody() for 'rocky' | 'gaseous' | 'metallic'. Carries the dual-board surface (sol + atmo), liquid, view toggle and atmo halo shell.

Extends

Properties

group

ts
group: Group;

Inherited from

BodyBase.group


sim

ts
sim: BodySimulation;

Inherited from

BodyBase.sim


palette

ts
palette: TerrainLevel[];

Inherited from

BodyBase.palette


variation

ts
variation: BodyVariation;

Inherited from

BodyBase.variation


tileCount

ts
tileCount: number;

Number of sol tiles generated by the hexasphere.

Inherited from

BodyBase.tileCount


shadowUniforms

ts
shadowUniforms: ShadowUniforms;

Inherited from

BodyBase.shadowUniforms


occluderUniforms

ts
occluderUniforms: OccluderUniforms;

Inherited from

BodyBase.occluderUniforms


planetMaterial

ts
planetMaterial: BodyMaterial;

Inherited from

BodyBase.planetMaterial


hoverChannel

ts
hoverChannel: HoverChannel;

Inherited from

BodyBase.hoverChannel


graphicsUniforms

ts
graphicsUniforms: GraphicsUniforms;

Inherited from

BodyBase.graphicsUniforms


interactive

ts
interactive: BodyInteractive;

Inherited from

BodyBase.interactive


hover

ts
hover: BodyHover;

Inherited from

BodyBase.hover


kind

ts
kind: "planet";

Discriminant — narrows the union Body to the planet branch.


config

ts
config: PlanetConfig;

Narrowed to the planet branch of BodyConfig.

Overrides

BodyBase.config


atmoShell

ts
atmoShell: AtmoShellHandle | null;

Procedural atmosphere halo handle — null on bodies without an atmospheric layer or when atmosphereOpacity resolves to 0. Used by the 'shader' overview view; the playable atmo grid is the separate tiles.atmo board.


liquid

ts
liquid: BodyLiquid;

view

ts
view: BodyView;

tiles

ts
tiles: PlanetTiles;

Methods

tick()

ts
tick(dt): void;

Parameters

ParameterType
dtnumber

Returns

void

Inherited from

BodyBase.tick


dispose()

ts
dispose(): void;

Returns

void

Inherited from

BodyBase.dispose


warmup()

ts
warmup(
   renderer, 
   camera, 
options?): Promise<void>;

Pre-compiles every shader the body relies on, exploiting KHR_parallel_shader_compile when available so the CPU stays responsive while the GPU driver links programs in the background.

Call once after useBody() and before the first render — the caller is expected to keep a loader / skeleton visible until the promise resolves. Subsequent calls are inexpensive (Three.js caches compiled programs by material identity).

onProgress fires at each phase boundary — at the start (collecting), after every compile resolves, and at the end (done). Use it to drive a loading bar or a status string. Phase codes are stable across lib versions; see WarmupPhase.

Multi-camera scenes only need a single warmup pass — Three.js compiled programs are not bound to a specific camera matrix.

Parameters

ParameterTypeDescription
rendererWebGLRendererRenderer that owns the WebGL context. Programs are compiled into this renderer's program cache.
cameraCameraCamera used to derive view-dependent uniforms during compilation. Any scene camera works.
options?WarmupOptionsOptional progress hook.

Returns

Promise<void>

Inherited from

BodyBase.warmup


getCoreRadius()

ts
getCoreRadius(): number;

World radius of the opaque inner core sphere (radius * coreRadiusRatio).

Returns

number

Inherited from

BodyBase.getCoreRadius


getSurfaceRadius()

ts
getSurfaceRadius(): number;

World radius of the outer surface (= config.radius).

Returns

number

Inherited from

BodyBase.getSurfaceRadius

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