Interface: BodyBase
Fields common to every body handle — identity, state, lifecycle, radii, interactive + hover namespaces. Both PlanetBody and StarBody extend this base; the union Body is what useBody() actually returns.
Extended by
Properties
group
group: Group;config
config: BodyConfig;sim
sim: BodySimulation;palette
palette: TerrainLevel[];variation
variation: BodyVariation;tileCount
tileCount: number;Number of sol tiles generated by the hexasphere.
shadowUniforms
shadowUniforms: ShadowUniforms;occluderUniforms
occluderUniforms: OccluderUniforms;planetMaterial
planetMaterial: BodyMaterial;hoverChannel
hoverChannel: HoverChannel;graphicsUniforms
graphicsUniforms: GraphicsUniforms;interactive
interactive: BodyInteractive;hover
hover: BodyHover;Methods
tick()
tick(dt): void;Parameters
| Parameter | Type |
|---|---|
dt | number |
Returns
void
dispose()
dispose(): void;Returns
void
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>
getCoreRadius()
getCoreRadius(): number;World radius of the opaque inner core sphere (radius * coreRadiusRatio).
Returns
number
getSurfaceRadius()
getSurfaceRadius(): number;World radius of the outer surface (= config.radius).
Returns
number