@needle-tools/engine 3.37.4-alpha → 3.37.6-alpha

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/needle-engine.js +258 -186
  3. package/dist/needle-engine.light.js +258 -186
  4. package/dist/needle-engine.light.min.js +25 -25
  5. package/dist/needle-engine.light.umd.cjs +156 -156
  6. package/dist/needle-engine.min.js +25 -25
  7. package/dist/needle-engine.umd.cjs +49 -49
  8. package/lib/engine/extensions/NEEDLE_progressive.d.ts +1 -0
  9. package/lib/engine/extensions/NEEDLE_progressive.js +7 -1
  10. package/lib/engine/extensions/NEEDLE_progressive.js.map +1 -1
  11. package/lib/engine-components/DropListener.d.ts +31 -3
  12. package/lib/engine-components/DropListener.js +30 -2
  13. package/lib/engine-components/DropListener.js.map +1 -1
  14. package/lib/engine-components/OrbitControls.d.ts +16 -3
  15. package/lib/engine-components/OrbitControls.js +25 -9
  16. package/lib/engine-components/OrbitControls.js.map +1 -1
  17. package/lib/engine-components/ParticleSystem.d.ts +31 -1
  18. package/lib/engine-components/ParticleSystem.js +42 -1
  19. package/lib/engine-components/ParticleSystem.js.map +1 -1
  20. package/lib/engine-components/SceneSwitcher.d.ts +22 -2
  21. package/lib/engine-components/SceneSwitcher.js +29 -3
  22. package/lib/engine-components/SceneSwitcher.js.map +1 -1
  23. package/lib/engine-components/VideoPlayer.d.ts +5 -3
  24. package/lib/engine-components/VideoPlayer.js +26 -14
  25. package/lib/engine-components/VideoPlayer.js.map +1 -1
  26. package/lib/engine-components/webxr/WebARCameraBackground.js +8 -0
  27. package/lib/engine-components/webxr/WebARCameraBackground.js.map +1 -1
  28. package/package.json +1 -1
  29. package/src/engine/extensions/NEEDLE_progressive.ts +9 -1
  30. package/src/engine-components/DropListener.ts +30 -2
  31. package/src/engine-components/OrbitControls.ts +29 -11
  32. package/src/engine-components/ParticleSystem.ts +44 -4
  33. package/src/engine-components/SceneSwitcher.ts +45 -5
  34. package/src/engine-components/VideoPlayer.ts +25 -13
  35. package/src/engine-components/webxr/WebARCameraBackground.ts +9 -0
@@ -28989,7 +28989,7 @@ function FBA(g, A) {
28989
28989
  g.lookAt(A), g.quaternion.multiply(IX);
28990
28990
  }
