import * as THREE from 'three'; import type { InteractiveMesh as LegacyInteractiveMesh } from './buildInteractiveMesh'; /** * Current raycast target resolved at query time. Lets callers swap the * geometry the hover query runs against (e.g. the layered mesh exposes * a sol-only proxy in surface view and an atmo-only proxy in atmosphere * view so `firstHitOnly` returns the right tile regardless of depth * order). */ export interface RaycastState { /** * Mesh the raycaster targets. Expected to carry an accelerated raycast * (see `accelerateRaycast`); the matrix is synced from the body group * on every query when the mesh is not mounted in the scene graph. */ mesh: THREE.Mesh; /** Maps the hit `faceIndex` back to the original tile id. */ faceToTileId: number[]; /** * Local-space radius of the opaque inner core, used to reject hits the * user can't possibly see. A dug-out tile (no prism) is a window the * ray slips through, and without this guard the next triangle the BVH * returns can be an internal wall of a tile on the far side — a point * that is actually hidden behind the core mesh. Leave it at `0` for * bodies with no solid core (there is no occluder, so nothing to cull). */ coreRadius: number; } /** * Activate / deactivate / hover-query helpers for a body's interactive hex * mesh. Built on top of any `InteractiveMesh`-shaped handle (legacy hex or * layered prism), so star + planet paths share the same controller surface. */ export interface InteractiveController { activateInteractive(): void; deactivateInteractive(): void; queryHover(raycaster: THREE.Raycaster): number | null; } /** Optional knobs for {@link makeInteractiveController}. */ export interface InteractiveControllerOptions { /** * When `true` (default), the controller hot-swaps the smooth display * mesh for the interactive hex mesh on activate / deactivate (legacy * behaviour matching the star pipeline). * * When `false`, the smooth display mesh stays mounted in the group at * all times — the caller is responsible for piloting its * `mesh.visible` flag through the body's view machinery. Required when * the view layer needs the smooth sphere to remain in the scene graph * even while the interactive grid is active (e.g. gaseous bodies that * use the smooth sphere as a procedural-atmosphere backdrop behind * the playable sol hex grid). */ manageDisplay?: boolean; } /** * Builds the activate / deactivate / hover-query helpers shared by every * body type. Wires the smooth display mesh into a Three.js group, hot-swaps * it for the interactive hex mesh on activation (when `manageDisplay`), * and resolves raycaster hits back to tile ids. * * The raycast target is resolved through `getRaycastState` at every query, * so layered bodies can return a different mesh per view (sol / atmo) — * crucial for `firstHitOnly` BVH acceleration where the BVH only holds * the triangles of the currently-visible layer. * * @param group - Parent group both meshes are mounted into. * @param displayMesh - Smooth display mesh shown in nominal view. * @param getRaycastState - Resolves the current raycast mesh + face map. * @param interactive - Interactive hex / layered mesh handle. * @param options - Optional controller knobs (see {@link InteractiveControllerOptions}). */ export declare function makeInteractiveController(group: THREE.Group, displayMesh: THREE.Mesh, getRaycastState: () => RaycastState, interactive: LegacyInteractiveMesh, options?: InteractiveControllerOptions): InteractiveController; //# sourceMappingURL=interactiveController.d.ts.map