import type { CabinTriangles, CamSpec, Vec3 } from './vehicleMath'; export interface FeetCameraInput { cabin: CabinTriangles; /** Cabin mesh names hidden for this frame (the seat's door panel, glass and card): they stop nothing and are not the sill. */ hiddenMeshes: ReadonlySet | readonly string[]; /** The occupant: skinned vertices (flat xyz, body frame), the bone each belongs to, and every bone's position. */ occupant: { points: number[]; pointBone?: number[]; boneNames?: string[]; bones: Record; }; /** Which side of the car the seat is on: the sign of the pelvis' x (1 = +x). */ side: number; pelvis: Vec3; /** Y of the crown (roof clearance), when measured. */ crownY?: number | null; } export interface DoorOpening { /** Where the opening was read from: the hidden door's own box, or (no door panel) the cabin's outer face near the seat. */ source: 'door-box' | 'cabin-extent'; /** x of the opening's outer face on the seat's side (signed, body frame). */ outerX: number; /** Fore/aft extent of the opening: the B-pillar side (aft) and the A-pillar side (fore) z. */ zAft: number; zFore: number; /** Top of the sill (the highest first surface under the opening, outboard of the seat) and the roof line over the opening. */ sillTopY: number; roofY: number; } export type FeetCameraKind = 'door-high' | 'cabin-above' | 'door-level'; export interface FeetVisibility { /** Fraction (0..1) of sampled vertices of the left/right foot that the lens sees. null = that foot has no samples. */ l: number | null; r: number | null; mean: number; min: number; } export interface FeetPlan { cam: CamSpec; kind: FeetCameraKind; opening: DoorOpening | null; seen: FeetVisibility; /** The frame may go to the critic: the feet are in view. */ judgeable: boolean; /** One sentence: why it is, or is not, judgeable. */ why: string; /** Feet (`left` / `right` of the avatar) that no lens could see: the caption says they are not judgeable. */ hiddenFeet: Array<'left' | 'right'>; /** Meshes that stood between the best lens and the feet, most-blocking first (empty when judgeable). */ blockers: string[]; candidates: number; /** What the OLD fixed placement would have seen from the same lens test (for the record). */ legacy: FeetVisibility | null; } /** * A frame is judgeable when at least one foot is clearly in view (>= 60 % of its sampled surface) and, over both feet, at least a * third of the surface is. A foot that stays hidden from every lens (a driver's far foot behind the footwell wall) is named in the * caption (`hiddenFeet`) as not judgeable, rather than the whole frame being thrown away or a critic voting on what it cannot see. */ export declare const FEET_MIN_BEST_VISIBLE = 0.6; export declare const FEET_MIN_MEAN_VISIBLE = 0.35; /** A foot below this share of its surface in view is called hidden in the caption. */ export declare const FEET_HIDDEN_BELOW = 0.3; /** The triangles of the soup minus the hidden meshes, as one flat array with its per-triangle mesh index. */ declare function visibleSoup(cabin: CabinTriangles, hidden: ReadonlySet): { tris: Float64Array; mesh: Int32Array; names: string[]; hiddenTris: number[]; }; /** Read the door opening off the hidden door's box and the cabin around it. */ export declare function measureDoorOpening(input: FeetCameraInput, soup: ReturnType, feetCentre: Vec3): DoorOpening; /** * Plan the feet camera. `null` only when the occupant has no foot vertices at all (nothing to photograph). * `legacy` is the fixed placement the capture used before (for the record, scored by the same lens test). */ export declare function planFeetCamera(input: FeetCameraInput, legacyPos?: Vec3): FeetPlan | null; /** What the capture records per seat (and what a reviewer reads to see the choice). */ export declare function feetPlanFacts(p: FeetPlan): Record; export {};