/** * Camera animation system handling tweened transitions, inertia/momentum, * preset views, and first-person mode. * Extracted from Camera class using composition pattern. */ import type { Vec3 } from './types.js'; import type { CameraInternalState } from './camera-controls.js'; import type { CameraControls } from './camera-controls.js'; import type { CameraProjection } from './camera-projection.js'; /** * Manages camera animations: tweened transitions between positions, * inertia/momentum after user interaction, preset view switching * with rotation cycling, and first-person movement. */ export declare class CameraAnimator { private readonly state; private readonly updateMatrices; private readonly controls; private readonly projection; private velocity; private damping; private minVelocity; private animationStartTime; private animationDuration; private animationStartPos; private animationStartTarget; private animationEndPos; private animationEndTarget; private animationStartUp; private animationEndUp; private animationStartOrthoSize; private animationEndOrthoSize; private animationEasing; private isFirstPersonMode; private walkVelocity; private lastPresetView; private presetViewRotation; constructor(state: CameraInternalState, updateMatrices: () => void, controls: CameraControls, projection: CameraProjection); addOrbitVelocity(deltaX: number, deltaY: number): void; addPanVelocity(deltaX: number, deltaY: number, panSpeed: number): void; addZoomVelocity(normalizedDelta: number): void; /** * Reset preset view tracking (called when user orbits) */ resetPresetTracking(): void; /** * Update camera animation and inertia * Returns true if camera is still animating */ update(_deltaTime: number): boolean; /** * Frame/center view on a point (keeps current distance and direction) * Standard CAD "Frame Selection" behavior */ framePoint(point: Vec3, duration?: number): Promise; /** * Frame selection - zoom to fit bounds while keeping current view direction * This is what "Frame Selection" should do - zoom to fill screen */ frameBounds(min: Vec3, max: Vec3, duration?: number): Promise; zoomExtent(min: Vec3, max: Vec3, duration?: number): Promise; /** * Animate camera to position and target */ animateTo(endPos: Vec3, endTarget: Vec3, duration?: number, endOrthoSize?: number): Promise; /** * Animate camera to position, target, and up vector (for orthogonal preset views) */ animateToWithUp(endPos: Vec3, endTarget: Vec3, endUp: Vec3, duration?: number): Promise; /** * Easing function: easeOutCubic */ private easeOutCubic; /** * Set first-person mode */ enableFirstPersonMode(enabled: boolean): void; /** * Walk on the horizontal XZ plane (Y-up coordinate system). * Forward/backward moves in the camera's horizontal facing direction. * Left/right strafes perpendicular. Y position stays fixed (walking on ground). * Speed scales with scene size. Movement uses smooth acceleration to avoid * abrupt jumps — velocity ramps up over successive frames. */ moveFirstPerson(forward: number, right: number, _up: number): void; /** * Set preset view with explicit bounds (Y-up coordinate system) * Clicking the same view again rotates 90 degrees around the view axis * @param buildingRotation Optional building rotation in radians (from IfcSite placement) */ setPresetView(view: 'top' | 'bottom' | 'front' | 'back' | 'left' | 'right', bounds?: { min: Vec3; max: Vec3; }, buildingRotation?: number): void; /** * Get current bounds estimate (simplified - in production would use scene bounds) */ private getCurrentBounds; /** * Reset velocity (stop inertia) */ stopInertia(): void; /** * Reset camera animation state (clear inertia, cancel animations, reset preset tracking) * Called when loading a new model to ensure clean state */ reset(): void; } //# sourceMappingURL=camera-animation.d.ts.map