/** * Smooth sphere display mesh for non-interactive (overview) rendering. * * Vertices are colored using `sim.noise3D` — same seed + scale as tile * elevations. Resource colors are approximated by snapping each vertex * to its nearest tile, via the shared {@link buildSphericalNearestLookup} * spatial index. */ import * as THREE from 'three'; import type { TerrainLevel } from '../types/terrain.types'; import type { BodySimulation } from '../../sim/BodySimulation'; import type { BodyVariation } from './bodyVariation'; import { BodyMaterial } from '../../shaders'; import { type BodyTypeStrategy } from './bodyTypeStrategy'; import { type RenderQuality } from '../quality/renderQuality'; /** * Handle returned by {@link buildSmoothSphereMesh} — exposes the display * mesh, its material, and a `setSeaLevel` callback that repaints submerged * vertices and slides the shader ocean-mask waterline in lockstep with the * hex-view's liquid sphere. */ export interface SmoothSphereHandle { mesh: THREE.Mesh; planetMaterial: InstanceType; /** * Moves the smooth-sphere waterline to `worldRadius`. No-op on bodies * without a surface liquid. Rewrites vertex colours in-place (O(V)) so * submerged vertices flip to the sea anchor and emerged ones pick their * land band again, then pushes the equivalent simplex-space threshold * into the shader so cracks / lava / craters stay masked off-shore. */ setSeaLevel: (worldRadius: number) => void; /** * Re-runs the vertex-colour paint at the current sea level. Picks up * any mutations that landed on `sim.tileStates` since the last paint * (dig, terraform…) so the smooth sphere reflects the same terrain * the hex mesh shows. Cheap — O(V) over the sphere vertex count. */ repaint: () => void; /** * Stamps per-tile RGB into the smooth-sphere vertex buffer — one-shot * post-build paint that an off-lib consumer uses to project resource * tints onto the distant view. Subsequent sea-level / elevation * mutations go through {@link repaint} and overwrite this pass, matching * the "frozen at generation" smooth-sphere contract. */ paintFromTiles: (colors: Map) => void; } /** * Builds the smooth (non-hex) display sphere for a rocky/metallic body. * Uses procedural elevation + palette lookup to shade each vertex and a * `BodyMaterial` for detail noise, cracks and lava. * * @param sim - Pre-computed body simulation. * @param levels - Terrain palette driving vertex colouring. * @param variation - Optional body-scoped visual variation. * @returns - Handle bundling the mesh, the attached * {@link BodyMaterial}, and a live `setSeaLevel` callback. */ export declare function buildSmoothSphereMesh(sim: BodySimulation, levels: TerrainLevel[], variation?: BodyVariation, options?: { meshRadius?: number; quality?: RenderQuality; strategy?: BodyTypeStrategy; }): SmoothSphereHandle; //# sourceMappingURL=buildSmoothSphereMesh.d.ts.map