import * as THREE from 'three'; import type { Disposable } from '../types.js'; /** Options for {@link createInfiniteGround}: tile size/radius/resolution, a `displace` height function, and material. */ export interface InfiniteGroundOptions { tileSize?: number; /** Tiles extend gridRadius cells in every direction: (2r+1)² tiles total. */ gridRadius?: number; segments?: number; /** World-space height function. Keep it pure — it re-runs on recenter. */ displace?: (x: number, z: number) => number; material?: THREE.Material; } /** Recentering tiled terrain. Call `update(center)` with the camera or player position each frame. */ export interface InfiniteGround extends Disposable { object: THREE.Group; /** Recenter tiles around a world position; call with the camera/player pos. */ update(center: THREE.Vector3): void; /** Sample the ground height at a world position. */ heightAt(x: number, z: number): number; } /** * Endless-looking ground from a fixed grid of displaced plane tiles that * recenter around a focus point — constant memory however far you travel. * * @param options - `tileSize` (default 32), `gridRadius` (default 2 → 5×5 * tiles), per-tile `segments`, a `displace(x, z)` height function, and * material. * @returns An {@link InfiniteGround}; `heightAt(x, z)` samples the same * displacement used for the mesh. * @remarks Recentering costs only the tiles that crossed a cell boundary; * frames with no boundary crossing do zero work. */ export declare function createInfiniteGround({ tileSize, gridRadius, segments, displace, material, }?: InfiniteGroundOptions): InfiniteGround; //# sourceMappingURL=infinite-ground.d.ts.map