/** * FACSSystem.ts * * Facial Action Coding System — 52 Action Unit definitions, * compound expression presets, 15 viseme mappings, and morph * target delta computation utilities. * * Compatible with Apple ARKit, Unreal MetaHuman, VRM, and VTuber tracking. * * @see W.240: FACS 52 AUs are the universal facial expression standard * @see P.CHAR.001: Shape-Sculpt-to-Morph-Target pipeline * @see G.CHAR.001: Sparse morph targets to reduce memory (31MB → 3MB) * @module character */ export interface ActionUnitDefinition { /** FACS AU number (e.g., 1, 2, 4, ...) */ id: number; /** Standard FACS name */ name: string; /** Primary facial region affected */ region: 'brow' | 'eye' | 'nose' | 'mouth' | 'jaw' | 'tongue' | 'cheek' | 'head' | 'gaze'; /** Description of the muscular action */ description: string; /** Whether this AU is typically bilateral (left+right) */ bilateral: boolean; /** Apple ARKit blend shape name(s) mapping */ arkitMapping?: string[]; } export declare const FACS_ACTION_UNITS: ActionUnitDefinition[]; export interface CompoundExpression { name: string; weights: Record; } export declare const EXPRESSION_PRESETS: CompoundExpression[]; export interface VisemeDefinition { name: string; phonemes: string[]; weights: Record; } export declare const VISEME_15: VisemeDefinition[]; export interface VertexDelta { /** Index into the vertex buffer */ vertexIndex: number; /** Position delta (dx, dy, dz) */ delta: [number, number, number]; /** Normal delta (optional, for smooth lighting) */ normalDelta?: [number, number, number]; } export interface SparseMorphTarget { /** AU or viseme name */ name: string; /** Only vertices that actually moved (sparse — G.CHAR.001) */ deltas: VertexDelta[]; /** Total vertex count of the base mesh */ totalVertices: number; } /** * Compute sparse morph target from neutral and deformed meshes. * * Only stores vertices where the delta exceeds epsilon. * This reduces memory from ~31MB (52 AUs x 50K x 12B) to ~3MB. * * @param neutral - Neutral pose vertex positions (flat Float32Array, 3 values per vertex) * @param deformed - Deformed pose vertex positions (same layout) * @param epsilon - Minimum delta magnitude to include (default 0.0001) * @returns SparseMorphTarget with only affected vertices */ export declare function computeSparseMorphTarget(name: string, neutral: Float32Array, deformed: Float32Array, epsilon?: number): SparseMorphTarget; /** * Apply weighted morph targets to a base mesh. * * @param basePositions - Neutral pose positions (will be modified in place) * @param targets - Active morph targets with their weights */ export declare function applyMorphTargets(basePositions: Float32Array, targets: Array<{ target: SparseMorphTarget; weight: number; }>): void; /** * Evaluate a compound expression into individual AU weights. */ export declare function evaluateExpression(expressionName: string): Record; /** * Get AU definition by ID. */ export declare function getActionUnit(id: number): ActionUnitDefinition | undefined; /** * Get viseme definition by name. */ export declare function getViseme(name: string): VisemeDefinition | undefined; //# sourceMappingURL=FACSSystem.d.ts.map