@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.
- package/CHANGELOG.md +5 -1
- package/dist/gltf-progressive.js +59 -59
- package/dist/gltf-progressive.light.js +59 -59
- package/dist/gltf-progressive.light.min.js +6 -6
- package/dist/gltf-progressive.light.umd.cjs +5 -5
- package/dist/gltf-progressive.min.js +6 -6
- package/dist/gltf-progressive.umd.cjs +5 -5
- package/dist/needle-engine.bundle.js +85 -76
- package/dist/needle-engine.bundle.light.js +85 -76
- package/dist/needle-engine.bundle.light.min.js +38 -38
- package/dist/needle-engine.bundle.light.umd.cjs +3 -3
- package/dist/needle-engine.bundle.min.js +38 -38
- package/dist/needle-engine.bundle.umd.cjs +3 -3
- package/lib/engine/engine_context.d.ts +2 -2
- package/lib/engine/engine_context.js +25 -4
- package/lib/engine/engine_context.js.map +1 -1
- package/lib/engine-components/Camera.d.ts +7 -4
- package/lib/engine-components/Camera.js +13 -10
- package/lib/engine-components/Camera.js.map +1 -1
- package/lib/engine-components/OrbitControls.js +1 -1
- package/lib/engine-components/OrbitControls.js.map +1 -1
- package/package.json +2 -2
- package/src/engine/engine_context.ts +29 -8
- package/src/engine-components/Camera.ts +14 -11
- package/src/engine-components/OrbitControls.ts +1 -1
|
@@ -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 fe, Q as W, P as Xs, i as
|
|
13
|
+
import { g as oe, V as v, h as fe, Q as W, P as Xs, i as ye, j as Ki, k as ms, U as ho, M as X, W as Or, 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 Mr, p as On, 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 gt, J as Dx, K as Lx, N as s0, X as n0, S as bu, Y as yr, Z as vu, _ as jx, $ as Mn, a0 as o0, a1 as Bx, a2 as Fx, a3 as zx, a4 as Ux, a5 as Nx, a6 as or, 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 Rn, 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.light.js";
|
|
14
14
|
import { c as ag, g as h0, L as Xr, N as Ze, a as HS, b as GS, s as qS, d as XS } from "./gltf-progressive.light.js";
|
|
15
15
|
import { a as Fa, F as QS, T as YS, b as KS, G as _r, 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.light.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 mn, T as Wy, C as w1, V as x1, e as S1, W as C1, g as P1, h as O1 } from "./vendor.light.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
|
|
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
|
|
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.
|
|
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[""
|
|
1759
|
+
Po('if(!globalThis[""Mon Feb 03 2025 09:35:17 GMT+0100 (Central European Standard Time)""]) globalThis[""Mon Feb 03 2025 09:35:17 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.
|
|
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__"] = "
|
|
1763
|
+
Po('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Mon Feb 03 2025 09:35:17 GMT+0100 (Central European Standard Time)";');
|
|
1764
1764
|
Po('globalThis["__NEEDLE_PUBLIC_KEY__"] = "npk_0b7230d0d7c94c5ef23003726b2e2ccfc5ec0f20d26de8f0bda29e63698f9006";');
|
|
1765
|
-
const $s = "4.1.0-beta.
|
|
1765
|
+
const $s = "4.1.0-beta.4", pg = "undefined", W0 = "Mon Feb 03 2025 09:35:17 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 Or({ alpha: !0 }), this._renderer.setAnimationLoop(this.onFrame), this._renderer.xr.setSession(i), this._renderer.xr.enabled = !0, this._camera = new
|
|
4313
|
+
this._mode = t, this._init = e, this._session = i, this._session.addEventListener("end", this.onEnd), this._renderer = new Or({ 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
|
|
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
|
|
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
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
|
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 =
|
|
10739
|
-
|
|
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
|
|
14387
|
+
let ge = km;
|
|
14382
14388
|
Mi([
|
|
14383
14389
|
zt()
|
|
14384
|
-
],
|
|
14390
|
+
], ge.prototype, "autoMass", 2);
|
|
14385
14391
|
Mi([
|
|
14386
14392
|
f()
|
|
14387
|
-
],
|
|
14393
|
+
], ge.prototype, "mass", 1);
|
|
14388
14394
|
Mi([
|
|
14389
14395
|
zt(),
|
|
14390
14396
|
f()
|
|
14391
|
-
],
|
|
14397
|
+
], ge.prototype, "useGravity", 2);
|
|
14392
14398
|
Mi([
|
|
14393
14399
|
f(v)
|
|
14394
|
-
],
|
|
14400
|
+
], ge.prototype, "centerOfMass", 2);
|
|
14395
14401
|
Mi([
|
|
14396
14402
|
zt(),
|
|
14397
14403
|
f()
|
|
14398
|
-
],
|
|
14404
|
+
], ge.prototype, "constraints", 2);
|
|
14399
14405
|
Mi([
|
|
14400
14406
|
zt(),
|
|
14401
14407
|
f()
|
|
14402
|
-
],
|
|
14408
|
+
], ge.prototype, "isKinematic", 2);
|
|
14403
14409
|
Mi([
|
|
14404
14410
|
zt(),
|
|
14405
14411
|
f()
|
|
14406
|
-
],
|
|
14412
|
+
], ge.prototype, "drag", 2);
|
|
14407
14413
|
Mi([
|
|
14408
14414
|
zt(),
|
|
14409
14415
|
f()
|
|
14410
|
-
],
|
|
14416
|
+
], ge.prototype, "angularDrag", 2);
|
|
14411
14417
|
Mi([
|
|
14412
14418
|
zt(),
|
|
14413
14419
|
f()
|
|
14414
|
-
],
|
|
14420
|
+
], ge.prototype, "detectCollisions", 2);
|
|
14415
14421
|
Mi([
|
|
14416
14422
|
zt(),
|
|
14417
14423
|
f()
|
|
14418
|
-
],
|
|
14424
|
+
], ge.prototype, "sleepThreshold", 2);
|
|
14419
14425
|
Mi([
|
|
14420
14426
|
zt(),
|
|
14421
14427
|
f()
|
|
14422
|
-
],
|
|
14428
|
+
], ge.prototype, "collisionDetectionMode", 2);
|
|
14423
14429
|
Mi([
|
|
14424
14430
|
zt()
|
|
14425
|
-
],
|
|
14431
|
+
], ge.prototype, "_gravityScale", 2);
|
|
14426
14432
|
Mi([
|
|
14427
14433
|
zt()
|
|
14428
|
-
],
|
|
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, wn.getRootAsSyncedTransformModel);
|
|
@@ -14485,7 +14491,7 @@ class In 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,
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
16428
|
-
e instanceof
|
|
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
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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,
|
|
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(
|
|
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,
|
|
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, In);
|
|
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,
|
|
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 Mn) && (o = n.geometry, a = n.material), i && !i(n) && (o = void 0, a = void 0), (n instanceof X || n instanceof Mn) && a && (a instanceof ai || a instanceof De || a instanceof Se && a.type === "MeshLineMaterial")) {
|
|
22371
22380
|
const h = Wh(n), d = n instanceof Mn ? n : null;
|
|
22372
22381
|
s = new Dt(n.uuid, h, l, o, a, void 0, d, n.animations);
|
|
22373
|
-
} else if (n instanceof
|
|
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 = Jr.uniforms;
|
|
22531
22540
|
s.blitTexture.value = n, s.flipY.value = !1, s.scale.value = new fe(1, 1, 1, 1), i !== void 0 && s.scale.value.copy(i), Jr.defines.IS_SRGB = n.colorSpace == gs, Jr.needsUpdate = !0, $h || ($h = new X(hp, Jr), $h.frustumCulled = !1);
|
|
22532
|
-
const o = new
|
|
22541
|
+
const o = new ye(), a = new Ki();
|
|
22533
22542
|
a.add($h), e || (e = Nh = new Or({ 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,
|
|
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
|
|
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 jr()), globalThis.false && C.getComponentsInChildren(t,
|
|
28534
|
+
this.interactive && (d.push(new Yg()), d.push(new jr()), globalThis.false && 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,
|
|
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(
|
|
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(
|
|
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 ht {
|
|
|
32353
32362
|
return "ScreenSpaceAmbientOcclusion";
|
|
32354
32363
|
}
|
|
32355
32364
|
onBeforeRender() {
|
|
32356
|
-
if (this._ssao && this.context.mainCamera instanceof
|
|
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
|
}
|
|
@@ -37579,7 +37588,7 @@ function zE(n, t) {
|
|
|
37579
37588
|
e.add(n), $b.set(t, e), console.debug("Initialize texture for camera feed");
|
|
37580
37589
|
const i = new De(), s = new Xs(), o = new Ki();
|
|
37581
37590
|
o.add(new X(s, i));
|
|
37582
|
-
const a = new
|
|
37591
|
+
const a = new ye();
|
|
37583
37592
|
i.map = t, n.render(o, a);
|
|
37584
37593
|
}
|
|
37585
37594
|
function QD(n, t, e, i = "image/webp", s) {
|
|
@@ -37618,7 +37627,7 @@ function hx(n) {
|
|
|
37618
37627
|
const K = A.instances[te];
|
|
37619
37628
|
vn(K.object, !0);
|
|
37620
37629
|
}
|
|
37621
|
-
})), 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
|
|
37630
|
+
})), 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());
|
|
37622
37631
|
const T = "type" in n && n.type === "texture";
|
|
37623
37632
|
let z = null;
|
|
37624
37633
|
T && (z = new wo(s, o, {
|
|
@@ -37633,7 +37642,7 @@ function hx(n) {
|
|
|
37633
37642
|
scene: i.scene,
|
|
37634
37643
|
camera: a,
|
|
37635
37644
|
renderer: l
|
|
37636
|
-
})) : i.renderNow(a || null), a instanceof
|
|
37645
|
+
})) : 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)
|
|
37637
37646
|
switch ((O = n.download_filename.split(".").pop()) == null ? void 0 : O.toLowerCase()) {
|
|
37638
37647
|
case "png":
|
|
37639
37648
|
e = "image/png";
|
|
@@ -37692,7 +37701,7 @@ function hx(n) {
|
|
|
37692
37701
|
}
|
|
37693
37702
|
return I;
|
|
37694
37703
|
} finally {
|
|
37695
|
-
l.setRenderTarget(_), i.scene.background = M, l.setSize(d, u, !1), l.setClearColor(b, x), k != null && a instanceof
|
|
37704
|
+
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);
|
|
37696
37705
|
}
|
|
37697
37706
|
return null;
|
|
37698
37707
|
}
|
|
@@ -37801,7 +37810,7 @@ class Pf extends D {
|
|
|
37801
37810
|
r(this, "forceTextureInitialization", function() {
|
|
37802
37811
|
const e = new De(), i = new Xs(), s = new Ki();
|
|
37803
37812
|
s.add(new X(i, e));
|
|
37804
|
-
const o = new
|
|
37813
|
+
const o = new ye();
|
|
37805
37814
|
return function(l, c) {
|
|
37806
37815
|
e.map = c, l.render(s, o), Wb && console.warn("Force texture initialization");
|
|
37807
37816
|
};
|
|
@@ -38634,7 +38643,7 @@ const YD = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
38634
38643
|
RemoteSkybox: Ln,
|
|
38635
38644
|
Renderer: Je,
|
|
38636
38645
|
RendererLightmap: Zd,
|
|
38637
|
-
Rigidbody:
|
|
38646
|
+
Rigidbody: ge,
|
|
38638
38647
|
RotationBySpeedModule: ns,
|
|
38639
38648
|
RotationOverLifetimeModule: vs,
|
|
38640
38649
|
SceneSwitcher: St,
|
|
@@ -38865,7 +38874,7 @@ w.add("SkinnedMeshRenderer", aw);
|
|
|
38865
38874
|
w.add("InstancingHandler", ao);
|
|
38866
38875
|
w.add("InstanceHandle", Ta);
|
|
38867
38876
|
w.add("RendererLightmap", Zd);
|
|
38868
|
-
w.add("Rigidbody",
|
|
38877
|
+
w.add("Rigidbody", ge);
|
|
38869
38878
|
w.add("SceneSwitcher", St);
|
|
38870
38879
|
w.add("ScreenCapture", Gr);
|
|
38871
38880
|
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
|
|
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
|
pe.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
|
|
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 = pr.Skybox : i.clearFlags = pr.SolidColor, i.backgroundColor = new ve(0.5, 0.5, 0.5, 1), i.fieldOfView = 35, n.context.domElement.getAttribute("transparent") != null && (i.clearFlags = pr.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
|
-
|
|
41493
|
+
ge as gC,
|
|
41485
41494
|
St as gD,
|
|
41486
41495
|
Gr as gE,
|
|
41487
41496
|
pf as gF,
|