@davi-ai/react-bodyengine-three 1.0.17 → 1.0.19
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 +307 -305
- package/dist/stats.html +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import v, { useState as D, useMemo as ye, useEffect as
|
|
1
|
+
import v, { useState as D, useMemo as ye, useEffect as N, useRef as re, useCallback as Ye, Suspense as Xe } from "react";
|
|
2
2
|
import * as T from "three/webgpu";
|
|
3
3
|
import { Vector3 as $e, TempNode as et, NodeUpdateType as tt, Matrix4 as $, 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
5
|
import { CharacterState as G, 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 Y, passTexture as gt, texture as Ae, velocity as fe, struct as ft, Fn as te, float as X, vec2 as de, If as ke, vec4 as se, 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 Ne, diffuseColor as Mt, output as Ve, 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
10
|
import { Canvas as Pt, useThree as Nt, useFrame as He } from "@react-three/fiber";
|
|
11
11
|
import { createSpeechSynthesisPonyfill as Vt, SpeechSynthesisUtterance as It } from "@davi-ai/web-speech-cognitive-services-davi";
|
|
12
12
|
const Ie = (e) => {
|
|
13
13
|
let t;
|
|
14
|
-
const s = /* @__PURE__ */ new Set(), r = (
|
|
15
|
-
const
|
|
16
|
-
if (!Object.is(
|
|
17
|
-
const
|
|
18
|
-
t =
|
|
14
|
+
const s = /* @__PURE__ */ new Set(), r = (h, p) => {
|
|
15
|
+
const g = typeof h == "function" ? h(t) : h;
|
|
16
|
+
if (!Object.is(g, t)) {
|
|
17
|
+
const w = t;
|
|
18
|
+
t = p ?? (typeof g != "object" || g === null) ? g : Object.assign({}, t, g), s.forEach((i) => i(t, w));
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, o = () => t, b = { setState: r, getState: o, getInitialState: () => x, subscribe: (h) => (s.add(h), () => s.delete(h)) }, x = t = e(r, o, b);
|
|
21
21
|
return b;
|
|
22
22
|
}, Ft = (e) => e ? Ie(e) : Ie, Rt = (e) => e;
|
|
23
23
|
function Bt(e, t = Rt) {
|
|
@@ -138,7 +138,7 @@ const zt = (e) => {
|
|
|
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 || {}), q = /* @__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))(q || {}),
|
|
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 || {}), q = /* @__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))(q || {}), 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"],
|
|
@@ -254,35 +254,35 @@ const De = /* @__PURE__ */ new Map([
|
|
|
254
254
|
["m", 21]
|
|
255
255
|
]), Yt = {
|
|
256
256
|
position: F.mouth,
|
|
257
|
-
distance:
|
|
257
|
+
distance: R.farther,
|
|
258
258
|
lookAt: F.lowerbelly
|
|
259
259
|
}, Xt = {
|
|
260
260
|
position: F.mouth,
|
|
261
|
-
distance:
|
|
261
|
+
distance: R.close,
|
|
262
262
|
lookAt: F.mouth
|
|
263
263
|
}, $t = {
|
|
264
264
|
position: F.mouth,
|
|
265
|
-
distance:
|
|
265
|
+
distance: R.midclose,
|
|
266
266
|
lookAt: F.mouth
|
|
267
267
|
}, es = {
|
|
268
268
|
position: F.neck,
|
|
269
|
-
distance:
|
|
269
|
+
distance: R.close,
|
|
270
270
|
lookAt: F.neck
|
|
271
271
|
}, ts = {
|
|
272
272
|
position: F.eye,
|
|
273
|
-
distance:
|
|
273
|
+
distance: R.medium,
|
|
274
274
|
lookAt: F.neck
|
|
275
275
|
}, ss = {
|
|
276
276
|
position: F.eye,
|
|
277
|
-
distance:
|
|
277
|
+
distance: R.medium,
|
|
278
278
|
lookAt: F.clavicle
|
|
279
279
|
}, rs = {
|
|
280
280
|
position: F.eye,
|
|
281
|
-
distance:
|
|
281
|
+
distance: R.midfar,
|
|
282
282
|
lookAt: F.belly
|
|
283
283
|
}, as = {
|
|
284
284
|
position: F.eye,
|
|
285
|
-
distance:
|
|
285
|
+
distance: R.far,
|
|
286
286
|
lookAt: F.lowerbelly
|
|
287
287
|
}, js = {
|
|
288
288
|
default: Yt,
|
|
@@ -356,37 +356,37 @@ const De = /* @__PURE__ */ new Map([
|
|
|
356
356
|
e !== k.getState().useBlendshapeManager && (qe(), Ge(), k.setState({ useBlendshapeManager: e }));
|
|
357
357
|
}, ds = (e, t, s) => {
|
|
358
358
|
let r = s[e.position || F.eye].getComponent(0);
|
|
359
|
-
const
|
|
359
|
+
const o = s[e.position || F.mouth].getComponent(1);
|
|
360
360
|
let n = 0;
|
|
361
|
-
const
|
|
362
|
-
switch (
|
|
363
|
-
case
|
|
361
|
+
const f = typeof e.distance == "string" ? parseInt(e.distance) : e.distance, b = typeof e.rotation == "string" ? parseInt(e.rotation) : e.rotation;
|
|
362
|
+
switch (f) {
|
|
363
|
+
case R.veryclose:
|
|
364
364
|
n = t.veryclose;
|
|
365
365
|
break;
|
|
366
|
-
case
|
|
366
|
+
case R.closer:
|
|
367
367
|
n = t.closer;
|
|
368
368
|
break;
|
|
369
|
-
case
|
|
369
|
+
case R.close:
|
|
370
370
|
n = t.close;
|
|
371
371
|
break;
|
|
372
|
-
case
|
|
372
|
+
case R.midclose:
|
|
373
373
|
n = t.midclose;
|
|
374
374
|
break;
|
|
375
|
-
case
|
|
375
|
+
case R.medium:
|
|
376
376
|
n = t.medium;
|
|
377
377
|
break;
|
|
378
|
-
case
|
|
378
|
+
case R.midfar:
|
|
379
379
|
n = t.midfar;
|
|
380
380
|
break;
|
|
381
|
-
case
|
|
381
|
+
case R.far:
|
|
382
382
|
n = t.far;
|
|
383
383
|
break;
|
|
384
|
-
case
|
|
384
|
+
case R.farther:
|
|
385
385
|
case void 0:
|
|
386
386
|
default:
|
|
387
387
|
n = t.farther;
|
|
388
388
|
break;
|
|
389
|
-
case
|
|
389
|
+
case R.veryfar:
|
|
390
390
|
n = t.veryfar;
|
|
391
391
|
break;
|
|
392
392
|
}
|
|
@@ -421,54 +421,54 @@ const De = /* @__PURE__ */ new Map([
|
|
|
421
421
|
r = r + n, n = s.eye.getComponent(2);
|
|
422
422
|
break;
|
|
423
423
|
}
|
|
424
|
-
return new T.Vector3(r,
|
|
424
|
+
return new T.Vector3(r, o, n);
|
|
425
425
|
}, me = /* @__PURE__ */ new at(), Ee = /* @__PURE__ */ new ge();
|
|
426
426
|
let pe;
|
|
427
427
|
function Je(e) {
|
|
428
428
|
const t = [];
|
|
429
429
|
let s, r;
|
|
430
|
-
function
|
|
431
|
-
s = new Array(
|
|
430
|
+
function o(h) {
|
|
431
|
+
s = new Array(h).fill(!1), r = new Array(h).fill(!1);
|
|
432
432
|
}
|
|
433
433
|
let n = 12345;
|
|
434
|
-
function
|
|
434
|
+
function f() {
|
|
435
435
|
return n = n * 1664525 + 1013904223 & 4294967295, (n >>> 0) / 4294967296;
|
|
436
436
|
}
|
|
437
|
-
function b(
|
|
438
|
-
const
|
|
439
|
-
let
|
|
440
|
-
if (
|
|
441
|
-
const
|
|
442
|
-
for (let
|
|
443
|
-
s[
|
|
444
|
-
|
|
437
|
+
function b(h, p) {
|
|
438
|
+
const g = p;
|
|
439
|
+
let w;
|
|
440
|
+
if (g <= s.length) {
|
|
441
|
+
const d = [];
|
|
442
|
+
for (let c = 0; c < g; c++)
|
|
443
|
+
s[c] || d.push(c);
|
|
444
|
+
w = d[Math.floor(f() * d.length)];
|
|
445
445
|
} else
|
|
446
|
-
|
|
447
|
-
let
|
|
448
|
-
if (
|
|
449
|
-
const
|
|
450
|
-
for (let
|
|
451
|
-
r[
|
|
452
|
-
|
|
446
|
+
w = Math.floor(f() * g);
|
|
447
|
+
let i;
|
|
448
|
+
if (g <= r.length) {
|
|
449
|
+
const d = [];
|
|
450
|
+
for (let c = 0; c < g; c++)
|
|
451
|
+
r[c] || d.push(c);
|
|
452
|
+
i = d[Math.floor(f() * d.length)];
|
|
453
453
|
} else
|
|
454
|
-
|
|
455
|
-
const
|
|
456
|
-
return
|
|
454
|
+
i = Math.floor(f() * g);
|
|
455
|
+
const l = (w + f()) / g, y = (i + f()) / g;
|
|
456
|
+
return w < s.length && (s[w] = !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;
|
|
460
460
|
for (; x < e; ) {
|
|
461
|
-
const
|
|
462
|
-
|
|
463
|
-
for (let
|
|
464
|
-
const [
|
|
465
|
-
|
|
461
|
+
const h = x * 2;
|
|
462
|
+
o(h);
|
|
463
|
+
for (let p = 0; p < x; p++) {
|
|
464
|
+
const [g, w] = t[p], i = Math.min(Math.floor(g * h), h - 1), l = Math.min(Math.floor(w * h), h - 1);
|
|
465
|
+
i < s.length && (s[i] = !0), l < r.length && (r[l] = !0);
|
|
466
466
|
}
|
|
467
|
-
for (let
|
|
468
|
-
const
|
|
469
|
-
t.push(
|
|
467
|
+
for (let p = 0; p < x; p++) {
|
|
468
|
+
const g = b(p, h);
|
|
469
|
+
t.push(g);
|
|
470
470
|
}
|
|
471
|
-
x =
|
|
471
|
+
x = h;
|
|
472
472
|
}
|
|
473
473
|
return t.slice(0, e);
|
|
474
474
|
}
|
|
@@ -477,8 +477,8 @@ class us extends et {
|
|
|
477
477
|
static get type() {
|
|
478
478
|
return "PMJTAANode";
|
|
479
479
|
}
|
|
480
|
-
constructor(t, s, r,
|
|
481
|
-
super("vec4"), this.isPMJTAANode = !0, this.updateBeforeType = tt.FRAME, this.beautyNode = t, this.depthNode = s, this.velocityNode = r, this.camera =
|
|
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 $(), this._progressiveWeight = Y(0), this._jitterIndex = 0, this._sampleCount = 64, this._sequenceLength = Ue.length, this._sequence = Ue, this._invSize = Y(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 $(), this._cameraNearFar = Y(new ge()), this._cameraWorldMatrix = Y(new $()), this._cameraWorldMatrixInverse = Y(new $()), this._cameraProjectionMatrixInverse = Y(new $()), this._previousCameraWorldMatrix = Y(new $()), this._previousCameraProjectionMatrixInverse = Y(new $()), this._previousDepthNode = Ae(new we(1, 1)), this._needsPostProcessingSync = !1, this._velocityNode = null;
|
|
482
482
|
}
|
|
483
483
|
getTextureNode() {
|
|
484
484
|
return this._textureNode;
|
|
@@ -498,12 +498,12 @@ class us extends et {
|
|
|
498
498
|
offsetY: 0,
|
|
499
499
|
width: t,
|
|
500
500
|
height: s
|
|
501
|
-
},
|
|
501
|
+
}, o = this._sequence[this._jitterIndex];
|
|
502
502
|
this.camera.setViewOffset(
|
|
503
503
|
r.fullWidth,
|
|
504
504
|
r.fullHeight,
|
|
505
|
-
r.offsetX + (
|
|
506
|
-
r.offsetY + (
|
|
505
|
+
r.offsetX + (o[0] - 0.5) * this.jitterIntensity,
|
|
506
|
+
r.offsetY + (o[1] - 0.5) * this.jitterIntensity,
|
|
507
507
|
r.width,
|
|
508
508
|
r.height
|
|
509
509
|
);
|
|
@@ -532,69 +532,69 @@ class us extends et {
|
|
|
532
532
|
}
|
|
533
533
|
updateBefore(t) {
|
|
534
534
|
const { renderer: s } = t, r = this.camera.matrixWorld;
|
|
535
|
-
let
|
|
535
|
+
let o = !1;
|
|
536
536
|
if (this.useProgressiveAccumulation) {
|
|
537
|
-
const
|
|
538
|
-
for (let
|
|
539
|
-
if (Math.abs(
|
|
540
|
-
|
|
537
|
+
const p = r.elements, g = this._prevCameraMatrix.elements;
|
|
538
|
+
for (let i = 0; i < 16; i++)
|
|
539
|
+
if (Math.abs(p[i] - g[i]) > 1e-6) {
|
|
540
|
+
o = !0;
|
|
541
541
|
break;
|
|
542
542
|
}
|
|
543
|
-
|
|
544
|
-
const
|
|
545
|
-
this._progressiveWeight.value =
|
|
543
|
+
o && (this._accumulatedFrames = 0), this._accumulatedFrames++;
|
|
544
|
+
const w = Math.min(this._accumulatedFrames, this.maxAccumulationFrames);
|
|
545
|
+
this._progressiveWeight.value = o ? 0 : 1 / w, 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,
|
|
550
|
-
this._needsPostProcessingSync === !0 && (this.setViewOffset(
|
|
551
|
-
const x = this._historyRenderTarget.width !==
|
|
552
|
-
this.setSize(
|
|
553
|
-
const
|
|
554
|
-
if (this._historyRenderTarget.height ===
|
|
555
|
-
const
|
|
556
|
-
s.copyTextureToTexture(
|
|
549
|
+
const n = this.beautyNode.isRTTNode ? this.beautyNode.renderTarget : this.beautyNode.passNode.renderTarget, f = n.texture.width, b = n.texture.height;
|
|
550
|
+
this._needsPostProcessingSync === !0 && (this.setViewOffset(f, b), this._needsPostProcessingSync = !1), pe = Te.resetRendererState(s, pe), s.setClearColor(new rt(0), 0);
|
|
551
|
+
const x = this._historyRenderTarget.width !== f || this._historyRenderTarget.height !== b;
|
|
552
|
+
this.setSize(f, b), 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
|
+
const h = s.getDrawingBufferSize(Ee);
|
|
554
|
+
if (this._historyRenderTarget.height === h.height && this._historyRenderTarget.width === h.width) {
|
|
555
|
+
const p = this.depthNode.value;
|
|
556
|
+
s.copyTextureToTexture(p, this._historyRenderTarget.depthTexture), this._previousDepthNode.value = this._historyRenderTarget.depthTexture;
|
|
557
557
|
}
|
|
558
558
|
Te.restoreRendererState(s, pe);
|
|
559
559
|
}
|
|
560
560
|
setup(t) {
|
|
561
561
|
const s = t.context.renderPipeline;
|
|
562
562
|
s && (this._needsPostProcessingSync = !0, s.context.onBeforeRenderPipeline = () => {
|
|
563
|
-
const
|
|
564
|
-
this.setViewOffset(
|
|
563
|
+
const i = t.renderer.getDrawingBufferSize(Ee);
|
|
564
|
+
this.setViewOffset(i.width, i.height);
|
|
565
565
|
}, s.context.onAfterRenderPipeline = () => {
|
|
566
566
|
this.clearViewOffset();
|
|
567
567
|
}), t.renderer.reversedDepthBuffer === !0 && (this._historyRenderTarget.depthTexture.type = nt), t.context.velocity !== void 0 ? this._velocityNode = t.context.velocity : this._velocityNode = fe;
|
|
568
|
-
const r = (
|
|
569
|
-
const { x:
|
|
570
|
-
return Pe(
|
|
571
|
-
},
|
|
568
|
+
const r = (i) => {
|
|
569
|
+
const { x: l, y } = this._cameraNearFar, d = xt(i, l, y);
|
|
570
|
+
return Pe(d, l, y);
|
|
571
|
+
}, o = ft({
|
|
572
572
|
closestDepth: "float",
|
|
573
573
|
closestPositionTexel: "vec2",
|
|
574
574
|
farthestDepth: "float"
|
|
575
|
-
}), n = te(([
|
|
576
|
-
const
|
|
577
|
-
for (let
|
|
575
|
+
}), n = te(([i]) => {
|
|
576
|
+
const l = X(2).toVar(), y = de(0).toVar(), d = X(-1).toVar();
|
|
577
|
+
for (let c = -1; c <= 1; ++c)
|
|
578
578
|
for (let a = -1; a <= 1; ++a) {
|
|
579
|
-
const S =
|
|
579
|
+
const S = i.add(de(c, a)).toVar();
|
|
580
580
|
let m = this.depthNode.load(S).r;
|
|
581
|
-
t.renderer.reversedDepthBuffer && (m = m.oneMinus()), t.renderer.logarithmicDepthBuffer && (m = r(m)), m = m.toVar(), ke(m.lessThan(
|
|
582
|
-
|
|
583
|
-
}), ke(m.greaterThan(
|
|
584
|
-
|
|
581
|
+
t.renderer.reversedDepthBuffer && (m = m.oneMinus()), t.renderer.logarithmicDepthBuffer && (m = r(m)), m = m.toVar(), ke(m.lessThan(l), () => {
|
|
582
|
+
l.assign(m), y.assign(S);
|
|
583
|
+
}), ke(m.greaterThan(d), () => {
|
|
584
|
+
d.assign(m);
|
|
585
585
|
});
|
|
586
586
|
}
|
|
587
|
-
return
|
|
588
|
-
}),
|
|
589
|
-
let
|
|
590
|
-
t.renderer.logarithmicDepthBuffer && (
|
|
591
|
-
const y = vt(
|
|
592
|
-
return this.camera.isOrthographicCamera ? bt(
|
|
593
|
-
}, b = te(([
|
|
594
|
-
const
|
|
595
|
-
return
|
|
596
|
-
se(
|
|
597
|
-
|
|
587
|
+
return o(l, y, d);
|
|
588
|
+
}), f = (i) => {
|
|
589
|
+
let l = this._previousDepthNode.sample(i).r;
|
|
590
|
+
t.renderer.logarithmicDepthBuffer && (l = r(l));
|
|
591
|
+
const y = vt(i, l, this._previousCameraProjectionMatrixInverse), d = this._previousCameraWorldMatrix.mul(se(y, 1)).xyz, c = this._cameraWorldMatrixInverse.mul(se(d, 1)).z;
|
|
592
|
+
return this.camera.isOrthographicCamera ? bt(c, this._cameraNearFar.x, this._cameraNearFar.y) : Pe(c, this._cameraNearFar.x, this._cameraNearFar.y);
|
|
593
|
+
}, b = 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(se(c, i.a)), _ = S.xyz.div(a).abs(), B = oe(_.x, _.y, _.z);
|
|
595
|
+
return B.greaterThan(1).select(
|
|
596
|
+
se(c, i.a).add(S.div(B)),
|
|
597
|
+
l
|
|
598
598
|
);
|
|
599
599
|
}).setLayout({
|
|
600
600
|
name: "clipAABB",
|
|
@@ -605,8 +605,8 @@ class us extends et {
|
|
|
605
605
|
{ name: "minColor", type: "vec4" },
|
|
606
606
|
{ name: "maxColor", type: "vec4" }
|
|
607
607
|
]
|
|
608
|
-
}), x = te(([
|
|
609
|
-
const
|
|
608
|
+
}), x = te(([i, l, y, d]) => {
|
|
609
|
+
const c = [
|
|
610
610
|
[-1, -1],
|
|
611
611
|
[-1, 1],
|
|
612
612
|
[1, -1],
|
|
@@ -615,16 +615,16 @@ class us extends et {
|
|
|
615
615
|
[0, -1],
|
|
616
616
|
[0, 1],
|
|
617
617
|
[-1, 0]
|
|
618
|
-
], a =
|
|
619
|
-
for (const [L,
|
|
620
|
-
const
|
|
621
|
-
a.addAssign(
|
|
618
|
+
], a = l.toVar(), S = l.pow2().toVar();
|
|
619
|
+
for (const [L, W] of c) {
|
|
620
|
+
const V = this.beautyNode.offset(yt(L, W)).load(i).max(0);
|
|
621
|
+
a.addAssign(V), S.addAssign(V.pow2());
|
|
622
622
|
}
|
|
623
|
-
const m =
|
|
624
|
-
return b(
|
|
625
|
-
}),
|
|
626
|
-
const
|
|
627
|
-
return
|
|
623
|
+
const m = X(c.length + 1), _ = a.div(m), B = S.div(m).sub(_.pow2()).max(0).sqrt().mul(d), u = _.sub(B), M = _.add(B);
|
|
624
|
+
return b(_.clamp(u, M), y, u, M);
|
|
625
|
+
}), h = te(([i, l]) => {
|
|
626
|
+
const d = i.mul(l).fract().abs(), c = oe(d, d.oneMinus());
|
|
627
|
+
return c.x.mul(c.y).oneMinus().div(0.75);
|
|
628
628
|
}).setLayout({
|
|
629
629
|
name: "subpixelCorrection",
|
|
630
630
|
type: "float",
|
|
@@ -632,52 +632,52 @@ class us extends et {
|
|
|
632
632
|
{ name: "velocityUV", type: "vec2" },
|
|
633
633
|
{ name: "textureSize", type: "ivec2" }
|
|
634
634
|
]
|
|
635
|
-
}),
|
|
636
|
-
const
|
|
637
|
-
return y.mulAssign(
|
|
638
|
-
}),
|
|
639
|
-
const
|
|
640
|
-
this.useSubpixelCorrection &&
|
|
641
|
-
const
|
|
642
|
-
|
|
635
|
+
}), p = te(([i, l, y]) => {
|
|
636
|
+
const d = y.oneMinus(), c = i.mul(X(1).div(oe(i.r, i.g, i.b).add(1))), a = l.mul(X(1).div(oe(l.r, l.g, l.b).add(1))), S = Ce(c.rgb), m = Ce(a.rgb);
|
|
637
|
+
return y.mulAssign(X(1).div(S.add(1))), d.mulAssign(X(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), w = 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)), _ = i.sub(m), B = f(_), u = _.greaterThanEqual(0).all().and(_.lessThanEqual(1).all()), M = S.sub(c).greaterThan(this.edgeDepthDiff), L = c.sub(B).greaterThan(this.depthThreshold), W = u.and(M.or(L.not())), V = this.beautyNode.sample(i), J = g.sample(i.sub(m)), ce = i.sub(_).mul(l).length().div(this.maxVelocityLength).saturate().sqrt(), K = X(0.05).toVar();
|
|
640
|
+
this.useSubpixelCorrection && K.addAssign(h(m, l).mul(0.5)), K.assign(W.select(K.add(ce.mul(0.6)).saturate(), 1));
|
|
641
|
+
const P = this._progressiveWeight, C = P.greaterThan(0).and(W);
|
|
642
|
+
K.assign(C.select(P, K));
|
|
643
643
|
const I = _e(0.25, 1.25, ce.oneMinus().pow2()), U = C.select(
|
|
644
|
-
|
|
645
|
-
x(y,
|
|
646
|
-
),
|
|
647
|
-
_e(U,
|
|
648
|
-
|
|
644
|
+
J,
|
|
645
|
+
x(y, V, J, I)
|
|
646
|
+
), Z = C.select(
|
|
647
|
+
_e(U, V, K),
|
|
648
|
+
p(V, U, K)
|
|
649
649
|
);
|
|
650
|
-
return se(
|
|
650
|
+
return se(Z.rgb.mul(Z.a), Z.a);
|
|
651
651
|
});
|
|
652
|
-
return this._resolveMaterial.fragmentNode =
|
|
652
|
+
return this._resolveMaterial.fragmentNode = w(), 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 = A((a) => a.animationsLoaded), t = A((a) => a.characterState), s = A((a) => a.lipSyncManager), r = A((a) => a.blendshapeManager),
|
|
659
|
+
const e = A((a) => a.animationsLoaded), t = A((a) => a.characterState), s = A((a) => a.lipSyncManager), r = A((a) => a.blendshapeManager), o = k((a) => a.credentials), n = k((a) => a.currentUtterance), f = k((a) => a.textToSpeak), b = k((a) => a.visemes), x = k((a) => a.blendshapes), h = k((a) => a.visemeIntensity), p = k((a) => a.currentVisemeIndex), g = k((a) => a.currentBlendshapeIndex), w = k((a) => a.useBlendshapeManager), [i, l] = D(!1), [y, d] = D(!1), c = ye(() => o != null && o.region && (o.subscriptionKey || o.token) ? Vt({
|
|
660
660
|
credentials: {
|
|
661
|
-
region:
|
|
662
|
-
authorizationToken:
|
|
663
|
-
subscriptionKey:
|
|
661
|
+
region: o.region,
|
|
662
|
+
authorizationToken: o.token,
|
|
663
|
+
subscriptionKey: o.subscriptionKey
|
|
664
664
|
}
|
|
665
|
-
}) : null, [
|
|
666
|
-
return
|
|
667
|
-
if (
|
|
668
|
-
const a =
|
|
669
|
-
a && Array.isArray(a) && a.length ? (je(a),
|
|
670
|
-
je(
|
|
665
|
+
}) : null, [o]);
|
|
666
|
+
return N(() => {
|
|
667
|
+
if (c) {
|
|
668
|
+
const a = c.speechSynthesis.getVoices();
|
|
669
|
+
a && Array.isArray(a) && a.length ? (je(a), l(!0)) : c.speechSynthesis.onvoiceschanged = () => {
|
|
670
|
+
je(c.speechSynthesis.getVoices()), l(!0);
|
|
671
671
|
};
|
|
672
672
|
}
|
|
673
|
-
}, [
|
|
674
|
-
|
|
675
|
-
}, [
|
|
676
|
-
if (
|
|
677
|
-
const a = new It(
|
|
673
|
+
}, [c]), N(() => {
|
|
674
|
+
i && (w ? !!r : !!s) && e && d(!0);
|
|
675
|
+
}, [i, s, r, e, w]), N(() => {
|
|
676
|
+
if (f) {
|
|
677
|
+
const a = new It(f);
|
|
678
678
|
os(a);
|
|
679
679
|
}
|
|
680
|
-
}, [
|
|
680
|
+
}, [f]), N(() => {
|
|
681
681
|
var a, S;
|
|
682
682
|
n && y ? (n.onstart = () => {
|
|
683
683
|
console.log("Start"), Re(G.speaking);
|
|
@@ -686,12 +686,12 @@ const Le = (e, t, s, r) => new us(pt(e), t, s, r), ms = () => {
|
|
|
686
686
|
}, n.onboundary = () => {
|
|
687
687
|
}, n.onviseme = (m) => {
|
|
688
688
|
We(m);
|
|
689
|
-
}, (a =
|
|
690
|
-
}, [n]),
|
|
691
|
-
s && (s.visemeIntensity =
|
|
692
|
-
}, [
|
|
693
|
-
if (!
|
|
694
|
-
if (!s.isStarted && s.start(), b.length > 1 &&
|
|
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]), N(() => {
|
|
691
|
+
s && (s.visemeIntensity = h);
|
|
692
|
+
}, [h]), N(() => {
|
|
693
|
+
if (!w && s && t === G.speaking) {
|
|
694
|
+
if (!s.isStarted && s.start(), b.length > 1 && p === 0)
|
|
695
695
|
b.forEach((a) => {
|
|
696
696
|
const S = parseInt(a.name);
|
|
697
697
|
if (!isNaN(S)) {
|
|
@@ -700,170 +700,172 @@ 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 =
|
|
703
|
+
for (let a = p + 1; a < b.length; a++) {
|
|
704
704
|
const S = b[a], m = parseInt(S.name);
|
|
705
705
|
if (!isNaN(m)) {
|
|
706
|
-
const
|
|
707
|
-
|
|
706
|
+
const _ = De.get(m);
|
|
707
|
+
_ && s.PlayVisemeAsync(_, S.elapsedTime / 1e4);
|
|
708
708
|
}
|
|
709
709
|
}
|
|
710
710
|
is(b.length - 1);
|
|
711
711
|
}
|
|
712
|
-
}, [t, b, s,
|
|
713
|
-
if (
|
|
714
|
-
if (!r.isStarted && r.start(), x.length > 1 &&
|
|
712
|
+
}, [t, b, s, w]), N(() => {
|
|
713
|
+
if (w && r && t === G.speaking) {
|
|
714
|
+
if (!r.isStarted && r.start(), x.length > 1 && g === 0)
|
|
715
715
|
x.forEach((a) => {
|
|
716
716
|
r.PlayBlendShapeAsync(a);
|
|
717
717
|
});
|
|
718
718
|
else
|
|
719
|
-
for (let a =
|
|
719
|
+
for (let a = g + 1; a < x.length; a++) {
|
|
720
720
|
const S = x[a];
|
|
721
721
|
r.PlayBlendShapeAsync(S);
|
|
722
722
|
}
|
|
723
723
|
cs(x.length - 1);
|
|
724
724
|
}
|
|
725
|
-
}, [t, x, r,
|
|
725
|
+
}, [t, x, r, w]), N(() => {
|
|
726
726
|
t !== G.speaking && (qe(), Ge());
|
|
727
727
|
}, [t]), null;
|
|
728
728
|
}, ps = ({ points: e, color: t = "red" }) => {
|
|
729
729
|
const s = ye(() => {
|
|
730
|
-
const r = new T.BufferGeometry().setFromPoints(e),
|
|
731
|
-
return new T.Line(r,
|
|
730
|
+
const r = new T.BufferGeometry().setFromPoints(e), o = new T.LineBasicMaterial({ color: t, toneMapped: !1 });
|
|
731
|
+
return new T.Line(r, o);
|
|
732
732
|
}, [e, t]);
|
|
733
733
|
return /* @__PURE__ */ v.createElement("primitive", { object: s });
|
|
734
734
|
}, gs = ({ parentGpuTier: e, setIsGpuAvailable: t, children: s, tonemapping: r }) => {
|
|
735
|
-
const
|
|
736
|
-
|
|
735
|
+
const o = z((u) => u.cameraPosition), n = z((u) => u.lookAt), f = z((u) => u.movable), b = E((u) => u.targets), x = E((u) => u.showFirstTarget), [h] = D(e || lt()), [p, g] = D(), [w, i] = D(null), [l, y] = D(void 0), d = re(null), c = re(null), a = re(null), S = (u) => {
|
|
736
|
+
u.preventDefault(), u.stopPropagation();
|
|
737
737
|
};
|
|
738
|
-
|
|
739
|
-
Et(
|
|
740
|
-
}, [
|
|
741
|
-
var
|
|
742
|
-
if (
|
|
743
|
-
|
|
738
|
+
N(() => {
|
|
739
|
+
Et(c.current);
|
|
740
|
+
}, [c.current]), N(() => {
|
|
741
|
+
var u, M, L, W;
|
|
742
|
+
if (f)
|
|
743
|
+
w == null || w.abort(), i(null);
|
|
744
744
|
else {
|
|
745
|
-
const
|
|
746
|
-
|
|
745
|
+
const V = new AbortController();
|
|
746
|
+
i(V), (u = d.current) == null || u.addEventListener("wheel", S, { passive: !1, signal: V.signal }), (M = d.current) == null || M.addEventListener("pointerdown", S, { passive: !1, signal: V.signal }), (L = d.current) == null || L.addEventListener("pointermove", S, { passive: !1, signal: V.signal }), (W = d.current) == null || W.addEventListener("click", S, { passive: !1, signal: V.signal });
|
|
747
747
|
}
|
|
748
|
-
}, [
|
|
749
|
-
a != null && a.current && n &&
|
|
750
|
-
}, [
|
|
751
|
-
if (
|
|
752
|
-
if (
|
|
753
|
-
|
|
748
|
+
}, [f]), N(() => {
|
|
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]), N(() => {
|
|
751
|
+
if (h)
|
|
752
|
+
if (h.type === "FALLBACK")
|
|
753
|
+
g(
|
|
754
754
|
"medium"
|
|
755
755
|
/* medium */
|
|
756
756
|
);
|
|
757
757
|
else
|
|
758
|
-
switch (
|
|
758
|
+
switch (h.tier) {
|
|
759
759
|
case 0:
|
|
760
760
|
case 1:
|
|
761
|
-
|
|
761
|
+
g(
|
|
762
762
|
"low"
|
|
763
763
|
/* low */
|
|
764
764
|
);
|
|
765
765
|
break;
|
|
766
766
|
case 2:
|
|
767
|
-
|
|
767
|
+
g(
|
|
768
768
|
"medium"
|
|
769
769
|
/* medium */
|
|
770
770
|
);
|
|
771
771
|
break;
|
|
772
772
|
case 3:
|
|
773
|
-
|
|
773
|
+
g(
|
|
774
774
|
"high"
|
|
775
775
|
/* high */
|
|
776
776
|
);
|
|
777
777
|
break;
|
|
778
778
|
default:
|
|
779
|
-
|
|
779
|
+
g(
|
|
780
780
|
"low"
|
|
781
781
|
/* low */
|
|
782
782
|
);
|
|
783
783
|
break;
|
|
784
784
|
}
|
|
785
|
-
}, [
|
|
786
|
-
switch (
|
|
785
|
+
}, [h]), N(() => {
|
|
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);
|
|
789
789
|
break;
|
|
790
790
|
case "medium":
|
|
791
|
-
y([
|
|
791
|
+
y([1, 1.5]), console.log(`Retorik React-Bodyengine-Three > GPU tier detected : ${p}`), t(!0);
|
|
792
792
|
break;
|
|
793
793
|
case "high":
|
|
794
|
-
y([1, 2]), console.log(`Retorik React-Bodyengine-Three > GPU tier detected : ${
|
|
794
|
+
y([1, 2]), console.log(`Retorik React-Bodyengine-Three > GPU tier detected : ${p}`), t(!0);
|
|
795
795
|
break;
|
|
796
796
|
}
|
|
797
|
-
}, [
|
|
798
|
-
const m = re(void 0),
|
|
799
|
-
const
|
|
800
|
-
canvas:
|
|
797
|
+
}, [p]);
|
|
798
|
+
const m = re(void 0), _ = Ye(async (u) => {
|
|
799
|
+
const M = new T.WebGPURenderer({
|
|
800
|
+
canvas: u.canvas,
|
|
801
801
|
antialias: !1,
|
|
802
802
|
alpha: !0,
|
|
803
803
|
powerPreference: "high-performance"
|
|
804
804
|
});
|
|
805
|
-
return
|
|
806
|
-
}, []),
|
|
805
|
+
return M.setClearColor(new T.Color("#000000"), 0), M.setPixelRatio(devicePixelRatio), M.shadowMap.type = T.PCFSoftShadowMap, await M.init(), M;
|
|
806
|
+
}, []), B = ye(() => {
|
|
807
807
|
if (b.length) {
|
|
808
|
-
const
|
|
809
|
-
return [
|
|
810
|
-
} else if (
|
|
811
|
-
const
|
|
812
|
-
return [
|
|
808
|
+
const u = b[0], M = new T.Vector3(u.position.x - 0.5, u.position.y, u.position.z - 0.1), L = new T.Vector3(u.position.x + 0.5, u.position.y, u.position.z - 0.1);
|
|
809
|
+
return [M, L];
|
|
810
|
+
} else if (o) {
|
|
811
|
+
const u = new T.Vector3(o.x - 0.5, o.y, o.z - 0.1), M = new T.Vector3(o.x + 0.5, o.y, o.z - 0.1);
|
|
812
|
+
return [u, M];
|
|
813
813
|
}
|
|
814
814
|
return [];
|
|
815
|
-
}, [b,
|
|
816
|
-
return
|
|
815
|
+
}, [b, o]);
|
|
816
|
+
return l ? /* @__PURE__ */ v.createElement(Pt, { gl: _, dpr: l, ref: d, shadows: !0 }, /* @__PURE__ */ v.createElement(fs, { tonemapping: r, processedTier: p }), /* @__PURE__ */ v.createElement(ht, null), /* @__PURE__ */ v.createElement(ms, null), /* @__PURE__ */ v.createElement(dt, { ref: c, makeDefault: !0, fov: 28 }), /* @__PURE__ */ v.createElement(ut, { ref: a }), x && B.length && /* @__PURE__ */ v.createElement(ps, { points: B, color: "red" }), /* @__PURE__ */ v.createElement(Xe, { fallback: null }, s)) : /* @__PURE__ */ v.createElement(v.Fragment, null);
|
|
817
817
|
}, fs = ({ tonemapping: e, processedTier: t }) => {
|
|
818
|
-
const { gl: s, scene: r, camera:
|
|
819
|
-
return
|
|
820
|
-
s && (s.shadowMap.type = T.PCFSoftShadowMap, s.toneMapping = e, t !== "low" ? r.environmentIntensity =
|
|
821
|
-
}, [s, e]),
|
|
822
|
-
r.environmentIntensity =
|
|
823
|
-
}, [
|
|
824
|
-
if (!s || !r || !
|
|
818
|
+
const { gl: s, scene: r, camera: o, size: n } = Nt(), [f] = D(new T.Vector3(-3, 2, 2)), [b] = D(new T.Vector3(0, 1, 0)), [x] = D(2), [h] = D(-1e-3), [p] = D(0.6), g = re(null), w = re(null);
|
|
819
|
+
return N(() => {
|
|
820
|
+
s && (s.shadowMap.type = T.PCFSoftShadowMap, s.toneMapping = e, t !== "low" ? r.environmentIntensity = p : r.environmentIntensity = 1);
|
|
821
|
+
}, [s, e]), N(() => {
|
|
822
|
+
r.environmentIntensity = p;
|
|
823
|
+
}, [p]), N(() => {
|
|
824
|
+
if (!s || !r || !o || !t) return;
|
|
825
825
|
r.background = null;
|
|
826
|
-
const
|
|
827
|
-
|
|
828
|
-
|
|
826
|
+
const i = t === "high" || t === "medium", l = wt(r, o);
|
|
827
|
+
l.setMRT(
|
|
828
|
+
i ? Ne({ output: Ve, diffuseColor: Mt, normal: Tt(At), velocity: fe }) : Ne({ output: Ve, velocity: fe })
|
|
829
829
|
);
|
|
830
|
-
let
|
|
831
|
-
if (
|
|
832
|
-
const
|
|
833
|
-
|
|
834
|
-
const
|
|
835
|
-
|
|
830
|
+
let y;
|
|
831
|
+
if (i) {
|
|
832
|
+
const c = l.getTextureNode("output"), a = l.getTextureNode("diffuseColor"), S = l.getTextureNode("depth"), m = l.getTextureNode("velocity"), _ = l.getTextureNode("normal"), B = kt((J) => Ct(_.sample(J))), u = _t(c, S, B, o);
|
|
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 M = u.rgb, L = u.a, W = se(Oe(c.rgb.mul(L), a.rgb.mul(M)), c.a), V = Le(W, S, m, o);
|
|
835
|
+
V.jitterIntensity = 0.25, y = V;
|
|
836
836
|
} else {
|
|
837
|
-
const
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
837
|
+
const c = Le(
|
|
838
|
+
l,
|
|
839
|
+
l.getTextureNode("depth"),
|
|
840
|
+
l.getTextureNode("velocity"),
|
|
841
|
+
o
|
|
842
842
|
);
|
|
843
|
-
|
|
843
|
+
c.jitterIntensity = 0.25, y = c;
|
|
844
844
|
}
|
|
845
|
-
const
|
|
846
|
-
return
|
|
847
|
-
|
|
845
|
+
const d = new T.RenderPipeline(s);
|
|
846
|
+
return d.outputNode = y, w.current = d, () => {
|
|
847
|
+
d.dispose(), w.current = null;
|
|
848
848
|
};
|
|
849
|
-
}, [s, r,
|
|
850
|
-
|
|
851
|
-
},
|
|
849
|
+
}, [s, r, o, t]), N(() => {
|
|
850
|
+
!s || !n || s.setSize(n.width, n.height);
|
|
851
|
+
}, [n]), He(({ gl: i, scene: l, camera: y }) => {
|
|
852
|
+
w.current && w.current.render();
|
|
853
|
+
}, 1), /* @__PURE__ */ v.createElement(v.Fragment, null, t !== "low" && s && /* @__PURE__ */ v.createElement(v.Fragment, null, /* @__PURE__ */ v.createElement("directionalLight", { ref: g, color: "white", position: f.toArray(), "target-position": b.toArray(), intensity: x, castShadow: !0, "shadow-mapSize-width": 1024, "shadow-mapSize-height": 1024, "shadow-bias": h, "shadow-intensity": 0.7, "shadow-radius": 2 }, /* @__PURE__ */ v.createElement("orthographicCamera", { attach: "shadow-camera", args: [-1, 1, 2, -0.5, 2, 8] })), /* @__PURE__ */ v.createElement("directionalLight", { name: "DirectionalLight2", color: "white", position: [0, 1, -1], intensity: 0.5 })));
|
|
852
854
|
}, ys = ({ character: e, autoLookAt: t }) => {
|
|
853
|
-
const s = A((
|
|
854
|
-
return He((
|
|
855
|
-
const
|
|
856
|
-
deltaTime:
|
|
857
|
-
timestamp:
|
|
855
|
+
const s = A((h) => h.characterState), r = E((h) => h.currentAUs), o = E((h) => h.currentGaze), n = E((h) => h.currentHeadPose), f = E((h) => h.lookAtCamera), b = z((h) => h.cameraPosition), x = E((h) => h.targets);
|
|
856
|
+
return He((h, p) => {
|
|
857
|
+
const g = {
|
|
858
|
+
deltaTime: p,
|
|
859
|
+
timestamp: h.clock.oldTime,
|
|
858
860
|
AU: r,
|
|
859
|
-
gaze:
|
|
861
|
+
gaze: o,
|
|
860
862
|
headPose: n,
|
|
861
863
|
characterState: s,
|
|
862
|
-
lookAt:
|
|
864
|
+
lookAt: f ? b : void 0,
|
|
863
865
|
targets: x
|
|
864
866
|
};
|
|
865
|
-
e.update(
|
|
866
|
-
}),
|
|
867
|
+
e.update(g);
|
|
868
|
+
}), N(() => {
|
|
867
869
|
if (t)
|
|
868
870
|
switch (s) {
|
|
869
871
|
case G.idle:
|
|
@@ -877,47 +879,47 @@ const Le = (e, t, s, r) => new us(pt(e), t, s, r), ms = () => {
|
|
|
877
879
|
}
|
|
878
880
|
else
|
|
879
881
|
ue(!1);
|
|
880
|
-
}, [s, t]),
|
|
882
|
+
}, [s, t]), N(() => {
|
|
881
883
|
Dt(e);
|
|
882
884
|
}, [e]), null;
|
|
883
|
-
}, Gs = ({ url: e, type: t, animationsUrl: s, gender: r, speechSynthesis:
|
|
884
|
-
const S = A((
|
|
885
|
+
}, Gs = ({ url: e, type: t, animationsUrl: s, gender: r, speechSynthesis: o, camera: n, onLoadingCompleted: f, autoLookAt: b, breathing: x, disableAnimations: h, debug: p, enableBml: g, animationWeights: w, license: i, detectGpuData: l, environmentPreset: y = "apartment", tonemapping: d = T.NeutralToneMapping, targets: c, useBlendshapeManager: a = !1 }) => {
|
|
886
|
+
const S = A((P) => P.animationsLoaded), m = z((P) => P.defaultPositions), _ = z((P) => P.defaultDistances), [B, u] = D(), [M, L] = D(null), [W, V] = D(), [J, xe] = D(!1), ve = async (P) => {
|
|
885
887
|
let C = null;
|
|
886
888
|
switch (t) {
|
|
887
889
|
case ee.cc3:
|
|
888
|
-
C = new ct(),
|
|
890
|
+
C = new ct(), V(le.cc3);
|
|
889
891
|
break;
|
|
890
892
|
case ee.avatarsdk:
|
|
891
|
-
C = new it(),
|
|
893
|
+
C = new it(), V(le.avatarsdk);
|
|
892
894
|
break;
|
|
893
895
|
case ee.avaturn:
|
|
894
|
-
C = new ot(),
|
|
896
|
+
C = new ot(), V(le.avaturn);
|
|
895
897
|
break;
|
|
896
898
|
}
|
|
897
|
-
const I = await C.loadAsync(
|
|
899
|
+
const I = await C.loadAsync(P).catch((U) => console.warn("Error loading character : ", U));
|
|
898
900
|
if (I) {
|
|
899
901
|
let U = null;
|
|
900
|
-
const
|
|
902
|
+
const Z = {
|
|
901
903
|
mesh: I,
|
|
902
904
|
onAnimationsLoaded: ce,
|
|
903
905
|
animationsUrl: s,
|
|
904
906
|
gender: r || "male",
|
|
905
907
|
type: t,
|
|
906
|
-
debug:
|
|
907
|
-
enableBmlManager: !!
|
|
908
|
-
animationWeights:
|
|
908
|
+
debug: p,
|
|
909
|
+
enableBmlManager: !!g,
|
|
910
|
+
animationWeights: w,
|
|
909
911
|
useBlendshapeManager: a,
|
|
910
|
-
license:
|
|
912
|
+
license: i
|
|
911
913
|
};
|
|
912
914
|
switch (t) {
|
|
913
915
|
case ee.cc3:
|
|
914
|
-
U = await he.fromCharacterCreator(
|
|
916
|
+
U = await he.fromCharacterCreator(Z);
|
|
915
917
|
break;
|
|
916
918
|
case ee.avatarsdk:
|
|
917
|
-
U = await he.fromAvatarSDK(
|
|
919
|
+
U = await he.fromAvatarSDK(Z);
|
|
918
920
|
break;
|
|
919
921
|
case ee.avaturn:
|
|
920
|
-
U = await he.fromAvaturn(
|
|
922
|
+
U = await he.fromAvaturn(Z);
|
|
921
923
|
break;
|
|
922
924
|
}
|
|
923
925
|
U && L(U);
|
|
@@ -925,73 +927,73 @@ const Le = (e, t, s, r) => new us(pt(e), t, s, r), ms = () => {
|
|
|
925
927
|
}, ce = () => {
|
|
926
928
|
Fe(!0);
|
|
927
929
|
};
|
|
928
|
-
|
|
929
|
-
var
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
}, 1e3)) :
|
|
933
|
-
}, [
|
|
934
|
-
Wt(
|
|
935
|
-
}, [
|
|
936
|
-
Fe(!1),
|
|
937
|
-
}, [e,
|
|
938
|
-
if (
|
|
930
|
+
N(() => {
|
|
931
|
+
var P, C;
|
|
932
|
+
M && S && (x === !1 && ((C = (P = M.animationManager) == null ? void 0 : P.disableBreathing) == null || C.call(P)), J ? (Jt(M.getAllAnimationNames()), Kt(M.getAllAnimations()), setTimeout(() => {
|
|
933
|
+
f == null || f();
|
|
934
|
+
}, 1e3)) : K());
|
|
935
|
+
}, [M, S, J]), N(() => {
|
|
936
|
+
Wt(c || []);
|
|
937
|
+
}, [c]), N(() => {
|
|
938
|
+
Fe(!1), B !== void 0 && (B ? ve(e) : f == null || f());
|
|
939
|
+
}, [e, B]), N(() => {
|
|
940
|
+
if (J && _ && m)
|
|
939
941
|
if (n) {
|
|
940
|
-
const
|
|
941
|
-
Be(
|
|
942
|
+
const P = ds(n, _, m);
|
|
943
|
+
Be(P), ze(n.lookAt ? m[n.lookAt] : m.lowerbelly), Ht(!!n.movable);
|
|
942
944
|
} else {
|
|
943
|
-
const
|
|
944
|
-
|
|
945
|
+
const P = m.mouth.clone();
|
|
946
|
+
P.setComponent(2, _.farther), Be(P), ze(m.lowerbelly);
|
|
945
947
|
}
|
|
946
|
-
}, [
|
|
947
|
-
|
|
948
|
-
}, [
|
|
948
|
+
}, [J, n, _, m]), N(() => {
|
|
949
|
+
o && (o.credentials && ns(o.credentials), o.voice && ls(o.voice));
|
|
950
|
+
}, [o]), N(() => {
|
|
949
951
|
hs(a);
|
|
950
952
|
}, [a]);
|
|
951
|
-
const
|
|
952
|
-
if (
|
|
953
|
+
const K = () => {
|
|
954
|
+
if (M && W) {
|
|
953
955
|
try {
|
|
954
|
-
const
|
|
956
|
+
const P = new T.Box3().setFromObject(M), C = P.max, I = P.min, U = new T.Vector3((C.x + I.x) / 2, (C.y + I.y) / 2, (C.z + I.z) / 2);
|
|
955
957
|
Ut(U);
|
|
956
|
-
const
|
|
958
|
+
const Z = Math.abs(C.x - I.x), j = Math.abs(C.y - I.y), Ke = Math.abs(C.z - I.z);
|
|
957
959
|
jt({
|
|
958
|
-
x:
|
|
960
|
+
x: Z,
|
|
959
961
|
y: j,
|
|
960
962
|
z: Ke
|
|
961
963
|
});
|
|
962
|
-
const
|
|
963
|
-
eye: new T.Vector3(
|
|
964
|
-
mouth: new T.Vector3(
|
|
965
|
-
neck: new T.Vector3(
|
|
966
|
-
clavicle: new T.Vector3(
|
|
967
|
-
torso: new T.Vector3(
|
|
968
|
-
belly: new T.Vector3(
|
|
969
|
-
lowerbelly: new T.Vector3(
|
|
964
|
+
const O = (C.x + I.x) / 2, H = (C.z + I.z) / 2, Ze = {
|
|
965
|
+
eye: new T.Vector3(O, C.y - j / 16, H),
|
|
966
|
+
mouth: new T.Vector3(O, C.y - j / 12, H),
|
|
967
|
+
neck: new T.Vector3(O, C.y - j / 8, H),
|
|
968
|
+
clavicle: new T.Vector3(O, C.y - j / 6, H),
|
|
969
|
+
torso: new T.Vector3(O, C.y - j / 4, H),
|
|
970
|
+
belly: new T.Vector3(O, C.y - j / 8 * 3, H),
|
|
971
|
+
lowerbelly: new T.Vector3(O, C.y - j / 32 * 15, H),
|
|
970
972
|
hips: U,
|
|
971
|
-
higherthigh: new T.Vector3(
|
|
972
|
-
thigh: new T.Vector3(
|
|
973
|
-
knee: new T.Vector3(
|
|
974
|
-
leg: new T.Vector3(
|
|
975
|
-
feet: new T.Vector3(
|
|
976
|
-
},
|
|
977
|
-
veryclose:
|
|
978
|
-
closer:
|
|
979
|
-
close:
|
|
980
|
-
midclose:
|
|
981
|
-
medium:
|
|
982
|
-
midfar:
|
|
983
|
-
far:
|
|
984
|
-
farther:
|
|
985
|
-
veryfar:
|
|
973
|
+
higherthigh: new T.Vector3(O, I.y + j / 32 * 15, H),
|
|
974
|
+
thigh: new T.Vector3(O, I.y + j / 8 * 3, H),
|
|
975
|
+
knee: new T.Vector3(O, I.y + j / 4, H),
|
|
976
|
+
leg: new T.Vector3(O, I.y + j / 8, H),
|
|
977
|
+
feet: new T.Vector3(O, I.y, H)
|
|
978
|
+
}, Q = (C.y - (I.y + j / 7 * 2)) / 2 / Math.tan(25 * (Math.PI / 180)), Qe = {
|
|
979
|
+
veryclose: Q / 4,
|
|
980
|
+
closer: Q / 3,
|
|
981
|
+
close: Q / 2.5,
|
|
982
|
+
midclose: Q / 2,
|
|
983
|
+
medium: Q,
|
|
984
|
+
midfar: Q * 2,
|
|
985
|
+
far: Q * 2.5,
|
|
986
|
+
farther: Q * 3,
|
|
987
|
+
veryfar: Q * 4
|
|
986
988
|
};
|
|
987
989
|
Lt(Ze), Ot(Qe);
|
|
988
|
-
} catch (
|
|
989
|
-
console.warn(
|
|
990
|
+
} catch (P) {
|
|
991
|
+
console.warn(P);
|
|
990
992
|
}
|
|
991
993
|
xe(!0);
|
|
992
994
|
}
|
|
993
995
|
};
|
|
994
|
-
return /* @__PURE__ */ v.createElement(gs, { parentGpuTier:
|
|
996
|
+
return /* @__PURE__ */ v.createElement(gs, { parentGpuTier: l, setIsGpuAvailable: u, tonemapping: d }, B ? /* @__PURE__ */ v.createElement(v.Fragment, null, M && /* @__PURE__ */ v.createElement(ys, { character: M, autoLookAt: !!b }), M && /* @__PURE__ */ v.createElement(v.Fragment, null, /* @__PURE__ */ v.createElement(mt, { preset: y }), /* @__PURE__ */ v.createElement("primitive", { object: M, castShadow: !0, receiveShadow: !0 }))) : /* @__PURE__ */ v.createElement(v.Fragment, null));
|
|
995
997
|
}, Ss = {
|
|
996
998
|
emotions: [],
|
|
997
999
|
currentTopEmotion: Se.Neutral,
|
|
@@ -1015,7 +1017,7 @@ export {
|
|
|
1015
1017
|
Gs as Character,
|
|
1016
1018
|
tr as CharacterState,
|
|
1017
1019
|
sr as CreationTool,
|
|
1018
|
-
|
|
1020
|
+
R as Distances,
|
|
1019
1021
|
$s as Object3D,
|
|
1020
1022
|
F as Positions,
|
|
1021
1023
|
q as Rotations,
|
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":"d9141255-1","name":"vanilla.mjs"},{"uid":"d9141255-3","name":"react.mjs"}]},{"name":"src","children":[{"name":"contexts","children":[{"uid":"d9141255-5","name":"characterStore.ts"},{"uid":"d9141255-7","name":"cameraStore.ts"},{"uid":"d9141255-9","name":"headStore.ts"},{"uid":"d9141255-11","name":"animationStore.ts"},{"uid":"d9141255-17","name":"speechStore.ts"},{"uid":"d9141255-33","name":"emotionStore.ts"}]},{"name":"models","children":[{"uid":"d9141255-13","name":"enums.ts"},{"uid":"d9141255-15","name":"constants.ts"}]},{"name":"utils/getCameraPositionVector.ts","uid":"d9141255-19"},{"name":"components","children":[{"name":"PostProcessing/PMJTAANode.js","uid":"d9141255-21"},{"uid":"d9141255-23","name":"SpeechManager.tsx"},{"uid":"d9141255-25","name":"HorizontalLine.tsx"},{"uid":"d9141255-27","name":"Scene.tsx"},{"name":"Controllers/CharacterController.ts","uid":"d9141255-29"},{"uid":"d9141255-31","name":"Character.tsx"}]},{"uid":"d9141255-35","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"d9141255-1":{"renderedLength":975,"gzipLength":394,"brotliLength":353,"metaUid":"d9141255-0"},"d9141255-3":{"renderedLength":593,"gzipLength":285,"brotliLength":235,"metaUid":"d9141255-2"},"d9141255-5":{"renderedLength":2066,"gzipLength":439,"brotliLength":380,"metaUid":"d9141255-4"},"d9141255-7":{"renderedLength":1028,"gzipLength":293,"brotliLength":249,"metaUid":"d9141255-6"},"d9141255-9":{"renderedLength":1484,"gzipLength":395,"brotliLength":345,"metaUid":"d9141255-8"},"d9141255-11":{"renderedLength":854,"gzipLength":308,"brotliLength":274,"metaUid":"d9141255-10"},"d9141255-13":{"renderedLength":2645,"gzipLength":700,"brotliLength":620,"metaUid":"d9141255-12"},"d9141255-15":{"renderedLength":2774,"gzipLength":852,"brotliLength":740,"metaUid":"d9141255-14"},"d9141255-17":{"renderedLength":2675,"gzipLength":668,"brotliLength":633,"metaUid":"d9141255-16"},"d9141255-19":{"renderedLength":2356,"gzipLength":571,"brotliLength":491,"metaUid":"d9141255-18"},"d9141255-21":{"renderedLength":25597,"gzipLength":6558,"brotliLength":5784,"metaUid":"d9141255-20"},"d9141255-23":{"renderedLength":5139,"gzipLength":1153,"brotliLength":1063,"metaUid":"d9141255-22"},"d9141255-25":{"renderedLength":383,"gzipLength":251,"brotliLength":209,"metaUid":"d9141255-24"},"d9141255-27":{"renderedLength":8922,"gzipLength":2406,"brotliLength":2137,"metaUid":"d9141255-26"},"d9141255-29":{"renderedLength":1366,"gzipLength":442,"brotliLength":408,"metaUid":"d9141255-28"},"d9141255-31":{"renderedLength":7048,"gzipLength":1843,"brotliLength":1639,"metaUid":"d9141255-30"},"d9141255-33":{"renderedLength":949,"gzipLength":361,"brotliLength":320,"metaUid":"d9141255-32"},"d9141255-35":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"d9141255-34"}},"nodeMetas":{"d9141255-0":{"id":"D:/a/1/s/packages/reactjs/node_modules/zustand/esm/vanilla.mjs","moduleParts":{"index.js":"d9141255-1"},"imported":[],"importedBy":[{"uid":"d9141255-40"},{"uid":"d9141255-2"}]},"d9141255-2":{"id":"D:/a/1/s/packages/reactjs/node_modules/zustand/esm/react.mjs","moduleParts":{"index.js":"d9141255-3"},"imported":[{"uid":"d9141255-38"},{"uid":"d9141255-0"}],"importedBy":[{"uid":"d9141255-40"}]},"d9141255-4":{"id":"D:/a/1/s/packages/reactjs/src/contexts/characterStore.ts","moduleParts":{"index.js":"d9141255-5"},"imported":[{"uid":"d9141255-40"},{"uid":"d9141255-36"}],"importedBy":[{"uid":"d9141255-34"},{"uid":"d9141255-30"},{"uid":"d9141255-16"},{"uid":"d9141255-8"},{"uid":"d9141255-32"},{"uid":"d9141255-10"},{"uid":"d9141255-28"},{"uid":"d9141255-22"}]},"d9141255-6":{"id":"D:/a/1/s/packages/reactjs/src/contexts/cameraStore.ts","moduleParts":{"index.js":"d9141255-7"},"imported":[{"uid":"d9141255-40"},{"uid":"d9141255-37"}],"importedBy":[{"uid":"d9141255-34"},{"uid":"d9141255-30"},{"uid":"d9141255-8"},{"uid":"d9141255-26"},{"uid":"d9141255-28"}]},"d9141255-8":{"id":"D:/a/1/s/packages/reactjs/src/contexts/headStore.ts","moduleParts":{"index.js":"d9141255-9"},"imported":[{"uid":"d9141255-40"},{"uid":"d9141255-4"},{"uid":"d9141255-6"}],"importedBy":[{"uid":"d9141255-34"},{"uid":"d9141255-30"},{"uid":"d9141255-26"},{"uid":"d9141255-28"}]},"d9141255-10":{"id":"D:/a/1/s/packages/reactjs/src/contexts/animationStore.ts","moduleParts":{"index.js":"d9141255-11"},"imported":[{"uid":"d9141255-40"},{"uid":"d9141255-4"}],"importedBy":[{"uid":"d9141255-34"},{"uid":"d9141255-30"}]},"d9141255-12":{"id":"D:/a/1/s/packages/reactjs/src/models/enums.ts","moduleParts":{"index.js":"d9141255-13"},"imported":[],"importedBy":[{"uid":"d9141255-34"},{"uid":"d9141255-30"},{"uid":"d9141255-32"},{"uid":"d9141255-14"},{"uid":"d9141255-18"}]},"d9141255-14":{"id":"D:/a/1/s/packages/reactjs/src/models/constants.ts","moduleParts":{"index.js":"d9141255-15"},"imported":[{"uid":"d9141255-12"}],"importedBy":[{"uid":"d9141255-34"},{"uid":"d9141255-16"},{"uid":"d9141255-22"}]},"d9141255-16":{"id":"D:/a/1/s/packages/reactjs/src/contexts/speechStore.ts","moduleParts":{"index.js":"d9141255-17"},"imported":[{"uid":"d9141255-40"},{"uid":"d9141255-4"},{"uid":"d9141255-14"}],"importedBy":[{"uid":"d9141255-34"},{"uid":"d9141255-30"},{"uid":"d9141255-22"}]},"d9141255-18":{"id":"D:/a/1/s/packages/reactjs/src/utils/getCameraPositionVector.ts","moduleParts":{"index.js":"d9141255-19"},"imported":[{"uid":"d9141255-37"},{"uid":"d9141255-12"}],"importedBy":[{"uid":"d9141255-30"}]},"d9141255-20":{"id":"D:/a/1/s/packages/reactjs/src/components/PostProcessing/PMJTAANode.js","moduleParts":{"index.js":"d9141255-21"},"imported":[{"uid":"d9141255-37"},{"uid":"d9141255-41"}],"importedBy":[{"uid":"d9141255-26"}]},"d9141255-22":{"id":"D:/a/1/s/packages/reactjs/src/components/SpeechManager.tsx","moduleParts":{"index.js":"d9141255-23"},"imported":[{"uid":"d9141255-38"},{"uid":"d9141255-16"},{"uid":"d9141255-4"},{"uid":"d9141255-44"},{"uid":"d9141255-14"},{"uid":"d9141255-36"}],"importedBy":[{"uid":"d9141255-26"}]},"d9141255-24":{"id":"D:/a/1/s/packages/reactjs/src/components/HorizontalLine.tsx","moduleParts":{"index.js":"d9141255-25"},"imported":[{"uid":"d9141255-38"},{"uid":"d9141255-37"}],"importedBy":[{"uid":"d9141255-26"}]},"d9141255-26":{"id":"D:/a/1/s/packages/reactjs/src/components/Scene.tsx","moduleParts":{"index.js":"d9141255-27"},"imported":[{"uid":"d9141255-38"},{"uid":"d9141255-37"},{"uid":"d9141255-41"},{"uid":"d9141255-20"},{"uid":"d9141255-42"},{"uid":"d9141255-39"},{"uid":"d9141255-43"},{"uid":"d9141255-6"},{"uid":"d9141255-8"},{"uid":"d9141255-22"},{"uid":"d9141255-24"}],"importedBy":[{"uid":"d9141255-30"}]},"d9141255-28":{"id":"D:/a/1/s/packages/reactjs/src/components/Controllers/CharacterController.ts","moduleParts":{"index.js":"d9141255-29"},"imported":[{"uid":"d9141255-38"},{"uid":"d9141255-4"},{"uid":"d9141255-36"},{"uid":"d9141255-43"},{"uid":"d9141255-8"},{"uid":"d9141255-6"}],"importedBy":[{"uid":"d9141255-30"}]},"d9141255-30":{"id":"D:/a/1/s/packages/reactjs/src/components/Character.tsx","moduleParts":{"index.js":"d9141255-31"},"imported":[{"uid":"d9141255-38"},{"uid":"d9141255-37"},{"uid":"d9141255-36"},{"uid":"d9141255-39"},{"uid":"d9141255-8"},{"uid":"d9141255-4"},{"uid":"d9141255-10"},{"uid":"d9141255-6"},{"uid":"d9141255-16"},{"uid":"d9141255-12"},{"uid":"d9141255-18"},{"uid":"d9141255-26"},{"uid":"d9141255-28"}],"importedBy":[{"uid":"d9141255-34"}]},"d9141255-32":{"id":"D:/a/1/s/packages/reactjs/src/contexts/emotionStore.ts","moduleParts":{"index.js":"d9141255-33"},"imported":[{"uid":"d9141255-40"},{"uid":"d9141255-12"},{"uid":"d9141255-4"}],"importedBy":[{"uid":"d9141255-34"}]},"d9141255-34":{"id":"D:/a/1/s/packages/reactjs/src/index.ts","moduleParts":{"index.js":"d9141255-35"},"imported":[{"uid":"d9141255-30"},{"uid":"d9141255-4"},{"uid":"d9141255-16"},{"uid":"d9141255-6"},{"uid":"d9141255-8"},{"uid":"d9141255-32"},{"uid":"d9141255-10"},{"uid":"d9141255-36"},{"uid":"d9141255-12"},{"uid":"d9141255-14"},{"uid":"d9141255-37"}],"importedBy":[],"isEntry":true},"d9141255-36":{"id":"@davi-ai/bodyengine-three","moduleParts":{},"imported":[],"importedBy":[{"uid":"d9141255-34"},{"uid":"d9141255-30"},{"uid":"d9141255-4"},{"uid":"d9141255-28"},{"uid":"d9141255-22"}],"isExternal":true},"d9141255-37":{"id":"three/webgpu","moduleParts":{},"imported":[],"importedBy":[{"uid":"d9141255-34"},{"uid":"d9141255-30"},{"uid":"d9141255-6"},{"uid":"d9141255-18"},{"uid":"d9141255-26"},{"uid":"d9141255-20"},{"uid":"d9141255-24"}],"isExternal":true},"d9141255-38":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"d9141255-30"},{"uid":"d9141255-26"},{"uid":"d9141255-28"},{"uid":"d9141255-22"},{"uid":"d9141255-24"},{"uid":"d9141255-2"}],"isExternal":true},"d9141255-39":{"id":"@react-three/drei","moduleParts":{},"imported":[],"importedBy":[{"uid":"d9141255-30"},{"uid":"d9141255-26"}],"isExternal":true},"d9141255-40":{"id":"D:/a/1/s/packages/reactjs/node_modules/zustand/esm/index.mjs","moduleParts":{},"imported":[{"uid":"d9141255-0"},{"uid":"d9141255-2"}],"importedBy":[{"uid":"d9141255-4"},{"uid":"d9141255-16"},{"uid":"d9141255-6"},{"uid":"d9141255-8"},{"uid":"d9141255-32"},{"uid":"d9141255-10"}]},"d9141255-41":{"id":"three/tsl","moduleParts":{},"imported":[],"importedBy":[{"uid":"d9141255-26"},{"uid":"d9141255-20"}],"isExternal":true},"d9141255-42":{"id":"three/addons/tsl/display/SSGINode.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d9141255-26"}],"isExternal":true},"d9141255-43":{"id":"@react-three/fiber","moduleParts":{},"imported":[],"importedBy":[{"uid":"d9141255-26"},{"uid":"d9141255-28"}],"isExternal":true},"d9141255-44":{"id":"@davi-ai/web-speech-cognitive-services-davi","moduleParts":{},"imported":[],"importedBy":[{"uid":"d9141255-22"}],"isExternal":true}},"env":{"rollup":"4.61.0"},"options":{"gzip":true,"brotli":true,"sourcemap":false}};
|
|
4933
4933
|
|
|
4934
4934
|
const run = () => {
|
|
4935
4935
|
const width = window.innerWidth;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@davi-ai/react-bodyengine-three",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.19",
|
|
4
4
|
"description": "Reactjs layer to use animations in a threejs environment",
|
|
5
5
|
"author": "DAVI",
|
|
6
6
|
"licence": "MIT",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"build": "vite build"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@davi-ai/bodyengine-three": "1.0.
|
|
25
|
+
"@davi-ai/bodyengine-three": "1.0.14",
|
|
26
26
|
"@react-three/drei": "^10.0.0",
|
|
27
27
|
"@react-three/fiber": "^9.0.0",
|
|
28
28
|
"@types/three": "^0.184.0",
|