loomlarge 0.2.0 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +126 -20
- package/dist/index.cjs +357 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +114 -30
- package/dist/index.d.ts +114 -30
- package/dist/index.js +358 -36
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -35,7 +35,39 @@ interface AUMappingConfig {
|
|
|
35
35
|
/**
|
|
36
36
|
* Helper type for mesh categories in morphToMesh
|
|
37
37
|
*/
|
|
38
|
-
type MorphCategory
|
|
38
|
+
type MorphCategory = 'face' | 'viseme' | 'eye' | 'tearLine' | 'tongue' | 'hair';
|
|
39
|
+
/**
|
|
40
|
+
* Mesh category types for character mesh classification
|
|
41
|
+
*/
|
|
42
|
+
type MeshCategory = 'body' | 'eye' | 'eyeOcclusion' | 'tearLine' | 'teeth' | 'tongue' | 'hair' | 'eyebrow' | 'cornea' | 'eyelash';
|
|
43
|
+
/**
|
|
44
|
+
* Blending mode names (matches Three.js constants)
|
|
45
|
+
*/
|
|
46
|
+
type BlendingMode = 'Normal' | 'Additive' | 'Subtractive' | 'Multiply' | 'None';
|
|
47
|
+
/**
|
|
48
|
+
* Blending mode options for Three.js materials
|
|
49
|
+
* Maps mode name to Three.js blending constant value
|
|
50
|
+
*/
|
|
51
|
+
declare const BLENDING_MODES: Record<BlendingMode, number>;
|
|
52
|
+
/**
|
|
53
|
+
* Material settings for mesh rendering
|
|
54
|
+
*/
|
|
55
|
+
interface MeshMaterialSettings {
|
|
56
|
+
renderOrder?: number;
|
|
57
|
+
transparent?: boolean;
|
|
58
|
+
opacity?: number;
|
|
59
|
+
depthWrite?: boolean;
|
|
60
|
+
depthTest?: boolean;
|
|
61
|
+
blending?: BlendingMode;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Mesh info including category, morph count, and optional material settings
|
|
65
|
+
*/
|
|
66
|
+
interface MeshInfo$1 {
|
|
67
|
+
category: MeshCategory;
|
|
68
|
+
morphCount: number;
|
|
69
|
+
material?: MeshMaterialSettings;
|
|
70
|
+
}
|
|
39
71
|
|
|
40
72
|
/**
|
|
41
73
|
* LoomLarge - Core Type Definitions
|
|
@@ -98,15 +130,11 @@ interface AUInfo {
|
|
|
98
130
|
faceArea?: 'Upper' | 'Lower';
|
|
99
131
|
facePart?: string;
|
|
100
132
|
}
|
|
101
|
-
/** Per-axis rotation state */
|
|
102
|
-
interface RotationAxisState {
|
|
103
|
-
value: number;
|
|
104
|
-
maxRadians: number;
|
|
105
|
-
}
|
|
133
|
+
/** Per-axis rotation state - simple -1 to 1 values like stable version */
|
|
106
134
|
interface CompositeRotationState {
|
|
107
|
-
pitch:
|
|
108
|
-
yaw:
|
|
109
|
-
roll:
|
|
135
|
+
pitch: number;
|
|
136
|
+
yaw: number;
|
|
137
|
+
roll: number;
|
|
110
138
|
}
|
|
111
139
|
type RotationsState = Record<string, CompositeRotationState>;
|
|
112
140
|
|
|
@@ -188,6 +216,7 @@ interface MeshInfo {
|
|
|
188
216
|
name: string;
|
|
189
217
|
visible: boolean;
|
|
190
218
|
morphCount: number;
|
|
219
|
+
category?: string;
|
|
191
220
|
}
|
|
192
221
|
/**
|
|
193
222
|
* LoomLarge Engine Interface
|
|
@@ -396,7 +425,49 @@ declare class LoomLargeThree implements LoomLarge {
|
|
|
396
425
|
setAU(id: number | string, v: number, balance?: number): void;
|
|
397
426
|
transitionAU(id: number | string, to: number, durationMs?: number, balance?: number): TransitionHandle;
|
|
398
427
|
getAU(id: number): number;
|
|
428
|
+
/**
|
|
429
|
+
* Set a continuum AU pair immediately (no animation).
|
|
430
|
+
*
|
|
431
|
+
* Sign convention:
|
|
432
|
+
* - Negative value (-1 to 0): activates negAU (e.g., head left, eyes left)
|
|
433
|
+
* - Positive value (0 to +1): activates posAU (e.g., head right, eyes right)
|
|
434
|
+
*
|
|
435
|
+
* @param negAU - AU ID for negative direction (e.g., 61 for eyes left)
|
|
436
|
+
* @param posAU - AU ID for positive direction (e.g., 62 for eyes right)
|
|
437
|
+
* @param continuumValue - Value from -1 (full negative) to +1 (full positive)
|
|
438
|
+
*/
|
|
439
|
+
setContinuum(negAU: number, posAU: number, continuumValue: number): void;
|
|
440
|
+
/**
|
|
441
|
+
* Smoothly transition a continuum AU pair (e.g., eyes left/right, head up/down).
|
|
442
|
+
* Takes a continuum value from -1 to +1 and internally manages both AU values.
|
|
443
|
+
*
|
|
444
|
+
* @param negAU - AU ID for negative direction (e.g., 61 for eyes left)
|
|
445
|
+
* @param posAU - AU ID for positive direction (e.g., 62 for eyes right)
|
|
446
|
+
* @param continuumValue - Target value from -1 (full negative) to +1 (full positive)
|
|
447
|
+
* @param durationMs - Transition duration in milliseconds
|
|
448
|
+
*/
|
|
449
|
+
transitionContinuum(negAU: number, posAU: number, continuumValue: number, durationMs?: number): TransitionHandle;
|
|
450
|
+
/**
|
|
451
|
+
* Set a morph target value.
|
|
452
|
+
*
|
|
453
|
+
* Fast paths (in order of speed):
|
|
454
|
+
* 1. Pass pre-resolved { infl, idx } array directly - zero lookups
|
|
455
|
+
* 2. String key with cache hit - one Map lookup
|
|
456
|
+
* 3. String key cache miss - dictionary lookup, then cached for next time
|
|
457
|
+
*/
|
|
399
458
|
setMorph(key: string, v: number, meshNames?: string[]): void;
|
|
459
|
+
setMorph(key: string, v: number, targets: {
|
|
460
|
+
infl: number[];
|
|
461
|
+
idx: number;
|
|
462
|
+
}[]): void;
|
|
463
|
+
/**
|
|
464
|
+
* Resolve morph key to direct targets for ultra-fast repeated access.
|
|
465
|
+
* Use this when you need to set the same morph many times (e.g., in animation loops).
|
|
466
|
+
*/
|
|
467
|
+
resolveMorphTargets(key: string, meshNames?: string[]): {
|
|
468
|
+
infl: number[];
|
|
469
|
+
idx: number;
|
|
470
|
+
}[];
|
|
400
471
|
transitionMorph(key: string, to: number, durationMs?: number, meshNames?: string[]): TransitionHandle;
|
|
401
472
|
setViseme(visemeIndex: number, value: number, jawScale?: number): void;
|
|
402
473
|
transitionViseme(visemeIndex: number, to: number, durationMs?: number, jawScale?: number): TransitionHandle;
|
|
@@ -409,7 +480,34 @@ declare class LoomLargeThree implements LoomLarge {
|
|
|
409
480
|
getActiveTransitionCount(): number;
|
|
410
481
|
resetToNeutral(): void;
|
|
411
482
|
getMeshList(): MeshInfo[];
|
|
483
|
+
/** Get all morph targets grouped by mesh name */
|
|
484
|
+
getMorphTargets(): Record<string, string[]>;
|
|
485
|
+
/** Get all resolved bone names and their current transforms */
|
|
486
|
+
getBones(): Record<string, {
|
|
487
|
+
position: [number, number, number];
|
|
488
|
+
rotation: [number, number, number];
|
|
489
|
+
}>;
|
|
412
490
|
setMeshVisible(meshName: string, visible: boolean): void;
|
|
491
|
+
/** Blending mode options for Three.js materials */
|
|
492
|
+
private static readonly BLENDING_MODES;
|
|
493
|
+
/** Get material config for a mesh */
|
|
494
|
+
getMeshMaterialConfig(meshName: string): {
|
|
495
|
+
renderOrder: number;
|
|
496
|
+
transparent: boolean;
|
|
497
|
+
opacity: number;
|
|
498
|
+
depthWrite: boolean;
|
|
499
|
+
depthTest: boolean;
|
|
500
|
+
blending: string;
|
|
501
|
+
} | null;
|
|
502
|
+
/** Set material config for a mesh */
|
|
503
|
+
setMeshMaterialConfig(meshName: string, config: {
|
|
504
|
+
renderOrder?: number;
|
|
505
|
+
transparent?: boolean;
|
|
506
|
+
opacity?: number;
|
|
507
|
+
depthWrite?: boolean;
|
|
508
|
+
depthTest?: boolean;
|
|
509
|
+
blending?: string;
|
|
510
|
+
}): void;
|
|
413
511
|
setAUMappings(mappings: AUMappingConfig): void;
|
|
414
512
|
getAUMappings(): AUMappingConfig;
|
|
415
513
|
private computeSideValues;
|
|
@@ -417,11 +515,16 @@ declare class LoomLargeThree implements LoomLarge {
|
|
|
417
515
|
private getMorphValue;
|
|
418
516
|
private isMixedAU;
|
|
419
517
|
private initBoneRotations;
|
|
518
|
+
/** Update rotation state - just stores -1 to 1 value like stable version */
|
|
420
519
|
private updateBoneRotation;
|
|
421
520
|
private updateBoneTranslation;
|
|
422
521
|
private transitionBoneRotation;
|
|
423
522
|
private transitionBoneTranslation;
|
|
424
523
|
private flushPendingComposites;
|
|
524
|
+
/**
|
|
525
|
+
* Apply composite rotation using quaternion composition like stable version.
|
|
526
|
+
* Looks up maxDegrees and channel from BONE_AU_TO_BINDINGS.
|
|
527
|
+
*/
|
|
425
528
|
private applyCompositeRotation;
|
|
426
529
|
private resolveBones;
|
|
427
530
|
private combineHandles;
|
|
@@ -603,27 +706,8 @@ declare const CC4_EYE_MESH_NODES: {
|
|
|
603
706
|
declare const AU_INFO: Record<string, AUInfo>;
|
|
604
707
|
/** Default mix weights (0 = morph only, 1 = bone only) */
|
|
605
708
|
declare const AU_MIX_DEFAULTS: Record<number, number>;
|
|
606
|
-
type MeshCategory = 'body' | 'eye' | 'eyeOcclusion' | 'tearLine' | 'teeth' | 'tongue' | 'hair' | 'eyebrow' | 'cornea' | 'eyelash';
|
|
607
|
-
/** Blending mode names (matches Three.js constants) */
|
|
608
|
-
type BlendingMode = 'Normal' | 'Additive' | 'Subtractive' | 'Multiply' | 'None';
|
|
609
|
-
/** Material settings for mesh rendering */
|
|
610
|
-
interface MeshMaterialSettings {
|
|
611
|
-
renderOrder?: number;
|
|
612
|
-
transparent?: boolean;
|
|
613
|
-
opacity?: number;
|
|
614
|
-
depthWrite?: boolean;
|
|
615
|
-
depthTest?: boolean;
|
|
616
|
-
blending?: BlendingMode;
|
|
617
|
-
}
|
|
618
|
-
/** Mesh info including category, morph count, and optional material settings */
|
|
619
|
-
interface CC4MeshInfo {
|
|
620
|
-
category: MeshCategory;
|
|
621
|
-
morphCount: number;
|
|
622
|
-
material?: MeshMaterialSettings;
|
|
623
|
-
}
|
|
624
709
|
/** Exact mesh name -> category mapping from the character GLB */
|
|
625
|
-
declare const CC4_MESHES: Record<string,
|
|
626
|
-
type MorphCategory = 'face' | 'viseme' | 'eye' | 'tearLine' | 'tongue' | 'hair';
|
|
710
|
+
declare const CC4_MESHES: Record<string, MeshInfo$1>;
|
|
627
711
|
/** Which mesh each morph category applies to */
|
|
628
712
|
declare const MORPH_TO_MESH: Record<MorphCategory, string[]>;
|
|
629
713
|
declare const CC4_PRESET: AUMappingConfig;
|
|
@@ -715,4 +799,4 @@ declare class HairPhysics {
|
|
|
715
799
|
reset(): void;
|
|
716
800
|
}
|
|
717
801
|
|
|
718
|
-
export { type AUInfo, type AUMappingConfig, AU_INFO, AU_MIX_DEFAULTS, AU_TO_MORPHS, type Animation, AnimationThree, BONE_AU_TO_BINDINGS, type BoneBinding, type BoneKey, CC4_BONE_NODES, CC4_EYE_MESH_NODES, CC4_MESHES, CC4_PRESET, COMPOSITE_ROTATIONS, CONTINUUM_LABELS, CONTINUUM_PAIRS_MAP, type CompositeRotation, type CompositeRotationState, DEFAULT_HAIR_PHYSICS_CONFIG, type HairMorphOutput$1 as HairMorphOutput, HairPhysics, type HairPhysicsConfig$1 as HairPhysicsConfig, type HairPhysics$1 as HairPhysicsInterface, type HairMorphOutput as HairPhysicsMorphOutput, type HairPhysicsState, type HairState, type HairStrand, type HeadState$1 as HeadState, type LoomEuler, type LoomLarge, type LoomLargeConfig, LoomLargeThree, type LoomMesh, type LoomObject3D, type LoomQuaternion, type LoomVector3, MORPH_TO_MESH, type MeshInfo, type
|
|
802
|
+
export { type AUInfo, type AUMappingConfig, AU_INFO, AU_MIX_DEFAULTS, AU_TO_MORPHS, type Animation, AnimationThree, BLENDING_MODES, BONE_AU_TO_BINDINGS, type BlendingMode, type BoneBinding, type BoneKey, CC4_BONE_NODES, CC4_EYE_MESH_NODES, CC4_MESHES, CC4_PRESET, COMPOSITE_ROTATIONS, CONTINUUM_LABELS, CONTINUUM_PAIRS_MAP, type CompositeRotation, type CompositeRotationState, DEFAULT_HAIR_PHYSICS_CONFIG, type HairMorphOutput$1 as HairMorphOutput, HairPhysics, type HairPhysicsConfig$1 as HairPhysicsConfig, type HairPhysics$1 as HairPhysicsInterface, type HairMorphOutput as HairPhysicsMorphOutput, type HairPhysicsState, type HairState, type HairStrand, type HeadState$1 as HeadState, type LoomEuler, type LoomLarge, type LoomLargeConfig, LoomLargeThree, type LoomMesh, type LoomObject3D, type LoomQuaternion, type LoomVector3, MORPH_TO_MESH, type MeshCategory, type MeshInfo, type MeshInfo$1 as MeshMaterialInfo, type MeshMaterialSettings, type MorphCategory, type ReadyPayload, type RotationAxis, type RotationsState, type TransitionHandle, VISEME_KEYS, collectMorphMeshes, LoomLargeThree as default, hasLeftRightMorphs, isMixedAU };
|
package/dist/index.d.ts
CHANGED
|
@@ -35,7 +35,39 @@ interface AUMappingConfig {
|
|
|
35
35
|
/**
|
|
36
36
|
* Helper type for mesh categories in morphToMesh
|
|
37
37
|
*/
|
|
38
|
-
type MorphCategory
|
|
38
|
+
type MorphCategory = 'face' | 'viseme' | 'eye' | 'tearLine' | 'tongue' | 'hair';
|
|
39
|
+
/**
|
|
40
|
+
* Mesh category types for character mesh classification
|
|
41
|
+
*/
|
|
42
|
+
type MeshCategory = 'body' | 'eye' | 'eyeOcclusion' | 'tearLine' | 'teeth' | 'tongue' | 'hair' | 'eyebrow' | 'cornea' | 'eyelash';
|
|
43
|
+
/**
|
|
44
|
+
* Blending mode names (matches Three.js constants)
|
|
45
|
+
*/
|
|
46
|
+
type BlendingMode = 'Normal' | 'Additive' | 'Subtractive' | 'Multiply' | 'None';
|
|
47
|
+
/**
|
|
48
|
+
* Blending mode options for Three.js materials
|
|
49
|
+
* Maps mode name to Three.js blending constant value
|
|
50
|
+
*/
|
|
51
|
+
declare const BLENDING_MODES: Record<BlendingMode, number>;
|
|
52
|
+
/**
|
|
53
|
+
* Material settings for mesh rendering
|
|
54
|
+
*/
|
|
55
|
+
interface MeshMaterialSettings {
|
|
56
|
+
renderOrder?: number;
|
|
57
|
+
transparent?: boolean;
|
|
58
|
+
opacity?: number;
|
|
59
|
+
depthWrite?: boolean;
|
|
60
|
+
depthTest?: boolean;
|
|
61
|
+
blending?: BlendingMode;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Mesh info including category, morph count, and optional material settings
|
|
65
|
+
*/
|
|
66
|
+
interface MeshInfo$1 {
|
|
67
|
+
category: MeshCategory;
|
|
68
|
+
morphCount: number;
|
|
69
|
+
material?: MeshMaterialSettings;
|
|
70
|
+
}
|
|
39
71
|
|
|
40
72
|
/**
|
|
41
73
|
* LoomLarge - Core Type Definitions
|
|
@@ -98,15 +130,11 @@ interface AUInfo {
|
|
|
98
130
|
faceArea?: 'Upper' | 'Lower';
|
|
99
131
|
facePart?: string;
|
|
100
132
|
}
|
|
101
|
-
/** Per-axis rotation state */
|
|
102
|
-
interface RotationAxisState {
|
|
103
|
-
value: number;
|
|
104
|
-
maxRadians: number;
|
|
105
|
-
}
|
|
133
|
+
/** Per-axis rotation state - simple -1 to 1 values like stable version */
|
|
106
134
|
interface CompositeRotationState {
|
|
107
|
-
pitch:
|
|
108
|
-
yaw:
|
|
109
|
-
roll:
|
|
135
|
+
pitch: number;
|
|
136
|
+
yaw: number;
|
|
137
|
+
roll: number;
|
|
110
138
|
}
|
|
111
139
|
type RotationsState = Record<string, CompositeRotationState>;
|
|
112
140
|
|
|
@@ -188,6 +216,7 @@ interface MeshInfo {
|
|
|
188
216
|
name: string;
|
|
189
217
|
visible: boolean;
|
|
190
218
|
morphCount: number;
|
|
219
|
+
category?: string;
|
|
191
220
|
}
|
|
192
221
|
/**
|
|
193
222
|
* LoomLarge Engine Interface
|
|
@@ -396,7 +425,49 @@ declare class LoomLargeThree implements LoomLarge {
|
|
|
396
425
|
setAU(id: number | string, v: number, balance?: number): void;
|
|
397
426
|
transitionAU(id: number | string, to: number, durationMs?: number, balance?: number): TransitionHandle;
|
|
398
427
|
getAU(id: number): number;
|
|
428
|
+
/**
|
|
429
|
+
* Set a continuum AU pair immediately (no animation).
|
|
430
|
+
*
|
|
431
|
+
* Sign convention:
|
|
432
|
+
* - Negative value (-1 to 0): activates negAU (e.g., head left, eyes left)
|
|
433
|
+
* - Positive value (0 to +1): activates posAU (e.g., head right, eyes right)
|
|
434
|
+
*
|
|
435
|
+
* @param negAU - AU ID for negative direction (e.g., 61 for eyes left)
|
|
436
|
+
* @param posAU - AU ID for positive direction (e.g., 62 for eyes right)
|
|
437
|
+
* @param continuumValue - Value from -1 (full negative) to +1 (full positive)
|
|
438
|
+
*/
|
|
439
|
+
setContinuum(negAU: number, posAU: number, continuumValue: number): void;
|
|
440
|
+
/**
|
|
441
|
+
* Smoothly transition a continuum AU pair (e.g., eyes left/right, head up/down).
|
|
442
|
+
* Takes a continuum value from -1 to +1 and internally manages both AU values.
|
|
443
|
+
*
|
|
444
|
+
* @param negAU - AU ID for negative direction (e.g., 61 for eyes left)
|
|
445
|
+
* @param posAU - AU ID for positive direction (e.g., 62 for eyes right)
|
|
446
|
+
* @param continuumValue - Target value from -1 (full negative) to +1 (full positive)
|
|
447
|
+
* @param durationMs - Transition duration in milliseconds
|
|
448
|
+
*/
|
|
449
|
+
transitionContinuum(negAU: number, posAU: number, continuumValue: number, durationMs?: number): TransitionHandle;
|
|
450
|
+
/**
|
|
451
|
+
* Set a morph target value.
|
|
452
|
+
*
|
|
453
|
+
* Fast paths (in order of speed):
|
|
454
|
+
* 1. Pass pre-resolved { infl, idx } array directly - zero lookups
|
|
455
|
+
* 2. String key with cache hit - one Map lookup
|
|
456
|
+
* 3. String key cache miss - dictionary lookup, then cached for next time
|
|
457
|
+
*/
|
|
399
458
|
setMorph(key: string, v: number, meshNames?: string[]): void;
|
|
459
|
+
setMorph(key: string, v: number, targets: {
|
|
460
|
+
infl: number[];
|
|
461
|
+
idx: number;
|
|
462
|
+
}[]): void;
|
|
463
|
+
/**
|
|
464
|
+
* Resolve morph key to direct targets for ultra-fast repeated access.
|
|
465
|
+
* Use this when you need to set the same morph many times (e.g., in animation loops).
|
|
466
|
+
*/
|
|
467
|
+
resolveMorphTargets(key: string, meshNames?: string[]): {
|
|
468
|
+
infl: number[];
|
|
469
|
+
idx: number;
|
|
470
|
+
}[];
|
|
400
471
|
transitionMorph(key: string, to: number, durationMs?: number, meshNames?: string[]): TransitionHandle;
|
|
401
472
|
setViseme(visemeIndex: number, value: number, jawScale?: number): void;
|
|
402
473
|
transitionViseme(visemeIndex: number, to: number, durationMs?: number, jawScale?: number): TransitionHandle;
|
|
@@ -409,7 +480,34 @@ declare class LoomLargeThree implements LoomLarge {
|
|
|
409
480
|
getActiveTransitionCount(): number;
|
|
410
481
|
resetToNeutral(): void;
|
|
411
482
|
getMeshList(): MeshInfo[];
|
|
483
|
+
/** Get all morph targets grouped by mesh name */
|
|
484
|
+
getMorphTargets(): Record<string, string[]>;
|
|
485
|
+
/** Get all resolved bone names and their current transforms */
|
|
486
|
+
getBones(): Record<string, {
|
|
487
|
+
position: [number, number, number];
|
|
488
|
+
rotation: [number, number, number];
|
|
489
|
+
}>;
|
|
412
490
|
setMeshVisible(meshName: string, visible: boolean): void;
|
|
491
|
+
/** Blending mode options for Three.js materials */
|
|
492
|
+
private static readonly BLENDING_MODES;
|
|
493
|
+
/** Get material config for a mesh */
|
|
494
|
+
getMeshMaterialConfig(meshName: string): {
|
|
495
|
+
renderOrder: number;
|
|
496
|
+
transparent: boolean;
|
|
497
|
+
opacity: number;
|
|
498
|
+
depthWrite: boolean;
|
|
499
|
+
depthTest: boolean;
|
|
500
|
+
blending: string;
|
|
501
|
+
} | null;
|
|
502
|
+
/** Set material config for a mesh */
|
|
503
|
+
setMeshMaterialConfig(meshName: string, config: {
|
|
504
|
+
renderOrder?: number;
|
|
505
|
+
transparent?: boolean;
|
|
506
|
+
opacity?: number;
|
|
507
|
+
depthWrite?: boolean;
|
|
508
|
+
depthTest?: boolean;
|
|
509
|
+
blending?: string;
|
|
510
|
+
}): void;
|
|
413
511
|
setAUMappings(mappings: AUMappingConfig): void;
|
|
414
512
|
getAUMappings(): AUMappingConfig;
|
|
415
513
|
private computeSideValues;
|
|
@@ -417,11 +515,16 @@ declare class LoomLargeThree implements LoomLarge {
|
|
|
417
515
|
private getMorphValue;
|
|
418
516
|
private isMixedAU;
|
|
419
517
|
private initBoneRotations;
|
|
518
|
+
/** Update rotation state - just stores -1 to 1 value like stable version */
|
|
420
519
|
private updateBoneRotation;
|
|
421
520
|
private updateBoneTranslation;
|
|
422
521
|
private transitionBoneRotation;
|
|
423
522
|
private transitionBoneTranslation;
|
|
424
523
|
private flushPendingComposites;
|
|
524
|
+
/**
|
|
525
|
+
* Apply composite rotation using quaternion composition like stable version.
|
|
526
|
+
* Looks up maxDegrees and channel from BONE_AU_TO_BINDINGS.
|
|
527
|
+
*/
|
|
425
528
|
private applyCompositeRotation;
|
|
426
529
|
private resolveBones;
|
|
427
530
|
private combineHandles;
|
|
@@ -603,27 +706,8 @@ declare const CC4_EYE_MESH_NODES: {
|
|
|
603
706
|
declare const AU_INFO: Record<string, AUInfo>;
|
|
604
707
|
/** Default mix weights (0 = morph only, 1 = bone only) */
|
|
605
708
|
declare const AU_MIX_DEFAULTS: Record<number, number>;
|
|
606
|
-
type MeshCategory = 'body' | 'eye' | 'eyeOcclusion' | 'tearLine' | 'teeth' | 'tongue' | 'hair' | 'eyebrow' | 'cornea' | 'eyelash';
|
|
607
|
-
/** Blending mode names (matches Three.js constants) */
|
|
608
|
-
type BlendingMode = 'Normal' | 'Additive' | 'Subtractive' | 'Multiply' | 'None';
|
|
609
|
-
/** Material settings for mesh rendering */
|
|
610
|
-
interface MeshMaterialSettings {
|
|
611
|
-
renderOrder?: number;
|
|
612
|
-
transparent?: boolean;
|
|
613
|
-
opacity?: number;
|
|
614
|
-
depthWrite?: boolean;
|
|
615
|
-
depthTest?: boolean;
|
|
616
|
-
blending?: BlendingMode;
|
|
617
|
-
}
|
|
618
|
-
/** Mesh info including category, morph count, and optional material settings */
|
|
619
|
-
interface CC4MeshInfo {
|
|
620
|
-
category: MeshCategory;
|
|
621
|
-
morphCount: number;
|
|
622
|
-
material?: MeshMaterialSettings;
|
|
623
|
-
}
|
|
624
709
|
/** Exact mesh name -> category mapping from the character GLB */
|
|
625
|
-
declare const CC4_MESHES: Record<string,
|
|
626
|
-
type MorphCategory = 'face' | 'viseme' | 'eye' | 'tearLine' | 'tongue' | 'hair';
|
|
710
|
+
declare const CC4_MESHES: Record<string, MeshInfo$1>;
|
|
627
711
|
/** Which mesh each morph category applies to */
|
|
628
712
|
declare const MORPH_TO_MESH: Record<MorphCategory, string[]>;
|
|
629
713
|
declare const CC4_PRESET: AUMappingConfig;
|
|
@@ -715,4 +799,4 @@ declare class HairPhysics {
|
|
|
715
799
|
reset(): void;
|
|
716
800
|
}
|
|
717
801
|
|
|
718
|
-
export { type AUInfo, type AUMappingConfig, AU_INFO, AU_MIX_DEFAULTS, AU_TO_MORPHS, type Animation, AnimationThree, BONE_AU_TO_BINDINGS, type BoneBinding, type BoneKey, CC4_BONE_NODES, CC4_EYE_MESH_NODES, CC4_MESHES, CC4_PRESET, COMPOSITE_ROTATIONS, CONTINUUM_LABELS, CONTINUUM_PAIRS_MAP, type CompositeRotation, type CompositeRotationState, DEFAULT_HAIR_PHYSICS_CONFIG, type HairMorphOutput$1 as HairMorphOutput, HairPhysics, type HairPhysicsConfig$1 as HairPhysicsConfig, type HairPhysics$1 as HairPhysicsInterface, type HairMorphOutput as HairPhysicsMorphOutput, type HairPhysicsState, type HairState, type HairStrand, type HeadState$1 as HeadState, type LoomEuler, type LoomLarge, type LoomLargeConfig, LoomLargeThree, type LoomMesh, type LoomObject3D, type LoomQuaternion, type LoomVector3, MORPH_TO_MESH, type MeshInfo, type
|
|
802
|
+
export { type AUInfo, type AUMappingConfig, AU_INFO, AU_MIX_DEFAULTS, AU_TO_MORPHS, type Animation, AnimationThree, BLENDING_MODES, BONE_AU_TO_BINDINGS, type BlendingMode, type BoneBinding, type BoneKey, CC4_BONE_NODES, CC4_EYE_MESH_NODES, CC4_MESHES, CC4_PRESET, COMPOSITE_ROTATIONS, CONTINUUM_LABELS, CONTINUUM_PAIRS_MAP, type CompositeRotation, type CompositeRotationState, DEFAULT_HAIR_PHYSICS_CONFIG, type HairMorphOutput$1 as HairMorphOutput, HairPhysics, type HairPhysicsConfig$1 as HairPhysicsConfig, type HairPhysics$1 as HairPhysicsInterface, type HairMorphOutput as HairPhysicsMorphOutput, type HairPhysicsState, type HairState, type HairStrand, type HeadState$1 as HeadState, type LoomEuler, type LoomLarge, type LoomLargeConfig, LoomLargeThree, type LoomMesh, type LoomObject3D, type LoomQuaternion, type LoomVector3, MORPH_TO_MESH, type MeshCategory, type MeshInfo, type MeshInfo$1 as MeshMaterialInfo, type MeshMaterialSettings, type MorphCategory, type ReadyPayload, type RotationAxis, type RotationsState, type TransitionHandle, VISEME_KEYS, collectMorphMeshes, LoomLargeThree as default, hasLeftRightMorphs, isMixedAU };
|