@davi-ai/react-bodyengine-three 1.0.24 → 1.0.26
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/dist/index.js +249 -249
- package/dist/stats.html +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
3
|
-
import { Vector3 as $e, TempNode as et, NodeUpdateType as tt, Matrix4 as
|
|
1
|
+
import M, { useState as D, useMemo as ye, useEffect as V, useRef as se, useCallback as Ye, Suspense as Xe } from "react";
|
|
2
|
+
import * as A from "three/webgpu";
|
|
3
|
+
import { Vector3 as $e, TempNode as et, NodeUpdateType as tt, Matrix4 as X, Vector2 as ge, RenderTarget as be, DepthTexture as we, HalfFloatType as Me, NodeMaterial as st, RendererUtils as Te, Color as rt, QuadMesh as at, FloatType as nt } from "three/webgpu";
|
|
4
4
|
import { Object3D as $s } from "three/webgpu";
|
|
5
|
-
import { CharacterState as
|
|
5
|
+
import { CharacterState as J, CreationTool as ee, AvaturnLoader as ot, AvatarSDKLoader as it, CC3Loader as ct, Character as he } from "@davi-ai/bodyengine-three";
|
|
6
6
|
import { CharacterState as tr, CreationTool as sr, bmlTags as rr, emotionList as ar } from "@davi-ai/bodyengine-three";
|
|
7
7
|
import { useDetectGPU as lt, AdaptiveDpr as ht, PerspectiveCamera as dt, CameraControls as ut, Environment as mt } from "@react-three/drei";
|
|
8
|
-
import { convertToTexture as pt, uniform as
|
|
8
|
+
import { convertToTexture as pt, uniform as Q, passTexture as gt, texture as Ae, velocity as fe, struct as ft, Fn as te, float as Y, vec2 as de, If as ke, vec4 as $, max as oe, ivec2 as yt, luminance as Ce, add as Oe, uv as St, mix as _e, logarithmicDepthToViewZ as xt, viewZToPerspectiveDepth as Pe, getViewPosition as vt, viewZToOrthographicDepth as bt, pass as wt, mrt as Ve, diffuseColor as Mt, output as Ne, directionToColor as Tt, normalView as At, sample as kt, colorToDirection as Ct } from "three/tsl";
|
|
9
9
|
import { ssgi as _t } from "three/addons/tsl/display/SSGINode.js";
|
|
10
|
-
import { Canvas as Pt, useThree as
|
|
11
|
-
import { createSpeechSynthesisPonyfill as
|
|
10
|
+
import { Canvas as Pt, useThree as Vt, useFrame as He } from "@react-three/fiber";
|
|
11
|
+
import { createSpeechSynthesisPonyfill as Nt, SpeechSynthesisUtterance as It } from "@davi-ai/web-speech-cognitive-services-davi";
|
|
12
12
|
const Ie = (e) => {
|
|
13
13
|
let t;
|
|
14
14
|
const s = /* @__PURE__ */ new Set(), r = (h, p) => {
|
|
15
15
|
const g = typeof h == "function" ? h(t) : h;
|
|
16
16
|
if (!Object.is(g, t)) {
|
|
17
|
-
const
|
|
18
|
-
t = p ?? (typeof g != "object" || g === null) ? g : Object.assign({}, t, g), s.forEach((i) => i(t,
|
|
17
|
+
const b = t;
|
|
18
|
+
t = p ?? (typeof g != "object" || g === null) ? g : Object.assign({}, t, g), s.forEach((i) => i(t, b));
|
|
19
19
|
}
|
|
20
|
-
}, o = () => t,
|
|
21
|
-
return
|
|
20
|
+
}, o = () => t, v = { setState: r, getState: o, getInitialState: () => x, subscribe: (h) => (s.add(h), () => s.delete(h)) }, x = t = e(r, o, v);
|
|
21
|
+
return v;
|
|
22
22
|
}, Ft = (e) => e ? Ie(e) : Ie, Rt = (e) => e;
|
|
23
23
|
function Bt(e, t = Rt) {
|
|
24
|
-
const s =
|
|
24
|
+
const s = M.useSyncExternalStore(
|
|
25
25
|
e.subscribe,
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
M.useCallback(() => t(e.getState()), [e, t]),
|
|
27
|
+
M.useCallback(() => t(e.getInitialState()), [e, t])
|
|
28
28
|
);
|
|
29
|
-
return
|
|
29
|
+
return M.useDebugValue(s), s;
|
|
30
30
|
}
|
|
31
31
|
const zt = (e) => {
|
|
32
32
|
const t = Ft(e), s = (r) => Bt(t, r);
|
|
33
33
|
return Object.assign(s, t), s;
|
|
34
|
-
},
|
|
34
|
+
}, ae = (e) => zt, k = ae()(() => ({
|
|
35
35
|
character: null,
|
|
36
36
|
managers: [],
|
|
37
37
|
globalManager: null,
|
|
@@ -47,21 +47,21 @@ const zt = (e) => {
|
|
|
47
47
|
characterWidth: 0,
|
|
48
48
|
characterHeight: 0,
|
|
49
49
|
characterDepth: 0,
|
|
50
|
-
characterState:
|
|
50
|
+
characterState: J.idle
|
|
51
51
|
})), Dt = (e) => {
|
|
52
|
-
|
|
52
|
+
k.setState({ character: e }), k.setState({ managers: {
|
|
53
53
|
lipSyncManager: (e == null ? void 0 : e.lipSyncManager) || null,
|
|
54
54
|
blendshapeManager: (e == null ? void 0 : e.blendshapeManager) || null,
|
|
55
55
|
eyeBlinkManager: (e == null ? void 0 : e.eyeBlinkManager) || null,
|
|
56
56
|
animationManager: (e == null ? void 0 : e.animationManager) || null
|
|
57
|
-
} }),
|
|
57
|
+
} }), k.setState({ globalManager: (e == null ? void 0 : e.globalManager) || null }), k.setState({ lipSyncManager: (e == null ? void 0 : e.lipSyncManager) || null }), k.setState({ blendshapeManager: (e == null ? void 0 : e.blendshapeManager) || null }), k.setState({ eyeBlinkManager: (e == null ? void 0 : e.eyeBlinkManager) || null }), k.setState({ animationManager: (e == null ? void 0 : e.animationManager) || null }), k.setState({ FACSManager: (e == null ? void 0 : e.FACSManager) || null }), k.setState({ headPoseManager: (e == null ? void 0 : e.headPoseManager) || null }), k.setState({ gazeManager: (e == null ? void 0 : e.gazeManager) || null }), k.setState({ bmlManager: (e == null ? void 0 : e.bmlManager) || null });
|
|
58
58
|
}, Fe = (e) => {
|
|
59
|
-
|
|
59
|
+
k.setState({ animationsLoaded: e });
|
|
60
60
|
}, jt = (e) => {
|
|
61
|
-
|
|
62
|
-
}, Cs = () =>
|
|
63
|
-
|
|
64
|
-
}, z =
|
|
61
|
+
k.setState({ characterWidth: e.x }), k.setState({ characterHeight: e.y }), k.setState({ characterDepth: e.z });
|
|
62
|
+
}, Cs = () => k.getState().characterHeight, Re = (e) => {
|
|
63
|
+
k.setState({ characterState: e });
|
|
64
|
+
}, z = ae()(() => ({
|
|
65
65
|
cameraRef: null,
|
|
66
66
|
cameraPosition: new $e(0, 0, 5),
|
|
67
67
|
bodyCenter: null,
|
|
@@ -83,7 +83,7 @@ const zt = (e) => {
|
|
|
83
83
|
z.setState({ lookAt: e });
|
|
84
84
|
}, Ps = () => z.getState().lookAt, Ht = (e) => {
|
|
85
85
|
z.setState({ movable: e });
|
|
86
|
-
}, E =
|
|
86
|
+
}, E = ae()(() => ({
|
|
87
87
|
currentAUs: null,
|
|
88
88
|
currentGaze: null,
|
|
89
89
|
currentHeadPose: null,
|
|
@@ -92,9 +92,9 @@ const zt = (e) => {
|
|
|
92
92
|
showFirstTarget: !1
|
|
93
93
|
})), Wt = (e) => {
|
|
94
94
|
E.setState({ targets: e });
|
|
95
|
-
}, Ns = (e) => {
|
|
96
|
-
E.setState({ currentAUs: e });
|
|
97
95
|
}, Vs = (e) => {
|
|
96
|
+
E.setState({ currentAUs: e });
|
|
97
|
+
}, Ns = (e) => {
|
|
98
98
|
E.setState({ currentGaze: e });
|
|
99
99
|
}, Is = (e) => {
|
|
100
100
|
E.setState({ currentHeadPose: e });
|
|
@@ -102,14 +102,14 @@ const zt = (e) => {
|
|
|
102
102
|
E.setState({ lookAtCamera: e }), e ? qt() : Gt();
|
|
103
103
|
}, Fs = (e) => {
|
|
104
104
|
E.setState({ lookAtCamera: e });
|
|
105
|
-
const t =
|
|
105
|
+
const t = k.getState().globalManager;
|
|
106
106
|
if (e) {
|
|
107
107
|
const s = z.getState().cameraRef;
|
|
108
108
|
t == null || t.lookAtAndSteady(s);
|
|
109
109
|
} else
|
|
110
110
|
t == null || t.releaseLookAt();
|
|
111
111
|
}, qt = (e) => {
|
|
112
|
-
const t =
|
|
112
|
+
const t = k.getState().globalManager;
|
|
113
113
|
if (e)
|
|
114
114
|
t == null || t.lookAtAndKeep(e);
|
|
115
115
|
else {
|
|
@@ -118,27 +118,27 @@ const zt = (e) => {
|
|
|
118
118
|
}
|
|
119
119
|
}, Gt = () => {
|
|
120
120
|
var e;
|
|
121
|
-
(e =
|
|
121
|
+
(e = k.getState().globalManager) == null || e.releaseLookAt();
|
|
122
122
|
}, Rs = (e) => {
|
|
123
123
|
E.setState({ showFirstTarget: e });
|
|
124
|
-
},
|
|
124
|
+
}, re = ae()(() => ({
|
|
125
125
|
animationsNames: [],
|
|
126
126
|
animations: /* @__PURE__ */ new Map(),
|
|
127
127
|
currentAnimation: null,
|
|
128
128
|
autoPlay: !0
|
|
129
129
|
})), Jt = (e) => {
|
|
130
|
-
|
|
130
|
+
re.setState({ animationsNames: e });
|
|
131
131
|
}, Kt = (e) => {
|
|
132
|
-
|
|
133
|
-
}, Bs = () =>
|
|
134
|
-
|
|
132
|
+
re.setState({ animations: e });
|
|
133
|
+
}, Bs = () => re.getState().animations, zs = (e) => {
|
|
134
|
+
re.setState({ autoPlay: e });
|
|
135
135
|
}, Ds = (e) => {
|
|
136
|
-
if (
|
|
137
|
-
const s =
|
|
136
|
+
if (re.setState({ autoPlay: !1 }), re.getState().animationsNames.includes(e)) {
|
|
137
|
+
const s = k.getState().animationManager;
|
|
138
138
|
s == null || s.playAnimation(e);
|
|
139
139
|
}
|
|
140
140
|
};
|
|
141
|
-
var F = /* @__PURE__ */ ((e) => (e.eye = "eye", e.mouth = "mouth", e.neck = "neck", e.clavicle = "clavicle", e.torso = "torso", e.belly = "belly", e.lowerbelly = "lowerbelly", e.hips = "hips", e.higherthigh = "higherthigh", e.thigh = "thigh", e.knee = "knee", e.leg = "leg", e.feet = "feet", e))(F || {}),
|
|
141
|
+
var F = /* @__PURE__ */ ((e) => (e.eye = "eye", e.mouth = "mouth", e.neck = "neck", e.clavicle = "clavicle", e.torso = "torso", e.belly = "belly", e.lowerbelly = "lowerbelly", e.hips = "hips", e.higherthigh = "higherthigh", e.thigh = "thigh", e.knee = "knee", e.leg = "leg", e.feet = "feet", e))(F || {}), G = /* @__PURE__ */ ((e) => (e[e.face = 1] = "face", e[e.eighthleft = 2] = "eighthleft", e[e.thirdleft = 3] = "thirdleft", e[e.quarterleft = 4] = "quarterleft", e[e.halfleft = 5] = "halfleft", e[e.eighthright = 6] = "eighthright", e[e.thirdright = 7] = "thirdright", e[e.quarterright = 8] = "quarterright", e[e.halfright = 9] = "halfright", e))(G || {}), R = /* @__PURE__ */ ((e) => (e[e.veryclose = 1] = "veryclose", e[e.closer = 2] = "closer", e[e.close = 3] = "close", e[e.midclose = 4] = "midclose", e[e.medium = 5] = "medium", e[e.midfar = 6] = "midfar", e[e.far = 7] = "far", e[e.farther = 8] = "farther", e[e.veryfar = 9] = "veryfar", e))(R || {}), le = /* @__PURE__ */ ((e) => (e.cc3 = "CC_Base_Body", e.avatarsdk = "AvatarBody", e.avaturn = "Body_Mesh", e))(le || {}), Se = /* @__PURE__ */ ((e) => (e.Jay = "joy", e.Anger = "anger", e.Contempt = "contempt", e.Disgust = "disgust", e.Dislike = "dislike", e.Distress = "distress", e.Fear = "fear", e.Frustration = "frustration", e.Guilt = "guilt", e.Hope = "hope", e.Love = "love", e.Pride = "pride", e.Regret = "regret", e.Relief = "relief", e.Sadness = "sadness", e.Shame = "shame", e.Smile = "smile", e.Surprise = "surprise", e.Neutral = "neutral", e))(Se || {});
|
|
142
142
|
const De = /* @__PURE__ */ new Map([
|
|
143
143
|
[0, "sil"],
|
|
144
144
|
[1, "aa"],
|
|
@@ -293,7 +293,7 @@ const De = /* @__PURE__ */ new Map([
|
|
|
293
293
|
belly: ss,
|
|
294
294
|
knees: rs,
|
|
295
295
|
feet: as
|
|
296
|
-
},
|
|
296
|
+
}, C = ae()(() => ({
|
|
297
297
|
credentials: void 0,
|
|
298
298
|
currentUtterance: null,
|
|
299
299
|
boundaries: [],
|
|
@@ -307,21 +307,21 @@ const De = /* @__PURE__ */ new Map([
|
|
|
307
307
|
visemeIntensity: 1,
|
|
308
308
|
useBlendshapeManager: !1
|
|
309
309
|
})), ns = (e) => {
|
|
310
|
-
|
|
310
|
+
C.setState({ credentials: e });
|
|
311
311
|
}, os = (e) => {
|
|
312
312
|
if (e) {
|
|
313
|
-
const t =
|
|
313
|
+
const t = C.getState().voice;
|
|
314
314
|
t && (e.voice = t);
|
|
315
315
|
}
|
|
316
|
-
|
|
316
|
+
C.setState({ currentUtterance: e }), C.setState({ textToSpeak: null });
|
|
317
317
|
}, Es = (e) => {
|
|
318
|
-
|
|
318
|
+
C.setState({ visemes: e });
|
|
319
319
|
}, Us = (e) => {
|
|
320
|
-
|
|
320
|
+
C.setState({ blendshapes: e });
|
|
321
321
|
}, We = (e) => {
|
|
322
|
-
|
|
322
|
+
C.setState({ visemes: [...C.getState().visemes, e] });
|
|
323
323
|
}, Ls = (e) => {
|
|
324
|
-
|
|
324
|
+
C.setState({ blendshapes: [...C.getState().blendshapes, e] });
|
|
325
325
|
}, Os = (e, t) => {
|
|
326
326
|
const s = Zt.get(e.name);
|
|
327
327
|
if (s) {
|
|
@@ -329,36 +329,36 @@ const De = /* @__PURE__ */ new Map([
|
|
|
329
329
|
r !== void 0 && We({ ...e, name: `${r}`, elapsedTime: e.elapsedTime * (t || 1e7) });
|
|
330
330
|
}
|
|
331
331
|
}, is = (e) => {
|
|
332
|
-
|
|
332
|
+
C.setState({ currentVisemeIndex: e });
|
|
333
333
|
}, cs = (e) => {
|
|
334
|
-
|
|
334
|
+
C.setState({ currentBlendshapeIndex: e });
|
|
335
335
|
}, qe = () => {
|
|
336
336
|
var e;
|
|
337
|
-
|
|
337
|
+
C.setState({
|
|
338
338
|
visemes: [],
|
|
339
339
|
currentVisemeIndex: 0
|
|
340
|
-
}), (e =
|
|
340
|
+
}), (e = k.getState().lipSyncManager) == null || e.stop();
|
|
341
341
|
}, Ge = () => {
|
|
342
342
|
var e;
|
|
343
|
-
|
|
343
|
+
C.setState({
|
|
344
344
|
blendshapes: [],
|
|
345
345
|
currentBlendshapeIndex: 0
|
|
346
|
-
}), (e =
|
|
346
|
+
}), (e = k.getState().blendshapeManager) == null || e.stop();
|
|
347
347
|
}, ls = (e) => {
|
|
348
|
-
|
|
348
|
+
C.setState({ voice: e });
|
|
349
349
|
}, je = (e) => {
|
|
350
|
-
|
|
350
|
+
C.setState({ voices: e });
|
|
351
351
|
}, Hs = (e) => {
|
|
352
|
-
|
|
353
|
-
}, Ws = () =>
|
|
354
|
-
|
|
352
|
+
C.setState({ textToSpeak: e });
|
|
353
|
+
}, Ws = () => C.getState().voices, qs = (e) => {
|
|
354
|
+
C.setState({ visemeIntensity: e });
|
|
355
355
|
}, hs = (e) => {
|
|
356
|
-
e !==
|
|
356
|
+
e !== C.getState().useBlendshapeManager && (qe(), Ge(), C.setState({ useBlendshapeManager: e }));
|
|
357
357
|
}, ds = (e, t, s) => {
|
|
358
358
|
let r = s[e.position || F.eye].getComponent(0);
|
|
359
359
|
const o = s[e.position || F.mouth].getComponent(1);
|
|
360
360
|
let n = 0;
|
|
361
|
-
const f = typeof e.distance == "string" ? parseInt(e.distance) : e.distance,
|
|
361
|
+
const f = typeof e.distance == "string" ? parseInt(e.distance) : e.distance, v = typeof e.rotation == "string" ? parseInt(e.rotation) : e.rotation;
|
|
362
362
|
switch (f) {
|
|
363
363
|
case R.veryclose:
|
|
364
364
|
n = t.veryclose;
|
|
@@ -390,38 +390,38 @@ const De = /* @__PURE__ */ new Map([
|
|
|
390
390
|
n = t.veryfar;
|
|
391
391
|
break;
|
|
392
392
|
}
|
|
393
|
-
if (
|
|
394
|
-
switch (
|
|
395
|
-
case
|
|
393
|
+
if (v && v !== G.face)
|
|
394
|
+
switch (v) {
|
|
395
|
+
case G.eighthleft: {
|
|
396
396
|
const x = 0.2588190451;
|
|
397
397
|
r = r - n * x, n = n * Math.sqrt(1 - Math.pow(x, 2));
|
|
398
398
|
break;
|
|
399
399
|
}
|
|
400
|
-
case
|
|
400
|
+
case G.thirdleft:
|
|
401
401
|
r = r - n * (1 / 2), n = n * (Math.sqrt(3) / 2);
|
|
402
402
|
break;
|
|
403
|
-
case
|
|
403
|
+
case G.quarterleft:
|
|
404
404
|
r = r - n * (Math.SQRT2 / 2), n = n * (Math.SQRT2 / 2);
|
|
405
405
|
break;
|
|
406
|
-
case
|
|
406
|
+
case G.halfleft:
|
|
407
407
|
r = r - n, n = s.eye.getComponent(2);
|
|
408
408
|
break;
|
|
409
|
-
case
|
|
409
|
+
case G.eighthright: {
|
|
410
410
|
const x = 0.2588190451;
|
|
411
411
|
r = r + n * x, n = n * Math.sqrt(1 - Math.pow(x, 2));
|
|
412
412
|
break;
|
|
413
413
|
}
|
|
414
|
-
case
|
|
414
|
+
case G.thirdright:
|
|
415
415
|
r = r + n * (1 / 2), n = n * (Math.sqrt(3) / 2);
|
|
416
416
|
break;
|
|
417
|
-
case
|
|
417
|
+
case G.quarterright:
|
|
418
418
|
r = r + n * (Math.SQRT2 / 2), n = n * (Math.SQRT2 / 2);
|
|
419
419
|
break;
|
|
420
|
-
case
|
|
420
|
+
case G.halfright:
|
|
421
421
|
r = r + n, n = s.eye.getComponent(2);
|
|
422
422
|
break;
|
|
423
423
|
}
|
|
424
|
-
return new
|
|
424
|
+
return new A.Vector3(r, o, n);
|
|
425
425
|
}, me = /* @__PURE__ */ new at(), Ee = /* @__PURE__ */ new ge();
|
|
426
426
|
let pe;
|
|
427
427
|
function Je(e) {
|
|
@@ -434,16 +434,16 @@ function Je(e) {
|
|
|
434
434
|
function f() {
|
|
435
435
|
return n = n * 1664525 + 1013904223 & 4294967295, (n >>> 0) / 4294967296;
|
|
436
436
|
}
|
|
437
|
-
function
|
|
437
|
+
function v(h, p) {
|
|
438
438
|
const g = p;
|
|
439
|
-
let
|
|
439
|
+
let b;
|
|
440
440
|
if (g <= s.length) {
|
|
441
441
|
const d = [];
|
|
442
442
|
for (let c = 0; c < g; c++)
|
|
443
443
|
s[c] || d.push(c);
|
|
444
|
-
|
|
444
|
+
b = d[Math.floor(f() * d.length)];
|
|
445
445
|
} else
|
|
446
|
-
|
|
446
|
+
b = Math.floor(f() * g);
|
|
447
447
|
let i;
|
|
448
448
|
if (g <= r.length) {
|
|
449
449
|
const d = [];
|
|
@@ -452,8 +452,8 @@ function Je(e) {
|
|
|
452
452
|
i = d[Math.floor(f() * d.length)];
|
|
453
453
|
} else
|
|
454
454
|
i = Math.floor(f() * g);
|
|
455
|
-
const l = (
|
|
456
|
-
return
|
|
455
|
+
const l = (b + f()) / g, y = (i + f()) / g;
|
|
456
|
+
return b < s.length && (s[b] = !0), i < r.length && (r[i] = !0), [l, y];
|
|
457
457
|
}
|
|
458
458
|
o(1), t.push([f(), f()]), s[0] = !0, r[0] = !0;
|
|
459
459
|
let x = 1;
|
|
@@ -461,11 +461,11 @@ function Je(e) {
|
|
|
461
461
|
const h = x * 2;
|
|
462
462
|
o(h);
|
|
463
463
|
for (let p = 0; p < x; p++) {
|
|
464
|
-
const [g,
|
|
464
|
+
const [g, b] = t[p], i = Math.min(Math.floor(g * h), h - 1), l = Math.min(Math.floor(b * h), h - 1);
|
|
465
465
|
i < s.length && (s[i] = !0), l < r.length && (r[l] = !0);
|
|
466
466
|
}
|
|
467
467
|
for (let p = 0; p < x; p++) {
|
|
468
|
-
const g =
|
|
468
|
+
const g = v(p, h);
|
|
469
469
|
t.push(g);
|
|
470
470
|
}
|
|
471
471
|
x = h;
|
|
@@ -478,7 +478,7 @@ class us extends et {
|
|
|
478
478
|
return "PMJTAANode";
|
|
479
479
|
}
|
|
480
480
|
constructor(t, s, r, o) {
|
|
481
|
-
super("vec4"), this.isPMJTAANode = !0, this.updateBeforeType = tt.FRAME, this.beautyNode = t, this.depthNode = s, this.velocityNode = r, this.camera = o, this.depthThreshold = 5e-4, this.edgeDepthDiff = 1e-3, this.maxVelocityLength = 128, this.useSubpixelCorrection = !0, this.jitterIntensity = 1, this.useProgressiveAccumulation = !1, this._accumulatedFrames = 0, this.maxAccumulationFrames = 256, this._prevCameraMatrix = new
|
|
481
|
+
super("vec4"), this.isPMJTAANode = !0, this.updateBeforeType = tt.FRAME, this.beautyNode = t, this.depthNode = s, this.velocityNode = r, this.camera = o, this.depthThreshold = 5e-4, this.edgeDepthDiff = 1e-3, this.maxVelocityLength = 128, this.useSubpixelCorrection = !0, this.jitterIntensity = 1, this.useProgressiveAccumulation = !1, this._accumulatedFrames = 0, this.maxAccumulationFrames = 256, this._prevCameraMatrix = new X(), this._progressiveWeight = Q(0), this._jitterIndex = 0, this._sampleCount = 64, this._sequenceLength = Ue.length, this._sequence = Ue, this._invSize = Q(new ge()), this._historyRenderTarget = new be(1, 1, { depthBuffer: !1, type: Me, depthTexture: new we() }), this._historyRenderTarget.texture.name = "PMJTAANode.history", this._resolveRenderTarget = new be(1, 1, { depthBuffer: !1, type: Me }), this._resolveRenderTarget.texture.name = "PMJTAANode.resolve", this._resolveMaterial = new st(), this._resolveMaterial.name = "PMJTAA.resolve", this._textureNode = gt(this, this._resolveRenderTarget.texture), this._originalProjectionMatrix = new X(), this._cameraNearFar = Q(new ge()), this._cameraWorldMatrix = Q(new X()), this._cameraWorldMatrixInverse = Q(new X()), this._cameraProjectionMatrixInverse = Q(new X()), this._previousCameraWorldMatrix = Q(new X()), this._previousCameraProjectionMatrixInverse = Q(new X()), this._previousDepthNode = Ae(new we(1, 1)), this._needsPostProcessingSync = !1, this._velocityNode = null;
|
|
482
482
|
}
|
|
483
483
|
getTextureNode() {
|
|
484
484
|
return this._textureNode;
|
|
@@ -541,15 +541,15 @@ class us extends et {
|
|
|
541
541
|
break;
|
|
542
542
|
}
|
|
543
543
|
o && (this._accumulatedFrames = 0), this._accumulatedFrames++;
|
|
544
|
-
const
|
|
545
|
-
this._progressiveWeight.value = o ? 0 : 1 /
|
|
544
|
+
const b = Math.min(this._accumulatedFrames, this.maxAccumulationFrames);
|
|
545
|
+
this._progressiveWeight.value = o ? 0 : 1 / b, this._prevCameraMatrix.copy(r);
|
|
546
546
|
} else
|
|
547
547
|
this._progressiveWeight.value = 0, this._accumulatedFrames = 0;
|
|
548
548
|
this._previousCameraWorldMatrix.value.copy(this._cameraWorldMatrix.value), this._previousCameraProjectionMatrixInverse.value.copy(this._cameraProjectionMatrixInverse.value), this._cameraNearFar.value.set(this.camera.near, this.camera.far), this._cameraWorldMatrix.value.copy(this.camera.matrixWorld), this._cameraWorldMatrixInverse.value.copy(this.camera.matrixWorldInverse), this._cameraProjectionMatrixInverse.value.copy(this.camera.projectionMatrixInverse);
|
|
549
|
-
const n = this.beautyNode.isRTTNode ? this.beautyNode.renderTarget : this.beautyNode.passNode.renderTarget, f = n.texture.width,
|
|
550
|
-
this._needsPostProcessingSync === !0 && (this.setViewOffset(f,
|
|
551
|
-
const x = this._historyRenderTarget.width !== f || this._historyRenderTarget.height !==
|
|
552
|
-
this.setSize(f,
|
|
549
|
+
const n = this.beautyNode.isRTTNode ? this.beautyNode.renderTarget : this.beautyNode.passNode.renderTarget, f = n.texture.width, v = n.texture.height;
|
|
550
|
+
this._needsPostProcessingSync === !0 && (this.setViewOffset(f, v), this._needsPostProcessingSync = !1), pe = Te.resetRendererState(s, pe), s.setClearColor(new rt(0), 0);
|
|
551
|
+
const x = this._historyRenderTarget.width !== f || this._historyRenderTarget.height !== v;
|
|
552
|
+
this.setSize(f, v), x === !0 && (s.initRenderTarget(this._historyRenderTarget), s.initRenderTarget(this._resolveRenderTarget), s.copyTextureToTexture(n.texture, this._historyRenderTarget.texture)), s.setRenderTarget(this._resolveRenderTarget), me.material = this._resolveMaterial, me.name = "PMJTAA", me.render(s), s.setRenderTarget(null), s.copyTextureToTexture(this._resolveRenderTarget.texture, this._historyRenderTarget.texture);
|
|
553
553
|
const h = s.getDrawingBufferSize(Ee);
|
|
554
554
|
if (this._historyRenderTarget.height === h.height && this._historyRenderTarget.width === h.width) {
|
|
555
555
|
const p = this.depthNode.value;
|
|
@@ -573,7 +573,7 @@ class us extends et {
|
|
|
573
573
|
closestPositionTexel: "vec2",
|
|
574
574
|
farthestDepth: "float"
|
|
575
575
|
}), n = te(([i]) => {
|
|
576
|
-
const l =
|
|
576
|
+
const l = Y(2).toVar(), y = de(0).toVar(), d = Y(-1).toVar();
|
|
577
577
|
for (let c = -1; c <= 1; ++c)
|
|
578
578
|
for (let a = -1; a <= 1; ++a) {
|
|
579
579
|
const S = i.add(de(c, a)).toVar();
|
|
@@ -588,12 +588,12 @@ class us extends et {
|
|
|
588
588
|
}), f = (i) => {
|
|
589
589
|
let l = this._previousDepthNode.sample(i).r;
|
|
590
590
|
t.renderer.logarithmicDepthBuffer && (l = r(l));
|
|
591
|
-
const y = vt(i, l, this._previousCameraProjectionMatrixInverse), d = this._previousCameraWorldMatrix.mul(
|
|
591
|
+
const y = vt(i, l, this._previousCameraProjectionMatrixInverse), d = this._previousCameraWorldMatrix.mul($(y, 1)).xyz, c = this._cameraWorldMatrixInverse.mul($(d, 1)).z;
|
|
592
592
|
return this.camera.isOrthographicCamera ? bt(c, this._cameraNearFar.x, this._cameraNearFar.y) : Pe(c, this._cameraNearFar.x, this._cameraNearFar.y);
|
|
593
|
-
},
|
|
594
|
-
const c = d.rgb.add(y.rgb).mul(0.5), a = d.rgb.sub(y.rgb).mul(0.5).add(1e-7), S = l.sub(
|
|
593
|
+
}, v = te(([i, l, y, d]) => {
|
|
594
|
+
const c = d.rgb.add(y.rgb).mul(0.5), a = d.rgb.sub(y.rgb).mul(0.5).add(1e-7), S = l.sub($(c, i.a)), P = S.xyz.div(a).abs(), B = oe(P.x, P.y, P.z);
|
|
595
595
|
return B.greaterThan(1).select(
|
|
596
|
-
|
|
596
|
+
$(c, i.a).add(S.div(B)),
|
|
597
597
|
l
|
|
598
598
|
);
|
|
599
599
|
}).setLayout({
|
|
@@ -616,12 +616,12 @@ class us extends et {
|
|
|
616
616
|
[0, 1],
|
|
617
617
|
[-1, 0]
|
|
618
618
|
], a = l.toVar(), S = l.pow2().toVar();
|
|
619
|
-
for (const [
|
|
620
|
-
const
|
|
621
|
-
a.addAssign(
|
|
619
|
+
for (const [U, q] of c) {
|
|
620
|
+
const I = this.beautyNode.offset(yt(U, q)).load(i).max(0), L = $(I.rgb.mul(I.a), I.a);
|
|
621
|
+
a.addAssign(L), S.addAssign(L.pow2());
|
|
622
622
|
}
|
|
623
|
-
const m =
|
|
624
|
-
return
|
|
623
|
+
const m = Y(c.length + 1), P = a.div(m), B = S.div(m).sub(P.pow2()).max(0).sqrt().mul(d), u = P.sub(B), w = P.add(B);
|
|
624
|
+
return v(P.clamp(u, w), y, u, w);
|
|
625
625
|
}), h = te(([i, l]) => {
|
|
626
626
|
const d = i.mul(l).fract().abs(), c = oe(d, d.oneMinus());
|
|
627
627
|
return c.x.mul(c.y).oneMinus().div(0.75);
|
|
@@ -633,66 +633,66 @@ class us extends et {
|
|
|
633
633
|
{ name: "textureSize", type: "ivec2" }
|
|
634
634
|
]
|
|
635
635
|
}), p = te(([i, l, y]) => {
|
|
636
|
-
const d = y.oneMinus(), c = i.mul(
|
|
637
|
-
return y.mulAssign(
|
|
638
|
-
}), g = Ae(this._historyRenderTarget.texture),
|
|
639
|
-
const i = St(), l = this.beautyNode.size(), y = i.mul(l), d = n(y), c = d.get("closestDepth"), a = d.get("closestPositionTexel"), S = d.get("farthestDepth"), m = this.velocityNode.load(a).xy.mul(de(0.5, -0.5)),
|
|
640
|
-
this.useSubpixelCorrection &&
|
|
641
|
-
const
|
|
642
|
-
|
|
643
|
-
const
|
|
644
|
-
|
|
645
|
-
x(y,
|
|
646
|
-
)
|
|
647
|
-
|
|
648
|
-
|
|
636
|
+
const d = y.oneMinus(), c = i.mul(Y(1).div(oe(i.r, i.g, i.b).add(1))), a = l.mul(Y(1).div(oe(l.r, l.g, l.b).add(1))), S = Ce(c.rgb), m = Ce(a.rgb);
|
|
637
|
+
return y.mulAssign(Y(1).div(S.add(1))), d.mulAssign(Y(1).div(m.add(1))), Oe(i.mul(y), l.mul(d)).div(oe(y.add(d), 1e-5)).toVar();
|
|
638
|
+
}), g = Ae(this._historyRenderTarget.texture), b = te(() => {
|
|
639
|
+
const i = St(), l = this.beautyNode.size(), y = i.mul(l), d = n(y), c = d.get("closestDepth"), a = d.get("closestPositionTexel"), S = d.get("farthestDepth"), m = this.velocityNode.load(a).xy.mul(de(0.5, -0.5)), P = i.sub(m), B = f(P), u = P.greaterThanEqual(0).all().and(P.lessThanEqual(1).all()), w = S.sub(c).greaterThan(this.edgeDepthDiff), U = c.sub(B).greaterThan(this.depthThreshold), q = u.and(w.or(U.not())), I = this.beautyNode.sample(i), L = g.sample(i.sub(m)), ne = $(I.rgb.mul(I.a), I.a).toVar(), ce = i.sub(P).mul(l).length().div(this.maxVelocityLength).saturate().sqrt(), T = Y(0.05).toVar();
|
|
640
|
+
this.useSubpixelCorrection && T.addAssign(h(m, l).mul(0.5)), T.assign(q.select(T.add(ce.mul(0.6)).saturate(), 1));
|
|
641
|
+
const _ = this._progressiveWeight, N = _.greaterThan(0).and(q);
|
|
642
|
+
T.assign(N.select(_, T));
|
|
643
|
+
const O = _e(0.25, 1.25, ce.oneMinus().pow2()), Z = N.select(
|
|
644
|
+
L,
|
|
645
|
+
x(y, ne, L, O)
|
|
646
|
+
);
|
|
647
|
+
return N.select(
|
|
648
|
+
_e(Z, ne, T),
|
|
649
|
+
p(ne, Z, T)
|
|
649
650
|
);
|
|
650
|
-
return se(Z.rgb.mul(Z.a), Z.a);
|
|
651
651
|
});
|
|
652
|
-
return this._resolveMaterial.fragmentNode =
|
|
652
|
+
return this._resolveMaterial.fragmentNode = b(), this._textureNode;
|
|
653
653
|
}
|
|
654
654
|
dispose() {
|
|
655
655
|
this._historyRenderTarget.dispose(), this._resolveRenderTarget.dispose(), this._resolveMaterial.dispose();
|
|
656
656
|
}
|
|
657
657
|
}
|
|
658
658
|
const Le = (e, t, s, r) => new us(pt(e), t, s, r), ms = () => {
|
|
659
|
-
const e =
|
|
659
|
+
const e = k((a) => a.animationsLoaded), t = k((a) => a.characterState), s = k((a) => a.lipSyncManager), r = k((a) => a.blendshapeManager), o = C((a) => a.credentials), n = C((a) => a.currentUtterance), f = C((a) => a.textToSpeak), v = C((a) => a.visemes), x = C((a) => a.blendshapes), h = C((a) => a.visemeIntensity), p = C((a) => a.currentVisemeIndex), g = C((a) => a.currentBlendshapeIndex), b = C((a) => a.useBlendshapeManager), [i, l] = D(!1), [y, d] = D(!1), c = ye(() => o != null && o.region && (o.subscriptionKey || o.token) ? Nt({
|
|
660
660
|
credentials: {
|
|
661
661
|
region: o.region,
|
|
662
662
|
authorizationToken: o.token,
|
|
663
663
|
subscriptionKey: o.subscriptionKey
|
|
664
664
|
}
|
|
665
665
|
}) : null, [o]);
|
|
666
|
-
return
|
|
666
|
+
return V(() => {
|
|
667
667
|
if (c) {
|
|
668
668
|
const a = c.speechSynthesis.getVoices();
|
|
669
669
|
a && Array.isArray(a) && a.length ? (je(a), l(!0)) : c.speechSynthesis.onvoiceschanged = () => {
|
|
670
670
|
je(c.speechSynthesis.getVoices()), l(!0);
|
|
671
671
|
};
|
|
672
672
|
}
|
|
673
|
-
}, [c]),
|
|
674
|
-
i && (
|
|
675
|
-
}, [i, s, r, e,
|
|
673
|
+
}, [c]), V(() => {
|
|
674
|
+
i && (b ? !!r : !!s) && e && d(!0);
|
|
675
|
+
}, [i, s, r, e, b]), V(() => {
|
|
676
676
|
if (f) {
|
|
677
677
|
const a = new It(f);
|
|
678
678
|
os(a);
|
|
679
679
|
}
|
|
680
|
-
}, [f]),
|
|
680
|
+
}, [f]), V(() => {
|
|
681
681
|
var a, S;
|
|
682
682
|
n && y ? (n.onstart = () => {
|
|
683
|
-
console.log("Start"), Re(
|
|
683
|
+
console.log("Start"), Re(J.speaking);
|
|
684
684
|
}, n.onend = () => {
|
|
685
|
-
console.log("End"), Re(
|
|
685
|
+
console.log("End"), Re(J.idle);
|
|
686
686
|
}, n.onboundary = () => {
|
|
687
687
|
}, n.onviseme = (m) => {
|
|
688
688
|
We(m);
|
|
689
689
|
}, (a = c == null ? void 0 : c.speechSynthesis) == null || a.speak(n, null)) : (S = c == null ? void 0 : c.speechSynthesis) == null || S.cancel();
|
|
690
|
-
}, [n]),
|
|
690
|
+
}, [n]), V(() => {
|
|
691
691
|
s && (s.visemeIntensity = h);
|
|
692
|
-
}, [h]),
|
|
693
|
-
if (!
|
|
694
|
-
if (!s.isStarted && s.start(),
|
|
695
|
-
|
|
692
|
+
}, [h]), V(() => {
|
|
693
|
+
if (!b && s && t === J.speaking) {
|
|
694
|
+
if (!s.isStarted && s.start(), v.length > 1 && p === 0)
|
|
695
|
+
v.forEach((a) => {
|
|
696
696
|
const S = parseInt(a.name);
|
|
697
697
|
if (!isNaN(S)) {
|
|
698
698
|
const m = De.get(S);
|
|
@@ -700,17 +700,17 @@ const Le = (e, t, s, r) => new us(pt(e), t, s, r), ms = () => {
|
|
|
700
700
|
}
|
|
701
701
|
});
|
|
702
702
|
else
|
|
703
|
-
for (let a = p + 1; a <
|
|
704
|
-
const S =
|
|
703
|
+
for (let a = p + 1; a < v.length; a++) {
|
|
704
|
+
const S = v[a], m = parseInt(S.name);
|
|
705
705
|
if (!isNaN(m)) {
|
|
706
|
-
const
|
|
707
|
-
|
|
706
|
+
const P = De.get(m);
|
|
707
|
+
P && s.PlayVisemeAsync(P, S.elapsedTime / 1e4);
|
|
708
708
|
}
|
|
709
709
|
}
|
|
710
|
-
is(
|
|
710
|
+
is(v.length - 1);
|
|
711
711
|
}
|
|
712
|
-
}, [t,
|
|
713
|
-
if (
|
|
712
|
+
}, [t, v, s, b]), V(() => {
|
|
713
|
+
if (b && r && t === J.speaking) {
|
|
714
714
|
if (!r.isStarted && r.start(), x.length > 1 && g === 0)
|
|
715
715
|
x.forEach((a) => {
|
|
716
716
|
r.PlayBlendShapeAsync(a);
|
|
@@ -722,32 +722,32 @@ const Le = (e, t, s, r) => new us(pt(e), t, s, r), ms = () => {
|
|
|
722
722
|
}
|
|
723
723
|
cs(x.length - 1);
|
|
724
724
|
}
|
|
725
|
-
}, [t, x, r,
|
|
726
|
-
t !==
|
|
725
|
+
}, [t, x, r, b]), V(() => {
|
|
726
|
+
t !== J.speaking && (qe(), Ge());
|
|
727
727
|
}, [t]), null;
|
|
728
728
|
}, ps = ({ points: e, color: t = "red" }) => {
|
|
729
729
|
const s = ye(() => {
|
|
730
|
-
const r = new
|
|
731
|
-
return new
|
|
730
|
+
const r = new A.BufferGeometry().setFromPoints(e), o = new A.LineBasicMaterial({ color: t, toneMapped: !1 });
|
|
731
|
+
return new A.Line(r, o);
|
|
732
732
|
}, [e, t]);
|
|
733
|
-
return /* @__PURE__ */
|
|
733
|
+
return /* @__PURE__ */ M.createElement("primitive", { object: s });
|
|
734
734
|
}, gs = ({ parentGpuTier: e, setIsGpuAvailable: t, children: s, tonemapping: r }) => {
|
|
735
|
-
const o = z((u) => u.cameraPosition), n = z((u) => u.lookAt), f = z((u) => u.movable),
|
|
735
|
+
const o = z((u) => u.cameraPosition), n = z((u) => u.lookAt), f = z((u) => u.movable), v = E((u) => u.targets), x = E((u) => u.showFirstTarget), [h] = D(e || lt()), [p, g] = D(), [b, i] = D(null), [l, y] = D(void 0), d = se(null), c = se(null), a = se(null), S = (u) => {
|
|
736
736
|
u.preventDefault(), u.stopPropagation();
|
|
737
737
|
};
|
|
738
|
-
|
|
738
|
+
V(() => {
|
|
739
739
|
Et(c.current);
|
|
740
|
-
}, [c.current]),
|
|
741
|
-
var u,
|
|
740
|
+
}, [c.current]), V(() => {
|
|
741
|
+
var u, w, U, q;
|
|
742
742
|
if (f)
|
|
743
|
-
|
|
743
|
+
b == null || b.abort(), i(null);
|
|
744
744
|
else {
|
|
745
|
-
const
|
|
746
|
-
i(
|
|
745
|
+
const I = new AbortController();
|
|
746
|
+
i(I), (u = d.current) == null || u.addEventListener("wheel", S, { passive: !1, signal: I.signal }), (w = d.current) == null || w.addEventListener("pointerdown", S, { passive: !1, signal: I.signal }), (U = d.current) == null || U.addEventListener("pointermove", S, { passive: !1, signal: I.signal }), (q = d.current) == null || q.addEventListener("click", S, { passive: !1, signal: I.signal });
|
|
747
747
|
}
|
|
748
|
-
}, [f]),
|
|
748
|
+
}, [f]), V(() => {
|
|
749
749
|
a != null && a.current && n && o && a.current.setLookAt(o.x, o.y, o.z, n.x, n.y, n.z, !0);
|
|
750
|
-
}, [o, n]),
|
|
750
|
+
}, [o, n]), V(() => {
|
|
751
751
|
if (h)
|
|
752
752
|
if (h.type === "FALLBACK")
|
|
753
753
|
g(
|
|
@@ -782,7 +782,7 @@ const Le = (e, t, s, r) => new us(pt(e), t, s, r), ms = () => {
|
|
|
782
782
|
);
|
|
783
783
|
break;
|
|
784
784
|
}
|
|
785
|
-
}, [h]),
|
|
785
|
+
}, [h]), V(() => {
|
|
786
786
|
switch (p && (m.current = p), p) {
|
|
787
787
|
case "low":
|
|
788
788
|
console.warn("Retorik React-Bodyengine-Three > GPU tier too low, no rendering available"), t(!1);
|
|
@@ -795,44 +795,44 @@ const Le = (e, t, s, r) => new us(pt(e), t, s, r), ms = () => {
|
|
|
795
795
|
break;
|
|
796
796
|
}
|
|
797
797
|
}, [p]);
|
|
798
|
-
const m =
|
|
799
|
-
const
|
|
798
|
+
const m = se(void 0), P = Ye(async (u) => {
|
|
799
|
+
const w = new A.WebGPURenderer({
|
|
800
800
|
canvas: u.canvas,
|
|
801
801
|
antialias: !1,
|
|
802
802
|
alpha: !0,
|
|
803
803
|
powerPreference: "high-performance"
|
|
804
804
|
});
|
|
805
|
-
return
|
|
805
|
+
return w.setClearColor(new A.Color("#000000"), 0), w.setPixelRatio(devicePixelRatio), w.shadowMap.type = A.PCFSoftShadowMap, await w.init(), w;
|
|
806
806
|
}, []), B = ye(() => {
|
|
807
|
-
if (
|
|
808
|
-
const u =
|
|
809
|
-
return [
|
|
807
|
+
if (v.length) {
|
|
808
|
+
const u = v[0], w = new A.Vector3(u.position.x - 0.5, u.position.y, u.position.z - 0.1), U = new A.Vector3(u.position.x + 0.5, u.position.y, u.position.z - 0.1);
|
|
809
|
+
return [w, U];
|
|
810
810
|
} else if (o) {
|
|
811
|
-
const u = new
|
|
812
|
-
return [u,
|
|
811
|
+
const u = new A.Vector3(o.x - 0.5, o.y, o.z - 0.1), w = new A.Vector3(o.x + 0.5, o.y, o.z - 0.1);
|
|
812
|
+
return [u, w];
|
|
813
813
|
}
|
|
814
814
|
return [];
|
|
815
|
-
}, [
|
|
816
|
-
return l ? /* @__PURE__ */
|
|
815
|
+
}, [v, o]);
|
|
816
|
+
return l ? /* @__PURE__ */ M.createElement(Pt, { gl: P, dpr: l, ref: d, shadows: !0 }, /* @__PURE__ */ M.createElement(fs, { tonemapping: r, processedTier: p }), /* @__PURE__ */ M.createElement(ht, null), /* @__PURE__ */ M.createElement(ms, null), /* @__PURE__ */ M.createElement(dt, { ref: c, makeDefault: !0, fov: 28 }), /* @__PURE__ */ M.createElement(ut, { ref: a }), x && B.length && /* @__PURE__ */ M.createElement(ps, { points: B, color: "red" }), /* @__PURE__ */ M.createElement(Xe, { fallback: null }, s)) : /* @__PURE__ */ M.createElement(M.Fragment, null);
|
|
817
817
|
}, fs = ({ tonemapping: e, processedTier: t }) => {
|
|
818
|
-
const { gl: s, scene: r, camera: o, size: n } =
|
|
819
|
-
return
|
|
820
|
-
s && (s.shadowMap.type =
|
|
821
|
-
}, [s, e]),
|
|
818
|
+
const { gl: s, scene: r, camera: o, size: n } = Vt(), [f] = D(new A.Vector3(-3, 2, 2)), [v] = D(new A.Vector3(0, 1, 0)), [x] = D(2), [h] = D(-3e-3), [p] = D(0.6), g = se(null), b = se(null);
|
|
819
|
+
return V(() => {
|
|
820
|
+
s && (s.shadowMap.type = A.PCFSoftShadowMap, s.toneMapping = e, t !== "low" ? r.environmentIntensity = p : r.environmentIntensity = 1);
|
|
821
|
+
}, [s, e]), V(() => {
|
|
822
822
|
r.environmentIntensity = p;
|
|
823
|
-
}, [p]),
|
|
823
|
+
}, [p]), V(() => {
|
|
824
824
|
if (!s || !r || !o || !t) return;
|
|
825
825
|
r.background = null;
|
|
826
826
|
const i = t === "high", l = wt(r, o);
|
|
827
827
|
l.setMRT(
|
|
828
|
-
i ?
|
|
828
|
+
i ? Ve({ output: Ne, diffuseColor: Mt, normal: Tt(At), velocity: fe }) : Ve({ output: Ne, velocity: fe })
|
|
829
829
|
);
|
|
830
830
|
let y;
|
|
831
831
|
if (i) {
|
|
832
|
-
const c = l.getTextureNode("output"), a = l.getTextureNode("diffuseColor"), S = l.getTextureNode("depth"), m = l.getTextureNode("velocity"),
|
|
832
|
+
const c = l.getTextureNode("output"), a = l.getTextureNode("diffuseColor"), S = l.getTextureNode("depth"), m = l.getTextureNode("velocity"), P = l.getTextureNode("normal"), B = kt((L) => Ct(P.sample(L))), u = _t(c, S, B, o);
|
|
833
833
|
u.aoIntensity.value = 1, u.giIntensity.value = 5, u.sliceCount.value = 2, u.stepCount.value = 8, u.thickness.value = 0.03, u.radius.value = 0.5, u.expFactor.value = 0.1, u.backfaceLighting.value = 0.1;
|
|
834
|
-
const
|
|
835
|
-
|
|
834
|
+
const w = u.rgb, U = u.a, q = $(Oe(c.rgb.mul(U), a.rgb.mul(w)), c.a), I = Le(q, S, m, o);
|
|
835
|
+
I.jitterIntensity = 0.25, y = I;
|
|
836
836
|
} else {
|
|
837
837
|
const c = Le(
|
|
838
838
|
l,
|
|
@@ -842,17 +842,17 @@ const Le = (e, t, s, r) => new us(pt(e), t, s, r), ms = () => {
|
|
|
842
842
|
);
|
|
843
843
|
c.jitterIntensity = 0.25, y = c;
|
|
844
844
|
}
|
|
845
|
-
const d = new
|
|
846
|
-
return d.outputNode = y,
|
|
847
|
-
d.dispose(),
|
|
845
|
+
const d = new A.RenderPipeline(s);
|
|
846
|
+
return d.outputNode = y, b.current = d, () => {
|
|
847
|
+
d.dispose(), b.current = null;
|
|
848
848
|
};
|
|
849
|
-
}, [s, r, o, t]),
|
|
849
|
+
}, [s, r, o, t]), V(() => {
|
|
850
850
|
!s || !n || s.setSize(n.width, n.height);
|
|
851
851
|
}, [n]), He(({ gl: i, scene: l, camera: y }) => {
|
|
852
|
-
|
|
853
|
-
}, 1), /* @__PURE__ */
|
|
852
|
+
b.current && b.current.render();
|
|
853
|
+
}, 1), /* @__PURE__ */ M.createElement(M.Fragment, null, t !== "low" && s && /* @__PURE__ */ M.createElement(M.Fragment, null, /* @__PURE__ */ M.createElement("directionalLight", { ref: g, color: "white", position: f.toArray(), "target-position": v.toArray(), intensity: x, castShadow: !0, "shadow-mapSize-width": 512, "shadow-mapSize-height": 512, "shadow-bias": h, "shadow-intensity": 0.7, "shadow-radius": 1.5 }, /* @__PURE__ */ M.createElement("orthographicCamera", { attach: "shadow-camera", args: [-1, 1, 2, -0.5, 2, 8] }))));
|
|
854
854
|
}, ys = ({ character: e, autoLookAt: t }) => {
|
|
855
|
-
const s =
|
|
855
|
+
const s = k((h) => h.characterState), r = E((h) => h.currentAUs), o = E((h) => h.currentGaze), n = E((h) => h.currentHeadPose), f = E((h) => h.lookAtCamera), v = z((h) => h.cameraPosition), x = E((h) => h.targets);
|
|
856
856
|
return He((h, p) => {
|
|
857
857
|
const g = {
|
|
858
858
|
deltaTime: p,
|
|
@@ -861,145 +861,145 @@ const Le = (e, t, s, r) => new us(pt(e), t, s, r), ms = () => {
|
|
|
861
861
|
gaze: o,
|
|
862
862
|
headPose: n,
|
|
863
863
|
characterState: s,
|
|
864
|
-
lookAt: f ?
|
|
864
|
+
lookAt: f ? v : void 0,
|
|
865
865
|
targets: x
|
|
866
866
|
};
|
|
867
867
|
e.update(g);
|
|
868
|
-
}),
|
|
868
|
+
}), V(() => {
|
|
869
869
|
if (t)
|
|
870
870
|
switch (s) {
|
|
871
|
-
case
|
|
872
|
-
case
|
|
871
|
+
case J.idle:
|
|
872
|
+
case J.waiting:
|
|
873
873
|
ue(!1);
|
|
874
874
|
break;
|
|
875
|
-
case
|
|
876
|
-
case
|
|
875
|
+
case J.listening:
|
|
876
|
+
case J.speaking:
|
|
877
877
|
ue(!0);
|
|
878
878
|
break;
|
|
879
879
|
}
|
|
880
880
|
else
|
|
881
881
|
ue(!1);
|
|
882
|
-
}, [s, t]),
|
|
882
|
+
}, [s, t]), V(() => {
|
|
883
883
|
Dt(e);
|
|
884
884
|
}, [e]), null;
|
|
885
|
-
}, Gs = ({ url: e, type: t, animationsUrl: s, gender: r, speechSynthesis: o, camera: n, onLoadingCompleted: f, autoLookAt:
|
|
886
|
-
const S =
|
|
887
|
-
let
|
|
885
|
+
}, Gs = ({ url: e, type: t, animationsUrl: s, gender: r, speechSynthesis: o, camera: n, onLoadingCompleted: f, autoLookAt: v, breathing: x, disableAnimations: h, debug: p, enableBml: g, animationWeights: b, license: i, detectGpuData: l, environmentPreset: y = "apartment", tonemapping: d = A.NeutralToneMapping, targets: c, useBlendshapeManager: a = !1 }) => {
|
|
886
|
+
const S = k((T) => T.animationsLoaded), m = z((T) => T.defaultPositions), P = z((T) => T.defaultDistances), [B, u] = D(), [w, U] = D(null), [q, I] = D(), [L, ne] = D(!1), xe = async (T) => {
|
|
887
|
+
let _ = null;
|
|
888
888
|
switch (t) {
|
|
889
889
|
case ee.cc3:
|
|
890
|
-
|
|
890
|
+
_ = new ct(), I(le.cc3);
|
|
891
891
|
break;
|
|
892
892
|
case ee.avatarsdk:
|
|
893
|
-
|
|
893
|
+
_ = new it(), I(le.avatarsdk);
|
|
894
894
|
break;
|
|
895
895
|
case ee.avaturn:
|
|
896
|
-
|
|
896
|
+
_ = new ot(), I(le.avaturn);
|
|
897
897
|
break;
|
|
898
898
|
}
|
|
899
|
-
const
|
|
900
|
-
if (
|
|
901
|
-
let
|
|
899
|
+
const N = await _.loadAsync(T).catch((O) => console.warn("Error loading character : ", O));
|
|
900
|
+
if (N) {
|
|
901
|
+
let O = null;
|
|
902
902
|
const Z = {
|
|
903
|
-
mesh:
|
|
904
|
-
onAnimationsLoaded:
|
|
903
|
+
mesh: N,
|
|
904
|
+
onAnimationsLoaded: ve,
|
|
905
905
|
animationsUrl: s,
|
|
906
906
|
gender: r || "male",
|
|
907
907
|
type: t,
|
|
908
908
|
debug: p,
|
|
909
909
|
enableBmlManager: !!g,
|
|
910
|
-
animationWeights:
|
|
910
|
+
animationWeights: b,
|
|
911
911
|
useBlendshapeManager: a,
|
|
912
912
|
license: i
|
|
913
913
|
};
|
|
914
914
|
switch (t) {
|
|
915
915
|
case ee.cc3:
|
|
916
|
-
|
|
916
|
+
O = await he.fromCharacterCreator(Z);
|
|
917
917
|
break;
|
|
918
918
|
case ee.avatarsdk:
|
|
919
|
-
|
|
919
|
+
O = await he.fromAvatarSDK(Z);
|
|
920
920
|
break;
|
|
921
921
|
case ee.avaturn:
|
|
922
|
-
|
|
922
|
+
O = await he.fromAvaturn(Z);
|
|
923
923
|
break;
|
|
924
924
|
}
|
|
925
|
-
|
|
925
|
+
O && U(O);
|
|
926
926
|
}
|
|
927
|
-
},
|
|
927
|
+
}, ve = () => {
|
|
928
928
|
Fe(!0);
|
|
929
929
|
};
|
|
930
|
-
|
|
931
|
-
var
|
|
932
|
-
|
|
930
|
+
V(() => {
|
|
931
|
+
var T, _;
|
|
932
|
+
w && S && (x === !1 && ((_ = (T = w.animationManager) == null ? void 0 : T.disableBreathing) == null || _.call(T)), L ? (Jt(w.getAllAnimationNames()), Kt(w.getAllAnimations()), setTimeout(() => {
|
|
933
933
|
f == null || f();
|
|
934
|
-
}, 1e3)) :
|
|
935
|
-
}, [
|
|
934
|
+
}, 1e3)) : ce());
|
|
935
|
+
}, [w, S, L]), V(() => {
|
|
936
936
|
Wt(c || []);
|
|
937
|
-
}, [c]),
|
|
938
|
-
Fe(!1), B !== void 0 && (B ?
|
|
939
|
-
}, [e, B]),
|
|
940
|
-
if (
|
|
937
|
+
}, [c]), V(() => {
|
|
938
|
+
Fe(!1), B !== void 0 && (B ? xe(e) : f == null || f());
|
|
939
|
+
}, [e, B]), V(() => {
|
|
940
|
+
if (L && P && m)
|
|
941
941
|
if (n) {
|
|
942
|
-
const
|
|
943
|
-
Be(
|
|
942
|
+
const T = ds(n, P, m);
|
|
943
|
+
Be(T), ze(n.lookAt ? m[n.lookAt] : m.lowerbelly), Ht(!!n.movable);
|
|
944
944
|
} else {
|
|
945
|
-
const
|
|
946
|
-
|
|
945
|
+
const T = m.mouth.clone();
|
|
946
|
+
T.setComponent(2, P.farther), Be(T), ze(m.lowerbelly);
|
|
947
947
|
}
|
|
948
|
-
}, [
|
|
948
|
+
}, [L, n, P, m]), V(() => {
|
|
949
949
|
o && (o.credentials && ns(o.credentials), o.voice && ls(o.voice));
|
|
950
|
-
}, [o]),
|
|
950
|
+
}, [o]), V(() => {
|
|
951
951
|
hs(a);
|
|
952
952
|
}, [a]);
|
|
953
|
-
const
|
|
954
|
-
if (
|
|
953
|
+
const ce = () => {
|
|
954
|
+
if (w && q) {
|
|
955
955
|
try {
|
|
956
|
-
const
|
|
957
|
-
Ut(
|
|
958
|
-
const Z = Math.abs(
|
|
956
|
+
const T = new A.Box3().setFromObject(w), _ = T.max, N = T.min, O = new A.Vector3((_.x + N.x) / 2, (_.y + N.y) / 2, (_.z + N.z) / 2);
|
|
957
|
+
Ut(O);
|
|
958
|
+
const Z = Math.abs(_.x - N.x), j = Math.abs(_.y - N.y), Ke = Math.abs(_.z - N.z);
|
|
959
959
|
jt({
|
|
960
960
|
x: Z,
|
|
961
961
|
y: j,
|
|
962
962
|
z: Ke
|
|
963
963
|
});
|
|
964
|
-
const
|
|
965
|
-
eye: new
|
|
966
|
-
mouth: new
|
|
967
|
-
neck: new
|
|
968
|
-
clavicle: new
|
|
969
|
-
torso: new
|
|
970
|
-
belly: new
|
|
971
|
-
lowerbelly: new
|
|
972
|
-
hips:
|
|
973
|
-
higherthigh: new
|
|
974
|
-
thigh: new
|
|
975
|
-
knee: new
|
|
976
|
-
leg: new
|
|
977
|
-
feet: new
|
|
978
|
-
},
|
|
979
|
-
veryclose:
|
|
980
|
-
closer:
|
|
981
|
-
close:
|
|
982
|
-
midclose:
|
|
983
|
-
medium:
|
|
984
|
-
midfar:
|
|
985
|
-
far:
|
|
986
|
-
farther:
|
|
987
|
-
veryfar:
|
|
964
|
+
const H = (_.x + N.x) / 2, W = (_.z + N.z) / 2, Ze = {
|
|
965
|
+
eye: new A.Vector3(H, _.y - j / 16, W),
|
|
966
|
+
mouth: new A.Vector3(H, _.y - j / 12, W),
|
|
967
|
+
neck: new A.Vector3(H, _.y - j / 8, W),
|
|
968
|
+
clavicle: new A.Vector3(H, _.y - j / 6, W),
|
|
969
|
+
torso: new A.Vector3(H, _.y - j / 4, W),
|
|
970
|
+
belly: new A.Vector3(H, _.y - j / 8 * 3, W),
|
|
971
|
+
lowerbelly: new A.Vector3(H, _.y - j / 32 * 15, W),
|
|
972
|
+
hips: O,
|
|
973
|
+
higherthigh: new A.Vector3(H, N.y + j / 32 * 15, W),
|
|
974
|
+
thigh: new A.Vector3(H, N.y + j / 8 * 3, W),
|
|
975
|
+
knee: new A.Vector3(H, N.y + j / 4, W),
|
|
976
|
+
leg: new A.Vector3(H, N.y + j / 8, W),
|
|
977
|
+
feet: new A.Vector3(H, N.y, W)
|
|
978
|
+
}, K = (_.y - (N.y + j / 7 * 2)) / 2 / Math.tan(25 * (Math.PI / 180)), Qe = {
|
|
979
|
+
veryclose: K / 4,
|
|
980
|
+
closer: K / 3,
|
|
981
|
+
close: K / 2.5,
|
|
982
|
+
midclose: K / 2,
|
|
983
|
+
medium: K,
|
|
984
|
+
midfar: K * 2,
|
|
985
|
+
far: K * 2.5,
|
|
986
|
+
farther: K * 3,
|
|
987
|
+
veryfar: K * 4
|
|
988
988
|
};
|
|
989
989
|
Lt(Ze), Ot(Qe);
|
|
990
|
-
} catch (
|
|
991
|
-
console.warn(
|
|
990
|
+
} catch (T) {
|
|
991
|
+
console.warn(T);
|
|
992
992
|
}
|
|
993
|
-
|
|
993
|
+
ne(!0);
|
|
994
994
|
}
|
|
995
995
|
};
|
|
996
|
-
return /* @__PURE__ */
|
|
996
|
+
return /* @__PURE__ */ M.createElement(gs, { parentGpuTier: l, setIsGpuAvailable: u, tonemapping: d }, B ? /* @__PURE__ */ M.createElement(M.Fragment, null, w && /* @__PURE__ */ M.createElement(ys, { character: w, autoLookAt: !!v }), w && /* @__PURE__ */ M.createElement(M.Fragment, null, /* @__PURE__ */ M.createElement(mt, { preset: y }), /* @__PURE__ */ M.createElement("primitive", { object: w, castShadow: !0, receiveShadow: !0 }))) : /* @__PURE__ */ M.createElement(M.Fragment, null));
|
|
997
997
|
}, Ss = {
|
|
998
998
|
emotions: [],
|
|
999
999
|
currentTopEmotion: Se.Neutral,
|
|
1000
1000
|
useTopEmotionOnly: !0,
|
|
1001
1001
|
autoDecay: !1
|
|
1002
|
-
}, ie =
|
|
1002
|
+
}, ie = ae()(() => Ss), Js = (e) => {
|
|
1003
1003
|
if (ie.setState({ emotions: e || [] }), e != null && e.length) {
|
|
1004
1004
|
const t = e.reduce((s, r) => s.value > r.value ? s : r);
|
|
1005
1005
|
ie.setState({ currentTopEmotion: t.emotion });
|
|
@@ -1010,7 +1010,7 @@ const Le = (e, t, s, r) => new us(pt(e), t, s, r), ms = () => {
|
|
|
1010
1010
|
}, Zs = (e) => {
|
|
1011
1011
|
ie.setState({ autoDecay: e });
|
|
1012
1012
|
}, Qs = (e) => {
|
|
1013
|
-
const t =
|
|
1013
|
+
const t = k.getState().FACSManager;
|
|
1014
1014
|
t == null || t.playFacialAnimation({ ...e });
|
|
1015
1015
|
};
|
|
1016
1016
|
export {
|
|
@@ -1020,7 +1020,7 @@ export {
|
|
|
1020
1020
|
R as Distances,
|
|
1021
1021
|
$s as Object3D,
|
|
1022
1022
|
F as Positions,
|
|
1023
|
-
|
|
1023
|
+
G as Rotations,
|
|
1024
1024
|
Ls as addBlendshape,
|
|
1025
1025
|
Os as addSPPASViseme,
|
|
1026
1026
|
We as addViseme,
|
|
@@ -1044,8 +1044,8 @@ export {
|
|
|
1044
1044
|
Us as setBlendshapes,
|
|
1045
1045
|
Be as setCameraPosition,
|
|
1046
1046
|
Re as setCharacterState,
|
|
1047
|
-
|
|
1048
|
-
|
|
1047
|
+
Vs as setCurrentAUs,
|
|
1048
|
+
Ns as setCurrentGaze,
|
|
1049
1049
|
Is as setCurrentHeadPose,
|
|
1050
1050
|
os as setCurrentUtterance,
|
|
1051
1051
|
Js as setEmotions,
|
|
@@ -1057,5 +1057,5 @@ export {
|
|
|
1057
1057
|
qs as setVisemeIntensity,
|
|
1058
1058
|
Es as setVisemes,
|
|
1059
1059
|
ls as setVoice,
|
|
1060
|
-
|
|
1060
|
+
k as useCharacterStore
|
|
1061
1061
|
};
|
package/dist/stats.html
CHANGED
|
@@ -4929,7 +4929,7 @@ var drawChart = (function (exports) {
|
|
|
4929
4929
|
</script>
|
|
4930
4930
|
<script>
|
|
4931
4931
|
/*<!--*/
|
|
4932
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"D:/a/1/s/packages/reactjs","children":[{"name":"node_modules/zustand/esm","children":[{"uid":"
|
|
4932
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"D:/a/1/s/packages/reactjs","children":[{"name":"node_modules/zustand/esm","children":[{"uid":"adeb88b4-1","name":"vanilla.mjs"},{"uid":"adeb88b4-3","name":"react.mjs"}]},{"name":"src","children":[{"name":"contexts","children":[{"uid":"adeb88b4-5","name":"characterStore.ts"},{"uid":"adeb88b4-7","name":"cameraStore.ts"},{"uid":"adeb88b4-9","name":"headStore.ts"},{"uid":"adeb88b4-11","name":"animationStore.ts"},{"uid":"adeb88b4-17","name":"speechStore.ts"},{"uid":"adeb88b4-33","name":"emotionStore.ts"}]},{"name":"models","children":[{"uid":"adeb88b4-13","name":"enums.ts"},{"uid":"adeb88b4-15","name":"constants.ts"}]},{"name":"utils/getCameraPositionVector.ts","uid":"adeb88b4-19"},{"name":"components","children":[{"name":"PostProcessing/PMJTAANode.js","uid":"adeb88b4-21"},{"uid":"adeb88b4-23","name":"SpeechManager.tsx"},{"uid":"adeb88b4-25","name":"HorizontalLine.tsx"},{"uid":"adeb88b4-27","name":"Scene.tsx"},{"name":"Controllers/CharacterController.ts","uid":"adeb88b4-29"},{"uid":"adeb88b4-31","name":"Character.tsx"}]},{"uid":"adeb88b4-35","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"adeb88b4-1":{"renderedLength":975,"gzipLength":394,"brotliLength":353,"metaUid":"adeb88b4-0"},"adeb88b4-3":{"renderedLength":593,"gzipLength":285,"brotliLength":235,"metaUid":"adeb88b4-2"},"adeb88b4-5":{"renderedLength":2066,"gzipLength":439,"brotliLength":380,"metaUid":"adeb88b4-4"},"adeb88b4-7":{"renderedLength":1028,"gzipLength":293,"brotliLength":249,"metaUid":"adeb88b4-6"},"adeb88b4-9":{"renderedLength":1484,"gzipLength":395,"brotliLength":345,"metaUid":"adeb88b4-8"},"adeb88b4-11":{"renderedLength":854,"gzipLength":308,"brotliLength":274,"metaUid":"adeb88b4-10"},"adeb88b4-13":{"renderedLength":2645,"gzipLength":700,"brotliLength":620,"metaUid":"adeb88b4-12"},"adeb88b4-15":{"renderedLength":2774,"gzipLength":852,"brotliLength":740,"metaUid":"adeb88b4-14"},"adeb88b4-17":{"renderedLength":2675,"gzipLength":668,"brotliLength":633,"metaUid":"adeb88b4-16"},"adeb88b4-19":{"renderedLength":2356,"gzipLength":571,"brotliLength":491,"metaUid":"adeb88b4-18"},"adeb88b4-21":{"renderedLength":25773,"gzipLength":6596,"brotliLength":5811,"metaUid":"adeb88b4-20"},"adeb88b4-23":{"renderedLength":5139,"gzipLength":1153,"brotliLength":1063,"metaUid":"adeb88b4-22"},"adeb88b4-25":{"renderedLength":383,"gzipLength":251,"brotliLength":209,"metaUid":"adeb88b4-24"},"adeb88b4-27":{"renderedLength":8713,"gzipLength":2368,"brotliLength":2099,"metaUid":"adeb88b4-26"},"adeb88b4-29":{"renderedLength":1366,"gzipLength":442,"brotliLength":408,"metaUid":"adeb88b4-28"},"adeb88b4-31":{"renderedLength":7048,"gzipLength":1843,"brotliLength":1639,"metaUid":"adeb88b4-30"},"adeb88b4-33":{"renderedLength":949,"gzipLength":361,"brotliLength":320,"metaUid":"adeb88b4-32"},"adeb88b4-35":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"adeb88b4-34"}},"nodeMetas":{"adeb88b4-0":{"id":"D:/a/1/s/packages/reactjs/node_modules/zustand/esm/vanilla.mjs","moduleParts":{"index.js":"adeb88b4-1"},"imported":[],"importedBy":[{"uid":"adeb88b4-40"},{"uid":"adeb88b4-2"}]},"adeb88b4-2":{"id":"D:/a/1/s/packages/reactjs/node_modules/zustand/esm/react.mjs","moduleParts":{"index.js":"adeb88b4-3"},"imported":[{"uid":"adeb88b4-38"},{"uid":"adeb88b4-0"}],"importedBy":[{"uid":"adeb88b4-40"}]},"adeb88b4-4":{"id":"D:/a/1/s/packages/reactjs/src/contexts/characterStore.ts","moduleParts":{"index.js":"adeb88b4-5"},"imported":[{"uid":"adeb88b4-40"},{"uid":"adeb88b4-36"}],"importedBy":[{"uid":"adeb88b4-34"},{"uid":"adeb88b4-30"},{"uid":"adeb88b4-16"},{"uid":"adeb88b4-8"},{"uid":"adeb88b4-32"},{"uid":"adeb88b4-10"},{"uid":"adeb88b4-28"},{"uid":"adeb88b4-22"}]},"adeb88b4-6":{"id":"D:/a/1/s/packages/reactjs/src/contexts/cameraStore.ts","moduleParts":{"index.js":"adeb88b4-7"},"imported":[{"uid":"adeb88b4-40"},{"uid":"adeb88b4-37"}],"importedBy":[{"uid":"adeb88b4-34"},{"uid":"adeb88b4-30"},{"uid":"adeb88b4-8"},{"uid":"adeb88b4-26"},{"uid":"adeb88b4-28"}]},"adeb88b4-8":{"id":"D:/a/1/s/packages/reactjs/src/contexts/headStore.ts","moduleParts":{"index.js":"adeb88b4-9"},"imported":[{"uid":"adeb88b4-40"},{"uid":"adeb88b4-4"},{"uid":"adeb88b4-6"}],"importedBy":[{"uid":"adeb88b4-34"},{"uid":"adeb88b4-30"},{"uid":"adeb88b4-26"},{"uid":"adeb88b4-28"}]},"adeb88b4-10":{"id":"D:/a/1/s/packages/reactjs/src/contexts/animationStore.ts","moduleParts":{"index.js":"adeb88b4-11"},"imported":[{"uid":"adeb88b4-40"},{"uid":"adeb88b4-4"}],"importedBy":[{"uid":"adeb88b4-34"},{"uid":"adeb88b4-30"}]},"adeb88b4-12":{"id":"D:/a/1/s/packages/reactjs/src/models/enums.ts","moduleParts":{"index.js":"adeb88b4-13"},"imported":[],"importedBy":[{"uid":"adeb88b4-34"},{"uid":"adeb88b4-30"},{"uid":"adeb88b4-32"},{"uid":"adeb88b4-14"},{"uid":"adeb88b4-18"}]},"adeb88b4-14":{"id":"D:/a/1/s/packages/reactjs/src/models/constants.ts","moduleParts":{"index.js":"adeb88b4-15"},"imported":[{"uid":"adeb88b4-12"}],"importedBy":[{"uid":"adeb88b4-34"},{"uid":"adeb88b4-16"},{"uid":"adeb88b4-22"}]},"adeb88b4-16":{"id":"D:/a/1/s/packages/reactjs/src/contexts/speechStore.ts","moduleParts":{"index.js":"adeb88b4-17"},"imported":[{"uid":"adeb88b4-40"},{"uid":"adeb88b4-4"},{"uid":"adeb88b4-14"}],"importedBy":[{"uid":"adeb88b4-34"},{"uid":"adeb88b4-30"},{"uid":"adeb88b4-22"}]},"adeb88b4-18":{"id":"D:/a/1/s/packages/reactjs/src/utils/getCameraPositionVector.ts","moduleParts":{"index.js":"adeb88b4-19"},"imported":[{"uid":"adeb88b4-37"},{"uid":"adeb88b4-12"}],"importedBy":[{"uid":"adeb88b4-30"}]},"adeb88b4-20":{"id":"D:/a/1/s/packages/reactjs/src/components/PostProcessing/PMJTAANode.js","moduleParts":{"index.js":"adeb88b4-21"},"imported":[{"uid":"adeb88b4-37"},{"uid":"adeb88b4-41"}],"importedBy":[{"uid":"adeb88b4-26"}]},"adeb88b4-22":{"id":"D:/a/1/s/packages/reactjs/src/components/SpeechManager.tsx","moduleParts":{"index.js":"adeb88b4-23"},"imported":[{"uid":"adeb88b4-38"},{"uid":"adeb88b4-16"},{"uid":"adeb88b4-4"},{"uid":"adeb88b4-44"},{"uid":"adeb88b4-14"},{"uid":"adeb88b4-36"}],"importedBy":[{"uid":"adeb88b4-26"}]},"adeb88b4-24":{"id":"D:/a/1/s/packages/reactjs/src/components/HorizontalLine.tsx","moduleParts":{"index.js":"adeb88b4-25"},"imported":[{"uid":"adeb88b4-38"},{"uid":"adeb88b4-37"}],"importedBy":[{"uid":"adeb88b4-26"}]},"adeb88b4-26":{"id":"D:/a/1/s/packages/reactjs/src/components/Scene.tsx","moduleParts":{"index.js":"adeb88b4-27"},"imported":[{"uid":"adeb88b4-38"},{"uid":"adeb88b4-37"},{"uid":"adeb88b4-41"},{"uid":"adeb88b4-20"},{"uid":"adeb88b4-42"},{"uid":"adeb88b4-39"},{"uid":"adeb88b4-43"},{"uid":"adeb88b4-6"},{"uid":"adeb88b4-8"},{"uid":"adeb88b4-22"},{"uid":"adeb88b4-24"}],"importedBy":[{"uid":"adeb88b4-30"}]},"adeb88b4-28":{"id":"D:/a/1/s/packages/reactjs/src/components/Controllers/CharacterController.ts","moduleParts":{"index.js":"adeb88b4-29"},"imported":[{"uid":"adeb88b4-38"},{"uid":"adeb88b4-4"},{"uid":"adeb88b4-36"},{"uid":"adeb88b4-43"},{"uid":"adeb88b4-8"},{"uid":"adeb88b4-6"}],"importedBy":[{"uid":"adeb88b4-30"}]},"adeb88b4-30":{"id":"D:/a/1/s/packages/reactjs/src/components/Character.tsx","moduleParts":{"index.js":"adeb88b4-31"},"imported":[{"uid":"adeb88b4-38"},{"uid":"adeb88b4-37"},{"uid":"adeb88b4-36"},{"uid":"adeb88b4-39"},{"uid":"adeb88b4-8"},{"uid":"adeb88b4-4"},{"uid":"adeb88b4-10"},{"uid":"adeb88b4-6"},{"uid":"adeb88b4-16"},{"uid":"adeb88b4-12"},{"uid":"adeb88b4-18"},{"uid":"adeb88b4-26"},{"uid":"adeb88b4-28"}],"importedBy":[{"uid":"adeb88b4-34"}]},"adeb88b4-32":{"id":"D:/a/1/s/packages/reactjs/src/contexts/emotionStore.ts","moduleParts":{"index.js":"adeb88b4-33"},"imported":[{"uid":"adeb88b4-40"},{"uid":"adeb88b4-12"},{"uid":"adeb88b4-4"}],"importedBy":[{"uid":"adeb88b4-34"}]},"adeb88b4-34":{"id":"D:/a/1/s/packages/reactjs/src/index.ts","moduleParts":{"index.js":"adeb88b4-35"},"imported":[{"uid":"adeb88b4-30"},{"uid":"adeb88b4-4"},{"uid":"adeb88b4-16"},{"uid":"adeb88b4-6"},{"uid":"adeb88b4-8"},{"uid":"adeb88b4-32"},{"uid":"adeb88b4-10"},{"uid":"adeb88b4-36"},{"uid":"adeb88b4-12"},{"uid":"adeb88b4-14"},{"uid":"adeb88b4-37"}],"importedBy":[],"isEntry":true},"adeb88b4-36":{"id":"@davi-ai/bodyengine-three","moduleParts":{},"imported":[],"importedBy":[{"uid":"adeb88b4-34"},{"uid":"adeb88b4-30"},{"uid":"adeb88b4-4"},{"uid":"adeb88b4-28"},{"uid":"adeb88b4-22"}],"isExternal":true},"adeb88b4-37":{"id":"three/webgpu","moduleParts":{},"imported":[],"importedBy":[{"uid":"adeb88b4-34"},{"uid":"adeb88b4-30"},{"uid":"adeb88b4-6"},{"uid":"adeb88b4-18"},{"uid":"adeb88b4-26"},{"uid":"adeb88b4-20"},{"uid":"adeb88b4-24"}],"isExternal":true},"adeb88b4-38":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"adeb88b4-30"},{"uid":"adeb88b4-26"},{"uid":"adeb88b4-28"},{"uid":"adeb88b4-22"},{"uid":"adeb88b4-24"},{"uid":"adeb88b4-2"}],"isExternal":true},"adeb88b4-39":{"id":"@react-three/drei","moduleParts":{},"imported":[],"importedBy":[{"uid":"adeb88b4-30"},{"uid":"adeb88b4-26"}],"isExternal":true},"adeb88b4-40":{"id":"D:/a/1/s/packages/reactjs/node_modules/zustand/esm/index.mjs","moduleParts":{},"imported":[{"uid":"adeb88b4-0"},{"uid":"adeb88b4-2"}],"importedBy":[{"uid":"adeb88b4-4"},{"uid":"adeb88b4-16"},{"uid":"adeb88b4-6"},{"uid":"adeb88b4-8"},{"uid":"adeb88b4-32"},{"uid":"adeb88b4-10"}]},"adeb88b4-41":{"id":"three/tsl","moduleParts":{},"imported":[],"importedBy":[{"uid":"adeb88b4-26"},{"uid":"adeb88b4-20"}],"isExternal":true},"adeb88b4-42":{"id":"three/addons/tsl/display/SSGINode.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"adeb88b4-26"}],"isExternal":true},"adeb88b4-43":{"id":"@react-three/fiber","moduleParts":{},"imported":[],"importedBy":[{"uid":"adeb88b4-26"},{"uid":"adeb88b4-28"}],"isExternal":true},"adeb88b4-44":{"id":"@davi-ai/web-speech-cognitive-services-davi","moduleParts":{},"imported":[],"importedBy":[{"uid":"adeb88b4-22"}],"isExternal":true}},"env":{"rollup":"4.61.1"},"options":{"gzip":true,"brotli":true,"sourcemap":false}};
|
|
4933
4933
|
|
|
4934
4934
|
const run = () => {
|
|
4935
4935
|
const width = window.innerWidth;
|