@davi-ai/react-bodyengine-three 1.0.33 → 1.0.34

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 CHANGED
@@ -1,21 +1,21 @@
1
- import D, { useState as te, useMemo as it, useEffect as j, useRef as Te, useCallback as $t, Suspense as Qt } from "react";
1
+ import D, { useState as ee, useMemo as it, useEffect as q, useRef as Pe, useCallback as $t, Suspense as Qt } from "react";
2
2
  import * as B from "three/webgpu";
3
- import { Vector3 as Bt, TempNode as He, NodeUpdateType as Xt, Vector2 as ve, RenderTarget as st, DepthTexture as pt, HalfFloatType as gt, NodeMaterial as Dt, NoBlending as Jt, Matrix4 as xe, RendererUtils as Ue, QuadMesh as zt, FloatType as es, UnsignedByteType as ft, RedFormat as ts, UnsignedInt101111Type as ss, RGBFormat as ns, MathUtils as os, DataTexture as as, RepeatWrapping as yt } from "three/webgpu";
3
+ import { Vector3 as Bt, TempNode as He, NodeUpdateType as Xt, Vector2 as Te, RenderTarget as st, DepthTexture as pt, HalfFloatType as gt, NodeMaterial as Dt, NoBlending as Jt, Matrix4 as xe, RendererUtils as Ue, QuadMesh as zt, FloatType as es, UnsignedByteType as ft, RedFormat as ts, UnsignedInt101111Type as ss, RGBFormat as ns, MathUtils as os, DataTexture as as, RepeatWrapping as yt } from "three/webgpu";
4
4
  import { Object3D as Co } from "three/webgpu";
5
5
  import { CharacterState as de, surfaceId as rs, surfaceMask as We, SURFACE as Ke, CreationTool as Se, AvaturnLoader as is, AvatarSDKLoader as cs, CC3Loader as ls, Character as Ye } from "@davi-ai/bodyengine-three";
6
6
  import { CharacterState as Mo, CreationTool as _o, bmlTags as ko, emotionList as Po } from "@davi-ai/bodyengine-three";
7
7
  import { useDetectGPU as ds, PerformanceMonitor as us, PerspectiveCamera as hs, CameraControls as ms, Environment as ps } from "@react-three/drei";
8
- import { convertToTexture as qe, uniform as I, passTexture as ze, texture as Fe, OnBeforeRenderPipeline as gs, OnAfterRenderPipeline as fs, velocity as ct, struct as ys, Fn as Q, float as C, vec2 as K, If as he, vec4 as J, max as q, vec3 as ae, ivec2 as ke, luminance as Ae, add as xs, uv as Re, mix as Pe, logarithmicDepthToViewZ as Ft, viewZToPerspectiveDepth as nt, getViewPosition as Ie, viewZToOrthographicDepth as Ss, NodeUpdateType as Ot, reference as je, uint as oe, sub as bs, abs as pe, HALF_PI as Ze, sqrt as Et, PI as fe, Loop as Oe, pow as Ge, mul as $e, Break as Ts, normalize as be, dot as ie, clamp as _e, div as vs, ceil as As, shiftRight as ws, countOneBits as xt, sign as St, property as Ee, outputStruct as Cs, screenCoordinate as bt, interleavedGradientNoise as Ns, fract as Ms, rand as _s, cos as ot, sin as at, cross as Tt, acos as ks, bool as vt, getNormalFromDepth as Lt, nodeObject as rt, uniformArray as Ps, textureSize as Vs, mat2 as Is, int as At, min as ce, pass as Ut, mrt as jt, diffuseColor as Rs, output as Gt, packNormalToRGB as Bs, normalView as Ds, sample as zs, unpackRGBToNormal as Fs, exp as Os, perspectiveDepthToViewZ as Es } from "three/tsl";
8
+ import { convertToTexture as qe, uniform as I, passTexture as ze, texture as Fe, OnBeforeRenderPipeline as gs, OnAfterRenderPipeline as fs, velocity as ct, struct as ys, Fn as Q, float as w, vec2 as Y, If as he, vec4 as J, max as W, vec3 as ae, ivec2 as _e, luminance as ve, add as xs, uv as Re, mix as ke, logarithmicDepthToViewZ as Ft, viewZToPerspectiveDepth as nt, getViewPosition as Ie, viewZToOrthographicDepth as Ss, NodeUpdateType as Ot, reference as je, uint as oe, sub as bs, abs as pe, HALF_PI as Ze, sqrt as Et, PI as fe, Loop as Oe, pow as Ge, mul as $e, Break as Ts, normalize as be, dot as ie, clamp as Me, div as vs, ceil as As, shiftRight as ws, countOneBits as xt, sign as St, property as Ee, outputStruct as Cs, screenCoordinate as bt, interleavedGradientNoise as Ns, fract as Ms, rand as _s, cos as ot, sin as at, cross as Tt, acos as ks, bool as vt, getNormalFromDepth as Lt, nodeObject as rt, uniformArray as Ps, textureSize as Vs, mat2 as Is, int as At, min as ce, pass as Ut, mrt as jt, diffuseColor as Rs, output as Gt, packNormalToRGB as Bs, normalView as Ds, sample as zs, unpackRGBToNormal as Fs, exp as Os, perspectiveDepthToViewZ as Es } from "three/tsl";
9
9
  import { SimplexNoise as Ls } from "three/examples/jsm/math/SimplexNoise.js";
10
10
  import { Canvas as Us, useThree as js, useFrame as Ht } from "@react-three/fiber";
11
11
  import { createSpeechSynthesisPonyfill as Gs, SpeechSynthesisUtterance as Hs } from "@davi-ai/web-speech-cognitive-services-davi";
