Skip to content

Interface: LayeredInteractiveMesh

Sol interactive mesh interface — InteractiveMesh plus the mutation primitives that only make sense on the sol layer (height mutation, sea-level repaint, layered overlay).

Extends

Properties

group

ts
group: Group;

Inherited from

InteractiveMesh.group


faceToTileId

ts
faceToTileId: number[];

Inherited from

InteractiveMesh.faceToTileId


surfaceOffset

ts
surfaceOffset: number;

Baseline radial offset (body-relative) applied to the interactive surface.

Inherited from

InteractiveMesh.surfaceOffset


setFill

ts
setFill: (on) => void;

Parameters

ParameterType
onboolean

Returns

void

Inherited from

InteractiveMesh.setFill


tileGeometry

ts
tileGeometry: (tileId) => TileGeometryInfo | null;

Resolves the geometry context for a tile (tile + terrain level). Returns null when the id is unknown. Consumed by overlay factories such as createTileOverlayMesh.

Parameters

ParameterType
tileIdnumber

Returns

TileGeometryInfo | null

Inherited from

InteractiveMesh.tileGeometry


writeTileColor

ts
writeTileColor: (tileId, rgb) => void;

Writes a raw RGB value to every vertex of a tile in the merged color buffer. No palette logic — callers decide the color.

Parameters

ParameterType
tileIdnumber
rgb{ r: number; g: number; b: number; }
rgb.rnumber
rgb.gnumber
rgb.bnumber

Returns

void

Inherited from

InteractiveMesh.writeTileColor


tileBaseVisual

ts
tileBaseVisual: (tileId) => TileBaseVisual | null;

Resolves the pre-blend visual snapshot for a tile (palette colour + PBR + emissive + submerged flag). Lets off-lib consumers run their own resource-aware blend without reading the lib's blend internals. Returns null when the tile id is unknown.

Parameters

ParameterType
tileIdnumber

Returns

TileBaseVisual | null

Inherited from

InteractiveMesh.tileBaseVisual


tick

ts
tick: (elapsed) => void;

Advances the per-vertex shader animation clock (call each frame with elapsed seconds).

Parameters

ParameterType
elapsednumber

Returns

void

Inherited from

InteractiveMesh.tick


dispose

ts
dispose: () => void;

Returns

void

Inherited from

InteractiveMesh.dispose


totalThickness

ts
totalThickness: number;

Sol band thickness (solOuterRadius - coreRadius). Lets callers scale runtime heights into world units.


updateTileSolHeight

ts
updateTileSolHeight: (updates) => void;

Mutates the sol height of the given tiles in place. Rewrites position, normal and aSolHeight attributes for each affected tile — vertex counts stay stable thanks to always-emitted walls in buildLayeredPrismGeometry.

Silently skips unknown tile ids. Heights are clamped to [0, maxTerrainHeight].

Parameters

ParameterType
updatesMap<number, number>

Returns

void


getTilePosition

ts
getTilePosition: (tileId) => Vector3 | null;

World-space position at the top of the sol cap for a tile. Returns null for unknown ids. Consumers use it to anchor labels, projectors or resource markers on the sol board.

Parameters

ParameterType
tileIdnumber

Returns

Vector3 | null


applyTileOverlay

ts
applyTileOverlay: (colors) => void;

Stamps per-tile RGB into the sol vertex buffer. Same effect as InteractiveMesh.writeTileColor called in a loop, but flips the dirty flag once at the end.

Parameters

ParameterType
colorsMap<number, { r: number; g: number; b: number; }>

Returns

void


setSeaLevel

ts
setSeaLevel: (worldRadius) => void;

Sets the world-space radius of the liquid surface sphere. Use with LayeredInteractiveMesh.totalThickness to express runtime heights: e.g. setSeaLevel(coreRadius + userHeight). A value ≤ 0 hides the liquid mesh.

No-op when the body has no liquid configured (dry rocky, metallic, …).

Parameters

ParameterType
worldRadiusnumber

Returns

void


getSeaLevelRadius

ts
getSeaLevelRadius: () => number;

Current sea level world radius. Returns -1 on dry / frozen bodies (no liquid surface). Used by the upstream hover cursor as the cap radius for the liquid layer.

Returns

number


setLiquidVisible

ts
setLiquidVisible: (on) => void;

Toggles the liquid surface visibility. No-op on dry bodies.

Parameters

ParameterType
onboolean

Returns

void


setLiquidOpacity

ts
setLiquidOpacity: (alpha) => void;

Sets the liquid surface alpha in [0, 1]. No-op on dry bodies.

Parameters

ParameterType
alphanumber

Returns

void


setLiquidColor

ts
setLiquidColor: (color) => void;

Live-patches the liquid surface tint. No-op on dry / frozen bodies. Substance-agnostic — the caller resolves the chemistry (h2o, ch4, …) and passes the resolved colour through.

Parameters

ParameterType
colorColorRepresentation

Returns

void


setVisible

ts
setVisible: (on) => void;

Toggles the entire sol mesh visibility (sol + liquid).

Parameters

ParameterType
onboolean

Returns

void


setFlatLighting

ts
setFlatLighting: (enabled) => void;

Forces the sol material to render with flat (light-independent) shading when enabled. Used by the playable views ('surface', 'atmosphere') so star-driven shadows don't hide tiles on the night side of the body. PBR channels (roughness, metalness, future per-tile biome attributes) stay intact — only the directional contribution of scene lights is bypassed.

Parameters

ParameterType
enabledboolean

Returns

void


getRaycastState

ts
getRaycastState: () => RaycastState;

Resolves the raycast target for the sol mesh — the mesh itself, with its accelerated BVH. The mesh may be hidden by the view switcher; the controller copies the body's matrixWorld onto it before each query so raycasting still works while it sits invisible.

Returns

RaycastState


getLiquidRaycastState

ts
getLiquidRaycastState: () => 
  | {
  mesh: Mesh;
  faceToTileId: readonly number[];
}
  | null;

Resolves the raycast target for the liquid shell, when the body carries one. Returns null on dry bodies / frozen bodies (no liquid shell built). The mesh is the merged liquid cap; faceToTileId maps a triangle index back to the tile it covers, letting callers tell which water hex the user is hovering.

Returns

| { mesh: Mesh; faceToTileId: readonly number[]; } | null

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