import { VecN } from '@holotope/core'; import type { HyperboxSupportShape4 } from './hyperbox4.js'; import type { SupportShapeN } from './support-shape.js'; /** Closed axis-aligned bounding box in R^n. Touching intervals overlap. */ export declare class AxisAlignedBoundsN { readonly dim: number; readonly min: Float64Array; readonly max: Float64Array; constructor(min: ArrayLike, max: ArrayLike); overlaps(other: AxisAlignedBoundsN): boolean; } /** * Conservative world AABB from the 2n axial supports of any compact shape. * * `padding` should include the downstream narrowphase's contact tolerance. * A small scale-aware Float64 band also widens every interval to keep roundoff * at the support-to-bounds boundary from causing a false negative. */ export declare function supportShapeBoundsN(shape: SupportShapeN, padding?: number): AxisAlignedBoundsN; /** * Conservative AABB of a closed bounds under one complete linear translation. * * `displacement` is the motion over a normalized interval, not a velocity. * Every intermediate translated bounds is contained in the result. The * operation is dimension-independent and does not assume anything about the * shape which produced the starting bounds. */ export declare function sweptBoundsN(bounds: AxisAlignedBoundsN, displacement: VecN | ArrayLike): AxisAlignedBoundsN; /** Axial support bounds followed by their complete translational sweep. */ export declare function supportShapeSweptBoundsN(shape: SupportShapeN, displacement: VecN | ArrayLike, padding?: number): AxisAlignedBoundsN; /** Analytic R4 hyperbox AABB; equivalent to axial supports with one axis build. */ export declare function hyperboxBounds4(shape: HyperboxSupportShape4, padding?: number): AxisAlignedBoundsN; export interface BroadphaseProxyN { /** Stable identity; must be unique in one candidate query. */ readonly id: string; readonly bounds: AxisAlignedBoundsN; readonly value: T; } export interface BroadphaseCandidatePairN { readonly proxyA: BroadphaseProxyN; readonly proxyB: BroadphaseProxyN; } export interface BroadphaseDiagnosticsN { readonly providerId: string; readonly proxyCount: number; readonly possiblePairs: number; readonly candidatePairs: number; readonly rejectedPairs: number; /** Sweep axis, or null for a provider without one. */ readonly axis: number | null; /** Intervals surviving the primary-axis rejection. */ readonly primaryAxisOverlaps: number; /** Closed-interval tests on non-primary axes. */ readonly secondaryAxisTests: number; /** Adjacent swaps needed when a coherent sweep order was reused. */ readonly sortSwaps: number; readonly reusedOrder: boolean; } export interface BroadphaseCandidateResultN { readonly pairs: readonly BroadphaseCandidatePairN[]; readonly diagnostics: BroadphaseDiagnosticsN; } /** Candidate generation only; it must be conservative for its supplied bounds. */ export interface BroadphaseCandidateProviderN { readonly id: string; compute(proxies: readonly BroadphaseProxyN[]): BroadphaseCandidateResultN; reset?(): void; } /** Auditable O(n^2) reference which emits every unordered pair. */ export declare class AllPairsCandidateProviderN implements BroadphaseCandidateProviderN { readonly id = "all-pairs"; compute(proxies: readonly BroadphaseProxyN[]): BroadphaseCandidateResultN; } export interface SweepAndPruneCandidateProviderNOptions { /** Fixed coordinate axis, or adaptive center-spread selection. Default auto. */ readonly axis?: number | 'auto'; } /** * Deterministic single-axis sweep-and-prune with full ℝⁿ AABB rejection. * * The previous primary-axis order seeds insertion sort when proxy identity and * the chosen axis are coherent. Candidate output is always canonically sorted * by stable pair identity, independent of input and sweep order. */ export declare class SweepAndPruneCandidateProviderN implements BroadphaseCandidateProviderN { readonly id = "sweep-and-prune"; private readonly axisPolicy; private previousAxis; private previousOrder; constructor(options?: SweepAndPruneCandidateProviderNOptions); compute(proxies: readonly BroadphaseProxyN[]): BroadphaseCandidateResultN; reset(): void; private resolveAxis; } //# sourceMappingURL=broadphase.d.ts.map