import * as THREE from 'three'; import type { App, AppOptions } from '../core/app.js'; import type { StateSource } from '../state/controller.js'; import type { Disposable } from '../types.js'; /** Options for {@link createFpsScaffold}: `AppOptions` minus orbit/state, plus movement/look tuning and collision/terrain hooks. */ export interface FpsScaffoldOptions extends Omit, 'orbit' | 'state'> { state?: StateSource; /** Movement speed, units/second. Default 5. */ speed?: number; /** Radians of yaw/pitch per pixel of pointer movement. Default 0.0022. */ lookSpeed?: number; /** Camera height above the ground. Default 1.7. */ eyeHeight?: number; /** Request pointer lock on canvas click. Default true (drag-look otherwise). */ pointerLock?: boolean; /** Veto/adjust movement: return the corrected position, or null to block. */ collide?: (next: THREE.Vector3, previous: THREE.Vector3) => THREE.Vector3 | null; /** Terrain height under (x, z); eyeHeight rides on top of it. */ groundHeight?: (x: number, z: number) => number; } /** Handle returned by {@link createFpsScaffold}. `dispose()` removes all input listeners, detaches the state binding, and disposes the app. */ export interface FpsScaffold extends Disposable { app: App; /** Current yaw/pitch, readable for HUDs or minimap needles. */ orientation(): { yaw: number; pitch: number; }; } /** * First-person scaffold: pointer-lock mouse look plus WASD/arrow movement * applied to the camera in the ground plane, with optional collision and * terrain-height hooks. Movement is framerate-independent and nothing writes * back into app state. * * @param options - State source, `speed`/`lookSpeed`/`eyeHeight`, * `pointerLock` toggle, `collide` and `groundHeight` hooks, and the remaining * `AppOptions`. * @returns An {@link FpsScaffold} with the app and an `orientation()` reader * for HUDs. * @remarks Pitch clamps to ±1.45 rad. With `pointerLock: false` the look is * drag-based. `collide` may veto (return `null`) or correct the next * position; `groundHeight` re-bases `eyeHeight` on terrain. * @example * const fps = createFpsScaffold({ canvas, speed: 7, groundHeight: (x, z) => terrain.height(x, z) }) * fps.app.start() */ export declare function createFpsScaffold>({ state, speed, lookSpeed, eyeHeight, pointerLock, collide, groundHeight, ...appOptions }: FpsScaffoldOptions): FpsScaffold; //# sourceMappingURL=fps.d.ts.map