@lovelace_lol/embody 0.0.7 → 0.0.8
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 +541 -2394
- package/dist/index.d.ts +2 -100
- package/dist/index.js +7714 -12951
- package/dist/index.js.map +1 -1
- package/dist/three/annotations/DOMControls.d.ts +73 -0
- package/dist/three/annotations/DPthree.d.ts +113 -0
- package/dist/three/annotations/DPthree3DMarkers.d.ts +319 -0
- package/dist/three/annotations/DPthreeCameraController.d.ts +414 -0
- package/dist/three/annotations/DPthreeHTMLMarkers.d.ts +131 -0
- package/dist/three/annotations/DPthreeMarkers.d.ts +52 -0
- package/dist/three/annotations/adapter.d.ts +157 -0
- package/dist/three/annotations/animationFrameTaskScheduler.d.ts +18 -0
- package/dist/three/annotations/annotationAnchorModel.d.ts +16 -0
- package/dist/three/annotations/annotationCameraCore.d.ts +5 -0
- package/dist/three/annotations/boneResolutionProfile.d.ts +7 -0
- package/dist/three/annotations/index.d.ts +20 -0
- package/dist/three/annotations/loadFrame.d.ts +2 -0
- package/dist/three/annotations/markerSurfaceRaycast.d.ts +11 -0
- package/dist/three/annotations/markerVisibilityLifecycle.d.ts +21 -0
- package/dist/three/annotations/modelRenderPreparation.d.ts +6 -0
- package/dist/three/annotations/runtimeAnnotationPreview.d.ts +15 -0
- package/dist/three/annotations/runtimeAnnotationPreviewSide.d.ts +10 -0
- package/dist/three/annotations/runtimeAnnotationSidePreview.d.ts +5 -0
- package/dist/three/annotations/types.d.ts +262 -0
- package/dist/three/gaze.d.ts +122 -0
- package/dist/three/index.d.ts +147 -0
- package/dist/three/model.d.ts +31 -0
- package/dist/three/modelSkinning.d.ts +3 -0
- package/dist/three/reference-pose.d.ts +73 -0
- package/dist/three/scene.d.ts +253 -0
- package/dist/three/sceneRenderingBinding.d.ts +22 -0
- package/dist/three.js +7696 -8936
- package/dist/three.js.map +1 -1
- package/dist/wasm/README.md +551 -62
- package/dist/wasm/auto.d.ts +1 -0
- package/dist/wasm/embody_wasm.d.ts +388 -52
- package/dist/wasm/embody_wasm.js +1514 -119
- package/dist/wasm/embody_wasm_bg.wasm +0 -0
- package/dist/wasm/embody_wasm_bg.wasm.d.ts +115 -40
- package/dist/wasm/index.d.ts +126 -0
- package/dist/wasm.d.ts +1 -43
- package/dist/wasm.js +1043 -239
- package/dist/wasm.js.map +1 -1
- package/package.json +34 -39
- package/service-worker/character-asset-service-worker.js +295 -0
- package/dist/authoring/boneAuthoring.d.ts +0 -132
- package/dist/camera/annotationCameraAngles.d.ts +0 -28
- package/dist/camera/cameraRelativeGaze.d.ts +0 -15
- package/dist/camera/rustAnnotationCameraCore.d.ts +0 -136
- package/dist/cljs.cjs +0 -362
- package/dist/cljs.cjs.map +0 -1
- package/dist/cljs.d.ts +0 -5
- package/dist/cljs.js +0 -359
- package/dist/cljs.js.map +0 -1
- package/dist/core/TsClipCompiler.d.ts +0 -51
- package/dist/core/WasmRuntimeCore.d.ts +0 -41
- package/dist/core/compositeAxis.d.ts +0 -4
- package/dist/core/contracts/abi.d.ts +0 -70
- package/dist/core/contracts/clip.d.ts +0 -44
- package/dist/core/contracts/frame.d.ts +0 -27
- package/dist/core/contracts/host.d.ts +0 -28
- package/dist/core/contracts/ids.d.ts +0 -15
- package/dist/core/contracts/index.d.ts +0 -10
- package/dist/core/contracts/model.d.ts +0 -31
- package/dist/core/contracts/primitives.d.ts +0 -17
- package/dist/core/contracts/skeletonFit.d.ts +0 -41
- package/dist/core/index.d.ts +0 -6
- package/dist/core/types.d.ts +0 -472
- package/dist/core.cjs +0 -343
- package/dist/core.cjs.map +0 -1
- package/dist/core.js +0 -323
- package/dist/core.js.map +0 -1
- package/dist/engines/three/Embody.d.ts +0 -372
- package/dist/engines/three/ThreeAnimationRuntime.d.ts +0 -203
- package/dist/engines/three/ThreeClipAdapter.d.ts +0 -24
- package/dist/engines/three/ThreeFrameApplier.d.ts +0 -68
- package/dist/engines/three/ThreeModelInspector.d.ts +0 -54
- package/dist/engines/three/bakedClipPartitioning.d.ts +0 -16
- package/dist/engines/three/balanceUtils.d.ts +0 -3
- package/dist/engines/three/characterHost.d.ts +0 -80
- package/dist/engines/three/characterScene.d.ts +0 -98
- package/dist/engines/three/hair/HairPhysicsController.d.ts +0 -124
- package/dist/engines/three/index.d.ts +0 -20
- package/dist/engines/three/modelLoader.d.ts +0 -61
- package/dist/engines/three/profileTestScene.d.ts +0 -52
- package/dist/engines/three/types.d.ts +0 -20
- package/dist/hair/appearance.d.ts +0 -29
- package/dist/index.cjs +0 -14871
- package/dist/index.cjs.map +0 -1
- package/dist/interfaces/Animation.d.ts +0 -315
- package/dist/interfaces/EmbodyRuntime.d.ts +0 -90
- package/dist/interfaces/Hair.d.ts +0 -181
- package/dist/interfaces/HairPhysics.d.ts +0 -90
- package/dist/interfaces/index.d.ts +0 -11
- package/dist/mappings/extendPresetWithProfile.d.ts +0 -17
- package/dist/mappings/types.d.ts +0 -309
- package/dist/mappings/visemeSystem.d.ts +0 -26
- package/dist/physics/HairPhysics.d.ts +0 -86
- package/dist/physics/RustHairPhysics.d.ts +0 -18
- package/dist/physics/index.d.ts +0 -6
- package/dist/preset.cjs +0 -2005
- package/dist/preset.cjs.map +0 -1
- package/dist/preset.js +0 -2003
- package/dist/preset.js.map +0 -1
- package/dist/presets/bettaFish.d.ts +0 -328
- package/dist/presets/cc4.d.ts +0 -145
- package/dist/presets/index.d.ts +0 -30
- package/dist/presets/registry.d.ts +0 -57
- package/dist/profiles/resolveProfileConfig.d.ts +0 -36
- package/dist/profiles/rustResolvedProfile.d.ts +0 -31
- package/dist/profiles/types.d.ts +0 -118
- package/dist/regions/normalizeRegionTree.d.ts +0 -6
- package/dist/regions/regionMapping.d.ts +0 -17
- package/dist/regions/types.d.ts +0 -122
- package/dist/skeletonTemplates/humanoidSkeletonTemplates.d.ts +0 -32
- package/dist/test/setupWasm.d.ts +0 -1
- package/dist/three.cjs +0 -9550
- package/dist/three.cjs.map +0 -1
- package/dist/validation/analyzeModel.d.ts +0 -68
- package/dist/validation/extractModelData.d.ts +0 -90
- package/dist/validation/generateMappingCorrections.d.ts +0 -32
- package/dist/validation/geometryHelpers.d.ts +0 -66
- package/dist/validation/types.d.ts +0 -10
- package/dist/validation/validateMappings.d.ts +0 -77
- package/dist/wasm.cjs +0 -302
- package/dist/wasm.cjs.map +0 -1
- package/dist/wasmTypes.d.ts +0 -123
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Profile } from './types';
|
|
2
|
-
import type { EmbodyCoreWasmModule } from '../wasmTypes';
|
|
3
|
-
/**
|
|
4
|
-
* Extend a base preset with a profile extension.
|
|
5
|
-
*
|
|
6
|
-
* Implemented by the Rust Wasm core.
|
|
7
|
-
*
|
|
8
|
-
* Rules:
|
|
9
|
-
* - Scalars: extension wins when provided.
|
|
10
|
-
* - Maps: shallow-merged by key, values cloned.
|
|
11
|
-
* - Mesh entries: merged by mesh name, including nested material settings.
|
|
12
|
-
* - Arrays: replaced when the extension provides them (except annotationRegions).
|
|
13
|
-
* - annotationRegions: merged by region name, with nested camera/style fields preserved.
|
|
14
|
-
*/
|
|
15
|
-
export declare function mergePresetWithProfile(core: EmbodyCoreWasmModule, base: Profile, extension?: Partial<Profile>): Profile;
|
|
16
|
-
/** Resolve a preset/profile pair through this package entry's Wasm loader. */
|
|
17
|
-
export declare function extendPresetWithProfile(base: Profile, extension?: Partial<Profile>): Promise<Profile>;
|
package/dist/mappings/types.d.ts
DELETED
|
@@ -1,309 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Embody - Profile Types
|
|
3
|
-
*
|
|
4
|
-
* Type definitions for character profiles.
|
|
5
|
-
* Profiles define how Action Units map to morphs/bones for a specific rig.
|
|
6
|
-
*/
|
|
7
|
-
import type { BoneBinding, AUInfo, CompositeRotation } from '../core/types';
|
|
8
|
-
import type { AnnotationRegion } from '../regions/types';
|
|
9
|
-
export type { AnnotationRegion } from '../regions/types';
|
|
10
|
-
/**
|
|
11
|
-
* Profile - Complete configuration for AU-to-morph/bone mappings
|
|
12
|
-
*
|
|
13
|
-
* This is the main configuration object that defines how Action Units
|
|
14
|
-
* map to morph targets and bone transformations for a specific rig type.
|
|
15
|
-
*/
|
|
16
|
-
export interface Profile {
|
|
17
|
-
/** Human-readable name for this profile (e.g., 'Character Creator 4', 'Betta Fish') */
|
|
18
|
-
name?: string;
|
|
19
|
-
/** Type of animal/creature this profile is for (e.g., 'human', 'fish', 'dog') */
|
|
20
|
-
animalType?: string;
|
|
21
|
-
/** Emoji representing this animal type (e.g., '😊' for human, '🐟' for fish) */
|
|
22
|
-
emoji?: string;
|
|
23
|
-
/** AU ID to morph target names split by side */
|
|
24
|
-
auToMorphs: Record<number, MorphTargetsBySide>;
|
|
25
|
-
/** AU ID to bone bindings (e.g., AU 51 → [{ node: 'HEAD', channel: 'ry', scale: 1, maxDegrees: 30 }]) */
|
|
26
|
-
auToBones: Record<number, BoneBinding[]>;
|
|
27
|
-
/** Bone key to actual node name in the model (e.g., 'HEAD' → 'Head' or 'CC_Base_Head') */
|
|
28
|
-
boneNodes: Record<string, string>;
|
|
29
|
-
/**
|
|
30
|
-
* Optional: Prefix to prepend to bone names when resolving nodes.
|
|
31
|
-
* If set, boneNodes should contain base names without prefix (e.g., 'Head' instead of 'CC_Base_Head').
|
|
32
|
-
* The engine will try: prefix + baseName + suffix, then fuzzy match with suffixPattern.
|
|
33
|
-
*/
|
|
34
|
-
bonePrefix?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Optional: Suffix to append to bone names when resolving nodes.
|
|
37
|
-
* Combined with bonePrefix: prefix + baseName + suffix (e.g., 'Bone.' + '001' + '_Armature' = 'Bone.001_Armature')
|
|
38
|
-
*/
|
|
39
|
-
boneSuffix?: string;
|
|
40
|
-
/**
|
|
41
|
-
* Optional: Prefix to prepend to morph target names when resolving.
|
|
42
|
-
* Similar to bonePrefix but for morph targets.
|
|
43
|
-
*/
|
|
44
|
-
morphPrefix?: string;
|
|
45
|
-
/**
|
|
46
|
-
* Optional: Suffix to append to morph target names when resolving.
|
|
47
|
-
* Similar to boneSuffix but for morph targets.
|
|
48
|
-
*/
|
|
49
|
-
morphSuffix?: string;
|
|
50
|
-
/**
|
|
51
|
-
* Optional: Regex pattern string for fuzzy matching bone/morph names with suffixes.
|
|
52
|
-
* Common patterns: "_\\d+$" for numbered suffixes (_01, _038), "\\.\\d+$" for Blender (.001)
|
|
53
|
-
* When set, the engine will try exact match first, then fuzzy match using this pattern.
|
|
54
|
-
*/
|
|
55
|
-
suffixPattern?: string;
|
|
56
|
-
/**
|
|
57
|
-
* Optional: Suffixes that indicate left-side morph targets.
|
|
58
|
-
* Used for auto-detecting laterality in the mapping editor.
|
|
59
|
-
* Default: ['_L', ' L']
|
|
60
|
-
*/
|
|
61
|
-
leftMorphSuffixes?: string[];
|
|
62
|
-
/**
|
|
63
|
-
* Optional: Suffixes that indicate right-side morph targets.
|
|
64
|
-
* Used for auto-detecting laterality in the mapping editor.
|
|
65
|
-
* Default: ['_R', ' R']
|
|
66
|
-
*/
|
|
67
|
-
rightMorphSuffixes?: string[];
|
|
68
|
-
/** Morph category to mesh names (e.g., 'face' → ['CC_Base_Body_1']) */
|
|
69
|
-
morphToMesh: Record<string, string[]>;
|
|
70
|
-
/**
|
|
71
|
-
* Optional map from AU `facePart` labels (from `auInfo`) to `morphToMesh` categories.
|
|
72
|
-
* This makes AU mesh routing fully preset/profile configurable.
|
|
73
|
-
* Example: { Eye: 'eye', Eyes: 'eye', Eyelids: 'eye', Tongue: 'tongue' }.
|
|
74
|
-
*/
|
|
75
|
-
auFacePartToMeshCategory?: Record<string, string>;
|
|
76
|
-
/** Optional ordered mapping sections for authoring UIs. Presets own this metadata, not consumers. */
|
|
77
|
-
mappingSections?: MappingEditorSection[];
|
|
78
|
-
/** Viseme targets in order (typically 15 phoneme positions) */
|
|
79
|
-
visemeKeys: MorphTargetRef[];
|
|
80
|
-
/** Optional id of the profile-defined viseme system (for example, 'cc4-arkit-15'). */
|
|
81
|
-
visemeSystemId?: string;
|
|
82
|
-
/** Optional profile-defined viseme slots used by editors and id-based runtime APIs. */
|
|
83
|
-
visemeSlots?: VisemeSlot[];
|
|
84
|
-
/** Optional authoring bindings keyed by viseme slot id. */
|
|
85
|
-
visemeBindings?: Record<string, VisemeBinding>;
|
|
86
|
-
/**
|
|
87
|
-
* Optional `morphToMesh` category to use for viseme morph routing.
|
|
88
|
-
* Falls back to `morphToMesh.viseme` (if present), then `morphToMesh.face`.
|
|
89
|
-
*/
|
|
90
|
-
visemeMeshCategory?: string;
|
|
91
|
-
/** Optional: Jaw opening amounts per viseme index (0-1). Used for auto-generating jaw rotation in clips. */
|
|
92
|
-
visemeJawAmounts?: number[];
|
|
93
|
-
/** Optional: Default mix weights for bone/morph blending (0 = morph only, 1 = bone only) */
|
|
94
|
-
auMixDefaults?: Record<number, number>;
|
|
95
|
-
/** Optional: AU metadata (names, muscle basis, etc.) */
|
|
96
|
-
auInfo?: Record<string, AUInfo>;
|
|
97
|
-
/** Optional: Eye mesh node fallbacks (some rigs use mesh nodes instead of bone nodes) */
|
|
98
|
-
eyeMeshNodes?: {
|
|
99
|
-
LEFT: string;
|
|
100
|
-
RIGHT: string;
|
|
101
|
-
};
|
|
102
|
-
/** Optional: Composite rotation definitions for bones (defaults to CC4 composites) */
|
|
103
|
-
compositeRotations?: CompositeRotation[];
|
|
104
|
-
/** Optional: Mesh info for material settings (depthWrite, blending, renderOrder, etc.) */
|
|
105
|
-
meshes?: Record<string, MeshInfo>;
|
|
106
|
-
/**
|
|
107
|
-
* Optional: Continuum pair mappings for bidirectional AU axes.
|
|
108
|
-
* Maps AU ID to its partner info (pairId, isNegative, axis, node).
|
|
109
|
-
* Enables negative value shorthand: setAU(51, -0.5) activates AU 52 at 0.5
|
|
110
|
-
*/
|
|
111
|
-
continuumPairs?: Record<number, {
|
|
112
|
-
pairId: number;
|
|
113
|
-
isNegative: boolean;
|
|
114
|
-
axis: 'pitch' | 'yaw' | 'roll';
|
|
115
|
-
node: string;
|
|
116
|
-
}>;
|
|
117
|
-
/**
|
|
118
|
-
* Optional: Human-readable labels for continuum pairs.
|
|
119
|
-
* Key format: "negativeAU-positiveAU" (e.g., "51-52")
|
|
120
|
-
* Value: Display label (e.g., "Head Turn — Left ↔ Right")
|
|
121
|
-
*/
|
|
122
|
-
continuumLabels?: Record<string, string>;
|
|
123
|
-
/**
|
|
124
|
-
* Optional: Annotation regions for camera/marker overlays.
|
|
125
|
-
*/
|
|
126
|
-
annotationRegions?: AnnotationRegion[];
|
|
127
|
-
/**
|
|
128
|
-
* Optional: preset region names this profile explicitly disables.
|
|
129
|
-
*/
|
|
130
|
-
disabledRegions?: string[];
|
|
131
|
-
/**
|
|
132
|
-
* Optional: Hair physics defaults for this preset/profile.
|
|
133
|
-
*/
|
|
134
|
-
hairPhysics?: HairPhysicsProfileConfig;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Hair physics morph mapping axis types.
|
|
138
|
-
*/
|
|
139
|
-
export type HairMorphAxis = 'yaw' | 'pitch' | 'roll';
|
|
140
|
-
/**
|
|
141
|
-
* Single morph target mapping with axis metadata.
|
|
142
|
-
*/
|
|
143
|
-
export interface HairMorphTargetMapping {
|
|
144
|
-
key: string;
|
|
145
|
-
axis: HairMorphAxis;
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Morph target mapping with axis metadata and intensity value.
|
|
149
|
-
*/
|
|
150
|
-
export interface HairMorphTargetValueMapping {
|
|
151
|
-
value: number;
|
|
152
|
-
axis: HairMorphAxis;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Hair physics defaults stored in presets/profiles.
|
|
156
|
-
*/
|
|
157
|
-
export interface HairPhysicsProfileConfig {
|
|
158
|
-
/** Whether hair physics should start enabled when this profile is applied. */
|
|
159
|
-
enabled?: boolean;
|
|
160
|
-
stiffness?: number;
|
|
161
|
-
damping?: number;
|
|
162
|
-
inertia?: number;
|
|
163
|
-
gravity?: number;
|
|
164
|
-
responseScale?: number;
|
|
165
|
-
idleSwayAmount?: number;
|
|
166
|
-
idleSwaySpeed?: number;
|
|
167
|
-
windStrength?: number;
|
|
168
|
-
windDirectionX?: number;
|
|
169
|
-
windDirectionZ?: number;
|
|
170
|
-
windTurbulence?: number;
|
|
171
|
-
windFrequency?: number;
|
|
172
|
-
idleClipDuration?: number;
|
|
173
|
-
impulseClipDuration?: number;
|
|
174
|
-
direction?: {
|
|
175
|
-
yawSign?: 1 | -1;
|
|
176
|
-
pitchSign?: 1 | -1;
|
|
177
|
-
};
|
|
178
|
-
morphTargets?: {
|
|
179
|
-
swayLeft?: HairMorphTargetMapping;
|
|
180
|
-
swayRight?: HairMorphTargetMapping;
|
|
181
|
-
swayFront?: HairMorphTargetMapping;
|
|
182
|
-
fluffRight?: HairMorphTargetMapping;
|
|
183
|
-
fluffBottom?: HairMorphTargetMapping;
|
|
184
|
-
headUp?: Record<string, HairMorphTargetValueMapping>;
|
|
185
|
-
headDown?: Record<string, HairMorphTargetValueMapping>;
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Morph target key (name in morphTargetDictionary).
|
|
190
|
-
*/
|
|
191
|
-
export type MorphTargetKey = string;
|
|
192
|
-
/**
|
|
193
|
-
* Morph target index (morphTargetInfluences slot).
|
|
194
|
-
*/
|
|
195
|
-
export type MorphTargetIndex = number;
|
|
196
|
-
/**
|
|
197
|
-
* Morph target reference (key or index).
|
|
198
|
-
*/
|
|
199
|
-
export type MorphTargetRef = MorphTargetKey | MorphTargetIndex;
|
|
200
|
-
export interface VisemeSlotFeatures {
|
|
201
|
-
jawOpen?: number;
|
|
202
|
-
lipClosed?: number;
|
|
203
|
-
lipRound?: number;
|
|
204
|
-
lipSpread?: number;
|
|
205
|
-
tongueTip?: number;
|
|
206
|
-
fricative?: number;
|
|
207
|
-
nasal?: number;
|
|
208
|
-
}
|
|
209
|
-
export interface VisemeSlot {
|
|
210
|
-
/** Stable profile/runtime id, such as 'aa', 'bmp', or 'rest'. */
|
|
211
|
-
id: string;
|
|
212
|
-
/** Human-readable editor label. */
|
|
213
|
-
label: string;
|
|
214
|
-
/** Optional display/runtime order. Lower values render first. */
|
|
215
|
-
order?: number;
|
|
216
|
-
/** Provider-specific viseme ids that should map to this slot. */
|
|
217
|
-
providerIds?: Record<string, Array<string | number>>;
|
|
218
|
-
/** Phoneme hints that can map provider phonemes to this slot. */
|
|
219
|
-
phonemes?: string[];
|
|
220
|
-
/** Regex strings used to classify likely morph candidates for this slot. */
|
|
221
|
-
matchers?: string[];
|
|
222
|
-
/** Semantic hints for approximate provider or UI matching. */
|
|
223
|
-
features?: VisemeSlotFeatures;
|
|
224
|
-
/** Optional default jaw amount for this slot. */
|
|
225
|
-
defaultJawAmount?: number;
|
|
226
|
-
}
|
|
227
|
-
export interface VisemeBindingTarget {
|
|
228
|
-
morph: MorphTargetRef;
|
|
229
|
-
weight?: number;
|
|
230
|
-
}
|
|
231
|
-
export interface VisemeBinding {
|
|
232
|
-
targets?: VisemeBindingTarget[];
|
|
233
|
-
/** Legacy/simplified single-target binding used by existing LoomLarge profiles. */
|
|
234
|
-
morph?: MorphTargetRef;
|
|
235
|
-
jawAmount?: number;
|
|
236
|
-
note?: string;
|
|
237
|
-
sharedWith?: string[];
|
|
238
|
-
}
|
|
239
|
-
export type MappingSectionKind = 'au' | 'viseme' | 'lipSync' | 'hair' | 'unmapped' | 'custom';
|
|
240
|
-
export interface MappingEditorSection {
|
|
241
|
-
id: string;
|
|
242
|
-
label: string;
|
|
243
|
-
kind: MappingSectionKind;
|
|
244
|
-
order: number;
|
|
245
|
-
meshCategory?: string;
|
|
246
|
-
facePart?: string;
|
|
247
|
-
}
|
|
248
|
-
export type MorphCandidateReason = 'explicit' | 'regex' | 'alias' | 'phoneme' | 'provider' | 'unmapped';
|
|
249
|
-
export interface MorphCandidateMatch {
|
|
250
|
-
slotId: string;
|
|
251
|
-
label: string;
|
|
252
|
-
confidence: number;
|
|
253
|
-
reason: MorphCandidateReason;
|
|
254
|
-
pattern?: string;
|
|
255
|
-
}
|
|
256
|
-
export interface MorphCandidate {
|
|
257
|
-
morph: string;
|
|
258
|
-
sectionId: string;
|
|
259
|
-
kind: 'explicit' | 'candidate' | 'conflict' | 'unmapped';
|
|
260
|
-
matches: MorphCandidateMatch[];
|
|
261
|
-
}
|
|
262
|
-
export interface MappingEditorModel {
|
|
263
|
-
sections: MappingEditorSection[];
|
|
264
|
-
candidates: MorphCandidate[];
|
|
265
|
-
}
|
|
266
|
-
export interface MorphTargetsBySide {
|
|
267
|
-
left: MorphTargetRef[];
|
|
268
|
-
right: MorphTargetRef[];
|
|
269
|
-
center: MorphTargetRef[];
|
|
270
|
-
}
|
|
271
|
-
/**
|
|
272
|
-
* Helper type for mesh categories in morphToMesh
|
|
273
|
-
*/
|
|
274
|
-
export type MorphCategory = 'face' | 'viseme' | 'eye' | 'tongue' | 'hair';
|
|
275
|
-
/**
|
|
276
|
-
* Mesh category types for character mesh classification
|
|
277
|
-
*/
|
|
278
|
-
export type MeshCategory = 'body' | 'eye' | 'eyeOcclusion' | 'tearLine' | 'teeth' | 'tongue' | 'hair' | 'eyebrow' | 'cornea' | 'eyelash';
|
|
279
|
-
/**
|
|
280
|
-
* Blending mode names (matches Three.js constants)
|
|
281
|
-
*/
|
|
282
|
-
export type BlendingMode = 'Normal' | 'Additive' | 'Subtractive' | 'Multiply' | 'None';
|
|
283
|
-
/**
|
|
284
|
-
* Blending mode options for Three.js materials
|
|
285
|
-
* Maps mode name to Three.js blending constant value
|
|
286
|
-
*/
|
|
287
|
-
export declare const BLENDING_MODES: Record<BlendingMode, number>;
|
|
288
|
-
/**
|
|
289
|
-
* Material settings for mesh rendering
|
|
290
|
-
*/
|
|
291
|
-
export interface MeshMaterialSettings {
|
|
292
|
-
renderOrder?: number;
|
|
293
|
-
transparent?: boolean;
|
|
294
|
-
opacity?: number;
|
|
295
|
-
depthWrite?: boolean;
|
|
296
|
-
depthTest?: boolean;
|
|
297
|
-
blending?: BlendingMode;
|
|
298
|
-
}
|
|
299
|
-
/**
|
|
300
|
-
* Mesh info including category, morph count, and optional material settings.
|
|
301
|
-
* Used in presets, profiles, and runtime.
|
|
302
|
-
*/
|
|
303
|
-
export interface MeshInfo {
|
|
304
|
-
name?: string;
|
|
305
|
-
visible?: boolean;
|
|
306
|
-
category: MeshCategory;
|
|
307
|
-
morphCount: number;
|
|
308
|
-
material?: MeshMaterialSettings;
|
|
309
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { MappingEditorModel, MorphTargetRef, Profile, VisemeSlot } from './types';
|
|
2
|
-
export interface ResolvedVisemeBindingTarget {
|
|
3
|
-
morph: MorphTargetRef;
|
|
4
|
-
weight: number;
|
|
5
|
-
}
|
|
6
|
-
export declare function getProfileVisemeSlots(profile: Profile): VisemeSlot[];
|
|
7
|
-
export declare function getVisemeSlotIndex(profile: Profile, slotId: string): number;
|
|
8
|
-
export declare function compileVisemeKeys(profile: Profile): MorphTargetRef[];
|
|
9
|
-
export declare function getVisemeBindingTargets(profile: Profile, visemeIndex: number): ResolvedVisemeBindingTarget[];
|
|
10
|
-
export declare function getVisemeJawAmounts(profile: Profile): number[] | undefined;
|
|
11
|
-
export declare function resolveVisemeMeshCategory(profile: Profile): string;
|
|
12
|
-
export declare function getMeshNamesForVisemeProfile(profile: Profile): string[];
|
|
13
|
-
export declare function getMeshNamesForAUProfile(profile: Profile, auId: number): string[];
|
|
14
|
-
export declare function buildMappingEditorModel(profile: Profile, morphNames?: string[]): MappingEditorModel;
|
|
15
|
-
export interface ProviderVisemeEvent {
|
|
16
|
-
provider: string;
|
|
17
|
-
id?: string | number;
|
|
18
|
-
phoneme?: string;
|
|
19
|
-
}
|
|
20
|
-
export interface ProviderVisemeMatch {
|
|
21
|
-
slotId: string;
|
|
22
|
-
index: number;
|
|
23
|
-
confidence: number;
|
|
24
|
-
reason: 'provider' | 'phoneme' | 'rest' | 'none';
|
|
25
|
-
}
|
|
26
|
-
export declare function mapProviderVisemeToSlot(profile: Profile, event: ProviderVisemeEvent): ProviderVisemeMatch | null;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HairPhysics - Spring-damper pendulum simulation for hair movement
|
|
3
|
-
*
|
|
4
|
-
* This is a pure physics simulation class with no Three.js dependencies.
|
|
5
|
-
* It outputs normalized morph values (0-1) that can be applied to hair meshes
|
|
6
|
-
* via EngineThree.setMorph() or transitionMorph().
|
|
7
|
-
*
|
|
8
|
-
* Physics model:
|
|
9
|
-
* - Hair is modeled as a damped pendulum affected by:
|
|
10
|
-
* - Gravity (constant downward force based on head orientation)
|
|
11
|
-
* - Head velocity (inertia causes hair to lag behind head movement)
|
|
12
|
-
* - Wind (oscillating force with turbulence)
|
|
13
|
-
* - Spring restoration (hair returns to rest position)
|
|
14
|
-
* - Damping (air resistance)
|
|
15
|
-
*/
|
|
16
|
-
export interface HairPhysicsConfig {
|
|
17
|
-
mass: number;
|
|
18
|
-
stiffness: number;
|
|
19
|
-
damping: number;
|
|
20
|
-
gravity: number;
|
|
21
|
-
headInfluence: number;
|
|
22
|
-
windEnabled: boolean;
|
|
23
|
-
windStrength: number;
|
|
24
|
-
windDirectionX: number;
|
|
25
|
-
windDirectionZ: number;
|
|
26
|
-
windTurbulence: number;
|
|
27
|
-
windFrequency: number;
|
|
28
|
-
}
|
|
29
|
-
export interface HairPhysicsState {
|
|
30
|
-
x: number;
|
|
31
|
-
z: number;
|
|
32
|
-
vx: number;
|
|
33
|
-
vz: number;
|
|
34
|
-
}
|
|
35
|
-
export interface HairMorphOutput {
|
|
36
|
-
L_Hair_Left: number;
|
|
37
|
-
L_Hair_Right: number;
|
|
38
|
-
L_Hair_Front: number;
|
|
39
|
-
R_Hair_Left: number;
|
|
40
|
-
R_Hair_Right: number;
|
|
41
|
-
R_Hair_Front: number;
|
|
42
|
-
}
|
|
43
|
-
export interface HeadState {
|
|
44
|
-
yaw: number;
|
|
45
|
-
pitch: number;
|
|
46
|
-
roll: number;
|
|
47
|
-
yawVelocity: number;
|
|
48
|
-
pitchVelocity: number;
|
|
49
|
-
}
|
|
50
|
-
export declare const DEFAULT_HAIR_PHYSICS_CONFIG: HairPhysicsConfig;
|
|
51
|
-
export declare class HairPhysics {
|
|
52
|
-
private config;
|
|
53
|
-
private state;
|
|
54
|
-
private time;
|
|
55
|
-
private prevHeadYaw;
|
|
56
|
-
private prevHeadPitch;
|
|
57
|
-
constructor(config?: Partial<HairPhysicsConfig>);
|
|
58
|
-
/**
|
|
59
|
-
* Update physics simulation
|
|
60
|
-
* @param dt Delta time in seconds
|
|
61
|
-
* @param headState Current head orientation and velocity
|
|
62
|
-
* @returns Morph values to apply to hair meshes
|
|
63
|
-
*/
|
|
64
|
-
update(dt: number, headState: HeadState): HairMorphOutput;
|
|
65
|
-
/**
|
|
66
|
-
* Convert physics state to morph target values
|
|
67
|
-
* Maps pendulum position to left/right/front morphs for both sides
|
|
68
|
-
*/
|
|
69
|
-
private computeMorphOutput;
|
|
70
|
-
/**
|
|
71
|
-
* Get current physics state (for debugging/UI)
|
|
72
|
-
*/
|
|
73
|
-
getState(): HairPhysicsState;
|
|
74
|
-
/**
|
|
75
|
-
* Update configuration
|
|
76
|
-
*/
|
|
77
|
-
setConfig(config: Partial<HairPhysicsConfig>): void;
|
|
78
|
-
/**
|
|
79
|
-
* Get current configuration
|
|
80
|
-
*/
|
|
81
|
-
getConfig(): HairPhysicsConfig;
|
|
82
|
-
/**
|
|
83
|
-
* Reset physics state to rest position
|
|
84
|
-
*/
|
|
85
|
-
reset(): void;
|
|
86
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { HairMorphOutput, HairPhysicsConfig, HairPhysicsState, HeadState } from './HairPhysics';
|
|
2
|
-
export declare class RustHairPhysics {
|
|
3
|
-
private solver;
|
|
4
|
-
private constructor();
|
|
5
|
-
static create(config?: Partial<HairPhysicsConfig>): Promise<RustHairPhysics>;
|
|
6
|
-
update(dt: number, headState: HeadState): HairMorphOutput;
|
|
7
|
-
getState(): HairPhysicsState;
|
|
8
|
-
setConfig(config: Partial<HairPhysicsConfig>): void;
|
|
9
|
-
getConfig(): HairPhysicsConfig;
|
|
10
|
-
reset(): void;
|
|
11
|
-
dispose(): void;
|
|
12
|
-
}
|
|
13
|
-
export declare function createRustHairPhysics(config?: Partial<HairPhysicsConfig>): Promise<RustHairPhysics>;
|
|
14
|
-
export declare function packHairConfig(config?: Partial<HairPhysicsConfig>): Float32Array;
|
|
15
|
-
export declare function packHeadState(headState: HeadState): Float32Array;
|
|
16
|
-
export declare function unpackHairConfig(values: ArrayLike<number>): HairPhysicsConfig;
|
|
17
|
-
export declare function unpackHairState(values: ArrayLike<number>): HairPhysicsState;
|
|
18
|
-
export declare function unpackHairMorphOutput(values: ArrayLike<number>): HairMorphOutput;
|
package/dist/physics/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Embody - Physics Exports
|
|
3
|
-
*/
|
|
4
|
-
export { HairPhysics, DEFAULT_HAIR_PHYSICS_CONFIG, } from './HairPhysics';
|
|
5
|
-
export { RustHairPhysics, createRustHairPhysics, packHairConfig, packHeadState, unpackHairConfig, unpackHairMorphOutput, unpackHairState, } from './RustHairPhysics';
|
|
6
|
-
export type { HairPhysicsConfig, HairPhysicsState, HairMorphOutput, HeadState, } from './HairPhysics';
|