@needle-tools/engine 6.0.0-alpha.4 → 6.0.0-alpha.5
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 +4 -0
- package/README.md +11 -1
- package/dist/{gltf-progressive-CcSfG2Ja.js → gltf-progressive-B7lOWdLe.js} +117 -115
- package/dist/gltf-progressive-BpT9M5Mt.umd.cjs +10 -0
- package/dist/gltf-progressive-D0rzvhNG.min.js +10 -0
- package/dist/{needle-engine.bundle-0tD9EcNs.js → needle-engine.bundle-4xlWxOTF.js} +592 -581
- package/dist/{needle-engine.bundle-BuUj9B4K.umd.cjs → needle-engine.bundle-D3nBMgfk.umd.cjs} +9 -9
- package/dist/{needle-engine.bundle-Bmcb5t3w.min.js → needle-engine.bundle-_kAszB-k.min.js} +27 -27
- package/dist/needle-engine.d.ts +13 -13
- package/dist/needle-engine.js +575 -575
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/lib/engine/api.d.ts +1 -1
- package/lib/engine/api.js +1 -1
- package/lib/engine/api.js.map +1 -1
- package/lib/engine/engine_init.js +2 -2
- package/lib/engine/engine_license.d.ts +7 -7
- package/lib/engine/engine_license.js +98 -78
- package/lib/engine/engine_license.js.map +1 -1
- package/lib/engine/engine_networking_blob.js +3 -3
- package/lib/engine/engine_networking_blob.js.map +1 -1
- package/lib/engine/engine_utils_qrcode.js +2 -2
- package/lib/engine/engine_utils_qrcode.js.map +1 -1
- package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js +2 -2
- package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js.map +1 -1
- package/lib/engine/webcomponents/needle menu/needle-menu.js +5 -5
- package/lib/engine/webcomponents/needle menu/needle-menu.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.js +2 -2
- package/lib/engine/webcomponents/needle-engine.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.loading.js +2 -2
- package/lib/engine/webcomponents/needle-engine.loading.js.map +1 -1
- package/lib/engine/xr/TempXRContext.js +2 -2
- package/lib/engine/xr/TempXRContext.js.map +1 -1
- package/lib/engine-components/export/usdz/USDZExporter.js +4 -4
- package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
- package/package.json +5 -2
- package/plugins/common/license.js +4 -4
- package/plugins/license/README.md +38 -0
- package/plugins/license/cli.js +43 -0
- package/plugins/license/index.js +24 -0
- package/plugins/vite/license.js +4 -4
- package/src/engine/api.ts +1 -1
- package/src/engine/engine_init.ts +2 -2
- package/src/engine/engine_license.ts +93 -76
- package/src/engine/engine_networking_blob.ts +3 -3
- package/src/engine/engine_utils_qrcode.ts +2 -2
- package/src/engine/webcomponents/needle menu/needle-menu-spatial.ts +2 -2
- package/src/engine/webcomponents/needle menu/needle-menu.ts +5 -5
- package/src/engine/webcomponents/needle-engine.loading.ts +2 -2
- package/src/engine/webcomponents/needle-engine.ts +2 -2
- package/src/engine/xr/TempXRContext.ts +2 -2
- package/src/engine-components/export/usdz/USDZExporter.ts +4 -4
- package/dist/gltf-progressive-BYG9UH7O.min.js +0 -10
- package/dist/gltf-progressive-sK--FWg7.umd.cjs +0 -10
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var _P = Object.defineProperty;
|
|
2
2
|
var bP = (s, e, t) => e in s ? _P(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
3
|
var Xb = (s, e, t) => bP(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { Vector2 as ee, Vector3 as w, Vector4 as ve, Quaternion as
|
|
5
|
-
import { createLoaders as n_, LODsManager as vr, NEEDLE_progressive as qe, getRaycastMesh as yx, calculateMeshLODLevel as Ak, getLODColor as Ik, addDracoAndKTX2Loaders as Lk, configureLoader as Dk, setKTX2TranscoderLocation as Fk, setDracoDecoderLocation as Bk } from "./gltf-progressive-
|
|
6
|
-
import { GroundedSkybox as _l, Font as jk, TextGeometry as
|
|
4
|
+
import { Vector2 as ee, Vector3 as w, Vector4 as ve, Quaternion as U, Box3 as li, ShadowMaterial as ix, Euler as Be, PlaneGeometry as zn, WebGLRenderer as ca, PerspectiveCamera as pe, OrthographicCamera as Df, Scene as zi, Mesh as V, Texture as ke, Uniform as an, Color as oe, ShaderMaterial as ps, MeshStandardMaterial as Tt, Box3Helper as vP, GridHelper as nx, Object3D as E, Material as Pe, Matrix3 as Hy, Matrix4 as Z, Layers as Xo, PropertyBinding as ml, AnimationClip as Yt, KeyframeTrack as wP, FileLoader as sx, BufferGeometry as In, TextureLoader as Jr, MeshBasicMaterial as Le, DoubleSide as Ni, Group as Ln, CylinderGeometry as ox, SphereGeometry as qy, BoxGeometry as gl, SpriteMaterial as xP, Sprite as SP, Shape as CP, ExtrudeGeometry as PP, Ray as ms, CubeUVReflectionMapping as cn, LinearSRGBColorSpace as Ys, ShaderChunk as ai, Sphere as Fh, DataTexture as Xy, RGBAFormat as Ff, EquirectangularReflectionMapping as Vs, SRGBColorSpace as Ks, PMREMGenerator as kP, NeutralToneMapping as yl, AgXToneMapping as Bf, ACESFilmicToneMapping as jf, NoToneMapping as Nu, AxesHelper as ji, MathUtils as Gs, Fog as rx, DirectionalLight as bg, PointLight as Qy, PCFShadowMap as OP, BasicNodeLibrary as TP, WebGLRenderTarget as gs, DepthTexture as ax, NearestFilter as $u, EdgesGeometry as RP, LineSegments as vg, LineBasicMaterial as Wu, Line as ph, BufferAttribute as lt, Raycaster as Yy, ArrayCamera as EP, Plane as Rl, SkinnedMesh as zo, InterleavedBufferAttribute as lx, Skeleton as MP, Bone as AP, Audio as cx, AudioListener as hx, WebGLCubeRenderTarget as IP, CubeCamera as LP, LoopRepeat as DP, LoopOnce as wg, AnimationMixer as Ky, InterpolateLinear as FP, InterpolateDiscrete as BP, InterpolateSmooth as jP, QuaternionKeyframeTrack as Ec, BooleanKeyframeTrack as Qb, VectorKeyframeTrack as Mc, ColorKeyframeTrack as Yb, NumberKeyframeTrack as Qp, AudioContext as dx, CompressedTexture as UP, FrontSide as Qo, Camera as zP, Frustum as Kb, PositionalAudio as NP, AudioLoader as $P, BackSide as Uf, EquirectangularRefractionMapping as Zy, CubeTexture as Jy, CompressedCubeTexture as ux, MeshDepthMaterial as WP, CustomBlending as VP, MaxEquation as GP, AlwaysStencilFunc as HP, GreaterEqualStencilFunc as qP, NotEqualStencilFunc as XP, GreaterStencilFunc as QP, LessEqualStencilFunc as YP, EqualStencilFunc as KP, LessStencilFunc as ZP, NeverStencilFunc as Zb, InvertStencilOp as JP, DecrementWrapStencilOp as ek, IncrementWrapStencilOp as tk, DecrementStencilOp as ik, IncrementStencilOp as nk, ReplaceStencilOp as sk, ZeroStencilOp as ok, KeepStencilOp as rk, AmbientLight as ak, HemisphereLight as lk, Loader as ck, GLSL3 as hk, AlwaysDepth as dk, GreaterEqualDepth as uk, GreaterDepth as fk, LessEqualDepth as pk, LessDepth as mk, NotEqualDepth as gk, EqualDepth as yk, RawShaderMaterial as fx, BatchedMesh as Jb, LinearFilter as Vu, UnsignedByteType as _k, MeshPhysicalMaterial as ev, RingGeometry as bk, Line3 as vk, AdditiveBlending as px, LoadingManager as mx, BoxHelper as wk, SpotLight as xk, DirectionalLightHelper as Sk, CameraHelper as Ck, LOD as Pk, Triangle as kk, NormalBlending as Ok, ReinhardToneMapping as e_, LinearToneMapping as t_, EventDispatcher as i_, VideoTexture as Tk, CatmullRomCurve3 as Rk, MirroredRepeatWrapping as tv, ShaderLib as Gu, UniformsUtils as gx, MeshNormalMaterial as Ek, HalfFloatType as Yp, Source as Mk } from "./three-core.js";
|
|
5
|
+
import { createLoaders as n_, LODsManager as vr, NEEDLE_progressive as qe, getRaycastMesh as yx, calculateMeshLODLevel as Ak, getLODColor as Ik, addDracoAndKTX2Loaders as Lk, configureLoader as Dk, setKTX2TranscoderLocation as Fk, setDracoDecoderLocation as Bk } from "./gltf-progressive-B7lOWdLe.js";
|
|
6
|
+
import { GroundedSkybox as _l, Font as jk, TextGeometry as Uk, FontLoader as zk, GLTFLoader as Zs, EXRLoader as s_, HDRLoader as _x, Stats as Nk, nodeFrame as Oi, TransformControlsGizmo as iv, OrbitControls as $k, PositionalAudioHelper as Wk, HorizontalBlurShader as Vk, VerticalBlurShader as Gk, GLTFExporter as bx, strToU8 as vx, zipSync as Hk, XRControllerModelFactory as qk, Line2 as Xk, LineGeometry as Qk, LineMaterial as Yk, OBJLoader as o_, FBXLoader as wx, TransformControls as Kk, InteractiveGroup as Zk, HTMLMesh as Jk, VertexNormalsHelper as eO, mergeVertices as tO } from "./three-examples.js";
|
|
7
7
|
import { v5 as xg, ByteBuffer as iO, fetchProfile as nO, MotionController as sO, SIZE_PREFIX_LENGTH as xx, Builder as r_, attachNeedleIdsToLoadedGltf as oO, createNoise4D as rO, Matrix4 as Kp, BatchedParticleRenderer as aO, ParticleSystem as lO, RenderMode as Ds, ConstantColor as cO, Vector4 as hO, ConstantValue as dO, TrailParticle as nv, deriveInstanceId as Zp, PROJECT_DOCUMENT_KEY as uO, isProjectDocument as fO, applyDef as pO, applyOver as mO, evaluateProjectDocument as gO, resolveMaterialEntity as yO, createOverApplyState as _O, reportProjectIssues as bO, resolveDocumentRemoteSrc as vO, splitPath as wO, WorkerBase as xO, MeshBVH as SO } from "./vendor-BQUQwut5.js";
|
|
8
8
|
import { __webpack_exports__default as Me, __webpack_exports__Text as Sx, __webpack_exports__update as CO, __webpack_exports__Block as Cx, SimpleStateBehavior as PO, __webpack_exports__Inline as Jp, __webpack_exports__FontLibrary as sv, ThreeMeshUI as ov } from "./three-mesh-ui-CkQrFn5S.js";
|
|
9
9
|
const rv = typeof window < "u" ? window.location.search.includes("debugcontext") : !1;
|
|
@@ -123,12 +123,12 @@ Example: ${i} will show an onscreen console window.`
|
|
|
123
123
|
console.groupEnd();
|
|
124
124
|
}
|
|
125
125
|
}, 100);
|
|
126
|
-
function
|
|
126
|
+
function zf() {
|
|
127
127
|
return new URLSearchParams(globalThis.location?.search);
|
|
128
128
|
}
|
|
129
129
|
function x(s) {
|
|
130
130
|
Ir && !Sg.includes(s) && Sg.push(s);
|
|
131
|
-
const e =
|
|
131
|
+
const e = zf();
|
|
132
132
|
if (e.has(s)) {
|
|
133
133
|
const t = e.get(s);
|
|
134
134
|
if (t) {
|
|
@@ -140,11 +140,11 @@ function x(s) {
|
|
|
140
140
|
}
|
|
141
141
|
Ir = x("help");
|
|
142
142
|
function c5(s, e) {
|
|
143
|
-
const t =
|
|
143
|
+
const t = zf();
|
|
144
144
|
t.has(s) ? t.set(s, e) : t.append(s, e), document.location.search = t.toString();
|
|
145
145
|
}
|
|
146
146
|
function Hu(s, e, t = !0) {
|
|
147
|
-
const i =
|
|
147
|
+
const i = zf();
|
|
148
148
|
i.has(s) ? e === null ? i.delete(s) : i.set(s, e) : e !== null && i.append(s, e), t ? TO(s, i) : Px(s, i);
|
|
149
149
|
}
|
|
150
150
|
function av(s, e, t) {
|
|
@@ -349,7 +349,7 @@ function l_(s, e) {
|
|
|
349
349
|
s[Fa] = new No(s, ["x", "y"]);
|
|
350
350
|
else if (s instanceof w)
|
|
351
351
|
s[Fa] = new No(s, ["x", "y", "z"]);
|
|
352
|
-
else if (s instanceof ve || s instanceof
|
|
352
|
+
else if (s instanceof ve || s instanceof U)
|
|
353
353
|
s[Fa] = new No(s, ["x", "y", "z", "w"]);
|
|
354
354
|
else
|
|
355
355
|
return !1;
|
|
@@ -567,7 +567,7 @@ function jO(s) {
|
|
|
567
567
|
Pg.push(s);
|
|
568
568
|
}
|
|
569
569
|
let im = !1;
|
|
570
|
-
function
|
|
570
|
+
function UO(...s) {
|
|
571
571
|
if (!im) {
|
|
572
572
|
im = !0;
|
|
573
573
|
try {
|
|
@@ -579,18 +579,18 @@ function zO(...s) {
|
|
|
579
579
|
im = !1;
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
|
-
const Rx = console.error,
|
|
582
|
+
const Rx = console.error, zO = function(...s) {
|
|
583
583
|
Rx.apply(console, s), WO(s), Fr(2, s, {}), $O(...s);
|
|
584
584
|
};
|
|
585
585
|
function NO(s) {
|
|
586
|
-
c_ = !s, s ? console.error =
|
|
586
|
+
c_ = !s, s ? console.error = zO : console.error = Rx;
|
|
587
587
|
}
|
|
588
588
|
function C5(s) {
|
|
589
589
|
return NO(s);
|
|
590
590
|
}
|
|
591
591
|
let Ex = 0;
|
|
592
592
|
function $O(...s) {
|
|
593
|
-
Ex += 1,
|
|
593
|
+
Ex += 1, UO(...s);
|
|
594
594
|
}
|
|
595
595
|
function WO(s) {
|
|
596
596
|
if (Array.isArray(s))
|
|
@@ -1046,7 +1046,7 @@ function nT(s, e, t) {
|
|
|
1046
1046
|
const i = s.length(), n = e.length(), o = B.lerp(i, n, t);
|
|
1047
1047
|
return s.lerp(e, t).normalize().multiplyScalar(o);
|
|
1048
1048
|
}
|
|
1049
|
-
const om = new
|
|
1049
|
+
const om = new U(), Ix = new U().setFromAxisAngle(new w(0, 1, 0), Math.PI);
|
|
1050
1050
|
function O5(s, e) {
|
|
1051
1051
|
s.lookAt(e), s.quaternion.multiply(Ix);
|
|
1052
1052
|
}
|
|
@@ -1066,7 +1066,7 @@ function $f(s, e, t = !0, i = !1) {
|
|
|
1066
1066
|
}
|
|
1067
1067
|
function T5(s, e, t, i = 1) {
|
|
1068
1068
|
if (t) {
|
|
1069
|
-
const n =
|
|
1069
|
+
const n = z(0, 0, 0), o = e.x / window.innerWidth * 2 - 1, r = -(e.y / window.innerHeight) * 2 + 1;
|
|
1070
1070
|
n.set(
|
|
1071
1071
|
o,
|
|
1072
1072
|
r,
|
|
@@ -1080,7 +1080,7 @@ function T5(s, e, t, i = 1) {
|
|
|
1080
1080
|
return null;
|
|
1081
1081
|
}
|
|
1082
1082
|
const sT = new dn(() => new w(), 100);
|
|
1083
|
-
function
|
|
1083
|
+
function z(s, e, t) {
|
|
1084
1084
|
const i = sT.get();
|
|
1085
1085
|
return i.set(0, 0, 0), s instanceof w ? i.copy(s) : Array.isArray(s) ? i.set(s[0], s[1], s[2]) : s instanceof DOMPointReadOnly ? i.set(s.x, s.y, s.z) : typeof s == "number" ? (i.x = s, i.y = e !== void 0 ? e : i.x, i.z = t !== void 0 ? t : i.x) : typeof s == "object" && (i.x = s.x, i.y = s.y, i.z = s.z), i;
|
|
1086
1086
|
}
|
|
@@ -1089,10 +1089,10 @@ function rT(s) {
|
|
|
1089
1089
|
const e = oT.get();
|
|
1090
1090
|
return s ? e.copy(s) : e.set(0, 0, 0), e;
|
|
1091
1091
|
}
|
|
1092
|
-
const aT = new dn(() => new
|
|
1092
|
+
const aT = new dn(() => new U(), 100);
|
|
1093
1093
|
function Mi(s, e, t, i) {
|
|
1094
1094
|
const n = aT.get();
|
|
1095
|
-
return n.identity(), s instanceof
|
|
1095
|
+
return n.identity(), s instanceof U ? n.copy(s) : s instanceof DOMPointReadOnly ? n.set(s.x, s.y, s.z, s.w) : typeof s == "number" && e !== void 0 && t !== void 0 && i !== void 0 ? n.set(s, e, t, i) : typeof s == "object" && "x" in s && "y" in s && "z" in s && "w" in s && n.set(s.x, s.y, s.z, s.w), n;
|
|
1096
1096
|
}
|
|
1097
1097
|
const h_ = new dn(() => new w(), 100), gv = /* @__PURE__ */ Symbol("lastMatrixWorldUpdateKey");
|
|
1098
1098
|
function le(s, e = null, t = !0) {
|
|
@@ -1108,7 +1108,7 @@ function bl(s, e, t, i) {
|
|
|
1108
1108
|
const n = h_.get();
|
|
1109
1109
|
return n.set(e, t, i), un(s, n), s;
|
|
1110
1110
|
}
|
|
1111
|
-
const Qu = new dn(() => new
|
|
1111
|
+
const Qu = new dn(() => new U(), 100), Gr = new U(), rm = new U();
|
|
1112
1112
|
function Ie(s, e = null) {
|
|
1113
1113
|
if (!s) return Qu.get().identity();
|
|
1114
1114
|
const t = e ?? Qu.get();
|
|
@@ -1138,11 +1138,11 @@ function mh(s, e) {
|
|
|
1138
1138
|
const t = cT;
|
|
1139
1139
|
s.parent.getWorldScale(t), s.scale.copy(e), s.scale.divide(t);
|
|
1140
1140
|
}
|
|
1141
|
-
const hT = new w(), yv = new
|
|
1141
|
+
const hT = new w(), yv = new U();
|
|
1142
1142
|
function R5(s) {
|
|
1143
1143
|
return Ie(s, yv), hT.set(0, 0, 1).applyQuaternion(yv);
|
|
1144
1144
|
}
|
|
1145
|
-
const dT = new dn(() => new w(), 100), _v = new
|
|
1145
|
+
const dT = new dn(() => new w(), 100), _v = new U();
|
|
1146
1146
|
function uT(s, e) {
|
|
1147
1147
|
return e || (e = dT.get().set(0, 0, 1)), Ie(s, _v), e.applyQuaternion(_v);
|
|
1148
1148
|
}
|
|
@@ -1241,7 +1241,7 @@ class ea {
|
|
|
1241
1241
|
static _blitMaterial;
|
|
1242
1242
|
static _mesh;
|
|
1243
1243
|
static get planeGeometry() {
|
|
1244
|
-
return this._planeGeometry ??= new
|
|
1244
|
+
return this._planeGeometry ??= new zn(2, 2, 1, 1);
|
|
1245
1245
|
}
|
|
1246
1246
|
static get renderer() {
|
|
1247
1247
|
return this._renderer ??= new ca({ antialias: !1, alpha: !0 });
|
|
@@ -1253,7 +1253,7 @@ class ea {
|
|
|
1253
1253
|
return this._orthographicCam ??= new Df();
|
|
1254
1254
|
}
|
|
1255
1255
|
static get scene() {
|
|
1256
|
-
return this._scene ??= new
|
|
1256
|
+
return this._scene ??= new zi();
|
|
1257
1257
|
}
|
|
1258
1258
|
static get blitMaterial() {
|
|
1259
1259
|
return this._blitMaterial ??= new Yu();
|
|
@@ -1446,7 +1446,7 @@ function jx(s, e, t, i) {
|
|
|
1446
1446
|
let bd = !1;
|
|
1447
1447
|
function wT() {
|
|
1448
1448
|
jO((...s) => {
|
|
1449
|
-
R() && ce.Current?.isInXR && (Xc(!0),
|
|
1449
|
+
R() && ce.Current?.isInXR && (Xc(!0), Ux("error", ...s));
|
|
1450
1450
|
});
|
|
1451
1451
|
}
|
|
1452
1452
|
function Xc(s) {
|
|
@@ -1599,7 +1599,7 @@ function ST() {
|
|
|
1599
1599
|
console[s] = function() {
|
|
1600
1600
|
if (Qc[s]?.apply(console, arguments), !e)
|
|
1601
1601
|
try {
|
|
1602
|
-
e = !0,
|
|
1602
|
+
e = !0, Ux(s, ...arguments);
|
|
1603
1603
|
} finally {
|
|
1604
1604
|
e = !1;
|
|
1605
1605
|
}
|
|
@@ -1612,7 +1612,7 @@ function CT() {
|
|
|
1612
1612
|
console[s] = Qc[s];
|
|
1613
1613
|
}
|
|
1614
1614
|
const lc = /* @__PURE__ */ new Map();
|
|
1615
|
-
function
|
|
1615
|
+
function Ux(s, ...e) {
|
|
1616
1616
|
try {
|
|
1617
1617
|
switch (lc.clear(), s) {
|
|
1618
1618
|
case "log":
|
|
@@ -1667,8 +1667,8 @@ function zx(s, ...e) {
|
|
|
1667
1667
|
if (o instanceof ee) return `(${i(o.x)}, ${i(o.y)})`;
|
|
1668
1668
|
if (o instanceof w) return `(${i(o.x)}, ${i(o.y)}, ${i(o.z)})`;
|
|
1669
1669
|
if (o instanceof ve) return `(${i(o.x)}, ${i(o.y)}, ${i(o.z)}, ${i(o.w)})`;
|
|
1670
|
-
if (o instanceof
|
|
1671
|
-
if (o instanceof
|
|
1670
|
+
if (o instanceof U) return `(${i(o.x)}, ${i(o.y)}, ${i(o.z)}, ${i(o.w)})`;
|
|
1671
|
+
if (o instanceof Pe || o instanceof ke) return o.name;
|
|
1672
1672
|
if (o instanceof Hy) return `[${o.elements.join(", ")}]`;
|
|
1673
1673
|
if (o instanceof Z) return `[${o.elements.join(", ")}]`;
|
|
1674
1674
|
if (o instanceof Xo) return o.mask.toString();
|
|
@@ -1710,7 +1710,7 @@ function Bh(s, e) {
|
|
|
1710
1710
|
$e(s, { ...e, type: ln.Error });
|
|
1711
1711
|
}
|
|
1712
1712
|
let _i, wr = null, us = null, cc = !1, xv = null;
|
|
1713
|
-
const
|
|
1713
|
+
const zx = "terminal", Eg = x("console");
|
|
1714
1714
|
let vd, wd;
|
|
1715
1715
|
function Ku() {
|
|
1716
1716
|
if (vd === void 0)
|
|
@@ -1757,7 +1757,7 @@ function RT() {
|
|
|
1757
1757
|
$x(), us && (us.setAttribute("error", "true"), us.innerText = "🤬");
|
|
1758
1758
|
}
|
|
1759
1759
|
function ET() {
|
|
1760
|
-
us && (us.removeAttribute("error"), us.innerText =
|
|
1760
|
+
us && (us.removeAttribute("error"), us.innerText = zx);
|
|
1761
1761
|
}
|
|
1762
1762
|
function MT(s = !1) {
|
|
1763
1763
|
if (_i !== void 0 || cc) return;
|
|
@@ -1776,7 +1776,7 @@ function MT(s = !1) {
|
|
|
1776
1776
|
}), t && console.warn("🌵 ?console=network: vConsole's fetch proxy is enabled — WebAssembly streaming (e.g. gaussian splats) will fail on this page");
|
|
1777
1777
|
const i = globalThis["needle:codegen_files"];
|
|
1778
1778
|
if (i && i.length > 0 && _i.addPlugin(AT()), _i.addPlugin(FT()), _i.addPlugin(BT()), wr = XT(), wr && (wr[PT] = wr.parentElement, wr.style.position = "absolute", wr.style.zIndex = Number.MAX_SAFE_INTEGER.toString()), _i.setSwitchPosition(20, 30), us = qT(), us) {
|
|
1779
|
-
us.innerText =
|
|
1779
|
+
us.innerText = zx, us.addEventListener("click", ET);
|
|
1780
1780
|
const n = document.createElement("style"), o = 40;
|
|
1781
1781
|
n.innerHTML = `
|
|
1782
1782
|
#__vconsole .vc-switch {
|
|
@@ -1949,7 +1949,7 @@ function BT() {
|
|
|
1949
1949
|
let t = `<div style='${Mg}'>`;
|
|
1950
1950
|
const i = jT();
|
|
1951
1951
|
i.length > 0 && (t += `<h3 style='${xr}'>General GPU Info</h3>`, t += is(i, !1));
|
|
1952
|
-
const n =
|
|
1952
|
+
const n = zT();
|
|
1953
1953
|
n.length > 0 && (t += `<h3 style='${xr}'>WebGL</h3>`, t += is(n, !1));
|
|
1954
1954
|
const o = NT();
|
|
1955
1955
|
o.length > 0 && (t += `<h3 style='${xr}'>WebGL 2 Features</h3>`, t += is(o, !1));
|
|
@@ -1973,12 +1973,12 @@ function jT() {
|
|
|
1973
1973
|
const l = Gx();
|
|
1974
1974
|
if (l) {
|
|
1975
1975
|
s.push({ label: "GPU", value: l.renderer }), s.push({ label: "Driver", value: l.vendor }), s.push({ label: "ANGLE", value: l.angle || "Not detected" });
|
|
1976
|
-
const c =
|
|
1976
|
+
const c = UT(l.renderer);
|
|
1977
1977
|
c && (c.manufacturer && s.push({ label: "Manufacturer", value: c.manufacturer }), c.cardVersion && s.push({ label: "Card Version", value: c.cardVersion }), c.brand && s.push({ label: "Brand", value: c.brand }), s.push({ label: "Integrated", value: c.integrated ? "Yes" : "No" }), c.layer && s.push({ label: "WebGL Layer", value: c.layer }));
|
|
1978
1978
|
}
|
|
1979
1979
|
return s;
|
|
1980
1980
|
}
|
|
1981
|
-
function
|
|
1981
|
+
function UT(s) {
|
|
1982
1982
|
if (!s) return null;
|
|
1983
1983
|
const e = (c, h) => {
|
|
1984
1984
|
const d = h.match(c);
|
|
@@ -1995,7 +1995,7 @@ function zT(s) {
|
|
|
1995
1995
|
card: i
|
|
1996
1996
|
};
|
|
1997
1997
|
}
|
|
1998
|
-
function
|
|
1998
|
+
function zT() {
|
|
1999
1999
|
const s = [], e = Gx();
|
|
2000
2000
|
return e && (s.push({ label: "📊 WebGL Version", value: e.version }), s.push({ label: "🎮 WebGL 2 Available", value: Vx() })), s;
|
|
2001
2001
|
}
|
|
@@ -2372,14 +2372,14 @@ ir('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"]
|
|
|
2372
2372
|
ir('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";');
|
|
2373
2373
|
ir('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";');
|
|
2374
2374
|
ir('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";');
|
|
2375
|
-
ir('globalThis["__NEEDLE_ENGINE_VERSION__"] = "6.0.0-alpha.
|
|
2375
|
+
ir('globalThis["__NEEDLE_ENGINE_VERSION__"] = "6.0.0-alpha.5";');
|
|
2376
2376
|
ir('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
|
|
2377
|
-
ir('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "
|
|
2377
|
+
ir('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Mon Oct 05 2026 13:00:42 GMT+0000 (Coordinated Universal Time)";');
|
|
2378
2378
|
ir('globalThis["__NEEDLE_PUBLIC_KEY__"] = "' + NEEDLE_PUBLIC_KEY + '";');
|
|
2379
|
-
const vi = "6.0.0-alpha.
|
|
2379
|
+
const vi = "6.0.0-alpha.5", gh = "undefined", Zu = "Mon Oct 05 2026 13:00:42 GMT+0000 (Coordinated Universal Time)";
|
|
2380
2380
|
qx && console.log(`Engine version: ${vi} (generator: ${gh})
|
|
2381
2381
|
Project built at ${Zu}`);
|
|
2382
|
-
const Br = NEEDLE_PUBLIC_KEY,
|
|
2382
|
+
const Br = NEEDLE_PUBLIC_KEY, zs = "needle_isActiveInHierarchy", Ba = "builtin_components", $o = "needle_editor_guid";
|
|
2383
2383
|
function ir(s) {
|
|
2384
2384
|
try {
|
|
2385
2385
|
(0, eval)(s);
|
|
@@ -2756,7 +2756,7 @@ function B5(s, e) {
|
|
|
2756
2756
|
function j5(s, e) {
|
|
2757
2757
|
return no(s, De.OnAfterRender, e), () => nr(s, De.OnAfterRender);
|
|
2758
2758
|
}
|
|
2759
|
-
const
|
|
2759
|
+
const Ce = x("__debuglic__"), ef = /* @__PURE__ */ new WeakMap(), tf = /* @__PURE__ */ new WeakMap(), __ = /* @__PURE__ */ new WeakSet();
|
|
2760
2760
|
ce.registerCallback(de.ContextDestroying, ({ context: s }) => {
|
|
2761
2761
|
__.add(s);
|
|
2762
2762
|
for (const e of ef.get(s) ?? []) clearInterval(e);
|
|
@@ -2781,9 +2781,9 @@ function vu(s, e, t) {
|
|
|
2781
2781
|
return i.add(n), n;
|
|
2782
2782
|
}
|
|
2783
2783
|
const wu = [];
|
|
2784
|
-
let
|
|
2785
|
-
if (
|
|
2786
|
-
if (console.log("License Type: " +
|
|
2784
|
+
let Ui = "", Yc = "";
|
|
2785
|
+
if (Ce)
|
|
2786
|
+
if (console.log("License Type: " + Ui), Yc) {
|
|
2787
2787
|
console.log("License JWT: " + Yc);
|
|
2788
2788
|
try {
|
|
2789
2789
|
const s = JSON.parse(atob(Yc.split(".")[1].replace(/-/g, "+").replace(/_/g, "/")));
|
|
@@ -2794,7 +2794,7 @@ if (Pe)
|
|
|
2794
2794
|
} else
|
|
2795
2795
|
console.log("License JWT: (none)");
|
|
2796
2796
|
function Hs() {
|
|
2797
|
-
switch (
|
|
2797
|
+
switch (Ui) {
|
|
2798
2798
|
case "pro":
|
|
2799
2799
|
case "enterprise":
|
|
2800
2800
|
return !0;
|
|
@@ -2802,10 +2802,10 @@ function Hs() {
|
|
|
2802
2802
|
return !1;
|
|
2803
2803
|
}
|
|
2804
2804
|
function Hf() {
|
|
2805
|
-
return
|
|
2805
|
+
return Ui === "indie";
|
|
2806
2806
|
}
|
|
2807
2807
|
function b_() {
|
|
2808
|
-
return
|
|
2808
|
+
return Ui === "edu";
|
|
2809
2809
|
}
|
|
2810
2810
|
function Dn() {
|
|
2811
2811
|
return Hs() || Hf() || b_();
|
|
@@ -2854,34 +2854,46 @@ async function uR(s) {
|
|
|
2854
2854
|
a.buffer,
|
|
2855
2855
|
r
|
|
2856
2856
|
))
|
|
2857
|
-
return
|
|
2857
|
+
return Ce && console.warn("JWT: signature verification failed"), null;
|
|
2858
2858
|
const c = new TextDecoder().decode(Iv(i)), h = JSON.parse(c);
|
|
2859
2859
|
if (typeof h.type != "string" || h.type.length === 0)
|
|
2860
|
-
return
|
|
2860
|
+
return Ce && console.warn("JWT: missing or invalid 'type' claim"), null;
|
|
2861
2861
|
if (typeof h.exp == "number") {
|
|
2862
2862
|
const d = Math.floor(Date.now() / 1e3);
|
|
2863
2863
|
if (d > h.exp)
|
|
2864
|
-
return
|
|
2864
|
+
return Ce && console.warn("JWT: token has expired (exp=" + h.exp + ", now=" + d + ")"), null;
|
|
2865
2865
|
}
|
|
2866
2866
|
if (h.aud) {
|
|
2867
2867
|
const d = typeof window < "u" ? window.location.hostname : void 0;
|
|
2868
2868
|
if (d) {
|
|
2869
2869
|
const u = Array.isArray(h.aud) ? h.aud : [h.aud];
|
|
2870
2870
|
if (!u.some((p) => d === p || d.endsWith("." + p)))
|
|
2871
|
-
return
|
|
2871
|
+
return Ce && console.warn("JWT: domain '" + d + "' not in allowed audience: " + u.join(", ")), null;
|
|
2872
2872
|
}
|
|
2873
2873
|
}
|
|
2874
|
-
return
|
|
2874
|
+
return Ce && console.log("JWT: verified license type: " + h.type), h.type;
|
|
2875
2875
|
} catch (e) {
|
|
2876
|
-
return
|
|
2876
|
+
return Ce && console.error("JWT: verification error", e), null;
|
|
2877
2877
|
}
|
|
2878
2878
|
}
|
|
2879
2879
|
let Fg;
|
|
2880
2880
|
async function fR() {
|
|
2881
|
-
|
|
2882
|
-
Yc = ""
|
|
2881
|
+
let s = Yc;
|
|
2882
|
+
if (Yc = "", !s && typeof document < "u") {
|
|
2883
|
+
const t = document.querySelector('meta[name="needle-license"]')?.getAttribute("content");
|
|
2884
|
+
if (t)
|
|
2885
|
+
try {
|
|
2886
|
+
const i = new URL(t, document.baseURI), n = await fetch(i, { cache: "no-store" });
|
|
2887
|
+
if (n.ok) {
|
|
2888
|
+
const o = await n.json();
|
|
2889
|
+
typeof o?.jwt == "string" && (s = o.jwt);
|
|
2890
|
+
}
|
|
2891
|
+
} catch (i) {
|
|
2892
|
+
Ce && console.warn("Could not load signed license file", i);
|
|
2893
|
+
}
|
|
2894
|
+
}
|
|
2883
2895
|
const e = await uR(s);
|
|
2884
|
-
e ? (
|
|
2896
|
+
e ? (Ui = e, Ce && console.log("License type set from verified JWT: " + e), Ac(Dn())) : (Ui = "basic", Ce && s && console.warn("JWT verification failed — license reset to basic"));
|
|
2885
2897
|
}
|
|
2886
2898
|
var ct;
|
|
2887
2899
|
((s) => {
|
|
@@ -2918,7 +2930,7 @@ var ct;
|
|
|
2918
2930
|
s.init = i;
|
|
2919
2931
|
function n(g) {
|
|
2920
2932
|
if (!o(g)) {
|
|
2921
|
-
|
|
2933
|
+
Ce && console.debug("Telemetry is disabled via no-telemetry attribute");
|
|
2922
2934
|
return;
|
|
2923
2935
|
}
|
|
2924
2936
|
return y({
|
|
@@ -2951,7 +2963,7 @@ var ct;
|
|
|
2951
2963
|
let _ = g?.domElement;
|
|
2952
2964
|
if (_ || (_ = document.querySelector("needle-engine")), !_ && !g) return !1;
|
|
2953
2965
|
const v = _?.getAttribute("no-telemetry");
|
|
2954
|
-
return Hs() && (v === "" || v === "true" || v === "1") ? (
|
|
2966
|
+
return Hs() && (v === "" || v === "true" || v === "1") ? (Ce && console.debug("Telemetry is disabled via no-telemetry attribute"), !1) : r() ? (Ce && console.debug("Telemetry is disabled via Do Not Track / Global Privacy Control"), !1) : typeof window < "u" && window.crossOriginIsolated ? (Ce && console.debug("Telemetry is disabled on cross-origin-isolated pages"), !1) : !0;
|
|
2955
2967
|
}
|
|
2956
2968
|
s.isAllowed = o;
|
|
2957
2969
|
function r() {
|
|
@@ -2964,7 +2976,7 @@ var ct;
|
|
|
2964
2976
|
const a = "dabb8317376f";
|
|
2965
2977
|
async function l(g, _, v) {
|
|
2966
2978
|
if (!o(g)) {
|
|
2967
|
-
|
|
2979
|
+
Ce && console.debug("Telemetry is disabled");
|
|
2968
2980
|
return;
|
|
2969
2981
|
}
|
|
2970
2982
|
const C = {
|
|
@@ -2979,7 +2991,7 @@ var ct;
|
|
|
2979
2991
|
s.sendEvent = l;
|
|
2980
2992
|
async function c(g, _, v) {
|
|
2981
2993
|
if (!o(g)) {
|
|
2982
|
-
|
|
2994
|
+
Ce && console.debug("Telemetry is disabled");
|
|
2983
2995
|
return;
|
|
2984
2996
|
}
|
|
2985
2997
|
v instanceof ErrorEvent ? v = {
|
|
@@ -3049,7 +3061,7 @@ var ct;
|
|
|
3049
3061
|
typeof C == "number" && (_.device_memory = C);
|
|
3050
3062
|
}
|
|
3051
3063
|
} catch (C) {
|
|
3052
|
-
|
|
3064
|
+
Ce && console.warn("Telemetry: capability probe failed", C);
|
|
3053
3065
|
}
|
|
3054
3066
|
}
|
|
3055
3067
|
const u = /* @__PURE__ */ new WeakSet();
|
|
@@ -3127,16 +3139,16 @@ var ct;
|
|
|
3127
3139
|
// @ts-ignore
|
|
3128
3140
|
priority: "low"
|
|
3129
3141
|
}).catch((v) => {
|
|
3130
|
-
|
|
3142
|
+
Ce && console.error("Failed to send telemetry", v);
|
|
3131
3143
|
});
|
|
3132
3144
|
} catch (_) {
|
|
3133
|
-
|
|
3145
|
+
Ce && console.error(_);
|
|
3134
3146
|
}
|
|
3135
3147
|
return Promise.resolve();
|
|
3136
3148
|
}
|
|
3137
3149
|
})(ct || (ct = {}));
|
|
3138
3150
|
function pR() {
|
|
3139
|
-
|
|
3151
|
+
Ui === "" && (Ui = "basic"), Fg = fR(), nf = mR(), ct.init(), ce.registerCallback(de.ContextRegistered, (s) => {
|
|
3140
3152
|
yR(s.context), gR(s.context), vu(s.context, () => bR(s.context), 2e3);
|
|
3141
3153
|
}), ce.registerCallback(de.ContextCreated, (s) => {
|
|
3142
3154
|
ct.attachContextLossMonitor(s.context), ct.attachPerformanceMonitor(s.context);
|
|
@@ -3145,20 +3157,19 @@ function pR() {
|
|
|
3145
3157
|
let nf, Bg = !1, jg = "";
|
|
3146
3158
|
async function mR() {
|
|
3147
3159
|
if (nf) return nf;
|
|
3148
|
-
if (Fg && await Fg,
|
|
3160
|
+
if (Fg && await Fg, Ui === "basic")
|
|
3149
3161
|
try {
|
|
3150
3162
|
const s = "https://needle.tools/api/v1/needle-engine/check?location=" + encodeURIComponent(window.location.href) + "&version=" + vi + "&generator=" + encodeURIComponent(gh), e = await fetch(s, {
|
|
3151
3163
|
method: "GET"
|
|
3152
3164
|
}).catch((t) => {
|
|
3153
|
-
|
|
3165
|
+
Ce && console.error("License check failed", t);
|
|
3154
3166
|
});
|
|
3155
|
-
e?.status === 200 ? (Bg = !1,
|
|
3167
|
+
e?.status === 200 ? (Bg = !1, Ce && console.log("License check succeeded"), Ui = "pro", Ac(!0)) : e?.status === 403 ? (Ac(!1), Bg = !0, jg = await e.text()) : (Ac(!1), Ce && console.log("License check failed with status " + e?.status));
|
|
3156
3168
|
} catch (s) {
|
|
3157
|
-
Ac(!1),
|
|
3169
|
+
Ac(!1), Ce && console.error("License check failed", s);
|
|
3158
3170
|
}
|
|
3159
|
-
else
|
|
3171
|
+
else Ce && console.log('Runtime license check is skipped because license is already applied as "' + Ui + '"');
|
|
3160
3172
|
}
|
|
3161
|
-
nf = mR();
|
|
3162
3173
|
async function gR(s) {
|
|
3163
3174
|
function e() {
|
|
3164
3175
|
const n = document.createElement("div");
|
|
@@ -3209,18 +3220,18 @@ async function yR(s) {
|
|
|
3209
3220
|
if (!Hs() && !Hf())
|
|
3210
3221
|
return cm(s);
|
|
3211
3222
|
} catch (e) {
|
|
3212
|
-
return
|
|
3223
|
+
return Ce && console.log("License check failed", e), cm(s);
|
|
3213
3224
|
}
|
|
3214
|
-
|
|
3225
|
+
Ce && cm(s);
|
|
3215
3226
|
}
|
|
3216
3227
|
async function cm(s) {
|
|
3217
3228
|
let e = !1;
|
|
3218
3229
|
s.domElement.addEventListener("ready", () => e = !0), await nf?.catch(() => {
|
|
3219
|
-
}), !(Hs() || Hf()) && (Dn() === !1 && _R(), e ?
|
|
3220
|
-
|
|
3230
|
+
}), !(Hs() || Hf()) && (Dn() === !1 && _R(), e ? Ug(s) : s.domElement.addEventListener("ready", () => {
|
|
3231
|
+
Ug(s);
|
|
3221
3232
|
}));
|
|
3222
3233
|
}
|
|
3223
|
-
function
|
|
3234
|
+
function Ug(s) {
|
|
3224
3235
|
const e = `
|
|
3225
3236
|
position: relative;
|
|
3226
3237
|
display: block;
|
|
@@ -3232,7 +3243,7 @@ function zg(s) {
|
|
|
3232
3243
|
padding: 10px;
|
|
3233
3244
|
padding-left: 30px;
|
|
3234
3245
|
`;
|
|
3235
|
-
if (
|
|
3246
|
+
if (Ui === "edu")
|
|
3236
3247
|
navigator.webdriver ? console.log("This project is supported by Needle for Education – https://needle.tools") : console.log("%c This project is supported by Needle for Education – https://needle.tools", e);
|
|
3237
3248
|
else
|
|
3238
3249
|
return;
|
|
@@ -3269,7 +3280,7 @@ function zg(s) {
|
|
|
3269
3280
|
}, 1e3);
|
|
3270
3281
|
b_() && vu(s, () => {
|
|
3271
3282
|
clearInterval(o), t?.remove(), vu(s, () => {
|
|
3272
|
-
s.domElement.parentNode &&
|
|
3283
|
+
s.domElement.parentNode && Ug(s);
|
|
3273
3284
|
}, 1e3 * 60 * 5);
|
|
3274
3285
|
}, 2e4);
|
|
3275
3286
|
}
|
|
@@ -3300,14 +3311,14 @@ async function _R(s) {
|
|
|
3300
3311
|
}
|
|
3301
3312
|
async function bR(s) {
|
|
3302
3313
|
if (!ct.isAllowed(s)) {
|
|
3303
|
-
|
|
3314
|
+
Ce && console.debug("Telemetry is disabled");
|
|
3304
3315
|
return;
|
|
3305
3316
|
}
|
|
3306
3317
|
try {
|
|
3307
3318
|
const e = "https://needle.tools/api/v1/needle-engine/ping";
|
|
3308
3319
|
if (e) {
|
|
3309
3320
|
const t = window.location.href.split("?")[0], n = {
|
|
3310
|
-
license:
|
|
3321
|
+
license: Ui,
|
|
3311
3322
|
url: t,
|
|
3312
3323
|
hostname: window.location.hostname,
|
|
3313
3324
|
pathname: window.location.pathname,
|
|
@@ -3318,10 +3329,10 @@ async function bR(s) {
|
|
|
3318
3329
|
build_time: Zu,
|
|
3319
3330
|
public_key: Br
|
|
3320
3331
|
}, o = navigator.sendBeacon?.(e, JSON.stringify(n));
|
|
3321
|
-
|
|
3332
|
+
Ce && console.debug("Sent beacon: " + o);
|
|
3322
3333
|
}
|
|
3323
3334
|
} catch (e) {
|
|
3324
|
-
|
|
3335
|
+
Ce && console.log("Failed to send non-commercial usage message to analytics backend", e);
|
|
3325
3336
|
}
|
|
3326
3337
|
}
|
|
3327
3338
|
function tS(s) {
|
|
@@ -3585,7 +3596,7 @@ function iS(s, e, t) {
|
|
|
3585
3596
|
t?.saveInRoom === !1 && (i.dontSave = !0), e.send("instance-destroyed", i, ns.Queued);
|
|
3586
3597
|
}
|
|
3587
3598
|
const xu = [];
|
|
3588
|
-
function
|
|
3599
|
+
function U5(s) {
|
|
3589
3600
|
return xu.push(s), () => {
|
|
3590
3601
|
const e = xu.indexOf(s);
|
|
3591
3602
|
e >= 0 && xu.splice(e, 1);
|
|
@@ -3606,7 +3617,7 @@ function PR(s) {
|
|
|
3606
3617
|
}
|
|
3607
3618
|
});
|
|
3608
3619
|
}
|
|
3609
|
-
class
|
|
3620
|
+
class z5 {
|
|
3610
3621
|
/** File to download */
|
|
3611
3622
|
filename;
|
|
3612
3623
|
/** Checksum to verify its the correct file */
|
|
@@ -3660,7 +3671,7 @@ function nS(s, e, t, i) {
|
|
|
3660
3671
|
if (l.guid) {
|
|
3661
3672
|
sf && console.log("[Local] new instance", "gameobject:", r?.guid);
|
|
3662
3673
|
const c = new kR(n.guid, l.guid);
|
|
3663
|
-
c.seed = a, e.deleteOnDisconnect === !0 && (c.deleteStateOnDisconnect = !0), o && (o.position && (Array.isArray(o.position) ? c.position = { x: o.position[0], y: o.position[1], z: o.position[2] } : c.position = { x: o.position.x, y: o.position.y, z: o.position.z }), o.rotation && (o.rotation instanceof Be ? o.rotation = new
|
|
3674
|
+
c.seed = a, e.deleteOnDisconnect === !0 && (c.deleteStateOnDisconnect = !0), o && (o.position && (Array.isArray(o.position) ? c.position = { x: o.position[0], y: o.position[1], z: o.position[2] } : c.position = { x: o.position.x, y: o.position.y, z: o.position.z }), o.rotation && (o.rotation instanceof Be ? o.rotation = new U().setFromEuler(o.rotation) : o.rotation instanceof Array && (o.rotation = new U().fromArray(o.rotation)), c.rotation = { x: o.rotation.x, y: o.rotation.y, z: o.rotation.z, w: o.rotation.w }), o.scale && (Array.isArray(o.scale) ? c.scale = { x: o.scale[0], y: o.scale[1], z: o.scale[2] } : c.scale = { x: o.scale.x, y: o.scale.y, z: o.scale.z })), c.position || (c.position = { x: l.position.x, y: l.position.y, z: l.position.z }), c.rotation || (c.rotation = { x: l.quaternion.x, y: l.quaternion.y, z: l.quaternion.z, w: l.quaternion.w }), c.scale || (c.scale = { x: l.scale.x, y: l.scale.y, z: l.scale.z }), c.visible = n.visible, o?.parent && (typeof o.parent == "string" ? c.parent = o.parent : o.parent?.guid ? c.parent = o.parent.guid : o.parent instanceof zi ? c.parent = "scene" : console.warn("Unsupported parent type in sync instantiate options: " + o.parent?.name)), c.hostData = t, i === !1 && (c.dontSave = !0), !e?.context?.connection && R() && console.debug("Object will be instantiated but it will not be synced: not connected", n.guid), e.context.connection.isInRoom && ja.push(new WeakRef(l)), e?.context?.connection.send("new-instance-created", c);
|
|
3664
3675
|
} else console.warn("Missing guid, can not send new instance event", l);
|
|
3665
3676
|
}
|
|
3666
3677
|
return r;
|
|
@@ -3679,7 +3690,7 @@ function RR(s) {
|
|
|
3679
3690
|
return;
|
|
3680
3691
|
}
|
|
3681
3692
|
const o = new so();
|
|
3682
|
-
i.position && (o.position = new w(i.position.x, i.position.y, i.position.z)), i.rotation && (o.rotation = new
|
|
3693
|
+
i.position && (o.position = new w(i.position.x, i.position.y, i.position.z)), i.rotation && (o.rotation = new U(i.rotation.x, i.rotation.y, i.rotation.z, i.rotation.w)), i.scale && (o.scale = new w(i.scale.x, i.scale.y, i.scale.z)), o.parent = i.parent, i.seed && (o.idProvider = new xt(i.seed)), o.visible = i.visible, o.context = s, sf && s.alias && console.log("[Remote] instantiate in: " + s.alias);
|
|
3683
3694
|
const r = Zo(n, o);
|
|
3684
3695
|
if (ja.push(new WeakRef(r)), r) {
|
|
3685
3696
|
i.parent === "scene" && s.scene.add(r), sf && console.log("[Remote] new instance", "gameobject:", r?.guid, n);
|
|
@@ -3746,7 +3757,7 @@ const jh = x("gizmos"), Rt = x("debugextension"), v_ = x("debugresolvedependenci
|
|
|
3746
3757
|
async function w_(s, e) {
|
|
3747
3758
|
v_ && console.log(s, e);
|
|
3748
3759
|
const t = [];
|
|
3749
|
-
|
|
3760
|
+
zg(LR, s, e, t);
|
|
3750
3761
|
const i = await Promise.all(t);
|
|
3751
3762
|
return typeof e == "string" && i.length === 1 ? i[0] : i;
|
|
3752
3763
|
}
|
|
@@ -3756,7 +3767,7 @@ function DR(s, e) {
|
|
|
3756
3767
|
function FR(s, e) {
|
|
3757
3768
|
s["needle:identifier"] = e;
|
|
3758
3769
|
}
|
|
3759
|
-
function
|
|
3770
|
+
function zg(s, e, t, i) {
|
|
3760
3771
|
if (typeof t == "object" && t !== void 0 && t !== null)
|
|
3761
3772
|
for (const n of Object.keys(t)) {
|
|
3762
3773
|
const o = t[n];
|
|
@@ -3785,9 +3796,9 @@ function Ug(s, e, t, i) {
|
|
|
3785
3796
|
break;
|
|
3786
3797
|
}
|
|
3787
3798
|
}
|
|
3788
|
-
typeof a == "object" &&
|
|
3799
|
+
typeof a == "object" && zg(s, e, a, i);
|
|
3789
3800
|
}
|
|
3790
|
-
else typeof o == "object" &&
|
|
3801
|
+
else typeof o == "object" && zg(s, e, o, i);
|
|
3791
3802
|
}
|
|
3792
3803
|
else if (typeof t == "string") {
|
|
3793
3804
|
const n = Bv(s, e, t);
|
|
@@ -3870,7 +3881,7 @@ class jR {
|
|
|
3870
3881
|
}
|
|
3871
3882
|
}
|
|
3872
3883
|
const ss = x("debugserializer");
|
|
3873
|
-
class
|
|
3884
|
+
class UR {
|
|
3874
3885
|
register(e, t) {
|
|
3875
3886
|
if (this.typeMap.has(e)) {
|
|
3876
3887
|
const i = this.typeMap.get(e);
|
|
@@ -3911,7 +3922,7 @@ class zR {
|
|
|
3911
3922
|
ss && console.warn("No serializer found for " + i, e, e.name, e.constructor.name);
|
|
3912
3923
|
}
|
|
3913
3924
|
}
|
|
3914
|
-
const of = new
|
|
3925
|
+
const of = new UR();
|
|
3915
3926
|
class Vi {
|
|
3916
3927
|
name;
|
|
3917
3928
|
// register<T>(c: Constructor<T> | Constructor<T>[])
|
|
@@ -3976,7 +3987,7 @@ class Xf {
|
|
|
3976
3987
|
this.root = e;
|
|
3977
3988
|
}
|
|
3978
3989
|
}
|
|
3979
|
-
function
|
|
3990
|
+
function zR(s) {
|
|
3980
3991
|
return s && typeof s == "object" && (typeof s.$serializedTypes == "object" || typeof s.onBeforeDeserialize == "function" || typeof s.onBeforeDeserializeMember == "function" || typeof s.onAfterDeserializeMember == "function" || typeof s.onAfterDeserialize == "function");
|
|
3981
3992
|
}
|
|
3982
3993
|
function NR(s, e) {
|
|
@@ -4156,7 +4167,7 @@ function Ng(s, e, t, i, n) {
|
|
|
4156
4167
|
} catch (h) {
|
|
4157
4168
|
console.error("Error in callback", h, s);
|
|
4158
4169
|
}
|
|
4159
|
-
if (t.type = r, !o && n && (n instanceof
|
|
4170
|
+
if (t.type = r, !o && n && (n instanceof Pe || n instanceof V || n instanceof In || n instanceof Yt))
|
|
4160
4171
|
return n;
|
|
4161
4172
|
if (i || (i = {
|
|
4162
4173
|
serializer: of.getSerializerForConstructor(r)
|
|
@@ -4190,7 +4201,7 @@ function Ng(s, e, t, i, n) {
|
|
|
4190
4201
|
l = s;
|
|
4191
4202
|
else {
|
|
4192
4203
|
if (s === void 0) return;
|
|
4193
|
-
if (s === null && (r ===
|
|
4204
|
+
if (s === null && (r === Pe || r === ke || r === V || r === Yt))
|
|
4194
4205
|
return null;
|
|
4195
4206
|
try {
|
|
4196
4207
|
l = new r(...HR(s));
|
|
@@ -4732,7 +4743,7 @@ class _s extends EventTarget {
|
|
|
4732
4743
|
}
|
|
4733
4744
|
};
|
|
4734
4745
|
}
|
|
4735
|
-
class
|
|
4746
|
+
class Uv {
|
|
4736
4747
|
_listeners = /* @__PURE__ */ new Map();
|
|
4737
4748
|
emit(e, t) {
|
|
4738
4749
|
const i = this._listeners.get(e);
|
|
@@ -4808,7 +4819,7 @@ function* nE(s) {
|
|
|
4808
4819
|
for (s.then(() => e = !1), s.catch(() => e = !1); e; )
|
|
4809
4820
|
yield;
|
|
4810
4821
|
}
|
|
4811
|
-
var
|
|
4822
|
+
var Uh = /* @__PURE__ */ ((s) => (s[s.Quad = 0] = "Quad", s[s.Cube = 1] = "Cube", s[s.Sphere = 2] = "Sphere", s[s.Cylinder = 3] = "Cylinder", s[s.RoundedCube = 10] = "RoundedCube", s))(Uh || {});
|
|
4812
4823
|
class ha {
|
|
4813
4824
|
/**
|
|
4814
4825
|
* Creates a 3D text object
|
|
@@ -4826,7 +4837,7 @@ class ha {
|
|
|
4826
4837
|
}
|
|
4827
4838
|
static #t(e, t, i) {
|
|
4828
4839
|
const n = i?.depth || 0.1;
|
|
4829
|
-
return new
|
|
4840
|
+
return new Uk(e, {
|
|
4830
4841
|
font: t,
|
|
4831
4842
|
size: 1,
|
|
4832
4843
|
depth: n,
|
|
@@ -4852,7 +4863,7 @@ class ha {
|
|
|
4852
4863
|
case "Quad":
|
|
4853
4864
|
case 0:
|
|
4854
4865
|
{
|
|
4855
|
-
const o = new
|
|
4866
|
+
const o = new zn(1, 1, 1, 1), r = t?.material ?? new Tt({ color: n });
|
|
4856
4867
|
t?.texture && "map" in r && (r.map = t.texture), i = new V(o, r), i.name = "Quad";
|
|
4857
4868
|
}
|
|
4858
4869
|
break;
|
|
@@ -4946,7 +4957,7 @@ function oE(s) {
|
|
|
4946
4957
|
const n = Pd.get(e);
|
|
4947
4958
|
if (n) return n;
|
|
4948
4959
|
}
|
|
4949
|
-
const t = new
|
|
4960
|
+
const t = new zk(), i = new Promise((n, o) => {
|
|
4950
4961
|
t.load(e, (r) => {
|
|
4951
4962
|
Pd.set(e, r), n(r);
|
|
4952
4963
|
}, void 0, o);
|
|
@@ -4968,17 +4979,17 @@ function rE(s, e) {
|
|
|
4968
4979
|
const t = Nv();
|
|
4969
4980
|
t.name = "ShaderBall-Placeholder";
|
|
4970
4981
|
const i = t.children[0];
|
|
4971
|
-
i?.type === "Mesh" &&
|
|
4982
|
+
i?.type === "Mesh" && zv(i, e), s.add(t);
|
|
4972
4983
|
}
|
|
4973
4984
|
fm.then((t) => {
|
|
4974
4985
|
s.children.forEach((o) => {
|
|
4975
4986
|
o.name === "ShaderBall-Placeholder" && s.remove(o);
|
|
4976
4987
|
});
|
|
4977
4988
|
const i = t.clone(), n = i.children[0];
|
|
4978
|
-
n?.type === "Mesh" && (n.geometry.attributes.tangent || n.geometry.computeTangents(),
|
|
4989
|
+
n?.type === "Mesh" && (n.geometry.attributes.tangent || n.geometry.computeTangents(), zv(n, e)), s.add(i);
|
|
4979
4990
|
});
|
|
4980
4991
|
}
|
|
4981
|
-
function
|
|
4992
|
+
function zv(s, e) {
|
|
4982
4993
|
if (e?.color || e?.material || e?.texture) {
|
|
4983
4994
|
const i = e?.material ?? s.material?.clone() ?? new Tt();
|
|
4984
4995
|
e.color && "color" in i && i.color instanceof oe && i.color.set(e.color), e?.texture && "map" in i && (i.map = e.texture), s.material = i;
|
|
@@ -5105,7 +5116,7 @@ class W5 {
|
|
|
5105
5116
|
this.key = e.key, this.keyType = e.type, this.source = e;
|
|
5106
5117
|
}
|
|
5107
5118
|
}
|
|
5108
|
-
var
|
|
5119
|
+
var Ur = /* @__PURE__ */ ((s) => (s[s.Early = -100] = "Early", s[s.Default = 0] = "Default", s[s.Late = 100] = "Late", s))(Ur || {});
|
|
5109
5120
|
class aE {
|
|
5110
5121
|
/** This is a list of event listeners per event type (e.g. pointerdown, pointerup, keydown...). Each entry contains a priority and list of listeners.
|
|
5111
5122
|
* That way users can control if they want to receive events before or after other listeners (e.g subscribe to pointer events before the EventSystem receives them) - this allows certain listeners to be always invoked first (or last) and stop propagation
|
|
@@ -5677,7 +5688,7 @@ class aE {
|
|
|
5677
5688
|
this.convertScreenspaceToRaycastSpace(r);
|
|
5678
5689
|
const a = this.tempFarPlaneVector.set(r.x, r.y, 1);
|
|
5679
5690
|
r.unproject(o), a.unproject(o);
|
|
5680
|
-
const l = o.worldUp ||
|
|
5691
|
+
const l = o.worldUp || z(0, 1, 0).applyQuaternion(Ie(o));
|
|
5681
5692
|
this.tempLookMatrix.lookAt(a, r, l), n.position.set(r.x, r.y, r.z), n.quaternion.setFromRotationMatrix(this.tempLookMatrix);
|
|
5682
5693
|
}
|
|
5683
5694
|
return n;
|
|
@@ -5996,7 +6007,7 @@ TEX ` + i.texture_lod;
|
|
|
5996
6007
|
` + (n.lastScreenCoverage * 100).toFixed(1) + `% cov
|
|
5997
6008
|
` + (n.lastCentrality * 100).toFixed(1) + `% centr
|
|
5998
6009
|
` + (Od.min.x.toFixed(2) + "-" + Od.max.x.toFixed(2) + "x" + Od.min.y.toFixed(2) + "-" + Od.max.y.toFixed(2)) + " scr"), n.lastScreenCoverage > 0.1) {
|
|
5999
|
-
const y = e, g = y.worldForward, _ = y.worldPosition, C =
|
|
6010
|
+
const y = e, g = y.worldForward, _ = y.worldPosition, C = z(g).multiplyScalar(c * 0.7).add(l), P = C.distanceTo(_), T = h[Math.min(h.length - 1, Math.max(0, o))] + "88", I = this.context.domHeight > 0 ? screen.height / this.context.domHeight : 1, F = e.isPerspectiveCamera ? Math.tan(e.fov * Math.PI / 180 / 2) : 1;
|
|
6000
6011
|
j.DrawLabel(C, b, P * 0.012 * I * F, void 0, 16777215, T);
|
|
6001
6012
|
}
|
|
6002
6013
|
}
|
|
@@ -6851,12 +6862,12 @@ function CE(s) {
|
|
|
6851
6862
|
}
|
|
6852
6863
|
}), Hv.set(s, e)), e;
|
|
6853
6864
|
}
|
|
6854
|
-
const
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
const PE = new Xy(
|
|
6865
|
+
const zh = new Uint8Array(4);
|
|
6866
|
+
zh[0] = 255;
|
|
6867
|
+
zh[1] = 255;
|
|
6868
|
+
zh[2] = 255;
|
|
6869
|
+
zh[3] = 255;
|
|
6870
|
+
const PE = new Xy(zh, 1, 1, Ff);
|
|
6860
6871
|
function C_(s, e = 1) {
|
|
6861
6872
|
const t = "alpha" in s, i = e * e, n = new Uint8Array(4 * i), o = Math.floor(s.r * 255), r = Math.floor(s.g * 255), a = Math.floor(s.b * 255);
|
|
6862
6873
|
for (let c = 0; c < i; c++) {
|
|
@@ -7579,14 +7590,14 @@ If you need multisampling consider changing 'auto' to a fixed value (e.g. 4).`))
|
|
|
7579
7590
|
this.restoreTonemapping(), this._handler?.dispose(), this._handler = null, this._composer = null, this._effects.length = 0;
|
|
7580
7591
|
}
|
|
7581
7592
|
}
|
|
7582
|
-
const
|
|
7593
|
+
const zr = [], ku = [];
|
|
7583
7594
|
var qg;
|
|
7584
7595
|
((s) => {
|
|
7585
7596
|
function e(i, n) {
|
|
7586
7597
|
const o = { name: n?.name, priority: n?.priority ?? 0, callback: i };
|
|
7587
|
-
return
|
|
7588
|
-
const r =
|
|
7589
|
-
r >= 0 &&
|
|
7598
|
+
return zr.push(o), zr.sort((r, a) => r.priority === a.priority ? 0 : r.priority > a.priority ? -1 : 1), () => {
|
|
7599
|
+
const r = zr.indexOf(o);
|
|
7600
|
+
r >= 0 && zr.splice(r, 1);
|
|
7590
7601
|
};
|
|
7591
7602
|
}
|
|
7592
7603
|
s.onCreateCustomModelLoader = e;
|
|
@@ -7598,7 +7609,7 @@ var qg;
|
|
|
7598
7609
|
}
|
|
7599
7610
|
s.onDetermineModelMimetype = t;
|
|
7600
7611
|
})(qg || (qg = {}));
|
|
7601
|
-
const gm = "Gaussian Splat Loader",
|
|
7612
|
+
const gm = "Gaussian Splat Loader", UE = x("debugsplats") || x("debugsplatsort") || x("debugspatsort"), zE = (() => {
|
|
7602
7613
|
const s = x("splatcull"), e = typeof s == "number" ? s : typeof s == "string" ? parseFloat(s) : NaN;
|
|
7603
7614
|
return Number.isFinite(e) && e > 0 ? Math.min(Math.PI, e * (Math.PI / 180)) : void 0;
|
|
7604
7615
|
})(), NE = {
|
|
@@ -7648,9 +7659,9 @@ const cf = [
|
|
|
7648
7659
|
// at 45 fps against target 60 must never go blurry (device log 2026-07-29).
|
|
7649
7660
|
{ lodRenderScale: 3.5, lodSplatScale: 0.35, maxPixelRadius: 0.5, maxStdDevCap: Math.sqrt(6), foveate: 0.45, minAlphaFloor: 10 / 255, resolutionScale: 0.75 },
|
|
7650
7661
|
{ lodRenderScale: 3.5, lodSplatScale: 0.35, maxPixelRadius: 0.5, maxStdDevCap: Math.sqrt(6), foveate: 0.45, minAlphaFloor: 10 / 255, resolutionScale: 0.6 }
|
|
7651
|
-
],
|
|
7662
|
+
], Ua = cf.length - 1;
|
|
7652
7663
|
function mS(s, e) {
|
|
7653
|
-
const t = Math.max(0, Math.min(
|
|
7664
|
+
const t = Math.max(0, Math.min(Ua, Math.round(e))), i = cf[t];
|
|
7654
7665
|
return {
|
|
7655
7666
|
...s,
|
|
7656
7667
|
lodRenderScale: s.lodRenderScale * i.lodRenderScale,
|
|
@@ -7680,9 +7691,9 @@ function KE(s, e, t) {
|
|
|
7680
7691
|
let n = i.level;
|
|
7681
7692
|
e.streaming && (i.lastStreamingTime = Math.max(i.lastStreamingTime, t));
|
|
7682
7693
|
const o = t - i.lastStreamingTime >= Jv || t - i.lastChangeTime >= XE;
|
|
7683
|
-
i.fpsBeforeStep !== null && t - i.lastChangeTime >= Zv && o && (e.smoothedFps < i.fpsBeforeStep * e0 ? R() && console.debug(`[SplatQuality] conditions collapsed since the degradation (${i.fpsBeforeStep.toFixed(1)} → ${e.smoothedFps.toFixed(1)}) — discarding the measurement, keeping level ${n}`) : e.smoothedFps < i.fpsBeforeStep * qE ? (n = i.stepFromLevel ?? Math.max(0, n - 1), i.downBackoffUntil = t + fc, i.stepFromLevel !== null && i.level - i.stepFromLevel > 1 && (i.jumpBackoffUntil = t + fc), R() && console.debug(`[SplatQuality] degradation bought no fps (${i.fpsBeforeStep.toFixed(1)} → ${e.smoothedFps.toFixed(1)}) — reverting to level ${n}, backing off ${fc}s`)) : R() && console.debug(`[SplatQuality] degradation bought fps (${i.fpsBeforeStep.toFixed(1)} → ${e.smoothedFps.toFixed(1)}) — keeping level ${n}`), i.fpsBeforeStep = null, i.stepFromLevel = null), i.fpsBeforeProbe !== null && t - i.lastChangeTime >= Zv && o && (e.smoothedFps < i.fpsBeforeProbe * e0 ? (n = Math.min(
|
|
7694
|
+
i.fpsBeforeStep !== null && t - i.lastChangeTime >= Zv && o && (e.smoothedFps < i.fpsBeforeStep * e0 ? R() && console.debug(`[SplatQuality] conditions collapsed since the degradation (${i.fpsBeforeStep.toFixed(1)} → ${e.smoothedFps.toFixed(1)}) — discarding the measurement, keeping level ${n}`) : e.smoothedFps < i.fpsBeforeStep * qE ? (n = i.stepFromLevel ?? Math.max(0, n - 1), i.downBackoffUntil = t + fc, i.stepFromLevel !== null && i.level - i.stepFromLevel > 1 && (i.jumpBackoffUntil = t + fc), R() && console.debug(`[SplatQuality] degradation bought no fps (${i.fpsBeforeStep.toFixed(1)} → ${e.smoothedFps.toFixed(1)}) — reverting to level ${n}, backing off ${fc}s`)) : R() && console.debug(`[SplatQuality] degradation bought fps (${i.fpsBeforeStep.toFixed(1)} → ${e.smoothedFps.toFixed(1)}) — keeping level ${n}`), i.fpsBeforeStep = null, i.stepFromLevel = null), i.fpsBeforeProbe !== null && t - i.lastChangeTime >= Zv && o && (e.smoothedFps < i.fpsBeforeProbe * e0 ? (n = Math.min(Ua, n + 1), R() && console.debug(`[SplatQuality] conditions collapsed during recovery probe (${i.fpsBeforeProbe.toFixed(1)} → ${e.smoothedFps.toFixed(1)}) — restoring level ${n}`)) : e.smoothedFps < i.fpsBeforeProbe * YE ? (n = Math.min(Ua, n + 1), i.upBackoffUntil = t + fc, R() && console.debug(`[SplatQuality] recovery probe cost fps (${i.fpsBeforeProbe.toFixed(1)} → ${e.smoothedFps.toFixed(1)}) — restoring level ${n}, backing off ${fc}s`)) : R() && console.debug(`[SplatQuality] recovery probe kept (fps ${i.fpsBeforeProbe.toFixed(1)} → ${e.smoothedFps.toFixed(1)}), level ${n}`), i.fpsBeforeProbe = null);
|
|
7684
7695
|
const r = e.smoothedFps < e.targetFps * VE, a = e.smoothedFps >= e.targetFps * GE, l = t - i.lastChangeTime >= WE;
|
|
7685
|
-
r ? (i.goodStreak = 0, l && t >= i.downBackoffUntil && n === i.level && i.fpsBeforeStep === null && i.fpsBeforeProbe === null && n <
|
|
7696
|
+
r ? (i.goodStreak = 0, l && t >= i.downBackoffUntil && n === i.level && i.fpsBeforeStep === null && i.fpsBeforeProbe === null && n < Ua ? (!(cf[n + 1].resolutionScale < cf[n].resolutionScale) || e.smoothedFps < e.targetFps * t0) && (i.fpsBeforeStep = e.smoothedFps, i.stepFromLevel = n, n++) : l && t < i.downBackoffUntil && t >= i.jumpBackoffUntil && e.smoothedFps < e.targetFps * t0 && n === i.level && i.fpsBeforeStep === null && i.fpsBeforeProbe === null && n < Ua && (i.fpsBeforeStep = e.smoothedFps, i.stepFromLevel = n, n = Ua)) : a ? (i.goodStreak++, i.goodStreak >= HE && l && i.fpsBeforeProbe === null && n > 0 && (n--, i.goodStreak = 0)) : i.goodStreak = 0;
|
|
7686
7697
|
const c = n === i.level && i.fpsBeforeStep === null && i.fpsBeforeProbe === null;
|
|
7687
7698
|
i.stableStreak = c ? i.stableStreak + 1 : 0, c && !r && n > 0 && i.stableStreak >= QE && l && t >= i.upBackoffUntil && t - i.lastStreamingTime >= Jv && (i.fpsBeforeProbe = e.smoothedFps, i.stableStreak = 0, n--), n !== i.level && (R() && console.debug(`[SplatQuality] adaptation level ${i.level} → ${n} (fps ${e.smoothedFps.toFixed(1)}/${e.targetFps}${n > i.level ? ", verifying fps gain" : i.fpsBeforeProbe !== null ? ", probing recovery" : ""})`), i.level = n, i.lastChangeTime = t, k_(i));
|
|
7688
7699
|
}
|
|
@@ -7696,7 +7707,7 @@ const ZE = 1500;
|
|
|
7696
7707
|
function JE(s, e) {
|
|
7697
7708
|
e.resumeQuietUntil !== 0 && performance.now() >= e.resumeQuietUntil && (e.renderer.pauseWork = !1, e.resumeQuietUntil = 0, R() && console.debug("[SplatQuality] calm resume over — splat work resumed"));
|
|
7698
7709
|
const t = s.time.time, i = gS(s, e);
|
|
7699
|
-
if (i && (e.lastStreamingTime = Math.max(e.lastStreamingTime, t)), t - e.lastEvalTime < $E || (e.lastEvalTime = t,
|
|
7710
|
+
if (i && (e.lastStreamingTime = Math.max(e.lastStreamingTime, t)), t - e.lastEvalTime < $E || (e.lastEvalTime = t, UE && eM(s, e), s.time.frameCount < 60)) return;
|
|
7700
7711
|
const n = s.isInXR;
|
|
7701
7712
|
let o = (n ? s.xrSession?.frameRate : void 0) ?? 60;
|
|
7702
7713
|
n && s.xrFrameRateLimit > 0 && (o = Math.min(o, s.xrFrameRateLimit)), KE(s, { smoothedFps: s.time.smoothedFps, targetFps: o, streaming: i }, t);
|
|
@@ -7730,7 +7741,7 @@ const tM = new w(), iM = new w();
|
|
|
7730
7741
|
function nM(s, e) {
|
|
7731
7742
|
s.minSortIntervalMs = e.minSortIntervalMs, s.numLodFetchers = e.fetchers, s.lodRenderScale = e.lodRenderScale;
|
|
7732
7743
|
const t = D.isiOS() ? 2 / 3 : 1;
|
|
7733
|
-
s.lodSplatScale = e.lodSplatScale * t, s.sortCullHalfAngle =
|
|
7744
|
+
s.lodSplatScale = e.lodSplatScale * t, s.sortCullHalfAngle = zE ?? e.sortCullHalfAngle, s.maxStdDev = e.maxStdDev, s.maxPixelRadius = e.maxPixelRadius, s.coneFoveate = e.coneFoveate, s.behindFoveate = e.behindFoveate, s.minAlpha = e.minAlpha, e.maxPagedSplats > 0 && !s.pager && (s.maxPagedSplats = e.maxPagedSplats), s.pager && (s.pager.numFetchers = e.fetchers), yS = e.xrFramebufferScale;
|
|
7734
7745
|
}
|
|
7735
7746
|
let yS;
|
|
7736
7747
|
function i0() {
|
|
@@ -7788,7 +7799,7 @@ function rM(s) {
|
|
|
7788
7799
|
return !/^(blob:|data:)/i.test(s);
|
|
7789
7800
|
}
|
|
7790
7801
|
function aM() {
|
|
7791
|
-
|
|
7802
|
+
zr.some((s) => s.name === gm) || qg.onCreateCustomModelLoader((s) => {
|
|
7792
7803
|
switch (s.mimetype) {
|
|
7793
7804
|
case "model/ply":
|
|
7794
7805
|
case "model/spz":
|
|
@@ -7848,7 +7859,7 @@ function aM() {
|
|
|
7848
7859
|
return null;
|
|
7849
7860
|
}, { name: gm });
|
|
7850
7861
|
}
|
|
7851
|
-
const sl = new Z().makeRotationY(Math.PI), sn = new
|
|
7862
|
+
const sl = new Z().makeRotationY(Math.PI), sn = new U().setFromAxisAngle(new w(0, 1, 0), Math.PI), lM = x("debugwebxr");
|
|
7852
7863
|
class cM {
|
|
7853
7864
|
priority = -1e5;
|
|
7854
7865
|
gameObject;
|
|
@@ -7865,7 +7876,7 @@ class cM {
|
|
|
7865
7876
|
}
|
|
7866
7877
|
}
|
|
7867
7878
|
}
|
|
7868
|
-
const Rs = x("debugwebxr"), Md = x("debugcustomgesture"), hM = "https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles", dM = "generic-trigger", uM = new
|
|
7879
|
+
const Rs = x("debugwebxr"), Md = x("debugcustomgesture"), hM = "https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles", dM = "generic-trigger", uM = new U().setFromEuler(new Be(Gs.degToRad(0), Gs.degToRad(-90), Gs.degToRad(-90))), fM = new w(0.04, -0.04, 0);
|
|
7869
7880
|
class bS {
|
|
7870
7881
|
/** the Needle XR Session */
|
|
7871
7882
|
xr;
|
|
@@ -7997,19 +8008,19 @@ class bS {
|
|
|
7997
8008
|
/** Grip position in grip space */
|
|
7998
8009
|
_gripPosition = new w();
|
|
7999
8010
|
/** Grip rotation in grip space */
|
|
8000
|
-
_gripQuaternion = new
|
|
8011
|
+
_gripQuaternion = new U();
|
|
8001
8012
|
_linearVelocity = new w();
|
|
8002
8013
|
_rayPositionRaw = new w();
|
|
8003
|
-
_rayRotationRaw = new
|
|
8014
|
+
_rayRotationRaw = new U();
|
|
8004
8015
|
/** ray matrix in grip space */
|
|
8005
8016
|
_rayMatrix = new Z();
|
|
8006
8017
|
/** Ray position in rig space */
|
|
8007
8018
|
_rayPosition = new w();
|
|
8008
8019
|
/** Ray rotation in rig space */
|
|
8009
|
-
_rayQuaternion = new
|
|
8020
|
+
_rayQuaternion = new U();
|
|
8010
8021
|
/** Grip position in rig space */
|
|
8011
8022
|
get gripPosition() {
|
|
8012
|
-
return
|
|
8023
|
+
return z(this._gripPosition);
|
|
8013
8024
|
}
|
|
8014
8025
|
/** Grip rotation in rig space */
|
|
8015
8026
|
get gripQuaternion() {
|
|
@@ -8022,11 +8033,11 @@ class bS {
|
|
|
8022
8033
|
* @link https://developer.mozilla.org/en-US/docs/Web/API/XRPose/linearVelocity
|
|
8023
8034
|
*/
|
|
8024
8035
|
get gripLinearVelocity() {
|
|
8025
|
-
return
|
|
8036
|
+
return z(this._linearVelocity).applyQuaternion(sn);
|
|
8026
8037
|
}
|
|
8027
8038
|
/** Ray position in rig space */
|
|
8028
8039
|
get rayPosition() {
|
|
8029
|
-
return
|
|
8040
|
+
return z(this._rayPosition);
|
|
8030
8041
|
}
|
|
8031
8042
|
/** Ray rotation in rig space */
|
|
8032
8043
|
get rayQuaternion() {
|
|
@@ -8034,17 +8045,17 @@ class bS {
|
|
|
8034
8045
|
}
|
|
8035
8046
|
/** Controller grip position in worldspace */
|
|
8036
8047
|
get gripWorldPosition() {
|
|
8037
|
-
return
|
|
8048
|
+
return z(this._gripWorldPosition);
|
|
8038
8049
|
}
|
|
8039
8050
|
_gripWorldPosition = new w();
|
|
8040
8051
|
/** Controller grip rotation in wordspace */
|
|
8041
8052
|
get gripWorldQuaternion() {
|
|
8042
8053
|
return Mi(this._gripWorldQuaternion);
|
|
8043
8054
|
}
|
|
8044
|
-
_gripWorldQuaternion = new
|
|
8055
|
+
_gripWorldQuaternion = new U();
|
|
8045
8056
|
/** Controller ray position in worldspace (this value is calculated once per frame by default - call `updateRayWorldPosition` to force an update) */
|
|
8046
8057
|
get rayWorldPosition() {
|
|
8047
|
-
return
|
|
8058
|
+
return z(this._rayWorldPosition);
|
|
8048
8059
|
}
|
|
8049
8060
|
_rayWorldPosition = new w();
|
|
8050
8061
|
/** Recalculates the ray world position */
|
|
@@ -8056,9 +8067,9 @@ class bS {
|
|
|
8056
8067
|
get rayWorldQuaternion() {
|
|
8057
8068
|
return Mi(this._rayWorldQuaternion);
|
|
8058
8069
|
}
|
|
8059
|
-
_rayWorldQuaternion = new
|
|
8070
|
+
_rayWorldQuaternion = new U();
|
|
8060
8071
|
get pinchPosition() {
|
|
8061
|
-
return
|
|
8072
|
+
return z(this._pinchPosition);
|
|
8062
8073
|
}
|
|
8063
8074
|
_pinchPosition = new w();
|
|
8064
8075
|
/** Recalculates the ray world quaternion */
|
|
@@ -8068,7 +8079,7 @@ class bS {
|
|
|
8068
8079
|
}
|
|
8069
8080
|
/** The controller ray in worldspace */
|
|
8070
8081
|
get ray() {
|
|
8071
|
-
return this._ray.origin.copy(this.rayWorldPosition), this._ray.direction.copy(
|
|
8082
|
+
return this._ray.origin.copy(this.rayWorldPosition), this._ray.direction.copy(z(0, 0, 1).applyQuaternion(this.rayWorldQuaternion)), this._ray;
|
|
8072
8083
|
}
|
|
8073
8084
|
_ray;
|
|
8074
8085
|
/** Recalculated once per update */
|
|
@@ -8082,7 +8093,7 @@ class bS {
|
|
|
8082
8093
|
if (this._hand_wristDotUp !== void 0) return this._hand_wristDotUp;
|
|
8083
8094
|
const e = this.handObject?.joints.wrist;
|
|
8084
8095
|
if (e) {
|
|
8085
|
-
const t =
|
|
8096
|
+
const t = z(0, 1, 0).applyQuaternion(e.quaternion), i = z(0, 1, 0).dot(t);
|
|
8086
8097
|
return this._hand_wristDotUp = i;
|
|
8087
8098
|
}
|
|
8088
8099
|
}
|
|
@@ -8143,7 +8154,7 @@ class bS {
|
|
|
8143
8154
|
this.onUpdateFrame(e), this.updateInputEvents(), this.onUpdateMove();
|
|
8144
8155
|
}
|
|
8145
8156
|
onRenderDebug() {
|
|
8146
|
-
j.DrawSphere(this.rayWorldPosition, 3e-3), j.DrawDirection(this.rayWorldPosition,
|
|
8157
|
+
j.DrawSphere(this.rayWorldPosition, 3e-3), j.DrawDirection(this.rayWorldPosition, z(0, 0, 10).applyQuaternion(this.rayWorldQuaternion));
|
|
8147
8158
|
const t = (this.inputSource.gripSpace ? this.gripWorldPosition : this.object.worldPosition).sub(this.object.worldForward.multiplyScalar(0.1)), i = this.inputSource.profiles.join(`
|
|
8148
8159
|
`);
|
|
8149
8160
|
let n = `Controller[${this.index}] (${this.inputSource.targetRayMode}, ${this.side})
|
|
@@ -8179,13 +8190,13 @@ Layout: `;
|
|
|
8179
8190
|
let i = null, n = null, o = null, r = null;
|
|
8180
8191
|
if (t) {
|
|
8181
8192
|
const h = t.transform;
|
|
8182
|
-
this._rayMatrix.fromArray(h.matrix).premultiply(sl), this._rayMatrix.decompose(this._rayPosition, this._rayQuaternion,
|
|
8193
|
+
this._rayMatrix.fromArray(h.matrix).premultiply(sl), this._rayMatrix.decompose(this._rayPosition, this._rayQuaternion, z(1, 1, 1)), o = z(h.position), r = Mi(h.orientation), this._rayPositionRaw.copy(o), this._rayRotationRaw.copy(r);
|
|
8183
8194
|
}
|
|
8184
8195
|
if (this.inputSource.gripSpace) {
|
|
8185
8196
|
const h = e.getPose(this.inputSource.gripSpace, this.xr.referenceSpace);
|
|
8186
8197
|
if (h) {
|
|
8187
8198
|
const d = h.transform;
|
|
8188
|
-
if (i =
|
|
8199
|
+
if (i = z(d.position), n = Mi(d.orientation), this._gripMatrix.fromArray(d.matrix).premultiply(sl), this._gripMatrix.decompose(this._gripPosition, this._gripQuaternion, z(1, 1, 1)), "linearVelocity" in h && h.linearVelocity) {
|
|
8189
8200
|
const u = h.linearVelocity;
|
|
8190
8201
|
this._linearVelocity.set(u.x, u.y, u.z);
|
|
8191
8202
|
}
|
|
@@ -8203,7 +8214,7 @@ Layout: `;
|
|
|
8203
8214
|
}
|
|
8204
8215
|
h || (this._object.position.copy(this._rayPosition), this._object.quaternion.copy(this._rayQuaternion).multiply(sn));
|
|
8205
8216
|
const p = a.get("middle-finger-metacarpal"), m = p && this.getHandJointPose(p, e);
|
|
8206
|
-
m && (this._gripMatrix.fromArray(m.transform.matrix).premultiply(sl), this._gripMatrix.decompose(this._gripPosition, this._gripQuaternion,
|
|
8217
|
+
m && (this._gripMatrix.fromArray(m.transform.matrix).premultiply(sl), this._gripMatrix.decompose(this._gripPosition, this._gripQuaternion, z(1, 1, 1)), i = z().copy(m.transform.position), n = Mi().copy(m.transform.orientation), n.multiply(uM), i.add(z(fM).applyQuaternion(n)));
|
|
8207
8218
|
} else this.inputSource.gripSpace && this.targetRayMode === "transient-pointer" && i && n ? (this._object.position.copy(i), this._object.quaternion.copy(n).multiply(sn)) : o && r && (this._object.position.copy(o), this._object.quaternion.copy(r).multiply(sn));
|
|
8208
8219
|
Rs && (o && r && (this._raySpaceObject?.position.copy(o), this._raySpaceObject?.quaternion.copy(r).multiply(sn)), i && n && (this._gripSpaceObject?.position.copy(i), this._gripSpaceObject?.quaternion.copy(n).multiply(sn)));
|
|
8209
8220
|
const l = this.xr.context.mainCamera?.parent, c = l ? Ie(l) : void 0;
|
|
@@ -8396,7 +8407,7 @@ Layout: `;
|
|
|
8396
8407
|
if (!this.emitPointerDownEvent || this.inputSource !== e.inputSource) return;
|
|
8397
8408
|
this.onUpdateFrame(e.frame), this._hasSelectEvent = !0;
|
|
8398
8409
|
const t = this._layout?.selectComponentId, i = this._layout?.components[t]?.gamepadIndices?.button;
|
|
8399
|
-
i !== void 0 && (this._selectButtonIndex = i), this._selectIsActive = !0, !Md && (Rs && j.DrawDirection(this.rayWorldPosition,
|
|
8410
|
+
i !== void 0 && (this._selectButtonIndex = i), this._selectIsActive = !0, !Md && (Rs && j.DrawDirection(this.rayWorldPosition, z(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 16711680, 10), this._selectCompleted = !1, this.emitPointerEvent(Ae.PointerDown, this._selectButtonIndex || 0, "xr-standard-trigger", !0, e));
|
|
8400
8411
|
};
|
|
8401
8412
|
onSelect = (e) => {
|
|
8402
8413
|
this.inputSource === e.inputSource && (this._selectCompleted = !0);
|
|
@@ -8408,7 +8419,7 @@ Layout: `;
|
|
|
8408
8419
|
this._selectCompleted = !1, this.emitPointerEvent(Ae.PointerUp, this._selectButtonIndex || 0, "xr-standard-trigger", !0, e, void 0, t);
|
|
8409
8420
|
};
|
|
8410
8421
|
onSqueezeStart = (e) => {
|
|
8411
|
-
this.emitPointerDownEvent && this.inputSource === e.inputSource && (this._squeezeButtonIndex = this._layout?.components["xr-standard-squeeze"]?.gamepadIndices?.button, this._squeezeButtonIndex !== void 0 && (Rs && j.DrawDirection(this.rayWorldPosition,
|
|
8422
|
+
this.emitPointerDownEvent && this.inputSource === e.inputSource && (this._squeezeButtonIndex = this._layout?.components["xr-standard-squeeze"]?.gamepadIndices?.button, this._squeezeButtonIndex !== void 0 && (Rs && j.DrawDirection(this.rayWorldPosition, z(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 255, 10), this._squeezeIsActive = !0, this._squeezeCompleted = !1, this.emitPointerEvent(Ae.PointerDown, this._squeezeButtonIndex || 0, "xr-standard-squeeze", !0, e)));
|
|
8412
8423
|
};
|
|
8413
8424
|
onSqueeze = (e) => {
|
|
8414
8425
|
this.inputSource === e.inputSource && (this._squeezeCompleted = !0);
|
|
@@ -8477,7 +8488,7 @@ Layout: `;
|
|
|
8477
8488
|
}
|
|
8478
8489
|
_didMoveLastFrame = !1;
|
|
8479
8490
|
_lastPointerMovePosition = new w();
|
|
8480
|
-
_lastPointerMoveQuaternion = new
|
|
8491
|
+
_lastPointerMoveQuaternion = new U();
|
|
8481
8492
|
onUpdateMove() {
|
|
8482
8493
|
if (!this.emitPointerMoveEvent) return;
|
|
8483
8494
|
let e = !1;
|
|
@@ -8649,7 +8660,7 @@ class o0 {
|
|
|
8649
8660
|
depthTest: !1,
|
|
8650
8661
|
fog: !1,
|
|
8651
8662
|
side: Ni
|
|
8652
|
-
}), this._fadeToColorQuad = new V(new
|
|
8663
|
+
}), this._fadeToColorQuad = new V(new zn(10, 10), this._fadeToColorMaterial);
|
|
8653
8664
|
}
|
|
8654
8665
|
dispose() {
|
|
8655
8666
|
this._fadeToColorQuad.geometry.dispose(), this._fadeToColorMaterial.dispose();
|
|
@@ -8729,7 +8740,7 @@ class Sl {
|
|
|
8729
8740
|
this._mode = e, this._init = t, this._session = i, this._session.addEventListener("end", this.onEnd), this._renderer = new ca({ alpha: !0, antialias: !0 }), this._renderer.outputColorSpace = "srgb", this._renderer.setPixelRatio(Math.min(2, window.devicePixelRatio)), this._renderer.setSize(window.innerWidth, window.innerHeight, !0), D.isNeedleAppClip() && window.requestAnimationFrame(() => {
|
|
8730
8741
|
const n = Math.min(2, window.devicePixelRatio), o = Math.floor(window.innerWidth * n), r = Math.floor(window.innerHeight * n);
|
|
8731
8742
|
this._renderer.domElement.width = o, this._renderer.domElement.height = r;
|
|
8732
|
-
}), this._renderer.setAnimationLoop(this.onFrame), this._renderer.xr.setSession(i), this._renderer.xr.enabled = !0, this._camera = new pe(), this._scene = new
|
|
8743
|
+
}), this._renderer.setAnimationLoop(this.onFrame), this._renderer.xr.setSession(i), this._renderer.xr.enabled = !0, this._camera = new pe(), this._scene = new zi(), this._scene.fog = new rx(4473924, 10, 250), this._scene.add(this._camera), this.setupScene();
|
|
8733
8744
|
}
|
|
8734
8745
|
end() {
|
|
8735
8746
|
return this._session ? this._session.end() : Promise.resolve();
|
|
@@ -8789,7 +8800,7 @@ class Sl {
|
|
|
8789
8800
|
d?.length && (e = d, R() && console.debug("[XR] Using custom loading logo from license:", e));
|
|
8790
8801
|
}
|
|
8791
8802
|
}
|
|
8792
|
-
const t = this._logoObject = new V(new
|
|
8803
|
+
const t = this._logoObject = new V(new zn(1, 1, 1, 1), new Le({ transparent: !0, side: 2 }));
|
|
8793
8804
|
t.scale.multiplyScalar(this._logoScale * window.devicePixelRatio), t.renderOrder = 1e3, t.material.opacity = 0, this._scene.add(t);
|
|
8794
8805
|
const i = document.createElement("canvas"), n = i.getContext("2d"), o = new Image(), r = (h) => {
|
|
8795
8806
|
if (!n) return;
|
|
@@ -8824,7 +8835,7 @@ class Sl {
|
|
|
8824
8835
|
color: 2236962,
|
|
8825
8836
|
metalness: 1,
|
|
8826
8837
|
roughness: 0.8
|
|
8827
|
-
}), p =
|
|
8838
|
+
}), p = Uh.Sphere, m = ha.createPrimitive(p, { material: u });
|
|
8828
8839
|
m.position.x = B.random(-50, 50), m.position.y = B.random(-2, 50), m.position.z = B.random(-50, 50), m.rotation.x = B.random(0, Math.PI * 2), m.rotation.y = B.random(0, Math.PI * 2), m.rotation.z = B.random(0, Math.PI * 2), m.scale.multiplyScalar(0.5 + Math.random() * 10);
|
|
8829
8840
|
const b = m.position.distanceTo(this._camera.position) - m.scale.x;
|
|
8830
8841
|
b < 10 && (m.position.z += 5, m.position.multiplyScalar(1 + 1 / b)), this._roomFlyObjects.push(m), this._scene.add(m);
|
|
@@ -9458,8 +9469,8 @@ class G {
|
|
|
9458
9469
|
*/
|
|
9459
9470
|
getUserOffsetInRig() {
|
|
9460
9471
|
const e = this.context.mainCamera?.position;
|
|
9461
|
-
if (!e || !this.rig) return
|
|
9462
|
-
const t =
|
|
9472
|
+
if (!e || !this.rig) return z(0, 0, 0);
|
|
9473
|
+
const t = z(e);
|
|
9463
9474
|
return t.x *= -1, t.z *= -1, t.applyQuaternion(Mi(this.rig.gameObject.quaternion)), t;
|
|
9464
9475
|
}
|
|
9465
9476
|
updateActiveXRRig() {
|
|
@@ -9512,7 +9523,7 @@ class G {
|
|
|
9512
9523
|
convertHitTestResult(e) {
|
|
9513
9524
|
const t = this.context.renderer.xr.getReferenceSpace(), i = t && e.getPose(t);
|
|
9514
9525
|
if (i) {
|
|
9515
|
-
const n =
|
|
9526
|
+
const n = z(i.transform.position), o = Mi(i.transform.orientation), r = this.context.mainCamera;
|
|
9516
9527
|
if (r?.parent !== this._cameraRenderParent && n.applyMatrix4(sl), r?.parent) {
|
|
9517
9528
|
n.applyMatrix4(r.parent.matrixWorld), o.multiply(sn);
|
|
9518
9529
|
const a = Ie(r.parent);
|
|
@@ -9524,7 +9535,7 @@ class G {
|
|
|
9524
9535
|
}
|
|
9525
9536
|
/** convert a XRRigidTransform from XR session space to threejs / Needle Engine XR space */
|
|
9526
9537
|
convertSpace(e) {
|
|
9527
|
-
const t =
|
|
9538
|
+
const t = z(e.position);
|
|
9528
9539
|
t.applyMatrix4(sl);
|
|
9529
9540
|
const i = Mi(e.orientation);
|
|
9530
9541
|
return i.premultiply(sn), { position: t, quaternion: i };
|
|
@@ -9550,7 +9561,7 @@ class G {
|
|
|
9550
9561
|
*/
|
|
9551
9562
|
_mainCamera = null;
|
|
9552
9563
|
constructor(e, t, i, n) {
|
|
9553
|
-
CM(e, n.init), this.session = t, this.mode = e, this.context = i, (Ye || x("console")) && Xc(!0), this._xr_scripts = [...n.scripts], this._xr_update_scripts = this._xr_scripts.filter((l) => typeof l.onUpdateXR == "function"), this._controllerAdded = n.controller_added, this._controllerRemoved = n.controller_removed, no(this.onBefore, De.LateUpdate), this.context.pre_render_callbacks.push(this.onBeforeRender), this.context.post_render_callbacks.push(this.onAfterRender), this.context.addBeforeRenderListener(this.context.scene, this.syncCameraCullingMask), (n.init.optionalFeatures?.includes("hit-test") || n.init.requiredFeatures?.includes("hit-test")) && t.requestReferenceSpace("viewer").then((l) => t.requestHitTestSource?.call(t, { space: l })?.then((c) => this._viewerHitTestSource = c).catch((c) => console.error(c))).catch((l) => console.error(l)), this.context.mainCamera && (this._originalCameraWorldPosition = le(this.context.mainCamera, new w()), this._originalCameraWorldRotation = Ie(this.context.mainCamera, new
|
|
9564
|
+
CM(e, n.init), this.session = t, this.mode = e, this.context = i, (Ye || x("console")) && Xc(!0), this._xr_scripts = [...n.scripts], this._xr_update_scripts = this._xr_scripts.filter((l) => typeof l.onUpdateXR == "function"), this._controllerAdded = n.controller_added, this._controllerRemoved = n.controller_removed, no(this.onBefore, De.LateUpdate), this.context.pre_render_callbacks.push(this.onBeforeRender), this.context.post_render_callbacks.push(this.onAfterRender), this.context.addBeforeRenderListener(this.context.scene, this.syncCameraCullingMask), (n.init.optionalFeatures?.includes("hit-test") || n.init.requiredFeatures?.includes("hit-test")) && t.requestReferenceSpace("viewer").then((l) => t.requestHitTestSource?.call(t, { space: l })?.then((c) => this._viewerHitTestSource = c).catch((c) => console.error(c))).catch((l) => console.error(l)), this.context.mainCamera && (this._originalCameraWorldPosition = le(this.context.mainCamera, new w()), this._originalCameraWorldRotation = Ie(this.context.mainCamera, new U()), this._originalCameraWorldScale = it(this.context.mainCamera, new w()), this._originalCameraParent = this.context.mainCamera.parent, this.context.mainCamera instanceof pe && (this.context.mainCamera[Ad] = this.context.mainCamera.fov)), this._defaultRig = new cM(), this.context.scene.add(this._defaultRig.gameObject), this.addRig(this._defaultRig);
|
|
9554
9565
|
for (let l = 0; l < t.inputSources.length; l++) {
|
|
9555
9566
|
const c = t.inputSources[l];
|
|
9556
9567
|
if (!c.handedness) {
|
|
@@ -9752,11 +9763,11 @@ class G {
|
|
|
9752
9763
|
if (this._didStart = !0, this.mode === "immersive-vr") {
|
|
9753
9764
|
const o = Wi(this.context.scene.children);
|
|
9754
9765
|
if (o) {
|
|
9755
|
-
const r = o.getSize(
|
|
9766
|
+
const r = o.getSize(z());
|
|
9756
9767
|
if (r.length() > 0) {
|
|
9757
9768
|
const a = this._defaultRig.gameObject;
|
|
9758
9769
|
a.position.set(o.min.x + r.x * 0.5, o.min.y, o.max.z + r.z * 0.5 + 1.5);
|
|
9759
|
-
const l = o.getCenter(
|
|
9770
|
+
const l = o.getCenter(z());
|
|
9760
9771
|
l.y = a.position.y, a.lookAt(l);
|
|
9761
9772
|
}
|
|
9762
9773
|
}
|
|
@@ -10000,7 +10011,7 @@ ${o.hand ? "hand" : "ctrl"} ${o.inputSource.handedness}[${o.index}] con:${o.conn
|
|
|
10000
10011
|
this._camera && this._previousCameraParent && this._previousCameraParent.add(this._camera), this._previousCameraParent = null, this._camera instanceof pe && this.originalCameraNearPlane != null && (this._camera.near = this.originalCameraNearPlane, this.originalCameraNearPlane = void 0);
|
|
10001
10012
|
}
|
|
10002
10013
|
_viewerPose;
|
|
10003
|
-
_transformOrientation = new
|
|
10014
|
+
_transformOrientation = new U();
|
|
10004
10015
|
_transformPosition = new w();
|
|
10005
10016
|
internalUpdateState() {
|
|
10006
10017
|
const e = this.context.renderer.xr.getReferenceSpace();
|
|
@@ -10680,10 +10691,10 @@ class jM {
|
|
|
10680
10691
|
});
|
|
10681
10692
|
i.add(n), i["needle:use_eventsystem"] = !0;
|
|
10682
10693
|
const o = new c0(this._context, () => t.click());
|
|
10683
|
-
return cl(i, o), new
|
|
10694
|
+
return cl(i, o), new UM(this, e, t, i, n);
|
|
10684
10695
|
}
|
|
10685
10696
|
}
|
|
10686
|
-
class
|
|
10697
|
+
class UM {
|
|
10687
10698
|
menu;
|
|
10688
10699
|
root;
|
|
10689
10700
|
htmlbutton;
|
|
@@ -11627,10 +11638,10 @@ class wh extends Gf {
|
|
|
11627
11638
|
}), this.appendChild(t);
|
|
11628
11639
|
}
|
|
11629
11640
|
}
|
|
11630
|
-
var
|
|
11641
|
+
var zM = Object.defineProperty, xe = (s, e, t, i) => {
|
|
11631
11642
|
for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
|
|
11632
11643
|
(r = s[o]) && (n = r(e, t, n) || n);
|
|
11633
|
-
return n &&
|
|
11644
|
+
return n && zM(e, t, n), n;
|
|
11634
11645
|
};
|
|
11635
11646
|
const tt = x("debugcontext"), NM = x("stats"), $M = x("debugactive"), WM = x("debugframerate"), VM = x("debugcoroutine"), J5 = {};
|
|
11636
11647
|
class e4 {
|
|
@@ -12050,7 +12061,7 @@ const _e = class Se {
|
|
|
12050
12061
|
get events() {
|
|
12051
12062
|
return this._events;
|
|
12052
12063
|
}
|
|
12053
|
-
_events = new
|
|
12064
|
+
_events = new Uv();
|
|
12054
12065
|
/** @deprecated AssetDatabase is deprecated */
|
|
12055
12066
|
assets;
|
|
12056
12067
|
lights = new Array();
|
|
@@ -12098,7 +12109,7 @@ const _e = class Se {
|
|
|
12098
12109
|
_isVisible = !1;
|
|
12099
12110
|
_stats = NM ? new Nk() : null;
|
|
12100
12111
|
constructor(e) {
|
|
12101
|
-
this.name = e?.name || "", this.alias = e?.alias, this.domElement = e?.domElement || document.body, this.hash = e?.hash, e?.renderer && (this.renderer = e.renderer, this.isManagedExternally = !0), e?.runInBackground !== void 0 && (this.runInBackground = e.runInBackground), e?.scene ? this.scene = e.scene : this.scene = new
|
|
12112
|
+
this.name = e?.name || "", this.alias = e?.alias, this.domElement = e?.domElement || document.body, this.hash = e?.hash, e?.renderer && (this.renderer = e.renderer, this.isManagedExternally = !0), e?.runInBackground !== void 0 && (this.runInBackground = e.runInBackground), e?.scene ? this.scene = e.scene : this.scene = new zi(), this._fallbackCamera && !this._fallbackCamera.parent && this.scene.add(this._fallbackCamera), e?.camera && (this._mainCamera = e.camera), this._application = new _s(this), this._time = new DE(), this._input = new aE(this), this._physics = new xh(this), this._postprocessing = new jE(this), this._connection = new af(this), this.assets = new JM(), this.sceneLighting = new ME(this), this.addressables = new XR(this), this.lightmaps = new cE(this), this.players = new SE(this), this.menu = new Jc(this), this.lodsManager = new hE(this), this._animations = new KT(this), this.accessibility = new Ju(this);
|
|
12102
12113
|
const t = () => this._needsUpdateSize = !0;
|
|
12103
12114
|
window.addEventListener("resize", t), this._disposeCallbacks.push(() => window.removeEventListener("resize", t));
|
|
12104
12115
|
const i = new ResizeObserver((n) => this._needsUpdateSize = !0);
|
|
@@ -12214,7 +12225,7 @@ const _e = class Se {
|
|
|
12214
12225
|
* or when the web component is removed from the DOM
|
|
12215
12226
|
*/
|
|
12216
12227
|
clear() {
|
|
12217
|
-
ce.dispatchCallback(de.ContextClearing, this), Xn(this, de.ContextClearing), $i(this.scene, !0, !0), this.scene = new
|
|
12228
|
+
ce.dispatchCallback(de.ContextClearing, this), Xn(this, de.ContextClearing), $i(this.scene, !0, !0), this.scene = new zi(), this._fallbackCamera = null, this._mainCamera = null, this.addressables?.dispose(), this.lightmaps?.clear(), this.accessibility?.clear(), this.resetSubsystems(), this.isManagedExternally || this.renderer && (this.renderer.renderLists.dispose(), this.renderer.state.reset(), this.renderer.resetState()), ce.dispatchCallback(de.ContextCleared, this);
|
|
12218
12229
|
}
|
|
12219
12230
|
/**
|
|
12220
12231
|
* Resets the **runtime execution state** of the context — NOT your application:
|
|
@@ -12261,7 +12272,7 @@ const _e = class Se {
|
|
|
12261
12272
|
/** Shared between {@link clear} and {@link resetRuntimeState}: disposes the physics world,
|
|
12262
12273
|
* clears the render listeners, replaces the event bus and empties the lights list. */
|
|
12263
12274
|
resetSubsystems() {
|
|
12264
|
-
this.physics?.engine?.dispose(), this._onBeforeRenderListeners.clear(), this._onAfterRenderListeners.clear(), this._events.clear(), this._events = new
|
|
12275
|
+
this.physics?.engine?.dispose(), this._onBeforeRenderListeners.clear(), this._onAfterRenderListeners.clear(), this._events.clear(), this._events = new Uv(), this.lights.length = 0;
|
|
12265
12276
|
}
|
|
12266
12277
|
/**
|
|
12267
12278
|
* Dispose all allocated resources and clears the scene. This is automatically called e.g. when the `<needle-engine>` component is removed from the DOM.
|
|
@@ -13086,7 +13097,7 @@ class he extends oe {
|
|
|
13086
13097
|
return new he(e);
|
|
13087
13098
|
}
|
|
13088
13099
|
}
|
|
13089
|
-
const qt = new w(), d0 = new w(), u0 = new
|
|
13100
|
+
const qt = new w(), d0 = new w(), u0 = new U(), HM = x("debuggizmos"), Sn = 8947848, Sm = 32;
|
|
13090
13101
|
class j {
|
|
13091
13102
|
constructor() {
|
|
13092
13103
|
}
|
|
@@ -13349,9 +13360,9 @@ class yi {
|
|
|
13349
13360
|
let i = t.geometry.getAttribute("position");
|
|
13350
13361
|
if (!i) {
|
|
13351
13362
|
i = new lt(new Float32Array(Sm * 3), 3), t.geometry.setAttribute("position", i);
|
|
13352
|
-
const n =
|
|
13363
|
+
const n = z(0, 1, 0), o = z(0, 0, 1), r = z(o);
|
|
13353
13364
|
r.cross(n).normalize();
|
|
13354
|
-
const a =
|
|
13365
|
+
const a = z(r), l = Math.PI * 2 / (Sm - 1);
|
|
13355
13366
|
for (let c = 0; c < Sm + 1; c++) {
|
|
13356
13367
|
const h = l * c;
|
|
13357
13368
|
n.copy(a).multiplyScalar(Math.cos(h) * 1), r.copy(o).multiplyScalar(Math.sin(h) * 1);
|
|
@@ -13675,19 +13686,19 @@ function KM(s, e, t) {
|
|
|
13675
13686
|
const l = this, c = l.geometry.boundingSphere;
|
|
13676
13687
|
if (c) {
|
|
13677
13688
|
if (l instanceof _l) {
|
|
13678
|
-
Dd.setFromNormalAndCoplanarPoint(
|
|
13679
|
-
const d = o.ray.intersectPlane(Dd,
|
|
13689
|
+
Dd.setFromNormalAndCoplanarPoint(z(0, 1, 0), z(0, -l.position.y, 0)), Dd.applyMatrix4(l.matrixWorld, YM);
|
|
13690
|
+
const d = o.ray.intersectPlane(Dd, z());
|
|
13680
13691
|
if (d) {
|
|
13681
13692
|
Cr.copy(c), Cr.applyMatrix4(l.matrixWorld);
|
|
13682
|
-
const p =
|
|
13693
|
+
const p = z(d).sub(o.ray.origin).length(), m = Cr.radius * 0.5;
|
|
13683
13694
|
p < m && r.push({ distance: p, point: d, object: l, normal: Dd.normal.clone() });
|
|
13684
13695
|
}
|
|
13685
13696
|
return;
|
|
13686
13697
|
}
|
|
13687
13698
|
Cr.copy(c), Cr.applyMatrix4(l.matrixWorld);
|
|
13688
|
-
const h = o.ray.intersectSphere(Cr,
|
|
13699
|
+
const h = o.ray.intersectSphere(Cr, z());
|
|
13689
13700
|
if (h) {
|
|
13690
|
-
const d =
|
|
13701
|
+
const d = z(h).sub(o.ray.origin), u = d.length();
|
|
13691
13702
|
if (u > Cr.radius) {
|
|
13692
13703
|
const p = d.clone().normalize();
|
|
13693
13704
|
r.push({ distance: u, point: h, object: l, normal: p });
|
|
@@ -13885,9 +13896,9 @@ function Ne(s) {
|
|
|
13885
13896
|
qr && console.warn("Object is marked as not disposable", s);
|
|
13886
13897
|
return;
|
|
13887
13898
|
}
|
|
13888
|
-
if (typeof s == "object" && (s[ES] = !0), s instanceof
|
|
13899
|
+
if (typeof s == "object" && (s[ES] = !0), s instanceof zi)
|
|
13889
13900
|
Ne(s.environment), Ne(s.background), Ne(s.customDepthMaterial), Ne(s.customDistanceMaterial);
|
|
13890
|
-
else if (s instanceof
|
|
13901
|
+
else if (s instanceof zo)
|
|
13891
13902
|
Ne(s.geometry), Ne(s.material), Ne(s.skeleton), Ne(s.bindMatrix), Ne(s.bindMatrixInverse), Ne(s.customDepthMaterial), Ne(s.customDistanceMaterial), s.visible = !1;
|
|
13892
13903
|
else if (s instanceof V)
|
|
13893
13904
|
Ne(s.geometry), Ne(s.material), Ne(s.customDepthMaterial), Ne(s.customDistanceMaterial), s.visible = !1;
|
|
@@ -13903,8 +13914,8 @@ function Ne(s) {
|
|
|
13903
13914
|
qr && console.warn("BufferAttribute dispose not supported", s.count);
|
|
13904
13915
|
else if (s instanceof Array)
|
|
13905
13916
|
for (const e of s)
|
|
13906
|
-
e instanceof
|
|
13907
|
-
else if (s instanceof
|
|
13917
|
+
e instanceof Pe && Ne(e);
|
|
13918
|
+
else if (s instanceof Pe) {
|
|
13908
13919
|
Oa(s);
|
|
13909
13920
|
for (const t of Object.keys(s)) {
|
|
13910
13921
|
const i = s[t];
|
|
@@ -13942,7 +13953,7 @@ function ti(s, e) {
|
|
|
13942
13953
|
da && !xh.raycasting && (uf(Sh, this, t, !1), uf(Sh, this, i, !0));
|
|
13943
13954
|
});
|
|
13944
13955
|
}
|
|
13945
|
-
da && (ti(V.prototype, "material"), ti(V.prototype, "geometry"), ti(
|
|
13956
|
+
da && (ti(V.prototype, "material"), ti(V.prototype, "geometry"), ti(Pe.prototype, "map"), ti(Pe.prototype, "bumpMap"), ti(Pe.prototype, "alphaMap"), ti(Pe.prototype, "normalMap"), ti(Pe.prototype, "displacementMap"), ti(Pe.prototype, "roughnessMap"), ti(Pe.prototype, "metalnessMap"), ti(Pe.prototype, "emissiveMap"), ti(Pe.prototype, "specularMap"), ti(Pe.prototype, "envMap"), ti(Pe.prototype, "lightMap"), ti(Pe.prototype, "aoMap"), ti(Pe.prototype, "gradientMap"));
|
|
13946
13957
|
function nA(s) {
|
|
13947
13958
|
if (da === !1) return;
|
|
13948
13959
|
const e = s[Sh];
|
|
@@ -13950,7 +13961,7 @@ function nA(s) {
|
|
|
13950
13961
|
for (const t of e)
|
|
13951
13962
|
uf(Sh, t, s, !1);
|
|
13952
13963
|
}
|
|
13953
|
-
da && f_(
|
|
13964
|
+
da && f_(Pe.prototype, "dispose", function() {
|
|
13954
13965
|
nA(this);
|
|
13955
13966
|
});
|
|
13956
13967
|
let Zg = 0;
|
|
@@ -14112,7 +14123,7 @@ function ta(s, e, t) {
|
|
|
14112
14123
|
if (e instanceof Set)
|
|
14113
14124
|
return lA(e, t);
|
|
14114
14125
|
if (!(e instanceof WeakMap || e instanceof WeakSet)) {
|
|
14115
|
-
if (
|
|
14126
|
+
if (zR(e) && e.$serializedTypes)
|
|
14116
14127
|
return cA(e, t);
|
|
14117
14128
|
if (iy(e))
|
|
14118
14129
|
return hA(s, e, t);
|
|
@@ -14340,7 +14351,7 @@ function mA() {
|
|
|
14340
14351
|
const s = new Z(), e = new w(0, 0, 0), t = new w(0, 1, 0);
|
|
14341
14352
|
Object.getOwnPropertyDescriptor(E.prototype, "worldForward") || Object.defineProperty(E.prototype, "worldForward", {
|
|
14342
14353
|
get: function() {
|
|
14343
|
-
return
|
|
14354
|
+
return z().set(0, 0, 1).applyQuaternion(Ie(this));
|
|
14344
14355
|
},
|
|
14345
14356
|
set: function(i) {
|
|
14346
14357
|
const n = Mi().setFromRotationMatrix(s.lookAt(e.set(0, 0, 0), i, t.set(0, 1, 0)));
|
|
@@ -14348,11 +14359,11 @@ function mA() {
|
|
|
14348
14359
|
}
|
|
14349
14360
|
}), Object.getOwnPropertyDescriptor(E.prototype, "worldRight") || Object.defineProperty(E.prototype, "worldRight", {
|
|
14350
14361
|
get: function() {
|
|
14351
|
-
return
|
|
14362
|
+
return z().set(1, 0, 0).applyQuaternion(Ie(this));
|
|
14352
14363
|
}
|
|
14353
14364
|
}), Object.getOwnPropertyDescriptor(E.prototype, "worldUp") || Object.defineProperty(E.prototype, "worldUp", {
|
|
14354
14365
|
get: function() {
|
|
14355
|
-
return
|
|
14366
|
+
return z().set(0, 1, 0).applyQuaternion(Ie(this));
|
|
14356
14367
|
}
|
|
14357
14368
|
}), Object.getOwnPropertyDescriptor(E.prototype, "contains") || Object.defineProperty(E.prototype, "contains", {
|
|
14358
14369
|
value: function(i) {
|
|
@@ -14391,7 +14402,7 @@ function rl(s, e) {
|
|
|
14391
14402
|
return typeof e == "number" && (e = e > 0.5), s.visible = e, s.visible;
|
|
14392
14403
|
}
|
|
14393
14404
|
function yA(s) {
|
|
14394
|
-
return s[
|
|
14405
|
+
return s[zs] || A_(s);
|
|
14395
14406
|
}
|
|
14396
14407
|
function _A(s, e) {
|
|
14397
14408
|
s[AS] = e;
|
|
@@ -14450,7 +14461,7 @@ function sy(s, e = !0, t = !0) {
|
|
|
14450
14461
|
t && n.removeFromParent();
|
|
14451
14462
|
}
|
|
14452
14463
|
function bs(s, e, t = !0) {
|
|
14453
|
-
return
|
|
14464
|
+
return US(s, e, t);
|
|
14454
14465
|
}
|
|
14455
14466
|
function* jS(s, e, t = !1, i = 999, n = 0) {
|
|
14456
14467
|
if (s?.userData.components && !(n > i)) {
|
|
@@ -14461,7 +14472,7 @@ function* jS(s, e, t = !1, i = 999, n = 0) {
|
|
|
14461
14472
|
yield* jS(o, e, !0, i, n + 1);
|
|
14462
14473
|
}
|
|
14463
14474
|
}
|
|
14464
|
-
function
|
|
14475
|
+
function US(s, e, t, i = 0) {
|
|
14465
14476
|
if (s) {
|
|
14466
14477
|
if (s.isObject3D, i > 1e3) {
|
|
14467
14478
|
console.warn("Failed to iterate components: too many levels");
|
|
@@ -14480,7 +14491,7 @@ function zS(s, e, t, i = 0) {
|
|
|
14480
14491
|
for (let o = 0; o < s.children.length; o++) {
|
|
14481
14492
|
const r = s.children[o];
|
|
14482
14493
|
if (!r) continue;
|
|
14483
|
-
const a =
|
|
14494
|
+
const a = US(r, e, t, n);
|
|
14484
14495
|
if (a !== void 0) return a;
|
|
14485
14496
|
}
|
|
14486
14497
|
}
|
|
@@ -14493,7 +14504,7 @@ function Zo(s, e) {
|
|
|
14493
14504
|
e != null && (e.x !== void 0 ? (t = new so(), t.position = e) : t = e);
|
|
14494
14505
|
let i = K.Current;
|
|
14495
14506
|
t?.context && (i = t.context), Tu && i.alias && console.log("context", i.alias), t && !t.idProvider && (t.idProvider = new xt(Date.now()));
|
|
14496
|
-
const n = [], o = {}, r = {}, a =
|
|
14507
|
+
const n = [], o = {}, r = {}, a = zS(i, s, t, n, o, r);
|
|
14497
14508
|
a && (sA(o), xA(r, o), wA(o)), Tu && (Rg(s, !0), Rg(a, !0));
|
|
14498
14509
|
const l = {};
|
|
14499
14510
|
for (const c in o) {
|
|
@@ -14526,7 +14537,7 @@ function Zo(s, e) {
|
|
|
14526
14537
|
}
|
|
14527
14538
|
return a;
|
|
14528
14539
|
}
|
|
14529
|
-
function
|
|
14540
|
+
function zS(s, e, t, i, n, o) {
|
|
14530
14541
|
if (!e || e[Di] || e instanceof cx || e instanceof hx || e.hideFlags & Js.DontInstantiate)
|
|
14531
14542
|
return null;
|
|
14532
14543
|
const r = e.userData;
|
|
@@ -14552,7 +14563,7 @@ function US(s, e, t, i, n, o) {
|
|
|
14552
14563
|
l.worldPosition = t.position;
|
|
14553
14564
|
else l.position.copy(e.position);
|
|
14554
14565
|
if (t?.rotation) {
|
|
14555
|
-
if (t.rotation instanceof
|
|
14566
|
+
if (t.rotation instanceof U)
|
|
14556
14567
|
l.worldQuaternion = t.rotation;
|
|
14557
14568
|
else if (t.rotation instanceof Be)
|
|
14558
14569
|
l.worldQuaternion = Mi().setFromEuler(t.rotation);
|
|
@@ -14587,7 +14598,7 @@ function US(s, e, t, i, n, o) {
|
|
|
14587
14598
|
}
|
|
14588
14599
|
t && (t.position = void 0, t.rotation = void 0, t.scale = void 0, t.parent = void 0, t.visible = void 0);
|
|
14589
14600
|
for (const d in e.children) {
|
|
14590
|
-
const u = e.children[d], p =
|
|
14601
|
+
const u = e.children[d], p = zS(s, u, t, i, n, o);
|
|
14591
14602
|
p && (n[p.uuid] = { original: u, clone: p }, l.add(p));
|
|
14592
14603
|
}
|
|
14593
14604
|
return l;
|
|
@@ -14791,11 +14802,11 @@ function gf(s, e, t, i = 0) {
|
|
|
14791
14802
|
const n = Nh(s);
|
|
14792
14803
|
if (e && (e = n, e && s.parent && i === 0)) {
|
|
14793
14804
|
const l = s.parent;
|
|
14794
|
-
e = l[
|
|
14805
|
+
e = l[zs], e === void 0 && (l instanceof zi || (e = !0));
|
|
14795
14806
|
}
|
|
14796
|
-
const r = s[
|
|
14807
|
+
const r = s[zs] !== e;
|
|
14797
14808
|
if (r) {
|
|
14798
|
-
s[
|
|
14809
|
+
s[zs] = e, SA && console.warn("ACTIVE CHANGE", { name: s.name, activeSelf: n, visible: s.visible, activeInHierarchy: e, changed: r, go: s });
|
|
14799
14810
|
{
|
|
14800
14811
|
const l = s.userData?.components;
|
|
14801
14812
|
if (l) {
|
|
@@ -14822,7 +14833,7 @@ function gf(s, e, t, i = 0) {
|
|
|
14822
14833
|
let c = !0;
|
|
14823
14834
|
for (let h = 0, d = a.length; h < d; h++) {
|
|
14824
14835
|
const u = a[h];
|
|
14825
|
-
u[
|
|
14836
|
+
u[zs] !== !1 && gf(u, !1, t, i + 1) === !1 && (c = !1);
|
|
14826
14837
|
}
|
|
14827
14838
|
return c;
|
|
14828
14839
|
}
|
|
@@ -14846,7 +14857,7 @@ function ih(s) {
|
|
|
14846
14857
|
}
|
|
14847
14858
|
i = i.parent;
|
|
14848
14859
|
}
|
|
14849
|
-
s[
|
|
14860
|
+
s[zs] = e && t;
|
|
14850
14861
|
}
|
|
14851
14862
|
const ll = /* @__PURE__ */ new Map(), WS = /* @__PURE__ */ Symbol("prewarmFlag"), yf = /* @__PURE__ */ Symbol("waitingForPrewarm"), ay = x("debugprewarm");
|
|
14852
14863
|
function kA(s, e) {
|
|
@@ -15065,7 +15076,7 @@ function $h(s, e, t, i = !0) {
|
|
|
15065
15076
|
return t || (t = []), i && (t.length = 0), QS(s, e, t), t;
|
|
15066
15077
|
}
|
|
15067
15078
|
function ep(s, e, t = !1) {
|
|
15068
|
-
if (t === !1 && s[
|
|
15079
|
+
if (t === !1 && s[zs] === !1) return null;
|
|
15069
15080
|
const i = Jo(s, e);
|
|
15070
15081
|
if (t === !1 && (i?.enabled === !1 || i?.activeAndEnabled === !1)) return null;
|
|
15071
15082
|
if (i) return i;
|
|
@@ -15184,7 +15195,7 @@ function a4() {
|
|
|
15184
15195
|
function P0() {
|
|
15185
15196
|
return globalThis.NEEDLE_HOT_RELOAD_ENABLED === !0;
|
|
15186
15197
|
}
|
|
15187
|
-
function
|
|
15198
|
+
function UA(s) {
|
|
15188
15199
|
if (Ph) {
|
|
15189
15200
|
Ho && console.warn("[Needle Engine] Hot reloading is in progress, not registering instance", s);
|
|
15190
15201
|
return;
|
|
@@ -15193,7 +15204,7 @@ function zA(s) {
|
|
|
15193
15204
|
const t = s.constructor.name;
|
|
15194
15205
|
nh.has(t) ? nh.get(t)?.push(s) : nh.set(t, [s]);
|
|
15195
15206
|
}
|
|
15196
|
-
function
|
|
15207
|
+
function zA(s) {
|
|
15197
15208
|
if (Ph) {
|
|
15198
15209
|
Ho && console.warn("[Needle Engine] Hot reloading is in progress, not unregistering instance", s);
|
|
15199
15210
|
return;
|
|
@@ -15699,11 +15710,11 @@ class A {
|
|
|
15699
15710
|
}
|
|
15700
15711
|
get __isActiveInHierarchy() {
|
|
15701
15712
|
if (!this.gameObject) return !1;
|
|
15702
|
-
const e = this.gameObject[
|
|
15713
|
+
const e = this.gameObject[zs];
|
|
15703
15714
|
return e === void 0 ? !0 : e;
|
|
15704
15715
|
}
|
|
15705
15716
|
set __isActiveInHierarchy(e) {
|
|
15706
|
-
this.gameObject && (this.gameObject[
|
|
15717
|
+
this.gameObject && (this.gameObject[zs] = e);
|
|
15707
15718
|
}
|
|
15708
15719
|
/**
|
|
15709
15720
|
* Reference to the GameObject this component is attached to
|
|
@@ -15827,7 +15838,7 @@ class A {
|
|
|
15827
15838
|
}
|
|
15828
15839
|
/** @internal */
|
|
15829
15840
|
constructor(e) {
|
|
15830
|
-
this.__didAwake = !1, this.__didStart = !1, this.__didCompleteStart = !1, this.__inEnableOrDisableCallback = !1, this.__didEnable = !1, this.__isEnabled = void 0, this.__destroyed = !1, this._internalInit(e), P0() &&
|
|
15841
|
+
this.__didAwake = !1, this.__didStart = !1, this.__didCompleteStart = !1, this.__inEnableOrDisableCallback = !1, this.__didEnable = !1, this.__isEnabled = void 0, this.__destroyed = !1, this._internalInit(e), P0() && UA(this);
|
|
15831
15842
|
}
|
|
15832
15843
|
/** @internal */
|
|
15833
15844
|
__internalNewInstanceCreated(e) {
|
|
@@ -15880,7 +15891,7 @@ class A {
|
|
|
15880
15891
|
}
|
|
15881
15892
|
/** @internal */
|
|
15882
15893
|
__internalDestroy() {
|
|
15883
|
-
this.__destroyed || (this.__destroyed = !0, this.__didAwake && (this.onDestroy?.call(this), this.__destroyCleanups?.dispose(), this.dispatchEvent(new CustomEvent("destroyed", { detail: this }))), BA(this), P0() &&
|
|
15894
|
+
this.__destroyed || (this.__destroyed = !0, this.__didAwake && (this.onDestroy?.call(this), this.__destroyCleanups?.dispose(), this.dispatchEvent(new CustomEvent("destroyed", { detail: this }))), BA(this), P0() && zA(this));
|
|
15884
15895
|
}
|
|
15885
15896
|
/**
|
|
15886
15897
|
* Controls whether this component is enabled
|
|
@@ -16487,12 +16498,12 @@ function KS(s) {
|
|
|
16487
16498
|
return s === "rotation" ? "quaternion" : s;
|
|
16488
16499
|
}
|
|
16489
16500
|
function ZA(s, e) {
|
|
16490
|
-
return s === "quaternion" || s === "rotation" ? Ec : s === "visible" ? Qb : s === "position" || s === "scale" ? Mc : s === "color" || s === "emissive" ? Yb : e instanceof w ? Mc : e instanceof
|
|
16501
|
+
return s === "quaternion" || s === "rotation" ? Ec : s === "visible" ? Qb : s === "position" || s === "scale" ? Mc : s === "color" || s === "emissive" ? Yb : e instanceof w ? Mc : e instanceof U ? Ec : e instanceof oe ? Yb : e instanceof Be ? Ec : typeof e == "boolean" ? Qb : typeof e == "number" ? Qp : Array.isArray(e) ? e.length === 4 ? Ec : e.length === 3 ? Mc : e.length === 2 ? Mc : Qp : Qp;
|
|
16491
16502
|
}
|
|
16492
16503
|
function JA(s, e) {
|
|
16493
16504
|
if (Array.isArray(s)) {
|
|
16494
16505
|
if (e === "rotation" && s.length === 3) {
|
|
16495
|
-
const t = new
|
|
16506
|
+
const t = new U().setFromEuler(new Be(s[0], s[1], s[2]));
|
|
16496
16507
|
return [t.x, t.y, t.z, t.w];
|
|
16497
16508
|
}
|
|
16498
16509
|
return s;
|
|
@@ -16500,10 +16511,10 @@ function JA(s, e) {
|
|
|
16500
16511
|
if (typeof s == "number") return [s];
|
|
16501
16512
|
if (typeof s == "boolean") return [s ? 1 : 0];
|
|
16502
16513
|
if (s instanceof w) return [s.x, s.y, s.z];
|
|
16503
|
-
if (s instanceof
|
|
16514
|
+
if (s instanceof U) return [s.x, s.y, s.z, s.w];
|
|
16504
16515
|
if (s instanceof oe) return [s.r, s.g, s.b];
|
|
16505
16516
|
if (s instanceof Be) {
|
|
16506
|
-
const t = new
|
|
16517
|
+
const t = new U().setFromEuler(s);
|
|
16507
16518
|
return [t.x, t.y, t.z, t.w];
|
|
16508
16519
|
}
|
|
16509
16520
|
return typeof s == "object" && s !== null && "x" in s && "y" in s ? "w" in s ? [s.x, s.y, s.z, s.w] : "z" in s ? [s.x, s.y, s.z] : [s.x, s.y] : [Number(s)];
|
|
@@ -16549,7 +16560,7 @@ function oI(s) {
|
|
|
16549
16560
|
return Ii.NotEqual;
|
|
16550
16561
|
}
|
|
16551
16562
|
}
|
|
16552
|
-
class
|
|
16563
|
+
class U_ {
|
|
16553
16564
|
_name;
|
|
16554
16565
|
_parameters = [];
|
|
16555
16566
|
_states = [];
|
|
@@ -16562,7 +16573,7 @@ class z_ {
|
|
|
16562
16573
|
* @param name - Optional name for the controller
|
|
16563
16574
|
*/
|
|
16564
16575
|
static create(e) {
|
|
16565
|
-
return new
|
|
16576
|
+
return new U_(e);
|
|
16566
16577
|
}
|
|
16567
16578
|
constructor(e) {
|
|
16568
16579
|
this._name = e ?? "AnimatorController";
|
|
@@ -16799,7 +16810,7 @@ const Ft = x("debuganimatorcontroller"), Bd = x("debugrootmotion"), ZS = class l
|
|
|
16799
16810
|
* ```
|
|
16800
16811
|
*/
|
|
16801
16812
|
static build(e) {
|
|
16802
|
-
return new
|
|
16813
|
+
return new U_(e);
|
|
16803
16814
|
}
|
|
16804
16815
|
/**
|
|
16805
16816
|
* Plays an animation state by name or hash.
|
|
@@ -17339,13 +17350,13 @@ class yt {
|
|
|
17339
17350
|
rotationWrapper = null;
|
|
17340
17351
|
context;
|
|
17341
17352
|
positionChange = new w();
|
|
17342
|
-
rotationChange = new
|
|
17353
|
+
rotationChange = new U();
|
|
17343
17354
|
constructor(e, t, i, n, o) {
|
|
17344
|
-
if (this.context = e, this.root = t, this.clip = i, yt.firstKeyframeRotation[this.cacheId] || (yt.firstKeyframeRotation[this.cacheId] = new
|
|
17355
|
+
if (this.context = e, this.root = t, this.clip = i, yt.firstKeyframeRotation[this.cacheId] || (yt.firstKeyframeRotation[this.cacheId] = new U()), o) {
|
|
17345
17356
|
const r = o.values;
|
|
17346
17357
|
yt.firstKeyframeRotation[this.cacheId].set(r[0], r[1], r[2], r[3]);
|
|
17347
17358
|
}
|
|
17348
|
-
yt.spaceRotation[this.cacheId] || (yt.spaceRotation[this.cacheId] = new
|
|
17359
|
+
yt.spaceRotation[this.cacheId] || (yt.spaceRotation[this.cacheId] = new U()), yt.effectiveSpaceRotation[this.cacheId] || (yt.effectiveSpaceRotation[this.cacheId] = new U()), yt.clipOffsetRotation[this.cacheId] = new U(), o && yt.clipOffsetRotation[this.cacheId].set(o.values[0], o.values[1], o.values[2], o.values[3]).invert(), this.handlePosition(i, n), this.handleRotation(i, o);
|
|
17349
17360
|
}
|
|
17350
17361
|
onStart(e) {
|
|
17351
17362
|
if (e.getClip() !== this.clip) return;
|
|
@@ -17371,17 +17382,17 @@ class yt {
|
|
|
17371
17382
|
});
|
|
17372
17383
|
}
|
|
17373
17384
|
}
|
|
17374
|
-
static identityQuaternion = new
|
|
17385
|
+
static identityQuaternion = new U();
|
|
17375
17386
|
handleRotation(e, t) {
|
|
17376
17387
|
if (t) {
|
|
17377
17388
|
if (Bd) {
|
|
17378
|
-
const r = t.values, a = new Be().setFromQuaternion(new
|
|
17389
|
+
const r = t.values, a = new Be().setFromQuaternion(new U(r[0], r[1], r[2], r[3]));
|
|
17379
17390
|
console.log(e.name, t.name, "FIRST ROTATION IN TRACK", B.toDegrees(a.y));
|
|
17380
|
-
const l = t.values.length - 4, c = new
|
|
17391
|
+
const l = t.values.length - 4, c = new U().set(r[l], r[l + 1], r[l + 2], r[l + 3]), h = new Be().setFromQuaternion(c);
|
|
17381
17392
|
console.log(e.name, t.name, "LAST ROTATION IN TRACK", B.toDegrees(h.y));
|
|
17382
17393
|
}
|
|
17383
17394
|
let i = 0;
|
|
17384
|
-
const n = new
|
|
17395
|
+
const n = new U(), o = new U();
|
|
17385
17396
|
this.rotationWrapper = new T0(t, (r, a) => (r > i && (o.set(a[0], a[1], a[2], a[3]), n.invert(), o.multiply(n), this.rotationChange.copy(o)), n.fromArray(a), i = r, a[0] = 0, a[1] = 0, a[2] = 0, a[3] = 1, a));
|
|
17386
17397
|
}
|
|
17387
17398
|
}
|
|
@@ -17398,7 +17409,7 @@ class lI {
|
|
|
17398
17409
|
handler = [];
|
|
17399
17410
|
root;
|
|
17400
17411
|
basePosition = new w();
|
|
17401
|
-
baseQuaternion = new
|
|
17412
|
+
baseQuaternion = new U();
|
|
17402
17413
|
baseRotation = new Be();
|
|
17403
17414
|
constructor(e) {
|
|
17404
17415
|
this.controller = e;
|
|
@@ -17420,7 +17431,7 @@ class lI {
|
|
|
17420
17431
|
t.onBeforeUpdate(e);
|
|
17421
17432
|
}
|
|
17422
17433
|
summedPosition = new w();
|
|
17423
|
-
summedRotation = new
|
|
17434
|
+
summedRotation = new U();
|
|
17424
17435
|
onAfterUpdate(e) {
|
|
17425
17436
|
if (!(e <= 0)) {
|
|
17426
17437
|
this.root.position.copy(this.basePosition), this.root.quaternion.copy(this.baseQuaternion), this.summedPosition.set(0, 0, 0), this.summedRotation.set(0, 0, 0, 1);
|
|
@@ -18311,7 +18322,7 @@ class vI extends Vi {
|
|
|
18311
18322
|
if (e instanceof ke && t.type === $s) {
|
|
18312
18323
|
let i = e;
|
|
18313
18324
|
const n = cy.get(i)?.deref();
|
|
18314
|
-
n && (i = n), i.isRenderTargetTexture = !0, i.flipY = !0, i.offset.y = 1, i.repeat.y = -1, i.needsUpdate = !0, i.mipmaps = [], i instanceof
|
|
18325
|
+
n && (i = n), i.isRenderTargetTexture = !0, i.flipY = !0, i.offset.y = 1, i.repeat.y = -1, i.needsUpdate = !0, i.mipmaps = [], i instanceof UP && (i.isCompressedTexture = !1, i.format = Ff);
|
|
18315
18326
|
const o = i.image, r = new $s(o.width, o.height, {
|
|
18316
18327
|
colorSpace: Ys
|
|
18317
18328
|
});
|
|
@@ -18644,7 +18655,7 @@ class oo extends A {
|
|
|
18644
18655
|
}
|
|
18645
18656
|
}), l = a.min.y;
|
|
18646
18657
|
if (l < 1 / 0) {
|
|
18647
|
-
const c =
|
|
18658
|
+
const c = z();
|
|
18648
18659
|
c.x = a.min.x + (a.max.x - a.min.x) * 0.5;
|
|
18649
18660
|
const h = it(this.gameObject).x;
|
|
18650
18661
|
c.y = l + this._height * h - o, c.z = a.min.z + (a.max.z - a.min.z) * 0.5, un(this._projection, c);
|
|
@@ -18822,7 +18833,7 @@ function DI(s) {
|
|
|
18822
18833
|
fov: s.fov
|
|
18823
18834
|
};
|
|
18824
18835
|
}
|
|
18825
|
-
var FI = Object.defineProperty,
|
|
18836
|
+
var FI = Object.defineProperty, z_ = (s, e, t, i) => {
|
|
18826
18837
|
for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
|
|
18827
18838
|
(r = s[o]) && (n = r(e, t, n) || n);
|
|
18828
18839
|
return n && FI(e, t, n), n;
|
|
@@ -18841,13 +18852,13 @@ class Ml extends A {
|
|
|
18841
18852
|
t && (t.worldPosition = e);
|
|
18842
18853
|
}
|
|
18843
18854
|
}
|
|
18844
|
-
|
|
18855
|
+
z_([
|
|
18845
18856
|
f()
|
|
18846
18857
|
], Ml.prototype, "constraintActive");
|
|
18847
|
-
|
|
18858
|
+
z_([
|
|
18848
18859
|
f()
|
|
18849
18860
|
], Ml.prototype, "locked");
|
|
18850
|
-
|
|
18861
|
+
z_([
|
|
18851
18862
|
f(E)
|
|
18852
18863
|
], Ml.prototype, "sources");
|
|
18853
18864
|
let Xr = class {
|
|
@@ -18984,7 +18995,7 @@ function BI(s, e, t, i, n) {
|
|
|
18984
18995
|
if (!l || !l.get) {
|
|
18985
18996
|
this[r] = this[o];
|
|
18986
18997
|
const c = this[o];
|
|
18987
|
-
if (c instanceof ee || c instanceof w || c instanceof ve || c instanceof
|
|
18998
|
+
if (c instanceof ee || c instanceof w || c instanceof ve || c instanceof U) {
|
|
18988
18999
|
const h = this[o];
|
|
18989
19000
|
l_(h, () => {
|
|
18990
19001
|
this.onValidate(o);
|
|
@@ -19036,12 +19047,12 @@ const f4 = function(s) {
|
|
|
19036
19047
|
});
|
|
19037
19048
|
};
|
|
19038
19049
|
};
|
|
19039
|
-
var jI = Object.defineProperty,
|
|
19040
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
19050
|
+
var jI = Object.defineProperty, UI = Object.getOwnPropertyDescriptor, Gi = (s, e, t, i) => {
|
|
19051
|
+
for (var n = i > 1 ? void 0 : i ? UI(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
19041
19052
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
19042
19053
|
return i && n && jI(e, t, n), n;
|
|
19043
19054
|
};
|
|
19044
|
-
class
|
|
19055
|
+
class zI {
|
|
19045
19056
|
get isDirty() {
|
|
19046
19057
|
return this.positionChanged || this.rotationChanged;
|
|
19047
19058
|
}
|
|
@@ -19104,7 +19115,7 @@ class UI {
|
|
|
19104
19115
|
this._positionWatch?.revoke(), this._rotationWatch?.revoke();
|
|
19105
19116
|
}
|
|
19106
19117
|
}
|
|
19107
|
-
const Pi = class
|
|
19118
|
+
const Pi = class za extends A {
|
|
19108
19119
|
get isRigidbody() {
|
|
19109
19120
|
return !0;
|
|
19110
19121
|
}
|
|
@@ -19197,7 +19208,7 @@ const Pi = class Ua extends A {
|
|
|
19197
19208
|
this._watch = void 0, this._propertiesChanged = !1;
|
|
19198
19209
|
}
|
|
19199
19210
|
onEnable() {
|
|
19200
|
-
this._watch || (this._watch = new
|
|
19211
|
+
this._watch || (this._watch = new zI(this.gameObject, this.context)), this._watch.start(!0, !0), this.startCoroutine(this.beforePhysics(), De.LateUpdate), R() && (globalThis.NEEDLE_USE_RAPIER === !1 ? console.warn("RAPIER physics are disabled in your build. Enable them by setting NEEDLE_USE_RAPIER to true in your build config: Rigidbody could not be created.") : L.RAPIER_PHYSICS.ready().then(async () => {
|
|
19201
19212
|
await a_(3), this.activeAndEnabled && !this.context.physics.engine?.getBody(this) && console.warn(`Rigidbody could not be created. Ensure "${this.name}" has a Collider component.`);
|
|
19202
19213
|
}));
|
|
19203
19214
|
}
|
|
@@ -19208,7 +19219,7 @@ const Pi = class Ua extends A {
|
|
|
19208
19219
|
this.context.physics.engine?.removeBody(this);
|
|
19209
19220
|
}
|
|
19210
19221
|
onValidate(e) {
|
|
19211
|
-
this._propertiesChanged = !0, e === "autoMass" && !this.autoMass && R() && !
|
|
19222
|
+
this._propertiesChanged = !0, e === "autoMass" && !this.autoMass && R() && !za._didWarnAutoMass && (za._didWarnAutoMass = !0, console.warn("[Rigidbody] autoMass disabled — consider using Collider.density instead of setting mass explicitly. Density scales naturally with collider size."));
|
|
19212
19223
|
}
|
|
19213
19224
|
static _didWarnAutoMass = !1;
|
|
19214
19225
|
// need to do this right before updating physics to prevent rendered object glitching through physical bodies
|
|
@@ -19312,9 +19323,9 @@ const Pi = class Ua extends A {
|
|
|
19312
19323
|
}
|
|
19313
19324
|
captureVelocity() {
|
|
19314
19325
|
const e = this.gameObject.matrixWorld;
|
|
19315
|
-
|
|
19316
|
-
const t =
|
|
19317
|
-
this._lastPosition.copy(
|
|
19326
|
+
za.tempPosition.setFromMatrixPosition(e);
|
|
19327
|
+
const t = za.tempPosition.sub(this._lastPosition);
|
|
19328
|
+
this._lastPosition.copy(za.tempPosition), this._smoothedVelocity.lerp(t, this.context.time.deltaTime / 0.1);
|
|
19318
19329
|
}
|
|
19319
19330
|
};
|
|
19320
19331
|
Gi([
|
|
@@ -19454,7 +19465,7 @@ class vs extends A {
|
|
|
19454
19465
|
receivedDataCallback = null;
|
|
19455
19466
|
/** @internal */
|
|
19456
19467
|
awake() {
|
|
19457
|
-
Po && console.log("[SyncedTransform] new instance", this.guid, this), this._receivedDataBefore = !1, this._targetPosition = new w(), this._targetRotation = new
|
|
19468
|
+
Po && console.log("[SyncedTransform] new instance", this.guid, this), this._receivedDataBefore = !1, this._targetPosition = new w(), this._targetRotation = new U(), this._targetScale = new w(), this.lastPosition = new w(), this.lastRotation = new U(), this.lastScale = new w(), this.rb = k.getComponentInChildren(this.gameObject, ht), this.rb && (this._wasKinematic = this.rb.isKinematic), this.receivedUpdate = !0, this._model = new vE(this.context.connection, this.guid), this.context.connection.isConnected && this.tryGetLastState(), this.joinedRoomCallback = this.tryGetLastState.bind(this), this.context.connection.beginListen(re.JoinedRoom, this.joinedRoomCallback), this.receivedDataCallback = this.onReceivedData.bind(this), this.context.connection.beginListenBinary(Oh, this.receivedDataCallback);
|
|
19458
19469
|
}
|
|
19459
19470
|
/** @internal */
|
|
19460
19471
|
onDestroy() {
|
|
@@ -19483,7 +19494,7 @@ class vs extends A {
|
|
|
19483
19494
|
const o = t.rotation();
|
|
19484
19495
|
o && (this.tempEuler.set(o.x(), o.y(), o.z()), this.interpolateRotation && this._targetRotation.setFromEuler(this.tempEuler), (!this.interpolateRotation || !this._receivedDataBefore) && Fx(this.gameObject, this.tempEuler));
|
|
19485
19496
|
const r = t.scale();
|
|
19486
|
-
r && (i === 0 ? this.gameObject.scale.set(r.x(), r.y(), r.z()) : (this.interpolateScale && this._targetScale.set(r.x(), r.y(), r.z()), (!this.interpolateScale || !this._receivedDataBefore) && (this.gameObject.worldScale =
|
|
19497
|
+
r && (i === 0 ? this.gameObject.scale.set(r.x(), r.y(), r.z()) : (this.interpolateScale && this._targetScale.set(r.x(), r.y(), r.z()), (!this.interpolateScale || !this._receivedDataBefore) && (this.gameObject.worldScale = z(r.x(), r.y(), r.z()))));
|
|
19487
19498
|
}
|
|
19488
19499
|
this._receivedDataBefore = !0;
|
|
19489
19500
|
}
|
|
@@ -19699,7 +19710,7 @@ class jn extends Th {
|
|
|
19699
19710
|
if (!this.targets) return null;
|
|
19700
19711
|
e ??= new El(), e.targets = this.targets, e.results = this.raycastHits, e.useAcceleratedRaycast = !0;
|
|
19701
19712
|
const t = e.testObject;
|
|
19702
|
-
this.ignoreSkinnedMeshes && (e.testObject = (n) => n instanceof
|
|
19713
|
+
this.ignoreSkinnedMeshes && (e.testObject = (n) => n instanceof zo ? "continue in children" : t ? t(n) : !0);
|
|
19703
19714
|
const i = this.context.physics.raycast(e);
|
|
19704
19715
|
return e.testObject = t, i;
|
|
19705
19716
|
}
|
|
@@ -20194,7 +20205,7 @@ var GI = Object.defineProperty, HI = Object.getOwnPropertyDescriptor, Re = (s, e
|
|
|
20194
20205
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
20195
20206
|
return i && n && GI(e, t, n), n;
|
|
20196
20207
|
};
|
|
20197
|
-
const Bt = x("debugorbit"), Tm = x("freecam"), qI = x("debugcamerafit"),
|
|
20208
|
+
const Bt = x("debugorbit"), Tm = x("freecam"), qI = x("debugcamerafit"), Ud = x("smoothcam"), XI = { LEFT: "", UP: "", RIGHT: "", BOTTOM: "" };
|
|
20198
20209
|
let Rm;
|
|
20199
20210
|
class xf extends CustomEvent {
|
|
20200
20211
|
constructor(e, t) {
|
|
@@ -20405,7 +20416,7 @@ class ye extends A {
|
|
|
20405
20416
|
this._controls.stopListenToKeyEvents();
|
|
20406
20417
|
} catch {
|
|
20407
20418
|
}
|
|
20408
|
-
this._syncedTransform = k.getComponent(this.gameObject, vs) ?? void 0, this.context.pre_render_callbacks.push(this.__onPreRender), this._activePointerEvents = [], this.context.input.addEventListener("pointerdown", this._onPointerDown, { queue:
|
|
20419
|
+
this._syncedTransform = k.getComponent(this.gameObject, vs) ?? void 0, this.context.pre_render_callbacks.push(this.__onPreRender), this._activePointerEvents = [], this.context.input.addEventListener("pointerdown", this._onPointerDown, { queue: Ur.Early }), this.context.input.addEventListener("pointerdown", this._onPointerDownLate, { queue: Ur.Late }), this.context.input.addEventListener("pointerup", this._onPointerUp, { queue: Ur.Early }), this.context.input.addEventListener("pointerup", this._onPointerUpLate, { queue: Ur.Late });
|
|
20409
20420
|
}
|
|
20410
20421
|
/** @internal */
|
|
20411
20422
|
onDisable() {
|
|
@@ -20523,11 +20534,11 @@ class ye extends A {
|
|
|
20523
20534
|
}
|
|
20524
20535
|
}
|
|
20525
20536
|
if (this.targetBounds) {
|
|
20526
|
-
const i = this.targetBounds.worldPosition, n =
|
|
20537
|
+
const i = this.targetBounds.worldPosition, n = z(this.targetBounds.worldScale).multiplyScalar(0.5), o = z(i).sub(n), r = z(i).add(n);
|
|
20527
20538
|
if (this._lookTargetLerpActive)
|
|
20528
20539
|
this._lookTargetEndPosition.clamp(o, r);
|
|
20529
20540
|
else {
|
|
20530
|
-
const a = this._controls.target, l =
|
|
20541
|
+
const a = this._controls.target, l = z(a).clamp(o, r).sub(a);
|
|
20531
20542
|
l.multiplyScalar(Math.min(1, this.context.time.deltaTime / 0.1)), a.add(l), this._cameraObject?.position.add(l);
|
|
20532
20543
|
}
|
|
20533
20544
|
Bt && j.DrawWireBox(i, n.multiplyScalar(2), 16755200);
|
|
@@ -20535,9 +20546,9 @@ class ye extends A {
|
|
|
20535
20546
|
if (this._controls) {
|
|
20536
20547
|
this.debugLog && (this._controls.domElement = this.context.renderer.domElement);
|
|
20537
20548
|
const i = 1 / (this.context.focusRectSettings?.zoom || 1);
|
|
20538
|
-
if (this._controls.enabled = !this._shouldDisable && this._camera === this.context.mainCameraComponent && !this.context.isInXR && !this._activePointerEvents.some((n) => n.used), this._controls.keys = this.enableKeys ? Rm : XI, this._controls.autoRotate = this.autoRotate, this._controls.autoRotateSpeed = this.autoRotateSpeed, this._controls.enableZoom = this.enableZoom, this._controls.zoomSpeed = this.zoomSpeed, this._controls.zoomToCursor = this.zoomToCursor, this._controls.enableDamping = this.enableDamping, this._controls.dampingFactor = this.dampingFactor, this._controls.enablePan = this.enablePan, this._controls.panSpeed = i, this._controls.enableRotate = this.enableRotate, this._controls.minAzimuthAngle = this.minAzimuthAngle ?? 1 / 0, this._controls.maxAzimuthAngle = this.maxAzimuthAngle ?? 1 / 0, this._controls.minPolarAngle = this.minPolarAngle ?? 0, this._controls.maxPolarAngle = this.maxPolarAngle ?? Math.PI, Tm || (this._camera?.threeCamera?.type === "PerspectiveCamera" ? (this._controls.minDistance = this.minZoom ?? 0, this._controls.maxDistance = this.maxZoom ?? 1 / 0, this._controls.minZoom = 0, this._controls.maxZoom = 1 / 0) : (this._controls.minDistance = 0, this._controls.maxDistance = 1 / 0, this._controls.minZoom = this.minZoom ?? 0, this._controls.maxZoom = this.maxZoom ?? 1 / 0)), typeof
|
|
20549
|
+
if (this._controls.enabled = !this._shouldDisable && this._camera === this.context.mainCameraComponent && !this.context.isInXR && !this._activePointerEvents.some((n) => n.used), this._controls.keys = this.enableKeys ? Rm : XI, this._controls.autoRotate = this.autoRotate, this._controls.autoRotateSpeed = this.autoRotateSpeed, this._controls.enableZoom = this.enableZoom, this._controls.zoomSpeed = this.zoomSpeed, this._controls.zoomToCursor = this.zoomToCursor, this._controls.enableDamping = this.enableDamping, this._controls.dampingFactor = this.dampingFactor, this._controls.enablePan = this.enablePan, this._controls.panSpeed = i, this._controls.enableRotate = this.enableRotate, this._controls.minAzimuthAngle = this.minAzimuthAngle ?? 1 / 0, this._controls.maxAzimuthAngle = this.maxAzimuthAngle ?? 1 / 0, this._controls.minPolarAngle = this.minPolarAngle ?? 0, this._controls.maxPolarAngle = this.maxPolarAngle ?? Math.PI, Tm || (this._camera?.threeCamera?.type === "PerspectiveCamera" ? (this._controls.minDistance = this.minZoom ?? 0, this._controls.maxDistance = this.maxZoom ?? 1 / 0, this._controls.minZoom = 0, this._controls.maxZoom = 1 / 0) : (this._controls.minDistance = 0, this._controls.maxDistance = 1 / 0, this._controls.minZoom = this.minZoom ?? 0, this._controls.maxZoom = this.maxZoom ?? 1 / 0)), typeof Ud == "number" || Ud === !0) {
|
|
20539
20550
|
this._controls.enableDamping = !0;
|
|
20540
|
-
const n = typeof
|
|
20551
|
+
const n = typeof Ud == "number" ? Ud : 0.99;
|
|
20541
20552
|
this._controls.dampingFactor = Math.max(1e-3, 1 - Math.min(1, n));
|
|
20542
20553
|
}
|
|
20543
20554
|
if (this.allowInterrupt || (this._lookTargetLerpActive && (this._controls.enablePan = !1), this._cameraLerpActive && (this._controls.enableRotate = !1, this._controls.autoRotate = !1), (this._lookTargetLerpActive || this._cameraLerpActive) && (this._controls.enableZoom = !1)), !this.context.isInXR && (!Tm && this.lookAtTarget && !this._lookTargetLerpActive && (this.lockLookAtTarget ? this.setLookTargetFromConstraint(this.lookAtConstraint01) : this._didApplyLookAtTarget || (this._didApplyLookAtTarget = !0, this.setLookTargetFromConstraint(1))), this._controls.update(this.context.time.deltaTime), Bt)) {
|
|
@@ -20570,9 +20581,9 @@ class ye extends A {
|
|
|
20570
20581
|
return (R() || Bt) && console.warn("[OrbitControls] setCameraAndLookTarget target is not an Object3D or Camera"), !1;
|
|
20571
20582
|
e instanceof wi && (e = e.gameObject);
|
|
20572
20583
|
const i = e.worldPosition, n = e.worldForward;
|
|
20573
|
-
e instanceof
|
|
20584
|
+
e instanceof zP && (Bt && console.debug("[OrbitControls] setCameraAndLookTarget flip forward direction for camera"), n.multiplyScalar(-1));
|
|
20574
20585
|
const o = new ms(i, n);
|
|
20575
|
-
return Bt && j.DrawRay(o.origin, o.direction, 16711680, 10), this.setTargetFromRaycast(o, t) || this.setLookTargetPosition(o.at(2,
|
|
20586
|
+
return Bt && j.DrawRay(o.origin, o.direction, 16711680, 10), this.setTargetFromRaycast(o, t) || this.setLookTargetPosition(o.at(2, z()), t), this.setCameraTargetPosition(i, t), !0;
|
|
20576
20587
|
}
|
|
20577
20588
|
/** Moves the camera to position smoothly.
|
|
20578
20589
|
* @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.
|
|
@@ -21815,7 +21826,7 @@ class sL {
|
|
|
21815
21826
|
if (!(r.times.length <= 0)) {
|
|
21816
21827
|
if (r.name.endsWith(n))
|
|
21817
21828
|
this.rootStartPosition = new w().fromArray(r.values, 0), this.rootEndPosition = new w().fromArray(r.values, r.values.length - 3), this.rootPositionOffset = this.rootEndPosition.clone().sub(this.rootStartPosition), Mn && console.log(this.rootPositionOffset);
|
|
21818
|
-
else if (r.name.endsWith(o) && (this.rootStartQuaternion = new
|
|
21829
|
+
else if (r.name.endsWith(o) && (this.rootStartQuaternion = new U().fromArray(r.values, 0), this.rootEndQuaternion = new U().fromArray(r.values, r.values.length - 4), this.rootQuaternionOffset = this.rootEndQuaternion.clone().multiply(this.rootStartQuaternion), Mn)) {
|
|
21819
21830
|
const a = new Be().setFromQuaternion(this.rootQuaternionOffset);
|
|
21820
21831
|
console.log("ROT", a);
|
|
21821
21832
|
}
|
|
@@ -21896,7 +21907,7 @@ class Cf extends Al {
|
|
|
21896
21907
|
this.target && (this._animator = k.getComponent(this.target, Gt) ?? null, this._animator && Si.setObjectAnimated(this._animator.gameObject, this, !0));
|
|
21897
21908
|
for (const e of this.models) {
|
|
21898
21909
|
const t = e.asset, i = t.position, n = t.rotation;
|
|
21899
|
-
i && i.x !== void 0 && (i.isVector3 || (t.position = new w(i.x, i.y, i.z)), n.isQuaternion || (t.rotation = new
|
|
21910
|
+
i && i.x !== void 0 && (i.isVector3 || (t.position = new w(i.x, i.y, i.z)), n.isQuaternion || (t.rotation = new U(n.x, n.y, n.z, n.w)));
|
|
21900
21911
|
}
|
|
21901
21912
|
this.ensureTrackOffsets();
|
|
21902
21913
|
}
|
|
@@ -21906,19 +21917,19 @@ class Cf extends Al {
|
|
|
21906
21917
|
const e = this.trackOffset.position;
|
|
21907
21918
|
e && (e.isVector3 || (this.trackOffset.position = new w(e.x, e.y, e.z)));
|
|
21908
21919
|
const t = this.trackOffset.rotation;
|
|
21909
|
-
t && (t.isQuaternion || (this.trackOffset.rotation = new
|
|
21920
|
+
t && (t.isQuaternion || (this.trackOffset.rotation = new U(t.x, t.y, t.z, t.w)));
|
|
21910
21921
|
}
|
|
21911
21922
|
}
|
|
21912
21923
|
_useclipOffsets = !0;
|
|
21913
21924
|
_totalOffsetPosition = new w();
|
|
21914
|
-
_totalOffsetRotation = new
|
|
21925
|
+
_totalOffsetRotation = new U();
|
|
21915
21926
|
_totalOffsetPosition2 = new w();
|
|
21916
|
-
_totalOffsetRotation2 = new
|
|
21927
|
+
_totalOffsetRotation2 = new U();
|
|
21917
21928
|
_summedPos = new w();
|
|
21918
21929
|
_tempPos = new w();
|
|
21919
|
-
_summedRot = new
|
|
21920
|
-
_tempRot = new
|
|
21921
|
-
_clipRotQuat = new
|
|
21930
|
+
_summedRot = new U();
|
|
21931
|
+
_tempRot = new U();
|
|
21932
|
+
_clipRotQuat = new U();
|
|
21922
21933
|
evaluate(e) {
|
|
21923
21934
|
if (this.track.muted || !this.mixer) return;
|
|
21924
21935
|
this.bind(), this._totalOffsetPosition.set(0, 0, 0), this._totalOffsetRotation.set(0, 0, 0, 1), this._totalOffsetPosition2.set(0, 0, 0), this._totalOffsetRotation2.set(0, 0, 0, 1);
|
|
@@ -21984,7 +21995,7 @@ class Cf extends Al {
|
|
|
21984
21995
|
this.mixer.update(e);
|
|
21985
21996
|
}
|
|
21986
21997
|
createRotationInterpolant(e, t, i) {
|
|
21987
|
-
const n = i.createInterpolant.bind(i), o = new
|
|
21998
|
+
const n = i.createInterpolant.bind(i), o = new U();
|
|
21988
21999
|
this.ensureTrackOffsets();
|
|
21989
22000
|
const r = this.trackOffset?.rotation;
|
|
21990
22001
|
i.createInterpolant = () => {
|
|
@@ -22917,12 +22928,12 @@ const hL = {
|
|
|
22917
22928
|
}
|
|
22918
22929
|
]
|
|
22919
22930
|
};
|
|
22920
|
-
class X_ extends
|
|
22931
|
+
class X_ extends zi {
|
|
22921
22932
|
constructor(e) {
|
|
22922
22933
|
super(), this.position.y = -3.5;
|
|
22923
22934
|
const t = new gl();
|
|
22924
22935
|
t.deleteAttribute("uv");
|
|
22925
|
-
const i = new Tt({ metalness: 0, side:
|
|
22936
|
+
const i = new Tt({ metalness: 0, side: Uf }), n = new Tt({ metalness: 0 }), o = e == "legacy" ? hL : dL, r = new Qy(16777215, o.topLight.intensity, 28, 2);
|
|
22926
22937
|
r.position.set(...o.topLight.position), this.add(r);
|
|
22927
22938
|
const a = new V(t, i);
|
|
22928
22939
|
a.position.set(...o.room.position), a.scale.set(...o.room.scale), this.add(a);
|
|
@@ -22964,7 +22975,7 @@ function uL() {
|
|
|
22964
22975
|
}
|
|
22965
22976
|
}
|
|
22966
22977
|
const o = cl(t, i, !0);
|
|
22967
|
-
return t.position.x = 0, t.position.y = 1, t.position.z = 2, s.context.domElement?.cameraControls != !1 &&
|
|
22978
|
+
return t.position.x = 0, t.position.y = 1, t.position.z = 2, s.context.domElement?.cameraControls != !1 && U0(s.context, o), o;
|
|
22968
22979
|
}), ce.registerCallback(de.ContextCreated, (s) => {
|
|
22969
22980
|
if (!s.context.mainCamera) {
|
|
22970
22981
|
oh && console.log("Will not auto-fit because a default camera exists");
|
|
@@ -22975,11 +22986,11 @@ function uL() {
|
|
|
22975
22986
|
oh && console.log("Will not auto-fit because a camera controller exists");
|
|
22976
22987
|
return;
|
|
22977
22988
|
}
|
|
22978
|
-
|
|
22989
|
+
U0(s.context);
|
|
22979
22990
|
}
|
|
22980
22991
|
}));
|
|
22981
22992
|
}
|
|
22982
|
-
function
|
|
22993
|
+
function U0(s, e) {
|
|
22983
22994
|
e = e ?? s.mainCameraComponent;
|
|
22984
22995
|
const t = e?.gameObject;
|
|
22985
22996
|
if (oh && console.log("Creating default camera controls", e?.name), t) {
|
|
@@ -23385,7 +23396,7 @@ class ut extends A {
|
|
|
23385
23396
|
const l = this.context.mainCameraComponent?.gameObject || this.context.mainCamera;
|
|
23386
23397
|
l?.removeFromParent();
|
|
23387
23398
|
const c = this.gameObject.removeFromParent();
|
|
23388
|
-
$i(this.context.scene, !0, !0), this.context.scene = new
|
|
23399
|
+
$i(this.context.scene, !0, !0), this.context.scene = new zi(), this.context.scene.add(c), l && this.context.scene.add(l);
|
|
23389
23400
|
}
|
|
23390
23401
|
if (e.asset.parent ? this._currentSceneAsset = Zo(e.asset, { parent: this.gameObject }) : (this._currentSceneAsset = e.asset, k.add(e.asset, this.gameObject)), this.useSceneLighting && this.context.sceneLighting.enable(e), this.useSceneBackground) {
|
|
23391
23402
|
const l = this.context.lightmaps.tryGetSkybox(e.url);
|
|
@@ -23393,7 +23404,7 @@ class ut extends A {
|
|
|
23393
23404
|
}
|
|
23394
23405
|
if (this.useHistory && t >= 0) {
|
|
23395
23406
|
let l = t.toString();
|
|
23396
|
-
if (this.useSceneName && (e instanceof E ? l = e.name : e instanceof se && e.asset?.name ? l = e.asset.name : e.url && (l =
|
|
23407
|
+
if (this.useSceneName && (e instanceof E ? l = e.name : e instanceof se && e.asset?.name ? l = e.asset.name : e.url && (l = z0(e.url))), this.queryParameterName?.length)
|
|
23397
23408
|
Hu(this.queryParameterName, l, this.useHistory);
|
|
23398
23409
|
else {
|
|
23399
23410
|
const c = history.state, h = this.guid + "::" + t;
|
|
@@ -23441,7 +23452,7 @@ class ut extends A {
|
|
|
23441
23452
|
const r = [];
|
|
23442
23453
|
if (o instanceof E) r.push(o.name);
|
|
23443
23454
|
else {
|
|
23444
|
-
o.url && r.push(
|
|
23455
|
+
o.url && r.push(z0(o.url));
|
|
23445
23456
|
const a = o.asset;
|
|
23446
23457
|
a instanceof E && a.name && r.push(a.name);
|
|
23447
23458
|
}
|
|
@@ -23565,7 +23576,7 @@ Mt([
|
|
|
23565
23576
|
Mt([
|
|
23566
23577
|
f(ne)
|
|
23567
23578
|
], ut.prototype, "sceneLoaded");
|
|
23568
|
-
function
|
|
23579
|
+
function z0(s) {
|
|
23569
23580
|
const t = s.split("/").pop()?.split(".").shift();
|
|
23570
23581
|
return t?.length ? t : s;
|
|
23571
23582
|
}
|
|
@@ -23794,14 +23805,14 @@ const aC = function(s = null) {
|
|
|
23794
23805
|
OL(this), c.call(this);
|
|
23795
23806
|
};
|
|
23796
23807
|
};
|
|
23797
|
-
},
|
|
23808
|
+
}, zd = /* @__PURE__ */ new Map();
|
|
23798
23809
|
function rp(s, e, t) {
|
|
23799
23810
|
const i = t?.format === void 0 ? s : `${s}|format=${t.format}`;
|
|
23800
|
-
if (
|
|
23801
|
-
return
|
|
23811
|
+
if (zd.has(i))
|
|
23812
|
+
return zd.get(i);
|
|
23802
23813
|
const n = new URL(s, window.location.href), o = TL(n, e, t);
|
|
23803
|
-
return
|
|
23804
|
-
|
|
23814
|
+
return zd.set(i, o), o.finally(() => {
|
|
23815
|
+
zd.delete(i);
|
|
23805
23816
|
}), o;
|
|
23806
23817
|
}
|
|
23807
23818
|
async function TL(s, e, t) {
|
|
@@ -24642,7 +24653,7 @@ class sr extends A {
|
|
|
24642
24653
|
animator;
|
|
24643
24654
|
lookForward = !0;
|
|
24644
24655
|
awake() {
|
|
24645
|
-
this._currentRotation = new
|
|
24656
|
+
this._currentRotation = new U();
|
|
24646
24657
|
}
|
|
24647
24658
|
update() {
|
|
24648
24659
|
const e = this.context.input;
|
|
@@ -24717,7 +24728,7 @@ function ds(s, e) {
|
|
|
24717
24728
|
s.layers[fC] = e;
|
|
24718
24729
|
}
|
|
24719
24730
|
const q0 = /* @__PURE__ */ Symbol("DidPatchLayers");
|
|
24720
|
-
function
|
|
24731
|
+
function UL() {
|
|
24721
24732
|
const s = Xo.prototype;
|
|
24722
24733
|
if (s[q0]) return;
|
|
24723
24734
|
s[q0] = !0;
|
|
@@ -24726,10 +24737,10 @@ function zL() {
|
|
|
24726
24737
|
return this[fC] === !1 ? !1 : e.call(this, t);
|
|
24727
24738
|
};
|
|
24728
24739
|
}
|
|
24729
|
-
var
|
|
24740
|
+
var zL = Object.defineProperty, Ll = (s, e, t, i) => {
|
|
24730
24741
|
for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
|
|
24731
24742
|
(r = s[o]) && (n = r(e, t, n) || n);
|
|
24732
|
-
return n &&
|
|
24743
|
+
return n && zL(e, t, n), n;
|
|
24733
24744
|
};
|
|
24734
24745
|
const Ra = x("debugcontactshadows");
|
|
24735
24746
|
y_((s) => {
|
|
@@ -24846,7 +24857,7 @@ const pa = class Bc extends A {
|
|
|
24846
24857
|
if (this.shadowsRoot.parent !== this.gameObject && this.gameObject.add(this.shadowsRoot), this.depthMaterial && this.horizontalBlurMaterial && this.verticalBlurMaterial && this.planeMaterial)
|
|
24847
24858
|
return;
|
|
24848
24859
|
Ra && console.log("Create ContactShadows on " + this.gameObject.name, this), this.shadowsRoot.name = "ContactShadows Root", this.shadowGroup.name = "ContactShadows Group", this.gameObject.add(this.shadowsRoot), this.shadowsRoot.add(this.shadowGroup), this.renderTarget = new gs(this.textureSize, this.textureSize), this.renderTarget.texture.generateMipmaps = !1, this.renderTargetBlur = new gs(this.textureSize, this.textureSize), this.renderTargetBlur.texture.generateMipmaps = !1;
|
|
24849
|
-
const e = new
|
|
24860
|
+
const e = new zn(1, 1).rotateX(Math.PI / 2);
|
|
24850
24861
|
this.gameObject instanceof V && (console.warn("ContactShadows can not be added to a Mesh. Please add it to a Group or an empty Object"), ds(this.gameObject, !1));
|
|
24851
24862
|
const t = this.planeMaterial = new Le({
|
|
24852
24863
|
map: this.renderTarget.texture,
|
|
@@ -24861,7 +24872,7 @@ const pa = class Bc extends A {
|
|
|
24861
24872
|
depthWrite: !0,
|
|
24862
24873
|
stencilWrite: !0,
|
|
24863
24874
|
colorWrite: !1,
|
|
24864
|
-
side:
|
|
24875
|
+
side: Uf
|
|
24865
24876
|
});
|
|
24866
24877
|
i.name = "ContactShadows Occluder", this.occluderMesh = new V(this.plane.geometry, i).translateY(-1e-4), this.occluderMesh.renderOrder = -100, this.occluderMesh.layers.set(2), this.shadowsRoot.add(this.occluderMesh), this.blurPlane = new V(e), this.blurPlane.visible = !1, this.shadowGroup.add(this.blurPlane);
|
|
24867
24878
|
const n = 0, o = 1;
|
|
@@ -25061,7 +25072,7 @@ class hp {
|
|
|
25061
25072
|
}
|
|
25062
25073
|
}
|
|
25063
25074
|
class tb {
|
|
25064
|
-
_savedQuat = new
|
|
25075
|
+
_savedQuat = new U();
|
|
25065
25076
|
init(e) {
|
|
25066
25077
|
this._savedQuat.copy(e.gameObject.worldQuaternion);
|
|
25067
25078
|
}
|
|
@@ -25137,9 +25148,9 @@ class GL {
|
|
|
25137
25148
|
this._eulerCache.setFromQuaternion(i, "XYZ"), t & 1 && (this._eulerCache.x = this._startEuler.x), t & 2 && (this._eulerCache.y = this._startEuler.y), t & 4 && (this._eulerCache.z = this._startEuler.z), Am.setFromEuler(this._eulerCache), this.useLocalSpace ? e.quaternion.copy(Am) : e.worldQuaternion = Am, e.updateMatrix();
|
|
25138
25149
|
}
|
|
25139
25150
|
}
|
|
25140
|
-
const Am = new
|
|
25151
|
+
const Am = new U();
|
|
25141
25152
|
class _C {
|
|
25142
|
-
_startQuat = new
|
|
25153
|
+
_startQuat = new U();
|
|
25143
25154
|
_axis;
|
|
25144
25155
|
constructor(e) {
|
|
25145
25156
|
this._axis = e.clone().normalize();
|
|
@@ -25160,7 +25171,7 @@ class _C {
|
|
|
25160
25171
|
e.updateMatrix();
|
|
25161
25172
|
}
|
|
25162
25173
|
}
|
|
25163
|
-
const Gd = new
|
|
25174
|
+
const Gd = new U(), Pr = new U();
|
|
25164
25175
|
class bC {
|
|
25165
25176
|
constructor(e) {
|
|
25166
25177
|
this.plane = e;
|
|
@@ -25544,7 +25555,7 @@ $n([
|
|
|
25544
25555
|
f(ne)
|
|
25545
25556
|
], bn.prototype, "dragEnded");
|
|
25546
25557
|
let Ja = bn;
|
|
25547
|
-
const Hd = new
|
|
25558
|
+
const Hd = new U(), K0 = new w(), Z0 = new w(), J0 = new w(), qd = new w(), Xd = new w();
|
|
25548
25559
|
class qL {
|
|
25549
25560
|
handlerA;
|
|
25550
25561
|
handlerB;
|
|
@@ -25556,7 +25567,7 @@ class qL {
|
|
|
25556
25567
|
_followObject;
|
|
25557
25568
|
_manipulatorObject;
|
|
25558
25569
|
_deviceMode;
|
|
25559
|
-
_followObjectStartWorldQuaternion = new
|
|
25570
|
+
_followObjectStartWorldQuaternion = new U();
|
|
25560
25571
|
_gridSnapConstraint = new eb(0);
|
|
25561
25572
|
_keepRotationConstraint = new tb();
|
|
25562
25573
|
/** GrabPointPlaneConstraint returned by the active strategy (if any); used to sync snapResolution. */
|
|
@@ -25608,7 +25619,7 @@ class qL {
|
|
|
25608
25619
|
this.handlerA.rebaseGrabPointToPointer(), this.handlerB.rebaseGrabPointToPointer(), this.handlerA.recenter(), this.handlerB.recenter(), this._manipulatorObject.removeFromParent(), this._followObject.removeFromParent(), this._manipulatorObject.destroy(), this._followObject.destroy();
|
|
25609
25620
|
}
|
|
25610
25621
|
_manipulatorPosOffset = new w();
|
|
25611
|
-
_manipulatorRotOffset = new
|
|
25622
|
+
_manipulatorRotOffset = new U();
|
|
25612
25623
|
/** Scale ratio between current two-hand distance and initial distance. Updated in alignManipulator(). */
|
|
25613
25624
|
_currentScaleRatio = 1;
|
|
25614
25625
|
/** World-scale of the dragged object captured at drag start. Used to apply scale directly. */
|
|
@@ -25701,7 +25712,7 @@ class qL {
|
|
|
25701
25712
|
l.lerp(n.worldPosition, a), i.worldPosition = l;
|
|
25702
25713
|
const c = i.worldQuaternion;
|
|
25703
25714
|
if (c.slerp(n.worldQuaternion, a), i.worldQuaternion = c, !r) {
|
|
25704
|
-
const h =
|
|
25715
|
+
const h = z(
|
|
25705
25716
|
this._initialWorldScale.x * this._currentScaleRatio,
|
|
25706
25717
|
this._initialWorldScale.y * this._currentScaleRatio,
|
|
25707
25718
|
this._initialWorldScale.z * this._currentScaleRatio
|
|
@@ -25743,12 +25754,12 @@ class XL {
|
|
|
25743
25754
|
const l = a[0];
|
|
25744
25755
|
if (this._draggedOverObject === l.object ? this._draggedOverObjectDuration += e.context.time.deltaTime : (this._draggedOverObject = l.object, this._draggedOverObjectDuration = 0), l.face) {
|
|
25745
25756
|
r = !0, this._hasLastSurfaceHitPoint = !0, this._lastSurfaceHitPoint.copy(l.point);
|
|
25746
|
-
const c =
|
|
25757
|
+
const c = z(l.normal || l.face.normal).applyQuaternion(l.object.worldQuaternion), h = this._draggedOverObjectDuration >= 0.15, d = e.totalMovement.length() >= 1e-3;
|
|
25747
25758
|
if (!(h || d))
|
|
25748
25759
|
return null;
|
|
25749
25760
|
if (this._draggedOverObjectLastSetUp !== this._draggedOverObject || this._draggedOverObjectLastNormal.dot(c) < 0.999999 || e.context.time.time - this._lastSurfacePlaneRefreshTime >= 1) {
|
|
25750
25761
|
this._lastSurfacePlaneRefreshTime = e.context.time.time, this._draggedOverObjectLastSetUp = this._draggedOverObject, this._draggedOverObjectLastNormal.copy(c);
|
|
25751
|
-
const m =
|
|
25762
|
+
const m = z(), b = z();
|
|
25752
25763
|
e.bounds.getCenter(m), e.bounds.getSize(b), m.sub(b.multiplyScalar(0.5).multiply(c));
|
|
25753
25764
|
const y = m.dot(c);
|
|
25754
25765
|
e.hitPointInLocalSpace.copy(c).multiplyScalar(y), e.hitNormalInLocalSpace.copy(l.face.normal), e.dragPlane.setFromNormalAndCoplanarPoint(c, l.point);
|
|
@@ -25778,7 +25789,7 @@ class QL {
|
|
|
25778
25789
|
* getConstraints call). Updated by onTwoPointerScaleUpdate to keep bounds grounded. */
|
|
25779
25790
|
_heightLock = null;
|
|
25780
25791
|
initialize(e, t, i) {
|
|
25781
|
-
const n =
|
|
25792
|
+
const n = z(0, 1, 0);
|
|
25782
25793
|
e.gameObject?.parent && n.transformDirection(e.gameObject.parent.matrixWorld), e.dragPlane.setFromNormalAndCoplanarPoint(n, t), this.xzPlane.copy(e.dragPlane), this._inFallback = !1;
|
|
25783
25794
|
}
|
|
25784
25795
|
reset() {
|
|
@@ -25806,7 +25817,7 @@ class QL {
|
|
|
25806
25817
|
e.gameObject ? e.gameObject.worldPosition : t.origin,
|
|
25807
25818
|
this._fallbackAnchor
|
|
25808
25819
|
)) : this._inFallback && i > 0.2 && (this._inFallback = !1), this._inFallback) {
|
|
25809
|
-
const n =
|
|
25820
|
+
const n = z(t.direction.x, 0, t.direction.z);
|
|
25810
25821
|
n.lengthSq() > 1e-6 && n.normalize(), e.dragPlane.setFromNormalAndCoplanarPoint(n, this._fallbackAnchor);
|
|
25811
25822
|
} else
|
|
25812
25823
|
e.dragPlane.copy(this.xzPlane);
|
|
@@ -25910,8 +25921,8 @@ class Dm {
|
|
|
25910
25921
|
_grabStartDistance = 0;
|
|
25911
25922
|
_deviceMode;
|
|
25912
25923
|
_followObjectStartPosition = new w();
|
|
25913
|
-
_followObjectStartQuaternion = new
|
|
25914
|
-
_followObjectStartWorldQuaternion = new
|
|
25924
|
+
_followObjectStartQuaternion = new U();
|
|
25925
|
+
_followObjectStartWorldQuaternion = new U();
|
|
25915
25926
|
_lastDragPosRigSpace;
|
|
25916
25927
|
_tempVec = new w();
|
|
25917
25928
|
_tempMat = new Z();
|
|
@@ -26075,7 +26086,7 @@ class Dm {
|
|
|
26075
26086
|
if (this._followObject.position.copy(this._followObjectStartPosition), l || this._followObject.quaternion.copy(this._followObjectStartQuaternion), r && this._grabStartDistance > 0.5) {
|
|
26076
26087
|
const _ = this._hitPointInLocalSpace.clone();
|
|
26077
26088
|
_.applyQuaternion(this._followObject.quaternion);
|
|
26078
|
-
const v =
|
|
26089
|
+
const v = z(this._followObjectStartPosition).add(_).normalize(), C = Math.max(0.1, d * this._grabStartDistance);
|
|
26079
26090
|
this._followObject.position.copy(v.multiplyScalar(C)).sub(_);
|
|
26080
26091
|
} else
|
|
26081
26092
|
this._followObject.position.multiplyScalar(d);
|
|
@@ -26084,7 +26095,7 @@ class Dm {
|
|
|
26084
26095
|
if (this._snapContext.gameObject = this.gameObject, this._currentStrategy.update(this._snapContext, p, i, t) === null) return;
|
|
26085
26096
|
if (this._currentStrategy.requiresPlaneIntersection && p.intersectPlane(this._dragPlane, this._tempVec)) {
|
|
26086
26097
|
this._followObject.worldPosition = this._tempVec, this._followObject.updateMatrix(), this._followObject.updateMatrixWorld(!0);
|
|
26087
|
-
const _ =
|
|
26098
|
+
const _ = z(this._hitPointInLocalSpace);
|
|
26088
26099
|
this._followObject.localToWorld(_), fs && j.DrawLine(_, this._tempVec, 65535, 0, !1), this._followObject.worldPosition = this._tempVec.multiplyScalar(2).sub(_), this._followObject.updateMatrix();
|
|
26089
26100
|
}
|
|
26090
26101
|
this._gridSnapConstraint.snapGridResolution = this.settings.snapGridResolution, this._grabPointPlaneConstraint && (this._grabPointPlaneConstraint.snapResolution = this.settings.snapGridResolution), vC(this._followObject, this._activeConstraints);
|
|
@@ -26120,7 +26131,7 @@ class Dm {
|
|
|
26120
26131
|
setPlaneViewAligned(e, t) {
|
|
26121
26132
|
if (!this._followObject.parent)
|
|
26122
26133
|
return !1;
|
|
26123
|
-
const i = this._followObject.parent.worldForward, n =
|
|
26134
|
+
const i = this._followObject.parent.worldForward, n = z(0, 1, 0), o = i, r = n.angleTo(o), a = 0.5;
|
|
26124
26135
|
return t && (r > Math.PI / 2 + a || r < Math.PI / 2 - a) ? this._dragPlane.setFromNormalAndCoplanarPoint(n, e) : this._dragPlane.setFromNormalAndCoplanarPoint(i, e), !0;
|
|
26125
26136
|
}
|
|
26126
26137
|
}
|
|
@@ -26163,7 +26174,7 @@ var ah;
|
|
|
26163
26174
|
opacity: 0.4
|
|
26164
26175
|
}));
|
|
26165
26176
|
c.position.y = 0.5, l.scale.y = 0.01, l.add(c);
|
|
26166
|
-
const h = new V(new
|
|
26177
|
+
const h = new V(new zn(1, 1, 1, 1), new Le({
|
|
26167
26178
|
color: 34,
|
|
26168
26179
|
transparent: !0,
|
|
26169
26180
|
opacity: 0.05,
|
|
@@ -26183,10 +26194,10 @@ var ah;
|
|
|
26183
26194
|
}
|
|
26184
26195
|
s.removePreview = i;
|
|
26185
26196
|
})(ah || (ah = {}));
|
|
26186
|
-
const
|
|
26197
|
+
const Ue = x("debugfileformat");
|
|
26187
26198
|
function xC(s) {
|
|
26188
26199
|
const e = s.split(".").pop() || s;
|
|
26189
|
-
switch (
|
|
26200
|
+
switch (Ue && console.warn(`[Needle Engine] Try to use file extension to determine type: '${e}'`), e.toUpperCase()) {
|
|
26190
26201
|
case "GLTF":
|
|
26191
26202
|
return "model/gltf+json";
|
|
26192
26203
|
case "VRM":
|
|
@@ -26262,7 +26273,7 @@ async function iD(s, e) {
|
|
|
26262
26273
|
}).catch((o) => null);
|
|
26263
26274
|
if (n?.ok) {
|
|
26264
26275
|
const o = await n.arrayBuffer(), r = nD(i, o, n);
|
|
26265
|
-
return
|
|
26276
|
+
return Ue && console.log("[Needle Engine] Determined file type from header: " + r), r;
|
|
26266
26277
|
}
|
|
26267
26278
|
return "unknown";
|
|
26268
26279
|
}
|
|
@@ -26270,32 +26281,32 @@ function nD(s, e, t) {
|
|
|
26270
26281
|
if (e.byteLength < 4)
|
|
26271
26282
|
return "unknown";
|
|
26272
26283
|
const i = new Uint8Array(e);
|
|
26273
|
-
|
|
26284
|
+
Ue && Ue && console.warn(`[Needle Engine] Trying to determine file type from binary data
|
|
26274
26285
|
`, '"' + new TextDecoder().decode(e) + `"
|
|
26275
26286
|
`, i);
|
|
26276
26287
|
const n = new TextDecoder().decode(e).replace(/\s/g, "");
|
|
26277
26288
|
if (n[0] === "{" && n[1] === '"')
|
|
26278
|
-
return
|
|
26289
|
+
return Ue && console.debug("GLTF detected"), "model/gltf+json";
|
|
26279
26290
|
if (i[0] == 103 && i[1] == 108 && i[2] == 84 && i[3] == 70 && (i[4] == 10 || i[4] === 2))
|
|
26280
|
-
return
|
|
26291
|
+
return Ue && console.debug("GLTF .bin detected"), "model/gltf+json";
|
|
26281
26292
|
if (i[0] == 103 && i[1] == 108 && i[2] == 84 && i[3] == 70 && i[4] == 98)
|
|
26282
|
-
return
|
|
26293
|
+
return Ue && console.debug("GLB detected"), "model/gltf-binary";
|
|
26283
26294
|
if (i[0] == 80 && i[1] == 75 && i[2] == 3 && i[3] == 4)
|
|
26284
|
-
return
|
|
26295
|
+
return Ue && console.debug("USDZ detected"), "model/vnd.usdz+zip";
|
|
26285
26296
|
if (i[0] == 80 && i[1] == 88 && i[2] == 82 && i[3] == 45 && i[4] == 85 && i[5] == 83 && i[6] == 68 && i[7] == 67)
|
|
26286
|
-
return
|
|
26297
|
+
return Ue && console.debug("Binary USD detected"), "model/vnd.usd";
|
|
26287
26298
|
if (i[0] == 35 && i[1] == 117 && i[2] == 115 && i[3] == 100 && i[4] == 97)
|
|
26288
|
-
return
|
|
26299
|
+
return Ue && console.debug("ASCII USD detected"), "model/vnd.usda";
|
|
26289
26300
|
if (i[0] == 75 && i[1] == 97 && i[2] == 121 && i[3] == 100 && i[4] == 97 && i[5] == 114 && i[6] == 97 && i[7] == 32)
|
|
26290
|
-
return
|
|
26301
|
+
return Ue && console.debug("Binary FBX detected"), "model/fbx";
|
|
26291
26302
|
if (i[0] == 59 && i[1] == 32 && i[2] == 70 && i[3] == 66 && i[4] == 88 && i[5] == 32)
|
|
26292
|
-
return
|
|
26303
|
+
return Ue && console.debug("ASCII FBX detected"), "model/fbx";
|
|
26293
26304
|
if (i[0] == 35 && i[1] == 32 && i[2] == 66 && i[3] == 108 && i[4] == 101 && i[5] == 110 && i[6] == 100 && i[7] == 101 && i[8] == 114 && i[9] == 32)
|
|
26294
|
-
return
|
|
26305
|
+
return Ue && console.debug("OBJ detected"), "model/obj";
|
|
26295
26306
|
if (i[0] == 35 && i[1] == 32 && i[2] == 65 && i[3] == 108 && i[4] == 105 && i[5] == 97 && i[6] == 115 && i[7] == 32 && i[8] == 79 && i[9] == 66 && i[10] == 74)
|
|
26296
|
-
return
|
|
26307
|
+
return Ue && console.debug("OBJ detected"), "model/obj";
|
|
26297
26308
|
if (i[0] == 112 && i[1] == 108 && i[2] == 121 && (i[3] == 10 || i[3] == 13))
|
|
26298
|
-
return
|
|
26309
|
+
return Ue && console.debug("PLY detected"), "model/ply";
|
|
26299
26310
|
for (const o of ku) {
|
|
26300
26311
|
const r = o({
|
|
26301
26312
|
url: s,
|
|
@@ -26304,13 +26315,13 @@ function nD(s, e, t) {
|
|
|
26304
26315
|
bytes: i
|
|
26305
26316
|
});
|
|
26306
26317
|
if (r)
|
|
26307
|
-
return
|
|
26318
|
+
return Ue && console.debug(`Mimetype callback returned: ${r}`), r;
|
|
26308
26319
|
}
|
|
26309
26320
|
if (t.headers.has("content-type")) {
|
|
26310
26321
|
const o = t.headers.get("content-type");
|
|
26311
26322
|
if (o?.startsWith("image/"))
|
|
26312
|
-
return
|
|
26313
|
-
switch (
|
|
26323
|
+
return Ue && console.debug("Image detected, not a model file"), "unsupported";
|
|
26324
|
+
switch (Ue && console.debug("Content-Type: " + o), o) {
|
|
26314
26325
|
case "model/gltf+json":
|
|
26315
26326
|
case "model/gltf-binary":
|
|
26316
26327
|
case "model/vrm":
|
|
@@ -26328,14 +26339,14 @@ function nD(s, e, t) {
|
|
|
26328
26339
|
}
|
|
26329
26340
|
}
|
|
26330
26341
|
if (i[0] == 118 && i[1] == 32 || i[0] == 102 && i[1] == 32)
|
|
26331
|
-
return
|
|
26342
|
+
return Ue && console.debug("OBJ detected (the file has no header and starts with vertex or face)"), "obj";
|
|
26332
26343
|
if (i[0] == 35 && i[1] == 32 && i[2] == 70 && i[3] == 105 && i[4] == 108 && i[5] == 101 && i[6] == 32 && i[7] == 101 && i[8] == 120 && i[9] == 112 && i[10] == 111 && i[11] == 114 && i[12] == 116 && i[13] == 101 && i[14] == 100 && i[15] == 32 && i[16] == 98 && i[17] == 121 && i[18] == 32 && i[19] == 90 && i[20] == 66 && i[21] == 114 && i[22] == 117 && i[23] == 115 && i[24] == 104)
|
|
26333
|
-
return
|
|
26344
|
+
return Ue && console.debug("OBJ detected (exported by ZBrush)"), "obj";
|
|
26334
26345
|
if (i[0] == 109 && i[1] == 116 && i[2] == 108 && i[3] == 108 && i[4] == 105 && i[5] == 98)
|
|
26335
|
-
return
|
|
26336
|
-
if (R() ||
|
|
26346
|
+
return Ue && console.debug("OBJ detected (mtllib)"), "obj";
|
|
26347
|
+
if (R() || Ue) {
|
|
26337
26348
|
const o = new TextDecoder().decode(e.slice(0, Math.min(e.byteLength, 32)));
|
|
26338
|
-
|
|
26349
|
+
Ue && console.warn(`Could not determine file type.
|
|
26339
26350
|
|
|
26340
26351
|
Consider registering a custom loader via the 'onCreateCustomModelLoader' callback: 'NeedleEngineModelLoader.onCreateCustomModelLoader(args => { })'
|
|
26341
26352
|
|
|
@@ -26343,7 +26354,7 @@ Content-Type: "${t.headers.get("content-type")}"
|
|
|
26343
26354
|
"Text: "${o}"
|
|
26344
26355
|
Binary:`, i);
|
|
26345
26356
|
} else
|
|
26346
|
-
|
|
26357
|
+
Ue && console.debug("Could not determine file type from binary data");
|
|
26347
26358
|
return "unknown";
|
|
26348
26359
|
}
|
|
26349
26360
|
const Fm = x("debugstencil");
|
|
@@ -26490,7 +26501,7 @@ class lD {
|
|
|
26490
26501
|
this.meshToOriginalCallbacks.set(e, t);
|
|
26491
26502
|
}
|
|
26492
26503
|
}
|
|
26493
|
-
const
|
|
26504
|
+
const Uo = new lD();
|
|
26494
26505
|
class qo {
|
|
26495
26506
|
_overrides = [];
|
|
26496
26507
|
_defines = {};
|
|
@@ -26521,8 +26532,8 @@ class qo {
|
|
|
26521
26532
|
* ```
|
|
26522
26533
|
*/
|
|
26523
26534
|
static get(e) {
|
|
26524
|
-
let t =
|
|
26525
|
-
return t || (t = new qo(e),
|
|
26535
|
+
let t = Uo.getBlock(e);
|
|
26536
|
+
return t || (t = new qo(e), Uo.setBlock(e, t), uD(e, t)), t;
|
|
26526
26537
|
}
|
|
26527
26538
|
/**
|
|
26528
26539
|
* Checks if an object has any property overrides
|
|
@@ -26530,7 +26541,7 @@ class qo {
|
|
|
26530
26541
|
* @returns True if the object has a property block with overrides
|
|
26531
26542
|
*/
|
|
26532
26543
|
static hasOverrides(e) {
|
|
26533
|
-
const t =
|
|
26544
|
+
const t = Uo.getBlock(e);
|
|
26534
26545
|
return t ? t.hasOverrides() : !1;
|
|
26535
26546
|
}
|
|
26536
26547
|
/**
|
|
@@ -26538,7 +26549,7 @@ class qo {
|
|
|
26538
26549
|
* After calling dispose, this property block should not be used.
|
|
26539
26550
|
*/
|
|
26540
26551
|
dispose() {
|
|
26541
|
-
this._object &&
|
|
26552
|
+
this._object && Uo.deleteBlock(this._object), this._overrides = [], this._object = null;
|
|
26542
26553
|
}
|
|
26543
26554
|
setOverride(e, t, i) {
|
|
26544
26555
|
const n = this._overrides.find((o) => o.name === e);
|
|
@@ -26715,9 +26726,9 @@ class qo {
|
|
|
26715
26726
|
}
|
|
26716
26727
|
const Iu = /* @__PURE__ */ Symbol("originalValues"), Lu = /* @__PURE__ */ Symbol("savedTextureTransforms");
|
|
26717
26728
|
function nb(s) {
|
|
26718
|
-
let e =
|
|
26729
|
+
let e = Uo.getBlock(s);
|
|
26719
26730
|
if (e) return { block: e, owner: s };
|
|
26720
|
-
if (s.parent && s.parent.type === "Group" && (e =
|
|
26731
|
+
if (s.parent && s.parent.type === "Group" && (e = Uo.getBlock(s.parent), e))
|
|
26721
26732
|
return { block: e, owner: s.parent };
|
|
26722
26733
|
}
|
|
26723
26734
|
const dl = /* @__PURE__ */ Symbol("beforeRenderingFlag"), _y = /* @__PURE__ */ new WeakMap(), by = /* @__PURE__ */ new WeakMap(), cD = function(s, e, t, i) {
|
|
@@ -26816,8 +26827,8 @@ function uD(s, e) {
|
|
|
26816
26827
|
}) : (s.type === "Mesh" || s.type === "SkinnedMesh") && sw(s, s, e);
|
|
26817
26828
|
}
|
|
26818
26829
|
function sw(s, e, t) {
|
|
26819
|
-
if (!
|
|
26820
|
-
if (
|
|
26830
|
+
if (!Uo.isHooked(s, e)) {
|
|
26831
|
+
if (Uo.addHook(s, e), s["needle:materialPropertyBlock"] = t, !s.onBeforeRender)
|
|
26821
26832
|
s.onBeforeRender = iw;
|
|
26822
26833
|
else {
|
|
26823
26834
|
const i = s.onBeforeRender;
|
|
@@ -27203,14 +27214,14 @@ class sb {
|
|
|
27203
27214
|
const rw = "NEEDLE_gameobject_data", vD = {
|
|
27204
27215
|
Default: 0,
|
|
27205
27216
|
"Ignore Raycast": 2
|
|
27206
|
-
}, Yd = /* @__PURE__ */ new Map(),
|
|
27217
|
+
}, Yd = /* @__PURE__ */ new Map(), Um = 8, Kd = 31;
|
|
27207
27218
|
function wD(s) {
|
|
27208
27219
|
if (typeof s == "number" && isFinite(s)) return s;
|
|
27209
27220
|
if (typeof s == "string" && s.length > 0) {
|
|
27210
27221
|
const e = vD[s];
|
|
27211
27222
|
if (e !== void 0) return e;
|
|
27212
27223
|
let t = Yd.get(s);
|
|
27213
|
-
return t === void 0 && (t = Math.min(
|
|
27224
|
+
return t === void 0 && (t = Math.min(Um + Yd.size, Kd), Um + Yd.size > Kd && console.warn(`[NEEDLE_gameobject_data] more than ${Kd - Um + 1} named layers — "${s}" shares index ${Kd}`), Yd.set(s, t)), t;
|
|
27214
27225
|
}
|
|
27215
27226
|
return 0;
|
|
27216
27227
|
}
|
|
@@ -27424,7 +27435,7 @@ class kD {
|
|
|
27424
27435
|
this.objectToWorldMatrix.copy(e.matrixWorld), lf(this.objectToWorldMatrix, this.objectToWorld), this.worldToObjectMatrix.copy(e.matrixWorld).invert(), lf(this.worldToObjectMatrix, this.worldToObject);
|
|
27425
27436
|
}
|
|
27426
27437
|
}
|
|
27427
|
-
class
|
|
27438
|
+
class ze extends fx {
|
|
27428
27439
|
identifier;
|
|
27429
27440
|
onBeforeRenderSceneCallback = this.onBeforeRenderScene.bind(this);
|
|
27430
27441
|
clone() {
|
|
@@ -27496,7 +27507,7 @@ class Ue extends fx {
|
|
|
27496
27507
|
}
|
|
27497
27508
|
onUpdateUniforms(e, t) {
|
|
27498
27509
|
const i = K.Current;
|
|
27499
|
-
if (e && (
|
|
27510
|
+
if (e && (ze.viewProjection && this.uniforms[this._viewProjectionName] && (ze.viewProjection.copy(e.projectionMatrix).multiply(e.matrixWorldInverse), lf(ze.viewProjection, ze._viewProjectionValues)), ze.viewMatrix && this.uniforms[this._viewMatrixName] && (ze.viewMatrix.copy(e.matrixWorldInverse), lf(ze.viewMatrix, ze._viewMatrixValues)), this.uniforms[ze._worldSpaceCameraPosName] && ze._worldSpaceCameraPos.setFromMatrixPosition(e.matrixWorld)), this.uniforms._TimeParameters && (this.uniforms._TimeParameters.value = i.sceneLighting.timeVec4), this.uniforms._Time) {
|
|
27500
27511
|
const a = this.uniforms._Time.value;
|
|
27501
27512
|
a.x = i.sceneLighting.timeVec4.x / 20, a.y = i.sceneLighting.timeVec4.x, a.z = i.sceneLighting.timeVec4.x * 2, a.w = i.sceneLighting.timeVec4.x * 3;
|
|
27502
27513
|
}
|
|
@@ -27514,12 +27525,12 @@ class Ue extends fx {
|
|
|
27514
27525
|
}
|
|
27515
27526
|
const n = i.mainLight;
|
|
27516
27527
|
if (n) {
|
|
27517
|
-
const a = le(n.gameObject,
|
|
27518
|
-
this.uniforms._MainLightPosition = { value: a.normalize() },
|
|
27528
|
+
const a = le(n.gameObject, ze._mainLightPosition);
|
|
27529
|
+
this.uniforms._MainLightPosition = { value: a.normalize() }, ze._mainLightColor.set(n.color.r, n.color.g, n.color.b, 0), this.uniforms._MainLightColor = { value: ze._mainLightColor };
|
|
27519
27530
|
const l = n.intensity;
|
|
27520
|
-
|
|
27531
|
+
ze._lightData.z = l, this.uniforms.unity_LightData = { value: ze._lightData };
|
|
27521
27532
|
}
|
|
27522
|
-
if (e && (
|
|
27533
|
+
if (e && (ze.viewProjection && this.uniforms[this._viewProjectionName] && (this.uniforms[this._viewProjectionName].value = ze._viewProjectionValues), ze.viewMatrix && this.uniforms[this._viewMatrixName] && (this.uniforms[this._viewMatrixName].value = ze._viewMatrixValues), this.uniforms[ze._worldSpaceCameraPosName] && (this.uniforms[ze._worldSpaceCameraPosName] = { value: ze._worldSpaceCameraPos }), i.mainCameraComponent)) {
|
|
27523
27534
|
if (this.uniforms._ProjectionParams) {
|
|
27524
27535
|
const a = this.uniforms._ProjectionParams.value;
|
|
27525
27536
|
a.x = 1, a.y = i.mainCameraComponent.nearClipPlane, a.z = i.mainCameraComponent.farClipPlane, a.w = 1 / a.z, this.uniforms._ProjectionParams.value = a;
|
|
@@ -27639,7 +27650,7 @@ class OD {
|
|
|
27639
27650
|
}
|
|
27640
27651
|
}
|
|
27641
27652
|
}
|
|
27642
|
-
const m = new
|
|
27653
|
+
const m = new ze(
|
|
27643
27654
|
this.identifier,
|
|
27644
27655
|
{
|
|
27645
27656
|
name: t.name ?? "",
|
|
@@ -27657,7 +27668,7 @@ class OD {
|
|
|
27657
27668
|
m.side = Ni;
|
|
27658
27669
|
break;
|
|
27659
27670
|
case 1:
|
|
27660
|
-
m.side =
|
|
27671
|
+
m.side = Uf;
|
|
27661
27672
|
break;
|
|
27662
27673
|
case 2:
|
|
27663
27674
|
m.side = Qo;
|
|
@@ -27767,7 +27778,7 @@ function MD(s, e, t) {
|
|
|
27767
27778
|
for (const i of sa)
|
|
27768
27779
|
i.onLoaded && i.onLoaded(s, e, t);
|
|
27769
27780
|
}
|
|
27770
|
-
const kt = x("debuginstancing"), AD = kt === "lods",
|
|
27781
|
+
const kt = x("debuginstancing"), AD = kt === "lods", zm = x("debugprogressive") === "colors" || AD;
|
|
27771
27782
|
function Sy(s, e, t, i) {
|
|
27772
27783
|
return s.lodsManager.manager?.trackLoadingPromise(e, t, i), i;
|
|
27773
27784
|
}
|
|
@@ -28022,7 +28033,7 @@ class Ro {
|
|
|
28022
28033
|
return this.name ? `${this.name} (BatchedMesh)` : "BatchedMesh";
|
|
28023
28034
|
}
|
|
28024
28035
|
constructor(e, t, i, n, o, r = !1) {
|
|
28025
|
-
this.name = e, this.geometry = t, this.material = i, this._context = o, this._mirrored = r, this._maxInstanceCount = Math.max(2, n), kt && (this._debugMaterial = lw(
|
|
28036
|
+
this.name = e, this.geometry = t, this.material = i, this._context = o, this._mirrored = r, this._maxInstanceCount = Math.max(2, n), kt && (this._debugMaterial = lw(zm));
|
|
28026
28037
|
const a = this.tryEstimateVertexCountSize(this._maxInstanceCount, [t], n);
|
|
28027
28038
|
this._maxVertexCount = a.vertexCount, this._maxIndexCount = a.indexCount, this._batchedMesh = new Jb(this._maxInstanceCount, this._maxVertexCount, this._maxIndexCount, this._debugMaterial ?? this.material), this._batchedMesh.name = this.getBatchedMeshName(), this.applyBatchTransform(this._batchedMesh), this._batchedMesh[Lc] = !0, this._batchedMesh.visible = !0, this._context.scene.add(this._batchedMesh), i instanceof fx && (i.defines.USE_INSTANCING = !0, i.needsUpdate = !0), o.pre_render_callbacks.push(this.onBeforeRender), o.post_render_callbacks.push(this.onAfterRender), kt && console.log(`Instanced renderer (${this.name}) created with ${this._maxInstanceCount} instances, ${this._maxVertexCount} max vertices and ${this._maxIndexCount} max indices for "${e}"`);
|
|
28028
28039
|
}
|
|
@@ -28162,7 +28173,7 @@ class Ro {
|
|
|
28162
28173
|
Mesh: "${this.name}${e.name?.length ? "/" + e.name : ""}" (${u.vertexCount.toLocaleString()} vertices, ${u.indexCount.toLocaleString()} indices)
|
|
28163
28174
|
Max count ${this._maxInstanceCount.toLocaleString()} → ${o.toLocaleString()}
|
|
28164
28175
|
Max vertex count ${this._maxVertexCount.toLocaleString()} -> ${l.toLocaleString()}
|
|
28165
|
-
Max index count ${this._maxIndexCount.toLocaleString()} -> ${c.toLocaleString()}`), this._debugMaterial = lw(
|
|
28176
|
+
Max index count ${this._maxIndexCount.toLocaleString()} -> ${c.toLocaleString()}`), this._debugMaterial = lw(zm);
|
|
28166
28177
|
} else R() && console.debug(`[Instancing] Growing Buffer
|
|
28167
28178
|
Mesh: "${this.name}${e.name?.length ? "/" + e.name : ""}"
|
|
28168
28179
|
Max count ${this._maxInstanceCount} → ${o}
|
|
@@ -28235,7 +28246,7 @@ Vertices: ${this._currentVertexCount.toLocaleString()}/${this._maxVertexCount.to
|
|
|
28235
28246
|
Indices: ${this._currentIndexCount.toLocaleString()}/${this._maxIndexCount.toLocaleString()}`);
|
|
28236
28247
|
}
|
|
28237
28248
|
updateDebugLODColor(e) {
|
|
28238
|
-
if (!
|
|
28249
|
+
if (!zm || e.__instanceIndex < 0) return;
|
|
28239
28250
|
const t = e.currentMeshLOD ?? e.geometry.userData?.LODS?.level ?? 0;
|
|
28240
28251
|
this._batchedMesh.setColorAt(e.__instanceIndex, Ik(t, Ro.debugLODColor));
|
|
28241
28252
|
}
|
|
@@ -28463,7 +28474,7 @@ class BD {
|
|
|
28463
28474
|
return c[h];
|
|
28464
28475
|
},
|
|
28465
28476
|
set(c, h, d) {
|
|
28466
|
-
return typeof h == "string" && i(d, Number.parseInt(h)), Reflect.set(c, h, d) ? (d instanceof
|
|
28477
|
+
return typeof h == "string" && i(d, Number.parseInt(h)), Reflect.set(c, h, d) ? (d instanceof Pe && (c.changed = !0), !0) : !1;
|
|
28467
28478
|
}
|
|
28468
28479
|
});
|
|
28469
28480
|
}
|
|
@@ -28583,7 +28594,7 @@ const xs = class jc extends A {
|
|
|
28583
28594
|
let t = !1;
|
|
28584
28595
|
for (let i = 0; i < this._sharedMaterials.length; i++) {
|
|
28585
28596
|
const n = i < e.length ? e[i] : null;
|
|
28586
|
-
n && n instanceof
|
|
28597
|
+
n && n instanceof Pe ? this.sharedMaterials[i] = n : t || (t = !0, console.warn("Can not assign null as material: " + this.name, n));
|
|
28587
28598
|
}
|
|
28588
28599
|
}
|
|
28589
28600
|
}
|
|
@@ -28735,7 +28746,7 @@ const xs = class jc extends A {
|
|
|
28735
28746
|
if (this.gameObject) {
|
|
28736
28747
|
if ((this._probeAnchorLastFrame !== this.probeAnchor || this._reflectionProbe?.activeAndEnabled === !1) && (this._reflectionProbe?.unapply(this.gameObject), this.updateReflectionProbe()), Wa == this.name && this.gameObject instanceof V) {
|
|
28737
28748
|
this.gameObject.geometry.computeBoundingSphere();
|
|
28738
|
-
const e =
|
|
28749
|
+
const e = z(this.gameObject.geometry.boundingSphere.center).applyMatrix4(this.gameObject.matrixWorld);
|
|
28739
28750
|
j.DrawWireSphere(e, this.gameObject.geometry.boundingSphere.radius, 56831);
|
|
28740
28751
|
}
|
|
28741
28752
|
if (this.isMultiMaterialObject(this.gameObject) && this.gameObject.children?.length > 0)
|
|
@@ -28855,7 +28866,7 @@ class RC extends up {
|
|
|
28855
28866
|
onAfterRender() {
|
|
28856
28867
|
if (super.onAfterRender(), this._needUpdateBoundingSphere) {
|
|
28857
28868
|
for (const e of this.sharedMeshes)
|
|
28858
|
-
if (e instanceof
|
|
28869
|
+
if (e instanceof zo) {
|
|
28859
28870
|
this._needUpdateBoundingSphere = !1;
|
|
28860
28871
|
try {
|
|
28861
28872
|
const t = e.geometry, i = yx(e);
|
|
@@ -28867,8 +28878,8 @@ class RC extends up {
|
|
|
28867
28878
|
}
|
|
28868
28879
|
if (hw) {
|
|
28869
28880
|
for (const e of this.sharedMeshes)
|
|
28870
|
-
if (e instanceof
|
|
28871
|
-
const t =
|
|
28881
|
+
if (e instanceof zo && e.boundingSphere) {
|
|
28882
|
+
const t = z(e.boundingSphere.center).applyMatrix4(e.matrixWorld);
|
|
28872
28883
|
j.DrawWireSphere(t, e.boundingSphere.radius, "red");
|
|
28873
28884
|
}
|
|
28874
28885
|
}
|
|
@@ -28883,7 +28894,7 @@ var Cy = /* @__PURE__ */ ((s) => (s[s.Off = 0] = "Off", s[s.On = 1] = "On", s[s.
|
|
|
28883
28894
|
return n && jD(e, t, n), n;
|
|
28884
28895
|
};
|
|
28885
28896
|
const si = x("debugdroplistener");
|
|
28886
|
-
class
|
|
28897
|
+
class UD extends CustomEvent {
|
|
28887
28898
|
/**
|
|
28888
28899
|
* Creates a new added event with the provided details
|
|
28889
28900
|
* @param detail Information about the added object
|
|
@@ -28892,7 +28903,7 @@ class zD extends CustomEvent {
|
|
|
28892
28903
|
super("object-added", { detail: e });
|
|
28893
28904
|
}
|
|
28894
28905
|
}
|
|
28895
|
-
const
|
|
28906
|
+
const zD = "blob";
|
|
28896
28907
|
class or extends A {
|
|
28897
28908
|
dropArea;
|
|
28898
28909
|
fitIntoVolume = !1;
|
|
@@ -29039,7 +29050,7 @@ class or extends A {
|
|
|
29039
29050
|
*/
|
|
29040
29051
|
async addFromFiles(e, t) {
|
|
29041
29052
|
if (si && console.log("Add files", e), !!Array.isArray(e) && e.length) {
|
|
29042
|
-
this.deleteDropEvent(), this.removePreviouslyAddedObjects(), Hu(
|
|
29053
|
+
this.deleteDropEvent(), this.removePreviouslyAddedObjects(), Hu(zD, null), this._abort?.abort("New files dropped"), this._abort = new AbortController();
|
|
29043
29054
|
for (const i of e) {
|
|
29044
29055
|
if (!i) continue;
|
|
29045
29056
|
if (i.type.startsWith("image/")) {
|
|
@@ -29109,7 +29120,7 @@ class or extends A {
|
|
|
29109
29120
|
}
|
|
29110
29121
|
}
|
|
29111
29122
|
Si.autoplayAnimations(n);
|
|
29112
|
-
const d = new
|
|
29123
|
+
const d = new UD({
|
|
29113
29124
|
sender: this,
|
|
29114
29125
|
gltf: n,
|
|
29115
29126
|
model: n,
|
|
@@ -29259,7 +29270,7 @@ const fp = class EC extends A {
|
|
|
29259
29270
|
}
|
|
29260
29271
|
this.object.visible = !1;
|
|
29261
29272
|
const e = this.gameObject.getComponent(Ja);
|
|
29262
|
-
e && (e.enabled = !1), this._startPosition = this.object.position?.clone() ?? new w(0, 0, 0), this._startQuaternion = this.object.quaternion?.clone() ?? new
|
|
29273
|
+
e && (e.enabled = !1), this._startPosition = this.object.position?.clone() ?? new w(0, 0, 0), this._startQuaternion = this.object.quaternion?.clone() ?? new U(0, 0, 0, 1);
|
|
29263
29274
|
}
|
|
29264
29275
|
this.gameObject.getComponentInParent(jn) || this.gameObject.addComponent(jn);
|
|
29265
29276
|
}
|
|
@@ -29391,7 +29402,7 @@ class AC {
|
|
|
29391
29402
|
const a = new Array(), l = new Array(), c = new Array();
|
|
29392
29403
|
for (let p = 0; p < e.count; p++) {
|
|
29393
29404
|
e.getMatrixAt(p, r);
|
|
29394
|
-
let m = new w(), b = new
|
|
29405
|
+
let m = new w(), b = new U(), y = new w();
|
|
29395
29406
|
r.decompose(m, b, y), a.push(m.x, m.y, m.z), l.push(b.x, b.y, b.z, b.w), c.push(y.x, y.y, y.z);
|
|
29396
29407
|
}
|
|
29397
29408
|
const h = new Float32Array(a), d = new Float32Array(l), u = new Float32Array(c);
|
|
@@ -29450,7 +29461,7 @@ var HD = Object.defineProperty, jC = (s, e, t, i) => {
|
|
|
29450
29461
|
return n && HD(e, t, n), n;
|
|
29451
29462
|
};
|
|
29452
29463
|
const Jd = x("debuggltfexport");
|
|
29453
|
-
class
|
|
29464
|
+
class UC extends Qt {
|
|
29454
29465
|
sceneRoot;
|
|
29455
29466
|
}
|
|
29456
29467
|
const cb = class Va extends A {
|
|
@@ -29571,7 +29582,7 @@ jC([
|
|
|
29571
29582
|
jC([
|
|
29572
29583
|
f(E)
|
|
29573
29584
|
], cb.prototype, "objects");
|
|
29574
|
-
let
|
|
29585
|
+
let zC = cb;
|
|
29575
29586
|
function qD() {
|
|
29576
29587
|
typeof globalThis !== void 0 && !("OffscreenCanvas" in globalThis) && (globalThis.OffscreenCanvas = class {
|
|
29577
29588
|
canvas;
|
|
@@ -29635,7 +29646,7 @@ class fe {
|
|
|
29635
29646
|
static start(e, t) {
|
|
29636
29647
|
typeof t == "string" && (t = { parentScope: t });
|
|
29637
29648
|
const i = new YD(e, t);
|
|
29638
|
-
|
|
29649
|
+
Uc.set(e, i);
|
|
29639
29650
|
}
|
|
29640
29651
|
/** Report progress for a formerly started scope.
|
|
29641
29652
|
* @param scope The scope to report progress for.
|
|
@@ -29658,7 +29669,7 @@ class fe {
|
|
|
29658
29669
|
* Progress.report("export-usdz", { currentStep: 1, totalSteps: 10 });
|
|
29659
29670
|
*/
|
|
29660
29671
|
static report(e, t) {
|
|
29661
|
-
const i =
|
|
29672
|
+
const i = Uc.get(e);
|
|
29662
29673
|
if (!i) {
|
|
29663
29674
|
console.warn("Reporting progress for non-existing scope", e);
|
|
29664
29675
|
return;
|
|
@@ -29669,11 +29680,11 @@ class fe {
|
|
|
29669
29680
|
* @remarks Will warn if any child scope is still running (progress < 1).
|
|
29670
29681
|
*/
|
|
29671
29682
|
static end(e) {
|
|
29672
|
-
const t =
|
|
29673
|
-
t && (t.end(),
|
|
29683
|
+
const t = Uc.get(e);
|
|
29684
|
+
t && (t.end(), Uc.delete(e));
|
|
29674
29685
|
}
|
|
29675
29686
|
}
|
|
29676
|
-
const
|
|
29687
|
+
const Uc = /* @__PURE__ */ new Map();
|
|
29677
29688
|
class YD {
|
|
29678
29689
|
scopeLabel;
|
|
29679
29690
|
parentScope;
|
|
@@ -29689,7 +29700,7 @@ class YD {
|
|
|
29689
29700
|
selfReports = 0;
|
|
29690
29701
|
totalReports = 0;
|
|
29691
29702
|
constructor(e, t) {
|
|
29692
|
-
this.parentScope = t?.parentScope ?
|
|
29703
|
+
this.parentScope = t?.parentScope ? Uc.get(t.parentScope) : void 0, this.parentScope && (this.parentScope.childScopes.push(this), this.parentDepth = this.parentScope.parentDepth + 1), this.scopeLabel = " ".repeat(this.parentDepth * 2) + e, this.showLogs = t?.logTimings ?? !!XD, this.showLogs && console.time(this.scopeLabel), this.onProgress = t?.onProgress;
|
|
29693
29704
|
}
|
|
29694
29705
|
report(e, t = !1) {
|
|
29695
29706
|
if (e) {
|
|
@@ -30001,7 +30012,7 @@ function WC(s) {
|
|
|
30001
30012
|
}
|
|
30002
30013
|
return t;
|
|
30003
30014
|
}
|
|
30004
|
-
const i2 = new w(), n2 = new
|
|
30015
|
+
const i2 = new w(), n2 = new U(), s2 = new w(1, 1, 1);
|
|
30005
30016
|
class wt {
|
|
30006
30017
|
static USDObject_export_id = 0;
|
|
30007
30018
|
uuid;
|
|
@@ -30023,7 +30034,7 @@ class wt {
|
|
|
30023
30034
|
this.transform = null;
|
|
30024
30035
|
return;
|
|
30025
30036
|
}
|
|
30026
|
-
const t = new w(), i = new
|
|
30037
|
+
const t = new w(), i = new U(), n = new w();
|
|
30027
30038
|
e.decompose(t, i, n), this.transform = { position: t, quaternion: i, scale: n };
|
|
30028
30039
|
}
|
|
30029
30040
|
/** @deprecated Use `transform`, or `getMatrix()` if you really need the matrix */
|
|
@@ -30268,7 +30279,7 @@ let a2 = class {
|
|
|
30268
30279
|
fe.report("export-usdz", "Invoking onBeforeBuildDocument"), await Du(i, "onBeforeBuildDocument"), fe.report("export-usdz", "Done onBeforeBuildDocument"), fe.report("export-usdz", "Reparent bones to common ancestor");
|
|
30269
30280
|
const a = [], l = /* @__PURE__ */ new Set();
|
|
30270
30281
|
e?.traverse((g) => {
|
|
30271
|
-
if (!(!t.exportInvisible && !g.visible) && g instanceof
|
|
30282
|
+
if (!(!t.exportInvisible && !g.visible) && g instanceof zo) {
|
|
30272
30283
|
const _ = g.skeleton.bones, v = $C(_);
|
|
30273
30284
|
if (v) {
|
|
30274
30285
|
const C = { object: g, originalParent: g.parent, newParent: v };
|
|
@@ -30346,9 +30357,9 @@ function GC(s, e, t, i) {
|
|
|
30346
30357
|
if (!t.exportInvisible && !s.visible) return;
|
|
30347
30358
|
let n, o, r;
|
|
30348
30359
|
const a = { position: s.position, quaternion: s.quaternion, scale: s.scale };
|
|
30349
|
-
if (s.position.x === 0 && s.position.y === 0 && s.position.z === 0 && (a.position = null), s.quaternion.x === 0 && s.quaternion.y === 0 && s.quaternion.z === 0 && s.quaternion.w === 1 && (a.quaternion = null), s.scale.x === 1 && s.scale.y === 1 && s.scale.z === 1 && (a.scale = null), (s instanceof V || s instanceof
|
|
30350
|
-
r.isMeshPhysicalNodeMaterial || r instanceof
|
|
30351
|
-
const l = nu(s), c = s instanceof
|
|
30360
|
+
if (s.position.x === 0 && s.position.y === 0 && s.position.z === 0 && (a.position = null), s.quaternion.x === 0 && s.quaternion.y === 0 && s.quaternion.z === 0 && s.quaternion.w === 1 && (a.quaternion = null), s.scale.x === 1 && s.scale.y === 1 && s.scale.z === 1 && (a.scale = null), (s instanceof V || s instanceof zo) && (o = s.geometry, r = s.material), i && !i(s) && (o = void 0, r = void 0), (s instanceof V || s instanceof zo) && r && typeof r == "object" && (r instanceof Tt || r instanceof Le || // material instanceof MeshPhysicalNodeMaterial ||
|
|
30361
|
+
r.isMeshPhysicalNodeMaterial || r instanceof Pe && r.type === "MeshLineMaterial")) {
|
|
30362
|
+
const l = nu(s), c = s instanceof zo ? s : null;
|
|
30352
30363
|
n = new wt(s.uuid, l, a, o, r, void 0, c, s.animations);
|
|
30353
30364
|
} else if (s instanceof pe || s instanceof Df) {
|
|
30354
30365
|
const l = nu(s);
|
|
@@ -30472,7 +30483,7 @@ async function Du(s, e, t = null) {
|
|
|
30472
30483
|
}
|
|
30473
30484
|
let tu = null, ii = null, Nm, Ia, iu;
|
|
30474
30485
|
async function c2(s, e = 1 / 0, t = null, i = void 0) {
|
|
30475
|
-
Nm || (Nm = new
|
|
30486
|
+
Nm || (Nm = new zn(2, 2, 1, 1)), Ia || (Ia = new ps({
|
|
30476
30487
|
uniforms: {
|
|
30477
30488
|
blitTexture: new an(s),
|
|
30478
30489
|
flipY: new an(!1),
|
|
@@ -30506,7 +30517,7 @@ async function c2(s, e = 1 / 0, t = null, i = void 0) {
|
|
|
30506
30517
|
}));
|
|
30507
30518
|
const n = Ia.uniforms;
|
|
30508
30519
|
n.blitTexture.value = s, n.flipY.value = !1, n.scale.value = new ve(1, 1, 1, 1), i !== void 0 && n.scale.value.copy(i), Ia.defines.IS_SRGB = s.colorSpace == Ks, Ia.needsUpdate = !0, iu || (iu = new V(Nm, Ia), iu.frustumCulled = !1);
|
|
30509
|
-
const o = new pe(), r = new
|
|
30520
|
+
const o = new pe(), r = new zi();
|
|
30510
30521
|
r.add(iu), t || (t = tu = new ca({ antialias: !1, alpha: !0, premultipliedAlpha: !1, preserveDrawingBuffer: !0 }));
|
|
30511
30522
|
const a = Math.min(s.image.width, e), l = Math.min(s.image.height, e);
|
|
30512
30523
|
ii && (ii.width !== a || ii.height !== l) && (ii.dispose(), ii = null), ii || (ii = new gs(a, l, { format: Ff, type: _k, minFilter: Vu, magFilter: Vu })), t.setRenderTarget(ii), t.setSize(a, l), t.clear(), t.render(r, o), tu && (tu.dispose(), tu = null);
|
|
@@ -31430,7 +31441,7 @@ class Ke {
|
|
|
31430
31441
|
* @param generateScale
|
|
31431
31442
|
*/
|
|
31432
31443
|
*getValues(e, t = !0, i = !0, n = !0) {
|
|
31433
|
-
const o = new w(), r = new
|
|
31444
|
+
const o = new w(), r = new U(), a = new w(1, 1, 1), l = this.target, c = t ? this.pos?.createInterpolant() : void 0, h = i ? this.rot?.createInterpolant() : void 0, d = n ? this.scale?.createInterpolant() : void 0;
|
|
31434
31445
|
c || o.set(l.position.x, l.position.y, l.position.z), h || r.set(l.quaternion.x, l.quaternion.y, l.quaternion.z, l.quaternion.w), d || a.set(l.scale.x, l.scale.y, l.scale.z);
|
|
31435
31446
|
const u = (m, b) => {
|
|
31436
31447
|
const y = m;
|
|
@@ -31959,7 +31970,7 @@ class Bl extends A {
|
|
|
31959
31970
|
relativeMotion = !1;
|
|
31960
31971
|
coroutine = null;
|
|
31961
31972
|
targetPos = new w();
|
|
31962
|
-
targetRot = new
|
|
31973
|
+
targetRot = new U();
|
|
31963
31974
|
targetScale = new w();
|
|
31964
31975
|
onEnable() {
|
|
31965
31976
|
this.context.accessibility.updateElement(this, {
|
|
@@ -32141,10 +32152,10 @@ const mp = class ni extends A {
|
|
|
32141
32152
|
}
|
|
32142
32153
|
};
|
|
32143
32154
|
Xe([
|
|
32144
|
-
f(
|
|
32155
|
+
f(Pe)
|
|
32145
32156
|
], mp.prototype, "materialToSwitch");
|
|
32146
32157
|
Xe([
|
|
32147
|
-
f(
|
|
32158
|
+
f(Pe)
|
|
32148
32159
|
], mp.prototype, "variantMaterial");
|
|
32149
32160
|
Xe([
|
|
32150
32161
|
f()
|
|
@@ -33061,7 +33072,7 @@ At([
|
|
|
33061
33072
|
f(he)
|
|
33062
33073
|
], Hi.prototype, "color", 2);
|
|
33063
33074
|
At([
|
|
33064
|
-
f(
|
|
33075
|
+
f(Pe)
|
|
33065
33076
|
], Hi.prototype, "sharedMaterial", 2);
|
|
33066
33077
|
At([
|
|
33067
33078
|
f()
|
|
@@ -33155,7 +33166,7 @@ class An extends A {
|
|
|
33155
33166
|
// move objects into a temporary scene while placing (which is not rendered) so that the components won't be disabled during this process
|
|
33156
33167
|
// e.g. we want the avatar to still be updated while placing
|
|
33157
33168
|
// another possibly solution would be to ensure from this component that the Rig is *also* not disabled while placing
|
|
33158
|
-
_placementScene = new
|
|
33169
|
+
_placementScene = new zi();
|
|
33159
33170
|
/** the reticles used for placement */
|
|
33160
33171
|
_reticle = [];
|
|
33161
33172
|
/** reference-space hit poses, in sync with the reticles — captured while placing when {@link useXRAnchor}
|
|
@@ -33192,10 +33203,10 @@ class An extends A {
|
|
|
33192
33203
|
this._reparentedComponents.length = 0, this._reparentedComponents.push({ comp: this, originalObject: this.gameObject }), k.addComponent(t, this);
|
|
33193
33204
|
for (const i of this._reticle)
|
|
33194
33205
|
$i(i);
|
|
33195
|
-
this._reticle.length = 0, this._isPlacing = !0, this.context.input.addEventListener("pointerup", this.onPlaceScene, { queue:
|
|
33206
|
+
this._reticle.length = 0, this._isPlacing = !0, this.context.input.addEventListener("pointerup", this.onPlaceScene, { queue: Ur.Early });
|
|
33196
33207
|
}
|
|
33197
33208
|
onLeaveXR() {
|
|
33198
|
-
this.context.input.removeEventListener("pointerup", this.onPlaceScene, { queue:
|
|
33209
|
+
this.context.input.removeEventListener("pointerup", this.onPlaceScene, { queue: Ur.Early }), this.onRevertSceneChanges(), this._anchor = null, this._pendingAnchorPose = null, An._hasPlaced = !1, this._rigPlacementMatrix = void 0;
|
|
33199
33210
|
}
|
|
33200
33211
|
onUpdateXR(e) {
|
|
33201
33212
|
if (e.xr.isTrackingImages) {
|
|
@@ -33255,7 +33266,7 @@ class An extends A {
|
|
|
33255
33266
|
this._reticle[t] = o, o.matrixAutoUpdate = !1, o.visible = !1;
|
|
33256
33267
|
}
|
|
33257
33268
|
if (o.lastPos = o.lastPos || i.position.clone(), o.lastQuat = o.lastQuat || i.quaternion.clone(), o.position.copy(o.lastPos.lerp(i.position, this.context.time.deltaTime / 0.1)), o.lastPos.copy(o.position), o.quaternion.copy(o.lastQuat.slerp(i.quaternion, this.context.time.deltaTime / 0.05)), o.lastQuat.copy(o.quaternion), o.scale.set(n, n, n), this.customReticle && this.applyViewBasedTransform(o), o.updateMatrix(), o.visible = !0, o.parent !== this.context.scene && this.context.scene.add(o), this._placementStartTime < 0 && (this._placementStartTime = this.context.time.realtimeSinceStartup), this.autoPlace)
|
|
33258
|
-
if (this.upVec.set(0, 1, 0).applyQuaternion(o.quaternion), this.upVec.dot(
|
|
33269
|
+
if (this.upVec.set(0, 1, 0).applyQuaternion(o.quaternion), this.upVec.dot(z(0, 1, 0)) > 0.9) {
|
|
33259
33270
|
let a = o["autoplace:timer"] || 0;
|
|
33260
33271
|
a >= 1 ? (o.visible = !1, this.onPlaceScene(null)) : (a += this.context.time.deltaTime, o["autoplace:timer"] = a);
|
|
33261
33272
|
} else
|
|
@@ -33830,7 +33841,7 @@ jl([
|
|
|
33830
33841
|
jl([
|
|
33831
33842
|
f()
|
|
33832
33843
|
], lo.prototype, "createQRCodeButton");
|
|
33833
|
-
const
|
|
33844
|
+
const U2 = x("debugavatar");
|
|
33834
33845
|
class bt extends A {
|
|
33835
33846
|
/**
|
|
33836
33847
|
* Get an avatar marker by index from the global list of avatar markers.
|
|
@@ -33866,7 +33877,7 @@ class bt extends A {
|
|
|
33866
33877
|
avatar;
|
|
33867
33878
|
/** @internal */
|
|
33868
33879
|
awake() {
|
|
33869
|
-
bt.instances.push(this),
|
|
33880
|
+
bt.instances.push(this), U2 && console.log(this);
|
|
33870
33881
|
for (const e of bt._onNewAvatarMarkerAdded)
|
|
33871
33882
|
e({ avatarMarker: this, gameObject: this.gameObject });
|
|
33872
33883
|
}
|
|
@@ -33884,14 +33895,14 @@ class bt extends A {
|
|
|
33884
33895
|
return this.connectionId === this.context.connection.connectionId;
|
|
33885
33896
|
}
|
|
33886
33897
|
}
|
|
33887
|
-
var
|
|
33898
|
+
var z2 = Object.defineProperty, N2 = (s, e, t, i) => {
|
|
33888
33899
|
for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
|
|
33889
33900
|
(r = s[o]) && (n = r(e, t, n) || n);
|
|
33890
|
-
return n &&
|
|
33901
|
+
return n && z2(e, t, n), n;
|
|
33891
33902
|
};
|
|
33892
33903
|
const Ga = x("debugxrflags"), n1 = x("disablexrflags");
|
|
33893
33904
|
n1 && console.warn("XRFlags are disabled");
|
|
33894
|
-
var
|
|
33905
|
+
var Us = /* @__PURE__ */ ((s) => (s[s.Never = 0] = "Never", s[s.Browser = 1] = "Browser", s[s.AR = 2] = "AR", s[s.VR = 4] = "VR", s[s.FirstPerson = 8] = "FirstPerson", s[s.ThirdPerson = 16] = "ThirdPerson", s[s.All = 4294967295] = "All", s))(Us || {});
|
|
33895
33906
|
class bi {
|
|
33896
33907
|
static Global = new bi();
|
|
33897
33908
|
Mask = 17;
|
|
@@ -33961,7 +33972,7 @@ var $2 = Object.defineProperty, pb = (s, e, t, i) => {
|
|
|
33961
33972
|
(r = s[o]) && (n = r(e, t, n) || n);
|
|
33962
33973
|
return n && $2(e, t, n), n;
|
|
33963
33974
|
};
|
|
33964
|
-
const bc = x("debugwebxr"), xw = new
|
|
33975
|
+
const bc = x("debugwebxr"), xw = new U().setFromAxisAngle(new w(0, 1, 0), Math.PI);
|
|
33965
33976
|
class aa extends A {
|
|
33966
33977
|
head;
|
|
33967
33978
|
leftHand;
|
|
@@ -34062,7 +34073,7 @@ class aa extends A {
|
|
|
34062
34073
|
else {
|
|
34063
34074
|
const e = new E();
|
|
34064
34075
|
e.name = "Head";
|
|
34065
|
-
const t = ha.createPrimitive(
|
|
34076
|
+
const t = ha.createPrimitive(Uh.Cube);
|
|
34066
34077
|
e.add(t), this.gameObject.add(e), this.head = new se("", this.sourceId, e), bc && console.log("Create head", e);
|
|
34067
34078
|
}
|
|
34068
34079
|
if (this.rightHand)
|
|
@@ -34350,7 +34361,7 @@ class tr extends A {
|
|
|
34350
34361
|
makeOccluder(e) {
|
|
34351
34362
|
if (e instanceof V) {
|
|
34352
34363
|
let t = e.material;
|
|
34353
|
-
t instanceof
|
|
34364
|
+
t instanceof Pe && (t = e.material = t.clone(), t.depthWrite = !0, t.depthTest = !0, t.colorWrite = !1, e.receiveShadow = !1, e.renderOrder = -100);
|
|
34354
34365
|
}
|
|
34355
34366
|
}
|
|
34356
34367
|
}
|
|
@@ -34406,7 +34417,7 @@ class mn extends A {
|
|
|
34406
34417
|
onHandleMovement(e, t) {
|
|
34407
34418
|
const i = e.getStick("xr-standard-thumbstick");
|
|
34408
34419
|
if (i.x != 0 || i.y != 0) {
|
|
34409
|
-
const n =
|
|
34420
|
+
const n = z(i.x, 0, i.y);
|
|
34410
34421
|
n.multiplyScalar(this.context.time.deltaTimeUnscaled * this.movementSpeed);
|
|
34411
34422
|
const o = it(t);
|
|
34412
34423
|
n.multiplyScalar(o.x), n.applyQuaternion(e.xr.poseOrientation), n.y = 0, n.applyQuaternion(t.worldQuaternion), R() && Number.isNaN(n.x) && console.error("Stick movement resulted in NaN", { stick: i, vec: n }), t.position.add(n), t.updateWorldMatrix(!1, !1);
|
|
@@ -34443,7 +34454,7 @@ class mn extends A {
|
|
|
34443
34454
|
this._didTeleport = !0;
|
|
34444
34455
|
const n = this.context.physics.raycastFromRay(e.ray)[0];
|
|
34445
34456
|
if (n && n.object instanceof _l) {
|
|
34446
|
-
const r = n.normal?.dot(
|
|
34457
|
+
const r = n.normal?.dot(z(0, 1, 0));
|
|
34447
34458
|
if (r !== void 0 && r < 0.4)
|
|
34448
34459
|
return;
|
|
34449
34460
|
}
|
|
@@ -34453,7 +34464,7 @@ class mn extends A {
|
|
|
34453
34464
|
const r = t.worldPosition;
|
|
34454
34465
|
this._plane.setFromNormalAndCoplanarPoint(new w(0, 1, 0), r);
|
|
34455
34466
|
const a = e.ray;
|
|
34456
|
-
o = r.clone(), this._plane.intersectLine(new vk(a.origin,
|
|
34467
|
+
o = r.clone(), this._plane.intersectLine(new vk(a.origin, z(a.direction).multiplyScalar(1e4).add(a.origin)), o), o.distanceTo(r) > t.scale.x * 10 && (o = null);
|
|
34457
34468
|
}
|
|
34458
34469
|
if (o) {
|
|
34459
34470
|
if (this.useTeleportTarget && !k.getComponentInParent(n.object, mb))
|
|
@@ -34524,7 +34535,7 @@ class mn extends A {
|
|
|
34524
34535
|
if (c || (c = l[0]), n && (n.controller = i, n.hit = c), this._hitDistances[t] = c?.distance || null, c) {
|
|
34525
34536
|
this._lastHitDistances[t] = c.distance;
|
|
34526
34537
|
const h = e.rigScale ?? 1;
|
|
34527
|
-
Xm && (j.DrawWireSphere(c.point, 0.025 * h, 16711680), j.DrawLabel(
|
|
34538
|
+
Xm && (j.DrawWireSphere(c.point, 0.025 * h, 16711680), j.DrawLabel(z(0, 0.2, 0).add(c.point), c.object.name, 0.02, 0)), n || (n = this.createHitPointObject(), this._hitDiscs[t] = n), n.hit = c, n.visible = c.distance > h * 0.05;
|
|
34528
34539
|
let d = 0.01 * (h + c.distance);
|
|
34529
34540
|
const u = i.getButton("primary")?.pressed;
|
|
34530
34541
|
u && (d *= 1.1), n.scale.set(d, d, d), n.layers.set(2);
|
|
@@ -34546,8 +34557,8 @@ class mn extends A {
|
|
|
34546
34557
|
return uy(e) || e.isUI === !0 ? !0 : e.isScene ? !1 : e.parent ? this.isObjectWithInteractiveComponent(e.parent, t + 1) : !1;
|
|
34547
34558
|
}
|
|
34548
34559
|
updateHitPointerPosition(e, t, i) {
|
|
34549
|
-
const n =
|
|
34550
|
-
n.add(
|
|
34560
|
+
const n = z(e.rayWorldPosition);
|
|
34561
|
+
n.add(z(0, 0, i - 0.01).applyQuaternion(e.rayWorldQuaternion)), t.position.lerp(n, this.context.time.deltaTimeUnscaled / 0.05);
|
|
34551
34562
|
}
|
|
34552
34563
|
hitPointRaycastFilter = (e) => e.type === "SkinnedMesh" ? "continue in children" : !0;
|
|
34553
34564
|
/** create an object to visualize hit points in the scene */
|
|
@@ -34751,7 +34762,7 @@ const vc = x("debugwebxr"), Y2 = x("debugusdz"), Ct = class Ha extends A {
|
|
|
34751
34762
|
if (!this.isActiveWebXR) return;
|
|
34752
34763
|
vc && console.log("WebXR onEnterXR"), this._previousXRState = bi.Global.Mask;
|
|
34753
34764
|
const t = e.xr.isVR;
|
|
34754
|
-
if (bi.Global.Set(t ?
|
|
34765
|
+
if (bi.Global.Set(t ? Us.VR : Us.AR), e.xr.isAR) {
|
|
34755
34766
|
let i = k.findObjectOfType(An, this.context, !1);
|
|
34756
34767
|
if (!i)
|
|
34757
34768
|
if (this.usePlacementReticle) {
|
|
@@ -35162,7 +35173,7 @@ Cx.prototype.interactable = {
|
|
|
35162
35173
|
this.interactable = s;
|
|
35163
35174
|
}
|
|
35164
35175
|
};
|
|
35165
|
-
class
|
|
35176
|
+
class Un extends A {
|
|
35166
35177
|
/** Is this object on the root of the UI hierarchy ? */
|
|
35167
35178
|
isRoot() {
|
|
35168
35179
|
return this.Root?.gameObject === this.gameObject;
|
|
@@ -35215,7 +35226,7 @@ class zn extends A {
|
|
|
35215
35226
|
if (!e) return;
|
|
35216
35227
|
this.removeShadowComponent();
|
|
35217
35228
|
const i = this.isRoot() ? this.gameObject : this.gameObject.parent;
|
|
35218
|
-
if (this._parentComponent = k.getComponentInParent(i,
|
|
35229
|
+
if (this._parentComponent = k.getComponentInParent(i, Un), !this._parentComponent) {
|
|
35219
35230
|
console.warn(`Component "${this.name}" doesn't have a UI parent anywhere. Do you have an UI element outside a Canvas? UI components must be a child of a Canvas component`, this);
|
|
35220
35231
|
return;
|
|
35221
35232
|
}
|
|
@@ -35251,7 +35262,7 @@ class zn extends A {
|
|
|
35251
35262
|
this.shadowComponent && (this.shadowComponent.interactable = e);
|
|
35252
35263
|
}
|
|
35253
35264
|
}
|
|
35254
|
-
class wp extends
|
|
35265
|
+
class wp extends Un {
|
|
35255
35266
|
awake() {
|
|
35256
35267
|
super.awake();
|
|
35257
35268
|
}
|
|
@@ -35272,7 +35283,7 @@ class tF {
|
|
|
35272
35283
|
width;
|
|
35273
35284
|
height;
|
|
35274
35285
|
}
|
|
35275
|
-
const Pn = new w(), wc = new Z(), au = new
|
|
35286
|
+
const Pn = new w(), wc = new Z(), au = new U(), Ul = class c1 extends Un {
|
|
35276
35287
|
get parent() {
|
|
35277
35288
|
return this._parentRectTransform;
|
|
35278
35289
|
}
|
|
@@ -35372,7 +35383,7 @@ const Pn = new w(), wc = new Z(), au = new z(), zl = class c1 extends zn {
|
|
|
35372
35383
|
if (!t) return;
|
|
35373
35384
|
this.gameObject.parent ? this._parentRectTransform = k.getComponentInParent(this.gameObject.parent, c1) : this._parentRectTransform = void 0, this._transformNeedsUpdate = !1, Ym && console.warn("RectTransform → ApplyTransform", this.name + " because " + e), this.isRoot() ? this.Root.screenspace || (t.rotation.y = Math.PI) : (t.matrix.identity(), t.matrixAutoUpdate = !1, Pn.set(0, 0, 0), this.applyPivot(Pn), t.matrix.setPosition(Pn.x, Pn.y, 0), (this.gameObject.quaternion.x || this.gameObject.quaternion.y || this.gameObject.quaternion.z) && (au.copy(this.gameObject.quaternion), au.x *= -1, au.z *= -1, wc.makeRotationFromQuaternion(au), t.matrix.premultiply(wc)), Pn.set(0, 0, 0), this.applyAnchoring(Pn), this.canvas?.screenspace ? Pn.z += 0.1 : Pn.z += 0.01, wc.identity(), wc.setPosition(Pn.x, Pn.y, Pn.z), t.matrix.premultiply(wc), t.matrix.scale(this.gameObject.scale)), this.lastMatrix.copy(this.gameObject.matrix);
|
|
35374
35385
|
const i = !0;
|
|
35375
|
-
for (const n of jS(this.gameObject,
|
|
35386
|
+
for (const n of jS(this.gameObject, Un, i, 1)) {
|
|
35376
35387
|
if (n === this || !n.activeAndEnabled) continue;
|
|
35377
35388
|
const o = n;
|
|
35378
35389
|
o.onParentRectTransformChanged && o.onParentRectTransformChanged(this);
|
|
@@ -35453,20 +35464,20 @@ const Pn = new w(), wc = new Z(), au = new z(), zl = class c1 extends zn {
|
|
|
35453
35464
|
};
|
|
35454
35465
|
ed([
|
|
35455
35466
|
f(ee)
|
|
35456
|
-
],
|
|
35467
|
+
], Ul.prototype, "anchoredPosition", 1);
|
|
35457
35468
|
ed([
|
|
35458
35469
|
f(ee)
|
|
35459
|
-
],
|
|
35470
|
+
], Ul.prototype, "sizeDelta", 2);
|
|
35460
35471
|
ed([
|
|
35461
35472
|
f(ee)
|
|
35462
|
-
],
|
|
35473
|
+
], Ul.prototype, "pivot", 2);
|
|
35463
35474
|
ed([
|
|
35464
35475
|
f(ee)
|
|
35465
|
-
],
|
|
35476
|
+
], Ul.prototype, "anchorMin", 2);
|
|
35466
35477
|
ed([
|
|
35467
35478
|
f(ee)
|
|
35468
|
-
],
|
|
35469
|
-
let ws =
|
|
35479
|
+
], Ul.prototype, "anchorMax", 2);
|
|
35480
|
+
let ws = Ul;
|
|
35470
35481
|
var iF = Object.defineProperty, h1 = (s, e, t, i) => {
|
|
35471
35482
|
for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
|
|
35472
35483
|
(r = s[o]) && (n = r(e, t, n) || n);
|
|
@@ -35492,7 +35503,7 @@ const Or = {
|
|
|
35492
35503
|
backgroundOpacity: 1,
|
|
35493
35504
|
borderColor: new oe(1, 1, 1),
|
|
35494
35505
|
borderOpacity: 1
|
|
35495
|
-
}, yb = class
|
|
35506
|
+
}, yb = class zc extends Un {
|
|
35496
35507
|
get isGraphic() {
|
|
35497
35508
|
return !0;
|
|
35498
35509
|
}
|
|
@@ -35585,14 +35596,14 @@ const Or = {
|
|
|
35585
35596
|
static textureCache = /* @__PURE__ */ new Map();
|
|
35586
35597
|
async setTexture(e) {
|
|
35587
35598
|
if (this.setOptions({ backgroundOpacity: 0 }), e) {
|
|
35588
|
-
if (
|
|
35589
|
-
e =
|
|
35599
|
+
if (zc.textureCache.has(e))
|
|
35600
|
+
e = zc.textureCache.get(e);
|
|
35590
35601
|
else if (!e.isRenderTargetTexture) {
|
|
35591
35602
|
const t = e.clone();
|
|
35592
|
-
t.colorSpace = Ys,
|
|
35603
|
+
t.colorSpace = Ys, zc.textureCache.set(e, t), e = t;
|
|
35593
35604
|
}
|
|
35594
35605
|
this.setOptions({ backgroundImage: e, borderRadius: 0, backgroundOpacity: this.color.alpha, backgroundSize: "stretch" }), qe.assignTextureLOD(e, 0).then((t) => {
|
|
35595
|
-
t instanceof ke && (e &&
|
|
35606
|
+
t instanceof ke && (e && zc.textureCache.set(e, t), this.setOptions({ backgroundImage: t }), this.markDirty());
|
|
35596
35607
|
});
|
|
35597
35608
|
} else
|
|
35598
35609
|
this.setOptions({ backgroundImage: void 0, borderRadius: 0, backgroundOpacity: this.color.alpha });
|
|
@@ -36133,7 +36144,7 @@ var uF = Object.defineProperty, ft = (s, e, t, i) => {
|
|
|
36133
36144
|
return n && uF(e, t, n), n;
|
|
36134
36145
|
};
|
|
36135
36146
|
const Ow = x("debuguilayout");
|
|
36136
|
-
class
|
|
36147
|
+
class zl {
|
|
36137
36148
|
left = 0;
|
|
36138
36149
|
right = 0;
|
|
36139
36150
|
top = 0;
|
|
@@ -36147,16 +36158,16 @@ class Ul {
|
|
|
36147
36158
|
}
|
|
36148
36159
|
ft([
|
|
36149
36160
|
f()
|
|
36150
|
-
],
|
|
36161
|
+
], zl.prototype, "left");
|
|
36151
36162
|
ft([
|
|
36152
36163
|
f()
|
|
36153
|
-
],
|
|
36164
|
+
], zl.prototype, "right");
|
|
36154
36165
|
ft([
|
|
36155
36166
|
f()
|
|
36156
|
-
],
|
|
36167
|
+
], zl.prototype, "top");
|
|
36157
36168
|
ft([
|
|
36158
36169
|
f()
|
|
36159
|
-
],
|
|
36170
|
+
], zl.prototype, "bottom");
|
|
36160
36171
|
class qi extends A {
|
|
36161
36172
|
_rectTransform = null;
|
|
36162
36173
|
get rectTransform() {
|
|
@@ -36215,7 +36226,7 @@ ft([
|
|
|
36215
36226
|
f()
|
|
36216
36227
|
], qi.prototype, "spacing");
|
|
36217
36228
|
ft([
|
|
36218
|
-
f(
|
|
36229
|
+
f(zl)
|
|
36219
36230
|
], qi.prototype, "padding");
|
|
36220
36231
|
ft([
|
|
36221
36232
|
f()
|
|
@@ -36479,7 +36490,7 @@ const Zm = x("debuguilayout"), gn = class y1 extends wp {
|
|
|
36479
36490
|
*_updateRenderSettingsDelayed() {
|
|
36480
36491
|
if (yield, this._updateRenderSettingsRoutine = void 0, this.shadowComponent) {
|
|
36481
36492
|
this.onUpdateRenderMode(), wf(this.shadowComponent, this);
|
|
36482
|
-
for (const e of k.getComponentsInChildren(this.gameObject,
|
|
36493
|
+
for (const e of k.getComponentsInChildren(this.gameObject, Un))
|
|
36483
36494
|
wf(e.shadowComponent, this);
|
|
36484
36495
|
}
|
|
36485
36496
|
}
|
|
@@ -36568,7 +36579,7 @@ class la extends A {
|
|
|
36568
36579
|
_buffer = [];
|
|
36569
36580
|
applyChangesNow() {
|
|
36570
36581
|
this._buffer.length = 0;
|
|
36571
|
-
for (const e of k.getComponentsInChildren(this.gameObject,
|
|
36582
|
+
for (const e of k.getComponentsInChildren(this.gameObject, Un, this._buffer)) {
|
|
36572
36583
|
const t = e;
|
|
36573
36584
|
t.setAlphaFactor && t.setAlphaFactor(this._alpha);
|
|
36574
36585
|
}
|
|
@@ -36604,7 +36615,7 @@ class _1 {
|
|
|
36604
36615
|
if (!k.isActiveInHierarchy(d)) {
|
|
36605
36616
|
const u = k.isActiveSelf(d);
|
|
36606
36617
|
k.setActive(d, !0);
|
|
36607
|
-
const p = k.getComponent(d,
|
|
36618
|
+
const p = k.getComponent(d, Un);
|
|
36608
36619
|
p && (p.onEnable(), l.push(() => {
|
|
36609
36620
|
p.onDisable();
|
|
36610
36621
|
}));
|
|
@@ -36908,7 +36919,7 @@ const ki = class Ar extends A {
|
|
|
36908
36919
|
}
|
|
36909
36920
|
jt && $e("Progressive Loading: " + n.length), await Promise.all(n), jt && $e("Progressive Loading: done"), fe.end("export-usdz-textures");
|
|
36910
36921
|
const r = bi.Global.Mask;
|
|
36911
|
-
bi.Global.Set(
|
|
36922
|
+
bi.Global.Set(Us.AR);
|
|
36912
36923
|
const a = new a2(), l = new db(this.quickLookCompatible);
|
|
36913
36924
|
let c;
|
|
36914
36925
|
const h = [];
|
|
@@ -36999,10 +37010,10 @@ const ki = class Ar extends A {
|
|
|
36999
37010
|
return this.customBranding && Object.assign(e, this.customBranding), Hs() || (console.log("Custom Quicklook banner text requires pro license: https://needle.tools/pricing"), e.callToAction = "Close", e.checkoutTitle = "🌵 Made with Needle", e.checkoutSubtitle = "_"), (e.callToAction?.length || e.checkoutTitle?.length || e.checkoutSubtitle?.length) && (e.callToAction?.length || (e.callToAction = "\0"), e.checkoutTitle?.length || (e.checkoutTitle = "\0"), e.checkoutSubtitle?.length || (e.checkoutSubtitle = "\0")), this.dispatchEvent(new CustomEvent("quicklook-overlay", { detail: e })), e;
|
|
37000
37011
|
}
|
|
37001
37012
|
static invertForwardMatrix = new Z().makeRotationY(Math.PI);
|
|
37002
|
-
static invertForwardQuaternion = new
|
|
37013
|
+
static invertForwardQuaternion = new U().setFromEuler(new Be(0, Math.PI, 0));
|
|
37003
37014
|
_rootSessionRootWasAppliedTo = null;
|
|
37004
37015
|
_rootPositionBeforeExport = new w();
|
|
37005
|
-
_rootRotationBeforeExport = new
|
|
37016
|
+
_rootRotationBeforeExport = new U();
|
|
37006
37017
|
_rootScaleBeforeExport = new w();
|
|
37007
37018
|
getARScaleAndTarget() {
|
|
37008
37019
|
if (!this.objectToExport) return { scale: 1, _invertForward: !1, target: this.gameObject, sessionRoot: null };
|
|
@@ -37304,8 +37315,8 @@ async function P1(s, e, t, i) {
|
|
|
37304
37315
|
}
|
|
37305
37316
|
async function k1(s, e, t) {
|
|
37306
37317
|
const i = await iD(s, { useExtension: !0 }) || "unknown";
|
|
37307
|
-
LF && console.debug(`Determined file type: '${i}' for url '${s}'`, { registeredModelLoaderCallbacks:
|
|
37308
|
-
for (const n of
|
|
37318
|
+
LF && console.debug(`Determined file type: '${i}' for url '${s}'`, { registeredModelLoaderCallbacks: zr });
|
|
37319
|
+
for (const n of zr) {
|
|
37309
37320
|
const { callback: o } = n, r = o({ context: e, url: s, mimetype: i });
|
|
37310
37321
|
if (r instanceof Promise && await r, r)
|
|
37311
37322
|
return console.debug(`Using custom loader (${n.name || "unnamed"}) for ${i} at '${s}'${DF ? `
|
|
@@ -37386,7 +37397,7 @@ async function wb(s, e, t, i, n) {
|
|
|
37386
37397
|
});
|
|
37387
37398
|
}
|
|
37388
37399
|
async function O1(s, e, t, i, n) {
|
|
37389
|
-
if (
|
|
37400
|
+
if (UF(e), e.split("?")[0].toLowerCase().endsWith(".json")) {
|
|
37390
37401
|
const a = await fetch(e).then((l) => l.ok ? l.text() : null).catch(() => null);
|
|
37391
37402
|
if (a !== null) {
|
|
37392
37403
|
const l = await P1(s, a, e, n);
|
|
@@ -37457,7 +37468,7 @@ async function hh(s, e, t, i, n, o) {
|
|
|
37457
37468
|
scenes: [a]
|
|
37458
37469
|
};
|
|
37459
37470
|
} else Array.isArray(i.scenes) === !1 && console.error(`[Needle Engine] The loaded model object does not have a scenes property '${t}' - please make sure the loader is registered correctly and three.js is not imported multiple times.`);
|
|
37460
|
-
return t.includes("?") && (t = t.split("?")[0]),
|
|
37471
|
+
return t.includes("?") && (t = t.split("?")[0]), zF(s, i), tR(i) && (BF(i), MD(t, i, e), await Ko().createBuiltinComponents(e, t, i, n, o || void 0)), i.scene && await jF(i.scene, e, e.mainCamera), i;
|
|
37461
37472
|
}
|
|
37462
37473
|
function BF(s) {
|
|
37463
37474
|
const e = s.parser;
|
|
@@ -37480,14 +37491,14 @@ async function jF(s, e, t) {
|
|
|
37480
37491
|
console.warn(i?.message || i);
|
|
37481
37492
|
}
|
|
37482
37493
|
}
|
|
37483
|
-
function
|
|
37494
|
+
function UF(s) {
|
|
37484
37495
|
if (new URL(s, window.location.href).href.startsWith("file://")) {
|
|
37485
37496
|
const t = `Hi - it looks like you are trying to load a local file which will not work. You need to use a webserver to serve your files.
|
|
37486
37497
|
Please refer to the documentation on <a href="https://fwd.needle.tools/needle-engine/docs/local-server">https://docs.needle.tools</a> or ask for help in our <a href="https://discord.needle.tools">discord community</a>`;
|
|
37487
37498
|
$e(t), console.warn(t);
|
|
37488
37499
|
}
|
|
37489
37500
|
}
|
|
37490
|
-
function
|
|
37501
|
+
function zF(s, e) {
|
|
37491
37502
|
if ("scenes" in e) {
|
|
37492
37503
|
for (const t of e.scenes)
|
|
37493
37504
|
if (t && !t.animations?.length)
|
|
@@ -38273,7 +38284,7 @@ class Vl extends A {
|
|
|
38273
38284
|
a.projectPoint(e, c), e.copy(c);
|
|
38274
38285
|
}
|
|
38275
38286
|
this.affectPosition && un(this.gameObject, e);
|
|
38276
|
-
const n = new Be(this.rotationOffset.x, this.rotationOffset.y, this.rotationOffset.z), o = new
|
|
38287
|
+
const n = new Be(this.rotationOffset.x, this.rotationOffset.y, this.rotationOffset.z), o = new U().setFromEuler(n);
|
|
38277
38288
|
this.affectRotation && ys(this.gameObject, t.multiply(o));
|
|
38278
38289
|
const r = new w();
|
|
38279
38290
|
this.from.getWorldDirection(r).multiplyScalar(50), this.levelLookDirection && (r.y = 0), this.alignLookDirection && this.gameObject.lookAt(r);
|
|
@@ -38971,7 +38982,7 @@ const pt = class Gc {
|
|
|
38971
38982
|
{
|
|
38972
38983
|
const l = a.index;
|
|
38973
38984
|
if (l) {
|
|
38974
|
-
const c = e.mesh_normal, h = l.getX(c * 3), d = l.getX(c * 3 + 1), u = l.getX(c * 3 + 2), p = a.getAttribute("position"), m =
|
|
38985
|
+
const c = e.mesh_normal, h = l.getX(c * 3), d = l.getX(c * 3 + 1), u = l.getX(c * 3 + 2), p = a.getAttribute("position"), m = z(), b = z(), y = z();
|
|
38975
38986
|
m.fromBufferAttribute(p, h), b.fromBufferAttribute(p, d), y.fromBufferAttribute(p, u), m.sub(b), y.sub(b), m.cross(y), this._dir.copy(m).multiplyScalar(-1);
|
|
38976
38987
|
const g = Ie(r);
|
|
38977
38988
|
this._dir.applyQuaternion(g);
|
|
@@ -38986,7 +38997,7 @@ const pt = class Gc {
|
|
|
38986
38997
|
}
|
|
38987
38998
|
return this._space === 1 && this._dir.applyQuaternion(this.system.worldQuaternion), this.applyRotation(this._dir), this._dir.normalize(), this.spherizeDirection(this._dir, this.sphericalDirectionAmount), this.randomizeDirection(this._dir, this.randomDirectionAmount), cu && (j.DrawSphere(t, 0.01, 8925952, 0.5, !0), j.DrawDirection(t, this._dir, 8925952, 0.5, !0)), this._dir;
|
|
38988
38999
|
}
|
|
38989
|
-
static _randomQuat = new
|
|
39000
|
+
static _randomQuat = new U();
|
|
38990
39001
|
static _tempVec = new w();
|
|
38991
39002
|
randomizePosition(e, t) {
|
|
38992
39003
|
if (t <= 0) return;
|
|
@@ -39784,7 +39795,7 @@ class D1 {
|
|
|
39784
39795
|
emitterType;
|
|
39785
39796
|
emitterProbability;
|
|
39786
39797
|
//private matrix_ = new Matrix4();
|
|
39787
|
-
q_ = new
|
|
39798
|
+
q_ = new U();
|
|
39788
39799
|
v_ = new w();
|
|
39789
39800
|
v2_ = new w();
|
|
39790
39801
|
_emitterMatrix = new Kp();
|
|
@@ -39876,14 +39887,14 @@ class Vn extends A {
|
|
|
39876
39887
|
const i = new Le();
|
|
39877
39888
|
i.copy(t), e ? this.trailMaterial = i : this.particleMaterial = i;
|
|
39878
39889
|
}
|
|
39879
|
-
t.map && (t.map.colorSpace = Ys, t.map.premultiplyAlpha = !1), e && t.side === Qo && (t = t.clone(), t.side =
|
|
39890
|
+
t.map && (t.map.colorSpace = Ys, t.map.premultiplyAlpha = !1), e && t.side === Qo && (t = t.clone(), t.side = Uf, e ? this.trailMaterial = t : this.particleMaterial = t);
|
|
39880
39891
|
}
|
|
39881
39892
|
return t && !sB && t._didRequestTextureLOD === void 0 && (t._didRequestTextureLOD = 0, oB && console.log("Load material LOD", t.name), qe.assignTextureLOD(t, 0)), t;
|
|
39882
39893
|
}
|
|
39883
39894
|
getMesh(e) {
|
|
39884
39895
|
let t = null;
|
|
39885
39896
|
if (!t && (this.particleMesh instanceof V && (t = this.particleMesh.geometry), t === null)) {
|
|
39886
|
-
t = new
|
|
39897
|
+
t = new zn(1, 1);
|
|
39887
39898
|
const n = t.attributes.uv;
|
|
39888
39899
|
for (let o = 0; o < n.count; o++)
|
|
39889
39900
|
n.setX(o, 1 - n.getX(o));
|
|
@@ -39895,10 +39906,10 @@ Qe([
|
|
|
39895
39906
|
f()
|
|
39896
39907
|
], Vn.prototype, "renderMode");
|
|
39897
39908
|
Qe([
|
|
39898
|
-
f(
|
|
39909
|
+
f(Pe)
|
|
39899
39910
|
], Vn.prototype, "particleMaterial");
|
|
39900
39911
|
Qe([
|
|
39901
|
-
f(
|
|
39912
|
+
f(Pe)
|
|
39902
39913
|
], Vn.prototype, "trailMaterial");
|
|
39903
39914
|
Qe([
|
|
39904
39915
|
f()
|
|
@@ -40053,7 +40064,7 @@ class uB extends ma {
|
|
|
40053
40064
|
this.system.sizeOverLifetime.enabled && (n *= this.system.sizeOverLifetime.evaluate(i, void 0, e[Aw]).x);
|
|
40054
40065
|
let o = 1;
|
|
40055
40066
|
this.system.renderer.renderMode !== Fs.Mesh && (o = this.system.worldScale.x / this.system.cameraScale);
|
|
40056
|
-
const r =
|
|
40067
|
+
const r = z(e.startSize).multiplyScalar(n * o);
|
|
40057
40068
|
if (e.size.set(r.x, r.y, r.z), this.system.localspace) {
|
|
40058
40069
|
const a = F1(this.system, dB);
|
|
40059
40070
|
e.size.x *= a.x, e.size.y *= a.y, e.size.z *= a.z;
|
|
@@ -40360,11 +40371,11 @@ const ei = class ju extends A {
|
|
|
40360
40371
|
get localspace() {
|
|
40361
40372
|
return this.main.simulationSpace === Ah.Local;
|
|
40362
40373
|
}
|
|
40363
|
-
__worldQuaternion = new
|
|
40374
|
+
__worldQuaternion = new U();
|
|
40364
40375
|
get worldQuaternion() {
|
|
40365
40376
|
return this.__worldQuaternion;
|
|
40366
40377
|
}
|
|
40367
|
-
_worldQuaternionInverted = new
|
|
40378
|
+
_worldQuaternionInverted = new U();
|
|
40368
40379
|
get worldQuaternionInverted() {
|
|
40369
40380
|
return this._worldQuaternionInverted;
|
|
40370
40381
|
}
|
|
@@ -40455,8 +40466,8 @@ const ei = class ju extends A {
|
|
|
40455
40466
|
set subEmitterSystems(e) {
|
|
40456
40467
|
for (let t = 0; t < e.length; t++) {
|
|
40457
40468
|
const i = e[t];
|
|
40458
|
-
if (!(i instanceof
|
|
40459
|
-
const n = new
|
|
40469
|
+
if (!(i instanceof Uy)) {
|
|
40470
|
+
const n = new Uy();
|
|
40460
40471
|
wl(n, i), e[t] = n;
|
|
40461
40472
|
}
|
|
40462
40473
|
}
|
|
@@ -40602,7 +40613,7 @@ Qe([
|
|
|
40602
40613
|
f(Qi)
|
|
40603
40614
|
], ei.prototype, "sizeBySpeed");
|
|
40604
40615
|
let Ef = ei;
|
|
40605
|
-
class
|
|
40616
|
+
class Uy {
|
|
40606
40617
|
particleSystem;
|
|
40607
40618
|
emitProbability = 1;
|
|
40608
40619
|
properties;
|
|
@@ -40792,12 +40803,12 @@ var wB = Object.defineProperty, xB = (s, e, t, i) => {
|
|
|
40792
40803
|
(r = s[o]) && (n = r(e, t, n) || n);
|
|
40793
40804
|
return n && wB(e, t, n), n;
|
|
40794
40805
|
};
|
|
40795
|
-
const SB = x("debugpost"),
|
|
40806
|
+
const SB = x("debugpost"), zy = {};
|
|
40796
40807
|
function Gn(s, e) {
|
|
40797
|
-
|
|
40808
|
+
zy[s] = e;
|
|
40798
40809
|
}
|
|
40799
40810
|
function CB(s) {
|
|
40800
|
-
return s.__type in
|
|
40811
|
+
return s.__type in zy ? zy[s.__type] : (SB && s.__type && console.warn("Unknown postprocessing type", s.__type, s), St);
|
|
40801
40812
|
}
|
|
40802
40813
|
class Ab {
|
|
40803
40814
|
components = [];
|
|
@@ -40970,7 +40981,7 @@ function AB(s) {
|
|
|
40970
40981
|
return 0;
|
|
40971
40982
|
}
|
|
40972
40983
|
}
|
|
40973
|
-
function
|
|
40984
|
+
function Uu(s) {
|
|
40974
40985
|
switch (s) {
|
|
40975
40986
|
case t_:
|
|
40976
40987
|
return L.POSTPROCESSING.MODULE.ToneMappingMode.LINEAR;
|
|
@@ -41022,14 +41033,14 @@ class Xl extends St {
|
|
|
41022
41033
|
}
|
|
41023
41034
|
this._tonemappingEffect?.dispose();
|
|
41024
41035
|
const e = rg(this.mode.value), t = this._tonemappingEffect = new L.POSTPROCESSING.MODULE.ToneMappingEffect({
|
|
41025
|
-
mode:
|
|
41036
|
+
mode: Uu(e)
|
|
41026
41037
|
});
|
|
41027
41038
|
return this.mode.onValueChanged = (i) => {
|
|
41028
41039
|
if (typeof i == "string")
|
|
41029
|
-
i = pS(i), t.mode =
|
|
41040
|
+
i = pS(i), t.mode = Uu(i);
|
|
41030
41041
|
else {
|
|
41031
41042
|
const n = rg(i);
|
|
41032
|
-
t.mode =
|
|
41043
|
+
t.mode = Uu(n);
|
|
41033
41044
|
}
|
|
41034
41045
|
t.name = "ToneMapping (" + Hc[i] + ")", ag && console.log("[PostProcessing] ToneMapping mode changed to", Hc[i], e, t.mode);
|
|
41035
41046
|
}, ag && console.log("[PostProcessing] Use ToneMapping", Hc[this.mode.value], e, t.mode, "renderer.tonemapping: " + this.context.renderer.toneMapping), t;
|
|
@@ -41179,7 +41190,7 @@ class Mf extends St {
|
|
|
41179
41190
|
return this.effect;
|
|
41180
41191
|
}
|
|
41181
41192
|
}
|
|
41182
|
-
var jB = Object.defineProperty,
|
|
41193
|
+
var jB = Object.defineProperty, UB = (s, e, t, i) => {
|
|
41183
41194
|
for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
|
|
41184
41195
|
(r = s[o]) && (n = r(e, t, n) || n);
|
|
41185
41196
|
return n && jB(e, t, n), n;
|
|
@@ -41207,14 +41218,14 @@ class Lp extends St {
|
|
|
41207
41218
|
e !== this._lastDpr && (this._lastDpr = e, this._effect.granularity = this.granularity.value * e, Bw && console.debug(`[PixelationEffect] DPR changed to ${e}, updating granularity: raw=${this.granularity.value}, effective=${this._effect.granularity}`));
|
|
41208
41219
|
}
|
|
41209
41220
|
}
|
|
41210
|
-
|
|
41221
|
+
UB([
|
|
41211
41222
|
f(W)
|
|
41212
41223
|
], Lp.prototype, "granularity");
|
|
41213
41224
|
Gn("PixelationEffect", Lp);
|
|
41214
|
-
var
|
|
41225
|
+
var zB = Object.defineProperty, cd = (s, e, t, i) => {
|
|
41215
41226
|
for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
|
|
41216
41227
|
(r = s[o]) && (n = r(e, t, n) || n);
|
|
41217
|
-
return n &&
|
|
41228
|
+
return n && zB(e, t, n), n;
|
|
41218
41229
|
};
|
|
41219
41230
|
class ur extends St {
|
|
41220
41231
|
get typeName() {
|
|
@@ -41396,7 +41407,7 @@ function WB(s) {
|
|
|
41396
41407
|
return i === Number.NEGATIVE_INFINITY ? (fu && console.warn("Unknown effect found: ", e.constructor.name, e), 1) : n === Number.NEGATIVE_INFINITY ? (fu && console.warn("Unknown effect found: ", t.constructor.name, t), -1) : i - n;
|
|
41397
41408
|
}), fu === "verbose" && console.debug("After ordering effects", [...s]);
|
|
41398
41409
|
}
|
|
41399
|
-
var VB = Object.defineProperty, GB = Object.getOwnPropertyDescriptor,
|
|
41410
|
+
var VB = Object.defineProperty, GB = Object.getOwnPropertyDescriptor, U1 = (s, e, t, i) => {
|
|
41400
41411
|
for (var n = GB(e, t), o = s.length - 1, r; o >= 0; o--)
|
|
41401
41412
|
(r = s[o]) && (n = r(e, t, n) || n);
|
|
41402
41413
|
return n && VB(e, t, n), n;
|
|
@@ -41435,10 +41446,10 @@ class Dp extends St {
|
|
|
41435
41446
|
// return this.effect.uniforms.get("threshold")!.value;
|
|
41436
41447
|
// }
|
|
41437
41448
|
}
|
|
41438
|
-
|
|
41449
|
+
U1([
|
|
41439
41450
|
f()
|
|
41440
41451
|
], Dp.prototype, "amount");
|
|
41441
|
-
|
|
41452
|
+
U1([
|
|
41442
41453
|
f()
|
|
41443
41454
|
], Dp.prototype, "radius");
|
|
41444
41455
|
function HB() {
|
|
@@ -41589,7 +41600,7 @@ Db([
|
|
|
41589
41600
|
f(W)
|
|
41590
41601
|
], Yl.prototype, "center");
|
|
41591
41602
|
Gn("Vignette", Yl);
|
|
41592
|
-
var QB = Object.defineProperty,
|
|
41603
|
+
var QB = Object.defineProperty, z1 = (s, e, t, i) => {
|
|
41593
41604
|
for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
|
|
41594
41605
|
(r = s[o]) && (n = r(e, t, n) || n);
|
|
41595
41606
|
return n && QB(e, t, n), n;
|
|
@@ -41741,10 +41752,10 @@ class Fp extends A {
|
|
|
41741
41752
|
}, 200);
|
|
41742
41753
|
}
|
|
41743
41754
|
}
|
|
41744
|
-
|
|
41755
|
+
z1([
|
|
41745
41756
|
dt(Ab)
|
|
41746
41757
|
], Fp.prototype, "sharedProfile");
|
|
41747
|
-
|
|
41758
|
+
z1([
|
|
41748
41759
|
dt()
|
|
41749
41760
|
], Fp.prototype, "multisampling");
|
|
41750
41761
|
const pu = /* @__PURE__ */ new Map(), He = x("debugnetworkingstreams");
|
|
@@ -42584,7 +42595,7 @@ class o3 {
|
|
|
42584
42595
|
const e = this._videos[this._videos.length - 1];
|
|
42585
42596
|
if (!e) return;
|
|
42586
42597
|
if (this._isInScreenspaceMode = !0, !this._screenspaceModeQuad) {
|
|
42587
|
-
if (this._screenspaceModeQuad = ha.createPrimitive(
|
|
42598
|
+
if (this._screenspaceModeQuad = ha.createPrimitive(Uh.Quad, {
|
|
42588
42599
|
material: new a3(e)
|
|
42589
42600
|
}), !this._screenspaceModeQuad) return;
|
|
42590
42601
|
this._screenspaceModeQuad.geometry.scale(2, 2, 2);
|
|
@@ -42748,7 +42759,7 @@ var l3 = Object.defineProperty, c3 = Object.getOwnPropertyDescriptor, hd = (s, e
|
|
|
42748
42759
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
42749
42760
|
return i && n && l3(e, t, n), n;
|
|
42750
42761
|
};
|
|
42751
|
-
const
|
|
42762
|
+
const Ut = x("debugscreensharing");
|
|
42752
42763
|
var G1 = /* @__PURE__ */ ((s) => (s[s.Screen = 0] = "Screen", s[s.Camera = 1] = "Camera", s[s.Canvas = 2] = "Canvas", s[s.Microphone = 3] = "Microphone", s))(G1 || {});
|
|
42753
42764
|
class ba extends A {
|
|
42754
42765
|
allowStartOnClick = !0;
|
|
@@ -42836,7 +42847,7 @@ class ba extends A {
|
|
|
42836
42847
|
_currentMode = 0;
|
|
42837
42848
|
/** @internal */
|
|
42838
42849
|
awake() {
|
|
42839
|
-
typeof this.device == "number" && (this.device = G1[this.device]),
|
|
42850
|
+
typeof this.device == "number" && (this.device = G1[this.device]), Ut && console.log("Screensharing", this.name, this), fn.registerWaitForAllowAudio(() => {
|
|
42840
42851
|
this._videoPlayer && this._currentStream && this._currentMode === 2 && (this._videoPlayer.playInBackground = !0, this._videoPlayer.setVideo(this._currentStream));
|
|
42841
42852
|
}), this._net = new Bp(this);
|
|
42842
42853
|
}
|
|
@@ -42934,17 +42945,17 @@ class ba extends A {
|
|
|
42934
42945
|
}
|
|
42935
42946
|
}
|
|
42936
42947
|
close() {
|
|
42937
|
-
this._requestOpen = !1, this._currentStream && (
|
|
42948
|
+
this._requestOpen = !1, this._currentStream && (Ut && console.warn("Close current stream / disposing resources, stream was active?", this._currentStream.active), this._net?.stopSendingStream(this._currentStream), Rn(this._currentStream), this._currentMode = 0, this._currentStream = null);
|
|
42938
42949
|
}
|
|
42939
42950
|
setStream(e, t) {
|
|
42940
42951
|
if (e === this._currentStream || (this.close(), !e)) return;
|
|
42941
42952
|
this._currentStream = e, this._requestOpen = !0, this._currentMode = t;
|
|
42942
42953
|
const i = this.device !== "Microphone", n = t === 1;
|
|
42943
|
-
i ? (this._videoPlayer || this._ensureVideoPlayer(), this._videoPlayer ? this._videoPlayer.setVideo(e) : console.error("No video player assigned for video stream")) : (this._audioSource || (this._audioSource = new fn(), this._audioSource.spatialBlend = 0, this._audioSource.volume = 1, this.gameObject.addComponent(this._audioSource)), n || (
|
|
42954
|
+
i ? (this._videoPlayer || this._ensureVideoPlayer(), this._videoPlayer ? this._videoPlayer.setVideo(e) : console.error("No video player assigned for video stream")) : (this._audioSource || (this._audioSource = new fn(), this._audioSource.spatialBlend = 0, this._audioSource.volume = 1, this.gameObject.addComponent(this._audioSource)), n || (Ut && console.log("PLAY", e.getAudioTracks()), this._audioSource.volume = 1, this._audioSource?.play(e))), n && this._net?.startSendingStream(e), n && (this._videoPlayer && (this._videoPlayer.muted = !0), this._audioSource?.stop());
|
|
42944
42955
|
for (const o of e.getTracks())
|
|
42945
42956
|
o.addEventListener("ended", () => {
|
|
42946
|
-
|
|
42947
|
-
}),
|
|
42957
|
+
Ut && console.log("Track ended", o), this.close();
|
|
42958
|
+
}), Ut && o.kind === "video" && console.log(n ? "Video →" : "Video ←", o.getSettings());
|
|
42948
42959
|
}
|
|
42949
42960
|
onReceiveStream = (e) => {
|
|
42950
42961
|
e.stream?.active === !0 && this.setStream(
|
|
@@ -42954,44 +42965,44 @@ class ba extends A {
|
|
|
42954
42965
|
);
|
|
42955
42966
|
};
|
|
42956
42967
|
onCallEnded = (e) => {
|
|
42957
|
-
|
|
42968
|
+
Ut && console.log("CALL ENDED", this.isReceiving, this?.screenspace), this.isReceiving && (this.screenspace = !1);
|
|
42958
42969
|
};
|
|
42959
42970
|
async tryShareUserCamera(e, t) {
|
|
42960
42971
|
const i = (await navigator.mediaDevices.enumerateDevices()).filter((o) => o.kind === "videoinput");
|
|
42961
|
-
|
|
42972
|
+
Ut && console.log(`Request camera. These are your kind:videoinput devices:
|
|
42962
42973
|
`, i);
|
|
42963
42974
|
let n = !1;
|
|
42964
42975
|
for (const o of i)
|
|
42965
42976
|
try {
|
|
42966
42977
|
if (!this._requestOpen) {
|
|
42967
|
-
|
|
42978
|
+
Ut && console.log("Camera selection cancelled");
|
|
42968
42979
|
break;
|
|
42969
42980
|
}
|
|
42970
42981
|
if (o.kind !== "videoinput") {
|
|
42971
|
-
|
|
42982
|
+
Ut && console.log("Skipping non-video device", o);
|
|
42972
42983
|
continue;
|
|
42973
42984
|
}
|
|
42974
42985
|
const r = o.deviceId;
|
|
42975
42986
|
if (t?.deviceId != null || t?.deviceFilter != null) {
|
|
42976
42987
|
if (t?.deviceId !== void 0 && r !== t.deviceId) {
|
|
42977
|
-
|
|
42988
|
+
Ut && console.log("Skipping device due to options.deviceId: " + o.label + "; " + o.deviceId);
|
|
42978
42989
|
continue;
|
|
42979
42990
|
}
|
|
42980
42991
|
if (t?.deviceFilter && t.deviceFilter(o) === !1) {
|
|
42981
|
-
|
|
42992
|
+
Ut && console.log("Skipping device due to options.deviceFilter: " + o.label + "; " + o.deviceId);
|
|
42982
42993
|
continue;
|
|
42983
42994
|
}
|
|
42984
42995
|
} else if (this.deviceFilter)
|
|
42985
42996
|
if (this.deviceFilter(o) === !1) {
|
|
42986
|
-
|
|
42997
|
+
Ut && console.log("Skipping device due to ScreenShare.deviceFilter: " + o.label + "; " + o.deviceId);
|
|
42987
42998
|
continue;
|
|
42988
|
-
} else
|
|
42999
|
+
} else Ut && console.log("Selected device by filter", o);
|
|
42989
43000
|
else if (this.deviceName) {
|
|
42990
43001
|
const c = o.label.toLowerCase(), h = this.deviceName.toLowerCase(), d = c.includes(h), u = o.deviceId === this.deviceName;
|
|
42991
43002
|
if (!d && !u) {
|
|
42992
|
-
|
|
43003
|
+
Ut && console.log("Skipping device due to ScreenShare.deviceName: " + o.label + "; " + o.deviceId);
|
|
42993
43004
|
continue;
|
|
42994
|
-
} else
|
|
43005
|
+
} else Ut && console.log("Selected device by name", o);
|
|
42995
43006
|
}
|
|
42996
43007
|
e.video !== !1 && ((typeof e.video > "u" || typeof e.video == "boolean") && (e.video = {}), e.video.deviceId = r), n = !0;
|
|
42997
43008
|
const l = await navigator.mediaDevices.getUserMedia(e).catch((c) => (console.error("Failed to get user media", c), null));
|
|
@@ -43001,7 +43012,7 @@ class ba extends A {
|
|
|
43001
43012
|
l,
|
|
43002
43013
|
1
|
|
43003
43014
|
/* Sending */
|
|
43004
|
-
),
|
|
43015
|
+
), Ut && console.log("Selected camera", o)) : (Rn(l), Ut && console.log("Camera selection cancelled"));
|
|
43005
43016
|
break;
|
|
43006
43017
|
} catch (r) {
|
|
43007
43018
|
if (r.message === "Failed to allocate videosource" || r.message === "Could not start video source") {
|
|
@@ -43106,14 +43117,14 @@ const va = class H1 extends A {
|
|
|
43106
43117
|
const t = this._referencePointDir.dot(this.context.mainCamera.worldForward) > 0.2;
|
|
43107
43118
|
if (d3 && this.referencePoint) {
|
|
43108
43119
|
const i = this.gameObject.worldPosition;
|
|
43109
|
-
j.DrawArrow(
|
|
43120
|
+
j.DrawArrow(z(i), i.sub(this._referencePointDir), t ? 16711680 : 65280), j.DrawWireSphere(this.referencePoint.worldPosition, 0.05, 255);
|
|
43110
43121
|
}
|
|
43111
43122
|
t ? this.updateAlpha(this.minAlpha, this.fadeDuration) : this.updateAlpha(1, this.fadeDuration);
|
|
43112
43123
|
}
|
|
43113
43124
|
// private readonly rendererMaterials = new WeakMap<Renderer, Array<MaterialWithState>>();
|
|
43114
43125
|
// private readonly rendererMaterialsOriginal = new WeakMap<Renderer, Array<Material>>();
|
|
43115
43126
|
updateDirection() {
|
|
43116
|
-
this.referencePoint ??= this.context.scene, this._referencePointVector.copy(this.gameObject.worldPosition.sub(this.referencePoint.worldPosition)), this._distance = this._referencePointVector.length(), this._referencePointDir.copy(this._referencePointVector).multiply(
|
|
43127
|
+
this.referencePoint ??= this.context.scene, this._referencePointVector.copy(this.gameObject.worldPosition.sub(this.referencePoint.worldPosition)), this._distance = this._referencePointVector.length(), this._referencePointDir.copy(this._referencePointVector).multiply(z(1, 0.5, 1)).normalize();
|
|
43117
43128
|
}
|
|
43118
43129
|
/**
|
|
43119
43130
|
* Update the alpha of the object's materials towards the target alpha over the given duration.
|
|
@@ -43179,7 +43190,7 @@ class jp extends A {
|
|
|
43179
43190
|
if (this.gameObject instanceof V)
|
|
43180
43191
|
this.gameObject instanceof V && this.gameObject.material && (this.gameObject.material = this.gameObject.material.clone(), this.targetMesh = this.gameObject, this.targetMesh.receiveShadow = !0);
|
|
43181
43192
|
else {
|
|
43182
|
-
const e = ha.createPrimitive(
|
|
43193
|
+
const e = ha.createPrimitive(Uh.Quad, {
|
|
43183
43194
|
name: "ShadowCatcher",
|
|
43184
43195
|
material: new Tt({
|
|
43185
43196
|
// HACK heuristic to get approx. the same colors out as with the current default ShadowCatcher material
|
|
@@ -43266,7 +43277,7 @@ X1([
|
|
|
43266
43277
|
X1([
|
|
43267
43278
|
f(he)
|
|
43268
43279
|
], jp.prototype, "shadowColor");
|
|
43269
|
-
var p3 = Object.defineProperty,
|
|
43280
|
+
var p3 = Object.defineProperty, Up = (s, e, t, i) => {
|
|
43270
43281
|
for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
|
|
43271
43282
|
(r = s[o]) && (n = r(e, t, n) || n);
|
|
43272
43283
|
return n && p3(e, t, n), n;
|
|
@@ -43278,7 +43289,7 @@ const dd = class Q1 extends A {
|
|
|
43278
43289
|
positionAxes = Dc.All;
|
|
43279
43290
|
/** When true, rotates 180° around Y axis (useful for mirrored setups) */
|
|
43280
43291
|
flipForward = !1;
|
|
43281
|
-
static _invertForward = new
|
|
43292
|
+
static _invertForward = new U().setFromAxisAngle(new w(0, 1, 0), Math.PI);
|
|
43282
43293
|
_firstUpdate = !0;
|
|
43283
43294
|
/**
|
|
43284
43295
|
* Update the position and rotation of the GameObject to follow the target.
|
|
@@ -43306,16 +43317,16 @@ const dd = class Q1 extends A {
|
|
|
43306
43317
|
}
|
|
43307
43318
|
}
|
|
43308
43319
|
};
|
|
43309
|
-
|
|
43320
|
+
Up([
|
|
43310
43321
|
f(E)
|
|
43311
43322
|
], dd.prototype, "target");
|
|
43312
|
-
|
|
43323
|
+
Up([
|
|
43313
43324
|
f()
|
|
43314
43325
|
], dd.prototype, "followFactor");
|
|
43315
|
-
|
|
43326
|
+
Up([
|
|
43316
43327
|
f()
|
|
43317
43328
|
], dd.prototype, "rotateFactor");
|
|
43318
|
-
|
|
43329
|
+
Up([
|
|
43319
43330
|
f()
|
|
43320
43331
|
], dd.prototype, "positionAxes");
|
|
43321
43332
|
let Fb = dd;
|
|
@@ -43324,9 +43335,9 @@ var m3 = Object.defineProperty, ud = (s, e, t, i) => {
|
|
|
43324
43335
|
(r = s[o]) && (n = r(e, t, n) || n);
|
|
43325
43336
|
return n && m3(e, t, n), n;
|
|
43326
43337
|
};
|
|
43327
|
-
const uh = x("debugspatialtrigger"),
|
|
43338
|
+
const uh = x("debugspatialtrigger"), Uw = new Xo(), zw = new Xo();
|
|
43328
43339
|
function g3(s, e) {
|
|
43329
|
-
return
|
|
43340
|
+
return Uw.mask = s, zw.mask = e, Uw.test(zw);
|
|
43330
43341
|
}
|
|
43331
43342
|
class Qs extends A {
|
|
43332
43343
|
triggerMask = 0;
|
|
@@ -43395,7 +43406,7 @@ ud([
|
|
|
43395
43406
|
ud([
|
|
43396
43407
|
f(ne)
|
|
43397
43408
|
], Qs.prototype, "onExit");
|
|
43398
|
-
const Y1 = class
|
|
43409
|
+
const Y1 = class zu extends A {
|
|
43399
43410
|
/** Global registry of all active spatial triggers in the scene */
|
|
43400
43411
|
static triggers = [];
|
|
43401
43412
|
triggerMask;
|
|
@@ -43411,13 +43422,13 @@ const Y1 = class Uu extends A {
|
|
|
43411
43422
|
* Registers this trigger in the global registry and sets up debug visualization if enabled
|
|
43412
43423
|
*/
|
|
43413
43424
|
onEnable() {
|
|
43414
|
-
|
|
43425
|
+
zu.triggers.push(this), this.boxHelper || (this.boxHelper = k.addComponent(this.gameObject, Qt), this.boxHelper?.showHelper(null, uh));
|
|
43415
43426
|
}
|
|
43416
43427
|
/**
|
|
43417
43428
|
* Removes this trigger from the global registry when disabled
|
|
43418
43429
|
*/
|
|
43419
43430
|
onDisable() {
|
|
43420
|
-
|
|
43431
|
+
zu.triggers.splice(zu.triggers.indexOf(this), 1);
|
|
43421
43432
|
}
|
|
43422
43433
|
/**
|
|
43423
43434
|
* Tests if an object is inside this trigger's box
|
|
@@ -43632,8 +43643,8 @@ class jb extends A {
|
|
|
43632
43643
|
const e = this._mode === 0;
|
|
43633
43644
|
for (const t of bt.instances)
|
|
43634
43645
|
if (t.avatar && "isLocalAvatar" in t.avatar && "flags" in t.avatar) {
|
|
43635
|
-
let i =
|
|
43636
|
-
this.isSpectatingSelf && (i = e && t.avatar.isLocalAvatar ?
|
|
43646
|
+
let i = Us.All;
|
|
43647
|
+
this.isSpectatingSelf && (i = e && t.avatar.isLocalAvatar ? Us.FirstPerson : Us.ThirdPerson);
|
|
43637
43648
|
const n = t.avatar.flags;
|
|
43638
43649
|
if (!n) continue;
|
|
43639
43650
|
for (const o of n)
|
|
@@ -43649,7 +43660,7 @@ class jb extends A {
|
|
|
43649
43660
|
const t = e.avatar.flags;
|
|
43650
43661
|
if (!t) continue;
|
|
43651
43662
|
for (const i of t)
|
|
43652
|
-
"isLocalAvatar" in e.avatar && e.avatar?.isLocalAvatar ? i.UpdateVisible(
|
|
43663
|
+
"isLocalAvatar" in e.avatar && e.avatar?.isLocalAvatar ? i.UpdateVisible(Us.FirstPerson) : i.UpdateVisible(Us.ThirdPerson);
|
|
43653
43664
|
}
|
|
43654
43665
|
}
|
|
43655
43666
|
}
|
|
@@ -43720,7 +43731,7 @@ class b3 {
|
|
|
43720
43731
|
}
|
|
43721
43732
|
}
|
|
43722
43733
|
}
|
|
43723
|
-
const v3 = new
|
|
43734
|
+
const v3 = new U().setFromAxisAngle(new w(0, 1, 0), Math.PI);
|
|
43724
43735
|
class w3 {
|
|
43725
43736
|
context;
|
|
43726
43737
|
spectator;
|
|
@@ -43889,7 +43900,7 @@ var P3 = Object.defineProperty, k3 = Object.getOwnPropertyDescriptor, Zl = (s, e
|
|
|
43889
43900
|
const Nw = x("debugsplines");
|
|
43890
43901
|
class eo {
|
|
43891
43902
|
position = new w();
|
|
43892
|
-
rotation = new
|
|
43903
|
+
rotation = new U();
|
|
43893
43904
|
tangentIn = new w();
|
|
43894
43905
|
tangentOut = new w();
|
|
43895
43906
|
}
|
|
@@ -43897,7 +43908,7 @@ Zl([
|
|
|
43897
43908
|
dt(w)
|
|
43898
43909
|
], eo.prototype, "position", 2);
|
|
43899
43910
|
Zl([
|
|
43900
|
-
dt(
|
|
43911
|
+
dt(U)
|
|
43901
43912
|
], eo.prototype, "rotation", 2);
|
|
43902
43913
|
Zl([
|
|
43903
43914
|
dt(w)
|
|
@@ -44582,7 +44593,7 @@ C) Set "joinRandomRoom" to true`), !1) : (mu && console.log("Join " + this.roomN
|
|
|
44582
44593
|
return null;
|
|
44583
44594
|
}
|
|
44584
44595
|
setRandomRoomUrlParameter() {
|
|
44585
|
-
const e =
|
|
44596
|
+
const e = zf(), t = this.generateRoomName();
|
|
44586
44597
|
x(this.urlParameterName) ? e.set(this.urlParameterName, t) : e.append(this.urlParameterName, t), Px(t, e);
|
|
44587
44598
|
}
|
|
44588
44599
|
generateRoomName() {
|
|
@@ -44932,11 +44943,11 @@ ec([
|
|
|
44932
44943
|
ec([
|
|
44933
44944
|
f(ne)
|
|
44934
44945
|
], mr.prototype, "onSpeakingChanged", 2);
|
|
44935
|
-
function
|
|
44946
|
+
function U3() {
|
|
44936
44947
|
const s = x("testwindowcount") || 0;
|
|
44937
|
-
s && s > 0 &&
|
|
44948
|
+
s && s > 0 && z3(s);
|
|
44938
44949
|
}
|
|
44939
|
-
function
|
|
44950
|
+
function z3(s) {
|
|
44940
44951
|
if (x("testwindow")) return null;
|
|
44941
44952
|
const e = new URL(window.location.href);
|
|
44942
44953
|
av(e.searchParams, B3, 1), av(e.searchParams, "testwindow", 1);
|
|
@@ -44969,7 +44980,7 @@ function U3(s) {
|
|
|
44969
44980
|
}
|
|
44970
44981
|
class J1 extends A {
|
|
44971
44982
|
awake() {
|
|
44972
|
-
|
|
44983
|
+
U3();
|
|
44973
44984
|
}
|
|
44974
44985
|
}
|
|
44975
44986
|
class eP extends A {
|
|
@@ -45032,7 +45043,7 @@ class N3 {
|
|
|
45032
45043
|
}
|
|
45033
45044
|
}
|
|
45034
45045
|
}
|
|
45035
|
-
var $3 = Object.defineProperty,
|
|
45046
|
+
var $3 = Object.defineProperty, zp = (s, e, t, i) => {
|
|
45036
45047
|
for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
|
|
45037
45048
|
(r = s[o]) && (n = r(e, t, n) || n);
|
|
45038
45049
|
return n && $3(e, t, n), n;
|
|
@@ -45158,16 +45169,16 @@ class tc extends A {
|
|
|
45158
45169
|
this.enabled && e.keyCode === 16 && this.disableSnapping();
|
|
45159
45170
|
};
|
|
45160
45171
|
}
|
|
45161
|
-
|
|
45172
|
+
zp([
|
|
45162
45173
|
f()
|
|
45163
45174
|
], tc.prototype, "isGizmo");
|
|
45164
|
-
|
|
45175
|
+
zp([
|
|
45165
45176
|
f()
|
|
45166
45177
|
], tc.prototype, "translationSnap");
|
|
45167
|
-
|
|
45178
|
+
zp([
|
|
45168
45179
|
f()
|
|
45169
45180
|
], tc.prototype, "rotationSnapAngle");
|
|
45170
|
-
|
|
45181
|
+
zp([
|
|
45171
45182
|
f()
|
|
45172
45183
|
], tc.prototype, "scaleSnap");
|
|
45173
45184
|
var W3 = Object.defineProperty, V3 = Object.getOwnPropertyDescriptor, Np = (s, e, t, i) => {
|
|
@@ -45175,16 +45186,16 @@ var W3 = Object.defineProperty, V3 = Object.getOwnPropertyDescriptor, Np = (s, e
|
|
|
45175
45186
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
45176
45187
|
return i && n && W3(e, t, n), n;
|
|
45177
45188
|
};
|
|
45178
|
-
class
|
|
45189
|
+
class Ub {
|
|
45179
45190
|
texture = null;
|
|
45180
45191
|
rect;
|
|
45181
45192
|
}
|
|
45182
45193
|
Np([
|
|
45183
45194
|
f(ke)
|
|
45184
|
-
],
|
|
45195
|
+
], Ub.prototype, "texture", 2);
|
|
45185
45196
|
let fd = class extends Sp {
|
|
45186
45197
|
set image(e) {
|
|
45187
|
-
this.sprite || (this.sprite = new
|
|
45198
|
+
this.sprite || (this.sprite = new Ub()), this.sprite.texture = e, this.onAfterCreated();
|
|
45188
45199
|
}
|
|
45189
45200
|
get image() {
|
|
45190
45201
|
return this.sprite ? this.sprite.texture : null;
|
|
@@ -45217,12 +45228,12 @@ let fd = class extends Sp {
|
|
|
45217
45228
|
}
|
|
45218
45229
|
};
|
|
45219
45230
|
Np([
|
|
45220
|
-
f(
|
|
45231
|
+
f(Ub)
|
|
45221
45232
|
], fd.prototype, "sprite", 1);
|
|
45222
45233
|
Np([
|
|
45223
45234
|
f()
|
|
45224
45235
|
], fd.prototype, "pixelsPerUnitMultiplier", 2);
|
|
45225
|
-
class
|
|
45236
|
+
class zb extends Sp {
|
|
45226
45237
|
get mainTexture() {
|
|
45227
45238
|
return this._mainTexture;
|
|
45228
45239
|
}
|
|
@@ -45236,7 +45247,7 @@ class Ub extends Sp {
|
|
|
45236
45247
|
}
|
|
45237
45248
|
Np([
|
|
45238
45249
|
f(ke)
|
|
45239
|
-
],
|
|
45250
|
+
], zb.prototype, "mainTexture", 1);
|
|
45240
45251
|
var G3 = Object.defineProperty, H3 = Object.getOwnPropertyDescriptor, Ki = (s, e, t, i) => {
|
|
45241
45252
|
for (var n = i > 1 ? void 0 : i ? H3(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
45242
45253
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
@@ -45631,7 +45642,7 @@ const md = class nP extends A {
|
|
|
45631
45642
|
invertForward = !1;
|
|
45632
45643
|
keepUpDirection = !0;
|
|
45633
45644
|
copyTargetRotation = !1;
|
|
45634
|
-
static flipYQuat = new
|
|
45645
|
+
static flipYQuat = new U().setFromAxisAngle(new w(0, 1, 0), Math.PI);
|
|
45635
45646
|
/** @internal */
|
|
45636
45647
|
onBeforeRender() {
|
|
45637
45648
|
let e = this.target;
|
|
@@ -45843,9 +45854,9 @@ class ic extends A {
|
|
|
45843
45854
|
/** @internal */
|
|
45844
45855
|
lateUpdate() {
|
|
45845
45856
|
this.updateDistance();
|
|
45846
|
-
const e = this.useFullPage ? this._ndc_x : this.context.input.mousePositionRC.x, t = this.useFullPage ? this._ndc_y : this.context.input.mousePositionRC.y, i = this.context.mainCamera, n = i.worldPosition, o =
|
|
45857
|
+
const e = this.useFullPage ? this._ndc_x : this.context.input.mousePositionRC.x, t = this.useFullPage ? this._ndc_y : this.context.input.mousePositionRC.y, i = this.context.mainCamera, n = i.worldPosition, o = z(e, t, 1).unproject(i);
|
|
45847
45858
|
o.sub(n).normalize();
|
|
45848
|
-
const r =
|
|
45859
|
+
const r = z(o).multiplyScalar(this._distance).add(n);
|
|
45849
45860
|
let a = r;
|
|
45850
45861
|
if (this.damping > 0) {
|
|
45851
45862
|
const l = this.gameObject.worldPosition;
|
|
@@ -46232,22 +46243,22 @@ let vt = class extends A {
|
|
|
46232
46243
|
l && (n = l.width, o = l.height, r = t / n, a = i / o), vt._tempProjectionMatrix.copy(e.projectionMatrix), vt._tempProjectionMatrixInverse.copy(e.projectionMatrixInverse);
|
|
46233
46244
|
const c = e.view, h = e.zoom, d = e.aspect, u = e.fov;
|
|
46234
46245
|
e.view = null, e.zoom = 1, e.fov = this.referenceFieldOfView, e.updateProjectionMatrix();
|
|
46235
|
-
const p = this.gameObject.worldPosition, m = this.gameObject.worldScale, b = e.worldPosition, y = b.distanceTo(p), g = Math.max(m.x, m.y, m.z), _ =
|
|
46246
|
+
const p = this.gameObject.worldPosition, m = this.gameObject.worldScale, b = e.worldPosition, y = b.distanceTo(p), g = Math.max(m.x, m.y, m.z), _ = z(b).sub(p);
|
|
46236
46247
|
if (y < g) {
|
|
46237
46248
|
(this.debug || So) && console.warn("[ViewBox] Moving camera out of bounds", y, "<", g);
|
|
46238
|
-
const $ =
|
|
46249
|
+
const $ = z(_);
|
|
46239
46250
|
$.y *= 1e-8, $.normalize();
|
|
46240
46251
|
const Q = g - y, te = b.add($.multiplyScalar(Q));
|
|
46241
46252
|
e.worldPosition = te.lerp(b, 1 - this.context.time.deltaTime);
|
|
46242
46253
|
}
|
|
46243
|
-
const v =
|
|
46254
|
+
const v = z(p);
|
|
46244
46255
|
e.worldToLocal(v), e.lookAt(p), e.updateMatrixWorld();
|
|
46245
46256
|
const C = this.referenceFieldOfView * Math.PI / 180, P = 2 * Math.tan(C / 2) * y, T = P * e.aspect, I = this.projectBoxIntoCamera(e, 1), F = I.maxX - I.minX, N = I.maxY - I.minY, H = this.fit(
|
|
46246
46257
|
F * e.aspect,
|
|
46247
46258
|
N,
|
|
46248
46259
|
T / r,
|
|
46249
46260
|
P / a
|
|
46250
|
-
) / (P * 0.5), M =
|
|
46261
|
+
) / (P * 0.5), M = z(p);
|
|
46251
46262
|
M.project(e), this.context.focusRectSettings.offsetX = M.x, this.context.focusRectSettings.offsetY = M.y, this.context.focusRectSettings.zoom = H, this.context.focusRect || this.context.setCameraFocusRect(this.context.domElement), e.view = c, e.zoom = h, e.aspect = d, e.fov = u, e.projectionMatrix.copy(vt._tempProjectionMatrix), e.projectionMatrixInverse.copy(vt._tempProjectionMatrixInverse);
|
|
46252
46263
|
};
|
|
46253
46264
|
/**
|
|
@@ -46259,14 +46270,14 @@ let vt = class extends A {
|
|
|
46259
46270
|
}
|
|
46260
46271
|
projectBoxIntoCamera(s, e) {
|
|
46261
46272
|
const t = 0.5 * e, i = [
|
|
46262
|
-
|
|
46263
|
-
|
|
46264
|
-
|
|
46265
|
-
|
|
46266
|
-
|
|
46267
|
-
|
|
46268
|
-
|
|
46269
|
-
|
|
46273
|
+
z(-t, -t, -t),
|
|
46274
|
+
z(t, -t, -t),
|
|
46275
|
+
z(-t, t, -t),
|
|
46276
|
+
z(t, t, -t),
|
|
46277
|
+
z(-t, -t, t),
|
|
46278
|
+
z(t, -t, t),
|
|
46279
|
+
z(-t, t, t),
|
|
46280
|
+
z(t, t, t)
|
|
46270
46281
|
];
|
|
46271
46282
|
let n = Number.POSITIVE_INFINITY, o = Number.NEGATIVE_INFINITY, r = Number.POSITIVE_INFINITY, a = Number.NEGATIVE_INFINITY;
|
|
46272
46283
|
for (let l = 0; l < i.length; l++) {
|
|
@@ -46309,7 +46320,7 @@ class _r extends A {
|
|
|
46309
46320
|
useGripSpace = !1;
|
|
46310
46321
|
resetTransformAfterXRSession = !0;
|
|
46311
46322
|
_startPosition = new w();
|
|
46312
|
-
_startRotation = new
|
|
46323
|
+
_startRotation = new U();
|
|
46313
46324
|
_startScale = new w();
|
|
46314
46325
|
/** @internal */
|
|
46315
46326
|
onEnterXR(e) {
|
|
@@ -46327,7 +46338,7 @@ class _r extends A {
|
|
|
46327
46338
|
this.controlVisibility && (this.gameObject.visible = !1);
|
|
46328
46339
|
return;
|
|
46329
46340
|
}
|
|
46330
|
-
this.controlVisibility && (this.gameObject.visible = !0), this.useGripSpace || t.targetRayMode === "transient-pointer" ? (this.gameObject.worldPosition = t.gripWorldPosition, this.gameObject.worldQuaternion = t.gripWorldQuaternion, this.gameObject.worldScale =
|
|
46341
|
+
this.controlVisibility && (this.gameObject.visible = !0), this.useGripSpace || t.targetRayMode === "transient-pointer" ? (this.gameObject.worldPosition = t.gripWorldPosition, this.gameObject.worldQuaternion = t.gripWorldQuaternion, this.gameObject.worldScale = z(t.xr.rigScale, t.xr.rigScale, t.xr.rigScale).multiply(this._startScale)) : (this.gameObject.worldPosition = t.rayWorldPosition, this.gameObject.worldQuaternion = t.rayWorldQuaternion, this.gameObject.worldScale = z(t.xr.rigScale, t.xr.rigScale, t.xr.rigScale).multiply(this._startScale));
|
|
46331
46342
|
}
|
|
46332
46343
|
}
|
|
46333
46344
|
/** @internal */
|
|
@@ -46400,7 +46411,7 @@ function cj(s, e) {
|
|
|
46400
46411
|
if (t.has(s))
|
|
46401
46412
|
return;
|
|
46402
46413
|
t.add(s), $w.set(e, t), console.debug("Initialize texture for camera feed");
|
|
46403
|
-
const i = new Le(), n = new
|
|
46414
|
+
const i = new Le(), n = new zn(), o = new zi();
|
|
46404
46415
|
o.add(new V(n, i));
|
|
46405
46416
|
const r = new pe();
|
|
46406
46417
|
i.map = e, s.render(o, r);
|
|
@@ -46642,7 +46653,7 @@ void main() {
|
|
|
46642
46653
|
return this.threeTexture;
|
|
46643
46654
|
}
|
|
46644
46655
|
});
|
|
46645
|
-
const d = new V(new
|
|
46656
|
+
const d = new V(new zn(2, 2), h);
|
|
46646
46657
|
return Tg(d, !1), d.geometry.deleteAttribute("normal"), d.renderOrder = -1e6, d.setTexture = function(u) {
|
|
46647
46658
|
h.uniforms.t2D.value = u;
|
|
46648
46659
|
}, d;
|
|
@@ -46677,7 +46688,7 @@ class qp extends A {
|
|
|
46677
46688
|
backgroundPlane;
|
|
46678
46689
|
threeTexture;
|
|
46679
46690
|
forceTextureInitialization = (function() {
|
|
46680
|
-
const e = new Le(), t = new
|
|
46691
|
+
const e = new Le(), t = new zn(), i = new zi();
|
|
46681
46692
|
i.add(new V(t, e));
|
|
46682
46693
|
const n = new pe();
|
|
46683
46694
|
return function(r, a) {
|
|
@@ -46875,7 +46886,7 @@ class Lh {
|
|
|
46875
46886
|
t && (t *= Math.max(1, i)), t === void 0 || t >= 1 ? (e.position.copy(this._position), e.quaternion.copy(this._rotation)) : (t = Math.max(0, Math.min(1, t)), e.position.lerp(this._position, t), e.quaternion.slerp(this._rotation, t));
|
|
46876
46887
|
}
|
|
46877
46888
|
static _positionBuffer = new dn(() => new w(), 20);
|
|
46878
|
-
static _rotationBuffer = new dn(() => new
|
|
46889
|
+
static _rotationBuffer = new dn(() => new U(), 20);
|
|
46879
46890
|
_position;
|
|
46880
46891
|
_rotation;
|
|
46881
46892
|
ensureTransformData() {
|
|
@@ -47523,7 +47534,7 @@ class wj extends A {
|
|
|
47523
47534
|
}
|
|
47524
47535
|
}
|
|
47525
47536
|
function xj() {
|
|
47526
|
-
O.add("AlignmentConstraint", ap), O.add("Animation", hi), O.add("Animator", Gt), O.add("AudioListener", Bo), O.add("AudioSource", fn), O.add("AxesHelper", Xh), O.add("BasicIKConstraint", dC), O.add("BoxHelperComponent", Qt), O.add("Camera", wi), O.add("CharacterController", Il), O.add("CharacterControllerInput", sr), O.add("SphereCollider", Qh), O.add("BoxCollider", Z_), O.add("MeshCollider", fa), O.add("CapsuleCollider", er), O.add("ContactShadows", lp), O.add("LogStats", pC), O.add("DeleteBox", Qr), O.add("Deletable", gC), O.add("DeviceFlag", J_), O.add("DragControls", Ja), O.add("DropListener", or), O.add("Duplicatable", MC), O.add("EventListEvent", JS), O.add("EventTrigger", lb), O.add("GltfExportBox",
|
|
47537
|
+
O.add("AlignmentConstraint", ap), O.add("Animation", hi), O.add("Animator", Gt), O.add("AudioListener", Bo), O.add("AudioSource", fn), O.add("AxesHelper", Xh), O.add("BasicIKConstraint", dC), O.add("BoxHelperComponent", Qt), O.add("Camera", wi), O.add("CharacterController", Il), O.add("CharacterControllerInput", sr), O.add("SphereCollider", Qh), O.add("BoxCollider", Z_), O.add("MeshCollider", fa), O.add("CapsuleCollider", er), O.add("ContactShadows", lp), O.add("LogStats", pC), O.add("DeleteBox", Qr), O.add("Deletable", gC), O.add("DeviceFlag", J_), O.add("DragControls", Ja), O.add("DropListener", or), O.add("Duplicatable", MC), O.add("EventListEvent", JS), O.add("EventTrigger", lb), O.add("GltfExportBox", UC), O.add("GltfExport", zC), O.add("VariantAction", YC), O.add("ChangeTransformOnClick", Bl), O.add("ChangeMaterialOnClick", KC), O.add("SetActiveOnClick", ZC), O.add("HideOnStart", Tn), O.add("EmphasizeOnClick", Zh), O.add("PlayAudioOnClick", oa), O.add("PlayAnimationOnClick", Tf), O.add("PreliminaryAction", Jh), O.add("PreliminaryTrigger", gp), O.add("VisibilityAction", yp), O.add("TapGestureTrigger", JC), O.add("USDZExporter", Xs), O.add("Fog", id), O.add("GaussianSplat", $l), O.add("BoxGizmo", Wl), O.add("GridHelper", nd), O.add("GroundProjectedEnv", oo), O.add("UsageMarker", cp), O.add("Interactable", mC), O.add("FixedJoint", R1), O.add("HingeJoint", Pp), O.add("Light", Jt), O.add("LODGroup", kb), O.add("LookAtConstraint", Ml), O.add("NeedleMenu", lo), O.add("NestedGltf", od), O.add("Networking", E1), O.add("OffsetConstraint", Vl), O.add("CameraTargetReachedEvent", xf), O.add("OrbitControls", ye), O.add("ParticleSystemRenderer", Vn), O.add("ParticleSystem", Ef), O.add("Attractor", ld), O.add("PlayerColor", Ih), O.add("Antialiasing", Ep), O.add("BloomEffect", Lb), O.add("ChromaticAberration", Ap), O.add("ColorAdjustments", ga), O.add("DepthOfField", Ps), O.add("EffectWrapper", Mf), O.add("PixelationEffect", Lp), O.add("ScreenSpaceAmbientOcclusion", ur), O.add("ScreenSpaceAmbientOcclusionN8", ks), O.add("SharpeningEffect", Dp), O.add("TiltShiftEffect", uo), O.add("ToneMappingEffect", Xl), O.add("Vignette", Yl), O.add("Volume", Fp), O.add("ReflectionProbe", To), O.add("Renderer", Ci), O.add("MeshRenderer", up), O.add("SkinnedMeshRenderer", RC), O.add("Rigidbody", ht), O.add("SceneSwitcher", ut), O.add("ScreenCapture", ba), O.add("SeeThrough", q1), O.add("ShadowCatcher", jp), O.add("RemoteSkybox", lC), O.add("SmoothFollow", Fb), O.add("SpatialTriggerReceiver", Qs), O.add("SpatialTrigger", Bb), O.add("SpectatorCamera", jb), O.add("SplineContainer", Jl), O.add("SplineWalker", Hn), O.add("SpriteRenderer", Hi), O.add("SyncedCamera", Z1), O.add("SyncedRoom", Os), O.add("SyncedTransform", vs), O.add("TestRunner", J1), O.add("TestSimulateUserData", eP), O.add("PlayableDirector", Rh), O.add("SignalReceiver", Ol), O.add("TimelineAnimationTrack", Cf), O.add("TimelineAudioTrack", jo), O.add("TimelineMarkerTrack", V_), O.add("SignalTrackHandler", Pf), O.add("TimelineActivationTrack", G_), O.add("TimelineControlTrack", H_), O.add("TransformGizmo", tc), O.add("BaseUIComponent", Un), O.add("UIRootComponent", wp), O.add("Button", yr), O.add("Canvas", Mh), O.add("CanvasGroup", la), O.add("EventSystem", xi), O.add("Graphic", xp), O.add("MaskableGraphic", Sp), O.add("Image", fd), O.add("RawImage", zb), O.add("InputField", tP), O.add("VerticalLayoutGroup", f1), O.add("HorizontalLayoutGroup", p1), O.add("GridLayoutGroup", m1), O.add("Outline", td), O.add("ObjectRaycaster", jn), O.add("GraphicRaycaster", $_), O.add("SpatialGrabRaycaster", kl), O.add("RectTransform", ws), O.add("SpatialHtml", Wp), O.add("Text", fi), O.add("EnvironmentScene", X_), O.add("LookAt", sP), O.add("OpenURL", gd), O.add("VideoPlayer", Et), O.add("Voip", mr), O.add("ClickThrough", $b), O.add("CursorFollow", ic), O.add("HoverAnimation", to), O.add("ScrollFollow", fo), O.add("ViewBox", vt), O.add("Avatar", aa), O.add("XRControllerFollow", _r), O.add("XRControllerModel", tr), O.add("XRControllerMovement", mn), O.add("TeleportTarget", mb), O.add("WebARCameraBackground", qp), O.add("WebARSessionRoot", An), O.add("WebXR", gb), O.add("AvatarMarker", bt), O.add("WebXRImageTracking", yd), O.add("WebXRPlaneTracking", br), O.add("XRRig", Vb), O.add("XRFlag", ls), O.add("PlayerSync", i1), O.add("PlayerState", Li), O.add("PresentationMode", wj);
|
|
47527
47538
|
}
|
|
47528
47539
|
const Ve = x("debugphysics"), pg = x("debugcolliderplacement"), mg = x("debugcollisions"), Sj = x("showcolliders"), gu = x("debugraycasts"), cP = /* @__PURE__ */ Symbol("needle component");
|
|
47529
47540
|
function nn(s) {
|
|
@@ -47532,7 +47543,7 @@ function nn(s) {
|
|
|
47532
47543
|
function gg(s, e) {
|
|
47533
47544
|
s[cP] = e ? new WeakRef(e) : null;
|
|
47534
47545
|
}
|
|
47535
|
-
const
|
|
47546
|
+
const zt = /* @__PURE__ */ Symbol("physics body"), Hw = /* @__PURE__ */ Symbol("rigidbody");
|
|
47536
47547
|
function Cj() {
|
|
47537
47548
|
Ve && console.log("Use Rapier", !0, globalThis.NEEDLE_USE_RAPIER), QM((s) => (Ve && console.log("Construct rapier physics backend"), new fh(s)));
|
|
47538
47549
|
}
|
|
@@ -47540,10 +47551,10 @@ class fh {
|
|
|
47540
47551
|
debugRenderColliders = !1;
|
|
47541
47552
|
debugRenderRaycasts = !1;
|
|
47542
47553
|
removeBody(e) {
|
|
47543
|
-
if (Ve && console.log("REMOVE BODY", e?.name, e[
|
|
47554
|
+
if (Ve && console.log("REMOVE BODY", e?.name, e[zt]), !e) return;
|
|
47544
47555
|
this.validate();
|
|
47545
|
-
const t = e[
|
|
47546
|
-
if (e[
|
|
47556
|
+
const t = e[zt];
|
|
47557
|
+
if (e[zt] = null, t && this.world) {
|
|
47547
47558
|
const i = this.entryLookup.get(e);
|
|
47548
47559
|
if (i) {
|
|
47549
47560
|
this.entryLookup.delete(e);
|
|
@@ -47575,7 +47586,7 @@ class fh {
|
|
|
47575
47586
|
}
|
|
47576
47587
|
}
|
|
47577
47588
|
setColliderEnabled(e, t) {
|
|
47578
|
-
const i = e[
|
|
47589
|
+
const i = e[zt];
|
|
47579
47590
|
return i ? (i.setEnabled(t), Ve && console.log("SET COLLIDER ENABLED", e.name, t), !0) : !1;
|
|
47580
47591
|
}
|
|
47581
47592
|
updateBody(e, t, i) {
|
|
@@ -47583,13 +47594,13 @@ class fh {
|
|
|
47583
47594
|
if (e.isCollider === !0)
|
|
47584
47595
|
console.warn("TODO: implement updating collider position");
|
|
47585
47596
|
else {
|
|
47586
|
-
const n = e, o = n[
|
|
47597
|
+
const n = e, o = n[zt];
|
|
47587
47598
|
o && this.syncPhysicsBody(n.gameObject, o, t, i);
|
|
47588
47599
|
}
|
|
47589
47600
|
}
|
|
47590
47601
|
updateProperties(e) {
|
|
47591
47602
|
if (this.validate(), e.isCollider) {
|
|
47592
|
-
const t = e, i = t[
|
|
47603
|
+
const t = e, i = t[zt];
|
|
47593
47604
|
i && (this.internalUpdateColliderProperties(t, i), t.sharedMaterial && this.updatePhysicsMaterial(t));
|
|
47594
47605
|
} else {
|
|
47595
47606
|
const t = e, i = this.internal_getRigidbody(t);
|
|
@@ -47776,7 +47787,7 @@ class fh {
|
|
|
47776
47787
|
return this._world;
|
|
47777
47788
|
}
|
|
47778
47789
|
_tempPosition = new w();
|
|
47779
|
-
_tempQuaternion = new
|
|
47790
|
+
_tempQuaternion = new U();
|
|
47780
47791
|
_tempScale = new w();
|
|
47781
47792
|
_tempMatrix = new Z();
|
|
47782
47793
|
static _didLoadPhysicsEngine = !1;
|
|
@@ -47902,7 +47913,7 @@ class fh {
|
|
|
47902
47913
|
}
|
|
47903
47914
|
updatePhysicsMaterial(e) {
|
|
47904
47915
|
if (!e) return;
|
|
47905
|
-
const t = e.sharedMaterial, i = e[
|
|
47916
|
+
const t = e.sharedMaterial, i = e[zt];
|
|
47906
47917
|
if (i && t) {
|
|
47907
47918
|
if (t.bounciness !== void 0 && i.setRestitution(t.bounciness), t.bounceCombine !== void 0)
|
|
47908
47919
|
switch (t.bounceCombine) {
|
|
@@ -47938,7 +47949,7 @@ class fh {
|
|
|
47938
47949
|
}
|
|
47939
47950
|
/** Get the rapier body for a Needle component */
|
|
47940
47951
|
getBody(e) {
|
|
47941
|
-
return e ? e[
|
|
47952
|
+
return e ? e[zt] : null;
|
|
47942
47953
|
}
|
|
47943
47954
|
/** Get the Needle Engine component for a rapier object */
|
|
47944
47955
|
getComponent(e) {
|
|
@@ -47994,7 +48005,7 @@ class fh {
|
|
|
47994
48005
|
e.attachedRigidbody?.autoMass === !1 ? t.setMass(1e-6) : e.density != null && t.setDensity(e.density);
|
|
47995
48006
|
try {
|
|
47996
48007
|
const r = this.world.createCollider(t, n);
|
|
47997
|
-
return gg(r, e), e[
|
|
48008
|
+
return gg(r, e), e[zt] = r, r.setActiveEvents(L.RAPIER_PHYSICS.MODULE.ActiveEvents.COLLISION_EVENTS), r.setActiveCollisionTypes(L.RAPIER_PHYSICS.MODULE.ActiveCollisionTypes.ALL), this.registerEntry(e, r), this.updateColliderCollisionGroups(e), Ve && console.log("Created collider", e.name, r), r;
|
|
47998
48009
|
} catch (r) {
|
|
47999
48010
|
return console.error('Error creating collider "' + e.name + `"
|
|
48000
48011
|
Error:`, r), null;
|
|
@@ -48006,7 +48017,7 @@ Error:`, r), null;
|
|
|
48006
48017
|
* @param collider - The collider to update.
|
|
48007
48018
|
*/
|
|
48008
48019
|
updateColliderCollisionGroups(e) {
|
|
48009
|
-
const t = e[
|
|
48020
|
+
const t = e[zt], i = e.membership;
|
|
48010
48021
|
let n = 0;
|
|
48011
48022
|
if (i == null)
|
|
48012
48023
|
n = 65535;
|
|
@@ -48031,13 +48042,13 @@ Error:`, r), null;
|
|
|
48031
48042
|
let i = null;
|
|
48032
48043
|
if (e.attachedRigidbody) {
|
|
48033
48044
|
const n = e.attachedRigidbody;
|
|
48034
|
-
if (i = n[
|
|
48045
|
+
if (i = n[zt], !i) {
|
|
48035
48046
|
const o = n.isKinematic && !pg;
|
|
48036
48047
|
Ve && console.log("Create rigidbody", o);
|
|
48037
48048
|
const r = o ? L.RAPIER_PHYSICS.MODULE.RigidBodyDesc.kinematicPositionBased() : L.RAPIER_PHYSICS.MODULE.RigidBodyDesc.dynamic(), a = le(e.attachedRigidbody.gameObject);
|
|
48038
48049
|
r.setTranslation(a.x, a.y, a.z), r.setRotation(Ie(e.attachedRigidbody.gameObject)), r.centerOfMass = new L.RAPIER_PHYSICS.MODULE.Vector3(n.centerOfMass.x, n.centerOfMass.y, n.centerOfMass.z), i = this.world.createRigidBody(r), this.registerEntry(n, i);
|
|
48039
48050
|
}
|
|
48040
|
-
gg(i, n), n[
|
|
48051
|
+
gg(i, n), n[zt] = i, this.internalUpdateRigidbodyProperties(n, i), this.getRigidbodyRelativeMatrix(e.gameObject, n.gameObject, t), e[Hw] = i;
|
|
48041
48052
|
} else {
|
|
48042
48053
|
const n = L.RAPIER_PHYSICS.MODULE.RigidBodyDesc.kinematicPositionBased(), o = le(e.gameObject);
|
|
48043
48054
|
n.setTranslation(o.x, o.y, o.z), n.setRotation(Ie(e.gameObject)), i = this.world.createRigidBody(n), t.identity(), gg(i, null);
|
|
@@ -48045,7 +48056,7 @@ Error:`, r), null;
|
|
|
48045
48056
|
return i;
|
|
48046
48057
|
}
|
|
48047
48058
|
internal_getRigidbody(e) {
|
|
48048
|
-
return e.isCollider === !0 ? e[Hw] : e[
|
|
48059
|
+
return e.isCollider === !0 ? e[Hw] : e[zt];
|
|
48049
48060
|
}
|
|
48050
48061
|
internalUpdateColliderProperties(e, t) {
|
|
48051
48062
|
const i = t.shape;
|
|
@@ -48215,7 +48226,7 @@ Error:`, r), null;
|
|
|
48215
48226
|
async addFixedJoint(e, t) {
|
|
48216
48227
|
if (this._isInitialized || await this.initialize(), !this.world)
|
|
48217
48228
|
return console.error("Physics world not initialized"), null;
|
|
48218
|
-
const i = e[
|
|
48229
|
+
const i = e[zt], n = t[zt];
|
|
48219
48230
|
if (!i || !n)
|
|
48220
48231
|
return console.error("Cannot create fixed joint: one or both physics bodies are not initialized"), null;
|
|
48221
48232
|
this.calculateJointRelativeMatrices(e.gameObject, t.gameObject, this._tempMatrix), this._tempMatrix.decompose(this._tempPosition, this._tempQuaternion, this._tempScale);
|
|
@@ -48231,7 +48242,7 @@ Error:`, r), null;
|
|
|
48231
48242
|
async addHingeJoint(e, t, i, n) {
|
|
48232
48243
|
if (this._isInitialized || await this.initialize(), !this.world)
|
|
48233
48244
|
return console.error("Physics world not initialized"), null;
|
|
48234
|
-
const o = e[
|
|
48245
|
+
const o = e[zt], r = t[zt];
|
|
48235
48246
|
if (!o || !r)
|
|
48236
48247
|
return console.error("Cannot create hinge joint: one or both physics bodies are not initialized"), null;
|
|
48237
48248
|
this.calculateJointRelativeMatrices(e.gameObject, t.gameObject, this._tempMatrix);
|
|
@@ -49563,10 +49574,10 @@ const jj = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
49563
49574
|
__proto__: null,
|
|
49564
49575
|
NeedleEngineWebComponent: pP
|
|
49565
49576
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
49566
|
-
function
|
|
49577
|
+
function Uj() {
|
|
49567
49578
|
typeof window > "u" || (window.customElements.get("needle-engine") || window.customElements.define("needle-engine", pP), window.customElements.get("needle-button") || window.customElements.define("needle-button", Tj), window.customElements.get("needle-logo-element") || window.customElements.define("needle-logo-element", Yf), window.customElements.get("needle-menu") || window.customElements.define("needle-menu", wh));
|
|
49568
49579
|
}
|
|
49569
|
-
function
|
|
49580
|
+
function zj() {
|
|
49570
49581
|
if (G.isARSupported(), D.isiOS()) {
|
|
49571
49582
|
const s = G.getAppClipLaunchUrl();
|
|
49572
49583
|
try {
|
|
@@ -49589,7 +49600,7 @@ function Uj() {
|
|
|
49589
49600
|
}
|
|
49590
49601
|
let Zw = !1;
|
|
49591
49602
|
function P4() {
|
|
49592
|
-
Zw || g_ || (Zw = !0, qD(), PI(), eE(), hI(), yL(), fS(),
|
|
49603
|
+
Zw || g_ || (Zw = !0, qD(), PI(), eE(), hI(), yL(), fS(), UL(), kj(), mA(), Oj(), xj(), IF(), setTimeout(pI, 1e3), uL(), cL(), EL(), vL(), Cj(), zj(), wT(), pR(), Uj());
|
|
49593
49604
|
}
|
|
49594
49605
|
const Nj = new rS();
|
|
49595
49606
|
function mP(s, e, t) {
|
|
@@ -49919,7 +49930,7 @@ class Dh {
|
|
|
49919
49930
|
const t = e.mainCameraComponent, i = e.renderer, n = e.scene, o = t.threeCamera;
|
|
49920
49931
|
if (typeof i[Tc] == "boolean" && (i.autoClear = i[Tc]), i[Tc] = i.autoClear, typeof i[Rc] == "number" && (i.toneMapping = i[Rc]), i[Rc] = i.toneMapping, i.toneMapping != Nu && !this._effects.find((d) => d instanceof L.POSTPROCESSING.MODULE.ToneMappingEffect)) {
|
|
49921
49932
|
const d = new L.POSTPROCESSING.MODULE.ToneMappingEffect();
|
|
49922
|
-
d.name = `ToneMapping (${i.toneMapping})`, d.mode =
|
|
49933
|
+
d.name = `ToneMapping (${i.toneMapping})`, d.mode = Uu(i.toneMapping), this._effects.push({
|
|
49923
49934
|
typeName: "ToneMapping",
|
|
49924
49935
|
effect: d,
|
|
49925
49936
|
priority: Pt.ToneMapping
|
|
@@ -50425,7 +50436,7 @@ const T4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
50425
50436
|
AvatarMarker: bt,
|
|
50426
50437
|
AxesHelper: Xh,
|
|
50427
50438
|
AxisRotationConstraint: _C,
|
|
50428
|
-
BaseUIComponent:
|
|
50439
|
+
BaseUIComponent: Un,
|
|
50429
50440
|
BasicIKConstraint: dC,
|
|
50430
50441
|
BehaviorExtension: a1,
|
|
50431
50442
|
BehaviorModel: Kt,
|
|
@@ -50474,8 +50485,8 @@ const T4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
50474
50485
|
FixedRotationAxesConstraint: GL,
|
|
50475
50486
|
Fog: id,
|
|
50476
50487
|
GaussianSplat: $l,
|
|
50477
|
-
GltfExport:
|
|
50478
|
-
GltfExportBox:
|
|
50488
|
+
GltfExport: zC,
|
|
50489
|
+
GltfExportBox: UC,
|
|
50479
50490
|
GrabPointPlaneConstraint: hp,
|
|
50480
50491
|
Gradient: Gl,
|
|
50481
50492
|
Graphic: xp,
|
|
@@ -50522,7 +50533,7 @@ const T4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
50522
50533
|
OpenURL: gd,
|
|
50523
50534
|
OrbitControls: ye,
|
|
50524
50535
|
Outline: td,
|
|
50525
|
-
Padding:
|
|
50536
|
+
Padding: zl,
|
|
50526
50537
|
ParticleBurst: Fy,
|
|
50527
50538
|
ParticleSubEmitter: D1,
|
|
50528
50539
|
ParticleSystem: Ef,
|
|
@@ -50538,7 +50549,7 @@ const T4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
50538
50549
|
PostProcessingHandler: Dh,
|
|
50539
50550
|
PreliminaryAction: Jh,
|
|
50540
50551
|
PreliminaryTrigger: gp,
|
|
50541
|
-
RawImage:
|
|
50552
|
+
RawImage: zb,
|
|
50542
50553
|
Rect: tF,
|
|
50543
50554
|
RectTransform: ws,
|
|
50544
50555
|
ReflectionProbe: To,
|
|
@@ -50583,7 +50594,7 @@ const T4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
50583
50594
|
SpriteData: ch,
|
|
50584
50595
|
SpriteRenderer: Hi,
|
|
50585
50596
|
SpriteSheet: Eh,
|
|
50586
|
-
SubEmitterSystem:
|
|
50597
|
+
SubEmitterSystem: Uy,
|
|
50587
50598
|
SyncedCamera: Z1,
|
|
50588
50599
|
SyncedRoom: Os,
|
|
50589
50600
|
SyncedTransform: vs,
|
|
@@ -50704,10 +50715,8 @@ const e5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
50704
50715
|
GenerateMeshBVHWorker: Jj
|
|
50705
50716
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
50706
50717
|
export {
|
|
50707
|
-
Hf as $TNE,
|
|
50708
50718
|
Ig as $componentName,
|
|
50709
50719
|
I5 as $physicsKey,
|
|
50710
|
-
Hs as $vnStLM,
|
|
50711
50720
|
be as ActionBuilder,
|
|
50712
50721
|
w2 as ActionCollection,
|
|
50713
50722
|
Ei as ActionModel,
|
|
@@ -50722,7 +50731,7 @@ export {
|
|
|
50722
50731
|
Gt as Animator,
|
|
50723
50732
|
Ii as AnimatorConditionMode,
|
|
50724
50733
|
Ns as AnimatorController,
|
|
50725
|
-
|
|
50734
|
+
U_ as AnimatorControllerBuilder,
|
|
50726
50735
|
Za as AnimatorControllerParameterType,
|
|
50727
50736
|
Fd as AnimatorStateInfo,
|
|
50728
50737
|
Ep as Antialiasing,
|
|
@@ -50741,7 +50750,7 @@ export {
|
|
|
50741
50750
|
Xh as AxesHelper,
|
|
50742
50751
|
_C as AxisRotationConstraint,
|
|
50743
50752
|
Zu as BUILD_TIME,
|
|
50744
|
-
|
|
50753
|
+
Un as BaseUIComponent,
|
|
50745
50754
|
dC as BasicIKConstraint,
|
|
50746
50755
|
a1 as BehaviorExtension,
|
|
50747
50756
|
Kt as BehaviorModel,
|
|
@@ -50787,7 +50796,7 @@ export {
|
|
|
50787
50796
|
ce as ContextRegistry,
|
|
50788
50797
|
ic as CursorFollow,
|
|
50789
50798
|
Nl as CustomBranding,
|
|
50790
|
-
|
|
50799
|
+
ze as CustomShader,
|
|
50791
50800
|
Vg as DefaultReflectionMode,
|
|
50792
50801
|
gC as Deletable,
|
|
50793
50802
|
Qr as DeleteBox,
|
|
@@ -50808,7 +50817,7 @@ export {
|
|
|
50808
50817
|
Zh as EmphasizeOnClick,
|
|
50809
50818
|
pl as EngineLoadingView,
|
|
50810
50819
|
X_ as EnvironmentScene,
|
|
50811
|
-
|
|
50820
|
+
Uv as EventBus,
|
|
50812
50821
|
ne as EventList,
|
|
50813
50822
|
JS as EventListEvent,
|
|
50814
50823
|
xi as EventSystem,
|
|
@@ -50827,8 +50836,8 @@ export {
|
|
|
50827
50836
|
k as GameObject,
|
|
50828
50837
|
$l as GaussianSplat,
|
|
50829
50838
|
j as Gizmos,
|
|
50830
|
-
|
|
50831
|
-
|
|
50839
|
+
zC as GltfExport,
|
|
50840
|
+
UC as GltfExportBox,
|
|
50832
50841
|
hp as GrabPointPlaneConstraint,
|
|
50833
50842
|
Gl as Gradient,
|
|
50834
50843
|
xp as Graphic,
|
|
@@ -50844,14 +50853,14 @@ export {
|
|
|
50844
50853
|
Pp as HingeJoint,
|
|
50845
50854
|
p1 as HorizontalLayoutGroup,
|
|
50846
50855
|
lF as HorizontalWrapMode,
|
|
50847
|
-
|
|
50856
|
+
z5 as HostData,
|
|
50848
50857
|
to as HoverAnimation,
|
|
50849
50858
|
fd as Image,
|
|
50850
50859
|
Bs as ImageReference,
|
|
50851
50860
|
KR as ImageReferenceSerializer,
|
|
50852
50861
|
L1 as InheritVelocityModule,
|
|
50853
50862
|
aE as Input,
|
|
50854
|
-
|
|
50863
|
+
Ur as InputEventQueue,
|
|
50855
50864
|
Ae as InputEvents,
|
|
50856
50865
|
tP as InputField,
|
|
50857
50866
|
ul as InstanceHandle,
|
|
@@ -50921,7 +50930,7 @@ export {
|
|
|
50921
50930
|
bE as OwnershipEvent,
|
|
50922
50931
|
vE as OwnershipModel,
|
|
50923
50932
|
Br as PUBLIC_KEY,
|
|
50924
|
-
|
|
50933
|
+
zl as Padding,
|
|
50925
50934
|
Fy as ParticleBurst,
|
|
50926
50935
|
D1 as ParticleSubEmitter,
|
|
50927
50936
|
Ef as ParticleSystem,
|
|
@@ -50954,14 +50963,14 @@ export {
|
|
|
50954
50963
|
Jh as PreliminaryAction,
|
|
50955
50964
|
gp as PreliminaryTrigger,
|
|
50956
50965
|
ah as PreviewHelper,
|
|
50957
|
-
|
|
50966
|
+
Uh as PrimitiveType,
|
|
50958
50967
|
fe as Progress,
|
|
50959
50968
|
Ox as PromiseAllWithErrors,
|
|
50960
50969
|
hv as PromiseErrorResult,
|
|
50961
50970
|
TB as QualityLevel,
|
|
50962
50971
|
he as RGBAColor,
|
|
50963
50972
|
fh as RapierPhysics,
|
|
50964
|
-
|
|
50973
|
+
zb as RawImage,
|
|
50965
50974
|
El as RaycastOptions,
|
|
50966
50975
|
tF as Rect,
|
|
50967
50976
|
ws as RectTransform,
|
|
@@ -51024,7 +51033,7 @@ export {
|
|
|
51024
51033
|
d4 as StateMachineBehaviour,
|
|
51025
51034
|
N1 as StreamEndedEvent,
|
|
51026
51035
|
KB as StreamReceivedEvent,
|
|
51027
|
-
|
|
51036
|
+
Uy as SubEmitterSystem,
|
|
51028
51037
|
Z1 as SyncedCamera,
|
|
51029
51038
|
Os as SyncedRoom,
|
|
51030
51039
|
vs as SyncedTransform,
|
|
@@ -51098,12 +51107,13 @@ export {
|
|
|
51098
51107
|
ls as XRFlag,
|
|
51099
51108
|
Vb as XRRig,
|
|
51100
51109
|
bi as XRState,
|
|
51101
|
-
|
|
51102
|
-
Dn as _$IqaqwY,
|
|
51110
|
+
Us as XRStateFlag,
|
|
51103
51111
|
Zj as __Ignore,
|
|
51112
|
+
Dn as __Pekxq,
|
|
51104
51113
|
n4 as __internalNotifyObjectDestroyed,
|
|
51105
51114
|
KE as __internalStepGaussianSplatAdaptation,
|
|
51106
|
-
|
|
51115
|
+
Hs as _fncZ,
|
|
51116
|
+
zs as activeInHierarchyFieldName,
|
|
51107
51117
|
mS as adaptGaussianSplatQuality,
|
|
51108
51118
|
Cg as addAttributeChangeCallback,
|
|
51109
51119
|
qs as addComponent,
|
|
@@ -51181,8 +51191,8 @@ export {
|
|
|
51181
51191
|
CE as getSceneData,
|
|
51182
51192
|
rT as getTempColor,
|
|
51183
51193
|
Mi as getTempQuaternion,
|
|
51184
|
-
|
|
51185
|
-
|
|
51194
|
+
z as getTempVector,
|
|
51195
|
+
zf as getUrlParams,
|
|
51186
51196
|
_T as getVisibleInCustomShadowRendering,
|
|
51187
51197
|
uT as getWorldDirection,
|
|
51188
51198
|
Dx as getWorldEuler,
|
|
@@ -51243,7 +51253,7 @@ export {
|
|
|
51243
51253
|
RO as makeIdFromRandomWords,
|
|
51244
51254
|
pn as makeNameSafe,
|
|
51245
51255
|
_A as markAsInstancedRendered,
|
|
51246
|
-
|
|
51256
|
+
Ua as maxGaussianSplatAdaptationLevel,
|
|
51247
51257
|
S5 as microphonePermissionsGranted,
|
|
51248
51258
|
a5 as nameof,
|
|
51249
51259
|
OO as nameofFactory,
|
|
@@ -51260,7 +51270,7 @@ export {
|
|
|
51260
51270
|
F5 as onDestroy,
|
|
51261
51271
|
Jx as onInitialized,
|
|
51262
51272
|
y_ as onStart,
|
|
51263
|
-
|
|
51273
|
+
U5 as onSyncDestroy,
|
|
51264
51274
|
OR as onSyncInstantiate,
|
|
51265
51275
|
cR as onUpdate,
|
|
51266
51276
|
SS as onXRSessionEnd,
|
|
@@ -51278,7 +51288,7 @@ export {
|
|
|
51278
51288
|
Gn as registerCustomEffectType,
|
|
51279
51289
|
kC as registerExportExtensions,
|
|
51280
51290
|
xy as registerExtensions,
|
|
51281
|
-
|
|
51291
|
+
UA as registerHotReloadType,
|
|
51282
51292
|
oR as registerLoader,
|
|
51283
51293
|
MR as registerPrefabProvider,
|
|
51284
51294
|
DS as registerPrototypeExtensions,
|
|
@@ -51290,6 +51300,7 @@ export {
|
|
|
51290
51300
|
A5 as removePatch,
|
|
51291
51301
|
P_ as resolveGaussianSplatQuality,
|
|
51292
51302
|
io as resolveUrl,
|
|
51303
|
+
Hf as sUknx,
|
|
51293
51304
|
EO as sanitizeString,
|
|
51294
51305
|
uj as saveImage,
|
|
51295
51306
|
S4 as screenshot,
|
|
@@ -51339,7 +51350,7 @@ export {
|
|
|
51339
51350
|
qu as tryFindObject,
|
|
51340
51351
|
tD as tryGetExtensionFromUrl,
|
|
51341
51352
|
uE as tryGetGuid,
|
|
51342
|
-
|
|
51353
|
+
zA as unregisterHotReloadType,
|
|
51343
51354
|
N5 as unregisterPrefabProvider,
|
|
51344
51355
|
kx as unwatchWrite,
|
|
51345
51356
|
ZO as useForAutoFit,
|