import { type Accessor, type Document, type Node, type Primitive } from '@gltf-transform/core'; export interface PoseDelta { joint: string; axis: readonly [number, number, number]; angleDeg: number; } export declare const FIT_POSES: Readonly>; export declare const FIT_POSE_NAMES: string[]; /** * Runs `fn` with `document` posed as `poseName`, then restores every touched node's exact local TRS — the * document is never left posed, so the same in-memory garment can be measured, fitted and written. */ export declare function withPose(document: Document, poseName: string, fn: () => T): T; /** Dominant-joint region label, exactly as the checker's `regionForJoint`. */ export declare function regionForJoint(jointName: string): string | null; export declare function regionGlobMatcher(globs: readonly string[]): ((region: string | null) => boolean) | null; /** Up to 8 influences per vertex (JOINTS_0/WEIGHTS_0 + JOINTS_1/WEIGHTS_1), flattened 8-wide. */ export interface Influences { count: number; joints: Int32Array; weights: Float64Array; /** Joint index with the largest weight (first wins on ties, as in the checker), or -1. */ dominant: Int32Array; } export declare function readInfluences(prim: Primitive, count: number): Influences; /** Per-joint skinning matrices (jointWorld · inverseBind) for a skinned node in the document's CURRENT pose. */ export declare function jointMatrices(node: Node): number[][]; /** * Per-vertex blended skinning matrix Σ wᵢ·Mᵢ / Σ wᵢ (16 per vertex, column-major). Linear blend skinning is * affine in the rest position, so posed = B·rest EXACTLY and posed displacement = linearPart(B)·Δrest * EXACTLY — the fit's posed→rest conversion is an exact inverse, not a linearisation. A vertex with no * usable weight falls back to its node's world matrix, as the checker does. */ export declare function blendMatrices(inf: Influences, mats: readonly number[][], nodeWorld: readonly number[]): Float64Array; /** * Posed positions (and unit normals) computed with EXACTLY the checker's floating-point recipe — * Σ wᵢ·(Mᵢ·p) accumulated influence by influence, then × (1/Σw); normals Σ wᵢ·(Mᵢ·n) normalised — so a * vertex sitting right at the 0.5mm threshold, or on a normal-flip boundary, lands on the same side in the * gate as in the checker. (Algebraically identical to `posePositions`, which the fit's own linearisation * uses; the two differ only in the last bits.) */ export declare function skinLikeChecker(rest: Float64Array, normals: Float64Array | null, inf: Influences, mats: readonly number[][], nodeWorld: readonly number[]): { positions: Float64Array; normals: Float64Array | null; }; /** posed = B · rest for every vertex. */ export declare function posePositions(rest: Float64Array, blended: Float64Array): Float64Array; /** Posed unit normals (linear part of B applied, renormalised — exact for the rigid-dominant blends the body uses). */ export declare function poseNormals(normals: Float64Array, blended: Float64Array): Float64Array; export declare function readVec3(accessor: Accessor): Float64Array; /** Every (node, mesh) pair that is skinned — the same set the checker walks. */ export declare function skinnedMeshNodes(document: Document): Node[];