@needle-tools/engine 3.37.4-alpha → 3.37.5-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.
@@ -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.5-alpha""]) globalThis[""3.37.5-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[""Tue Apr 23 2024 09:16:03 GMT+0200 (Central European Summer Time)""]) globalThis[""Tue Apr 23 2024 09:16:03 GMT+0200 (Central European Summer Time)""] = "unknown";');
29482
+ OE('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.37.5-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__"] = "Tue Apr 23 2024 09:16:03 GMT+0200 (Central European Summer Time)";');
29485
+ const lC = "3.37.5-alpha", jU = "undefined", hT = "Tue Apr 23 2024 09:16:03 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)
61399
61405
  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;
61406
+ if (this._cameraObject !== this.context.mainCamera) {
61407
+ this._controls.enabled = !1;
61408
+ return;
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();
@@ -66705,7 +66718,7 @@ const KgA = IA("gizmos"), JgA = IA("debugboxhelper"), xo = class extends RA {
66705
66718
  for (let o = 0; o < e.children.length; o++)
66706
66719
  e.children[o].type === "Mesh" && xo.testBox.expandByObject(e);
66707
66720
  } else {
66708
- const o = xe(e, xo._position), s = oi(e, xo._size);
66721
+ const o = _e(e, xo._position), s = oi(e, xo._size);
66709
66722
  t !== void 0 && s.multiplyScalar(t), xo.testBox.setFromCenterAndSize(o, s);
66710
66723
  }
66711
66724
  this.updateBox();
@@ -66719,7 +66732,7 @@ const KgA = IA("gizmos"), JgA = IA("debugboxhelper"), xo = class extends RA {
66719
66732
  if (this.box || (this.box = new wt()), e || this.context.time.frameCount != this._lastMatrixUpdateFrame) {
66720
66733
  const t = this._lastMatrixUpdateFrame < 0;
66721
66734
  this._lastMatrixUpdateFrame = this.context.time.frameCount;
66722
- const i = t, I = xe(this.gameObject, xo._position, i), o = oi(this.gameObject, xo._size);
66735
+ const i = t, I = _e(this.gameObject, xo._position, i), o = oi(this.gameObject, xo._size);
66723
66736
  this.box.setFromCenterAndSize(I, o);
66724
66737
  }
66725
66738
  return this.box;
@@ -67945,7 +67958,7 @@ class sc extends RA {
67945
67958
  *moveToTarget() {
67946
67959
  if (!this.target || !this.object)
67947
67960
  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);
67961
+ 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
67962
  if (n < 0.01 && C < 0.01 && a < 0.01) {
67950
67963
  vI(this.object, t), Ns(this.object, I), QD(this.object, s), this.coroutine = null;
67951
67964
  return;
@@ -68624,7 +68637,7 @@ class Xa extends RA {
68624
68637
  if (this.controller) {
68625
68638
  const l = (E = this.controller) == null ? void 0 : E.rigidbody.getVelocity().y;
68626
68639
  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);
68640
+ 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
68641
  const h = this.layer;
68629
68642
  this.gameObject.layers.disableAll(), this.gameObject.layers.set(2);
68630
68643
  const p = this.context.physics.raycast(this._raycastOptions);
@@ -68676,7 +68689,7 @@ class Jy extends xI {
68676
68689
  }
68677
68690
  }
68678
68691
  oIA([
68679
- D(_e)
68692
+ D(Le)
68680
68693
  ], Jy.prototype, "intensity", 2);
68681
68694
  Ls("ChromaticAberration", Jy);
68682
68695
  const zd = new ue();
@@ -70201,14 +70214,14 @@ class by extends RA {
70201
70214
  vp.set(o, C);
70202
70215
  const a = Object.keys(n);
70203
70216
  for (const B of a)
70204
- n[B] instanceof _e && C.push(B);
70217
+ n[B] instanceof Le && C.push(B);
70205
70218
  }
70206
70219
  if (vp.has(o)) {
70207
70220
  const C = s.toLowerCase(), a = vp.get(o);
70208
70221
  for (const B of a)
70209
70222
  if (B.toLowerCase() === C) {
70210
70223
  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));
70224
+ 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
70225
  return;
70213
70226
  }
70214
70227
  }
@@ -70309,16 +70322,16 @@ class FB extends xI {
70309
70322
  // }
70310
70323
  }
70311
70324
  vy([
70312
- D(_e)
70325
+ D(Le)
70313
70326
  ], FB.prototype, "postExposure", 2);
70314
70327
  vy([
70315
- D(_e)
70328
+ D(Le)
70316
70329
  ], FB.prototype, "contrast", 2);
70317
70330
  vy([
70318
- D(_e)
70331
+ D(Le)
70319
70332
  ], FB.prototype, "hueShift", 2);
70320
70333
  vy([
70321
- D(_e)
70334
+ D(Le)
70322
70335
  ], FB.prototype, "saturation", 2);
70323
70336
  Ls("ColorAdjustments", FB);
70324
70337
  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 +71108,7 @@ const ii = class extends Dd {
71095
71108
  r(this, "_viewProjectionName", "hlslcc_mtx4x4unity_MatrixVP");
71096
71109
  r(this, "_viewMatrixName", "hlslcc_mtx4x4unity_MatrixV");
71097
71110
  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);
71111
+ 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
71112
  }
71100
71113
  clone() {
71101
71114
  const e = super.clone();
@@ -71103,8 +71116,8 @@ const ii = class extends Dd {
71103
71116
  }
71104
71117
  dispose() {
71105
71118
  super.dispose();
71106
- const e = Le.Current.pre_render_callbacks.indexOf(this.onBeforeRenderSceneCallback);
71107
- e >= 0 && Le.Current.pre_render_callbacks.splice(e, 1);
71119
+ const e = xe.Current.pre_render_callbacks.indexOf(this.onBeforeRenderSceneCallback);
71120
+ e >= 0 && xe.Current.pre_render_callbacks.splice(e, 1);
71108
71121
  }
71109
71122
  get depthTextureUniform() {
71110
71123
  if (this.uniforms)
@@ -71115,13 +71128,13 @@ const ii = class extends Dd {
71115
71128
  return this.uniforms._CameraOpaqueTexture;
71116
71129
  }
71117
71130
  onBeforeRenderScene() {
71118
- this.opaqueTextureUniform && Le.Current.setRequireColor(!0), this.depthTextureUniform && Le.Current.setRequireDepth(!0);
71131
+ this.opaqueTextureUniform && xe.Current.setRequireColor(!0), this.depthTextureUniform && xe.Current.setRequireDepth(!0);
71119
71132
  }
71120
71133
  onBeforeRender(e, t, i, I, o, s) {
71121
71134
  I.attributes.tangent || I.computeTangents(), this.onUpdateUniforms(i, o);
71122
71135
  }
71123
71136
  onUpdateUniforms(e, t) {
71124
- const i = Le.Current;
71137
+ const i = xe.Current;
71125
71138
  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
71139
  const n = this.uniforms._Time.value;
71127
71140
  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 +71153,7 @@ const ii = class extends Dd {
71140
71153
  }
71141
71154
  const I = i.mainLight;
71142
71155
  if (I) {
71143
- const n = xe(I.gameObject, ii._mainLightPosition);
71156
+ const n = _e(I.gameObject, ii._mainLightPosition);
71144
71157
  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
71158
  const C = I.intensity;
71146
71159
  ii._lightData.z = C, this.uniforms.unity_LightData = { value: ii._lightData };
@@ -72285,7 +72298,7 @@ Texture LODs available? ${this.hasTextureLODs ? "YES" : "NO"}`);
72285
72298
  }
72286
72299
  const E = C.geometry.boundingBox;
72287
72300
  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)))) {
72301
+ 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
72302
  o = 0;
72290
72303
  break;
72291
72304
  }
@@ -75544,7 +75557,7 @@ class Rn extends xI {
75544
75557
  const e = 1 / window.devicePixelRatio;
75545
75558
  if (this.resolutionScale === void 0) {
75546
75559
  let i = 1;
75547
- Is() && (i = 0.6), this.resolutionScale = new _e(i * e);
75560
+ Is() && (i = 0.6), this.resolutionScale = new Le(i * e);
75548
75561
  }
75549
75562
  const t = new fH(this.context.mainCamera, {
75550
75563
  worldFocusRange: 0.2,
@@ -75563,22 +75576,22 @@ xB([
75563
75576
  D()
75564
75577
  ], Rn.prototype, "mode", 2);
75565
75578
  xB([
75566
- D(_e)
75579
+ D(Le)
75567
75580
  ], Rn.prototype, "focusDistance", 2);
75568
75581
  xB([
75569
- D(_e)
75582
+ D(Le)
75570
75583
  ], Rn.prototype, "focalLength", 2);
75571
75584
  xB([
75572
- D(_e)
75585
+ D(Le)
75573
75586
  ], Rn.prototype, "aperture", 2);
75574
75587
  xB([
75575
- D(_e)
75588
+ D(Le)
75576
75589
  ], Rn.prototype, "gaussianMaxRadius", 2);
75577
75590
  xB([
75578
- D(_e)
75591
+ D(Le)
75579
75592
  ], Rn.prototype, "resolutionScale", 2);
75580
75593
  xB([
75581
- D(_e)
75594
+ D(Le)
75582
75595
  ], Rn.prototype, "bokehScale", 2);
75583
75596
  Ls("DepthOfField", Rn);
75584
75597
  var EoA = Object.defineProperty, coA = Object.getOwnPropertyDescriptor, loA = (g, A, e, t) => {
@@ -76095,17 +76108,17 @@ const yF = class {
76095
76108
  onUpdate(A) {
76096
76109
  if (!this._selected)
76097
76110
  return;
76098
- const e = xe(this._selected);
76111
+ const e = _e(this._selected);
76099
76112
  this.onUpdateWorldPosition(e, this._groundPlanePoint, !1), this.onUpdateGroundPlane(), this._didDragOnGroundPlaneLastFrame = !0, this._hasGroundPlane = !0;
76100
76113
  }
76101
76114
  onUpdateWorldPosition(A, e, t) {
76102
76115
  if (this._selected) {
76103
76116
  if (t) {
76104
- const i = xe(this._selected);
76117
+ const i = _e(this._selected);
76105
76118
  i.y = A.y, A = i;
76106
76119
  }
76107
76120
  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;
76121
+ const i = _e(this._camera).distanceTo(e) * 0.01;
76109
76122
  this._groundMarker.scale.set(i, i, i), vI(this._groundMarker, e);
76110
76123
  }
76111
76124
  }
@@ -76119,7 +76132,7 @@ const yF = class {
76119
76132
  onUpdateGroundPlane() {
76120
76133
  if (!this._selected || !this._context)
76121
76134
  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();
76135
+ 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
76136
  t.ignore = [this._selected];
76124
76137
  const i = this._context.physics.raycastFromRay(e, t);
76125
76138
  for (let I = 0; I < i.length; I++) {
@@ -78200,7 +78213,7 @@ const vQ = class extends RA {
78200
78213
  static calculateCenter(A, e) {
78201
78214
  const t = e || new w();
78202
78215
  return t.set(0, 0, 0), A.forEach((i) => {
78203
- t.add(xe(i));
78216
+ t.add(_e(i));
78204
78217
  }), console.log(t), t.divideScalar(A.length), t;
78205
78218
  }
78206
78219
  static filterTopmostParent(A) {
@@ -79045,11 +79058,11 @@ class dc extends RA {
79045
79058
  update() {
79046
79059
  if (!this.from)
79047
79060
  return;
79048
- var e = xe(this.from), t = bt(this.from);
79061
+ var e = _e(this.from), t = bt(this.from);
79049
79062
  this.offset.copy(this.positionOffset);
79050
79063
  const i = this.offset.length();
79051
79064
  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);
79065
+ const n = new kI(this.gameObject.up, 0), C = _e(this.referenceSpace);
79053
79066
  n.setFromNormalAndCoplanarPoint(this.gameObject.up, C);
79054
79067
  const a = new w(0, 0, 0);
79055
79068
  n.projectPoint(e, a), e.copy(a);
@@ -83797,7 +83810,7 @@ class CCA extends hN {
83797
83810
  r(this, "_lastDistance", 0);
83798
83811
  }
83799
83812
  update() {
83800
- const e = xe(this.system.gameObject);
83813
+ const e = _e(this.system.gameObject);
83801
83814
  this._lastDistance = this._lastPosition.distanceTo(e), this._lastPosition.copy(e);
83802
83815
  }
83803
83816
  genValue() {
@@ -84243,7 +84256,7 @@ const qf = class extends RA {
84243
84256
  return this._worldScale;
84244
84257
  }
84245
84258
  get worldPos() {
84246
- return this._worldPositionFrame !== this.context.time.frame && (this._worldPositionFrame = this.context.time.frame, xe(this.gameObject, this._worldPos)), this._worldPos;
84259
+ return this._worldPositionFrame !== this.context.time.frame && (this._worldPositionFrame = this.context.time.frame, _e(this.gameObject, this._worldPos)), this._worldPos;
84247
84260
  }
84248
84261
  get matrixWorld() {
84249
84262
  return this._container.matrixWorld;
@@ -84251,12 +84264,34 @@ const qf = class extends RA {
84251
84264
  get isSubsystem() {
84252
84265
  return this._isUsedAsSubsystem;
84253
84266
  }
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
84267
+ /** Add a custom quarks behaviour to the particle system.
84268
+ * You can add a quarks.Behaviour type or derive from {@link ParticleSystemBaseBehaviour}
84269
+ * @link https://github.com/Alchemist0823/three.quarks
84270
+ * @example
84271
+ * ```typescript
84272
+ * class MyBehaviour extends ParticleSystemBaseBehaviour {
84273
+ * initialize(particle: Particle) {
84274
+ * // initialize the particle
84275
+ * }
84276
+ * update(particle: Particle, delta: number) {
84277
+ * // do something with the particle
84278
+ * }
84279
+ * }
84280
+ *
84281
+ * const system = gameObject.getComponent(ParticleSystem);
84282
+ * system.addBehaviour(new MyBehaviour());
84283
+ * ```
84256
84284
  */
84257
84285
  addBehaviour(A) {
84258
84286
  return this._particleSystem ? (A instanceof _B && (A.system = this), de() && console.log("add behaviour", A), this._particleSystem.addBehavior(A), !0) : !1;
84259
84287
  }
84288
+ /** Remove a custom quarks behaviour from the particle system. **/
84289
+ removeBehaviour(A) {
84290
+ if (!this._particleSystem)
84291
+ return !1;
84292
+ const e = this._particleSystem.behaviors, t = e.indexOf(A);
84293
+ return t !== -1 && e.splice(t, 1), !0;
84294
+ }
84260
84295
  /** Removes all behaviours from the particle system
84261
84296
  * **Note:** this will also remove the default behaviours like SizeBehaviour, ColorBehaviour etc.
84262
84297
  */
@@ -84295,11 +84330,13 @@ const qf = class extends RA {
84295
84330
  }
84296
84331
  bl && A.length > 0 && console.log("SubEmitters: ", A, this), this._subEmitterSystems = A;
84297
84332
  }
84333
+ /** @internal */
84298
84334
  onAfterDeserialize(A) {
84299
84335
  if (this._subEmitterSystems && Array.isArray(this._subEmitterSystems))
84300
84336
  for (const e of this._subEmitterSystems)
84301
84337
  e._deserialize(this.context, this.gameObject);
84302
84338
  }
84339
+ /** @internal */
84303
84340
  awake() {
84304
84341
  if (this._worldPositionFrame = -1, this._renderer = this.gameObject.getComponent(Ts), !this.main)
84305
84342
  throw new Error("Not Supported: ParticleSystem needs a serialized MainModule. Creating new particle systems at runtime is currently not supported.");
@@ -84307,19 +84344,23 @@ const qf = class extends RA {
84307
84344
  const A = this._particleSystem.emitter;
84308
84345
  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
84346
  }
84347
+ /** @internal */
84310
84348
  start() {
84311
84349
  this.addSubParticleSystems(), this.updateLayers();
84312
84350
  }
84351
+ /** @internal */
84313
84352
  onDestroy() {
84314
84353
  var A, e, t, i;
84315
84354
  (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
84355
  }
84356
+ /** @internal */
84317
84357
  onEnable() {
84318
84358
  this.main && (this.inheritVelocity && (this.inheritVelocity.system = this), this._batchSystem && (this._batchSystem.visible = !0), this.playOnAwake && this.play(), this._isPlaying = this.playOnAwake);
84319
84359
  }
84320
84360
  onDisable() {
84321
84361
  this._batchSystem && (this._batchSystem.visible = !1);
84322
84362
  }
84363
+ /** @internal */
84323
84364
  onBeforeRender() {
84324
84365
  var A;
84325
84366
  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 +84597,7 @@ class iS extends xI {
84556
84597
  }
84557
84598
  }
84558
84599
  DCA([
84559
- D(_e)
84600
+ D(Le)
84560
84601
  ], iS.prototype, "granularity", 2);
84561
84602
  Ls("PixelationEffect", iS);
84562
84603
  class Id extends RA {
@@ -85044,6 +85085,7 @@ class LI extends RA {
85044
85085
  }
85045
85086
  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
85087
  }
85088
+ /** @internal */
85047
85089
  async __internalSwitchScene(e) {
85048
85090
  var i, I;
85049
85091
  if (this._currentScene) {
@@ -85136,6 +85178,13 @@ class LI extends RA {
85136
85178
  o instanceof Promise && await o;
85137
85179
  }
85138
85180
  }
85181
+ if (this._isCurrentlyLoading) {
85182
+ const i = this.tryGetSceneEventListener(this.gameObject);
85183
+ if (i && i.sceneOpened) {
85184
+ const I = i.sceneOpened(this);
85185
+ I instanceof Promise && await I;
85186
+ }
85187
+ }
85139
85188
  }
85140
85189
  async onEndLoading() {
85141
85190
  var e;
@@ -85148,6 +85197,13 @@ class LI extends RA {
85148
85197
  }
85149
85198
  aA.remove(t);
85150
85199
  }
85200
+ if (!this._isCurrentlyLoading) {
85201
+ const t = this.tryGetSceneEventListener(this.gameObject);
85202
+ if (t && t.sceneClosing) {
85203
+ const i = t.sceneClosing();
85204
+ i instanceof Promise && await i;
85205
+ }
85206
+ }
85151
85207
  }
85152
85208
  tryGetSceneEventListener(e, t = 0) {
85153
85209
  const i = aA.foreachComponent(e, (I) => I.sceneClosing ? I : void 0);
@@ -86118,19 +86174,19 @@ class Ar extends xI {
86118
86174
  }
86119
86175
  }
86120
86176
  nu([
86121
- D(_e)
86177
+ D(Le)
86122
86178
  ], Ar.prototype, "intensity", 2);
86123
86179
  nu([
86124
- D(_e)
86180
+ D(Le)
86125
86181
  ], Ar.prototype, "falloff", 2);
86126
86182
  nu([
86127
- D(_e)
86183
+ D(Le)
86128
86184
  ], Ar.prototype, "samples", 2);
86129
86185
  nu([
86130
- D(_e)
86186
+ D(Le)
86131
86187
  ], Ar.prototype, "color", 2);
86132
86188
  nu([
86133
- D(_e)
86189
+ D(Le)
86134
86190
  ], Ar.prototype, "luminanceInfluence", 2);
86135
86191
  Ls("ScreenSpaceAmbientOcclusion", Ar);
86136
86192
  var TCA = Object.defineProperty, HCA = Object.getOwnPropertyDescriptor, TB = (g, A, e, t) => {
@@ -86181,20 +86237,20 @@ TB([
86181
86237
  D()
86182
86238
  ], Fn.prototype, "gammaCorrection", 2);
86183
86239
  TB([
86184
- D(_e)
86240
+ D(Le)
86185
86241
  ], Fn.prototype, "intensity", 2);
86186
86242
  TB([
86187
- D(_e)
86243
+ D(Le)
86188
86244
  ], Fn.prototype, "falloff", 2);
86189
86245
  TB([
86190
- D(_e)
86246
+ D(Le)
86191
86247
  ], Fn.prototype, "aoRadius", 2);
86192
86248
  TB([
86193
86249
  QI(),
86194
86250
  D()
86195
86251
  ], Fn.prototype, "screenspaceRadius", 2);
86196
86252
  TB([
86197
- D(_e)
86253
+ D(Le)
86198
86254
  ], Fn.prototype, "color", 2);
86199
86255
  TB([
86200
86256
  QI(),
@@ -86330,7 +86386,7 @@ const sO = (rG = class extends RA {
86330
86386
  updateNow(A) {
86331
86387
  if (!(!this.target || this.target === this.gameObject)) {
86332
86388
  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;
86389
+ const e = _e(this.target), t = this._firstUpdate || A ? 1 : ie.clamp01(this.context.time.deltaTime * this.followFactor), i = this.worldPosition;
86334
86390
  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
86391
  }
86336
86392
  if (this.rotateFactor > 0) {
@@ -87350,7 +87406,7 @@ class daA {
87350
87406
  Co.clear();
87351
87407
  const t = Co.createString(this.guid), i = Co.createString(this.userId);
87352
87408
  gn.startSyncedCameraModel(Co), gn.addGuid(Co, t), gn.addUserId(Co, i);
87353
- const I = xe(A), o = Ay(A);
87409
+ const I = _e(A), o = Ay(A);
87354
87410
  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
87411
  const s = gn.endSyncedCameraModel(Co);
87356
87412
  Co.finish(s, HD), e.sendBinary(Co.asUint8Array());
@@ -87407,7 +87463,7 @@ const uM = (QG = class extends RA {
87407
87463
  if (!this.context.connection.isConnected || this.context.connection.connectionId === null)
87408
87464
  return;
87409
87465
  this._model === null && (this._model = new daA(this.context.connection.connectionId, this.context.connection.connectionId + "_camera"));
87410
- const e = xe(A), t = bt(A);
87466
+ const e = _e(A), t = bt(A);
87411
87467
  (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
87468
  }
87413
87469
  onReceivedRemoteCameraInfoBin(A) {
@@ -87713,22 +87769,22 @@ class LC extends xI {
87713
87769
  }
87714
87770
  }
87715
87771
  wc([
87716
- D(_e)
87772
+ D(Le)
87717
87773
  ], LC.prototype, "offset", 2);
87718
87774
  wc([
87719
- D(_e)
87775
+ D(Le)
87720
87776
  ], LC.prototype, "rotation", 2);
87721
87777
  wc([
87722
- D(_e)
87778
+ D(Le)
87723
87779
  ], LC.prototype, "focusArea", 2);
87724
87780
  wc([
87725
- D(_e)
87781
+ D(Le)
87726
87782
  ], LC.prototype, "feather", 2);
87727
87783
  wc([
87728
- D(_e)
87784
+ D(Le)
87729
87785
  ], LC.prototype, "kernelSize", 2);
87730
87786
  wc([
87731
- D(_e)
87787
+ D(Le)
87732
87788
  ], LC.prototype, "resolutionScale", 2);
87733
87789
  Ls("TiltShiftEffect", LC);
87734
87790
  var SaA = Object.defineProperty, maA = Object.getOwnPropertyDescriptor, GaA = (g, A, e, t) => {
@@ -87748,7 +87804,7 @@ class aS extends xI {
87748
87804
  return !0;
87749
87805
  }
87750
87806
  init() {
87751
- this.mode || (this.mode = new _e(jI)), this.mode.defaultValue = jI;
87807
+ this.mode || (this.mode = new Le(jI)), this.mode.defaultValue = jI;
87752
87808
  }
87753
87809
  apply() {
87754
87810
  this.mode || this.init(), this.mode.onValueChanged = this._apply.bind(this), this._apply(this.mode.value);
@@ -87770,7 +87826,7 @@ class aS extends xI {
87770
87826
  }
87771
87827
  }
87772
87828
  GaA([
87773
- D(_e)
87829
+ D(Le)
87774
87830
  ], aS.prototype, "mode", 2);
87775
87831
  Ls("Tonemapping", aS);
87776
87832
  var kaA = Object.defineProperty, MaA = Object.getOwnPropertyDescriptor, rS = (g, A, e, t) => {
@@ -87910,13 +87966,13 @@ class Sc extends xI {
87910
87966
  }
87911
87967
  }
87912
87968
  wN([
87913
- D(_e)
87969
+ D(Le)
87914
87970
  ], Sc.prototype, "color", 2);
87915
87971
  wN([
87916
- D(_e)
87972
+ D(Le)
87917
87973
  ], Sc.prototype, "intensity", 2);
87918
87974
  wN([
87919
- D(_e)
87975
+ D(Le)
87920
87976
  ], Sc.prototype, "center", 2);
87921
87977
  Ls("Vignette", Sc);
87922
87978
  var NaA = Object.defineProperty, FaA = Object.getOwnPropertyDescriptor, KaA = (g, A, e, t) => {
@@ -90323,7 +90379,7 @@ const prA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
90323
90379
  VisibilityAction: Ky,
90324
90380
  Voip: ec,
90325
90381
  Volume: by,
90326
- VolumeParameter: _e,
90382
+ VolumeParameter: Le,
90327
90383
  VolumeProfile: Sy,
90328
90384
  WebARCameraBackground: yN,
90329
90385
  WebARSessionRoot: is,
@@ -90552,7 +90608,7 @@ z.add("Vignette", Sc);
90552
90608
  z.add("VisibilityAction", Ky);
90553
90609
  z.add("Voip", ec);
90554
90610
  z.add("Volume", by);
90555
- z.add("VolumeParameter", _e);
90611
+ z.add("VolumeParameter", Le);
90556
90612
  z.add("VolumeProfile", Sy);
90557
90613
  z.add("WebARCameraBackground", yN);
90558
90614
  z.add("WebARSessionRoot", is);
@@ -90786,7 +90842,7 @@ function UrA(g, A, e = !0) {
90786
90842
  }
90787
90843
  }
90788
90844
  function _QA(g, A = null) {
90789
- const e = A ?? Le.Current.scripts;
90845
+ const e = A ?? xe.Current.scripts;
90790
90846
  for (const t in e) {
90791
90847
  const i = e[t];
90792
90848
  if (i && i.guid === g)
@@ -90895,7 +90951,7 @@ class GO extends HTMLElement {
90895
90951
  <div class="content">
90896
90952
  <slot class="overlay-content"></slot>
90897
90953
  </div>
90898
- `, this.shadowRoot && this.shadowRoot.appendChild(e.content.cloneNode(!0)), this._context = new Le({ domElement: this }), this.addEventListener("error", this.onError);
90954
+ `, this.shadowRoot && this.shadowRoot.appendChild(e.content.cloneNode(!0)), this._context = new xe({ domElement: this }), this.addEventListener("error", this.onError);
90899
90955
  }
90900
90956
  static get observedAttributes() {
90901
90957
  return NrA;
@@ -91001,7 +91057,7 @@ class GO extends HTMLElement {
91001
91057
  var E, c;
91002
91058
  if (!this.isConnected)
91003
91059
  return;
91004
- if (this._context || (Qi && console.warn("Create new context"), this._context = new Le({ domElement: this })), !this._context) {
91060
+ if (this._context || (Qi && console.warn("Create new context"), this._context = new xe({ domElement: this })), !this._context) {
91005
91061
  console.error("Needle Engine: Context not initialized");
91006
91062
  return;
91007
91063
  }
@@ -96570,7 +96626,7 @@ const Dh = class {
96570
96626
  if (!i)
96571
96627
  return console.error("Can not perform raycast - no camera found"), null;
96572
96628
  o.set(A.origin.x, A.origin.y, A.origin.z);
96573
- const a = xe(i);
96629
+ const a = _e(i);
96574
96630
  o.sub(a);
96575
96631
  }
96576
96632
  return o.normalize(), A.dir.x = o.x, A.dir.y = o.y, A.dir.z = o.z, A;
@@ -96735,7 +96791,7 @@ this is not optimal for performance since this isn't supported by the Rapier phy
96735
96791
  throw new Error("Physics world not initialized");
96736
96792
  const t = this._tempMatrix;
96737
96793
  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);
96794
+ 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
96795
  const I = A.sharedMaterial;
96740
96796
  if (I) {
96741
96797
  if (I.bounciness !== void 0 && e.setRestitution(I.bounciness), I.bounceCombine !== void 0)
@@ -96813,12 +96869,12 @@ Error:`, s), null;
96813
96869
  if (t = i[yI], !t) {
96814
96870
  const I = i.isKinematic && !AG;
96815
96871
  qi && console.log("Create rigidbody", I);
96816
- const o = I ? On.RigidBodyDesc.kinematicPositionBased() : On.RigidBodyDesc.dynamic(), s = xe(A.attachedRigidbody.gameObject);
96872
+ const o = I ? On.RigidBodyDesc.kinematicPositionBased() : On.RigidBodyDesc.dynamic(), s = _e(A.attachedRigidbody.gameObject);
96817
96873
  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
96874
  }
96819
96875
  t[OI] = i, i[yI] = t, this.internalUpdateRigidbodyProperties(i, t), this.getRigidbodyRelativeMatrix(A.gameObject, i.gameObject, e), A[nx] = t;
96820
96876
  } else {
96821
- const i = On.RigidBodyDesc.kinematicPositionBased(), I = xe(A.gameObject);
96877
+ const i = On.RigidBodyDesc.kinematicPositionBased(), I = _e(A.gameObject);
96822
96878
  i.setTranslation(I.x, I.y, I.z), i.setRotation(bt(A.gameObject)), t = this.world.createRigidBody(i), e.identity(), t[OI] = null;
96823
96879
  }
96824
96880
  return t;
@@ -96912,7 +96968,7 @@ Error:`, s), null;
96912
96968
  }
96913
96969
  syncPhysicsBody(A, e, t, i) {
96914
96970
  if (e instanceof KE) {
96915
- const I = xe(A, this._tempPosition), o = bt(A, this._tempQuaternion);
96971
+ const I = _e(A, this._tempPosition), o = bt(A, this._tempQuaternion);
96916
96972
  switch (e.bodyType()) {
96917
96973
  case GI.Fixed:
96918
96974
  case GI.KinematicPositionBased:
@@ -96924,7 +96980,7 @@ Error:`, s), null;
96924
96980
  break;
96925
96981
  }
96926
96982
  } else if (e instanceof vE) {
96927
- const I = xe(A, this._tempPosition), o = bt(A, this._tempQuaternion), s = e[OI];
96983
+ const I = _e(A, this._tempPosition), o = bt(A, this._tempQuaternion), s = e[OI];
96928
96984
  if (this.tryApplyCenter(s, I), t) {
96929
96985
  const n = e.translation();
96930
96986
  (n.x !== I.x || n.y !== I.y || n.z !== I.z) && e.setTranslation(I);
@@ -97204,7 +97260,7 @@ function bO(g, A) {
97204
97260
  console.warn("Missing camera object, can not add orbit controls");
97205
97261
  }
97206
97262
  const cF = {
97207
- Context: Le,
97263
+ Context: xe,
97208
97264
  glTF: {
97209
97265
  loadFromURL: DO
97210
97266
  }
@@ -98265,7 +98321,7 @@ export {
98265
98321
  peA as ConnectionEvents,
98266
98322
  jrA as ContactPoint,
98267
98323
  vB as ContactShadows,
98268
- Le as Context,
98324
+ xe as Context,
98269
98325
  fQA as ContextArgs,
98270
98326
  ki as ContextEvent,
98271
98327
  rt as ContextRegistry,
@@ -98514,7 +98570,7 @@ export {
98514
98570
  Ky as VisibilityAction,
98515
98571
  ec as Voip,
98516
98572
  by as Volume,
98517
- _e as VolumeParameter,
98573
+ Le as VolumeParameter,
98518
98574
  Sy as VolumeProfile,
98519
98575
  dQA as WaitForFrames,
98520
98576
  NeA as WaitForPromise,
@@ -98612,7 +98668,7 @@ export {
98612
98668
  Pw as getUrlParams,
98613
98669
  aT as getWorldDirection,
98614
98670
  rT as getWorldEuler,
98615
- xe as getWorldPosition,
98671
+ _e as getWorldPosition,
98616
98672
  bt as getWorldQuaternion,
98617
98673
  Ay as getWorldRotation,
98618
98674
  oi as getWorldScale,