Interface: BodyLiquid
Surface liquid controls — no-ops on bodies without liquid configured (dry rocky, metallic, gaseous, stars).
Methods
setSeaLevel()
setSeaLevel(worldRadius): void;Sets the world-space radius of the liquid surface sphere.
Parameters
| Parameter | Type |
|---|---|
worldRadius | number |
Returns
void
setVisible()
setVisible(visible): void;Toggles the liquid surface visibility.
Parameters
| Parameter | Type |
|---|---|
visible | boolean |
Returns
void
setOpacity()
setOpacity(alpha): void;Sets the liquid surface alpha in [0, 1].
Parameters
| Parameter | Type |
|---|---|
alpha | number |
Returns
void
setColor()
setColor(color): void;Live-patches the liquid surface tint without rebuilding the body. Substance-agnostic — the caller resolves the chemistry (h2o, ch4, nh3, …) and pushes the resolved colour through. No-op on dry / frozen bodies.
Parameters
| Parameter | Type |
|---|---|
color | ColorRepresentation |
Returns
void
getRaycastState()
getRaycastState():
| {
mesh: Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material<MaterialEventMap> | Material<MaterialEventMap>[], Object3DEventMap>;
faceToTileId: readonly number[];
}
| null;Resolves the liquid shell's raycast target — mesh is the merged water cap, faceToTileId[i] returns the tile id of the i-th triangle. Returns null on dry / frozen bodies (no shell built). Lets callers raycast against the water surface and identify which submerged tile sits under the pointer.
Returns
| { mesh: Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material<MaterialEventMap> | Material<MaterialEventMap>[], Object3DEventMap>; faceToTileId: readonly number[]; } | null