@lovelace_lol/polymer 0.0.1
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 +226 -0
- package/dist/index.d.ts +2603 -0
- package/dist/index.js +1031 -0
- package/dist/test.cjs +1519 -0
- package/dist/worker/agency-worker.js +972 -0
- package/dist/worker/manifest.edn +1 -0
- package/package.json +57 -0
- package/shadow-cljs.edn +173 -0
- package/src/polymer/animation/agency.cljs +84 -0
- package/src/polymer/animation/domain.cljs +110 -0
- package/src/polymer/animation/planner.cljs +88 -0
- package/src/polymer/animation/runtime.cljs +137 -0
- package/src/polymer/animation/scheduler.cljs +178 -0
- package/src/polymer/animation/service.cljs +981 -0
- package/src/polymer/animation/state.cljs +112 -0
- package/src/polymer/blink/agency.cljs +131 -0
- package/src/polymer/blink/planner.cljs +115 -0
- package/src/polymer/blink/scheduler.cljs +90 -0
- package/src/polymer/blink/snippet.cljs +50 -0
- package/src/polymer/blink/state.cljs +102 -0
- package/src/polymer/camera_context/agency.cljs +132 -0
- package/src/polymer/camera_context/domain.cljs +186 -0
- package/src/polymer/camera_context/planner.cljs +50 -0
- package/src/polymer/camera_context/scheduler.cljs +113 -0
- package/src/polymer/camera_context/state.cljs +121 -0
- package/src/polymer/character.cljs +471 -0
- package/src/polymer/conversation/agency.cljs +83 -0
- package/src/polymer/conversation/domain.cljs +35 -0
- package/src/polymer/conversation/effector.cljs +130 -0
- package/src/polymer/conversation/planner.cljs +178 -0
- package/src/polymer/conversation/scheduler.cljs +202 -0
- package/src/polymer/conversation/service.cljs +329 -0
- package/src/polymer/conversation/state.cljs +186 -0
- package/src/polymer/core.cljs +172 -0
- package/src/polymer/eye_head/agency.cljs +75 -0
- package/src/polymer/eye_head/domain.cljs +133 -0
- package/src/polymer/eye_head/goap.cljs +106 -0
- package/src/polymer/eye_head/scheduler.cljs +176 -0
- package/src/polymer/eye_head/service.cljs +259 -0
- package/src/polymer/eye_head/snippet.cljs +92 -0
- package/src/polymer/eye_head/state.cljs +167 -0
- package/src/polymer/gaze/agency.cljs +85 -0
- package/src/polymer/gaze/domain.cljs +211 -0
- package/src/polymer/gaze/goap.cljs +208 -0
- package/src/polymer/gaze/scheduler.cljs +184 -0
- package/src/polymer/gaze/state.cljs +202 -0
- package/src/polymer/gesture/agency.cljs +185 -0
- package/src/polymer/gesture/goap.cljs +461 -0
- package/src/polymer/gesture/scheduler.cljs +122 -0
- package/src/polymer/gesture/snippet.cljs +198 -0
- package/src/polymer/gesture/state.cljs +273 -0
- package/src/polymer/lipsync/agency.cljs +593 -0
- package/src/polymer/lipsync/articulation/jaw.cljs +258 -0
- package/src/polymer/lipsync/articulation/snippet.cljs +605 -0
- package/src/polymer/lipsync/articulation/tongue.cljs +418 -0
- package/src/polymer/lipsync/articulation/visemes.cljs +429 -0
- package/src/polymer/lipsync/goap.cljs +132 -0
- package/src/polymer/lipsync/pronunciation/effector.cljs +51 -0
- package/src/polymer/lipsync/scheduler.cljs +302 -0
- package/src/polymer/lipsync/state.cljs +202 -0
- package/src/polymer/nlp/phonemes.cljs +164 -0
- package/src/polymer/prosodic/agency.cljs +196 -0
- package/src/polymer/prosodic/goap.cljs +122 -0
- package/src/polymer/prosodic/scheduler.cljs +99 -0
- package/src/polymer/prosodic/snippet.cljs +106 -0
- package/src/polymer/prosodic/state.cljs +139 -0
- package/src/polymer/runtime/embody.cljs +117 -0
- package/src/polymer/runtime/embody_wasm.cljs +177 -0
- package/src/polymer/runtime/rust_embody_host.cljs +645 -0
- package/src/polymer/society.cljs +239 -0
- package/src/polymer/stream.cljs +130 -0
- package/src/polymer/transcription/agency.cljs +69 -0
- package/src/polymer/transcription/domain.cljs +68 -0
- package/src/polymer/transcription/effector.cljs +611 -0
- package/src/polymer/transcription/planner.cljs +203 -0
- package/src/polymer/transcription/scheduler.cljs +225 -0
- package/src/polymer/transcription/service.cljs +209 -0
- package/src/polymer/transcription/state.cljs +239 -0
- package/src/polymer/tts/agency.cljs +503 -0
- package/src/polymer/tts/azure.cljs +290 -0
- package/src/polymer/tts/planner.cljs +178 -0
- package/src/polymer/tts/runtime.cljs +624 -0
- package/src/polymer/tts/scheduler.cljs +162 -0
- package/src/polymer/tts/state.cljs +191 -0
- package/src/polymer/worker.cljs +70 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
(ns polymer.runtime.embody
|
|
2
|
+
(:require ["@lovelace_lol/embody" :as embody]
|
|
3
|
+
[polymer.runtime.rust-embody-host :as rust-host]))
|
|
4
|
+
|
|
5
|
+
;; Polymer is the package boundary for character runtime APIs. LoomLarge imports
|
|
6
|
+
;; these helpers from Polymer, while Polymer remains free to change the concrete
|
|
7
|
+
;; Embody/Three.js implementation behind this boundary later.
|
|
8
|
+
;; scripts/embody-export-contract.mjs is the canonical public export list; CI
|
|
9
|
+
;; verifies this namespace, shadow-cljs, dist JS, declarations, and the pinned
|
|
10
|
+
;; Embody package against that one contract.
|
|
11
|
+
|
|
12
|
+
(def Embody (aget embody "Embody"))
|
|
13
|
+
(def BLENDING_MODES (or (.-BLENDING_MODES embody)
|
|
14
|
+
(.-THREE_BLENDING_MODES embody)))
|
|
15
|
+
(def THREE_BLENDING_MODES (.-THREE_BLENDING_MODES embody))
|
|
16
|
+
(def collectMorphMeshes (.-collectMorphMeshes embody))
|
|
17
|
+
|
|
18
|
+
(def analyzeModel (.-analyzeModel embody))
|
|
19
|
+
(def extractModelData (.-extractModelData embody))
|
|
20
|
+
(def getPreset (.-getPreset embody))
|
|
21
|
+
(def validateMappings (.-validateMappings embody))
|
|
22
|
+
(def extendCharacterConfigWithPreset (.-extendCharacterConfigWithPreset embody))
|
|
23
|
+
(def extractProfileOverrides (.-extractProfileOverrides embody))
|
|
24
|
+
(def mergeCharacterRegionsByName (.-mergeCharacterRegionsByName embody))
|
|
25
|
+
|
|
26
|
+
(def applyAUBoneBindingUpdate (.-applyAUBoneBindingUpdate embody))
|
|
27
|
+
(def applyBilateralAxisBindingUpdate (.-applyBilateralAxisBindingUpdate embody))
|
|
28
|
+
(def applyBoneAxisBindingUpdate (.-applyBoneAxisBindingUpdate embody))
|
|
29
|
+
(def buildBoneAuOptions (.-buildBoneAuOptions embody))
|
|
30
|
+
(def classifyAuAsJointControl (.-classifyAuAsJointControl embody))
|
|
31
|
+
(def createBilateralBoneAxisAu (.-createBilateralBoneAxisAu embody))
|
|
32
|
+
(def createBoneAxisAu (.-createBoneAxisAu embody))
|
|
33
|
+
(def DEFAULT_AXIS_TO_CHANNEL (.-DEFAULT_AXIS_TO_CHANNEL embody))
|
|
34
|
+
(def DEFAULT_BONE_MAX_DEGREES (.-DEFAULT_BONE_MAX_DEGREES embody))
|
|
35
|
+
(def ensureBilateralBoneNodeKeys (.-ensureBilateralBoneNodeKeys embody))
|
|
36
|
+
(def ensureBoneNodeKey (.-ensureBoneNodeKey embody))
|
|
37
|
+
(def findNodeKeyForBone (.-findNodeKeyForBone embody))
|
|
38
|
+
(def formatAxisDirectionLabel (.-formatAxisDirectionLabel embody))
|
|
39
|
+
(def formatAxisLabel (.-formatAxisLabel embody))
|
|
40
|
+
(def getAUBoneBindingState (.-getAUBoneBindingState embody))
|
|
41
|
+
(def getAxisFromChannel (.-getAxisFromChannel embody))
|
|
42
|
+
(def getBilateralAxisBindingState (.-getBilateralAxisBindingState embody))
|
|
43
|
+
(def getBoneAxisBindingState (.-getBoneAxisBindingState embody))
|
|
44
|
+
(def inferChiralBoneNamePair (.-inferChiralBoneNamePair embody))
|
|
45
|
+
(def inferEyeControlFamily (.-inferEyeControlFamily embody))
|
|
46
|
+
(def inferEyeControlScope (.-inferEyeControlScope embody))
|
|
47
|
+
(def isJointControlAuInfo (.-isJointControlAuInfo embody))
|
|
48
|
+
(def isMaxDegreesOnlyAxisBindingUpdate (.-isMaxDegreesOnlyAxisBindingUpdate embody))
|
|
49
|
+
(def JOINT_CONTROL_SECTION (.-JOINT_CONTROL_SECTION embody))
|
|
50
|
+
(def resolveBoneAxisChannel (.-resolveBoneAxisChannel embody))
|
|
51
|
+
(def resolveBoneNameForNodeKey (.-resolveBoneNameForNodeKey embody))
|
|
52
|
+
(def resolveContinuumDisplayLabel (.-resolveContinuumDisplayLabel embody))
|
|
53
|
+
(def stripConfiguredBoneAffixes (.-stripConfiguredBoneAffixes embody))
|
|
54
|
+
|
|
55
|
+
(def computeCameraRelativeGazeOffset (.-computeCameraRelativeGazeOffset embody))
|
|
56
|
+
(def detectAnnotationLaterality (.-detectAnnotationLaterality embody))
|
|
57
|
+
(def fuzzyNameMatch (.-fuzzyNameMatch embody))
|
|
58
|
+
(def getDefaultAnnotationLaterality (.-getDefaultAnnotationLaterality embody))
|
|
59
|
+
(def getMeshNamesForAUProfile (.-getMeshNamesForAUProfile embody))
|
|
60
|
+
(def getModelLocalOrbitAngle (.-getModelLocalOrbitAngle embody))
|
|
61
|
+
(def getSemanticHorizontalSign (.-getSemanticHorizontalSign embody))
|
|
62
|
+
(def getSemanticHorizontalSignForSide (.-getSemanticHorizontalSignForSide embody))
|
|
63
|
+
(def getWorldDirectionForCameraAngle (.-getWorldDirectionForCameraAngle embody))
|
|
64
|
+
(def hasLeftRightMorphs (.-hasLeftRightMorphs embody))
|
|
65
|
+
(def isMixedAU (.-isMixedAU embody))
|
|
66
|
+
(def passesMarkerCameraAngleGate (.-passesMarkerCameraAngleGate embody))
|
|
67
|
+
(def resolveBoneNames (.-resolveBoneNames embody))
|
|
68
|
+
(def resolveFaceCenter (.-resolveFaceCenter embody))
|
|
69
|
+
(def resolveRegionCameraAngle (.-resolveRegionCameraAngle embody))
|
|
70
|
+
(def resolveRegionVisibilityCameraAngle (.-resolveRegionVisibilityCameraAngle embody))
|
|
71
|
+
(def toWorldDirection (.-toWorldDirection embody))
|
|
72
|
+
(def RustAnnotationCameraCore (.-RustAnnotationCameraCore embody))
|
|
73
|
+
(def createRustAnnotationCameraCore (.-createRustAnnotationCameraCore embody))
|
|
74
|
+
|
|
75
|
+
(def CC4_BONES (or (aget embody "CC4_BONES")
|
|
76
|
+
(aget embody "CC4_BONE_NODES")))
|
|
77
|
+
(def VISEME_KEYS (.-VISEME_KEYS embody))
|
|
78
|
+
|
|
79
|
+
;; Hair appearance/materials are Embody runtime APIs (not a Polymer agency).
|
|
80
|
+
;; Re-export so hosts can import presets/helpers from Polymer without depending
|
|
81
|
+
;; on @lovelace_lol/embody directly.
|
|
82
|
+
(def HAIR_COLOR_PRESETS (.-HAIR_COLOR_PRESETS embody))
|
|
83
|
+
(def DEFAULT_HAIR_COLOR_APPEARANCE (.-DEFAULT_HAIR_COLOR_APPEARANCE embody))
|
|
84
|
+
(def normalizeHairColorAppearance (.-normalizeHairColorAppearance embody))
|
|
85
|
+
|
|
86
|
+
(def HUMANOID_SKELETON_TEMPLATES (.-HUMANOID_SKELETON_TEMPLATES embody))
|
|
87
|
+
(def JONATHAN_HUMANOID_SKELETON_TEMPLATE (.-JONATHAN_HUMANOID_SKELETON_TEMPLATE embody))
|
|
88
|
+
(def getHumanoidSkeletonTemplate (.-getHumanoidSkeletonTemplate embody))
|
|
89
|
+
(def getHumanoidSkeletonTemplateBoneNames (.-getHumanoidSkeletonTemplateBoneNames embody))
|
|
90
|
+
(def createValidationSkeletonFromHumanoidTemplate (.-createValidationSkeletonFromHumanoidTemplate embody))
|
|
91
|
+
(def computeHumanoidSkeletonTemplateRestBounds (.-computeHumanoidSkeletonTemplateRestBounds embody))
|
|
92
|
+
(def extractHumanoidSkeletonTemplateFromModel (.-extractHumanoidSkeletonTemplateFromModel embody))
|
|
93
|
+
|
|
94
|
+
(def createCharacterHost (.-createCharacterHost embody))
|
|
95
|
+
|
|
96
|
+
;; Polymer owns the CLJS host boundary and talks directly to RuntimeCore. Embody
|
|
97
|
+
;; contributes only the Wasm ABI and reusable Three.js inspection/application
|
|
98
|
+
;; utilities.
|
|
99
|
+
(def createRustEmbodyHost rust-host/createRustEmbodyHost)
|
|
100
|
+
(def createRustEmbodyHostUnbound rust-host/createRustEmbodyHostUnbound)
|
|
101
|
+
(def supportsRustEmbodyPreset rust-host/supportsRustEmbodyPreset)
|
|
102
|
+
|
|
103
|
+
(def createDefaultCharacterScene (.-createDefaultCharacterScene embody))
|
|
104
|
+
(def createDefaultCharacterLighting (.-createDefaultCharacterLighting embody))
|
|
105
|
+
(def createShadowPlane (.-createShadowPlane embody))
|
|
106
|
+
(def loadCharacterModel (.-loadCharacterModel embody))
|
|
107
|
+
(def parseCharacterModel (.-parseCharacterModel embody))
|
|
108
|
+
(def applyCharacterModelTransform (.-applyCharacterModelTransform embody))
|
|
109
|
+
(def disposeCharacterModel (.-disposeCharacterModel embody))
|
|
110
|
+
(def DEFAULT_CHARACTER_LIGHTING_PRESET_ID (.-DEFAULT_CHARACTER_LIGHTING_PRESET_ID embody))
|
|
111
|
+
(def DEFAULT_CHARACTER_LIGHTING_PRESET_IDS (.-DEFAULT_CHARACTER_LIGHTING_PRESET_IDS embody))
|
|
112
|
+
(def DEFAULT_CHARACTER_LIGHTING_PRESETS (.-DEFAULT_CHARACTER_LIGHTING_PRESETS embody))
|
|
113
|
+
(def DEFAULT_CHARACTER_LIGHTING_SETTINGS (.-DEFAULT_CHARACTER_LIGHTING_SETTINGS embody))
|
|
114
|
+
(def normalizeDefaultCharacterLightingSettings (.-normalizeDefaultCharacterLightingSettings embody))
|
|
115
|
+
(def CHARACTER_SCENE_TYPES (.-CHARACTER_SCENE_TYPES embody))
|
|
116
|
+
(def CHARACTER_SCENE_TYPE_IDS (.-CHARACTER_SCENE_TYPE_IDS embody))
|
|
117
|
+
(def DEFAULT_CHARACTER_SCENE_TYPE_ID (.-DEFAULT_CHARACTER_SCENE_TYPE_ID embody))
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
(ns polymer.runtime.embody-wasm
|
|
2
|
+
"Direct CLJS access to the Embody Rust/Wasm core.
|
|
3
|
+
|
|
4
|
+
Agencies and LoomLarge tooling should load numeric kernels through this
|
|
5
|
+
namespace rather than going through the TypeScript Embody facade. The Three.js
|
|
6
|
+
adapter (polymer.runtime.embody / Embody class) remains responsible for scene
|
|
7
|
+
graph mutation, AnimationMixer, and host writes."
|
|
8
|
+
(:require ["@lovelace_lol/embody/wasm" :as wasm]))
|
|
9
|
+
|
|
10
|
+
;; Public aliases in this namespace are listed in
|
|
11
|
+
;; scripts/embody-export-contract.mjs and validated across source, shadow-cljs,
|
|
12
|
+
;; checked-in dist JS, declarations, and the pinned upstream Wasm entry.
|
|
13
|
+
|
|
14
|
+
(def ^:private *core (atom nil))
|
|
15
|
+
(def ^:private *init-promise (atom nil))
|
|
16
|
+
|
|
17
|
+
(defn- js-call
|
|
18
|
+
[obj method & args]
|
|
19
|
+
(let [f (aget obj method)]
|
|
20
|
+
(when-not (fn? f)
|
|
21
|
+
(throw (js/Error. (str "Embody Wasm module is missing method: " method))))
|
|
22
|
+
(apply f args)))
|
|
23
|
+
|
|
24
|
+
(defn core-ready?
|
|
25
|
+
"True when init-core! has resolved a Wasm module."
|
|
26
|
+
[]
|
|
27
|
+
(some? @*core))
|
|
28
|
+
|
|
29
|
+
(defn get-core
|
|
30
|
+
"Return the initialized Wasm module or throw."
|
|
31
|
+
[]
|
|
32
|
+
(or @*core
|
|
33
|
+
(throw (js/Error. "Embody Wasm core is not initialized. Call initEmbodyCore / init-core! first."))))
|
|
34
|
+
|
|
35
|
+
(defn init-core!
|
|
36
|
+
"Initialize the Embody Wasm core via @lovelace_lol/embody/wasm.
|
|
37
|
+
|
|
38
|
+
Returns a Promise that resolves to the Wasm module. Subsequent calls reuse
|
|
39
|
+
the same in-flight or completed initialization."
|
|
40
|
+
[]
|
|
41
|
+
(if-let [pending @*init-promise]
|
|
42
|
+
pending
|
|
43
|
+
(let [pending
|
|
44
|
+
(-> (wasm/initEmbodyCore)
|
|
45
|
+
(.then
|
|
46
|
+
(fn [mod]
|
|
47
|
+
(let [expected (or (.-EMBODY_CORE_ABI_VERSION wasm) 1)
|
|
48
|
+
actual (js-call mod "core_abi_version")]
|
|
49
|
+
(when (not= actual expected)
|
|
50
|
+
(throw (js/Error.
|
|
51
|
+
(str "Embody Wasm ABI mismatch: runtime=" actual
|
|
52
|
+
" expected=" expected))))
|
|
53
|
+
(reset! *core mod)
|
|
54
|
+
mod)))
|
|
55
|
+
(.catch
|
|
56
|
+
(fn [err]
|
|
57
|
+
(reset! *init-promise nil)
|
|
58
|
+
(throw err))))]
|
|
59
|
+
(reset! *init-promise pending)
|
|
60
|
+
pending)))
|
|
61
|
+
|
|
62
|
+
;; JS-friendly aliases for shadow-cljs / TypeScript consumers
|
|
63
|
+
(def initEmbodyCore init-core!)
|
|
64
|
+
(def isEmbodyCoreReady core-ready?)
|
|
65
|
+
(def getEmbodyCore get-core)
|
|
66
|
+
|
|
67
|
+
(defn core-abi-version
|
|
68
|
+
[]
|
|
69
|
+
(js-call (get-core) "core_abi_version"))
|
|
70
|
+
|
|
71
|
+
(def coreAbiVersion core-abi-version)
|
|
72
|
+
|
|
73
|
+
(defn pack-morph-frame-delta
|
|
74
|
+
[mesh-ids morph-target-ids values modes]
|
|
75
|
+
(js-call (get-core) "pack_morph_frame_delta" mesh-ids morph-target-ids values modes))
|
|
76
|
+
|
|
77
|
+
(def packMorphFrameDelta pack-morph-frame-delta)
|
|
78
|
+
|
|
79
|
+
(defn solve-bilateral-values
|
|
80
|
+
[base balance]
|
|
81
|
+
(js-call (get-core) "solve_bilateral_values" base balance))
|
|
82
|
+
|
|
83
|
+
(def solveBilateralValues solve-bilateral-values)
|
|
84
|
+
|
|
85
|
+
(defn solve-morph-batch
|
|
86
|
+
[values balances mix-weights]
|
|
87
|
+
(js-call (get-core) "solve_morph_batch" values balances mix-weights))
|
|
88
|
+
|
|
89
|
+
(def solveMorphBatch solve-morph-batch)
|
|
90
|
+
|
|
91
|
+
(defn solve-axis-quaternion
|
|
92
|
+
[axis degrees value scale]
|
|
93
|
+
(js-call (get-core) "solve_axis_quaternion" axis degrees value scale))
|
|
94
|
+
|
|
95
|
+
(def solveAxisQuaternion solve-axis-quaternion)
|
|
96
|
+
|
|
97
|
+
(defn analyze-mesh-proportions
|
|
98
|
+
[vertices vertical-axis]
|
|
99
|
+
(js-call (get-core) "analyze_mesh_proportions" vertices vertical-axis))
|
|
100
|
+
|
|
101
|
+
(def analyzeMeshProportions analyze-mesh-proportions)
|
|
102
|
+
|
|
103
|
+
(defn solve-template-skeleton-fit
|
|
104
|
+
[mesh-vertices template-bounds vertical-axis vertical-anchor]
|
|
105
|
+
(js-call (get-core)
|
|
106
|
+
"solve_template_skeleton_fit"
|
|
107
|
+
mesh-vertices
|
|
108
|
+
template-bounds
|
|
109
|
+
vertical-axis
|
|
110
|
+
vertical-anchor))
|
|
111
|
+
|
|
112
|
+
(def solveTemplateSkeletonFit solve-template-skeleton-fit)
|
|
113
|
+
|
|
114
|
+
(defn compose-template-fit-adjustment
|
|
115
|
+
[fit scale-multiplier offset-x offset-y offset-z]
|
|
116
|
+
(js-call (get-core)
|
|
117
|
+
"compose_template_fit_adjustment"
|
|
118
|
+
fit
|
|
119
|
+
scale-multiplier
|
|
120
|
+
offset-x
|
|
121
|
+
offset-y
|
|
122
|
+
offset-z))
|
|
123
|
+
|
|
124
|
+
(def composeTemplateFitAdjustment compose-template-fit-adjustment)
|
|
125
|
+
|
|
126
|
+
(defn compose-template-skeleton-fit-transform
|
|
127
|
+
[fit-scale fit-translation manual-scale manual-translation]
|
|
128
|
+
(js-call (get-core)
|
|
129
|
+
"compose_template_skeleton_fit_transform"
|
|
130
|
+
fit-scale
|
|
131
|
+
fit-translation
|
|
132
|
+
manual-scale
|
|
133
|
+
manual-translation))
|
|
134
|
+
|
|
135
|
+
(def composeTemplateSkeletonFitTransform compose-template-skeleton-fit-transform)
|
|
136
|
+
|
|
137
|
+
(defn default-hair-physics-config-values
|
|
138
|
+
[]
|
|
139
|
+
(js-call (get-core) "default_hair_physics_config_values"))
|
|
140
|
+
|
|
141
|
+
(def defaultHairPhysicsConfigValues default-hair-physics-config-values)
|
|
142
|
+
|
|
143
|
+
(defn create-hair-physics-solver
|
|
144
|
+
"Construct a Wasm HairPhysicsSolver from optional packed config values."
|
|
145
|
+
([]
|
|
146
|
+
(create-hair-physics-solver (default-hair-physics-config-values)))
|
|
147
|
+
([config-values]
|
|
148
|
+
(let [Ctor (aget (get-core) "HairPhysicsSolver")]
|
|
149
|
+
(when-not Ctor
|
|
150
|
+
(throw (js/Error. "Embody Wasm module does not export HairPhysicsSolver")))
|
|
151
|
+
(new Ctor config-values))))
|
|
152
|
+
|
|
153
|
+
(def createHairPhysicsSolver create-hair-physics-solver)
|
|
154
|
+
|
|
155
|
+
(defn create-runtime-core
|
|
156
|
+
"Construct the Wasm live morph RuntimeCore (AU/viseme state -> packed
|
|
157
|
+
morph FrameDelta rows). Load bindings with load_au_morph_bindings /
|
|
158
|
+
load_viseme_morph_bindings before evaluating."
|
|
159
|
+
[viseme-slot-count]
|
|
160
|
+
(let [Ctor (aget (get-core) "RuntimeCore")]
|
|
161
|
+
(when-not Ctor
|
|
162
|
+
(throw (js/Error. "Embody Wasm module does not export RuntimeCore")))
|
|
163
|
+
(new Ctor viseme-slot-count)))
|
|
164
|
+
|
|
165
|
+
(def createRuntimeCore create-runtime-core)
|
|
166
|
+
|
|
167
|
+
;; Re-export ABI constants from the JS wasm entry for consumers that need them
|
|
168
|
+
;; before init completes.
|
|
169
|
+
(def EMBODY_CORE_ABI_VERSION (or (.-EMBODY_CORE_ABI_VERSION wasm) 1))
|
|
170
|
+
(def PACKED_MORPH_FRAME_DELTA_STRIDE (.-PACKED_MORPH_FRAME_DELTA_STRIDE wasm))
|
|
171
|
+
(def HAIR_CONFIG_STRIDE (.-HAIR_CONFIG_STRIDE wasm))
|
|
172
|
+
(def HAIR_STATE_STRIDE (.-HAIR_STATE_STRIDE wasm))
|
|
173
|
+
(def HAIR_HEAD_STATE_STRIDE (.-HAIR_HEAD_STATE_STRIDE wasm))
|
|
174
|
+
(def HAIR_MORPH_OUTPUT_STRIDE (.-HAIR_MORPH_OUTPUT_STRIDE wasm))
|
|
175
|
+
(def MESH_PROPORTIONS_STRIDE (.-MESH_PROPORTIONS_STRIDE wasm))
|
|
176
|
+
(def TEMPLATE_SKELETON_FIT_SOLUTION_STRIDE (.-TEMPLATE_SKELETON_FIT_SOLUTION_STRIDE wasm))
|
|
177
|
+
(def TEMPLATE_SKELETON_FIT_TRANSFORM_STRIDE (.-TEMPLATE_SKELETON_FIT_TRANSFORM_STRIDE wasm))
|