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
group: Group;Inherited from
faceToTileId
faceToTileId: number[];Inherited from
surfaceOffset
surfaceOffset: number;Baseline radial offset (body-relative) applied to the interactive surface.
Inherited from
setFill
setFill: (on) => void;Parameters
| Parameter | Type |
|---|---|
on | boolean |
Returns
void
Inherited from
tileGeometry
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
| Parameter | Type |
|---|---|
tileId | number |
Returns
TileGeometryInfo | null
Inherited from
writeTileColor
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
| Parameter | Type |
|---|---|
tileId | number |
rgb | { r: number; g: number; b: number; } |
rgb.r | number |
rgb.g | number |
rgb.b | number |
Returns
void
Inherited from
InteractiveMesh.writeTileColor
tileBaseVisual
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
| Parameter | Type |
|---|---|
tileId | number |
Returns
TileBaseVisual | null
Inherited from
InteractiveMesh.tileBaseVisual
tick
tick: (elapsed) => void;Advances the per-vertex shader animation clock (call each frame with elapsed seconds).
Parameters
| Parameter | Type |
|---|---|
elapsed | number |
Returns
void
Inherited from
dispose
dispose: () => void;Returns
void
Inherited from
totalThickness
totalThickness: number;Sol band thickness (solOuterRadius - coreRadius). Lets callers scale runtime heights into world units.
updateTileSolHeight
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
| Parameter | Type |
|---|---|
updates | Map<number, number> |
Returns
void
getTilePosition
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
| Parameter | Type |
|---|---|
tileId | number |
Returns
Vector3 | null
applyTileOverlay
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
| Parameter | Type |
|---|---|
colors | Map<number, { r: number; g: number; b: number; }> |
Returns
void
setSeaLevel
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
| Parameter | Type |
|---|---|
worldRadius | number |
Returns
void
getSeaLevelRadius
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
setLiquidVisible: (on) => void;Toggles the liquid surface visibility. No-op on dry bodies.
Parameters
| Parameter | Type |
|---|---|
on | boolean |
Returns
void
setLiquidOpacity
setLiquidOpacity: (alpha) => void;Sets the liquid surface alpha in [0, 1]. No-op on dry bodies.
Parameters
| Parameter | Type |
|---|---|
alpha | number |
Returns
void
setLiquidColor
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
| Parameter | Type |
|---|---|
color | ColorRepresentation |
Returns
void
setVisible
setVisible: (on) => void;Toggles the entire sol mesh visibility (sol + liquid).
Parameters
| Parameter | Type |
|---|---|
on | boolean |
Returns
void
setFlatLighting
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
| Parameter | Type |
|---|---|
enabled | boolean |
Returns
void
getRaycastState
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
getLiquidRaycastState
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