import type * as THREEJS from "three"; import type { Base } from "./base-inputs"; /** * Interface for orbit camera internal state and methods. * Exposed through OrbitCameraController.orbitCamera property. */ export interface OrbitCameraInstance { autoRender: boolean; distanceMax: number; distanceMin: number; pitchAngleMax: number; pitchAngleMin: number; inertiaFactor: number; enableDamping: boolean; dampingFactor: number; focusObject: THREEJS.Object3D | null; frameOnStart: boolean; distance: number; pitch: number; yaw: number; pivotPoint: THREEJS.Vector3; focus(focusObject: THREEJS.Object3D, padding?: number): void; resetAndLookAtPoint(resetPoint: THREEJS.Vector3, lookAtPoint: THREEJS.Vector3): void; resetAndLookAtObject(resetPoint: THREEJS.Vector3, object: THREEJS.Object3D): void; reset(yaw: number, pitch: number, distance: number): void; update(dt: number): void; initializePivotPoint(point: THREEJS.Vector3): void; } /** * Interface for input handlers (mouse, touch, keyboard). */ export interface InputHandler { destroy(): void; } /** * Orbit camera controller returned by create method. * Contains the camera, orbit controls, and input handlers. */ export interface OrbitCameraController { orbitCamera: OrbitCameraInstance; camera: THREEJS.PerspectiveCamera; mouseInput: InputHandler | null; touchInput: InputHandler | null; keyboardInput: InputHandler | null; update: (dt: number) => void; destroy: () => void; } /** * Parameters for Three.js cameras: position, target, field of view and clipping planes, plus the * orbit-control settings that decide how a user moves the view. */ export declare namespace ThreeJSCamera { /** * Feeds `three.camera.orbitCamera.create`: where the orbiting camera starts around its pivot, * how far it may zoom and tilt, how fast it reacts and how its motion is smoothed. */ class OrbitCameraDto { constructor(distance?: number, pitch?: number, yaw?: number, distanceMin?: number, distanceMax?: number, pitchAngleMin?: number, pitchAngleMax?: number, orbitSensitivity?: number, distanceSensitivity?: number, panSensitivity?: number, inertiaFactor?: number, autoRender?: boolean, frameOnStart?: boolean, enableDamping?: boolean, dampingFactor?: number); /** * The point the camera looks at and circles around * @default [0, 0, 0] */ pivotPoint?: Base.Point3 | undefined; /** * How far from the pivot the camera starts, in scene units * @default 20 * @minimum 0 * @maximum Infinity * @step 1 */ distance?: number | undefined; /** * How far above or below the pivot the camera starts, in degrees; 0 is level, positive is * above looking down * @default 30 * @minimum -90 * @maximum 90 * @step 1 */ pitch?: number | undefined; /** * How far around the vertical axis the camera starts, in degrees * @default 45 * @minimum -Infinity * @maximum Infinity * @step 1 */ yaw?: number | undefined; /** * The closest the camera may zoom to the pivot, in scene units * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ distanceMin?: number | undefined; /** * The farthest the camera may zoom from the pivot, in scene units * @default 1000 * @minimum 0 * @maximum Infinity * @step 1 */ distanceMax?: number | undefined; /** * The lowest the camera may tilt, in degrees; -90 looks straight up from below * @default -90 * @minimum -90 * @maximum 90 * @step 1 */ pitchAngleMin?: number | undefined; /** * The highest the camera may tilt, in degrees; 90 looks straight down from above * @default 90 * @minimum -90 * @maximum 90 * @step 1 */ pitchAngleMax?: number | undefined; /** * How far a pointer drag turns the camera; higher turns faster * @default 0.3 * @minimum 0 * @maximum Infinity * @step 0.1 */ orbitSensitivity?: number | undefined; /** * How far a wheel step zooms the camera; higher zooms faster * @default 0.15 * @minimum 0 * @maximum Infinity * @step 0.01 */ distanceSensitivity?: number | undefined; /** * How far a pan drag moves the pivot; higher pans faster * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ panSensitivity?: number | undefined; /** * How much the camera keeps gliding after a drag, from 0 for none to 1 for most * @default 0.1 * @minimum 0 * @maximum 1 * @step 0.1 */ inertiaFactor?: number | undefined; /** * When true, the scene is rendered again whenever the camera moves * @default true */ autoRender?: boolean | undefined; /** * When true and a focus object is given, the camera starts framed on it * @default true */ frameOnStart?: boolean | undefined; /** * When true, camera moves ease in and out instead of stopping dead * @default true */ enableDamping?: boolean | undefined; /** * How quickly damped moves settle; lower is smoother but slower * @default 0.1 * @minimum 0.01 * @maximum 1 * @step 0.01 */ dampingFactor?: number | undefined; /** * An object to frame the camera on at the start, when given * @optional true */ focusObject?: THREEJS.Object3D | undefined; /** * The element the pointer and touch listeners attach to; left out, the whole page * @optional true */ domElement?: HTMLElement | undefined; } /** * A Three.js camera to work on; kept for camera methods that take just the camera. */ class CameraDto { constructor(camera?: THREEJS.PerspectiveCamera | THREEJS.OrthographicCamera); /** * The camera to work on * @default undefined */ camera: THREEJS.PerspectiveCamera | THREEJS.OrthographicCamera; } /** * A Three.js camera and the point to move it to; kept for camera methods that place the camera. */ class PositionDto { constructor(camera?: THREEJS.PerspectiveCamera | THREEJS.OrthographicCamera, position?: Base.Point3); /** * The camera to move * @default undefined */ camera: THREEJS.PerspectiveCamera | THREEJS.OrthographicCamera; /** * The point to move the camera to * @default [0, 0, 0] */ position?: Base.Point3 | undefined; } /** * Feeds `three.camera.orbitCamera.setPivotPoint` and `getPivotPoint` with the controller and * the point the camera circles around. */ class PivotPointDto { constructor(orbitCamera?: OrbitCameraController, pivotPoint?: Base.Point3); /** * The orbit camera controller, as `create` gave it * @default undefined */ orbitCamera: OrbitCameraController; /** * The point the camera looks at and circles around * @default [0, 0, 0] */ pivotPoint?: Base.Point3 | undefined; } /** * Feeds `three.camera.orbitCamera.focusOnObject` with the controller, the object to frame and * how much space to leave around it. */ class FocusObjectDto { constructor(orbitCamera?: OrbitCameraController, object?: THREEJS.Object3D, padding?: number); /** * The orbit camera controller, as `create` gave it * @default undefined */ orbitCamera: OrbitCameraController; /** * The object the camera backs off to fit in view * @default undefined */ object: THREEJS.Object3D; /** * Space left around the object as a factor; 1 fits it tightly, 1.5 leaves half again as * much room * @default 1.5 * @minimum 1 * @maximum Infinity * @step 0.1 */ padding?: number | undefined; } /** * Feeds `three.camera.orbitCamera.resetCamera` with the controller and the angles and distance * to put the camera at. */ class ResetCameraDto { constructor(orbitCamera?: OrbitCameraController, yaw?: number, pitch?: number, distance?: number); /** * The orbit camera controller, as `create` gave it * @default undefined */ orbitCamera: OrbitCameraController; /** * How far around the vertical axis, in degrees * @default 45 * @minimum -Infinity * @maximum Infinity * @step 1 */ yaw?: number | undefined; /** * How far above or below the pivot, in degrees; positive is above looking down * @default 30 * @minimum -90 * @maximum 90 * @step 1 */ pitch?: number | undefined; /** * How far from the pivot, in scene units * @default 20 * @minimum 0 * @maximum Infinity * @step 1 */ distance?: number | undefined; } /** * Feeds the `three.camera.orbitCamera` getters with the controller to read from. */ class OrbitCameraControllerDto { constructor(orbitCamera?: OrbitCameraController); /** * The orbit camera controller, as `create` gave it * @default undefined */ orbitCamera: OrbitCameraController; } /** * Feeds `three.camera.orbitCamera.setDistanceLimits` with the controller and how close and how * far the camera may zoom. */ class SetDistanceLimitsDto { constructor(orbitCamera?: OrbitCameraController, min?: number, max?: number); /** * The orbit camera controller, as `create` gave it * @default undefined */ orbitCamera: OrbitCameraController; /** * The closest the camera may zoom to the pivot, in scene units * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ min?: number | undefined; /** * The farthest the camera may zoom from the pivot, in scene units * @default 1000 * @minimum 0 * @maximum Infinity * @step 1 */ max?: number | undefined; } /** * Feeds `three.camera.orbitCamera.setPitchLimits` with the controller and how far down and up * the camera may tilt. */ class SetPitchLimitsDto { constructor(orbitCamera?: OrbitCameraController, min?: number, max?: number); /** * The orbit camera controller, as `create` gave it * @default undefined */ orbitCamera: OrbitCameraController; /** * The lowest the camera may tilt, in degrees; 0 keeps it above the ground plane * @default -90 * @minimum -90 * @maximum 90 * @step 1 */ min?: number | undefined; /** * The highest the camera may tilt, in degrees; 90 looks straight down * @default 90 * @minimum -90 * @maximum 90 * @step 1 */ max?: number | undefined; } }