import { VecN } from '@holotope/core'; import { type ConstraintParticipant4 } from './constraint-row4.js'; import { RigidBody4 } from './rigid-body4.js'; /** Dynamic body, prescribed rigid motion, or a fixed world participant. */ export type PointJointParticipant4 = ConstraintParticipant4; /** Four coupled bilateral velocity constraints at a pair of world-space anchors. */ export interface PointJointConstraint4 { /** Must be unique within a solver; persistent IDs retain warm impulses. */ readonly id: string; readonly participantA: PointJointParticipant4; readonly participantB: PointJointParticipant4; /** Current world-space anchor attached to participant A. */ readonly anchorA: VecN; /** Current world-space anchor attached to participant B. */ readonly anchorB: VecN; } export interface PointJointSolver4Options { /** Block Gauss-Seidel passes. Default 8. */ readonly iterations?: number; /** Fraction of anchor error corrected per step. Default 0.2. */ readonly baumgarte?: number; /** Anchor error ignored by velocity-level bias. Default 0.001. */ readonly positionSlop?: number; /** Upper bound on the bias target's R4 speed. Default 2. */ readonly maxBiasSpeed?: number; /** Apply coherent impulses retained from the previous solve. Default true. */ readonly warmStart?: boolean; } export interface PointJointResult4 { readonly id: string; /** Initial world-space anchor error `anchorA - anchorB`. */ readonly initialError: VecN; readonly initialRelativeVelocity: VecN; /** Desired `velocityA - velocityB`, including bounded position bias. */ readonly targetRelativeVelocity: VecN; /** Row-major 4x4 map from world impulse to relative anchor velocity. */ readonly response: Float64Array; /** Row-major inverse of `response`. */ readonly effectiveMass: Float64Array; readonly warmStartedImpulse: VecN; readonly accumulatedImpulse: VecN; readonly finalRelativeVelocity: VecN; readonly residualVelocity: VecN; } export interface PointJointSolveResult4 { readonly joints: readonly PointJointResult4[]; readonly retiredIds: readonly string[]; readonly iterations: number; readonly totalImpulse: number; readonly maxResidualSpeed: number; readonly maxAnchorError: number; } /** * Warm-started R4 point-joint solver. * * A point joint removes all four components of relative anchor velocity in one * coupled solve. Off-centre impulses therefore include the complete 4D * translational/rotational response rather than treating axes independently. */ export declare class PointJointSolver4 { readonly iterations: number; readonly baumgarte: number; readonly positionSlop: number; readonly maxBiasSpeed: number; readonly warmStart: boolean; private readonly blockSolver; constructor(options?: PointJointSolver4Options); solve(constraints: readonly PointJointConstraint4[], dt: number): PointJointSolveResult4; reset(): void; } export type PointJoint4Options = { readonly id: string; readonly bodyA: RigidBody4; readonly localAnchorA: VecN | ArrayLike; readonly bodyB: RigidBody4; readonly localAnchorB: VecN | ArrayLike; } | { readonly id: string; readonly bodyA: RigidBody4; readonly localAnchorA: VecN | ArrayLike; readonly bodyB?: null; readonly worldAnchorB: VecN | ArrayLike; }; /** Persistent local-anchor binding that resolves a fresh solver constraint. */ export declare class PointJoint4 { readonly id: string; readonly bodyA: RigidBody4; readonly localAnchorA: VecN; readonly bodyB: RigidBody4 | null; readonly anchorB: VecN; constructor(options: PointJoint4Options); worldAnchorA(): VecN; worldAnchorB(): VecN; constraint(): PointJointConstraint4; } /** Row-major 4x4 point-impulse response for a bilateral anchor pair. */ export declare function pointJointResponseMatrix4(constraint: PointJointConstraint4): Float64Array; /** Applies equal and opposite world impulses at the two joint anchors. */ export declare function applyPairPointImpulse4(constraint: PointJointConstraint4, impulseWorld: VecN): void; //# sourceMappingURL=point-joint4.d.ts.map