/** * Atmosphere board mesh — playable hex grid floating above the sol surface. * * Built from a dedicated hexasphere (independent subdivision count from the * sol board), this mesh hosts the atmo gameplay: each tile is a flat * hex/pent prism spanning the radial slice * `[innerRadius, outerRadius]` (= `[solOuterRadius, atmoOuterRadius]`), all * tiles at the same height. The atmo board carries no elevation staircase * — it is purely a planar resource board, with a single colour per tile * driven by an off-lib resource overlay. * * Decoupled from the sol mesh by design: a sol tile id has no relation to * an atmo tile id, the two boards live on separate hexaspheres with their * own raycast targets. Mining "tile 42 atmo" is a strictly different * action from mining "tile 42 sol". */ import * as THREE from 'three'; import type { Tile } from '../../geometry/hexasphere.types'; import type { RaycastState } from '../body/interactiveController'; import type { RGB } from '../types/bodyHandle.types'; /** Inputs accepted by {@link buildAtmoBoardMesh}. */ export interface AtmoBoardMeshOptions { /** Atmosphere hexasphere tiles (own subdivision, ids unrelated to sol ids). */ tiles: readonly Tile[]; /** Inner radius of the atmo prism band (= sol outer radius). */ innerRadius: number; /** Outer radius of the atmo prism band (= body silhouette radius). */ outerRadius: number; /** Initial vertex colour applied to every tile before any overlay. */ defaultColor?: RGB; } /** * Public handle returned by {@link buildAtmoBoardMesh}. Mirrors the surface * of the sol board's interactive mesh closely enough that the orchestrator * (`assemblePlanetSceneGraph` + view switcher) can route hover, paint and * raycast through the same state machine. */ export interface AtmoBoardMesh { /** Root group that mounts the atmo mesh into the body scene graph. */ group: THREE.Group; /** Atmo tiles (re-export from input — convenience for downstream consumers). */ tiles: readonly Tile[]; /** Toggles the board's visibility wholesale. */ setVisible(visible: boolean): void; /** * Forces the board material to render with flat (light-independent) * shading when enabled. Used by the playable atmosphere view so the * star's directional lighting doesn't hide tiles on the night side. */ setFlatLighting(enabled: boolean): void; /** Stamps a single tile's vertex colour. Silently skips unknown ids. */ writeTileColor(tileId: number, rgb: RGB): void; /** Bulk overlay — same effect as calling `writeTileColor` once per entry. */ applyOverlay(colors: Map): void; /** * World-space top-cap centre of a tile (projected to `outerRadius`). * Returns `null` for unknown ids. Used by overlays that anchor markers * on the atmo board. */ getTilePosition(tileId: number): THREE.Vector3 | null; /** Resolves the raycast target for the atmo board (mesh + face → tile). */ getRaycastState(): RaycastState; /** * Runs a hover query against the atmo board's own BVH-accelerated mesh. * Returns the tile id under the ray, or `null` when the ray misses or * the board is hidden. The returned id is **only** comparable against * other atmo tile ids — atmo and sol live on independent hexaspheres, * so a sol id `42` and an atmo id `42` are unrelated. */ queryHover(raycaster: THREE.Raycaster, parentGroup: THREE.Object3D): number | null; /** * Highlights an atmo tile by overlaying a hover tint on top of its * current colour. Pass `null` to clear the highlight. The previous * colour is restored when the highlight clears or moves to another tile. * The hover tint is purely a vertex-colour overlay — no extra mesh. */ setHover(tileId: number | null, tint?: RGB): void; /** Releases the BVH and the merged geometry. Idempotent. */ dispose(): void; } /** * Builds the atmosphere board mesh from a dedicated hexasphere. * * The mesh is fully self-contained: own geometry, own BVH, own raycast * proxy. The orchestrator (`assemblePlanetSceneGraph`) mounts it on the * body group; the view switcher toggles its visibility against the sol * board. */ export declare function buildAtmoBoardMesh(options: AtmoBoardMeshOptions): AtmoBoardMesh; //# sourceMappingURL=buildAtmoBoardMesh.d.ts.map