/** * Legacy single-layer interactive hex mesh — used by the star path. * * Single merged hex mesh (1 draw call) + 2 hover overlay meshes: * - fill : additive semi-transparent fan covering the tile top face * - border: thin quad-strip along the tile boundary perimeter * * Planets use {@link buildLayeredInteractiveMesh} instead (two-band prism * with sol + atmo). Kept here because the star renderer has no atmo band * and can stay on the flat variant. */ import * as THREE from 'three'; import type { TerrainLevel } from '../types/terrain.types'; import type { BodySimulation } from '../../sim/BodySimulation'; import { type HoverConfig } from '../../config/render'; import type { HoverChannel } from '../state/hoverState'; import type { GraphicsUniforms } from '../hex/hexGraphicsUniforms'; import type { TileBaseVisual } from '../types/bodyHandle.types'; import { type TileGeometryInfo } from '../hex/hexMeshShared'; import { type BodyTypeStrategy } from './bodyTypeStrategy'; /** * Public surface of the interactive hex mesh. Exposes reusable primitives * (tileGeometry / writeTileColor / computeTileBaseRGB / onHoverChange / * surfaceOffset) that any overlay renderer can consume to paint tiles * without knowing about the underlying mesh layout. */ export interface InteractiveMesh { group: THREE.Group; faceToTileId: number[]; /** Baseline radial offset (body-relative) applied to the interactive surface. */ surfaceOffset: number; setFill: (on: boolean) => void; /** * Resolves the geometry context for a tile (tile + terrain level). * Returns null when the id is unknown. Consumed by overlay factories * such as `createTileOverlayMesh`. */ tileGeometry: (tileId: number) => TileGeometryInfo | null; /** * Writes a raw RGB value to every vertex of a tile in the merged color * buffer. No palette logic — callers decide the color. */ writeTileColor: (tileId: number, rgb: { r: number; g: number; b: number; }) => void; /** * 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. */ tileBaseVisual: (tileId: number) => TileBaseVisual | null; /** Advances the per-vertex shader animation clock (call each frame with elapsed seconds). */ tick: (elapsed: number) => void; dispose: () => void; } /** Required dependencies + optional tuning for the interactive hex mesh builder. */ export interface InteractiveMeshOptions { /** Per-body hover/pin publication channel — written on hover/pin changes. */ hoverChannel: HoverChannel; /** Per-body graphics uniform bag — wired into the hex terrain shader. */ graphicsUniforms: GraphicsUniforms; /** Optional hover overlay visual tuning. Falls back to {@link DEFAULT_HOVER}. */ hoverCfg?: HoverConfig; /** * Optional pre-resolved body-type strategy. When omitted, the builder * resolves it via `strategyFor(sim.config)`. Passing it through avoids * the redundant lookup when the orchestrator already resolved it. */ strategy?: BodyTypeStrategy; } /** * Builds the interactive hex mesh used when a body is focused — carries * the hover/pin overlays, per-tile color writebacks, and the per-vertex * shader animation clock. Returns an {@link InteractiveMesh} façade * consumed by the scene components. * * Star-only path: stars never carry a liquid surface, so this builder * does not mount any liquid shell. Planets go through the layered * variant ({@link buildLayeredInteractiveMesh}) which has its own. * * @param sim - Pre-computed body simulation. * @param levels - Terrain palette driving vertex colouring. * @param options - Per-body channels + optional tuning. See {@link InteractiveMeshOptions}. */ export declare function buildInteractiveMesh(sim: BodySimulation, levels: TerrainLevel[], options: InteractiveMeshOptions): InteractiveMesh; //# sourceMappingURL=buildInteractiveMesh.d.ts.map