Skip to content

Interface: LiquidShellHandle ​

Handle returned by buildLiquidShell.

Properties ​

group ​

ts
group: Group;

Root group — attach under the body's group.


mesh ​

ts
mesh: Mesh;

The merged liquid mesh — single draw call, single material.


faceToTileId ​

ts
faceToTileId: readonly number[];

faceToTileId[i] returns the tile id of the i-th triangle.


setTopElevation ​

ts
setTopElevation: (newTopBand) => void;

Re-elevates every prism to a new uniform top band (band space) so the cap surface tracks a moving sea level. Submerged tiles whose base is already at or above the new top end up collapsed.

Parameters ​

ParameterType
newTopBandnumber

Returns ​

void


setBaseElevation ​

ts
setBaseElevation: (updates) => void;

Re-bases the wall start of one or more tiles in band space. Used when the underlying sol cap moves (digging, scripted lift) so the liquid hex follows: a tile dug below the current waterline gains a liquid cap, a tile lifted above it loses it (collapses). Re-uses the last setTopElevation request as the clamp ceiling so the cap top stays on the current sea level after the mutation. Unknown tile ids are silently skipped.

Parameters ​

ParameterType
updatesReadonlyMap<number, number>

Returns ​

void


setVisible ​

ts
setVisible: (on) => void;

Toggles mesh visibility.

Parameters ​

ParameterType
onboolean

Returns ​

void


setOpacity ​

ts
setOpacity: (alpha) => void;

Updates the alpha in [0, 1]. Syncs the per-body shader uniform.

Parameters ​

ParameterType
alphanumber

Returns ​

void


setColor ​

ts
setColor: (color) => void;

Live-patches the liquid tint without rebuilding the material. The caller resolves the substance (h2o, ch4, …) and passes the resolved color in any THREE.ColorRepresentation form (hex string, hex int, THREE.Color). The shader's per-fragment colour shifts (foam, depth darken) keep working unchanged — they read the diffuse base after this update.

Parameters ​

ParameterType
colorColorRepresentation

Returns ​

void


tick ​

ts
tick: (elapsed) => void;

Advances the wave animation clock.

Parameters ​

ParameterType
elapsednumber

Returns ​

void


dispose ​

ts
dispose: () => void;

Releases GPU resources.

Returns ​

void

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