import { TransformN } from '@holotope/core'; import { type BroadphaseCandidateProviderN, type BroadphaseDiagnosticsN } from './broadphase.js'; import type { ContactMaterial4 } from './contact-material4.js'; import { ContactSolver4, type ContactParticipant4, type ContactSolveResult4, type ContactSolver4Options } from './normal-contact-solver4.js'; import { type HyperboxContactOptions4, type HyperboxContactPatch4, type HyperboxContactResult4 } from './hyperbox-contact4.js'; import { HyperboxSupportShape4 } from './hyperbox4.js'; import { NarrowphaseDispatcherN, type NarrowphaseHyperboxDeepManifoldResultN } from './narrowphase-dispatcher.js'; import type { PhysicsWorld4 } from './world4.js'; export interface HyperboxCollider4Options { readonly id: string; readonly halfExtents: ArrayLike; /** Dynamic body, pose-owning kinematic body, velocity-only motion, or null. */ readonly participant?: ContactParticipant4; /** Manual world pose for fixed/velocity-only colliders. Pose owners reject it. */ readonly transform?: TransformN; /** Pose of the box relative to a dynamic body's center/principal frame. */ readonly localTransform?: TransformN; readonly material?: ContactMaterial4; /** Unsigned 32-bit membership bits. Default 1. */ readonly collisionGroup?: number; /** Unsigned 32-bit accepted membership bits. Default all bits. */ readonly collisionMask?: number; readonly enabled?: boolean; } /** * A full-dimensional R4 hyperbox plus response and filtering policy. * * Dynamic and pose-owning kinematic collider poses are synchronized before * every query. A velocity-only `RigidMotion4` retains an explicit manual pose. */ export declare class HyperboxCollider4 { readonly id: string; readonly shape: HyperboxSupportShape4; readonly localTransform: TransformN; friction: number; restitution: number; collisionGroup: number; collisionMask: number; enabled: boolean; private _participant; private manualTransform; constructor(options: HyperboxCollider4Options); get participant(): ContactParticipant4; /** Replace response motion while retaining the current collider identity. */ setParticipant(participant: ContactParticipant4): this; /** Set the world pose of a fixed or velocity-only participant. */ setTransform(transform: TransformN): this; /** Synchronize the support shape from its authoritative pose. */ sync(): this; } /** * The same record as `ContactPipelinePair4`, for the pipeline that handles * hyperboxes only. * * Every union the general pipeline carries is a single type here — one kind of * collider, one narrowphase result, one kind of patch — because this pipeline * accepts nothing else. That is what it exists for: with the shape pair fixed, * the exact box-against-box construction is always the one that answers, and * neither dispatch nor a fallback is needed. * * Detection and response remain separate, as they are there: a patch means the * boxes touch, `responded` means the solver was given something to do. */ export interface HyperboxContactPair4 { /** Identity of the ordered pair, stable across steps for warm-starting. */ readonly id: string; /** The first box, in the order the pair was formed. */ readonly colliderA: HyperboxCollider4; /** The second. */ readonly colliderB: HyperboxCollider4; /** The narrowphase result, always the box deep-manifold capability. */ readonly narrowphase: NarrowphaseHyperboxDeepManifoldResultN; /** The underlying contact query, carried alongside so its separating axis * and feature detail are reachable without unwrapping the narrowphase. */ readonly query: HyperboxContactResult4; /** The contact region; `null` when the boxes do not touch. */ readonly patch: HyperboxContactPatch4 | null; /** Coulomb coefficient for this pair, combined from both policies. */ readonly friction: number; /** Restitution for this pair, likewise combined. */ readonly restitution: number; /** Constraints this pair contributed, by id. */ readonly constraintIds: readonly string[]; /** Whether it contributed any. */ readonly responded: boolean; } export interface HyperboxContactPipelineResult4 { readonly pairs: readonly HyperboxContactPair4[]; readonly response: ContactSolveResult4; readonly colliderCount: number; /** All mathematically possible active unordered pairs. */ readonly possiblePairs: number; /** Pairs retained by the configured candidate provider. */ readonly candidatePairs: number; readonly broadphaseRejectedPairs: number; readonly broadphase: BroadphaseDiagnosticsN; readonly filteredPairs: number; readonly narrowphasePairs: number; readonly contactPairs: number; readonly respondingPairs: number; readonly constraintCount: number; } export interface HyperboxContactWorldStep4 { readonly substeps: readonly HyperboxContactPipelineResult4[]; readonly final: HyperboxContactPipelineResult4; } export interface HyperboxContactPipeline4Options { readonly solver?: ContactSolver4; readonly solverOptions?: ContactSolver4Options; readonly contactOptions?: HyperboxContactOptions4; /** Default: temporally coherent sweep-and-prune over conservative R4 AABBs. */ readonly candidateProvider?: BroadphaseCandidateProviderN; /** Extra AABB expansion beyond the contact tolerance. Default 0. */ readonly broadphasePadding?: number; readonly narrowphaseDispatcher?: NarrowphaseDispatcherN; readonly mixFriction?: (frictionA: number, frictionB: number) => number; readonly mixRestitution?: (restitutionA: number, restitutionB: number) => number; readonly pairFilter?: (colliderA: HyperboxCollider4, colliderB: HyperboxCollider4) => boolean; } /** * Deterministic broadphase-to-response dispatch for the specialized R4 * hyperbox path. * * Active colliders are sorted by stable ID; a replaceable candidate provider * prunes pairs; filters run before narrowphase; every responding point is * solved in one shared `ContactSolver4` batch. */ export declare class HyperboxContactPipeline4 { readonly solver: ContactSolver4; readonly contactOptions: HyperboxContactOptions4; readonly candidateProvider: BroadphaseCandidateProviderN; readonly narrowphaseDispatcher: NarrowphaseDispatcherN; readonly broadphasePadding: number; private readonly colliders; private readonly mixFriction; private readonly mixRestitution; private readonly pairFilter; constructor(options?: HyperboxContactPipeline4Options); get size(): number; addCollider(collider: HyperboxCollider4): this; removeCollider(colliderOrId: HyperboxCollider4 | string): this; getCollider(id: string): HyperboxCollider4 | undefined; /** Synchronize every dynamic support shape to its current body pose. */ sync(): this; /** Query all admitted pairs and solve every active response constraint. */ solve(dt: number): HyperboxContactPipelineResult4; /** * Advance a `PhysicsWorld4` and run this pipeline at its velocity-constraint * seam. Colliders are resynchronized to the final integrated poses. */ stepWorld(world: PhysicsWorld4, dt: number, substeps?: number): HyperboxContactWorldStep4; reset(): void; } /** Stable, delimiter-safe ID for a canonically ordered collider pair. */ export declare function hyperboxPairId4(colliderIdA: string, colliderIdB: string): string; //# sourceMappingURL=hyperbox-contact-pipeline4.d.ts.map