@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 nue(s, e) {
28989
28989
  s.lookAt(e), s.quaternion.multiply(Tq);
28990
28990
  }
28991
28991
  function ox(s, e, t = !0, i = !1) {
28992
- const n = Ft(e), r = Ft(s);
28992
+ const n = Nt(e), r = Nt(s);
28993
28993
  if (i) {
28994
28994
  if (Aa(s, Ri(e)), t) {
28995
28995
  const o = r.y, a = r.sub(TU(s));
@@ -29010,7 +29010,7 @@ function Af(s) {
29010
29010
  return s instanceof Ce ? e.copy(s) : s instanceof DOMPointReadOnly && e.set(s.x, s.y, s.z, s.w), e;
29011
29011
  }
29012
29012
  const FT = new va(() => new w(), 100), DB = Symbol("lastMatrixWorldUpdateKey");
29013
- function Ft(s, e = null, t = !0) {
29013
+ function Nt(s, e = null, t = !0) {
29014
29014
  const i = e ?? FT.get();
29015
29015
  return s ? s.parent ? (t && s.updateWorldMatrix(!0, !1), s.matrixWorldNeedsUpdate && s[DB] !== Date.now() && (s[DB] = Date.now(), s.updateMatrixWorld()), i.setFromMatrixPosition(s.matrixWorld), i) : i.copy(s.position) : i.set(0, 0, 0);
29016
29016
  }
@@ -29476,13 +29476,13 @@ function aue(s) {
29476
29476
  WE = s;
29477
29477
  }
29478
29478
  const OU = ne("debugdefines");
29479
- gp('if(!globalThis[""3.37.4-alpha""]) globalThis[""3.37.4-alpha""] = "0.0.0";');
29479
+ gp('if(!globalThis[""3.37.6-alpha""]) globalThis[""3.37.6-alpha""] = "0.0.0";');
29480
29480
  gp('if(!globalThis[""undefined""]) globalThis[""undefined""] = "unknown";');
29481
- gp('if(!globalThis[""Mon Apr 22 2024 09:46:27 GMT+0200 (Central European Summer Time)""]) globalThis[""Mon Apr 22 2024 09:46:27 GMT+0200 (Central European Summer Time)""] = "unknown";');
29482
- gp('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.37.4-alpha";');
29481
+ gp('if(!globalThis[""Wed Apr 24 2024 17:26:48 GMT+0200 (Central European Summer Time)""]) globalThis[""Wed Apr 24 2024 17:26:48 GMT+0200 (Central European Summer Time)""] = "unknown";');
29482
+ gp('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.37.6-alpha";');
29483
29483
  gp('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
29484
- gp('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Mon Apr 22 2024 09:46:27 GMT+0200 (Central European Summer Time)";');
29485
- const tc = "3.37.4-alpha", UT = "undefined", LU = "Mon Apr 22 2024 09:46:27 GMT+0200 (Central European Summer Time)";
29484
+ gp('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Wed Apr 24 2024 17:26:48 GMT+0200 (Central European Summer Time)";');
29485
+ const tc = "3.37.6-alpha", UT = "undefined", LU = "Wed Apr 24 2024 17:26:48 GMT+0200 (Central European Summer Time)";
29486
29486
  OU && console.log(`Engine version: ${tc} (generator: ${UT})
29487
29487
  Project built at ${LU}`);
29488
29488
  const uh = "needle_isActiveInHierarchy", nf = "builtin_components", P0 = "needle_editor_guid";
@@ -44369,7 +44369,7 @@ const XS = Symbol("assetReference"), gu = class {
44369
44369
  * @returns the AssetReference for the URL
44370
44370
  */
44371
44371
  static getOrCreateFromUrl(e, t) {
44372
- if (!t && (t = Ut.Current, !t))
44372
+ if (!t && (t = Ft.Current, !t))
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 i = t.addressables, n = i.findAssetReference(e);
44375
44375
  if (n)
@@ -44383,7 +44383,7 @@ const XS = Symbol("assetReference"), gu = class {
44383
44383
  */
44384
44384
  static getOrCreate(e, t, i) {
44385
44385
  if (typeof e == "string") {
44386
- if (!i && (i = Ut.Current, !i))
44386
+ if (!i && (i = Ft.Current, !i))
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
  i = e.context, e = e.sourceId;
@@ -44426,7 +44426,7 @@ const XS = Symbol("assetReference"), gu = class {
44426
44426
  }
44427
44427
  /** frees previously allocated memory and destroys the current `asset` instance (if any) */
44428
44428
  unload() {
44429
- this.asset && (Uc && console.log("Unload", this.asset), this.asset.scene && cl(this.asset.scene, !0, !0), cl(this.asset, !0, !0)), this.asset = null, this._rawBinary = void 0, this._glbRoot = null, this._loading = void 0, Ut.Current && Ut.Current.addressables.unregisterAssetReference(this);
44429
+ this.asset && (Uc && console.log("Unload", this.asset), this.asset.scene && cl(this.asset.scene, !0, !0), cl(this.asset, !0, !0)), this.asset = null, this._rawBinary = void 0, this._glbRoot = null, this._loading = void 0, Ft.Current && Ft.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 XS = Symbol("assetReference"), gu = class {
44449
44449
  return this.asset;
44450
44450
  if (e && this._progressListeners.push(e), this._loading !== void 0)
44451
44451
  return this._loading.then((n) => this.asset);
44452
- const t = Ut.Current;
44452
+ const t = Ft.Current;
44453
44453
  this._rawBinary ? (this._loading = rl().parseSync(t, this._rawBinary, this.uri, null), this.raiseProgressEvent(new ProgressEvent("progress", { loaded: this._rawBinary.byteLength, total: this._rawBinary.byteLength }))) : (Uc && console.log("Load async", this.uri), this._loading = rl().loadSync(t, this._hashedUri, this.uri, null, (n) => {
44454
44454
  this.raiseProgressEvent(n);
44455
44455
  }));
@@ -44477,7 +44477,7 @@ const XS = Symbol("assetReference"), gu = class {
44477
44477
  t(this, e);
44478
44478
  }
44479
44479
  async onInstantiate(e, t = !1, i) {
44480
- const n = Ut.Current, r = new fl();
44480
+ const n = Ft.Current, r = new fl();
44481
44481
  if (e instanceof me ? r.parent = e : e && r.cloneAssign(e), r.parent || (r.parent = n.scene), this.mustLoad && await this.loadAssetAsync(), Uc && console.log("Instantiate", this.uri, "parent:", e), this.asset) {
44482
44482
  Uc && console.log("Add to scene", this.asset);
44483
44483
  let o = gu.currentlyInstantiating.get(this.uri);
@@ -44994,7 +44994,7 @@ class Fn {
44994
44994
  this.set({ textContent: d }), c.tmuiNeedsUpdate = !0;
44995
44995
  };
44996
44996
  }
44997
- return this.tmuiNeedsUpdate = !0, this.registerTimedObject(Ut.Current, o, e, this.textLabelCache), o;
44997
+ return this.tmuiNeedsUpdate = !0, this.registerTimedObject(Ft.Current, o, e, this.textLabelCache), o;
44998
44998
  }
44999
44999
  static getBox(e) {
45000
45000
  let t = this.boxesCache.pop();
@@ -45002,7 +45002,7 @@ class Fn {
45002
45002
  const i = new ki(1, 1, 1);
45003
45003
  t = new de(i);
45004
45004
  }
45005
- return this.registerTimedObject(Ut.Current, t, e, this.boxesCache), t;
45005
+ return this.registerTimedObject(Ft.Current, t, e, this.boxesCache), t;
45006
45006
  }
45007
45007
  static getLine(e) {
45008
45008
  let t = this.linesCache.pop();
@@ -45011,15 +45011,15 @@ class Fn {
45011
45011
  let i = t.geometry.getAttribute("position");
45012
45012
  i || (i = new et(new Float32Array(2 * 3), 3), t.geometry.setAttribute("position", i));
45013
45013
  }
45014
- return t.frustumCulled = !1, this.registerTimedObject(Ut.Current, t, e, this.linesCache), t;
45014
+ return t.frustumCulled = !1, this.registerTimedObject(Ft.Current, t, e, this.linesCache), t;
45015
45015
  }
45016
45016
  static getSphere(e, t, i) {
45017
45017
  let n = this.spheresCache.pop();
45018
- return n || (n = new de(new wa(1, 8, 8))), n.scale.set(e, e, e), n.material.wireframe = i, this.registerTimedObject(Ut.Current, n, t, this.spheresCache), n;
45018
+ return n || (n = new de(new wa(1, 8, 8))), n.scale.set(e, e, e), n.material.wireframe = i, this.registerTimedObject(Ft.Current, n, t, this.spheresCache), n;
45019
45019
  }
45020
45020
  static getArrowHead(e) {
45021
45021
  let t = this.arrowHeadsCache.pop();
45022
- return t || (t = new de(new En(0, 0.5, 1, 8))), this.registerTimedObject(Ut.Current, t, e, this.arrowHeadsCache), t;
45022
+ return t || (t = new de(new En(0, 0.5, 1, 8))), this.registerTimedObject(Ft.Current, t, e, this.arrowHeadsCache), t;
45023
45023
  }
45024
45024
  static registerTimedObject(e, t, i, n) {
45025
45025
  const r = this.contextBeforeRenderCallbacks.get(e), o = this.contextPostRenderCallbacks.get(e);
@@ -45047,7 +45047,7 @@ class Fn {
45047
45047
  }
45048
45048
  t.traverse((a) => {
45049
45049
  a.layers.disableAll(), a.layers.enable(2);
45050
- }), t.renderOrder = 999999, t[g1] = n, this.timedObjectsBuffer.push(t), this.timesBuffer.push(Ut.Current.time.realtimeSinceStartup + i), e.scene.add(t);
45050
+ }), t.renderOrder = 999999, t[g1] = n, this.timedObjectsBuffer.push(t), this.timesBuffer.push(Ft.Current.time.realtimeSinceStartup + i), e.scene.add(t);
45051
45051
  }
45052
45052
  static onBeforeRender(e, t) {
45053
45053
  this.tmuiNeedsUpdate && Di.update();
@@ -45785,11 +45785,11 @@ class JZ {
45785
45785
  return t[e] = i, i;
45786
45786
  }
45787
45787
  onDispatchEvent(e) {
45788
- const t = Ut.Current;
45788
+ const t = Ft.Current;
45789
45789
  try {
45790
- Ut.Current = this.context, this.dispatchEvent(e);
45790
+ Ft.Current = this.context, this.dispatchEvent(e);
45791
45791
  } finally {
45792
- Ut.Current = t;
45792
+ Ft.Current = t;
45793
45793
  }
45794
45794
  }
45795
45795
  }
@@ -46277,8 +46277,8 @@ Pinch: ${(n = this.getGesture("pinch")) == null ? void 0 : n.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 + t, this.pointerInit.pointerType = this.hand ? "hand" : "controller", this.pointerInit.button = t, this.pointerInit.buttonName = i, this.pointerInit.isPrimary = n, this.pointerInit.mode = this.inputSource.targetRayMode, this.pointerInit.ray = this.ray, this.pointerInit.device = this.object, this.pointerInit.pressure = o;
46280
- const a = Ut.Current;
46281
- Ut.Current = this.xr.context, Nc && e !== "pointermove" && console.warn("Pointer event", e, t, i, { ...this.pointerInit }), this.xr.context.input.createInputEvent(new Vc(e, r, this.pointerInit)), Ut.Current = a;
46280
+ const a = Ft.Current;
46281
+ Ft.Current = this.xr.context, Nc && e !== "pointermove" && console.warn("Pointer event", e, t, i, { ...this.pointerInit }), this.xr.context.input.createInputEvent(new Vc(e, r, this.pointerInit)), Ft.Current = a;
46282
46282
  }
46283
46283
  }
46284
46284
  }
@@ -52794,7 +52794,7 @@ async function Y$() {
52794
52794
  const e = sessionStorage.getItem("needle_xr_session_mode"), t = sessionStorage.getItem("needle_xr_session_init") ?? null, i = t ? JSON.parse(t) : null;
52795
52795
  let n = null;
52796
52796
  if (Y3() && (await sh.start(e || "immersive-vr", i || St.getDefaultSessionInit("immersive-vr")), await Z$(), n = await sh.handoff()), n)
52797
- St.setSession(n.mode, n.session, n.init, Ut.Current);
52797
+ St.setSession(n.mode, n.session, n.init, Ft.Current);
52798
52798
  else if (e && t) {
52799
52799
  console.log("Session Granted: Restore last session");
52800
52800
  const r = JSON.parse(t);
@@ -53022,7 +53022,7 @@ const Gl = class {
53022
53022
  J$(e, n.init), this.session = t, this.mode = e, this.context = i, (es || ne("console")) && lv(!0), this._xr_scripts = [...n.scripts], this._xr_update_scripts = this._xr_scripts.filter((a) => typeof a.onUpdateXR == "function"), this._controllerAdded = n.controller_added, this._controllerRemoved = n.controller_removed, Ap(this.onBefore, en.LateUpdate), this.context.pre_render_callbacks.push(this.onBeforeRender), this.context.post_render_callbacks.push(this.onAfterRender), ((r = n.init.optionalFeatures) != null && r.includes("hit-test") || (o = n.init.requiredFeatures) != null && o.includes("hit-test")) && t.requestReferenceSpace("viewer").then((a) => {
53023
53023
  var l, c;
53024
53024
  return (c = (l = t.requestHitTestSource) == null ? void 0 : l.call(t, { space: a })) == null ? void 0 : c.then((u) => this._viewerHitTestSource = u);
53025
- }).catch((a) => console.warn(a)), this.context.mainCamera && (this._originalCameraWorldPosition = Ft(this.context.mainCamera, new w()), this._originalCameraWorldRotation = Ri(this.context.mainCamera, new Ce()), this._originalCameraWorldScale = Zi(this.context.mainCamera, new w()), this._originalCameraParent = this.context.mainCamera.parent), this._defaultRig = new ZZ(), this.context.scene.add(this._defaultRig.gameObject), this.addRig(this._defaultRig);
53025
+ }).catch((a) => console.warn(a)), this.context.mainCamera && (this._originalCameraWorldPosition = Nt(this.context.mainCamera, new w()), this._originalCameraWorldRotation = Ri(this.context.mainCamera, new Ce()), this._originalCameraWorldScale = Zi(this.context.mainCamera, new w()), this._originalCameraParent = this.context.mainCamera.parent), this._defaultRig = new ZZ(), this.context.scene.add(this._defaultRig.gameObject), this.addRig(this._defaultRig);
53026
53026
  for (let a = 0; a < t.inputSources.length; a++) {
53027
53027
  const l = t.inputSources[a];
53028
53028
  if (!l.handedness) {
@@ -53163,7 +53163,7 @@ const Gl = class {
53163
53163
  return console.warn("A XRSession is already being requested"), (es || vt()) && _n("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 (i || (i = Ut.Current), i || (i = ci.All[0]), !i)
53166
+ if (i || (i = Ft.Current), i || (i = ci.All[0]), !i)
53167
53167
  throw new Error("No Needle Engine Context found");
53168
53168
  switch (t || (t = {}), e) {
53169
53169
  case "immersive-ar":
@@ -53673,7 +53673,7 @@ let Ou = TR;
53673
53673
  /** @deprecated use Application.registerWaitForInteraction instead */
53674
53674
  h(Ou, "registerWaitForAllowAudio", TR.registerWaitForInteraction);
53675
53675
  function* eee(s, e = null) {
53676
- const t = e ? e.time : Ut.Current.time, i = t.time;
53676
+ const t = e ? e.time : Ft.Current.time, i = t.time;
53677
53677
  for (; t.time - i < s; )
53678
53678
  yield;
53679
53679
  }
@@ -54849,7 +54849,7 @@ class ree {
54849
54849
  o.matrixWorldNeedsUpdate && o.updateMatrixWorld();
54850
54850
  const l = this.tempBoundingBox.copy(a.boundingBox).applyMatrix4(o.matrixWorld);
54851
54851
  if (t.intersectsBox(l)) {
54852
- const c = Ft(e), u = c.distanceTo(t.center), d = new see(e, u, c);
54852
+ const c = Nt(e), u = c.distanceTo(t.center), d = new see(e, u, c);
54853
54853
  if (n.push(d), !r)
54854
54854
  return;
54855
54855
  }
@@ -56347,7 +56347,7 @@ The script will be ignored. Please make sure your component extends "Behaviour"
56347
56347
  `, s);
56348
56348
  return;
56349
56349
  }
56350
- const t = (e == null ? void 0 : e.new_scripts) ?? Ut.Current.new_scripts;
56350
+ const t = (e == null ? void 0 : e.new_scripts) ?? Ft.Current.new_scripts;
56351
56351
  t.includes(s) || t.push(s);
56352
56352
  }
56353
56353
  const Ni = class {
@@ -57119,8 +57119,8 @@ Memory:`, { ...this.renderer.info.memory })), this._dispatchReadyAfterFrame && (
57119
57119
  }
57120
57120
  }
57121
57121
  };
57122
- let Ut = Ni;
57123
- h(Ut, "_defaultTargetFramerate", { value: 60 }), h(Ut, "_defaultWebglRendererParameters", {
57122
+ let Ft = Ni;
57123
+ h(Ft, "_defaultTargetFramerate", { value: 60 }), h(Ft, "_defaultWebglRendererParameters", {
57124
57124
  antialias: !0,
57125
57125
  alpha: !1,
57126
57126
  powerPreference: "high-performance"
@@ -57232,7 +57232,7 @@ function ez(s, e, t, i) {
57232
57232
  const n = s;
57233
57233
  if (!n.guid)
57234
57234
  return console.warn("Can not instantiate: No guid", n), null;
57235
- if (e.context || (e.context = Ut.Current), !e.context)
57235
+ if (e.context || (e.context = Ft.Current), !e.context)
57236
57236
  return console.error("Missing network instantiate options / reference to network connection in sync instantiate"), null;
57237
57237
  const r = e ? { ...e } : null, { instance: o, seed: a } = Pee(n, e);
57238
57238
  if (o) {
@@ -57432,7 +57432,7 @@ function rz(s, e, t, i = 0) {
57432
57432
  function qv(s, e = null) {
57433
57433
  let t = null;
57434
57434
  e !== null && (e.x !== void 0 ? (t = new fl(), t.position = e) : t = e);
57435
- let i = Ut.Current;
57435
+ let i = Ft.Current;
57436
57436
  t != null && t.context && (i = t.context), Q0 && i.alias && console.log("context", i.alias), t && !t.idProvider && (t.idProvider = new Ps(Date.now()));
57437
57437
  const n = [], r = {}, o = {}, a = oz(i, s, t, n, r, o);
57438
57438
  a && (Nee(r), Uee(o, r)), Q0 && (jE(s, !0), jE(a, !0));
@@ -57666,7 +57666,7 @@ Object.getOwnPropertyDescriptor(me.prototype, "transform") || Object.definePrope
57666
57666
  });
57667
57667
  Object.getOwnPropertyDescriptor(me.prototype, "worldPosition") || Object.defineProperty(me.prototype, "worldPosition", {
57668
57668
  get: function() {
57669
- return this instanceof VT ? Ft(this.object) : Ft(this);
57669
+ return this instanceof VT ? Nt(this.object) : Nt(this);
57670
57670
  },
57671
57671
  set: function(s) {
57672
57672
  Mr(this, s);
@@ -57762,7 +57762,7 @@ function Wee(s) {
57762
57762
  const e = s.gameObject.userData.components.indexOf(s);
57763
57763
  s.gameObject.userData.components.splice(e, 1);
57764
57764
  }
57765
- s.__internalDisable && s.__internalDisable(), ql(s, s.context ?? Ut.Current), s.destroy(), s.gameObject = null;
57765
+ s.__internalDisable && s.__internalDisable(), ql(s, s.context ?? Ft.Current), s.destroy(), s.gameObject = null;
57766
57766
  }
57767
57767
  let RD = !1;
57768
57768
  function hz(s, e, t) {
@@ -57840,7 +57840,7 @@ function gI(s, e, t, i = !0) {
57840
57840
  function qee(s, e = void 0, t = !0) {
57841
57841
  if (!s)
57842
57842
  return null;
57843
- if (!e && (e = Ut.Current, !e))
57843
+ if (!e && (e = Ft.Current, !e))
57844
57844
  return console.error("Can not search object without any needle context or scene!!!"), null;
57845
57845
  let i = e;
57846
57846
  if (i.isScene || (i = e == null ? void 0 : e.scene), !i)
@@ -57858,7 +57858,7 @@ function qee(s, e = void 0, t = !0) {
57858
57858
  function Xee(s, e, t = void 0) {
57859
57859
  if (!s)
57860
57860
  return e;
57861
- if (e || (e = []), e.length = 0, !t && (t = Ut.Current, !t))
57861
+ if (e || (e = []), e.length = 0, !t && (t = Ft.Current, !t))
57862
57862
  return console.error("Can not search object without any needle context or scene!!!"), e;
57863
57863
  "scene" in t && (t = t.scene);
57864
57864
  const i = t;
@@ -57879,7 +57879,7 @@ class oe extends me {
57879
57879
  return sp(t);
57880
57880
  }
57881
57881
  static setActive(t, i, n = !0) {
57882
- t && (j0(t, i), k0(t), i && n && EN(Ut.Current, t));
57882
+ t && (j0(t, i), k0(t), i && n && EN(Ft.Current, t));
57883
57883
  }
57884
57884
  /** If the object is active (same as go.visible) */
57885
57885
  static isActiveSelf(t) {
@@ -57927,7 +57927,7 @@ class oe extends me {
57927
57927
  if (!t)
57928
57928
  return;
57929
57929
  const r = t;
57930
- i = i ?? Ut.Current, dI(r, i.connection, n);
57930
+ i = i ?? Ft.Current, dI(r, i.connection, n);
57931
57931
  }
57932
57932
  /** Destroys a object
57933
57933
  * @param instance object to destroy
@@ -57945,7 +57945,7 @@ class oe extends me {
57945
57945
  console.warn("Can not add object to self", t);
57946
57946
  return;
57947
57947
  }
57948
- n || (n = Ut.Current), i.add(t), j0(t, !0), k0(t), n ? oe.foreachComponent(t, (r) => {
57948
+ n || (n = Ft.Current), i.add(t), j0(t, !0), k0(t), n ? oe.foreachComponent(t, (r) => {
57949
57949
  XT(r, n), !r.__internalDidAwakeAndStart && n.new_script_start.includes(r) === !1 && n.new_script_start.push(r);
57950
57950
  }, !0) : console.warn("Missing context");
57951
57951
  }
@@ -58015,7 +58015,7 @@ class oe extends me {
58015
58015
  return _x(t, i);
58016
58016
  }
58017
58017
  static findObjectOfType(t, i, n = !0) {
58018
- return qee(t, i ?? Ut.Current, n);
58018
+ return qee(t, i ?? Ft.Current, n);
58019
58019
  }
58020
58020
  static findObjectsOfType(t, i) {
58021
58021
  const n = [];
@@ -58077,7 +58077,7 @@ let Te = (qa = 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 ?? Ut.Current;
58080
+ return this.__context ?? Ft.Current;
58081
58081
  }
58082
58082
  set context(e) {
58083
58083
  this.__context = e;
@@ -58247,7 +58247,7 @@ let Te = (qa = class {
58247
58247
  e ? this.__internalEnable() : this.__internalDisable();
58248
58248
  }
58249
58249
  get worldPosition() {
58250
- return Ft(this.gameObject);
58250
+ return Nt(this.gameObject);
58251
58251
  }
58252
58252
  set worldPosition(e) {
58253
58253
  Mr(this.gameObject, e);
@@ -58338,8 +58338,8 @@ class Cx extends Te {
58338
58338
  update() {
58339
58339
  if (!this.from || !this.to)
58340
58340
  return;
58341
- const t = Ft(this.from).clone(), i = Ft(this.to).clone(), n = t.distanceTo(i);
58342
- this._centerPos.copy(t), this._centerPos.add(i), this._centerPos.multiplyScalar(0.5), Mr(this.gameObject, this.centered ? this._centerPos : t), this.gameObject.lookAt(Ft(this.to).clone()), this.gameObject.scale.set(this.width, this.width, n);
58341
+ const t = Nt(this.from).clone(), i = Nt(this.to).clone(), n = t.distanceTo(i);
58342
+ this._centerPos.copy(t), this._centerPos.add(i), this._centerPos.multiplyScalar(0.5), Mr(this.gameObject, this.centered ? this._centerPos : t), this.gameObject.lookAt(Nt(this.to).clone()), this.gameObject.scale.set(this.width, this.width, n);
58343
58343
  }
58344
58344
  }
58345
58345
  uz([
@@ -59976,7 +59976,7 @@ const F1 = (QC = class extends Te {
59976
59976
  setBodyFromGameObject(e = null) {
59977
59977
  }
59978
59978
  captureVelocity() {
59979
- const e = Ft(this.gameObject);
59979
+ const e = Nt(this.gameObject);
59980
59980
  F1.tempPosition.copy(e);
59981
59981
  const t = e.sub(this._lastPosition);
59982
59982
  this._lastPosition.copy(F1.tempPosition), this._smoothedVelocity.lerp(t, this.context.time.deltaTime / 0.1);
@@ -60923,7 +60923,7 @@ const za = class extends Te {
60923
60923
  oe.addNewComponent(i, za), t.scene.add(i);
60924
60924
  }
60925
60925
  static get systems() {
60926
- const t = Ut.Current;
60926
+ const t = Ft.Current;
60927
60927
  return this._eventSystemMap.has(t) || this._eventSystemMap.set(t, []), this._eventSystemMap.get(t);
60928
60928
  }
60929
60929
  static get(t) {
@@ -61364,16 +61364,20 @@ class Ei extends Te {
61364
61364
  set targetLerpSpeed(t) {
61365
61365
  this.targetLerpDuration = 1 / t;
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 = ao.get(this.context) ?? void 0, this._eventSystem && (this._afterHandleInputFn = this.afterHandleInput.bind(this), this._eventSystem.addEventListener(N1.AfterHandleInput, this._afterHandleInputFn));
61372
61374
  }
61375
+ /** @internal */
61373
61376
  onDestroy() {
61374
61377
  var t, i;
61375
61378
  (t = this._controls) == null || t.dispose(), (i = this._eventSystem) == null || i.removeEventListener(N1.AfterHandleInput, this._afterHandleInputFn);
61376
61379
  }
61380
+ /** @internal */
61377
61381
  onEnable() {
61378
61382
  this._enableTime = this.context.time.time;
61379
61383
  const t = oe.getComponent(this.gameObject, Vi);
@@ -61386,6 +61390,7 @@ class Ei extends Te {
61386
61390
  }
61387
61391
  this._controls && (Hy && (this.enablePan = !0, this.enableZoom = !0, this.middleClickToFocus = !0, Xo() && (this.doubleClickToFocus = !0)), this._controls.addEventListener("start", this.onControlsChangeStarted), (i == null ? void 0 : i.type) === "PerspectiveCamera" ? Hy || (this._controls.minDistance = this.minZoom, this._controls.maxDistance = this.maxZoom) : Hy || (this._controls.minZoom = this.minZoom, this._controls.maxZoom = this.maxZoom), this._startedListeningToKeyEvents || (this._startedListeningToKeyEvents = !0, this._controls.listenToKeyEvents(window.document.body))), this._syncedTransform = oe.getComponent(this.gameObject, Ju) ?? void 0;
61388
61392
  }
61393
+ /** @internal */
61389
61394
  onDisable() {
61390
61395
  var t;
61391
61396
  (t = this._camera) != null && t.cam && LD(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 Ei extends Te {
61393
61398
  afterHandleInput(t) {
61394
61399
  t.detail.args.pointerId === 0 && (t.detail.args.isDown ? this._controls && this._eventSystem && (this._shouldDisable = this._eventSystem.hasActiveUI) : (!t.detail.args.isPressed || t.detail.args.isUp) && (this._shouldDisable = !1));
61395
61400
  }
61401
+ /** @internal */
61396
61402
  onBeforeRender() {
61397
61403
  var i, n;
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) && ((i = this.context.input.getPointerPositionDelta(0)) != null && i.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) && ((i = this.context.input.getPointerPositionDelta(0)) != null && i.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 t = this.middleClickToFocus && this.context.input.getPointerClicked(1);
61402
61412
  if (t || (t = this.doubleClickToFocus && this.context.input.getPointerDoubleClicked(0) && this.context.time.time - this._enableTime > 0.3), t && this.setTargetFromRaycast(), this._lookTargetLerpActive || this._cameraLerpActive) {
61403
61413
  if (this._cameraLerpActive && this._cameraObject)
@@ -61429,7 +61439,7 @@ class Ei extends Te {
61429
61439
  const t = oe.getComponent(this.gameObject, Vi);
61430
61440
  if (t && !this.setLookTargetFromConstraint()) {
61431
61441
  this.debugLog && console.log("NO TARGET");
61432
- const n = Ft(t.cam).length(), r = new w(0, 0, -n).applyMatrix4(t.cam.matrixWorld);
61442
+ const n = Nt(t.cam).length(), r = new w(0, 0, -n).applyMatrix4(t.cam.matrixWorld);
61433
61443
  this.setLookTargetPosition(r, !0);
61434
61444
  }
61435
61445
  if (!this.autoFit && !this.setLookTargetFromConstraint()) {
@@ -61447,15 +61457,16 @@ class Ei extends Te {
61447
61457
  setCameraAndLookTarget(t) {
61448
61458
  if (!t || !(t instanceof me))
61449
61459
  return;
61450
- const i = Ft(t), n = TU(t);
61460
+ const i = Nt(t), n = TU(t);
61451
61461
  this.setTargetFromRaycast(new Qr(i, n)), this.setCameraTargetPosition(i);
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(t, i = !1) {
61457
61468
  var n, r;
61458
- t && (t instanceof me && (t = Ft(t)), this._cameraEndPosition || (this._cameraEndPosition = new w()), this._cameraEndPosition.copy(t), i === !0 ? (this._cameraLerpActive = !1, (n = this.controllerObject) == null || n.position.copy(this._cameraEndPosition)) : this._cameraObject && (this._cameraLerpActive = !0, this._cameraLerp01 = 0, this._cameraStartPosition.copy((r = this._cameraObject) == null ? void 0 : r.position), typeof i == "number" ? this._cameraLerpDuration = i : this._cameraLerpDuration = this.targetLerpDuration));
61469
+ t && (t instanceof me && (t = Nt(t)), this._cameraEndPosition || (this._cameraEndPosition = new w()), this._cameraEndPosition.copy(t), i === !0 ? (this._cameraLerpActive = !1, (n = this.controllerObject) == null || n.position.copy(this._cameraEndPosition)) : this._cameraObject && (this._cameraLerpActive = !0, this._cameraLerp01 = 0, this._cameraStartPosition.copy((r = this._cameraObject) == null ? void 0 : r.position), typeof i == "number" ? this._cameraLerpDuration = i : 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 Ei extends Te {
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(t = null, i = !1) {
61470
- this._controls && t && (t instanceof me && (t = Ft(t)), this._lookTargetEndPosition.copy(t), i === !0 ? this._controls.target.copy(this._lookTargetEndPosition) : (this._lookTargetLerpActive = !0, this._lookTargetLerp01 = 0, this._lookTargetStartPosition.copy(this._controls.target), typeof i == "number" ? this._lookTargetLerpDuration = i : this._lookTargetLerpDuration = this.targetLerpDuration));
61484
+ this._controls && t && (t instanceof me && (t = Nt(t)), this._lookTargetEndPosition.copy(t), i === !0 ? this._controls.target.copy(this._lookTargetEndPosition) : (this._lookTargetLerpActive = !0, this._lookTargetLerp01 = 0, this._lookTargetStartPosition.copy(this._controls.target), typeof i == "number" ? this._lookTargetLerpDuration = i : 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 Ei extends Te {
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(t = 0, i = 1) {
61482
61499
  var r;
61483
61500
  if (!this._controls)
@@ -61498,22 +61515,18 @@ class Ei extends Te {
61498
61515
  this._controls && (i >= 1 ? this._controls.target.copy(t) : this._controls.target.lerp(t, i));
61499
61516
  }
61500
61517
  setTargetFromRaycast(t) {
61501
- var n, r;
61502
61518
  if (!this.controls)
61503
61519
  return;
61504
61520
  const i = t ? this.context.physics.raycastFromRay(t) : this.context.physics.raycast();
61505
- for (const o of i)
61506
- if (o.distance > 0 && oe.isActiveInHierarchy(o.object)) {
61507
- const a = xI(o.object);
61508
- if (a) {
61509
- const l = a.canvas;
61510
- if (l != null && l.screenspace)
61521
+ for (const n of i)
61522
+ if (n.distance > 0 && oe.isActiveInHierarchy(n.object)) {
61523
+ const r = xI(n.object);
61524
+ if (r) {
61525
+ const o = r.canvas;
61526
+ if (o != null && o.screenspace)
61511
61527
  break;
61512
61528
  }
61513
- if (this.setLookTargetPosition(o.point), this.context.mainCamera) {
61514
- const c = Ft(this.context.mainCamera).clone().sub(this.controls.target).add(this._lookTargetEndPosition);
61515
- (r = (n = this._cameraObject) == null ? void 0 : n.parent) == null || r.worldToLocal(c), this.setCameraTargetPosition(c);
61516
- }
61529
+ this.setLookTargetPosition(n.point);
61517
61530
  break;
61518
61531
  }
61519
61532
  }
@@ -61577,7 +61590,7 @@ class Ei extends Te {
61577
61590
  Sm && console.log("Fit camera to objects", A, g, "distance", v), o.maxDistance = v * 10, o.minDistance = v * 0.01;
61578
61591
  const _ = 0.05, y = l.clone();
61579
61592
  y.y -= a.y * _, this.setLookTargetPosition(y, n), this.autoTarget = !1, r.near = v / 1e3, r.far = v * 100, r.updateMatrixWorld(), r.updateProjectionMatrix();
61580
- const b = Ft(r), M = l.clone();
61593
+ const b = Nt(r), M = l.clone();
61581
61594
  if (M.sub(b), M.y = 0, M.normalize(), M.multiplyScalar(v), M.y += -_ * 4 * a.y, r.parent) {
61582
61595
  const E = r.parent.worldToLocal(l.clone().sub(M));
61583
61596
  this.setCameraTargetPosition(E, n);
@@ -61793,7 +61806,7 @@ const Zm = (A0 = class extends Te {
61793
61806
  screenPointToRay(e, t, i) {
61794
61807
  const n = this.cam, r = Zm._origin;
61795
61808
  r.set(e, t, -1), this.context.input.convertScreenspaceToRaycastSpace(r), UD && console.log("screenPointToRay", e.toFixed(2), t.toFixed(2), "now:", r.x.toFixed(2), r.y.toFixed(2), "isInXR:" + this.context.isInXR), r.z = -1, r.unproject(n);
61796
- const o = Zm._direction.set(r.x, r.y, r.z), a = Ft(n);
61809
+ const o = Zm._direction.set(r.x, r.y, r.z), a = Nt(n);
61797
61810
  return o.sub(a), o.normalize(), i ? (i.set(a, o), i) : new Qr(a.clone(), o.clone());
61798
61811
  }
61799
61812
  getFrustum() {
@@ -63046,7 +63059,7 @@ class ede {
63046
63059
  h(this, "_context");
63047
63060
  }
63048
63061
  get context() {
63049
- return this._context ?? Ut.Current;
63062
+ return this._context ?? Ft.Current;
63050
63063
  }
63051
63064
  get isStateMachineBehaviour() {
63052
63065
  return !0;
@@ -64290,7 +64303,7 @@ var eie = Object.defineProperty, tie = Object.getOwnPropertyDescriptor, Az = (s,
64290
64303
  return i && n && eie(e, t, n), n;
64291
64304
  };
64292
64305
  const GD = ne("debugpost");
64293
- class Nt {
64306
+ class Ut {
64294
64307
  constructor(e) {
64295
64308
  h(this, "_active", !0);
64296
64309
  h(this, "_value");
@@ -64345,10 +64358,10 @@ class Nt {
64345
64358
  }
64346
64359
  Az([
64347
64360
  x()
64348
- ], Nt.prototype, "overrideState", 1);
64361
+ ], Ut.prototype, "overrideState", 1);
64349
64362
  Az([
64350
64363
  x()
64351
- ], Nt.prototype, "value", 1);
64364
+ ], Ut.prototype, "value", 1);
64352
64365
  var iie = Object.defineProperty, nie = Object.getOwnPropertyDescriptor, sie = (s, e, t, i) => {
64353
64366
  for (var n = i > 1 ? void 0 : i ? nie(e, t) : e, r = s.length - 1, o; r >= 0; r--)
64354
64367
  (o = s[r]) && (n = (i ? o(e, t, n) : o(n)) || n);
@@ -64366,7 +64379,7 @@ class Ir extends Te {
64366
64379
  this.ensureVolumeParameters();
64367
64380
  for (const i of Object.keys(t)) {
64368
64381
  const n = t[i], r = this[i];
64369
- r instanceof Nt && (r.value = n);
64382
+ r instanceof Ut && (r.value = n);
64370
64383
  }
64371
64384
  }
64372
64385
  }
@@ -64394,7 +64407,7 @@ class Ir extends Te {
64394
64407
  const t = Object.keys(this);
64395
64408
  for (const i of t) {
64396
64409
  const n = this[i];
64397
- n instanceof Nt && n.__init();
64410
+ n instanceof Ut && n.__init();
64398
64411
  }
64399
64412
  }
64400
64413
  onAfterDeserialize(t, i) {
@@ -64402,7 +64415,7 @@ class Ir extends Te {
64402
64415
  const n = this.$serializedTypes;
64403
64416
  if (n) {
64404
64417
  for (const r of Object.keys(n))
64405
- if (n[r] === Nt) {
64418
+ if (n[r] === Ut) {
64406
64419
  const a = t[r];
64407
64420
  if (a !== void 0) {
64408
64421
  const l = this[r];
@@ -64416,7 +64429,7 @@ class Ir extends Te {
64416
64429
  // since these handle that already.
64417
64430
  onEditorModification(t) {
64418
64431
  const i = t.propertyName;
64419
- if (this[i] instanceof Nt) {
64432
+ if (this[i] instanceof Ut) {
64420
64433
  const n = t.value;
64421
64434
  return this[i].value = n, !0;
64422
64435
  }
@@ -64429,7 +64442,7 @@ class Ir extends Te {
64429
64442
  const t = this.$serializedTypes;
64430
64443
  if (t)
64431
64444
  for (const i of Object.keys(t))
64432
- t[i] === Nt && (this[i] || (this[i] = new Nt()));
64445
+ t[i] === Ut && (this[i] || (this[i] = new Ut()));
64433
64446
  }
64434
64447
  }
64435
64448
  sie([
@@ -64484,7 +64497,7 @@ class Dx extends Ir {
64484
64497
  }
64485
64498
  }
64486
64499
  fie([
64487
- x(Nt)
64500
+ x(Ut)
64488
64501
  ], Dx.prototype, "preset", 2);
64489
64502
  Ea("Antialiasing", Dx);
64490
64503
  const pie = ne("debugusdz");
@@ -65108,7 +65121,7 @@ class oc {
65108
65121
  if (t) {
65109
65122
  for (const n of this.Pois)
65110
65123
  if (n.obj === t) {
65111
- this.Pois.splice(this.Pois.indexOf(n), 1), this.LastChangeTime = (e == null ? void 0 : e.time.time) ?? ((i = Ut.Current) == null ? void 0 : i.time.time);
65124
+ this.Pois.splice(this.Pois.indexOf(n), 1), this.LastChangeTime = (e == null ? void 0 : e.time.time) ?? ((i = Ft.Current) == null ? void 0 : i.time.time);
65112
65125
  return;
65113
65126
  }
65114
65127
  }
@@ -65155,7 +65168,7 @@ class Y_ extends Te {
65155
65168
  update() {
65156
65169
  var i;
65157
65170
  if ((!this.context.connection.isConnected || (i = this._model) != null && i.hasOwnership) && (oc.LastChangeTime !== this._lastPoiChangedTime && (this._lastPoiChangedTime = oc.LastChangeTime, this._lookDuration = 0), this.selectTarget(), this._currentTargetObject && this.context.time.frameCount % 10 === 0 && this.target)) {
65158
- const n = Ft(this._currentTargetObject);
65171
+ const n = Nt(this._currentTargetObject);
65159
65172
  Mr(this.target, n), 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(n));
65160
65173
  }
65161
65174
  }
@@ -65735,9 +65748,9 @@ const Sz = (jC = class extends Te {
65735
65748
  if (e && this.head) {
65736
65749
  const t = this.eyes;
65737
65750
  if (t) {
65738
- const i = Ft(e);
65751
+ const i = Nt(e);
65739
65752
  this.currentTargetPoint.lerp(i, this.context.time.deltaTime / 0.1);
65740
- const n = Ft(this.head), r = this.vec.copy(this.currentTargetPoint).sub(n).normalize();
65753
+ const n = Nt(this.head), r = this.vec.copy(this.currentTargetPoint).sub(n).normalize();
65741
65754
  if (r.length() < 0.1)
65742
65755
  return;
65743
65756
  const o = Sz.forward;
@@ -65914,11 +65927,11 @@ class Ez extends Te {
65914
65927
  update() {
65915
65928
  if (!this.from || !this.to || !this.hint)
65916
65929
  return;
65917
- const t = Ft(this.to).clone(), i = Ft(this.from).clone(), n = t.distanceTo(i), r = t.clone();
65930
+ const t = Nt(this.to).clone(), i = Nt(this.from).clone(), n = t.distanceTo(i), r = t.clone();
65918
65931
  r.sub(i);
65919
65932
  const o = i.clone();
65920
65933
  o.add(t), o.multiplyScalar(0.5);
65921
- const a = Ft(this.hint).clone();
65934
+ const a = Nt(this.hint).clone();
65922
65935
  a.sub(o);
65923
65936
  const l = new w();
65924
65937
  l.crossVectors(a, r), l.crossVectors(r, l), l.normalize();
@@ -66056,13 +66069,13 @@ const Mz = (WC = class extends Ir {
66056
66069
  h(WC, "useSelectiveBloom", !1), WC);
66057
66070
  let Tp = Mz;
66058
66071
  BI([
66059
- x(Nt)
66072
+ x(Ut)
66060
66073
  ], Tp.prototype, "threshold", 2);
66061
66074
  BI([
66062
- x(Nt)
66075
+ x(Ut)
66063
66076
  ], Tp.prototype, "intensity", 2);
66064
66077
  BI([
66065
- x(Nt)
66078
+ x(Ut)
66066
66079
  ], Tp.prototype, "scatter", 2);
66067
66080
  Ea("Bloom", Tp);
66068
66081
  const Mm = "NEEDLE_progressive", Vs = ne("debugprogressive"), aC = Symbol("needle-progressive-texture"), kf = /* @__PURE__ */ new Map();
@@ -66290,7 +66303,7 @@ const kr = class {
66290
66303
  const f = Array.isArray(l.lods) ? l.lods[n].path : l.lods;
66291
66304
  if (!f)
66292
66305
  return Vs && !l["missing:uri"] && (l["missing:uri"] = !0, console.warn("Missing uri for progressive asset for LOD " + n, l)), null;
66293
- const p = Eh(t, f);
66306
+ let p = Eh(t, f);
66294
66307
  if (p.endsWith(".glb") || p.endsWith(".gltf")) {
66295
66308
  if (!l.guid)
66296
66309
  return console.warn("missing pointer for glb/gltf texture", l), null;
@@ -66304,7 +66317,11 @@ const kr = class {
66304
66317
  }
66305
66318
  const g = l, v = new Promise(async (y, b) => {
66306
66319
  const M = new vp();
66307
- zv(M, e), Vs && (await ll(Math.random() * 1e3), r && console.warn("Start loading (delayed) " + p, g.guid));
66320
+ if (zv(M, e), l && Array.isArray(l.lods)) {
66321
+ const P = l.lods[n];
66322
+ P.hash && (p += "?v=" + P.hash);
66323
+ }
66324
+ Vs && (await ll(Math.random() * 1e3), r && console.warn("Start loading (delayed) " + p, g.guid));
66308
66325
  const E = await M.loadAsync(p).catch((P) => (console.error(`Error loading LOD ${n} from ${p}
66309
66326
  `, P), null));
66310
66327
  if (!E)
@@ -66705,7 +66722,7 @@ const nne = ne("gizmos"), sne = ne("debugboxhelper"), Io = class extends Te {
66705
66722
  for (let o = 0; o < t.children.length; o++)
66706
66723
  t.children[o].type === "Mesh" && Io.testBox.expandByObject(t);
66707
66724
  } else {
66708
- const o = Ft(t, Io._position), a = Zi(t, Io._size);
66725
+ const o = Nt(t, Io._position), a = Zi(t, Io._size);
66709
66726
  i !== void 0 && a.multiplyScalar(i), Io.testBox.setFromCenterAndSize(o, a);
66710
66727
  }
66711
66728
  this.updateBox();
@@ -66719,7 +66736,7 @@ const nne = ne("gizmos"), sne = ne("debugboxhelper"), Io = class extends Te {
66719
66736
  if (this.box || (this.box = new Ai()), t || this.context.time.frameCount != this._lastMatrixUpdateFrame) {
66720
66737
  const i = this._lastMatrixUpdateFrame < 0;
66721
66738
  this._lastMatrixUpdateFrame = this.context.time.frameCount;
66722
- const n = i, r = Ft(this.gameObject, Io._position, n), o = Zi(this.gameObject, Io._size);
66739
+ const n = i, r = Nt(this.gameObject, Io._position, n), o = Zi(this.gameObject, Io._size);
66723
66740
  this.box.setFromCenterAndSize(r, o);
66724
66741
  }
66725
66742
  return this.box;
@@ -67945,7 +67962,7 @@ class Bp extends Te {
67945
67962
  *moveToTarget() {
67946
67963
  if (!this.target || !this.object)
67947
67964
  return;
67948
- const t = Ft(this.object).clone(), i = Ft(this.target).clone(), n = Ri(this.object).clone(), r = Ri(this.target).clone(), o = Zi(this.object).clone(), a = Zi(this.target).clone(), l = t.distanceTo(i), c = n.angleTo(r), u = o.distanceTo(a);
67965
+ const t = Nt(this.object).clone(), i = Nt(this.target).clone(), n = Ri(this.object).clone(), r = Ri(this.target).clone(), o = Zi(this.object).clone(), a = Zi(this.target).clone(), l = t.distanceTo(i), c = n.angleTo(r), u = o.distanceTo(a);
67949
67966
  if (l < 0.01 && c < 0.01 && u < 0.01) {
67950
67967
  Mr(this.object, i), Aa(this.object, r), M_(this.object, a), this.coroutine = null;
67951
67968
  return;
@@ -68624,7 +68641,7 @@ class Ph extends Te {
68624
68641
  if (this.controller) {
68625
68642
  const g = (p = this.controller) == null ? void 0 : p.rigidbody.getVelocity().y;
68626
68643
  if (g < -1) {
68627
- this._raycastOptions.ray || (this._raycastOptions.ray = new Qr()), this._raycastOptions.ray.origin.copy(Ft(this.gameObject)), this._raycastOptions.ray.direction.set(0, -1, 0);
68644
+ this._raycastOptions.ray || (this._raycastOptions.ray = new Qr()), this._raycastOptions.ray.origin.copy(Nt(this.gameObject)), this._raycastOptions.ray.direction.set(0, -1, 0);
68628
68645
  const v = this.layer;
68629
68646
  this.gameObject.layers.disableAll(), this.gameObject.layers.set(2);
68630
68647
  const _ = this.context.physics.raycast(this._raycastOptions);
@@ -68676,7 +68693,7 @@ class Hx extends Ir {
68676
68693
  }
68677
68694
  }
68678
68695
  Ine([
68679
- x(Nt)
68696
+ x(Ut)
68680
68697
  ], Hx.prototype, "intensity", 2);
68681
68698
  Ea("ChromaticAberration", Hx);
68682
68699
  const hA = new At();
@@ -70201,14 +70218,14 @@ class Qx extends Te {
70201
70218
  Yy.set(o, c);
70202
70219
  const u = Object.keys(l);
70203
70220
  for (const d of u)
70204
- l[d] instanceof Nt && c.push(d);
70221
+ l[d] instanceof Ut && c.push(d);
70205
70222
  }
70206
70223
  if (Yy.has(o)) {
70207
70224
  const c = a.toLowerCase(), u = Yy.get(o);
70208
70225
  for (const d of u)
70209
70226
  if (d.toLowerCase() === c) {
70210
70227
  const f = l[d];
70211
- f instanceof Nt && (r.length === 4 && r[3] === "active" ? (f.overrideState = t.value, this.scheduleRecreate()) : f && f.value !== void 0 && (f.value = t.value));
70228
+ f instanceof Ut && (r.length === 4 && r[3] === "active" ? (f.overrideState = t.value, this.scheduleRecreate()) : f && f.value !== void 0 && (f.value = t.value));
70212
70229
  return;
70213
70230
  }
70214
70231
  }
@@ -70309,16 +70326,16 @@ class ld extends Ir {
70309
70326
  // }
70310
70327
  }
70311
70328
  Vx([
70312
- x(Nt)
70329
+ x(Ut)
70313
70330
  ], ld.prototype, "postExposure", 2);
70314
70331
  Vx([
70315
- x(Nt)
70332
+ x(Ut)
70316
70333
  ], ld.prototype, "contrast", 2);
70317
70334
  Vx([
70318
- x(Nt)
70335
+ x(Ut)
70319
70336
  ], ld.prototype, "hueShift", 2);
70320
70337
  Vx([
70321
- x(Nt)
70338
+ x(Ut)
70322
70339
  ], ld.prototype, "saturation", 2);
70323
70340
  Ea("ColorAdjustments", ld);
70324
70341
  const Gne = (Math.sqrt(5) - 1) / 4, ps = (5 - Math.sqrt(5)) / 20, Jy = (s) => Math.floor(s) | 0, Ky = /* @__PURE__ */ new Float64Array([
@@ -71095,7 +71112,7 @@ const Yi = class extends Lv {
71095
71112
  h(this, "_viewProjectionName", "hlslcc_mtx4x4unity_MatrixVP");
71096
71113
  h(this, "_viewMatrixName", "hlslcc_mtx4x4unity_MatrixV");
71097
71114
  h(this, "_rendererData", new ose());
71098
- this.identifier = t, Kc && 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) && Ut.Current.pre_render_callbacks.push(this.onBeforeRenderSceneCallback);
71115
+ this.identifier = t, Kc && 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) && Ft.Current.pre_render_callbacks.push(this.onBeforeRenderSceneCallback);
71099
71116
  }
71100
71117
  clone() {
71101
71118
  const t = super.clone();
@@ -71103,8 +71120,8 @@ const Yi = class extends Lv {
71103
71120
  }
71104
71121
  dispose() {
71105
71122
  super.dispose();
71106
- const t = Ut.Current.pre_render_callbacks.indexOf(this.onBeforeRenderSceneCallback);
71107
- t >= 0 && Ut.Current.pre_render_callbacks.splice(t, 1);
71123
+ const t = Ft.Current.pre_render_callbacks.indexOf(this.onBeforeRenderSceneCallback);
71124
+ t >= 0 && Ft.Current.pre_render_callbacks.splice(t, 1);
71108
71125
  }
71109
71126
  get depthTextureUniform() {
71110
71127
  if (this.uniforms)
@@ -71115,13 +71132,13 @@ const Yi = class extends Lv {
71115
71132
  return this.uniforms._CameraOpaqueTexture;
71116
71133
  }
71117
71134
  onBeforeRenderScene() {
71118
- this.opaqueTextureUniform && Ut.Current.setRequireColor(!0), this.depthTextureUniform && Ut.Current.setRequireDepth(!0);
71135
+ this.opaqueTextureUniform && Ft.Current.setRequireColor(!0), this.depthTextureUniform && Ft.Current.setRequireDepth(!0);
71119
71136
  }
71120
71137
  onBeforeRender(t, i, n, r, o, a) {
71121
71138
  r.attributes.tangent || r.computeTangents(), this.onUpdateUniforms(n, o);
71122
71139
  }
71123
71140
  onUpdateUniforms(t, i) {
71124
- const n = Ut.Current;
71141
+ const n = Ft.Current;
71125
71142
  if (t && (Yi.viewProjection && this.uniforms[this._viewProjectionName] && (Yi.viewProjection.copy(t.projectionMatrix).multiply(t.matrixWorldInverse), z_(Yi.viewProjection, Yi._viewProjectionValues)), Yi.viewMatrix && this.uniforms[this._viewMatrixName] && (Yi.viewMatrix.copy(t.matrixWorldInverse), z_(Yi.viewMatrix, Yi._viewMatrixValues)), this.uniforms[Yi._worldSpaceCameraPosName] && Yi._worldSpaceCameraPos.setFromMatrixPosition(t.matrixWorld)), this.uniforms._TimeParameters && (this.uniforms._TimeParameters.value = n.sceneLighting.timeVec4), this.uniforms._Time) {
71126
71143
  const l = this.uniforms._Time.value;
71127
71144
  l.x = n.sceneLighting.timeVec4.x / 20, l.y = n.sceneLighting.timeVec4.x, l.z = n.sceneLighting.timeVec4.x * 2, l.w = n.sceneLighting.timeVec4.x * 3;
@@ -71140,7 +71157,7 @@ const Yi = class extends Lv {
71140
71157
  }
71141
71158
  const r = n.mainLight;
71142
71159
  if (r) {
71143
- const l = Ft(r.gameObject, Yi._mainLightPosition);
71160
+ const l = Nt(r.gameObject, Yi._mainLightPosition);
71144
71161
  this.uniforms._MainLightPosition = { value: l.normalize() }, Yi._mainLightColor.set(r.color.r, r.color.g, r.color.b, 0), this.uniforms._MainLightColor = { value: Yi._mainLightColor };
71145
71162
  const c = r.intensity;
71146
71163
  Yi._lightData.z = c, this.uniforms.unity_LightData = { value: Yi._lightData };
@@ -72285,7 +72302,7 @@ Texture LODs available? ${this.hasTextureLODs ? "YES" : "NO"}`);
72285
72302
  }
72286
72303
  const p = c.geometry.boundingBox;
72287
72304
  if (p && this.context.mainCamera instanceof Gt) {
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(Ft(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(Nt(this.context.mainCamera)))) {
72289
72306
  o = 0;
72290
72307
  break;
72291
72308
  }
@@ -75544,7 +75561,7 @@ class gl extends Ir {
75544
75561
  const t = 1 / window.devicePixelRatio;
75545
75562
  if (this.resolutionScale === void 0) {
75546
75563
  let n = 1;
75547
- Xo() && (n = 0.6), this.resolutionScale = new Nt(n * t);
75564
+ Xo() && (n = 0.6), this.resolutionScale = new Ut(n * t);
75548
75565
  }
75549
75566
  const i = new NN(this.context.mainCamera, {
75550
75567
  worldFocusRange: 0.2,
@@ -75563,22 +75580,22 @@ pd([
75563
75580
  x()
75564
75581
  ], gl.prototype, "mode", 2);
75565
75582
  pd([
75566
- x(Nt)
75583
+ x(Ut)
75567
75584
  ], gl.prototype, "focusDistance", 2);
75568
75585
  pd([
75569
- x(Nt)
75586
+ x(Ut)
75570
75587
  ], gl.prototype, "focalLength", 2);
75571
75588
  pd([
75572
- x(Nt)
75589
+ x(Ut)
75573
75590
  ], gl.prototype, "aperture", 2);
75574
75591
  pd([
75575
- x(Nt)
75592
+ x(Ut)
75576
75593
  ], gl.prototype, "gaussianMaxRadius", 2);
75577
75594
  pd([
75578
- x(Nt)
75595
+ x(Ut)
75579
75596
  ], gl.prototype, "resolutionScale", 2);
75580
75597
  pd([
75581
- x(Nt)
75598
+ x(Ut)
75582
75599
  ], gl.prototype, "bokehScale", 2);
75583
75600
  Ea("DepthOfField", gl);
75584
75601
  var Fse = Object.defineProperty, Use = Object.getOwnPropertyDescriptor, Nse = (s, e, t, i) => {
@@ -76095,17 +76112,17 @@ const DR = class {
76095
76112
  onUpdate(e) {
76096
76113
  if (!this._selected)
76097
76114
  return;
76098
- const t = Ft(this._selected);
76115
+ const t = Nt(this._selected);
76099
76116
  this.onUpdateWorldPosition(t, this._groundPlanePoint, !1), this.onUpdateGroundPlane(), this._didDragOnGroundPlaneLastFrame = !0, this._hasGroundPlane = !0;
76100
76117
  }
76101
76118
  onUpdateWorldPosition(e, t, i) {
76102
76119
  if (this._selected) {
76103
76120
  if (i) {
76104
- const n = Ft(this._selected);
76121
+ const n = Nt(this._selected);
76105
76122
  n.y = e.y, e = n;
76106
76123
  }
76107
76124
  if (Mr(this._selected, e), Mr(this._groundLine, e), this._hasGroundPlane ? this._groundLine.scale.y = this._groundDistance : this._groundLine.scale.y = 1e3, this._groundLine.visible = this.showGizmo, this._groundMarker.visible = t !== null && this.showGizmo, t) {
76108
- const n = Ft(this._camera).distanceTo(t) * 0.01;
76125
+ const n = Nt(this._camera).distanceTo(t) * 0.01;
76109
76126
  this._groundMarker.scale.set(n, n, n), Mr(this._groundMarker, t);
76110
76127
  }
76111
76128
  }
@@ -76119,7 +76136,7 @@ const DR = class {
76119
76136
  onUpdateGroundPlane() {
76120
76137
  if (!this._selected || !this._context)
76121
76138
  return;
76122
- const e = Ft(this._selected), t = new Qr(new w(0, 0.1, 0).add(e), new w(0, -1, 0)), i = new ya();
76139
+ const e = Nt(this._selected), t = new Qr(new w(0, 0.1, 0).add(e), new w(0, -1, 0)), i = new ya();
76123
76140
  i.ignore = [this._selected];
76124
76141
  const n = this._context.physics.raycastFromRay(t, i);
76125
76142
  for (let r = 0; r < n.length; r++) {
@@ -78200,7 +78217,7 @@ const ff = class extends Te {
78200
78217
  static calculateCenter(e, t) {
78201
78218
  const i = t || new w();
78202
78219
  return i.set(0, 0, 0), e.forEach((n) => {
78203
- i.add(Ft(n));
78220
+ i.add(Nt(n));
78204
78221
  }), console.log(i), i.divideScalar(e.length), i;
78205
78222
  }
78206
78223
  static filterTopmostParent(e) {
@@ -79045,11 +79062,11 @@ class Qp extends Te {
79045
79062
  update() {
79046
79063
  if (!this.from)
79047
79064
  return;
79048
- var t = Ft(this.from), i = Ri(this.from);
79065
+ var t = Nt(this.from), i = Ri(this.from);
79049
79066
  this.offset.copy(this.positionOffset);
79050
79067
  const n = this.offset.length();
79051
79068
  if (this.referenceSpace && this.offset.transformDirection(this.referenceSpace.matrixWorld).multiplyScalar(n), t.add(this.offset), this.levelPosition && this.referenceSpace) {
79052
- const l = new Ar(this.gameObject.up, 0), c = Ft(this.referenceSpace);
79069
+ const l = new Ar(this.gameObject.up, 0), c = Nt(this.referenceSpace);
79053
79070
  l.setFromNormalAndCoplanarPoint(this.gameObject.up, c);
79054
79071
  const u = new w(0, 0, 0);
79055
79072
  l.projectPoint(t, u), t.copy(u);
@@ -83797,7 +83814,7 @@ class Bae extends oR {
83797
83814
  h(this, "_lastDistance", 0);
83798
83815
  }
83799
83816
  update() {
83800
- const t = Ft(this.system.gameObject);
83817
+ const t = Nt(this.system.gameObject);
83801
83818
  this._lastDistance = this._lastPosition.distanceTo(t), this._lastPosition.copy(t);
83802
83819
  }
83803
83820
  genValue() {
@@ -84243,7 +84260,7 @@ const Z0 = class extends Te {
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, Ft(this.gameObject, this._worldPos)), this._worldPos;
84263
+ return this._worldPositionFrame !== this.context.time.frame && (this._worldPositionFrame = this.context.time.frame, Nt(this.gameObject, this._worldPos)), this._worldPos;
84247
84264
  }
84248
84265
  get matrixWorld() {
84249
84266
  return this._container.matrixWorld;
@@ -84251,12 +84268,34 @@ const Z0 = class extends Te {
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(e) {
84258
84290
  return this._particleSystem ? (e instanceof gd && (e.system = this), vt() && console.log("add behaviour", e), this._particleSystem.addBehavior(e), !0) : !1;
84259
84291
  }
84292
+ /** Remove a custom quarks behaviour from the particle system. **/
84293
+ removeBehaviour(e) {
84294
+ if (!this._particleSystem)
84295
+ return !1;
84296
+ const t = this._particleSystem.behaviors, i = t.indexOf(e);
84297
+ return i !== -1 && t.splice(i, 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 Z0 = class extends Te {
84295
84334
  }
84296
84335
  ng && e.length > 0 && console.log("SubEmitters: ", e, this), this._subEmitterSystems = e;
84297
84336
  }
84337
+ /** @internal */
84298
84338
  onAfterDeserialize(e) {
84299
84339
  if (this._subEmitterSystems && Array.isArray(this._subEmitterSystems))
84300
84340
  for (const t of this._subEmitterSystems)
84301
84341
  t._deserialize(this.context, this.gameObject);
84302
84342
  }
84343
+ /** @internal */
84303
84344
  awake() {
84304
84345
  if (this._worldPositionFrame = -1, this._renderer = this.gameObject.getComponent(Ta), !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 Z0 = class extends Te {
84307
84348
  const e = this._particleSystem.emitter;
84308
84349
  this.context.scene.add(e), this.inheritVelocity.system && this.inheritVelocity.system !== this && (this.inheritVelocity = this.inheritVelocity.clone()), this.inheritVelocity.awake(this), ng && (console.log(this), this.gameObject.add(new jo(1)));
84309
84350
  }
84351
+ /** @internal */
84310
84352
  start() {
84311
84353
  this.addSubParticleSystems(), this.updateLayers();
84312
84354
  }
84355
+ /** @internal */
84313
84356
  onDestroy() {
84314
84357
  var e, t, i, n;
84315
84358
  (e = this._container) == null || e.removeFromParent(), (t = this._batchSystem) == null || t.removeFromParent(), (i = this._particleSystem) == null || i.emitter.removeFromParent(), (n = this._particleSystem) == null || n.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 e;
84325
84370
  this.main && (this._didPreWarm === !1 && ((e = this.main) == null ? void 0 : e.prewarm) === !0 && (this._didPreWarm = !0, this.preWarm()), this.onUpdate(), this.onSimulate(this.deltaTime));
@@ -84556,7 +84601,7 @@ class hw extends Ir {
84556
84601
  }
84557
84602
  }
84558
84603
  jae([
84559
- x(Nt)
84604
+ x(Ut)
84560
84605
  ], hw.prototype, "granularity", 2);
84561
84606
  Ea("PixelationEffect", hw);
84562
84607
  class xv extends Te {
@@ -85044,6 +85089,7 @@ class Rr extends Te {
85044
85089
  }
85045
85090
  return t.uri === this.sourceId ? (console.warn("SceneSwitcher: can't load own scene - prevent recursive loading", this.sourceId), !1) : this.__lastSwitchScene === t && this.__lastSwitchScenePromise ? this.__lastSwitchScenePromise : (this.__lastSwitchScene = t, this.__lastSwitchScenePromise = this.__internalSwitchScene(t), await this.__lastSwitchScenePromise);
85046
85091
  }
85092
+ /** @internal */
85047
85093
  async __internalSwitchScene(t) {
85048
85094
  var n, r;
85049
85095
  if (this._currentScene) {
@@ -85136,6 +85182,13 @@ class Rr extends Te {
85136
85182
  o instanceof Promise && await o;
85137
85183
  }
85138
85184
  }
85185
+ if (this._isCurrentlyLoading) {
85186
+ const n = this.tryGetSceneEventListener(this.gameObject);
85187
+ if (n && n.sceneOpened) {
85188
+ const r = n.sceneOpened(this);
85189
+ r instanceof Promise && await r;
85190
+ }
85191
+ }
85139
85192
  }
85140
85193
  async onEndLoading() {
85141
85194
  var t;
@@ -85148,6 +85201,13 @@ class Rr extends Te {
85148
85201
  }
85149
85202
  oe.remove(i);
85150
85203
  }
85204
+ if (!this._isCurrentlyLoading) {
85205
+ const i = this.tryGetSceneEventListener(this.gameObject);
85206
+ if (i && i.sceneClosing) {
85207
+ const n = i.sceneClosing();
85208
+ n instanceof Promise && await n;
85209
+ }
85210
+ }
85151
85211
  }
85152
85212
  tryGetSceneEventListener(t, i = 0) {
85153
85213
  const n = oe.foreachComponent(t, (r) => r.sceneClosing ? r : void 0);
@@ -85292,7 +85352,7 @@ class hs extends Te {
85292
85352
  h(this, "aspectMode", 0);
85293
85353
  h(this, "clip", null);
85294
85354
  h(this, "source", 1);
85295
- h(this, "url", null);
85355
+ h(this, "_url", null);
85296
85356
  h(this, "renderMode");
85297
85357
  h(this, "targetMaterialProperty");
85298
85358
  h(this, "targetMaterialRenderer");
@@ -85327,7 +85387,7 @@ class hs extends Te {
85327
85387
  h(this, "_hls");
85328
85388
  h(this, "onHlsAvailable", () => {
85329
85389
  var t;
85330
- is && 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), (t = this._videoElement) == null || t.play(), is && console.log("HLS: loaded", this.clip));
85390
+ is && 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), (t = this._videoElement) == null || t.play(), is && console.log("HLS: loaded", this.clip));
85331
85391
  });
85332
85392
  tle(() => {
85333
85393
  this._receivedInput = !0, this.updateVideoElementSettings();
@@ -85335,6 +85395,13 @@ class hs extends Te {
85335
85395
  t.key === "f" && (this.screenspace = !this.screenspace);
85336
85396
  });
85337
85397
  }
85398
+ get url() {
85399
+ return this._url;
85400
+ }
85401
+ set url(t) {
85402
+ const n = this._url !== t;
85403
+ this.__didAwake ? n && this.setClipURL(t ?? "") : this._url = t;
85404
+ }
85338
85405
  get playbackSpeed() {
85339
85406
  var t;
85340
85407
  return ((t = this._videoElement) == null ? void 0 : t.playbackRate) ?? this._playbackSpeed;
@@ -85412,7 +85479,7 @@ class hs extends Te {
85412
85479
  this.clip = t, this.source = 0, this._videoElement ? (this._videoElement.srcObject = t, this._isPlaying && this.play(), this.updateAspect()) : this.create(this.playOnAwake);
85413
85480
  }
85414
85481
  setClipURL(t) {
85415
- this.url !== t && (this.url = t, this.source = 1, is && console.log("set url", t), this._videoElement ? t.endsWith(".m3u8") ? this.ensureM3U8CanBePlayed() : (this._videoElement.src = t, this._isPlaying && (this.stop(), this.play())) : this.create(this.playOnAwake));
85482
+ this._url !== t && (this._url = t, this.source = 1, is && console.log("set url", t), this._videoElement ? t.endsWith(".m3u8") || t.includes(".m3u") ? this.ensureM3UCanBePlayed() : (this._videoElement.src = t, this._isPlaying && (this.stop(), this.play())) : this.create(this.playOnAwake));
85416
85483
  }
85417
85484
  onEnable() {
85418
85485
  var t, i;
@@ -85434,8 +85501,8 @@ class hs extends Te {
85434
85501
  return;
85435
85502
  }
85436
85503
  if (!(this._isPlaying && !((t = this._videoElement) != null && t.ended) && !((i = this._videoElement) != null && i.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
  is && console.log("Video Play()", this.clip, this._videoElement, this.time), this._videoElement.currentTime = this.time, this._videoElement.play().catch((n) => {
@@ -85521,7 +85588,7 @@ class hs extends Te {
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(), t && (this.shouldUseM3U8 && this.ensureM3U8CanBePlayed(), this.play());
85591
+ this.updateVideoElementSettings(), this.updateVideoElementStyles(), t && (this.shouldUseM3U && this.ensureM3UCanBePlayed(), this.play());
85525
85592
  }
85526
85593
  updateVideoElementSettings() {
85527
85594
  if (!this._videoElement)
@@ -85577,11 +85644,11 @@ class hs extends Te {
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 t = document.head.querySelector("script[data-hls_library]");
85587
85654
  t ? globalThis.Hls ? this.onHlsAvailable() : t.addEventListener("load", this.onHlsAvailable) : (is && console.log("HLS: load script"), t = document.createElement("script"), t.dataset.hls_library = "hls.js", t.src = "https://cdn.jsdelivr.net/npm/hls.js@1", t.addEventListener("load", this.onHlsAvailable), document.head.append(t));
@@ -85601,7 +85668,7 @@ bo([
85601
85668
  ], hs.prototype, "source", 2);
85602
85669
  bo([
85603
85670
  x(URL)
85604
- ], hs.prototype, "url", 2);
85671
+ ], hs.prototype, "url", 1);
85605
85672
  bo([
85606
85673
  x()
85607
85674
  ], hs.prototype, "renderMode", 2);
@@ -86118,19 +86185,19 @@ class Dh extends Ir {
86118
86185
  }
86119
86186
  }
86120
86187
  bA([
86121
- x(Nt)
86188
+ x(Ut)
86122
86189
  ], Dh.prototype, "intensity", 2);
86123
86190
  bA([
86124
- x(Nt)
86191
+ x(Ut)
86125
86192
  ], Dh.prototype, "falloff", 2);
86126
86193
  bA([
86127
- x(Nt)
86194
+ x(Ut)
86128
86195
  ], Dh.prototype, "samples", 2);
86129
86196
  bA([
86130
- x(Nt)
86197
+ x(Ut)
86131
86198
  ], Dh.prototype, "color", 2);
86132
86199
  bA([
86133
- x(Nt)
86200
+ x(Ut)
86134
86201
  ], Dh.prototype, "luminanceInfluence", 2);
86135
86202
  Ea("ScreenSpaceAmbientOcclusion", Dh);
86136
86203
  var ule = Object.defineProperty, dle = Object.getOwnPropertyDescriptor, vd = (s, e, t, i) => {
@@ -86181,20 +86248,20 @@ vd([
86181
86248
  x()
86182
86249
  ], Al.prototype, "gammaCorrection", 2);
86183
86250
  vd([
86184
- x(Nt)
86251
+ x(Ut)
86185
86252
  ], Al.prototype, "intensity", 2);
86186
86253
  vd([
86187
- x(Nt)
86254
+ x(Ut)
86188
86255
  ], Al.prototype, "falloff", 2);
86189
86256
  vd([
86190
- x(Nt)
86257
+ x(Ut)
86191
86258
  ], Al.prototype, "aoRadius", 2);
86192
86259
  vd([
86193
86260
  sr(),
86194
86261
  x()
86195
86262
  ], Al.prototype, "screenspaceRadius", 2);
86196
86263
  vd([
86197
- x(Nt)
86264
+ x(Ut)
86198
86265
  ], Al.prototype, "color", 2);
86199
86266
  vd([
86200
86267
  sr(),
@@ -86330,7 +86397,7 @@ const C4 = (KC = class extends Te {
86330
86397
  updateNow(e) {
86331
86398
  if (!(!this.target || this.target === this.gameObject)) {
86332
86399
  if (this.followFactor > 0) {
86333
- const t = Ft(this.target), i = this._firstUpdate || e ? 1 : tt.clamp01(this.context.time.deltaTime * this.followFactor), n = this.worldPosition;
86400
+ const t = Nt(this.target), i = this._firstUpdate || e ? 1 : tt.clamp01(this.context.time.deltaTime * this.followFactor), n = this.worldPosition;
86334
86401
  this.positionAxes & Km.X && (n.x = tt.lerp(n.x, t.x, i)), this.positionAxes & Km.Y && (n.y = tt.lerp(n.y, t.y, i)), this.positionAxes & Km.Z && (n.z = tt.lerp(n.z, t.z, i)), this.worldPosition = n;
86335
86402
  }
86336
86403
  if (this.rotateFactor > 0) {
@@ -87350,7 +87417,7 @@ class Gle {
87350
87417
  $r.clear();
87351
87418
  const i = $r.createString(this.guid), n = $r.createString(this.userId);
87352
87419
  Qa.startSyncedCameraModel($r), Qa.addGuid($r, i), Qa.addUserId($r, n);
87353
- const r = Ft(e), o = ax(e);
87420
+ const r = Nt(e), o = ax(e);
87354
87421
  Qa.addPos($r, Uu.createVec3($r, r.x, r.y, r.z)), Qa.addRot($r, Uu.createVec3($r, o.x, o.y, o.z));
87355
87422
  const a = Qa.endSyncedCameraModel($r);
87356
87423
  $r.finish(a, nb), t.sendBinary($r.asUint8Array());
@@ -87407,7 +87474,7 @@ const rM = ($C = class extends Te {
87407
87474
  if (!this.context.connection.isConnected || this.context.connection.connectionId === null)
87408
87475
  return;
87409
87476
  this._model === null && (this._model = new Gle(this.context.connection.connectionId, this.context.connection.connectionId + "_camera"));
87410
- const t = Ft(e), i = Ri(e);
87477
+ const t = Nt(e), i = Ri(e);
87411
87478
  (t.distanceTo(this._lastWorldPosition) > 1e-3 || i.angleTo(this._lastWorldQuaternion) > 0.01) && (this._needsUpdate = !0), this._lastWorldPosition.copy(t), this._lastWorldQuaternion.copy(i), !((!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(e, this.context.connection), this.context.isInXR || this.context.players.setPlayerView(this.context.connection.connectionId, e, Lu.Browser));
87412
87479
  }
87413
87480
  onReceivedRemoteCameraInfoBin(e) {
@@ -87713,22 +87780,22 @@ class bc extends Ir {
87713
87780
  }
87714
87781
  }
87715
87782
  Xp([
87716
- x(Nt)
87783
+ x(Ut)
87717
87784
  ], bc.prototype, "offset", 2);
87718
87785
  Xp([
87719
- x(Nt)
87786
+ x(Ut)
87720
87787
  ], bc.prototype, "rotation", 2);
87721
87788
  Xp([
87722
- x(Nt)
87789
+ x(Ut)
87723
87790
  ], bc.prototype, "focusArea", 2);
87724
87791
  Xp([
87725
- x(Nt)
87792
+ x(Ut)
87726
87793
  ], bc.prototype, "feather", 2);
87727
87794
  Xp([
87728
- x(Nt)
87795
+ x(Ut)
87729
87796
  ], bc.prototype, "kernelSize", 2);
87730
87797
  Xp([
87731
- x(Nt)
87798
+ x(Ut)
87732
87799
  ], bc.prototype, "resolutionScale", 2);
87733
87800
  Ea("TiltShiftEffect", bc);
87734
87801
  var Xle = Object.defineProperty, Yle = Object.getOwnPropertyDescriptor, Jle = (s, e, t, i) => {
@@ -87748,7 +87815,7 @@ class vw extends Ir {
87748
87815
  return !0;
87749
87816
  }
87750
87817
  init() {
87751
- this.mode || (this.mode = new Nt(Nr)), this.mode.defaultValue = Nr;
87818
+ this.mode || (this.mode = new Ut(Nr)), this.mode.defaultValue = Nr;
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 vw extends Ir {
87770
87837
  }
87771
87838
  }
87772
87839
  Jle([
87773
- x(Nt)
87840
+ x(Ut)
87774
87841
  ], vw.prototype, "mode", 2);
87775
87842
  Ea("Tonemapping", vw);
87776
87843
  var Kle = Object.defineProperty, Zle = Object.getOwnPropertyDescriptor, Aw = (s, e, t, i) => {
@@ -87910,13 +87977,13 @@ class Jp extends Ir {
87910
87977
  }
87911
87978
  }
87912
87979
  dR([
87913
- x(Nt)
87980
+ x(Ut)
87914
87981
  ], Jp.prototype, "color", 2);
87915
87982
  dR([
87916
- x(Nt)
87983
+ x(Ut)
87917
87984
  ], Jp.prototype, "intensity", 2);
87918
87985
  dR([
87919
- x(Nt)
87986
+ x(Ut)
87920
87987
  ], Jp.prototype, "center", 2);
87921
87988
  Ea("Vignette", Jp);
87922
87989
  var tce = Object.defineProperty, ice = Object.getOwnPropertyDescriptor, nce = (s, e, t, i) => {
@@ -87971,17 +88038,22 @@ class fR extends Te {
87971
88038
  updateFromFrame(t) {
87972
88039
  if (!t)
87973
88040
  return;
87974
- const i = t.getViewerPose(this.context.renderer.xr.getReferenceSpace());
87975
- if (i) {
87976
- for (const n of i.views)
87977
- if ("camera" in n && n.camera) {
87978
- let o = this.context.renderer.xr.getBinding();
87979
- if (o || (o = new XRWebGLBinding(t.session, this.context.renderer.getContext())), o) {
87980
- let a = null;
87981
- if ("getCameraImage" in o) {
87982
- a = o.getCameraImage(n.camera);
87983
- const l = this.context.renderer.properties.get(this.threeTexture);
87984
- l.__webglTexture = a, this.backgroundPlane ? (this.backgroundPlane.setTexture(this.threeTexture), this.backgroundPlane.visible = !0) : i_ && console.warn("No background plane to set texture on");
88041
+ const i = t.session.enabledFeatures;
88042
+ if (i && !i.some((r) => r === "camera-access")) {
88043
+ this.background && (this.background.visible = !1);
88044
+ return;
88045
+ }
88046
+ const n = t.getViewerPose(this.context.renderer.xr.getReferenceSpace());
88047
+ if (n) {
88048
+ for (const r of n.views)
88049
+ if ("camera" in r && r.camera) {
88050
+ let a = this.context.renderer.xr.getBinding();
88051
+ if (a || (a = new XRWebGLBinding(t.session, this.context.renderer.getContext())), a) {
88052
+ let l = null;
88053
+ if ("getCameraImage" in a) {
88054
+ l = a.getCameraImage(r.camera);
88055
+ const c = this.context.renderer.properties.get(this.threeTexture);
88056
+ c.__webglTexture = l, this.backgroundPlane ? (this.backgroundPlane.setTexture(this.threeTexture), this.backgroundPlane.visible = !0) : i_ && console.warn("No background plane to set texture on");
87985
88057
  }
87986
88058
  }
87987
88059
  }
@@ -90323,7 +90395,7 @@ const Qce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
90323
90395
  VisibilityAction: Gx,
90324
90396
  Voip: Ep,
90325
90397
  Volume: Qx,
90326
- VolumeParameter: Nt,
90398
+ VolumeParameter: Ut,
90327
90399
  VolumeProfile: Bx,
90328
90400
  WebARCameraBackground: fR,
90329
90401
  WebARSessionRoot: qo,
@@ -90552,7 +90624,7 @@ J.add("Vignette", Jp);
90552
90624
  J.add("VisibilityAction", Gx);
90553
90625
  J.add("Voip", Ep);
90554
90626
  J.add("Volume", Qx);
90555
- J.add("VolumeParameter", Nt);
90627
+ J.add("VolumeParameter", Ut);
90556
90628
  J.add("VolumeProfile", Bx);
90557
90629
  J.add("WebARCameraBackground", fR);
90558
90630
  J.add("WebARSessionRoot", qo);
@@ -90786,7 +90858,7 @@ function $ce(s, e, t = !0) {
90786
90858
  }
90787
90859
  }
90788
90860
  function hde(s, e = null) {
90789
- const t = e ?? Ut.Current.scripts;
90861
+ const t = e ?? Ft.Current.scripts;
90790
90862
  for (const i in t) {
90791
90863
  const n = t[i];
90792
90864
  if (n && n.guid === s)
@@ -90895,7 +90967,7 @@ class j4 extends HTMLElement {
90895
90967
  <div class="content">
90896
90968
  <slot class="overlay-content"></slot>
90897
90969
  </div>
90898
- `, this.shadowRoot && this.shadowRoot.appendChild(t.content.cloneNode(!0)), this._context = new Ut({ domElement: this }), this.addEventListener("error", this.onError);
90970
+ `, this.shadowRoot && this.shadowRoot.appendChild(t.content.cloneNode(!0)), this._context = new Ft({ domElement: this }), this.addEventListener("error", this.onError);
90899
90971
  }
90900
90972
  static get observedAttributes() {
90901
90973
  return the;
@@ -91001,7 +91073,7 @@ class j4 extends HTMLElement {
91001
91073
  var p, m;
91002
91074
  if (!this.isConnected)
91003
91075
  return;
91004
- if (this._context || (on && console.warn("Create new context"), this._context = new Ut({ domElement: this })), !this._context) {
91076
+ if (this._context || (on && console.warn("Create new context"), this._context = new Ft({ domElement: this })), !this._context) {
91005
91077
  console.error("Needle Engine: Context not initialized");
91006
91078
  return;
91007
91079
  }
@@ -93154,7 +93226,7 @@ const Ng = class {
93154
93226
  if (!n)
93155
93227
  return console.error("Can not perform raycast - no camera found"), null;
93156
93228
  o.set(e.origin.x, e.origin.y, e.origin.z);
93157
- const u = Ft(n);
93229
+ const u = Nt(n);
93158
93230
  o.sub(u);
93159
93231
  }
93160
93232
  return o.normalize(), e.dir.x = o.x, e.dir.y = o.y, e.dir.z = o.z, e;
@@ -93319,7 +93391,7 @@ this is not optimal for performance since this isn't supported by the Rapier phy
93319
93391
  throw new Error("Physics world not initialized");
93320
93392
  const i = this._tempMatrix;
93321
93393
  let n;
93322
- e.attachedRigidbody ? n = this.getRigidbody(e, this._tempMatrix) : (Qs && console.log("Create collider without rigidbody", e.name), i.makeRotationFromQuaternion(Ri(e.gameObject)), i.setPosition(Ft(e.gameObject))), i.decompose(this._tempPosition, this._tempQuaternion, this._tempScale), this.tryApplyCenter(e, this._tempPosition), t.setTranslation(this._tempPosition.x, this._tempPosition.y, this._tempPosition.z), t.setRotation(this._tempQuaternion), t.setSensor(e.isTrigger);
93394
+ e.attachedRigidbody ? n = this.getRigidbody(e, this._tempMatrix) : (Qs && console.log("Create collider without rigidbody", e.name), i.makeRotationFromQuaternion(Ri(e.gameObject)), i.setPosition(Nt(e.gameObject))), i.decompose(this._tempPosition, this._tempQuaternion, this._tempScale), this.tryApplyCenter(e, this._tempPosition), t.setTranslation(this._tempPosition.x, this._tempPosition.y, this._tempPosition.z), t.setRotation(this._tempQuaternion), t.setSensor(e.isTrigger);
93323
93395
  const r = e.sharedMaterial;
93324
93396
  if (r) {
93325
93397
  if (r.bounciness !== void 0 && t.setRestitution(r.bounciness), r.bounceCombine !== void 0)
@@ -93397,12 +93469,12 @@ Error:`, a), null;
93397
93469
  if (i = n[mr], !i) {
93398
93470
  const r = n.isKinematic && !zC;
93399
93471
  Qs && console.log("Create rigidbody", r);
93400
- const o = r ? ou.RigidBodyDesc.kinematicPositionBased() : ou.RigidBodyDesc.dynamic(), a = Ft(e.attachedRigidbody.gameObject);
93472
+ const o = r ? ou.RigidBodyDesc.kinematicPositionBased() : ou.RigidBodyDesc.dynamic(), a = Nt(e.attachedRigidbody.gameObject);
93401
93473
  o.setTranslation(a.x, a.y, a.z), o.setRotation(Ri(e.attachedRigidbody.gameObject)), o.centerOfMass = new ou.Vector3(n.centerOfMass.x, n.centerOfMass.y, n.centerOfMass.z), i = this.world.createRigidBody(o), this.bodies.push(i), this.objects.push(n);
93402
93474
  }
93403
93475
  i[Lr] = n, n[mr] = i, this.internalUpdateRigidbodyProperties(n, i), this.getRigidbodyRelativeMatrix(e.gameObject, n.gameObject, t), e[EL] = i;
93404
93476
  } else {
93405
- const n = ou.RigidBodyDesc.kinematicPositionBased(), r = Ft(e.gameObject);
93477
+ const n = ou.RigidBodyDesc.kinematicPositionBased(), r = Nt(e.gameObject);
93406
93478
  n.setTranslation(r.x, r.y, r.z), n.setRotation(Ri(e.gameObject)), i = this.world.createRigidBody(n), t.identity(), i[Lr] = null;
93407
93479
  }
93408
93480
  return i;
@@ -93496,7 +93568,7 @@ Error:`, a), null;
93496
93568
  }
93497
93569
  syncPhysicsBody(e, t, i, n) {
93498
93570
  if (t instanceof wL) {
93499
- const r = Ft(e, this._tempPosition), o = Ri(e, this._tempQuaternion);
93571
+ const r = Nt(e, this._tempPosition), o = Ri(e, this._tempQuaternion);
93500
93572
  switch (t.bodyType()) {
93501
93573
  case Dg.Fixed:
93502
93574
  case Dg.KinematicPositionBased:
@@ -93508,7 +93580,7 @@ Error:`, a), null;
93508
93580
  break;
93509
93581
  }
93510
93582
  } else if (t instanceof SL) {
93511
- const r = Ft(e, this._tempPosition), o = Ri(e, this._tempQuaternion), a = t[Lr];
93583
+ const r = Nt(e, this._tempPosition), o = Ri(e, this._tempQuaternion), a = t[Lr];
93512
93584
  if (this.tryApplyCenter(a, r), i) {
93513
93585
  const l = t.translation();
93514
93586
  (l.x !== r.x || l.y !== r.y || l.z !== r.z) && t.setTranslation(r);
@@ -93788,7 +93860,7 @@ function rG(s, e) {
93788
93860
  console.warn("Missing camera object, can not add orbit controls");
93789
93861
  }
93790
93862
  const SR = {
93791
- Context: Ut,
93863
+ Context: Ft,
93792
93864
  glTF: {
93793
93865
  loadFromURL: z4
93794
93866
  }
@@ -94849,7 +94921,7 @@ export {
94849
94921
  Q$ as ConnectionEvents,
94850
94922
  yhe as ContactPoint,
94851
94923
  dd as ContactShadows,
94852
- Ut as Context,
94924
+ Ft as Context,
94853
94925
  Vue as ContextArgs,
94854
94926
  In as ContextEvent,
94855
94927
  ci as ContextRegistry,
@@ -95098,7 +95170,7 @@ export {
95098
95170
  Gx as VisibilityAction,
95099
95171
  Ep as Voip,
95100
95172
  Qx as Volume,
95101
- Nt as VolumeParameter,
95173
+ Ut as VolumeParameter,
95102
95174
  Bx as VolumeProfile,
95103
95175
  Gue as WaitForFrames,
95104
95176
  tee as WaitForPromise,
@@ -95196,7 +95268,7 @@ export {
95196
95268
  $b as getUrlParams,
95197
95269
  TU as getWorldDirection,
95198
95270
  IU as getWorldEuler,
95199
- Ft as getWorldPosition,
95271
+ Nt as getWorldPosition,
95200
95272
  Ri as getWorldQuaternion,
95201
95273
  ax as getWorldRotation,
95202
95274
  Zi as getWorldScale,