/** * Constraint Solver * * Applies constraints to transforms, limiting movement based on constraint type. * Handles hinge (rotation), slider (translation), ball joint, and more. */ import type { Constraint, Transform, Vector3 } from './types'; /** * Delta transform - change in position/rotation */ export interface TransformDelta { position?: Vector3; rotation?: Vector3; } /** * Constraint solver - applies constraints to transforms */ export declare class ConstraintSolver { /** * Apply constraint to a proposed transform change * * @param constraint - Constraint definition * @param current - Current transform state * @param delta - Proposed change * @param currentValue - Current constraint value (angle or distance) * @returns New transform and constraint value */ applyConstraint(constraint: Constraint, current: Transform, delta: TransformDelta, currentValue?: number): { transform: Transform; value: number; }; /** * Solve hinge constraint - rotation around a single axis */ private solveHinge; /** * Solve slider constraint - translation along a single axis */ private solveSlider; /** * Solve ball joint constraint - free rotation around pivot */ private solveBall; /** * Solve piston constraint - translation with rotation */ private solvePiston; /** * Solve planar constraint - movement within a 2D plane */ private solvePlanar; /** * Solve free constraint - no restrictions */ private solveFree; /** * Rotate transform around a pivot point */ private rotateAroundPivot; /** * Get rotation angle around a specific axis from quaternion */ private getAngleAroundAxis; /** * Project rotation to only affect rotation around specified axis */ private projectRotationToAxis; /** * Apply spring-back force to return value toward initial position */ applySpringBack(constraint: Constraint, currentValue: number, initialValue?: number, deltaTime?: number): number; /** * Check if value is at constraint limit */ isAtLimit(constraint: Constraint, value: number): 'min' | 'max' | null; /** * Snap value to nearest snap point if within threshold */ applySnap(constraint: Constraint, value: number): number; } //# sourceMappingURL=constraint-solver.d.ts.map