import { BivectorN, TransformN, VecN } from '@holotope/core'; import type { HyperboxContactPatch4, HyperboxContactVertex4 } from './hyperbox-contact4.js'; import type { RigidBody4 } from './rigid-body4.js'; export type ContactTangentBasis4 = readonly [VecN, VecN, VecN]; /** Instantaneous world-space rigid motion, usable by dynamic or kinematic bodies. */ export interface RigidMotion4 { readonly center: VecN; readonly linearVelocity: VecN; readonly angularVelocityWorld: BivectorN; } export interface HyperboxContactKinematicsOptions4 { /** Evaluate the bounded solver subset (default) or every patch vertex. */ pointSource?: 'solver' | 'vertices'; /** Previous frame basis, projected forward to avoid tangent-coordinate flips. */ previousTangentBasis?: readonly VecN[]; /** Linear-independence band for frame construction. Default 1e-10. */ frameTolerance?: number; } export interface HyperboxContactPointKinematics4 { readonly id: string; readonly vertex: HyperboxContactVertex4; /** Original-pose surface anchor on A (resolved point minus `translationA`). */ readonly anchorA: VecN; /** Original-pose surface anchor on B. */ readonly anchorB: VecN; readonly velocityA: VecN; readonly velocityB: VecN; /** `velocityA - velocityB`. */ readonly relativeVelocity: VecN; /** Positive is separating along the B→A contact normal; negative is closing. */ readonly normalSpeed: number; readonly tangentialVelocity: VecN; readonly tangentSpeeds: readonly [number, number, number]; } export interface HyperboxContactKinematics4 { readonly normal: VecN; readonly tangentBasis: ContactTangentBasis4; readonly points: readonly HyperboxContactPointKinematics4[]; } /** Snapshot the instantaneous motion of a simulated dynamic body. */ export declare function rigidMotionFromBody4(body: RigidBody4): RigidMotion4; /** * Extract average world-space motion from two coherent rigid poses. * * This is the kinematic-driver bridge: animated platforms and authored motion * can participate in contact velocities without becoming dynamic bodies. */ export declare function rigidMotionFromTransforms4(previous: TransformN, current: TransformN, dt: number): RigidMotion4; /** World velocity `v + Ω·(point-center)` for an R4 rigid motion. */ export declare function velocityAtWorldPoint4(motion: RigidMotion4, point: VecN): VecN; /** * Builds the three-dimensional tangent basis of an R4 contact hyperplane. * A previous basis is parallel-projected and orthonormalized first, providing * coherent tangent coordinates under small normal changes. */ export declare function contactTangentBasis4(normal: VecN, previousBasis?: readonly VecN[], tolerance?: number): ContactTangentBasis4; /** Extract normal and full three-tangent relative velocity at every box anchor. */ export declare function hyperboxContactKinematics4(patch: HyperboxContactPatch4, motionA: RigidMotion4, motionB: RigidMotion4, options?: HyperboxContactKinematicsOptions4): HyperboxContactKinematics4; //# sourceMappingURL=contact-kinematics4.d.ts.map