/** * VRM node constraints (`VRMC_node_constraint`) → the additive `helixConstraints` block. * * VRoid 1.0 exports hang twist helpers off the arms: `J_Roll_L_LowerArm` takes half of the hand's roll so a * forearm twists smoothly instead of collapsing like a candy wrapper, and the cloth weighted to those helpers * only looks right while they follow. The web import bakes AIM constraints into the skeleton (a joint that aims at a limb * can simply hang from it), but a ROLL or ROTATION constraint copies motion from one bone to another and has no * static equivalent, so it must be evaluated every frame. * * ── WHY WORLD FRAMES ─────────────────────────────────────────────────────────────────────────────────────────── * The spec defines both in terms of local quaternions and each node's own local axes ("roll about the * destination's X"). The converter rebuilds every local frame (`conform`, the 0.x flip, canonical reorientation), * so those axes no longer exist on the shipped rig. What survives is the geometry: where each node pointed in * the world at rest. So this records exactly that, in the converted model's frame, and the runtime evaluates the * same relation from it: * * roll the part of the source's parent-relative rotation that twists about `axis` (a world direction at * rest), copied to the destination at `weight`, as a rotation about the same direction. * rotation the source's parent-relative rotation, re-expressed in the destination's local axes (`srcRest` and * `dstRest` are the two nodes' world rest orientations) and slerped in at `weight`. * * Runtimes without the key ignore it and the helpers stay at rest, which is what they did before. */ export declare const CONSTRAINT_LIMITS: { readonly constraints: 64; }; export interface RollConstraint { kind: 'roll'; node: string; source: string; weight: number; axis: [number, number, number]; } export interface RotationConstraint { kind: 'rotation'; node: string; source: string; weight: number; /** World rest orientation (x, y, z, w) in the converted model's frame. */ srcRest: [number, number, number, number]; dstRest: [number, number, number, number]; } export type HelixConstraint = RollConstraint | RotationConstraint; export interface ConstraintJsonNode { name?: string; extensions?: { VRMC_node_constraint?: { constraint?: Record; }; }; } type Q = [number, number, number, number]; /** Rotation (x, y, z, w) of a column-major 4x4 with any uniform scale removed. */ export declare function quatFromMatrix(m: ArrayLike): Q; export interface ConstraintContext { /** Source node name → world matrix at rest, in the SOURCE file's frame. */ sourceWorld(sourceName: string): ArrayLike | undefined; /** Source node name → the converted rig's name for it if it is a skinned joint there, else undefined. */ resolve(sourceName: string): string | undefined; /** The source frame → converted model frame as a pure rotation (identity, or 180 degrees about Y for 0.x). */ frame: Q; } export declare function convertVrmConstraints(nodes: ReadonlyArray, ctx: ConstraintContext): { constraints: HelixConstraint[]; warnings: string[]; }; export {};