28991
28991
  function $w(g, A, e = !0, t = !1) {
28992
- const i = xe(A), I = xe(g);
28992
+ const i = _e(A), I = _e(g);
28993
28993
  if (t) {
28994
28994
  if (Ns(g, bt(A)), e) {
28995
28995
  const o = I.y, s = I.sub(aT(g));
@@ -29010,7 +29010,7 @@ function TQ(g) {
29010
29010
  return g instanceof MA ? A.copy(g) : g instanceof DOMPointReadOnly && A.set(g.x, g.y, g.z, g.w), A;
29011
29011
  }
29012
29012
  const ZU = new Rs(() => new w(), 100), yJ = Symbol("lastMatrixWorldUpdateKey");
29013
- function xe(g, A = null, e = !0) {
29013
+ function _e(g, A = null, e = !0) {
29014
29014
  const t = A ?? ZU.get();
29015
29015
  return g ? g.parent ? (e && g.updateWorldMatrix(!0, !1), g.matrixWorldNeedsUpdate && g[yJ] !== Date.now() && (g[yJ] = Date.now(), g.updateMatrixWorld()), t.setFromMatrixPosition(g.matrixWorld), t) : t.copy(g.position) : t.set(0, 0, 0);
29016
29016
  }
@@ -29476,13 +29476,13 @@ function vBA(g) {
29476
29476
  ok = g;
29477
29477
  }
29478
29478
  const lT = IA("debugdefines");
29479
- OE('if(!globalThis[""3.37.4-alpha""]) globalThis[""3.37.4-alpha""] = "0.0.0";');
29479
+ OE('if(!globalThis[""3.37.6-alpha""]) globalThis[""3.37.6-alpha""] = "0.0.0";');
29480
29480
  OE('if(!globalThis[""undefined""]) globalThis[""undefined""] = "unknown";');
29481
- OE('if(!globalThis[""Mon Apr 22 2024 09:46:17 GMT+0200 (Central European Summer Time)""]) globalThis[""Mon Apr 22 2024 09:46:17 GMT+0200 (Central European Summer Time)""] = "unknown";');
29482
- OE('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.37.4-alpha";');
29481
+ OE('if(!globalThis[""Wed Apr 24 2024 17:26:38 GMT+0200 (Central European Summer Time)""]) globalThis[""Wed Apr 24 2024 17:26:38 GMT+0200 (Central European Summer Time)""] = "unknown";');
29482
+ OE('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.37.6-alpha";');
29483
29483
  OE('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
29484
- OE('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Mon Apr 22 2024 09:46:17 GMT+0200 (Central European Summer Time)";');
29485
- const lC = "3.37.4-alpha", jU = "undefined", hT = "Mon Apr 22 2024 09:46:17 GMT+0200 (Central European Summer Time)";
29484
+ OE('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Wed Apr 24 2024 17:26:38 GMT+0200 (Central European Summer Time)";');
29485
+ const lC = "3.37.6-alpha", jU = "undefined", hT = "Wed Apr 24 2024 17:26:38 GMT+0200 (Central European Summer Time)";
29486
29486
  lT && console.log(`Engine version: ${lC} (generator: ${jU})
29487
29487
  Project built at ${hT}`);
29488
29488
  const Ra = "needle_isActiveInHierarchy", GQ = "builtin_components", hf = "needle_editor_guid";
@@ -44369,7 +44369,7 @@ const sm = Symbol("assetReference"), vr = class {
44369
44369
  * @returns the AssetReference for the URL
44370
44370
  */
44371
44371
  static getOrCreateFromUrl(A, e) {
44372
- if (!e && (e = Le.Current, !e))
44372
+ if (!e && (e = xe.Current, !e))
44373
44373
  throw new Error('Context is required when sourceId is a string. When you call this method from a component you can call it with "getOrCreate(this, url)" where "this" is the component.');
44374
44374
  const t = e.addressables, i = t.findAssetReference(A);
44375
44375
  if (i)
@@ -44383,7 +44383,7 @@ const sm = Symbol("assetReference"), vr = class {
44383
44383
  */
44384
44384
  static getOrCreate(A, e, t) {
44385
44385
  if (typeof A == "string") {
44386
- if (!t && (t = Le.Current, !t))
44386
+ if (!t && (t = xe.Current, !t))
44387
44387
  throw new Error('Context is required when sourceId is a string. When you call this method from a component you can call it with "getOrCreate(this, url)" where "this" is the component.');
44388
44388
  } else
44389
44389
  t = A.context, A = A.sourceId;
@@ -44426,7 +44426,7 @@ const sm = Symbol("assetReference"), vr = class {
44426
44426
  }
44427
44427
  /** frees previously allocated memory and destroys the current `asset` instance (if any) */
44428
44428
  unload() {
44429
- this.asset && (ia && console.log("Unload", this.asset), this.asset.scene && yn(this.asset.scene, !0, !0), yn(this.asset, !0, !0)), this.asset = null, this._rawBinary = void 0, this._glbRoot = null, this._loading = void 0, Le.Current && Le.Current.addressables.unregisterAssetReference(this);
44429
+ this.asset && (ia && console.log("Unload", this.asset), this.asset.scene && yn(this.asset.scene, !0, !0), yn(this.asset, !0, !0)), this.asset = null, this._rawBinary = void 0, this._glbRoot = null, this._loading = void 0, xe.Current && xe.Current.addressables.unregisterAssetReference(this);
44430
44430
  }
44431
44431
  /** loads the asset binary without creating an instance */
44432
44432
  async preload() {
@@ -44449,7 +44449,7 @@ const sm = Symbol("assetReference"), vr = class {
44449
44449
  return this.asset;
44450
44450
  if (A && this._progressListeners.push(A), this._loading !== void 0)
44451
44451
  return this._loading.then((i) => this.asset);
44452
- const e = Le.Current;
44452
+ const e = xe.Current;
44453
44453
  this._rawBinary ? (this._loading = pn().parseSync(e, this._rawBinary, this.uri, null), this.raiseProgressEvent(new ProgressEvent("progress", { loaded: this._rawBinary.byteLength, total: this._rawBinary.byteLength }))) : (ia && console.log("Load async", this.uri), this._loading = pn().loadSync(e, this._hashedUri, this.uri, null, (i) => {
44454
44454
  this.raiseProgressEvent(i);
44455
44455
  }));
@@ -44477,7 +44477,7 @@ const sm = Symbol("assetReference"), vr = class {
44477
44477
  e(this, A);
44478
44478
  }
44479
44479
  async onInstantiate(A, e = !1, t) {
44480
- const i = Le.Current, I = new kn();
44480
+ const i = xe.Current, I = new kn();
44481
44481
  if (A instanceof uA ? I.parent = A : A && I.cloneAssign(A), I.parent || (I.parent = i.scene), this.mustLoad && await this.loadAssetAsync(), ia && console.log("Instantiate", this.uri, "parent:", A), this.asset) {
44482
44482
  ia && console.log("Add to scene", this.asset);
44483
44483
  let o = vr.currentlyInstantiating.get(this.uri);
@@ -44994,7 +44994,7 @@ class Zi {
44994
44994
  this.set({ textContent: B }), C.tmuiNeedsUpdate = !0;
44995
44995
  };
44996
44996
  }
44997
- return this.tmuiNeedsUpdate = !0, this.registerTimedObject(Le.Current, o, A, this.textLabelCache), o;
44997
+ return this.tmuiNeedsUpdate = !0, this.registerTimedObject(xe.Current, o, A, this.textLabelCache), o;
44998
44998
  }
44999
44999
  static getBox(A) {
45000
45000
  let e = this.boxesCache.pop();
@@ -45002,7 +45002,7 @@ class Zi {
45002
45002
  const t = new Yt(1, 1, 1);
45003
45003
  e = new lA(t);
45004
45004
  }
45005
- return this.registerTimedObject(Le.Current, e, A, this.boxesCache), e;
45005
+ return this.registerTimedObject(xe.Current, e, A, this.boxesCache), e;
45006
45006
  }
45007
45007
  static getLine(A) {
45008
45008
  let e = this.linesCache.pop();
@@ -45011,15 +45011,15 @@ class Zi {
45011
45011
  let t = e.geometry.getAttribute("position");
45012
45012
  t || (t = new te(new Float32Array(2 * 3), 3), e.geometry.setAttribute("position", t));
45013
45013
  }
45014
- return e.frustumCulled = !1, this.registerTimedObject(Le.Current, e, A, this.linesCache), e;
45014
+ return e.frustumCulled = !1, this.registerTimedObject(xe.Current, e, A, this.linesCache), e;
45015
45015
  }
45016
45016
  static getSphere(A, e, t) {
45017
45017
  let i = this.spheresCache.pop();
45018
- return i || (i = new lA(new vs(1, 8, 8))), i.scale.set(A, A, A), i.material.wireframe = t, this.registerTimedObject(Le.Current, i, e, this.spheresCache), i;
45018
+ return i || (i = new lA(new vs(1, 8, 8))), i.scale.set(A, A, A), i.material.wireframe = t, this.registerTimedObject(xe.Current, i, e, this.spheresCache), i;
45019
45019
  }
45020
45020
  static getArrowHead(A) {
45021
45021
  let e = this.arrowHeadsCache.pop();
45022
- return e || (e = new lA(new xi(0, 0.5, 1, 8))), this.registerTimedObject(Le.Current, e, A, this.arrowHeadsCache), e;
45022
+ return e || (e = new lA(new xi(0, 0.5, 1, 8))), this.registerTimedObject(xe.Current, e, A, this.arrowHeadsCache), e;
45023
45023
  }
45024
45024
  static registerTimedObject(A, e, t, i) {
45025
45025
  const I = this.contextBeforeRenderCallbacks.get(A), o = this.contextPostRenderCallbacks.get(A);
@@ -45047,7 +45047,7 @@ class Zi {
45047
45047
  }
45048
45048
  e.traverse((s) => {
45049
45049
  s.layers.disableAll(), s.layers.enable(2);
45050
- }), e.renderOrder = 999999, e[Uk] = i, this.timedObjectsBuffer.push(e), this.timesBuffer.push(Le.Current.time.realtimeSinceStartup + t), A.scene.add(e);
45050
+ }), e.renderOrder = 999999, e[Uk] = i, this.timedObjectsBuffer.push(e), this.timesBuffer.push(xe.Current.time.realtimeSinceStartup + t), A.scene.add(e);
45051
45051
  }
45052
45052
  static onBeforeRender(A, e) {
45053
45053
  this.tmuiNeedsUpdate && Lt.update();
@@ -45785,11 +45785,11 @@ class GAA {
45785
45785
  return e[A] = t, t;
45786
45786
  }
45787
45787
  onDispatchEvent(A) {
45788
- const e = Le.Current;
45788
+ const e = xe.Current;
45789
45789
  try {
45790
- Le.Current = this.context, this.dispatchEvent(A);
45790
+ xe.Current = this.context, this.dispatchEvent(A);
45791
45791
  } finally {
45792
- Le.Current = e;
45792
+ xe.Current = e;
45793
45793
  }
45794
45794
  }
45795
45795
  }
@@ -46277,8 +46277,8 @@ Pinch: ${(i = this.getGesture("pinch")) == null ? void 0 : i.value.toFixed(3)}`)
46277
46277
  }
46278
46278
  if (this.xr.mode === "immersive-vr" || this.xr.isPassThrough) {
46279
46279
  this.pointerInit.origin = this, this.pointerInit.pointerId = this.index * 10 + e, this.pointerInit.pointerType = this.hand ? "hand" : "controller", this.pointerInit.button = e, this.pointerInit.buttonName = t, this.pointerInit.isPrimary = i, this.pointerInit.mode = this.inputSource.targetRayMode, this.pointerInit.ray = this.ray, this.pointerInit.device = this.object, this.pointerInit.pressure = o;
46280
- const s = Le.Current;
46281
- Le.Current = this.xr.context, ga && A !== "pointermove" && console.warn("Pointer event", A, e, t, { ...this.pointerInit }), this.xr.context.input.createInputEvent(new Ca(A, I, this.pointerInit)), Le.Current = s;
46280
+ const s = xe.Current;
46281
+ xe.Current = this.xr.context, ga && A !== "pointermove" && console.warn("Pointer event", A, e, t, { ...this.pointerInit }), this.xr.context.input.createInputEvent(new Ca(A, I, this.pointerInit)), xe.Current = s;
46282
46282
  }
46283
46283
  }
46284
46284
  }
@@ -52794,7 +52794,7 @@ async function meA() {
52794
52794
  const A = sessionStorage.getItem("needle_xr_session_mode"), e = sessionStorage.getItem("needle_xr_session_init") ?? null, t = e ? JSON.parse(e) : null;
52795
52795
  let i = null;
52796
52796
  if (RY() && (await wa.start(A || "immersive-vr", t || Se.getDefaultSessionInit("immersive-vr")), await MeA(), i = await wa.handoff()), i)
52797
- Se.setSession(i.mode, i.session, i.init, Le.Current);
52797
+ Se.setSession(i.mode, i.session, i.init, xe.Current);
52798
52798
  else if (A && e) {
52799
52799
  console.log("Session Granted: Restore last session");
52800
52800
  const I = JSON.parse(e);
@@ -53022,7 +53022,7 @@ const tC = class {
53022
53022
  GeA(A, i.init), this.session = e, this.mode = A, this.context = t, (Bg || IA("console")) && Oh(!0), this._xr_scripts = [...i.scripts], this._xr_update_scripts = this._xr_scripts.filter((s) => typeof s.onUpdateXR == "function"), this._controllerAdded = i.controller_added, this._controllerRemoved = i.controller_removed, WE(this.onBefore, ni.LateUpdate), this.context.pre_render_callbacks.push(this.onBeforeRender), this.context.post_render_callbacks.push(this.onAfterRender), ((I = i.init.optionalFeatures) != null && I.includes("hit-test") || (o = i.init.requiredFeatures) != null && o.includes("hit-test")) && e.requestReferenceSpace("viewer").then((s) => {
53023
53023
  var n, C;
53024
53024
  return (C = (n = e.requestHitTestSource) == null ? void 0 : n.call(e, { space: s })) == null ? void 0 : C.then((a) => this._viewerHitTestSource = a);
53025
- }).catch((s) => console.warn(s)), this.context.mainCamera && (this._originalCameraWorldPosition = xe(this.context.mainCamera, new w()), this._originalCameraWorldRotation = bt(this.context.mainCamera, new MA()), this._originalCameraWorldScale = oi(this.context.mainCamera, new w()), this._originalCameraParent = this.context.mainCamera.parent), this._defaultRig = new MAA(), this.context.scene.add(this._defaultRig.gameObject), this.addRig(this._defaultRig);
53025
+ }).catch((s) => console.warn(s)), this.context.mainCamera && (this._originalCameraWorldPosition = _e(this.context.mainCamera, new w()), this._originalCameraWorldRotation = bt(this.context.mainCamera, new MA()), this._originalCameraWorldScale = oi(this.context.mainCamera, new w()), this._originalCameraParent = this.context.mainCamera.parent), this._defaultRig = new MAA(), this.context.scene.add(this._defaultRig.gameObject), this.addRig(this._defaultRig);
53026
53026
  for (let s = 0; s < e.inputSources.length; s++) {
53027
53027
  const n = e.inputSources[s];
53028
53028
  if (!n.handedness) {
@@ -53163,7 +53163,7 @@ const tC = class {
53163
53163
  return console.warn("A XRSession is already being requested"), (Bg || de()) && Ni("A XRSession is already being requested"), this._currentSessionRequest.then(() => this._activeSession);
53164
53164
  if (this._activeSession)
53165
53165
  return console.error("A XRSession is already running"), this._activeSession;
53166
- if (t || (t = Le.Current), t || (t = rt.All[0]), !t)
53166
+ if (t || (t = xe.Current), t || (t = rt.All[0]), !t)
53167
53167
  throw new Error("No Needle Engine Context found");
53168
53168
  switch (e || (e = {}), A) {
53169
53169
  case "immersive-ar":
@@ -53673,7 +53673,7 @@ let eB = uF;
53673
53673
  /** @deprecated use Application.registerWaitForInteraction instead */
53674
53674
  r(eB, "registerWaitForAllowAudio", uF.registerWaitForInteraction);
53675
53675
  function* ReA(g, A = null) {
53676
- const e = A ? A.time : Le.Current.time, t = e.time;
53676
+ const e = A ? A.time : xe.Current.time, t = e.time;
53677
53677
  for (; e.time - t < g; )
53678
53678
  yield;
53679
53679
  }
@@ -54849,7 +54849,7 @@ class beA {
54849
54849
  o.matrixWorldNeedsUpdate && o.updateMatrixWorld();
54850
54850
  const n = this.tempBoundingBox.copy(s.boundingBox).applyMatrix4(o.matrixWorld);
54851
54851
  if (e.intersectsBox(n)) {
54852
- const C = xe(A), a = C.distanceTo(e.center), B = new JeA(A, a, C);
54852
+ const C = _e(A), a = C.distanceTo(e.center), B = new JeA(A, a, C);
54853
54853
  if (i.push(B), !I)
54854
54854
  return;
54855
54855
  }
@@ -56347,7 +56347,7 @@ The script will be ignored. Please make sure your component extends "Behaviour"
56347
56347
  `, g);
56348
56348
  return;
56349
56349
  }
56350
- const e = (A == null ? void 0 : A.new_scripts) ?? Le.Current.new_scripts;
56350
+ const e = (A == null ? void 0 : A.new_scripts) ?? xe.Current.new_scripts;
56351
56351
  e.includes(g) || e.push(g);
56352
56352
  }
56353
56353
  const Pt = class {
@@ -57119,8 +57119,8 @@ Memory:`, { ...this.renderer.info.memory })), this._dispatchReadyAfterFrame && (
57119
57119
  }
57120
57120
  }
57121
57121
  };
57122
- let Le = Pt;
57123
- r(Le, "_defaultTargetFramerate", { value: 60 }), r(Le, "_defaultWebglRendererParameters", {
57122
+ let xe = Pt;
57123
+ r(xe, "_defaultTargetFramerate", { value: 60 }), r(xe, "_defaultWebglRendererParameters", {
57124
57124
  antialias: !0,
57125
57125
  alpha: !1,
57126
57126
  powerPreference: "high-performance"
@@ -57232,7 +57232,7 @@ function bY(g, A, e, t) {
57232
57232
  const i = g;
57233
57233
  if (!i.guid)
57234
57234
  return console.warn("Can not instantiate: No guid", i), null;
57235
- if (A.context || (A.context = Le.Current), !A.context)
57235
+ if (A.context || (A.context = xe.Current), !A.context)
57236
57236
  return console.error("Missing network instantiate options / reference to network connection in sync instantiate"), null;
57237
57237
  const I = A ? { ...A } : null, { instance: o, seed: s } = ntA(i, A);
57238
57238
  if (o) {
@@ -57432,7 +57432,7 @@ function _Y(g, A, e, t = 0) {
57432
57432
  function Kd(g, A = null) {
57433
57433
  let e = null;
57434
57434
  A !== null && (A.x !== void 0 ? (e = new kn(), e.position = A) : e = A);
57435
- let t = Le.Current;
57435
+ let t = xe.Current;
57436
57436
  e != null && e.context && (t = e.context), Mf && t.alias && console.log("context", t.alias), e && !e.idProvider && (e.idProvider = new Hg(Date.now()));
57437
57437
  const i = [], I = {}, o = {}, s = TY(t, g, e, i, I, o);
57438
57438
  s && (ltA(I), ctA(o, I)), Mf && (Ik(g, !0), Ik(s, !0));
@@ -57666,7 +57666,7 @@ Object.getOwnPropertyDescriptor(uA.prototype, "transform") || Object.definePrope
57666
57666
  });
57667
57667
  Object.getOwnPropertyDescriptor(uA.prototype, "worldPosition") || Object.defineProperty(uA.prototype, "worldPosition", {
57668
57668
  get: function() {
57669
- return this instanceof eR ? xe(this.object) : xe(this);
57669
+ return this instanceof eR ? _e(this.object) : _e(this);
57670
57670
  },
57671
57671
  set: function(g) {
57672
57672
  vI(this, g);
@@ -57762,7 +57762,7 @@ function wtA(g) {
57762
57762
  const A = g.gameObject.userData.components.indexOf(g);
57763
57763
  g.gameObject.userData.components.splice(A, 1);
57764
57764
  }
57765
- g.__internalDisable && g.__internalDisable(), nC(g, g.context ?? Le.Current), g.destroy(), g.gameObject = null;
57765
+ g.__internalDisable && g.__internalDisable(), nC(g, g.context ?? xe.Current), g.destroy(), g.gameObject = null;
57766
57766
  }
57767
57767
  let fv = !1;
57768
57768
  function PY(g, A, e) {
@@ -57840,7 +57840,7 @@ function GR(g, A, e, t = !0) {
57840
57840
  function ytA(g, A = void 0, e = !0) {
57841
57841
  if (!g)
57842
57842
  return null;
57843
- if (!A && (A = Le.Current, !A))
57843
+ if (!A && (A = xe.Current, !A))
57844
57844
  return console.error("Can not search object without any needle context or scene!!!"), null;
57845
57845
  let t = A;
57846
57846
  if (t.isScene || (t = A == null ? void 0 : A.scene), !t)
@@ -57858,7 +57858,7 @@ function ytA(g, A = void 0, e = !0) {
57858
57858
  function StA(g, A, e = void 0) {
57859
57859
  if (!g)
57860
57860
  return A;
57861
- if (A || (A = []), A.length = 0, !e && (e = Le.Current, !e))
57861
+ if (A || (A = []), A.length = 0, !e && (e = xe.Current, !e))
57862
57862
  return console.error("Can not search object without any needle context or scene!!!"), A;
57863
57863
  "scene" in e && (e = e.scene);
57864
57864
  const t = e;
@@ -57879,7 +57879,7 @@ class aA extends uA {
57879
57879
  return GE(e);
57880
57880
  }
57881
57881
  static setActive(e, t, i = !0) {
57882
- e && (Rf(e, t), Df(e), t && i && nH(Le.Current, e));
57882
+ e && (Rf(e, t), Df(e), t && i && nH(xe.Current, e));
57883
57883
  }
57884
57884
  /** If the object is active (same as go.visible) */
57885
57885
  static isActiveSelf(e) {
@@ -57927,7 +57927,7 @@ class aA extends uA {
57927
57927
  if (!e)
57928
57928
  return;
57929
57929
  const I = e;
57930
- t = t ?? Le.Current, wR(I, t.connection, i);
57930
+ t = t ?? xe.Current, wR(I, t.connection, i);
57931
57931
  }
57932
57932
  /** Destroys a object
57933
57933
  * @param instance object to destroy
@@ -57945,7 +57945,7 @@ class aA extends uA {
57945
57945
  console.warn("Can not add object to self", e);
57946
57946
  return;
57947
57947
  }
57948
- i || (i = Le.Current), t.add(e), Rf(e, !0), Df(e), i ? aA.foreachComponent(e, (I) => {
57948
+ i || (i = xe.Current), t.add(e), Rf(e, !0), Df(e), i ? aA.foreachComponent(e, (I) => {
57949
57949
  IR(I, i), !I.__internalDidAwakeAndStart && i.new_script_start.includes(I) === !1 && i.new_script_start.push(I);
57950
57950
  }, !0) : console.warn("Missing context");
57951
57951
  }
@@ -58015,7 +58015,7 @@ class aA extends uA {
58015
58015
  return Qy(e, t);
58016
58016
  }
58017
58017
  static findObjectOfType(e, t, i = !0) {
58018
- return ytA(e, t ?? Le.Current, i);
58018
+ return ytA(e, t ?? xe.Current, i);
58019
58019
  }
58020
58020
  static findObjectsOfType(e, t) {
58021
58021
  const i = [];
@@ -58077,7 +58077,7 @@ let RA = (nn = class {
58077
58077
  }
58078
58078
  /** Use the context to get access to many Needle Engine features and use physics, timing, access the camera or scene */
58079
58079
  get context() {
58080
- return this.__context ?? Le.Current;
58080
+ return this.__context ?? xe.Current;
58081
58081
  }
58082
58082
  set context(A) {
58083
58083
  this.__context = A;
@@ -58247,7 +58247,7 @@ let RA = (nn = class {
58247
58247
  A ? this.__internalEnable() : this.__internalDisable();
58248
58248
  }
58249
58249
  get worldPosition() {
58250
- return xe(this.gameObject);
58250
+ return _e(this.gameObject);
58251
58251
  }
58252
58252
  set worldPosition(A) {
58253
58253
  vI(this.gameObject, A);
@@ -58338,8 +58338,8 @@ class dy extends RA {
58338
58338
  update() {
58339
58339
  if (!this.from || !this.to)
58340
58340
  return;
58341
- const e = xe(this.from).clone(), t = xe(this.to).clone(), i = e.distanceTo(t);
58342
- this._centerPos.copy(e), this._centerPos.add(t), this._centerPos.multiplyScalar(0.5), vI(this.gameObject, this.centered ? this._centerPos : e), this.gameObject.lookAt(xe(this.to).clone()), this.gameObject.scale.set(this.width, this.width, i);
58341
+ const e = _e(this.from).clone(), t = _e(this.to).clone(), i = e.distanceTo(t);
58342
+ this._centerPos.copy(e), this._centerPos.add(t), this._centerPos.multiplyScalar(0.5), vI(this.gameObject, this.centered ? this._centerPos : e), this.gameObject.lookAt(_e(this.to).clone()), this.gameObject.scale.set(this.width, this.width, i);
58343
58343
  }
58344
58344
  }
58345
58345
  WY([
@@ -59976,7 +59976,7 @@ const zk = (iG = class extends RA {
59976
59976
  setBodyFromGameObject(A = null) {
59977
59977
  }
59978
59978
  captureVelocity() {
59979
- const A = xe(this.gameObject);
59979
+ const A = _e(this.gameObject);
59980
59980
  zk.tempPosition.copy(A);
59981
59981
  const e = A.sub(this._lastPosition);
59982
59982
  this._lastPosition.copy(zk.tempPosition), this._smoothedVelocity.lerp(e, this.context.time.deltaTime / 0.1);
@@ -60923,7 +60923,7 @@ const An = class extends RA {
60923
60923
  aA.addNewComponent(t, An), e.scene.add(t);
60924
60924
  }
60925
60925
  static get systems() {
60926
- const e = Le.Current;
60926
+ const e = xe.Current;
60927
60927
  return this._eventSystemMap.has(e) || this._eventSystemMap.set(e, []), this._eventSystemMap.get(e);
60928
60928
  }
60929
60929
  static get(e) {
@@ -61364,16 +61364,20 @@ class Nt extends RA {
61364
61364
  set targetLerpSpeed(e) {
61365
61365
  this.targetLerpDuration = 1 / e;
61366
61366
  }
61367
+ /** @internal */
61367
61368
  awake() {
61368
61369
  this._didStart = !1, this._didSetTarget = !1, this._startedListeningToKeyEvents = !1;
61369
61370
  }
61371
+ /** @internal */
61370
61372
  start() {
61371
61373
  this._didStart = !0, this._eventSystem = ho.get(this.context) ?? void 0, this._eventSystem && (this._afterHandleInputFn = this.afterHandleInput.bind(this), this._eventSystem.addEventListener($k.AfterHandleInput, this._afterHandleInputFn));
61372
61374
  }
61375
+ /** @internal */
61373
61376
  onDestroy() {
61374
61377
  var e, t;
61375
61378
  (e = this._controls) == null || e.dispose(), (t = this._eventSystem) == null || t.removeEventListener($k.AfterHandleInput, this._afterHandleInputFn);
61376
61379
  }
61380
+ /** @internal */
61377
61381
  onEnable() {
61378
61382
  this._enableTime = this.context.time.time;
61379
61383
  const e = aA.getComponent(this.gameObject, Xt);
@@ -61386,6 +61390,7 @@ class Nt extends RA {
61386
61390
  }
61387
61391
  this._controls && (Up && (this.enablePan = !0, this.enableZoom = !0, this.middleClickToFocus = !0, Is() && (this.doubleClickToFocus = !0)), this._controls.addEventListener("start", this.onControlsChangeStarted), (t == null ? void 0 : t.type) === "PerspectiveCamera" ? Up || (this._controls.minDistance = this.minZoom, this._controls.maxDistance = this.maxZoom) : Up || (this._controls.minZoom = this.minZoom, this._controls.maxZoom = this.maxZoom), this._startedListeningToKeyEvents || (this._startedListeningToKeyEvents = !0, this._controls.listenToKeyEvents(window.document.body))), this._syncedTransform = aA.getComponent(this.gameObject, hB) ?? void 0;
61388
61392
  }
61393
+ /** @internal */
61389
61394
  onDisable() {
61390
61395
  var e;
61391
61396
  (e = this._camera) != null && e.cam && mv(this._camera.cam, this, !1), this._controls && (this._controls.enabled = !1, this._controls.autoRotate = !1, this._controls.removeEventListener("start", this.onControlsChangeStarted));
@@ -61393,11 +61398,16 @@ class Nt extends RA {
61393
61398
  afterHandleInput(e) {
61394
61399
  e.detail.args.pointerId === 0 && (e.detail.args.isDown ? this._controls && this._eventSystem && (this._shouldDisable = this._eventSystem.hasActiveUI) : (!e.detail.args.isPressed || e.detail.args.isUp) && (this._shouldDisable = !1));
61395
61400
  }
61401
+ /** @internal */
61396
61402
  onBeforeRender() {
61397
61403
  var t, i;
61398
- if (!this._controls || this._cameraObject !== this.context.mainCamera)
61404
+ if (!this._controls)
61405
+ return;
61406
+ if (this._cameraObject !== this.context.mainCamera) {
61407
+ this._controls.enabled = !1;
61399
61408
  return;
61400
- this.__handleSetTargetWhenBecomingActiveTheFirstTime(), (this.context.input.getPointerDown(1) || this.context.input.getPointerDown(2) || this.context.input.mouseWheelChanged || this.context.input.getPointerPressed(0) && ((t = this.context.input.getPointerPositionDelta(0)) != null && t.length()) || 0 > 0.1) && (this._inputs += 1), this._inputs > 0 && this.allowInterrupt && (this.enableRotate && (this.autoRotate = !1), this._cameraLerpActive = !1, this._lookTargetLerpActive = !1), this._inputs = 0;
61409
+ }
61410
+ this._controls.enabled = !0, this.__handleSetTargetWhenBecomingActiveTheFirstTime(), (this.context.input.getPointerDown(1) || this.context.input.getPointerDown(2) || this.context.input.mouseWheelChanged || this.context.input.getPointerPressed(0) && ((t = this.context.input.getPointerPositionDelta(0)) != null && t.length()) || 0 > 0.1) && (this._inputs += 1), this._inputs > 0 && this.allowInterrupt && (this.enableRotate && (this.autoRotate = !1), this._cameraLerpActive = !1, this._lookTargetLerpActive = !1), this._inputs = 0;
61401
61411
  let e = this.middleClickToFocus && this.context.input.getPointerClicked(1);
61402
61412
  if (e || (e = this.doubleClickToFocus && this.context.input.getPointerDoubleClicked(0) && this.context.time.time - this._enableTime > 0.3), e && this.setTargetFromRaycast(), this._lookTargetLerpActive || this._cameraLerpActive) {
61403
61413
  if (this._cameraLerpActive && this._cameraObject)
@@ -61429,7 +61439,7 @@ class Nt extends RA {
61429
61439
  const e = aA.getComponent(this.gameObject, Xt);
61430
61440
  if (e && !this.setLookTargetFromConstraint()) {
61431
61441
  this.debugLog && console.log("NO TARGET");
61432
- const i = xe(e.cam).length(), I = new w(0, 0, -i).applyMatrix4(e.cam.matrixWorld);
61442
+ const i = _e(e.cam).length(), I = new w(0, 0, -i).applyMatrix4(e.cam.matrixWorld);
61433
61443
  this.setLookTargetPosition(I, !0);
61434
61444
  }
61435
61445
  if (!this.autoFit && !this.setLookTargetFromConstraint()) {
@@ -61447,15 +61457,16 @@ class Nt extends RA {
61447
61457
  setCameraAndLookTarget(e) {
61448
61458
  if (!e || !(e instanceof uA))
61449
61459
  return;
61450
- const t = xe(e), i = aT(e);
61460
+ const t = _e(e), i = aT(e);
61451
61461
  this.setTargetFromRaycast(new $I(t, i)), this.setCameraTargetPosition(t);
61452
61462
  }
61453
61463
  /** Moves the camera to position smoothly.
61454
61464
  * @param position The position in local space of the controllerObject to move the camera to. If null the camera will stop lerping to the target.
61465
+ * @param immediateOrDuration If true the camera will move immediately to the new position, otherwise it will lerp. If a number is passed in it will be used as the duration of the lerp.
61455
61466
  */
61456
61467
  setCameraTargetPosition(e, t = !1) {
61457
61468
  var i, I;
61458
- e && (e instanceof uA && (e = xe(e)), this._cameraEndPosition || (this._cameraEndPosition = new w()), this._cameraEndPosition.copy(e), t === !0 ? (this._cameraLerpActive = !1, (i = this.controllerObject) == null || i.position.copy(this._cameraEndPosition)) : this._cameraObject && (this._cameraLerpActive = !0, this._cameraLerp01 = 0, this._cameraStartPosition.copy((I = this._cameraObject) == null ? void 0 : I.position), typeof t == "number" ? this._cameraLerpDuration = t : this._cameraLerpDuration = this.targetLerpDuration));
61469
+ e && (e instanceof uA && (e = _e(e)), this._cameraEndPosition || (this._cameraEndPosition = new w()), this._cameraEndPosition.copy(e), t === !0 ? (this._cameraLerpActive = !1, (i = this.controllerObject) == null || i.position.copy(this._cameraEndPosition)) : this._cameraObject && (this._cameraLerpActive = !0, this._cameraLerp01 = 0, this._cameraStartPosition.copy((I = this._cameraObject) == null ? void 0 : I.position), typeof t == "number" ? this._cameraLerpDuration = t : this._cameraLerpDuration = this.targetLerpDuration));
61459
61470
  }
61460
61471
  /** True while the camera position is being lerped */
61461
61472
  get cameraLerpActive() {
@@ -61465,9 +61476,12 @@ class Nt extends RA {
61465
61476
  stopCameraLerp() {
61466
61477
  this._cameraLerpActive = !1;
61467
61478
  }
61468
- /** Moves the camera look-at target to a position smoothly. */
61479
+ /** Moves the camera look-at target to a position smoothly.
61480
+ * @param position The position in world space to move the camera target to. If null the camera will stop lerping to the target.
61481
+ * @param immediateOrDuration If true the camera target will move immediately to the new position, otherwise it will lerp. If a number is passed in it will be used as the duration of the lerp.
61482
+ */
61469
61483
  setLookTargetPosition(e = null, t = !1) {
61470
- this._controls && e && (e instanceof uA && (e = xe(e)), this._lookTargetEndPosition.copy(e), t === !0 ? this._controls.target.copy(this._lookTargetEndPosition) : (this._lookTargetLerpActive = !0, this._lookTargetLerp01 = 0, this._lookTargetStartPosition.copy(this._controls.target), typeof t == "number" ? this._lookTargetLerpDuration = t : this._lookTargetLerpDuration = this.targetLerpDuration));
61484
+ this._controls && e && (e instanceof uA && (e = _e(e)), this._lookTargetEndPosition.copy(e), t === !0 ? this._controls.target.copy(this._lookTargetEndPosition) : (this._lookTargetLerpActive = !0, this._lookTargetLerp01 = 0, this._lookTargetStartPosition.copy(this._controls.target), typeof t == "number" ? this._lookTargetLerpDuration = t : this._lookTargetLerpDuration = this.targetLerpDuration));
61471
61485
  }
61472
61486
  /** True while the camera look target is being lerped */
61473
61487
  get lookTargetLerpActive() {
@@ -61477,7 +61491,10 @@ class Nt extends RA {
61477
61491
  stopLookTargetLerp() {
61478
61492
  this._lookTargetLerpActive = !1;
61479
61493
  }
61480
- /** Sets the look at target from an assigned lookAtConstraint source by index */
61494
+ /** Sets the look at target from an assigned lookAtConstraint source by index
61495
+ * @param index The index of the source to use
61496
+ * @param t The interpolation factor between the current look at target and the new target
61497
+ */
61481
61498
  setLookTargetFromConstraint(e = 0, t = 1) {
61482
61499
  var I;
61483
61500
  if (!this._controls)
@@ -61498,22 +61515,18 @@ class Nt extends RA {
61498
61515
  this._controls && (t >= 1 ? this._controls.target.copy(e) : this._controls.target.lerp(e, t));
61499
61516
  }
61500
61517
  setTargetFromRaycast(e) {
61501
- var i, I;
61502
61518
  if (!this.controls)
61503
61519
  return;
61504
61520
  const t = e ? this.context.physics.raycastFromRay(e) : this.context.physics.raycast();
61505
- for (const o of t)
61506
- if (o.distance > 0 && aA.isActiveInHierarchy(o.object)) {
61507
- const s = FR(o.object);
61508
- if (s) {
61509
- const n = s.canvas;
61510
- if (n != null && n.screenspace)
61521
+ for (const i of t)
61522
+ if (i.distance > 0 && aA.isActiveInHierarchy(i.object)) {
61523
+ const I = FR(i.object);
61524
+ if (I) {
61525
+ const o = I.canvas;
61526
+ if (o != null && o.screenspace)
61511
61527
  break;
61512
61528
  }
61513
- if (this.setLookTargetPosition(o.point), this.context.mainCamera) {
61514
- const C = xe(this.context.mainCamera).clone().sub(this.controls.target).add(this._lookTargetEndPosition);
61515
- (I = (i = this._cameraObject) == null ? void 0 : i.parent) == null || I.worldToLocal(C), this.setCameraTargetPosition(C);
61516
- }
61529
+ this.setLookTargetPosition(i.point);
61517
61530
  break;
61518
61531
  }
61519
61532
  }
@@ -61577,7 +61590,7 @@ class Nt extends RA {
61577
61590
  il && console.log("Fit camera to objects", d, l, "distance", h), o.maxDistance = h * 10, o.minDistance = h * 0.01;
61578
61591
  const p = 0.05, u = n.clone();
61579
61592
  u.y -= s.y * p, this.setLookTargetPosition(u, i), this.autoTarget = !1, I.near = h / 1e3, I.far = h * 100, I.updateMatrixWorld(), I.updateProjectionMatrix();
61580
- const f = xe(I), k = n.clone();
61593
+ const f = _e(I), k = n.clone();
61581
61594
  if (k.sub(f), k.y = 0, k.normalize(), k.multiplyScalar(h), k.y += -p * 4 * s.y, I.parent) {
61582
61595
  const G = I.parent.worldToLocal(n.clone().sub(k));
61583
61596
  this.setCameraTargetPosition(G, i);
@@ -61793,7 +61806,7 @@ const Rl = (gf = class extends RA {
61793
61806
  screenPointToRay(A, e, t) {
61794
61807
  const i = this.cam, I = Rl._origin;
61795
61808
  I.set(A, e, -1), this.context.input.convertScreenspaceToRaycastSpace(I), Mv && console.log("screenPointToRay", A.toFixed(2), e.toFixed(2), "now:", I.x.toFixed(2), I.y.toFixed(2), "isInXR:" + this.context.isInXR), I.z = -1, I.unproject(i);
61796
- const o = Rl._direction.set(I.x, I.y, I.z), s = xe(i);
61809
+ const o = Rl._direction.set(I.x, I.y, I.z), s = _e(i);
61797
61810
  return o.sub(s), o.normalize(), t ? (t.set(s, o), t) : new $I(s.clone(), o.clone());
61798
61811
  }
61799
61812
  getFrustum() {
@@ -63046,7 +63059,7 @@ class RQA {
63046
63059
  r(this, "_context");
63047
63060
  }
63048
63061
  get context() {
63049
- return this._context ?? Le.Current;
63062
+ return this._context ?? xe.Current;
63050
63063
  }
63051
63064
  get isStateMachineBehaviour() {
63052
63065
  return !0;
@@ -64290,7 +64303,7 @@ var RiA = Object.defineProperty, NiA = Object.getOwnPropertyDescriptor, A2 = (g,
64290
64303
  return t && i && RiA(A, e, i), i;
64291
64304
  };
64292
64305
  const Nv = IA("debugpost");
64293
- class _e {
64306
+ class Le {
64294
64307
  constructor(A) {
64295
64308
  r(this, "_active", !0);
64296
64309
  r(this, "_value");
@@ -64345,10 +64358,10 @@ class _e {
64345
64358
  }
64346
64359
  A2([
64347
64360
  D()
64348
- ], _e.prototype, "overrideState", 1);
64361
+ ], Le.prototype, "overrideState", 1);
64349
64362
  A2([
64350
64363
  D()
64351
- ], _e.prototype, "value", 1);
64364
+ ], Le.prototype, "value", 1);
64352
64365
  var FiA = Object.defineProperty, KiA = Object.getOwnPropertyDescriptor, JiA = (g, A, e, t) => {
64353
64366
  for (var i = t > 1 ? void 0 : t ? KiA(A, e) : A, I = g.length - 1, o; I >= 0; I--)
64354
64367
  (o = g[I]) && (i = (t ? o(A, e, i) : o(i)) || i);
@@ -64366,7 +64379,7 @@ class xI extends RA {
64366
64379
  this.ensureVolumeParameters();
64367
64380
  for (const t of Object.keys(e)) {
64368
64381
  const i = e[t], I = this[t];
64369
- I instanceof _e && (I.value = i);
64382
+ I instanceof Le && (I.value = i);
64370
64383
  }
64371
64384
  }
64372
64385
  }
@@ -64394,7 +64407,7 @@ class xI extends RA {
64394
64407
  const e = Object.keys(this);
64395
64408
  for (const t of e) {
64396
64409
  const i = this[t];
64397
- i instanceof _e && i.__init();
64410
+ i instanceof Le && i.__init();
64398
64411
  }
64399
64412
  }
64400
64413
  onAfterDeserialize(e, t) {
@@ -64402,7 +64415,7 @@ class xI extends RA {
64402
64415
  const i = this.$serializedTypes;
64403
64416
  if (i) {
64404
64417
  for (const I of Object.keys(i))
64405
- if (i[I] === _e) {
64418
+ if (i[I] === Le) {
64406
64419
  const s = e[I];
64407
64420
  if (s !== void 0) {
64408
64421
  const n = this[I];
@@ -64416,7 +64429,7 @@ class xI extends RA {
64416
64429
  // since these handle that already.
64417
64430
  onEditorModification(e) {
64418
64431
  const t = e.propertyName;
64419
- if (this[t] instanceof _e) {
64432
+ if (this[t] instanceof Le) {
64420
64433
  const i = e.value;
64421
64434
  return this[t].value = i, !0;
64422
64435
  }
@@ -64429,7 +64442,7 @@ class xI extends RA {
64429
64442
  const e = this.$serializedTypes;
64430
64443
  if (e)
64431
64444
  for (const t of Object.keys(e))
64432
- e[t] === _e && (this[t] || (this[t] = new _e()));
64445
+ e[t] === Le && (this[t] || (this[t] = new Le()));
64433
64446
  }
64434
64447
  }
64435
64448
  JiA([
@@ -64484,7 +64497,7 @@ class my extends xI {
64484
64497
  }
64485
64498
  }
64486
64499
  YiA([
64487
- D(_e)
64500
+ D(Le)
64488
64501
  ], my.prototype, "preset", 2);
64489
64502
  Ls("Antialiasing", my);
64490
64503
  const OiA = IA("debugusdz");
@@ -65108,7 +65121,7 @@ class fC {
65108
65121
  if (e) {
65109
65122
  for (const i of this.Pois)
65110
65123
  if (i.obj === e) {
65111
- this.Pois.splice(this.Pois.indexOf(i), 1), this.LastChangeTime = (A == null ? void 0 : A.time.time) ?? ((t = Le.Current) == null ? void 0 : t.time.time);
65124
+ this.Pois.splice(this.Pois.indexOf(i), 1), this.LastChangeTime = (A == null ? void 0 : A.time.time) ?? ((t = xe.Current) == null ? void 0 : t.time.time);
65112
65125
  return;
65113
65126
  }
65114
65127
  }
@@ -65155,7 +65168,7 @@ class JD extends RA {
65155
65168
  update() {
65156
65169
  var t;
65157
65170
  if ((!this.context.connection.isConnected || (t = this._model) != null && t.hasOwnership) && (fC.LastChangeTime !== this._lastPoiChangedTime && (this._lastPoiChangedTime = fC.LastChangeTime, this._lookDuration = 0), this.selectTarget(), this._currentTargetObject && this.context.time.frameCount % 10 === 0 && this.target)) {
65158
- const i = xe(this._currentTargetObject);
65171
+ const i = _e(this._currentTargetObject);
65159
65172
  vI(this.target, i), this.context.connection.isConnected && this.avatar && (this.context.connection.send("avatar-look-target-changed", this._targetModel), this._targetModel.guid = this.avatar.guid, this._targetModel.position.copy(i));
65160
65173
  }
65161
65174
  }
@@ -65735,9 +65748,9 @@ const o2 = (IG = class extends RA {
65735
65748
  if (A && this.head) {
65736
65749
  const e = this.eyes;
65737
65750
  if (e) {
65738
- const t = xe(A);
65751
+ const t = _e(A);
65739
65752
  this.currentTargetPoint.lerp(t, this.context.time.deltaTime / 0.1);
65740
- const i = xe(this.head), I = this.vec.copy(this.currentTargetPoint).sub(i).normalize();
65753
+ const i = _e(this.head), I = this.vec.copy(this.currentTargetPoint).sub(i).normalize();
65741
65754
  if (I.length() < 0.1)
65742
65755
  return;
65743
65756
  const o = o2.forward;
@@ -65914,11 +65927,11 @@ class n2 extends RA {
65914
65927
  update() {
65915
65928
  if (!this.from || !this.to || !this.hint)
65916
65929
  return;
65917
- const e = xe(this.to).clone(), t = xe(this.from).clone(), i = e.distanceTo(t), I = e.clone();
65930
+ const e = _e(this.to).clone(), t = _e(this.from).clone(), i = e.distanceTo(t), I = e.clone();
65918
65931
  I.sub(t);
65919
65932
  const o = t.clone();
65920
65933
  o.add(e), o.multiplyScalar(0.5);
65921
- const s = xe(this.hint).clone();
65934
+ const s = _e(this.hint).clone();
65922
65935
  s.sub(o);
65923
65936
  const n = new w();
65924
65937
  n.crossVectors(s, I), n.crossVectors(I, n), n.normalize();
@@ -66056,13 +66069,13 @@ const C2 = (oG = class extends xI {
66056
66069
  r(oG, "useSelectiveBloom", !1), oG);
66057
66070
  let ic = C2;
66058
66071
  HR([
66059
- D(_e)
66072
+ D(Le)
66060
66073
  ], ic.prototype, "threshold", 2);
66061
66074
  HR([
66062
- D(_e)
66075
+ D(Le)
66063
66076
  ], ic.prototype, "intensity", 2);
66064
66077
  HR([
66065
- D(_e)
66078
+ D(Le)
66066
66079
  ], ic.prototype, "scatter", 2);
66067
66080
  Ls("Bloom", ic);
66068
66081
  const ol = "NEEDLE_progressive", eI = IA("debugprogressive"), pm = Symbol("needle-progressive-texture"), IE = /* @__PURE__ */ new Map();
@@ -66290,7 +66303,7 @@ const PI = class {
66290
66303
  const Q = Array.isArray(n.lods) ? n.lods[i].path : n.lods;
66291
66304
  if (!Q)
66292
66305
  return eI && !n["missing:uri"] && (n["missing:uri"] = !0, console.warn("Missing uri for progressive asset for LOD " + i, n)), null;
66293
- const E = Wa(e, Q);
66306
+ let E = Wa(e, Q);
66294
66307
  if (E.endsWith(".glb") || E.endsWith(".gltf")) {
66295
66308
  if (!n.guid)
66296
66309
  return console.warn("missing pointer for glb/gltf texture", n), null;
@@ -66304,7 +66317,11 @@ const PI = class {
66304
66317
  }
66305
66318
  const l = n, h = new Promise(async (u, f) => {
66306
66319
  const k = new PE();
66307
- Gd(k, A), eI && (await wn(Math.random() * 1e3), I && console.warn("Start loading (delayed) " + E, l.guid));
66320
+ if (Gd(k, A), n && Array.isArray(n.lods)) {
66321
+ const N = n.lods[i];
66322
+ N.hash && (E += "?v=" + N.hash);
66323
+ }
66324
+ eI && (await wn(Math.random() * 1e3), I && console.warn("Start loading (delayed) " + E, l.guid));
66308
66325
  const G = await k.loadAsync(E).catch((N) => (console.error(`Error loading LOD ${i} from ${E}
66309
66326
  `, N), null));
66310
66327
  if (!G)
@@ -66705,7 +66722,7 @@ const KgA = IA("gizmos"), JgA = IA("debugboxhelper"), xo = class extends RA {
66705
66722
  for (let o = 0; o < e.children.length; o++)
66706
66723
  e.children[o].type === "Mesh" && xo.testBox.expandByObject(e);
66707
66724
  } else {
66708
- const o = xe(e, xo._position), s = oi(e, xo._size);
66725
+ const o = _e(e, xo._position), s = oi(e, xo._size);
66709
66726
  t !== void 0 && s.multiplyScalar(t), xo.testBox.setFromCenterAndSize(o, s);
66710
66727
  }
66711
66728
  this.updateBox();
@@ -66719,7 +66736,7 @@ const KgA = IA("gizmos"), JgA = IA("debugboxhelper"), xo = class extends RA {
66719
66736
  if (this.box || (this.box = new wt()), e || this.context.time.frameCount != this._lastMatrixUpdateFrame) {
66720
66737
  const t = this._lastMatrixUpdateFrame < 0;
66721
66738
  this._lastMatrixUpdateFrame = this.context.time.frameCount;
66722
- const i = t, I = xe(this.gameObject, xo._position, i), o = oi(this.gameObject, xo._size);
66739
+ const i = t, I = _e(this.gameObject, xo._position, i), o = oi(this.gameObject, xo._size);
66723
66740
  this.box.setFromCenterAndSize(I, o);
66724
66741
  }
66725
66742
  return this.box;
@@ -67945,7 +67962,7 @@ class sc extends RA {
67945
67962
  *moveToTarget() {
67946
67963
  if (!this.target || !this.object)
67947
67964
  return;
67948
- const e = xe(this.object).clone(), t = xe(this.target).clone(), i = bt(this.object).clone(), I = bt(this.target).clone(), o = oi(this.object).clone(), s = oi(this.target).clone(), n = e.distanceTo(t), C = i.angleTo(I), a = o.distanceTo(s);
67965
+ const e = _e(this.object).clone(), t = _e(this.target).clone(), i = bt(this.object).clone(), I = bt(this.target).clone(), o = oi(this.object).clone(), s = oi(this.target).clone(), n = e.distanceTo(t), C = i.angleTo(I), a = o.distanceTo(s);
67949
67966
  if (n < 0.01 && C < 0.01 && a < 0.01) {
67950
67967
  vI(this.object, t), Ns(this.object, I), QD(this.object, s), this.coroutine = null;
67951
67968
  return;
@@ -68624,7 +68641,7 @@ class Xa extends RA {
68624
68641
  if (this.controller) {
68625
68642
  const l = (E = this.controller) == null ? void 0 : E.rigidbody.getVelocity().y;
68626
68643
  if (l < -1) {
68627
- this._raycastOptions.ray || (this._raycastOptions.ray = new $I()), this._raycastOptions.ray.origin.copy(xe(this.gameObject)), this._raycastOptions.ray.direction.set(0, -1, 0);
68644
+ this._raycastOptions.ray || (this._raycastOptions.ray = new $I()), this._raycastOptions.ray.origin.copy(_e(this.gameObject)), this._raycastOptions.ray.direction.set(0, -1, 0);
68628
68645
  const h = this.layer;
68629
68646
  this.gameObject.layers.disableAll(), this.gameObject.layers.set(2);
68630
68647
  const p = this.context.physics.raycast(this._raycastOptions);
@@ -68676,7 +68693,7 @@ class Jy extends xI {
68676
68693
  }
68677
68694
  }
68678
68695
  oIA([
68679
- D(_e)
68696
+ D(Le)
68680
68697
  ], Jy.prototype, "intensity", 2);
68681
68698
  Ls("ChromaticAberration", Jy);
68682
68699
  const zd = new ue();
@@ -70201,14 +70218,14 @@ class by extends RA {
70201
70218
  vp.set(o, C);
70202
70219
  const a = Object.keys(n);
70203
70220
  for (const B of a)
70204
- n[B] instanceof _e && C.push(B);
70221
+ n[B] instanceof Le && C.push(B);
70205
70222
  }
70206
70223
  if (vp.has(o)) {
70207
70224
  const C = s.toLowerCase(), a = vp.get(o);
70208
70225
  for (const B of a)
70209
70226
  if (B.toLowerCase() === C) {
70210
70227
  const Q = n[B];
70211
- Q instanceof _e && (I.length === 4 && I[3] === "active" ? (Q.overrideState = e.value, this.scheduleRecreate()) : Q && Q.value !== void 0 && (Q.value = e.value));
70228
+ Q instanceof Le && (I.length === 4 && I[3] === "active" ? (Q.overrideState = e.value, this.scheduleRecreate()) : Q && Q.value !== void 0 && (Q.value = e.value));
70212
70229
  return;
70213
70230
  }
70214
70231
  }
@@ -70309,16 +70326,16 @@ class FB extends xI {
70309
70326
  // }
70310
70327
  }
70311
70328
  vy([
70312
- D(_e)
70329
+ D(Le)
70313
70330
  ], FB.prototype, "postExposure", 2);
70314
70331
  vy([
70315
- D(_e)
70332
+ D(Le)
70316
70333
  ], FB.prototype, "contrast", 2);
70317
70334
  vy([
70318
- D(_e)
70335
+ D(Le)
70319
70336
  ], FB.prototype, "hueShift", 2);
70320
70337
  vy([
70321
- D(_e)
70338
+ D(Le)
70322
70339
  ], FB.prototype, "saturation", 2);
70323
70340
  Ls("ColorAdjustments", FB);
70324
70341
  const dIA = (Math.sqrt(5) - 1) / 4, Gg = (5 - Math.sqrt(5)) / 20, qp = (g) => Math.floor(g) | 0, xp = /* @__PURE__ */ new Float64Array([
@@ -71095,7 +71112,7 @@ const ii = class extends Dd {
71095
71112
  r(this, "_viewProjectionName", "hlslcc_mtx4x4unity_MatrixVP");
71096
71113
  r(this, "_viewMatrixName", "hlslcc_mtx4x4unity_MatrixV");
71097
71114
  r(this, "_rendererData", new vIA());
71098
- this.identifier = e, la && console.log(this), this.type = "NEEDLE_CUSTOM_SHADER", this.uniforms[this._objToWorldName] || (this.uniforms[this._objToWorldName] = { value: [] }), this.uniforms[this._worldToObjectName] || (this.uniforms[this._worldToObjectName] = { value: [] }), this.uniforms[this._viewProjectionName] || (this.uniforms[this._viewProjectionName] = { value: [] }), this.uniforms[this._sphericalHarmonicsName], (this.depthTextureUniform || this.opaqueTextureUniform) && Le.Current.pre_render_callbacks.push(this.onBeforeRenderSceneCallback);
71115
+ this.identifier = e, la && console.log(this), this.type = "NEEDLE_CUSTOM_SHADER", this.uniforms[this._objToWorldName] || (this.uniforms[this._objToWorldName] = { value: [] }), this.uniforms[this._worldToObjectName] || (this.uniforms[this._worldToObjectName] = { value: [] }), this.uniforms[this._viewProjectionName] || (this.uniforms[this._viewProjectionName] = { value: [] }), this.uniforms[this._sphericalHarmonicsName], (this.depthTextureUniform || this.opaqueTextureUniform) && xe.Current.pre_render_callbacks.push(this.onBeforeRenderSceneCallback);
71099
71116
  }
71100
71117
  clone() {
71101
71118
  const e = super.clone();
@@ -71103,8 +71120,8 @@ const ii = class extends Dd {
71103
71120
  }
71104
71121
  dispose() {
71105
71122
  super.dispose();
71106
- const e = Le.Current.pre_render_callbacks.indexOf(this.onBeforeRenderSceneCallback);
71107
- e >= 0 && Le.Current.pre_render_callbacks.splice(e, 1);
71123
+ const e = xe.Current.pre_render_callbacks.indexOf(this.onBeforeRenderSceneCallback);
71124
+ e >= 0 && xe.Current.pre_render_callbacks.splice(e, 1);
71108
71125
  }
71109
71126
  get depthTextureUniform() {
71110
71127
  if (this.uniforms)
@@ -71115,13 +71132,13 @@ const ii = class extends Dd {
71115
71132
  return this.uniforms._CameraOpaqueTexture;
71116
71133
  }
71117
71134
  onBeforeRenderScene() {
71118
- this.opaqueTextureUniform && Le.Current.setRequireColor(!0), this.depthTextureUniform && Le.Current.setRequireDepth(!0);
71135
+ this.opaqueTextureUniform && xe.Current.setRequireColor(!0), this.depthTextureUniform && xe.Current.setRequireDepth(!0);
71119
71136
  }
71120
71137
  onBeforeRender(e, t, i, I, o, s) {
71121
71138
  I.attributes.tangent || I.computeTangents(), this.onUpdateUniforms(i, o);
71122
71139
  }
71123
71140
  onUpdateUniforms(e, t) {
71124
- const i = Le.Current;
71141
+ const i = xe.Current;
71125
71142
  if (e && (ii.viewProjection && this.uniforms[this._viewProjectionName] && (ii.viewProjection.copy(e.projectionMatrix).multiply(e.matrixWorldInverse), mD(ii.viewProjection, ii._viewProjectionValues)), ii.viewMatrix && this.uniforms[this._viewMatrixName] && (ii.viewMatrix.copy(e.matrixWorldInverse), mD(ii.viewMatrix, ii._viewMatrixValues)), this.uniforms[ii._worldSpaceCameraPosName] && ii._worldSpaceCameraPos.setFromMatrixPosition(e.matrixWorld)), this.uniforms._TimeParameters && (this.uniforms._TimeParameters.value = i.sceneLighting.timeVec4), this.uniforms._Time) {
71126
71143
  const n = this.uniforms._Time.value;
71127
71144
  n.x = i.sceneLighting.timeVec4.x / 20, n.y = i.sceneLighting.timeVec4.x, n.z = i.sceneLighting.timeVec4.x * 2, n.w = i.sceneLighting.timeVec4.x * 3;
@@ -71140,7 +71157,7 @@ const ii = class extends Dd {
71140
71157
  }
71141
71158
  const I = i.mainLight;
71142
71159
  if (I) {
71143
- const n = xe(I.gameObject, ii._mainLightPosition);
71160
+ const n = _e(I.gameObject, ii._mainLightPosition);
71144
71161
  this.uniforms._MainLightPosition = { value: n.normalize() }, ii._mainLightColor.set(I.color.r, I.color.g, I.color.b, 0), this.uniforms._MainLightColor = { value: ii._mainLightColor };
71145
71162
  const C = I.intensity;
71146
71163
  ii._lightData.z = C, this.uniforms.unity_LightData = { value: ii._lightData };
@@ -72285,7 +72302,7 @@ Texture LODs available? ${this.hasTextureLODs ? "YES" : "NO"}`);
72285
72302
  }
72286
72303
  const E = C.geometry.boundingBox;
72287
72304
  if (E && this.context.mainCamera instanceof He) {
72288
- if (C.geometry.attributes.color && C.geometry.attributes.color.count < 100 && C.geometry.boundingSphere && (this._sphere.copy(C.geometry.boundingSphere), this._sphere.applyMatrix4(C.matrixWorld), this._sphere.containsPoint(xe(this.context.mainCamera)))) {
72305
+ if (C.geometry.attributes.color && C.geometry.attributes.color.count < 100 && C.geometry.boundingSphere && (this._sphere.copy(C.geometry.boundingSphere), this._sphere.applyMatrix4(C.matrixWorld), this._sphere.containsPoint(_e(this.context.mainCamera)))) {
72289
72306
  o = 0;
72290
72307
  break;
72291
72308
  }
@@ -75544,7 +75561,7 @@ class Rn extends xI {
75544
75561
  const e = 1 / window.devicePixelRatio;
75545
75562
  if (this.resolutionScale === void 0) {
75546
75563
  let i = 1;
75547
- Is() && (i = 0.6), this.resolutionScale = new _e(i * e);
75564
+ Is() && (i = 0.6), this.resolutionScale = new Le(i * e);
75548
75565
  }
75549
75566
  const t = new fH(this.context.mainCamera, {
75550
75567
  worldFocusRange: 0.2,
@@ -75563,22 +75580,22 @@ xB([
75563
75580
  D()
75564
75581
  ], Rn.prototype, "mode", 2);
75565
75582
  xB([
75566
- D(_e)
75583
+ D(Le)
75567
75584
  ], Rn.prototype, "focusDistance", 2);
75568
75585
  xB([
75569
- D(_e)
75586
+ D(Le)
75570
75587
  ], Rn.prototype, "focalLength", 2);
75571
75588
  xB([
75572
- D(_e)
75589
+ D(Le)
75573
75590
  ], Rn.prototype, "aperture", 2);
75574
75591
  xB([
75575
- D(_e)
75592
+ D(Le)
75576
75593
  ], Rn.prototype, "gaussianMaxRadius", 2);
75577
75594
  xB([
75578
- D(_e)
75595
+ D(Le)
75579
75596
  ], Rn.prototype, "resolutionScale", 2);
75580
75597
  xB([
75581
- D(_e)
75598
+ D(Le)
75582
75599
  ], Rn.prototype, "bokehScale", 2);
75583
75600
  Ls("DepthOfField", Rn);
75584
75601
  var EoA = Object.defineProperty, coA = Object.getOwnPropertyDescriptor, loA = (g, A, e, t) => {
@@ -76095,17 +76112,17 @@ const yF = class {
76095
76112
  onUpdate(A) {
76096
76113
  if (!this._selected)
76097
76114
  return;
76098
- const e = xe(this._selected);
76115
+ const e = _e(this._selected);
76099
76116
  this.onUpdateWorldPosition(e, this._groundPlanePoint, !1), this.onUpdateGroundPlane(), this._didDragOnGroundPlaneLastFrame = !0, this._hasGroundPlane = !0;
76100
76117
  }
76101
76118
  onUpdateWorldPosition(A, e, t) {
76102
76119
  if (this._selected) {
76103
76120
  if (t) {
76104
- const i = xe(this._selected);
76121
+ const i = _e(this._selected);
76105
76122
  i.y = A.y, A = i;
76106
76123
  }
76107
76124
  if (vI(this._selected, A), vI(this._groundLine, A), this._hasGroundPlane ? this._groundLine.scale.y = this._groundDistance : this._groundLine.scale.y = 1e3, this._groundLine.visible = this.showGizmo, this._groundMarker.visible = e !== null && this.showGizmo, e) {
76108
- const i = xe(this._camera).distanceTo(e) * 0.01;
76125
+ const i = _e(this._camera).distanceTo(e) * 0.01;
76109
76126
  this._groundMarker.scale.set(i, i, i), vI(this._groundMarker, e);
76110
76127
  }
76111
76128
  }
@@ -76119,7 +76136,7 @@ const yF = class {
76119
76136
  onUpdateGroundPlane() {
76120
76137
  if (!this._selected || !this._context)
76121
76138
  return;
76122
- const A = xe(this._selected), e = new $I(new w(0, 0.1, 0).add(A), new w(0, -1, 0)), t = new Fs();
76139
+ const A = _e(this._selected), e = new $I(new w(0, 0.1, 0).add(A), new w(0, -1, 0)), t = new Fs();
76123
76140
  t.ignore = [this._selected];
76124
76141
  const i = this._context.physics.raycastFromRay(e, t);
76125
76142
  for (let I = 0; I < i.length; I++) {
@@ -78200,7 +78217,7 @@ const vQ = class extends RA {
78200
78217
  static calculateCenter(A, e) {
78201
78218
  const t = e || new w();
78202
78219
  return t.set(0, 0, 0), A.forEach((i) => {
78203
- t.add(xe(i));
78220
+ t.add(_e(i));
78204
78221
  }), console.log(t), t.divideScalar(A.length), t;
78205
78222
  }
78206
78223
  static filterTopmostParent(A) {
@@ -79045,11 +79062,11 @@ class dc extends RA {
79045
79062
  update() {
79046
79063
  if (!this.from)
79047
79064
  return;
79048
- var e = xe(this.from), t = bt(this.from);
79065
+ var e = _e(this.from), t = bt(this.from);
79049
79066
  this.offset.copy(this.positionOffset);
79050
79067
  const i = this.offset.length();
79051
79068
  if (this.referenceSpace && this.offset.transformDirection(this.referenceSpace.matrixWorld).multiplyScalar(i), e.add(this.offset), this.levelPosition && this.referenceSpace) {
79052
- const n = new kI(this.gameObject.up, 0), C = xe(this.referenceSpace);
79069
+ const n = new kI(this.gameObject.up, 0), C = _e(this.referenceSpace);
79053
79070
  n.setFromNormalAndCoplanarPoint(this.gameObject.up, C);
79054
79071
  const a = new w(0, 0, 0);
79055
79072
  n.projectPoint(e, a), e.copy(a);
@@ -83797,7 +83814,7 @@ class CCA extends hN {
83797
83814
  r(this, "_lastDistance", 0);
83798
83815
  }
83799
83816
  update() {
83800
- const e = xe(this.system.gameObject);
83817
+ const e = _e(this.system.gameObject);
83801
83818
  this._lastDistance = this._lastPosition.distanceTo(e), this._lastPosition.copy(e);
83802
83819
  }
83803
83820
  genValue() {
@@ -84243,7 +84260,7 @@ const qf = class extends RA {
84243
84260
  return this._worldScale;
84244
84261
  }
84245
84262
  get worldPos() {
84246
- return this._worldPositionFrame !== this.context.time.frame && (this._worldPositionFrame = this.context.time.frame, xe(this.gameObject, this._worldPos)), this._worldPos;
84263
+ return this._worldPositionFrame !== this.context.time.frame && (this._worldPositionFrame = this.context.time.frame, _e(this.gameObject, this._worldPos)), this._worldPos;
84247
84264
  }
84248
84265
  get matrixWorld() {
84249
84266
  return this._container.matrixWorld;
@@ -84251,12 +84268,34 @@ const qf = class extends RA {
84251
84268
  get isSubsystem() {
84252
84269
  return this._isUsedAsSubsystem;
84253
84270
  }
84254
- /** Add a custom quarks behaviour to the particle system. You can add a quarks.Behaviour type.
84255
- * @link https://github.com/Alchemist0823/three.quarks
84271
+ /** Add a custom quarks behaviour to the particle system.
84272
+ * You can add a quarks.Behaviour type or derive from {@link ParticleSystemBaseBehaviour}
84273
+ * @link https://github.com/Alchemist0823/three.quarks
84274
+ * @example
84275
+ * ```typescript
84276
+ * class MyBehaviour extends ParticleSystemBaseBehaviour {
84277
+ * initialize(particle: Particle) {
84278
+ * // initialize the particle
84279
+ * }
84280
+ * update(particle: Particle, delta: number) {
84281
+ * // do something with the particle
84282
+ * }
84283
+ * }
84284
+ *
84285
+ * const system = gameObject.getComponent(ParticleSystem);
84286
+ * system.addBehaviour(new MyBehaviour());
84287
+ * ```
84256
84288
  */
84257
84289
  addBehaviour(A) {
84258
84290
  return this._particleSystem ? (A instanceof _B && (A.system = this), de() && console.log("add behaviour", A), this._particleSystem.addBehavior(A), !0) : !1;
84259
84291
  }
84292
+ /** Remove a custom quarks behaviour from the particle system. **/
84293
+ removeBehaviour(A) {
84294
+ if (!this._particleSystem)
84295
+ return !1;
84296
+ const e = this._particleSystem.behaviors, t = e.indexOf(A);
84297
+ return t !== -1 && e.splice(t, 1), !0;
84298
+ }
84260
84299
  /** Removes all behaviours from the particle system
84261
84300
  * **Note:** this will also remove the default behaviours like SizeBehaviour, ColorBehaviour etc.
84262
84301
  */
@@ -84295,11 +84334,13 @@ const qf = class extends RA {
84295
84334
  }
84296
84335
  bl && A.length > 0 && console.log("SubEmitters: ", A, this), this._subEmitterSystems = A;
84297
84336
  }
84337
+ /** @internal */
84298
84338
  onAfterDeserialize(A) {
84299
84339
  if (this._subEmitterSystems && Array.isArray(this._subEmitterSystems))
84300
84340
  for (const e of this._subEmitterSystems)
84301
84341
  e._deserialize(this.context, this.gameObject);
84302
84342
  }
84343
+ /** @internal */
84303
84344
  awake() {
84304
84345
  if (this._worldPositionFrame = -1, this._renderer = this.gameObject.getComponent(Ts), !this.main)
84305
84346
  throw new Error("Not Supported: ParticleSystem needs a serialized MainModule. Creating new particle systems at runtime is currently not supported.");
@@ -84307,19 +84348,23 @@ const qf = class extends RA {
84307
84348
  const A = this._particleSystem.emitter;
84308
84349
  this.context.scene.add(A), this.inheritVelocity.system && this.inheritVelocity.system !== this && (this.inheritVelocity = this.inheritVelocity.clone()), this.inheritVelocity.awake(this), bl && (console.log(this), this.gameObject.add(new es(1)));
84309
84350
  }
84351
+ /** @internal */
84310
84352
  start() {
84311
84353
  this.addSubParticleSystems(), this.updateLayers();
84312
84354
  }
84355
+ /** @internal */
84313
84356
  onDestroy() {
84314
84357
  var A, e, t, i;
84315
84358
  (A = this._container) == null || A.removeFromParent(), (e = this._batchSystem) == null || e.removeFromParent(), (t = this._particleSystem) == null || t.emitter.removeFromParent(), (i = this._particleSystem) == null || i.dispose();
84316
84359
  }
84360
+ /** @internal */
84317
84361
  onEnable() {
84318
84362
  this.main && (this.inheritVelocity && (this.inheritVelocity.system = this), this._batchSystem && (this._batchSystem.visible = !0), this.playOnAwake && this.play(), this._isPlaying = this.playOnAwake);
84319
84363
  }
84320
84364
  onDisable() {
84321
84365
  this._batchSystem && (this._batchSystem.visible = !1);
84322
84366
  }
84367
+ /** @internal */
84323
84368
  onBeforeRender() {
84324
84369
  var A;
84325
84370
  this.main && (this._didPreWarm === !1 && ((A = this.main) == null ? void 0 : A.prewarm) === !0 && (this._didPreWarm = !0, this.preWarm()), this.onUpdate(), this.onSimulate(this.deltaTime));
@@ -84556,7 +84601,7 @@ class iS extends xI {
84556
84601
  }
84557
84602
  }
84558
84603
  DCA([
84559
- D(_e)
84604
+ D(Le)
84560
84605
  ], iS.prototype, "granularity", 2);
84561
84606
  Ls("PixelationEffect", iS);
84562
84607
  class Id extends RA {
@@ -85044,6 +85089,7 @@ class LI extends RA {
85044
85089
  }
85045
85090
  return e.uri === this.sourceId ? (console.warn("SceneSwitcher: can't load own scene - prevent recursive loading", this.sourceId), !1) : this.__lastSwitchScene === e && this.__lastSwitchScenePromise ? this.__lastSwitchScenePromise : (this.__lastSwitchScene = e, this.__lastSwitchScenePromise = this.__internalSwitchScene(e), await this.__lastSwitchScenePromise);
85046
85091
  }
85092
+ /** @internal */
85047
85093
  async __internalSwitchScene(e) {
85048
85094
  var i, I;
85049
85095
  if (this._currentScene) {
@@ -85136,6 +85182,13 @@ class LI extends RA {
85136
85182
  o instanceof Promise && await o;
85137
85183
  }
85138
85184
  }
85185
+ if (this._isCurrentlyLoading) {
85186
+ const i = this.tryGetSceneEventListener(this.gameObject);
85187
+ if (i && i.sceneOpened) {
85188
+ const I = i.sceneOpened(this);
85189
+ I instanceof Promise && await I;
85190
+ }
85191
+ }
85139
85192
  }
85140
85193
  async onEndLoading() {
85141
85194
  var e;
@@ -85148,6 +85201,13 @@ class LI extends RA {
85148
85201
  }
85149
85202
  aA.remove(t);
85150
85203
  }
85204
+ if (!this._isCurrentlyLoading) {
85205
+ const t = this.tryGetSceneEventListener(this.gameObject);
85206
+ if (t && t.sceneClosing) {
85207
+ const i = t.sceneClosing();
85208
+ i instanceof Promise && await i;
85209
+ }
85210
+ }
85151
85211
  }
85152
85212
  tryGetSceneEventListener(e, t = 0) {
85153
85213
  const i = aA.foreachComponent(e, (I) => I.sceneClosing ? I : void 0);
@@ -85292,7 +85352,7 @@ class yg extends RA {
85292
85352
  r(this, "aspectMode", 0);
85293
85353
  r(this, "clip", null);
85294
85354
  r(this, "source", 1);
85295
- r(this, "url", null);
85355
+ r(this, "_url", null);
85296
85356
  r(this, "renderMode");
85297
85357
  r(this, "targetMaterialProperty");
85298
85358
  r(this, "targetMaterialRenderer");
@@ -85327,7 +85387,7 @@ class yg extends RA {
85327
85387
  r(this, "_hls");
85328
85388
  r(this, "onHlsAvailable", () => {
85329
85389
  var e;
85330
- Eg && console.log("HLS: available", this.clip), !(!this.shouldUseM3U8 || !this.url) && (this._hls || (this._hls = new Hls()), this.videoElement.autoplay = !0, this._hls.loadSource(this.url), this._hls.attachMedia(this.videoElement), (e = this._videoElement) == null || e.play(), Eg && console.log("HLS: loaded", this.clip));
85390
+ Eg && console.log("HLS: available", this.clip), !(!this.shouldUseM3U || !this.url) && (this._hls || (this._hls = new Hls()), this.videoElement.autoplay = !0, this._hls.loadSource(this.url), this._hls.attachMedia(this.videoElement), (e = this._videoElement) == null || e.play(), Eg && console.log("HLS: loaded", this.clip));
85331
85391
  });
85332
85392
  NCA(() => {
85333
85393
  this._receivedInput = !0, this.updateVideoElementSettings();
@@ -85335,6 +85395,13 @@ class yg extends RA {
85335
85395
  e.key === "f" && (this.screenspace = !this.screenspace);
85336
85396
  });
85337
85397
  }
85398
+ get url() {
85399
+ return this._url;
85400
+ }
85401
+ set url(e) {
85402
+ const i = this._url !== e;
85403
+ this.__didAwake ? i && this.setClipURL(e ?? "") : this._url = e;
85404
+ }
85338
85405
  get playbackSpeed() {
85339
85406
  var e;
85340
85407
  return ((e = this._videoElement) == null ? void 0 : e.playbackRate) ?? this._playbackSpeed;
@@ -85412,7 +85479,7 @@ class yg extends RA {
85412
85479
  this.clip = e, this.source = 0, this._videoElement ? (this._videoElement.srcObject = e, this._isPlaying && this.play(), this.updateAspect()) : this.create(this.playOnAwake);
85413
85480
  }
85414
85481
  setClipURL(e) {
85415
- this.url !== e && (this.url = e, this.source = 1, Eg && console.log("set url", e), this._videoElement ? e.endsWith(".m3u8") ? this.ensureM3U8CanBePlayed() : (this._videoElement.src = e, this._isPlaying && (this.stop(), this.play())) : this.create(this.playOnAwake));
85482
+ this._url !== e && (this._url = e, this.source = 1, Eg && console.log("set url", e), this._videoElement ? e.endsWith(".m3u8") || e.includes(".m3u") ? this.ensureM3UCanBePlayed() : (this._videoElement.src = e, this._isPlaying && (this.stop(), this.play())) : this.create(this.playOnAwake));
85416
85483
  }
85417
85484
  onEnable() {
85418
85485
  var e, t;
@@ -85434,8 +85501,8 @@ class yg extends RA {
85434
85501
  return;
85435
85502
  }
85436
85503
  if (!(this._isPlaying && !((e = this._videoElement) != null && e.ended) && !((t = this._videoElement) != null && t.paused))) {
85437
- if (this._isPlaying = !0, this._receivedInput || (this._videoElement.muted = !0), this.handleBeginPlaying(!1), this.shouldUseM3U8) {
85438
- this.ensureM3U8CanBePlayed();
85504
+ if (this._isPlaying = !0, this._receivedInput || (this._videoElement.muted = !0), this.handleBeginPlaying(!1), this.shouldUseM3U) {
85505
+ this.ensureM3UCanBePlayed();
85439
85506
  return;
85440
85507
  }
85441
85508
  Eg && console.log("Video Play()", this.clip, this._videoElement, this.time), this._videoElement.currentTime = this.time, this._videoElement.play().catch((i) => {
@@ -85521,7 +85588,7 @@ class yg extends RA {
85521
85588
  console.warn("Can not play video, no material found, this might be a multimaterial case which is not supported yet");
85522
85589
  return;
85523
85590
  }
85524
- this.updateVideoElementSettings(), this.updateVideoElementStyles(), e && (this.shouldUseM3U8 && this.ensureM3U8CanBePlayed(), this.play());
85591
+ this.updateVideoElementSettings(), this.updateVideoElementStyles(), e && (this.shouldUseM3U && this.ensureM3UCanBePlayed(), this.play());
85525
85592
  }
85526
85593
  updateVideoElementSettings() {
85527
85594
  if (!this._videoElement)
@@ -85577,11 +85644,11 @@ class yg extends RA {
85577
85644
  yield;
85578
85645
  }
85579
85646
  }
85580
- get shouldUseM3U8() {
85581
- return this.url != null && this.url.endsWith(".m3u8") && this.source === 1;
85647
+ get shouldUseM3U() {
85648
+ return this.url != null && (this.url.endsWith(".m3u8") || this.url.endsWith(".m3u")) && this.source === 1;
85582
85649
  }
85583
- ensureM3U8CanBePlayed() {
85584
- if (!this.shouldUseM3U8)
85650
+ ensureM3UCanBePlayed() {
85651
+ if (!this.shouldUseM3U)
85585
85652
  return;
85586
85653
  let e = document.head.querySelector("script[data-hls_library]");
85587
85654
  e ? globalThis.Hls ? this.onHlsAvailable() : e.addEventListener("load", this.onHlsAvailable) : (Eg && console.log("HLS: load script"), e = document.createElement("script"), e.dataset.hls_library = "hls.js", e.src = "https://cdn.jsdelivr.net/npm/hls.js@1", e.addEventListener("load", this.onHlsAvailable), document.head.append(e));
@@ -85601,7 +85668,7 @@ Ro([
85601
85668
  ], yg.prototype, "source", 2);
85602
85669
  Ro([
85603
85670
  D(URL)
85604
- ], yg.prototype, "url", 2);
85671
+ ], yg.prototype, "url", 1);
85605
85672
  Ro([
85606
85673
  D()
85607
85674
  ], yg.prototype, "renderMode", 2);
@@ -86118,19 +86185,19 @@ class Ar extends xI {
86118
86185
  }
86119
86186
  }
86120
86187
  nu([
86121
- D(_e)
86188
+ D(Le)
86122
86189
  ], Ar.prototype, "intensity", 2);
86123
86190
  nu([
86124
- D(_e)
86191
+ D(Le)
86125
86192
  ], Ar.prototype, "falloff", 2);
86126
86193
  nu([
86127
- D(_e)
86194
+ D(Le)
86128
86195
  ], Ar.prototype, "samples", 2);
86129
86196
  nu([
86130
- D(_e)
86197
+ D(Le)
86131
86198
  ], Ar.prototype, "color", 2);
86132
86199
  nu([
86133
- D(_e)
86200
+ D(Le)
86134
86201
  ], Ar.prototype, "luminanceInfluence", 2);
86135
86202
  Ls("ScreenSpaceAmbientOcclusion", Ar);
86136
86203
  var TCA = Object.defineProperty, HCA = Object.getOwnPropertyDescriptor, TB = (g, A, e, t) => {
@@ -86181,20 +86248,20 @@ TB([
86181
86248
  D()
86182
86249
  ], Fn.prototype, "gammaCorrection", 2);
86183
86250
  TB([
86184
- D(_e)
86251
+ D(Le)
86185
86252
  ], Fn.prototype, "intensity", 2);
86186
86253
  TB([
86187
- D(_e)
86254
+ D(Le)
86188
86255
  ], Fn.prototype, "falloff", 2);
86189
86256
  TB([
86190
- D(_e)
86257
+ D(Le)
86191
86258
  ], Fn.prototype, "aoRadius", 2);
86192
86259
  TB([
86193
86260
  QI(),
86194
86261
  D()
86195
86262
  ], Fn.prototype, "screenspaceRadius", 2);
86196
86263
  TB([
86197
- D(_e)
86264
+ D(Le)
86198
86265
  ], Fn.prototype, "color", 2);
86199
86266
  TB([
86200
86267
  QI(),
@@ -86330,7 +86397,7 @@ const sO = (rG = class extends RA {
86330
86397
  updateNow(A) {
86331
86398
  if (!(!this.target || this.target === this.gameObject)) {
86332
86399
  if (this.followFactor > 0) {
86333
- const e = xe(this.target), t = this._firstUpdate || A ? 1 : ie.clamp01(this.context.time.deltaTime * this.followFactor), i = this.worldPosition;
86400
+ const e = _e(this.target), t = this._firstUpdate || A ? 1 : ie.clamp01(this.context.time.deltaTime * this.followFactor), i = this.worldPosition;
86334
86401
  this.positionAxes & Ul.X && (i.x = ie.lerp(i.x, e.x, t)), this.positionAxes & Ul.Y && (i.y = ie.lerp(i.y, e.y, t)), this.positionAxes & Ul.Z && (i.z = ie.lerp(i.z, e.z, t)), this.worldPosition = i;
86335
86402
  }
86336
86403
  if (this.rotateFactor > 0) {
@@ -87350,7 +87417,7 @@ class daA {
87350
87417
  Co.clear();
87351
87418
  const t = Co.createString(this.guid), i = Co.createString(this.userId);
87352
87419
  gn.startSyncedCameraModel(Co), gn.addGuid(Co, t), gn.addUserId(Co, i);
87353
- const I = xe(A), o = Ay(A);
87420
+ const I = _e(A), o = Ay(A);
87354
87421
  gn.addPos(Co, IB.createVec3(Co, I.x, I.y, I.z)), gn.addRot(Co, IB.createVec3(Co, o.x, o.y, o.z));
87355
87422
  const s = gn.endSyncedCameraModel(Co);
87356
87423
  Co.finish(s, HD), e.sendBinary(Co.asUint8Array());
@@ -87407,7 +87474,7 @@ const uM = (QG = class extends RA {
87407
87474
  if (!this.context.connection.isConnected || this.context.connection.connectionId === null)
87408
87475
  return;
87409
87476
  this._model === null && (this._model = new daA(this.context.connection.connectionId, this.context.connection.connectionId + "_camera"));
87410
- const e = xe(A), t = bt(A);
87477
+ const e = _e(A), t = bt(A);
87411
87478
  (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, tB.Browser));
87412
87479
  }
87413
87480
  onReceivedRemoteCameraInfoBin(A) {
@@ -87713,22 +87780,22 @@ class LC extends xI {
87713
87780
  }
87714
87781
  }
87715
87782
  wc([
87716
- D(_e)
87783
+ D(Le)
87717
87784
  ], LC.prototype, "offset", 2);
87718
87785
  wc([
87719
- D(_e)
87786
+ D(Le)
87720
87787
  ], LC.prototype, "rotation", 2);
87721
87788
  wc([
87722
- D(_e)
87789
+ D(Le)
87723
87790
  ], LC.prototype, "focusArea", 2);
87724
87791
  wc([
87725
- D(_e)
87792
+ D(Le)
87726
87793
  ], LC.prototype, "feather", 2);
87727
87794
  wc([
87728
- D(_e)
87795
+ D(Le)
87729
87796
  ], LC.prototype, "kernelSize", 2);
87730
87797
  wc([
87731
- D(_e)
87798
+ D(Le)
87732
87799
  ], LC.prototype, "resolutionScale", 2);
87733
87800
  Ls("TiltShiftEffect", LC);
87734
87801
  var SaA = Object.defineProperty, maA = Object.getOwnPropertyDescriptor, GaA = (g, A, e, t) => {
@@ -87748,7 +87815,7 @@ class aS extends xI {
87748
87815
  return !0;
87749
87816
  }
87750
87817
  init() {
87751
- this.mode || (this.mode = new _e(jI)), this.mode.defaultValue = jI;
87818
+ this.mode || (this.mode = new Le(jI)), this.mode.defaultValue = jI;
87752
87819
  }
87753
87820
  apply() {
87754
87821
  this.mode || this.init(), this.mode.onValueChanged = this._apply.bind(this), this._apply(this.mode.value);
@@ -87770,7 +87837,7 @@ class aS extends xI {
87770
87837
  }
87771
87838
  }
87772
87839
  GaA([
87773
- D(_e)
87840
+ D(Le)
87774
87841
  ], aS.prototype, "mode", 2);
87775
87842
  Ls("Tonemapping", aS);
87776
87843
  var kaA = Object.defineProperty, MaA = Object.getOwnPropertyDescriptor, rS = (g, A, e, t) => {
@@ -87910,13 +87977,13 @@ class Sc extends xI {
87910
87977
  }
87911
87978
  }
87912
87979
  wN([
87913
- D(_e)
87980
+ D(Le)
87914
87981
  ], Sc.prototype, "color", 2);
87915
87982
  wN([
87916
- D(_e)
87983
+ D(Le)
87917
87984
  ], Sc.prototype, "intensity", 2);
87918
87985
  wN([
87919
- D(_e)
87986
+ D(Le)
87920
87987
  ], Sc.prototype, "center", 2);
87921
87988
  Ls("Vignette", Sc);
87922
87989
  var NaA = Object.defineProperty, FaA = Object.getOwnPropertyDescriptor, KaA = (g, A, e, t) => {
@@ -87971,17 +88038,22 @@ class yN extends RA {
87971
88038
  updateFromFrame(e) {
87972
88039
  if (!e)
87973
88040
  return;
87974
- const t = e.getViewerPose(this.context.renderer.xr.getReferenceSpace());
87975
- if (t) {
87976
- for (const i of t.views)
87977
- if ("camera" in i && i.camera) {
87978
- let o = this.context.renderer.xr.getBinding();
87979
- if (o || (o = new XRWebGLBinding(e.session, this.context.renderer.getContext())), o) {
87980
- let s = null;
87981
- if ("getCameraImage" in o) {
87982
- s = o.getCameraImage(i.camera);
87983
- const n = this.context.renderer.properties.get(this.threeTexture);
87984
- n.__webglTexture = s, this.backgroundPlane ? (this.backgroundPlane.setTexture(this.threeTexture), this.backgroundPlane.visible = !0) : Tf && console.warn("No background plane to set texture on");
88041
+ const t = e.session.enabledFeatures;
88042
+ if (t && !t.some((I) => I === "camera-access")) {
88043
+ this.background && (this.background.visible = !1);
88044
+ return;
88045
+ }
88046
+ const i = e.getViewerPose(this.context.renderer.xr.getReferenceSpace());
88047
+ if (i) {
88048
+ for (const I of i.views)
88049
+ if ("camera" in I && I.camera) {
88050
+ let s = this.context.renderer.xr.getBinding();
88051
+ if (s || (s = new XRWebGLBinding(e.session, this.context.renderer.getContext())), s) {
88052
+ let n = null;
88053
+ if ("getCameraImage" in s) {
88054
+ n = s.getCameraImage(I.camera);
88055
+ const C = this.context.renderer.properties.get(this.threeTexture);
88056
+ C.__webglTexture = n, this.backgroundPlane ? (this.backgroundPlane.setTexture(this.threeTexture), this.backgroundPlane.visible = !0) : Tf && console.warn("No background plane to set texture on");
87985
88057
  }
87986
88058
  }
87987
88059
  }
@@ -90323,7 +90395,7 @@ const prA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
90323
90395
  VisibilityAction: Ky,
90324
90396
  Voip: ec,
90325
90397
  Volume: by,
90326
- VolumeParameter: _e,
90398
+ VolumeParameter: Le,
90327
90399
  VolumeProfile: Sy,
90328
90400
  WebARCameraBackground: yN,
90329
90401
  WebARSessionRoot: is,
@@ -90552,7 +90624,7 @@ z.add("Vignette", Sc);
90552
90624
  z.add("VisibilityAction", Ky);
90553
90625
  z.add("Voip", ec);
90554
90626
  z.add("Volume", by);
90555
- z.add("VolumeParameter", _e);
90627
+ z.add("VolumeParameter", Le);
90556
90628
  z.add("VolumeProfile", Sy);
90557
90629
  z.add("WebARCameraBackground", yN);
90558
90630
  z.add("WebARSessionRoot", is);
@@ -90786,7 +90858,7 @@ function UrA(g, A, e = !0) {
90786
90858
  }
90787
90859
  }
90788
90860
  function _QA(g, A = null) {
90789
- const e = A ?? Le.Current.scripts;
90861
+ const e = A ?? xe.Current.scripts;
90790
90862
  for (const t in e) {
90791
90863
  const i = e[t];
90792
90864
  if (i && i.guid === g)
@@ -90895,7 +90967,7 @@ class GO extends HTMLElement {
90895
90967
  <div class="content">
90896
90968
  <slot class="overlay-content"></slot>
90897
90969
  </div>
90898
- `, this.shadowRoot && this.shadowRoot.appendChild(e.content.cloneNode(!0)), this._context = new Le({ domElement: this }), this.addEventListener("error", this.onError);
90970
+ `, this.shadowRoot && this.shadowRoot.appendChild(e.content.cloneNode(!0)), this._context = new xe({ domElement: this }), this.addEventListener("error", this.onError);
90899
90971
  }
90900
90972
  static get observedAttributes() {
90901
90973
  return NrA;
@@ -91001,7 +91073,7 @@ class GO extends HTMLElement {
91001
91073
  var E, c;
91002
91074
  if (!this.isConnected)
91003
91075
  return;
91004
- if (this._context || (Qi && console.warn("Create new context"), this._context = new Le({ domElement: this })), !this._context) {
91076
+ if (this._context || (Qi && console.warn("Create new context"), this._context = new xe({ domElement: this })), !this._context) {
91005
91077
  console.error("Needle Engine: Context not initialized");
91006
91078
  return;
91007
91079
  }
@@ -96570,7 +96642,7 @@ const Dh = class {
96570
96642
  if (!i)
96571
96643
  return console.error("Can not perform raycast - no camera found"), null;
96572
96644
  o.set(A.origin.x, A.origin.y, A.origin.z);
96573
- const a = xe(i);
96645
+ const a = _e(i);
96574
96646
  o.sub(a);
96575
96647
  }
96576
96648
  return o.normalize(), A.dir.x = o.x, A.dir.y = o.y, A.dir.z = o.z, A;
@@ -96735,7 +96807,7 @@ this is not optimal for performance since this isn't supported by the Rapier phy
96735
96807
  throw new Error("Physics world not initialized");
96736
96808
  const t = this._tempMatrix;
96737
96809
  let i;
96738
- A.attachedRigidbody ? i = this.getRigidbody(A, this._tempMatrix) : (qi && console.log("Create collider without rigidbody", A.name), t.makeRotationFromQuaternion(bt(A.gameObject)), t.setPosition(xe(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);
96810
+ A.attachedRigidbody ? i = this.getRigidbody(A, this._tempMatrix) : (qi && console.log("Create collider without rigidbody", A.name), t.makeRotationFromQuaternion(bt(A.gameObject)), t.setPosition(_e(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);
96739
96811
  const I = A.sharedMaterial;
96740
96812
  if (I) {
96741
96813
  if (I.bounciness !== void 0 && e.setRestitution(I.bounciness), I.bounceCombine !== void 0)
@@ -96813,12 +96885,12 @@ Error:`, s), null;
96813
96885
  if (t = i[yI], !t) {
96814
96886
  const I = i.isKinematic && !AG;
96815
96887
  qi && console.log("Create rigidbody", I);
96816
- const o = I ? On.RigidBodyDesc.kinematicPositionBased() : On.RigidBodyDesc.dynamic(), s = xe(A.attachedRigidbody.gameObject);
96888
+ const o = I ? On.RigidBodyDesc.kinematicPositionBased() : On.RigidBodyDesc.dynamic(), s = _e(A.attachedRigidbody.gameObject);
96817
96889
  o.setTranslation(s.x, s.y, s.z), o.setRotation(bt(A.attachedRigidbody.gameObject)), o.centerOfMass = new On.Vector3(i.centerOfMass.x, i.centerOfMass.y, i.centerOfMass.z), t = this.world.createRigidBody(o), this.bodies.push(t), this.objects.push(i);
96818
96890
  }
96819
96891
  t[OI] = i, i[yI] = t, this.internalUpdateRigidbodyProperties(i, t), this.getRigidbodyRelativeMatrix(A.gameObject, i.gameObject, e), A[nx] = t;
96820
96892
  } else {
96821
- const i = On.RigidBodyDesc.kinematicPositionBased(), I = xe(A.gameObject);
96893
+ const i = On.RigidBodyDesc.kinematicPositionBased(), I = _e(A.gameObject);
96822
96894
  i.setTranslation(I.x, I.y, I.z), i.setRotation(bt(A.gameObject)), t = this.world.createRigidBody(i), e.identity(), t[OI] = null;
96823
96895
  }
96824
96896
  return t;
@@ -96912,7 +96984,7 @@ Error:`, s), null;
96912
96984
  }
96913
96985
  syncPhysicsBody(A, e, t, i) {
96914
96986
  if (e instanceof KE) {
96915
- const I = xe(A, this._tempPosition), o = bt(A, this._tempQuaternion);
96987
+ const I = _e(A, this._tempPosition), o = bt(A, this._tempQuaternion);
96916
96988
  switch (e.bodyType()) {
96917
96989
  case GI.Fixed:
96918
96990
  case GI.KinematicPositionBased:
@@ -96924,7 +96996,7 @@ Error:`, s), null;
96924
96996
  break;
96925
96997
  }
96926
96998
  } else if (e instanceof vE) {
96927
- const I = xe(A, this._tempPosition), o = bt(A, this._tempQuaternion), s = e[OI];
96999
+ const I = _e(A, this._tempPosition), o = bt(A, this._tempQuaternion), s = e[OI];
96928
97000
  if (this.tryApplyCenter(s, I), t) {
96929
97001
  const n = e.translation();
96930
97002
  (n.x !== I.x || n.y !== I.y || n.z !== I.z) && e.setTranslation(I);
@@ -97204,7 +97276,7 @@ function bO(g, A) {
97204
97276
  console.warn("Missing camera object, can not add orbit controls");
97205
97277
  }
97206
97278
  const cF = {
97207
- Context: Le,
97279
+ Context: xe,
97208
97280
  glTF: {
97209
97281
  loadFromURL: DO
97210
97282
  }
@@ -98265,7 +98337,7 @@ export {
98265
98337
  peA as ConnectionEvents,
98266
98338
  jrA as ContactPoint,
98267
98339
  vB as ContactShadows,
98268
- Le as Context,
98340
+ xe as Context,
98269
98341
  fQA as ContextArgs,
98270
98342
  ki as ContextEvent,
98271
98343
  rt as ContextRegistry,
@@ -98514,7 +98586,7 @@ export {
98514
98586
  Ky as VisibilityAction,
98515
98587
  ec as Voip,
98516
98588
  by as Volume,
98517
- _e as VolumeParameter,
98589
+ Le as VolumeParameter,
98518
98590
  Sy as VolumeProfile,
98519
98591
  dQA as WaitForFrames,
98520
98592
  NeA as WaitForPromise,
@@ -98612,7 +98684,7 @@ export {
98612
98684
  Pw as getUrlParams,
98613
98685
  aT as getWorldDirection,
98614
98686
  rT as getWorldEuler,
98615
- xe as getWorldPosition,
98687
+ _e as getWorldPosition,
98616
98688
  bt as getWorldQuaternion,
98617
98689
  Ay as getWorldRotation,
98618
98690
  oi as getWorldScale,