@needle-tools/engine 4.1.0-beta.3 → 4.1.0-beta.4

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.
@@ -10,7 +10,7 @@ var de = (n, t, e) => (Of(n, t, "read from private field"), e ? e.call(n) : t.ge
10
10
  t instanceof WeakSet ? t.add(n) : t.set(n, e);
11
11
  }, rs = (n, t, e, i) => (Of(n, t, "write to private field"), i ? i.call(n, e) : t.set(n, e), e);
12
12
  var Uo = (n, t, e) => (Of(n, t, "access private method"), e);
13
- import { g as oe, V as v, h as pe, Q as W, P as Xs, i as ge, j as Ki, k as ms, U as ho, M as X, W as Mr, T as We, E as Lt, d as Ci, e as ai, l as ae, m as Zb, n as Jb, G as Jm, a as Se, o as e0, c as ne, L as vo, O as L, R as Rr, p as Pn, A as Pi, q as De, D as Oi, B as uo, r as fo, s as _u, t as Sc, u as Tx, v as Ax, w as Ex, x as Ix, F as t0, y as Kp, z as i0, H as Cc, I as yt, J as Dx, K as Lx, N as s0, X as n0, S as bu, Y as _r, Z as vu, _ as jx, $ as On, a0 as o0, a1 as Bx, a2 as Fx, a3 as zx, a4 as Ux, a5 as Nx, a6 as rr, b as xa, a7 as ja, a8 as Nc, a9 as Kt, aa as $x, ab as r0, ac as eg, ad as wu, ae as Mn, af as gs, C as Wx, ag as Ba, ah as Vx, ai as Hx, aj as wo, ak as Gx, al as kd, am as qx, an as Zp, ao as tg, ap as Xx, aq as xo, ar as Ly, as as ig, at as Qx, au as Yx, av as Jp, aw as sg, ax as ng, ay as Kx, az as Zx, aA as Jx, aB as eS, aC as tS, aD as iS, aE as sS, aF as nS, aG as oS, aH as rS, aI as aS, aJ as lS, aK as cS, aL as hS, aM as dS, aN as uS, aO as fS, aP as pS, aQ as mS, aR as gS, aS as jy, aT as a0, aU as yS, aV as _S, aW as bS, aX as vS, aY as wS, aZ as xS, a_ as SS, a$ as CS, b0 as By, b1 as em, b2 as PS, b3 as Fy, b4 as OS, b5 as MS, b6 as l0, b7 as RS, b8 as kS, b9 as TS, ba as AS, bb as ES, bc as IS, bd as DS, be as Pc, bf as xu, bg as og, bh as rg, bi as Su, bj as LS, bk as jS, bl as BS, bm as FS, bn as zS, bo as US, bp as NS, bq as $S, br as zy, bs as c0, bt as Td, bu as WS, bv as VS } from "./three.js";
13
+ import { g as oe, V as v, h as pe, Q as W, P as Xs, i as ye, j as Ki, k as ms, U as ho, M as X, W as Mr, T as We, E as Lt, d as Ci, e as ai, l as ae, m as Zb, n as Jb, G as Jm, a as Se, o as e0, c as ne, L as vo, O as L, R as Rr, p as Pn, A as Pi, q as De, D as Oi, B as uo, r as fo, s as _u, t as Sc, u as Tx, v as Ax, w as Ex, x as Ix, F as t0, y as Kp, z as i0, H as Cc, I as yt, J as Dx, K as Lx, N as s0, X as n0, S as bu, Y as _r, Z as vu, _ as jx, $ as On, a0 as o0, a1 as Bx, a2 as Fx, a3 as zx, a4 as Ux, a5 as Nx, a6 as rr, b as xa, a7 as ja, a8 as Nc, a9 as Kt, aa as $x, ab as r0, ac as eg, ad as wu, ae as Mn, af as gs, C as Wx, ag as Ba, ah as Vx, ai as Hx, aj as wo, ak as Gx, al as kd, am as qx, an as Zp, ao as tg, ap as Xx, aq as xo, ar as Ly, as as ig, at as Qx, au as Yx, av as Jp, aw as sg, ax as ng, ay as Kx, az as Zx, aA as Jx, aB as eS, aC as tS, aD as iS, aE as sS, aF as nS, aG as oS, aH as rS, aI as aS, aJ as lS, aK as cS, aL as hS, aM as dS, aN as uS, aO as fS, aP as pS, aQ as mS, aR as gS, aS as jy, aT as a0, aU as yS, aV as _S, aW as bS, aX as vS, aY as wS, aZ as xS, a_ as SS, a$ as CS, b0 as By, b1 as em, b2 as PS, b3 as Fy, b4 as OS, b5 as MS, b6 as l0, b7 as RS, b8 as kS, b9 as TS, ba as AS, bb as ES, bc as IS, bd as DS, be as Pc, bf as xu, bg as og, bh as rg, bi as Su, bj as LS, bk as jS, bl as BS, bm as FS, bn as zS, bo as US, bp as NS, bq as $S, br as zy, bs as c0, bt as Td, bu as WS, bv as VS } from "./three.js";
14
14
  import { c as ag, g as h0, L as Qr, N as Je, a as HS, b as GS, s as qS, d as XS } from "./gltf-progressive.js";
15
15
  import { a as Fa, F as QS, T as YS, b as KS, G as br, c as d0, E as Ad, R as tm, S as ZS, n as JS, O as u0, P as e1, H as t1, V as i1, d as f0, s as p0, z as s1, X as n1, e as o1, L as r1, f as a1, g as l1, K as c1, h as h1, I as d1, i as u1, j as f1, k as lg, l as m0, m as p1 } from "./three-examples.js";
16
16
  import { f as m1, M as g1, $ as Uy, B as y1, v as Ny, m as $y, S as g0, a as cg, c as _1, b as Mf, d as b1, P as v1, R as pn, T as Wy, C as w1, V as x1, e as S1, W as C1, g as P1, h as O1 } from "./vendor.js";
@@ -1155,7 +1155,7 @@ class us {
1155
1155
  return null;
1156
1156
  }
1157
1157
  }
