import { VecN } from '@holotope/core'; import { type GjkOptions, type GjkResult } from './gjk.js'; import { type SupportShapeN } from './support-shape.js'; export interface GjkMarginOptions extends GjkOptions { /** Spherical margin around shape A's convex core. */ marginA: number; /** Spherical margin around shape B's convex core. */ marginB: number; } export type GjkMarginStatus = 'separated' | 'margin-contact' | 'core-contact' | 'iteration-limit'; /** * Shallow-contact result for two convex cores surrounded by spherical margins. * `core-contact` is intentionally non-metric: once the cores touch or overlap, * closest-point GJK no longer supplies a trustworthy penetration normal. */ export interface GjkMarginResult { readonly status: GjkMarginStatus; readonly intersects: boolean | null; /** Core distance minus both margins; null after core contact/indeterminacy. */ readonly signedDistance: number | null; readonly distance: number | null; /** Penetration of margins only; null when the convex cores already contact. */ readonly penetrationDepth: number | null; /** Unit vector from B toward A while the cores remain separated. */ readonly normal: VecN | null; readonly closestPointA: VecN | null; readonly closestPointB: VecN | null; readonly contactPoint: VecN | null; readonly coreResult: GjkResult; } /** * Query rounded shapes by running GJK on their cores at positive distance. * This preserves a stable normal for ordinary shallow contacts and makes the * deep/core-overlap boundary explicit instead of fabricating EPA-like data. */ export declare function gjkMarginDistance(shapeA: SupportShapeN, shapeB: SupportShapeN, options: GjkMarginOptions): GjkMarginResult; //# sourceMappingURL=gjk-margin.d.ts.map