@needle-tools/engine 3.25.4 → 3.25.5

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.
@@ -10841,7 +10841,7 @@ function eW(i, A, e, t, g, I, o) {
10841
10841
  DA = ao.vertexShader, pA = ao.fragmentShader;
10842
10842
  } else
10843
10843
  DA = k.vertexShader, pA = k.fragmentShader, C.update(k), RA = C.getVertexShaderID(k), UA = C.getFragmentShaderID(k);
10844
- const HA = i.getRenderTarget(), PA = H.isInstancedMesh === !0, Be = !!k.map, Ge = !!k.matcap, oe = !!v, P = !!k.aoMap, xA = !!k.lightMap, fA = !!k.bumpMap, LA = !!k.normalMap, MA = !!k.displacementMap, ie = !!k.emissiveMap, zA = !!k.metalnessMap, ZA = !!k.roughnessMap, ue = k.anisotropy > 0, Me = k.clearcoat > 0, et = k.iridescence > 0, T = k.sheen > 0, q = k.transmission > 0, EA = ue && !!k.anisotropyMap, KA = Me && !!k.clearcoatMap, JA = Me && !!k.clearcoatNormalMap, TA = Me && !!k.clearcoatRoughnessMap, V = et && !!k.iridescenceMap, hA = et && !!k.iridescenceThicknessMap, rA = T && !!k.sheenColorMap, VA = T && !!k.sheenRoughnessMap, jA = !!k.specularMap, OA = !!k.specularColorMap, bA = !!k.specularIntensityMap, se = q && !!k.transmissionMap, fe = q && !!k.thicknessMap, ye = !!k.gradientMap, $ = !!k.alphaMap, cA = k.alphaTest > 0, lA = !!k.alphaHash, WA = !!k.extensions, XA = !!j.attributes.uv1, Ct = !!j.attributes.uv2, Kt = !!j.attributes.uv3;
10844
+ const HA = i.getRenderTarget(), PA = H.isInstancedMesh === !0, Be = !!k.map, Ge = !!k.matcap, oe = !!v, P = !!k.aoMap, xA = !!k.lightMap, fA = !!k.bumpMap, LA = !!k.normalMap, MA = !!k.displacementMap, ie = !!k.emissiveMap, zA = !!k.metalnessMap, ZA = !!k.roughnessMap, ue = k.anisotropy > 0, Me = k.clearcoat > 0, et = k.iridescence > 0, T = k.sheen > 0, q = k.transmission > 0, EA = ue && !!k.anisotropyMap, KA = Me && !!k.clearcoatMap, JA = Me && !!k.clearcoatNormalMap, TA = Me && !!k.clearcoatRoughnessMap, V = et && !!k.iridescenceMap, hA = et && !!k.iridescenceThicknessMap, rA = T && !!k.sheenColorMap, VA = T && !!k.sheenRoughnessMap, jA = !!k.specularMap, OA = !!k.specularColorMap, bA = !!k.specularIntensityMap, se = q && !!k.transmissionMap, fe = q && !!k.thicknessMap, ye = !!k.gradientMap, $ = !!k.alphaMap, cA = k.alphaTest > 0, lA = !!k.alphaHash, WA = !!k.extensions, XA = !!j.attributes.uv1, Ct = !!j.attributes.uv2, Jt = !!j.attributes.uv3;
10845
10845
  return {
10846
10846
  isWebGL2: a,
10847
10847
  shaderID: eA,
@@ -10928,7 +10928,7 @@ function eW(i, A, e, t, g, I, o) {
10928
10928
  vertexAlphas: k.vertexColors === !0 && !!j.attributes.color && j.attributes.color.itemSize === 4,
10929
10929
  vertexUv1s: XA,
10930
10930
  vertexUv2s: Ct,
10931
- vertexUv3s: Kt,
10931
+ vertexUv3s: Jt,
10932
10932
  pointsUvs: H.isPoints === !0 && !!j.attributes.uv && (Be || $),
10933
10933
  fog: !!_,
10934
10934
  useFog: k.fog === !0,
@@ -11550,8 +11550,8 @@ function EW(i, A, e) {
11550
11550
  setLocked: function(XA) {
11551
11551
  $ = XA;
11552
11552
  },
11553
- setClear: function(XA, Ct, Kt, mi, ao) {
11554
- ao === !0 && (XA *= mi, Ct *= mi, Kt *= mi), cA.set(XA, Ct, Kt, mi), WA.equals(cA) === !1 && (i.clearColor(XA, Ct, Kt, mi), WA.copy(cA));
11553
+ setClear: function(XA, Ct, Jt, mi, ao) {
11554
+ ao === !0 && (XA *= mi, Ct *= mi, Jt *= mi), cA.set(XA, Ct, Jt, mi), WA.equals(cA) === !1 && (i.clearColor(XA, Ct, Jt, mi), WA.copy(cA));
11555
11555
  },
11556
11556
  reset: function() {
11557
11557
  $ = !1, lA = null, WA.set(-1, 0, 0, 0);
@@ -11612,7 +11612,7 @@ function EW(i, A, e) {
11612
11612
  };
11613
11613
  }
11614
11614
  function o() {
11615
- let $ = !1, cA = null, lA = null, WA = null, XA = null, Ct = null, Kt = null, mi = null, ao = null;
11615
+ let $ = !1, cA = null, lA = null, WA = null, XA = null, Ct = null, Jt = null, mi = null, ao = null;
11616
11616
  return {
11617
11617
  setTest: function(_t) {
11618
11618
  $ || (_t ? HA(i.STENCIL_TEST) : PA(i.STENCIL_TEST));
@@ -11624,7 +11624,7 @@ function EW(i, A, e) {
11624
11624
  (lA !== _t || WA !== ro || XA !== rg) && (i.stencilFunc(_t, ro, rg), lA = _t, WA = ro, XA = rg);
11625
11625
  },
11626
11626
  setOp: function(_t, ro, rg) {
11627
- (Ct !== _t || Kt !== ro || mi !== rg) && (i.stencilOp(_t, ro, rg), Ct = _t, Kt = ro, mi = rg);
11627
+ (Ct !== _t || Jt !== ro || mi !== rg) && (i.stencilOp(_t, ro, rg), Ct = _t, Jt = ro, mi = rg);
11628
11628
  },
11629
11629
  setLocked: function(_t) {
11630
11630
  $ = _t;
@@ -11633,7 +11633,7 @@ function EW(i, A, e) {
11633
11633
  ao !== _t && (i.clearStencil(_t), ao = _t);
11634
11634
  },
11635
11635
  reset: function() {
11636
- $ = !1, cA = null, lA = null, WA = null, XA = null, Ct = null, Kt = null, mi = null, ao = null;
11636
+ $ = !1, cA = null, lA = null, WA = null, XA = null, Ct = null, Jt = null, mi = null, ao = null;
11637
11637
  }
11638
11638
  };
11639
11639
  }
@@ -11648,8 +11648,8 @@ function EW(i, A, e) {
11648
11648
  function RA($, cA, lA, WA) {
11649
11649
  const XA = new Uint8Array(4), Ct = i.createTexture();
11650
11650
  i.bindTexture($, Ct), i.texParameteri($, i.TEXTURE_MIN_FILTER, i.NEAREST), i.texParameteri($, i.TEXTURE_MAG_FILTER, i.NEAREST);
11651
- for (let Kt = 0; Kt < lA; Kt++)
11652
- t && ($ === i.TEXTURE_3D || $ === i.TEXTURE_2D_ARRAY) ? i.texImage3D(cA, 0, i.RGBA, 1, 1, WA, 0, i.RGBA, i.UNSIGNED_BYTE, XA) : i.texImage2D(cA + Kt, 0, i.RGBA, 1, 1, 0, i.RGBA, i.UNSIGNED_BYTE, XA);
11651
+ for (let Jt = 0; Jt < lA; Jt++)
11652
+ t && ($ === i.TEXTURE_3D || $ === i.TEXTURE_2D_ARRAY) ? i.texImage3D(cA, 0, i.RGBA, 1, 1, WA, 0, i.RGBA, i.UNSIGNED_BYTE, XA) : i.texImage2D(cA + Jt, 0, i.RGBA, 1, 1, 0, i.RGBA, i.UNSIGNED_BYTE, XA);
11653
11653
  return Ct;
11654
11654
  }
11655
11655
  const UA = {};
@@ -11669,7 +11669,7 @@ function EW(i, A, e) {
11669
11669
  if (lA = c.get(cA), lA === void 0 && (lA = [], c.set(cA, lA)), $.isWebGLMultipleRenderTargets) {
11670
11670
  const XA = $.texture;
11671
11671
  if (lA.length !== XA.length || lA[0] !== i.COLOR_ATTACHMENT0) {
11672
- for (let Ct = 0, Kt = XA.length; Ct < Kt; Ct++)
11672
+ for (let Ct = 0, Jt = XA.length; Ct < Jt; Ct++)
11673
11673
  lA[Ct] = i.COLOR_ATTACHMENT0 + Ct;
11674
11674
  lA.length = XA.length, WA = !0;
11675
11675
  }
@@ -11706,7 +11706,7 @@ function EW(i, A, e) {
11706
11706
  [Eb]: i.ONE_MINUS_DST_COLOR,
11707
11707
  [Bb]: i.ONE_MINUS_DST_ALPHA
11708
11708
  };
11709
- function fA($, cA, lA, WA, XA, Ct, Kt, mi) {
11709
+ function fA($, cA, lA, WA, XA, Ct, Jt, mi) {
11710
11710
  if ($ === ii) {
11711
11711
  h === !0 && (PA(i.BLEND), h = !1);
11712
11712
  return;
@@ -11753,7 +11753,7 @@ function EW(i, A, e) {
11753
11753
  }
11754
11754
  return;
11755
11755
  }
11756
- XA = XA || cA, Ct = Ct || lA, Kt = Kt || WA, (cA !== u || XA !== m) && (i.blendEquationSeparate(P[cA], P[XA]), u = cA, m = XA), (lA !== f || WA !== S || Ct !== M || Kt !== R) && (i.blendFuncSeparate(xA[lA], xA[WA], xA[Ct], xA[Kt]), f = lA, S = WA, M = Ct, R = Kt), p = $, k = !1;
11756
+ XA = XA || cA, Ct = Ct || lA, Jt = Jt || WA, (cA !== u || XA !== m) && (i.blendEquationSeparate(P[cA], P[XA]), u = cA, m = XA), (lA !== f || WA !== S || Ct !== M || Jt !== R) && (i.blendFuncSeparate(xA[lA], xA[WA], xA[Ct], xA[Jt]), f = lA, S = WA, M = Ct, R = Jt), p = $, k = !1;
11757
11757
  }
11758
11758
  function LA($, cA) {
11759
11759
  $.side === St ? PA(i.CULL_FACE) : HA(i.CULL_FACE);
@@ -13173,9 +13173,9 @@ class Da {
13173
13173
  N.removeEventListener("dispose", XA), Ct(N);
13174
13174
  }
13175
13175
  function Ct(y) {
13176
- Kt(y), zA.remove(y);
13176
+ Jt(y), zA.remove(y);
13177
13177
  }
13178
- function Kt(y) {
13178
+ function Jt(y) {
13179
13179
  const N = zA.get(y).programs;
13180
13180
  N !== void 0 && (N.forEach(function(b) {
13181
13181
  EA.releaseProgram(b);
@@ -13205,8 +13205,8 @@ class Da {
13205
13205
  if (O.isInstancedMesh)
13206
13206
  ce.renderInstances(Ae, ge, O.count);
13207
13207
  else if (b.isInstancedBufferGeometry) {
13208
- const le = b._maxInstanceCount !== void 0 ? b._maxInstanceCount : 1 / 0, Jt = Math.min(b.instanceCount, le);
13209
- ce.renderInstances(Ae, ge, Jt);
13208
+ const le = b._maxInstanceCount !== void 0 ? b._maxInstanceCount : 1 / 0, qt = Math.min(b.instanceCount, le);
13209
+ ce.renderInstances(Ae, ge, qt);
13210
13210
  } else
13211
13211
  ce.render(Ae, ge);
13212
13212
  }, this.compile = function(y, N) {
@@ -13349,23 +13349,23 @@ class Da {
13349
13349
  }
13350
13350
  function Gd(y, N, b, L, O) {
13351
13351
  N.isScene !== !0 && (N = Ge), ZA.resetTextureUnits();
13352
- const CA = N.fog, dA = L.isMeshStandardMaterial ? N.environment : null, wA = M === null ? u.outputColorSpace : M.isXRRenderTarget === !0 ? M.texture.colorSpace : Si, QA = (L.isMeshStandardMaterial ? Me : ue).get(L.envMap || dA), kA = L.vertexColors === !0 && !!b.attributes.color && b.attributes.color.itemSize === 4, qA = !!b.attributes.tangent && (!!L.normalMap || L.anisotropy > 0), vA = !!b.morphAttributes.position, Ae = !!b.morphAttributes.normal, Ee = !!b.morphAttributes.color, ge = L.toneMapped ? u.toneMapping : sI, re = b.morphAttributes.position || b.morphAttributes.normal || b.morphAttributes.color, ce = re !== void 0 ? re.length : 0, le = zA.get(L), Jt = d.state.lights;
13352
+ const CA = N.fog, dA = L.isMeshStandardMaterial ? N.environment : null, wA = M === null ? u.outputColorSpace : M.isXRRenderTarget === !0 ? M.texture.colorSpace : Si, QA = (L.isMeshStandardMaterial ? Me : ue).get(L.envMap || dA), kA = L.vertexColors === !0 && !!b.attributes.color && b.attributes.color.itemSize === 4, qA = !!b.attributes.tangent && (!!L.normalMap || L.anisotropy > 0), vA = !!b.morphAttributes.position, Ae = !!b.morphAttributes.normal, Ee = !!b.morphAttributes.color, ge = L.toneMapped ? u.toneMapping : sI, re = b.morphAttributes.position || b.morphAttributes.normal || b.morphAttributes.color, ce = re !== void 0 ? re.length : 0, le = zA.get(L), qt = d.state.lights;
13353
13353
  if (pA === !0 && (RA === !0 || y !== k)) {
13354
13354
  const Ai = y === k && L.id === R;
13355
13355
  V.setState(L, y, Ai);
13356
13356
  }
13357
13357
  let Qt = !1;
13358
- L.version === le.__version ? (le.needsLights && le.lightsStateVersion !== Jt.state.version || le.outputColorSpace !== wA || O.isInstancedMesh && le.instancing === !1 || !O.isInstancedMesh && le.instancing === !0 || O.isSkinnedMesh && le.skinning === !1 || !O.isSkinnedMesh && le.skinning === !0 || le.envMap !== QA || L.fog === !0 && le.fog !== CA || le.numClippingPlanes !== void 0 && (le.numClippingPlanes !== V.numPlanes || le.numIntersection !== V.numIntersection) || le.vertexAlphas !== kA || le.vertexTangents !== qA || le.morphTargets !== vA || le.morphNormals !== Ae || le.morphColors !== Ee || le.toneMapping !== ge || LA.isWebGL2 === !0 && le.morphTargetsCount !== ce) && (Qt = !0) : (Qt = !0, le.__version = L.version);
13358
+ L.version === le.__version ? (le.needsLights && le.lightsStateVersion !== qt.state.version || le.outputColorSpace !== wA || O.isInstancedMesh && le.instancing === !1 || !O.isInstancedMesh && le.instancing === !0 || O.isSkinnedMesh && le.skinning === !1 || !O.isSkinnedMesh && le.skinning === !0 || le.envMap !== QA || L.fog === !0 && le.fog !== CA || le.numClippingPlanes !== void 0 && (le.numClippingPlanes !== V.numPlanes || le.numIntersection !== V.numIntersection) || le.vertexAlphas !== kA || le.vertexTangents !== qA || le.morphTargets !== vA || le.morphNormals !== Ae || le.morphColors !== Ee || le.toneMapping !== ge || LA.isWebGL2 === !0 && le.morphTargetsCount !== ce) && (Qt = !0) : (Qt = !0, le.__version = L.version);
13359
13359
  let rt = le.currentProgram;
13360
13360
  Qt === !0 && (rt = ms(L, N, O));
13361
- let tt = !1, qt = !1, Rg = !1;
13361
+ let tt = !1, vt = !1, Rg = !1;
13362
13362
  const nt = rt.getUniforms(), je = le.uniforms;
13363
- if (MA.useProgram(rt.program) && (tt = !0, qt = !0, Rg = !0), L.id !== R && (R = L.id, qt = !0), tt || k !== y) {
13363
+ if (MA.useProgram(rt.program) && (tt = !0, vt = !0, Rg = !0), L.id !== R && (R = L.id, vt = !0), tt || k !== y) {
13364
13364
  if (nt.setValue(P, "projectionMatrix", y.projectionMatrix), LA.logarithmicDepthBuffer && nt.setValue(
13365
13365
  P,
13366
13366
  "logDepthBufFC",
13367
13367
  2 / (Math.log(y.far + 1) / Math.LN2)
13368
- ), k !== y && (k = y, qt = !0, Rg = !0), L.isShaderMaterial || L.isMeshPhongMaterial || L.isMeshToonMaterial || L.isMeshStandardMaterial || L.envMap) {
13368
+ ), k !== y && (k = y, vt = !0, Rg = !0), L.isShaderMaterial || L.isMeshPhongMaterial || L.isMeshToonMaterial || L.isMeshStandardMaterial || L.envMap) {
13369
13369
  const Ai = nt.map.cameraPosition;
13370
13370
  Ai !== void 0 && Ai.setValue(
13371
13371
  P,
@@ -13380,7 +13380,7 @@ class Da {
13380
13380
  Ai && (LA.floatVertexTextures ? (Ai.boneTexture === null && Ai.computeBoneTexture(), nt.setValue(P, "boneTexture", Ai.boneTexture, ZA), nt.setValue(P, "boneTextureSize", Ai.boneTextureSize)) : console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."));
13381
13381
  }
13382
13382
  const lt = b.morphAttributes;
13383
- if ((lt.position !== void 0 || lt.normal !== void 0 || lt.color !== void 0 && LA.isWebGL2 === !0) && VA.update(O, b, rt), (qt || le.receiveShadow !== O.receiveShadow) && (le.receiveShadow = O.receiveShadow, nt.setValue(P, "receiveShadow", O.receiveShadow)), L.isMeshGouraudMaterial && L.envMap !== null && (je.envMap.value = QA, je.flipEnvMap.value = QA.isCubeTexture && QA.isRenderTargetTexture === !1 ? -1 : 1), qt && (nt.setValue(P, "toneMappingExposure", u.toneMappingExposure), le.needsLights && jy(je, Rg), CA && L.fog === !0 && KA.refreshFogUniforms(je, CA), KA.refreshMaterialUniforms(je, L, v, x, UA), lp.upload(P, le.uniformsList, je, ZA)), L.isShaderMaterial && L.uniformsNeedUpdate === !0 && (lp.upload(P, le.uniformsList, je, ZA), L.uniformsNeedUpdate = !1), L.isSpriteMaterial && nt.setValue(P, "center", O.center), nt.setValue(P, "modelViewMatrix", O.modelViewMatrix), nt.setValue(P, "normalMatrix", O.normalMatrix), nt.setValue(P, "modelMatrix", O.matrixWorld), L.isShaderMaterial || L.isRawShaderMaterial) {
13383
+ if ((lt.position !== void 0 || lt.normal !== void 0 || lt.color !== void 0 && LA.isWebGL2 === !0) && VA.update(O, b, rt), (vt || le.receiveShadow !== O.receiveShadow) && (le.receiveShadow = O.receiveShadow, nt.setValue(P, "receiveShadow", O.receiveShadow)), L.isMeshGouraudMaterial && L.envMap !== null && (je.envMap.value = QA, je.flipEnvMap.value = QA.isCubeTexture && QA.isRenderTargetTexture === !1 ? -1 : 1), vt && (nt.setValue(P, "toneMappingExposure", u.toneMappingExposure), le.needsLights && jy(je, Rg), CA && L.fog === !0 && KA.refreshFogUniforms(je, CA), KA.refreshMaterialUniforms(je, L, v, x, UA), lp.upload(P, le.uniformsList, je, ZA)), L.isShaderMaterial && L.uniformsNeedUpdate === !0 && (lp.upload(P, le.uniformsList, je, ZA), L.uniformsNeedUpdate = !1), L.isSpriteMaterial && nt.setValue(P, "center", O.center), nt.setValue(P, "modelViewMatrix", O.modelViewMatrix), nt.setValue(P, "normalMatrix", O.normalMatrix), nt.setValue(P, "modelMatrix", O.matrixWorld), L.isShaderMaterial || L.isRawShaderMaterial) {
13384
13384
  const Ai = L.uniformsGroups;
13385
13385
  for (let nC = 0, Bo = Ai.length; nC < Bo; nC++)
13386
13386
  if (LA.isWebGL2) {
@@ -21294,7 +21294,7 @@ function g8() {
21294
21294
  return window.location.hostname.includes("glitch.me");
21295
21295
  }
21296
21296
  var sg = /* @__PURE__ */ ((i) => (i.ContextRegistered = "ContextRegistered", i.ContextCreationStart = "ContextCreationStart", i.ContextCreated = "ContextCreated", i.ContextFirstFrameRendered = "ContextFirstFrameRendered", i.ContextDestroyed = "ContextDestroyed", i.MissingCamera = "MissingCamera", i.ContextClearing = "ContextClearing", i.ContextCleared = "ContextCleared", i))(sg || {});
21297
- class xt {
21297
+ class Tt {
21298
21298
  /** The currently active (rendering) Needle Engine context */
21299
21299
  static get Current() {
21300
21300
  return globalThis["NeedleEngine.Context.Current"];
@@ -21347,7 +21347,7 @@ class xt {
21347
21347
  }
21348
21348
  }
21349
21349
  /** All currently registered Needle Engine contexts. Do not modify */
21350
- r(xt, "Registered", []), r(xt, "_callbacks", {});
21350
+ r(Tt, "Registered", []), r(Tt, "_callbacks", {});
21351
21351
  const hK = sA("debugdebug");
21352
21352
  let GQ = !1;
21353
21353
  (sA("noerrors") || sA("nooverlaymessages")) && (GQ = !0);
@@ -21393,7 +21393,7 @@ function o8(i) {
21393
21393
  function jC(i, A, e, t) {
21394
21394
  if (GQ)
21395
21395
  return;
21396
- const g = xt.Current, I = (g == null ? void 0 : g.domElement) ?? document.querySelector("needle-engine");
21396
+ const g = Tt.Current, I = (g == null ? void 0 : g.domElement) ?? document.querySelector("needle-engine");
21397
21397
  if (I) {
21398
21398
  if (Array.isArray(A)) {
21399
21399
  let o = "";
@@ -22295,7 +22295,7 @@ function zaA(i, A) {
22295
22295
  function tx(i, A, e = !0, t = !1) {
22296
22296
  const g = he(A), I = he(i);
22297
22297
  if (t) {
22298
- if (NI(i, Tt(A)), e) {
22298
+ if (NI(i, Kt(A)), e) {
22299
22299
  const o = I.sub(ix(i));
22300
22300
  i.lookAt(o);
22301
22301
  }
@@ -22323,7 +22323,7 @@ function Wh(i, A, e, t) {
22323
22323
  g.set(A, e, t), Li(i, g);
22324
22324
  }
22325
22325
  const Ef = new Zs(() => new GA(), 100), Ur = new GA(), JS = new GA();
22326
- function Tt(i, A = null) {
22326
+ function Kt(i, A = null) {
22327
22327
  if (!i)
22328
22328
  return Ef.get().identity();
22329
22329
  const e = A ?? Ef.get();
@@ -22357,11 +22357,11 @@ function nm(i, A) {
22357
22357
  }
22358
22358
  const G8 = new w(), DK = new GA();
22359
22359
  function jaA(i) {
22360
- return Tt(i, DK), G8.set(0, 0, 1).applyQuaternion(DK);
22360
+ return Kt(i, DK), G8.set(0, 0, 1).applyQuaternion(DK);
22361
22361
  }
22362
22362
  const M8 = new Zs(() => new w(), 100), wK = new GA();
22363
22363
  function ix(i, A) {
22364
- return A || (A = M8.get().set(0, 0, 1)), Tt(i, wK), A.applyQuaternion(wK);
22364
+ return A || (A = M8.get().set(0, 0, 1)), Kt(i, wK), A.applyQuaternion(wK);
22365
22365
  }
22366
22366
  const yK = new yi(), SK = new yi(), R8 = new w();
22367
22367
  function U8(i) {
@@ -28863,7 +28863,7 @@ function Lz(i) {
28863
28863
  return [e[0] >> 24 & 255, e[0] >> 16 & 255, e[0] >> 8 & 255, e[0] & 255, e[1] >> 24 & 255, e[1] >> 16 & 255, e[1] >> 8 & 255, e[1] & 255, e[2] >> 24 & 255, e[2] >> 16 & 255, e[2] >> 8 & 255, e[2] & 255, e[3] >> 24 & 255, e[3] >> 16 & 255, e[3] >> 8 & 255, e[3] & 255, e[4] >> 24 & 255, e[4] >> 16 & 255, e[4] >> 8 & 255, e[4] & 255];
28864
28864
  }
28865
28865
  const xz = vz("v5", 80, Lz), eJ = xz;
28866
- xt.registerCallback(sg.ContextCreated, (i) => {
28866
+ Tt.registerCallback(sg.ContextCreated, (i) => {
28867
28867
  const A = i.context;
28868
28868
  Oz(A), Hz(A);
28869
28869
  });
@@ -29783,7 +29783,7 @@ Object.getOwnPropertyDescriptor(SA.prototype, "worldPosition") || Object.defineP
29783
29783
  });
29784
29784
  Object.getOwnPropertyDescriptor(SA.prototype, "worldQuaternion") || Object.defineProperty(SA.prototype, "worldQuaternion", {
29785
29785
  get: function() {
29786
- return this instanceof VM ? Tt(this.object) : Tt(this);
29786
+ return this instanceof VM ? Kt(this.object) : Kt(this);
29787
29787
  },
29788
29788
  set: function(i) {
29789
29789
  NI(this, i);
@@ -29807,17 +29807,17 @@ Object.getOwnPropertyDescriptor(SA.prototype, "worldScale") || Object.defineProp
29807
29807
  });
29808
29808
  Object.getOwnPropertyDescriptor(SA.prototype, "worldForward") || Object.defineProperty(SA.prototype, "worldForward", {
29809
29809
  get: function() {
29810
- return NM().set(0, 0, 1).applyQuaternion(Tt(this));
29810
+ return NM().set(0, 0, 1).applyQuaternion(Kt(this));
29811
29811
  }
29812
29812
  });
29813
29813
  Object.getOwnPropertyDescriptor(SA.prototype, "worldRight") || Object.defineProperty(SA.prototype, "worldRight", {
29814
29814
  get: function() {
29815
- return NM().set(1, 0, 0).applyQuaternion(Tt(this));
29815
+ return NM().set(1, 0, 0).applyQuaternion(Kt(this));
29816
29816
  }
29817
29817
  });
29818
29818
  Object.getOwnPropertyDescriptor(SA.prototype, "worldUp") || Object.defineProperty(SA.prototype, "worldUp", {
29819
29819
  get: function() {
29820
- return NM().set(0, 1, 0).applyQuaternion(Tt(this));
29820
+ return NM().set(0, 1, 0).applyQuaternion(Kt(this));
29821
29821
  }
29822
29822
  });
29823
29823
  jz(SA);
@@ -30479,7 +30479,7 @@ const QT = Symbol("disposed");
30479
30479
  function srA(i) {
30480
30480
  return i[QT] === !0;
30481
30481
  }
30482
- function vt(i) {
30482
+ function bt(i) {
30483
30483
  var A;
30484
30484
  if (i) {
30485
30485
  if (i[rT] === !1) {
@@ -30487,33 +30487,33 @@ function vt(i) {
30487
30487
  return;
30488
30488
  }
30489
30489
  if (i[QT] = !0, i instanceof UI)
30490
- vt(i.environment), vt(i.background), vt(i.customDepthMaterial), vt(i.customDistanceMaterial);
30490
+ bt(i.environment), bt(i.background), bt(i.customDepthMaterial), bt(i.customDistanceMaterial);
30491
30491
  else if (i instanceof wa)
30492
- vt(i.geometry), vt(i.material), vt(i.skeleton), vt(i.bindMatrix), vt(i.bindMatrixInverse), vt(i.customDepthMaterial), vt(i.customDistanceMaterial), i.geometry = null, i.material = null;
30492
+ bt(i.geometry), bt(i.material), bt(i.skeleton), bt(i.bindMatrix), bt(i.bindMatrixInverse), bt(i.customDepthMaterial), bt(i.customDistanceMaterial), i.geometry = null, i.material = null;
30493
30493
  else if (i instanceof uA)
30494
- vt(i.geometry), vt(i.material), vt(i.customDepthMaterial), vt(i.customDistanceMaterial), i.geometry = null, i.material = null;
30494
+ bt(i.geometry), bt(i.material), bt(i.customDepthMaterial), bt(i.customDistanceMaterial), i.geometry = null, i.material = null;
30495
30495
  else if (i instanceof de) {
30496
30496
  xB(i);
30497
30497
  for (const e of Object.keys(i.attributes)) {
30498
30498
  const t = i.attributes[e];
30499
- vt(t);
30499
+ bt(t);
30500
30500
  }
30501
30501
  } else if (i instanceof ee || i instanceof en)
30502
30502
  Nr && console.warn("BufferAttribute dispose not supported", i.count);
30503
30503
  else if (i instanceof Array)
30504
30504
  for (const e of i)
30505
- e instanceof Le && vt(e);
30505
+ e instanceof Le && bt(e);
30506
30506
  else if (i instanceof Le) {
30507
30507
  xB(i);
30508
30508
  for (const t of Object.keys(i)) {
30509
30509
  const g = i[t];
30510
- g instanceof be && (vt(g), i[t] = null);
30510
+ g instanceof be && (bt(g), i[t] = null);
30511
30511
  }
30512
30512
  const e = i.uniforms;
30513
30513
  if (e)
30514
30514
  for (const t of Object.keys(e)) {
30515
30515
  const g = e[t];
30516
- g instanceof be ? (vt(g), e[t] = null) : g instanceof mA && (vt(g.value), g.value = null);
30516
+ g instanceof be ? (bt(g), e[t] = null) : g instanceof mA && (bt(g.value), g.value = null);
30517
30517
  }
30518
30518
  } else
30519
30519
  i instanceof be ? (xB(i), xB(i.source), ((A = i.source) == null ? void 0 : A.data) instanceof ImageBitmap && xB(i.source.data)) : i instanceof rE ? (xB(i.boneTexture), i.boneTexture = null) : i instanceof Rl || !(i instanceof SA) && Nr && console.warn("Unknown object type", i);
@@ -30577,7 +30577,7 @@ function ff(i, A, e, t) {
30577
30577
  } else if (A && g.has(A)) {
30578
30578
  g.delete(A);
30579
30579
  let I = e[Tc] || 0;
30580
- I > 0 && (I -= 1, e[Tc] = I), Nr && console.warn(`🔴 Removed user of "${e.type}"`, A, e, I, "users:", g), I <= 0 && (sh.isLoading(e) || (aw && console.warn(`🔴 Removed all user of "${e.type}"`, e), aT() && vt(e)));
30580
+ I > 0 && (I -= 1, e[Tc] = I), Nr && console.warn(`🔴 Removed user of "${e.type}"`, A, e, I, "users:", g), I <= 0 && (sh.isLoading(e) || (aw && console.warn(`🔴 Removed all user of "${e.type}"`, e), aT() && bt(e)));
30581
30581
  }
30582
30582
  e[i] = g;
30583
30583
  }
@@ -30653,7 +30653,7 @@ function hT(i, A = !0, e = !1, t = !0, g) {
30653
30653
  return;
30654
30654
  }
30655
30655
  const o = i;
30656
- if (vj(o, !0), e && vt(o), Uj(o), Sp && console.log(o), A && o.children)
30656
+ if (vj(o, !0), e && bt(o), Uj(o), Sp && console.log(o), A && o.children)
30657
30657
  for (const C of o.children)
30658
30658
  hT(C, A, e, !1, g);
30659
30659
  const s = o.userData.components;
@@ -30949,7 +30949,7 @@ function lC(i, A) {
30949
30949
  e >= 0 && A.splice(e, 1);
30950
30950
  }
30951
30951
  function Gp(i) {
30952
- if (i || (i = xt.Current.scene), !i) {
30952
+ if (i || (i = Tt.Current.scene), !i) {
30953
30953
  console.trace("Invalid call - no current context.");
30954
30954
  return;
30955
30955
  }
@@ -40385,25 +40385,25 @@ class Sf extends uM {
40385
40385
  for (QA >>= 1, kA = QA, QA >>= 1; QA >= 1; ) {
40386
40386
  qA = 0;
40387
40387
  const vA = qA + O * (L - kA), Ae = O * QA, Ee = O * kA, ge = b * QA, re = b * kA;
40388
- let ce, le, Jt, Qt;
40388
+ let ce, le, qt, Qt;
40389
40389
  for (; qA <= vA; qA += Ee) {
40390
40390
  let rt = qA;
40391
40391
  const tt = qA + b * (N - kA);
40392
40392
  for (; rt <= tt; rt += re) {
40393
- const qt = rt + ge, Rg = rt + Ae, nt = Rg + ge;
40394
- dA ? (HA(F[rt + y], F[Rg + y]), ce = UA.a, Jt = UA.b, HA(F[qt + y], F[nt + y]), le = UA.a, Qt = UA.b, HA(ce, le), F[rt + y] = UA.a, F[qt + y] = UA.b, HA(Jt, Qt), F[Rg + y] = UA.a, F[nt + y] = UA.b) : (PA(F[rt + y], F[Rg + y]), ce = UA.a, Jt = UA.b, PA(F[qt + y], F[nt + y]), le = UA.a, Qt = UA.b, PA(ce, le), F[rt + y] = UA.a, F[qt + y] = UA.b, PA(Jt, Qt), F[Rg + y] = UA.a, F[nt + y] = UA.b);
40393
+ const vt = rt + ge, Rg = rt + Ae, nt = Rg + ge;
40394
+ dA ? (HA(F[rt + y], F[Rg + y]), ce = UA.a, qt = UA.b, HA(F[vt + y], F[nt + y]), le = UA.a, Qt = UA.b, HA(ce, le), F[rt + y] = UA.a, F[vt + y] = UA.b, HA(qt, Qt), F[Rg + y] = UA.a, F[nt + y] = UA.b) : (PA(F[rt + y], F[Rg + y]), ce = UA.a, qt = UA.b, PA(F[vt + y], F[nt + y]), le = UA.a, Qt = UA.b, PA(ce, le), F[rt + y] = UA.a, F[vt + y] = UA.b, PA(qt, Qt), F[Rg + y] = UA.a, F[nt + y] = UA.b);
40395
40395
  }
40396
40396
  if (N & QA) {
40397
- const qt = rt + Ae;
40398
- dA ? HA(F[rt + y], F[qt + y]) : PA(F[rt + y], F[qt + y]), ce = UA.a, F[qt + y] = UA.b, F[rt + y] = ce;
40397
+ const vt = rt + Ae;
40398
+ dA ? HA(F[rt + y], F[vt + y]) : PA(F[rt + y], F[vt + y]), ce = UA.a, F[vt + y] = UA.b, F[rt + y] = ce;
40399
40399
  }
40400
40400
  }
40401
40401
  if (L & QA) {
40402
40402
  let rt = qA;
40403
40403
  const tt = qA + b * (N - kA);
40404
40404
  for (; rt <= tt; rt += re) {
40405
- const qt = rt + ge;
40406
- dA ? HA(F[rt + y], F[qt + y]) : PA(F[rt + y], F[qt + y]), ce = UA.a, F[qt + y] = UA.b, F[rt + y] = ce;
40405
+ const vt = rt + ge;
40406
+ dA ? HA(F[rt + y], F[vt + y]) : PA(F[rt + y], F[vt + y]), ce = UA.a, F[vt + y] = UA.b, F[rt + y] = ce;
40407
40407
  }
40408
40408
  }
40409
40409
  kA = QA, QA >>= 1;
@@ -40498,12 +40498,12 @@ class Sf extends uM {
40498
40498
  }
40499
40499
  function MA(F, y, N, b, L, O) {
40500
40500
  let CA = new DataView(O.buffer);
40501
- const dA = N[F.idx[0]].width, wA = N[F.idx[0]].height, QA = 3, kA = Math.floor(dA / 8), qA = Math.ceil(dA / 8), vA = Math.ceil(wA / 8), Ae = dA - (qA - 1) * 8, Ee = wA - (vA - 1) * 8, ge = { value: 0 }, re = new Array(QA), ce = new Array(QA), le = new Array(QA), Jt = new Array(QA), Qt = new Array(QA);
40501
+ const dA = N[F.idx[0]].width, wA = N[F.idx[0]].height, QA = 3, kA = Math.floor(dA / 8), qA = Math.ceil(dA / 8), vA = Math.ceil(wA / 8), Ae = dA - (qA - 1) * 8, Ee = wA - (vA - 1) * 8, ge = { value: 0 }, re = new Array(QA), ce = new Array(QA), le = new Array(QA), qt = new Array(QA), Qt = new Array(QA);
40502
40502
  for (let tt = 0; tt < QA; ++tt)
40503
- Qt[tt] = y[F.idx[tt]], re[tt] = tt < 1 ? 0 : re[tt - 1] + qA * vA, ce[tt] = new Float32Array(64), le[tt] = new Uint16Array(64), Jt[tt] = new Uint16Array(qA * 64);
40503
+ Qt[tt] = y[F.idx[tt]], re[tt] = tt < 1 ? 0 : re[tt - 1] + qA * vA, ce[tt] = new Float32Array(64), le[tt] = new Uint16Array(64), qt[tt] = new Uint16Array(qA * 64);
40504
40504
  for (let tt = 0; tt < vA; ++tt) {
40505
- let qt = 8;
40506
- tt == vA - 1 && (qt = Ee);
40505
+ let vt = 8;
40506
+ tt == vA - 1 && (vt = Ee);
40507
40507
  let Rg = 8;
40508
40508
  for (let je = 0; je < qA; ++je) {
40509
40509
  je == qA - 1 && (Rg = Ae);
@@ -40511,23 +40511,23 @@ class Sf extends uM {
40511
40511
  le[lt].fill(0), le[lt][0] = L[re[lt]++], ie(ge, b, le[lt]), zA(le[lt], ce[lt]), ZA(ce[lt]);
40512
40512
  ue(ce);
40513
40513
  for (let lt = 0; lt < QA; ++lt)
40514
- Me(ce[lt], Jt[lt], je * 64);
40514
+ Me(ce[lt], qt[lt], je * 64);
40515
40515
  }
40516
40516
  let nt = 0;
40517
40517
  for (let je = 0; je < QA; ++je) {
40518
40518
  const lt = N[F.idx[je]].type;
40519
- for (let Ai = 8 * tt; Ai < 8 * tt + qt; ++Ai) {
40519
+ for (let Ai = 8 * tt; Ai < 8 * tt + vt; ++Ai) {
40520
40520
  nt = Qt[je][Ai];
40521
40521
  for (let nC = 0; nC < kA; ++nC) {
40522
40522
  const Bo = nC * 64 + (Ai & 7) * 8;
40523
- CA.setUint16(nt + 0 * 2 * lt, Jt[je][Bo + 0], !0), CA.setUint16(nt + 1 * 2 * lt, Jt[je][Bo + 1], !0), CA.setUint16(nt + 2 * 2 * lt, Jt[je][Bo + 2], !0), CA.setUint16(nt + 3 * 2 * lt, Jt[je][Bo + 3], !0), CA.setUint16(nt + 4 * 2 * lt, Jt[je][Bo + 4], !0), CA.setUint16(nt + 5 * 2 * lt, Jt[je][Bo + 5], !0), CA.setUint16(nt + 6 * 2 * lt, Jt[je][Bo + 6], !0), CA.setUint16(nt + 7 * 2 * lt, Jt[je][Bo + 7], !0), nt += 8 * 2 * lt;
40523
+ CA.setUint16(nt + 0 * 2 * lt, qt[je][Bo + 0], !0), CA.setUint16(nt + 1 * 2 * lt, qt[je][Bo + 1], !0), CA.setUint16(nt + 2 * 2 * lt, qt[je][Bo + 2], !0), CA.setUint16(nt + 3 * 2 * lt, qt[je][Bo + 3], !0), CA.setUint16(nt + 4 * 2 * lt, qt[je][Bo + 4], !0), CA.setUint16(nt + 5 * 2 * lt, qt[je][Bo + 5], !0), CA.setUint16(nt + 6 * 2 * lt, qt[je][Bo + 6], !0), CA.setUint16(nt + 7 * 2 * lt, qt[je][Bo + 7], !0), nt += 8 * 2 * lt;
40524
40524
  }
40525
40525
  }
40526
40526
  if (kA != qA)
40527
- for (let Ai = 8 * tt; Ai < 8 * tt + qt; ++Ai) {
40527
+ for (let Ai = 8 * tt; Ai < 8 * tt + vt; ++Ai) {
40528
40528
  const nC = Qt[je][Ai] + 8 * kA * 2 * lt, Bo = kA * 64 + (Ai & 7) * 8;
40529
40529
  for (let va = 0; va < Rg; ++va)
40530
- CA.setUint16(nC + va * 2 * lt, Jt[je][Bo + va], !0);
40530
+ CA.setUint16(nC + va * 2 * lt, qt[je][Bo + va], !0);
40531
40531
  }
40532
40532
  }
40533
40533
  }
@@ -40535,14 +40535,14 @@ class Sf extends uM {
40535
40535
  CA = new DataView(O.buffer);
40536
40536
  for (let tt = 0; tt < QA; ++tt) {
40537
40537
  N[F.idx[tt]].decoded = !0;
40538
- const qt = N[F.idx[tt]].type;
40538
+ const vt = N[F.idx[tt]].type;
40539
40539
  if (N[tt].type == 2)
40540
40540
  for (let Rg = 0; Rg < wA; ++Rg) {
40541
40541
  const nt = Qt[tt][Rg];
40542
40542
  for (let je = 0; je < dA; ++je)
40543
- rt[je] = CA.getUint16(nt + je * 2 * qt, !0);
40543
+ rt[je] = CA.getUint16(nt + je * 2 * vt, !0);
40544
40544
  for (let je = 0; je < dA; ++je)
40545
- CA.setFloat32(nt + je * 2 * qt, cA(rt[je]), !0);
40545
+ CA.setFloat32(nt + je * 2 * vt, cA(rt[je]), !0);
40546
40546
  }
40547
40547
  }
40548
40548
  }
@@ -40669,10 +40669,10 @@ class Sf extends uM {
40669
40669
  const O = new Array();
40670
40670
  let CA = lA(y, N) - 2;
40671
40671
  for (; CA > 0; ) {
40672
- const ge = V(y.buffer, N), re = se(y, N), ce = re >> 2 & 3, le = (re >> 4) - 1, Jt = new Int8Array([le])[0], Qt = se(y, N);
40672
+ const ge = V(y.buffer, N), re = se(y, N), ce = re >> 2 & 3, le = (re >> 4) - 1, qt = new Int8Array([le])[0], Qt = se(y, N);
40673
40673
  O.push({
40674
40674
  name: ge,
40675
- index: Jt,
40675
+ index: qt,
40676
40676
  type: Qt,
40677
40677
  compression: ce
40678
40678
  }), CA -= ge.length + 3;
@@ -40729,7 +40729,7 @@ class Sf extends uM {
40729
40729
  switch (re.compression) {
40730
40730
  case 2:
40731
40731
  let ce = 0, le = 0;
40732
- for (let Jt = 0; Jt < F.lines; ++Jt) {
40732
+ for (let qt = 0; qt < F.lines; ++qt) {
40733
40733
  let Qt = Ee[ge][ce];
40734
40734
  for (let rt = 0; rt < re.width; ++rt) {
40735
40735
  for (let tt = 0; tt < 2 * re.type; ++tt)
@@ -40828,7 +40828,7 @@ class Sf extends uM {
40828
40828
  const N = ye(F, y), b = ye(F, y), L = ye(F, y), O = ye(F, y), CA = ye(F, y), dA = ye(F, y), wA = ye(F, y), QA = ye(F, y);
40829
40829
  return { redX: N, redY: b, greenX: L, greenY: O, blueX: CA, blueY: dA, whiteX: wA, whiteY: QA };
40830
40830
  }
40831
- function Kt(F, y) {
40831
+ function Jt(F, y) {
40832
40832
  const N = [
40833
40833
  "NO_COMPRESSION",
40834
40834
  "RLE_COMPRESSION",
@@ -40869,7 +40869,7 @@ class Sf extends uM {
40869
40869
  if (b === "chromaticities")
40870
40870
  return Ct(F, N);
40871
40871
  if (b === "compression")
40872
- return Kt(F, N);
40872
+ return Jt(F, N);
40873
40873
  if (b === "box2i")
40874
40874
  return mi(F, N);
40875
40875
  if (b === "lineOrder")
@@ -41534,7 +41534,7 @@ const ei = class {
41534
41534
  }), this._disposeCallbacks.push(() => {
41535
41535
  var g;
41536
41536
  return (g = this._intersectionObserver) == null ? void 0 : g.disconnect();
41537
- }), xt.register(this);
41537
+ }), Tt.register(this);
41538
41538
  }
41539
41539
  /** When a new context is created this is the framerate that will be used by default */
41540
41540
  static get DefaultTargetFrameRate() {
@@ -41553,11 +41553,11 @@ const ei = class {
41553
41553
  }
41554
41554
  /** The currently active context. Only set during the update loops */
41555
41555
  static get Current() {
41556
- return xt.Current;
41556
+ return Tt.Current;
41557
41557
  }
41558
41558
  /** @internal this property should not be set by user code */
41559
41559
  static set Current(A) {
41560
- xt.Current = A;
41560
+ Tt.Current = A;
41561
41561
  }
41562
41562
  appendHTMLElement(A) {
41563
41563
  return this.domElement.shadowRoot ? this.domElement.shadowRoot.appendChild(A) : this.domElement.appendChild(A);
@@ -41687,7 +41687,7 @@ const ei = class {
41687
41687
  */
41688
41688
  clear() {
41689
41689
  var A, e, t, g;
41690
- xt.dispatchCallback(sg.ContextClearing, this), In(this.scene, !0, !0), this.scene = new UI(), (A = this.addressables) == null || A.dispose(), (e = this.lightmaps) == null || e.clear(), (g = (t = this.physics) == null ? void 0 : t.engine) == null || g.clearCaches(), this.isManagedExternally || this.renderer && (this.renderer.renderLists.dispose(), this.renderer.state.reset(), this.renderer.resetState()), xt.dispatchCallback(sg.ContextCleared, this);
41690
+ Tt.dispatchCallback(sg.ContextClearing, this), In(this.scene, !0, !0), this.scene = new UI(), (A = this.addressables) == null || A.dispose(), (e = this.lightmaps) == null || e.clear(), (g = (t = this.physics) == null ? void 0 : t.engine) == null || g.clearCaches(), this.isManagedExternally || this.renderer && (this.renderer.renderLists.dispose(), this.renderer.state.reset(), this.renderer.resetState()), Tt.dispatchCallback(sg.ContextCleared, this);
41691
41691
  }
41692
41692
  dispose() {
41693
41693
  this.internalOnDestroy();
@@ -41705,7 +41705,7 @@ const ei = class {
41705
41705
  } catch (g) {
41706
41706
  console.error("Error in on dispose callback:", g, t);
41707
41707
  }
41708
- (e = this.domElement) != null && e.parentElement && this.domElement.parentElement.removeChild(this.domElement), xt.dispatchCallback(sg.ContextDestroyed, this), xt.unregister(this);
41708
+ (e = this.domElement) != null && e.parentElement && this.domElement.parentElement.removeChild(this.domElement), Tt.dispatchCallback(sg.ContextDestroyed, this), Tt.unregister(this);
41709
41709
  }
41710
41710
  registerCoroutineUpdate(A, e, t) {
41711
41711
  return this.coroutines[t] || (this.coroutines[t] = []), this.coroutines[t].push({ comp: A, main: e }), e;
@@ -41805,7 +41805,7 @@ const ei = class {
41805
41805
  async internalOnCreate(A) {
41806
41806
  var o, s, C, n, a;
41807
41807
  const e = ++this._createId;
41808
- this.clear(), this.isManagedExternally === !1 && (this.createNewRenderer(), (o = this.renderer) == null || o.setAnimationLoop(null)), await Tr(1), ei.Current = this, await xt.dispatchCallback(sg.ContextCreationStart, this);
41808
+ this.clear(), this.isManagedExternally === !1 && (this.createNewRenderer(), (o = this.renderer) == null || o.setAnimationLoop(null)), await Tr(1), ei.Current = this, await Tt.dispatchCallback(sg.ContextCreationStart, this);
41809
41809
  let t = !0, g;
41810
41810
  try {
41811
41811
  ei.Current = this, A ? g = await this.internalLoadInitialContent(e, A) : g = [];
@@ -41840,14 +41840,14 @@ const ei = class {
41840
41840
  return B = E, !0;
41841
41841
  B = E;
41842
41842
  }
41843
- }), B ? this.setCurrentCamera(B) : !xt.dispatchCallback(sg.MissingCamera, this, { files: g }) && !this.mainCamera && !this.isManagedExternally && console.warn("Missing camera in main scene", this);
41843
+ }), B ? this.setCurrentCamera(B) : !Tt.dispatchCallback(sg.MissingCamera, this, { files: g }) && !this.mainCamera && !this.isManagedExternally && console.warn("Missing camera in main scene", this);
41844
41844
  }
41845
41845
  if (ei.Current = this, Df(this), this.physics.engine && ((s = this.physics.engine) == null || s.step(0), (C = this.physics.engine) == null || C.postStep()), !this.isManagedExternally && this.composer && this.mainCamera) {
41846
41846
  const B = new cw(this.scene, this.mainCamera);
41847
41847
  this.renderer.setSize(this.domWidth, this.domHeight), this.composer.addPass(B), this.composer.setSize(this.domWidth, this.domHeight);
41848
41848
  }
41849
41849
  this._sizeChanged = !0, this._stats && (this._stats.showPanel(0), (n = this.domElement.shadowRoot) == null || n.appendChild(this._stats.dom)), Ln && am(this.scene, !0), this.targetFrameRate === void 0 ? (Ln && console.warn("No target framerate set, using default", ei.DefaultTargetFrameRate), this.targetFrameRate = ei._defaultTargetFramerate) : Ln && console.log("Target framerate set to", this.targetFrameRate), this._dispatchReadyAfterFrame = !0;
41850
- const I = xt.dispatchCallback(sg.ContextCreated, this, { files: g });
41850
+ const I = Tt.dispatchCallback(sg.ContextCreated, this, { files: g });
41851
41851
  return I && ("internalSetLoadingMessage" in this.domElement && typeof this.domElement.internalSetLoadingMessage == "function" && ((a = this.domElement) == null || a.internalSetLoadingMessage("finish loading")), await I), ja(this, sg.ContextCreated), this._isCreating = !1, this.isManagedExternally || this.restartRenderLoop(), I;
41852
41852
  }
41853
41853
  async internalLoadInitialContent(A, e) {
@@ -42041,7 +42041,7 @@ const ei = class {
42041
42041
  for (const A in this.post_render_callbacks)
42042
42042
  this.post_render_callbacks[A]();
42043
42043
  }
42044
- this._currentFrameEvent = -1, this.connection.sendBufferedMessagesNow(), this._stats && (this._stats.end(), this.time.frameCount % 150 === 0 && console.log({ ...this.renderer.info.memory }, { ...this.renderer.info.render })), this._dispatchReadyAfterFrame && (this._dispatchReadyAfterFrame = !1, this.domElement.dispatchEvent(new CustomEvent("ready")), xt.dispatchCallback(sg.ContextFirstFrameRendered, this));
42044
+ this._currentFrameEvent = -1, this.connection.sendBufferedMessagesNow(), this._stats && (this._stats.end(), this.time.frameCount % 150 === 0 && console.log({ ...this.renderer.info.memory }, { ...this.renderer.info.render })), this._dispatchReadyAfterFrame && (this._dispatchReadyAfterFrame = !1, this.domElement.dispatchEvent(new CustomEvent("ready")), Tt.dispatchCallback(sg.ContextFirstFrameRendered, this));
42045
42045
  }
42046
42046
  renderNow(A) {
42047
42047
  return !A && (A = this.mainCamera, !A) ? !1 : (this._isRendering = !0, this.renderRequiredTextures(), this.composer && !this.isInXR ? this.composer.render(this.time.deltaTime) : A && this.renderer.render(this.scene, A), this._isRendering = !1, !0);
@@ -42555,7 +42555,7 @@ let $r = (ai = class {
42555
42555
  ai._worldPositionBuffer.set(A, e, t), this.worldPosition = ai._worldPositionBuffer;
42556
42556
  }
42557
42557
  get worldQuaternion() {
42558
- return this._worldQuaternion || (this._worldQuaternion = new GA()), Tt(this.gameObject, this._worldQuaternion);
42558
+ return this._worldQuaternion || (this._worldQuaternion = new GA()), Kt(this.gameObject, this._worldQuaternion);
42559
42559
  }
42560
42560
  set worldQuaternion(A) {
42561
42561
  NI(this.gameObject, A);
@@ -42642,7 +42642,7 @@ function iY() {
42642
42642
  function jQ() {
42643
42643
  return Qh() || iY();
42644
42644
  }
42645
- xt.registerCallback(sg.ContextRegistered, (i) => {
42645
+ Tt.registerCallback(sg.ContextRegistered, (i) => {
42646
42646
  PX(i.context), jX(), OX(i.context);
42647
42647
  });
42648
42648
  let Ia, Ym = !1, Yc = "";
@@ -46070,7 +46070,7 @@ class Z9 {
46070
46070
  return null;
46071
46071
  }
46072
46072
  }
46073
- xt.registerCallback(sg.ContextCreated, (i) => {
46073
+ Tt.registerCallback(sg.ContextCreated, (i) => {
46074
46074
  const A = i.context, e = oA.findObjectOfType(Vm, A);
46075
46075
  e != null && e.sourceId && (e.enabled = !0);
46076
46076
  });
@@ -58733,7 +58733,7 @@ function rtA(i) {
58733
58733
  const A = i[xp];
58734
58734
  return A !== void 0 && A.size > 0;
58735
58735
  }
58736
- xt.registerCallback(sg.ContextCreated, (i) => {
58736
+ Tt.registerCallback(sg.ContextCreated, (i) => {
58737
58737
  const A = i.context.domElement.getAttribute("autoplay");
58738
58738
  if (A !== void 0 && (A === "" || A === "true") && i.files)
58739
58739
  for (const e of i.files)
@@ -61412,7 +61412,7 @@ const og = class extends NA {
61412
61412
  }
61413
61413
  getWristQuaternion() {
61414
61414
  const e = this.wrist;
61415
- return e ? (this._wristQuaternion || (this._wristQuaternion = new GA()), Tt(e).multiply(this._wristQuaternion.setFromEuler(new yi(-Math.PI / 4, 0, 0)))) : null;
61415
+ return e ? (this._wristQuaternion || (this._wristQuaternion = new GA()), Kt(e).multiply(this._wristQuaternion.setFromEuler(new yi(-Math.PI / 4, 0, 0)))) : null;
61416
61416
  }
61417
61417
  get selectionDown() {
61418
61418
  return this._selectionPressed && !this._selectionPressedLastFrame;
@@ -61508,7 +61508,7 @@ const og = class extends NA {
61508
61508
  for (const I of e)
61509
61509
  I(this);
61510
61510
  let t = 1;
61511
- this.type === 0 ? t = this.context.time.deltaTime / 0.1 : this.isUsingHands && this.handPointerModel.pinched && (t = this.context.time.deltaTime / 0.3), this.rayRotation.slerp(Tt(this.controller), this.useSmoothing ? t : 1);
61511
+ this.type === 0 ? t = this.context.time.deltaTime / 0.1 : this.isUsingHands && this.handPointerModel.pinched && (t = this.context.time.deltaTime / 0.3), this.rayRotation.slerp(Kt(this.controller), this.useSmoothing ? t : 1);
61512
61512
  const g = he(this.controller);
61513
61513
  this.isUsingHands && this.handPointerModel.cursorObject && (this.handPointerModel.cursorObject.visible = !1), this.enableRaycasts ? (this.raycastLine && this.raycastUpdate(this.raycastLine, g), this.lastHit = this.updateLastHit(), this.grabbed && this.grabbed.update()) : this.raycastLine && (this.raycastLine.visible = !1), this._selectionPressedLastFrame = this._selectionPressed, this.selectStartCallback && this.selectStartCallback();
61514
61514
  }
@@ -61791,7 +61791,7 @@ const tI = class {
61791
61791
  const a = () => s ? this.lastControllerWorldPos.clone() : o.point.clone();
61792
61792
  this.grabDistance = a().distanceTo(this.lastControllerWorldPos), this.totalChangeAlongDirection = 0, this.localPositionOffsetToGrab = this.selected.worldToLocal(a());
61793
61793
  const B = A.isUsingHands && s ? this.controller.getWristQuaternion().clone() : A.rayRotation.clone();
61794
- Tt(this.selected, this.localQuaternionToGrab).premultiply(B.invert());
61794
+ Kt(this.selected, this.localQuaternionToGrab).premultiply(B.invert());
61795
61795
  const Q = this.controller.webXR.Rig;
61796
61796
  return Q && this.rigPositionLastFrame.copy(he(Q)), RI.Add(A.context, this.selected), tI.Register(this), this.sync && (this.sync.fastMode = !0), (c = tI.Events.DidTake) == null || c.forEach((l) => l(this, C)), this;
61797
61797
  }
@@ -64829,7 +64829,7 @@ const u_ = (Qk = class extends NA {
64829
64829
  if (I.length() < 0.1)
64830
64830
  return;
64831
64831
  const o = u_.forward;
64832
- if (o.set(0, 0, 1), o.applyQuaternion(Tt(this.head)), o.dot(I) > 0.45)
64832
+ if (o.set(0, 0, 1), o.applyQuaternion(Kt(this.head)), o.dot(I) > 0.45)
64833
64833
  for (let C = 0; C < e.length; C++)
64834
64834
  e[C].lookAt(this.currentTargetPoint);
64835
64835
  }
@@ -66392,7 +66392,7 @@ class mE extends NA {
66392
66392
  *moveToTarget() {
66393
66393
  if (!this.target || !this.object)
66394
66394
  return;
66395
- const e = he(this.object).clone(), t = he(this.target).clone(), g = Tt(this.object).clone(), I = Tt(this.target).clone(), o = fg(this.object).clone(), s = fg(this.target).clone(), C = e.distanceTo(t), n = g.angleTo(I), a = o.distanceTo(s);
66395
+ const e = he(this.object).clone(), t = he(this.target).clone(), g = Kt(this.object).clone(), I = Kt(this.target).clone(), o = fg(this.object).clone(), s = fg(this.target).clone(), C = e.distanceTo(t), n = g.angleTo(I), a = o.distanceTo(s);
66396
66396
  if (C < 0.01 && n < 0.01 && a < 0.01) {
66397
66397
  Li(this.object, t), NI(this.object, I), nm(this.object, s), this.coroutine = null;
66398
66398
  return;
@@ -69711,7 +69711,7 @@ const Ig = (AQ = class extends NA {
69711
69711
  }
69712
69712
  }
69713
69713
  captureStateBeforeXR() {
69714
- this.context.mainCamera && (this._originalCameraPosition.copy(he(this.context.mainCamera)), this._originalCameraRotation.copy(Tt(this.context.mainCamera)), this._originalCameraParent = this.context.mainCamera.parent), this.Rig && (this._originalXRRigParent = this.Rig.parent, this._originalXRRigPosition.copy(this.Rig.position), this._originalXRRigRotation.copy(this.Rig.quaternion));
69714
+ this.context.mainCamera && (this._originalCameraPosition.copy(he(this.context.mainCamera)), this._originalCameraRotation.copy(Kt(this.context.mainCamera)), this._originalCameraParent = this.context.mainCamera.parent), this.Rig && (this._originalXRRigParent = this.Rig.parent, this._originalXRRigPosition.copy(this.Rig.position), this._originalXRRigRotation.copy(this.Rig.quaternion));
69715
69715
  }
69716
69716
  ensureRig() {
69717
69717
  if (!this.rig || AR(this.rig)) {
@@ -71091,7 +71091,7 @@ async function aIA(i, A) {
71091
71091
  s && s.scene ? (s.scene, fU(), e(s)) : console.warn("Unsupported file type: " + i.toString());
71092
71092
  });
71093
71093
  }
71094
- xt.registerCallback(sg.ContextCreated, (i) => {
71094
+ Tt.registerCallback(sg.ContextCreated, (i) => {
71095
71095
  rIA(i.context);
71096
71096
  });
71097
71097
  function rIA(i) {
@@ -73841,7 +73841,7 @@ class bE extends NA {
73841
73841
  update() {
73842
73842
  if (!this.from)
73843
73843
  return;
73844
- var e = he(this.from), t = Tt(this.from);
73844
+ var e = he(this.from), t = Kt(this.from);
73845
73845
  this.offset.copy(this.positionOffset);
73846
73846
  const g = this.offset.length();
73847
73847
  if (this.referenceSpace && this.offset.transformDirection(this.referenceSpace.matrixWorld).multiplyScalar(g), e.add(this.offset), this.levelPosition && this.referenceSpace) {
@@ -79162,7 +79162,7 @@ const _p = class extends NA {
79162
79162
  this._cameraScale = s.x;
79163
79163
  }
79164
79164
  const t = !this.worldspace, g = this.gameObject;
79165
- if (Tt(g, this.__worldQuaternion), this._worldQuaternionInverted.copy(this.__worldQuaternion).invert(), fg(this.gameObject, this._worldScale), t && this._container && ((I = this.gameObject) != null && I.parent)) {
79165
+ if (Kt(g, this.__worldQuaternion), this._worldQuaternionInverted.copy(this.__worldQuaternion).invert(), fg(this.gameObject, this._worldScale), t && this._container && ((I = this.gameObject) != null && I.parent)) {
79166
79166
  const s = A2(this, yG);
79167
79167
  this._container.matrix.makeScale(s.x, s.y, s.z), this._container.matrix.makeRotationFromQuaternion(this.__worldQuaternion), this._container.matrix.setPosition(this.worldPos), this._container.matrix.scale(this.gameObject.scale);
79168
79168
  }
@@ -80950,7 +80950,7 @@ function _v(i, A, e, t, g) {
80950
80950
  Ys && console.log("Destroyed attribute remote skybox", g), t8(i.domElement, g, o);
80951
80951
  }), I.setSkybox(A);
80952
80952
  }
80953
- xt.addContextCreatedCallback((i) => {
80953
+ Tt.addContextCreatedCallback((i) => {
80954
80954
  var I;
80955
80955
  const A = i.context, e = A.domElement.getAttribute("skybox-image"), t = A.domElement.getAttribute("environment-image"), g = new Array();
80956
80956
  if (e) {
@@ -80974,7 +80974,7 @@ function hCA(i) {
80974
80974
  }
80975
80975
  async function lCA(i) {
80976
80976
  const A = await i;
80977
- BT(A, !0), vt(A);
80977
+ BT(A, !0), bt(A);
80978
80978
  }
80979
80979
  function dCA(i, A) {
80980
80980
  const e = I2();
@@ -82507,7 +82507,7 @@ const a2 = (dk = class extends NA {
82507
82507
  this.positionAxes & Hc.X && (g.x = $A.lerp(g.x, e.x, t)), this.positionAxes & Hc.Y && (g.y = $A.lerp(g.y, e.y, t)), this.positionAxes & Hc.Z && (g.z = $A.lerp(g.z, e.z, t)), this.worldPosition = g;
82508
82508
  }
82509
82509
  if (this.rotateFactor > 0) {
82510
- const e = Tt(this.target);
82510
+ const e = Kt(this.target);
82511
82511
  this.flipForward && e.premultiply(a2._invertForward);
82512
82512
  const t = this._firstUpdate || A ? 1 : $A.clamp01(this.context.time.deltaTime * this.rotateFactor);
82513
82513
  this.worldQuaternion = this.worldQuaternion.slerp(e, t);
@@ -83509,7 +83509,7 @@ const mG = (pk = class extends NA {
83509
83509
  if (!this.context.connection.isConnected || this.context.connection.connectionId === null)
83510
83510
  return;
83511
83511
  this._model === null && (this._model = new CnA(this.context.connection.connectionId, this.context.connection.connectionId + "_camera"));
83512
- const e = he(A), t = Tt(A);
83512
+ const e = he(A), t = Kt(A);
83513
83513
  (e.distanceTo(this._lastWorldPosition) > 1e-3 || t.angleTo(this._lastWorldQuaternion) > 0.01) && (this._needsUpdate = !0), this._lastWorldPosition.copy(e), this._lastWorldQuaternion.copy(t), !((!this._needsUpdate || this.context.time.frameCount % 2 !== 0) && !(this.context.time.realtimeSinceStartup - this._lastUpdateTime > this._camTimeoutInSeconds * 0.5)) && (this._lastUpdateTime = this.context.time.realtimeSinceStartup, this._needsUpdate = !1, this._model.send(A, this.context.connection), this.context.isInXR || this.context.players.setPlayerView(this.context.connection.connectionId, A, XC.Browser));
83514
83514
  }
83515
83515
  onReceivedRemoteCameraInfoBin(A) {
@@ -84545,10 +84545,10 @@ class WE extends NA {
84545
84545
  } else if (this.dataTemplate || (this.dataTemplate = new uA()), this.dataTemplate) {
84546
84546
  const E = oA.instantiate(this.dataTemplate);
84547
84547
  if (B = E, E instanceof uA)
84548
- vt(E.geometry), E.geometry = this.createGeometry(C), Q(E.material);
84548
+ bt(E.geometry), E.geometry = this.createGeometry(C), Q(E.material);
84549
84549
  else if (E instanceof II)
84550
84550
  for (const d of E.children)
84551
- d instanceof uA && (vt(d.geometry), d.geometry = this.createGeometry(C), Q(d.material));
84551
+ d instanceof uA && (bt(d.geometry), d.geometry = this.createGeometry(C), Q(d.material));
84552
84552
  const c = E.getComponent(ed);
84553
84553
  if (c) {
84554
84554
  const d = E;
@@ -86068,7 +86068,7 @@ function pe(i) {
86068
86068
  function Zf() {
86069
86069
  return zp.byteLength === 0 && (zp = new Float64Array(U.memory.buffer)), zp;
86070
86070
  }
86071
- function bt() {
86071
+ function Lt() {
86072
86072
  return jp.byteLength === 0 && (jp = new Int32Array(U.memory.buffer)), jp;
86073
86073
  }
86074
86074
  const G2 = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 });
@@ -86082,11 +86082,11 @@ function iA(i, A) {
86082
86082
  return i.ptr;
86083
86083
  }
86084
86084
  G2.decode();
86085
- let Xp, $p, Lt = 32;
86085
+ let Xp, $p, xt = 32;
86086
86086
  function Ci(i) {
86087
- if (Lt == 1)
86087
+ if (xt == 1)
86088
86088
  throw new Error("out of js stack");
86089
- return Et[--Lt] = i, Lt;
86089
+ return Et[--xt] = i, xt;
86090
86090
  }
86091
86091
  function Sh() {
86092
86092
  return Xp.byteLength === 0 && (Xp = new Float32Array(U.memory.buffer)), Xp;
@@ -86197,7 +86197,7 @@ class pi {
86197
86197
  try {
86198
86198
  const g = U.__wbindgen_add_to_stack_pointer(-16);
86199
86199
  U.rawcolliderset_coRadius(g, this.ptr, A);
86200
- var e = bt()[g / 4 + 0], t = Sh()[g / 4 + 1];
86200
+ var e = Lt()[g / 4 + 0], t = Sh()[g / 4 + 1];
86201
86201
  return e === 0 ? void 0 : t;
86202
86202
  } finally {
86203
86203
  U.__wbindgen_add_to_stack_pointer(16);
@@ -86207,7 +86207,7 @@ class pi {
86207
86207
  try {
86208
86208
  const g = U.__wbindgen_add_to_stack_pointer(-16);
86209
86209
  U.rawcolliderset_coHalfHeight(g, this.ptr, A);
86210
- var e = bt()[g / 4 + 0], t = Sh()[g / 4 + 1];
86210
+ var e = Lt()[g / 4 + 0], t = Sh()[g / 4 + 1];
86211
86211
  return e === 0 ? void 0 : t;
86212
86212
  } finally {
86213
86213
  U.__wbindgen_add_to_stack_pointer(16);
@@ -86217,7 +86217,7 @@ class pi {
86217
86217
  try {
86218
86218
  const g = U.__wbindgen_add_to_stack_pointer(-16);
86219
86219
  U.rawcolliderset_coRoundRadius(g, this.ptr, A);
86220
- var e = bt()[g / 4 + 0], t = Sh()[g / 4 + 1];
86220
+ var e = Lt()[g / 4 + 0], t = Sh()[g / 4 + 1];
86221
86221
  return e === 0 ? void 0 : t;
86222
86222
  } finally {
86223
86223
  U.__wbindgen_add_to_stack_pointer(16);
@@ -86227,7 +86227,7 @@ class pi {
86227
86227
  try {
86228
86228
  const g = U.__wbindgen_add_to_stack_pointer(-16);
86229
86229
  U.rawcolliderset_coVertices(g, this.ptr, A);
86230
- var e = bt()[g / 4 + 0], t = bt()[g / 4 + 1];
86230
+ var e = Lt()[g / 4 + 0], t = Lt()[g / 4 + 1];
86231
86231
  let I;
86232
86232
  return e !== 0 && (I = Xv(e, t).slice(), U.__wbindgen_free(e, 4 * t)), I;
86233
86233
  } finally {
@@ -86238,7 +86238,7 @@ class pi {
86238
86238
  try {
86239
86239
  const g = U.__wbindgen_add_to_stack_pointer(-16);
86240
86240
  U.rawcolliderset_coIndices(g, this.ptr, A);
86241
- var e = bt()[g / 4 + 0], t = bt()[g / 4 + 1];
86241
+ var e = Lt()[g / 4 + 0], t = Lt()[g / 4 + 1];
86242
86242
  let I;
86243
86243
  return e !== 0 && (I = function(o, s) {
86244
86244
  return R2().subarray(o / 4, o / 4 + s);
@@ -86251,7 +86251,7 @@ class pi {
86251
86251
  try {
86252
86252
  const g = U.__wbindgen_add_to_stack_pointer(-16);
86253
86253
  U.rawcolliderset_coHeightfieldHeights(g, this.ptr, A);
86254
- var e = bt()[g / 4 + 0], t = bt()[g / 4 + 1];
86254
+ var e = Lt()[g / 4 + 0], t = Lt()[g / 4 + 1];
86255
86255
  let I;
86256
86256
  return e !== 0 && (I = Xv(e, t).slice(), U.__wbindgen_free(e, 4 * t)), I;
86257
86257
  } finally {
@@ -86266,7 +86266,7 @@ class pi {
86266
86266
  try {
86267
86267
  const g = U.__wbindgen_add_to_stack_pointer(-16);
86268
86268
  U.rawcolliderset_coHeightfieldNRows(g, this.ptr, A);
86269
- var e = bt()[g / 4 + 0], t = bt()[g / 4 + 1];
86269
+ var e = Lt()[g / 4 + 0], t = Lt()[g / 4 + 1];
86270
86270
  return e === 0 ? void 0 : t >>> 0;
86271
86271
  } finally {
86272
86272
  U.__wbindgen_add_to_stack_pointer(16);
@@ -86276,7 +86276,7 @@ class pi {
86276
86276
  try {
86277
86277
  const g = U.__wbindgen_add_to_stack_pointer(-16);
86278
86278
  U.rawcolliderset_coHeightfieldNCols(g, this.ptr, A);
86279
- var e = bt()[g / 4 + 0], t = bt()[g / 4 + 1];
86279
+ var e = Lt()[g / 4 + 0], t = Lt()[g / 4 + 1];
86280
86280
  return e === 0 ? void 0 : t >>> 0;
86281
86281
  } finally {
86282
86282
  U.__wbindgen_add_to_stack_pointer(16);
@@ -86286,7 +86286,7 @@ class pi {
86286
86286
  try {
86287
86287
  const g = U.__wbindgen_add_to_stack_pointer(-16);
86288
86288
  U.rawcolliderset_coParent(g, this.ptr, A);
86289
- var e = bt()[g / 4 + 0], t = Zf()[g / 8 + 1];
86289
+ var e = Lt()[g / 4 + 0], t = Zf()[g / 8 + 1];
86290
86290
  return e === 0 ? void 0 : t;
86291
86291
  } finally {
86292
86292
  U.__wbindgen_add_to_stack_pointer(16);
@@ -86431,7 +86431,7 @@ class pi {
86431
86431
  try {
86432
86432
  const G = U.__wbindgen_add_to_stack_pointer(-16);
86433
86433
  iA(A, Ue), iA(e, BA), iA(t, Xe), iA(o, BA), iA(s, BA), iA(C, Xe), iA(M, fi), U.rawcolliderset_createCollider(G, this.ptr, A.ptr, e.ptr, t.ptr, g, I, o.ptr, s.ptr, C.ptr, n, a, B, Q, E, c, l, d, h, p, u, f, S, m, M.ptr);
86434
- var R = bt()[G / 4 + 0], k = Zf()[G / 8 + 1];
86434
+ var R = Lt()[G / 4 + 0], k = Zf()[G / 8 + 1];
86435
86435
  return R === 0 ? void 0 : k;
86436
86436
  } finally {
86437
86437
  U.__wbindgen_add_to_stack_pointer(16);
@@ -86447,7 +86447,7 @@ class pi {
86447
86447
  try {
86448
86448
  U.rawcolliderset_forEachColliderHandle(this.ptr, Ci(A));
86449
86449
  } finally {
86450
- Et[Lt++] = void 0;
86450
+ Et[xt++] = void 0;
86451
86451
  }
86452
86452
  }
86453
86453
  }
@@ -86691,14 +86691,14 @@ class hl {
86691
86691
  try {
86692
86692
  U.raweventqueue_drainCollisionEvents(this.ptr, Ci(A));
86693
86693
  } finally {
86694
- Et[Lt++] = void 0;
86694
+ Et[xt++] = void 0;
86695
86695
  }
86696
86696
  }
86697
86697
  drainContactForceEvents(A) {
86698
86698
  try {
86699
86699
  U.raweventqueue_drainContactForceEvents(this.ptr, Ci(A));
86700
86700
  } finally {
86701
- Et[Lt++] = void 0;
86701
+ Et[xt++] = void 0;
86702
86702
  }
86703
86703
  }
86704
86704
  clear() {
@@ -86833,14 +86833,14 @@ class eC {
86833
86833
  try {
86834
86834
  U.rawimpulsejointset_forEachJointHandle(this.ptr, Ci(A));
86835
86835
  } finally {
86836
- Et[Lt++] = void 0;
86836
+ Et[xt++] = void 0;
86837
86837
  }
86838
86838
  }
86839
86839
  forEachJointAttachedToRigidBody(A, e) {
86840
86840
  try {
86841
86841
  U.rawimpulsejointset_forEachJointAttachedToRigidBody(this.ptr, A, Ci(e));
86842
86842
  } finally {
86843
- Et[Lt++] = void 0;
86843
+ Et[xt++] = void 0;
86844
86844
  }
86845
86845
  }
86846
86846
  }
@@ -86937,7 +86937,7 @@ class ds {
86937
86937
  try {
86938
86938
  U.rawislandmanager_forEachActiveRigidBodyHandle(this.ptr, Ci(A));
86939
86939
  } finally {
86940
- Et[Lt++] = void 0;
86940
+ Et[xt++] = void 0;
86941
86941
  }
86942
86942
  }
86943
86943
  }
@@ -87005,14 +87005,14 @@ class tC {
87005
87005
  try {
87006
87006
  U.rawmultibodyjointset_forEachJointHandle(this.ptr, Ci(A));
87007
87007
  } finally {
87008
- Et[Lt++] = void 0;
87008
+ Et[xt++] = void 0;
87009
87009
  }
87010
87010
  }
87011
87011
  forEachJointAttachedToRigidBody(A, e) {
87012
87012
  try {
87013
87013
  U.rawmultibodyjointset_forEachJointAttachedToRigidBody(this.ptr, A, Ci(e));
87014
87014
  } finally {
87015
- Et[Lt++] = void 0;
87015
+ Et[xt++] = void 0;
87016
87016
  }
87017
87017
  }
87018
87018
  }
@@ -87101,7 +87101,7 @@ class AD {
87101
87101
  try {
87102
87102
  const t = U.__wbindgen_add_to_stack_pointer(-16);
87103
87103
  U.rawpointcolliderprojection_featureId(t, this.ptr);
87104
- var A = bt()[t / 4 + 0], e = bt()[t / 4 + 1];
87104
+ var A = Lt()[t / 4 + 0], e = Lt()[t / 4 + 1];
87105
87105
  return A === 0 ? void 0 : e >>> 0;
87106
87106
  } finally {
87107
87107
  U.__wbindgen_add_to_stack_pointer(16);
@@ -87155,7 +87155,7 @@ class eD {
87155
87155
  const Q = U.rawquerypipeline_castRay(this.ptr, A.ptr, e.ptr, t.ptr, g.ptr, I, o, s, !pe(C), pe(C) ? 0 : C, !pe(n), pe(n) ? 0 : n, !pe(a), pe(a) ? 0 : a, Ci(B));
87156
87156
  return Q === 0 ? void 0 : iF.__wrap(Q);
87157
87157
  } finally {
87158
- Et[Lt++] = void 0;
87158
+ Et[xt++] = void 0;
87159
87159
  }
87160
87160
  }
87161
87161
  castRayAndGetNormal(A, e, t, g, I, o, s, C, n, a, B) {
@@ -87164,24 +87164,24 @@ class eD {
87164
87164
  const Q = U.rawquerypipeline_castRayAndGetNormal(this.ptr, A.ptr, e.ptr, t.ptr, g.ptr, I, o, s, !pe(C), pe(C) ? 0 : C, !pe(n), pe(n) ? 0 : n, !pe(a), pe(a) ? 0 : a, Ci(B));
87165
87165
  return Q === 0 ? void 0 : yy.__wrap(Q);
87166
87166
  } finally {
87167
- Et[Lt++] = void 0;
87167
+ Et[xt++] = void 0;
87168
87168
  }
87169
87169
  }
87170
87170
  intersectionsWithRay(A, e, t, g, I, o, s, C, n, a, B, Q) {
87171
87171
  try {
87172
87172
  iA(A, fi), iA(e, pi), iA(t, BA), iA(g, BA), U.rawquerypipeline_intersectionsWithRay(this.ptr, A.ptr, e.ptr, t.ptr, g.ptr, I, o, Ci(s), C, !pe(n), pe(n) ? 0 : n, !pe(a), pe(a) ? 0 : a, !pe(B), pe(B) ? 0 : B, Ci(Q));
87173
87173
  } finally {
87174
- Et[Lt++] = void 0, Et[Lt++] = void 0;
87174
+ Et[xt++] = void 0, Et[xt++] = void 0;
87175
87175
  }
87176
87176
  }
87177
87177
  intersectionWithShape(A, e, t, g, I, o, s, C, n, a) {
87178
87178
  try {
87179
87179
  const E = U.__wbindgen_add_to_stack_pointer(-16);
87180
87180
  iA(A, fi), iA(e, pi), iA(t, BA), iA(g, Xe), iA(I, Ue), U.rawquerypipeline_intersectionWithShape(E, this.ptr, A.ptr, e.ptr, t.ptr, g.ptr, I.ptr, o, !pe(s), pe(s) ? 0 : s, !pe(C), pe(C) ? 0 : C, !pe(n), pe(n) ? 0 : n, Ci(a));
87181
- var B = bt()[E / 4 + 0], Q = Zf()[E / 8 + 1];
87181
+ var B = Lt()[E / 4 + 0], Q = Zf()[E / 8 + 1];
87182
87182
  return B === 0 ? void 0 : Q;
87183
87183
  } finally {
87184
- U.__wbindgen_add_to_stack_pointer(16), Et[Lt++] = void 0;
87184
+ U.__wbindgen_add_to_stack_pointer(16), Et[xt++] = void 0;
87185
87185
  }
87186
87186
  }
87187
87187
  projectPoint(A, e, t, g, I, o, s, C, n) {
@@ -87190,7 +87190,7 @@ class eD {
87190
87190
  const a = U.rawquerypipeline_projectPoint(this.ptr, A.ptr, e.ptr, t.ptr, g, I, !pe(o), pe(o) ? 0 : o, !pe(s), pe(s) ? 0 : s, !pe(C), pe(C) ? 0 : C, Ci(n));
87191
87191
  return a === 0 ? void 0 : AD.__wrap(a);
87192
87192
  } finally {
87193
- Et[Lt++] = void 0;
87193
+ Et[xt++] = void 0;
87194
87194
  }
87195
87195
  }
87196
87196
  projectPointAndGetFeature(A, e, t, g, I, o, s, C) {
@@ -87199,14 +87199,14 @@ class eD {
87199
87199
  const n = U.rawquerypipeline_projectPointAndGetFeature(this.ptr, A.ptr, e.ptr, t.ptr, g, !pe(I), pe(I) ? 0 : I, !pe(o), pe(o) ? 0 : o, !pe(s), pe(s) ? 0 : s, Ci(C));
87200
87200
  return n === 0 ? void 0 : AD.__wrap(n);
87201
87201
  } finally {
87202
- Et[Lt++] = void 0;
87202
+ Et[xt++] = void 0;
87203
87203
  }
87204
87204
  }
87205
87205
  intersectionsWithPoint(A, e, t, g, I, o, s, C, n) {
87206
87206
  try {
87207
87207
  iA(A, fi), iA(e, pi), iA(t, BA), U.rawquerypipeline_intersectionsWithPoint(this.ptr, A.ptr, e.ptr, t.ptr, Ci(g), I, !pe(o), pe(o) ? 0 : o, !pe(s), pe(s) ? 0 : s, !pe(C), pe(C) ? 0 : C, Ci(n));
87208
87208
  } finally {
87209
- Et[Lt++] = void 0, Et[Lt++] = void 0;
87209
+ Et[xt++] = void 0, Et[xt++] = void 0;
87210
87210
  }
87211
87211
  }
87212
87212
  castShape(A, e, t, g, I, o, s, C, n, a, B, Q) {
@@ -87215,21 +87215,21 @@ class eD {
87215
87215
  const E = U.rawquerypipeline_castShape(this.ptr, A.ptr, e.ptr, t.ptr, g.ptr, I.ptr, o.ptr, s, C, !pe(n), pe(n) ? 0 : n, !pe(a), pe(a) ? 0 : a, !pe(B), pe(B) ? 0 : B, Ci(Q));
87216
87216
  return E === 0 ? void 0 : ky.__wrap(E);
87217
87217
  } finally {
87218
- Et[Lt++] = void 0;
87218
+ Et[xt++] = void 0;
87219
87219
  }
87220
87220
  }
87221
87221
  intersectionsWithShape(A, e, t, g, I, o, s, C, n, a, B) {
87222
87222
  try {
87223
87223
  iA(A, fi), iA(e, pi), iA(t, BA), iA(g, Xe), iA(I, Ue), U.rawquerypipeline_intersectionsWithShape(this.ptr, A.ptr, e.ptr, t.ptr, g.ptr, I.ptr, Ci(o), s, !pe(C), pe(C) ? 0 : C, !pe(n), pe(n) ? 0 : n, !pe(a), pe(a) ? 0 : a, Ci(B));
87224
87224
  } finally {
87225
- Et[Lt++] = void 0, Et[Lt++] = void 0;
87225
+ Et[xt++] = void 0, Et[xt++] = void 0;
87226
87226
  }
87227
87227
  }
87228
87228
  collidersWithAabbIntersectingAabb(A, e, t) {
87229
87229
  try {
87230
87230
  iA(A, BA), iA(e, BA), U.rawquerypipeline_collidersWithAabbIntersectingAabb(this.ptr, A.ptr, e.ptr, Ci(t));
87231
87231
  } finally {
87232
- Et[Lt++] = void 0;
87232
+ Et[xt++] = void 0;
87233
87233
  }
87234
87234
  }
87235
87235
  }
@@ -87263,7 +87263,7 @@ class yy {
87263
87263
  try {
87264
87264
  const t = U.__wbindgen_add_to_stack_pointer(-16);
87265
87265
  U.rawpointcolliderprojection_featureId(t, this.ptr);
87266
- var A = bt()[t / 4 + 0], e = bt()[t / 4 + 1];
87266
+ var A = Lt()[t / 4 + 0], e = Lt()[t / 4 + 1];
87267
87267
  return A === 0 ? void 0 : e >>> 0;
87268
87268
  } finally {
87269
87269
  U.__wbindgen_add_to_stack_pointer(16);
@@ -87317,7 +87317,7 @@ class Sy {
87317
87317
  try {
87318
87318
  const t = U.__wbindgen_add_to_stack_pointer(-16);
87319
87319
  U.rawrayintersection_featureId(t, this.ptr);
87320
- var A = bt()[t / 4 + 0], e = bt()[t / 4 + 1];
87320
+ var A = Lt()[t / 4 + 0], e = Lt()[t / 4 + 1];
87321
87321
  return A === 0 ? void 0 : e >>> 0;
87322
87322
  } finally {
87323
87323
  U.__wbindgen_add_to_stack_pointer(16);
@@ -87516,7 +87516,7 @@ class fi {
87516
87516
  try {
87517
87517
  U.rawrigidbodyset_forEachRigidBodyHandle(this.ptr, Ci(A));
87518
87518
  } finally {
87519
- Et[Lt++] = void 0;
87519
+ Et[xt++] = void 0;
87520
87520
  }
87521
87521
  }
87522
87522
  }
@@ -87878,7 +87878,7 @@ async function U2(i) {
87878
87878
  return Ui(I);
87879
87879
  }, g.wbg.__wbindgen_number_get = function(I, o) {
87880
87880
  const s = dt(o), C = typeof s == "number" ? s : void 0;
87881
- Zf()[I / 8 + 1] = pe(C) ? 0 : C, bt()[I / 4 + 0] = !pe(C);
87881
+ Zf()[I / 8 + 1] = pe(C) ? 0 : C, Lt()[I / 4 + 0] = !pe(C);
87882
87882
  }, g.wbg.__wbindgen_boolean_get = function(I) {
87883
87883
  const o = dt(I);
87884
87884
  return typeof o == "boolean" ? o ? 1 : 0 : 2;
@@ -89856,7 +89856,7 @@ function N2() {
89856
89856
  try {
89857
89857
  const e = U.__wbindgen_add_to_stack_pointer(-16);
89858
89858
  U.version(e);
89859
- var i = bt()[e / 4 + 0], A = bt()[e / 4 + 1];
89859
+ var i = Lt()[e / 4 + 0], A = Lt()[e / 4 + 1];
89860
89860
  return M2(i, A);
89861
89861
  } finally {
89862
89862
  U.__wbindgen_add_to_stack_pointer(16), U.__wbindgen_free(i, A);
@@ -89999,7 +89999,7 @@ const naA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
89999
89999
  let bn;
90000
90000
  globalThis.true = globalThis.true !== void 0 ? globalThis.true : !0;
90001
90001
  hi && console.log("Use Rapier", !0, globalThis.true);
90002
- xt.registerCallback(sg.ContextCreationStart, (i) => {
90002
+ Tt.registerCallback(sg.ContextCreationStart, (i) => {
90003
90003
  hi && console.log("Register rapier physics backend"), i.context.physics.engine = new ar(), i.context.physics.engine.initialize(i.context);
90004
90004
  });
90005
90005
  const Fh = class {
@@ -90018,7 +90018,6 @@ const Fh = class {
90018
90018
  // physics simulation
90019
90019
  r(this, "enabled", !1);
90020
90020
  r(this, "_tempPosition", new w());
90021
- r(this, "_tempPosition2", new w());
90022
90021
  r(this, "_tempQuaternion", new GA());
90023
90022
  r(this, "_tempScale", new w());
90024
90023
  r(this, "_tempMatrix", new FA());
@@ -90033,6 +90032,9 @@ const Fh = class {
90033
90032
  r(this, "_gravity", { x: 0, y: -9.81, z: 0 });
90034
90033
  // private _lastStepTime: number | undefined = 0;
90035
90034
  r(this, "lines");
90035
+ r(this, "_tempCenterPos", new w());
90036
+ r(this, "_tempCenterVec", new w());
90037
+ r(this, "_tempCenterQuaternion", new GA());
90036
90038
  }
90037
90039
  removeBody(A) {
90038
90040
  var t, g, I;
@@ -90363,7 +90365,7 @@ this is not optimal for performance since this isn't supported by the Rapier phy
90363
90365
  throw new Error("Physics world not initialized");
90364
90366
  const t = this._tempMatrix;
90365
90367
  let g;
90366
- A.attachedRigidbody ? g = this.getRigidbody(A, this._tempMatrix) : (hi && console.log("Create collider without rigidbody", A.name), t.makeRotationFromQuaternion(Tt(A.gameObject)), t.setPosition(he(A.gameObject))), t.decompose(this._tempPosition, this._tempQuaternion, this._tempScale), this.tryApplyCenter(A, this._tempPosition), e.setTranslation(this._tempPosition.x, this._tempPosition.y, this._tempPosition.z), e.setRotation(this._tempQuaternion), e.setSensor(A.isTrigger);
90368
+ A.attachedRigidbody ? g = this.getRigidbody(A, this._tempMatrix) : (hi && console.log("Create collider without rigidbody", A.name), t.makeRotationFromQuaternion(Kt(A.gameObject)), t.setPosition(he(A.gameObject))), t.decompose(this._tempPosition, this._tempQuaternion, this._tempScale), this.tryApplyCenter(A, this._tempPosition), e.setTranslation(this._tempPosition.x, this._tempPosition.y, this._tempPosition.z), e.setRotation(this._tempQuaternion), e.setSensor(A.isTrigger);
90367
90369
  const I = A.sharedMaterial;
90368
90370
  if (I) {
90369
90371
  if (I.bounciness !== void 0 && e.setRestitution(I.bounciness), I.bounceCombine !== void 0)
@@ -90412,16 +90414,16 @@ Error:`, s), null;
90412
90414
  let t = null;
90413
90415
  if (A.attachedRigidbody) {
90414
90416
  const g = A.attachedRigidbody;
90415
- if (t = g[dI], g.autoMass, !t) {
90417
+ if (t = g[dI], !t) {
90416
90418
  const I = g.isKinematic && !nk;
90417
90419
  hi && console.log("Create rigidbody", I);
90418
90420
  const o = I ? bn.RigidBodyDesc.kinematicPositionBased() : bn.RigidBodyDesc.dynamic(), s = he(A.attachedRigidbody.gameObject);
90419
- o.setTranslation(s.x, s.y, s.z), o.setRotation(Tt(A.attachedRigidbody.gameObject)), t = this.world.createRigidBody(o), this.bodies.push(t), this.objects.push(g);
90421
+ o.setTranslation(s.x, s.y, s.z), o.setRotation(Kt(A.attachedRigidbody.gameObject)), t = this.world.createRigidBody(o), this.bodies.push(t), this.objects.push(g);
90420
90422
  }
90421
90423
  t[DI] = g, g[dI] = t, this.internalUpdateRigidbodyProperties(g, t), this.getRigidbodyRelativeMatrix(A.gameObject, g.gameObject, e), A[Ab] = t;
90422
90424
  } else {
90423
90425
  const g = bn.RigidBodyDesc.kinematicPositionBased(), I = he(A.gameObject);
90424
- g.setTranslation(I.x, I.y, I.z), g.setRotation(Tt(A.gameObject)), t = this.world.createRigidBody(g), e.identity(), t[DI] = null;
90426
+ g.setTranslation(I.x, I.y, I.z), g.setRotation(Kt(A.gameObject)), t = this.world.createRigidBody(g), e.identity(), t[DI] = null;
90425
90427
  }
90426
90428
  return t;
90427
90429
  }
@@ -90508,7 +90510,7 @@ Error:`, s), null;
90508
90510
  }
90509
90511
  syncPhysicsBody(A, e, t, g) {
90510
90512
  if (e instanceof gE) {
90511
- const I = he(A, this._tempPosition), o = Tt(A, this._tempQuaternion);
90513
+ const I = he(A, this._tempPosition), o = Kt(A, this._tempQuaternion);
90512
90514
  switch (e.bodyType()) {
90513
90515
  case iI.Fixed:
90514
90516
  case iI.KinematicPositionBased:
@@ -90521,13 +90523,17 @@ Error:`, s), null;
90521
90523
  }
90522
90524
  e.wakeUp();
90523
90525
  } else if (e instanceof sE) {
90524
- const I = he(A, this._tempPosition), o = Tt(A, this._tempQuaternion), s = e[DI];
90526
+ const I = he(A, this._tempPosition), o = Kt(A, this._tempQuaternion), s = e[DI];
90525
90527
  this.tryApplyCenter(s, I), t && e.setTranslation(I), g && e.setRotation(o);
90526
90528
  }
90527
90529
  }
90528
90530
  tryApplyCenter(A, e) {
90529
90531
  const t = A.center;
90530
- t && A.gameObject && (fg(A.gameObject, this._tempScale), this._tempPosition2.x = t.x, this._tempPosition2.y = t.y, this._tempPosition2.z = t.z, this._tempPosition2.multiply(this._tempScale), e.x -= this._tempPosition2.x, e.y += this._tempPosition2.y, e.z += this._tempPosition2.z);
90532
+ if (t && A.gameObject && (t.x !== 0 || t.y !== 0 || t.z !== 0)) {
90533
+ this._tempCenterPos.x = -t.x, this._tempCenterPos.y = t.y, this._tempCenterPos.z = t.z, fg(A.gameObject, this._tempCenterVec), this._tempCenterPos.multiply(this._tempCenterVec);
90534
+ const g = Kt(A.gameObject, this._tempCenterQuaternion);
90535
+ this._tempCenterPos.applyQuaternion(g), e.x += this._tempCenterPos.x, e.y += this._tempCenterPos.y, e.z += this._tempCenterPos.z;
90536
+ }
90531
90537
  }
90532
90538
  getRigidbodyRelativeMatrix(A, e, t, g) {
90533
90539
  if (g === void 0 && (g = Fh._matricesBuffer, g.length = 0), A === e) {
@@ -90729,7 +90735,7 @@ Object.defineProperty($e.prototype, "far", {
90729
90735
  }
90730
90736
  });
90731
90737
  function jrA(i, A, e, t = "image/webp", g) {
90732
- if (!i && (i = xt.Current, !i))
90738
+ if (!i && (i = Tt.Current, !i))
90733
90739
  return console.error("Can not save screenshot: No needle-engine context found or provided."), null;
90734
90740
  if (!g && (g = i.mainCamera, !g))
90735
90741
  return console.error("No camera found"), null;
@@ -90756,7 +90762,7 @@ function ZrA(i, A) {
90756
90762
  }
90757
90763
  }
90758
90764
  const CD = sA("debugmissingcamera");
90759
- xt.registerCallback(sg.MissingCamera, (i) => {
90765
+ Tt.registerCallback(sg.MissingCamera, (i) => {
90760
90766
  var I, o, s;
90761
90767
  CD && console.warn("Creating missing camera");
90762
90768
  const A = i.context.scene, e = new SA();
@@ -90766,7 +90772,7 @@ xt.registerCallback(sg.MissingCamera, (i) => {
90766
90772
  const g = Zr(e, t, !0);
90767
90773
  return e.position.x = 0, e.position.y = 1, e.position.z = 2, K2(i.context, g), g;
90768
90774
  });
90769
- xt.registerCallback(sg.ContextCreated, (i) => {
90775
+ Tt.registerCallback(sg.ContextCreated, (i) => {
90770
90776
  if (!i.context.mainCamera) {
90771
90777
  CD && console.log("Will not auto-fit because a default camera exists");
90772
90778
  return;
@@ -91518,7 +91524,7 @@ export {
91518
91524
  xe as Context,
91519
91525
  QrA as ContextArgs,
91520
91526
  sg as ContextEvent,
91521
- xt as ContextRegistry,
91527
+ Tt as ContextRegistry,
91522
91528
  IU as ControlTrackHandler,
91523
91529
  On as ControllerEvents,
91524
91530
  hh as ControllerType,
@@ -91604,7 +91610,7 @@ export {
91604
91610
  No as NEEDLE_progressive,
91605
91611
  KS as NEKeyboardEvent,
91606
91612
  Yn as NEPointerEvent,
91607
- xt as NeedleEngine,
91613
+ Tt as NeedleEngine,
91608
91614
  m2 as NeedleEngineHTMLElement,
91609
91615
  d2 as NeedleGltfLoader,
91610
91616
  _S as NeedlePatchesKey,
@@ -91806,7 +91812,7 @@ export {
91806
91812
  Aj as destroyComponentInstance,
91807
91813
  _gA as detectARSupport,
91808
91814
  OgA as detectVRSupport,
91809
- vt as disposeObjectResources,
91815
+ bt as disposeObjectResources,
91810
91816
  Xn as disposeStream,
91811
91817
  eX as download,
91812
91818
  WT as download_file,
@@ -91842,7 +91848,7 @@ export {
91842
91848
  ix as getWorldDirection,
91843
91849
  U8 as getWorldEuler,
91844
91850
  he as getWorldPosition,
91845
- Tt as getWorldQuaternion,
91851
+ Kt as getWorldQuaternion,
91846
91852
  ew as getWorldRotation,
91847
91853
  fg as getWorldScale,
91848
91854
  iY as hasIndieLicense,