import type { Accessor, Document, Node } from '@gltf-transform/core'; /** * In-memory models of the two documents the fit works on: the posed BODY (read-only, precomputed once per * pose) and the GARMENT (its rest positions plus, per pose, the exact affine skinning map rest → posed). * Nothing here mutates a glTF document; the stage writes POSITION back only after its gate passes. */ export interface BodyPose { /** Posed positions of every body vertex, all skinned primitives concatenated (3 per vertex). */ positions: Float64Array; /** Posed unit normals (3 per vertex), or null when any body primitive lacks NORMAL. */ normals: Float64Array | null; } export interface BodyModel { vertexCount: number; /** Dominant-joint region per vertex (the checker's classification). */ regions: Array; poses: Map; } export declare function buildBodyModel(body: Document, poseNames?: readonly string[]): BodyModel; /** One skinned garment mesh — in a packaged add-on, one LOD level. */ export interface GarmentUnit { node: Node; /** Distinct POSITION accessors in this mesh, in concatenation order. */ accessors: Accessor[]; /** Start of each accessor's vertices in the concatenated arrays. */ accessorBase: number[]; vertexCount: number; /** Original rest positions, concatenated (3 per vertex). Never modified. */ rest: Float64Array; /** Triangles as concatenated vertex indices (3 per triangle). */ triangles: Int32Array; /** Per pose: posed ORIGINAL positions (3 per vertex) and the row-major linear part of each vertex's * blended skinning matrix (9 per vertex): posed(rest + Δ) = posedRest + L·Δ, exactly. */ poses: Map; } export interface GarmentModel { units: GarmentUnit[]; /** Why a mesh was left out of the fit, if any was. */ excluded: string[]; } export declare function buildGarmentModel(garment: Document, poseNames?: readonly string[]): GarmentModel; /** Posed positions of a unit for rest displacement `delta` (3 per vertex): posedRest + L·Δ. */ export declare function posedWithDelta(unit: GarmentUnit, poseName: string, delta: Float64Array): Float64Array;