@lovelace_lol/embody 0.0.8 → 0.0.10

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.
@@ -177,6 +177,197 @@ export class HairPhysicsSolver {
177
177
  }
178
178
  if (Symbol.dispose) HairPhysicsSolver.prototype[Symbol.dispose] = HairPhysicsSolver.prototype.free;
179
179
 
180
+ /**
181
+ * A command protocol for one bound model/profile, not an animation evaluator.
182
+ * Dispatch each returned batch in order, then feed native events to `notify`.
183
+ * Before `free`, dispatch `dispose` to release engine-owned resources.
184
+ */
185
+ export class NativePlaybackSession {
186
+ __destroy_into_raw() {
187
+ const ptr = this.__wbg_ptr;
188
+ this.__wbg_ptr = 0;
189
+ NativePlaybackSessionFinalization.unregister(this);
190
+ return ptr;
191
+ }
192
+ free() {
193
+ const ptr = this.__destroy_into_raw();
194
+ wasm.__wbg_nativeplaybacksession_free(ptr, 0);
195
+ }
196
+ /**
197
+ * @param {string} handle
198
+ * @param {string} control_json
199
+ * @returns {string}
200
+ */
201
+ control(handle, control_json) {
202
+ let deferred4_0;
203
+ let deferred4_1;
204
+ try {
205
+ const ptr0 = passStringToWasm0(handle, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
206
+ const len0 = WASM_VECTOR_LEN;
207
+ const ptr1 = passStringToWasm0(control_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
208
+ const len1 = WASM_VECTOR_LEN;
209
+ const ret = wasm.nativeplaybacksession_control(this.__wbg_ptr, ptr0, len0, ptr1, len1);
210
+ var ptr3 = ret[0];
211
+ var len3 = ret[1];
212
+ if (ret[3]) {
213
+ ptr3 = 0; len3 = 0;
214
+ throw takeFromExternrefTable0(ret[2]);
215
+ }
216
+ deferred4_0 = ptr3;
217
+ deferred4_1 = len3;
218
+ return getStringFromWasm0(ptr3, len3);
219
+ } finally {
220
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
221
+ }
222
+ }
223
+ /**
224
+ * @returns {string}
225
+ */
226
+ dispose() {
227
+ let deferred2_0;
228
+ let deferred2_1;
229
+ try {
230
+ const ret = wasm.nativeplaybacksession_dispose(this.__wbg_ptr);
231
+ var ptr1 = ret[0];
232
+ var len1 = ret[1];
233
+ if (ret[3]) {
234
+ ptr1 = 0; len1 = 0;
235
+ throw takeFromExternrefTable0(ret[2]);
236
+ }
237
+ deferred2_0 = ptr1;
238
+ deferred2_1 = len1;
239
+ return getStringFromWasm0(ptr1, len1);
240
+ } finally {
241
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
242
+ }
243
+ }
244
+ constructor() {
245
+ const ret = wasm.nativeplaybacksession_new();
246
+ if (ret[2]) {
247
+ throw takeFromExternrefTable0(ret[1]);
248
+ }
249
+ this.__wbg_ptr = ret[0];
250
+ NativePlaybackSessionFinalization.register(this, this.__wbg_ptr, this);
251
+ return this;
252
+ }
253
+ /**
254
+ * Late/duplicate/foreign well-formed notifications return an empty batch.
255
+ * A native error after held completion releases resources without emitting
256
+ * a second terminal event.
257
+ * @param {string} native_event_json
258
+ * @returns {string}
259
+ */
260
+ notify(native_event_json) {
261
+ let deferred3_0;
262
+ let deferred3_1;
263
+ try {
264
+ const ptr0 = passStringToWasm0(native_event_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
265
+ const len0 = WASM_VECTOR_LEN;
266
+ const ret = wasm.nativeplaybacksession_notify(this.__wbg_ptr, ptr0, len0);
267
+ var ptr2 = ret[0];
268
+ var len2 = ret[1];
269
+ if (ret[3]) {
270
+ ptr2 = 0; len2 = 0;
271
+ throw takeFromExternrefTable0(ret[2]);
272
+ }
273
+ deferred3_0 = ptr2;
274
+ deferred3_1 = len2;
275
+ return getStringFromWasm0(ptr2, len2);
276
+ } finally {
277
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
278
+ }
279
+ }
280
+ /**
281
+ * Takes concrete ClipIR from RuntimeCore compilation or baked-clip intake.
282
+ * Semantic strength must already be compiled into the clip; weight is the
283
+ * native action's contribution and never changes compiled samples.
284
+ * @param {string} clip_json
285
+ * @param {string} options_json
286
+ * @returns {string}
287
+ */
288
+ play(clip_json, options_json) {
289
+ let deferred4_0;
290
+ let deferred4_1;
291
+ try {
292
+ const ptr0 = passStringToWasm0(clip_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
293
+ const len0 = WASM_VECTOR_LEN;
294
+ const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
295
+ const len1 = WASM_VECTOR_LEN;
296
+ const ret = wasm.nativeplaybacksession_play(this.__wbg_ptr, ptr0, len0, ptr1, len1);
297
+ var ptr3 = ret[0];
298
+ var len3 = ret[1];
299
+ if (ret[3]) {
300
+ ptr3 = 0; len3 = 0;
301
+ throw takeFromExternrefTable0(ret[2]);
302
+ }
303
+ deferred4_0 = ptr3;
304
+ deferred4_1 = len3;
305
+ return getStringFromWasm0(ptr3, len3);
306
+ } finally {
307
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
308
+ }
309
+ }
310
+ /**
311
+ * Always starts a new generation, even if the identity labels are reused.
312
+ * Hosts must call this on every model/profile replacement before new play.
313
+ * @param {string} model_key
314
+ * @param {string} profile_key
315
+ * @returns {string}
316
+ */
317
+ rebind(model_key, profile_key) {
318
+ let deferred4_0;
319
+ let deferred4_1;
320
+ try {
321
+ const ptr0 = passStringToWasm0(model_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
322
+ const len0 = WASM_VECTOR_LEN;
323
+ const ptr1 = passStringToWasm0(profile_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
324
+ const len1 = WASM_VECTOR_LEN;
325
+ const ret = wasm.nativeplaybacksession_rebind(this.__wbg_ptr, ptr0, len0, ptr1, len1);
326
+ var ptr3 = ret[0];
327
+ var len3 = ret[1];
328
+ if (ret[3]) {
329
+ ptr3 = 0; len3 = 0;
330
+ throw takeFromExternrefTable0(ret[2]);
331
+ }
332
+ deferred4_0 = ptr3;
333
+ deferred4_1 = len3;
334
+ return getStringFromWasm0(ptr3, len3);
335
+ } finally {
336
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
337
+ }
338
+ }
339
+ /**
340
+ * Replace authored samples without resetting native time, loop progress or
341
+ * the request identity. A held request remains terminal after a pose edit.
342
+ * @param {string} handle
343
+ * @param {string} clip_json
344
+ * @returns {string}
345
+ */
346
+ replace_clip(handle, clip_json) {
347
+ let deferred4_0;
348
+ let deferred4_1;
349
+ try {
350
+ const ptr0 = passStringToWasm0(handle, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
351
+ const len0 = WASM_VECTOR_LEN;
352
+ const ptr1 = passStringToWasm0(clip_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
353
+ const len1 = WASM_VECTOR_LEN;
354
+ const ret = wasm.nativeplaybacksession_replace_clip(this.__wbg_ptr, ptr0, len0, ptr1, len1);
355
+ var ptr3 = ret[0];
356
+ var len3 = ret[1];
357
+ if (ret[3]) {
358
+ ptr3 = 0; len3 = 0;
359
+ throw takeFromExternrefTable0(ret[2]);
360
+ }
361
+ deferred4_0 = ptr3;
362
+ deferred4_1 = len3;
363
+ return getStringFromWasm0(ptr3, len3);
364
+ } finally {
365
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
366
+ }
367
+ }
368
+ }
369
+ if (Symbol.dispose) NativePlaybackSession.prototype[Symbol.dispose] = NativePlaybackSession.prototype.free;
370
+
180
371
  /**
181
372
  * Host-neutral live morph runtime. Owns AU/viseme/mix state and emits packed
182
373
  * morph frame deltas. Engine objects never enter this struct.
@@ -192,13 +383,6 @@ export class RuntimeCore {
192
383
  const ptr = this.__destroy_into_raw();
193
384
  wasm.__wbg_runtimecore_free(ptr, 0);
194
385
  }
195
- /**
196
- * @returns {number}
197
- */
198
- active_transition_count() {
199
- const ret = wasm.runtimecore_active_transition_count(this.__wbg_ptr);
200
- return ret >>> 0;
201
- }
202
386
  /**
203
387
  * Validate every channel before replacing Body state. Other FACS state remains.
204
388
  * @param {string} json
@@ -218,6 +402,13 @@ export class RuntimeCore {
218
402
  const ret = wasm.runtimecore_au_morph_binding_stride();
219
403
  return ret >>> 0;
220
404
  }
405
+ /**
406
+ * Begin one host command; its concrete destinations determine which native
407
+ * actions are replaced. Unrelated targets keep their existing playback.
408
+ */
409
+ begin_live_command() {
410
+ wasm.runtimecore_begin_live_command(this.__wbg_ptr);
411
+ }
221
412
  /**
222
413
  * @param {string} clip_name
223
414
  * @param {string} curves_json
@@ -248,6 +439,95 @@ export class RuntimeCore {
248
439
  wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
249
440
  }
250
441
  }
442
+ /**
443
+ * Compile the configured gravity response directly to concrete morph
444
+ * tracks. Three owns interpolation from the captured initial scene pose.
445
+ * @param {string} name
446
+ * @param {number} pitch
447
+ * @param {number} duration_seconds
448
+ * @param {string} options_json
449
+ * @returns {string}
450
+ */
451
+ build_hair_gravity_clip(name, pitch, duration_seconds, options_json) {
452
+ let deferred4_0;
453
+ let deferred4_1;
454
+ try {
455
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
456
+ const len0 = WASM_VECTOR_LEN;
457
+ const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
458
+ const len1 = WASM_VECTOR_LEN;
459
+ const ret = wasm.runtimecore_build_hair_gravity_clip(this.__wbg_ptr, ptr0, len0, pitch, duration_seconds, ptr1, len1);
460
+ var ptr3 = ret[0];
461
+ var len3 = ret[1];
462
+ if (ret[3]) {
463
+ ptr3 = 0; len3 = 0;
464
+ throw takeFromExternrefTable0(ret[2]);
465
+ }
466
+ deferred4_0 = ptr3;
467
+ deferred4_1 = len3;
468
+ return getStringFromWasm0(ptr3, len3);
469
+ } finally {
470
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
471
+ }
472
+ }
473
+ /**
474
+ * Compile the current live semantic controls into ordinary native tracks.
475
+ * The connector captures inherited starts at play time; Rust never ticks
476
+ * or interpolates these samples. Empty output relinquishes all live tracks.
477
+ * @param {string} name
478
+ * @param {number} duration_seconds
479
+ * @returns {string}
480
+ */
481
+ build_live_clip(name, duration_seconds) {
482
+ let deferred3_0;
483
+ let deferred3_1;
484
+ try {
485
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
486
+ const len0 = WASM_VECTOR_LEN;
487
+ const ret = wasm.runtimecore_build_live_clip(this.__wbg_ptr, ptr0, len0, duration_seconds);
488
+ var ptr2 = ret[0];
489
+ var len2 = ret[1];
490
+ if (ret[3]) {
491
+ ptr2 = 0; len2 = 0;
492
+ throw takeFromExternrefTable0(ret[2]);
493
+ }
494
+ deferred3_0 = ptr2;
495
+ deferred3_1 = len2;
496
+ return getStringFromWasm0(ptr2, len2);
497
+ } finally {
498
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
499
+ }
500
+ }
501
+ /**
502
+ * Compile relinquished live targets back to their reference values. Run
503
+ * this clip with finalPose=release so native ownership ends at completion.
504
+ * @param {string} name
505
+ * @param {string} previous_clip_json
506
+ * @param {number} duration_seconds
507
+ * @returns {string}
508
+ */
509
+ build_live_release_clip(name, previous_clip_json, duration_seconds) {
510
+ let deferred4_0;
511
+ let deferred4_1;
512
+ try {
513
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
514
+ const len0 = WASM_VECTOR_LEN;
515
+ const ptr1 = passStringToWasm0(previous_clip_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
516
+ const len1 = WASM_VECTOR_LEN;
517
+ const ret = wasm.runtimecore_build_live_release_clip(this.__wbg_ptr, ptr0, len0, ptr1, len1, duration_seconds);
518
+ var ptr3 = ret[0];
519
+ var len3 = ret[1];
520
+ if (ret[3]) {
521
+ ptr3 = 0; len3 = 0;
522
+ throw takeFromExternrefTable0(ret[2]);
523
+ }
524
+ deferred4_0 = ptr3;
525
+ deferred4_1 = len3;
526
+ return getStringFromWasm0(ptr3, len3);
527
+ } finally {
528
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
529
+ }
530
+ }
251
531
  /**
252
532
  * Compile semantic motions and optional facial curves together without changing live state.
253
533
  * @param {string} name
@@ -338,9 +618,6 @@ export class RuntimeCore {
338
618
  clear() {
339
619
  wasm.runtimecore_clear(this.__wbg_ptr);
340
620
  }
341
- clear_transitions() {
342
- wasm.runtimecore_clear_transitions(this.__wbg_ptr);
343
- }
344
621
  /**
345
622
  * Configure the core from the profile and model descriptor JSON hosts
346
623
  * already have. All binding compilation (mesh/morph/bone name resolution,
@@ -399,54 +676,13 @@ export class RuntimeCore {
399
676
  }
400
677
  }
401
678
  /**
402
- * Host-owned crossfade marker. Rust does not lerp; the host mixer should fade.
403
- * @param {string} clip_name
404
- * @param {number} _duration
405
- * @param {string} options_json
406
- * @returns {string}
679
+ * Carry canonical controls across a renderer rebind. Model-local IDs and
680
+ * reference values belong to the new binding and are never copied.
681
+ * @param {RuntimeCore} previous
407
682
  */
408
- crossfade_to(clip_name, _duration, options_json) {
409
- let deferred4_0;
410
- let deferred4_1;
411
- try {
412
- const ptr0 = passStringToWasm0(clip_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
413
- const len0 = WASM_VECTOR_LEN;
414
- const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
415
- const len1 = WASM_VECTOR_LEN;
416
- const ret = wasm.runtimecore_crossfade_to(this.__wbg_ptr, ptr0, len0, _duration, ptr1, len1);
417
- var ptr3 = ret[0];
418
- var len3 = ret[1];
419
- if (ret[3]) {
420
- ptr3 = 0; len3 = 0;
421
- throw takeFromExternrefTable0(ret[2]);
422
- }
423
- deferred4_0 = ptr3;
424
- deferred4_1 = len3;
425
- return getStringFromWasm0(ptr3, len3);
426
- } finally {
427
- wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
428
- }
429
- }
430
- /**
431
- * @returns {string}
432
- */
433
- drain_animation_events() {
434
- let deferred2_0;
435
- let deferred2_1;
436
- try {
437
- const ret = wasm.runtimecore_drain_animation_events(this.__wbg_ptr);
438
- var ptr1 = ret[0];
439
- var len1 = ret[1];
440
- if (ret[3]) {
441
- ptr1 = 0; len1 = 0;
442
- throw takeFromExternrefTable0(ret[2]);
443
- }
444
- deferred2_0 = ptr1;
445
- deferred2_1 = len1;
446
- return getStringFromWasm0(ptr1, len1);
447
- } finally {
448
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
449
- }
683
+ copy_live_state_from(previous) {
684
+ _assertClass(previous, RuntimeCore);
685
+ wasm.runtimecore_copy_live_state_from(this.__wbg_ptr, previous.__wbg_ptr);
450
686
  }
451
687
  /**
452
688
  * Same rows as `evaluate_bone_frame_delta`, but only bones an active AU,
@@ -577,30 +813,6 @@ export class RuntimeCore {
577
813
  wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
578
814
  }
579
815
  }
580
- /**
581
- * @param {string} clip_name
582
- * @returns {string}
583
- */
584
- get_animation_state(clip_name) {
585
- let deferred3_0;
586
- let deferred3_1;
587
- try {
588
- const ptr0 = passStringToWasm0(clip_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
589
- const len0 = WASM_VECTOR_LEN;
590
- const ret = wasm.runtimecore_get_animation_state(this.__wbg_ptr, ptr0, len0);
591
- var ptr2 = ret[0];
592
- var len2 = ret[1];
593
- if (ret[3]) {
594
- ptr2 = 0; len2 = 0;
595
- throw takeFromExternrefTable0(ret[2]);
596
- }
597
- deferred3_0 = ptr2;
598
- deferred3_1 = len2;
599
- return getStringFromWasm0(ptr2, len2);
600
- } finally {
601
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
602
- }
603
- }
604
816
  /**
605
817
  * @param {number} id
606
818
  * @returns {number}
@@ -654,13 +866,15 @@ export class RuntimeCore {
654
866
  return ret;
655
867
  }
656
868
  /**
869
+ * Normalized hair configuration belongs to the selected profile, never an
870
+ * adapter fallback. Explicit empty/null mappings remain empty.
657
871
  * @returns {string}
658
872
  */
659
- get_playing_animations() {
873
+ get_hair_config_json() {
660
874
  let deferred2_0;
661
875
  let deferred2_1;
662
876
  try {
663
- const ret = wasm.runtimecore_get_playing_animations(this.__wbg_ptr);
877
+ const ret = wasm.runtimecore_get_hair_config_json(this.__wbg_ptr);
664
878
  var ptr1 = ret[0];
665
879
  var len1 = ret[1];
666
880
  if (ret[3]) {
@@ -674,6 +888,30 @@ export class RuntimeCore {
674
888
  wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
675
889
  }
676
890
  }
891
+ /**
892
+ * @param {string} available_json
893
+ * @returns {string}
894
+ */
895
+ get_missing_hair_morph_targets_json(available_json) {
896
+ let deferred3_0;
897
+ let deferred3_1;
898
+ try {
899
+ const ptr0 = passStringToWasm0(available_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
900
+ const len0 = WASM_VECTOR_LEN;
901
+ const ret = wasm.runtimecore_get_missing_hair_morph_targets_json(this.__wbg_ptr, ptr0, len0);
902
+ var ptr2 = ret[0];
903
+ var len2 = ret[1];
904
+ if (ret[3]) {
905
+ ptr2 = 0; len2 = 0;
906
+ throw takeFromExternrefTable0(ret[2]);
907
+ }
908
+ deferred3_0 = ptr2;
909
+ deferred3_1 = len2;
910
+ return getStringFromWasm0(ptr2, len2);
911
+ } finally {
912
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
913
+ }
914
+ }
677
915
  /**
678
916
  * Profile-derived motions and resolved model support for prompt/pose editors.
679
917
  * @returns {string}
@@ -709,6 +947,29 @@ export class RuntimeCore {
709
947
  const ret = wasm.runtimecore_get_viseme_jaw_scale(this.__wbg_ptr, index);
710
948
  return ret;
711
949
  }
950
+ /**
951
+ * @param {number} au_id
952
+ * @returns {boolean}
953
+ */
954
+ has_left_right_bones(au_id) {
955
+ const ret = wasm.runtimecore_has_left_right_bones(this.__wbg_ptr, au_id);
956
+ return ret !== 0;
957
+ }
958
+ /**
959
+ * @returns {string}
960
+ */
961
+ live_command_targets_json() {
962
+ let deferred1_0;
963
+ let deferred1_1;
964
+ try {
965
+ const ret = wasm.runtimecore_live_command_targets_json(this.__wbg_ptr);
966
+ deferred1_0 = ret[0];
967
+ deferred1_1 = ret[1];
968
+ return getStringFromWasm0(ret[0], ret[1]);
969
+ } finally {
970
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
971
+ }
972
+ }
712
973
  /**
713
974
  * @param {string} clips_json
714
975
  */
@@ -731,7 +992,6 @@ export class RuntimeCore {
731
992
  wasm.runtimecore_load_au_morph_bindings(this.__wbg_ptr, ptr0, len0);
732
993
  }
733
994
  /**
734
- * Packed rows: `[bone_id, px, py, pz, qx, qy, qz, qw] * N`
735
995
  * @param {Float32Array} values
736
996
  */
737
997
  load_bone_rest_transforms(values) {
@@ -782,119 +1042,19 @@ export class RuntimeCore {
782
1042
  * Packed rows: `[viseme_index, mesh_id, morph_target_id, weight] * N`
783
1043
  * @param {Float32Array} values
784
1044
  */
785
- load_viseme_morph_bindings(values) {
786
- const ptr0 = passArrayF32ToWasm0(values, wasm.__wbindgen_malloc);
787
- const len0 = WASM_VECTOR_LEN;
788
- wasm.runtimecore_load_viseme_morph_bindings(this.__wbg_ptr, ptr0, len0);
789
- }
790
- /**
791
- * @param {number} viseme_slot_count
792
- */
793
- constructor(viseme_slot_count) {
794
- const ret = wasm.runtimecore_new(viseme_slot_count);
795
- this.__wbg_ptr = ret;
796
- RuntimeCoreFinalization.register(this, this.__wbg_ptr, this);
797
- return this;
798
- }
799
- pause_all_animations() {
800
- wasm.runtimecore_pause_all_animations(this.__wbg_ptr);
801
- }
802
- /**
803
- * @param {string} clip_name
804
- */
805
- pause_animation(clip_name) {
806
- const ptr0 = passStringToWasm0(clip_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
807
- const len0 = WASM_VECTOR_LEN;
808
- wasm.runtimecore_pause_animation(this.__wbg_ptr, ptr0, len0);
809
- }
810
- /**
811
- * Registry lookup only. Host animation libraries own play/lerp; this returns
812
- * a host-owned action id marker when the clip exists in the registry.
813
- * @param {string} clip_name
814
- * @param {string} _options_json
815
- * @returns {string}
816
- */
817
- play_animation(clip_name, _options_json) {
818
- let deferred4_0;
819
- let deferred4_1;
820
- try {
821
- const ptr0 = passStringToWasm0(clip_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
822
- const len0 = WASM_VECTOR_LEN;
823
- const ptr1 = passStringToWasm0(_options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
824
- const len1 = WASM_VECTOR_LEN;
825
- const ret = wasm.runtimecore_play_animation(this.__wbg_ptr, ptr0, len0, ptr1, len1);
826
- var ptr3 = ret[0];
827
- var len3 = ret[1];
828
- if (ret[3]) {
829
- ptr3 = 0; len3 = 0;
830
- throw takeFromExternrefTable0(ret[2]);
831
- }
832
- deferred4_0 = ptr3;
833
- deferred4_1 = len3;
834
- return getStringFromWasm0(ptr3, len3);
835
- } finally {
836
- wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
837
- }
838
- }
839
- /**
840
- * @param {string} clip_name
841
- * @param {string} curves_json
842
- * @param {string} options_json
843
- * @returns {string}
844
- */
845
- play_snippet(clip_name, curves_json, options_json) {
846
- let deferred5_0;
847
- let deferred5_1;
848
- try {
849
- const ptr0 = passStringToWasm0(clip_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
850
- const len0 = WASM_VECTOR_LEN;
851
- const ptr1 = passStringToWasm0(curves_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
852
- const len1 = WASM_VECTOR_LEN;
853
- const ptr2 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
854
- const len2 = WASM_VECTOR_LEN;
855
- const ret = wasm.runtimecore_play_snippet(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
856
- var ptr4 = ret[0];
857
- var len4 = ret[1];
858
- if (ret[3]) {
859
- ptr4 = 0; len4 = 0;
860
- throw takeFromExternrefTable0(ret[2]);
861
- }
862
- deferred5_0 = ptr4;
863
- deferred5_1 = len4;
864
- return getStringFromWasm0(ptr4, len4);
865
- } finally {
866
- wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
867
- }
1045
+ load_viseme_morph_bindings(values) {
1046
+ const ptr0 = passArrayF32ToWasm0(values, wasm.__wbindgen_malloc);
1047
+ const len0 = WASM_VECTOR_LEN;
1048
+ wasm.runtimecore_load_viseme_morph_bindings(this.__wbg_ptr, ptr0, len0);
868
1049
  }
869
1050
  /**
870
- * @param {string} clip_name
871
- * @param {string} channels_json
872
- * @param {string} options_json
873
- * @returns {string}
1051
+ * @param {number} viseme_slot_count
874
1052
  */
875
- play_typed_snippet(clip_name, channels_json, options_json) {
876
- let deferred5_0;
877
- let deferred5_1;
878
- try {
879
- const ptr0 = passStringToWasm0(clip_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
880
- const len0 = WASM_VECTOR_LEN;
881
- const ptr1 = passStringToWasm0(channels_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
882
- const len1 = WASM_VECTOR_LEN;
883
- const ptr2 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
884
- const len2 = WASM_VECTOR_LEN;
885
- const ret = wasm.runtimecore_play_typed_snippet(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
886
- var ptr4 = ret[0];
887
- var len4 = ret[1];
888
- if (ret[3]) {
889
- ptr4 = 0; len4 = 0;
890
- throw takeFromExternrefTable0(ret[2]);
891
- }
892
- deferred5_0 = ptr4;
893
- deferred5_1 = len4;
894
- return getStringFromWasm0(ptr4, len4);
895
- } finally {
896
- wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
897
- }
1053
+ constructor(viseme_slot_count) {
1054
+ const ret = wasm.runtimecore_new(viseme_slot_count);
1055
+ this.__wbg_ptr = ret;
1056
+ RuntimeCoreFinalization.register(this, this.__wbg_ptr, this);
1057
+ return this;
898
1058
  }
899
1059
  /**
900
1060
  * @param {string} clip_json
@@ -975,110 +1135,33 @@ export class RuntimeCore {
975
1135
  reset_procedural_frame_tracking() {
976
1136
  wasm.runtimecore_reset_procedural_frame_tracking(this.__wbg_ptr);
977
1137
  }
978
- resume_all_animations() {
979
- wasm.runtimecore_resume_all_animations(this.__wbg_ptr);
980
- }
981
- /**
982
- * @param {string} clip_name
983
- */
984
- resume_animation(clip_name) {
985
- const ptr0 = passStringToWasm0(clip_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
986
- const len0 = WASM_VECTOR_LEN;
987
- wasm.runtimecore_resume_animation(this.__wbg_ptr, ptr0, len0);
988
- }
989
- /**
990
- * @param {string} clip_name
991
- * @param {number} time
992
- */
993
- seek_animation(clip_name, time) {
994
- const ptr0 = passStringToWasm0(clip_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
995
- const len0 = WASM_VECTOR_LEN;
996
- wasm.runtimecore_seek_animation(this.__wbg_ptr, ptr0, len0, time);
997
- }
998
- /**
999
- * @param {string} clip_name
1000
- * @param {string} blend_mode
1001
- */
1002
- set_animation_blend_mode(clip_name, blend_mode) {
1003
- const ptr0 = passStringToWasm0(clip_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1004
- const len0 = WASM_VECTOR_LEN;
1005
- const ptr1 = passStringToWasm0(blend_mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1006
- const len1 = WASM_VECTOR_LEN;
1007
- const ret = wasm.runtimecore_set_animation_blend_mode(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1008
- if (ret[1]) {
1009
- throw takeFromExternrefTable0(ret[0]);
1010
- }
1011
- }
1012
- /**
1013
- * @param {string} clip_name
1014
- * @param {string} easing
1015
- */
1016
- set_animation_easing(clip_name, easing) {
1017
- const ptr0 = passStringToWasm0(clip_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1018
- const len0 = WASM_VECTOR_LEN;
1019
- const ptr1 = passStringToWasm0(easing, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1020
- const len1 = WASM_VECTOR_LEN;
1021
- const ret = wasm.runtimecore_set_animation_easing(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1022
- if (ret[1]) {
1023
- throw takeFromExternrefTable0(ret[0]);
1024
- }
1025
- }
1026
- /**
1027
- * @param {string} clip_name
1028
- * @param {number} intensity
1029
- */
1030
- set_animation_intensity(clip_name, intensity) {
1031
- const ptr0 = passStringToWasm0(clip_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1032
- const len0 = WASM_VECTOR_LEN;
1033
- wasm.runtimecore_set_animation_intensity(this.__wbg_ptr, ptr0, len0, intensity);
1034
- }
1035
1138
  /**
1036
- * @param {string} clip_name
1037
- * @param {string} loop_mode
1139
+ * The adapter supplies native quaternion samples and scene/reference
1140
+ * transforms; the profile resolves which tracks represent head motion.
1141
+ * @param {string} tracks_json
1142
+ * @param {boolean} additive
1143
+ * @returns {string}
1038
1144
  */
1039
- set_animation_loop_mode(clip_name, loop_mode) {
1040
- const ptr0 = passStringToWasm0(clip_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1041
- const len0 = WASM_VECTOR_LEN;
1042
- const ptr1 = passStringToWasm0(loop_mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1043
- const len1 = WASM_VECTOR_LEN;
1044
- const ret = wasm.runtimecore_set_animation_loop_mode(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1045
- if (ret[1]) {
1046
- throw takeFromExternrefTable0(ret[0]);
1145
+ resolve_hair_motion_json(tracks_json, additive) {
1146
+ let deferred3_0;
1147
+ let deferred3_1;
1148
+ try {
1149
+ const ptr0 = passStringToWasm0(tracks_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1150
+ const len0 = WASM_VECTOR_LEN;
1151
+ const ret = wasm.runtimecore_resolve_hair_motion_json(this.__wbg_ptr, ptr0, len0, additive);
1152
+ var ptr2 = ret[0];
1153
+ var len2 = ret[1];
1154
+ if (ret[3]) {
1155
+ ptr2 = 0; len2 = 0;
1156
+ throw takeFromExternrefTable0(ret[2]);
1157
+ }
1158
+ deferred3_0 = ptr2;
1159
+ deferred3_1 = len2;
1160
+ return getStringFromWasm0(ptr2, len2);
1161
+ } finally {
1162
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
1047
1163
  }
1048
1164
  }
1049
- /**
1050
- * @param {string} clip_name
1051
- * @param {number} repeat_count
1052
- */
1053
- set_animation_repeat_count(clip_name, repeat_count) {
1054
- const ptr0 = passStringToWasm0(clip_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1055
- const len0 = WASM_VECTOR_LEN;
1056
- wasm.runtimecore_set_animation_repeat_count(this.__wbg_ptr, ptr0, len0, repeat_count);
1057
- }
1058
- /**
1059
- * @param {string} clip_name
1060
- * @param {boolean} reverse
1061
- */
1062
- set_animation_reverse(clip_name, reverse) {
1063
- const ptr0 = passStringToWasm0(clip_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1064
- const len0 = WASM_VECTOR_LEN;
1065
- wasm.runtimecore_set_animation_reverse(this.__wbg_ptr, ptr0, len0, reverse);
1066
- }
1067
- /**
1068
- * @param {string} clip_name
1069
- * @param {number} speed
1070
- */
1071
- set_animation_speed(clip_name, speed) {
1072
- const ptr0 = passStringToWasm0(clip_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1073
- const len0 = WASM_VECTOR_LEN;
1074
- wasm.runtimecore_set_animation_speed(this.__wbg_ptr, ptr0, len0, speed);
1075
- }
1076
- /**
1077
- * @param {number} time_scale
1078
- */
1079
- set_animation_time_scale(time_scale) {
1080
- wasm.runtimecore_set_animation_time_scale(this.__wbg_ptr, time_scale);
1081
- }
1082
1165
  /**
1083
1166
  * @param {number} id
1084
1167
  * @param {number} value
@@ -1114,6 +1197,30 @@ export class RuntimeCore {
1114
1197
  set_continuum(neg_au, pos_au, value, balance) {
1115
1198
  wasm.runtimecore_set_continuum(this.__wbg_ptr, neg_au, pos_au, value, balance);
1116
1199
  }
1200
+ /**
1201
+ * @param {string} update_json
1202
+ * @returns {string}
1203
+ */
1204
+ set_hair_config_json(update_json) {
1205
+ let deferred3_0;
1206
+ let deferred3_1;
1207
+ try {
1208
+ const ptr0 = passStringToWasm0(update_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1209
+ const len0 = WASM_VECTOR_LEN;
1210
+ const ret = wasm.runtimecore_set_hair_config_json(this.__wbg_ptr, ptr0, len0);
1211
+ var ptr2 = ret[0];
1212
+ var len2 = ret[1];
1213
+ if (ret[3]) {
1214
+ ptr2 = 0; len2 = 0;
1215
+ throw takeFromExternrefTable0(ret[2]);
1216
+ }
1217
+ deferred3_0 = ptr2;
1218
+ deferred3_1 = len2;
1219
+ return getStringFromWasm0(ptr2, len2);
1220
+ } finally {
1221
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
1222
+ }
1223
+ }
1117
1224
  /**
1118
1225
  * @param {Uint32Array} ids
1119
1226
  */
@@ -1168,93 +1275,6 @@ export class RuntimeCore {
1168
1275
  set_viseme_slot_count(count) {
1169
1276
  wasm.runtimecore_set_viseme_slot_count(this.__wbg_ptr, count);
1170
1277
  }
1171
- stop_all_animations() {
1172
- wasm.runtimecore_stop_all_animations(this.__wbg_ptr);
1173
- }
1174
- /**
1175
- * @param {string} clip_name
1176
- */
1177
- stop_animation(clip_name) {
1178
- const ptr0 = passStringToWasm0(clip_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1179
- const len0 = WASM_VECTOR_LEN;
1180
- wasm.runtimecore_stop_animation(this.__wbg_ptr, ptr0, len0);
1181
- }
1182
- /**
1183
- * Set an AU immediately. Duration is ignored — host mixers own timed fades.
1184
- * @param {number} id
1185
- * @param {number} to
1186
- * @param {number} _duration_ms
1187
- * @param {number} balance
1188
- */
1189
- transition_au(id, to, _duration_ms, balance) {
1190
- wasm.runtimecore_transition_au(this.__wbg_ptr, id, to, _duration_ms, balance);
1191
- }
1192
- /**
1193
- * Set morph(s) immediately. Duration is ignored — host mixers own timed fades.
1194
- * @param {string} morph_name
1195
- * @param {number} to
1196
- * @param {number} _duration_ms
1197
- * @param {string} mesh_names_json
1198
- * @returns {number}
1199
- */
1200
- transition_morph(morph_name, to, _duration_ms, mesh_names_json) {
1201
- const ptr0 = passStringToWasm0(morph_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1202
- const len0 = WASM_VECTOR_LEN;
1203
- const ptr1 = passStringToWasm0(mesh_names_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1204
- const len1 = WASM_VECTOR_LEN;
1205
- const ret = wasm.runtimecore_transition_morph(this.__wbg_ptr, ptr0, len0, to, _duration_ms, ptr1, len1);
1206
- return ret >>> 0;
1207
- }
1208
- /**
1209
- * Set morph index target(s) immediately. Duration is ignored.
1210
- * @param {number} morph_index
1211
- * @param {number} to
1212
- * @param {number} _duration_ms
1213
- * @param {string} mesh_names_json
1214
- * @returns {number}
1215
- */
1216
- transition_morph_index(morph_index, to, _duration_ms, mesh_names_json) {
1217
- const ptr0 = passStringToWasm0(mesh_names_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1218
- const len0 = WASM_VECTOR_LEN;
1219
- const ret = wasm.runtimecore_transition_morph_index(this.__wbg_ptr, morph_index, to, _duration_ms, ptr0, len0);
1220
- return ret >>> 0;
1221
- }
1222
- /**
1223
- * Set a viseme immediately. Duration is ignored — host mixers own timed fades.
1224
- * @param {number} index
1225
- * @param {number} to
1226
- * @param {number} _duration_ms
1227
- * @param {number} jaw_scale
1228
- */
1229
- transition_viseme(index, to, _duration_ms, jaw_scale) {
1230
- wasm.runtimecore_transition_viseme(this.__wbg_ptr, index, to, _duration_ms, jaw_scale);
1231
- }
1232
- /**
1233
- * Tick hook for hosts. Clip playback/lerp lives in the host animation
1234
- * library; Rust only exposes live AU/viseme state for packed frames.
1235
- * @param {number} _dt_seconds
1236
- * @returns {number}
1237
- */
1238
- update(_dt_seconds) {
1239
- const ret = wasm.runtimecore_update(this.__wbg_ptr, _dt_seconds);
1240
- return ret >>> 0;
1241
- }
1242
- /**
1243
- * @param {string} clip_name
1244
- * @param {string} params_json
1245
- * @returns {boolean}
1246
- */
1247
- update_clip_params(clip_name, params_json) {
1248
- const ptr0 = passStringToWasm0(clip_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1249
- const len0 = WASM_VECTOR_LEN;
1250
- const ptr1 = passStringToWasm0(params_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1251
- const len1 = WASM_VECTOR_LEN;
1252
- const ret = wasm.runtimecore_update_clip_params(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1253
- if (ret[2]) {
1254
- throw takeFromExternrefTable0(ret[1]);
1255
- }
1256
- return ret[0] !== 0;
1257
- }
1258
1278
  /**
1259
1279
  * Compile and validate without registering a clip or changing live controls.
1260
1280
  * @param {string} json
@@ -2273,14 +2293,6 @@ export function sample_marker_bezier_curve(start, end, segments) {
2273
2293
  return v3;
2274
2294
  }
2275
2295
 
2276
- /**
2277
- * @returns {number}
2278
- */
2279
- export function screen_space_gaze_solution_stride() {
2280
- const ret = wasm.screen_space_gaze_solution_stride();
2281
- return ret >>> 0;
2282
- }
2283
-
2284
2296
  /**
2285
2297
  * Separates overlapping marker endpoints while preserving each marker's
2286
2298
  * surface anchor and leader-line length.
@@ -2437,193 +2449,6 @@ export function solve_morph_batch(values, balances, mix_weights) {
2437
2449
  return v4;
2438
2450
  }
2439
2451
 
2440
- /**
2441
- * Solve a screen-space eye target against rendered-camera and character-eye
2442
- * geometry using the profile's authored AU rotation limits.
2443
- *
2444
- * Output layout (14 floats): combined target x/y, eye target x/y, head target
2445
- * x/y, total yaw/pitch degrees, camera-center yaw/pitch degrees, eye-to-camera
2446
- * distance, and viewer-target world x/y/z.
2447
- *
2448
- * The profile must describe the active rig and calibrated semantic yaw/pitch
2449
- * axes: neutral forward is model +Z, up is +Y, and head yaw precedes pitch.
2450
- * Bone availability/rest and optical-axis calibration are not encoded by this
2451
- * ABI. Missing or morph-only AUs have no inferred angular capacity. Shared eye
2452
- * outputs cannot represent vergence or independently calibrated eye ranges.
2453
- * Head follow is participation from model-neutral +Z toward the shared target;
2454
- * zero prefers neutral, with additional head movement allowed for eye overflow.
2455
- * @param {string} profile_json
2456
- * @param {Float32Array} screen_target
2457
- * @param {Float32Array} camera_position
2458
- * @param {Float32Array} camera_quaternion
2459
- * @param {Float32Array} gaze_origin
2460
- * @param {Float32Array} model_quaternion
2461
- * @param {number} vertical_fov_degrees
2462
- * @param {number} aspect
2463
- * @param {boolean} eyes_enabled
2464
- * @param {boolean} head_enabled
2465
- * @param {number} head_follow_fraction
2466
- * @returns {Float32Array}
2467
- */
2468
- export function solve_profile_screen_space_gaze(profile_json, screen_target, camera_position, camera_quaternion, gaze_origin, model_quaternion, vertical_fov_degrees, aspect, eyes_enabled, head_enabled, head_follow_fraction) {
2469
- const ptr0 = passStringToWasm0(profile_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2470
- const len0 = WASM_VECTOR_LEN;
2471
- const ptr1 = passArrayF32ToWasm0(screen_target, wasm.__wbindgen_malloc);
2472
- const len1 = WASM_VECTOR_LEN;
2473
- const ptr2 = passArrayF32ToWasm0(camera_position, wasm.__wbindgen_malloc);
2474
- const len2 = WASM_VECTOR_LEN;
2475
- const ptr3 = passArrayF32ToWasm0(camera_quaternion, wasm.__wbindgen_malloc);
2476
- const len3 = WASM_VECTOR_LEN;
2477
- const ptr4 = passArrayF32ToWasm0(gaze_origin, wasm.__wbindgen_malloc);
2478
- const len4 = WASM_VECTOR_LEN;
2479
- const ptr5 = passArrayF32ToWasm0(model_quaternion, wasm.__wbindgen_malloc);
2480
- const len5 = WASM_VECTOR_LEN;
2481
- const ret = wasm.solve_profile_screen_space_gaze(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, vertical_fov_degrees, aspect, eyes_enabled, head_enabled, head_follow_fraction);
2482
- if (ret[3]) {
2483
- throw takeFromExternrefTable0(ret[2]);
2484
- }
2485
- var v7 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
2486
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2487
- return v7;
2488
- }
2489
-
2490
- /**
2491
- * Normalized tracking controls span the active profile's signed head AU range
2492
- * (or eye range with the head disabled). At full head participation, +/-1 on
2493
- * an aligned display axis reaches the same rotation as its AU at intensity 1.
2494
- * Zero input retains the camera bearing, bounded by that range. Camera roll
2495
- * rotates display axes into the model frame. X/Y are clamped to [-1, 1]; Z is
2496
- * finite-target depth in meters and does not attenuate angular movement.
2497
- * Pass 1 for full head participation; smaller explicit fractions retain the
2498
- * existing allocation policy. Output layout matches the physical gaze solvers.
2499
- * @param {string} profile_json
2500
- * @param {Float32Array} tracking_target
2501
- * @param {Float32Array} camera_position
2502
- * @param {Float32Array} camera_quaternion
2503
- * @param {Float32Array} gaze_origin
2504
- * @param {Float32Array} model_quaternion
2505
- * @param {boolean} eyes_enabled
2506
- * @param {boolean} head_enabled
2507
- * @param {number} head_follow_fraction
2508
- * @param {boolean} lock_head_to_camera
2509
- * @param {number} world_units_per_meter
2510
- * @returns {Float32Array}
2511
- */
2512
- export function solve_profile_tracking_gaze(profile_json, tracking_target, camera_position, camera_quaternion, gaze_origin, model_quaternion, eyes_enabled, head_enabled, head_follow_fraction, lock_head_to_camera, world_units_per_meter) {
2513
- const ptr0 = passStringToWasm0(profile_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2514
- const len0 = WASM_VECTOR_LEN;
2515
- const ptr1 = passArrayF32ToWasm0(tracking_target, wasm.__wbindgen_malloc);
2516
- const len1 = WASM_VECTOR_LEN;
2517
- const ptr2 = passArrayF32ToWasm0(camera_position, wasm.__wbindgen_malloc);
2518
- const len2 = WASM_VECTOR_LEN;
2519
- const ptr3 = passArrayF32ToWasm0(camera_quaternion, wasm.__wbindgen_malloc);
2520
- const len3 = WASM_VECTOR_LEN;
2521
- const ptr4 = passArrayF32ToWasm0(gaze_origin, wasm.__wbindgen_malloc);
2522
- const len4 = WASM_VECTOR_LEN;
2523
- const ptr5 = passArrayF32ToWasm0(model_quaternion, wasm.__wbindgen_malloc);
2524
- const len5 = WASM_VECTOR_LEN;
2525
- const ret = wasm.solve_profile_tracking_gaze(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, eyes_enabled, head_enabled, head_follow_fraction, lock_head_to_camera, world_units_per_meter);
2526
- if (ret[3]) {
2527
- throw takeFromExternrefTable0(ret[2]);
2528
- }
2529
- var v7 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
2530
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2531
- return v7;
2532
- }
2533
-
2534
- /**
2535
- * Solve a webcam/user target against the rendered camera. `viewer_target` is
2536
- * x/y in webcam NDC and z as estimated viewer distance behind the rendered
2537
- * camera in the same units as `camera_position` and `gaze_origin`. Hosts must
2538
- * convert estimated meters to scene units before calling. Zero x/y extends the
2539
- * eye-to-camera bearing; camera-right/up offsets retain the viewer projection
2540
- * without making eye contact depend on where the eyes sit in the image.
2541
- * `lock_head_to_camera` prefers the camera bearing while eyes can reach; it
2542
- * allows head overflow correction and follows the viewer with eyes disabled.
2543
- * Without that explicit lock, head follow participates from model-neutral +Z
2544
- * toward the shared target. A zero follow fraction does not imply camera lock.
2545
- * New consumers with metric viewer depth should use
2546
- * `solve_profile_viewer_space_gaze_scaled` to supply the scene conversion.
2547
- * @param {string} profile_json
2548
- * @param {Float32Array} viewer_target
2549
- * @param {Float32Array} camera_position
2550
- * @param {Float32Array} camera_quaternion
2551
- * @param {Float32Array} gaze_origin
2552
- * @param {Float32Array} model_quaternion
2553
- * @param {number} viewer_vertical_fov_degrees
2554
- * @param {number} viewer_aspect
2555
- * @param {boolean} eyes_enabled
2556
- * @param {boolean} head_enabled
2557
- * @param {number} head_follow_fraction
2558
- * @param {boolean} lock_head_to_camera
2559
- * @returns {Float32Array}
2560
- */
2561
- export function solve_profile_viewer_space_gaze(profile_json, viewer_target, camera_position, camera_quaternion, gaze_origin, model_quaternion, viewer_vertical_fov_degrees, viewer_aspect, eyes_enabled, head_enabled, head_follow_fraction, lock_head_to_camera) {
2562
- const ptr0 = passStringToWasm0(profile_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2563
- const len0 = WASM_VECTOR_LEN;
2564
- const ptr1 = passArrayF32ToWasm0(viewer_target, wasm.__wbindgen_malloc);
2565
- const len1 = WASM_VECTOR_LEN;
2566
- const ptr2 = passArrayF32ToWasm0(camera_position, wasm.__wbindgen_malloc);
2567
- const len2 = WASM_VECTOR_LEN;
2568
- const ptr3 = passArrayF32ToWasm0(camera_quaternion, wasm.__wbindgen_malloc);
2569
- const len3 = WASM_VECTOR_LEN;
2570
- const ptr4 = passArrayF32ToWasm0(gaze_origin, wasm.__wbindgen_malloc);
2571
- const len4 = WASM_VECTOR_LEN;
2572
- const ptr5 = passArrayF32ToWasm0(model_quaternion, wasm.__wbindgen_malloc);
2573
- const len5 = WASM_VECTOR_LEN;
2574
- const ret = wasm.solve_profile_viewer_space_gaze(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, viewer_vertical_fov_degrees, viewer_aspect, eyes_enabled, head_enabled, head_follow_fraction, lock_head_to_camera);
2575
- if (ret[3]) {
2576
- throw takeFromExternrefTable0(ret[2]);
2577
- }
2578
- var v7 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
2579
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2580
- return v7;
2581
- }
2582
-
2583
- /**
2584
- * Solve a webcam/user target with an explicit scene-unit conversion.
2585
- * `viewer_target` x/y are normalized webcam coordinates and z is estimated
2586
- * viewer distance in meters. `world_units_per_meter` converts both that depth
2587
- * and its projected lateral offsets into the units of `camera_position` and
2588
- * `gaze_origin`. Positive finite scales are accepted; malformed scales use 1.
2589
- * The output layout and head/eye allocation match the unscaled export.
2590
- * @param {string} profile_json
2591
- * @param {Float32Array} viewer_target
2592
- * @param {Float32Array} camera_position
2593
- * @param {Float32Array} camera_quaternion
2594
- * @param {Float32Array} gaze_origin
2595
- * @param {Float32Array} model_quaternion
2596
- * @param {number} viewer_vertical_fov_degrees
2597
- * @param {number} viewer_aspect
2598
- * @param {boolean} eyes_enabled
2599
- * @param {boolean} head_enabled
2600
- * @param {number} head_follow_fraction
2601
- * @param {boolean} lock_head_to_camera
2602
- * @param {number} world_units_per_meter
2603
- * @returns {Float32Array}
2604
- */
2605
- export function solve_profile_viewer_space_gaze_scaled(profile_json, viewer_target, camera_position, camera_quaternion, gaze_origin, model_quaternion, viewer_vertical_fov_degrees, viewer_aspect, eyes_enabled, head_enabled, head_follow_fraction, lock_head_to_camera, world_units_per_meter) {
2606
- const ptr0 = passStringToWasm0(profile_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2607
- const len0 = WASM_VECTOR_LEN;
2608
- const ptr1 = passArrayF32ToWasm0(viewer_target, wasm.__wbindgen_malloc);
2609
- const len1 = WASM_VECTOR_LEN;
2610
- const ptr2 = passArrayF32ToWasm0(camera_position, wasm.__wbindgen_malloc);
2611
- const len2 = WASM_VECTOR_LEN;
2612
- const ptr3 = passArrayF32ToWasm0(camera_quaternion, wasm.__wbindgen_malloc);
2613
- const len3 = WASM_VECTOR_LEN;
2614
- const ptr4 = passArrayF32ToWasm0(gaze_origin, wasm.__wbindgen_malloc);
2615
- const len4 = WASM_VECTOR_LEN;
2616
- const ptr5 = passArrayF32ToWasm0(model_quaternion, wasm.__wbindgen_malloc);
2617
- const len5 = WASM_VECTOR_LEN;
2618
- const ret = wasm.solve_profile_viewer_space_gaze_scaled(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, viewer_vertical_fov_degrees, viewer_aspect, eyes_enabled, head_enabled, head_follow_fraction, lock_head_to_camera, world_units_per_meter);
2619
- if (ret[3]) {
2620
- throw takeFromExternrefTable0(ret[2]);
2621
- }
2622
- var v7 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
2623
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2624
- return v7;
2625
- }
2626
-
2627
2452
  /**
2628
2453
  * Solve a uniform scale and translation for placing a template skeleton inside a mesh.
2629
2454
  *
@@ -2823,10 +2648,19 @@ const CameraOrbitFinalization = (typeof FinalizationRegistry === 'undefined')
2823
2648
  const HairPhysicsSolverFinalization = (typeof FinalizationRegistry === 'undefined')
2824
2649
  ? { register: () => {}, unregister: () => {} }
2825
2650
  : new FinalizationRegistry(ptr => wasm.__wbg_hairphysicssolver_free(ptr, 1));
2651
+ const NativePlaybackSessionFinalization = (typeof FinalizationRegistry === 'undefined')
2652
+ ? { register: () => {}, unregister: () => {} }
2653
+ : new FinalizationRegistry(ptr => wasm.__wbg_nativeplaybacksession_free(ptr, 1));
2826
2654
  const RuntimeCoreFinalization = (typeof FinalizationRegistry === 'undefined')
2827
2655
  ? { register: () => {}, unregister: () => {} }
2828
2656
  : new FinalizationRegistry(ptr => wasm.__wbg_runtimecore_free(ptr, 1));
2829
2657
 
2658
+ function _assertClass(instance, klass) {
2659
+ if (!(instance instanceof klass)) {
2660
+ throw new Error(`expected instance of ${klass.name}`);
2661
+ }
2662
+ }
2663
+
2830
2664
  function getArrayF32FromWasm0(ptr, len) {
2831
2665
  ptr = ptr >>> 0;
2832
2666
  return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);