1158
- r(us, "planeGeometry", new Xs(2, 2, 1, 1)), r(us, "renderer"), r(us, "perspectiveCam", new ge()), r(us, "scene", new Ki()), r(us, "vertex", `
1158
+ r(us, "planeGeometry", new Xs(2, 2, 1, 1)), r(us, "renderer"), r(us, "perspectiveCam", new ye()), r(us, "scene", new Ki()), r(us, "vertex", `
1159
1159
  varying vec2 vUv;
1160
1160
  void main(){
1161
1161
  vUv = uv;
@@ -1313,7 +1313,7 @@ class gC {
1313
1313
  r(this, "onBeforeRender", () => {
1314
1314
  var e, i;
1315
1315
  const t = (e = this.context) == null ? void 0 : e.mainCamera;
1316
- if (this.context && t instanceof ge) {
1316
+ if (this.context && t instanceof ye) {
1317
1317
  const s = this.getRoot();
1318
1318
  Number.isNaN(s.position.x) && s.position.set(0, 0, 0), Number.isNaN(s.quaternion.x) && s.quaternion.set(0, 0, 0, 1), this.context.scene.add(this.targetObject);
1319
1319
  const o = ((i = this.context.xr) == null ? void 0 : i.rigScale) ?? 1, a = 3.5 * o, l = t.worldForward;
@@ -1754,15 +1754,15 @@ function RC() {
1754
1754
  return n || null;
1755
1755
  }
1756
1756
  const $0 = S("debugdefines");
1757
- Po('if(!globalThis[""4.1.0-beta.3""]) globalThis[""4.1.0-beta.3""] = "0.0.0";');
1757
+ Po('if(!globalThis[""4.1.0-beta.4""]) globalThis[""4.1.0-beta.4""] = "0.0.0";');
1758
1758
  Po('if(!globalThis[""undefined""]) globalThis[""undefined""] = "unknown";');
1759
- Po('if(!globalThis[""Thu Jan 30 2025 13:38:09 GMT+0100 (Central European Standard Time)""]) globalThis[""Thu Jan 30 2025 13:38:09 GMT+0100 (Central European Standard Time)""] = "unknown";');
1759
+ Po('if(!globalThis[""Mon Feb 03 2025 09:35:07 GMT+0100 (Central European Standard Time)""]) globalThis[""Mon Feb 03 2025 09:35:07 GMT+0100 (Central European Standard Time)""] = "unknown";');
1760
1760
  Po('if(!globalThis[""npk_0b7230d0d7c94c5ef23003726b2e2ccfc5ec0f20d26de8f0bda29e63698f9006""]) globalThis[""npk_0b7230d0d7c94c5ef23003726b2e2ccfc5ec0f20d26de8f0bda29e63698f9006""] = "unknown";');
1761
- Po('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.1.0-beta.3";');
1761
+ Po('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.1.0-beta.4";');
1762
1762
  Po('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
1763
- Po('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Jan 30 2025 13:38:09 GMT+0100 (Central European Standard Time)";');
1763
+ Po('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Mon Feb 03 2025 09:35:07 GMT+0100 (Central European Standard Time)";');
1764
1764
  Po('globalThis["__NEEDLE_PUBLIC_KEY__"] = "npk_0b7230d0d7c94c5ef23003726b2e2ccfc5ec0f20d26de8f0bda29e63698f9006";');
1765
- const $s = "4.1.0-beta.3", pg = "undefined", W0 = "Thu Jan 30 2025 13:38:09 GMT+0100 (Central European Standard Time)";
1765
+ const $s = "4.1.0-beta.4", pg = "undefined", W0 = "Mon Feb 03 2025 09:35:07 GMT+0100 (Central European Standard Time)";
1766
1766
  $0 && console.log(`Engine version: ${$s} (generator: ${pg})
1767
1767
  Project built at ${W0}`);
1768
1768
  const cd = "npk_0b7230d0d7c94c5ef23003726b2e2ccfc5ec0f20d26de8f0bda29e63698f9006", mo = "needle_isActiveInHierarchy", ra = "builtin_components", hd = "needle_editor_guid";
@@ -4310,7 +4310,7 @@ const Py = class {
4310
4310
  this.update(t, i), this._camera.parent !== this._scene && this._scene.add(this._camera), this._renderer.render(this._scene, this._camera);
4311
4311
  });
4312
4312
  r(this, "_objects", []);
4313
- this._mode = t, this._init = e, this._session = i, this._session.addEventListener("end", this.onEnd), this._renderer = new Mr({ alpha: !0 }), this._renderer.setAnimationLoop(this.onFrame), this._renderer.xr.setSession(i), this._renderer.xr.enabled = !0, this._camera = new ge(), this._scene = new Ki(), this._scene.fog = new t0(4473924, 10, 250), this._scene.add(this._camera), this.setupScene();
4313
+ this._mode = t, this._init = e, this._session = i, this._session.addEventListener("end", this.onEnd), this._renderer = new Mr({ alpha: !0 }), this._renderer.setAnimationLoop(this.onFrame), this._renderer.xr.setSession(i), this._renderer.xr.enabled = !0, this._camera = new ye(), this._scene = new Ki(), this._scene.fog = new t0(4473924, 10, 250), this._scene.add(this._camera), this.setupScene();
4314
4314
  }
4315
4315
  static get active() {
4316
4316
  return this._active;
@@ -5272,11 +5272,11 @@ ${o.hand ? "hand" : "ctrl"} ${o.inputSource.handedness}[${o.index}] con:${o.conn
5272
5272
  const i = Ie(this.rig.gameObject);
5273
5273
  e *= i.x;
5274
5274
  }
5275
- this._camera instanceof ge && this._camera.near > e && (this.originalCameraNearPlane = this._camera.near, this._camera.near = e);
5275
+ this._camera instanceof ye && this._camera.near > e && (this.originalCameraNearPlane = this._camera.near, this._camera.near = e);
5276
5276
  }
5277
5277
  }
5278
5278
  revertCustomForward() {
5279
- this._camera && this._previousCameraParent && this._previousCameraParent.add(this._camera), this._previousCameraParent = null, this._camera instanceof ge && this.originalCameraNearPlane != null && (this._camera.near = this.originalCameraNearPlane);
5279
+ this._camera && this._previousCameraParent && this._previousCameraParent.add(this._camera), this._previousCameraParent = null, this._camera instanceof ye && this.originalCameraNearPlane != null && (this._camera.near = this.originalCameraNearPlane);
5280
5280
  }
5281
5281
  internalUpdateState() {
5282
5282
  const t = this.context.renderer.xr.getReferenceSpace();
@@ -5302,7 +5302,7 @@ ${o.hand ? "hand" : "ctrl"} ${o.inputSource.handedness}[${o.index}] con:${o.conn
5302
5302
  }
5303
5303
  /** e.g. FadeToBlack */
5304
5304
  updateFade(t) {
5305
- this._transition && t instanceof ge && this._transition.update(t, this.context.time.deltaTime);
5305
+ this._transition && t instanceof ye && this._transition.update(t, this.context.time.deltaTime);
5306
5306
  }
5307
5307
  onUpdateFade_PostRender() {
5308
5308
  var t;
@@ -7064,7 +7064,7 @@ function iO() {
7064
7064
  };
7065
7065
  }
7066
7066
  iO();
7067
- Object.defineProperty(ge.prototype, "fov", {
7067
+ Object.defineProperty(ye.prototype, "fov", {
7068
7068
  get: function() {
7069
7069
  return this._fov;
7070
7070
  },
@@ -7074,7 +7074,7 @@ Object.defineProperty(ge.prototype, "fov", {
7074
7074
  },
7075
7075
  configurable: !0
7076
7076
  });
7077
- Object.defineProperty(ge.prototype, "near", {
7077
+ Object.defineProperty(ye.prototype, "near", {
7078
7078
  get: function() {
7079
7079
  return this._near;
7080
7080
  },
@@ -7084,7 +7084,7 @@ Object.defineProperty(ge.prototype, "near", {
7084
7084
  },
7085
7085
  configurable: !0
7086
7086
  });
7087
- Object.defineProperty(ge.prototype, "far", {
7087
+ Object.defineProperty(ye.prototype, "far", {
7088
7088
  get: function() {
7089
7089
  return this._far;
7090
7090
  },
@@ -10685,7 +10685,7 @@ const Pe = class {
10685
10685
  const t = this.mainCameraComponent;
10686
10686
  return t.threeCamera || t.buildCamera(), t.threeCamera;
10687
10687
  }
10688
- return this._fallbackCamera || (this._fallbackCamera = new ge(75, this.domWidth / this.domHeight, 0.1, 1e3)), this._fallbackCamera;
10688
+ return this._fallbackCamera || (this._fallbackCamera = new ye(75, this.domWidth / this.domHeight, 0.1, 1e3)), this._fallbackCamera;
10689
10689
  }
10690
10690
  /** Set the main camera of the scene. If set to null the camera of the {@link mainCameraComponent} will be used - this camera is used for rendering */
10691
10691
  set mainCamera(t) {
@@ -10735,8 +10735,14 @@ const Pe = class {
10735
10735
  if (!t)
10736
10736
  return;
10737
10737
  e === void 0 && (e = this.domWidth), i === void 0 && (i = this.domHeight);
10738
- const s = t.aspect;
10739
- t.aspect = e / i, s !== t.aspect && t.updateProjectionMatrix();
10738
+ const s = e / i;
10739
+ if (t.isPerspectiveCamera) {
10740
+ const o = t, a = o.aspect;
10741
+ o.aspect = s, a !== o.aspect && t.updateProjectionMatrix();
10742
+ } else if (t.isOrthographicCamera) {
10743
+ const o = t, a = o.top - o.bottom, c = a * s / 2, h = a / 2;
10744
+ (o.left != -c || o.top != h) && (o.left = -c, o.right = c, o.top = h, o.bottom = -h, t.updateProjectionMatrix());
10745
+ }
10740
10746
  }
10741
10747
  /** This will recreate the whole needle engine context and dispose the whole scene content
10742
10748
  * All content will be reloaded (loading times might be faster due to browser caches)
@@ -14378,54 +14384,54 @@ const km = (Fp = class extends D {
14378
14384
  this._lastPosition.copy(km.tempPosition), this._smoothedVelocity.lerp(e, this.context.time.deltaTime / 0.1);
14379
14385
  }
14380
14386
  }, r(Fp, "tempPosition", new v()), Fp);
14381
- let ye = km;
14387
+ let ge = km;
14382
14388
  Mi([
14383
14389
  zt()
14384
- ], ye.prototype, "autoMass", 2);
14390
+ ], ge.prototype, "autoMass", 2);
14385
14391
  Mi([
14386
14392
  f()
14387
- ], ye.prototype, "mass", 1);
14393
+ ], ge.prototype, "mass", 1);
14388
14394
  Mi([
14389
14395
  zt(),
14390
14396
  f()
14391
- ], ye.prototype, "useGravity", 2);
14397
+ ], ge.prototype, "useGravity", 2);
14392
14398
  Mi([
14393
14399
  f(v)
14394
- ], ye.prototype, "centerOfMass", 2);
14400
+ ], ge.prototype, "centerOfMass", 2);
14395
14401
  Mi([
14396
14402
  zt(),
14397
14403
  f()
14398
- ], ye.prototype, "constraints", 2);
14404
+ ], ge.prototype, "constraints", 2);
14399
14405
  Mi([
14400
14406
  zt(),
14401
14407
  f()
14402
- ], ye.prototype, "isKinematic", 2);
14408
+ ], ge.prototype, "isKinematic", 2);
14403
14409
  Mi([
14404
14410
  zt(),
14405
14411
  f()
14406
- ], ye.prototype, "drag", 2);
14412
+ ], ge.prototype, "drag", 2);
14407
14413
  Mi([
14408
14414
  zt(),
14409
14415
  f()
14410
- ], ye.prototype, "angularDrag", 2);
14416
+ ], ge.prototype, "angularDrag", 2);
14411
14417
  Mi([
14412
14418
  zt(),
14413
14419
  f()
14414
- ], ye.prototype, "detectCollisions", 2);
14420
+ ], ge.prototype, "detectCollisions", 2);
14415
14421
  Mi([
14416
14422
  zt(),
14417
14423
  f()
14418
- ], ye.prototype, "sleepThreshold", 2);
14424
+ ], ge.prototype, "sleepThreshold", 2);
14419
14425
  Mi([
14420
14426
  zt(),
14421
14427
  f()
14422
- ], ye.prototype, "collisionDetectionMode", 2);
14428
+ ], ge.prototype, "collisionDetectionMode", 2);
14423
14429
  Mi([
14424
14430
  zt()
14425
- ], ye.prototype, "_gravityScale", 2);
14431
+ ], ge.prototype, "_gravityScale", 2);
14426
14432
  Mi([
14427
14433
  zt()
14428
- ], ye.prototype, "dominanceGroup", 2);
14434
+ ], ge.prototype, "dominanceGroup", 2);
14429
14435
  new v();
14430
14436
  const TM = new W(), AM = new v(), Jn = S("debugsync"), Ic = "STRS";
14431
14437
  Y0(Ic, vn.getRootAsSyncedTransformModel);
@@ -14485,7 +14491,7 @@ class En extends D {
14485
14491
  }
14486
14492
  /** @internal */
14487
14493
  awake() {
14488
- Jn && console.log("new instance", this.guid, this), this._receivedDataBefore = !1, this._targetPosition = new v(), this._targetRotation = new W(), this.lastWorldPos = new v(), this.lastWorldRotation = new W(), this.rb = C.getComponentInChildren(this.gameObject, ye), this.rb && (this._wasKinematic = this.rb.isKinematic), this.receivedUpdate = !0, this._model = new K0(this.context.connection, this.guid), this.context.connection.isConnected && this.tryGetLastState(), this.joinedRoomCallback = this.tryGetLastState.bind(this), this.context.connection.beginListen(se.JoinedRoom, this.joinedRoomCallback), this.receivedDataCallback = this.onReceivedData.bind(this), this.context.connection.beginListenBinary(Ic, this.receivedDataCallback);
14494
+ Jn && console.log("new instance", this.guid, this), this._receivedDataBefore = !1, this._targetPosition = new v(), this._targetRotation = new W(), this.lastWorldPos = new v(), this.lastWorldRotation = new W(), this.rb = C.getComponentInChildren(this.gameObject, ge), this.rb && (this._wasKinematic = this.rb.isKinematic), this.receivedUpdate = !0, this._model = new K0(this.context.connection, this.guid), this.context.connection.isConnected && this.tryGetLastState(), this.joinedRoomCallback = this.tryGetLastState.bind(this), this.context.connection.beginListen(se.JoinedRoom, this.joinedRoomCallback), this.receivedDataCallback = this.onReceivedData.bind(this), this.context.connection.beginListenBinary(Ic, this.receivedDataCallback);
14489
14495
  }
14490
14496
  /** @internal */
14491
14497
  onDestroy() {
@@ -15913,7 +15919,7 @@ class _e extends D {
15913
15919
  const e = C.getComponent(this.gameObject, Re);
15914
15920
  this._camera = e;
15915
15921
  let i = e == null ? void 0 : e.threeCamera;
15916
- if (!i && this.gameObject instanceof ge && (i = this.gameObject), i && Jy(i, this, !0), !this._controls && i instanceof ge) {
15922
+ if (!i && this.gameObject instanceof ye && (i = this.gameObject), i && Jy(i, this, !0), !this._controls && i instanceof L) {
15917
15923
  this._cameraObject = i;
15918
15924
  const s = this.targetElement ?? this.context.renderer.domElement, o = i == null ? void 0 : i.quaternion.clone();
15919
15925
  this._controls = new u0(i, s), i == null || i.quaternion.copy(o), tp === void 0 && (tp = { ...this._controls.keys });
@@ -16135,9 +16141,9 @@ class _e extends D {
16135
16141
  }, 1e4), G.DrawWireBox3(y, 65280, 10), this._haveAttachedKeyboardEvents || (this._haveAttachedKeyboardEvents = !0, document.body.addEventListener("keydown", (te) => {
16136
16142
  if (te.code === "KeyF") {
16137
16143
  let K;
16138
- this._cameraObject instanceof ge && (K = Math.random() * Math.random() * 170 + 10), this.fitCamera({ objects: s, fitOffset: d, immediate: !1, fov: K });
16144
+ this._cameraObject instanceof ye && (K = Math.random() * Math.random() * 170 + 10), this.fitCamera({ objects: s, fitOffset: d, immediate: !1, fov: K });
16139
16145
  }
16140
- te.code === "KeyV" && this._cameraObject instanceof ge && (this._cameraObject.fov = 60);
16146
+ te.code === "KeyV" && this._cameraObject instanceof ye && (this._cameraObject.fov = 60);
16141
16147
  }));
16142
16148
  }
16143
16149
  a.update();
@@ -16249,18 +16255,18 @@ const Vl = (td = class extends D {
16249
16255
  }
16250
16256
  /** The camera's aspect ratio (width divided by height) if it is a perspective camera */
16251
16257
  get aspect() {
16252
- return this._cam instanceof ge ? this._cam.aspect : this.context.domWidth / this.context.domHeight;
16258
+ return this._cam instanceof ye ? this._cam.aspect : this.context.domWidth / this.context.domHeight;
16253
16259
  }
16254
16260
  set aspect(t) {
16255
- this._cam instanceof ge && this._cam.aspect !== t && (this._cam.aspect = t, this._cam.updateProjectionMatrix());
16261
+ this._cam instanceof ye && this._cam.aspect !== t && (this._cam.aspect = t, this._cam.updateProjectionMatrix());
16256
16262
  }
16257
- /** The camera's field of view in degrees if it is a perspective camera */
16263
+ /** The camera's field of view in degrees if it is a perspective camera. Calls updateProjectionMatrix when set */
16258
16264
  get fieldOfView() {
16259
- return this._cam instanceof ge ? this._cam.fov : this._fov;
16265
+ return this._cam instanceof ye ? this._cam.fov : this._fov;
16260
16266
  }
16261
16267
  set fieldOfView(t) {
16262
16268
  const e = this.fieldOfView != t;
16263
- if (this._fov = t, e && this._cam && this._cam instanceof ge) {
16269
+ if (this._fov = t, e && this._cam && this._cam instanceof ye) {
16264
16270
  if (this._fov === void 0) {
16265
16271
  console.warn("Can not set undefined fov on PerspectiveCamera");
16266
16272
  return;
@@ -16268,7 +16274,7 @@ const Vl = (td = class extends D {
16268
16274
  this._cam.fov = this._fov, this._cam.updateProjectionMatrix();
16269
16275
  }
16270
16276
  }
16271
- /** The camera's near clipping plane */
16277
+ /** The camera's near clipping plane. Calls updateProjectionMatrix when set */
16272
16278
  get nearClipPlane() {
16273
16279
  return this._nearClipPlane;
16274
16280
  }
@@ -16276,10 +16282,7 @@ const Vl = (td = class extends D {
16276
16282
  const e = this._nearClipPlane != t;
16277
16283
  this._nearClipPlane = t, this._cam && (e || this._cam.near != t) && (this._cam.near = t, this._cam.updateProjectionMatrix());
16278
16284
  }
16279
- applyClippingPlane() {
16280
- this._cam && (this._cam.near = this._nearClipPlane, this._cam.far = this._farClipPlane, this._cam.updateProjectionMatrix());
16281
- }
16282
- /** The camera's far clipping plane */
16285
+ /** The camera's far clipping plane. Calls updateProjectionMatrix when set */
16283
16286
  get farClipPlane() {
16284
16287
  return this._farClipPlane;
16285
16288
  }
@@ -16287,6 +16290,12 @@ const Vl = (td = class extends D {
16287
16290
  const e = this._farClipPlane != t;
16288
16291
  this._farClipPlane = t, this._cam && (e || this._cam.far != t) && (this._cam.far = t, this._cam.updateProjectionMatrix());
16289
16292
  }
16293
+ /**
16294
+ * Applys both the camera's near and far plane and calls updateProjectionMatrix on the camera.
16295
+ */
16296
+ applyClippingPlane() {
16297
+ this._cam && (this._cam.near = this._nearClipPlane, this._cam.far = this._farClipPlane, this._cam.updateProjectionMatrix());
16298
+ }
16290
16299
  get clearFlags() {
16291
16300
  return this._clearFlags;
16292
16301
  }
@@ -16424,10 +16433,10 @@ const Vl = (td = class extends D {
16424
16433
  return;
16425
16434
  const t = this.gameObject.isCamera;
16426
16435
  let e = null;
16427
- if (t ? (e = this.gameObject, e == null || e.layers.enableAll(), e instanceof ge && (this._fov = e.fov)) : e = this.gameObject.children[0], e && e.isCamera)
16428
- e instanceof ge && (this._fov && (e.fov = this._fov), e.near = this._nearClipPlane, e.far = this._farClipPlane, e.updateProjectionMatrix());
16436
+ if (t ? (e = this.gameObject, e == null || e.layers.enableAll(), e instanceof ye && (this._fov = e.fov)) : e = this.gameObject.children[0], e && e.isCamera)
16437
+ e instanceof ye && (this._fov && (e.fov = this._fov), e.near = this._nearClipPlane, e.far = this._farClipPlane, e.updateProjectionMatrix());
16429
16438
  else if (!this.orthographic)
16430
- e = new ge(this.fieldOfView, window.innerWidth / window.innerHeight, this._nearClipPlane, this._farClipPlane), this.fieldOfView && (e.fov = this.fieldOfView), this.gameObject.add(e);
16439
+ e = new ye(this.fieldOfView, window.innerWidth / window.innerHeight, this._nearClipPlane, this._farClipPlane), this.fieldOfView && (e.fov = this.fieldOfView), this.gameObject.add(e);
16431
16440
  else {
16432
16441
  const i = this.orthographicSize * 100;
16433
16442
  e = new ig(window.innerWidth / -i, window.innerWidth / i, window.innerHeight / i, window.innerHeight / -i, this._nearClipPlane, this._farClipPlane), this.gameObject.add(e);
@@ -18146,15 +18155,15 @@ class Ri extends D {
18146
18155
  }
18147
18156
  /** @internal */
18148
18157
  awake() {
18149
- super.awake(), this.attachedRigidbody || (this.attachedRigidbody = this.gameObject.getComponentInParent(ye));
18158
+ super.awake(), this.attachedRigidbody || (this.attachedRigidbody = this.gameObject.getComponentInParent(ge));
18150
18159
  }
18151
18160
  /** @internal */
18152
18161
  start() {
18153
- this.attachedRigidbody || (this.attachedRigidbody = this.gameObject.getComponentInParent(ye));
18162
+ this.attachedRigidbody || (this.attachedRigidbody = this.gameObject.getComponentInParent(ge));
18154
18163
  }
18155
18164
  /** @internal */
18156
18165
  onEnable() {
18157
- this.attachedRigidbody || (this.attachedRigidbody = this.gameObject.getComponentInParent(ye));
18166
+ this.attachedRigidbody || (this.attachedRigidbody = this.gameObject.getComponentInParent(ge));
18158
18167
  }
18159
18168
  /** @internal */
18160
18169
  onDisable() {
@@ -18173,7 +18182,7 @@ class Ri extends D {
18173
18182
  }
18174
18183
  }
18175
18184
  hi([
18176
- f(ye)
18185
+ f(ge)
18177
18186
  ], Ri.prototype, "attachedRigidbody", 2);
18178
18187
  hi([
18179
18188
  f()
@@ -18221,7 +18230,7 @@ const Hv = class extends Ri {
18221
18230
  const i = new Hv();
18222
18231
  t.geometry.boundingBox || t.geometry.computeBoundingBox();
18223
18232
  const s = t.geometry.boundingBox;
18224
- return i.size = s.getSize(new v()) || new v(1, 1, 1), i.center = s.getCenter(new v()) || new v(0, 0, 0), Qi(t, i), (e == null ? void 0 : e.rigidbody) === !0 && Qi(t, ye, { isKinematic: !1 }), i;
18233
+ return i.size = s.getSize(new v()) || new v(1, 1, 1), i.center = s.getCenter(new v()) || new v(0, 0, 0), Qi(t, i), (e == null ? void 0 : e.rigidbody) === !0 && Qi(t, ge, { isKinematic: !1 }), i;
18225
18234
  }
18226
18235
  onEnable() {
18227
18236
  var t;
@@ -18325,7 +18334,7 @@ class Ja extends D {
18325
18334
  r(this, "_contactVelocity", new v());
18326
18335
  }
18327
18336
  get rigidbody() {
18328
- return this._rigidbody ? this._rigidbody : (this._rigidbody = this.gameObject.getComponent(ye), this._rigidbody || (this._rigidbody = this.gameObject.addComponent(ye)), this.rigidbody);
18337
+ return this._rigidbody ? this._rigidbody : (this._rigidbody = this.gameObject.getComponent(ge), this._rigidbody || (this._rigidbody = this.gameObject.addComponent(ge)), this.rigidbody);
18329
18338
  }
18330
18339
  awake() {
18331
18340
  this._activeGroundCollisions = /* @__PURE__ */ new Set();
@@ -18773,7 +18782,7 @@ const ji = (jl = class extends D {
18773
18782
  for (const o of this._dragHandlers.values())
18774
18783
  o.setTargetObject(t);
18775
18784
  const e = "_rigidbody-was-kinematic";
18776
- ((i = this._rigidbody) == null ? void 0 : i[e]) === !1 && (this._rigidbody.isKinematic = !1, this._rigidbody[e] = void 0), this._rigidbody = null, t && (this._rigidbody = C.getComponentInChildren(t, ye), ((s = this._rigidbody) == null ? void 0 : s.isKinematic) === !1 && (this._rigidbody.isKinematic = !0, this._rigidbody[e] = !1));
18785
+ ((i = this._rigidbody) == null ? void 0 : i[e]) === !1 && (this._rigidbody.isKinematic = !1, this._rigidbody[e] = void 0), this._rigidbody = null, t && (this._rigidbody = C.getComponentInChildren(t, ge), ((s = this._rigidbody) == null ? void 0 : s.isKinematic) === !1 && (this._rigidbody.isKinematic = !0, this._rigidbody[e] = !1));
18777
18786
  }
18778
18787
  /** @internal */
18779
18788
  awake() {
@@ -18859,7 +18868,7 @@ const ji = (jl = class extends D {
18859
18868
  this._isDragging = !0;
18860
18869
  const s = C.getComponentInChildren(i, En);
18861
18870
  Us && console.log("DRAG START", s, i), s && (s.fastMode = !0, s == null || s.requestOwnership()), this._marker = C.addComponent(i, Hu), this._draggingRigidbodies.length = 0;
18862
- const o = C.getComponentsInChildren(i, ye);
18871
+ const o = C.getComponentsInChildren(i, ge);
18863
18872
  o && this._draggingRigidbodies.push(...o);
18864
18873
  }
18865
18874
  /** Called each frame as long as any pointer is dragging this object. */
@@ -22370,7 +22379,7 @@ function pw(n, t, e, i) {
22370
22379
  if (n.position.x === 0 && n.position.y === 0 && n.position.z === 0 && (l.position = null), n.quaternion.x === 0 && n.quaternion.y === 0 && n.quaternion.z === 0 && n.quaternion.w === 1 && (l.quaternion = null), n.scale.x === 1 && n.scale.y === 1 && n.scale.z === 1 && (l.scale = null), (n instanceof X || n instanceof On) && (o = n.geometry, a = n.material), i && !i(n) && (o = void 0, a = void 0), (n instanceof X || n instanceof On) && a && (a instanceof ai || a instanceof De || a instanceof Se && a.type === "MeshLineMaterial")) {
22371
22380
  const h = Wh(n), d = n instanceof On ? n : null;
22372
22381
  s = new Dt(n.uuid, h, l, o, a, void 0, d, n.animations);
22373
- } else if (n instanceof ge || n instanceof ig) {
22382
+ } else if (n instanceof ye || n instanceof ig) {
22374
22383
  const h = Wh(n);
22375
22384
  s = new Dt(n.uuid, h, l, void 0, void 0, n);
22376
22385
  } else {
@@ -22529,7 +22538,7 @@ async function Lk(n, t = 1 / 0, e = null, i = void 0) {
22529
22538
  }));
22530
22539
  const s = ea.uniforms;
22531
22540
  s.blitTexture.value = n, s.flipY.value = !1, s.scale.value = new pe(1, 1, 1, 1), i !== void 0 && s.scale.value.copy(i), ea.defines.IS_SRGB = n.colorSpace == gs, ea.needsUpdate = !0, $h || ($h = new X(hp, ea), $h.frustumCulled = !1);
22532
- const o = new ge(), a = new Ki();
22541
+ const o = new ye(), a = new Ki();
22533
22542
  a.add($h), e || (e = Nh = new Mr({ antialias: !1, alpha: !0, premultipliedAlpha: !1, preserveDrawingBuffer: !0 }));
22534
22543
  const l = Math.min(n.image.width, t), c = Math.min(n.image.height, t);
22535
22544
  Ht && (Ht.width !== l || Ht.height !== c) && (Ht.dispose(), Ht = null), Ht || (Ht = new wo(l, c, { format: wu, type: PS, minFilter: Fy, magFilter: Fy })), e.setRenderTarget(Ht), e.setSize(l, c), e.clear(), e.render(a, o), Nh && (Nh.dispose(), Nh = null);
@@ -24846,10 +24855,10 @@ class Kg {
24846
24855
  return "Physics";
24847
24856
  }
24848
24857
  onExportObject(t, e, i) {
24849
- const s = C.getComponents(t, ye).filter((c) => c.enabled), o = C.getComponents(t, Ri).filter((c) => c.enabled && !c.isTrigger);
24858
+ const s = C.getComponents(t, ge).filter((c) => c.enabled), o = C.getComponents(t, Ri).filter((c) => c.enabled && !c.isTrigger);
24850
24859
  let a = s.length > 0 ? s[0] : null;
24851
24860
  const l = o.length > 0 ? o[0] : null;
24852
- l && !a && (a = new ye(), a.isKinematic = !0), a && e.addEventListener("serialize", (c, h) => {
24861
+ l && !a && (a = new ge(), a.isKinematic = !0), a && e.addEventListener("serialize", (c, h) => {
24853
24862
  var d, u, p;
24854
24863
  if (a) {
24855
24864
  if (c.appendLine(), c.beginBlock('def RealityKitComponent "RigidBody"', "{", !0), a.useGravity || c.appendLine("bool gravityEnabled = 0"), c.appendLine('uniform token info:id = "RealityKit.RigidBody"'), a.isKinematic && c.appendLine('token motionType = "Kinematic"'), c.beginBlock('def RealityKitStruct "massFrame"', "{", !0), c.appendLine(`float m_mass = ${a.mass}`), c.beginBlock('def RealityKitStruct "m_pose"', "{", !0), c.appendLine(`float3 position = (${a.centerOfMass.x}, ${a.centerOfMass.y}, ${a.centerOfMass.z})`), c.closeBlock("}"), c.closeBlock("}"), o.length > 0) {
@@ -28522,7 +28531,7 @@ const Fm = (od = class extends D {
28522
28531
  const l = new Ik(), c = new Qu(this.quickLookCompatible);
28523
28532
  let h;
28524
28533
  const d = [];
28525
- this.interactive && (d.push(new Yg()), d.push(new Br()), globalThis.true && C.getComponentsInChildren(t, ye).length > 0 && (this.physics ? (h = new Kg(), d.push(h)) : U() && console.warn("USDZExporter: Physics export is disabled, but there are active Rigidbody components in the scene. They will not be exported.")), d.push(new Ju()), d.push(new ey()));
28534
+ this.interactive && (d.push(new Yg()), d.push(new Br()), globalThis.true && C.getComponentsInChildren(t, ge).length > 0 && (this.physics ? (h = new Kg(), d.push(h)) : U() && console.warn("USDZExporter: Physics export is disabled, but there are active Rigidbody components in the scene. They will not be exported.")), d.push(new Ju()), d.push(new ey()));
28526
28535
  const u = [c, ...d, ...this.extensions], p = { self: this, exporter: l, extensions: u, object: t };
28527
28536
  he.report("export-usdz", "Invoking before-export"), this.dispatchEvent(new CustomEvent("before-export", { detail: p })), this.applyWebARSessionRoot(), this._previousTimeScale = this.context.time.timeScale, this.context.time.timeScale = 0, he.report("export-usdz", "auto export animations and audio sources");
28528
28537
  const m = new Array();
@@ -28536,7 +28545,7 @@ const Fm = (od = class extends D {
28536
28545
  if (U() && c && h) {
28537
28546
  const O = c.animatedRoots;
28538
28547
  for (const R of O) {
28539
- const E = C.getComponentsInChildren(R, ye).filter((T) => T.enabled), j = C.getComponents(R, Ri).filter((T) => T.enabled && !T.isTrigger);
28548
+ const E = C.getComponentsInChildren(R, ge).filter((T) => T.enabled), j = C.getComponents(R, Ri).filter((T) => T.enabled && !T.isTrigger);
28540
28549
  (E.length > 0 || j.length > 0) && console.error("An animated object has physics components in its child hierarchy. This can lead to undefined behaviour due to a bug in Apple's QuickLook (FB15925487). Remove the physics components from child objects or verify that you get the expected results.", R);
28541
28550
  }
28542
28551
  }
@@ -28812,14 +28821,14 @@ class ly extends D {
28812
28821
  return this._rigidBody;
28813
28822
  }
28814
28823
  onEnable() {
28815
- this._rigidBody || (this._rigidBody = this.gameObject.getComponent(ye)), this.rigidBody && this.connectedBody && this.startCoroutine(this.create());
28824
+ this._rigidBody || (this._rigidBody = this.gameObject.getComponent(ge)), this.rigidBody && this.connectedBody && this.startCoroutine(this.create());
28816
28825
  }
28817
28826
  *create() {
28818
28827
  yield, this.rigidBody && this.connectedBody && this.activeAndEnabled && this.createJoint(this.rigidBody, this.connectedBody);
28819
28828
  }
28820
28829
  }
28821
28830
  ay([
28822
- f(ye)
28831
+ f(ge)
28823
28832
  ], ly.prototype, "connectedBody", 2);
28824
28833
  class Uw extends ly {
28825
28834
  createJoint(t, e) {
@@ -32353,7 +32362,7 @@ class Eo extends dt {
32353
32362
  return "ScreenSpaceAmbientOcclusion";
32354
32363
  }
32355
32364
  onBeforeRender() {
32356
- if (this._ssao && this.context.mainCamera instanceof ge) {
32365
+ if (this._ssao && this.context.mainCamera instanceof ye) {
32357
32366
  const e = this.context.mainCamera.far - this.context.mainCamera.near;
32358
32367
  this._ssao.ssaoMaterial.worldDistanceFalloff = e * 0.01, this._ssao.ssaoMaterial.worldDistanceThreshold = this.context.mainCamera.far;
32359
32368
  }
@@ -37576,7 +37585,7 @@ function zE(n, t) {
37576
37585
  e.add(n), $b.set(t, e), console.debug("Initialize texture for camera feed");
37577
37586
  const i = new De(), s = new Xs(), o = new Ki();
37578
37587
  o.add(new X(s, i));
37579
- const a = new ge();
37588
+ const a = new ye();
37580
37589
  i.map = t, n.render(o, a);
37581
37590
  }
37582
37591
  function QD(n, t, e, i = "image/webp", s) {
@@ -37615,7 +37624,7 @@ function hx(n) {
37615
37624
  const K = A.instances[te];
37616
37625
  bn(K.object, !0);
37617
37626
  }
37618
- })), t && (i.scene.background = null, l.setClearColor(0, 0)), n.background && (i.scene.background = null, l.setClearColor(n.background), n.background instanceof ve && l.setClearAlpha(n.background.a)), t && l.setClearAlpha(0), l.setSize(s, o, !1), "cam" in a && (a = a.threeCamera), a instanceof ge && (a.aspect = s / o, a.updateProjectionMatrix());
37627
+ })), t && (i.scene.background = null, l.setClearColor(0, 0)), n.background && (i.scene.background = null, l.setClearColor(n.background), n.background instanceof ve && l.setClearAlpha(n.background.a)), t && l.setClearAlpha(0), l.setSize(s, o, !1), "cam" in a && (a = a.threeCamera), a instanceof ye && (a.aspect = s / o, a.updateProjectionMatrix());
37619
37628
  const T = "type" in n && n.type === "texture";
37620
37629
  let z = null;
37621
37630
  T && (z = new wo(s, o, {
@@ -37630,7 +37639,7 @@ function hx(n) {
37630
37639
  scene: i.scene,
37631
37640
  camera: a,
37632
37641
  renderer: l
37633
- })) : i.renderNow(a || null), a instanceof ge && k != null && (a.aspect = k, a.updateProjectionMatrix()), E && j.forEach((A) => A.onAfterRender()), !e && "download_filename" in n && n.download_filename)
37642
+ })) : i.renderNow(a || null), a instanceof ye && k != null && (a.aspect = k, a.updateProjectionMatrix()), E && j.forEach((A) => A.onAfterRender()), !e && "download_filename" in n && n.download_filename)
37634
37643
  switch ((O = n.download_filename.split(".").pop()) == null ? void 0 : O.toLowerCase()) {
37635
37644
  case "png":
37636
37645
  e = "image/png";
@@ -37689,7 +37698,7 @@ function hx(n) {
37689
37698
  }
37690
37699
  return I;
37691
37700
  } finally {
37692
- l.setRenderTarget(_), i.scene.background = M, l.setSize(d, u, !1), l.setClearColor(b, x), k != null && a instanceof ge && (a.aspect = k, a.updateProjectionMatrix()), l.xr.enabled = y, l.xr.isPresenting = c, c || i.updateSize(!0);
37701
+ l.setRenderTarget(_), i.scene.background = M, l.setSize(d, u, !1), l.setClearColor(b, x), k != null && a instanceof ye && (a.aspect = k, a.updateProjectionMatrix()), l.xr.enabled = y, l.xr.isPresenting = c, c || i.updateSize(!0);
37693
37702
  }
37694
37703
  return null;
37695
37704
  }
@@ -37798,7 +37807,7 @@ class Pf extends D {
37798
37807
  r(this, "forceTextureInitialization", function() {
37799
37808
  const e = new De(), i = new Xs(), s = new Ki();
37800
37809
  s.add(new X(i, e));
37801
- const o = new ge();
37810
+ const o = new ye();
37802
37811
  return function(l, c) {
37803
37812
  e.map = c, l.render(s, o), Wb && console.warn("Force texture initialization");
37804
37813
  };
@@ -38631,7 +38640,7 @@ const YD = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
38631
38640
  RemoteSkybox: Dn,
38632
38641
  Renderer: et,
38633
38642
  RendererLightmap: Zd,
38634
- Rigidbody: ye,
38643
+ Rigidbody: ge,
38635
38644
  RotationBySpeedModule: ns,
38636
38645
  RotationOverLifetimeModule: vs,
38637
38646
  SceneSwitcher: Ct,
@@ -38862,7 +38871,7 @@ w.add("SkinnedMeshRenderer", aw);
38862
38871
  w.add("InstancingHandler", ao);
38863
38872
  w.add("InstanceHandle", Ta);
38864
38873
  w.add("RendererLightmap", Zd);
38865
- w.add("Rigidbody", ye);
38874
+ w.add("Rigidbody", ge);
38866
38875
  w.add("SceneSwitcher", Ct);
38867
38876
  w.add("ScreenCapture", qr);
38868
38877
  w.add("ShadowCatcher", pf);
@@ -40745,7 +40754,7 @@ class sL {
40745
40754
  const b = Ji([_]);
40746
40755
  a += b.getSize(new v()).y, a += 0.1;
40747
40756
  }
40748
- const l = new ge(20);
40757
+ const l = new ye(20);
40749
40758
  o.add(l);
40750
40759
  const c = t.environment || "https://dl.polyhaven.org/file/ph-assets/HDRIs/exr/1k/studio_small_09_1k.exr";
40751
40760
  if (c) {
@@ -40947,7 +40956,7 @@ const au = S("debugmissingcamera");
40947
40956
  fe.registerCallback(me.MissingCamera, (n) => {
40948
40957
  var l, c, h;
40949
40958
  au && console.warn("Creating missing camera");
40950
- const t = n.context.scene, e = new ge();
40959
+ const t = n.context.scene, e = new ye();
40951
40960
  e.name = "Default Fallback Camera", t.add(e);
40952
40961
  const i = new Re();
40953
40962
  i.sourceId = ((c = (l = n.files) == null ? void 0 : l[0]) == null ? void 0 : c.src) ?? "unknown", (h = n.context.domElement.getAttribute("skybox-image")) != null && h.length || 0 > 0 || n.context.lightmaps.tryGetSkybox(i.sourceId) ? i.clearFlags = mr.Skybox : i.clearFlags = mr.SolidColor, i.backgroundColor = new ve(0.5, 0.5, 0.5, 1), i.fieldOfView = 35, n.context.domElement.getAttribute("transparent") != null && (i.clearFlags = mr.Uninitialized), i.backgroundBlurriness = 0.2;
@@ -41481,7 +41490,7 @@ export {
41481
41490
  ui as g9,
41482
41491
  Ta as gA,
41483
41492
  Zd as gB,
41484
- ye as gC,
41493
+ ge as gC,
41485
41494
  Ct as gD,
41486
41495
  qr as gE,
41487
41496
  pf as gF,