/** * Single-band hex prism geometry — one closed prism per tile, spanning the * radial slice `[coreRadius, coreRadius + solHeight]`. * * The atmosphere shell used to ride above the sol prism in the same merged * geometry; that legacy two-band layout has been replaced by a dedicated * atmosphere board mesh built from its own hexasphere (see * {@link buildAtmoBoardMesh}). The sol mesh is now strictly one band per * tile — sol heights from `0` (collapsed prism, core visible) to * `shellThickness` (peak, top sits at `solOuterRadius`). * * Walls and bottom fan are **always emitted**, even when the prism collapses * (`solHeight === 0`). The triangles are degenerate in that case (zero-area) * and the GPU silently discards them. Stable vertex counts are a prerequisite * for live mutation (e.g. `updateTileSolHeight` after a dig) — the merged * buffer layout never has to be reallocated. */ import * as THREE from 'three'; import type { Tile } from '../../geometry/hexasphere.types'; /** * Vertex range produced by {@link buildLayeredPrismGeometry}: `[start, count)` * — `start` is the index of the first vertex and `count` is the number of * consecutive vertices in the prism. */ export interface PrismRange { start: number; count: number; } /** * Single-prism output bundle. The `geometry` is a non-indexed * `BufferGeometry` containing the tile's prism, the `range` describes the * vertex span (always starts at 0 for a single prism, but the type is kept * so the merged-mesh builder can cache it directly). * * Attributes set on the geometry: * - `position` (vec3) — world-space vertex positions. * - `normal` (vec3) — face normals (outward for top + walls, inward for bottom). * - `aSolHeight` (float) — sol band height used to build this tile, broadcast * to every vertex so the sol shader can derive a normalised height. */ export interface LayeredPrismGeometry { geometry: THREE.BufferGeometry; range: PrismRange; } /** * Builds the single-band hex prism for a tile — spans * `[coreRadius, coreRadius + solHeight]`, capped at the sol surface. * * `solHeight` is clamped to `[0, shellThickness]`. Callers pass the clamped * value — this function is the authority on the geometry layout, not on * the game rules that drive `solHeight`. * * The returned geometry is non-indexed (one triangle per 3 vertices), so * `mergeGeometries` can batch it across tiles without index shifts. * * @param tile - Hex/pentagon tile on the hexasphere. * @param coreRadius - World-space radius of the inner core sphere. * @param solHeight - World-space height of the sol band (`[0, shellThickness]`). * @param shellThickness - World-space radial span of the sol band, i.e. * `solOuterRadius - coreRadius`. */ export declare function buildLayeredPrismGeometry(tile: Tile, coreRadius: number, solHeight: number, shellThickness: number): LayeredPrismGeometry; //# sourceMappingURL=buildLayeredPrism.d.ts.map