12
12
  const wt = (e) => {
13
13
  let t;
14
- const s = /* @__PURE__ */ new Set(), a = (v, S) => {
14
+ const s = /* @__PURE__ */ new Set(), a = (v, x) => {
15
15
  const V = typeof v == "function" ? v(t) : v;
16
16
  if (!Object.is(V, t)) {
17
17
  const m = t;
18
- t = S ?? (typeof V != "object" || V === null) ? V : Object.assign({}, t, V), s.forEach((k) => k(t, m));
18
+ t = x ?? (typeof V != "object" || V === null) ? V : Object.assign({}, t, V), s.forEach((k) => k(t, m));
19
19
  }
20
20
  }, r = () => t, f = { setState: a, getState: r, getInitialState: () => T, subscribe: (v) => (s.add(v), () => s.delete(v)) }, T = t = e(a, r, f);
21
21
  return f;
@@ -31,7 +31,7 @@ function Ks(e, t = Ws) {
31
31
  const Ys = (e) => {
32
32
  const t = qs(e), s = (a) => Ks(t, a);
33
33
  return Object.assign(s, t), s;
34
- }, Ce = (e) => Ys, O = Ce()(() => ({
34
+ }, we = (e) => Ys, O = we()(() => ({
35
35
  character: null,
36
36
  managers: [],
37
37
  globalManager: null,
@@ -61,7 +61,7 @@ const Ys = (e) => {
61
61
  O.setState({ characterWidth: e.x }), O.setState({ characterHeight: e.y }), O.setState({ characterDepth: e.z });
62
62
  }, Jn = () => O.getState().characterHeight, Nt = (e) => {
63
63
  O.setState({ characterState: e });
64
- }, se = Ce()(() => ({
64
+ }, se = we()(() => ({
65
65
  cameraRef: null,
66
66
  cameraPosition: new Bt(0, 0, 5),
67
67
  bodyCenter: null,
@@ -83,7 +83,7 @@ const Ys = (e) => {
83
83
  se.setState({ lookAt: e });
84
84
  }, to = () => se.getState().lookAt, tn = (e) => {
85
85
  se.setState({ movable: e });
86
- }, re = Ce()(() => ({
86
+ }, re = we()(() => ({
87
87
  currentAUs: null,
88
88
  currentGaze: null,
89
89
  currentHeadPose: null,
@@ -113,19 +113,19 @@ const Ys = (e) => {
113
113
  (e = O.getState().globalManager) == null || e.releaseLookAt();
114
114
  }, ao = (e) => {
115
115
  re.setState({ showFirstTarget: e });
116
- }, we = Ce()(() => ({
116
+ }, Ae = we()(() => ({
117
117
  animationsNames: [],
118
118
  animations: /* @__PURE__ */ new Map(),
119
119
  currentAnimation: null,
120
120
  autoPlay: !0
121
121
  })), an = (e) => {
122
- we.setState({ animationsNames: e });
122
+ Ae.setState({ animationsNames: e });
123
123
  }, rn = (e) => {
124
- we.setState({ animations: e });
125
- }, ro = () => we.getState().animations, io = (e) => {
126
- we.setState({ autoPlay: e });
124
+ Ae.setState({ animations: e });
125
+ }, ro = () => Ae.getState().animations, io = (e) => {
126
+ Ae.setState({ autoPlay: e });
127
127
  }, co = (e) => {
128
- if (we.setState({ autoPlay: !1 }), we.getState().animationsNames.includes(e)) {
128
+ if (Ae.setState({ autoPlay: !1 }), Ae.getState().animationsNames.includes(e)) {
129
129
  const s = O.getState().animationManager;
130
130
  s == null || s.playAnimation(e);
131
131
  }
@@ -285,7 +285,7 @@ const kt = /* @__PURE__ */ new Map([
285
285
  belly: gn,
286
286
  knees: fn,
287
287
  feet: yn
288
- }, z = Ce()(() => ({
288
+ }, z = we()(() => ({
289
289
  credentials: void 0,
290
290
  currentUtterance: null,
291
291
  boundaries: [],
@@ -350,8 +350,8 @@ const kt = /* @__PURE__ */ new Map([
350
350
  let a = s[e.position || $.eye].getComponent(0);
351
351
  const r = s[e.position || $.mouth].getComponent(1);
352
352
  let o = 0;
353
- const d = typeof e.distance == "string" ? parseInt(e.distance) : e.distance, f = typeof e.rotation == "string" ? parseInt(e.rotation) : e.rotation;
354
- switch (d) {
353
+ const l = typeof e.distance == "string" ? parseInt(e.distance) : e.distance, f = typeof e.rotation == "string" ? parseInt(e.rotation) : e.rotation;
354
+ switch (l) {
355
355
  case X.veryclose:
356
356
  o = t.veryclose;
357
357
  break;
@@ -414,7 +414,7 @@ const kt = /* @__PURE__ */ new Map([
414
414
  break;
415
415
  }
416
416
  return new B.Vector3(a, r, o);
417
- }, Xe = /* @__PURE__ */ new zt(), Vt = /* @__PURE__ */ new ve();
417
+ }, Xe = /* @__PURE__ */ new zt(), Vt = /* @__PURE__ */ new Te();
418
418
  let Je;
419
419
  class Cn extends He {
420
420
  static get type() {
@@ -429,7 +429,7 @@ class Cn extends He {
429
429
  * @param {Camera} camera - The camera the scene is rendered with.
430
430
  */
431
431
  constructor(t, s, a, r) {
432
- super("vec4"), this.isTRAANode = !0, this.updateBeforeType = Xt.FRAME, this.beautyNode = t, this.depthNode = s, this.velocityNode = a, this.camera = r, this.depthThreshold = 5e-4, this.edgeDepthDiff = 1e-3, this.maxVelocityLength = 32, this.useSubpixelCorrection = !0, this._jitterIndex = 0, this._invSize = I(new ve()), this._historyRenderTarget = new st(1, 1, { depthBuffer: !1, type: gt, depthTexture: new pt() }), this._historyRenderTarget.texture.name = "TRAANode.history", this._resolveRenderTarget = new st(1, 1, { depthBuffer: !1, type: gt }), this._resolveRenderTarget.texture.name = "TRAANode.resolve", this._resolveMaterial = new Dt(), this._resolveMaterial.name = "TRAA.resolve", this._resolveMaterial.blending = Jt, this._textureNode = ze(this, this._resolveRenderTarget.texture), this._originalProjectionMatrix = new xe(), this._cameraNearFar = I(new ve()), this._cameraWorldMatrix = I(new xe()), this._cameraWorldMatrixInverse = I(new xe()), this._cameraProjectionMatrixInverse = I(new xe()), this._previousCameraWorldMatrix = I(new xe()), this._previousCameraProjectionMatrixInverse = I(new xe()), this._previousDepthNode = Fe(new pt(1, 1)), this._needsPostProcessingSync = !1, this._velocityNode = null;
432
+ super("vec4"), this.isTRAANode = !0, this.updateBeforeType = Xt.FRAME, this.beautyNode = t, this.depthNode = s, this.velocityNode = a, this.camera = r, this.depthThreshold = 5e-4, this.edgeDepthDiff = 1e-3, this.maxVelocityLength = 32, this.useSubpixelCorrection = !0, this._jitterIndex = 0, this._invSize = I(new Te()), this._historyRenderTarget = new st(1, 1, { depthBuffer: !1, type: gt, depthTexture: new pt() }), this._historyRenderTarget.texture.name = "TRAANode.history", this._resolveRenderTarget = new st(1, 1, { depthBuffer: !1, type: gt }), this._resolveRenderTarget.texture.name = "TRAANode.resolve", this._resolveMaterial = new Dt(), this._resolveMaterial.name = "TRAA.resolve", this._resolveMaterial.blending = Jt, this._textureNode = ze(this, this._resolveRenderTarget.texture), this._originalProjectionMatrix = new xe(), this._cameraNearFar = I(new Te()), this._cameraWorldMatrix = I(new xe()), this._cameraWorldMatrixInverse = I(new xe()), this._cameraProjectionMatrixInverse = I(new xe()), this._previousCameraWorldMatrix = I(new xe()), this._previousCameraProjectionMatrixInverse = I(new xe()), this._previousDepthNode = Fe(new pt(1, 1)), this._needsPostProcessingSync = !1, this._velocityNode = null;
433
433
  }
434
434
  /**
435
435
  * Returns the result of the effect as a texture node.
@@ -504,8 +504,8 @@ class Cn extends He {
504
504
  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);
505
505
  const a = this.beautyNode.isRTTNode ? this.beautyNode.renderTarget : this.beautyNode.passNode.renderTarget, r = a.texture.width, o = a.texture.height;
506
506
  this._needsPostProcessingSync === !0 && (this.setViewOffset(r, o), this._needsPostProcessingSync = !1), Je = Ue.resetRendererState(s, Je);
507
- const d = this._historyRenderTarget.width !== r || this._historyRenderTarget.height !== o;
508
- this.setSize(r, o), d === !0 && (s.initRenderTarget(this._historyRenderTarget), s.initRenderTarget(this._resolveRenderTarget), s.copyTextureToTexture(a.texture, this._historyRenderTarget.texture)), s.setClearColor(16777215, 0), s.setRenderTarget(this._resolveRenderTarget), Xe.material = this._resolveMaterial, Xe.name = "TRAA", Xe.render(s), s.setRenderTarget(null), s.copyTextureToTexture(this._resolveRenderTarget.texture, this._historyRenderTarget.texture);
507
+ const l = this._historyRenderTarget.width !== r || this._historyRenderTarget.height !== o;
508
+ this.setSize(r, o), l === !0 && (s.initRenderTarget(this._historyRenderTarget), s.initRenderTarget(this._resolveRenderTarget), s.copyTextureToTexture(a.texture, this._historyRenderTarget.texture)), s.setClearColor(16777215, 0), s.setRenderTarget(this._resolveRenderTarget), Xe.material = this._resolveMaterial, Xe.name = "TRAA", Xe.render(s), s.setRenderTarget(null), s.copyTextureToTexture(this._resolveRenderTarget.texture, this._historyRenderTarget.texture);
509
509
  const f = s.getDrawingBufferSize(Vt);
510
510
  if (this._historyRenderTarget.height === f.height && this._historyRenderTarget.width === f.width) {
511
511
  const T = this.depthNode.value;
@@ -521,40 +521,40 @@ class Cn extends He {
521
521
  */
522
522
  setup(t) {
523
523
  t.renderPipeline && !t.context.renderPipelineState.viewOffsetOwner && (t.context.renderPipelineState.viewOffsetOwner = this, this._needsPostProcessingSync = !0, gs(() => {
524
- const u = t.renderer.getDrawingBufferSize(Vt);
525
- this.setViewOffset(u.width, u.height);
524
+ const d = t.renderer.getDrawingBufferSize(Vt);
525
+ this.setViewOffset(d.width, d.height);
526
526
  }), fs(() => {
527
527
  this.clearViewOffset();
528
528
  })), t.renderer.reversedDepthBuffer === !0 && (this._historyRenderTarget.depthTexture.type = es), t.context.velocity !== void 0 ? this._velocityNode = t.context.velocity : this._velocityNode = ct;
529
- const s = (u) => {
530
- const { x: g, y: i } = this._cameraNearFar, n = Ft(u, g, i);
531
- return nt(n, g, i);
529
+ const s = (d) => {
530
+ const { x: g, y: c } = this._cameraNearFar, n = Ft(d, g, c);
531
+ return nt(n, g, c);
532
532
  }, a = ys({
533
533
  closestDepth: "float",
534
534
  closestPositionTexel: "vec2",
535
535
  farthestDepth: "float"
536
- }), r = Q(([u]) => {
537
- const g = C(2).toVar(), i = K(0).toVar(), n = C(-1).toVar();
538
- for (let c = -1; c <= 1; ++c)
539
- for (let h = -1; h <= 1; ++h) {
540
- const y = u.add(K(c, h)).toVar();
541
- let p = this.depthNode.load(y).r;
542
- t.renderer.reversedDepthBuffer && (p = p.oneMinus()), t.renderer.logarithmicDepthBuffer && (p = s(p)), p = p.toVar(), he(p.lessThan(g), () => {
543
- g.assign(p), i.assign(y);
544
- }), he(p.greaterThan(n), () => {
545
- n.assign(p);
536
+ }), r = Q(([d]) => {
537
+ const g = w(2).toVar(), c = Y(0).toVar(), n = w(-1).toVar();
538
+ for (let i = -1; i <= 1; ++i)
539
+ for (let p = -1; p <= 1; ++p) {
540
+ const y = d.add(Y(i, p)).toVar();
541
+ let h = this.depthNode.load(y).r;
542
+ t.renderer.reversedDepthBuffer && (h = h.oneMinus()), t.renderer.logarithmicDepthBuffer && (h = s(h)), h = h.toVar(), he(h.lessThan(g), () => {
543
+ g.assign(h), c.assign(y);
544
+ }), he(h.greaterThan(n), () => {
545
+ n.assign(h);
546
546
  });
547
547
  }
548
- return a(g, i, n);
549
- }), o = (u) => {
550
- let g = this._previousDepthNode.sample(u).r;
548
+ return a(g, c, n);
549
+ }), o = (d) => {
550
+ let g = this._previousDepthNode.sample(d).r;
551
551
  t.renderer.reversedDepthBuffer && (g = g.oneMinus()), t.renderer.logarithmicDepthBuffer && (g = s(g));
552
- const i = Ie(u, g, this._previousCameraProjectionMatrixInverse), n = this._previousCameraWorldMatrix.mul(J(i, 1)).xyz, c = this._cameraWorldMatrixInverse.mul(J(n, 1)).z;
553
- return this.camera.isOrthographicCamera ? Ss(c, this._cameraNearFar.x, this._cameraNearFar.y) : nt(c, this._cameraNearFar.x, this._cameraNearFar.y);
554
- }, d = Q(([u, g, i, n]) => {
555
- const c = n.rgb.add(i.rgb).mul(0.5), h = n.rgb.sub(i.rgb).mul(0.5).add(1e-7), y = g.sub(J(c, u.a)), A = y.xyz.div(h).abs(), w = q(A.x, A.y, A.z);
556
- return w.greaterThan(1).select(
557
- J(c, u.a).add(y.div(w)),
552
+ const c = Ie(d, g, this._previousCameraProjectionMatrixInverse), n = this._previousCameraWorldMatrix.mul(J(c, 1)).xyz, i = this._cameraWorldMatrixInverse.mul(J(n, 1)).z;
553
+ return this.camera.isOrthographicCamera ? Ss(i, this._cameraNearFar.x, this._cameraNearFar.y) : nt(i, this._cameraNearFar.x, this._cameraNearFar.y);
554
+ }, l = Q(([d, g, c, n]) => {
555
+ const i = n.rgb.add(c.rgb).mul(0.5), p = n.rgb.sub(c.rgb).mul(0.5).add(1e-7), y = g.sub(J(i, d.a)), A = y.xyz.div(p).abs(), C = W(A.x, A.y, A.z);
556
+ return C.greaterThan(1).select(
557
+ J(i, d.a).add(y.div(C)),
558
558
  g
559
559
  );
560
560
  }).setLayout({
@@ -566,24 +566,24 @@ class Cn extends He {
566
566
  { name: "minColor", type: "vec4" },
567
567
  { name: "maxColor", type: "vec4" }
568
568
  ]
569
- }), f = Q(([u]) => ae(
570
- u.x.mul(0.25).add(u.y.mul(0.5)).add(u.z.mul(0.25)),
571
- u.x.mul(0.5).sub(u.z.mul(0.5)),
572
- u.x.mul(-0.25).add(u.y.mul(0.5)).sub(u.z.mul(0.25))
569
+ }), f = Q(([d]) => ae(
570
+ d.x.mul(0.25).add(d.y.mul(0.5)).add(d.z.mul(0.25)),
571
+ d.x.mul(0.5).sub(d.z.mul(0.5)),
572
+ d.x.mul(-0.25).add(d.y.mul(0.5)).sub(d.z.mul(0.25))
573
573
  )).setLayout({
574
574
  name: "RGBToYCoCg",
575
575
  type: "vec3",
576
576
  inputs: [{ name: "c", type: "vec3" }]
577
- }), T = Q(([u]) => ae(
578
- u.x.add(u.y).sub(u.z),
579
- u.x.add(u.z),
580
- u.x.sub(u.y).sub(u.z)
577
+ }), T = Q(([d]) => ae(
578
+ d.x.add(d.y).sub(d.z),
579
+ d.x.add(d.z),
580
+ d.x.sub(d.y).sub(d.z)
581
581
  )).setLayout({
582
582
  name: "YCoCgToRGB",
583
583
  type: "vec3",
584
584
  inputs: [{ name: "c", type: "vec3" }]
585
- }), v = Q(([u, g, i, n]) => {
586
- const c = [
585
+ }), v = Q(([d, g, c, n]) => {
586
+ const i = [
587
587
  [-1, -1],
588
588
  [-1, 1],
589
589
  [1, -1],
@@ -592,16 +592,16 @@ class Cn extends He {
592
592
  [0, -1],
593
593
  [0, 1],
594
594
  [-1, 0]
595
- ], h = J(f(g.rgb), g.a).toVar(), y = J(f(i.rgb), i.a).toVar(), p = h.toVar(), A = h.pow2().toVar();
596
- for (const [Z, G] of c) {
597
- const E = this.beautyNode.offset(ke(Z, G)).load(u).max(0), U = J(f(E.rgb), E.a).toVar();
598
- p.addAssign(U), A.addAssign(U.pow2());
595
+ ], p = J(f(g.rgb), g.a).toVar(), y = J(f(c.rgb), c.a).toVar(), h = p.toVar(), A = p.pow2().toVar();
596
+ for (const [j, G] of i) {
597
+ const E = this.beautyNode.offset(_e(j, G)).load(d).max(0), U = J(f(E.rgb), E.a).toVar();
598
+ h.addAssign(U), A.addAssign(U.pow2());
599
599
  }
600
- const w = C(c.length + 1), l = p.div(w), b = A.div(w).sub(l.pow2()).max(0).sqrt().mul(n), M = l.sub(b), _ = l.add(b), x = d(l.clamp(M, _), y, M, _);
601
- return J(T(x.rgb), x.a);
602
- }), S = Q(([u, g]) => {
603
- const n = u.mul(g).fract().abs(), c = q(n, n.oneMinus());
604
- return c.x.mul(c.y).oneMinus().div(0.75);
600
+ const C = w(i.length + 1), N = h.div(C), u = A.div(C).sub(N.pow2()).max(0).sqrt().mul(n), S = N.sub(u), M = N.add(u), b = l(N.clamp(S, M), y, S, M);
601
+ return J(T(b.rgb), b.a);
602
+ }), x = Q(([d, g]) => {
603
+ const n = d.mul(g).fract().abs(), i = W(n, n.oneMinus());
604
+ return i.x.mul(i.y).oneMinus().div(0.75);
605
605
  }).setLayout({
606
606
  name: "subpixelCorrection",
607
607
  type: "float",
@@ -609,17 +609,17 @@ class Cn extends He {
609
609
  { name: "velocityUV", type: "vec2" },
610
610
  { name: "textureSize", type: "ivec2" }
611
611
  ]
612
- }), V = Q(([u, g, i]) => {
613
- const n = i.oneMinus(), c = u.mul(C(1).div(q(u.r, u.g, u.b).add(1))), h = g.mul(C(1).div(q(g.r, g.g, g.b).add(1))), y = Ae(c.rgb), p = Ae(h.rgb);
614
- return i.mulAssign(C(1).div(y.add(1))), n.mulAssign(C(1).div(p.add(1))), xs(u.mul(i), g.mul(n)).div(q(i.add(n), 1e-5)).toVar();
615
- }), m = Fe(this._historyRenderTarget.texture), k = Q(([u, g]) => {
616
- const i = u.mul(g), n = i.sub(0.5).floor().add(0.5).toVar(), c = i.sub(n).toVar(), h = c.mul(c.mul(c.mul(-0.5).add(1)).sub(0.5)).toVar(), y = c.pow2().mul(c.mul(1.5).sub(2.5)).add(1).toVar(), p = c.mul(c.mul(c.mul(-1.5).add(2)).add(0.5)).toVar(), A = c.pow2().mul(c.mul(0.5).sub(0.5)).toVar(), w = y.add(p).toVar(), l = p.div(w).toVar(), b = n.sub(1).mul(this._invSize).toVar(), M = n.add(2).mul(this._invSize).toVar(), _ = n.add(l).mul(this._invSize).toVar();
617
- return m.sample(K(b.x, b.y)).mul(h.x.mul(h.y)).add(m.sample(K(_.x, b.y)).mul(w.x.mul(h.y))).add(m.sample(K(M.x, b.y)).mul(A.x.mul(h.y))).add(m.sample(K(b.x, _.y)).mul(h.x.mul(w.y))).add(m.sample(K(_.x, _.y)).mul(w.x.mul(w.y))).add(m.sample(K(M.x, _.y)).mul(A.x.mul(w.y))).add(m.sample(K(b.x, M.y)).mul(h.x.mul(A.y))).add(m.sample(K(_.x, M.y)).mul(w.x.mul(A.y))).add(m.sample(K(M.x, M.y)).mul(A.x.mul(A.y))).max(0);
612
+ }), V = Q(([d, g, c]) => {
613
+ const n = c.oneMinus(), i = d.mul(w(1).div(W(d.r, d.g, d.b).add(1))), p = g.mul(w(1).div(W(g.r, g.g, g.b).add(1))), y = ve(i.rgb), h = ve(p.rgb);
614
+ return c.mulAssign(w(1).div(y.add(1))), n.mulAssign(w(1).div(h.add(1))), xs(d.mul(c), g.mul(n)).div(W(c.add(n), 1e-5)).toVar();
615
+ }), m = Fe(this._historyRenderTarget.texture), k = Q(([d, g]) => {
616
+ const c = d.mul(g), n = c.sub(0.5).floor().add(0.5).toVar(), i = c.sub(n).toVar(), p = i.mul(i.mul(i.mul(-0.5).add(1)).sub(0.5)).toVar(), y = i.pow2().mul(i.mul(1.5).sub(2.5)).add(1).toVar(), h = i.mul(i.mul(i.mul(-1.5).add(2)).add(0.5)).toVar(), A = i.pow2().mul(i.mul(0.5).sub(0.5)).toVar(), C = y.add(h).toVar(), N = h.div(C).toVar(), u = n.sub(1).mul(this._invSize).toVar(), S = n.add(2).mul(this._invSize).toVar(), M = n.add(N).mul(this._invSize).toVar();
617
+ return m.sample(Y(u.x, u.y)).mul(p.x.mul(p.y)).add(m.sample(Y(M.x, u.y)).mul(C.x.mul(p.y))).add(m.sample(Y(S.x, u.y)).mul(A.x.mul(p.y))).add(m.sample(Y(u.x, M.y)).mul(p.x.mul(C.y))).add(m.sample(Y(M.x, M.y)).mul(C.x.mul(C.y))).add(m.sample(Y(S.x, M.y)).mul(A.x.mul(C.y))).add(m.sample(Y(u.x, S.y)).mul(p.x.mul(A.y))).add(m.sample(Y(M.x, S.y)).mul(C.x.mul(A.y))).add(m.sample(Y(S.x, S.y)).mul(A.x.mul(A.y))).max(0);
618
618
  }), R = Q(() => {
619
- const u = Re(), g = this.beautyNode.size(), i = u.mul(g), n = r(i), c = n.get("closestDepth"), h = n.get("closestPositionTexel"), y = n.get("farthestDepth"), p = this.velocityNode.load(h).xy.mul(K(0.5, -0.5)), A = u.sub(p), w = o(A), l = A.greaterThanEqual(0).all().and(A.lessThanEqual(1).all()), b = y.sub(c).greaterThan(this.edgeDepthDiff), M = c.sub(w).greaterThan(this.depthThreshold), _ = l.and(b.or(M.not())), x = this.beautyNode.sample(u), Z = k(A, g), G = u.sub(A).mul(g).length().div(this.maxVelocityLength).saturate(), E = C(0.01).toVar();
620
- this.useSubpixelCorrection && E.addAssign(S(p, g).mul(0.2)), E.assign(_.select(E.add(G).saturate(), 1));
621
- const U = Pe(0.5, 1, G.oneMinus().pow2()), P = v(i, x, Z, U);
622
- return V(x, P, E);
619
+ const d = Re(), g = this.beautyNode.size(), c = d.mul(g), n = r(c), i = n.get("closestDepth"), p = n.get("closestPositionTexel"), y = n.get("farthestDepth"), h = this.velocityNode.load(p).xy.mul(Y(0.5, -0.5)), A = d.sub(h), C = o(A), N = A.greaterThanEqual(0).all().and(A.lessThanEqual(1).all()), u = y.sub(i).greaterThan(this.edgeDepthDiff), S = i.sub(C).greaterThan(this.depthThreshold), M = N.and(u.or(S.not())), b = this.beautyNode.sample(d), j = k(A, g), G = d.sub(A).mul(g).length().div(this.maxVelocityLength).saturate(), E = w(0.01).toVar();
620
+ this.useSubpixelCorrection && E.addAssign(x(h, g).mul(0.2)), E.assign(M.select(E.add(G).saturate(), 1));
621
+ const U = ke(0.5, 1, G.oneMinus().pow2()), P = v(c, b, j, U);
622
+ return V(b, P, E);
623
623
  });
624
624
  return this._resolveMaterial.colorNode = R(), this._textureNode;
625
625
  }
@@ -640,7 +640,7 @@ function It(e, t) {
640
640
  const Rt = /* @__PURE__ */ Array.from(
641
641
  { length: 16 },
642
642
  (e, t) => [It(t + 1, 2), It(t + 1, 3)]
643
- ), Yt = (e, t, s, a) => new Cn(qe(e), t, s, a), et = /* @__PURE__ */ new zt(), Nn = /* @__PURE__ */ new ve(), Mn = [60, 300, 180, 240, 120, 0], _n = [0, 0.5, 0.25, 0.75];
643
+ ), Yt = (e, t, s, a) => new Cn(qe(e), t, s, a), et = /* @__PURE__ */ new zt(), Nn = /* @__PURE__ */ new Te(), Mn = [60, 300, 180, 240, 120, 0], _n = [0, 0.5, 0.25, 0.75];
644
644
  let tt;
645
645
  class kn extends He {
646
646
  static get type() {
@@ -655,11 +655,11 @@ class kn extends He {
655
655
  * @param {PerspectiveCamera} camera - The camera the scene is rendered with.
656
656
  */
657
657
  constructor(t, s, a, r) {
658
- super("vec4"), this.beautyNode = t, this.depthNode = s, this.normalNode = a, this.updateBeforeType = Ot.FRAME, this.sliceCount = I(1, "uint"), this.stepCount = I(12, "uint"), this.aoIntensity = I(1, "float"), this.giIntensity = I(10, "float"), this.radius = I(12, "float"), this.useScreenSpaceSampling = I(!0, "bool"), this.expFactor = I(2, "float"), this.thickness = I(1, "float"), this.useLinearThickness = I(!1, "bool"), this.backfaceLighting = I(0, "float"), this.useTemporalFiltering = !0, this.resolutionScale = 1, this._resolution = I(new ve()), this._halfProjScale = I(1), this._temporalDirection = I(0), this._temporalOffset = I(0), this._cameraProjectionMatrix = I(r.projectionMatrix), this._cameraProjectionMatrixInverse = I(r.projectionMatrixInverse), this._cameraNear = je("near", "float", r), this._cameraFar = je("far", "float", r), this._camera = r, this._ssgiRenderTarget = new st(1, 1, { depthBuffer: !1, count: 3 });
658
+ super("vec4"), this.beautyNode = t, this.depthNode = s, this.normalNode = a, this.updateBeforeType = Ot.FRAME, this.sliceCount = I(1, "uint"), this.stepCount = I(12, "uint"), this.aoIntensity = I(1, "float"), this.giIntensity = I(10, "float"), this.radius = I(12, "float"), this.useScreenSpaceSampling = I(!0, "bool"), this.expFactor = I(2, "float"), this.thickness = I(1, "float"), this.useLinearThickness = I(!1, "bool"), this.backfaceLighting = I(0, "float"), this.useTemporalFiltering = !0, this.resolutionScale = 1, this._resolution = I(new Te()), this._halfProjScale = I(1), this._temporalDirection = I(0), this._temporalOffset = I(0), this._cameraProjectionMatrix = I(r.projectionMatrix), this._cameraProjectionMatrixInverse = I(r.projectionMatrixInverse), this._cameraNear = je("near", "float", r), this._cameraFar = je("far", "float", r), this._camera = r, this._ssgiRenderTarget = new st(1, 1, { depthBuffer: !1, count: 3 });
659
659
  const o = this._ssgiRenderTarget.textures[0];
660
660
  o.name = "SSGI.AO", o.type = ft, o.format = ts;
661
- const d = this._ssgiRenderTarget.textures[1];
662
- d.name = "SSGI.GI", d.type = ss, d.format = ns;
661
+ const l = this._ssgiRenderTarget.textures[1];
662
+ l.name = "SSGI.GI", l.type = ss, l.format = ns;
663
663
  const f = this._ssgiRenderTarget.textures[2];
664
664
  f.name = "SSGI.BentNormals", f.type = ft, this._material = new Dt(), this._material.name = "SSGI", this._aoNode = ze(this, this._ssgiRenderTarget.textures[0]), this._giNode = ze(this, this._ssgiRenderTarget.textures[1]), this._bentNormalNode = ze(this, this._ssgiRenderTarget.textures[2]);
665
665
  }
@@ -724,80 +724,80 @@ class kn extends He {
724
724
  setup(t) {
725
725
  const s = t.renderer;
726
726
  s.backend.isWebGPUBackend === !0 && s.hasFeature("rg11b10ufloat-renderable") === !1 && console.error('THREE.SSGINode: The device does not support the "rg11b10ufloat-renderable" feature which is required for SSGI.');
727
- const a = Re(), r = oe(32), o = oe(0), d = (i) => {
728
- const n = this.depthNode.sample(i).r;
727
+ const a = Re(), r = oe(32), o = oe(0), l = (c) => {
728
+ const n = this.depthNode.sample(c).r;
729
729
  if (t.renderer.logarithmicDepthBuffer === !0) {
730
- const c = Ft(n, this._cameraNear, this._cameraFar);
731
- return nt(c, this._cameraNear, this._cameraFar);
730
+ const i = Ft(n, this._cameraNear, this._cameraFar);
731
+ return nt(i, this._cameraNear, this._cameraFar);
732
732
  }
733
733
  return n;
734
- }, f = (i) => this.normalNode !== null ? this.normalNode.sample(i).rgb.normalize() : Lt(i, this.depthNode.value, this._cameraProjectionMatrixInverse), T = (i) => this.beautyNode.sample(i), v = Q(([i]) => C(0.25).mul(bs(i.y, i.x).bitAnd(3))).setLayout({
734
+ }, f = (c) => this.normalNode !== null ? this.normalNode.sample(c).rgb.normalize() : Lt(c, this.depthNode.value, this._cameraProjectionMatrixInverse), T = (c) => this.beautyNode.sample(c), v = Q(([c]) => w(0.25).mul(bs(c.y, c.x).bitAnd(3))).setLayout({
735
735
  name: "spatialOffsets",
736
736
  type: "float",
737
737
  inputs: [
738
738
  { name: "position", type: "vec2" }
739
739
  ]
740
- }), S = Q(([i]) => {
741
- const n = pe(i).mul(C(-0.156583)).add(Ze);
742
- n.mulAssign(Et(pe(i).oneMinus()));
743
- const c = i.x.greaterThanEqual(0).select(n.x, fe.sub(n.x)), h = i.y.greaterThanEqual(0).select(n.y, fe.sub(n.y));
744
- return K(c, h);
740
+ }), x = Q(([c]) => {
741
+ const n = pe(c).mul(w(-0.156583)).add(Ze);
742
+ n.mulAssign(Et(pe(c).oneMinus()));
743
+ const i = c.x.greaterThanEqual(0).select(n.x, fe.sub(n.x)), p = c.y.greaterThanEqual(0).select(n.y, fe.sub(n.y));
744
+ return Y(i, p);
745
745
  }).setLayout({
746
746
  name: "GTAOFastAcos",
747
747
  type: "vec2",
748
748
  inputs: [
749
749
  { name: "value", type: "vec2" }
750
750
  ]
751
- }), V = Q(([i, n, c, h, y, p, A, w, l, b]) => {
752
- const M = this.stepCount.toConst(), _ = this.expFactor.toConst(), x = this.thickness.toConst(), Z = this.backfaceLighting.toConst(), G = i.select(K(1, -1), K(-1, 1)), E = i.select(1, -1), U = ae(0);
753
- return Oe({ start: oe(0), end: M, type: "uint", condition: "<" }, ({ i: P }) => {
754
- const N = Ge(pe($e(n, C(P).add(p)).div(c)), _).mul(c).toConst(), L = y.mul(q(N, C(P).add(1))).toConst(), H = A.add(L.mul(G)).toConst();
751
+ }), V = Q(([c, n, i, p, y, h, A, C, N, u]) => {
752
+ const S = this.stepCount.toConst(), M = this.expFactor.toConst(), b = this.thickness.toConst(), j = this.backfaceLighting.toConst(), G = c.select(Y(1, -1), Y(-1, 1)), E = c.select(1, -1), U = ae(0);
753
+ return Oe({ start: oe(0), end: S, type: "uint", condition: "<" }, ({ i: P }) => {
754
+ const _ = Ge(pe($e(n, w(P).add(h)).div(i)), M).mul(i).toConst(), L = y.mul(W(_, w(P).add(1))).toConst(), H = A.add(L.mul(G)).toConst();
755
755
  he(H.x.lessThanEqual(0).or(H.y.lessThanEqual(0)).or(H.x.greaterThanEqual(1)).or(H.y.greaterThanEqual(1)), () => {
756
756
  Ts();
757
757
  });
758
- const ne = Ie(H, d(H), this._cameraProjectionMatrixInverse).toConst(), W = ne.sub(h).normalize().toConst(), ue = this.useLinearThickness.select(ne.z.negate().div(this._cameraFar).clamp().mul(100), C(1)), Y = be(ne.sub(ue.mul(w).mul(x)).sub(h));
759
- let F = K(ie(W, w), ie(Y, w));
760
- F = S(_e(F, -1, 1)), F = _e(vs($e(E, F.negate()).sub(b.sub(Ze)), fe)), F = i.select(F.yx, F.xy);
761
- const me = F.x.toConst(), ee = F.y.toConst(), Ne = oe(F.mul(C(r))).toConst(), Be = oe(As(ee.sub(me).mul(C(r)))).toConst();
762
- let ge = Be.greaterThan(oe(0)).select(oe(ws(oe(4294967295), oe(32).sub(r).add(r.sub(Be)))), oe(0)).toConst().shiftLeft(Ne);
758
+ const ne = Ie(H, l(H), this._cameraProjectionMatrixInverse).toConst(), K = ne.sub(p).normalize().toConst(), ue = this.useLinearThickness.select(ne.z.negate().div(this._cameraFar).clamp().mul(100), w(1)), Z = be(ne.sub(ue.mul(C).mul(b)).sub(p));
759
+ let F = Y(ie(K, C), ie(Z, C));
760
+ F = x(Me(F, -1, 1)), F = Me(vs($e(E, F.negate()).sub(u.sub(Ze)), fe)), F = c.select(F.yx, F.xy);
761
+ const me = F.x.toConst(), te = F.y.toConst(), Ce = oe(F.mul(w(r))).toConst(), Be = oe(As(te.sub(me).mul(w(r)))).toConst();
762
+ let ge = Be.greaterThan(oe(0)).select(oe(ws(oe(4294967295), oe(32).sub(r).add(r.sub(Be)))), oe(0)).toConst().shiftLeft(Ce);
763
763
  ge = ge.bitAnd(o.bitNot()), o.assign(o.bitOr(ge));
764
- const Me = xt(ge);
765
- he(Me.greaterThan(0), () => {
764
+ const Ne = xt(ge);
765
+ he(Ne.greaterThan(0), () => {
766
766
  const dt = T(H);
767
- he(Ae(dt).greaterThan(1e-3), () => {
768
- const ut = be(W), ht = _e(ie(l, ut));
767
+ he(ve(dt).greaterThan(1e-3), () => {
768
+ const ut = be(K), ht = Me(ie(N, ut));
769
769
  he(ht.greaterThan(1e-3), () => {
770
770
  const mt = f(H);
771
771
  let ye = ie(mt, ut.negate());
772
- const Zt = St(ye).lessThan(0).select(pe(ye).mul(Z), pe(ye));
773
- ye = Z.greaterThan(0).and(ie(mt, w).greaterThan(0)).select(Zt, _e(ye)), U.rgb.addAssign(C(Me).div(C(r)).mul(dt).mul(ht).mul(ye));
772
+ const Zt = St(ye).lessThan(0).select(pe(ye).mul(j), pe(ye));
773
+ ye = j.greaterThan(0).and(ie(mt, C).greaterThan(0)).select(Zt, Me(ye)), U.rgb.addAssign(w(Ne).div(w(r)).mul(dt).mul(ht).mul(ye));
774
774
  });
775
775
  });
776
776
  });
777
777
  }), U;
778
- }), m = Ee("float"), k = Ee("vec3"), R = Ee("vec4"), u = Cs(m, k, R), g = Q(() => {
779
- const i = d(a).toVar();
780
- i.greaterThanEqual(1).discard();
781
- const n = Ie(a, i, this._cameraProjectionMatrixInverse).toVar(), c = f(a).toVar(), h = be(n.xyz.negate()).toVar(), y = v(bt), p = Ns(bt), A = this._temporalDirection.mul(0.02), w = Ms(y.add(this._temporalOffset)).add(_s(a.add(A).mul(2).sub(1))), l = C(0), b = ae(0), M = ae(0), _ = this.sliceCount.toConst(), x = this.stepCount.toConst(), Z = this.aoIntensity.toConst(), G = this.giIntensity.toConst(), E = this.radius.toConst(), U = C(0).toVar();
778
+ }), m = Ee("float"), k = Ee("vec3"), R = Ee("vec4"), d = Cs(m, k, R), g = Q(() => {
779
+ const c = l(a).toVar();
780
+ c.greaterThanEqual(1).discard();
781
+ const n = Ie(a, c, this._cameraProjectionMatrixInverse).toVar(), i = f(a).toVar(), p = be(n.xyz.negate()).toVar(), y = v(bt), h = Ns(bt), A = this._temporalDirection.mul(0.02), C = Ms(y.add(this._temporalOffset)).add(_s(a.add(A).mul(2).sub(1))), N = w(0), u = ae(0), S = ae(0), M = this.sliceCount.toConst(), b = this.stepCount.toConst(), j = this.aoIntensity.toConst(), G = this.giIntensity.toConst(), E = this.radius.toConst(), U = w(0).toVar();
782
782
  he(this.useScreenSpaceSampling, () => {
783
- U.assign(E.mul(this._resolution.x.div(2)).div(C(16)));
783
+ U.assign(E.mul(this._resolution.x.div(2)).div(w(16)));
784
784
  }).Else(() => {
785
- U.assign(q(E.mul(this._halfProjScale).div(n.z.negate()), C(x)));
786
- }), U.divAssign(C(x).add(1));
787
- const P = q(1, C(x.sub(1))).mul(U).toConst();
788
- Oe({ start: oe(0), end: _, type: "uint", condition: "<" }, ({ i: ne }) => {
789
- const W = $e(C(ne).add(p).add(this._temporalDirection), fe.div(C(_))).toConst(), ue = ae(K(ot(W), at(W)), 0).toConst(), Y = ue.xy.mul(C(1).div(this._resolution)).toConst(), F = be(Tt(ue, h)).toConst(), me = Tt(h, F).toConst(), ee = c.sub(F.mul(ie(c, F))).toConst(), Ne = be(ee).toConst(), Be = _e(ie(Ne, h), -1, 1).toConst(), De = St(ie(ee, me)).negate().mul(ks(Be)).toConst();
790
- o.assign(0), b.addAssign(V(vt(!0), U, P, n, Y, w, a, h, c, De)), b.addAssign(V(vt(!1), U, P, n, Y, w, a, h, c, De)), l.addAssign(C(xt(o)).div(C(r))), Oe({ start: oe(0), end: r, type: "uint", condition: "<", name: "j" }, ({ j: ge }) => {
785
+ U.assign(W(E.mul(this._halfProjScale).div(n.z.negate()), w(b)));
786
+ }), U.divAssign(w(b).add(1));
787
+ const P = W(1, w(b.sub(1))).mul(U).toConst();
788
+ Oe({ start: oe(0), end: M, type: "uint", condition: "<" }, ({ i: ne }) => {
789
+ const K = $e(w(ne).add(h).add(this._temporalDirection), fe.div(w(M))).toConst(), ue = ae(Y(ot(K), at(K)), 0).toConst(), Z = ue.xy.mul(w(1).div(this._resolution)).toConst(), F = be(Tt(ue, p)).toConst(), me = Tt(p, F).toConst(), te = i.sub(F.mul(ie(i, F))).toConst(), Ce = be(te).toConst(), Be = Me(ie(Ce, p), -1, 1).toConst(), De = St(ie(te, me)).negate().mul(ks(Be)).toConst();
790
+ o.assign(0), u.addAssign(V(vt(!0), U, P, n, Z, C, a, p, i, De)), u.addAssign(V(vt(!1), U, P, n, Z, C, a, p, i, De)), N.addAssign(w(xt(o)).div(w(r))), Oe({ start: oe(0), end: r, type: "uint", condition: "<", name: "j" }, ({ j: ge }) => {
791
791
  he(o.shiftRight(ge).bitAnd(oe(1)).equal(oe(0)), () => {
792
- const Me = Ze.sub(De).sub(C(ge).add(0.5).div(C(r)).mul(fe));
793
- M.addAssign(h.mul(ot(Me)).add(me.mul(at(Me))));
792
+ const Ne = Ze.sub(De).sub(w(ge).add(0.5).div(w(r)).mul(fe));
793
+ S.addAssign(p.mul(ot(Ne)).add(me.mul(at(Ne))));
794
794
  });
795
795
  });
796
- }), l.divAssign(C(_)), l.assign(Ge(l.clamp().oneMinus(), Z).clamp()), b.divAssign(C(_)), b.mulAssign(G);
797
- const N = C(7).toConst(), L = Ae(b), H = L.greaterThan(N).select(N.div(L), C(1));
798
- return b.mulAssign(H), M.assign(be(M.add(c.mul(1e-4)))), m.assign(l), k.assign(b), R.assign(J(M.mul(0.5).add(0.5), 1)), J(0);
796
+ }), N.divAssign(w(M)), N.assign(Ge(N.clamp().oneMinus(), j).clamp()), u.divAssign(w(M)), u.mulAssign(G);
797
+ const _ = w(7).toConst(), L = ve(u), H = L.greaterThan(_).select(_.div(L), w(1));
798
+ return u.mulAssign(H), S.assign(be(S.add(i.mul(1e-4)))), m.assign(N), k.assign(u), R.assign(J(S.mul(0.5).add(0.5), 1)), J(0);
799
799
  });
800
- return this._material.colorNode = g().context(t.getSharedContext()), this._material.outputNode = u, this._material.needsUpdate = !0, this._aoNode;
800
+ return this._material.colorNode = g().context(t.getSharedContext()), this._material.outputNode = d, this._material.needsUpdate = !0, this._aoNode;
801
801
  }
802
802
  /**
803
803
  * Frees internal resources. This method should be called
@@ -821,7 +821,7 @@ class Vn extends He {
821
821
  * @param {Camera} camera - The camera the scene is rendered with.
822
822
  */
823
823
  constructor(t, s, a, r) {
824
- super("vec4"), this.textureNode = t, this.depthNode = s, this.normalNode = a, this.noiseNode = Fe(Rn()), this.lumaPhi = I(5), this.depthPhi = I(5), this.normalPhi = I(5), this.radius = I(5), this.index = I(0), this.updateBeforeType = Ot.FRAME, this._resolution = I(new ve()), this._sampleVectors = Ps(In(16, 2, 1)), this._cameraProjectionMatrixInverse = I(r.projectionMatrixInverse);
824
+ super("vec4"), this.textureNode = t, this.depthNode = s, this.normalNode = a, this.noiseNode = Fe(Rn()), this.lumaPhi = I(5), this.depthPhi = I(5), this.normalPhi = I(5), this.radius = I(5), this.index = I(0), this.updateBeforeType = Ot.FRAME, this._resolution = I(new Te()), this._sampleVectors = Ps(In(16, 2, 1)), this._cameraProjectionMatrixInverse = I(r.projectionMatrixInverse);
825
825
  }
826
826
  /**
827
827
  * This method is used to update internal uniforms once per frame.
@@ -839,22 +839,22 @@ class Vn extends He {
839
839
  * @return {ShaderCallNodeInternal}
840
840
  */
841
841
  setup() {
842
- const t = Re(), s = (S) => this.textureNode.sample(S), a = (S) => this.depthNode.sample(S).x, r = (S) => this.normalNode !== null ? this.normalNode.sample(S).rgb.normalize() : Lt(S, this.depthNode.value, this._cameraProjectionMatrixInverse), o = (S) => this.noiseNode.sample(S), d = (S, V, m, k) => {
843
- const R = s(k).toVar(), u = a(k).toVar(), g = r(k).toVar(), i = Ie(k, u, this._cameraProjectionMatrixInverse).toVar(), n = ie(V, g), c = Ge(q(n, 0), this.normalPhi), h = pe(Ae(R.rgb).sub(Ae(S))), y = q(C(1).sub(h.div(this.lumaPhi)), 0), p = pe(ie(m.sub(i), V)), A = q(C(1).sub(p.div(this.depthPhi)), 0), w = y.mul(A).mul(c).toVar();
844
- return { color: R.mul(w), weight: w };
845
- }, f = Q(([S]) => {
846
- const V = a(S).toVar(), m = r(S).toVar(), k = s(S).toVar(), R = Ee("vec4");
842
+ const t = Re(), s = (x) => this.textureNode.sample(x), a = (x) => this.depthNode.sample(x).x, r = (x) => this.normalNode !== null ? this.normalNode.sample(x).rgb.normalize() : Lt(x, this.depthNode.value, this._cameraProjectionMatrixInverse), o = (x) => this.noiseNode.sample(x), l = (x, V, m, k) => {
843
+ const R = s(k).toVar(), d = a(k).toVar(), g = r(k).toVar(), c = Ie(k, d, this._cameraProjectionMatrixInverse).toVar(), n = ie(V, g), i = Ge(W(n, 0), this.normalPhi), p = pe(ve(R.rgb).sub(ve(x))), y = W(w(1).sub(p.div(this.lumaPhi)), 0), h = pe(ie(m.sub(c), V)), A = W(w(1).sub(h.div(this.depthPhi)), 0), C = y.mul(A).mul(i).toVar();
844
+ return { color: R.mul(C), weight: C };
845
+ }, f = Q(([x]) => {
846
+ const V = a(x).toVar(), m = r(x).toVar(), k = s(x).toVar(), R = Ee("vec4");
847
847
  return he(V.greaterThanEqual(1).or(ie(m, m).equal(0)), () => {
848
848
  R.assign(k);
849
849
  }).Else(() => {
850
- const u = ae(k.rgb), g = Ie(S, V, this._cameraProjectionMatrixInverse).toConst(), i = Vs(this.noiseNode, 0);
851
- let n = K(S.x, S.y.oneMinus());
852
- n = n.mul(this._resolution.div(i));
853
- const c = o(n).toVar(), h = at(c.element(this.index.mod(4).mul(2).mul(fe))), y = ot(c.element(this.index.mod(4).mul(2).mul(fe))), p = K(h, y), A = Is(p.x, p.y.negate(), p.x, p.y), w = C(1).toVar(), l = J(k).toVar();
854
- Oe({ start: At(0), end: At(16), type: "int", condition: "<" }, ({ i: b }) => {
855
- const M = this._sampleVectors.element(b), _ = A.mul(M.xy.mul(C(1).add(M.z.mul(this.radius.sub(1))))).div(this._resolution), x = S.add(_), Z = d(u, m, g, x);
856
- l.addAssign(Z.color), w.addAssign(Z.weight);
857
- }), R.assign(l.div(w));
850
+ const d = ae(k.rgb), g = Ie(x, V, this._cameraProjectionMatrixInverse).toConst(), c = Vs(this.noiseNode, 0);
851
+ let n = Y(x.x, x.y.oneMinus());
852
+ n = n.mul(this._resolution.div(c));
853
+ const i = o(n).toVar(), p = at(i.element(this.index.mod(4).mul(2).mul(fe))), y = ot(i.element(this.index.mod(4).mul(2).mul(fe))), h = Y(p, y), A = Is(h.x, h.y.negate(), h.x, h.y), C = w(1).toVar(), N = J(k).toVar();
854
+ Oe({ start: At(0), end: At(16), type: "int", condition: "<" }, ({ i: u }) => {
855
+ const S = this._sampleVectors.element(u), M = A.mul(S.xy.mul(w(1).add(S.z.mul(this.radius.sub(1))))).div(this._resolution), b = x.add(M), j = l(d, m, g, b);
856
+ N.addAssign(j.color), C.addAssign(j.weight);
857
+ }), R.assign(N.div(C));
858
858
  }), R;
859
859
  });
860
860
  return Q(() => f(t))();
@@ -863,17 +863,17 @@ class Vn extends He {
863
863
  function In(e, t, s) {
864
864
  const a = [];
865
865
  for (let r = 0; r < e; r++) {
866
- const o = 2 * Math.PI * t * r / e, d = Math.pow(r / (e - 1), s);
867
- a.push(new Bt(Math.cos(o), Math.sin(o), d));
866
+ const o = 2 * Math.PI * t * r / e, l = Math.pow(r / (e - 1), s);
867
+ a.push(new Bt(Math.cos(o), Math.sin(o), l));
868
868
  }
869
869
  return a;
870
870
  }
871
871
  function Rn(e = 64) {
872
872
  const t = new Ls(), s = e * e * 4, a = new Uint8Array(s);
873
873
  for (let o = 0; o < e; o++)
874
- for (let d = 0; d < e; d++) {
875
- const f = o, T = d;
876
- a[(o * e + d) * 4] = (t.noise(f, T) * 0.5 + 0.5) * 255, a[(o * e + d) * 4 + 1] = (t.noise(f + e, T) * 0.5 + 0.5) * 255, a[(o * e + d) * 4 + 2] = (t.noise(f, T + e) * 0.5 + 0.5) * 255, a[(o * e + d) * 4 + 3] = (t.noise(f + e, T + e) * 0.5 + 0.5) * 255;
874
+ for (let l = 0; l < e; l++) {
875
+ const f = o, T = l;
876
+ a[(o * e + l) * 4] = (t.noise(f, T) * 0.5 + 0.5) * 255, a[(o * e + l) * 4 + 1] = (t.noise(f + e, T) * 0.5 + 0.5) * 255, a[(o * e + l) * 4 + 2] = (t.noise(f, T + e) * 0.5 + 0.5) * 255, a[(o * e + l) * 4 + 3] = (t.noise(f + e, T + e) * 0.5 + 0.5) * 255;
877
877
  }
878
878
  const r = new as(a, e, e);
879
879
  return r.wrapS = yt, r.wrapT = yt, r.needsUpdate = !0, r;
@@ -900,17 +900,17 @@ class Dn extends He {
900
900
  * @return {Node<vec4>}
901
901
  */
902
902
  setup() {
903
- const t = this.textureNode, s = (d) => Et(d.div(d.add(1))), a = (d) => {
904
- const f = d.pow2().min(0.9999);
903
+ const t = this.textureNode, s = (l) => Et(l.div(l.add(1))), a = (l) => {
904
+ const f = l.pow2().min(0.9999);
905
905
  return f.div(f.oneMinus());
906
- }, r = (d) => d.g.add(d.r.add(d.b).mul(0.5));
906
+ }, r = (l) => l.g.add(l.r.add(l.b).mul(0.5));
907
907
  return Q(() => {
908
- const d = ke(t.size()).toConst(), f = d.sub(1).toConst(), T = ke(Re().mul(K(d))).toConst(), v = (U, P) => {
909
- const N = t.load(q(ce(T.add(ke(U, P)), f), ke(0))), L = N.a.saturate().toConst(), H = L.greaterThan(1 / 255).select(N.rgb.max(0).div(L), ae(0));
908
+ const l = _e(t.size()).toConst(), f = l.sub(1).toConst(), T = _e(Re().mul(Y(l))).toConst(), v = (U, P) => {
909
+ const _ = t.load(W(ce(T.add(_e(U, P)), f), _e(0))), L = _.a.saturate().toConst(), H = L.greaterThan(1 / 255).select(_.rgb.max(0).div(L), ae(0));
910
910
  return { p: s(H).toConst(), a: L };
911
- }, S = v(0, 0), V = v(0, -1), m = v(-1, 0), k = v(1, 0), R = v(0, 1), u = ce(ce(V.p, m.p), ce(k.p, R.p)).toConst(), g = q(q(V.p, m.p), q(k.p, R.p)).toConst(), i = C(0.25 - 1 / 16), n = ce(u, S.p).div(g.mul(4).max(1e-5)), c = ae(1).sub(q(g, S.p)).div(u.mul(4).sub(4)), h = q(n.negate(), c).toConst(), y = q(i.negate(), ce(q(h.r, q(h.g, h.b)), 0)).mul(this.amount).toVar(), p = r(V.p), A = r(m.p), w = r(S.p), l = r(k.p), b = r(R.p), M = p.add(A).add(l).add(b).mul(0.25).sub(w), _ = q(q(p, A), q(w, q(l, b))).sub(ce(ce(p, A), ce(w, ce(l, b)))), x = C(1).sub(pe(M).div(_.max(1 / 65536)).saturate().mul(0.5));
912
- y.mulAssign(this.denoise.greaterThan(0.5).select(x, 1));
913
- const Z = y.mul(4).add(1).reciprocal().toConst(), G = a(V.p.add(m.p).add(k.p).add(R.p).mul(y).add(S.p).mul(Z).max(0)), E = V.a.add(m.a).add(k.a).add(R.a).mul(y).add(S.a).mul(Z).saturate().toConst();
911
+ }, x = v(0, 0), V = v(0, -1), m = v(-1, 0), k = v(1, 0), R = v(0, 1), d = ce(ce(V.p, m.p), ce(k.p, R.p)).toConst(), g = W(W(V.p, m.p), W(k.p, R.p)).toConst(), c = w(0.25 - 1 / 16), n = ce(d, x.p).div(g.mul(4).max(1e-5)), i = ae(1).sub(W(g, x.p)).div(d.mul(4).sub(4)), p = W(n.negate(), i).toConst(), y = W(c.negate(), ce(W(p.r, W(p.g, p.b)), 0)).mul(this.amount).toVar(), h = r(V.p), A = r(m.p), C = r(x.p), N = r(k.p), u = r(R.p), S = h.add(A).add(N).add(u).mul(0.25).sub(C), M = W(W(h, A), W(C, W(N, u))).sub(ce(ce(h, A), ce(C, ce(N, u)))), b = w(1).sub(pe(S).div(M.max(1 / 65536)).saturate().mul(0.5));
912
+ y.mulAssign(this.denoise.greaterThan(0.5).select(b, 1));
913
+ const j = y.mul(4).add(1).reciprocal().toConst(), G = a(V.p.add(m.p).add(k.p).add(R.p).mul(y).add(x.p).mul(j).max(0)), E = V.a.add(m.a).add(k.a).add(R.a).mul(y).add(x.a).mul(j).saturate().toConst();
914
914
  return J(G.mul(E), E);
915
915
  })();
916
916
  }
@@ -926,28 +926,28 @@ function Fn(e, t) {
926
926
  normal: J(Bs(Ds), rs),
927
927
  velocity: ct
928
928
  }));
929
- const a = s.getTextureNode("output"), r = s.getTextureNode("depth"), o = s.getTextureNode("normal"), d = s.getTextureNode("velocity"), f = s.getTextureNode("diffuseColor");
929
+ const a = s.getTextureNode("output"), r = s.getTextureNode("depth"), o = s.getTextureNode("normal"), l = s.getTextureNode("velocity"), f = s.getTextureNode("diffuseColor");
930
930
  s.getTexture("diffuseColor").type = B.UnsignedByteType, s.getTexture("normal").type = B.UnsignedByteType;
931
- const T = We(o.a, Ke.skin), v = We(o.a, Ke.eye), S = We(o.a, Ke.hair), V = zs((G) => Fs(o.sample(G))), m = Pn(a, r, V, t);
931
+ const T = We(o.a, Ke.skin), v = We(o.a, Ke.eye), x = We(o.a, Ke.hair), V = zs((G) => Fs(o.sample(G))), m = Pn(a, r, V, t);
932
932
  m.resolutionScale = 0.5, m.aoIntensity.value = 1, m.giIntensity.value = 5, m.sliceCount.value = 2, m.stepCount.value = 8, m.thickness.value = 0.03, m.radius.value = 1, m.expFactor.value = 1, m.backfaceLighting.value = 0.1;
933
- const k = m.getAONode(), R = m.getGINode(), u = je("near", "float", t), g = je("far", "float", t), i = (G) => Es(r.sample(G).r, u, g), n = Q(() => {
934
- const G = Re(), E = K(m.getAONode().size()), U = G.mul(E).sub(0.5), P = U.floor(), N = U.sub(P), L = i(G), H = J(0).toVar(), ne = C(0).toVar();
935
- for (const [W, ue] of [[0, 0], [1, 0], [0, 1], [1, 1]]) {
936
- const Y = P.add(K(W + 0.5, ue + 0.5)).div(E), F = (W === 1 ? N.x : N.x.oneMinus()).mul(ue === 1 ? N.y : N.y.oneMinus()), me = Os(L.sub(i(Y)).abs().mul(-32)).add(1e-3), ee = F.mul(me);
937
- H.addAssign(J(R.sample(Y).rgb, k.sample(Y).r).mul(ee)), ne.addAssign(ee);
933
+ const k = m.getAONode(), R = m.getGINode(), d = je("near", "float", t), g = je("far", "float", t), c = (G) => Es(r.sample(G).r, d, g), n = Q(() => {
934
+ const G = Re(), E = Y(m.getAONode().size()), U = G.mul(E).sub(0.5), P = U.floor(), _ = U.sub(P), L = c(G), H = J(0).toVar(), ne = w(0).toVar();
935
+ for (const [K, ue] of [[0, 0], [1, 0], [0, 1], [1, 1]]) {
936
+ const Z = P.add(Y(K + 0.5, ue + 0.5)).div(E), F = (K === 1 ? _.x : _.x.oneMinus()).mul(ue === 1 ? _.y : _.y.oneMinus()), me = Os(L.sub(c(Z)).abs().mul(-32)).add(1e-3), te = F.mul(me);
937
+ H.addAssign(J(R.sample(Z).rgb, k.sample(Z).r).mul(te)), ne.addAssign(te);
938
938
  }
939
939
  return H.div(ne);
940
- }), c = Bn(n(), r, V, t);
941
- c.radius.value = 8, c.depthPhi.value = 0.1, c.lumaPhi.value = 5;
942
- const h = rt(c), y = I(0.5), p = I(0.5), A = h.a.oneMinus().mul(Pe(C(1), y, S)).mul(Pe(C(1), p, v)).oneMinus(), w = Pe(a.rgb, f.rgb, f.a), l = Q(([G, E]) => {
943
- const U = E.mul(2.0404).sub(0.3324), P = E.mul(-4.7951).add(0.6417), N = E.mul(2.7552).add(0.6903);
944
- return ae(G).max(U.mul(G).add(P).mul(G).add(N).mul(G));
945
- }), b = I(new B.Vector3(0.45, 0.15, 0.05)), M = Pe(ae(A), Ge(ae(A), ae(1).sub(b)), T), _ = J(
946
- a.rgb.mul(l(M, w)).add(w.mul(h.rgb)),
940
+ }), i = Bn(n(), r, V, t);
941
+ i.radius.value = 8, i.depthPhi.value = 0.1, i.lumaPhi.value = 5;
942
+ const p = rt(i), y = I(0.5), h = I(0.5), A = p.a.oneMinus().mul(ke(w(1), y, x)).mul(ke(w(1), h, v)).oneMinus(), C = ke(a.rgb, f.rgb, f.a), N = Q(([G, E]) => {
943
+ const U = E.mul(2.0404).sub(0.3324), P = E.mul(-4.7951).add(0.6417), _ = E.mul(2.7552).add(0.6903);
944
+ return ae(G).max(U.mul(G).add(P).mul(G).add(_).mul(G));
945
+ }), u = I(new B.Vector3(0.45, 0.15, 0.05)), S = ke(ae(A), Ge(ae(A), ae(1).sub(u)), T), M = J(
946
+ a.rgb.mul(N(S, C)).add(C.mul(p.rgb)),
947
947
  // indirect diffuse modulated by albedo
948
948
  a.a
949
- ), x = Yt(_, r, d, t);
950
- return x._resolveMaterial.needsUpdate = !0, { outputNode: zn(x, 0.5), scenePassColor: a, traaPass: x, giPass: m, denoisePass: c, ao: k, gi: R, hairAO: y, eyeAO: p };
949
+ ), b = Yt(M, r, l, t);
950
+ return b._resolveMaterial.needsUpdate = !0, { outputNode: zn(b, 0.5), scenePassColor: a, traaPass: b, giPass: m, denoisePass: i, ao: k, gi: R, hairAO: y, eyeAO: h };
951
951
  }
952
952
  function On(e, t) {
953
953
  const s = Ut(e, t);
@@ -956,60 +956,60 @@ function On(e, t) {
956
956
  return r._resolveMaterial.needsUpdate = !0, { outputNode: r, scenePassColor: a, traaPass: r };
957
957
  }
958
958
  const En = () => {
959
- const e = O((n) => n.animationsLoaded), t = O((n) => n.characterState), s = O((n) => n.lipSyncManager), a = O((n) => n.blendshapeManager), r = z((n) => n.credentials), o = z((n) => n.currentUtterance), d = z((n) => n.textToSpeak), f = z((n) => n.visemes), T = z((n) => n.blendshapes), v = z((n) => n.visemeIntensity), S = z((n) => n.currentVisemeIndex), V = z((n) => n.currentBlendshapeIndex), m = z((n) => n.useBlendshapeManager), [k, R] = te(!1), [u, g] = te(!1), i = it(() => r != null && r.region && (r.subscriptionKey || r.token) ? Gs({
959
+ const e = O((n) => n.animationsLoaded), t = O((n) => n.characterState), s = O((n) => n.lipSyncManager), a = O((n) => n.blendshapeManager), r = z((n) => n.credentials), o = z((n) => n.currentUtterance), l = z((n) => n.textToSpeak), f = z((n) => n.visemes), T = z((n) => n.blendshapes), v = z((n) => n.visemeIntensity), x = z((n) => n.currentVisemeIndex), V = z((n) => n.currentBlendshapeIndex), m = z((n) => n.useBlendshapeManager), [k, R] = ee(!1), [d, g] = ee(!1), c = it(() => r != null && r.region && (r.subscriptionKey || r.token) ? Gs({
960
960
  credentials: {
961
961
  region: r.region,
962
962
  authorizationToken: r.token,
963
963
  subscriptionKey: r.subscriptionKey
964
964
  }
965
965
  }) : null, [r]);
966
- return j(() => {
967
- if (i) {
968
- const n = i.speechSynthesis.getVoices();
969
- n && Array.isArray(n) && n.length ? (Pt(n), R(!0)) : i.speechSynthesis.onvoiceschanged = () => {
970
- Pt(i.speechSynthesis.getVoices()), R(!0);
966
+ return q(() => {
967
+ if (c) {
968
+ const n = c.speechSynthesis.getVoices();
969
+ n && Array.isArray(n) && n.length ? (Pt(n), R(!0)) : c.speechSynthesis.onvoiceschanged = () => {
970
+ Pt(c.speechSynthesis.getVoices()), R(!0);
971
971
  };
972
972
  }
973
- }, [i]), j(() => {
973
+ }, [c]), q(() => {
974
974
  k && (m ? !!a : !!s) && e && g(!0);
975
- }, [k, s, a, e, m]), j(() => {
976
- if (d) {
977
- const n = new Hs(d);
975
+ }, [k, s, a, e, m]), q(() => {
976
+ if (l) {
977
+ const n = new Hs(l);
978
978
  Sn(n);
979
979
  }
980
- }, [d]), j(() => {
981
- var n, c;
982
- o && u ? (o.onstart = () => {
980
+ }, [l]), q(() => {
981
+ var n, i;
982
+ o && d ? (o.onstart = () => {
983
983
  console.log("Start"), Nt(de.speaking);
984
984
  }, o.onend = () => {
985
985
  console.log("End"), Nt(de.idle);
986
986
  }, o.onboundary = () => {
987
- }, o.onviseme = (h) => {
988
- qt(h);
989
- }, (n = i == null ? void 0 : i.speechSynthesis) == null || n.speak(o, null)) : (c = i == null ? void 0 : i.speechSynthesis) == null || c.cancel();
990
- }, [o]), j(() => {
987
+ }, o.onviseme = (p) => {
988
+ qt(p);
989
+ }, (n = c == null ? void 0 : c.speechSynthesis) == null || n.speak(o, null)) : (i = c == null ? void 0 : c.speechSynthesis) == null || i.cancel();
990
+ }, [o]), q(() => {
991
991
  s && (s.visemeIntensity = v);
992
- }, [v]), j(() => {
992
+ }, [v]), q(() => {
993
993
  if (!m && s && t === de.speaking) {
994
- if (!s.isStarted && s.start(), f.length > 1 && S === 0)
994
+ if (!s.isStarted && s.start(), f.length > 1 && x === 0)
995
995
  f.forEach((n) => {
996
- const c = parseInt(n.name);
997
- if (!isNaN(c)) {
998
- const h = kt.get(c);
999
- h && s.PlayVisemeAsync(h, n.elapsedTime / 1e4);
996
+ const i = parseInt(n.name);
997
+ if (!isNaN(i)) {
998
+ const p = kt.get(i);
999
+ p && s.PlayVisemeAsync(p, n.elapsedTime / 1e4);
1000
1000
  }
1001
1001
  });
1002
1002
  else
1003
- for (let n = S + 1; n < f.length; n++) {
1004
- const c = f[n], h = parseInt(c.name);
1005
- if (!isNaN(h)) {
1006
- const y = kt.get(h);
1007
- y && s.PlayVisemeAsync(y, c.elapsedTime / 1e4);
1003
+ for (let n = x + 1; n < f.length; n++) {
1004
+ const i = f[n], p = parseInt(i.name);
1005
+ if (!isNaN(p)) {
1006
+ const y = kt.get(p);
1007
+ y && s.PlayVisemeAsync(y, i.elapsedTime / 1e4);
1008
1008
  }
1009
1009
  }
1010
1010
  bn(f.length - 1);
1011
1011
  }
1012
- }, [t, f, s, m]), j(() => {
1012
+ }, [t, f, s, m]), q(() => {
1013
1013
  if (m && a && t === de.speaking) {
1014
1014
  if (!a.isStarted && a.start(), T.length > 1 && V === 0)
1015
1015
  T.forEach((n) => {
@@ -1017,12 +1017,12 @@ const En = () => {
1017
1017
  });
1018
1018
  else
1019
1019
  for (let n = V + 1; n < T.length; n++) {
1020
- const c = T[n];
1021
- a.PlayBlendShapeAsync(c);
1020
+ const i = T[n];
1021
+ a.PlayBlendShapeAsync(i);
1022
1022
  }
1023
1023
  Tn(T.length - 1);
1024
1024
  }
1025
- }, [t, T, a, m]), j(() => {
1025
+ }, [t, T, a, m]), q(() => {
1026
1026
  t !== de.speaking && (Wt(), Kt());
1027
1027
  }, [t]), null;
1028
1028
  }, Ln = ({ points: e, color: t = "red" }) => {
@@ -1032,36 +1032,37 @@ const En = () => {
1032
1032
  }, [e, t]);
1033
1033
  return /* @__PURE__ */ D.createElement("primitive", { object: s });
1034
1034
  }, Un = ({ parentGpuTier: e, setIsGpuAvailable: t, children: s, tonemapping: a, inspector: r = !1 }) => {
1035
- const o = se((l) => l.cameraPosition), d = se((l) => l.lookAt), f = se((l) => l.movable), T = re((l) => l.targets), v = re((l) => l.showFirstTarget), [S, V] = te(e || ds()), [m, k] = te(
1035
+ const o = se((u) => u.cameraPosition), l = se((u) => u.lookAt), f = se((u) => u.movable), T = re((u) => u.targets), v = re((u) => u.showFirstTarget), [x, V] = ee(e || ds()), [m, k] = ee(
1036
1036
  "low"
1037
1037
  /* low */
1038
- ), [R, u] = te(null), [g, i] = te(void 0), n = Te(null), c = Te(null), h = Te(null), y = (l) => {
1039
- l.preventDefault(), l.stopPropagation();
1038
+ ), [R, d] = ee(null), [g, c] = ee(void 0), n = Pe(null), [i, p] = ee(null), y = Pe(null), h = (u) => {
1039
+ u.preventDefault(), u.stopPropagation();
1040
1040
  };
1041
- j(() => {
1042
- Qs(c.current);
1043
- }, [c.current]), j(() => {
1044
- var l, b, M, _;
1041
+ q(() => {
1042
+ var u, S, M, b;
1045
1043
  if (f)
1046
- R == null || R.abort(), u(null);
1044
+ R == null || R.abort(), d(null);
1047
1045
  else {
1048
- const x = new AbortController();
1049
- u(x), (l = n.current) == null || l.addEventListener("wheel", y, { passive: !1, signal: x.signal }), (b = n.current) == null || b.addEventListener("pointerdown", y, { passive: !1, signal: x.signal }), (M = n.current) == null || M.addEventListener("pointermove", y, { passive: !1, signal: x.signal }), (_ = n.current) == null || _.addEventListener("click", y, { passive: !1, signal: x.signal });
1046
+ const j = new AbortController();
1047
+ d(j), (u = n.current) == null || u.addEventListener("wheel", h, { passive: !1, signal: j.signal }), (S = n.current) == null || S.addEventListener("pointerdown", h, { passive: !1, signal: j.signal }), (M = n.current) == null || M.addEventListener("pointermove", h, { passive: !1, signal: j.signal }), (b = n.current) == null || b.addEventListener("click", h, { passive: !1, signal: j.signal });
1050
1048
  }
1051
- }, [f]), j(() => {
1052
- h != null && h.current && d && o && h.current.setLookAt(o.x, o.y, o.z, d.x, d.y, d.z, !0);
1053
- }, [o, d]), j(() => {
1049
+ }, [f]), q(() => {
1050
+ if (i && l && o) {
1051
+ const u = y.current === i;
1052
+ i.setLookAt(o.x, o.y, o.z, l.x, l.y, l.z, u), y.current = i;
1053
+ }
1054
+ }, [i, o, l]), q(() => {
1054
1055
  e && V(e);
1055
- }, [e]), j(() => {
1056
- if (S)
1057
- if (S.type === "FALLBACK") {
1058
- const l = typeof navigator < "u" && /Macintosh|Mac OS X/.test(navigator.userAgent);
1056
+ }, [e]), q(() => {
1057
+ if (x)
1058
+ if (x.type === "FALLBACK") {
1059
+ const u = typeof navigator < "u" && /Macintosh|Mac OS X/.test(navigator.userAgent);
1059
1060
  k(
1060
- l ? "medium" : "low"
1061
+ u ? "medium" : "low"
1061
1062
  /* low */
1062
1063
  );
1063
1064
  } else
1064
- switch (S.tier) {
1065
+ switch (x.tier) {
1065
1066
  case 0:
1066
1067
  case 1:
1067
1068
  k(
@@ -1088,97 +1089,97 @@ const En = () => {
1088
1089
  );
1089
1090
  break;
1090
1091
  }
1091
- }, [S]), j(() => {
1092
- switch (m && (p.current = m), m) {
1092
+ }, [x]), q(() => {
1093
+ switch (m && (A.current = m), m) {
1093
1094
  case "low":
1094
1095
  console.warn("Retorik React-Bodyengine-Three > GPU tier too low, no rendering available"), t(!1);
1095
1096
  break;
1096
1097
  case "medium":
1097
- i([0.8, 1]), console.log(`Retorik React-Bodyengine-Three > GPU tier detected : ${m}`), t(!0);
1098
+ c([0.8, 1]), console.log(`Retorik React-Bodyengine-Three > GPU tier detected : ${m}`), t(!0);
1098
1099
  break;
1099
1100
  case "high":
1100
- i([1, 1.5]), console.log(`Retorik React-Bodyengine-Three > GPU tier detected : ${m}`), t(!0);
1101
+ c([1, 1.5]), console.log(`Retorik React-Bodyengine-Three > GPU tier detected : ${m}`), t(!0);
1101
1102
  break;
1102
1103
  }
1103
1104
  }, [m]);
1104
- const p = Te(void 0), A = $t(async (l) => {
1105
- const b = new B.WebGPURenderer({
1106
- canvas: l.canvas,
1105
+ const A = Pe(void 0), C = $t(async (u) => {
1106
+ const S = new B.WebGPURenderer({
1107
+ canvas: u.canvas,
1107
1108
  antialias: !1,
1108
1109
  alpha: !0,
1109
1110
  powerPreference: "high-performance"
1110
1111
  });
1111
- return b.setClearColor(new B.Color("#000000"), 0), b.setPixelRatio(Math.min(devicePixelRatio, 1.5)), b.shadowMap.type = B.PCFShadowMap, await b.init(), b;
1112
- }, []), w = it(() => {
1112
+ return S.setClearColor(new B.Color("#000000"), 0), S.setPixelRatio(Math.min(devicePixelRatio, 1.5)), S.shadowMap.type = B.PCFShadowMap, await S.init(), S;
1113
+ }, []), N = it(() => {
1113
1114
  if (T.length) {
1114
- const l = T[0], b = new B.Vector3(l.position.x - 0.5, l.position.y, l.position.z - 0.1), M = new B.Vector3(l.position.x + 0.5, l.position.y, l.position.z - 0.1);
1115
- return [b, M];
1115
+ const u = T[0], S = new B.Vector3(u.position.x - 0.5, u.position.y, u.position.z - 0.1), M = new B.Vector3(u.position.x + 0.5, u.position.y, u.position.z - 0.1);
1116
+ return [S, M];
1116
1117
  } else if (o) {
1117
- const l = new B.Vector3(o.x - 0.5, o.y, o.z - 0.1), b = new B.Vector3(o.x + 0.5, o.y, o.z - 0.1);
1118
- return [l, b];
1118
+ const u = new B.Vector3(o.x - 0.5, o.y, o.z - 0.1), S = new B.Vector3(o.x + 0.5, o.y, o.z - 0.1);
1119
+ return [u, S];
1119
1120
  }
1120
1121
  return [];
1121
1122
  }, [T, o]);
1122
1123
  return g ? (
1123
1124
  // "percentage" = PCFShadowMap; shadows={true} would make R3F set the removed PCFSoftShadowMap
1124
- /* @__PURE__ */ D.createElement(Us, { gl: A, dpr: g, ref: n, shadows: "percentage" }, /* @__PURE__ */ D.createElement(us, { iterations: 5, ms: 100, threshold: 0.75 }, /* @__PURE__ */ D.createElement(jn, { tonemapping: a, processedTier: m, inspector: r }), /* @__PURE__ */ D.createElement(En, null), /* @__PURE__ */ D.createElement(hs, { ref: c, makeDefault: !0, fov: 28 }), /* @__PURE__ */ D.createElement(ms, { ref: h }), v && w.length && /* @__PURE__ */ D.createElement(Ln, { points: w, color: "red" }), /* @__PURE__ */ D.createElement(Qt, { fallback: null }, s)))
1125
+ /* @__PURE__ */ D.createElement(Us, { gl: C, dpr: g, ref: n, shadows: "percentage" }, /* @__PURE__ */ D.createElement(us, { iterations: 5, ms: 100, threshold: 0.75 }, /* @__PURE__ */ D.createElement(jn, { tonemapping: a, processedTier: m, inspector: r }), /* @__PURE__ */ D.createElement(En, null), /* @__PURE__ */ D.createElement(hs, { ref: Qs, makeDefault: !0, fov: 28 }), /* @__PURE__ */ D.createElement(ms, { ref: p }), v && N.length && /* @__PURE__ */ D.createElement(Ln, { points: N, color: "red" }), /* @__PURE__ */ D.createElement(Qt, { fallback: null }, s)))
1125
1126
  ) : /* @__PURE__ */ D.createElement(D.Fragment, null);
1126
1127
  }, jn = ({ tonemapping: e, processedTier: t, inspector: s = !1 }) => {
1127
- const [a, r] = te(!1), { gl: o, scene: d, camera: f, size: T } = js(), [v] = te(new B.Vector3(-3, 2, 2)), [S] = te(new B.Vector3(0, 1, 0)), [V] = te(3.5), [m] = te(-2e-4), [k] = te(0.57), [R] = te(0.25), u = Te(null), g = Te(null);
1128
- return j(() => {
1129
- o && (o.shadowMap.type = B.PCFShadowMap, o.toneMapping = e, t !== "low" ? d.environmentIntensity = R : d.environmentIntensity = 1);
1130
- }, [o, e]), j(() => {
1131
- d.environmentIntensity = R;
1132
- }, [R]), j(() => {
1128
+ const [a, r] = ee(!1), { gl: o, scene: l, camera: f, size: T } = js(), [v] = ee(new B.Vector3(-3, 2, 2)), [x] = ee(new B.Vector3(0, 1, 0)), [V] = ee(3.5), [m] = ee(-2e-4), [k] = ee(0.57), [R] = ee(0.25), d = Pe(null), g = Pe(null);
1129
+ return q(() => {
1130
+ o && (o.shadowMap.type = B.PCFShadowMap, o.toneMapping = e, t !== "low" ? l.environmentIntensity = R : l.environmentIntensity = 1);
1131
+ }, [o, e]), q(() => {
1132
+ l.environmentIntensity = R;
1133
+ }, [R]), q(() => {
1133
1134
  if (!s || !o || a) return;
1134
- let i = !1;
1135
+ let c = !1;
1135
1136
  return import("three/addons/inspector/Inspector.js").then(({ Inspector: n }) => {
1136
- i || (o.inspector = new n(), r(!0));
1137
+ c || (o.inspector = new n(), r(!0));
1137
1138
  }).catch((n) => console.warn("Scene: could not load three's Inspector", n)), () => {
1138
- i = !0;
1139
+ c = !0;
1139
1140
  };
1140
- }, [s, o, a]), j(() => {
1141
- if (!o || !d || !f || !t) return;
1142
- d.background = null;
1143
- const i = t === "high", n = i ? Fn(d, f) : On(d, f), { outputNode: c, scenePassColor: h, traaPass: y, giPass: p, ao: A, gi: w, hairAO: l, eyeAO: b } = n, M = new B.RenderPipeline(o);
1144
- if (M.outputNode = c, g.current = M, s && a && o.inspector) {
1145
- const _ = () => {
1146
- M.needsUpdate = !0;
1147
- }, x = o.inspector.createParameters(i ? "SSGI + TRAA" : "TRAA");
1148
- if (i) {
1149
- const Z = { output: 0, feedback: !1 }, G = { Combined: 0, AO: 1, GI: 2, Direct: 3 };
1150
- x.add(Z, "output", G).name("output").onChange((E) => {
1141
+ }, [s, o, a]), q(() => {
1142
+ if (!o || !l || !f || !t) return;
1143
+ l.background = null;
1144
+ const c = t === "high", n = c ? Fn(l, f) : On(l, f), { outputNode: i, scenePassColor: p, traaPass: y, giPass: h, ao: A, gi: C, hairAO: N, eyeAO: u } = n, S = new B.RenderPipeline(o);
1145
+ if (S.outputNode = i, g.current = S, s && a && o.inspector) {
1146
+ const M = () => {
1147
+ S.needsUpdate = !0;
1148
+ }, b = o.inspector.createParameters(c ? "SSGI + TRAA" : "TRAA");
1149
+ if (c) {
1150
+ const j = { output: 0, feedback: !1 }, G = { Combined: 0, AO: 1, GI: 2, Direct: 3 };
1151
+ b.add(j, "output", G).name("output").onChange((E) => {
1151
1152
  const U = Number(E);
1152
- M.outputNode = U === 1 ? J(ae(A.r), 1) : U === 2 ? J(w.rgb, 1) : U === 3 ? h : c, _();
1153
- }), x.add(p.sliceCount, "value", 1, 4, 1).name("slice count"), x.add(p.stepCount, "value", 1, 32, 1).name("step count"), x.add(p.radius, "value", 0.1, 2).name("radius"), x.add(p.expFactor, "value", 1e-3, 10).name("exp factor"), x.add(p.thickness, "value", 1e-3, 0.1).name("thickness"), x.add(p.backfaceLighting, "value", 0, 1).name("backface lighting"), x.add(p.aoIntensity, "value", 0, 4).name("AO intensity"), x.add(p.giIntensity, "value", 0, 20).name("GI intensity"), x.add(p, "resolutionScale", 0.25, 1).name("SSGI resolution scale"), x.add(l, "value", 0, 1).name("SSGI AO on hair"), x.add(b, "value", 0, 1).name("SSGI AO on eyes"), x.add(Z, "feedback").name("SSGI 2nd bounce (TRAA history)").onChange((E) => {
1154
- p.beautyNode = E ? y.getHistoryTextureNode() : h, _();
1153
+ S.outputNode = U === 1 ? J(ae(A.r), 1) : U === 2 ? J(C.rgb, 1) : U === 3 ? p : i, M();
1154
+ }), b.add(h.sliceCount, "value", 1, 4, 1).name("slice count"), b.add(h.stepCount, "value", 1, 32, 1).name("step count"), b.add(h.radius, "value", 0.1, 2).name("radius"), b.add(h.expFactor, "value", 1e-3, 10).name("exp factor"), b.add(h.thickness, "value", 1e-3, 0.1).name("thickness"), b.add(h.backfaceLighting, "value", 0, 1).name("backface lighting"), b.add(h.aoIntensity, "value", 0, 4).name("AO intensity"), b.add(h.giIntensity, "value", 0, 20).name("GI intensity"), b.add(h, "resolutionScale", 0.25, 1).name("SSGI resolution scale"), b.add(N, "value", 0, 1).name("SSGI AO on hair"), b.add(u, "value", 0, 1).name("SSGI AO on eyes"), b.add(j, "feedback").name("SSGI 2nd bounce (TRAA history)").onChange((E) => {
1155
+ h.beautyNode = E ? y.getHistoryTextureNode() : p, M();
1155
1156
  });
1156
1157
  }
1157
- x.add(y, "maxVelocityLength", 4, 128, 1).name("TRAA max velocity").onChange(_), x.add(y, "depthThreshold", 1e-4, 0.01).name("TRAA depth threshold").onChange(_), x.add(y, "edgeDepthDiff", 1e-4, 0.01).name("TRAA edge depth diff").onChange(_), x.add(y, "useSubpixelCorrection").name("TRAA subpixel correction").onChange(_);
1158
+ b.add(y, "maxVelocityLength", 4, 128, 1).name("TRAA max velocity").onChange(M), b.add(y, "depthThreshold", 1e-4, 0.01).name("TRAA depth threshold").onChange(M), b.add(y, "edgeDepthDiff", 1e-4, 0.01).name("TRAA edge depth diff").onChange(M), b.add(y, "useSubpixelCorrection").name("TRAA subpixel correction").onChange(M);
1158
1159
  }
1159
1160
  return () => {
1160
- M.dispose(), g.current = null;
1161
+ S.dispose(), g.current = null;
1161
1162
  };
1162
- }, [o, d, f, t, s, a]), j(() => {
1163
+ }, [o, l, f, t, s, a]), q(() => {
1163
1164
  !o || !T || o.setSize(T.width, T.height);
1164
- }, [T]), Ht(({ gl: i, scene: n, camera: c }) => {
1165
+ }, [T]), Ht(({ gl: c, scene: n, camera: i }) => {
1165
1166
  g.current && g.current.render();
1166
- }, 1), /* @__PURE__ */ D.createElement(D.Fragment, null, t !== "low" && o && /* @__PURE__ */ D.createElement(D.Fragment, null, /* @__PURE__ */ D.createElement("directionalLight", { ref: u, color: "white", position: v.toArray(), "target-position": S.toArray(), intensity: V, castShadow: !0, "shadow-mapSize-width": 1024, "shadow-mapSize-height": 1024, "shadow-bias": m, "shadow-normalBias": 3e-3, "shadow-intensity": 0.6, "shadow-radius": 2.5 }, /* @__PURE__ */ D.createElement("orthographicCamera", { attach: "shadow-camera", args: [-1, 1, 2, -0.5, 2, 5] })), t === "high" && /* @__PURE__ */ D.createElement("directionalLight", { name: "RimLight", color: "#fff4e8", position: [0.9, 2.3, -3.2], "target-position": [0, 1.6, 0], intensity: k })));
1167
+ }, 1), /* @__PURE__ */ D.createElement(D.Fragment, null, t !== "low" && o && /* @__PURE__ */ D.createElement(D.Fragment, null, /* @__PURE__ */ D.createElement("directionalLight", { ref: d, color: "white", position: v.toArray(), "target-position": x.toArray(), intensity: V, castShadow: !0, "shadow-mapSize-width": 1024, "shadow-mapSize-height": 1024, "shadow-bias": m, "shadow-normalBias": 3e-3, "shadow-intensity": 0.6, "shadow-radius": 2.5 }, /* @__PURE__ */ D.createElement("orthographicCamera", { attach: "shadow-camera", args: [-1, 1, 2, -0.5, 2, 5] })), t === "high" && /* @__PURE__ */ D.createElement("directionalLight", { name: "RimLight", color: "#fff4e8", position: [0.9, 2.3, -3.2], "target-position": [0, 1.6, 0], intensity: k })));
1167
1168
  }, Gn = ({ character: e, autoLookAt: t }) => {
1168
- const s = O((v) => v.characterState), a = re((v) => v.currentAUs), r = re((v) => v.currentGaze), o = re((v) => v.currentHeadPose), d = re((v) => v.lookAtCamera), f = se((v) => v.cameraPosition), T = re((v) => v.targets);
1169
- return Ht((v, S) => {
1169
+ const s = O((v) => v.characterState), a = re((v) => v.currentAUs), r = re((v) => v.currentGaze), o = re((v) => v.currentHeadPose), l = re((v) => v.lookAtCamera), f = se((v) => v.cameraPosition), T = re((v) => v.targets);
1170
+ return Ht((v, x) => {
1170
1171
  const V = {
1171
- deltaTime: S,
1172
+ deltaTime: x,
1172
1173
  timestamp: v.clock.oldTime,
1173
1174
  AU: a,
1174
1175
  gaze: r,
1175
1176
  headPose: o,
1176
1177
  characterState: s,
1177
- lookAt: d ? f : void 0,
1178
+ lookAt: l ? f : void 0,
1178
1179
  targets: T
1179
1180
  };
1180
1181
  e.update(V);
1181
- }), j(() => {
1182
+ }), q(() => {
1182
1183
  if (t)
1183
1184
  switch (s) {
1184
1185
  case de.idle:
@@ -1192,24 +1193,24 @@ const En = () => {
1192
1193
  }
1193
1194
  else
1194
1195
  Qe(!1);
1195
- }, [s, t]), j(() => {
1196
+ }, [s, t]), q(() => {
1196
1197
  Zs(e);
1197
1198
  }, [e]), null;
1198
- }, xo = ({ url: e, type: t, animationsUrl: s, gender: a, speechSynthesis: r, camera: o, onLoadingCompleted: d, autoLookAt: f, breathing: T, disableAnimations: v, debug: S, inspector: V, enableBml: m, animationWeights: k, license: R, detectGpuData: u, environmentPreset: g = "apartment", tonemapping: i = B.NeutralToneMapping, targets: n, useBlendshapeManager: c = !1 }) => {
1199
- const h = O((P) => P.animationsLoaded), y = se((P) => P.defaultPositions), p = se((P) => P.defaultDistances), [A, w] = te(), [l, b] = te(null), [M, _] = te(), [x, Z] = te(!1), G = async (P) => {
1200
- let N = null;
1199
+ }, xo = ({ url: e, type: t, animationsUrl: s, gender: a, speechSynthesis: r, camera: o, onLoadingCompleted: l, autoLookAt: f, breathing: T, disableAnimations: v, debug: x, inspector: V, enableBml: m, animationWeights: k, license: R, detectGpuData: d, environmentPreset: g = "apartment", tonemapping: c = B.NeutralToneMapping, targets: n, useBlendshapeManager: i = !1 }) => {
1200
+ const p = O((P) => P.animationsLoaded), y = se((P) => P.defaultPositions), h = se((P) => P.defaultDistances), [A, C] = ee(), [N, u] = ee(null), [S, M] = ee(), [b, j] = ee(!1), G = async (P) => {
1201
+ let _ = null;
1201
1202
  switch (t) {
1202
1203
  case Se.cc3:
1203
- N = new ls(), _(Le.cc3);
1204
+ _ = new ls(), M(Le.cc3);
1204
1205
  break;
1205
1206
  case Se.avatarsdk:
1206
- N = new cs(), _(Le.avatarsdk);
1207
+ _ = new cs(), M(Le.avatarsdk);
1207
1208
  break;
1208
1209
  case Se.avaturn:
1209
- N = new is(), _(Le.avaturn);
1210
+ _ = new is(), M(Le.avaturn);
1210
1211
  break;
1211
1212
  }
1212
- const L = await N.loadAsync(P).catch((H) => console.warn("Error loading character : ", H));
1213
+ const L = await _.loadAsync(P).catch((H) => console.warn("Error loading character : ", H));
1213
1214
  if (L) {
1214
1215
  let H = null;
1215
1216
  const ne = {
@@ -1218,10 +1219,10 @@ const En = () => {
1218
1219
  animationsUrl: s,
1219
1220
  gender: a || "male",
1220
1221
  type: t,
1221
- debug: S,
1222
+ debug: x,
1222
1223
  enableBmlManager: !!m,
1223
1224
  animationWeights: k,
1224
- useBlendshapeManager: c,
1225
+ useBlendshapeManager: i,
1225
1226
  license: R
1226
1227
  };
1227
1228
  switch (t) {
@@ -1235,84 +1236,84 @@ const En = () => {
1235
1236
  H = await Ye.fromAvaturn(ne);
1236
1237
  break;
1237
1238
  }
1238
- H && b(H);
1239
+ H && u(H);
1239
1240
  }
1240
1241
  }, E = () => {
1241
1242
  Ct(!0);
1242
1243
  };
1243
- j(() => {
1244
- var P, N;
1245
- l && h && (T === !1 && ((N = (P = l.animationManager) == null ? void 0 : P.disableBreathing) == null || N.call(P)), x ? (an(l.getAllAnimationNames()), rn(l.getAllAnimations()), setTimeout(() => {
1246
- d == null || d();
1244
+ q(() => {
1245
+ var P, _;
1246
+ N && p && (T === !1 && ((_ = (P = N.animationManager) == null ? void 0 : P.disableBreathing) == null || _.call(P)), b ? (an(N.getAllAnimationNames()), rn(N.getAllAnimations()), setTimeout(() => {
1247
+ l == null || l();
1247
1248
  }, 1e3)) : U());
1248
- }, [l, h, x]), j(() => {
1249
+ }, [N, p, b]), q(() => {
1249
1250
  sn(n || []);
1250
- }, [n]), j(() => {
1251
- Ct(!1), A !== void 0 && (A ? G(e) : d == null || d());
1252
- }, [e, A]), j(() => {
1253
- if (x && p && y)
1251
+ }, [n]), q(() => {
1252
+ Ct(!1), A !== void 0 && (A ? G(e) : l == null || l());
1253
+ }, [e, A]), q(() => {
1254
+ if (b && h && y)
1254
1255
  if (o) {
1255
- const P = wn(o, p, y);
1256
+ const P = wn(o, h, y);
1256
1257
  Mt(P), _t(o.lookAt ? y[o.lookAt] : y.lowerbelly), tn(!!o.movable);
1257
1258
  } else {
1258
1259
  const P = y.mouth.clone();
1259
- P.setComponent(2, p.farther), Mt(P), _t(y.lowerbelly);
1260
+ P.setComponent(2, h.farther), Mt(P), _t(y.lowerbelly);
1260
1261
  }
1261
- }, [x, o, p, y]), j(() => {
1262
+ }, [b, o, h, y]), q(() => {
1262
1263
  r && (r.credentials && xn(r.credentials), r.voice && vn(r.voice));
1263
- }, [r]), j(() => {
1264
- An(c);
1265
- }, [c]);
1264
+ }, [r]), q(() => {
1265
+ An(i);
1266
+ }, [i]);
1266
1267
  const U = () => {
1267
- if (l && M) {
1268
+ if (N && S) {
1268
1269
  try {
1269
- const P = new B.Box3().setFromObject(l), N = P.max, L = P.min, H = new B.Vector3((N.x + L.x) / 2, (N.y + L.y) / 2, (N.z + L.z) / 2);
1270
+ const P = new B.Box3().setFromObject(N), _ = P.max, L = P.min, H = new B.Vector3((_.x + L.x) / 2, (_.y + L.y) / 2, (_.z + L.z) / 2);
1270
1271
  Xs(H);
1271
- const ne = Math.abs(N.x - L.x), W = Math.abs(N.y - L.y), ue = Math.abs(N.z - L.z);
1272
+ const ne = Math.abs(_.x - L.x), K = Math.abs(_.y - L.y), ue = Math.abs(_.z - L.z);
1272
1273
  $s({
1273
1274
  x: ne,
1274
- y: W,
1275
+ y: K,
1275
1276
  z: ue
1276
1277
  });
1277
- const Y = (N.x + L.x) / 2, F = (N.z + L.z) / 2, me = {
1278
- eye: new B.Vector3(Y, N.y - W / 16, F),
1279
- mouth: new B.Vector3(Y, N.y - W / 12, F),
1280
- neck: new B.Vector3(Y, N.y - W / 8, F),
1281
- clavicle: new B.Vector3(Y, N.y - W / 6, F),
1282
- torso: new B.Vector3(Y, N.y - W / 4, F),
1283
- belly: new B.Vector3(Y, N.y - W / 8 * 3, F),
1284
- lowerbelly: new B.Vector3(Y, N.y - W / 32 * 15, F),
1278
+ const Z = (_.x + L.x) / 2, F = (_.z + L.z) / 2, me = {
1279
+ eye: new B.Vector3(Z, _.y - K / 16, F),
1280
+ mouth: new B.Vector3(Z, _.y - K / 12, F),
1281
+ neck: new B.Vector3(Z, _.y - K / 8, F),
1282
+ clavicle: new B.Vector3(Z, _.y - K / 6, F),
1283
+ torso: new B.Vector3(Z, _.y - K / 4, F),
1284
+ belly: new B.Vector3(Z, _.y - K / 8 * 3, F),
1285
+ lowerbelly: new B.Vector3(Z, _.y - K / 32 * 15, F),
1285
1286
  hips: H,
1286
- higherthigh: new B.Vector3(Y, L.y + W / 32 * 15, F),
1287
- thigh: new B.Vector3(Y, L.y + W / 8 * 3, F),
1288
- knee: new B.Vector3(Y, L.y + W / 4, F),
1289
- leg: new B.Vector3(Y, L.y + W / 8, F),
1290
- feet: new B.Vector3(Y, L.y, F)
1291
- }, ee = (N.y - (L.y + W / 7 * 2)) / 2 / Math.tan(25 * (Math.PI / 180)), Ne = {
1292
- veryclose: ee / 4,
1293
- closer: ee / 3,
1294
- close: ee / 2.5,
1295
- midclose: ee / 2,
1296
- medium: ee,
1297
- midfar: ee * 2,
1298
- far: ee * 2.5,
1299
- farther: ee * 3,
1300
- veryfar: ee * 4
1287
+ higherthigh: new B.Vector3(Z, L.y + K / 32 * 15, F),
1288
+ thigh: new B.Vector3(Z, L.y + K / 8 * 3, F),
1289
+ knee: new B.Vector3(Z, L.y + K / 4, F),
1290
+ leg: new B.Vector3(Z, L.y + K / 8, F),
1291
+ feet: new B.Vector3(Z, L.y, F)
1292
+ }, te = (_.y - (L.y + K / 7 * 2)) / 2 / Math.tan(25 * (Math.PI / 180)), Ce = {
1293
+ veryclose: te / 4,
1294
+ closer: te / 3,
1295
+ close: te / 2.5,
1296
+ midclose: te / 2,
1297
+ medium: te,
1298
+ midfar: te * 2,
1299
+ far: te * 2.5,
1300
+ farther: te * 3,
1301
+ veryfar: te * 4
1301
1302
  };
1302
- Js(me), en(Ne);
1303
+ Js(me), en(Ce);
1303
1304
  } catch (P) {
1304
1305
  console.warn(P);
1305
1306
  }
1306
- Z(!0);
1307
+ j(!0);
1307
1308
  }
1308
1309
  };
1309
- return /* @__PURE__ */ D.createElement(Un, { parentGpuTier: u, setIsGpuAvailable: w, tonemapping: i, inspector: V }, A ? /* @__PURE__ */ D.createElement(D.Fragment, null, l && /* @__PURE__ */ D.createElement(Gn, { character: l, autoLookAt: !!f }), l && /* @__PURE__ */ D.createElement(D.Fragment, null, /* @__PURE__ */ D.createElement(ps, { preset: g }), /* @__PURE__ */ D.createElement("primitive", { object: l, castShadow: !0, receiveShadow: !0 }))) : /* @__PURE__ */ D.createElement(D.Fragment, null));
1310
+ return /* @__PURE__ */ D.createElement(Un, { parentGpuTier: d, setIsGpuAvailable: C, tonemapping: c, inspector: V }, A ? /* @__PURE__ */ D.createElement(D.Fragment, null, N && /* @__PURE__ */ D.createElement(Gn, { character: N, autoLookAt: !!f }), N && /* @__PURE__ */ D.createElement(D.Fragment, null, /* @__PURE__ */ D.createElement(ps, { preset: g }), /* @__PURE__ */ D.createElement("primitive", { object: N, castShadow: !0, receiveShadow: !0 }))) : /* @__PURE__ */ D.createElement(D.Fragment, null));
1310
1311
  }, Hn = {
1311
1312
  emotions: [],
1312
1313
  currentTopEmotion: lt.Neutral,
1313
1314
  useTopEmotionOnly: !0,
1314
1315
  autoDecay: !1
1315
- }, Ve = Ce()(() => Hn), So = (e) => {
1316
+ }, Ve = we()(() => Hn), So = (e) => {
1316
1317
  if (Ve.setState({ emotions: e || [] }), e != null && e.length) {
1317
1318
  const t = e.reduce((s, a) => s.value > a.value ? s : a);
1318
1319
  Ve.setState({ currentTopEmotion: t.emotion });
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":"7f9b80b9-1","name":"vanilla.mjs"},{"uid":"7f9b80b9-3","name":"react.mjs"}]},{"name":"src","children":[{"name":"contexts","children":[{"uid":"7f9b80b9-5","name":"characterStore.ts"},{"uid":"7f9b80b9-7","name":"cameraStore.ts"},{"uid":"7f9b80b9-9","name":"headStore.ts"},{"uid":"7f9b80b9-11","name":"animationStore.ts"},{"uid":"7f9b80b9-17","name":"speechStore.ts"},{"uid":"7f9b80b9-41","name":"emotionStore.ts"}]},{"name":"models","children":[{"uid":"7f9b80b9-13","name":"enums.ts"},{"uid":"7f9b80b9-15","name":"constants.ts"}]},{"name":"utils/getCameraPositionVector.ts","uid":"7f9b80b9-19"},{"name":"components","children":[{"name":"PostProcessing","children":[{"uid":"7f9b80b9-21","name":"TRAANode.js"},{"uid":"7f9b80b9-23","name":"SSGINode.js"},{"uid":"7f9b80b9-25","name":"DenoiseNode.js"},{"uid":"7f9b80b9-27","name":"CASNode.js"},{"uid":"7f9b80b9-29","name":"pipelines.ts"}]},{"uid":"7f9b80b9-31","name":"SpeechManager.tsx"},{"uid":"7f9b80b9-33","name":"HorizontalLine.tsx"},{"uid":"7f9b80b9-35","name":"Scene.tsx"},{"name":"Controllers/CharacterController.ts","uid":"7f9b80b9-37"},{"uid":"7f9b80b9-39","name":"Character.tsx"}]},{"uid":"7f9b80b9-43","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"7f9b80b9-1":{"renderedLength":975,"gzipLength":394,"brotliLength":353,"metaUid":"7f9b80b9-0"},"7f9b80b9-3":{"renderedLength":593,"gzipLength":285,"brotliLength":235,"metaUid":"7f9b80b9-2"},"7f9b80b9-5":{"renderedLength":2066,"gzipLength":439,"brotliLength":380,"metaUid":"7f9b80b9-4"},"7f9b80b9-7":{"renderedLength":1028,"gzipLength":293,"brotliLength":249,"metaUid":"7f9b80b9-6"},"7f9b80b9-9":{"renderedLength":1154,"gzipLength":359,"brotliLength":315,"metaUid":"7f9b80b9-8"},"7f9b80b9-11":{"renderedLength":854,"gzipLength":308,"brotliLength":274,"metaUid":"7f9b80b9-10"},"7f9b80b9-13":{"renderedLength":2645,"gzipLength":700,"brotliLength":620,"metaUid":"7f9b80b9-12"},"7f9b80b9-15":{"renderedLength":2774,"gzipLength":852,"brotliLength":740,"metaUid":"7f9b80b9-14"},"7f9b80b9-17":{"renderedLength":2675,"gzipLength":668,"brotliLength":633,"metaUid":"7f9b80b9-16"},"7f9b80b9-19":{"renderedLength":2356,"gzipLength":571,"brotliLength":491,"metaUid":"7f9b80b9-18"},"7f9b80b9-21":{"renderedLength":28077,"gzipLength":7145,"brotliLength":6234,"metaUid":"7f9b80b9-20"},"7f9b80b9-23":{"renderedLength":25103,"gzipLength":6860,"brotliLength":5937,"metaUid":"7f9b80b9-22"},"7f9b80b9-25":{"renderedLength":9917,"gzipLength":3018,"brotliLength":2626,"metaUid":"7f9b80b9-24"},"7f9b80b9-27":{"renderedLength":5776,"gzipLength":2316,"brotliLength":2006,"metaUid":"7f9b80b9-26"},"7f9b80b9-29":{"renderedLength":4516,"gzipLength":1512,"brotliLength":1368,"metaUid":"7f9b80b9-28"},"7f9b80b9-31":{"renderedLength":5139,"gzipLength":1153,"brotliLength":1063,"metaUid":"7f9b80b9-30"},"7f9b80b9-33":{"renderedLength":383,"gzipLength":251,"brotliLength":209,"metaUid":"7f9b80b9-32"},"7f9b80b9-35":{"renderedLength":10653,"gzipLength":3076,"brotliLength":2718,"metaUid":"7f9b80b9-34"},"7f9b80b9-37":{"renderedLength":1366,"gzipLength":442,"brotliLength":408,"metaUid":"7f9b80b9-36"},"7f9b80b9-39":{"renderedLength":7070,"gzipLength":1850,"brotliLength":1651,"metaUid":"7f9b80b9-38"},"7f9b80b9-41":{"renderedLength":949,"gzipLength":361,"brotliLength":320,"metaUid":"7f9b80b9-40"},"7f9b80b9-43":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"7f9b80b9-42"}},"nodeMetas":{"7f9b80b9-0":{"id":"D:/a/1/s/packages/reactjs/node_modules/zustand/esm/vanilla.mjs","moduleParts":{"index.js":"7f9b80b9-1"},"imported":[],"importedBy":[{"uid":"7f9b80b9-48"},{"uid":"7f9b80b9-2"}]},"7f9b80b9-2":{"id":"D:/a/1/s/packages/reactjs/node_modules/zustand/esm/react.mjs","moduleParts":{"index.js":"7f9b80b9-3"},"imported":[{"uid":"7f9b80b9-46"},{"uid":"7f9b80b9-0"}],"importedBy":[{"uid":"7f9b80b9-48"}]},"7f9b80b9-4":{"id":"D:/a/1/s/packages/reactjs/src/contexts/characterStore.ts","moduleParts":{"index.js":"7f9b80b9-5"},"imported":[{"uid":"7f9b80b9-48"},{"uid":"7f9b80b9-44"}],"importedBy":[{"uid":"7f9b80b9-42"},{"uid":"7f9b80b9-38"},{"uid":"7f9b80b9-16"},{"uid":"7f9b80b9-8"},{"uid":"7f9b80b9-40"},{"uid":"7f9b80b9-10"},{"uid":"7f9b80b9-36"},{"uid":"7f9b80b9-30"}]},"7f9b80b9-6":{"id":"D:/a/1/s/packages/reactjs/src/contexts/cameraStore.ts","moduleParts":{"index.js":"7f9b80b9-7"},"imported":[{"uid":"7f9b80b9-48"},{"uid":"7f9b80b9-45"}],"importedBy":[{"uid":"7f9b80b9-42"},{"uid":"7f9b80b9-38"},{"uid":"7f9b80b9-8"},{"uid":"7f9b80b9-34"},{"uid":"7f9b80b9-36"}]},"7f9b80b9-8":{"id":"D:/a/1/s/packages/reactjs/src/contexts/headStore.ts","moduleParts":{"index.js":"7f9b80b9-9"},"imported":[{"uid":"7f9b80b9-48"},{"uid":"7f9b80b9-4"},{"uid":"7f9b80b9-6"}],"importedBy":[{"uid":"7f9b80b9-42"},{"uid":"7f9b80b9-38"},{"uid":"7f9b80b9-34"},{"uid":"7f9b80b9-36"}]},"7f9b80b9-10":{"id":"D:/a/1/s/packages/reactjs/src/contexts/animationStore.ts","moduleParts":{"index.js":"7f9b80b9-11"},"imported":[{"uid":"7f9b80b9-48"},{"uid":"7f9b80b9-4"}],"importedBy":[{"uid":"7f9b80b9-42"},{"uid":"7f9b80b9-38"}]},"7f9b80b9-12":{"id":"D:/a/1/s/packages/reactjs/src/models/enums.ts","moduleParts":{"index.js":"7f9b80b9-13"},"imported":[],"importedBy":[{"uid":"7f9b80b9-42"},{"uid":"7f9b80b9-38"},{"uid":"7f9b80b9-40"},{"uid":"7f9b80b9-14"},{"uid":"7f9b80b9-18"}]},"7f9b80b9-14":{"id":"D:/a/1/s/packages/reactjs/src/models/constants.ts","moduleParts":{"index.js":"7f9b80b9-15"},"imported":[{"uid":"7f9b80b9-12"}],"importedBy":[{"uid":"7f9b80b9-42"},{"uid":"7f9b80b9-16"},{"uid":"7f9b80b9-30"}]},"7f9b80b9-16":{"id":"D:/a/1/s/packages/reactjs/src/contexts/speechStore.ts","moduleParts":{"index.js":"7f9b80b9-17"},"imported":[{"uid":"7f9b80b9-48"},{"uid":"7f9b80b9-4"},{"uid":"7f9b80b9-14"}],"importedBy":[{"uid":"7f9b80b9-42"},{"uid":"7f9b80b9-38"},{"uid":"7f9b80b9-30"}]},"7f9b80b9-18":{"id":"D:/a/1/s/packages/reactjs/src/utils/getCameraPositionVector.ts","moduleParts":{"index.js":"7f9b80b9-19"},"imported":[{"uid":"7f9b80b9-45"},{"uid":"7f9b80b9-12"}],"importedBy":[{"uid":"7f9b80b9-38"}]},"7f9b80b9-20":{"id":"D:/a/1/s/packages/reactjs/src/components/PostProcessing/TRAANode.js","moduleParts":{"index.js":"7f9b80b9-21"},"imported":[{"uid":"7f9b80b9-45"},{"uid":"7f9b80b9-49"}],"importedBy":[{"uid":"7f9b80b9-28"}]},"7f9b80b9-22":{"id":"D:/a/1/s/packages/reactjs/src/components/PostProcessing/SSGINode.js","moduleParts":{"index.js":"7f9b80b9-23"},"imported":[{"uid":"7f9b80b9-45"},{"uid":"7f9b80b9-49"}],"importedBy":[{"uid":"7f9b80b9-28"}]},"7f9b80b9-24":{"id":"D:/a/1/s/packages/reactjs/src/components/PostProcessing/DenoiseNode.js","moduleParts":{"index.js":"7f9b80b9-25"},"imported":[{"uid":"7f9b80b9-45"},{"uid":"7f9b80b9-49"},{"uid":"7f9b80b9-53"}],"importedBy":[{"uid":"7f9b80b9-28"}]},"7f9b80b9-26":{"id":"D:/a/1/s/packages/reactjs/src/components/PostProcessing/CASNode.js","moduleParts":{"index.js":"7f9b80b9-27"},"imported":[{"uid":"7f9b80b9-45"},{"uid":"7f9b80b9-49"}],"importedBy":[{"uid":"7f9b80b9-28"}]},"7f9b80b9-28":{"id":"D:/a/1/s/packages/reactjs/src/components/PostProcessing/pipelines.ts","moduleParts":{"index.js":"7f9b80b9-29"},"imported":[{"uid":"7f9b80b9-45"},{"uid":"7f9b80b9-49"},{"uid":"7f9b80b9-44"},{"uid":"7f9b80b9-20"},{"uid":"7f9b80b9-22"},{"uid":"7f9b80b9-24"},{"uid":"7f9b80b9-26"}],"importedBy":[{"uid":"7f9b80b9-34"}]},"7f9b80b9-30":{"id":"D:/a/1/s/packages/reactjs/src/components/SpeechManager.tsx","moduleParts":{"index.js":"7f9b80b9-31"},"imported":[{"uid":"7f9b80b9-46"},{"uid":"7f9b80b9-16"},{"uid":"7f9b80b9-4"},{"uid":"7f9b80b9-52"},{"uid":"7f9b80b9-14"},{"uid":"7f9b80b9-44"}],"importedBy":[{"uid":"7f9b80b9-34"}]},"7f9b80b9-32":{"id":"D:/a/1/s/packages/reactjs/src/components/HorizontalLine.tsx","moduleParts":{"index.js":"7f9b80b9-33"},"imported":[{"uid":"7f9b80b9-46"},{"uid":"7f9b80b9-45"}],"importedBy":[{"uid":"7f9b80b9-34"}]},"7f9b80b9-34":{"id":"D:/a/1/s/packages/reactjs/src/components/Scene.tsx","moduleParts":{"index.js":"7f9b80b9-35"},"imported":[{"uid":"7f9b80b9-46"},{"uid":"7f9b80b9-45"},{"uid":"7f9b80b9-49"},{"uid":"7f9b80b9-28"},{"uid":"7f9b80b9-47"},{"uid":"7f9b80b9-50"},{"uid":"7f9b80b9-6"},{"uid":"7f9b80b9-8"},{"uid":"7f9b80b9-30"},{"uid":"7f9b80b9-32"},{"uid":"7f9b80b9-51","dynamic":true}],"importedBy":[{"uid":"7f9b80b9-38"}]},"7f9b80b9-36":{"id":"D:/a/1/s/packages/reactjs/src/components/Controllers/CharacterController.ts","moduleParts":{"index.js":"7f9b80b9-37"},"imported":[{"uid":"7f9b80b9-46"},{"uid":"7f9b80b9-4"},{"uid":"7f9b80b9-44"},{"uid":"7f9b80b9-50"},{"uid":"7f9b80b9-8"},{"uid":"7f9b80b9-6"}],"importedBy":[{"uid":"7f9b80b9-38"}]},"7f9b80b9-38":{"id":"D:/a/1/s/packages/reactjs/src/components/Character.tsx","moduleParts":{"index.js":"7f9b80b9-39"},"imported":[{"uid":"7f9b80b9-46"},{"uid":"7f9b80b9-45"},{"uid":"7f9b80b9-44"},{"uid":"7f9b80b9-47"},{"uid":"7f9b80b9-8"},{"uid":"7f9b80b9-4"},{"uid":"7f9b80b9-10"},{"uid":"7f9b80b9-6"},{"uid":"7f9b80b9-16"},{"uid":"7f9b80b9-12"},{"uid":"7f9b80b9-18"},{"uid":"7f9b80b9-34"},{"uid":"7f9b80b9-36"}],"importedBy":[{"uid":"7f9b80b9-42"}]},"7f9b80b9-40":{"id":"D:/a/1/s/packages/reactjs/src/contexts/emotionStore.ts","moduleParts":{"index.js":"7f9b80b9-41"},"imported":[{"uid":"7f9b80b9-48"},{"uid":"7f9b80b9-12"},{"uid":"7f9b80b9-4"}],"importedBy":[{"uid":"7f9b80b9-42"}]},"7f9b80b9-42":{"id":"D:/a/1/s/packages/reactjs/src/index.ts","moduleParts":{"index.js":"7f9b80b9-43"},"imported":[{"uid":"7f9b80b9-38"},{"uid":"7f9b80b9-4"},{"uid":"7f9b80b9-16"},{"uid":"7f9b80b9-6"},{"uid":"7f9b80b9-8"},{"uid":"7f9b80b9-40"},{"uid":"7f9b80b9-10"},{"uid":"7f9b80b9-44"},{"uid":"7f9b80b9-12"},{"uid":"7f9b80b9-14"},{"uid":"7f9b80b9-45"}],"importedBy":[],"isEntry":true},"7f9b80b9-44":{"id":"@davi-ai/bodyengine-three","moduleParts":{},"imported":[],"importedBy":[{"uid":"7f9b80b9-42"},{"uid":"7f9b80b9-38"},{"uid":"7f9b80b9-4"},{"uid":"7f9b80b9-36"},{"uid":"7f9b80b9-28"},{"uid":"7f9b80b9-30"}],"isExternal":true},"7f9b80b9-45":{"id":"three/webgpu","moduleParts":{},"imported":[],"importedBy":[{"uid":"7f9b80b9-42"},{"uid":"7f9b80b9-38"},{"uid":"7f9b80b9-6"},{"uid":"7f9b80b9-18"},{"uid":"7f9b80b9-34"},{"uid":"7f9b80b9-28"},{"uid":"7f9b80b9-32"},{"uid":"7f9b80b9-20"},{"uid":"7f9b80b9-22"},{"uid":"7f9b80b9-24"},{"uid":"7f9b80b9-26"}],"isExternal":true},"7f9b80b9-46":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"7f9b80b9-38"},{"uid":"7f9b80b9-34"},{"uid":"7f9b80b9-36"},{"uid":"7f9b80b9-30"},{"uid":"7f9b80b9-32"},{"uid":"7f9b80b9-2"}],"isExternal":true},"7f9b80b9-47":{"id":"@react-three/drei","moduleParts":{},"imported":[],"importedBy":[{"uid":"7f9b80b9-38"},{"uid":"7f9b80b9-34"}],"isExternal":true},"7f9b80b9-48":{"id":"D:/a/1/s/packages/reactjs/node_modules/zustand/esm/index.mjs","moduleParts":{},"imported":[{"uid":"7f9b80b9-0"},{"uid":"7f9b80b9-2"}],"importedBy":[{"uid":"7f9b80b9-4"},{"uid":"7f9b80b9-16"},{"uid":"7f9b80b9-6"},{"uid":"7f9b80b9-8"},{"uid":"7f9b80b9-40"},{"uid":"7f9b80b9-10"}]},"7f9b80b9-49":{"id":"three/tsl","moduleParts":{},"imported":[],"importedBy":[{"uid":"7f9b80b9-34"},{"uid":"7f9b80b9-28"},{"uid":"7f9b80b9-20"},{"uid":"7f9b80b9-22"},{"uid":"7f9b80b9-24"},{"uid":"7f9b80b9-26"}],"isExternal":true},"7f9b80b9-50":{"id":"@react-three/fiber","moduleParts":{},"imported":[],"importedBy":[{"uid":"7f9b80b9-34"},{"uid":"7f9b80b9-36"}],"isExternal":true},"7f9b80b9-51":{"id":"three/addons/inspector/Inspector.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"7f9b80b9-34"}],"isExternal":true},"7f9b80b9-52":{"id":"@davi-ai/web-speech-cognitive-services-davi","moduleParts":{},"imported":[],"importedBy":[{"uid":"7f9b80b9-30"}],"isExternal":true},"7f9b80b9-53":{"id":"three/examples/jsm/math/SimplexNoise.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"7f9b80b9-24"}],"isExternal":true}},"env":{"rollup":"4.63.5"},"options":{"gzip":true,"brotli":true,"sourcemap":false}};
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":"13322081-1","name":"vanilla.mjs"},{"uid":"13322081-3","name":"react.mjs"}]},{"name":"src","children":[{"name":"contexts","children":[{"uid":"13322081-5","name":"characterStore.ts"},{"uid":"13322081-7","name":"cameraStore.ts"},{"uid":"13322081-9","name":"headStore.ts"},{"uid":"13322081-11","name":"animationStore.ts"},{"uid":"13322081-17","name":"speechStore.ts"},{"uid":"13322081-41","name":"emotionStore.ts"}]},{"name":"models","children":[{"uid":"13322081-13","name":"enums.ts"},{"uid":"13322081-15","name":"constants.ts"}]},{"name":"utils/getCameraPositionVector.ts","uid":"13322081-19"},{"name":"components","children":[{"name":"PostProcessing","children":[{"uid":"13322081-21","name":"TRAANode.js"},{"uid":"13322081-23","name":"SSGINode.js"},{"uid":"13322081-25","name":"DenoiseNode.js"},{"uid":"13322081-27","name":"CASNode.js"},{"uid":"13322081-29","name":"pipelines.ts"}]},{"uid":"13322081-31","name":"SpeechManager.tsx"},{"uid":"13322081-33","name":"HorizontalLine.tsx"},{"uid":"13322081-35","name":"Scene.tsx"},{"name":"Controllers/CharacterController.ts","uid":"13322081-37"},{"uid":"13322081-39","name":"Character.tsx"}]},{"uid":"13322081-43","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"13322081-1":{"renderedLength":975,"gzipLength":394,"brotliLength":353,"metaUid":"13322081-0"},"13322081-3":{"renderedLength":593,"gzipLength":285,"brotliLength":235,"metaUid":"13322081-2"},"13322081-5":{"renderedLength":2066,"gzipLength":439,"brotliLength":380,"metaUid":"13322081-4"},"13322081-7":{"renderedLength":1028,"gzipLength":293,"brotliLength":249,"metaUid":"13322081-6"},"13322081-9":{"renderedLength":1154,"gzipLength":359,"brotliLength":315,"metaUid":"13322081-8"},"13322081-11":{"renderedLength":854,"gzipLength":308,"brotliLength":274,"metaUid":"13322081-10"},"13322081-13":{"renderedLength":2645,"gzipLength":700,"brotliLength":620,"metaUid":"13322081-12"},"13322081-15":{"renderedLength":2774,"gzipLength":852,"brotliLength":740,"metaUid":"13322081-14"},"13322081-17":{"renderedLength":2675,"gzipLength":668,"brotliLength":633,"metaUid":"13322081-16"},"13322081-19":{"renderedLength":2356,"gzipLength":571,"brotliLength":491,"metaUid":"13322081-18"},"13322081-21":{"renderedLength":28077,"gzipLength":7145,"brotliLength":6234,"metaUid":"13322081-20"},"13322081-23":{"renderedLength":25103,"gzipLength":6860,"brotliLength":5937,"metaUid":"13322081-22"},"13322081-25":{"renderedLength":9917,"gzipLength":3018,"brotliLength":2626,"metaUid":"13322081-24"},"13322081-27":{"renderedLength":5776,"gzipLength":2316,"brotliLength":2006,"metaUid":"13322081-26"},"13322081-29":{"renderedLength":4516,"gzipLength":1512,"brotliLength":1368,"metaUid":"13322081-28"},"13322081-31":{"renderedLength":5139,"gzipLength":1153,"brotliLength":1063,"metaUid":"13322081-30"},"13322081-33":{"renderedLength":383,"gzipLength":251,"brotliLength":209,"metaUid":"13322081-32"},"13322081-35":{"renderedLength":10770,"gzipLength":3098,"brotliLength":2740,"metaUid":"13322081-34"},"13322081-37":{"renderedLength":1366,"gzipLength":442,"brotliLength":408,"metaUid":"13322081-36"},"13322081-39":{"renderedLength":7070,"gzipLength":1850,"brotliLength":1651,"metaUid":"13322081-38"},"13322081-41":{"renderedLength":949,"gzipLength":361,"brotliLength":320,"metaUid":"13322081-40"},"13322081-43":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"13322081-42"}},"nodeMetas":{"13322081-0":{"id":"D:/a/1/s/packages/reactjs/node_modules/zustand/esm/vanilla.mjs","moduleParts":{"index.js":"13322081-1"},"imported":[],"importedBy":[{"uid":"13322081-48"},{"uid":"13322081-2"}]},"13322081-2":{"id":"D:/a/1/s/packages/reactjs/node_modules/zustand/esm/react.mjs","moduleParts":{"index.js":"13322081-3"},"imported":[{"uid":"13322081-46"},{"uid":"13322081-0"}],"importedBy":[{"uid":"13322081-48"}]},"13322081-4":{"id":"D:/a/1/s/packages/reactjs/src/contexts/characterStore.ts","moduleParts":{"index.js":"13322081-5"},"imported":[{"uid":"13322081-48"},{"uid":"13322081-44"}],"importedBy":[{"uid":"13322081-42"},{"uid":"13322081-38"},{"uid":"13322081-16"},{"uid":"13322081-8"},{"uid":"13322081-40"},{"uid":"13322081-10"},{"uid":"13322081-36"},{"uid":"13322081-30"}]},"13322081-6":{"id":"D:/a/1/s/packages/reactjs/src/contexts/cameraStore.ts","moduleParts":{"index.js":"13322081-7"},"imported":[{"uid":"13322081-48"},{"uid":"13322081-45"}],"importedBy":[{"uid":"13322081-42"},{"uid":"13322081-38"},{"uid":"13322081-8"},{"uid":"13322081-34"},{"uid":"13322081-36"}]},"13322081-8":{"id":"D:/a/1/s/packages/reactjs/src/contexts/headStore.ts","moduleParts":{"index.js":"13322081-9"},"imported":[{"uid":"13322081-48"},{"uid":"13322081-4"},{"uid":"13322081-6"}],"importedBy":[{"uid":"13322081-42"},{"uid":"13322081-38"},{"uid":"13322081-34"},{"uid":"13322081-36"}]},"13322081-10":{"id":"D:/a/1/s/packages/reactjs/src/contexts/animationStore.ts","moduleParts":{"index.js":"13322081-11"},"imported":[{"uid":"13322081-48"},{"uid":"13322081-4"}],"importedBy":[{"uid":"13322081-42"},{"uid":"13322081-38"}]},"13322081-12":{"id":"D:/a/1/s/packages/reactjs/src/models/enums.ts","moduleParts":{"index.js":"13322081-13"},"imported":[],"importedBy":[{"uid":"13322081-42"},{"uid":"13322081-38"},{"uid":"13322081-40"},{"uid":"13322081-14"},{"uid":"13322081-18"}]},"13322081-14":{"id":"D:/a/1/s/packages/reactjs/src/models/constants.ts","moduleParts":{"index.js":"13322081-15"},"imported":[{"uid":"13322081-12"}],"importedBy":[{"uid":"13322081-42"},{"uid":"13322081-16"},{"uid":"13322081-30"}]},"13322081-16":{"id":"D:/a/1/s/packages/reactjs/src/contexts/speechStore.ts","moduleParts":{"index.js":"13322081-17"},"imported":[{"uid":"13322081-48"},{"uid":"13322081-4"},{"uid":"13322081-14"}],"importedBy":[{"uid":"13322081-42"},{"uid":"13322081-38"},{"uid":"13322081-30"}]},"13322081-18":{"id":"D:/a/1/s/packages/reactjs/src/utils/getCameraPositionVector.ts","moduleParts":{"index.js":"13322081-19"},"imported":[{"uid":"13322081-45"},{"uid":"13322081-12"}],"importedBy":[{"uid":"13322081-38"}]},"13322081-20":{"id":"D:/a/1/s/packages/reactjs/src/components/PostProcessing/TRAANode.js","moduleParts":{"index.js":"13322081-21"},"imported":[{"uid":"13322081-45"},{"uid":"13322081-49"}],"importedBy":[{"uid":"13322081-28"}]},"13322081-22":{"id":"D:/a/1/s/packages/reactjs/src/components/PostProcessing/SSGINode.js","moduleParts":{"index.js":"13322081-23"},"imported":[{"uid":"13322081-45"},{"uid":"13322081-49"}],"importedBy":[{"uid":"13322081-28"}]},"13322081-24":{"id":"D:/a/1/s/packages/reactjs/src/components/PostProcessing/DenoiseNode.js","moduleParts":{"index.js":"13322081-25"},"imported":[{"uid":"13322081-45"},{"uid":"13322081-49"},{"uid":"13322081-53"}],"importedBy":[{"uid":"13322081-28"}]},"13322081-26":{"id":"D:/a/1/s/packages/reactjs/src/components/PostProcessing/CASNode.js","moduleParts":{"index.js":"13322081-27"},"imported":[{"uid":"13322081-45"},{"uid":"13322081-49"}],"importedBy":[{"uid":"13322081-28"}]},"13322081-28":{"id":"D:/a/1/s/packages/reactjs/src/components/PostProcessing/pipelines.ts","moduleParts":{"index.js":"13322081-29"},"imported":[{"uid":"13322081-45"},{"uid":"13322081-49"},{"uid":"13322081-44"},{"uid":"13322081-20"},{"uid":"13322081-22"},{"uid":"13322081-24"},{"uid":"13322081-26"}],"importedBy":[{"uid":"13322081-34"}]},"13322081-30":{"id":"D:/a/1/s/packages/reactjs/src/components/SpeechManager.tsx","moduleParts":{"index.js":"13322081-31"},"imported":[{"uid":"13322081-46"},{"uid":"13322081-16"},{"uid":"13322081-4"},{"uid":"13322081-52"},{"uid":"13322081-14"},{"uid":"13322081-44"}],"importedBy":[{"uid":"13322081-34"}]},"13322081-32":{"id":"D:/a/1/s/packages/reactjs/src/components/HorizontalLine.tsx","moduleParts":{"index.js":"13322081-33"},"imported":[{"uid":"13322081-46"},{"uid":"13322081-45"}],"importedBy":[{"uid":"13322081-34"}]},"13322081-34":{"id":"D:/a/1/s/packages/reactjs/src/components/Scene.tsx","moduleParts":{"index.js":"13322081-35"},"imported":[{"uid":"13322081-46"},{"uid":"13322081-45"},{"uid":"13322081-49"},{"uid":"13322081-28"},{"uid":"13322081-47"},{"uid":"13322081-50"},{"uid":"13322081-6"},{"uid":"13322081-8"},{"uid":"13322081-30"},{"uid":"13322081-32"},{"uid":"13322081-51","dynamic":true}],"importedBy":[{"uid":"13322081-38"}]},"13322081-36":{"id":"D:/a/1/s/packages/reactjs/src/components/Controllers/CharacterController.ts","moduleParts":{"index.js":"13322081-37"},"imported":[{"uid":"13322081-46"},{"uid":"13322081-4"},{"uid":"13322081-44"},{"uid":"13322081-50"},{"uid":"13322081-8"},{"uid":"13322081-6"}],"importedBy":[{"uid":"13322081-38"}]},"13322081-38":{"id":"D:/a/1/s/packages/reactjs/src/components/Character.tsx","moduleParts":{"index.js":"13322081-39"},"imported":[{"uid":"13322081-46"},{"uid":"13322081-45"},{"uid":"13322081-44"},{"uid":"13322081-47"},{"uid":"13322081-8"},{"uid":"13322081-4"},{"uid":"13322081-10"},{"uid":"13322081-6"},{"uid":"13322081-16"},{"uid":"13322081-12"},{"uid":"13322081-18"},{"uid":"13322081-34"},{"uid":"13322081-36"}],"importedBy":[{"uid":"13322081-42"}]},"13322081-40":{"id":"D:/a/1/s/packages/reactjs/src/contexts/emotionStore.ts","moduleParts":{"index.js":"13322081-41"},"imported":[{"uid":"13322081-48"},{"uid":"13322081-12"},{"uid":"13322081-4"}],"importedBy":[{"uid":"13322081-42"}]},"13322081-42":{"id":"D:/a/1/s/packages/reactjs/src/index.ts","moduleParts":{"index.js":"13322081-43"},"imported":[{"uid":"13322081-38"},{"uid":"13322081-4"},{"uid":"13322081-16"},{"uid":"13322081-6"},{"uid":"13322081-8"},{"uid":"13322081-40"},{"uid":"13322081-10"},{"uid":"13322081-44"},{"uid":"13322081-12"},{"uid":"13322081-14"},{"uid":"13322081-45"}],"importedBy":[],"isEntry":true},"13322081-44":{"id":"@davi-ai/bodyengine-three","moduleParts":{},"imported":[],"importedBy":[{"uid":"13322081-42"},{"uid":"13322081-38"},{"uid":"13322081-4"},{"uid":"13322081-36"},{"uid":"13322081-28"},{"uid":"13322081-30"}],"isExternal":true},"13322081-45":{"id":"three/webgpu","moduleParts":{},"imported":[],"importedBy":[{"uid":"13322081-42"},{"uid":"13322081-38"},{"uid":"13322081-6"},{"uid":"13322081-18"},{"uid":"13322081-34"},{"uid":"13322081-28"},{"uid":"13322081-32"},{"uid":"13322081-20"},{"uid":"13322081-22"},{"uid":"13322081-24"},{"uid":"13322081-26"}],"isExternal":true},"13322081-46":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"13322081-38"},{"uid":"13322081-34"},{"uid":"13322081-36"},{"uid":"13322081-30"},{"uid":"13322081-32"},{"uid":"13322081-2"}],"isExternal":true},"13322081-47":{"id":"@react-three/drei","moduleParts":{},"imported":[],"importedBy":[{"uid":"13322081-38"},{"uid":"13322081-34"}],"isExternal":true},"13322081-48":{"id":"D:/a/1/s/packages/reactjs/node_modules/zustand/esm/index.mjs","moduleParts":{},"imported":[{"uid":"13322081-0"},{"uid":"13322081-2"}],"importedBy":[{"uid":"13322081-4"},{"uid":"13322081-16"},{"uid":"13322081-6"},{"uid":"13322081-8"},{"uid":"13322081-40"},{"uid":"13322081-10"}]},"13322081-49":{"id":"three/tsl","moduleParts":{},"imported":[],"importedBy":[{"uid":"13322081-34"},{"uid":"13322081-28"},{"uid":"13322081-20"},{"uid":"13322081-22"},{"uid":"13322081-24"},{"uid":"13322081-26"}],"isExternal":true},"13322081-50":{"id":"@react-three/fiber","moduleParts":{},"imported":[],"importedBy":[{"uid":"13322081-34"},{"uid":"13322081-36"}],"isExternal":true},"13322081-51":{"id":"three/addons/inspector/Inspector.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"13322081-34"}],"isExternal":true},"13322081-52":{"id":"@davi-ai/web-speech-cognitive-services-davi","moduleParts":{},"imported":[],"importedBy":[{"uid":"13322081-30"}],"isExternal":true},"13322081-53":{"id":"three/examples/jsm/math/SimplexNoise.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"13322081-24"}],"isExternal":true}},"env":{"rollup":"4.63.6"},"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.33",
3
+ "version": "1.0.34",
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.22",
25
+ "@davi-ai/bodyengine-three": "^1.0.23",
26
26
  "@davi-ai/web-speech-cognitive-services-davi": "^3.0.1",
27
27
  "@react-three/drei": "^10.0.0",
28
28
  "@react-three/fiber": "^9.0.0",