import type { OccupantPull, Vec3 } from './vehicleMath'; export declare const OCCUPANT_POSTURE_THRESHOLDS: { /** Torso angle from vertical, leaning back positive. FAIL outside [failMin, failMax], WARN outside [warnMin, warnMax]. */ readonly torsoFailMinDeg: 5; readonly torsoFailMaxDeg: 32; readonly torsoWarnMinDeg: 10; readonly torsoWarnMaxDeg: 28; /** Thigh (hip -> knee) elevation above horizontal, degrees. */ readonly thighFailMaxDeg: 35; readonly thighWarnMaxDeg: 30; readonly thighFailMinDeg: -25; /** * Skull to car, below the crown: a gap of this or less on `headPocketSides`+ sides is a snug head pocket. REPORTED ONLY since the * 2026-10-29 recalibration (a real sports seat holds the head at 0-20 mm: see the head_in_wings note above). */ readonly headPocketM: 0.06; readonly headPocketSides: 2; /** The skull surface sunk into the seat / headrest / cabin on any of back / left / right: FAIL beyond `headPenFailM`, WARN above `headPenWarnM`. */ readonly headPenFailM: 0.01; readonly headPenWarnM: 0.0005; }; export type OccupantPostureThresholds = typeof OCCUPANT_POSTURE_THRESHOLDS; export interface HeadGaps { /** Closest skull vertex to a car surface that lies wholly below the crown, per side of the head. Null: nothing within the search radius. */ behindM: number | null; leftM: number | null; rightM: number | null; /** The mesh each gap is against. */ behindMesh: string | null; leftMesh: string | null; rightMesh: string | null; /** How many of the three are within the pocket distance (information only: a snug pocket is normal in a sports seat). */ sidesEnclosed: number; /** How far the skull surface is SUNK into the car on each side, metres (0 = clear; the gaps above are 0 when this is not). Absent in older bundles. */ behindPenM?: number; leftPenM?: number; rightPenM?: number; /** The deepest of the three. The judge fails above `headPenFailM`, warns above `headPenWarnM`. */ maxPenM?: number; skullPoints: number; /** The skull's centre (mean of its vertices) and crown height in the car's body frame, metres: what a cabin edit needs to open a pocket around the head. */ skullCentreM?: Vec3 | null; crownY?: number | null; } export interface OccupantPosture { /** hip -> neck base from vertical, degrees, positive = leaning back. */ torsoDeg: number | null; /** hip -> head bone from vertical (reported only). */ headLeanDeg: number | null; /** The worse (higher) thigh of the two: hip -> knee above horizontal, degrees (positive = knee above the hip). */ thighDeg: number | null; /** Knee height above the hip bone, metres, the same thigh. */ kneeAboveHipM: number | null; /** Included angles, degrees: torso-thigh at the hip and thigh-shin at the knee (the thigh with the larger elevation). */ hipAngleDeg: number | null; kneeAngleDeg: number | null; /** Pelvis bone height above the lowest up-facing surface below it (the floor pan), metres, when the hips were measured. */ hPointAboveFloorM: number | null; head: HeadGaps | null; } /** Closest point on triangle (a,b,c) to p (Ericson, Real-Time Collision Detection 5.1.5). */ export declare function closestPointOnTriangle(p: Vec3, a: Vec3, b: Vec3, c: Vec3): Vec3; /** Squared distance from p to triangle (a,b,c). */ export declare function sqDistPointTriangle(p: Vec3, a: Vec3, b: Vec3, c: Vec3): number; /** * The skull's gap to the car on its back and on each side. The surfaces considered are the car triangles that lie WHOLLY below * the crown (the roof lining and everything above head height is `head_clearance`'s business, not a wing), within 0.45 m of the * head. Each skull vertex is assigned to the side it is on (behind the skull centre, or left/right of it, by whichever axis its offset is mostly along) and the gap is * the closest vertex to the closest such triangle. */ export declare function measureHeadGaps(pull: Pick & { pointBone?: number[]; boneNames?: string[]; }, pocketM?: 0.06): HeadGaps | null; /** Posture of one occupant from the same pull the other occupant measures read. `baseY` is `OccupantMeasure.hips.baseY`. */ export declare function measurePosture(pull: Pick & { pointBone?: number[]; boneNames?: string[]; }, baseY?: number | null): OccupantPosture; export interface PostureSeat { seatKey: string; role: string; posture?: OccupantPosture | null; } export interface PostureVerdict { id: string; pass: boolean; severity?: 'block' | 'warn'; detail: string; measured: Record; } /** The posture asserts. A seat whose bones could not be read is reported as a warn (not measured), never a silent pass. */ export declare function judgePosture(seats: PostureSeat[], T?: OccupantPostureThresholds): PostureVerdict[]; /** The thresholds in words, for the printed summary (read from the same constants the judges use). */ export declare const POSTURE_THRESHOLD_TEXT: Record;