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
group: Group;Inherited from
sim
sim: BodySimulation;Inherited from
palette
palette: TerrainLevel[];Inherited from
variation
variation: BodyVariation;Inherited from
tileCount
tileCount: number;Number of sol tiles generated by the hexasphere.
Inherited from
shadowUniforms
shadowUniforms: ShadowUniforms;Inherited from
occluderUniforms
occluderUniforms: OccluderUniforms;Inherited from
planetMaterial
planetMaterial: BodyMaterial;Inherited from
hoverChannel
hoverChannel: HoverChannel;Inherited from
graphicsUniforms
graphicsUniforms: GraphicsUniforms;Inherited from
interactive
interactive: BodyInteractive;Inherited from
hover
hover: BodyHover;Inherited from
kind
kind: "planet";Discriminant — narrows the union Body to the planet branch.
config
config: PlanetConfig;Narrowed to the planet branch of BodyConfig.
Overrides
atmoShell
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
liquid: BodyLiquid;view
view: BodyView;tiles
tiles: PlanetTiles;Methods
tick()
tick(dt): void;Parameters
| Parameter | Type |
|---|---|
dt | number |
Returns
void
Inherited from
dispose()
dispose(): void;Returns
void
Inherited from
warmup()
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
| Parameter | Type | Description |
|---|---|---|
renderer | WebGLRenderer | Renderer that owns the WebGL context. Programs are compiled into this renderer's program cache. |
camera | Camera | Camera used to derive view-dependent uniforms during compilation. Any scene camera works. |
options? | WarmupOptions | Optional progress hook. |
Returns
Promise<void>
Inherited from
getCoreRadius()
getCoreRadius(): number;World radius of the opaque inner core sphere (radius * coreRadiusRatio).
Returns
number
Inherited from
getSurfaceRadius()
getSurfaceRadius(): number;World radius of the outer surface (= config.radius).
Returns
number