import type { Vec2 } from "./geometry.js"; /** Closest point on segment `a`→`b` to `p`, and the clamped parameter `t` in [0,1] where it lies. */ export interface ClosestOnSegment { point: Vec2; t: number; } /** Closest point on the segment `a`→`b` to point `p`, with the clamped parameter `t` (0 at `a`, 1 at `b`). */ export declare function closestPointOnSegment(p: Vec2, a: Vec2, b: Vec2): ClosestOnSegment; /** A resolved circle-vs-segment contact. */ export interface CircleSegmentHit { /** Unit surface normal pointing from the segment toward the circle center — the axis to bounce off. */ normal: Vec2; /** Penetration depth; push the center out by `normal · depth` to separate. */ depth: number; /** Closest point on the segment (the contact point). */ contact: Vec2; /** Circle center pushed just outside the segment — a tunnel-proof resolved position. */ resolved: Vec2; } /** * Circle (center + `radius`) against a capsule segment `a`→`b` of half-thickness `thickness` (0 for a thin * wall). Returns the contact — surface normal, penetration depth, contact point, and the separated center — * or `null` when they do not overlap. Endpoints are rounded (the segment is a capsule), so a ball never * catches on a corner. Reflect the velocity across `normal` for the bounce; the pure geometry every 2D * ball game (pinball, breakout, air hockey) reimplemented per wall, bumper, and paddle. */ export declare function circleVsSegment(center: Vec2, radius: number, a: Vec2, b: Vec2, thickness?: number): CircleSegmentHit | null;