@needle-tools/engine 4.8.8-next.7387ba3 → 4.8.8-next.937fc15
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 -5
- package/README.md +1 -3
- package/dist/{needle-engine.bundle-Dm2TtQhy.min.js → needle-engine.bundle--r19rtjt.min.js} +82 -82
- package/dist/{needle-engine.bundle-fg_vGCYe.umd.cjs → needle-engine.bundle-CAvlLwYK.umd.cjs} +104 -104
- package/dist/{needle-engine.bundle-D47vIqsQ.js → needle-engine.bundle-Dao6Iztd.js} +687 -689
- package/dist/needle-engine.js +2 -2
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/lib/engine/engine_loaders.callbacks.d.ts +1 -0
- package/lib/engine/engine_loaders.callbacks.js +1 -0
- package/lib/engine/engine_loaders.callbacks.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.d.ts +2 -2
- package/lib/engine/webcomponents/needle-engine.js +11 -18
- package/lib/engine/webcomponents/needle-engine.js.map +1 -1
- package/lib/engine-components/Camera.d.ts +2 -0
- package/lib/engine-components/Camera.js +5 -1
- package/lib/engine-components/Camera.js.map +1 -1
- package/lib/engine-components/DropListener.d.ts +4 -3
- package/lib/engine-components/DropListener.js +4 -3
- package/lib/engine-components/DropListener.js.map +1 -1
- package/lib/engine-components/OrbitControls.d.ts +29 -6
- package/lib/engine-components/OrbitControls.js +41 -3
- package/lib/engine-components/OrbitControls.js.map +1 -1
- package/lib/engine-components/Skybox.js +8 -9
- package/lib/engine-components/Skybox.js.map +1 -1
- package/lib/engine-components/api.d.ts +1 -0
- package/lib/engine-components/api.js.map +1 -1
- package/package.json +1 -1
- package/plugins/common/files.js +6 -3
- package/plugins/vite/editor-connection.js +4 -4
- package/src/engine/engine_loaders.callbacks.ts +1 -0
- package/src/engine/webcomponents/needle-engine.ts +10 -17
- package/src/engine-components/Camera.ts +7 -1
- package/src/engine-components/DropListener.ts +4 -3
- package/src/engine-components/OrbitControls.ts +63 -10
- package/src/engine-components/Skybox.ts +9 -10
- package/src/engine-components/api.ts +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Vector2 as J, Vector3 as b, Vector4 as de, Quaternion as
|
|
1
|
+
import { Vector2 as J, Vector3 as b, Vector4 as de, Quaternion as N, PlaneGeometry as Un, WebGLRenderer as ur, PerspectiveCamera as pe, OrthographicCamera as Td, Scene as gi, Mesh as H, Texture as Te, Uniform$1 as zi, Color as se, ShaderMaterial as Ln, Box3 as pi, ShadowMaterial as ob, Euler as Rt, MeshStandardMaterial as ct, Box3Helper as Ww, GridHelper as am, Object3D as M, Material as _e, Matrix3 as rb, Matrix4 as te, Layers as ao, Ray as lo, MathUtils as gs, AxesHelper as mi, MeshBasicMaterial as we, DoubleSide as yi, BufferGeometry as Tn, Group as io, CylinderGeometry as ab, SphereGeometry as Ed, BoxGeometry as la, SpriteMaterial as Vw, Sprite as Hw, Shape as Gw, ExtrudeGeometry as qw, Fog as lb, DirectionalLight as ip, PointLight as lm, EdgesGeometry as Xw, LineSegments as cb, LineBasicMaterial as hb, Line as Zl, BufferAttribute as ht, Raycaster as Ad, Sphere as Id, ArrayCamera as Qw, Plane as nr, SkinnedMesh as ys, InterleavedBufferAttribute as db, Skeleton as Yw, Bone as Kw, Source as Zw, WebGLCubeRenderTarget as Jw, CubeCamera as ex, AnimationClip as no, FileLoader as cm, TextureLoader as Jl, PropertyBinding as ca, LinearSRGBColorSpace as Ss, ShaderChunk as Wt, UniformsLib as tx, DataTexture as hm, RGBAFormat as Ld, EquirectangularReflectionMapping as _s, SRGBColorSpace as Cs, Clock as ix, NeutralToneMapping as ha, AgXToneMapping as Dd, ACESFilmicToneMapping as jd, NoToneMapping as Gh, PCFSoftShadowMap$1 as nx, BasicNodeLibrary as sx, WebGLRenderTarget as Dn, DepthTexture as ub, NearestFilter as qh, LoopRepeat as ox, LoopOnce as np, AnimationMixer as dm, CompressedTexture as rx, FrontSide as co, Camera as ax, Frustum as Gg, AudioListener as lx, PositionalAudio as cx, AudioLoader as sp, EventDispatcher as um, BackSide as Bd, MeshDepthMaterial as hx, CustomBlending as dx, MaxEquation as ux, AmbientLight as fx, HemisphereLight as px, AlwaysStencilFunc as mx, GreaterEqualStencilFunc as gx, NotEqualStencilFunc as yx, GreaterStencilFunc as _x, LessEqualStencilFunc as bx, EqualStencilFunc as vx, LessStencilFunc as wx, NeverStencilFunc as qg, InvertStencilOp as xx, DecrementWrapStencilOp as Sx, IncrementWrapStencilOp as Cx, DecrementStencilOp as Px, IncrementStencilOp as Ox, ReplaceStencilOp as kx, ZeroStencilOp as Mx, KeepStencilOp as Rx, RawShaderMaterial as fb, GLSL3 as Tx, AlwaysDepth as Ex, GreaterEqualDepth as Ax, GreaterDepth as Ix, LessEqualDepth as Lx, LessDepth as Dx, NotEqualDepth as jx, EqualDepth as Bx, BatchedMesh as Xg, MeshPhysicalMaterial as op, LinearFilter as Xh, UnsignedByteType as Fx, RingGeometry as zx, Line3 as Ux, AdditiveBlending as pb, BoxHelper as Nx, SpotLight as $x, DirectionalLightHelper as Wx, CameraHelper as Vx, LOD as Hx, Triangle as Gx, NormalBlending as qx, ReinhardToneMapping as fm, LinearToneMapping as pm, HalfFloatType as Vu, VideoTexture as Xx, CubeUVReflectionMapping as mb, CubeTexture as Qx, CompressedCubeTexture as Yx, EquirectangularRefractionMapping as Kx, VectorKeyframeTrack as Zx, QuaternionKeyframeTrack as Jx, Audio as eS, ShaderLib as Qh, UniformsUtils as gb, MirroredRepeatWrapping as Qg, MeshNormalMaterial as tS, AudioContext as iS, PMREMGenerator$1 as nS } from "./three-BRSLmpyi.js";
|
|
2
2
|
import { createLoaders as mm, getRaycastMesh as yb, LODsManager as Ao, NEEDLE_progressive as We, addDracoAndKTX2Loaders as sS, configureLoader as oS, setKTX2TranscoderLocation as rS, setDracoDecoderLocation as aS } from "./gltf-progressive-BcHT3Nyo.js";
|
|
3
3
|
import { GroundedSkybox as da, Font as lS, TextGeometry as cS, FontLoader as hS, GLTFLoader as Ps, TransformControlsGizmo as _b, EXRLoader as gm, RGBELoader as bb, Stats as dS, nodeFrame as uS, OrbitControls as vb, PositionalAudioHelper as fS, HorizontalBlurShader as pS, VerticalBlurShader as mS, GLTFExporter as wb, strToU8 as xb, zipSync as gS, XRControllerModelFactory as yS, XRHandMeshModel as _S, Line2 as bS, LineGeometry as vS, LineMaterial as wS, TransformControls as xS, InteractiveGroup as SS, HTMLMesh as CS, VertexNormalsHelper as PS, OBJLoader as ym, FBXLoader as Sb, mergeVertices as OS } from "./three-examples-CNexix3E.js";
|
|
4
4
|
import { fetchProfile as kS, MotionController as MS, $70d766613f57b014$export$2e2bcd8739ae039 as Yg, ByteBuffer as RS, v5 as Kg, md5 as Zg, SIZE_PREFIX_LENGTH as Cb, Builder as _m, createNoise4D as TS, Matrix4 as Hu, BatchedParticleRenderer as ES, ParticleSystem as AS, RenderMode as as, ConstantColor as IS, Vector4 as LS, ConstantValue as DS, TrailParticle as Jg, WorkerBase as jS, MeshBVH as BS } from "./vendor-Z4SPrTcP.js";
|
|
@@ -329,7 +329,7 @@ function bm(s, e) {
|
|
|
329
329
|
s[jr] = new so(s, ["x", "y"]);
|
|
330
330
|
else if (s instanceof b)
|
|
331
331
|
s[jr] = new so(s, ["x", "y", "z"]);
|
|
332
|
-
else if (s instanceof de || s instanceof
|
|
332
|
+
else if (s instanceof de || s instanceof N)
|
|
333
333
|
s[jr] = new so(s, ["x", "y", "z", "w"]);
|
|
334
334
|
else
|
|
335
335
|
return !1;
|
|
@@ -340,12 +340,12 @@ function Rb(s, e) {
|
|
|
340
340
|
const t = s[jr];
|
|
341
341
|
t && t.unsubscribeWrite(e);
|
|
342
342
|
}
|
|
343
|
-
var
|
|
343
|
+
var q;
|
|
344
344
|
((s) => {
|
|
345
345
|
let e;
|
|
346
346
|
function t() {
|
|
347
347
|
if (e !== void 0) return e;
|
|
348
|
-
const
|
|
348
|
+
const V = window.navigator.userAgent, ne = /Windows|MacOS|Mac OS/.test(V), re = /Windows NT/.test(V) && /Edg/.test(V) && !/Win64/.test(V);
|
|
349
349
|
return e = ne && !re && !y();
|
|
350
350
|
}
|
|
351
351
|
s.isDesktop = t;
|
|
@@ -379,8 +379,8 @@ var X;
|
|
|
379
379
|
if (navigator.userAgentData)
|
|
380
380
|
return f = navigator.userAgentData.platform === "macOS";
|
|
381
381
|
{
|
|
382
|
-
const
|
|
383
|
-
return f =
|
|
382
|
+
const V = navigator.userAgent.toLowerCase();
|
|
383
|
+
return f = V.includes("mac os x") || V.includes("macintosh");
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
386
|
s.isMacOS = p;
|
|
@@ -406,69 +406,69 @@ var X;
|
|
|
406
406
|
}
|
|
407
407
|
s.isQuest = k;
|
|
408
408
|
let E;
|
|
409
|
-
function
|
|
409
|
+
function B() {
|
|
410
410
|
return E !== void 0 || (E = document.createElement("a").relList.supports("ar")), E;
|
|
411
411
|
}
|
|
412
|
-
s.supportsQuickLookAR =
|
|
413
|
-
async function
|
|
412
|
+
s.supportsQuickLookAR = B;
|
|
413
|
+
async function L() {
|
|
414
414
|
try {
|
|
415
415
|
return (await navigator.permissions.query({ name: "microphone" })).state !== "denied";
|
|
416
|
-
} catch (
|
|
417
|
-
return console.error("Error querying `microphone` permissions.",
|
|
416
|
+
} catch (V) {
|
|
417
|
+
return console.error("Error querying `microphone` permissions.", V), !1;
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
s.microphonePermissionsGranted =
|
|
421
|
-
let
|
|
422
|
-
function
|
|
423
|
-
if (
|
|
424
|
-
const
|
|
425
|
-
if (
|
|
420
|
+
s.microphonePermissionsGranted = L;
|
|
421
|
+
let W;
|
|
422
|
+
function X() {
|
|
423
|
+
if (W !== void 0) return W;
|
|
424
|
+
const V = navigator.userAgent.match(/iPhone OS (\d+_\d+)/);
|
|
425
|
+
if (V && (W = V[1].replace("_", ".")), !W) {
|
|
426
426
|
const ne = navigator.userAgent.match(/(?:\(Macintosh;|iPhone;|iPad;).*Version\/(\d+\.\d+)/);
|
|
427
|
-
ne && (
|
|
427
|
+
ne && (W = ne[1]);
|
|
428
428
|
}
|
|
429
|
-
return
|
|
429
|
+
return W || (W = null), W;
|
|
430
430
|
}
|
|
431
|
-
s.getiOSVersion =
|
|
431
|
+
s.getiOSVersion = X;
|
|
432
432
|
let A;
|
|
433
|
-
function
|
|
433
|
+
function $() {
|
|
434
434
|
if (A !== void 0) return A;
|
|
435
|
-
const
|
|
436
|
-
return
|
|
435
|
+
const V = navigator.userAgent.match(/(?:CriOS|Chrome)\/(\d+\.\d+\.\d+\.\d+)/);
|
|
436
|
+
return V ? A = V[1].replace("_", ".") : A = null, A;
|
|
437
437
|
}
|
|
438
|
-
s.getChromeVersion =
|
|
439
|
-
})(
|
|
438
|
+
s.getChromeVersion = $;
|
|
439
|
+
})(q || (q = {}));
|
|
440
440
|
function sI() {
|
|
441
|
-
return
|
|
441
|
+
return q.isDesktop();
|
|
442
442
|
}
|
|
443
443
|
function oI() {
|
|
444
|
-
return
|
|
444
|
+
return q.isMobileDevice();
|
|
445
445
|
}
|
|
446
446
|
function rI() {
|
|
447
|
-
return
|
|
447
|
+
return q.isiPad();
|
|
448
448
|
}
|
|
449
449
|
function aI() {
|
|
450
|
-
return
|
|
450
|
+
return q.isiPad();
|
|
451
451
|
}
|
|
452
452
|
function lI() {
|
|
453
|
-
return
|
|
453
|
+
return q.isAndroidDevice();
|
|
454
454
|
}
|
|
455
455
|
function cI() {
|
|
456
|
-
return
|
|
456
|
+
return q.isMozillaXR();
|
|
457
457
|
}
|
|
458
458
|
function hI() {
|
|
459
|
-
return
|
|
459
|
+
return q.isMacOS();
|
|
460
460
|
}
|
|
461
461
|
function dI() {
|
|
462
|
-
return
|
|
462
|
+
return q.isiOS();
|
|
463
463
|
}
|
|
464
464
|
function uI() {
|
|
465
|
-
return
|
|
465
|
+
return q.isSafari();
|
|
466
466
|
}
|
|
467
467
|
function fI() {
|
|
468
|
-
return
|
|
468
|
+
return q.isQuest();
|
|
469
469
|
}
|
|
470
470
|
async function pI() {
|
|
471
|
-
return
|
|
471
|
+
return q.microphonePermissionsGranted();
|
|
472
472
|
}
|
|
473
473
|
const Zs = /* @__PURE__ */ new WeakMap();
|
|
474
474
|
function iC(s, e, t) {
|
|
@@ -581,12 +581,12 @@ async function rC(s, e) {
|
|
|
581
581
|
if (h) {
|
|
582
582
|
const y = a.width / a.height;
|
|
583
583
|
y > 1 ? _ = g / y : g = _ * y;
|
|
584
|
-
const x = n * s.width, I = Math.max(g, _), O = Math.round(I + x), k = Math.round(I + x), E = (d.width - I) / 2,
|
|
584
|
+
const x = n * s.width, I = Math.max(g, _), O = Math.round(I + x), k = Math.round(I + x), E = (d.width - I) / 2, B = (d.height - I) / 2;
|
|
585
585
|
f.shadowColor = o, f.shadowBlur = i;
|
|
586
|
-
const
|
|
587
|
-
f.beginPath(), f.moveTo(
|
|
588
|
-
const A = (d.width - g) / 2,
|
|
589
|
-
f.drawImage(a, A,
|
|
586
|
+
const L = r, W = Math.round(E - x / 2), X = Math.round(B - x / 2);
|
|
587
|
+
f.beginPath(), f.moveTo(W + L, X), f.lineTo(W + O - L, X), f.quadraticCurveTo(W + O, X, W + O, X + L), f.lineTo(W + O, X + k - L), f.quadraticCurveTo(W + O, X + k, W + O - L, X + k), f.lineTo(W + L, X + k), f.quadraticCurveTo(W, X + k, W, X + k - L), f.lineTo(W, X + L), f.quadraticCurveTo(W, X, W + L, X), f.fillStyle = "#ffffff", f.closePath(), f.fill(), f.clip(), f.shadowColor = "transparent";
|
|
588
|
+
const A = (d.width - g) / 2, $ = (d.height - _) / 2;
|
|
589
|
+
f.drawImage(a, A, $, g, _);
|
|
590
590
|
}
|
|
591
591
|
const m = d.toDataURL("image/png"), v = document.createElement("img");
|
|
592
592
|
return v.src = m, v.style.width = "100%", v.style.height = "auto", v;
|
|
@@ -971,7 +971,7 @@ function yI(s, e, t) {
|
|
|
971
971
|
const i = s.length(), n = e.length(), o = j.lerp(i, n, t);
|
|
972
972
|
return s.lerp(e, t).normalize().multiplyScalar(o);
|
|
973
973
|
}
|
|
974
|
-
const Ku = new
|
|
974
|
+
const Ku = new N(), jb = new N().setFromAxisAngle(new b(0, 1, 0), Math.PI);
|
|
975
975
|
function _I(s, e) {
|
|
976
976
|
s.lookAt(e), s.quaternion.multiply(jb);
|
|
977
977
|
}
|
|
@@ -1014,10 +1014,10 @@ function OC(s) {
|
|
|
1014
1014
|
const e = PC.get();
|
|
1015
1015
|
return s ? e.copy(s) : e.set(0, 0, 0), e;
|
|
1016
1016
|
}
|
|
1017
|
-
const kC = new $i(() => new
|
|
1017
|
+
const kC = new $i(() => new N(), 100);
|
|
1018
1018
|
function bn(s) {
|
|
1019
1019
|
const e = kC.get();
|
|
1020
|
-
return e.identity(), s instanceof
|
|
1020
|
+
return e.identity(), s instanceof N ? e.copy(s) : s instanceof DOMPointReadOnly && e.set(s.x, s.y, s.z, s.w), e;
|
|
1021
1021
|
}
|
|
1022
1022
|
const wm = new $i(() => new b(), 100), hy = Symbol("lastMatrixWorldUpdateKey");
|
|
1023
1023
|
function Z(s, e = null, t = !0) {
|
|
@@ -1033,7 +1033,7 @@ function ua(s, e, t, i) {
|
|
|
1033
1033
|
const n = wm.get();
|
|
1034
1034
|
return n.set(e, t, i), ut(s, n), s;
|
|
1035
1035
|
}
|
|
1036
|
-
const Zh = new $i(() => new
|
|
1036
|
+
const Zh = new $i(() => new N(), 100), Xo = new N(), Zu = new N();
|
|
1037
1037
|
function be(s, e = null) {
|
|
1038
1038
|
if (!s) return Zh.get().identity();
|
|
1039
1039
|
const t = e ?? Zh.get();
|
|
@@ -1063,11 +1063,11 @@ function tc(s, e) {
|
|
|
1063
1063
|
const t = RC;
|
|
1064
1064
|
s.parent.getWorldScale(t), s.scale.copy(e), s.scale.divide(t);
|
|
1065
1065
|
}
|
|
1066
|
-
const TC = new b(), dy = new
|
|
1066
|
+
const TC = new b(), dy = new N();
|
|
1067
1067
|
function vI(s) {
|
|
1068
1068
|
return be(s, dy), TC.set(0, 0, 1).applyQuaternion(dy);
|
|
1069
1069
|
}
|
|
1070
|
-
const EC = new $i(() => new b(), 100), uy = new
|
|
1070
|
+
const EC = new $i(() => new b(), 100), uy = new N();
|
|
1071
1071
|
function AC(s, e) {
|
|
1072
1072
|
return e || (e = EC.get().set(0, 0, 1)), be(s, uy), e.applyQuaternion(uy);
|
|
1073
1073
|
}
|
|
@@ -1330,7 +1330,7 @@ function Nb(s, e, t, i) {
|
|
|
1330
1330
|
}
|
|
1331
1331
|
let Gc = !1;
|
|
1332
1332
|
lC((...s) => {
|
|
1333
|
-
|
|
1333
|
+
D() && he.Current?.isInXR && (Yr(!0), $b("error", ...s));
|
|
1334
1334
|
});
|
|
1335
1335
|
function Yr(s) {
|
|
1336
1336
|
if (s) {
|
|
@@ -1545,7 +1545,7 @@ function $b(s, ...e) {
|
|
|
1545
1545
|
if (o instanceof J) return `(${i(o.x)}, ${i(o.y)})`;
|
|
1546
1546
|
if (o instanceof b) return `(${i(o.x)}, ${i(o.y)}, ${i(o.z)})`;
|
|
1547
1547
|
if (o instanceof de) return `(${i(o.x)}, ${i(o.y)}, ${i(o.z)}, ${i(o.w)})`;
|
|
1548
|
-
if (o instanceof
|
|
1548
|
+
if (o instanceof N) return `(${i(o.x)}, ${i(o.y)}, ${i(o.z)}, ${i(o.w)})`;
|
|
1549
1549
|
if (o instanceof _e || o instanceof Te) return o.name;
|
|
1550
1550
|
if (o instanceof rb) return `[${o.elements.join(", ")}]`;
|
|
1551
1551
|
if (o instanceof te) return `[${o.elements.join(", ")}]`;
|
|
@@ -1589,7 +1589,7 @@ function Wd(s) {
|
|
|
1589
1589
|
Be(s, Ui.Error);
|
|
1590
1590
|
}
|
|
1591
1591
|
let dp, Ju;
|
|
1592
|
-
function
|
|
1592
|
+
function D() {
|
|
1593
1593
|
if (HC) return !1;
|
|
1594
1594
|
if (dp !== void 0) return dp;
|
|
1595
1595
|
if (Ju !== void 0) return Ju;
|
|
@@ -1765,9 +1765,9 @@ fo('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUIL
|
|
|
1765
1765
|
fo('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";');
|
|
1766
1766
|
fo('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.8.8";');
|
|
1767
1767
|
fo('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
|
|
1768
|
-
fo('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "
|
|
1768
|
+
fo('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Wed Sep 03 2025 08:12:49 GMT+0000 (Coordinated Universal Time)";');
|
|
1769
1769
|
fo('globalThis["__NEEDLE_PUBLIC_KEY__"] = "' + NEEDLE_PUBLIC_KEY + '";');
|
|
1770
|
-
const En = "4.8.8", Sm = "undefined", Gb = "
|
|
1770
|
+
const En = "4.8.8", Sm = "undefined", Gb = "Wed Sep 03 2025 08:12:49 GMT+0000 (Coordinated Universal Time)";
|
|
1771
1771
|
Hb && console.log(`Engine version: ${En} (generator: ${Sm})
|
|
1772
1772
|
Project built at ${Gb}`);
|
|
1773
1773
|
const bl = NEEDLE_PUBLIC_KEY, oo = "needle_isActiveInHierarchy", Br = "builtin_components", Mh = "needle_editor_guid";
|
|
@@ -2428,7 +2428,7 @@ class a1 {
|
|
|
2428
2428
|
this._mouseWheelDeltaY[e] = 0;
|
|
2429
2429
|
};
|
|
2430
2430
|
canReceiveInput(e) {
|
|
2431
|
-
return e.target === this.context.renderer?.domElement || e.target === this.context.domElement || this.context.isInAR || this.context.isInAR && e.target === document.body &&
|
|
2431
|
+
return e.target === this.context.renderer?.domElement || e.target === this.context.domElement || this.context.isInAR || this.context.isInAR && e.target === document.body && q.isMozillaXR() ? !0 : (tt && console.warn("CanReceiveInput:False for", e.target), !1);
|
|
2432
2432
|
}
|
|
2433
2433
|
onContextMenu = (e) => {
|
|
2434
2434
|
this.canReceiveInput(e) !== !1 && e instanceof PointerEvent && e.pointerType;
|
|
@@ -2640,15 +2640,15 @@ class a1 {
|
|
|
2640
2640
|
return t[e] = i, i;
|
|
2641
2641
|
}
|
|
2642
2642
|
onDispatchEvent(e) {
|
|
2643
|
-
const t =
|
|
2643
|
+
const t = U.Current;
|
|
2644
2644
|
try {
|
|
2645
|
-
|
|
2645
|
+
U.Current = this.context, this.dispatchEvent(e);
|
|
2646
2646
|
} finally {
|
|
2647
|
-
|
|
2647
|
+
U.Current = t;
|
|
2648
2648
|
}
|
|
2649
2649
|
}
|
|
2650
2650
|
}
|
|
2651
|
-
const Kr = new te().makeRotationY(Math.PI), ji = new
|
|
2651
|
+
const Kr = new te().makeRotationY(Math.PI), ji = new N().setFromAxisAngle(new b(0, 1, 0), Math.PI), l1 = w("debugwebxr");
|
|
2652
2652
|
class c1 {
|
|
2653
2653
|
priority = -1e5;
|
|
2654
2654
|
gameObject;
|
|
@@ -2665,7 +2665,7 @@ class c1 {
|
|
|
2665
2665
|
}
|
|
2666
2666
|
}
|
|
2667
2667
|
}
|
|
2668
|
-
const Yn = w("debugwebxr"), Xc = w("debugcustomgesture"), h1 = "https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles", d1 = "generic-trigger", u1 = new
|
|
2668
|
+
const Yn = w("debugwebxr"), Xc = w("debugcustomgesture"), h1 = "https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles", d1 = "generic-trigger", u1 = new N().setFromEuler(new Rt(gs.degToRad(0), gs.degToRad(-90), gs.degToRad(-90))), f1 = new b(0.04, -0.04, 0);
|
|
2669
2669
|
class Zb {
|
|
2670
2670
|
/** the Needle XR Session */
|
|
2671
2671
|
xr;
|
|
@@ -2797,16 +2797,16 @@ class Zb {
|
|
|
2797
2797
|
/** Grip position in grip space */
|
|
2798
2798
|
_gripPosition = new b();
|
|
2799
2799
|
/** Grip rotation in grip space */
|
|
2800
|
-
_gripQuaternion = new
|
|
2800
|
+
_gripQuaternion = new N();
|
|
2801
2801
|
_linearVelocity = new b();
|
|
2802
2802
|
_rayPositionRaw = new b();
|
|
2803
|
-
_rayRotationRaw = new
|
|
2803
|
+
_rayRotationRaw = new N();
|
|
2804
2804
|
/** ray matrix in grip space */
|
|
2805
2805
|
_rayMatrix = new te();
|
|
2806
2806
|
/** Ray position in rig space */
|
|
2807
2807
|
_rayPosition = new b();
|
|
2808
2808
|
/** Ray rotation in rig space */
|
|
2809
|
-
_rayQuaternion = new
|
|
2809
|
+
_rayQuaternion = new N();
|
|
2810
2810
|
/** Grip position in rig space */
|
|
2811
2811
|
get gripPosition() {
|
|
2812
2812
|
return G(this._gripPosition);
|
|
@@ -2841,7 +2841,7 @@ class Zb {
|
|
|
2841
2841
|
get gripWorldQuaternion() {
|
|
2842
2842
|
return bn(this._gripWorldQuaternion);
|
|
2843
2843
|
}
|
|
2844
|
-
_gripWorldQuaternion = new
|
|
2844
|
+
_gripWorldQuaternion = new N();
|
|
2845
2845
|
/** Controller ray position in worldspace (this value is calculated once per frame by default - call `updateRayWorldPosition` to force an update) */
|
|
2846
2846
|
get rayWorldPosition() {
|
|
2847
2847
|
return G(this._rayWorldPosition);
|
|
@@ -2856,7 +2856,7 @@ class Zb {
|
|
|
2856
2856
|
get rayWorldQuaternion() {
|
|
2857
2857
|
return bn(this._rayWorldQuaternion);
|
|
2858
2858
|
}
|
|
2859
|
-
_rayWorldQuaternion = new
|
|
2859
|
+
_rayWorldQuaternion = new N();
|
|
2860
2860
|
get pinchPosition() {
|
|
2861
2861
|
return G(this._pinchPosition);
|
|
2862
2862
|
}
|
|
@@ -2943,7 +2943,7 @@ class Zb {
|
|
|
2943
2943
|
this.onUpdateFrame(e), this.updateInputEvents(), this.onUpdateMove();
|
|
2944
2944
|
}
|
|
2945
2945
|
onRenderDebug() {
|
|
2946
|
-
|
|
2946
|
+
z.DrawSphere(this.rayWorldPosition, 3e-3), z.DrawDirection(this.rayWorldPosition, G(0, 0, 10).applyQuaternion(this.rayWorldQuaternion));
|
|
2947
2947
|
const t = (this.inputSource.gripSpace ? this.gripWorldPosition : this.object.worldPosition).sub(this.object.worldForward.multiplyScalar(0.1)), i = this.inputSource.profiles.join(`
|
|
2948
2948
|
`);
|
|
2949
2949
|
let n = `Controller[${this.index}] (${this.inputSource.targetRayMode}, ${this.side})
|
|
@@ -2958,7 +2958,7 @@ Pinch: ${this.getGesture("pinch")?.value.toFixed(3)}`), n += `
|
|
|
2958
2958
|
[axes ` + o.axes.length + "]: " + o.axes.map((a) => a.toPrecision(1)).join(","), n += `
|
|
2959
2959
|
` + r;
|
|
2960
2960
|
}
|
|
2961
|
-
|
|
2961
|
+
z.DrawLabel(t, n, 6e-3);
|
|
2962
2962
|
}
|
|
2963
2963
|
onUpdateFrame(e) {
|
|
2964
2964
|
if (this._handJointPoses.clear(), this._hand_wristDotUp = void 0, !this.xr.referenceSpace) {
|
|
@@ -3156,13 +3156,13 @@ Pinch: ${this.getGesture("pinch")?.value.toFixed(3)}`), n += `
|
|
|
3156
3156
|
if (!this.emitPointerDownEvent || this.inputSource !== e.inputSource) return;
|
|
3157
3157
|
this.onUpdateFrame(e.frame), this._hasSelectEvent = !0;
|
|
3158
3158
|
const t = this._layout?.selectComponentId, i = this._layout?.components[t]?.gamepadIndices?.button;
|
|
3159
|
-
i !== void 0 && (this._selectButtonIndex = i), !Xc && (Yn &&
|
|
3159
|
+
i !== void 0 && (this._selectButtonIndex = i), !Xc && (Yn && z.DrawDirection(this.rayWorldPosition, G(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 16711680, 10), this.emitPointerEvent(De.PointerDown, this._selectButtonIndex || 0, "xr-standard-trigger", !0, e));
|
|
3160
3160
|
};
|
|
3161
3161
|
onSelectEnd = (e) => {
|
|
3162
3162
|
this.emitPointerUpEvent && (Xc || this.inputSource === e.inputSource && this.emitPointerEvent(De.PointerUp, this._selectButtonIndex || 0, "xr-standard-trigger", !0, e));
|
|
3163
3163
|
};
|
|
3164
3164
|
onSequeezeStart = (e) => {
|
|
3165
|
-
this.emitPointerDownEvent && this.inputSource === e.inputSource && (this._squeezeButtonIndex = this._layout?.components["xr-standard-squeeze"]?.gamepadIndices?.button, this._squeezeButtonIndex !== void 0 && (Yn &&
|
|
3165
|
+
this.emitPointerDownEvent && this.inputSource === e.inputSource && (this._squeezeButtonIndex = this._layout?.components["xr-standard-squeeze"]?.gamepadIndices?.button, this._squeezeButtonIndex !== void 0 && (Yn && z.DrawDirection(this.rayWorldPosition, G(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 255, 10), this.emitPointerEvent(De.PointerDown, this._squeezeButtonIndex || 0, "xr-standard-squeeze", !0, e)));
|
|
3166
3166
|
};
|
|
3167
3167
|
onSequeezeEnd = (e) => {
|
|
3168
3168
|
this.emitPointerUpEvent && this.inputSource === e.inputSource && this._squeezeButtonIndex !== void 0 && this.emitPointerEvent(De.PointerUp, this._squeezeButtonIndex || 0, "xr-standard-squeeze", !0, e);
|
|
@@ -3213,12 +3213,12 @@ Pinch: ${this.getGesture("pinch")?.value.toFixed(3)}`), n += `
|
|
|
3213
3213
|
}
|
|
3214
3214
|
_didMoveLastFrame = !1;
|
|
3215
3215
|
_lastPointerMovePosition = new b();
|
|
3216
|
-
_lastPointerMoveQuaternion = new
|
|
3216
|
+
_lastPointerMoveQuaternion = new N();
|
|
3217
3217
|
onUpdateMove() {
|
|
3218
3218
|
if (!this.emitPointerMoveEvent) return;
|
|
3219
3219
|
let e = !1;
|
|
3220
3220
|
if (this._lastPointerMovePosition.distanceTo(this.gripWorldPosition) > this.pointerMoveDistanceThreshold * this.xr.rigScale && (e = !0), e || this._lastPointerMoveQuaternion.angleTo(this.gripWorldQuaternion) > this.pointerMoveAngleThreshold && (e = !0), e) {
|
|
3221
|
-
this._didMoveLastFrame = !0, this._lastPointerMovePosition.copy(this.gripWorldPosition), this._lastPointerMoveQuaternion.copy(this.gripWorldQuaternion), Yn &&
|
|
3221
|
+
this._didMoveLastFrame = !0, this._lastPointerMovePosition.copy(this.gripWorldPosition), this._lastPointerMoveQuaternion.copy(this.gripWorldQuaternion), Yn && z.DrawLabel(this.rayWorldPosition.add(this.object.worldForward.multiplyScalar(0.1)), "move", 0.01);
|
|
3222
3222
|
let i = this.xr.context.input.getFirstPressedButtonForPointer(this.index);
|
|
3223
3223
|
i === void 0 && (i = 0);
|
|
3224
3224
|
const n = this.gamepad?.buttons[i]?.value;
|
|
@@ -3235,8 +3235,8 @@ Pinch: ${this.getGesture("pinch")?.value.toFixed(3)}`), n += `
|
|
|
3235
3235
|
}
|
|
3236
3236
|
if (this.xr.mode === "immersive-vr" || this.xr.isPassThrough) {
|
|
3237
3237
|
this.pointerInit.origin = this, this.pointerInit.pointerId = this.getPointerId(t), this.pointerInit.pointerType = this.hand ? "hand" : "controller", this.pointerInit.button = t, this.pointerInit.buttonName = i, this.pointerInit.isPrimary = n, this.pointerInit.mode = this.inputSource.targetRayMode, this.pointerInit.ray = this.ray, this.pointerInit.device = this.object, this.pointerInit.pressure = r, this.pointerInit.clientX = this._rayPosition.x / this.xr.rigScale, this.pointerInit.clientY = this._rayPosition.y / this.xr.rigScale, this.pointerInit.clientZ = this._rayPosition.z / this.xr.rigScale;
|
|
3238
|
-
const a =
|
|
3239
|
-
|
|
3238
|
+
const a = U.Current;
|
|
3239
|
+
U.Current = this.xr.context, Yn && e !== "pointermove" && console.warn("Pointer event", e, t, i, { ...this.pointerInit }), this.xr.context.input.createInputEvent(new Ws(e, o, this.pointerInit)), U.Current = a;
|
|
3240
3240
|
}
|
|
3241
3241
|
}
|
|
3242
3242
|
}
|
|
@@ -3268,7 +3268,7 @@ let ed = !1;
|
|
|
3268
3268
|
const Vr = [];
|
|
3269
3269
|
function pr() {
|
|
3270
3270
|
if (ed) return;
|
|
3271
|
-
|
|
3271
|
+
D() && console.debug("User interaction registered: audio can now be played"), ed = !0;
|
|
3272
3272
|
const s = [...Vr];
|
|
3273
3273
|
Vr.length = 0, s.forEach((e) => e());
|
|
3274
3274
|
}
|
|
@@ -3866,7 +3866,7 @@ class x1 {
|
|
|
3866
3866
|
console.debug(`⊡ Connecting to networking backend on
|
|
3867
3867
|
` + Mi);
|
|
3868
3868
|
const o = await import("./vendor-Z4SPrTcP.js").then((c) => c.index), r = o.default?.WebsocketBuilder ?? o.WebsocketBuilder, a = o.default?.ExponentialBackoff ?? o.ExponentialBackoff, l = new r(Mi).withMaxRetries(10).withBackoff(new a(2e3, 4)).onOpen(() => {
|
|
3869
|
-
this._connectingToWebsocketPromise = null, this._ws = l, this.connected = !0,
|
|
3869
|
+
this._connectingToWebsocketPromise = null, this._ws = l, this.connected = !0, D() || oi ? console.log(`⊞ Connected to networking backend
|
|
3870
3870
|
` + Mi) : console.debug("⊞ Connected to networking backend", Mi), n(!0), this.onSendQueued(vn.OnConnection);
|
|
3871
3871
|
}).onClose((c) => {
|
|
3872
3872
|
this._connectingToWebsocketPromise = null, this.connected = !1, this._isInRoom = !1, n(!1);
|
|
@@ -3896,7 +3896,7 @@ class x1 {
|
|
|
3896
3896
|
else this.handleIncomingStringMessage(n);
|
|
3897
3897
|
return;
|
|
3898
3898
|
} catch (n) {
|
|
3899
|
-
oi && i === "pong" ? console.log("<<", i) :
|
|
3899
|
+
oi && i === "pong" ? console.log("<<", i) : D() && console.error("Failed to parse message", n);
|
|
3900
3900
|
}
|
|
3901
3901
|
}
|
|
3902
3902
|
async handleIncomingBinaryMessage(e) {
|
|
@@ -3926,7 +3926,7 @@ class x1 {
|
|
|
3926
3926
|
if (oi && console.log(e), e) {
|
|
3927
3927
|
this._isInRoom = !0;
|
|
3928
3928
|
const r = e;
|
|
3929
|
-
this._currentRoomName = r.room, this._currentRoomViewId = r.viewId, this._currentRoomAllowEditing = r.allowEditing ?? !0, this._currentInRoom.length = 0, this._currentInRoom.push(...r.inRoom), (Kc ||
|
|
3929
|
+
this._currentRoomName = r.room, this._currentRoomViewId = r.viewId, this._currentRoomAllowEditing = r.allowEditing ?? !0, this._currentInRoom.length = 0, this._currentInRoom.push(...r.inRoom), (Kc || D()) && console.debug("Joined Needle Engine Room: " + r.room);
|
|
3930
3930
|
const a = new URL(window.location.href);
|
|
3931
3931
|
a.searchParams.has("room") && a.searchParams.delete("room"), a.searchParams.set("view", this._currentRoomViewId), console.debug(`Room view id: ${this._currentRoomViewId}
|
|
3932
3932
|
${a.href}`);
|
|
@@ -3935,7 +3935,7 @@ ${a.href}`);
|
|
|
3935
3935
|
break;
|
|
3936
3936
|
case "left-room":
|
|
3937
3937
|
const n = e;
|
|
3938
|
-
n.room === this.currentRoomName && (this._isInRoom = !1, this._currentRoomName = null, this._currentRoomAllowEditing = !0, this._currentInRoom.length = 0, (Kc ||
|
|
3938
|
+
n.room === this.currentRoomName && (this._isInRoom = !1, this._currentRoomName = null, this._currentRoomAllowEditing = !0, this._currentInRoom.length = 0, (Kc || D()) && console.debug("Left Needle Engine Room: " + n.room));
|
|
3939
3939
|
break;
|
|
3940
3940
|
case "user-joined-room":
|
|
3941
3941
|
if (e.data) {
|
|
@@ -4480,7 +4480,7 @@ async function M1() {
|
|
|
4480
4480
|
const s = sessionStorage.getItem("needle_xr_session_mode"), e = sessionStorage.getItem("needle_xr_session_init") ?? null, t = e ? JSON.parse(e) : null;
|
|
4481
4481
|
let i = null;
|
|
4482
4482
|
if (n0() && (await ga.start(s || "immersive-vr", t || K.getDefaultSessionInit("immersive-vr")), await E1(), i = await ga.handoff()), i)
|
|
4483
|
-
K.setSession(i.mode, i.session, i.init,
|
|
4483
|
+
K.setSession(i.mode, i.session, i.init, U.Current);
|
|
4484
4484
|
else if (s && e) {
|
|
4485
4485
|
console.log("Session Granted: Restore last session");
|
|
4486
4486
|
const n = JSON.parse(e);
|
|
@@ -4515,7 +4515,7 @@ function E1() {
|
|
|
4515
4515
|
}, 100);
|
|
4516
4516
|
});
|
|
4517
4517
|
}
|
|
4518
|
-
|
|
4518
|
+
q.isDesktop() && D() && window.addEventListener("keydown", (s) => {
|
|
4519
4519
|
(s.key === "x" || s.key === "Escape") && K.active && K.stop();
|
|
4520
4520
|
});
|
|
4521
4521
|
function A1(s) {
|
|
@@ -4662,12 +4662,12 @@ class K {
|
|
|
4662
4662
|
switch (e) {
|
|
4663
4663
|
case "immersive-ar":
|
|
4664
4664
|
const t = ["anchors", "local-floor", "layers", "dom-overlay", "hit-test", "unbounded"];
|
|
4665
|
-
return
|
|
4665
|
+
return q.isVisionOS() || t.push("hand-tracking"), {
|
|
4666
4666
|
optionalFeatures: t
|
|
4667
4667
|
};
|
|
4668
4668
|
case "immersive-vr":
|
|
4669
4669
|
const i = ["local-floor", "bounded-floor", "high-fixed-foveation-level", "layers"];
|
|
4670
|
-
return
|
|
4670
|
+
return q.isVisionOS() || i.push("hand-tracking"), {
|
|
4671
4671
|
optionalFeatures: i
|
|
4672
4672
|
};
|
|
4673
4673
|
default:
|
|
@@ -4681,20 +4681,20 @@ class K {
|
|
|
4681
4681
|
* @param context The Needle Engine context to use
|
|
4682
4682
|
*/
|
|
4683
4683
|
static async start(e, t, i) {
|
|
4684
|
-
if (
|
|
4684
|
+
if (q.isiOS()) {
|
|
4685
4685
|
if (e === "ar")
|
|
4686
4686
|
if (await this.isARSupported())
|
|
4687
4687
|
e = "immersive-ar";
|
|
4688
4688
|
else
|
|
4689
4689
|
return ic.exportAndOpen(), null;
|
|
4690
4690
|
} else e == "ar" && (e = "immersive-ar");
|
|
4691
|
-
if (
|
|
4691
|
+
if (D() && w("debugxrpreroom"))
|
|
4692
4692
|
return console.warn("Debug: Starting temporary XR session"), await ga.start(e, t || K.getDefaultSessionInit(e)), null;
|
|
4693
4693
|
if (this._currentSessionRequest)
|
|
4694
|
-
return console.warn("A XRSession is already being requested"), (He ||
|
|
4694
|
+
return console.warn("A XRSession is already being requested"), (He || D()) && ge("A XRSession is already being requested"), this._currentSessionRequest.then(() => this._activeSession);
|
|
4695
4695
|
if (this._activeSession)
|
|
4696
4696
|
return console.error("A XRSession is already running"), this._activeSession;
|
|
4697
|
-
if (i || (i =
|
|
4697
|
+
if (i || (i = U.Current), i || (i = he.All[0]), !i) throw new Error("No Needle Engine Context found");
|
|
4698
4698
|
switch (t || (t = {}), e) {
|
|
4699
4699
|
// Setup VR initialization parameters
|
|
4700
4700
|
case "immersive-ar":
|
|
@@ -4702,7 +4702,7 @@ class K {
|
|
|
4702
4702
|
if (await this.xrSystem?.isSessionSupported("immersive-ar") !== !0)
|
|
4703
4703
|
return console.error(e + " is not supported by this browser."), null;
|
|
4704
4704
|
const l = this.getDefaultSessionInit(e), c = k1(i.domElement);
|
|
4705
|
-
c && !
|
|
4705
|
+
c && !q.isQuest() && (l.domOverlay = { root: c }, l.optionalFeatures.push("dom-overlay")), t = {
|
|
4706
4706
|
...l,
|
|
4707
4707
|
...t
|
|
4708
4708
|
};
|
|
@@ -4831,7 +4831,7 @@ class K {
|
|
|
4831
4831
|
}
|
|
4832
4832
|
/** Returns true if running in pass through mode in immersive AR (e.g. user is wearing a headset while in AR) */
|
|
4833
4833
|
get isPassThrough() {
|
|
4834
|
-
return !!(this.environmentBlendMode !== "opaque" && this.interactionMode === "world-space" || this.mode === "immersive-ar" && this.environmentBlendMode !== "opaque" && this.controllers.some((e) => e.inputSource.targetRayMode === "tracked-pointer") ||
|
|
4834
|
+
return !!(this.environmentBlendMode !== "opaque" && this.interactionMode === "world-space" || this.mode === "immersive-ar" && this.environmentBlendMode !== "opaque" && this.controllers.some((e) => e.inputSource.targetRayMode === "tracked-pointer") || D() && q.isDesktop() && this.mode === "immersive-ar");
|
|
4835
4835
|
}
|
|
4836
4836
|
get isAR() {
|
|
4837
4837
|
return this.mode === "immersive-ar";
|
|
@@ -4995,7 +4995,7 @@ class K {
|
|
|
4995
4995
|
*/
|
|
4996
4996
|
_mainCamera = null;
|
|
4997
4997
|
constructor(e, t, i, n) {
|
|
4998
|
-
R1(e, n.init), this.session = t, this.mode = e, this.context = i, (He || w("console")) && Yr(!0), this._xr_scripts = [...n.scripts], this._xr_update_scripts = this._xr_scripts.filter((o) => typeof o.onUpdateXR == "function"), this._controllerAdded = n.controller_added, this._controllerRemoved = n.controller_removed, ks(this.onBefore, xe.LateUpdate), this.context.pre_render_callbacks.push(this.onBeforeRender), this.context.post_render_callbacks.push(this.onAfterRender), (n.init.optionalFeatures?.includes("hit-test") || n.init.requiredFeatures?.includes("hit-test")) && t.requestReferenceSpace("viewer").then((o) => t.requestHitTestSource?.call(t, { space: o })?.then((r) => this._viewerHitTestSource = r).catch((r) => console.error(r))).catch((o) => console.error(o)), this.context.mainCamera && (this._originalCameraWorldPosition = Z(this.context.mainCamera, new b()), this._originalCameraWorldRotation = be(this.context.mainCamera, new
|
|
4998
|
+
R1(e, n.init), this.session = t, this.mode = e, this.context = i, (He || w("console")) && Yr(!0), this._xr_scripts = [...n.scripts], this._xr_update_scripts = this._xr_scripts.filter((o) => typeof o.onUpdateXR == "function"), this._controllerAdded = n.controller_added, this._controllerRemoved = n.controller_removed, ks(this.onBefore, xe.LateUpdate), this.context.pre_render_callbacks.push(this.onBeforeRender), this.context.post_render_callbacks.push(this.onAfterRender), (n.init.optionalFeatures?.includes("hit-test") || n.init.requiredFeatures?.includes("hit-test")) && t.requestReferenceSpace("viewer").then((o) => t.requestHitTestSource?.call(t, { space: o })?.then((r) => this._viewerHitTestSource = r).catch((r) => console.error(r))).catch((o) => console.error(o)), this.context.mainCamera && (this._originalCameraWorldPosition = Z(this.context.mainCamera, new b()), this._originalCameraWorldRotation = be(this.context.mainCamera, new N()), this._originalCameraWorldScale = $e(this.context.mainCamera, new b()), this._originalCameraParent = this.context.mainCamera.parent), this._defaultRig = new c1(), this.context.scene.add(this._defaultRig.gameObject), this.addRig(this._defaultRig);
|
|
4999
4999
|
for (let o = 0; o < t.inputSources.length; o++) {
|
|
5000
5000
|
const r = t.inputSources[o];
|
|
5001
5001
|
if (!r.handedness) {
|
|
@@ -5202,14 +5202,14 @@ class K {
|
|
|
5202
5202
|
for (const o of this.controllers)
|
|
5203
5203
|
n += `
|
|
5204
5204
|
${o.hand ? "hand" : "ctrl"} ${o.inputSource.handedness}[${o.index}] con:${o.connected} tr:${o.isTracking} hts:${o.hasHitTestSource ? "yes" : "no"}`;
|
|
5205
|
-
of = 0,
|
|
5205
|
+
of = 0, z.DrawLabel(e, n, void 0, 1 / 60 * 20);
|
|
5206
5206
|
}
|
|
5207
5207
|
}
|
|
5208
5208
|
onBeforeRender = () => {
|
|
5209
5209
|
this.context.mainCamera && this.updateFade(this.context.mainCamera);
|
|
5210
5210
|
};
|
|
5211
5211
|
onAfterRender = () => {
|
|
5212
|
-
if (this.onUpdateFade_PostRender(),
|
|
5212
|
+
if (this.onUpdateFade_PostRender(), q.isDesktop() || !this._renderOnceOnDevice) {
|
|
5213
5213
|
const e = this.context.renderer;
|
|
5214
5214
|
if (e.xr.isPresenting && this.context.mainCamera) {
|
|
5215
5215
|
this._renderOnceOnDevice = !0;
|
|
@@ -5311,7 +5311,7 @@ ${o.hand ? "hand" : "ctrl"} ${o.inputSource.handedness}[${o.index}] con:${o.conn
|
|
|
5311
5311
|
this._camera && this._previousCameraParent && this._previousCameraParent.add(this._camera), this._previousCameraParent = null, this._camera instanceof pe && this.originalCameraNearPlane != null && (this._camera.near = this.originalCameraNearPlane);
|
|
5312
5312
|
}
|
|
5313
5313
|
_viewerPose;
|
|
5314
|
-
_transformOrientation = new
|
|
5314
|
+
_transformOrientation = new N();
|
|
5315
5315
|
_transformPosition = new b();
|
|
5316
5316
|
internalUpdateState() {
|
|
5317
5317
|
const e = this.context.renderer.xr.getReferenceSpace();
|
|
@@ -5359,8 +5359,8 @@ class I1 {
|
|
|
5359
5359
|
}
|
|
5360
5360
|
}
|
|
5361
5361
|
}
|
|
5362
|
-
const Ot = new b(), Ey = new b(), Ay = new
|
|
5363
|
-
class
|
|
5362
|
+
const Ot = new b(), Ey = new b(), Ay = new N(), L1 = w("debuggizmos"), Zi = 8947848, af = 32;
|
|
5363
|
+
class z {
|
|
5364
5364
|
constructor() {
|
|
5365
5365
|
}
|
|
5366
5366
|
/**
|
|
@@ -5391,7 +5391,7 @@ class F {
|
|
|
5391
5391
|
* @returns a handle to the label that can be used to update the text
|
|
5392
5392
|
*/
|
|
5393
5393
|
static DrawLabel(e, t, i = 0.05, n = 0, o, r, a) {
|
|
5394
|
-
if (!
|
|
5394
|
+
if (!z.enabled) return null;
|
|
5395
5395
|
o || (o = Zi);
|
|
5396
5396
|
const l = K.active?.rigScale ?? 1, c = Ri.getTextLabel(n, t, i * l, o, r);
|
|
5397
5397
|
return a instanceof M && a.add(c), c.position.x = e.x, c.position.y = e.y, c.position.z = e.z, c;
|
|
@@ -5405,7 +5405,7 @@ class F {
|
|
|
5405
5405
|
* @param depthTest if true the ray will be rendered with depth test
|
|
5406
5406
|
*/
|
|
5407
5407
|
static DrawRay(e, t, i = Zi, n = 0, o = !0) {
|
|
5408
|
-
if (!
|
|
5408
|
+
if (!z.enabled) return;
|
|
5409
5409
|
const r = Ri.getLine(n), a = r.geometry.getAttribute("position");
|
|
5410
5410
|
a.setXYZ(0, e.x, e.y, e.z), Ot.set(t.x, t.y, t.z).multiplyScalar(999999999), a.setXYZ(1, e.x + Ot.x, e.y + Ot.y, e.z + Ot.z), a.needsUpdate = !0, r.material.color.set(i), r.material.depthTest = o, r.material.depthWrite = !1;
|
|
5411
5411
|
}
|
|
@@ -5419,7 +5419,7 @@ class F {
|
|
|
5419
5419
|
* @param lengthFactor the length of the line. Default is 1
|
|
5420
5420
|
*/
|
|
5421
5421
|
static DrawDirection(e, t, i = Zi, n = 0, o = !0, r = 1) {
|
|
5422
|
-
if (!
|
|
5422
|
+
if (!z.enabled) return;
|
|
5423
5423
|
const a = Ri.getLine(n), l = a.geometry.getAttribute("position");
|
|
5424
5424
|
l.setXYZ(0, e.x, e.y, e.z), t.w !== void 0 ? (Ot.set(0, 0, -r), Ay.set(t.x, t.y, t.z, t.w), Ot.applyQuaternion(Ay)) : (Ot.set(t.x, t.y, t.z), Ot.multiplyScalar(r)), l.setXYZ(1, e.x + Ot.x, e.y + Ot.y, e.z + Ot.z), l.needsUpdate = !0, a.material.color.set(i), a.material.depthTest = o, a.material.depthWrite = !1;
|
|
5425
5425
|
}
|
|
@@ -5432,7 +5432,7 @@ class F {
|
|
|
5432
5432
|
* @param depthTest if true the line will be rendered with depth test
|
|
5433
5433
|
*/
|
|
5434
5434
|
static DrawLine(e, t, i = Zi, n = 0, o = !0) {
|
|
5435
|
-
if (!
|
|
5435
|
+
if (!z.enabled) return;
|
|
5436
5436
|
const r = Ri.getLine(n), a = r.geometry.getAttribute("position");
|
|
5437
5437
|
a.setXYZ(0, e.x, e.y, e.z), a.setXYZ(1, t.x, t.y, t.z), a.needsUpdate = !0, r.material.color.set(i), r.material.depthTest = o, r.material.depthWrite = !1, r.material.fog = !1;
|
|
5438
5438
|
}
|
|
@@ -5446,7 +5446,7 @@ class F {
|
|
|
5446
5446
|
* @param depthTest if true the circle will be rendered with depth test
|
|
5447
5447
|
*/
|
|
5448
5448
|
static DrawCircle(e, t, i, n = Zi, o = 0, r = !0) {
|
|
5449
|
-
if (!
|
|
5449
|
+
if (!z.enabled) return;
|
|
5450
5450
|
const a = Ri.getCircle(o);
|
|
5451
5451
|
a.position.set(e.x, e.y, e.z), a.scale.set(i, i, i), a.quaternion.setFromUnitVectors(this._up, Ot.set(t.x, t.y, t.z).normalize()), a.material.color.set(n), a.material.depthTest = r, a.material.depthWrite = !1, a.material.fog = !1;
|
|
5452
5452
|
}
|
|
@@ -5459,7 +5459,7 @@ class F {
|
|
|
5459
5459
|
* @param depthTest if true the sphere will be rendered with depth test
|
|
5460
5460
|
*/
|
|
5461
5461
|
static DrawWireSphere(e, t, i = Zi, n = 0, o = !0) {
|
|
5462
|
-
if (!
|
|
5462
|
+
if (!z.enabled) return;
|
|
5463
5463
|
const r = Ri.getSphere(t, n, !0);
|
|
5464
5464
|
ua(r, e.x, e.y, e.z), r.material.color.set(i), r.material.depthTest = o, r.material.depthWrite = !1, r.material.fog = !1;
|
|
5465
5465
|
}
|
|
@@ -5472,7 +5472,7 @@ class F {
|
|
|
5472
5472
|
* @param depthTest if true the sphere will be rendered with depth test
|
|
5473
5473
|
*/
|
|
5474
5474
|
static DrawSphere(e, t, i = Zi, n = 0, o = !0) {
|
|
5475
|
-
if (!
|
|
5475
|
+
if (!z.enabled) return;
|
|
5476
5476
|
const r = Ri.getSphere(t, n, !1);
|
|
5477
5477
|
ua(r, e.x, e.y, e.z), r.material.color.set(i), r.material.depthTest = o, r.material.depthWrite = !1;
|
|
5478
5478
|
}
|
|
@@ -5486,7 +5486,7 @@ class F {
|
|
|
5486
5486
|
* @param depthTest if true the box will be rendered with depth test
|
|
5487
5487
|
*/
|
|
5488
5488
|
static DrawWireBox(e, t, i = Zi, n = 0, o = !0, r = void 0) {
|
|
5489
|
-
if (!
|
|
5489
|
+
if (!z.enabled) return;
|
|
5490
5490
|
const a = Ri.getBox(n);
|
|
5491
5491
|
a.position.set(e.x, e.y, e.z), a.scale.set(t.x, t.y, t.z), r ? a.quaternion.copy(r) : a.quaternion.identity(), a.material.color.set(i), a.material.depthTest = o, a.material.wireframe = !0, a.material.depthWrite = !1, a.material.fog = !1;
|
|
5492
5492
|
}
|
|
@@ -5498,7 +5498,7 @@ class F {
|
|
|
5498
5498
|
* @param depthTest if true the box will be rendered with depth test
|
|
5499
5499
|
*/
|
|
5500
5500
|
static DrawWireBox3(e, t = Zi, i = 0, n = !0) {
|
|
5501
|
-
if (!
|
|
5501
|
+
if (!z.enabled) return;
|
|
5502
5502
|
const o = Ri.getBox(i);
|
|
5503
5503
|
o.position.copy(e.getCenter(Ot)), o.scale.copy(e.getSize(Ot)), o.material.color.set(t), o.material.depthTest = n, o.material.wireframe = !0, o.material.depthWrite = !1, o.material.fog = !1;
|
|
5504
5504
|
}
|
|
@@ -5513,7 +5513,7 @@ class F {
|
|
|
5513
5513
|
* @param wireframe if true the arrow will be rendered as wireframe
|
|
5514
5514
|
*/
|
|
5515
5515
|
static DrawArrow(e, t, i = Zi, n = 0, o = !0, r = !1) {
|
|
5516
|
-
if (!
|
|
5516
|
+
if (!z.enabled) return;
|
|
5517
5517
|
const a = Ri.getArrowHead(n);
|
|
5518
5518
|
a.position.set(t.x, t.y, t.z), a.quaternion.setFromUnitVectors(this._up.set(0, 1, 0), Ot.set(t.x, t.y, t.z).sub(Ey.set(e.x, e.y, e.z)).normalize());
|
|
5519
5519
|
const c = Ot.set(t.x, t.y, t.z).sub(Ey.set(e.x, e.y, e.z)).length() * 0.1;
|
|
@@ -5582,7 +5582,7 @@ class Ri {
|
|
|
5582
5582
|
this.set({ textContent: d }), c.tmuiNeedsUpdate = !0;
|
|
5583
5583
|
};
|
|
5584
5584
|
}
|
|
5585
|
-
return this.tmuiNeedsUpdate = !0, this.registerTimedObject(
|
|
5585
|
+
return this.tmuiNeedsUpdate = !0, this.registerTimedObject(U.Current, r, e, this.textLabelCache), r;
|
|
5586
5586
|
}
|
|
5587
5587
|
static getBox(e) {
|
|
5588
5588
|
let t = this.boxesCache.pop();
|
|
@@ -5590,7 +5590,7 @@ class Ri {
|
|
|
5590
5590
|
const i = new la(1, 1, 1);
|
|
5591
5591
|
t = new H(i);
|
|
5592
5592
|
}
|
|
5593
|
-
return this.registerTimedObject(
|
|
5593
|
+
return this.registerTimedObject(U.Current, t, e, this.boxesCache), t;
|
|
5594
5594
|
}
|
|
5595
5595
|
static getLine(e) {
|
|
5596
5596
|
let t = this.linesCache.pop();
|
|
@@ -5599,7 +5599,7 @@ class Ri {
|
|
|
5599
5599
|
let i = t.geometry.getAttribute("position");
|
|
5600
5600
|
i || (i = new ht(new Float32Array(6), 3), t.geometry.setAttribute("position", i));
|
|
5601
5601
|
}
|
|
5602
|
-
return t.frustumCulled = !1, this.registerTimedObject(
|
|
5602
|
+
return t.frustumCulled = !1, this.registerTimedObject(U.Current, t, e, this.linesCache), t;
|
|
5603
5603
|
}
|
|
5604
5604
|
static getCircle(e) {
|
|
5605
5605
|
let t = this.circlesCache.pop();
|
|
@@ -5619,19 +5619,19 @@ class Ri {
|
|
|
5619
5619
|
}
|
|
5620
5620
|
}
|
|
5621
5621
|
}
|
|
5622
|
-
return t.frustumCulled = !1, this.registerTimedObject(
|
|
5622
|
+
return t.frustumCulled = !1, this.registerTimedObject(U.Current, t, e, this.circlesCache), t;
|
|
5623
5623
|
}
|
|
5624
5624
|
static getSphere(e, t, i) {
|
|
5625
5625
|
let n = this.spheresCache.pop();
|
|
5626
|
-
return n || (n = new H(new Ed(1, 8, 8))), n.scale.set(e, e, e), n.material.wireframe = i, this.registerTimedObject(
|
|
5626
|
+
return n || (n = new H(new Ed(1, 8, 8))), n.scale.set(e, e, e), n.material.wireframe = i, this.registerTimedObject(U.Current, n, t, this.spheresCache), n;
|
|
5627
5627
|
}
|
|
5628
5628
|
static getArrowHead(e) {
|
|
5629
5629
|
let t = this.arrowHeadsCache.pop();
|
|
5630
|
-
return t || (t = new H(new ab(0, 0.5, 1, 8))), this.registerTimedObject(
|
|
5630
|
+
return t || (t = new H(new ab(0, 0.5, 1, 8))), this.registerTimedObject(U.Current, t, e, this.arrowHeadsCache), t;
|
|
5631
5631
|
}
|
|
5632
5632
|
static getMesh(e) {
|
|
5633
5633
|
let t = this.mesh.pop();
|
|
5634
|
-
return t || (t = new H(), t.material = new we()), this.registerTimedObject(
|
|
5634
|
+
return t || (t = new H(), t.material = new we()), this.registerTimedObject(U.Current, t, e, this.mesh), t;
|
|
5635
5635
|
}
|
|
5636
5636
|
static linesCache = [];
|
|
5637
5637
|
static circlesCache = [];
|
|
@@ -5670,7 +5670,7 @@ class Ri {
|
|
|
5670
5670
|
}
|
|
5671
5671
|
t.traverse((a) => {
|
|
5672
5672
|
a.layers.disableAll(), a.layers.enable(2);
|
|
5673
|
-
}), t.renderOrder = 999999, t[mp] = n, t.castShadow = !1, t.receiveShadow = !1, t.isGizmo = !0, this.timedObjectsBuffer.push(t), this.timesBuffer.push(
|
|
5673
|
+
}), t.renderOrder = 999999, t[mp] = n, t.castShadow = !1, t.receiveShadow = !1, t.isGizmo = !0, this.timedObjectsBuffer.push(t), this.timesBuffer.push(U.Current.time.realtimeSinceStartup + i), e.scene.add(t);
|
|
5674
5674
|
}
|
|
5675
5675
|
static timedObjectsBuffer = new Array();
|
|
5676
5676
|
static timesBuffer = new Array();
|
|
@@ -5825,7 +5825,7 @@ class nc {
|
|
|
5825
5825
|
}
|
|
5826
5826
|
intersect(e, t, i, n) {
|
|
5827
5827
|
for (const o of t) {
|
|
5828
|
-
if (!o || o.visible === !1 ||
|
|
5828
|
+
if (!o || o.visible === !1 || z.isGizmo(o) || n.lineThreshold !== void 0 && n.lineThreshold < 0 && o instanceof Zl)
|
|
5829
5829
|
continue;
|
|
5830
5830
|
let r = !0;
|
|
5831
5831
|
const a = o, l = a.geometry;
|
|
@@ -5842,7 +5842,7 @@ class nc {
|
|
|
5842
5842
|
let d = !0;
|
|
5843
5843
|
if (n.precise === !1 && (d = !1), d ||= l.getAttribute("position")?.array?.length < 64, a instanceof da && (d = !1), !d && B1(a, e, i) || (n.useAcceleratedRaycast !== !1 ? td.runMeshBVHRaycast(e, a, i, this.context, n) : e.intersectObject(a, !1, i)), $t && i.length != h) {
|
|
5844
5844
|
const f = i[i.length - 1], p = c ? 8969557 : 7798784;
|
|
5845
|
-
|
|
5845
|
+
z.DrawWireSphere(f.point, 0.1, p, 1, !1), z.DrawWireMesh({ mesh: o, depthTest: !1, duration: 0.2, color: p });
|
|
5846
5846
|
}
|
|
5847
5847
|
a.geometry = l;
|
|
5848
5848
|
}
|
|
@@ -5852,7 +5852,7 @@ class nc {
|
|
|
5852
5852
|
}
|
|
5853
5853
|
tempBoundingBox = new pi();
|
|
5854
5854
|
intersectSphere(e, t, i, n, o, r, a, l) {
|
|
5855
|
-
let c = e && e.isMesh && e.layers.test(n) && !
|
|
5855
|
+
let c = e && e.isMesh && e.layers.test(n) && !z.isGizmo(e);
|
|
5856
5856
|
c &&= e.visible, c &&= !(e instanceof Zl), c &&= !(e instanceof da);
|
|
5857
5857
|
const h = e, d = h.geometry;
|
|
5858
5858
|
if (c && l) {
|
|
@@ -5925,37 +5925,37 @@ var td;
|
|
|
5925
5925
|
return !1;
|
|
5926
5926
|
const k = y.geometry;
|
|
5927
5927
|
if (y?.isSkinnedMesh) {
|
|
5928
|
-
const E = y,
|
|
5928
|
+
const E = y, B = E.bvhNeedsUpdate;
|
|
5929
5929
|
if (!E.staticGenerator)
|
|
5930
5930
|
a(), o && (E.staticGenerator = new o(y), E.staticGenerator.applyWorldTransforms = !1, E.staticGeometry = E.staticGenerator.generate(), k.boundsTree = r?.call(E.staticGeometry), E.staticGeometryLastUpdate = performance.now() + Math.random() * 200, E.bvhNeedsUpdate = !0);
|
|
5931
|
-
else if (k.boundsTree && (E.autoUpdateMeshBvhInterval !== void 0 && E.autoUpdateMeshBvhInterval >= 0 ||
|
|
5932
|
-
const
|
|
5933
|
-
(
|
|
5931
|
+
else if (k.boundsTree && (E.autoUpdateMeshBvhInterval !== void 0 && E.autoUpdateMeshBvhInterval >= 0 || B === !0)) {
|
|
5932
|
+
const L = performance.now(), W = L - E.staticGeometryLastUpdate, X = E.autoUpdateMeshBvhInterval ?? 100;
|
|
5933
|
+
(B || W > X) && ($t && console.warn(`Physics: updating skinned mesh bvh for ${y.name} after ${W.toFixed(2)}ms`), E.bvhNeedsUpdate = !1, E.staticGeometryLastUpdate = L, E.staticGenerator?.generate(E.staticGeometry), k.boundsTree.refit());
|
|
5934
5934
|
}
|
|
5935
5935
|
} else if (!k.boundsTree) {
|
|
5936
5936
|
c || m();
|
|
5937
5937
|
let E = !0;
|
|
5938
5938
|
if ((I.xr || k[p] === !1 || k.getAttribute("position")?.isInterleavedBufferAttribute || k.index && k.index?.isInterleavedBufferAttribute) && (E = !1), E && d) {
|
|
5939
5939
|
if (k[f] === void 0) {
|
|
5940
|
-
let
|
|
5940
|
+
let B = null;
|
|
5941
5941
|
if (_.length > 0) {
|
|
5942
|
-
const
|
|
5943
|
-
|
|
5942
|
+
const L = _.shift();
|
|
5943
|
+
L && !L.running && (B = L);
|
|
5944
5944
|
}
|
|
5945
|
-
if (!
|
|
5946
|
-
const
|
|
5947
|
-
$t && console.log("<<<< worker start",
|
|
5948
|
-
const
|
|
5945
|
+
if (!B && g.length < 3 && (B = new d(), g.push(B)), B != null && !B.running) {
|
|
5946
|
+
const L = y.name;
|
|
5947
|
+
$t && console.log("<<<< worker start", L, B), k[f] = "queued", performance.mark("bvh.create.start");
|
|
5948
|
+
const W = k.clone();
|
|
5949
5949
|
try {
|
|
5950
|
-
|
|
5951
|
-
k[f] = "done", k.boundsTree =
|
|
5952
|
-
}).catch((
|
|
5953
|
-
k[f] = "failed - " +
|
|
5950
|
+
B.generate(W).then((X) => {
|
|
5951
|
+
k[f] = "done", k.boundsTree = X;
|
|
5952
|
+
}).catch((X) => {
|
|
5953
|
+
k[f] = "failed - " + X?.message, k[p] = !1, $t && console.error("Failed to generate mesh bvh on worker", X);
|
|
5954
5954
|
}).finally(() => {
|
|
5955
|
-
$t && console.log(">>>>> worker done",
|
|
5955
|
+
$t && console.log(">>>>> worker done", L, { hasBoundsTre: k.boundsTree != null }), _.push(B), W.dispose(), performance.mark("bvh.create.end"), performance.measure("bvh.create (worker)", "bvh.create.start", "bvh.create.end");
|
|
5956
5956
|
});
|
|
5957
|
-
} catch (
|
|
5958
|
-
console.error("Failed to generate mesh bvh on worker",
|
|
5957
|
+
} catch (X) {
|
|
5958
|
+
console.error("Failed to generate mesh bvh on worker", X);
|
|
5959
5959
|
}
|
|
5960
5960
|
} else
|
|
5961
5961
|
$t && console.warn("No worker available");
|
|
@@ -5963,19 +5963,19 @@ var td;
|
|
|
5963
5963
|
} else (!h || !E) && (a(), n && (performance.mark("bvh.create.start"), k.boundsTree = new n(k), performance.mark("bvh.create.end"), performance.measure("bvh.create", "bvh.create.start", "bvh.create.end")));
|
|
5964
5964
|
}
|
|
5965
5965
|
if (v instanceof Ad) {
|
|
5966
|
-
const E = v,
|
|
5966
|
+
const E = v, B = y.raycast;
|
|
5967
5967
|
if (k.boundsTree)
|
|
5968
5968
|
a(), i && (y.acceleratedRaycast || (y.acceleratedRaycast = i.bind(y), $t && console.debug(`Physics: bind acceleratedRaycast fn to "${y.name}"`)), y.raycast = y.acceleratedRaycast);
|
|
5969
5969
|
else if ($t && console.warn("No bounds tree found for mesh", y.name, { workerTask: k[f], hasAcceleratedRaycast: i != null }), O.allowSlowRaycastFallback === !1)
|
|
5970
5970
|
return $t && console.warn("Skipping raycast because no bounds tree is available and allowSlowRaycastFallback is false"), !1;
|
|
5971
|
-
const
|
|
5972
|
-
return E.firstHitOnly = !1, E.intersectObject(y, !1, x), E.firstHitOnly =
|
|
5971
|
+
const L = E.firstHitOnly;
|
|
5972
|
+
return E.firstHitOnly = !1, E.intersectObject(y, !1, x), E.firstHitOnly = L, y.raycast = B, !0;
|
|
5973
5973
|
} else if (v instanceof Id) {
|
|
5974
5974
|
const E = k.boundsTree;
|
|
5975
5975
|
if (E) {
|
|
5976
|
-
const
|
|
5977
|
-
if (l.copy(y.matrixWorld).invert(),
|
|
5978
|
-
const
|
|
5976
|
+
const B = v;
|
|
5977
|
+
if (l.copy(y.matrixWorld).invert(), B.applyMatrix4(l), E.intersectsSphere(B)) {
|
|
5978
|
+
const W = Z(y), X = W.distanceTo(B.center), A = new s0(y, X, W);
|
|
5979
5979
|
x.push(A);
|
|
5980
5980
|
}
|
|
5981
5981
|
}
|
|
@@ -5989,7 +5989,7 @@ var td;
|
|
|
5989
5989
|
t || (t = !0, import("./vendor-Z4SPrTcP.js").then((v) => v.index$1).then((v) => {
|
|
5990
5990
|
i = v.acceleratedRaycast, n = v.MeshBVH, o = v.StaticGeometryGenerator, r = v.computeBoundsTree;
|
|
5991
5991
|
}).catch((v) => {
|
|
5992
|
-
($t ||
|
|
5992
|
+
($t || D()) && console.error("Failed to load BVH library...", v.message);
|
|
5993
5993
|
}));
|
|
5994
5994
|
}
|
|
5995
5995
|
const l = new te();
|
|
@@ -5999,7 +5999,7 @@ var td;
|
|
|
5999
5999
|
c = !0, h = !0, Promise.resolve().then(() => HA).then((v) => {
|
|
6000
6000
|
d = v.GenerateMeshBVHWorker;
|
|
6001
6001
|
}).catch((v) => {
|
|
6002
|
-
($t ||
|
|
6002
|
+
($t || D()) && console.warn("Failed to setup mesh bvh worker");
|
|
6003
6003
|
}).finally(() => {
|
|
6004
6004
|
h = !1;
|
|
6005
6005
|
});
|
|
@@ -6266,7 +6266,7 @@ function sd(s) {
|
|
|
6266
6266
|
try {
|
|
6267
6267
|
const t = ke[e];
|
|
6268
6268
|
if (t.isComponent !== !0) {
|
|
6269
|
-
(
|
|
6269
|
+
(D() || yp) && console.error(`Registered script is not a Needle Engine component.
|
|
6270
6270
|
The script will be ignored. Please make sure your component extends "Behaviour" imported from "@needle-tools/engine"
|
|
6271
6271
|
`, t), ke.splice(e, 1), e--;
|
|
6272
6272
|
continue;
|
|
@@ -6367,7 +6367,7 @@ function Rh(s, e = !1) {
|
|
|
6367
6367
|
return;
|
|
6368
6368
|
}
|
|
6369
6369
|
const t = yc(s);
|
|
6370
|
-
u0(s, t, !0) || (yp ||
|
|
6370
|
+
u0(s, t, !0) || (yp || D() ? console.error(`Error updating hierarchy
|
|
6371
6371
|
Do you have circular references in your project? <a target="_blank" href="https://docs.needle.tools/circular-reference"> Click here for more information.`, s) : console.error('Failed to update active state in hierarchy of "' + s.name + '"', s), console.warn(" ↑ this error might be caused by circular references. Please make sure you don't have files with circular references (e.g. one GLB 1 is loading GLB 2 which is then loading GLB 1 again)."));
|
|
6372
6372
|
}
|
|
6373
6373
|
function u0(s, e, t, i = 0) {
|
|
@@ -6486,7 +6486,7 @@ function Hd(s, e, t = !0, i) {
|
|
|
6486
6486
|
return;
|
|
6487
6487
|
}
|
|
6488
6488
|
if (!e.isConnected) {
|
|
6489
|
-
|
|
6489
|
+
D() && console.debug("Can not send destroy: not connected", s.guid);
|
|
6490
6490
|
return;
|
|
6491
6491
|
}
|
|
6492
6492
|
let o = s.guid;
|
|
@@ -6543,7 +6543,7 @@ function m0(s, e, t, i) {
|
|
|
6543
6543
|
const n = s;
|
|
6544
6544
|
if (!n.guid)
|
|
6545
6545
|
return console.warn("Can not instantiate: No guid", n), null;
|
|
6546
|
-
if (e.context || (e.context =
|
|
6546
|
+
if (e.context || (e.context = U.Current), !e.context)
|
|
6547
6547
|
return console.error("Missing network instantiate options / reference to network connection in sync instantiate"), null;
|
|
6548
6548
|
const o = e ? { ...e } : null, { instance: r, seed: a } = nP(n, e);
|
|
6549
6549
|
if (r) {
|
|
@@ -6551,7 +6551,7 @@ function m0(s, e, t, i) {
|
|
|
6551
6551
|
if (l.guid) {
|
|
6552
6552
|
od && console.log("[Local] new instance", "gameobject:", r?.guid);
|
|
6553
6553
|
const c = new eP(n.guid, l.guid);
|
|
6554
|
-
c.seed = a, e.deleteOnDisconnect === !0 && (c.deleteStateOnDisconnect = !0), o && (o.position && (c.position = { x: o.position.x, y: o.position.y, z: o.position.z }), o.rotation && (c.rotation = { x: o.rotation.x, y: o.rotation.y, z: o.rotation.z, w: o.rotation.w }), o.scale && (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 : c.parent = o.parent.guid), c.hostData = t, i === !1 && (c.dontSave = !0), !e?.context?.connection &&
|
|
6554
|
+
c.seed = a, e.deleteOnDisconnect === !0 && (c.deleteStateOnDisconnect = !0), o && (o.position && (c.position = { x: o.position.x, y: o.position.y, z: o.position.z }), o.rotation && (c.rotation = { x: o.rotation.x, y: o.rotation.y, z: o.rotation.z, w: o.rotation.w }), o.scale && (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 : c.parent = o.parent.guid), c.hostData = t, i === !1 && (c.dontSave = !0), !e?.context?.connection && D() && console.debug("Object will be instantiated but it will not be synced: not connected", n.guid), e.context.connection.isInRoom && Fr.push(new WeakRef(l)), e?.context?.connection.send("new-instance-created", c);
|
|
6555
6555
|
} else console.warn("Missing guid, can not send new instance event", l);
|
|
6556
6556
|
}
|
|
6557
6557
|
return r;
|
|
@@ -6570,7 +6570,7 @@ function iP(s) {
|
|
|
6570
6570
|
return;
|
|
6571
6571
|
}
|
|
6572
6572
|
const i = new Nn();
|
|
6573
|
-
e.position && (i.position = new b(e.position.x, e.position.y, e.position.z)), e.rotation && (i.rotation = new
|
|
6573
|
+
e.position && (i.position = new b(e.position.x, e.position.y, e.position.z)), e.rotation && (i.rotation = new N(e.rotation.x, e.rotation.y, e.rotation.z, e.rotation.w)), e.scale && (i.scale = new b(e.scale.x, e.scale.y, e.scale.z)), i.parent = e.parent, e.seed && (i.idProvider = new Tt(e.seed)), i.visible = e.visible, i.context = s, od && s.alias && console.log("[Remote] instantiate in: " + s.alias);
|
|
6574
6574
|
const n = va(t, i);
|
|
6575
6575
|
Fr.push(new WeakRef(n)), n && (e.parent === "scene" && s.scene.add(n), od && console.log("[Remote] new instance", "gameobject:", n?.guid, t));
|
|
6576
6576
|
}), s.connection.beginListen("left-room", () => {
|
|
@@ -7254,7 +7254,7 @@ function TP(s) {
|
|
|
7254
7254
|
const e = s.gameObject.userData.components.indexOf(s);
|
|
7255
7255
|
s.gameObject.userData.components.splice(e, 1);
|
|
7256
7256
|
}
|
|
7257
|
-
s.__internalDisable && s.__internalDisable(), cs(s, s.context ??
|
|
7257
|
+
s.__internalDisable && s.__internalDisable(), cs(s, s.context ?? U.Current), s.destroy(), s.gameObject = null;
|
|
7258
7258
|
}
|
|
7259
7259
|
let Hy = !1;
|
|
7260
7260
|
function P0(s, e, t) {
|
|
@@ -7321,7 +7321,7 @@ function Dm(s, e, t, i = !0) {
|
|
|
7321
7321
|
}
|
|
7322
7322
|
function Qd(s, e = void 0, t = !0) {
|
|
7323
7323
|
if (!s) return null;
|
|
7324
|
-
if (!e && (e =
|
|
7324
|
+
if (!e && (e = U.Current, !e))
|
|
7325
7325
|
return console.error("Can not search object without any needle context or scene!!!"), null;
|
|
7326
7326
|
let i = e;
|
|
7327
7327
|
if (i.isScene || (i = e?.scene), !i) return null;
|
|
@@ -7330,7 +7330,7 @@ function Qd(s, e = void 0, t = !0) {
|
|
|
7330
7330
|
}
|
|
7331
7331
|
function EP(s, e, t = void 0) {
|
|
7332
7332
|
if (!s) return e ?? [];
|
|
7333
|
-
if (e || (e = []), e.length = 0, !t && (t =
|
|
7333
|
+
if (e || (e = []), e.length = 0, !t && (t = U.Current, !t))
|
|
7334
7334
|
return console.error("Can not search object without any needle context or scene!!!"), e;
|
|
7335
7335
|
"scene" in t && (t = t.scene);
|
|
7336
7336
|
const i = t;
|
|
@@ -7638,7 +7638,7 @@ function va(s, e) {
|
|
|
7638
7638
|
return s.instantiate(e ?? void 0);
|
|
7639
7639
|
let t = null;
|
|
7640
7640
|
e != null && (e.x !== void 0 ? (t = new Nn(), t.position = e) : t = e);
|
|
7641
|
-
let i =
|
|
7641
|
+
let i = U.Current;
|
|
7642
7642
|
t?.context && (i = t.context), Ah && i.alias && console.log("context", i.alias), t && !t.idProvider && (t.idProvider = new Tt(Date.now()));
|
|
7643
7643
|
const n = [], o = {}, r = {}, a = R0(i, s, t, n, o, r);
|
|
7644
7644
|
a && (jP(o), DP(r, o)), Ah && (hp(s, !0), hp(a, !0));
|
|
@@ -7848,7 +7848,7 @@ var wa;
|
|
|
7848
7848
|
headers: v,
|
|
7849
7849
|
body: p,
|
|
7850
7850
|
signal: d?.abort
|
|
7851
|
-
}).then((
|
|
7851
|
+
}).then((B) => (d?.onProgress?.call(null, { progress01: 1, state: "finished" }), B)).catch((B) => B);
|
|
7852
7852
|
};
|
|
7853
7853
|
console.debug("Uploading file", y.upload);
|
|
7854
7854
|
let I = !1, O = null;
|
|
@@ -7936,7 +7936,7 @@ class ie {
|
|
|
7936
7936
|
* @returns the AssetReference for the URL
|
|
7937
7937
|
*/
|
|
7938
7938
|
static getOrCreateFromUrl(e, t) {
|
|
7939
|
-
if (!t && (t =
|
|
7939
|
+
if (!t && (t = U.Current, !t))
|
|
7940
7940
|
throw new Error('Context is required when sourceId is a string. When you call this method from a component you can call it with "getOrCreate(this, url)" where "this" is the component.');
|
|
7941
7941
|
const i = t.addressables, n = i.findAssetReference(e);
|
|
7942
7942
|
if (n) return n;
|
|
@@ -7949,7 +7949,7 @@ class ie {
|
|
|
7949
7949
|
*/
|
|
7950
7950
|
static getOrCreate(e, t, i) {
|
|
7951
7951
|
if (typeof e == "string") {
|
|
7952
|
-
if (!i && (i =
|
|
7952
|
+
if (!i && (i = U.Current, !i))
|
|
7953
7953
|
throw new Error('Context is required when sourceId is a string. When you call this method from a component you can call it with "getOrCreate(this, url)" where "this" is the component.');
|
|
7954
7954
|
} else
|
|
7955
7955
|
i = e.context, e = e.sourceId;
|
|
@@ -8031,7 +8031,7 @@ class ie {
|
|
|
8031
8031
|
}
|
|
8032
8032
|
/** frees previously allocated memory and destroys the current `asset` instance (if any) */
|
|
8033
8033
|
unload() {
|
|
8034
|
-
this.asset && (js && console.log("Unload", this.asset), "scene" in this.asset && this.asset.scene && Wi(this.asset.scene, !0, !0), Wi(this.asset, !0, !0)), this.asset = null, this._rawBinary = void 0, this._glbRoot = null, this._loadingPromise = null,
|
|
8034
|
+
this.asset && (js && console.log("Unload", this.asset), "scene" in this.asset && this.asset.scene && Wi(this.asset.scene, !0, !0), Wi(this.asset, !0, !0)), this.asset = null, this._rawBinary = void 0, this._glbRoot = null, this._loadingPromise = null, U.Current && U.Current.addressables.unregisterAssetReference(this);
|
|
8035
8035
|
}
|
|
8036
8036
|
/** loads the asset binary without creating an instance */
|
|
8037
8037
|
async preload() {
|
|
@@ -8051,7 +8051,7 @@ class ie {
|
|
|
8051
8051
|
if (js && console.log("[AssetReference] loadAssetAsync", this.url), !this.mustLoad) return this.asset;
|
|
8052
8052
|
if (e && this._progressListeners.push(e), this._loadingPromise !== null)
|
|
8053
8053
|
return this._loadingPromise.then((n) => this.asset);
|
|
8054
|
-
const t =
|
|
8054
|
+
const t = U.Current;
|
|
8055
8055
|
if (this._rawBinary) {
|
|
8056
8056
|
if (!(this._rawBinary instanceof ArrayBuffer))
|
|
8057
8057
|
return console.error("[AssetReference] Failed loading – Invalid data. Must be of type ArrayBuffer. " + typeof this._rawBinary), null;
|
|
@@ -8085,7 +8085,7 @@ class ie {
|
|
|
8085
8085
|
}
|
|
8086
8086
|
static currentlyInstantiating = /* @__PURE__ */ new Map();
|
|
8087
8087
|
async onInstantiate(e, t = !1, i) {
|
|
8088
|
-
const n =
|
|
8088
|
+
const n = U.Current, o = new Nn();
|
|
8089
8089
|
if (e instanceof M ? o.parent = e : e && (Object.assign(o, e), o.cloneAssign(e)), o.parent === void 0 && (o.parent = n.scene), this.mustLoad && await this.loadAssetAsync(), js && console.log("Instantiate", this.url, "parent:", e), this.asset) {
|
|
8090
8090
|
js && console.log("Add to scene", this.asset);
|
|
8091
8091
|
let r = ie.currentlyInstantiating.get(this.url);
|
|
@@ -8341,7 +8341,7 @@ class rc {
|
|
|
8341
8341
|
}
|
|
8342
8342
|
}
|
|
8343
8343
|
function* T0(s, e = null) {
|
|
8344
|
-
const t = e ? e.time :
|
|
8344
|
+
const t = e ? e.time : U.Current.time, i = t.time;
|
|
8345
8345
|
for (; t.time - i < s; )
|
|
8346
8346
|
yield;
|
|
8347
8347
|
}
|
|
@@ -8389,7 +8389,7 @@ class VP {
|
|
|
8389
8389
|
h && a.push(h);
|
|
8390
8390
|
}
|
|
8391
8391
|
const l = await Tb(a);
|
|
8392
|
-
l?.anyFailed &&
|
|
8392
|
+
l?.anyFailed && D() && console.error("Failed to load lightmap extension", l), o();
|
|
8393
8393
|
})) : null;
|
|
8394
8394
|
}
|
|
8395
8395
|
}
|
|
@@ -8504,7 +8504,7 @@ class GP {
|
|
|
8504
8504
|
}
|
|
8505
8505
|
/** @internal */
|
|
8506
8506
|
setRenderer(e) {
|
|
8507
|
-
this._lodsManager?.disable(), Ao.removePlugin(this), Ao.addPlugin(this), Ao.debugDrawLine =
|
|
8507
|
+
this._lodsManager?.disable(), Ao.removePlugin(this), Ao.addPlugin(this), Ao.debugDrawLine = z.DrawLine, this._lodsManager = Ao.get(e, { engine: "needle-engine" }), this.applySettings(), this._lodsManager.enable();
|
|
8508
8508
|
}
|
|
8509
8509
|
disable() {
|
|
8510
8510
|
this._lodsManager?.disable(), Ao.removePlugin(this);
|
|
@@ -8524,7 +8524,7 @@ class GP {
|
|
|
8524
8524
|
th.copy(a), th.applyMatrix4(t.matrixWorld);
|
|
8525
8525
|
const l = th.center, c = th.radius, h = ["#76c43e", "#bcc43e", "#c4ac3e", "#c4673e", "#ff3e3e"];
|
|
8526
8526
|
if (r)
|
|
8527
|
-
|
|
8527
|
+
z.DrawWireSphere(l, c, h[o], 0.1);
|
|
8528
8528
|
else {
|
|
8529
8529
|
const d = t.geometry.index?.count ?? 0, f = We.getMeshLODExtension(t.geometry)?.lods;
|
|
8530
8530
|
o = f ? Math.min(f?.length - 1, o) : 0;
|
|
@@ -8543,8 +8543,8 @@ TEX ` + i.texture_lod;
|
|
|
8543
8543
|
` + (n.lastScreenCoverage * 100).toFixed(1) + `% cov
|
|
8544
8544
|
` + (n.lastCentrality * 100).toFixed(1) + `% centr
|
|
8545
8545
|
` + (eh.min.x.toFixed(2) + "-" + eh.max.x.toFixed(2) + "x" + eh.min.y.toFixed(2) + "-" + eh.max.y.toFixed(2)) + " scr"), n.lastScreenCoverage > 0.1) {
|
|
8546
|
-
const m = e, v = m.worldForward, y = m.worldPosition, I = G(v).multiplyScalar(c * 0.7).add(l), O = I.distanceTo(y), k = h[Math.min(h.length - 1, Math.max(0, o))] + "88", E = this.context.domHeight > 0 ? screen.height / this.context.domHeight : 1,
|
|
8547
|
-
|
|
8546
|
+
const m = e, v = m.worldForward, y = m.worldPosition, I = G(v).multiplyScalar(c * 0.7).add(l), O = I.distanceTo(y), k = h[Math.min(h.length - 1, Math.max(0, o))] + "88", E = this.context.domHeight > 0 ? screen.height / this.context.domHeight : 1, B = e.isPerspectiveCamera ? Math.tan(e.fov * Math.PI / 180 / 2) : 1;
|
|
8547
|
+
z.DrawLabel(I, _, O * 0.012 * E * B, void 0, 16777215, k);
|
|
8548
8548
|
}
|
|
8549
8549
|
}
|
|
8550
8550
|
}
|
|
@@ -8977,7 +8977,7 @@ vec3 NeutralToneMapping( vec3 color ) {
|
|
|
8977
8977
|
if (i >= 0 && n >= 0) {
|
|
8978
8978
|
const o = Wt.tonemapping_pars_fragment.substring(i, n + t.length);
|
|
8979
8979
|
Wt.tonemapping_pars_fragment = Wt.tonemapping_pars_fragment.replace(o, s);
|
|
8980
|
-
} else
|
|
8980
|
+
} else D() && console.error("Couldn't find NeutralToneMapping in ShaderChunk.tonemapping_pars_fragment");
|
|
8981
8981
|
}
|
|
8982
8982
|
function rO() {
|
|
8983
8983
|
const s = `
|
|
@@ -9095,7 +9095,7 @@ vec3 AgXToneMapping( vec3 color ) {
|
|
|
9095
9095
|
if (i >= 0 && n >= 0) {
|
|
9096
9096
|
const o = Wt.tonemapping_pars_fragment.substring(i, n + t.length);
|
|
9097
9097
|
Wt.tonemapping_pars_fragment = Wt.tonemapping_pars_fragment.replace(o, s);
|
|
9098
|
-
} else
|
|
9098
|
+
} else D() && console.error("Couldn't find AgXToneMapping in ShaderChunk.tonemapping_pars_fragment");
|
|
9099
9099
|
}
|
|
9100
9100
|
function A0(s) {
|
|
9101
9101
|
if (typeof s == "string")
|
|
@@ -9171,7 +9171,7 @@ class On {
|
|
|
9171
9171
|
if (this._fullscreenButton)
|
|
9172
9172
|
return this._fullscreenButton;
|
|
9173
9173
|
if (!document.fullscreenEnabled)
|
|
9174
|
-
return
|
|
9174
|
+
return D() && console.warn("NeedleMenu: Fullscreen button could not be created, device doesn't support the Fullscreen API"), null;
|
|
9175
9175
|
const t = document.createElement("button");
|
|
9176
9176
|
this._fullscreenButton = t, t.classList.add("fullscreen-button"), t.title = "Click to enter fullscreen mode";
|
|
9177
9177
|
const i = Mt("fullscreen"), n = Mt("fullscreen_exit");
|
|
@@ -9243,7 +9243,7 @@ class On {
|
|
|
9243
9243
|
const n = document.createElement("div");
|
|
9244
9244
|
n.classList.add("qr-code-container"), i.appendChild(n), t.addEventListener("click", () => {
|
|
9245
9245
|
if (i.parentNode) return r();
|
|
9246
|
-
|
|
9246
|
+
D() && window.location.href.includes("://localhost") && ge("To access your website from another device in the same local network you have to use the IP address instead of localhost. The IP address is logged in your development server console when you start the server."), o();
|
|
9247
9247
|
});
|
|
9248
9248
|
async function o() {
|
|
9249
9249
|
await a();
|
|
@@ -9396,7 +9396,7 @@ class lO {
|
|
|
9396
9396
|
this.menu?.removeFromParent();
|
|
9397
9397
|
return;
|
|
9398
9398
|
}
|
|
9399
|
-
if (mf &&
|
|
9399
|
+
if (mf && q.isDesktop() && this.updateMenu(), !this._context.xr?.running) {
|
|
9400
9400
|
this._wasInXR && (this._wasInXR = !1, this.onExitXR());
|
|
9401
9401
|
return;
|
|
9402
9402
|
}
|
|
@@ -9432,7 +9432,7 @@ class lO {
|
|
|
9432
9432
|
const t = this._context.mainCamera, n = this._context.xr?.rigScale || 1;
|
|
9433
9433
|
if (t) {
|
|
9434
9434
|
const o = t.worldPosition, r = t.worldForward.multiplyScalar(-1), a = r.y > 0.6, l = r.y > 0.4, c = (e.visible ? l : a) || this.userRequestedMenu, h = !e.visible && c;
|
|
9435
|
-
e.visible = c ||
|
|
9435
|
+
e.visible = c || q.isDesktop() && mf, r.multiplyScalar(3 * n), o.add(r), (h || !1) && (e.position.copy(this._menuTarget.position), e.position.y += 0.25, this._menuTarget.position.copy(e.position), this.positionFilter.reset(e.position), e.quaternion.copy(this._menuTarget.quaternion), this.markDirty());
|
|
9436
9436
|
const f = this._menuTarget.position.distanceTo(o);
|
|
9437
9437
|
(h || f > 1.5 * n) && (this.ensureRenderOnTop(this.menu), this._menuTarget.position.copy(o), this._context.scene.add(this._menuTarget), Nd(this._menuTarget, this._context.mainCamera, !0, !0), this._menuTarget.removeFromParent()), this.positionFilter.filter(this._menuTarget.position, e.position, this._context.time.time), this.menu?.quaternion.slerp(this._menuTarget.quaternion, this._context.time.deltaTime * 5), this.menu?.scale.setScalar(n);
|
|
9438
9438
|
}
|
|
@@ -9738,7 +9738,7 @@ let hO = class {
|
|
|
9738
9738
|
* If enabled=true then a button will be added to the menu that will show a QR code for the current page when clicked.
|
|
9739
9739
|
*/
|
|
9740
9740
|
showQRCodeButton(e) {
|
|
9741
|
-
if (e === "desktop-only" && (e = !
|
|
9741
|
+
if (e === "desktop-only" && (e = !q.isMobileDevice()), e) {
|
|
9742
9742
|
const t = On.getOrCreate().createQRCode();
|
|
9743
9743
|
return t.style.display = "", this._menu.appendChild(t), t;
|
|
9744
9744
|
} else {
|
|
@@ -10412,32 +10412,32 @@ var xe = /* @__PURE__ */ ((s) => (s[s.Start = -1] = "Start", s[s.EarlyUpdate = 0
|
|
|
10412
10412
|
function Um(s, e) {
|
|
10413
10413
|
if (!s) return;
|
|
10414
10414
|
if (!s.isComponent) {
|
|
10415
|
-
(
|
|
10415
|
+
(D() || Xe) && console.error(`Registered script is not a Needle Engine component.
|
|
10416
10416
|
The script will be ignored. Please make sure your component extends "Behaviour" imported from "@needle-tools/engine"
|
|
10417
10417
|
`, s);
|
|
10418
10418
|
return;
|
|
10419
10419
|
}
|
|
10420
|
-
e || (e =
|
|
10420
|
+
e || (e = U.Current, Xe && console.warn("> Registering component without context"));
|
|
10421
10421
|
const t = e?.new_scripts;
|
|
10422
10422
|
t.includes(s) || t.push(s);
|
|
10423
10423
|
}
|
|
10424
|
-
class
|
|
10424
|
+
class U {
|
|
10425
10425
|
static _defaultTargetFramerate = { value: 90, toString() {
|
|
10426
10426
|
return this.value;
|
|
10427
10427
|
} };
|
|
10428
10428
|
/** When a new context is created this is the framerate that will be used by default */
|
|
10429
10429
|
static get DefaultTargetFrameRate() {
|
|
10430
|
-
return
|
|
10430
|
+
return U._defaultTargetFramerate.value;
|
|
10431
10431
|
}
|
|
10432
10432
|
/** When a new context is created this is the framerate that will be used by default */
|
|
10433
10433
|
static set DefaultTargetFrameRate(e) {
|
|
10434
|
-
|
|
10434
|
+
U._defaultTargetFramerate.value = e;
|
|
10435
10435
|
}
|
|
10436
10436
|
static _defaultWebglRendererParameters = {
|
|
10437
10437
|
antialias: !0,
|
|
10438
10438
|
alpha: !1,
|
|
10439
10439
|
// Note: this is due to a bug on OSX devices. See NE-5370
|
|
10440
|
-
powerPreference:
|
|
10440
|
+
powerPreference: q.isiOS() || q.isMacOS() ? "default" : "high-performance",
|
|
10441
10441
|
stencil: !0
|
|
10442
10442
|
// logarithmicDepthBuffer: true,
|
|
10443
10443
|
// reverseDepthBuffer: true, // https://github.com/mrdoob/three.js/issues/29770
|
|
@@ -10451,7 +10451,7 @@ class N {
|
|
|
10451
10451
|
* ```
|
|
10452
10452
|
*/
|
|
10453
10453
|
static get DefaultWebGLRendererParameters() {
|
|
10454
|
-
return
|
|
10454
|
+
return U._defaultWebglRendererParameters;
|
|
10455
10455
|
}
|
|
10456
10456
|
/** The needle engine version */
|
|
10457
10457
|
get version() {
|
|
@@ -10764,11 +10764,11 @@ class N {
|
|
|
10764
10764
|
* @returns {WebGLRenderer} the newly created renderer
|
|
10765
10765
|
*/
|
|
10766
10766
|
createNewRenderer(e) {
|
|
10767
|
-
if (this.renderer?.dispose(), e = { ...
|
|
10767
|
+
if (this.renderer?.dispose(), e = { ...U.DefaultWebGLRendererParameters, ...e }, !e.canvas) {
|
|
10768
10768
|
const t = this.domElement?.shadowRoot?.querySelector("canvas");
|
|
10769
10769
|
t && (e.canvas = t, Xe && console.log("Using canvas from shadow root", t));
|
|
10770
10770
|
}
|
|
10771
|
-
return Xe && console.log("Using Renderer Parameters:", e, this.domElement), this.renderer = new ur(e), this.renderer.debug.checkShaderErrors =
|
|
10771
|
+
return Xe && console.log("Using Renderer Parameters:", e, this.domElement), this.renderer = new ur(e), this.renderer.debug.checkShaderErrors = D() || w("checkshadererrors") === !0, this.renderer.toneMappingExposure = 1, this.renderer.toneMapping = Gh, this.renderer.setClearColor(new se("lightgrey"), 0), this.renderer.shadowMap.enabled = !0, this.renderer.shadowMap.type = nx, this.renderer.setSize(this.domWidth, this.domHeight), this.renderer.outputColorSpace = Cs, this.renderer.nodes = {
|
|
10772
10772
|
library: new sx(),
|
|
10773
10773
|
modelViewMatrix: null,
|
|
10774
10774
|
modelNormalViewMatrix: null
|
|
@@ -10876,14 +10876,14 @@ class N {
|
|
|
10876
10876
|
this.internalOnDestroy();
|
|
10877
10877
|
}
|
|
10878
10878
|
internalOnDestroy() {
|
|
10879
|
-
|
|
10879
|
+
U.Current = this, he.dispatchCallback(ce.ContextDestroying, this), mn(this, ce.ContextDestroying), this.clear(), this.renderer?.setAnimationLoop(null), this.renderer && (this.renderer.setClearAlpha(0), this.renderer.clear(), this.isManagedExternally || (Xe && console.log("Disposing renderer"), this.renderer.dispose())), this.scene = null, this.renderer = null, this.input.dispose(), this.menu.onDestroy(), this.animations.onDestroy();
|
|
10880
10880
|
for (const e of this._disposeCallbacks)
|
|
10881
10881
|
try {
|
|
10882
10882
|
e();
|
|
10883
10883
|
} catch (t) {
|
|
10884
10884
|
console.error("Error in on dispose callback:", t, e);
|
|
10885
10885
|
}
|
|
10886
|
-
this.domElement?.parentElement && this.domElement.parentElement.removeChild(this.domElement), this._isCreated = !1, he.dispatchCallback(ce.ContextDestroyed, this), mn(this, ce.ContextDestroyed), he.unregister(this),
|
|
10886
|
+
this.domElement?.parentElement && this.domElement.parentElement.removeChild(this.domElement), this._isCreated = !1, he.dispatchCallback(ce.ContextDestroyed, this), mn(this, ce.ContextDestroyed), he.unregister(this), U.Current === this && (U.Current = null);
|
|
10887
10887
|
}
|
|
10888
10888
|
/** @internal Automatically called by components when you call `startCoroutine`. Use `startCoroutine` instead */
|
|
10889
10889
|
registerCoroutineUpdate(e, t, i) {
|
|
@@ -11016,7 +11016,7 @@ Start a coroutine from a component by calling "this.startCoroutine(myCoroutine()
|
|
|
11016
11016
|
Xe && console.log("Creating context", this.name, e);
|
|
11017
11017
|
const i = globalThis["needle:dependencies:ready"];
|
|
11018
11018
|
i instanceof Promise && (Xe && console.log("Waiting for dependencies to be ready"), await i.catch((c) => {
|
|
11019
|
-
if (Xe ||
|
|
11019
|
+
if (Xe || D()) {
|
|
11020
11020
|
if (Wd("Needle Engine dependencies failed to load. Please check the console for more details"), c instanceof ReferenceError) {
|
|
11021
11021
|
let h = "YourComponentName";
|
|
11022
11022
|
const d = c.message.indexOf("'");
|
|
@@ -11044,10 +11044,10 @@ Possible solutions:
|
|
|
11044
11044
|
Xe && console.log("Needle Engine dependencies are ready");
|
|
11045
11045
|
})), this.clear();
|
|
11046
11046
|
const n = this.renderer, o = !n || n.isDisposed === !0;
|
|
11047
|
-
this.isManagedExternally === !1 && o ? this.createNewRenderer() : this.lodsManager.setRenderer(this.renderer), this.renderer?.setAnimationLoop(null),
|
|
11047
|
+
this.isManagedExternally === !1 && o ? this.createNewRenderer() : this.lodsManager.setRenderer(this.renderer), this.renderer?.setAnimationLoop(null), U.Current = this, await he.dispatchCallback(ce.ContextCreationStart, this);
|
|
11048
11048
|
let r = !0, a;
|
|
11049
11049
|
try {
|
|
11050
|
-
|
|
11050
|
+
U.Current = this, e ? a = await this.internalLoadInitialContent(t, e) : a = [];
|
|
11051
11051
|
} catch (c) {
|
|
11052
11052
|
console.error(c), r = !1;
|
|
11053
11053
|
}
|
|
@@ -11057,7 +11057,7 @@ Possible solutions:
|
|
|
11057
11057
|
return !1;
|
|
11058
11058
|
if (this.internalOnUpdateVisible(), !this.renderer)
|
|
11059
11059
|
return Xe && console.warn("Context has no renderer (perhaps it was disconnected?", this.domElement.isConnected), !1;
|
|
11060
|
-
!this.isManagedExternally && !this.domElement.shadowRoot && this.domElement.prepend(this.renderer.domElement),
|
|
11060
|
+
!this.isManagedExternally && !this.domElement.shadowRoot && this.domElement.prepend(this.renderer.domElement), U.Current = this, U.Current = this;
|
|
11061
11061
|
for (let c = 0; c < this.new_scripts.length; c++) {
|
|
11062
11062
|
const h = this.new_scripts[c];
|
|
11063
11063
|
if (h.gameObject !== void 0 && h.gameObject !== null) {
|
|
@@ -11068,9 +11068,9 @@ Possible solutions:
|
|
|
11068
11068
|
}
|
|
11069
11069
|
if (this.post_setup_callbacks)
|
|
11070
11070
|
for (let c = 0; c < this.post_setup_callbacks.length; c++)
|
|
11071
|
-
|
|
11071
|
+
U.Current = this, await this.post_setup_callbacks[c](this);
|
|
11072
11072
|
if (!this._mainCamera) {
|
|
11073
|
-
|
|
11073
|
+
U.Current = this;
|
|
11074
11074
|
let c = null;
|
|
11075
11075
|
ba(this.scene, (h) => {
|
|
11076
11076
|
const d = h;
|
|
@@ -11082,7 +11082,7 @@ Possible solutions:
|
|
|
11082
11082
|
}
|
|
11083
11083
|
}), c ? this.setCurrentCamera(c) : !he.dispatchCallback(ce.MissingCamera, this, { files: a }) && !this.mainCamera && !this.isManagedExternally && console.warn("Missing camera in main scene", this);
|
|
11084
11084
|
}
|
|
11085
|
-
this.input.bindEvents(),
|
|
11085
|
+
this.input.bindEvents(), U.Current = this, sd(this), this.physics.engine && (this.physics.engine?.step(0), this.physics.engine?.postStep()), !this.isManagedExternally && this.composer && this.mainCamera, this._needsUpdateSize = !0, this._stats && (this._stats.showPanel(0), this._stats.dom.style.position = "absolute", this.domElement.shadowRoot?.appendChild(this._stats.dom)), Xe && hp(this.scene, !0), this.targetFrameRate === void 0 ? (Xe && console.warn("No target framerate set, using default", U.DefaultTargetFrameRate), this.targetFrameRate = U._defaultTargetFramerate) : Xe && console.log("Target framerate set to", this.targetFrameRate), this._dispatchReadyAfterFrame = !0;
|
|
11086
11086
|
const l = he.dispatchCallback(ce.ContextCreated, this, { files: a });
|
|
11087
11087
|
if (l) {
|
|
11088
11088
|
const c = this.domElement;
|
|
@@ -11157,11 +11157,11 @@ Possible solutions:
|
|
|
11157
11157
|
_renderlooperrors = 0;
|
|
11158
11158
|
/** Performs a full update step including script callbacks, rendering (unless isManagedExternally is set to false) and post render callbacks */
|
|
11159
11159
|
update(e, t) {
|
|
11160
|
-
if (t === void 0 && (t = null),
|
|
11160
|
+
if (t === void 0 && (t = null), D() || Xe || G1())
|
|
11161
11161
|
try {
|
|
11162
11162
|
this.internalStep(e, t), this._renderlooperrors = 0;
|
|
11163
11163
|
} catch (i) {
|
|
11164
|
-
this._renderlooperrors += 1, (
|
|
11164
|
+
this._renderlooperrors += 1, (D() || Xe) && (i instanceof Error || i instanceof TypeError) && Be("Caught unhandled exception during render-loop - see console for details.", Ui.Error), console.error("Frame #" + this.time.frame + `
|
|
11165
11165
|
`, i), this._renderlooperrors >= 3 && (console.warn("Stopping render loop due to error"), this.renderer.setAnimationLoop(null)), this.domElement.dispatchEvent(new CustomEvent("error", { detail: i }));
|
|
11166
11166
|
}
|
|
11167
11167
|
else
|
|
@@ -11203,8 +11203,8 @@ Possible solutions:
|
|
|
11203
11203
|
return !1;
|
|
11204
11204
|
this._accumulatedTime = 0;
|
|
11205
11205
|
}
|
|
11206
|
-
if (this._stats?.begin(),
|
|
11207
|
-
for (
|
|
11206
|
+
if (this._stats?.begin(), U.Current = this, this.onHandlePaused()) return !1;
|
|
11207
|
+
for (U.Current = this, this.time.update(), fO && console.log("FPS", this.time.smoothedFps.toFixed(0)), sd(this), Rh(this.scene), d0(this), mn(
|
|
11208
11208
|
this,
|
|
11209
11209
|
-1
|
|
11210
11210
|
/* Start */
|
|
@@ -11224,7 +11224,7 @@ Possible solutions:
|
|
|
11224
11224
|
this._currentFrameEvent = 0;
|
|
11225
11225
|
for (let n = 0; n < this.scripts_earlyUpdate.length; n++) {
|
|
11226
11226
|
const o = this.scripts_earlyUpdate[n];
|
|
11227
|
-
o.activeAndEnabled && o.earlyUpdate !== void 0 && (
|
|
11227
|
+
o.activeAndEnabled && o.earlyUpdate !== void 0 && (U.Current = this, o.earlyUpdate());
|
|
11228
11228
|
}
|
|
11229
11229
|
this.executeCoroutines(
|
|
11230
11230
|
0
|
|
@@ -11236,7 +11236,7 @@ Possible solutions:
|
|
|
11236
11236
|
), this._currentFrameEvent = 1;
|
|
11237
11237
|
for (let n = 0; n < this.scripts_update.length; n++) {
|
|
11238
11238
|
const o = this.scripts_update[n];
|
|
11239
|
-
o.activeAndEnabled && o.update !== void 0 && (
|
|
11239
|
+
o.activeAndEnabled && o.update !== void 0 && (U.Current = this, o.update());
|
|
11240
11240
|
}
|
|
11241
11241
|
this.executeCoroutines(
|
|
11242
11242
|
1
|
|
@@ -11248,7 +11248,7 @@ Possible solutions:
|
|
|
11248
11248
|
), this._currentFrameEvent = 2;
|
|
11249
11249
|
for (let n = 0; n < this.scripts_lateUpdate.length; n++) {
|
|
11250
11250
|
const o = this.scripts_lateUpdate[n];
|
|
11251
|
-
o.activeAndEnabled && o.lateUpdate !== void 0 && (
|
|
11251
|
+
o.activeAndEnabled && o.lateUpdate !== void 0 && (U.Current = this, o.lateUpdate());
|
|
11252
11252
|
}
|
|
11253
11253
|
if (this.executeCoroutines(
|
|
11254
11254
|
2
|
|
@@ -11261,7 +11261,7 @@ Possible solutions:
|
|
|
11261
11261
|
this._focusRect && this.mainCamera instanceof pe && SC(this._focusRect, this.time.deltaTime / 0.05, this.mainCamera, this.renderer), this._currentFrameEvent = 3;
|
|
11262
11262
|
for (let n = 0; n < this.scripts_onBeforeRender.length; n++) {
|
|
11263
11263
|
const o = this.scripts_onBeforeRender[n];
|
|
11264
|
-
o.activeAndEnabled && o.onBeforeRender !== void 0 && (
|
|
11264
|
+
o.activeAndEnabled && o.onBeforeRender !== void 0 && (U.Current = this, o.onBeforeRender(t));
|
|
11265
11265
|
}
|
|
11266
11266
|
if (this.executeCoroutines(
|
|
11267
11267
|
3
|
|
@@ -11296,7 +11296,7 @@ Possible solutions:
|
|
|
11296
11296
|
if (this.isVisibleToUser || this.runInBackground) {
|
|
11297
11297
|
for (let e = 0; e < this.scripts_onAfterRender.length; e++) {
|
|
11298
11298
|
const t = this.scripts_onAfterRender[e];
|
|
11299
|
-
t.activeAndEnabled && t.onAfterRender !== void 0 && (
|
|
11299
|
+
t.activeAndEnabled && t.onAfterRender !== void 0 && (U.Current = this, t.onAfterRender());
|
|
11300
11300
|
}
|
|
11301
11301
|
if (this.executeCoroutines(
|
|
11302
11302
|
4
|
|
@@ -11323,7 +11323,7 @@ Target Framerate: ` + this.targetFrameRate)), this._dispatchReadyAfterFrame && (
|
|
|
11323
11323
|
e && "setMainCamera" in this.composer && this.composer.passes[0]?.mainCamera != e && this.composer.setMainCamera(e);
|
|
11324
11324
|
const t = this.renderer.getClearColor(this._tempClearColor), i = this.renderer.getClearAlpha();
|
|
11325
11325
|
this._tempClearColor2.copy(t), this.renderer.setClearColor(t.convertSRGBToLinear(), this.renderer.getClearAlpha()), this.composer.render(this.time.deltaTime), this.renderer.setClearColor(this._tempClearColor2, i);
|
|
11326
|
-
} else e && (this.isInXR &&
|
|
11326
|
+
} else e && (this.isInXR && q.isMacOS() && this.renderer.clearDepth(), this.renderer.render(this.scene, e));
|
|
11327
11327
|
return this._isRendering = !1, !0;
|
|
11328
11328
|
}
|
|
11329
11329
|
_contextRestoreTries = 0;
|
|
@@ -11338,7 +11338,7 @@ Target Framerate: ` + this.targetFrameRate)), this._dispatchReadyAfterFrame && (
|
|
|
11338
11338
|
uO && console.log("Paused?", e, "context:" + this.alias);
|
|
11339
11339
|
for (let t = 0; t < this.scripts_pausedChanged.length; t++) {
|
|
11340
11340
|
const i = this.scripts_pausedChanged[t];
|
|
11341
|
-
i.activeAndEnabled && i.onPausedChanged !== void 0 && (
|
|
11341
|
+
i.activeAndEnabled && i.onPausedChanged !== void 0 && (U.Current = this, i.onPausedChanged(e, this._wasPaused));
|
|
11342
11342
|
}
|
|
11343
11343
|
}
|
|
11344
11344
|
return this._wasPaused = e, e;
|
|
@@ -11597,7 +11597,7 @@ async function bO(s) {
|
|
|
11597
11597
|
border-radius: .5em;
|
|
11598
11598
|
border: 2px solid rgba(160,160,160,.3);
|
|
11599
11599
|
`, n = `Needle Engine — No license active, commercial use is not allowed. Visit https://needle.tools/pricing for more information and licensing options! v${En}`;
|
|
11600
|
-
|
|
11600
|
+
U.Current?.xr ? console.log(n) : console.log("%c " + n, t);
|
|
11601
11601
|
}
|
|
11602
11602
|
async function vO(s) {
|
|
11603
11603
|
if (window.crossOriginIsolated) return;
|
|
@@ -11828,7 +11828,7 @@ class S extends M {
|
|
|
11828
11828
|
* @param processStart Whether to process the start callbacks if being activated
|
|
11829
11829
|
*/
|
|
11830
11830
|
static setActive(e, t, i = !0) {
|
|
11831
|
-
e && (Ih(e, t), Rh(e), t && i && d0(
|
|
11831
|
+
e && (Ih(e, t), Rh(e), t && i && d0(U.Current, e));
|
|
11832
11832
|
}
|
|
11833
11833
|
/**
|
|
11834
11834
|
* Checks if the GameObject itself is active (same as go.visible)
|
|
@@ -11893,7 +11893,7 @@ class S extends M {
|
|
|
11893
11893
|
static destroySynced(e, t, i = !0) {
|
|
11894
11894
|
if (!e) return;
|
|
11895
11895
|
const n = e;
|
|
11896
|
-
t = t ??
|
|
11896
|
+
t = t ?? U.Current, Hd(n, t.connection, i);
|
|
11897
11897
|
}
|
|
11898
11898
|
/**
|
|
11899
11899
|
* Destroys an object
|
|
@@ -11915,7 +11915,7 @@ class S extends M {
|
|
|
11915
11915
|
console.warn("Can not add object to self", e);
|
|
11916
11916
|
return;
|
|
11917
11917
|
}
|
|
11918
|
-
i || (i =
|
|
11918
|
+
i || (i = U.Current), t.add(e), Ih(e, !0), Rh(e), i ? S.foreachComponent(e, (n) => {
|
|
11919
11919
|
Am(n, i), !n.__internalDidAwakeAndStart && i.new_script_start.includes(n) === !1 && i.new_script_start.push(n);
|
|
11920
11920
|
}, !0) : console.warn("Missing context");
|
|
11921
11921
|
}
|
|
@@ -12029,7 +12029,7 @@ class S extends M {
|
|
|
12029
12029
|
* @returns The first matching component if found, otherwise null
|
|
12030
12030
|
*/
|
|
12031
12031
|
static findObjectOfType(e, t, i = !0) {
|
|
12032
|
-
return Qd(e, t ??
|
|
12032
|
+
return Qd(e, t ?? U.Current, i);
|
|
12033
12033
|
}
|
|
12034
12034
|
/**
|
|
12035
12035
|
* Finds all objects of the specified component type in the scene
|
|
@@ -12114,7 +12114,7 @@ class T {
|
|
|
12114
12114
|
* including physics, timing utilities, camera, and scene
|
|
12115
12115
|
*/
|
|
12116
12116
|
get context() {
|
|
12117
|
-
return this.__context ??
|
|
12117
|
+
return this.__context ?? U.Current;
|
|
12118
12118
|
}
|
|
12119
12119
|
set context(e) {
|
|
12120
12120
|
this.__context = e;
|
|
@@ -12327,7 +12327,7 @@ class T {
|
|
|
12327
12327
|
}
|
|
12328
12328
|
/** @internal */
|
|
12329
12329
|
__internalEnable(e) {
|
|
12330
|
-
return this.__destroyed ? (
|
|
12330
|
+
return this.__destroyed ? (D() && console.warn("[Needle Engine Dev] Trying to enable destroyed component"), !1) : this.__didAwake ? this.__didEnable ? (e !== !0 && (this.__isEnabled = !0), !1) : (this.__didEnable = !0, this.__isEnabled = !0, this.onEnable(), !0) : !1;
|
|
12331
12331
|
}
|
|
12332
12332
|
/** @internal */
|
|
12333
12333
|
__internalDisable(e) {
|
|
@@ -12352,7 +12352,7 @@ class T {
|
|
|
12352
12352
|
}
|
|
12353
12353
|
set enabled(e) {
|
|
12354
12354
|
if (this.__destroyed) {
|
|
12355
|
-
|
|
12355
|
+
D() && console.warn(`[Needle Engine Dev] Trying to ${e ? "enable" : "disable"} destroyed component`);
|
|
12356
12356
|
return;
|
|
12357
12357
|
}
|
|
12358
12358
|
if (typeof e == "number" && (e >= 0.5 ? e = !0 : e = !1), !this.__didAwake) {
|
|
@@ -12860,7 +12860,7 @@ function EO(s) {
|
|
|
12860
12860
|
class YI {
|
|
12861
12861
|
_context;
|
|
12862
12862
|
get context() {
|
|
12863
|
-
return this._context ??
|
|
12863
|
+
return this._context ?? U.Current;
|
|
12864
12864
|
}
|
|
12865
12865
|
get isStateMachineBehaviour() {
|
|
12866
12866
|
return !0;
|
|
@@ -13230,7 +13230,7 @@ class on {
|
|
|
13230
13230
|
}
|
|
13231
13231
|
}
|
|
13232
13232
|
setStartTransition() {
|
|
13233
|
-
this.model.layers.length > 1 && (et ||
|
|
13233
|
+
this.model.layers.length > 1 && (et || D()) && console.warn("Multiple layers are not supported yet " + this.animator?.name);
|
|
13234
13234
|
for (const e of this.model.layers) {
|
|
13235
13235
|
const t = e.stateMachine;
|
|
13236
13236
|
t.defaultState === void 0 && (et && console.warn("AnimatorController default state is undefined, will assign state 0 as default", e), t.defaultState = 0);
|
|
@@ -13381,7 +13381,7 @@ Exit Time: ` + c, o.hasExitTime);
|
|
|
13381
13381
|
r.conditions || (r.conditions = []);
|
|
13382
13382
|
if (o.motion || (et && console.warn("No motion", o), o.motion = AO(o.name)), this.animator && o.motion.clips) {
|
|
13383
13383
|
const r = o.motion.clips?.find((a) => a.node.name === this.animator?.gameObject?.name);
|
|
13384
|
-
r ? o.motion.clip = r.clip : (et ||
|
|
13384
|
+
r ? o.motion.clip = r.clip : (et || D()) && console.warn('Could not find clip for animator "' + this.animator?.gameObject?.name + '"', o.motion.clips.map((a) => a.node.name));
|
|
13385
13385
|
}
|
|
13386
13386
|
if (!o.motion.clip) {
|
|
13387
13387
|
et && console.warn("No clip assigned to state", o);
|
|
@@ -13394,7 +13394,7 @@ Exit Time: ` + c, o.hasExitTime);
|
|
|
13394
13394
|
const a = this.createAction(r);
|
|
13395
13395
|
o.motion.action = a;
|
|
13396
13396
|
} else
|
|
13397
|
-
(et ||
|
|
13397
|
+
(et || D()) && console.warn("No valid animationclip assigned", o);
|
|
13398
13398
|
}
|
|
13399
13399
|
if (o.behaviours && Array.isArray(o.behaviours))
|
|
13400
13400
|
for (const r of o.behaviours) {
|
|
@@ -13404,7 +13404,7 @@ Exit Time: ` + c, o.hasExitTime);
|
|
|
13404
13404
|
const l = new a();
|
|
13405
13405
|
l.isStateMachineBehaviour && (l._context = this.context ?? void 0, ya(l, r.properties), r.instance = l), et && console.log("Created animator controller behaviour", o.name, r.typeName, r.properties, l);
|
|
13406
13406
|
} else
|
|
13407
|
-
(et ||
|
|
13407
|
+
(et || D()) && console.warn("Could not find AnimatorBehaviour type: " + r.typeName);
|
|
13408
13408
|
}
|
|
13409
13409
|
}
|
|
13410
13410
|
}
|
|
@@ -13483,13 +13483,13 @@ class nt {
|
|
|
13483
13483
|
rotationWrapper = null;
|
|
13484
13484
|
context;
|
|
13485
13485
|
positionChange = new b();
|
|
13486
|
-
rotationChange = new
|
|
13486
|
+
rotationChange = new N();
|
|
13487
13487
|
constructor(e, t, i, n, o) {
|
|
13488
|
-
if (this.context = e, this.root = t, this.clip = i, nt.firstKeyframeRotation[this.cacheId] || (nt.firstKeyframeRotation[this.cacheId] = new
|
|
13488
|
+
if (this.context = e, this.root = t, this.clip = i, nt.firstKeyframeRotation[this.cacheId] || (nt.firstKeyframeRotation[this.cacheId] = new N()), o) {
|
|
13489
13489
|
const r = o.values;
|
|
13490
13490
|
nt.firstKeyframeRotation[this.cacheId].set(r[0], r[1], r[2], r[3]);
|
|
13491
13491
|
}
|
|
13492
|
-
nt.spaceRotation[this.cacheId] || (nt.spaceRotation[this.cacheId] = new
|
|
13492
|
+
nt.spaceRotation[this.cacheId] || (nt.spaceRotation[this.cacheId] = new N()), nt.effectiveSpaceRotation[this.cacheId] || (nt.effectiveSpaceRotation[this.cacheId] = new N()), nt.clipOffsetRotation[this.cacheId] = new N(), o && nt.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);
|
|
13493
13493
|
}
|
|
13494
13494
|
onStart(e) {
|
|
13495
13495
|
if (e.getClip() !== this.clip) return;
|
|
@@ -13515,17 +13515,17 @@ class nt {
|
|
|
13515
13515
|
});
|
|
13516
13516
|
}
|
|
13517
13517
|
}
|
|
13518
|
-
static identityQuaternion = new
|
|
13518
|
+
static identityQuaternion = new N();
|
|
13519
13519
|
handleRotation(e, t) {
|
|
13520
13520
|
if (t) {
|
|
13521
13521
|
if (oh) {
|
|
13522
|
-
const r = t.values, a = new Rt().setFromQuaternion(new
|
|
13522
|
+
const r = t.values, a = new Rt().setFromQuaternion(new N(r[0], r[1], r[2], r[3]));
|
|
13523
13523
|
console.log(e.name, t.name, "FIRST ROTATION IN TRACK", j.toDegrees(a.y));
|
|
13524
|
-
const l = t.values.length - 4, c = new
|
|
13524
|
+
const l = t.values.length - 4, c = new N().set(r[l], r[l + 1], r[l + 2], r[l + 3]), h = new Rt().setFromQuaternion(c);
|
|
13525
13525
|
console.log(e.name, t.name, "LAST ROTATION IN TRACK", j.toDegrees(h.y));
|
|
13526
13526
|
}
|
|
13527
13527
|
let i = 0;
|
|
13528
|
-
const n = new
|
|
13528
|
+
const n = new N(), o = new N();
|
|
13529
13529
|
this.rotationWrapper = new c_(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));
|
|
13530
13530
|
}
|
|
13531
13531
|
}
|
|
@@ -13542,7 +13542,7 @@ class IO {
|
|
|
13542
13542
|
handler = [];
|
|
13543
13543
|
root;
|
|
13544
13544
|
basePosition = new b();
|
|
13545
|
-
baseQuaternion = new
|
|
13545
|
+
baseQuaternion = new N();
|
|
13546
13546
|
baseRotation = new Rt();
|
|
13547
13547
|
constructor(e) {
|
|
13548
13548
|
this.controller = e;
|
|
@@ -13564,7 +13564,7 @@ class IO {
|
|
|
13564
13564
|
t.onBeforeUpdate(e);
|
|
13565
13565
|
}
|
|
13566
13566
|
summedPosition = new b();
|
|
13567
|
-
summedRotation = new
|
|
13567
|
+
summedRotation = new N();
|
|
13568
13568
|
onAfterUpdate(e) {
|
|
13569
13569
|
if (!(e <= 0)) {
|
|
13570
13570
|
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);
|
|
@@ -13997,7 +13997,7 @@ class Ms extends T {
|
|
|
13997
13997
|
const l = $e(this.gameObject).x;
|
|
13998
13998
|
a.y = r + this._height * l - i, a.z = o.min.z + (o.max.z - o.min.z) * 0.5, ut(this._projection, a);
|
|
13999
13999
|
}
|
|
14000
|
-
rh &&
|
|
14000
|
+
rh && z.DrawWireBox3(o, 65280, 5);
|
|
14001
14001
|
}
|
|
14002
14002
|
this.context.scene.backgroundBlurriness > 1e-3 && this._needsTextureUpdate && this.updateBlurriness(e, this.context.scene.backgroundBlurriness), this._lastBackground = e, this._lastHeight = this._height, this._lastRadius = this._radius, this._needsTextureUpdate = !1;
|
|
14003
14003
|
}
|
|
@@ -14303,13 +14303,13 @@ function $O(s, e, t, i, n) {
|
|
|
14303
14303
|
const r = Symbol(o), a = s.__internalAwake;
|
|
14304
14304
|
s.__internalAwake = function() {
|
|
14305
14305
|
if (!this.onValidate) {
|
|
14306
|
-
|
|
14306
|
+
D() && console.warn('Usage of @validate decorate detected but there is no onValidate method in your class: "' + s.constructor?.name + '"');
|
|
14307
14307
|
return;
|
|
14308
14308
|
}
|
|
14309
14309
|
if (this[r] === void 0) {
|
|
14310
14310
|
this[r] = this[o];
|
|
14311
14311
|
const l = this[o];
|
|
14312
|
-
if (l instanceof J || l instanceof b || l instanceof de || l instanceof
|
|
14312
|
+
if (l instanceof J || l instanceof b || l instanceof de || l instanceof N) {
|
|
14313
14313
|
const c = this[o];
|
|
14314
14314
|
bm(c, () => {
|
|
14315
14315
|
this.onValidate(o);
|
|
@@ -14521,7 +14521,7 @@ const ei = class Bh extends T {
|
|
|
14521
14521
|
this._watch = void 0, this._propertiesChanged = !1;
|
|
14522
14522
|
}
|
|
14523
14523
|
onEnable() {
|
|
14524
|
-
this._watch || (this._watch = new HO(this.gameObject, this.context)), this._watch.start(!0, !0), this.startCoroutine(this.beforePhysics(), xe.LateUpdate),
|
|
14524
|
+
this._watch || (this._watch = new HO(this.gameObject, this.context)), this._watch.start(!0, !0), this.startCoroutine(this.beforePhysics(), xe.LateUpdate), D() && (globalThis.NEEDLE_USE_RAPIER ? R.RAPIER_PHYSICS.ready().then(async () => {
|
|
14525
14525
|
await Ud(3), this.context.physics.engine?.getBody(this) || console.warn(`Rigidbody could not be created. Ensure "${this.name}" has a Collider component.`);
|
|
14526
14526
|
}) : console.warn("Rigidbody could not be created: Rapier physics are explicitly disabled."));
|
|
14527
14527
|
}
|
|
@@ -14762,7 +14762,7 @@ class Fn extends T {
|
|
|
14762
14762
|
receivedDataCallback = null;
|
|
14763
14763
|
/** @internal */
|
|
14764
14764
|
awake() {
|
|
14765
|
-
Vs && console.log("new instance", this.guid, this), this._receivedDataBefore = !1, this._targetPosition = new b(), this._targetRotation = new
|
|
14765
|
+
Vs && console.log("new instance", this.guid, this), this._receivedDataBefore = !1, this._targetPosition = new b(), this._targetRotation = new N(), this.lastPosition = new b(), this.lastRotation = new N(), this.lastScale = new b(), this.rb = S.getComponentInChildren(this.gameObject, ft), this.rb && (this._wasKinematic = this.rb.isKinematic), this.receivedUpdate = !0, this._model = new i0(this.context.connection, this.guid), this.context.connection.isConnected && this.tryGetLastState(), this.joinedRoomCallback = this.tryGetLastState.bind(this), this.context.connection.beginListen(ee.JoinedRoom, this.joinedRoomCallback), this.receivedDataCallback = this.onReceivedData.bind(this), this.context.connection.beginListenBinary(lc, this.receivedDataCallback);
|
|
14766
14766
|
}
|
|
14767
14767
|
/** @internal */
|
|
14768
14768
|
onDestroy() {
|
|
@@ -15031,7 +15031,7 @@ class me {
|
|
|
15031
15031
|
if (l) {
|
|
15032
15032
|
const c = o.arguments?.map((h) => h instanceof Object && h.uuid ? e[h.uuid] : h?.isComponent ? e[h.guid] : h);
|
|
15033
15033
|
t.push(new Qs(l.clone, o.methodName, c, o.enabled));
|
|
15034
|
-
} else
|
|
15034
|
+
} else D() && console.warn("Could not find target for event listener");
|
|
15035
15035
|
}
|
|
15036
15036
|
}
|
|
15037
15037
|
}
|
|
@@ -15154,7 +15154,7 @@ class QO extends Xi {
|
|
|
15154
15154
|
if (e.endsWith(".glb") || e.endsWith(".gltf")) {
|
|
15155
15155
|
if (t.serializable instanceof Array && t.serializable.includes(ie))
|
|
15156
15156
|
return;
|
|
15157
|
-
|
|
15157
|
+
D() && ge("Detected wrong usage of @serializable with Object3D or GameObject. Instead you should use AssetReference here! Please see the console for details.");
|
|
15158
15158
|
const i = t.target?.constructor?.name;
|
|
15159
15159
|
console.warn(`Wrong usage of @serializable detected in your script "${i}"
|
|
15160
15160
|
|
|
@@ -15179,7 +15179,7 @@ ${t.path}! : AssetReference;
|
|
|
15179
15179
|
}
|
|
15180
15180
|
let i;
|
|
15181
15181
|
const n = t.gltf?.scene;
|
|
15182
|
-
return n && (i = S.findByGuid(e.guid, n)), i || (i = S.findByGuid(e.guid, t.context.scene)), i ? (i && i.isComponent === !0 && (dt && console.warn("Deserialized object reference is a component"), i = i.gameObject), dt && console.log("Deserialized object reference?", e, i, t?.nodeToObject)) : ((
|
|
15182
|
+
return n && (i = S.findByGuid(e.guid, n)), i || (i = S.findByGuid(e.guid, t.context.scene)), i ? (i && i.isComponent === !0 && (dt && console.warn("Deserialized object reference is a component"), i = i.gameObject), dt && console.log("Deserialized object reference?", e, i, t?.nodeToObject)) : ((D() || dt) && console.warn("Could not resolve object reference", t.path, e, t.target, t.context.scene), e.could_not_resolve = !0), i;
|
|
15183
15183
|
}
|
|
15184
15184
|
}
|
|
15185
15185
|
}
|
|
@@ -15204,7 +15204,7 @@ class KO extends Xi {
|
|
|
15204
15204
|
let n = this.findObjectForGuid(e.guid, t.root);
|
|
15205
15205
|
if (n || t.context && (n = this.findObjectForGuid(e.guid, t.context?.scene), n))
|
|
15206
15206
|
return n;
|
|
15207
|
-
(
|
|
15207
|
+
(D() || dt) && console.warn('Could not resolve component reference: "' + i + '" using guid ' + e.guid, t.target), e.could_not_resolve = !0;
|
|
15208
15208
|
return;
|
|
15209
15209
|
}
|
|
15210
15210
|
}
|
|
@@ -15271,7 +15271,7 @@ Could not find method ${r.method} on object ${l.name}`, l, typeof l[r.method]);
|
|
|
15271
15271
|
}
|
|
15272
15272
|
p = Object.getPrototypeOf(p);
|
|
15273
15273
|
}
|
|
15274
|
-
!f && (
|
|
15274
|
+
!f && (D() || dt) && h();
|
|
15275
15275
|
}
|
|
15276
15276
|
}
|
|
15277
15277
|
if (l) {
|
|
@@ -15283,7 +15283,7 @@ Could not find method ${r.method} on object ${l.name}`, l, typeof l[r.method]);
|
|
|
15283
15283
|
const f = new Qs(l, r.method, h, r.enabled);
|
|
15284
15284
|
i.push(f);
|
|
15285
15285
|
}
|
|
15286
|
-
} else
|
|
15286
|
+
} else D() && console.warn(`[Dev] EventList: Could not find event listener in scene (${t.object?.name})`, r);
|
|
15287
15287
|
}
|
|
15288
15288
|
const n = new me(i);
|
|
15289
15289
|
dt && console.log(n);
|
|
@@ -15498,7 +15498,7 @@ class Jt extends T {
|
|
|
15498
15498
|
}
|
|
15499
15499
|
/** Get the currently active event system */
|
|
15500
15500
|
static get instance() {
|
|
15501
|
-
return this.get(
|
|
15501
|
+
return this.get(U.Current);
|
|
15502
15502
|
}
|
|
15503
15503
|
raycaster = [];
|
|
15504
15504
|
register(e) {
|
|
@@ -15768,7 +15768,7 @@ class Jt extends T {
|
|
|
15768
15768
|
const n = this._capturedPointer[i] || [];
|
|
15769
15769
|
n.push(t), this._capturedPointer[i] = n;
|
|
15770
15770
|
} else
|
|
15771
|
-
|
|
15771
|
+
D() && !t.z__warned_no_pointermove && (t.z__warned_no_pointermove = !0, console.warn("PointerCapture was requested but the component doesn't implement onPointerMove. It will not receive any pointer events"));
|
|
15772
15772
|
} else e.z__pointer_cture_rleased && (e.z__pointer_cture_rleased = !1, this.releasePointerCapture(e, t));
|
|
15773
15773
|
}
|
|
15774
15774
|
/** removes the component from the pointer capture list */
|
|
@@ -16064,7 +16064,7 @@ class ye extends T {
|
|
|
16064
16064
|
this._controls.target.copy(l);
|
|
16065
16065
|
}
|
|
16066
16066
|
if (this._controls)
|
|
16067
|
-
if (bf && (this.enablePan = !0, this.enableZoom = !0, this.middleClickToFocus = !0,
|
|
16067
|
+
if (bf && (this.enablePan = !0, this.enableZoom = !0, this.middleClickToFocus = !0, q.isMobileDevice() && (this.doubleClickToFocus = !0)), this._controls.addEventListener("start", this.onControlsChangeStarted), this._controls.addEventListener("endMovement", this.onControlsChangeEnded), !this._startedListeningToKeyEvents && this.enableKeys)
|
|
16068
16068
|
this._startedListeningToKeyEvents = !0, this._controls.listenToKeyEvents(this.context.domElement);
|
|
16069
16069
|
else
|
|
16070
16070
|
try {
|
|
@@ -16117,7 +16117,7 @@ class ye extends T {
|
|
|
16117
16117
|
};
|
|
16118
16118
|
updateTargetNow(e) {
|
|
16119
16119
|
const t = new lo(this._cameraObject?.worldPosition, this._cameraObject?.worldForward.multiplyScalar(-1)), i = this.context.physics.raycastFromRay(t, e), n = i.length > 0 ? i[0] : void 0;
|
|
16120
|
-
n && n.distance > this.minZoom && n.distance < this.maxZoom && (Ai &&
|
|
16120
|
+
n && n.distance > this.minZoom && n.distance < this.maxZoom && (Ai && z.DrawWireSphere(n.point, 0.1, 16711680, 2), this._controls?.target.copy(i[0].point));
|
|
16121
16121
|
}
|
|
16122
16122
|
_orbitStartAngle = 0;
|
|
16123
16123
|
_zoomStartDistance = 0;
|
|
@@ -16149,7 +16149,7 @@ class ye extends T {
|
|
|
16149
16149
|
if (t && !this.setLookTargetFromConstraint()) {
|
|
16150
16150
|
this.debugLog && console.log("NO TARGET");
|
|
16151
16151
|
const i = Z(t.threeCamera), n = Math.max(0.01, i.length()), o = new b(0, 0, -n).applyMatrix4(t.threeCamera.matrixWorld);
|
|
16152
|
-
Ai &&
|
|
16152
|
+
Ai && z.DrawLine(i, o, 5592575, 10), this.setLookTargetPosition(o, !0);
|
|
16153
16153
|
}
|
|
16154
16154
|
if (!this.setLookTargetFromConstraint()) {
|
|
16155
16155
|
const i = new mr();
|
|
@@ -16190,7 +16190,7 @@ class ye extends T {
|
|
|
16190
16190
|
const t = typeof ah == "number" ? ah : 0.99;
|
|
16191
16191
|
this._controls.dampingFactor = Math.max(1e-3, 1 - Math.min(1, t));
|
|
16192
16192
|
}
|
|
16193
|
-
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 || (!bf && this.lookAtConstraint?.locked && !this._lookTargetLerpActive && this.setLookTargetFromConstraint(0, this.lookAtConstraint01), this._controls.update(this.context.time.deltaTime), Ai &&
|
|
16193
|
+
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 || (!bf && this.lookAtConstraint?.locked && !this._lookTargetLerpActive && this.setLookTargetFromConstraint(0, this.lookAtConstraint01), this._controls.update(this.context.time.deltaTime), Ai && z.DrawWireSphere(this._controls.target, 0.1, 65280));
|
|
16194
16194
|
}
|
|
16195
16195
|
}
|
|
16196
16196
|
__onPreRender = () => {
|
|
@@ -16212,14 +16212,14 @@ class ye extends T {
|
|
|
16212
16212
|
*/
|
|
16213
16213
|
setCameraAndLookTarget(e, t = !1) {
|
|
16214
16214
|
if (!e)
|
|
16215
|
-
return (
|
|
16215
|
+
return (D() || Ai) && console.warn("[OrbitControls] setCameraAndLookTarget target is null"), !1;
|
|
16216
16216
|
if (!(e instanceof M) && !(e instanceof ui))
|
|
16217
|
-
return (
|
|
16217
|
+
return (D() || Ai) && console.warn("[OrbitControls] setCameraAndLookTarget target is not an Object3D or Camera"), !1;
|
|
16218
16218
|
e instanceof ui && (e = e.gameObject);
|
|
16219
16219
|
const i = e.worldPosition, n = e.worldForward;
|
|
16220
16220
|
e instanceof ax && (Ai && console.debug("[OrbitControls] setCameraAndLookTarget flip forward direction for camera"), n.multiplyScalar(-1));
|
|
16221
16221
|
const o = new lo(i, n);
|
|
16222
|
-
return Ai &&
|
|
16222
|
+
return Ai && z.DrawRay(o.origin, o.direction, 16711680, 10), this.setTargetFromRaycast(o, t) || this.setLookTargetPosition(o.at(2, G()), t), this.setCameraTargetPosition(i, t), !0;
|
|
16223
16223
|
}
|
|
16224
16224
|
/** Moves the camera to position smoothly.
|
|
16225
16225
|
* @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.
|
|
@@ -16270,7 +16270,7 @@ class ye extends T {
|
|
|
16270
16270
|
* @param immediateOrDuration If true the camera target will move immediately to the new position, otherwise it will lerp. If a number is passed in it will be used as the duration of the lerp.
|
|
16271
16271
|
*/
|
|
16272
16272
|
setLookTargetPosition(e = null, t = !1) {
|
|
16273
|
-
this._controls && e && (e instanceof M && (e = Z(e)), this._lookTargetEndPosition.copy(e), this._didSetTarget++, Ai && (console.warn("OrbitControls: setLookTargetPosition", e, t),
|
|
16273
|
+
this._controls && e && (e instanceof M && (e = Z(e)), this._lookTargetEndPosition.copy(e), this._didSetTarget++, Ai && (console.warn("OrbitControls: setLookTargetPosition", e, t), z.DrawWireSphere(this._lookTargetEndPosition, 0.2, 16711680, 2)), t === !0 ? this.lerpLookTarget(this._lookTargetEndPosition, this._lookTargetEndPosition, 1) : (this._lookTargetLerpActive = !0, this._lookTargetLerp01 = 0, this._lookTargetStartPosition.copy(this._controls.target), typeof t == "number" ? this._lookTargetLerpDuration = t : this._lookTargetLerpDuration = this.targetLerpDuration));
|
|
16274
16274
|
}
|
|
16275
16275
|
/** True while the camera look target is being lerped */
|
|
16276
16276
|
get lookTargetLerpActive() {
|
|
@@ -16310,8 +16310,10 @@ class ye extends T {
|
|
|
16310
16310
|
return !1;
|
|
16311
16311
|
}
|
|
16312
16312
|
fitCamera(e, t) {
|
|
16313
|
-
if (this.context.isInXR)
|
|
16313
|
+
if (this.context.isInXR) {
|
|
16314
|
+
console.warn("[OrbitControls] Can not fit camera while XR session is active");
|
|
16314
16315
|
return;
|
|
16316
|
+
}
|
|
16315
16317
|
let i;
|
|
16316
16318
|
if (Array.isArray(e) ? i = e : e && "type" in e ? i = e.children : e && typeof e == "object" && !(e instanceof M) && !Array.isArray(e) && (t = e, i = t.objects), i && !Array.isArray(i) && (i = i.children), (!Array.isArray(i) || i && i.length <= 0) && (i = this.context.scene.children), !Array.isArray(i) || i.length <= 0) {
|
|
16317
16319
|
console.warn("No objects to fit camera to...");
|
|
@@ -16323,7 +16325,7 @@ class ye extends T {
|
|
|
16323
16325
|
return;
|
|
16324
16326
|
}
|
|
16325
16327
|
t || (t = {});
|
|
16326
|
-
const { immediate: r = !1, centerCamera: a
|
|
16328
|
+
const { immediate: r = !1, centerCamera: a, cameraNearFar: l = "auto", fitOffset: c = 1.1, fov: h = n?.fov } = t, d = new b(), f = new b(), p = _i(i, void 0, this._camera?.threeCamera?.layers), g = p.clone();
|
|
16327
16329
|
n.updateMatrixWorld(), n.updateProjectionMatrix(), p.getCenter(f);
|
|
16328
16330
|
const _ = new b();
|
|
16329
16331
|
if (p.getSize(_), p.applyMatrix4(n.matrixWorldInverse), p.getSize(d), p.setFromCenterAndSize(f, d), Number.isNaN(d.x) || Number.isNaN(d.y) || Number.isNaN(d.z)) {
|
|
@@ -16337,21 +16339,21 @@ class ye extends T {
|
|
|
16337
16339
|
const m = h, v = 2 * Math.atan(Math.tan(m * Math.PI / 360 / 2) * n.aspect) / Math.PI * 360, y = d.y / (2 * Math.atan(Math.PI * m / 360)), x = d.x / (2 * Math.atan(Math.PI * v / 360)), I = c * Math.max(y, x) + d.z / 2;
|
|
16338
16340
|
nl && console.log("Fit camera to objects", { fitHeightDistance: y, fitWidthDistance: x, distance: I, verticalFov: m, horizontalFov: v }), this.maxZoom = I * 10, this.minZoom = I * 0.01;
|
|
16339
16341
|
const O = 0.05, k = f.clone();
|
|
16340
|
-
if (k.y -= d.y * O, this.setLookTargetPosition(k, r), this.setFieldOfView(t.fov, r), l == null || l == "auto") {
|
|
16341
|
-
const
|
|
16342
|
-
n.near = I / 100, n.far =
|
|
16342
|
+
if (k.y -= d.y * O, t.targetOffset && (t.targetOffset.x !== void 0 && (k.x += t.targetOffset.x), t.targetOffset.y !== void 0 && (k.y += t.targetOffset.y), t.targetOffset.z !== void 0 && (k.z += t.targetOffset.z)), t.relativeTargetOffset && (t.relativeTargetOffset.x !== void 0 && (k.x += t.relativeTargetOffset.x * d.x), t.relativeTargetOffset.y !== void 0 && (k.y += t.relativeTargetOffset.y * d.y), t.relativeTargetOffset.z !== void 0 && (k.z += t.relativeTargetOffset.z * d.z)), this.setLookTargetPosition(k, r), this.setFieldOfView(t.fov, r), l == null || l == "auto") {
|
|
16343
|
+
const W = S.findObjectOfType(Ms), X = W ? W.radius : 0, A = Math.max(_.x, _.y, _.z, X);
|
|
16344
|
+
n.near = I / 100, n.far = A + I * 10, W && (this.maxZoom = Math.max(Math.min(this.maxZoom, X * 0.5), I));
|
|
16343
16345
|
}
|
|
16344
16346
|
const E = o.getDistance();
|
|
16345
16347
|
E < this.minZoom && (this.minZoom = E * 0.9), E > this.maxZoom && (this.maxZoom = E * 1.1), n.updateMatrixWorld(), n.updateProjectionMatrix();
|
|
16346
|
-
const
|
|
16347
|
-
|
|
16348
|
-
let
|
|
16349
|
-
n.parent && (
|
|
16350
|
-
if (
|
|
16351
|
-
let
|
|
16352
|
-
this._cameraObject instanceof pe && (
|
|
16353
|
-
}
|
|
16354
|
-
|
|
16348
|
+
const B = f.clone();
|
|
16349
|
+
t.fitDirection ? B.sub(new b().copy(t.fitDirection).multiplyScalar(1e6)) : B.sub(n.worldPosition), a === "y" && (B.y = 0), B.normalize(), B.multiplyScalar(I), a === "y" && (B.y += -O * 4 * I);
|
|
16350
|
+
let L = f.clone().sub(B);
|
|
16351
|
+
t.cameraOffset && (t.cameraOffset.x !== void 0 && (L.x += t.cameraOffset.x), t.cameraOffset.y !== void 0 && (L.y += t.cameraOffset.y), t.cameraOffset.z !== void 0 && (L.z += t.cameraOffset.z)), t.relativeCameraOffset && (t.relativeCameraOffset.x !== void 0 && (L.x += t.relativeCameraOffset.x * d.x), t.relativeCameraOffset.y !== void 0 && (L.y += t.relativeCameraOffset.y * d.y), t.relativeCameraOffset.z !== void 0 && (L.z += t.relativeCameraOffset.z * d.z)), n.parent && (L = n.parent.worldToLocal(L)), this.setCameraTargetPosition(L, r), (nl || t.debug) && (z.DrawWireBox3(p, 16777011, 10), z.DrawWireBox3(g, 65280, 10), !this._haveAttachedKeyboardEvents && nl && (this._haveAttachedKeyboardEvents = !0, document.body.addEventListener("keydown", (W) => {
|
|
16352
|
+
if (W.code === "KeyF") {
|
|
16353
|
+
let X;
|
|
16354
|
+
this._cameraObject instanceof pe && (X = Math.random() * Math.random() * 170 + 10), this.fitCamera({ objects: i, fitOffset: c, immediate: !1, fov: X });
|
|
16355
|
+
}
|
|
16356
|
+
W.code === "KeyV" && this._cameraObject instanceof pe && (this._cameraObject.fov = 60);
|
|
16355
16357
|
}))), this.onBeforeRender();
|
|
16356
16358
|
}
|
|
16357
16359
|
_haveAttachedKeyboardEvents = !1;
|
|
@@ -16650,7 +16652,7 @@ const Gs = w("debugcam"), u_ = w("debugscreenpointtoray"), Lt = class Sl extends
|
|
|
16650
16652
|
const t = e.clientX, i = e.clientY;
|
|
16651
16653
|
console.log("touch", t.toFixed(2), i.toFixed(2));
|
|
16652
16654
|
const n = this.screenPointToRay(t, i), o = "#" + Math.floor(Math.random() * 16777215).toString(16);
|
|
16653
|
-
|
|
16655
|
+
z.DrawRay(n.origin, n.direction, o, 10);
|
|
16654
16656
|
});
|
|
16655
16657
|
}
|
|
16656
16658
|
/** @internal */
|
|
@@ -16661,6 +16663,9 @@ const Gs = w("debugcam"), u_ = w("debugscreenpointtoray"), Lt = class Sl extends
|
|
|
16661
16663
|
onDisable() {
|
|
16662
16664
|
this.context.removeCamera(this);
|
|
16663
16665
|
}
|
|
16666
|
+
onLeaveXR(e) {
|
|
16667
|
+
this.fieldOfView = this._fov;
|
|
16668
|
+
}
|
|
16664
16669
|
/** @internal */
|
|
16665
16670
|
onBeforeRender() {
|
|
16666
16671
|
if (this._cam && (this._frustum && this.updateFrustum(), this._clearFlags === 2 && this.applyClearFlagsIfIsActiveCamera(), this._targetTexture)) {
|
|
@@ -16707,7 +16712,7 @@ const Gs = w("debugcam"), u_ = w("debugscreenpointtoray"), Lt = class Sl extends
|
|
|
16707
16712
|
Gs && console.log("Camera does not exist (apply clear flags)");
|
|
16708
16713
|
return;
|
|
16709
16714
|
}
|
|
16710
|
-
if (this.fieldOfView = this.
|
|
16715
|
+
if (this.fieldOfView = this.fieldOfView, Gs) {
|
|
16711
16716
|
const i = `[Camera] Apply ClearFlags: ${sa[this._clearFlags]} - "${this.name}"`;
|
|
16712
16717
|
console.debug(i);
|
|
16713
16718
|
}
|
|
@@ -17066,7 +17071,7 @@ const bt = w("debugaudio"), Qi = class qs extends T {
|
|
|
17066
17071
|
onVisibilityChanged = () => {
|
|
17067
17072
|
switch (document.visibilityState) {
|
|
17068
17073
|
case "hidden":
|
|
17069
|
-
(this.playInBackground === !1 ||
|
|
17074
|
+
(this.playInBackground === !1 || q.isMobileDevice()) && (this.wasPlaying = this.isPlaying, this.isPlaying && this.pause());
|
|
17070
17075
|
break;
|
|
17071
17076
|
case "visible":
|
|
17072
17077
|
bt && console.log("visible", this.enabled, this.playOnAwake, !this.isPlaying, qs.userInteractionRegistered, this.wasPlaying), this.enabled && this.playOnAwake && !this.isPlaying && qs.userInteractionRegistered && this.wasPlaying && this.play();
|
|
@@ -17132,7 +17137,7 @@ const bt = w("debugaudio"), Qi = class qs extends T {
|
|
|
17132
17137
|
* @param clip - Optional audio clip or {@link MediaStream} to play
|
|
17133
17138
|
*/
|
|
17134
17139
|
play(e = void 0) {
|
|
17135
|
-
!e && this.clip && (e = this.clip), e !== void 0 && typeof e != "string" && !(e instanceof MediaStream) && (
|
|
17140
|
+
!e && this.clip && (e = this.clip), e !== void 0 && typeof e != "string" && !(e instanceof MediaStream) && (D() && console.warn("Called play on AudioSource with unknown argument type:", e + `
|
|
17136
17141
|
Using the assigned clip instead:`, this.clip), e = this.clip);
|
|
17137
17142
|
let t = !this.sound || e && e !== this.clip;
|
|
17138
17143
|
if (typeof e == "string" && !this.audioLoader && (t = !0), (e instanceof MediaStream || typeof e == "string") && (this.clip = e), t) {
|
|
@@ -17244,7 +17249,7 @@ class oa {
|
|
|
17244
17249
|
if (t) {
|
|
17245
17250
|
for (const i of this.Pois)
|
|
17246
17251
|
if (i.obj === t) {
|
|
17247
|
-
this.Pois.splice(this.Pois.indexOf(i), 1), this.LastChangeTime = e?.time.time ??
|
|
17252
|
+
this.Pois.splice(this.Pois.indexOf(i), 1), this.LastChangeTime = e?.time.time ?? U.Current?.time.time;
|
|
17248
17253
|
return;
|
|
17249
17254
|
}
|
|
17250
17255
|
}
|
|
@@ -17624,7 +17629,7 @@ class tu extends um {
|
|
|
17624
17629
|
e = i.context, t = eo.getOrCreate(i.context, i.guid);
|
|
17625
17630
|
} else typeof t == "string" && (t = eo.getOrCreate(e, t));
|
|
17626
17631
|
if (e) {
|
|
17627
|
-
if (!(e instanceof
|
|
17632
|
+
if (!(e instanceof U)) throw new Error("Failed to create NetworkedStreams because context is not an instance of Context");
|
|
17628
17633
|
} else throw new Error("Failed to create NetworkedStreams because context is undefined");
|
|
17629
17634
|
if (!t) throw new Error("Failed to create NetworkedStreams because peer is undefined");
|
|
17630
17635
|
this.context = e, this.peer = t, Le && (this.debug = !0);
|
|
@@ -17807,10 +17812,10 @@ class _r extends T {
|
|
|
17807
17812
|
if (!this._net)
|
|
17808
17813
|
return console.error("Cannot connect to voice chat - NetworkedStreams not initialized. Make sure the component is enabled before calling this method."), !1;
|
|
17809
17814
|
if (this.context.connection.isConnected) {
|
|
17810
|
-
if (!await
|
|
17815
|
+
if (!await q.microphonePermissionsGranted())
|
|
17811
17816
|
return console.error("Cannot connect to voice chat - microphone permissions not granted"), this.updateButton(), !1;
|
|
17812
17817
|
} else return console.error("Cannot connect to voice chat - not connected to server"), this.updateButton(), !1;
|
|
17813
|
-
return this._allowSending = !0, this._net?.stopSendingStream(this._outputStream), ms(this._outputStream), this._outputStream = await this.getAudioStream(e), this._outputStream ? (this.debug && console.log("VOIP: Got audio stream"), this._net?.startSendingStream(this._outputStream), this.updateButton(), !0) : (this.updateButton(), await
|
|
17818
|
+
return this._allowSending = !0, this._net?.stopSendingStream(this._outputStream), ms(this._outputStream), this._outputStream = await this.getAudioStream(e), this._outputStream ? (this.debug && console.log("VOIP: Got audio stream"), this._net?.startSendingStream(this._outputStream), this.updateButton(), !0) : (this.updateButton(), await q.microphonePermissionsGranted() ? console.error("VOIP: Could not get audio stream - please make sure to connect an audio device and grant microphone permissions") : Wd("Microphone permissions not granted: Please grant microphone permissions to use voice chat"), (this.debug || D()) && console.log("VOIP: Failed to get audio stream"), !1);
|
|
17814
17819
|
}
|
|
17815
17820
|
/** Stop sending audio (muting your own microphone) */
|
|
17816
17821
|
disconnect(e) {
|
|
@@ -17838,27 +17843,27 @@ class _r extends T {
|
|
|
17838
17843
|
async updateButton() {
|
|
17839
17844
|
if (this.createMenuButton) {
|
|
17840
17845
|
if (this._menubutton || (this._menubutton = document.createElement("button"), this._menubutton.addEventListener("click", () => {
|
|
17841
|
-
this.isSending ? this.disconnect({ remember: !0 }) : this.connect(),
|
|
17846
|
+
this.isSending ? this.disconnect({ remember: !0 }) : this.connect(), q.microphonePermissionsGranted().then((e) => {
|
|
17842
17847
|
e || ge("<strong>Microphone permissions not granted</strong>. Please allow your browser to use the microphone to be able to talk. Click on the button on the left side of your browser's address bar to allow microphone permissions.");
|
|
17843
17848
|
});
|
|
17844
17849
|
})), this._menubutton) {
|
|
17845
17850
|
this.context.menu.appendChild(this._menubutton), this.activeAndEnabled ? this._menubutton.style.display = "" : this._menubutton.style.display = "none", this._menubutton.title = this.isSending ? "Click to disable your microphone" : "Click to enable your microphone";
|
|
17846
17851
|
let e = (this.isSending, ""), t = this.isSending ? "mic" : "mic_off";
|
|
17847
|
-
await
|
|
17852
|
+
await q.microphonePermissionsGranted() || (e = "No Permission", t = "mic_off", this._menubutton.title = "Microphone permissions not granted. Please allow your browser to use the microphone to be able to talk. This can usually be done in the addressbar of the webpage."), this._menubutton.innerText = e, this._menubutton.prepend(Mt(t)), this.context.connection.isConnected == !1 ? this._menubutton.setAttribute("disabled", "") : this._menubutton.removeAttribute("disabled");
|
|
17848
17853
|
}
|
|
17849
17854
|
} else this.activeAndEnabled || this._menubutton?.remove();
|
|
17850
17855
|
}
|
|
17851
17856
|
// private _analyzer?: AudioAnalyser;
|
|
17852
17857
|
/** @deprecated */
|
|
17853
17858
|
getFrequency(e) {
|
|
17854
|
-
return this.unsupported_getfrequency || (this.unsupported_getfrequency = !0,
|
|
17859
|
+
return this.unsupported_getfrequency || (this.unsupported_getfrequency = !0, D() && ge("VOIP: getFrequency is currently not supported"), console.warn("VOIP: getFrequency is currently not supported")), null;
|
|
17855
17860
|
}
|
|
17856
17861
|
async getAudioStream(e) {
|
|
17857
17862
|
if (!navigator.mediaDevices.getUserMedia)
|
|
17858
17863
|
return console.error("No getDisplayMedia support"), null;
|
|
17859
17864
|
const t = async (n) => await navigator.mediaDevices.getUserMedia({ audio: n ?? !0, video: !1 }).catch((o) => (console.warn("VOIP failed getting audio stream", o), null)), i = await t(e);
|
|
17860
17865
|
if (!i) return null;
|
|
17861
|
-
if (
|
|
17866
|
+
if (q.isiOS() && e?.deviceId === void 0) {
|
|
17862
17867
|
const o = (await navigator.mediaDevices.enumerateDevices()).find((r) => (r.kind === "audioinput" || r.kind === "audiooutput") && !r.label.includes("iPhone"));
|
|
17863
17868
|
if (o) {
|
|
17864
17869
|
const r = Object.assign({}, e);
|
|
@@ -18232,7 +18237,7 @@ class Ct extends T {
|
|
|
18232
18237
|
}
|
|
18233
18238
|
this.updateBox();
|
|
18234
18239
|
const t = this.box?.intersectsBox(Ct.testBox);
|
|
18235
|
-
return t && jk &&
|
|
18240
|
+
return t && jk && z.DrawWireBox3(Ct.testBox, 16711680, 5), t;
|
|
18236
18241
|
}
|
|
18237
18242
|
/**
|
|
18238
18243
|
* Tests if this helper's bounding box intersects with another box
|
|
@@ -18419,7 +18424,7 @@ const Zm = class J0 extends wi {
|
|
|
18419
18424
|
const t = this.gameObject, i = t.position.clone(), n = t.quaternion.clone(), o = t.scale.clone(), r = t.parent;
|
|
18420
18425
|
t.position.set(0, 0, 0), t.quaternion.set(0, 0, 0, 1), t.scale.set(1, 1, 1), t.parent = null, t.updateMatrix();
|
|
18421
18426
|
const a = _i([t]);
|
|
18422
|
-
t.position.copy(i), t.quaternion.copy(n), t.scale.copy(o), t.parent = r, e?.debug === !0 &&
|
|
18427
|
+
t.position.copy(i), t.quaternion.copy(n), t.scale.copy(o), t.parent = r, e?.debug === !0 && z.DrawWireBox3(a, 16768256, 20), this.size = a.getSize(new b()) || new b(1, 1, 1), this.center = a.getCenter(new b()) || new b(0, 0, 0), this.size.length() <= 0 && this.size.set(0.01, 0.01, 0.01);
|
|
18423
18428
|
}
|
|
18424
18429
|
};
|
|
18425
18430
|
ti([
|
|
@@ -18462,7 +18467,7 @@ class br extends wi {
|
|
|
18462
18467
|
r && this.activeAndEnabled && (o.geometry = r, this.context.physics.engine?.addMeshCollider(this, o, this.convex));
|
|
18463
18468
|
});
|
|
18464
18469
|
} else
|
|
18465
|
-
(
|
|
18470
|
+
(D() || w("showcolliders")) && console.warn(`[MeshCollider] A MeshCollider mesh is assigned to an unknown object on "${this.gameObject.name}", but it's neither a Mesh nor a Group. Please double check that you attached the collider component to the right object and report a bug otherwise!`, this);
|
|
18466
18471
|
}
|
|
18467
18472
|
}
|
|
18468
18473
|
}
|
|
@@ -18559,7 +18564,7 @@ class mo extends T {
|
|
|
18559
18564
|
animator;
|
|
18560
18565
|
lookForward = !0;
|
|
18561
18566
|
awake() {
|
|
18562
|
-
this._currentRotation = new
|
|
18567
|
+
this._currentRotation = new N();
|
|
18563
18568
|
}
|
|
18564
18569
|
update() {
|
|
18565
18570
|
const e = this.context.input;
|
|
@@ -18652,7 +18657,7 @@ const vr = class Cl extends T {
|
|
|
18652
18657
|
* @returns The instance of the contact shadows.
|
|
18653
18658
|
*/
|
|
18654
18659
|
static auto(e) {
|
|
18655
|
-
if (e || (e =
|
|
18660
|
+
if (e || (e = U.Current), !e)
|
|
18656
18661
|
throw new Error("No context provided and no current context set.");
|
|
18657
18662
|
let t = this._instances.get(e);
|
|
18658
18663
|
if (!t || t.destroyed) {
|
|
@@ -18711,7 +18716,7 @@ const vr = class Cl extends T {
|
|
|
18711
18716
|
fitShadows() {
|
|
18712
18717
|
sl && console.warn("Fitting shadows to scene"), cp(this.shadowsRoot, !1);
|
|
18713
18718
|
const e = _i(this.context.scene.children, [this.shadowsRoot]), t = Math.max(1, this.blur / 32), i = e.max.x - e.min.x, n = e.max.z - e.min.z;
|
|
18714
|
-
e.expandByVector(new b(t * i, 0, t * n)), sl &&
|
|
18719
|
+
e.expandByVector(new b(t * i, 0, t * n)), sl && z.DrawWireBox3(e, 16776960, 60), this.gameObject.parent && e.applyMatrix4(this.gameObject.parent.matrixWorld.clone().invert());
|
|
18715
18720
|
const o = e.min, r = Math.max(1e-5, (e.max.y - o.y) * 2e-3);
|
|
18716
18721
|
e.max.y += r, this.shadowsRoot.position.set((o.x + e.max.x) / 2, o.y - r, (o.z + e.max.z) / 2), this.shadowsRoot.scale.set(e.max.x - o.x, e.max.y - o.y, e.max.z - o.z), this.applyMinSize(), this.shadowsRoot.matrixWorldNeedsUpdate = !0, sl && console.log("Fitted shadows to scene", this.shadowsRoot.scale.clone());
|
|
18717
18722
|
}
|
|
@@ -18872,7 +18877,7 @@ class iv extends T {
|
|
|
18872
18877
|
try {
|
|
18873
18878
|
if (e.box) {
|
|
18874
18879
|
const o = e.box, r = Ct.testBox;
|
|
18875
|
-
|
|
18880
|
+
z.DrawWireBox3(o, 16711680, 5), z.DrawWireBox3(r, 255, 5), console.log("DeleteBox: Destroying", this.gameObject, { deleteBoxArea: o, deletedObjectArea: r });
|
|
18876
18881
|
} else
|
|
18877
18882
|
console.log("DeleteBox: Destroying", this.gameObject);
|
|
18878
18883
|
} catch {
|
|
@@ -18897,7 +18902,7 @@ class eg extends T {
|
|
|
18897
18902
|
this.test() || S.setActive(this.gameObject, !1);
|
|
18898
18903
|
}
|
|
18899
18904
|
test() {
|
|
18900
|
-
return this.visibleOn < 0 ? !0 :
|
|
18905
|
+
return this.visibleOn < 0 ? !0 : q.isMobileDevice() ? (this.visibleOn & 2) !== 0 : (this.visibleOn & 1) !== 0;
|
|
18901
18906
|
}
|
|
18902
18907
|
}
|
|
18903
18908
|
$k([
|
|
@@ -19048,7 +19053,7 @@ const go = class Ii extends T {
|
|
|
19048
19053
|
* @internal
|
|
19049
19054
|
*/
|
|
19050
19055
|
onPointerUp(e) {
|
|
19051
|
-
if (kn &&
|
|
19056
|
+
if (kn && z.DrawLabel(e.point ?? this.gameObject.worldPosition, "POINTERUP:" + e.pointerId + ", " + e.button, 0.03, 3), !this.allowEdit(this.gameObject) || e.button !== 0) return;
|
|
19052
19057
|
this._potentialDragStartEvt = null;
|
|
19053
19058
|
const t = this._dragHandlers.get(e.event.space), i = this._dragHandlers.get(this.gameObject);
|
|
19054
19059
|
i && (i.handlerA === t || i.handlerB === t) && (this._dragHandlers.delete(this.gameObject), i.onDragEnd(e)), t && (Ii._active > 0 && (Ii._active -= 1), this.setTargetObject(null), t.onDragEnd && t.onDragEnd(e), this._dragHandlers.delete(e.event.space), this._dragHandlers.size === 0 && this.onLastDragEnd(e), e.use());
|
|
@@ -19155,7 +19160,7 @@ class Vk {
|
|
|
19155
19160
|
_followObject;
|
|
19156
19161
|
_manipulatorObject;
|
|
19157
19162
|
_deviceMode;
|
|
19158
|
-
_followObjectStartWorldQuaternion = new
|
|
19163
|
+
_followObjectStartWorldQuaternion = new N();
|
|
19159
19164
|
constructor(e, t, i, n) {
|
|
19160
19165
|
this.context = e.context, this.settings = e, this.gameObject = t, this.handlerA = i, this.handlerB = n, this._followObject = new M(), this._manipulatorObject = new M(), this.context.scene.add(this._manipulatorObject);
|
|
19161
19166
|
const o = K.active?.rig?.gameObject;
|
|
@@ -19166,7 +19171,7 @@ class Vk {
|
|
|
19166
19171
|
if (this._tempVec1.copy(this.handlerA.hitPointInLocalSpace), this._tempVec2.copy(this.handlerB.hitPointInLocalSpace), this.gameObject.localToWorld(this._tempVec1), this.gameObject.localToWorld(this._tempVec2), o && (o.worldToLocal(this._tempVec1), o.worldToLocal(this._tempVec2)), this._initialDistance = this._tempVec1.distanceTo(this._tempVec2), this._initialDistance < 0.02 ? (kn && console.log("Finding alternative drag attachment points since initial distance is too low: " + this._initialDistance.toFixed(2)), this.handlerA.followObject.parent.getWorldPosition(this._tempVec1), this.handlerB.followObject.parent.getWorldPosition(this._tempVec2), this._handlerAAttachmentPoint.copy(this._tempVec1), this._handlerBAttachmentPoint.copy(this._tempVec2), this.gameObject.worldToLocal(this._handlerAAttachmentPoint), this.gameObject.worldToLocal(this._handlerBAttachmentPoint), this._initialDistance = this._tempVec1.distanceTo(this._tempVec2), this._initialDistance < 1e-3 && (console.warn("Not supported right now – controller drag points for multitouch are too close!"), this._initialDistance = 1)) : (this._handlerAAttachmentPoint.copy(this.handlerA.hitPointInLocalSpace), this._handlerBAttachmentPoint.copy(this.handlerB.hitPointInLocalSpace)), this._tempVec3.lerpVectors(this._tempVec1, this._tempVec2, 0.5), this._initialScale.copy(t.scale), kn) {
|
|
19167
19172
|
this._followObject.add(new mi(2)), this._manipulatorObject.add(new mi(5));
|
|
19168
19173
|
const r = (a) => `${a.x.toFixed(2)}, ${a.y.toFixed(2)}, ${a.z.toFixed(2)}`;
|
|
19169
|
-
|
|
19174
|
+
z.DrawLine(this._tempVec1, this._tempVec2, 65535, 0, !1), z.DrawLabel(this._tempVec3, "A:B " + this._initialDistance.toFixed(2) + `
|
|
19170
19175
|
` + r(this._tempVec1) + `
|
|
19171
19176
|
` + r(this._tempVec2), 0.03, 5);
|
|
19172
19177
|
}
|
|
@@ -19182,7 +19187,7 @@ class Vk {
|
|
|
19182
19187
|
this.handlerA.recenter(), this.handlerB.recenter(), this._manipulatorObject.removeFromParent(), this._followObject.removeFromParent(), this._manipulatorObject.destroy(), this._followObject.destroy();
|
|
19183
19188
|
}
|
|
19184
19189
|
_manipulatorPosOffset = new b();
|
|
19185
|
-
_manipulatorRotOffset = new
|
|
19190
|
+
_manipulatorRotOffset = new N();
|
|
19186
19191
|
_manipulatorScaleOffset = new b();
|
|
19187
19192
|
_tempVec1 = new b();
|
|
19188
19193
|
_tempVec2 = new b();
|
|
@@ -19203,7 +19208,7 @@ class Vk {
|
|
|
19203
19208
|
const e = this.context.mainCamera;
|
|
19204
19209
|
this.tempLookMatrix.lookAt(this._tempVec3, this._tempVec2, e.worldUp), this._manipulatorObject.quaternion.setFromRotationMatrix(this.tempLookMatrix);
|
|
19205
19210
|
const t = this._tempVec1.distanceTo(this._tempVec2);
|
|
19206
|
-
this._manipulatorObject.scale.copy(this._initialScale).multiplyScalar(t / this._initialDistance), this._manipulatorObject.updateMatrix(), this._manipulatorObject.updateMatrixWorld(!0), kn && (
|
|
19211
|
+
this._manipulatorObject.scale.copy(this._initialScale).multiplyScalar(t / this._initialDistance), this._manipulatorObject.updateMatrix(), this._manipulatorObject.updateMatrixWorld(!0), kn && (z.DrawLabel(this._tempVec3.clone().add(new b(0, 0.2, 0)), "A:B " + t.toFixed(2), 0.03), z.DrawLine(this._tempVec1, this._tempVec2, 65280, 0, !1));
|
|
19207
19212
|
}
|
|
19208
19213
|
onDragUpdate() {
|
|
19209
19214
|
this.alignManipulator();
|
|
@@ -19266,8 +19271,8 @@ class Cf {
|
|
|
19266
19271
|
_grabStartDistance = 0;
|
|
19267
19272
|
_deviceMode;
|
|
19268
19273
|
_followObjectStartPosition = new b();
|
|
19269
|
-
_followObjectStartQuaternion = new
|
|
19270
|
-
_followObjectStartWorldQuaternion = new
|
|
19274
|
+
_followObjectStartQuaternion = new N();
|
|
19275
|
+
_followObjectStartWorldQuaternion = new N();
|
|
19271
19276
|
_lastDragPosRigSpace;
|
|
19272
19277
|
_tempVec = new b();
|
|
19273
19278
|
_tempMat = new te();
|
|
@@ -19303,7 +19308,7 @@ class Cf {
|
|
|
19303
19308
|
const t = this._hitPointInLocalSpace.clone();
|
|
19304
19309
|
this.gameObject.localToWorld(t), this._grabStartDistance = t.distanceTo(e.worldPosition);
|
|
19305
19310
|
const n = K.active?.rig?.gameObject?.worldScale.x || 1;
|
|
19306
|
-
this._grabStartDistance /= n, this._totalMovementAlongRayDirection = 0, this._lastDragPosRigSpace = void 0, kn && (
|
|
19311
|
+
this._grabStartDistance /= n, this._totalMovementAlongRayDirection = 0, this._lastDragPosRigSpace = void 0, kn && (z.DrawLine(t, e.worldPosition, 65280, 0.5, !1), z.DrawLabel(e.worldPosition.add(new b(0, 0.1, 0)), this._grabStartDistance.toFixed(2), 0.03, 0.5));
|
|
19307
19312
|
}
|
|
19308
19313
|
onDragStart(e) {
|
|
19309
19314
|
if (!this.gameObject) {
|
|
@@ -19357,7 +19362,7 @@ class Cf {
|
|
|
19357
19362
|
const n = e.worldForward;
|
|
19358
19363
|
if (i && (this._tempMat.copy(i.matrixWorld).invert(), n.transformDirection(this._tempMat)), this._totalMovementAlongRayDirection += n.dot(this._tempVec), this._tempVec.x = Math.abs(this._tempVec.x), this._tempVec.y = Math.abs(this._tempVec.y), this._tempVec.z = Math.abs(this._tempVec.z), this._totalMovement.add(this._tempVec), this._lastDragPosRigSpace.copy(t), kn) {
|
|
19359
19364
|
let o = t;
|
|
19360
|
-
i && (o = o.clone(), o.transformDirection(i.matrixWorld)),
|
|
19365
|
+
i && (o = o.clone(), o.transformDirection(i.matrixWorld)), z.DrawRay(o, n, 255);
|
|
19361
19366
|
}
|
|
19362
19367
|
}
|
|
19363
19368
|
onDragUpdate(e) {
|
|
@@ -19395,15 +19400,15 @@ class Cf {
|
|
|
19395
19400
|
const x = y[0];
|
|
19396
19401
|
if (this._draggedOverObject === x.object ? this._draggedOverObjectDuration += this.context.time.deltaTime : (this._draggedOverObject = x.object, this._draggedOverObjectDuration = 0), x.face) {
|
|
19397
19402
|
this._hasLastSurfaceHitPoint = !0, this._lastSurfaceHitPoint.copy(x.point);
|
|
19398
|
-
const O = this._draggedOverObjectDuration >= 0.15, E = this._totalMovement.length() >= 1e-3,
|
|
19399
|
-
if ((O || E) && (this._draggedOverObjectLastSetUp !== this._draggedOverObject || this._draggedOverObjectLastNormal.dot(
|
|
19403
|
+
const O = this._draggedOverObjectDuration >= 0.15, E = this._totalMovement.length() >= 1e-3, B = G(x.normal || x.face.normal).applyQuaternion(x.object.worldQuaternion);
|
|
19404
|
+
if ((O || E) && (this._draggedOverObjectLastSetUp !== this._draggedOverObject || this._draggedOverObjectLastNormal.dot(B) < 0.999999 || this.context.time.frame % 60 === 0)) {
|
|
19400
19405
|
this._draggedOverObjectLastSetUp = this._draggedOverObject, this._draggedOverObjectLastNormal.copy(x.face.normal);
|
|
19401
|
-
const
|
|
19402
|
-
this._bounds.getCenter(
|
|
19403
|
-
const
|
|
19404
|
-
this._followObject.localToWorld(
|
|
19406
|
+
const L = G(), W = G();
|
|
19407
|
+
this._bounds.getCenter(L), this._bounds.getSize(W), L.sub(W.multiplyScalar(0.5).multiply(B)), this._hitPointInLocalSpace.copy(L), this._hitNormalInLocalSpace.copy(x.face.normal), this._bounds.getCenter(L), this._bounds.getSize(W), L.add(W.multiplyScalar(0.5).multiply(x.face.normal));
|
|
19408
|
+
const X = G(this._hitPointInLocalSpace).add(L);
|
|
19409
|
+
this._followObject.localToWorld(X);
|
|
19405
19410
|
const A = x.point;
|
|
19406
|
-
this._dragPlane.setFromNormalAndCoplanarPoint(
|
|
19411
|
+
this._dragPlane.setFromNormalAndCoplanarPoint(B, A);
|
|
19407
19412
|
} else if (!(O || E))
|
|
19408
19413
|
return;
|
|
19409
19414
|
}
|
|
@@ -19412,7 +19417,7 @@ class Cf {
|
|
|
19412
19417
|
if (l !== 1 && p.intersectPlane(this._dragPlane, this._tempVec)) {
|
|
19413
19418
|
this._followObject.worldPosition = this._tempVec, this._followObject.updateMatrix(), this._followObject.updateMatrixWorld(!0);
|
|
19414
19419
|
const y = G(this._hitPointInLocalSpace);
|
|
19415
|
-
this._followObject.localToWorld(y), kn &&
|
|
19420
|
+
this._followObject.localToWorld(y), kn && z.DrawLine(y, this._tempVec, 65535, 0, !1), this._followObject.worldPosition = this._tempVec.multiplyScalar(2).sub(y), this._followObject.updateMatrix(), this._followObject.updateMatrix();
|
|
19416
19421
|
}
|
|
19417
19422
|
if (this.settings.snapGridResolution > 0) {
|
|
19418
19423
|
const y = this._followObject.worldPosition, x = this.settings.snapGridResolution;
|
|
@@ -19424,9 +19429,9 @@ class Cf {
|
|
|
19424
19429
|
const v = t.worldQuaternion;
|
|
19425
19430
|
if (v.slerp(this._followObject.worldQuaternion, _), t.worldQuaternion = v, kn) {
|
|
19426
19431
|
const y = this._hitPointInLocalSpace.clone();
|
|
19427
|
-
t.localToWorld(y),
|
|
19432
|
+
t.localToWorld(y), z.DrawSphere(y, 0.02, 16711680);
|
|
19428
19433
|
const x = this._hitNormalInLocalSpace.clone();
|
|
19429
|
-
x.applyQuaternion(v),
|
|
19434
|
+
x.applyQuaternion(v), z.DrawRay(y, x, 16711680), z.DrawLabel(
|
|
19430
19435
|
m.add(new b(0, 0.25, 0)),
|
|
19431
19436
|
`Distance: ${this._totalMovement.length().toFixed(2)}
|
|
19432
19437
|
|
|
@@ -19440,7 +19445,7 @@ class Cf {
|
|
|
19440
19445
|
0.03
|
|
19441
19446
|
);
|
|
19442
19447
|
const I = this._bottomCenter.clone(), O = this._backCenter.clone(), k = this._backBottomCenter.clone();
|
|
19443
|
-
t.localToWorld(I), t.localToWorld(O), t.localToWorld(k),
|
|
19448
|
+
t.localToWorld(I), t.localToWorld(O), t.localToWorld(k), z.DrawSphere(I, 0.01, 65280, 0, !1), z.DrawSphere(O, 0.01, 255, 0, !1), z.DrawSphere(k, 0.01, 16711935, 0, !1), z.DrawLine(I, k, 65535, 0, !1), z.DrawLine(k, O, 65535, 0, !1);
|
|
19444
19449
|
}
|
|
19445
19450
|
}
|
|
19446
19451
|
onDragEnd(e) {
|
|
@@ -19764,7 +19769,7 @@ function Xk(s, e, t) {
|
|
|
19764
19769
|
if (r)
|
|
19765
19770
|
return Vl && console.debug(`Mimetype callback returned: ${r}`), r;
|
|
19766
19771
|
}
|
|
19767
|
-
if (
|
|
19772
|
+
if (D() || Vl) {
|
|
19768
19773
|
const o = new TextDecoder().decode(e.slice(0, Math.min(e.byteLength, 32)));
|
|
19769
19774
|
console.warn(`Could not determine file type.
|
|
19770
19775
|
|
|
@@ -19927,10 +19932,11 @@ class yo extends T {
|
|
|
19927
19932
|
}
|
|
19928
19933
|
_abort = null;
|
|
19929
19934
|
/**
|
|
19930
|
-
* Processes dropped files
|
|
19931
|
-
*
|
|
19935
|
+
* Processes dropped files and loads them as 3D models.
|
|
19936
|
+
* When enabled, it also handles network drops (sending files between clients).
|
|
19937
|
+
* Automatically handles cancelling previous uploads if new files are dropped.
|
|
19932
19938
|
* @param fileList Array of dropped files
|
|
19933
|
-
* @param ctx Context information about where the drop occurred
|
|
19939
|
+
* @param ctx Context information about where on the screen or in 3D space the drop occurred
|
|
19934
19940
|
*/
|
|
19935
19941
|
async addFromFiles(e, t) {
|
|
19936
19942
|
if (ri && console.log("Add files", e), !!Array.isArray(e) && e.length) {
|
|
@@ -19987,7 +19993,7 @@ class yo extends T {
|
|
|
19987
19993
|
const r = n.scene;
|
|
19988
19994
|
this.gameObject.attach(r), r.position.set(0, 0, 0), r.quaternion.identity(), this._addedObjects.push(r), this._addedModels.push(n);
|
|
19989
19995
|
const a = new pi().setFromCenterAndSize(new b(0, this.fitVolumeSize.y * 0.5, 0).add(this.gameObject.worldPosition), this.fitVolumeSize);
|
|
19990
|
-
if (ri &&
|
|
19996
|
+
if (ri && z.DrawWireBox3(a, 255, 5), this.fitIntoVolume && UC(r, a, {
|
|
19991
19997
|
position: !this.placeAtHitPosition
|
|
19992
19998
|
}), this.placeAtHitPosition && t && t.screenposition) {
|
|
19993
19999
|
r.visible = !1;
|
|
@@ -20056,7 +20062,7 @@ class yo extends T {
|
|
|
20056
20062
|
recursive: !0,
|
|
20057
20063
|
testObject: (n) => !this._addedObjects.includes(n)
|
|
20058
20064
|
}).length)
|
|
20059
|
-
return
|
|
20065
|
+
return D() && console.log(`Dropped outside of drop area for DropListener "${this.name}".`), !1;
|
|
20060
20066
|
}
|
|
20061
20067
|
return !0;
|
|
20062
20068
|
}
|
|
@@ -20100,7 +20106,7 @@ var md;
|
|
|
20100
20106
|
async function t(i, n) {
|
|
20101
20107
|
return new Promise(async (o, r) => {
|
|
20102
20108
|
const a = new Tt(n.guid), l = i.toString();
|
|
20103
|
-
ri &&
|
|
20109
|
+
ri && z.DrawWireSphere(n.point, 0.1, 16711680, 3);
|
|
20104
20110
|
const c = Wo.addPreview({
|
|
20105
20111
|
guid: n.guid,
|
|
20106
20112
|
parent: n.parent,
|
|
@@ -20144,7 +20150,7 @@ const au = class ov extends T {
|
|
|
20144
20150
|
}
|
|
20145
20151
|
this.object.visible = !1;
|
|
20146
20152
|
const e = this.gameObject.getComponent(Gr);
|
|
20147
|
-
e && (e.enabled = !1), this._startPosition = this.object.position?.clone() ?? new b(0, 0, 0), this._startQuaternion = this.object.quaternion?.clone() ?? new
|
|
20153
|
+
e && (e.enabled = !1), this._startPosition = this.object.position?.clone() ?? new b(0, 0, 0), this._startQuaternion = this.object.quaternion?.clone() ?? new N(0, 0, 0, 1);
|
|
20148
20154
|
}
|
|
20149
20155
|
this.gameObject.getComponentInParent(Vi) || this.gameObject.addComponent(Vi);
|
|
20150
20156
|
}
|
|
@@ -20164,7 +20170,7 @@ const au = class ov extends T {
|
|
|
20164
20170
|
const t = this.handleDuplication();
|
|
20165
20171
|
if (t) {
|
|
20166
20172
|
const i = S.getComponent(t, Gr);
|
|
20167
|
-
i ? (i.onPointerDown(e), this._forwardPointerEvents.set(e.event.space, i)) :
|
|
20173
|
+
i ? (i.onPointerDown(e), this._forwardPointerEvents.set(e.event.space, i)) : D() && console.warn(`Duplicated object (${t.name}) does not have DragControls`);
|
|
20168
20174
|
} else
|
|
20169
20175
|
this._currentCount >= this.limitCount ? console.warn(`[Duplicatable] Limit of ${this.limitCount} objects created within a few seconds reached. Please wait a moment before creating more objects.`) : console.warn("[Duplicatable] Could not duplicate object.");
|
|
20170
20176
|
}
|
|
@@ -20262,7 +20268,7 @@ class av {
|
|
|
20262
20268
|
}
|
|
20263
20269
|
class tM extends av {
|
|
20264
20270
|
beforeWriteNode(e, t) {
|
|
20265
|
-
|
|
20271
|
+
z.isGizmo(e) && (t.keep = !1);
|
|
20266
20272
|
}
|
|
20267
20273
|
}
|
|
20268
20274
|
class lv extends av {
|
|
@@ -20697,12 +20703,12 @@ class Me extends fb {
|
|
|
20697
20703
|
return dv(e), e;
|
|
20698
20704
|
}
|
|
20699
20705
|
constructor(e, ...t) {
|
|
20700
|
-
super(...t), this.identifier = e, _n && console.log(this), this.type = "NEEDLE_CUSTOM_SHADER", this.uniforms[this._objToWorldName] || (this.uniforms[this._objToWorldName] = { value: [] }), this.uniforms[this._worldToObjectName] || (this.uniforms[this._worldToObjectName] = { value: [] }), this.uniforms[this._viewProjectionName] || (this.uniforms[this._viewProjectionName] = { value: [] }), this.uniforms[this._sphericalHarmonicsName], (this.depthTextureUniform || this.opaqueTextureUniform) &&
|
|
20706
|
+
super(...t), this.identifier = e, _n && console.log(this), this.type = "NEEDLE_CUSTOM_SHADER", this.uniforms[this._objToWorldName] || (this.uniforms[this._objToWorldName] = { value: [] }), this.uniforms[this._worldToObjectName] || (this.uniforms[this._worldToObjectName] = { value: [] }), this.uniforms[this._viewProjectionName] || (this.uniforms[this._viewProjectionName] = { value: [] }), this.uniforms[this._sphericalHarmonicsName], (this.depthTextureUniform || this.opaqueTextureUniform) && U.Current.pre_render_callbacks.push(this.onBeforeRenderSceneCallback);
|
|
20701
20707
|
}
|
|
20702
20708
|
dispose() {
|
|
20703
20709
|
super.dispose();
|
|
20704
|
-
const e =
|
|
20705
|
-
e >= 0 &&
|
|
20710
|
+
const e = U.Current.pre_render_callbacks.indexOf(this.onBeforeRenderSceneCallback);
|
|
20711
|
+
e >= 0 && U.Current.pre_render_callbacks.splice(e, 1);
|
|
20706
20712
|
}
|
|
20707
20713
|
/* REMOVED, we don't have Lit shader support for now
|
|
20708
20714
|
async waitForLighting() {
|
|
@@ -20754,13 +20760,13 @@ class Me extends fb {
|
|
|
20754
20760
|
return this.uniforms._CameraOpaqueTexture;
|
|
20755
20761
|
}
|
|
20756
20762
|
onBeforeRenderScene() {
|
|
20757
|
-
this.opaqueTextureUniform &&
|
|
20763
|
+
this.opaqueTextureUniform && U.Current.setRequireColor(!0), this.depthTextureUniform && U.Current.setRequireDepth(!0);
|
|
20758
20764
|
}
|
|
20759
20765
|
onBeforeRender(e, t, i, n, o, r) {
|
|
20760
20766
|
n.attributes.tangent || n.computeTangents(), this.onUpdateUniforms(i, o);
|
|
20761
20767
|
}
|
|
20762
20768
|
onUpdateUniforms(e, t) {
|
|
20763
|
-
const i =
|
|
20769
|
+
const i = U.Current;
|
|
20764
20770
|
if (e && (Me.viewProjection && this.uniforms[this._viewProjectionName] && (Me.viewProjection.copy(e.projectionMatrix).multiply(e.matrixWorldInverse), ld(Me.viewProjection, Me._viewProjectionValues)), Me.viewMatrix && this.uniforms[this._viewMatrixName] && (Me.viewMatrix.copy(e.matrixWorldInverse), ld(Me.viewMatrix, Me._viewMatrixValues)), this.uniforms[Me._worldSpaceCameraPosName] && Me._worldSpaceCameraPos.setFromMatrixPosition(e.matrixWorld)), this.uniforms._TimeParameters && (this.uniforms._TimeParameters.value = i.sceneLighting.timeVec4), this.uniforms._Time) {
|
|
20765
20771
|
const a = this.uniforms._Time.value;
|
|
20766
20772
|
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;
|
|
@@ -21023,7 +21029,7 @@ async function Fp(s, e, t) {
|
|
|
21023
21029
|
const o = new gd(n);
|
|
21024
21030
|
return o.setAnimationPointerResolver.bind(o)(new gM()), o;
|
|
21025
21031
|
} else
|
|
21026
|
-
return (pM ||
|
|
21032
|
+
return (pM || D()) && console.error("Missing KHR_animation_pointer extension..."), {
|
|
21027
21033
|
name: "KHR_animation_pointer_NOT_AVAILABLE"
|
|
21028
21034
|
};
|
|
21029
21035
|
});
|
|
@@ -21050,7 +21056,7 @@ class pv {
|
|
|
21050
21056
|
const a = new Array(), l = new Array(), c = new Array();
|
|
21051
21057
|
for (let p = 0; p < e.count; p++) {
|
|
21052
21058
|
e.getMatrixAt(p, r);
|
|
21053
|
-
let g = new b(), _ = new
|
|
21059
|
+
let g = new b(), _ = new N(), m = new b();
|
|
21054
21060
|
r.decompose(g, _, m), a.push(g.x, g.y, g.z), l.push(_.x, _.y, _.z, _.w), c.push(m.x, m.y, m.z);
|
|
21055
21061
|
}
|
|
21056
21062
|
const h = new Float32Array(a), d = new Float32Array(l), f = new Float32Array(c);
|
|
@@ -21111,7 +21117,7 @@ const ol = w("debugreflectionprobe"), v_ = w("noreflectionprobe"), Mf = Symbol("
|
|
|
21111
21117
|
this._boxHelper = this.gameObject.addComponent(Ct), this._boxHelper.updateBox(!0), ol && this._boxHelper.showHelper(5592320, !0), this._texture && (this._texture.mapping = _s, this._texture.colorSpace = Ss, this._texture.needsUpdate = !0);
|
|
21112
21118
|
}
|
|
21113
21119
|
start() {
|
|
21114
|
-
!this._texture &&
|
|
21120
|
+
!this._texture && D() && (console.warn(`[ReflectionProbe] Missing texture. Please assign a custom cubemap texture. To use reflection probes assign them to your renderer's "anchor" property.`), ge("ReflectionProbe configuration hint: See browser console for details"));
|
|
21115
21121
|
}
|
|
21116
21122
|
onDestroy() {
|
|
21117
21123
|
const e = ss._probes.get(this.context);
|
|
@@ -21299,7 +21305,7 @@ class ra {
|
|
|
21299
21305
|
return i(`Instancing: Can not update geometry (${this.name}), reserved index range is too small: ${this.__reservedIndexRange.toLocaleString()} < ${this.indexCount.toLocaleString()} indices for ${this.name}`);
|
|
21300
21306
|
return this.renderer.updateGeometry(e, this.__geometryIndex);
|
|
21301
21307
|
function i(n) {
|
|
21302
|
-
return t.updateMeshInformation() && (t.renderer.remove(t, !0), t.renderer.add(t)) ? !0 : ((
|
|
21308
|
+
return t.updateMeshInformation() && (t.renderer.remove(t, !0), t.renderer.add(t)) ? !0 : ((D() || Qt) && console.error(n), !1);
|
|
21303
21309
|
}
|
|
21304
21310
|
}
|
|
21305
21311
|
/** Adds this object to the instancing renderer (effectively activating instancing) */
|
|
@@ -21357,7 +21363,7 @@ class bM {
|
|
|
21357
21363
|
updateBounds(e = !0, t = !0) {
|
|
21358
21364
|
if (this._needUpdateBounds = !1, e && this._batchedMesh.computeBoundingBox(), t && this._batchedMesh.computeBoundingSphere(), Qt && this._batchedMesh.boundingSphere) {
|
|
21359
21365
|
const i = this._batchedMesh.boundingSphere;
|
|
21360
|
-
|
|
21366
|
+
z.DrawWireSphere(i.center, i.radius, 65280);
|
|
21361
21367
|
}
|
|
21362
21368
|
}
|
|
21363
21369
|
_context;
|
|
@@ -21396,7 +21402,7 @@ class bM {
|
|
|
21396
21402
|
this.add(t);
|
|
21397
21403
|
} catch (i) {
|
|
21398
21404
|
if (console.error(`Failed adding mesh to instancing (object name: "${e.name}", instances: ${this._currentInstanceCount.toLocaleString()}/${this._maxInstanceCount.toLocaleString()}, vertices: ${this._currentVertexCount.toLocaleString()}/${this._maxVertexCount.toLocaleString()}, indices: ${this._currentIndexCount.toLocaleString()}/${this._maxIndexCount.toLocaleString()})
|
|
21399
|
-
`, i),
|
|
21405
|
+
`, i), D()) {
|
|
21400
21406
|
Wd("Failed instancing mesh. See the browser console for details.");
|
|
21401
21407
|
debugger;
|
|
21402
21408
|
}
|
|
@@ -21434,7 +21440,7 @@ class bM {
|
|
|
21434
21440
|
const t = this.geometry;
|
|
21435
21441
|
for (const i in t.attributes)
|
|
21436
21442
|
if (i !== "batchId" && !e.hasAttribute(i))
|
|
21437
|
-
return
|
|
21443
|
+
return D() && console.warn(`BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`), !1;
|
|
21438
21444
|
return !0;
|
|
21439
21445
|
}
|
|
21440
21446
|
markNeedsUpdate() {
|
|
@@ -21459,7 +21465,7 @@ ${c.vertexCount} vertices, ${c.indexCount} indices
|
|
|
21459
21465
|
Max count ${this._maxInstanceCount} → ${i}
|
|
21460
21466
|
Max vertex count ${this._maxVertexCount} -> ${o}
|
|
21461
21467
|
Max index count ${this._maxIndexCount} -> ${r}`), this._debugMaterial = x_();
|
|
21462
|
-
} else
|
|
21468
|
+
} else D() && console.debug(`[Instancing] Growing Buffer
|
|
21463
21469
|
Mesh: "${this.name}${e.name?.length ? "/" + e.name : ""}"
|
|
21464
21470
|
Max count ${this._maxInstanceCount} → ${i}
|
|
21465
21471
|
Max vertex count ${this._maxVertexCount} -> ${o}
|
|
@@ -21523,7 +21529,7 @@ Index: ${e.__instanceIndex}`), this._batchedMesh.deleteInstance(e.__instanceInde
|
|
|
21523
21529
|
}
|
|
21524
21530
|
function Vo(s) {
|
|
21525
21531
|
if (!s)
|
|
21526
|
-
return
|
|
21532
|
+
return D() && console.error("Cannot get mesh information from null geometry"), { vertexCount: 0, indexCount: 0 };
|
|
21527
21533
|
let e = s.attributes?.position?.count || 0, t = s.index ? s.index.count : 0;
|
|
21528
21534
|
const i = We.getMeshLODExtension(s);
|
|
21529
21535
|
if (i) {
|
|
@@ -21988,7 +21994,7 @@ const $n = class zh extends T {
|
|
|
21988
21994
|
if (this._probeAnchorLastFrame !== this.probeAnchor && (this._reflectionProbe?.onUnset(this), this.updateReflectionProbe()), Pl == this.name && this.gameObject instanceof H) {
|
|
21989
21995
|
this.gameObject.geometry.computeBoundingSphere();
|
|
21990
21996
|
const e = G(this.gameObject.geometry.boundingSphere.center).applyMatrix4(this.gameObject.matrixWorld);
|
|
21991
|
-
|
|
21997
|
+
z.DrawWireSphere(e, this.gameObject.geometry.boundingSphere.radius, 56831);
|
|
21992
21998
|
}
|
|
21993
21999
|
if (this.isMultiMaterialObject(this.gameObject) && this.gameObject.children?.length > 0)
|
|
21994
22000
|
for (const e of this.gameObject.children)
|
|
@@ -22115,7 +22121,7 @@ class gv extends lu {
|
|
|
22115
22121
|
for (const e of this.sharedMeshes)
|
|
22116
22122
|
if (e instanceof ys && e.boundingSphere) {
|
|
22117
22123
|
const t = G(e.boundingSphere.center).applyMatrix4(e.matrixWorld);
|
|
22118
|
-
|
|
22124
|
+
z.DrawWireSphere(t, e.boundingSphere.radius, "red");
|
|
22119
22125
|
}
|
|
22120
22126
|
}
|
|
22121
22127
|
}
|
|
@@ -22678,7 +22684,7 @@ function xv(s) {
|
|
|
22678
22684
|
}
|
|
22679
22685
|
return t;
|
|
22680
22686
|
}
|
|
22681
|
-
const IM = new b(), LM = new
|
|
22687
|
+
const IM = new b(), LM = new N(), DM = new b(1, 1, 1);
|
|
22682
22688
|
class st {
|
|
22683
22689
|
static USDObject_export_id = 0;
|
|
22684
22690
|
uuid;
|
|
@@ -22700,7 +22706,7 @@ class st {
|
|
|
22700
22706
|
this.transform = null;
|
|
22701
22707
|
return;
|
|
22702
22708
|
}
|
|
22703
|
-
const t = new b(), i = new
|
|
22709
|
+
const t = new b(), i = new N(), n = new b();
|
|
22704
22710
|
e.decompose(t, i, n), this.transform = { position: t, quaternion: i, scale: n };
|
|
22705
22711
|
}
|
|
22706
22712
|
/** @deprecated Use `transform`, or `getMatrix()` if you really need the matrix */
|
|
@@ -22988,13 +22994,13 @@ let FM = class {
|
|
|
22988
22994
|
le.report("export-usdz-textures", { message: "read back texture", autoStep: !0 });
|
|
22989
22995
|
const E = x.scale !== void 0 && x.scale.x !== 1 && x.scale.y !== 1 && x.scale.z !== 1 && x.scale.w !== 1;
|
|
22990
22996
|
(I.isCompressedTexture || I.isRenderTargetTexture || E) && (k = await UM(I, t.maxTextureSize, g, x.scale)), le.report("export-usdz-textures", { message: "convert texture to canvas", autoStep: !0 });
|
|
22991
|
-
const
|
|
22992
|
-
console.error("Error converting texture to canvas", I,
|
|
22997
|
+
const B = await $M(k.imageBitmap || k.imageData, t.maxTextureSize).catch((L) => {
|
|
22998
|
+
console.error("Error converting texture to canvas", I, L);
|
|
22993
22999
|
});
|
|
22994
|
-
if (
|
|
23000
|
+
if (B) {
|
|
22995
23001
|
le.report("export-usdz-textures", { message: "convert canvas to blob", autoStep: !0 });
|
|
22996
|
-
const
|
|
22997
|
-
n[`textures/${y}.${O ? "png" : "jpg"}`] = new Uint8Array(await
|
|
23002
|
+
const L = await B.convertToBlob({ type: O ? "image/png" : "image/jpeg", quality: 0.95 });
|
|
23003
|
+
n[`textures/${y}.${O ? "png" : "jpg"}`] = new Uint8Array(await L.arrayBuffer());
|
|
22998
23004
|
} else
|
|
22999
23005
|
console.warn("Can`t export texture: ", I);
|
|
23000
23006
|
};
|
|
@@ -23482,7 +23488,7 @@ function Fs(s, e, t, i, n, o, r = void 0, a = void 0) {
|
|
|
23482
23488
|
// MirroredRepeatWrapping
|
|
23483
23489
|
}, _ = s.repeat.clone(), m = s.offset.clone(), v = s.rotation, y = Math.sin(v), x = Math.cos(v);
|
|
23484
23490
|
m.y = 1 - m.y - _.y, t ? (_.x === 0 && (_.x = 1e-4), _.y === 0 && (_.y = 1e-4), m.x = m.x / _.x, m.y = m.y / _.y, m.x += y / _.x, m.y += x - 1) : (m.x += y * _.x, m.y += (1 - x) * _.y);
|
|
23485
|
-
const I = cu(n), O = _.x != 1 || _.y != 1 || m.x != 0 || m.y != 0 || v != 0, k = `${Ut}/${I}/${"uvReader_" + f}.outputs:result>`, E = `${Ut}/${I}/Transform2d_${e}.outputs:result>`,
|
|
23491
|
+
const I = cu(n), O = _.x != 1 || _.y != 1 || m.x != 0 || m.y != 0 || v != 0, k = `${Ut}/${I}/${"uvReader_" + f}.outputs:result>`, E = `${Ut}/${I}/Transform2d_${e}.outputs:result>`, B = e !== "normal" && r && (r.r !== 1 || r.g !== 1 || r.b !== 1 || a !== 1) || !1, L = e === "normal", W = n instanceof ct && n.normalScale ? n.normalScale.x * 2 : 2, X = W.toFixed(Oe), A = (-1 * (W / 2)).toFixed(Oe), $ = (1 - W).toFixed(Oe);
|
|
23486
23492
|
return `
|
|
23487
23493
|
${O ? `def Shader "Transform2d_${e}" (
|
|
23488
23494
|
sdrMetadata = {
|
|
@@ -23504,12 +23510,12 @@ function Fs(s, e, t, i, n, o, r = void 0, a = void 0) {
|
|
|
23504
23510
|
asset inputs:file = @textures/${c}.${p ? "png" : "jpg"}@
|
|
23505
23511
|
token inputs:sourceColorSpace = "${s.colorSpace === "srgb" ? "sRGB" : "raw"}"
|
|
23506
23512
|
float2 inputs:st.connect = ${O ? E : k}
|
|
23507
|
-
${
|
|
23513
|
+
${B ? `
|
|
23508
23514
|
float4 inputs:scale = (${r ? r.r + ", " + r.g + ", " + r.b : "1, 1, 1"}, ${a})
|
|
23509
23515
|
` : ""}
|
|
23510
|
-
${
|
|
23511
|
-
float4 inputs:scale = (${
|
|
23512
|
-
float4 inputs:bias = (${A}, ${A}, ${
|
|
23516
|
+
${L ? `
|
|
23517
|
+
float4 inputs:scale = (${X}, ${X}, ${X}, 1)
|
|
23518
|
+
float4 inputs:bias = (${A}, ${A}, ${$}, 0)
|
|
23513
23519
|
` : ""}
|
|
23514
23520
|
token inputs:wrapS = "${g[s.wrapS]}"
|
|
23515
23521
|
token inputs:wrapT = "${g[s.wrapT]}"
|
|
@@ -24075,7 +24081,7 @@ class Ue {
|
|
|
24075
24081
|
console.error("This is a rest clip but you're trying to add tracks to it – this is likely a bug");
|
|
24076
24082
|
return;
|
|
24077
24083
|
}
|
|
24078
|
-
e.name.endsWith("position") ? this.pos = e : e.name.endsWith("quaternion") ? this.rot = e : e.name.endsWith("scale") ? this.scale = e : (e.name.endsWith("activeSelf") ? console.warn("[USDZ] Animation of enabled/disabled state is not supported for USDZ export and will NOT be exported: " + e.name + " on " + (this.root?.name ?? this.target.name) + ". Animate scale 0/1 instead.") : console.warn("[USDZ] Animation track type not supported for USDZ export and will NOT be exported: " + e.name + " on " + (this.root?.name ?? this.target.name) + ". Only .position, .rotation, .scale are supported."),
|
|
24084
|
+
e.name.endsWith("position") ? this.pos = e : e.name.endsWith("quaternion") ? this.rot = e : e.name.endsWith("scale") ? this.scale = e : (e.name.endsWith("activeSelf") ? console.warn("[USDZ] Animation of enabled/disabled state is not supported for USDZ export and will NOT be exported: " + e.name + " on " + (this.root?.name ?? this.target.name) + ". Animate scale 0/1 instead.") : console.warn("[USDZ] Animation track type not supported for USDZ export and will NOT be exported: " + e.name + " on " + (this.root?.name ?? this.target.name) + ". Only .position, .rotation, .scale are supported."), D() && ge("[USDZ] Some animations can't be exported. See console for details."));
|
|
24079
24085
|
}
|
|
24080
24086
|
getFrames() {
|
|
24081
24087
|
return this.clip ? Math.max(this.pos?.times?.length ?? 0, this.rot?.times?.length ?? 0, this.scale?.times?.length ?? 0) : 2;
|
|
@@ -24101,7 +24107,7 @@ class Ue {
|
|
|
24101
24107
|
* @param generateScale
|
|
24102
24108
|
*/
|
|
24103
24109
|
*getValues(e, t = !0, i = !0, n = !0) {
|
|
24104
|
-
const o = new b(), r = new
|
|
24110
|
+
const o = new b(), r = new N(), a = new b(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;
|
|
24105
24111
|
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), c && c.valueSize !== 3 && (c.valueSize = 3), h && h.valueSize !== 4 && (h.valueSize = 4), d && d.valueSize !== 3 && (d.valueSize = 3);
|
|
24106
24112
|
const f = 0;
|
|
24107
24113
|
for (let p = 0 - f; p < e.length + f; p++) {
|
|
@@ -24344,35 +24350,35 @@ class JM {
|
|
|
24344
24350
|
const n = this.model, o = this.animationData;
|
|
24345
24351
|
if (n && n.skinnedMesh) {
|
|
24346
24352
|
let r = function(A) {
|
|
24347
|
-
const
|
|
24348
|
-
for (const [
|
|
24349
|
-
let re = `${
|
|
24353
|
+
const $ = [];
|
|
24354
|
+
for (const [V, ne] of A) {
|
|
24355
|
+
let re = `${V} : [`;
|
|
24350
24356
|
const ue = [];
|
|
24351
24357
|
for (const Se of ne)
|
|
24352
24358
|
ue.push(`(${ae(Se.x)}, ${ae(Se.y)}, ${ae(Se.z)})`);
|
|
24353
|
-
re = re.concat(ue.join(", ")), re = re.concat("],"),
|
|
24359
|
+
re = re.concat(ue.join(", ")), re = re.concat("],"), $.push(re);
|
|
24354
24360
|
}
|
|
24355
|
-
return
|
|
24361
|
+
return $;
|
|
24356
24362
|
}, a = function(A) {
|
|
24357
|
-
const
|
|
24358
|
-
for (const [
|
|
24359
|
-
let re = `${
|
|
24363
|
+
const $ = [];
|
|
24364
|
+
for (const [V, ne] of A) {
|
|
24365
|
+
let re = `${V} : [`;
|
|
24360
24366
|
const ue = [];
|
|
24361
24367
|
for (const Se of ne)
|
|
24362
24368
|
ue.push(`(${ae(Se.w)}, ${ae(Se.x)}, ${ae(Se.y)}, ${ae(Se.z)})`);
|
|
24363
|
-
re = re.concat(ue.join(", ")), re = re.concat("],"),
|
|
24369
|
+
re = re.concat(ue.join(", ")), re = re.concat("],"), $.push(re);
|
|
24364
24370
|
}
|
|
24365
|
-
return
|
|
24371
|
+
return $;
|
|
24366
24372
|
}, l = function(A) {
|
|
24367
|
-
let
|
|
24373
|
+
let $, V = !0;
|
|
24368
24374
|
const ne = /* @__PURE__ */ new Map();
|
|
24369
24375
|
for (const [ue, Se] of A) {
|
|
24370
|
-
|
|
24376
|
+
$ === void 0 && ($ = Se.length), $ !== Se.length && (V = !1);
|
|
24371
24377
|
let Je = 0;
|
|
24372
24378
|
for (const ki of Se)
|
|
24373
24379
|
Je++, ki || (ne.has(ue) || ne.set(ue, []), ne.get(ue).push(Je));
|
|
24374
24380
|
}
|
|
24375
|
-
Sn && console.log("Bone count: ", A.size, "TransformData entries per bone: ",
|
|
24381
|
+
Sn && console.log("Bone count: ", A.size, "TransformData entries per bone: ", $, "Undefined bone entries: ", ne), console.assert(V, "All bones should have the same number of TransformData entries", A), console.assert(ne.size === 0, "All TransformData entries should be set", ne);
|
|
24376
24382
|
const re = [];
|
|
24377
24383
|
for (const [ue, Se] of A)
|
|
24378
24384
|
for (let Je = 0; Je < Se.length; Je++) {
|
|
@@ -24384,14 +24390,14 @@ class JM {
|
|
|
24384
24390
|
for (const ue of re)
|
|
24385
24391
|
ue.pos.sort((Se, Je) => Se - Je), ue.rot.sort((Se, Je) => Se - Je), ue.scale.sort((Se, Je) => Se - Je), ue.pos = [...new Set(ue.pos)], ue.rot = [...new Set(ue.rot)], ue.scale = [...new Set(ue.scale)];
|
|
24386
24392
|
return re;
|
|
24387
|
-
}, c = function(A,
|
|
24388
|
-
const ne = /* @__PURE__ */ new Map(), re = /* @__PURE__ */ new Map(), ue = /* @__PURE__ */ new Map(), Se =
|
|
24389
|
-
for (const Je of
|
|
24393
|
+
}, c = function(A, $, V) {
|
|
24394
|
+
const ne = /* @__PURE__ */ new Map(), re = /* @__PURE__ */ new Map(), ue = /* @__PURE__ */ new Map(), Se = $.length;
|
|
24395
|
+
for (const Je of V) {
|
|
24390
24396
|
const ki = A.get(Je);
|
|
24391
24397
|
let Vc;
|
|
24392
|
-
ki ? console.assert(ki.length === Se, "We should have the same number of TransformData entries for each bone", ki,
|
|
24398
|
+
ki ? console.assert(ki.length === Se, "We should have the same number of TransformData entries for each bone", ki, $) : Vc = new Ue(null, Je, null);
|
|
24393
24399
|
for (let Ds = 0; Ds < Se; Ds++) {
|
|
24394
|
-
const Wu = ki ? ki[Ds] : Vc, kr =
|
|
24400
|
+
const Wu = ki ? ki[Ds] : Vc, kr = $[Ds];
|
|
24395
24401
|
for (const { time: Ya, translation: Ka } of Wu.getValues(kr.pos, !0, !1, !1)) {
|
|
24396
24402
|
const Ki = (Ya + kr.timeOffset) * 60;
|
|
24397
24403
|
ne.has(Ki) || ne.set(Ki, new Array()), ne.get(Ki).push(Ka.clone());
|
|
@@ -24412,93 +24418,93 @@ class JM {
|
|
|
24412
24418
|
scale: ue.size == 0 ? void 0 : ue
|
|
24413
24419
|
};
|
|
24414
24420
|
}, h = function(A) {
|
|
24415
|
-
const
|
|
24416
|
-
for (const
|
|
24417
|
-
|
|
24418
|
-
return
|
|
24421
|
+
const $ = [];
|
|
24422
|
+
for (const V of A)
|
|
24423
|
+
$.push(`(${ae(V.x)}, ${ae(V.y)}, ${ae(V.z)})`);
|
|
24424
|
+
return $.join(", ");
|
|
24419
24425
|
}, d = function(A) {
|
|
24420
|
-
const
|
|
24421
|
-
for (const
|
|
24422
|
-
|
|
24423
|
-
return
|
|
24426
|
+
const $ = [];
|
|
24427
|
+
for (const V of A)
|
|
24428
|
+
$.push(`(${ae(V.w)}, ${ae(V.x)}, ${ae(V.y)}, ${ae(V.z)})`);
|
|
24429
|
+
return $.join(", ");
|
|
24424
24430
|
}, f = function(A) {
|
|
24425
|
-
const
|
|
24431
|
+
const $ = /* @__PURE__ */ new Map();
|
|
24426
24432
|
if (Sn) {
|
|
24427
|
-
const
|
|
24433
|
+
const V = new Array();
|
|
24428
24434
|
for (const [ne, re] of o)
|
|
24429
|
-
|
|
24435
|
+
V.push(ne.uuid + ": " + re.length + " " + re.map((ue) => ue.clip?.uuid.substring(0, 6)).join(" "));
|
|
24430
24436
|
console.log(`getPerBoneTransformData
|
|
24431
|
-
` +
|
|
24437
|
+
` + V.join(`
|
|
24432
24438
|
`));
|
|
24433
24439
|
}
|
|
24434
|
-
for (const
|
|
24435
|
-
const ne = o.get(
|
|
24436
|
-
ne &&
|
|
24440
|
+
for (const V of A) {
|
|
24441
|
+
const ne = o.get(V);
|
|
24442
|
+
ne && $.set(V, ne);
|
|
24437
24443
|
}
|
|
24438
|
-
return
|
|
24444
|
+
return $;
|
|
24439
24445
|
}, p = function(A) {
|
|
24440
|
-
const
|
|
24441
|
-
return c(
|
|
24446
|
+
const $ = f(A), V = l($);
|
|
24447
|
+
return c($, V, A);
|
|
24442
24448
|
};
|
|
24443
24449
|
const g = n.skinnedMesh.skeleton, _ = new Array(), m = [], v = [];
|
|
24444
24450
|
for (const A of g.bones) {
|
|
24445
24451
|
m.push(A), v.push(A.uuid);
|
|
24446
|
-
const
|
|
24447
|
-
_.push({ bone: A, inverse:
|
|
24452
|
+
const $ = g.boneInverses[g.bones.indexOf(A)];
|
|
24453
|
+
_.push({ bone: A, inverse: $ });
|
|
24448
24454
|
}
|
|
24449
24455
|
let y = 1e4;
|
|
24450
24456
|
for (; v.length < g.bones.length && y-- > 0; )
|
|
24451
24457
|
for (const A of m) {
|
|
24452
|
-
const
|
|
24453
|
-
for (const
|
|
24454
|
-
if (v.indexOf(
|
|
24455
|
-
m.push(
|
|
24456
|
-
const ne = g.boneInverses[g.bones.indexOf(
|
|
24457
|
-
_.push({ bone:
|
|
24458
|
+
const $ = A.children;
|
|
24459
|
+
for (const V of $)
|
|
24460
|
+
if (v.indexOf(V.uuid) === -1 && g.bones.indexOf(V) !== -1) {
|
|
24461
|
+
m.push(V), v.push(V.uuid);
|
|
24462
|
+
const ne = g.boneInverses[g.bones.indexOf(V)];
|
|
24463
|
+
_.push({ bone: V, inverse: ne });
|
|
24458
24464
|
}
|
|
24459
24465
|
}
|
|
24460
24466
|
y <= 0 && console.error("Failed to sort bones in skinned mesh", n.skinnedMesh, g.bones, v);
|
|
24461
24467
|
for (const A of xv(g.bones))
|
|
24462
24468
|
_.push({ bone: A, inverse: A.matrixWorld.clone().invert() });
|
|
24463
24469
|
const x = _[0].bone.parent;
|
|
24464
|
-
x || console.error("No bone parent found for skinned mesh during USDZ export", n.skinnedMesh), _.sort((A,
|
|
24465
|
-
const I = t.quickLookCompatible, O = [], k = [], E = [],
|
|
24470
|
+
x || console.error("No bone parent found for skinned mesh during USDZ export", n.skinnedMesh), _.sort((A, $) => aa(A.bone, x) > aa($.bone, x) ? 1 : -1);
|
|
24471
|
+
const I = t.quickLookCompatible, O = [], k = [], E = [], B = [];
|
|
24466
24472
|
for (const { bone: A } of _) {
|
|
24467
24473
|
if (I) {
|
|
24468
|
-
const
|
|
24469
|
-
|
|
24474
|
+
const $ = A.scale;
|
|
24475
|
+
$.x == 0 && ($.x = 1e-5), $.y == 0 && ($.y = 1e-5), $.z == 0 && ($.z = 1e-5), O.push(new te().compose(A.position, A.quaternion, A.scale));
|
|
24470
24476
|
} else
|
|
24471
24477
|
O.push(A.matrix.clone());
|
|
24472
|
-
k.push(A.position), E.push(A.quaternion),
|
|
24478
|
+
k.push(A.position), E.push(A.quaternion), B.push(A.scale);
|
|
24473
24479
|
}
|
|
24474
|
-
const
|
|
24475
|
-
e.beginBlock('def Skeleton "Rig"'), e.appendLine(`uniform matrix4d[] bindTransforms = [${
|
|
24476
|
-
const
|
|
24480
|
+
const L = _.map((A) => '"' + aa(A.bone, x) + '"').join(", "), W = _.map((A) => k_(A.inverse.clone().invert())).join(", ");
|
|
24481
|
+
e.beginBlock('def Skeleton "Rig"'), e.appendLine(`uniform matrix4d[] bindTransforms = [${W}]`), e.appendLine(`uniform token[] joints = [${L}]`), e.appendLine('uniform token purpose = "guide"'), e.appendLine(`uniform matrix4d[] restTransforms = [${O.map((A) => k_(A)).join(", ")}]`);
|
|
24482
|
+
const X = p(_.map((A) => A.bone));
|
|
24477
24483
|
if (Sn) {
|
|
24478
|
-
let A = 1e7,
|
|
24479
|
-
for (const
|
|
24480
|
-
A = Math.min(A,
|
|
24481
|
-
console.log("Time samples", A,
|
|
24484
|
+
let A = 1e7, $ = 0;
|
|
24485
|
+
for (const V of X.position?.keys() ?? [])
|
|
24486
|
+
A = Math.min(A, V), $ = Math.max($, V);
|
|
24487
|
+
console.log("Time samples", A, $, X);
|
|
24482
24488
|
}
|
|
24483
|
-
if (e.beginBlock('def SkelAnimation "_anim"'), e.appendLine(`uniform token[] joints = [${
|
|
24489
|
+
if (e.beginBlock('def SkelAnimation "_anim"'), e.appendLine(`uniform token[] joints = [${L}]`), e.appendLine(`quatf[] rotations = [${d(E)}]`), X && X.quaternion) {
|
|
24484
24490
|
e.beginBlock("quatf[] rotations.timeSamples = {", "");
|
|
24485
|
-
const A = a(
|
|
24486
|
-
for (const
|
|
24487
|
-
e.appendLine(
|
|
24491
|
+
const A = a(X.quaternion);
|
|
24492
|
+
for (const $ of A)
|
|
24493
|
+
e.appendLine($);
|
|
24488
24494
|
e.closeBlock();
|
|
24489
24495
|
}
|
|
24490
|
-
if (e.appendLine(`half3[] scales = [${h(
|
|
24496
|
+
if (e.appendLine(`half3[] scales = [${h(B)}]`), X && X.scale) {
|
|
24491
24497
|
e.beginBlock("half3[] scales.timeSamples = {", "");
|
|
24492
|
-
const A = r(
|
|
24493
|
-
for (const
|
|
24494
|
-
e.appendLine(
|
|
24498
|
+
const A = r(X.scale);
|
|
24499
|
+
for (const $ of A)
|
|
24500
|
+
e.appendLine($);
|
|
24495
24501
|
e.closeBlock();
|
|
24496
24502
|
}
|
|
24497
|
-
if (e.appendLine(`float3[] translations = [${h(k)}]`),
|
|
24503
|
+
if (e.appendLine(`float3[] translations = [${h(k)}]`), X && X.position) {
|
|
24498
24504
|
e.beginBlock("float3[] translations.timeSamples = {", "");
|
|
24499
|
-
const A = r(
|
|
24500
|
-
for (const
|
|
24501
|
-
e.appendLine(
|
|
24505
|
+
const A = r(X.position);
|
|
24506
|
+
for (const $ of A)
|
|
24507
|
+
e.appendLine($);
|
|
24502
24508
|
e.closeBlock();
|
|
24503
24509
|
}
|
|
24504
24510
|
e.closeBlock(), e.closeBlock();
|
|
@@ -24552,18 +24558,18 @@ class JM {
|
|
|
24552
24558
|
}
|
|
24553
24559
|
if (y)
|
|
24554
24560
|
for (const { time: O, translation: k } of g.getValues(m, !0, !1, !1)) {
|
|
24555
|
-
const
|
|
24556
|
-
e.appendLine(
|
|
24561
|
+
const B = `${l.format((_ + O) * Ue.frameRate)}: (${ae(k.x)}, ${ae(k.y)}, ${ae(k.z)}),`;
|
|
24562
|
+
e.appendLine(B);
|
|
24557
24563
|
}
|
|
24558
24564
|
if (x)
|
|
24559
24565
|
for (const { time: O, rotation: k } of g.getValues(m, !1, !0, !1)) {
|
|
24560
|
-
const
|
|
24561
|
-
e.appendLine(
|
|
24566
|
+
const B = `${l.format((_ + O) * Ue.frameRate)}: (${ae(k.w)}, ${ae(k.x)}, ${ae(k.y)}, ${ae(k.z)}),`;
|
|
24567
|
+
e.appendLine(B);
|
|
24562
24568
|
}
|
|
24563
24569
|
if (I)
|
|
24564
24570
|
for (const { time: O, scale: k } of g.getValues(m, !1, !1, !0)) {
|
|
24565
|
-
const
|
|
24566
|
-
e.appendLine(
|
|
24571
|
+
const B = `${l.format((_ + O) * Ue.frameRate)}: (${ae(k.x)}, ${ae(k.y)}, ${ae(k.z)}),`;
|
|
24572
|
+
e.appendLine(B);
|
|
24567
24573
|
}
|
|
24568
24574
|
}
|
|
24569
24575
|
e.closeBlock();
|
|
@@ -24619,7 +24625,7 @@ var tR = Object.defineProperty, Fe = (s, e, t, i) => {
|
|
|
24619
24625
|
};
|
|
24620
24626
|
const A_ = w("debugusdzbehaviours");
|
|
24621
24627
|
function xc(s) {
|
|
24622
|
-
s && (s.getComponentInParent(Sa) || (
|
|
24628
|
+
s && (s.getComponentInParent(Sa) || (D() && console.debug('Raycaster on "' + s.name + '" was automatically added, because no raycaster was found in the parent hierarchy.'), s.addComponent(Vi)));
|
|
24623
24629
|
}
|
|
24624
24630
|
class Da extends T {
|
|
24625
24631
|
object;
|
|
@@ -24628,7 +24634,7 @@ class Da extends T {
|
|
|
24628
24634
|
relativeMotion = !1;
|
|
24629
24635
|
coroutine = null;
|
|
24630
24636
|
targetPos = new b();
|
|
24631
|
-
targetRot = new
|
|
24637
|
+
targetRot = new N();
|
|
24632
24638
|
targetScale = new b();
|
|
24633
24639
|
start() {
|
|
24634
24640
|
xc(this.gameObject);
|
|
@@ -24685,7 +24691,7 @@ const hu = class zt extends T {
|
|
|
24685
24691
|
variantMaterial;
|
|
24686
24692
|
fadeDuration = 0;
|
|
24687
24693
|
start() {
|
|
24688
|
-
this._objectsWithThisMaterial = this.objectsWithThisMaterial, xc(this.gameObject),
|
|
24694
|
+
this._objectsWithThisMaterial = this.objectsWithThisMaterial, xc(this.gameObject), D() && this._objectsWithThisMaterial.length <= 0 && console.warn('ChangeMaterialOnClick: No objects found with material "' + this.materialToSwitch?.name + '"');
|
|
24689
24695
|
}
|
|
24690
24696
|
onPointerEnter(e) {
|
|
24691
24697
|
this.context.input.setCursor("pointer");
|
|
@@ -25024,7 +25030,7 @@ const cg = class yn extends T {
|
|
|
25024
25030
|
afterSerialize() {
|
|
25025
25031
|
if (yn.rootsWithExclusivePlayback.size > 1) {
|
|
25026
25032
|
const e = 'Multiple root objects targeted by more than one animation. To work around QuickLook bug FB13410767, animations will be set as "exclusive" and activating them will stop other animations being marked as exclusive.';
|
|
25027
|
-
|
|
25033
|
+
D() && ge(e), console.warn(e, ...yn.rootsWithExclusivePlayback);
|
|
25028
25034
|
}
|
|
25029
25035
|
yn.animationActions = [], yn.rootsWithExclusivePlayback = /* @__PURE__ */ new Set();
|
|
25030
25036
|
}
|
|
@@ -25033,7 +25039,7 @@ const cg = class yn extends T {
|
|
|
25033
25039
|
const i = t.document, n = t.extensions.find((a) => a instanceof lg);
|
|
25034
25040
|
if (!n) return;
|
|
25035
25041
|
const o = n.getClipCount(this.target) > 1;
|
|
25036
|
-
o && (
|
|
25042
|
+
o && (D() && console.warn("Setting exclusive playback for " + this.target.name + "@" + this.stateName + " because it has " + n.getClipCount(this.target) + " animations. This works around QuickLook bug FB13410767."), yn.rootsWithExclusivePlayback.add(this.target));
|
|
25037
25043
|
const r = this.name ? this.name : "";
|
|
25038
25044
|
i.traverse((a) => {
|
|
25039
25045
|
if (a.uuid === this.target?.uuid) {
|
|
@@ -25131,8 +25137,8 @@ const cg = class yn extends T {
|
|
|
25131
25137
|
y.tracks = v.tracks.map((O) => {
|
|
25132
25138
|
const k = O.clone();
|
|
25133
25139
|
k.times = new Float32Array([0, I]);
|
|
25134
|
-
const E = O.values.length,
|
|
25135
|
-
return k.values = new Float32Array(2 *
|
|
25140
|
+
const E = O.values.length, B = O.getValueSize(), L = O.values.slice(E - B, E);
|
|
25141
|
+
return k.values = new Float32Array(2 * B), k.values.set(L, 0), k.values.set(L, B), k;
|
|
25136
25142
|
}), y.name = x, e.holdClipMap.set(v, y);
|
|
25137
25143
|
}
|
|
25138
25144
|
if (y) {
|
|
@@ -25275,11 +25281,11 @@ class ir {
|
|
|
25275
25281
|
if (this._quicklookButton) return this._quicklookButton;
|
|
25276
25282
|
const e = document.createElement("button");
|
|
25277
25283
|
this._quicklookButton = e, e.dataset.needle = "quicklook-button";
|
|
25278
|
-
const t =
|
|
25284
|
+
const t = q.supportsQuickLookAR();
|
|
25279
25285
|
e.innerText = "View in AR", e.prepend(Mt("view_in_ar"));
|
|
25280
25286
|
let i = !1, n = null;
|
|
25281
25287
|
return e.addEventListener("click", () => {
|
|
25282
|
-
n = Qd(ws), n || (i = !0, n = new ws()), i && (n.objectToExport =
|
|
25288
|
+
n = Qd(ws), n || (i = !0, n = new ws()), i && (n.objectToExport = U.Current.scene), n ? (e.classList.add("this-mode-is-requested"), n.exportAndOpen().then(() => {
|
|
25283
25289
|
e.classList.remove("this-mode-is-requested");
|
|
25284
25290
|
}).catch((o) => {
|
|
25285
25291
|
e.classList.remove("this-mode-is-requested"), console.error(o);
|
|
@@ -25296,7 +25302,7 @@ class ir {
|
|
|
25296
25302
|
createARButton(e) {
|
|
25297
25303
|
if (this._arButton) return this._arButton;
|
|
25298
25304
|
const t = "immersive-ar", i = document.createElement("button");
|
|
25299
|
-
return this._arButton = i, i.classList.add("webxr-button"), i.dataset.needle = "webxr-ar-button", i.innerText = "Enter AR", i.prepend(Mt("view_in_ar")), i.title = "Click to start an AR session", i.addEventListener("click", () => K.start(t, e)), this.updateSessionSupported(i, t), this.listenToXRSessionState(i, t), this.hideElementDuringXRSession(i), this.isSecureConnection || (i.disabled = !0, i.title = "WebXR requires a secure connection (HTTPS)"),
|
|
25305
|
+
return this._arButton = i, i.classList.add("webxr-button"), i.dataset.needle = "webxr-ar-button", i.innerText = "Enter AR", i.prepend(Mt("view_in_ar")), i.title = "Click to start an AR session", i.addEventListener("click", () => K.start(t, e)), this.updateSessionSupported(i, t), this.listenToXRSessionState(i, t), this.hideElementDuringXRSession(i), this.isSecureConnection || (i.disabled = !0, i.title = "WebXR requires a secure connection (HTTPS)"), q.isMozillaXR() || navigator.xr?.addEventListener("devicechange", () => this.updateSessionSupported(i, t)), i;
|
|
25300
25306
|
}
|
|
25301
25307
|
/** get or create the WebXR VR button
|
|
25302
25308
|
* @param init optional session init options
|
|
@@ -25308,7 +25314,7 @@ class ir {
|
|
|
25308
25314
|
createVRButton(e) {
|
|
25309
25315
|
if (this._vrButton) return this._vrButton;
|
|
25310
25316
|
const t = "immersive-vr", i = document.createElement("button");
|
|
25311
|
-
return this._vrButton = i, i.classList.add("webxr-button"), i.dataset.needle = "webxr-vr-button", i.innerText = "Enter VR", i.prepend(Mt("panorama_photosphere")), i.title = "Click to start a VR session", i.addEventListener("click", () => K.start(t, e)), this.updateSessionSupported(i, t), this.listenToXRSessionState(i, t), this.hideElementDuringXRSession(i), this.isSecureConnection || (i.disabled = !0, i.title = "WebXR requires a secure connection (HTTPS)"),
|
|
25317
|
+
return this._vrButton = i, i.classList.add("webxr-button"), i.dataset.needle = "webxr-vr-button", i.innerText = "Enter VR", i.prepend(Mt("panorama_photosphere")), i.title = "Click to start a VR session", i.addEventListener("click", () => K.start(t, e)), this.updateSessionSupported(i, t), this.listenToXRSessionState(i, t), this.hideElementDuringXRSession(i), this.isSecureConnection || (i.disabled = !0, i.title = "WebXR requires a secure connection (HTTPS)"), q.isMozillaXR() || navigator.xr?.addEventListener("devicechange", () => this.updateSessionSupported(i, t)), i;
|
|
25312
25318
|
}
|
|
25313
25319
|
/** get or create the Send To Quest button
|
|
25314
25320
|
* Behaviour of the button:
|
|
@@ -25320,7 +25326,7 @@ class ir {
|
|
|
25320
25326
|
return this._sendToQuestButton = t, t.dataset.needle = "webxr-sendtoquest-button", t.innerText = "Open on Quest", t.prepend(Mt("share_windows")), t.title = "Click to send this page to the Oculus Browser on your Quest", t.addEventListener("click", () => {
|
|
25321
25327
|
const i = encodeURIComponent(window.location.href), n = e + i;
|
|
25322
25328
|
window.open(n) == null && Be("This page doesn't allow popups. Please paste " + n + " into your browser.");
|
|
25323
|
-
}), this.listenToXRSessionState(t), this.hideElementDuringXRSession(t),
|
|
25329
|
+
}), this.listenToXRSessionState(t), this.hideElementDuringXRSession(t), q.isMozillaXR() || navigator.xr?.addEventListener("devicechange", () => {
|
|
25324
25330
|
navigator.xr?.isSessionSupported("immersive-vr") ? t.style.display = "none" : t.style.display = "";
|
|
25325
25331
|
}), t;
|
|
25326
25332
|
}
|
|
@@ -25336,7 +25342,7 @@ class ir {
|
|
|
25336
25342
|
return;
|
|
25337
25343
|
}
|
|
25338
25344
|
K.isSessionSupported(t).then((i) => {
|
|
25339
|
-
e.style.display = i ? "" : "none",
|
|
25345
|
+
e.style.display = i ? "" : "none", D() && !i && console.log('[WebXR] "' + t + '" is not supported on this device – make sure your server runs using HTTPS and you have a device connected that supports ' + t);
|
|
25340
25346
|
});
|
|
25341
25347
|
}
|
|
25342
25348
|
hideElementDuringXRSession(e) {
|
|
@@ -25843,7 +25849,7 @@ class Ni extends T {
|
|
|
25843
25849
|
}
|
|
25844
25850
|
async onCreateAnchor(e, t) {
|
|
25845
25851
|
if (t.createAnchor === void 0) {
|
|
25846
|
-
console.warn("Hit does not support creating an anchor", t),
|
|
25852
|
+
console.warn("Hit does not support creating an anchor", t), D() && ge("Hit does not support creating an anchor");
|
|
25847
25853
|
return;
|
|
25848
25854
|
} else {
|
|
25849
25855
|
const i = await t.createAnchor(e.viewerPose.transform);
|
|
@@ -25948,7 +25954,7 @@ class vd {
|
|
|
25948
25954
|
touchStart = (e) => {
|
|
25949
25955
|
if (!e.defaultPrevented)
|
|
25950
25956
|
for (let t = 0; t < e.changedTouches.length; t++) {
|
|
25951
|
-
const i = e.changedTouches[t], n =
|
|
25957
|
+
const i = e.changedTouches[t], n = q.isAndroidDevice() && i.clientY < window.innerHeight * 0.1;
|
|
25952
25958
|
this.prev.has(i.identifier) || this.prev.set(i.identifier, {
|
|
25953
25959
|
ignore: n,
|
|
25954
25960
|
x: 0,
|
|
@@ -26100,10 +26106,10 @@ const Lv = function(s = null) {
|
|
|
26100
26106
|
let i = "";
|
|
26101
26107
|
typeof t == "string" ? i = t : i = t.name;
|
|
26102
26108
|
let n = null, o;
|
|
26103
|
-
typeof s == "string" ? o = e[s] : typeof s == "function" && (o = s), o == null && (
|
|
26109
|
+
typeof s == "string" ? o = e[s] : typeof s == "function" && (o = s), o == null && (D() || Ks) && s != null && console.warn('syncField: no callback function found for property "' + i + '"', '"' + s + '"');
|
|
26104
26110
|
const r = e, a = r.__internalAwake;
|
|
26105
26111
|
if (typeof a != "function") {
|
|
26106
|
-
(Ks ||
|
|
26112
|
+
(Ks || D()) && console.error('@syncField can currently only used on Needle Engine Components, custom object of type "' + e?.constructor?.name + '" is not supported', e);
|
|
26107
26113
|
return;
|
|
26108
26114
|
}
|
|
26109
26115
|
Ks && console.log(i);
|
|
@@ -26117,7 +26123,7 @@ const Lv = function(s = null) {
|
|
|
26117
26123
|
set: function(f) {
|
|
26118
26124
|
const p = this[l];
|
|
26119
26125
|
if (this[l] = f, d) {
|
|
26120
|
-
(
|
|
26126
|
+
(D() || Ks) && console.warn("Recursive call detected", i);
|
|
26121
26127
|
return;
|
|
26122
26128
|
}
|
|
26123
26129
|
d = !0;
|
|
@@ -26397,7 +26403,7 @@ class Es extends T {
|
|
|
26397
26403
|
* Applies all configured options to the active {@link Context.menu}.
|
|
26398
26404
|
*/
|
|
26399
26405
|
applyOptions() {
|
|
26400
|
-
this.context.menu.setPosition(this.position), this.context.menu.showNeedleLogo(this.showNeedleLogo), this.createFullscreenButton === !0 && this.context.menu.showFullscreenOption(!0), this.createMuteButton === !0 && this.context.menu.showAudioPlaybackOption(!0), this.showSpatialMenu === !0 && this.context.menu.showSpatialMenu(this.showSpatialMenu), this.createQRCodeButton === !0 && (
|
|
26406
|
+
this.context.menu.setPosition(this.position), this.context.menu.showNeedleLogo(this.showNeedleLogo), this.createFullscreenButton === !0 && this.context.menu.showFullscreenOption(!0), this.createMuteButton === !0 && this.context.menu.showAudioPlaybackOption(!0), this.showSpatialMenu === !0 && this.context.menu.showSpatialMenu(this.showSpatialMenu), this.createQRCodeButton === !0 && (q.isMobileDevice() || this.context.menu.showQRCodeButton(!0));
|
|
26401
26407
|
}
|
|
26402
26408
|
}
|
|
26403
26409
|
ja([
|
|
@@ -26423,7 +26429,7 @@ var mR = Object.defineProperty, ug = (s, e, t, i) => {
|
|
|
26423
26429
|
(r = s[o]) && (n = r(e, t, n) || n);
|
|
26424
26430
|
return n && mR(e, t, n), n;
|
|
26425
26431
|
};
|
|
26426
|
-
const rl = w("debugwebxr"), L_ = new
|
|
26432
|
+
const rl = w("debugwebxr"), L_ = new N().setFromAxisAngle(new b(0, 1, 0), Math.PI);
|
|
26427
26433
|
class lr extends T {
|
|
26428
26434
|
head;
|
|
26429
26435
|
leftHand;
|
|
@@ -26646,7 +26652,7 @@ class uo extends T {
|
|
|
26646
26652
|
}
|
|
26647
26653
|
async loadHandModel(e, t) {
|
|
26648
26654
|
const i = this.context, n = i.renderer.xr.getHand(t.index);
|
|
26649
|
-
n || (Jn ?
|
|
26655
|
+
n || (Jn ? z.DrawLabel(t.rayWorldPosition, "No hand found for index " + t.index, 0.05, 5) : console.warn("No hand found for index " + t.index));
|
|
26650
26656
|
const o = new Ps();
|
|
26651
26657
|
$m(o, i), await Fp(o, i, this.sourceId ?? "");
|
|
26652
26658
|
const r = uv(o);
|
|
@@ -26659,7 +26665,7 @@ class uo extends T {
|
|
|
26659
26665
|
const f = r?.gltf;
|
|
26660
26666
|
f?.scene.children?.length === 0 && (f.scene.children[0] = d), r?.gltf && jn().createBuiltinComponents(e.context, e.sourceId || a, r.gltf, null, r), d.traverse((p) => {
|
|
26661
26667
|
p.layers.set(2), K.active?.isPassThrough && !l && this.makeOccluder(p), p instanceof H && We.assignMeshLOD(p, 0);
|
|
26662
|
-
}), t.connected || (Jn &&
|
|
26668
|
+
}), t.connected || (Jn && z.DrawLabel(t.rayWorldPosition, "Hand is loaded but not connected anymore", 0.05, 5), d.removeFromParent());
|
|
26663
26669
|
});
|
|
26664
26670
|
if (Jn && c.add(new mi(0.5)), t.inputSource.hand) {
|
|
26665
26671
|
Jn && console.log(t.inputSource.hand);
|
|
@@ -26669,7 +26675,7 @@ class uo extends T {
|
|
|
26669
26675
|
f.matrixAutoUpdate = !1, f.visible = !0, n.joints[d.jointName] = f, n.add(f);
|
|
26670
26676
|
}
|
|
26671
26677
|
} else
|
|
26672
|
-
Jn &&
|
|
26678
|
+
Jn && z.DrawLabel(t.rayWorldPosition, "No inputSource.hand found for index " + t.index, 0.05, 5);
|
|
26673
26679
|
return { handObject: c, handmesh: h };
|
|
26674
26680
|
}
|
|
26675
26681
|
makeOccluder(e) {
|
|
@@ -26784,9 +26790,9 @@ class Gi extends T {
|
|
|
26784
26790
|
if (this.useTeleportTarget && !S.getComponentInParent(n.object, fg))
|
|
26785
26791
|
return;
|
|
26786
26792
|
const r = o.clone();
|
|
26787
|
-
if (jf &&
|
|
26793
|
+
if (jf && z.DrawSphere(o, 0.025, 16711680, 5), this.context.mainCamera?.position) {
|
|
26788
26794
|
const l = this.context.xr?.getUserOffsetInRig();
|
|
26789
|
-
l && (l.y = 0, r.sub(l), jf &&
|
|
26795
|
+
l && (l.y = 0, r.sub(l), jf && z.DrawWireSphere(l.add(r), 0.025, 65280, 5));
|
|
26790
26796
|
}
|
|
26791
26797
|
this._teleportBuffer.push(t.matrix.clone()), this._teleportBuffer.length > 10 && this._teleportBuffer.shift(), this.useTeleportFade ? e.xr.fadeTransition()?.then(() => {
|
|
26792
26798
|
t.worldPosition = r;
|
|
@@ -26849,7 +26855,7 @@ class Gi extends T {
|
|
|
26849
26855
|
if (c || (c = l[0]), n && (n.controller = i, n.hit = c), this._hitDistances[t] = c?.distance || null, c) {
|
|
26850
26856
|
this._lastHitDistances[t] = c.distance;
|
|
26851
26857
|
const h = e.rigScale ?? 1;
|
|
26852
|
-
jf && (
|
|
26858
|
+
jf && (z.DrawWireSphere(c.point, 0.025 * h, 16711680), z.DrawLabel(G(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;
|
|
26853
26859
|
let d = 0.01 * (h + c.distance);
|
|
26854
26860
|
const f = i.getButton("primary")?.pressed;
|
|
26855
26861
|
f && (d *= 1.1), n.scale.set(d, d, d), n.layers.set(2);
|
|
@@ -27074,7 +27080,7 @@ const al = w("debugwebxr"), vR = w("debugusdz"), rt = class Wr extends T {
|
|
|
27074
27080
|
for (const o of this.context.scene.children)
|
|
27075
27081
|
n.add(o);
|
|
27076
27082
|
this.context.scene.add(n), i = S.addComponent(n, Ni), this._createdComponentsInSession.push(i);
|
|
27077
|
-
} else (al ||
|
|
27083
|
+
} else (al || D()) && console.warn("WebXR: No WebARSessionRoot found in scene and usePlacementReticle is disabled in WebXR component.");
|
|
27078
27084
|
this._activeWebARSessionRoot = i, i && (i.customReticle = this.customARPlacementReticle, i.arScale = this.arScale, i.arTouchTransform = this.usePlacementAdjustment, i.autoPlace = this.autoPlace, i.autoCenter = this.autoCenter, i.useXRAnchor = this.useXRAnchor);
|
|
27079
27085
|
}
|
|
27080
27086
|
this.useDefaultControls && this.setDefaultMovementEnabled(!0), (this.showControllerModels || this.showHandModels) && this.setDefaultControllerRenderingEnabled(!0), this.useSpatialGrab && (this._spatialGrabRaycaster = S.findObjectOfType(Ca) ?? void 0, this._spatialGrabRaycaster || (this._spatialGrabRaycaster = this.gameObject.addComponent(Ca))), this.createLocalAvatar(e.xr), e.xr.isScreenBasedAR || (this._exitXRMenuButton = this.context.menu.appendChild({
|
|
@@ -27157,7 +27163,7 @@ const al = w("debugwebxr"), vR = w("debugusdz"), rt = class Wr extends T {
|
|
|
27157
27163
|
*/
|
|
27158
27164
|
handleCreatingHTML() {
|
|
27159
27165
|
if (this.createARButton || this.createVRButton || this.useQuicklookExport) {
|
|
27160
|
-
if ((
|
|
27166
|
+
if ((q.isiOS() && q.isSafari() || vR) && this.useQuicklookExport) {
|
|
27161
27167
|
const t = S.findObjectOfType(ws);
|
|
27162
27168
|
if (!t || t && t.allowCreateQuicklookButton) {
|
|
27163
27169
|
const i = this.getButtonsFactory().createQuicklookButton();
|
|
@@ -27173,7 +27179,7 @@ const al = w("debugwebxr"), vR = w("debugusdz"), rt = class Wr extends T {
|
|
|
27173
27179
|
this.addButton(t, 50);
|
|
27174
27180
|
}
|
|
27175
27181
|
}
|
|
27176
|
-
if (this.createSendToQuestButton && !
|
|
27182
|
+
if (this.createSendToQuestButton && !q.isQuest() && K.isVRSupported().then((t) => {
|
|
27177
27183
|
if (!t) {
|
|
27178
27184
|
const i = this.getButtonsFactory().createSendToQuestButton();
|
|
27179
27185
|
this.addButton(i, 50);
|
|
@@ -27181,8 +27187,8 @@ const al = w("debugwebxr"), vR = w("debugusdz"), rt = class Wr extends T {
|
|
|
27181
27187
|
}), this.createQRCode) {
|
|
27182
27188
|
const t = Qd(Es);
|
|
27183
27189
|
if (t && t.createQRCodeButton === !1)
|
|
27184
|
-
|
|
27185
|
-
else if (!
|
|
27190
|
+
D() && console.warn("WebXR: QRCode button is disabled in the Needle Menu component");
|
|
27191
|
+
else if (!q.isMobileDevice()) {
|
|
27186
27192
|
const i = On.getOrCreate().createQRCode();
|
|
27187
27193
|
this.addButton(i, 50);
|
|
27188
27194
|
}
|
|
@@ -27587,7 +27593,7 @@ class PR {
|
|
|
27587
27593
|
width;
|
|
27588
27594
|
height;
|
|
27589
27595
|
}
|
|
27590
|
-
const en = new b(), ll = new te(), gh = new
|
|
27596
|
+
const en = new b(), ll = new te(), gh = new N(), Ba = class zv extends hn {
|
|
27591
27597
|
get parent() {
|
|
27592
27598
|
return this._parentRectTransform;
|
|
27593
27599
|
}
|
|
@@ -28503,8 +28509,8 @@ class vo extends Si {
|
|
|
28503
28509
|
a ? m += this.padding.left : m += this.padding.top;
|
|
28504
28510
|
let v = 0, y = 0;
|
|
28505
28511
|
for (let E = 0; E < this.gameObject.children.length; E++) {
|
|
28506
|
-
const
|
|
28507
|
-
|
|
28512
|
+
const B = this.gameObject.children[E], L = S.getComponent(B, zn);
|
|
28513
|
+
L?.activeAndEnabled && (y += 1, a ? v += L.width : v += L.height);
|
|
28508
28514
|
}
|
|
28509
28515
|
let x = 0;
|
|
28510
28516
|
const I = this.spacing * (y - 1);
|
|
@@ -28516,20 +28522,20 @@ class vo extends Si {
|
|
|
28516
28522
|
O += this.padding.left, O -= this.padding.right, _ !== 0 && (m = g - v, m *= _, m -= I * _, a ? (m -= this.padding.right * _, m += this.padding.left * (1 - _), m < this.padding.left && (m = this.padding.left)) : (m -= this.padding.bottom * _, m += this.padding.top * (1 - _), m < this.padding.top && (m = this.padding.top)));
|
|
28517
28523
|
let k = 1;
|
|
28518
28524
|
for (let E = 0; E < this.gameObject.children.length; E++) {
|
|
28519
|
-
const
|
|
28520
|
-
if (
|
|
28521
|
-
|
|
28522
|
-
const
|
|
28523
|
-
|
|
28524
|
-
const
|
|
28525
|
-
|
|
28526
|
-
const A = a ?
|
|
28527
|
-
if (m +=
|
|
28525
|
+
const B = this.gameObject.children[E], L = S.getComponent(B, zn);
|
|
28526
|
+
if (L?.activeAndEnabled) {
|
|
28527
|
+
L.pivot?.set(0.5, 0.5), L.anchorMin.set(0, 1), L.anchorMax.set(0, 1);
|
|
28528
|
+
const W = i * 0.5 + O * 0.5;
|
|
28529
|
+
L.anchoredPosition.x !== W && (L.anchoredPosition.x = W);
|
|
28530
|
+
const X = o * -0.5;
|
|
28531
|
+
L.anchoredPosition.y !== X && (L.anchoredPosition.y = X), f && h && L.sizeDelta[l] !== p && (L.sizeDelta[l] = p), d && c && L.sizeDelta[t] !== x && (L.sizeDelta[t] = x);
|
|
28532
|
+
const A = a ? L.width : L.height, $ = A * 0.5;
|
|
28533
|
+
if (m += $, d) {
|
|
28528
28534
|
const ne = x * k - x * 0.5;
|
|
28529
|
-
ne > m && (m = ne - x * 0.5 + A + this.padding.left, m -=
|
|
28535
|
+
ne > m && (m = ne - x * 0.5 + A + this.padding.left, m -= $);
|
|
28530
28536
|
}
|
|
28531
|
-
let
|
|
28532
|
-
t === "y" && (
|
|
28537
|
+
let V = m;
|
|
28538
|
+
t === "y" && (V = -V), L.anchoredPosition[t] !== V && (L.anchoredPosition[t] = V), m += $, m += this.spacing, k += 1;
|
|
28533
28539
|
}
|
|
28534
28540
|
}
|
|
28535
28541
|
}
|
|
@@ -29064,7 +29070,7 @@ const ii = class Tl extends T {
|
|
|
29064
29070
|
}
|
|
29065
29071
|
/** @internal */
|
|
29066
29072
|
onEnable() {
|
|
29067
|
-
const e =
|
|
29073
|
+
const e = q.supportsQuickLookAR(), t = q.isiOS() || q.isiPad();
|
|
29068
29074
|
!this.button && (ni || e || t) && (this.allowCreateQuicklookButton && (this.button = this.createQuicklookButton()), this.lastCallback = this.quicklookCallback.bind(this), this.link = j_(this.context, e), this.link.addEventListener("message", this.lastCallback)), ni && Be("USDZ Exporter enabled: " + this.name), document.getElementById("open-in-ar")?.addEventListener("click", this.onClickedOpenInARElement), ic.registerExporter(this);
|
|
29069
29075
|
}
|
|
29070
29076
|
/** @internal */
|
|
@@ -29088,7 +29094,7 @@ const ii = class Tl extends T {
|
|
|
29088
29094
|
*/
|
|
29089
29095
|
async exportAndOpen() {
|
|
29090
29096
|
let e = this.exportFileName ?? this.objectToExport?.name ?? this.name;
|
|
29091
|
-
if (e += "-" + OM(), bs() || (e !== "" && (e += "-"), e += "MadeWithNeedle"), this.link || (this.link = j_(this.context,
|
|
29097
|
+
if (e += "-" + OM(), bs() || (e !== "" && (e += "-"), e += "MadeWithNeedle"), this.link || (this.link = j_(this.context, q.supportsQuickLookAR())), this.customUsdzFile)
|
|
29092
29098
|
return ni && console.log("Exporting custom usdz", this.customUsdzFile), this.openInQuickLook(this.customUsdzFile, e), null;
|
|
29093
29099
|
if (!this.objectToExport)
|
|
29094
29100
|
return console.warn("No object to export", this), null;
|
|
@@ -29128,19 +29134,19 @@ const ii = class Tl extends T {
|
|
|
29128
29134
|
for (const k of O.sharedMeshes)
|
|
29129
29135
|
if (k) {
|
|
29130
29136
|
const E = We.assignMeshLOD(k, 0);
|
|
29131
|
-
E instanceof Promise && n.push(new Promise((
|
|
29137
|
+
E instanceof Promise && n.push(new Promise((B, L) => {
|
|
29132
29138
|
E.then(() => {
|
|
29133
|
-
o++, le.report("export-usdz-textures", { message: "Loaded progressive mesh", currentStep: o, totalSteps: n.length }),
|
|
29134
|
-
}).catch((
|
|
29139
|
+
o++, le.report("export-usdz-textures", { message: "Loaded progressive mesh", currentStep: o, totalSteps: n.length }), B();
|
|
29140
|
+
}).catch((W) => L(W));
|
|
29135
29141
|
}));
|
|
29136
29142
|
}
|
|
29137
29143
|
for (const k of O.sharedMaterials)
|
|
29138
29144
|
if (k) {
|
|
29139
29145
|
const E = We.assignTextureLOD(k, 0);
|
|
29140
|
-
E instanceof Promise && n.push(new Promise((
|
|
29146
|
+
E instanceof Promise && n.push(new Promise((B, L) => {
|
|
29141
29147
|
E.then(() => {
|
|
29142
|
-
o++, le.report("export-usdz-textures", { message: "Loaded progressive texture", currentStep: o, totalSteps: n.length }),
|
|
29143
|
-
}).catch((
|
|
29148
|
+
o++, le.report("export-usdz-textures", { message: "Loaded progressive texture", currentStep: o, totalSteps: n.length }), B();
|
|
29149
|
+
}).catch((W) => L(W));
|
|
29144
29150
|
}));
|
|
29145
29151
|
}
|
|
29146
29152
|
}
|
|
@@ -29150,7 +29156,7 @@ const ii = class Tl extends T {
|
|
|
29150
29156
|
const a = new FM(), l = new lg(this.quickLookCompatible);
|
|
29151
29157
|
let c;
|
|
29152
29158
|
const h = [];
|
|
29153
|
-
this.interactive && (h.push(new Bv()), h.push(new La()), globalThis.NEEDLE_USE_RAPIER && S.getComponentsInChildren(e, ft).length > 0 && (this.physics ? (c = new Fv(), h.push(c)) :
|
|
29159
|
+
this.interactive && (h.push(new Bv()), h.push(new La()), globalThis.NEEDLE_USE_RAPIER && S.getComponentsInChildren(e, ft).length > 0 && (this.physics ? (c = new Fv(), h.push(c)) : D() && console.warn("USDZExporter: Physics export is disabled, but there are active Rigidbody components in the scene. They will not be exported.")), h.push(new gg()), h.push(new Qv()));
|
|
29154
29160
|
const d = [l, ...h, ...this.extensions], f = { self: this, exporter: a, extensions: d, object: e };
|
|
29155
29161
|
le.report("export-usdz", "Invoking before-export"), this.dispatchEvent(new CustomEvent("before-export", { detail: f })), this.applyWebARSessionRoot(), this._previousTimeScale = this.context.time.timeScale, this.context.time.timeScale = 0, le.report("export-usdz", "auto export animations and audio sources");
|
|
29156
29162
|
const p = new Array();
|
|
@@ -29161,11 +29167,11 @@ const ii = class Tl extends T {
|
|
|
29161
29167
|
const E = S.getComponent(O, Hi);
|
|
29162
29168
|
return E && !E.enabled && (k = !1), k && _.includes(O) && (k = !1), k && S.getComponentInParent(O, ou) && (k = !1), k && S.getComponentInParent(O, Ms) && (k = !1), ni && !k && console.log("USDZExporter: Discarding object", O), k;
|
|
29163
29169
|
}, a.beforeWritingDocument = () => {
|
|
29164
|
-
if (
|
|
29170
|
+
if (D() && l && c) {
|
|
29165
29171
|
const O = l.animatedRoots;
|
|
29166
29172
|
for (const k of O) {
|
|
29167
|
-
const E = S.getComponentsInChildren(k, ft).filter((
|
|
29168
|
-
(E.length > 0 ||
|
|
29173
|
+
const E = S.getComponentsInChildren(k, ft).filter((L) => L.enabled), B = S.getComponents(k, wi).filter((L) => L.enabled && !L.isTrigger);
|
|
29174
|
+
(E.length > 0 || B.length > 0) && console.error("An animated object has physics components in its child hierarchy. This can lead to undefined behaviour due to a bug in Apple's QuickLook (FB15925487). Remove the physics components from child objects or verify that you get the expected results.", k);
|
|
29169
29175
|
}
|
|
29170
29176
|
}
|
|
29171
29177
|
};
|
|
@@ -29237,10 +29243,10 @@ const ii = class Tl extends T {
|
|
|
29237
29243
|
return this.customBranding && Object.assign(e, this.customBranding), bs() || (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;
|
|
29238
29244
|
}
|
|
29239
29245
|
static invertForwardMatrix = new te().makeRotationY(Math.PI);
|
|
29240
|
-
static invertForwardQuaternion = new
|
|
29246
|
+
static invertForwardQuaternion = new N().setFromEuler(new Rt(0, Math.PI, 0));
|
|
29241
29247
|
_rootSessionRootWasAppliedTo = null;
|
|
29242
29248
|
_rootPositionBeforeExport = new b();
|
|
29243
|
-
_rootRotationBeforeExport = new
|
|
29249
|
+
_rootRotationBeforeExport = new N();
|
|
29244
29250
|
_rootScaleBeforeExport = new b();
|
|
29245
29251
|
getARScaleAndTarget() {
|
|
29246
29252
|
if (!this.objectToExport) return { scale: 1, _invertForward: !1, target: this.gameObject, sessionRoot: null };
|
|
@@ -29984,7 +29990,7 @@ class Na extends T {
|
|
|
29984
29990
|
a.projectPoint(e, c), e.copy(c);
|
|
29985
29991
|
}
|
|
29986
29992
|
this.affectPosition && ut(this.gameObject, e);
|
|
29987
|
-
const n = new Rt(this.rotationOffset.x, this.rotationOffset.y, this.rotationOffset.z), o = new
|
|
29993
|
+
const n = new Rt(this.rotationOffset.x, this.rotationOffset.y, this.rotationOffset.z), o = new N().setFromEuler(n);
|
|
29988
29994
|
this.affectRotation && an(this.gameObject, t.multiply(o));
|
|
29989
29995
|
const r = new b();
|
|
29990
29996
|
this.from.getWorldDirection(r).multiplyScalar(50), this.levelLookDirection && (r.y = 0), this.alignLookDirection && this.gameObject.lookAt(r);
|
|
@@ -30601,7 +30607,7 @@ const Ke = class Il {
|
|
|
30601
30607
|
if (i && (n *= this.system.worldScale.x), this.enabled) {
|
|
30602
30608
|
switch (this.shapeType) {
|
|
30603
30609
|
case 5:
|
|
30604
|
-
bh &&
|
|
30610
|
+
bh && z.DrawWireBox(this.position, this.scale, 14540253, 1), this._vector.x = Math.random() * this.scale.x - this.scale.x / 2, this._vector.y = Math.random() * this.scale.y - this.scale.y / 2, this._vector.z = Math.random() * this.scale.z - this.scale.z / 2, this._vector.add(t);
|
|
30605
30611
|
break;
|
|
30606
30612
|
case 4:
|
|
30607
30613
|
this.randomConePoint(this.position, this.angle, n, this.radiusThickness, this.arc, this.arcMode, this._vector);
|
|
@@ -30643,12 +30649,12 @@ const Ke = class Il {
|
|
|
30643
30649
|
}
|
|
30644
30650
|
break;
|
|
30645
30651
|
default:
|
|
30646
|
-
this._vector.set(0, 0, 0),
|
|
30652
|
+
this._vector.set(0, 0, 0), D() && !globalThis.__particlesystem_shapetype_unsupported && (console.warn("ParticleSystem ShapeType is not supported:", Gp[this.shapeType]), globalThis.__particlesystem_shapetype_unsupported = !0);
|
|
30647
30653
|
break;
|
|
30648
30654
|
}
|
|
30649
30655
|
this.randomizePosition(this._vector, this.randomPositionAmount);
|
|
30650
30656
|
}
|
|
30651
|
-
this.applyRotation(this._vector), i && (this._vector.applyQuaternion(this.system.worldQuaternion), this._vector.add(this.system.worldPos)), bh &&
|
|
30657
|
+
this.applyRotation(this._vector), i && (this._vector.applyQuaternion(this.system.worldQuaternion), this._vector.add(this.system.worldPos)), bh && z.DrawSphere(this._vector, 0.03, 16711680, 0.5, !0);
|
|
30652
30658
|
}
|
|
30653
30659
|
_dir = new b();
|
|
30654
30660
|
getDirection(e, t) {
|
|
@@ -30695,9 +30701,9 @@ const Ke = class Il {
|
|
|
30695
30701
|
this._dir.set(0, 0, 1);
|
|
30696
30702
|
break;
|
|
30697
30703
|
}
|
|
30698
|
-
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), bh && (
|
|
30704
|
+
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), bh && (z.DrawSphere(t, 0.01, 8925952, 0.5, !0), z.DrawDirection(t, this._dir, 8925952, 0.5, !0)), this._dir;
|
|
30699
30705
|
}
|
|
30700
|
-
static _randomQuat = new
|
|
30706
|
+
static _randomQuat = new N();
|
|
30701
30707
|
static _tempVec = new b();
|
|
30702
30708
|
randomizePosition(e, t) {
|
|
30703
30709
|
if (t <= 0) return;
|
|
@@ -31056,7 +31062,7 @@ class Ve {
|
|
|
31056
31062
|
if (!this.enabled) return;
|
|
31057
31063
|
const l = r / a, c = this.speedModifier.evaluate(l) * this.speedModifierMultiplier, h = this.x.evaluate(l), d = this.y.evaluate(l), f = this.z.evaluate(l);
|
|
31058
31064
|
if (this._temp.set(-h, d, f), this._system && this._system.main.simulationSpace === 1 && this._temp.applyQuaternion(this._system.worldQuaternion), this._hasOrbital && this._system?.worldPos) {
|
|
31059
|
-
const g = this._temp2.set(i.x, i.y, i.z), _ = this.orbitalXMultiplier, m = this.orbitalYMultiplier, v = this.orbitalZMultiplier, y = c * Math.PI * 2 * 10, x = Math.cos(y * _), I = Math.sin(y * _), O = Math.cos(y * m), k = Math.sin(y * m), E = Math.cos(y * v),
|
|
31065
|
+
const g = this._temp2.set(i.x, i.y, i.z), _ = this.orbitalXMultiplier, m = this.orbitalYMultiplier, v = this.orbitalZMultiplier, y = c * Math.PI * 2 * 10, x = Math.cos(y * _), I = Math.sin(y * _), O = Math.cos(y * m), k = Math.sin(y * m), E = Math.cos(y * v), B = Math.sin(y * v), L = g.x * (O * E) + g.y * (O * B) + g.z * -k, W = g.x * (I * k * E - x * B) + g.y * (I * k * B + x * E) + g.z * (I * O), X = g.x * (x * k * E + I * B) + g.y * (x * k * B - I * E) + g.z * (x * O), A = this._temp3.set(g.x - L, g.y - W, g.z - X);
|
|
31060
31066
|
A.normalize(), A.multiplyScalar(0.2 / o * Math.max(this.orbitalXMultiplier, this.orbitalYMultiplier, this.orbitalZMultiplier)), n.x += A.x, n.y += A.y, n.z += A.z;
|
|
31061
31067
|
}
|
|
31062
31068
|
n.x += this._temp.x, n.y += this._temp.y, n.z += this._temp.z, n.x *= c, n.y *= c, n.z *= c;
|
|
@@ -31493,7 +31499,7 @@ class iw {
|
|
|
31493
31499
|
emitterType;
|
|
31494
31500
|
emitterProbability;
|
|
31495
31501
|
//private matrix_ = new Matrix4();
|
|
31496
|
-
q_ = new
|
|
31502
|
+
q_ = new N();
|
|
31497
31503
|
v_ = new b();
|
|
31498
31504
|
v2_ = new b();
|
|
31499
31505
|
_emitterMatrix = new Hu();
|
|
@@ -31569,7 +31575,7 @@ class fn extends T {
|
|
|
31569
31575
|
cameraVelocityScale;
|
|
31570
31576
|
lengthScale;
|
|
31571
31577
|
start() {
|
|
31572
|
-
if (this.maxParticleSize !== 0.5 && this.minParticleSize !== 0 &&
|
|
31578
|
+
if (this.maxParticleSize !== 0.5 && this.minParticleSize !== 0 && D()) {
|
|
31573
31579
|
const e = `ParticleSystem "${this.name}" has non-default min/max particle size. This may not render correctly. Please set min size to 0 and the max size to 0.5 and use the "StartSize" setting instead`;
|
|
31574
31580
|
console.warn(e);
|
|
31575
31581
|
}
|
|
@@ -32062,11 +32068,11 @@ const Dt = class $h extends T {
|
|
|
32062
32068
|
get localspace() {
|
|
32063
32069
|
return this.main.simulationSpace === dc.Local;
|
|
32064
32070
|
}
|
|
32065
|
-
__worldQuaternion = new
|
|
32071
|
+
__worldQuaternion = new N();
|
|
32066
32072
|
get worldQuaternion() {
|
|
32067
32073
|
return this.__worldQuaternion;
|
|
32068
32074
|
}
|
|
32069
|
-
_worldQuaternionInverted = new
|
|
32075
|
+
_worldQuaternionInverted = new N();
|
|
32070
32076
|
get worldQuaternionInverted() {
|
|
32071
32077
|
return this._worldQuaternionInverted;
|
|
32072
32078
|
}
|
|
@@ -32111,7 +32117,7 @@ const Dt = class $h extends T {
|
|
|
32111
32117
|
if (!this._particleSystem)
|
|
32112
32118
|
return !1;
|
|
32113
32119
|
const t = this._particleSystem.behaviors, i = t.indexOf(e);
|
|
32114
|
-
return i !== -1 && ((
|
|
32120
|
+
return i !== -1 && ((D() || Xs) && console.debug("Remove custom ParticleSystem Behaviour", i, e), t.splice(i, 1)), !0;
|
|
32115
32121
|
}
|
|
32116
32122
|
/** Removes all behaviours from the particle system
|
|
32117
32123
|
* **Note:** this will also remove the default behaviours like SizeBehaviour, ColorBehaviour etc.
|
|
@@ -32248,7 +32254,7 @@ const Dt = class $h extends T {
|
|
|
32248
32254
|
addSubParticleSystems() {
|
|
32249
32255
|
if (this._subEmitterSystems && this._particleSystem)
|
|
32250
32256
|
for (const e of this._subEmitterSystems) {
|
|
32251
|
-
e.particleSystem && (e.particleSystem.__internalAwake ? e.particleSystem.__internalAwake() :
|
|
32257
|
+
e.particleSystem && (e.particleSystem.__internalAwake ? e.particleSystem.__internalAwake() : D() && console.warn("SubParticleSystem serialization issue(?)", e.particleSystem, e));
|
|
32252
32258
|
const t = e.particleSystem?._particleSystem;
|
|
32253
32259
|
if (t) {
|
|
32254
32260
|
e.particleSystem._isUsedAsSubsystem = !0;
|
|
@@ -32326,7 +32332,7 @@ function nw(s, e) {
|
|
|
32326
32332
|
if (!s.unsupported_scaling_mode) {
|
|
32327
32333
|
s.unsupported_scaling_mode = !0;
|
|
32328
32334
|
const t = "ParticleSystem scale mode " + qp[s.main.scalingMode] + " is not supported";
|
|
32329
|
-
|
|
32335
|
+
D() && ge(t), console.warn(t, s.name, s);
|
|
32330
32336
|
}
|
|
32331
32337
|
e = $e(s.gameObject, e);
|
|
32332
32338
|
break;
|
|
@@ -32402,7 +32408,7 @@ function ST(s) {
|
|
|
32402
32408
|
const t = s.scene;
|
|
32403
32409
|
e = An(t, Zp);
|
|
32404
32410
|
} else
|
|
32405
|
-
|
|
32411
|
+
D() && console.warn("No post processing manager found");
|
|
32406
32412
|
return e;
|
|
32407
32413
|
}
|
|
32408
32414
|
const lt = {
|
|
@@ -32438,7 +32444,7 @@ var PT = Object.defineProperty, OT = Object.getOwnPropertyDescriptor, ow = (s, e
|
|
|
32438
32444
|
return n && PT(e, t, n), n;
|
|
32439
32445
|
};
|
|
32440
32446
|
const kT = w("debugpost");
|
|
32441
|
-
class
|
|
32447
|
+
class F {
|
|
32442
32448
|
isVolumeParameter = !0;
|
|
32443
32449
|
constructor(e) {
|
|
32444
32450
|
e !== void 0 && this.initialize(e);
|
|
@@ -32492,20 +32498,20 @@ class B {
|
|
|
32492
32498
|
}
|
|
32493
32499
|
ow([
|
|
32494
32500
|
u()
|
|
32495
|
-
],
|
|
32501
|
+
], F.prototype, "overrideState");
|
|
32496
32502
|
ow([
|
|
32497
32503
|
u()
|
|
32498
|
-
],
|
|
32504
|
+
], F.prototype, "value");
|
|
32499
32505
|
class MT extends Xi {
|
|
32500
32506
|
constructor() {
|
|
32501
|
-
super([
|
|
32507
|
+
super([F]);
|
|
32502
32508
|
}
|
|
32503
32509
|
onSerialize(e, t) {
|
|
32504
32510
|
}
|
|
32505
32511
|
onDeserialize(e, t) {
|
|
32506
32512
|
const i = t.target, n = t.path;
|
|
32507
32513
|
let o;
|
|
32508
|
-
if (i && n && (o = i[n]), (typeof o != "object" || typeof o == "object" && o.isVolumeParameter !== !0) && (o = new
|
|
32514
|
+
if (i && n && (o = i[n]), (typeof o != "object" || typeof o == "object" && o.isVolumeParameter !== !0) && (o = new F()), typeof e == "object" && "value" in e) {
|
|
32509
32515
|
const r = e.value;
|
|
32510
32516
|
o.initialize(r), o.overrideState = e.overrideState;
|
|
32511
32517
|
} else
|
|
@@ -32546,7 +32552,7 @@ class ot extends T {
|
|
|
32546
32552
|
if (super(), e)
|
|
32547
32553
|
for (const t of Object.keys(e)) {
|
|
32548
32554
|
const i = e[t], n = this[t];
|
|
32549
|
-
n instanceof
|
|
32555
|
+
n instanceof F ? n.initialize(i) : n !== void 0 && (this[t] = i);
|
|
32550
32556
|
}
|
|
32551
32557
|
}
|
|
32552
32558
|
active = !0;
|
|
@@ -32583,14 +32589,14 @@ class ot extends T {
|
|
|
32583
32589
|
const e = Object.keys(this);
|
|
32584
32590
|
for (const t of e) {
|
|
32585
32591
|
const i = this[t];
|
|
32586
|
-
i instanceof
|
|
32592
|
+
i instanceof F && i.__init();
|
|
32587
32593
|
}
|
|
32588
32594
|
}
|
|
32589
32595
|
// TODO this is currently not used for post processing effects that are part of Volume stacks,
|
|
32590
32596
|
// since these handle that already.
|
|
32591
32597
|
onEditorModification(e) {
|
|
32592
32598
|
const t = e.propertyName;
|
|
32593
|
-
if (this[t] instanceof
|
|
32599
|
+
if (this[t] instanceof F) {
|
|
32594
32600
|
const i = e.value;
|
|
32595
32601
|
return this[t].value = i, !0;
|
|
32596
32602
|
}
|
|
@@ -32643,7 +32649,7 @@ class Cu extends ot {
|
|
|
32643
32649
|
get typeName() {
|
|
32644
32650
|
return "Antialiasing";
|
|
32645
32651
|
}
|
|
32646
|
-
preset = new
|
|
32652
|
+
preset = new F(2);
|
|
32647
32653
|
// 2 is HIGH: https://github.com/pmndrs/postprocessing/blob/main/src/enums/SMAAPreset.js#L14
|
|
32648
32654
|
onCreateEffect() {
|
|
32649
32655
|
const e = new R.POSTPROCESSING.MODULE.SMAAEffect({
|
|
@@ -32658,7 +32664,7 @@ class Cu extends ot {
|
|
|
32658
32664
|
}
|
|
32659
32665
|
}
|
|
32660
32666
|
jT([
|
|
32661
|
-
u(
|
|
32667
|
+
u(F)
|
|
32662
32668
|
], Cu.prototype, "preset");
|
|
32663
32669
|
pn("Antialiasing", Cu);
|
|
32664
32670
|
var FT = Object.defineProperty, Mg = (s, e, t, i) => {
|
|
@@ -32672,9 +32678,9 @@ const Pu = class rw extends ot {
|
|
|
32672
32678
|
get typeName() {
|
|
32673
32679
|
return "Bloom";
|
|
32674
32680
|
}
|
|
32675
|
-
threshold = new
|
|
32676
|
-
intensity = new
|
|
32677
|
-
scatter = new
|
|
32681
|
+
threshold = new F(0.9);
|
|
32682
|
+
intensity = new F(1);
|
|
32683
|
+
scatter = new F(0.7);
|
|
32678
32684
|
/**
|
|
32679
32685
|
* Set to true to use selective bloom when the effect gets created.
|
|
32680
32686
|
* @default false
|
|
@@ -32716,13 +32722,13 @@ const Pu = class rw extends ot {
|
|
|
32716
32722
|
}
|
|
32717
32723
|
};
|
|
32718
32724
|
Mg([
|
|
32719
|
-
u(
|
|
32725
|
+
u(F)
|
|
32720
32726
|
], Pu.prototype, "threshold");
|
|
32721
32727
|
Mg([
|
|
32722
|
-
u(
|
|
32728
|
+
u(F)
|
|
32723
32729
|
], Pu.prototype, "intensity");
|
|
32724
32730
|
Mg([
|
|
32725
|
-
u(
|
|
32731
|
+
u(F)
|
|
32726
32732
|
], Pu.prototype, "scatter");
|
|
32727
32733
|
let Rg = Pu;
|
|
32728
32734
|
pn("Bloom", Rg);
|
|
@@ -32735,7 +32741,7 @@ class Ou extends ot {
|
|
|
32735
32741
|
get typeName() {
|
|
32736
32742
|
return "ChromaticAberration";
|
|
32737
32743
|
}
|
|
32738
|
-
intensity = new
|
|
32744
|
+
intensity = new F(0);
|
|
32739
32745
|
onCreateEffect() {
|
|
32740
32746
|
const e = new R.POSTPROCESSING.MODULE.ChromaticAberrationEffect();
|
|
32741
32747
|
return e.offset = new J(0, 0), e.radialModulation = !0, e.modulationOffset = 0.15, this.intensity.valueProcessor = (t) => t * 0.02, this.intensity.onValueChanged = (t) => {
|
|
@@ -32744,7 +32750,7 @@ class Ou extends ot {
|
|
|
32744
32750
|
}
|
|
32745
32751
|
}
|
|
32746
32752
|
UT([
|
|
32747
|
-
u(
|
|
32753
|
+
u(F)
|
|
32748
32754
|
], Ou.prototype, "intensity");
|
|
32749
32755
|
pn("ChromaticAberration", Ou);
|
|
32750
32756
|
var Dl = /* @__PURE__ */ ((s) => (s[s.None = 0] = "None", s[s.Neutral = 1] = "Neutral", s[s.ACES = 2] = "ACES", s[s.AgX = 3] = "AgX", s[s.KhronosNeutral = 4] = "KhronosNeutral", s))(Dl || {});
|
|
@@ -32807,8 +32813,8 @@ class hr extends ot {
|
|
|
32807
32813
|
get typeName() {
|
|
32808
32814
|
return "ToneMapping";
|
|
32809
32815
|
}
|
|
32810
|
-
mode = new
|
|
32811
|
-
exposure = new
|
|
32816
|
+
mode = new F(void 0);
|
|
32817
|
+
exposure = new F(1);
|
|
32812
32818
|
/** Set the tonemapping mode to e.g. "agx" */
|
|
32813
32819
|
setMode(e) {
|
|
32814
32820
|
const t = Dl[e];
|
|
@@ -32849,10 +32855,10 @@ class hr extends ot {
|
|
|
32849
32855
|
}
|
|
32850
32856
|
}
|
|
32851
32857
|
aw([
|
|
32852
|
-
u(
|
|
32858
|
+
u(F)
|
|
32853
32859
|
], hr.prototype, "mode");
|
|
32854
32860
|
aw([
|
|
32855
|
-
u(
|
|
32861
|
+
u(F)
|
|
32856
32862
|
], hr.prototype, "exposure");
|
|
32857
32863
|
pn("Tonemapping", hr);
|
|
32858
32864
|
var WT = Object.defineProperty, ku = (s, e, t, i) => {
|
|
@@ -32868,10 +32874,10 @@ class Sr extends ot {
|
|
|
32868
32874
|
* Whether values for contrast, hueshift or saturation are remapped to a different range.
|
|
32869
32875
|
*/
|
|
32870
32876
|
remap = !0;
|
|
32871
|
-
postExposure = new
|
|
32872
|
-
contrast = new
|
|
32873
|
-
hueShift = new
|
|
32874
|
-
saturation = new
|
|
32877
|
+
postExposure = new F(1);
|
|
32878
|
+
contrast = new F(0);
|
|
32879
|
+
hueShift = new F(0);
|
|
32880
|
+
saturation = new F(0);
|
|
32875
32881
|
init() {
|
|
32876
32882
|
this.postExposure.valueProcessor = (e) => (this.remap && (e = Math.pow(2, e)), e), this.contrast.valueProcessor = (e) => {
|
|
32877
32883
|
if (!this.remap) return e;
|
|
@@ -32892,16 +32898,16 @@ class Sr extends ot {
|
|
|
32892
32898
|
}
|
|
32893
32899
|
}
|
|
32894
32900
|
ku([
|
|
32895
|
-
u(
|
|
32901
|
+
u(F)
|
|
32896
32902
|
], Sr.prototype, "postExposure");
|
|
32897
32903
|
ku([
|
|
32898
|
-
u(
|
|
32904
|
+
u(F)
|
|
32899
32905
|
], Sr.prototype, "contrast");
|
|
32900
32906
|
ku([
|
|
32901
|
-
u(
|
|
32907
|
+
u(F)
|
|
32902
32908
|
], Sr.prototype, "hueShift");
|
|
32903
32909
|
ku([
|
|
32904
|
-
u(
|
|
32910
|
+
u(F)
|
|
32905
32911
|
], Sr.prototype, "saturation");
|
|
32906
32912
|
pn("ColorAdjustments", Sr);
|
|
32907
32913
|
var VT = Object.defineProperty, Cr = (s, e, t, i) => {
|
|
@@ -32915,12 +32921,12 @@ class Gn extends ot {
|
|
|
32915
32921
|
return "DepthOfField";
|
|
32916
32922
|
}
|
|
32917
32923
|
mode;
|
|
32918
|
-
focusDistance = new
|
|
32919
|
-
focalLength = new
|
|
32920
|
-
aperture = new
|
|
32921
|
-
gaussianMaxRadius = new
|
|
32922
|
-
resolutionScale = new
|
|
32923
|
-
bokehScale = new
|
|
32924
|
+
focusDistance = new F(1);
|
|
32925
|
+
focalLength = new F(0.2);
|
|
32926
|
+
aperture = new F(20);
|
|
32927
|
+
gaussianMaxRadius = new F();
|
|
32928
|
+
resolutionScale = new F(1 / window.devicePixelRatio);
|
|
32929
|
+
bokehScale = new F();
|
|
32924
32930
|
init() {
|
|
32925
32931
|
this.focalLength.valueProcessor = (t) => {
|
|
32926
32932
|
const i = t / 300;
|
|
@@ -32954,22 +32960,22 @@ Cr([
|
|
|
32954
32960
|
u()
|
|
32955
32961
|
], Gn.prototype, "mode");
|
|
32956
32962
|
Cr([
|
|
32957
|
-
u(
|
|
32963
|
+
u(F)
|
|
32958
32964
|
], Gn.prototype, "focusDistance");
|
|
32959
32965
|
Cr([
|
|
32960
|
-
u(
|
|
32966
|
+
u(F)
|
|
32961
32967
|
], Gn.prototype, "focalLength");
|
|
32962
32968
|
Cr([
|
|
32963
|
-
u(
|
|
32969
|
+
u(F)
|
|
32964
32970
|
], Gn.prototype, "aperture");
|
|
32965
32971
|
Cr([
|
|
32966
|
-
u(
|
|
32972
|
+
u(F)
|
|
32967
32973
|
], Gn.prototype, "gaussianMaxRadius");
|
|
32968
32974
|
Cr([
|
|
32969
|
-
u(
|
|
32975
|
+
u(F)
|
|
32970
32976
|
], Gn.prototype, "resolutionScale");
|
|
32971
32977
|
Cr([
|
|
32972
|
-
u(
|
|
32978
|
+
u(F)
|
|
32973
32979
|
], Gn.prototype, "bokehScale");
|
|
32974
32980
|
pn("DepthOfField", Gn);
|
|
32975
32981
|
class xd extends ot {
|
|
@@ -32993,7 +32999,7 @@ class Mu extends ot {
|
|
|
32993
32999
|
get typeName() {
|
|
32994
33000
|
return "PixelationEffect";
|
|
32995
33001
|
}
|
|
32996
|
-
granularity = new
|
|
33002
|
+
granularity = new F(10);
|
|
32997
33003
|
onCreateEffect() {
|
|
32998
33004
|
const e = new R.POSTPROCESSING.MODULE.PixelationEffect();
|
|
32999
33005
|
return this.granularity.onValueChanged = (t) => {
|
|
@@ -33002,7 +33008,7 @@ class Mu extends ot {
|
|
|
33002
33008
|
}
|
|
33003
33009
|
}
|
|
33004
33010
|
qT([
|
|
33005
|
-
u(
|
|
33011
|
+
u(F)
|
|
33006
33012
|
], Mu.prototype, "granularity");
|
|
33007
33013
|
pn("PixelationEffect", Mu);
|
|
33008
33014
|
var XT = Object.defineProperty, Lc = (s, e, t, i) => {
|
|
@@ -33014,11 +33020,11 @@ class Co extends ot {
|
|
|
33014
33020
|
get typeName() {
|
|
33015
33021
|
return "ScreenSpaceAmbientOcclusion";
|
|
33016
33022
|
}
|
|
33017
|
-
intensity = new
|
|
33018
|
-
falloff = new
|
|
33019
|
-
samples = new
|
|
33020
|
-
color = new
|
|
33021
|
-
luminanceInfluence = new
|
|
33023
|
+
intensity = new F(2);
|
|
33024
|
+
falloff = new F(1);
|
|
33025
|
+
samples = new F(9);
|
|
33026
|
+
color = new F(new se(0, 0, 0));
|
|
33027
|
+
luminanceInfluence = new F(0.7);
|
|
33022
33028
|
onBeforeRender() {
|
|
33023
33029
|
if (this._ssao && this.context.mainCamera instanceof pe) {
|
|
33024
33030
|
const e = this.context.mainCamera.far - this.context.mainCamera.near;
|
|
@@ -33058,19 +33064,19 @@ class Co extends ot {
|
|
|
33058
33064
|
}
|
|
33059
33065
|
}
|
|
33060
33066
|
Lc([
|
|
33061
|
-
u(
|
|
33067
|
+
u(F)
|
|
33062
33068
|
], Co.prototype, "intensity");
|
|
33063
33069
|
Lc([
|
|
33064
|
-
u(
|
|
33070
|
+
u(F)
|
|
33065
33071
|
], Co.prototype, "falloff");
|
|
33066
33072
|
Lc([
|
|
33067
|
-
u(
|
|
33073
|
+
u(F)
|
|
33068
33074
|
], Co.prototype, "samples");
|
|
33069
33075
|
Lc([
|
|
33070
|
-
u(
|
|
33076
|
+
u(F)
|
|
33071
33077
|
], Co.prototype, "color");
|
|
33072
33078
|
Lc([
|
|
33073
|
-
u(
|
|
33079
|
+
u(F)
|
|
33074
33080
|
], Co.prototype, "luminanceInfluence");
|
|
33075
33081
|
pn("ScreenSpaceAmbientOcclusion", Co);
|
|
33076
33082
|
var QT = Object.defineProperty, Pr = (s, e, t, i) => {
|
|
@@ -33088,10 +33094,10 @@ class qn extends ot {
|
|
|
33088
33094
|
return this._ssao;
|
|
33089
33095
|
}
|
|
33090
33096
|
gammaCorrection = !0;
|
|
33091
|
-
aoRadius = new
|
|
33092
|
-
falloff = new
|
|
33093
|
-
intensity = new
|
|
33094
|
-
color = new
|
|
33097
|
+
aoRadius = new F(1);
|
|
33098
|
+
falloff = new F(1);
|
|
33099
|
+
intensity = new F(1);
|
|
33100
|
+
color = new F(new se(0, 0, 0));
|
|
33095
33101
|
screenspaceRadius = !1;
|
|
33096
33102
|
quality = 2;
|
|
33097
33103
|
_ssao;
|
|
@@ -33129,16 +33135,16 @@ Pr([
|
|
|
33129
33135
|
u()
|
|
33130
33136
|
], qn.prototype, "gammaCorrection");
|
|
33131
33137
|
Pr([
|
|
33132
|
-
u(
|
|
33138
|
+
u(F)
|
|
33133
33139
|
], qn.prototype, "aoRadius");
|
|
33134
33140
|
Pr([
|
|
33135
|
-
u(
|
|
33141
|
+
u(F)
|
|
33136
33142
|
], qn.prototype, "falloff");
|
|
33137
33143
|
Pr([
|
|
33138
|
-
u(
|
|
33144
|
+
u(F)
|
|
33139
33145
|
], qn.prototype, "intensity");
|
|
33140
33146
|
Pr([
|
|
33141
|
-
u(
|
|
33147
|
+
u(F)
|
|
33142
33148
|
], qn.prototype, "color");
|
|
33143
33149
|
Pr([
|
|
33144
33150
|
It(),
|
|
@@ -33265,12 +33271,12 @@ class Ls extends ot {
|
|
|
33265
33271
|
get typeName() {
|
|
33266
33272
|
return "TiltShiftEffect";
|
|
33267
33273
|
}
|
|
33268
|
-
offset = new
|
|
33269
|
-
rotation = new
|
|
33270
|
-
focusArea = new
|
|
33271
|
-
feather = new
|
|
33272
|
-
kernelSize = new
|
|
33273
|
-
resolutionScale = new
|
|
33274
|
+
offset = new F(0);
|
|
33275
|
+
rotation = new F(0);
|
|
33276
|
+
focusArea = new F(0.4);
|
|
33277
|
+
feather = new F(0.3);
|
|
33278
|
+
kernelSize = new F(2);
|
|
33279
|
+
resolutionScale = new F(1 / window.devicePixelRatio);
|
|
33274
33280
|
init() {
|
|
33275
33281
|
this.offset.defaultValue = 0, this.rotation.defaultValue = 0, this.focusArea.defaultValue = 0.4, this.feather.defaultValue = 0.3, this.kernelSize.defaultValue = R.POSTPROCESSING.MODULE.KernelSize.MEDIUM, this.resolutionScale.defaultValue = 1 / window.devicePixelRatio;
|
|
33276
33282
|
}
|
|
@@ -33286,22 +33292,22 @@ class Ls extends ot {
|
|
|
33286
33292
|
}
|
|
33287
33293
|
}
|
|
33288
33294
|
Ha([
|
|
33289
|
-
u(
|
|
33295
|
+
u(F)
|
|
33290
33296
|
], Ls.prototype, "offset");
|
|
33291
33297
|
Ha([
|
|
33292
|
-
u(
|
|
33298
|
+
u(F)
|
|
33293
33299
|
], Ls.prototype, "rotation");
|
|
33294
33300
|
Ha([
|
|
33295
|
-
u(
|
|
33301
|
+
u(F)
|
|
33296
33302
|
], Ls.prototype, "focusArea");
|
|
33297
33303
|
Ha([
|
|
33298
|
-
u(
|
|
33304
|
+
u(F)
|
|
33299
33305
|
], Ls.prototype, "feather");
|
|
33300
33306
|
Ha([
|
|
33301
|
-
u(
|
|
33307
|
+
u(F)
|
|
33302
33308
|
], Ls.prototype, "kernelSize");
|
|
33303
33309
|
Ha([
|
|
33304
|
-
u(
|
|
33310
|
+
u(F)
|
|
33305
33311
|
], Ls.prototype, "resolutionScale");
|
|
33306
33312
|
pn("TiltShiftEffect", Ls);
|
|
33307
33313
|
var tE = Object.defineProperty, Tg = (s, e, t, i) => {
|
|
@@ -33313,9 +33319,9 @@ class Ga extends ot {
|
|
|
33313
33319
|
get typeName() {
|
|
33314
33320
|
return "Vignette";
|
|
33315
33321
|
}
|
|
33316
|
-
color = new
|
|
33317
|
-
intensity = new
|
|
33318
|
-
center = new
|
|
33322
|
+
color = new F({ r: 0, g: 0, b: 0, a: 1 });
|
|
33323
|
+
intensity = new F(0);
|
|
33324
|
+
center = new F({ x: 0.5, y: 0.5 });
|
|
33319
33325
|
init() {
|
|
33320
33326
|
this.color.defaultValue = { r: 0, g: 0, b: 0, a: 1 }, this.intensity.defaultValue = 0, this.center.defaultValue = { x: 0.5, y: 0.5 };
|
|
33321
33327
|
}
|
|
@@ -33333,13 +33339,13 @@ class Ga extends ot {
|
|
|
33333
33339
|
}
|
|
33334
33340
|
}
|
|
33335
33341
|
Tg([
|
|
33336
|
-
u(
|
|
33342
|
+
u(F)
|
|
33337
33343
|
], Ga.prototype, "color");
|
|
33338
33344
|
Tg([
|
|
33339
|
-
u(
|
|
33345
|
+
u(F)
|
|
33340
33346
|
], Ga.prototype, "intensity");
|
|
33341
33347
|
Tg([
|
|
33342
|
-
u(
|
|
33348
|
+
u(F)
|
|
33343
33349
|
], Ga.prototype, "center");
|
|
33344
33350
|
pn("Vignette", Ga);
|
|
33345
33351
|
globalThis.NEEDLE_USE_POSTPROCESSING = globalThis.NEEDLE_USE_POSTPROCESSING !== void 0 ? globalThis.NEEDLE_USE_POSTPROCESSING : !0;
|
|
@@ -33653,7 +33659,7 @@ class Dc extends T {
|
|
|
33653
33659
|
if (!this.context.isInXR && (this.context.mainCamera && this._isDirty && this.apply(), this.context.composer && this._postprocessing && this._postprocessing.composer === this.context.composer)) {
|
|
33654
33660
|
if (this.context.renderer.getContext().isContextLost() && this.context.renderer.forceContextRestore(), this.context.composer.getRenderer() !== this.context.renderer && this.context.composer.setRenderer(this.context.renderer), this.context.composer.setMainScene(this.context.scene), this.multisampling === "auto")
|
|
33655
33661
|
if (this._postprocessing && this._postprocessing.hasSmaaEffect)
|
|
33656
|
-
this._postprocessing.multisampling !== 0 && (this._postprocessing.multisampling = 0, (Bo ||
|
|
33662
|
+
this._postprocessing.multisampling !== 0 && (this._postprocessing.multisampling = 0, (Bo || D()) && console.log(`[PostProcessing] multisampling is disabled because it's set to 'auto' on your PostprocessingManager/Volume component that also has an SMAA effect.
|
|
33657
33663
|
|
|
33658
33664
|
If you need multisampling consider changing 'auto' to a fixed value (e.g. 4).`));
|
|
33659
33665
|
else {
|
|
@@ -33693,7 +33699,7 @@ If you need multisampling consider changing 'auto' to a fixed value (e.g. 4).`))
|
|
|
33693
33699
|
_rapidApplyCount = 0;
|
|
33694
33700
|
_isDirty = !1;
|
|
33695
33701
|
apply() {
|
|
33696
|
-
if (Bo && console.log(`Apply PostProcessing "${this.name || "unnamed"}"`),
|
|
33702
|
+
if (Bo && console.log(`Apply PostProcessing "${this.name || "unnamed"}"`), D() && (this._lastApplyTime !== void 0 && Date.now() - this._lastApplyTime < 100 && (this._rapidApplyCount++, this._rapidApplyCount === 5 && console.warn("Detected rapid post processing modifications - this might be a bug", this)), this._lastApplyTime = Date.now()), this._isDirty = !1, this._activeEffects.length = 0, this.sharedProfile?.components) {
|
|
33697
33703
|
const e = this.sharedProfile.components;
|
|
33698
33704
|
for (const t of e)
|
|
33699
33705
|
t.active && t.enabled && !this._activeEffects.includes(t) && this._activeEffects.push(t);
|
|
@@ -33701,7 +33707,7 @@ If you need multisampling consider changing 'auto' to a fixed value (e.g. 4).`))
|
|
|
33701
33707
|
for (const e of this._effects)
|
|
33702
33708
|
e.active && e.enabled && !this._activeEffects.includes(e) && this._activeEffects.push(e);
|
|
33703
33709
|
this._activeEffects.length > 0 ? (this._postprocessing || (this._postprocessing = new cw(this.context)), this._postprocessing.apply(this._activeEffects)?.then(() => {
|
|
33704
|
-
this.activeAndEnabled && (this._applyPostQueue(), this._postprocessing ? (this.multisampling === "auto" ? this._postprocessing.multisampling =
|
|
33710
|
+
this.activeAndEnabled && (this._applyPostQueue(), this._postprocessing ? (this.multisampling === "auto" ? this._postprocessing.multisampling = q.isMobileDevice() ? 2 : 4 : this._postprocessing.multisampling = Math.max(0, Math.min(this.multisampling, this.context.renderer.capabilities.maxSamples)), Bo && console.debug(`[PostProcessing] Set multisampling to ${this._postprocessing.multisampling} (Is Mobile: ${q.isMobileDevice()})`)) : Bo && console.warn("[PostProcessing] No composer found"));
|
|
33705
33711
|
})) : this._postprocessing?.unapply(!1);
|
|
33706
33712
|
}
|
|
33707
33713
|
_applyPostQueue() {
|
|
@@ -33730,14 +33736,14 @@ If you need multisampling consider changing 'auto' to a fixed value (e.g. 4).`))
|
|
|
33730
33736
|
Sh.set(i, r);
|
|
33731
33737
|
const a = Object.keys(o);
|
|
33732
33738
|
for (const l of a)
|
|
33733
|
-
o[l] instanceof
|
|
33739
|
+
o[l] instanceof F && r.push(l);
|
|
33734
33740
|
}
|
|
33735
33741
|
if (Sh.has(i)) {
|
|
33736
33742
|
const r = n.toLowerCase(), a = Sh.get(i);
|
|
33737
33743
|
for (const l of a)
|
|
33738
33744
|
if (l.toLowerCase() === r) {
|
|
33739
33745
|
const c = o[l];
|
|
33740
|
-
c instanceof
|
|
33746
|
+
c instanceof F && (t.length === 4 && t[3] === "active" ? (c.overrideState = e.value, this.scheduleRecreate()) : c && c.value !== void 0 && (c.value = e.value));
|
|
33741
33747
|
return;
|
|
33742
33748
|
}
|
|
33743
33749
|
}
|
|
@@ -34474,7 +34480,7 @@ class pt extends T {
|
|
|
34474
34480
|
return this.clip;
|
|
34475
34481
|
}
|
|
34476
34482
|
set audioOutputMode(e) {
|
|
34477
|
-
e !== this._audioOutputMode && (e === 1 &&
|
|
34483
|
+
e !== this._audioOutputMode && (e === 1 && D() && console.warn("VideoAudioOutputMode.AudioSource is not yet implemented"), this._audioOutputMode = e, this.updateVideoElementSettings());
|
|
34478
34484
|
}
|
|
34479
34485
|
get audioOutputMode() {
|
|
34480
34486
|
return this._audioOutputMode;
|
|
@@ -35046,7 +35052,7 @@ class Or extends T {
|
|
|
35046
35052
|
}
|
|
35047
35053
|
async internalShare(e) {
|
|
35048
35054
|
if (this.context.connection.isInRoom === !1) {
|
|
35049
|
-
console.warn("Can not start screensharing: requires network connection"),
|
|
35055
|
+
console.warn("Can not start screensharing: requires network connection"), D() && ge("Can not start screensharing: requires network connection. Add a SyncedRoom component or join a room first.");
|
|
35050
35056
|
return;
|
|
35051
35057
|
}
|
|
35052
35058
|
if (e?.device && (this.device = e.device), !this.videoPlayer && this.requiresVideoPlayer && (this._videoPlayer || (this._videoPlayer = S.getComponent(this.gameObject, pt) ?? void 0), this.videoPlayer || this._ensureVideoPlayer(), !this.videoPlayer)) {
|
|
@@ -35194,7 +35200,7 @@ class Or extends T {
|
|
|
35194
35200
|
} else
|
|
35195
35201
|
console.error("Failed to get user media", r.message, r.code, r);
|
|
35196
35202
|
}
|
|
35197
|
-
!n &&
|
|
35203
|
+
!n && D() && (ge("No camera found for sharing. Please connect a camera (see console for more information)"), console.warn("No camera found for sharing. Please connect a camera", i, this.deviceName, "Using deviceFilter? " + this.deviceFilter != null, "Using options? " + t != null, "Using deviceName? " + this.deviceName != null, "Using options.deviceId? " + t?.deviceId != null, "Using options.deviceFilter? " + t?.deviceFilter != null));
|
|
35198
35204
|
}
|
|
35199
35205
|
// private _cameraSelectionWindow : Window | null = null;
|
|
35200
35206
|
// private openWindowToSelectCamera(){
|
|
@@ -35369,16 +35375,16 @@ function G_(s, e, t, i, n) {
|
|
|
35369
35375
|
}
|
|
35370
35376
|
const Sd = new Array();
|
|
35371
35377
|
he.registerCallback(ce.ContextCreationStart, (s) => {
|
|
35372
|
-
const e = s.context, t = e.domElement.getAttribute("background-image"), i = e.domElement.getAttribute("environment-image")
|
|
35373
|
-
if (t
|
|
35374
|
-
Kt && console.log("Creating
|
|
35375
|
-
const
|
|
35376
|
-
|
|
35378
|
+
const e = s.context, t = e.domElement.getAttribute("background-image"), i = e.domElement.getAttribute("environment-image");
|
|
35379
|
+
if (t) {
|
|
35380
|
+
Kt && console.log("Creating RemoteSkybox to load background " + t);
|
|
35381
|
+
const n = G_(e, t, !0, !1, "background-image");
|
|
35382
|
+
n && Sd.push(n);
|
|
35377
35383
|
}
|
|
35378
35384
|
if (i) {
|
|
35379
|
-
Kt && console.log("Creating
|
|
35380
|
-
const
|
|
35381
|
-
|
|
35385
|
+
Kt && console.log("Creating RemoteSkybox to load environment " + i);
|
|
35386
|
+
const n = G_(e, i, !1, !0, "environment-image");
|
|
35387
|
+
n && Sd.push(n);
|
|
35382
35388
|
}
|
|
35383
35389
|
});
|
|
35384
35390
|
he.registerCallback(ce.ContextCreationStart, () => Promise.all(Sd).finally(() => {
|
|
@@ -35413,7 +35419,7 @@ const dr = class extends T {
|
|
|
35413
35419
|
*/
|
|
35414
35420
|
async setSkybox(e, t) {
|
|
35415
35421
|
if (!this.activeAndEnabled || (e = vE(e, this.environment, this.background), !e)) return !1;
|
|
35416
|
-
if (t ??= e, this.isValidTextureType(t) || console.warn('Potentially invalid skybox URL: "' + t + '" on ' + (this.name || this.gameObject?.name || "context")), Kt && console.log("Set
|
|
35422
|
+
if (t ??= e, this.isValidTextureType(t) || console.warn('Potentially invalid skybox URL: "' + t + '" on ' + (this.name || this.gameObject?.name || "context")), Kt && console.log("Set RemoteSkybox url: " + e), this._prevUrl === e && this._prevLoadedEnvironment)
|
|
35417
35423
|
return this.apply(), !0;
|
|
35418
35424
|
this._prevLoadedEnvironment?.dispose(), this._prevLoadedEnvironment = void 0, this._prevUrl = e;
|
|
35419
35425
|
const i = await yE(e, this.context.renderer);
|
|
@@ -35426,7 +35432,7 @@ const dr = class extends T {
|
|
|
35426
35432
|
console.warn("RemoteSkybox: Context is not available - can not apply skybox.");
|
|
35427
35433
|
return;
|
|
35428
35434
|
}
|
|
35429
|
-
this.context.scene.background !== e && (this._prevBackground = this.context.scene.background), this.context.scene.environment !== e && (this._prevEnvironment = this.context.scene.environment), Kt && console.log("Set
|
|
35435
|
+
this.context.scene.background !== e && (this._prevBackground = this.context.scene.background), this.context.scene.environment !== e && (this._prevEnvironment = this.context.scene.environment), Kt && console.log("Set RemoteSkybox (" + (this.environment && this.background ? "environment and background" : this.environment ? "environment" : this.background ? "background" : "none") + ")", this.url, !ui.backgroundShouldBeTransparent(this.context)), this.environment && (this.context.scene.environment = e), this.background && !ui.backgroundShouldBeTransparent(this.context) && (this.context.scene.background = e), this.context.mainCameraComponent?.backgroundBlurriness !== void 0 && (this.context.scene.backgroundBlurriness = this.context.mainCameraComponent.backgroundBlurriness);
|
|
35430
35436
|
}
|
|
35431
35437
|
}
|
|
35432
35438
|
validProtocols = ["file:", "blob:", "data:"];
|
|
@@ -35536,7 +35542,7 @@ const Fc = class gw extends T {
|
|
|
35536
35542
|
rotateFactor = 0.1;
|
|
35537
35543
|
positionAxes = xl.All;
|
|
35538
35544
|
flipForward = !1;
|
|
35539
|
-
static _invertForward = new
|
|
35545
|
+
static _invertForward = new N().setFromAxisAngle(new b(0, 1, 0), Math.PI);
|
|
35540
35546
|
_firstUpdate = !0;
|
|
35541
35547
|
/**
|
|
35542
35548
|
* Update the position and rotation of the GameObject to follow the target.
|
|
@@ -35973,7 +35979,7 @@ class OE {
|
|
|
35973
35979
|
}
|
|
35974
35980
|
}
|
|
35975
35981
|
}
|
|
35976
|
-
const kE = new
|
|
35982
|
+
const kE = new N().setFromAxisAngle(new b(0, 1, 0), Math.PI);
|
|
35977
35983
|
class ME {
|
|
35978
35984
|
context;
|
|
35979
35985
|
spectator;
|
|
@@ -36255,7 +36261,7 @@ const _w = class tm extends T {
|
|
|
36255
36261
|
for (const n in this.remoteCams) {
|
|
36256
36262
|
const o = this.remoteCams[n], r = this.context.time.realtimeSinceStartup - o.lastUpdate;
|
|
36257
36263
|
if (!o || r > this._camTimeoutInSeconds) {
|
|
36258
|
-
|
|
36264
|
+
D() && console.log("Remote cam timeout", n), o?.obj && S.destroy(o.obj), delete this.remoteCams[n], o && delete this.userToCamMap[o.userId], tm.instances.push(o), this.context.players.removePlayerView(o.userId, Zo.Browser);
|
|
36259
36265
|
continue;
|
|
36260
36266
|
}
|
|
36261
36267
|
}
|
|
@@ -36370,7 +36376,7 @@ class Xn extends T {
|
|
|
36370
36376
|
return this.tryJoinRoom(e + 1);
|
|
36371
36377
|
} else
|
|
36372
36378
|
this.joinRandomRoom && (this.roomName === null || this.roomName === void 0 || this.roomName.length <= 0) && (this.roomName = this.generateRoomName());
|
|
36373
|
-
return this.requireRoomParameter && !t ? ((Kf ||
|
|
36379
|
+
return this.requireRoomParameter && !t ? ((Kf || D()) && console.warn('[SyncedRoom] Missing required room parameter "' + this.urlParameterName + `" in url - will not connect.
|
|
36374
36380
|
To allow joining a room without a query parameter you can set "requireRoomParameter" to false.`), !1) : (this.context.connection.isConnected || this.context.connection.connect(), this._lastJoinedRoom = this.roomName, this._roomPrefix && (this.roomName = this._roomPrefix + this.roomName), this.roomName.length <= 0 ? (console.warn(`[SyncedRoom] Room name is not set so we can not join a networked room.
|
|
36375
36381
|
Please choose one of the following options to fix this:
|
|
36376
36382
|
A) Set a room name in the SyncedRoom component
|
|
@@ -36382,7 +36388,7 @@ C) Set "joinRandomRoom" to true`), !1) : (Kf && console.log("Join " + this.roomN
|
|
|
36382
36388
|
_userWantsToBeInARoom = !1;
|
|
36383
36389
|
/** @internal */
|
|
36384
36390
|
update() {
|
|
36385
|
-
this.context.connection.isConnected && (this.context.time.time - this._lastPingTime > 3 && (this._lastPingTime = this.context.time.time, this.context.connection.sendPing()), this.context.connection.isInRoom && (this._lastRoomTime = this.context.time.time)), this._lastRoomTime > 0 && this.context.time.time - this._lastRoomTime > 0.3 && (this._lastRoomTime = -1, this.autoRejoin ? this._userWantsToBeInARoom && (console.log("Disconnected from networking backend - attempt reconnecting now"), this.tryJoinRoom()) :
|
|
36391
|
+
this.context.connection.isConnected && (this.context.time.time - this._lastPingTime > 3 && (this._lastPingTime = this.context.time.time, this.context.connection.sendPing()), this.context.connection.isInRoom && (this._lastRoomTime = this.context.time.time)), this._lastRoomTime > 0 && this.context.time.time - this._lastRoomTime > 0.3 && (this._lastRoomTime = -1, this.autoRejoin ? this._userWantsToBeInARoom && (console.log("Disconnected from networking backend - attempt reconnecting now"), this.tryJoinRoom()) : D() && console.warn("You are not connected to a room anymore (possibly because the tab was inactive for too long and the server kicked you?)"));
|
|
36386
36392
|
}
|
|
36387
36393
|
/**
|
|
36388
36394
|
* Get the URL to view the current room in view only mode.
|
|
@@ -36727,7 +36733,7 @@ class $E {
|
|
|
36727
36733
|
if (!(r.times.length <= 0)) {
|
|
36728
36734
|
if (r.name.endsWith(n))
|
|
36729
36735
|
this.rootStartPosition = new b().fromArray(r.values, 0), this.rootEndPosition = new b().fromArray(r.values, r.values.length - 3), this.rootPositionOffset = this.rootEndPosition.clone().sub(this.rootStartPosition), Rn && console.log(this.rootPositionOffset);
|
|
36730
|
-
else if (r.name.endsWith(o) && (this.rootStartQuaternion = new
|
|
36736
|
+
else if (r.name.endsWith(o) && (this.rootStartQuaternion = new N().fromArray(r.values, 0), this.rootEndQuaternion = new N().fromArray(r.values, r.values.length - 4), this.rootQuaternionOffset = this.rootEndQuaternion.clone().multiply(this.rootStartQuaternion), Rn)) {
|
|
36731
36737
|
const a = new Rt().setFromQuaternion(this.rootQuaternionOffset);
|
|
36732
36738
|
console.log("ROT", a);
|
|
36733
36739
|
}
|
|
@@ -36805,7 +36811,7 @@ class Bg extends Du {
|
|
|
36805
36811
|
this.target && (this._animator = S.getComponent(this.target, At) ?? null, this._animator && l_(this._animator.gameObject, this, !0));
|
|
36806
36812
|
for (const e of this.models) {
|
|
36807
36813
|
const t = e.asset, i = t.position, n = t.rotation;
|
|
36808
|
-
i && i.x !== void 0 && (i.isVector3 || (t.position = new b(i.x, i.y, i.z)), n.isQuaternion || (t.rotation = new
|
|
36814
|
+
i && i.x !== void 0 && (i.isVector3 || (t.position = new b(i.x, i.y, i.z)), n.isQuaternion || (t.rotation = new N(n.x, n.y, n.z, n.w)));
|
|
36809
36815
|
}
|
|
36810
36816
|
this.ensureTrackOffsets();
|
|
36811
36817
|
}
|
|
@@ -36815,19 +36821,19 @@ class Bg extends Du {
|
|
|
36815
36821
|
const e = this.trackOffset.position;
|
|
36816
36822
|
e && (e.isVector3 || (this.trackOffset.position = new b(e.x, e.y, e.z)));
|
|
36817
36823
|
const t = this.trackOffset.rotation;
|
|
36818
|
-
t && (t.isQuaternion || (this.trackOffset.rotation = new
|
|
36824
|
+
t && (t.isQuaternion || (this.trackOffset.rotation = new N(t.x, t.y, t.z, t.w)));
|
|
36819
36825
|
}
|
|
36820
36826
|
}
|
|
36821
36827
|
_useclipOffsets = !0;
|
|
36822
36828
|
_totalOffsetPosition = new b();
|
|
36823
|
-
_totalOffsetRotation = new
|
|
36829
|
+
_totalOffsetRotation = new N();
|
|
36824
36830
|
_totalOffsetPosition2 = new b();
|
|
36825
|
-
_totalOffsetRotation2 = new
|
|
36831
|
+
_totalOffsetRotation2 = new N();
|
|
36826
36832
|
_summedPos = new b();
|
|
36827
36833
|
_tempPos = new b();
|
|
36828
|
-
_summedRot = new
|
|
36829
|
-
_tempRot = new
|
|
36830
|
-
_clipRotQuat = new
|
|
36834
|
+
_summedRot = new N();
|
|
36835
|
+
_tempRot = new N();
|
|
36836
|
+
_clipRotQuat = new N();
|
|
36831
36837
|
evaluate(e) {
|
|
36832
36838
|
if (this.track.muted || !this.mixer) return;
|
|
36833
36839
|
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);
|
|
@@ -36867,33 +36873,33 @@ class Bg extends Du {
|
|
|
36867
36873
|
x %= O;
|
|
36868
36874
|
break;
|
|
36869
36875
|
case rs.PingPong:
|
|
36870
|
-
const
|
|
36871
|
-
x %= O,
|
|
36876
|
+
const B = Math.floor(x / O) % 2 !== 0;
|
|
36877
|
+
x %= O, B && (x = O - x);
|
|
36872
36878
|
break;
|
|
36873
36879
|
}
|
|
36874
36880
|
l.reversed === !0 ? c.time = c.getClip().duration - x : c.time = x, c.timeScale = 0;
|
|
36875
36881
|
const k = Math.max(0, v);
|
|
36876
36882
|
if (c.weight = k, r += k, c.clampWhenFinished = !1, c.isRunning() || c.play(), this._useclipOffsets) {
|
|
36877
|
-
const E = t == 0 ? this._totalOffsetPosition : this._totalOffsetPosition2,
|
|
36883
|
+
const E = t == 0 ? this._totalOffsetPosition : this._totalOffsetPosition2, B = t == 0 ? this._totalOffsetRotation : this._totalOffsetRotation2;
|
|
36878
36884
|
t < 1 && (i = 1 - v), t += 1;
|
|
36879
|
-
const
|
|
36880
|
-
|
|
36881
|
-
const
|
|
36882
|
-
if (
|
|
36885
|
+
const L = this._summedPos.set(0, 0, 0), W = this._tempPos.set(0, 0, 0), X = this._summedRot.identity(), A = this._tempRot.identity(), $ = h.rotation;
|
|
36886
|
+
$ && (this._clipRotQuat.identity(), this._clipRotQuat.slerp($, v));
|
|
36887
|
+
const V = this._actionOffsets[a];
|
|
36888
|
+
if (V.hasOffsets)
|
|
36883
36889
|
for (let ne = 0; ne < I; ne++)
|
|
36884
|
-
|
|
36885
|
-
this._clipRotQuat &&
|
|
36890
|
+
V.rootPositionOffset ? W.copy(V.rootPositionOffset) : W.set(0, 0, 0), W.applyQuaternion(X), this._clipRotQuat && W.applyQuaternion(this._clipRotQuat), V.rootQuaternionOffset && (A.copy(V.rootQuaternionOffset), X.multiply(A)), L.add(W);
|
|
36891
|
+
this._clipRotQuat && B.multiply(this._clipRotQuat), B.multiply(X), h.position && L.add(h.position), E.add(L);
|
|
36886
36892
|
}
|
|
36887
36893
|
}
|
|
36888
36894
|
}
|
|
36889
|
-
if (this._useclipOffsets && (this._totalOffsetPosition.lerp(this._totalOffsetPosition2, i), this._totalOffsetRotation.slerp(this._totalOffsetRotation2, i)), this.__mixerError === void 0 && (Rn ||
|
|
36895
|
+
if (this._useclipOffsets && (this._totalOffsetPosition.lerp(this._totalOffsetPosition2, i), this._totalOffsetRotation.slerp(this._totalOffsetRotation2, i)), this.__mixerError === void 0 && (Rn || D()) && this._animator?.runtimeAnimatorController?.mixer && this.mixer !== this._animator?.runtimeAnimatorController?.mixer && (this.__mixerError = !0, console.error("AnimationTrack mixer is not shared with the animator controller - this might result in the timeline to not animate properly. Please report a bug to the Needle Engine team!", this)), this._animator?.runtimeAnimatorController) {
|
|
36890
36896
|
const a = Math.max(0, 1 - r);
|
|
36891
36897
|
this._animator?.runtimeAnimatorController?.update(a);
|
|
36892
36898
|
} else
|
|
36893
36899
|
this.mixer.update(e);
|
|
36894
36900
|
}
|
|
36895
36901
|
createRotationInterpolant(e, t, i) {
|
|
36896
|
-
const n = i.createInterpolant.bind(i), o = new
|
|
36902
|
+
const n = i.createInterpolant.bind(i), o = new N();
|
|
36897
36903
|
this.ensureTrackOffsets();
|
|
36898
36904
|
const r = this.trackOffset?.rotation;
|
|
36899
36905
|
i.createInterpolant = () => {
|
|
@@ -37189,7 +37195,7 @@ const ts = w("debugtimeline"), zg = class im extends T {
|
|
|
37189
37195
|
_speed = 1;
|
|
37190
37196
|
/** @internal */
|
|
37191
37197
|
awake() {
|
|
37192
|
-
ts && console.log(this, this.playableAsset?.tracks), this.rebuildGraph(), !this.isValid() && (ts ||
|
|
37198
|
+
ts && console.log(this, this.playableAsset?.tracks), this.rebuildGraph(), !this.isValid() && (ts || D()) && (ts ? console.warn("PlayableDirector is not valid", "Asset?", this.playableAsset, "Tracks:", this.playableAsset?.tracks, "IsArray?", Array.isArray(this.playableAsset?.tracks), this) : this.playableAsset?.tracks?.length ? console.warn("PlayableDirector is not valid") : console.warn("PlayableDirector has no tracks"));
|
|
37193
37199
|
}
|
|
37194
37200
|
/** @internal */
|
|
37195
37201
|
onEnable() {
|
|
@@ -37819,7 +37825,7 @@ class ko extends T {
|
|
|
37819
37825
|
onPointerClick(e) {
|
|
37820
37826
|
if (this.interactable && !(e.button !== 0 && e.event.pointerType === km.Mouse) && (Fo && (console.warn("Button Click", this.onClick), Be("CLICKED button " + this.name + " at " + this.context.time.frameCount)), this.onClick && this.onClick.listenerCount > 0 && (this.onClick.invoke(), e.use(), Fo))) {
|
|
37821
37827
|
const t = this.gameObject.worldPosition;
|
|
37822
|
-
t.add(this.gameObject.worldUp.multiplyScalar(1 + Math.random() * 0.5)),
|
|
37828
|
+
t.add(this.gameObject.worldUp.multiplyScalar(1 + Math.random() * 0.5)), z.DrawLabel(t, "CLICK:" + Date.now(), 0.1, 1 + Math.random() * 0.5);
|
|
37823
37829
|
}
|
|
37824
37830
|
}
|
|
37825
37831
|
colors;
|
|
@@ -37952,7 +37958,7 @@ const $s = w("debuginputfield"), Nc = class Q extends T {
|
|
|
37952
37958
|
$s && console.log(this.name, this);
|
|
37953
37959
|
}
|
|
37954
37960
|
onEnable() {
|
|
37955
|
-
Q.htmlField || (Q.htmlField = document.createElement("input"), Q.htmlField.style.width = "0px", Q.htmlField.style.height = "0px", Q.htmlField.style.padding = "0px", Q.htmlField.style.border = "none", Q.htmlField.style.overflow = "hidden", Q.htmlField.style.caretColor = "transparent", Q.htmlField.style.outline = "none", Q.htmlField.classList.add("ar"), Q.htmlField.onfocus = () => Q.htmlFieldFocused = !0, Q.htmlField.onblur = () => Q.htmlFieldFocused = !1, document.body.append(Q.htmlField)), this.inputEventFn || (this.inputEventFn = this.onInput.bind(this)), Q.htmlField.addEventListener("keyup", this.inputEventFn), this.placeholder && this.textComponent?.text.length && S.setActive(this.placeholder.gameObject, !1),
|
|
37961
|
+
Q.htmlField || (Q.htmlField = document.createElement("input"), Q.htmlField.style.width = "0px", Q.htmlField.style.height = "0px", Q.htmlField.style.padding = "0px", Q.htmlField.style.border = "none", Q.htmlField.style.overflow = "hidden", Q.htmlField.style.caretColor = "transparent", Q.htmlField.style.outline = "none", Q.htmlField.classList.add("ar"), Q.htmlField.onfocus = () => Q.htmlFieldFocused = !0, Q.htmlField.onblur = () => Q.htmlFieldFocused = !1, document.body.append(Q.htmlField)), this.inputEventFn || (this.inputEventFn = this.onInput.bind(this)), Q.htmlField.addEventListener("keyup", this.inputEventFn), this.placeholder && this.textComponent?.text.length && S.setActive(this.placeholder.gameObject, !1), q.isiOS() && (this._iosEventFn = this.processInputOniOS.bind(this), window.addEventListener("click", this._iosEventFn));
|
|
37956
37962
|
}
|
|
37957
37963
|
onDisable() {
|
|
37958
37964
|
Q.htmlField?.removeEventListener("keyup", this.inputEventFn), this.onDeselected(), this._iosEventFn && window.removeEventListener("click", this._iosEventFn);
|
|
@@ -38017,7 +38023,7 @@ const $s = w("debuginputfield"), Nc = class Q extends T {
|
|
|
38017
38023
|
}
|
|
38018
38024
|
}
|
|
38019
38025
|
selectInputField() {
|
|
38020
|
-
Q.htmlField && ($s && console.log("Focus Inputfield", Q.htmlFieldFocused), Q.htmlField.setSelectionRange(Q.htmlField.value.length, Q.htmlField.value.length),
|
|
38026
|
+
Q.htmlField && ($s && console.log("Focus Inputfield", Q.htmlFieldFocused), Q.htmlField.setSelectionRange(Q.htmlField.value.length, Q.htmlField.value.length), q.isiOS() ? Q.htmlField.focus({ preventScroll: !0 }) : setTimeout(() => Q.htmlField?.focus(), 1));
|
|
38021
38027
|
}
|
|
38022
38028
|
processInputOniOS() {
|
|
38023
38029
|
const e = this.context.physics.raycast();
|
|
@@ -38327,7 +38333,7 @@ const $c = class kw extends T {
|
|
|
38327
38333
|
invertForward = !1;
|
|
38328
38334
|
keepUpDirection = !0;
|
|
38329
38335
|
copyTargetRotation = !1;
|
|
38330
|
-
static flipYQuat = new
|
|
38336
|
+
static flipYQuat = new N().setFromAxisAngle(new b(0, 1, 0), Math.PI);
|
|
38331
38337
|
/** @internal */
|
|
38332
38338
|
onBeforeRender() {
|
|
38333
38339
|
let e = this.target;
|
|
@@ -38391,15 +38397,15 @@ class Wc extends T {
|
|
|
38391
38397
|
}
|
|
38392
38398
|
this._validateUrl();
|
|
38393
38399
|
let e = this.url;
|
|
38394
|
-
switch (!e.startsWith("mailto:") && e.includes("@") && (e = "mailto:" + e),
|
|
38400
|
+
switch (!e.startsWith("mailto:") && e.includes("@") && (e = "mailto:" + e), D() && Be("Open URL: " + e), this.mode) {
|
|
38395
38401
|
case 0:
|
|
38396
|
-
|
|
38402
|
+
q.isSafari(), globalThis.open(e, "_blank");
|
|
38397
38403
|
break;
|
|
38398
38404
|
case 1:
|
|
38399
|
-
|
|
38405
|
+
q.isSafari() && q.isiOS() ? globalThis.open(e, "_top") : globalThis.open(e, "_self");
|
|
38400
38406
|
break;
|
|
38401
38407
|
case 2:
|
|
38402
|
-
|
|
38408
|
+
q.isSafari() ? globalThis.open(e, "_top") : globalThis.open(e, "_new");
|
|
38403
38409
|
break;
|
|
38404
38410
|
}
|
|
38405
38411
|
}
|
|
@@ -38420,7 +38426,7 @@ class Wc extends T {
|
|
|
38420
38426
|
this.clickable && !e.used && this.url?.length && this.open();
|
|
38421
38427
|
}
|
|
38422
38428
|
_validateUrl() {
|
|
38423
|
-
this.url && this.url.startsWith("www.") && (
|
|
38429
|
+
this.url && this.url.startsWith("www.") && (D() && console.warn("URL is not valid, adding https:// to the start of the URL", this.url), this.url = "https://" + this.url);
|
|
38424
38430
|
}
|
|
38425
38431
|
}
|
|
38426
38432
|
Wg([
|
|
@@ -38449,7 +38455,7 @@ class Mo extends T {
|
|
|
38449
38455
|
useGripSpace = !1;
|
|
38450
38456
|
resetTransformAfterXRSession = !0;
|
|
38451
38457
|
_startPosition = new b();
|
|
38452
|
-
_startRotation = new
|
|
38458
|
+
_startRotation = new N();
|
|
38453
38459
|
_startScale = new b();
|
|
38454
38460
|
/** @internal */
|
|
38455
38461
|
onEnterXR(e) {
|
|
@@ -38506,7 +38512,7 @@ NeedleXRSession.onSessionRequestStart(evt => {
|
|
|
38506
38512
|
evt.init.optionalFeatures = evt.init.optionalFeatures || [];
|
|
38507
38513
|
evt.init.optionalFeatures.push('camera-access');
|
|
38508
38514
|
});
|
|
38509
|
-
`),
|
|
38515
|
+
`), D() && Wd("No camera feed available - please request the 'camera-access' feature before starting WebXR or add the ARCameraBackground component to your scene"), !1;
|
|
38510
38516
|
const n = t.getViewerPose(s.xr.getReferenceSpace());
|
|
38511
38517
|
if (n)
|
|
38512
38518
|
for (const o of n.views)
|
|
@@ -38554,9 +38560,9 @@ function Tw(s) {
|
|
|
38554
38560
|
const a = i.renderer, l = a.xr.enabled && a.xr.isPresenting;
|
|
38555
38561
|
if (l && i.currentFrameEvent != xe.EarlyUpdate)
|
|
38556
38562
|
return console.warn("Screenshot: defer to access XR frame"), new Promise((E) => {
|
|
38557
|
-
ks((
|
|
38558
|
-
const
|
|
38559
|
-
E(
|
|
38563
|
+
ks((B) => {
|
|
38564
|
+
const L = Tw(s);
|
|
38565
|
+
E(L);
|
|
38560
38566
|
}, xe.EarlyUpdate, { once: !0 });
|
|
38561
38567
|
});
|
|
38562
38568
|
const c = a.domElement, h = c.width, d = c.height;
|
|
@@ -38571,20 +38577,20 @@ function Tw(s) {
|
|
|
38571
38577
|
const k = s.render_events !== !1, E = new Array();
|
|
38572
38578
|
k && (gc(i.scene, Hi, E), E.forEach((A) => {
|
|
38573
38579
|
if (A?.onBeforeRender(), A.isInstancingActive && A.instances)
|
|
38574
|
-
for (let
|
|
38575
|
-
const
|
|
38576
|
-
hs(
|
|
38580
|
+
for (let $ = 0; $ < A.instances?.length; $++) {
|
|
38581
|
+
const V = A.instances[$];
|
|
38582
|
+
hs(V.object, !0);
|
|
38577
38583
|
}
|
|
38578
38584
|
})), e && (i.scene.background = null, a.setClearColor(0, 0)), s.background && (i.scene.background = null, a.setClearColor(s.background), s.background instanceof oe && a.setClearAlpha(s.background.a)), e && a.setClearAlpha(0), a.setSize(n, o, !1), "cam" in r && (r = r.threeCamera), r instanceof pe && (r.aspect = n / o, r.updateProjectionMatrix());
|
|
38579
|
-
const
|
|
38580
|
-
let
|
|
38581
|
-
|
|
38585
|
+
const B = "type" in s && s.type === "texture";
|
|
38586
|
+
let L = null;
|
|
38587
|
+
B && (L = new Dn(n, o, {
|
|
38582
38588
|
wrapS: Qg,
|
|
38583
38589
|
wrapT: Qg,
|
|
38584
38590
|
format: 1023
|
|
38585
|
-
}), a.setRenderTarget(
|
|
38586
|
-
let
|
|
38587
|
-
if (l ? (
|
|
38591
|
+
}), a.setRenderTarget(L));
|
|
38592
|
+
let W = c;
|
|
38593
|
+
if (l ? (L && console.error('Taking XR screenshots with { type: "texture" } is currently not supported.'), W = Od.compositeWithCameraImage({
|
|
38588
38594
|
width: f,
|
|
38589
38595
|
height: p,
|
|
38590
38596
|
scene: i.scene,
|
|
@@ -38604,21 +38610,21 @@ function Tw(s) {
|
|
|
38604
38610
|
break;
|
|
38605
38611
|
}
|
|
38606
38612
|
if (e && s.trim === !0) {
|
|
38607
|
-
const A = oA(
|
|
38608
|
-
A && (
|
|
38613
|
+
const A = oA(W);
|
|
38614
|
+
A && (W = A);
|
|
38609
38615
|
}
|
|
38610
38616
|
if ("type" in s) {
|
|
38611
38617
|
if (s.type === "texture")
|
|
38612
|
-
return
|
|
38618
|
+
return L ? (s.target && (s.target.image = L?.texture.image, s.target.needsUpdate = !0), L.texture.offset.set(0, -1), L.texture.needsUpdate = !0, L.texture) : (console.error("No target texture found"), null);
|
|
38613
38619
|
if (s.type === "blob")
|
|
38614
|
-
return new Promise((
|
|
38615
|
-
|
|
38616
|
-
|
|
38620
|
+
return new Promise(($, V) => {
|
|
38621
|
+
W.toBlob((ne) => {
|
|
38622
|
+
$(ne);
|
|
38617
38623
|
}, t);
|
|
38618
38624
|
});
|
|
38619
38625
|
if (s.type === "share")
|
|
38620
|
-
return new Promise((
|
|
38621
|
-
|
|
38626
|
+
return new Promise(($, V) => {
|
|
38627
|
+
W.toBlob((ne) => {
|
|
38622
38628
|
if (ne && "share" in navigator) {
|
|
38623
38629
|
let re = "file_type" in s && s.file_type || t;
|
|
38624
38630
|
t || (re = "image/png");
|
|
@@ -38631,7 +38637,7 @@ function Tw(s) {
|
|
|
38631
38637
|
}).catch((Je) => {
|
|
38632
38638
|
console.warn("User cancelled share", Je.message);
|
|
38633
38639
|
}).finally(() => {
|
|
38634
|
-
|
|
38640
|
+
$({ blob: ne, shared: !0 });
|
|
38635
38641
|
});
|
|
38636
38642
|
}
|
|
38637
38643
|
return {
|
|
@@ -38641,17 +38647,17 @@ function Tw(s) {
|
|
|
38641
38647
|
}, t);
|
|
38642
38648
|
});
|
|
38643
38649
|
}
|
|
38644
|
-
const
|
|
38650
|
+
const X = W.toDataURL(t);
|
|
38645
38651
|
if ("download_filename" in s && s.download_filename) {
|
|
38646
38652
|
let A = s.download_filename;
|
|
38647
|
-
if (
|
|
38648
|
-
const
|
|
38653
|
+
if (q.isMobileDevice() && typeof window < "u") {
|
|
38654
|
+
const $ = A + "_screenshots", V = A.split("."), ne = V.pop()?.toLowerCase();
|
|
38649
38655
|
let re = 0;
|
|
38650
|
-
localStorage.getItem(
|
|
38656
|
+
localStorage.getItem($) && (re = parseInt(sessionStorage.getItem($) || "0")), re > 0 && (A = `${V.join()}-${re}.${ne}`), re += 1, sessionStorage.setItem($, re.toString());
|
|
38651
38657
|
}
|
|
38652
|
-
rA(
|
|
38658
|
+
rA(X, A);
|
|
38653
38659
|
}
|
|
38654
|
-
return
|
|
38660
|
+
return X;
|
|
38655
38661
|
} finally {
|
|
38656
38662
|
a.setRenderTarget(v), i.scene.background = I, a.setSize(h, d, !1), a.setClearColor(y, x), O != null && r instanceof pe && (r.aspect = O, r.updateProjectionMatrix()), a.xr.enabled = m, a.xr.isPresenting = l, l || i.updateSize(!0);
|
|
38657
38663
|
}
|
|
@@ -38877,7 +38883,7 @@ class pc {
|
|
|
38877
38883
|
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));
|
|
38878
38884
|
}
|
|
38879
38885
|
static _positionBuffer = new $i(() => new b(), 20);
|
|
38880
|
-
static _rotationBuffer = new $i(() => new
|
|
38886
|
+
static _rotationBuffer = new $i(() => new N(), 20);
|
|
38881
38887
|
_position;
|
|
38882
38888
|
_rotation;
|
|
38883
38889
|
ensureTransformData() {
|
|
@@ -38938,11 +38944,11 @@ class dA {
|
|
|
38938
38944
|
const n = i;
|
|
38939
38945
|
return n.isImageTrackingExtension && n.component.activeAndEnabled && n.component.trackedImages?.length > 0;
|
|
38940
38946
|
}).indexOf(this);
|
|
38941
|
-
this.shouldExport = t === 0, this.shouldExport && this.component.trackedImages?.length > 1 && (kd ||
|
|
38947
|
+
this.shouldExport = t === 0, this.shouldExport && this.component.trackedImages?.length > 1 && (kd || D()) && (ge("USDZ: Only one tracked image is supported."), console.warn("USDZ: Only one tracked image is supported. Will choose the first one in the trackedImages list"));
|
|
38942
38948
|
}
|
|
38943
38949
|
onAfterHierarchy(e, t) {
|
|
38944
38950
|
if (!this.shouldExport) return;
|
|
38945
|
-
const i =
|
|
38951
|
+
const i = q.getiOSVersion(), r = (i ? parseInt(i.split(".")[0]) : 18) >= 18 ? 1 : 100;
|
|
38946
38952
|
t.beginBlock('def Preliminary_ReferenceImage "AnchoringReferenceImage"'), t.appendLine("uniform asset image = @image_tracking/" + this.filename + "@"), t.appendLine("uniform double physicalWidth = " + (this.imageModel.widthInMeters * r).toFixed(8)), t.closeBlock();
|
|
38947
38953
|
}
|
|
38948
38954
|
async onAfterSerialize(e) {
|
|
@@ -39022,7 +39028,7 @@ class $u extends T {
|
|
|
39022
39028
|
t.frames = 0;
|
|
39023
39029
|
}
|
|
39024
39030
|
onLeaveXR(e) {
|
|
39025
|
-
if (!this.supported &&
|
|
39031
|
+
if (!this.supported && q.isAndroidDevice() && ge(this.webXRIncubationsWarning), this.trackedImages) {
|
|
39026
39032
|
for (const t of this.trackedImages)
|
|
39027
39033
|
if (t.object?.asset) {
|
|
39028
39034
|
const i = t.object.asset;
|
|
@@ -39184,7 +39190,7 @@ class Eo extends T {
|
|
|
39184
39190
|
for (const d of this._allPlanes.values())
|
|
39185
39191
|
!d.mesh || !d.mesh.visible || (this.bounds.makeEmpty(), d.mesh.traverse((f) => {
|
|
39186
39192
|
f instanceof H && this.bounds.expandByObject(f);
|
|
39187
|
-
}), this.bounds.getCenter(this.center), this.labelOffset.copy(h).sub(this.center).normalize().multiplyScalar(0.1),
|
|
39193
|
+
}), this.bounds.getCenter(this.center), this.labelOffset.copy(h).sub(this.center).normalize().multiplyScalar(0.1), z.DrawLabel(
|
|
39188
39194
|
this.center.add(this.labelOffset),
|
|
39189
39195
|
(d.xrData.semanticLabel || "plane").toUpperCase() + `
|
|
39190
39196
|
` + d.xrData.lastChangedTime.toFixed(2),
|
|
@@ -39738,7 +39744,7 @@ Use import { NeedleEngineModelLoader } from "@needle-tools/engine" namespace to
|
|
|
39738
39744
|
}
|
|
39739
39745
|
}
|
|
39740
39746
|
function uL(s, e) {
|
|
39741
|
-
return Lw(e?.context ||
|
|
39747
|
+
return Lw(e?.context || U.Current, s, s, e?.seed || null, e?.onprogress);
|
|
39742
39748
|
}
|
|
39743
39749
|
async function SA(s, e, t, i) {
|
|
39744
39750
|
typeof t != "string" && (console.warn("Parse gltf binary without path, this might lead to errors in resolving extensions. Please provide the source path of the gltf/glb file", t, typeof t), t = ""), Aw && console.log("Parse glTF", t);
|
|
@@ -39883,7 +39889,7 @@ class MA {
|
|
|
39883
39889
|
this.onRequestedEndAR();
|
|
39884
39890
|
};
|
|
39885
39891
|
onBegin(e, t, i) {
|
|
39886
|
-
if (this.currentSession = i, this.arContainer = t,
|
|
39892
|
+
if (this.currentSession = i, this.arContainer = t, q.isMozillaXR()) {
|
|
39887
39893
|
const n = e.domElement.children;
|
|
39888
39894
|
for (let o = 0; o < n?.length; o++) {
|
|
39889
39895
|
const r = n[o];
|
|
@@ -39901,7 +39907,7 @@ class MA {
|
|
|
39901
39907
|
const i = t.el;
|
|
39902
39908
|
t.previousParent?.appendChild(i);
|
|
39903
39909
|
}
|
|
39904
|
-
this._reparentedObjects.length = 0,
|
|
39910
|
+
this._reparentedObjects.length = 0, q.isMozillaXR() && setTimeout(() => {
|
|
39905
39911
|
const t = e.renderer.domElement;
|
|
39906
39912
|
t && e.domElement.shadowRoot?.prepend(t);
|
|
39907
39913
|
const i = document.querySelectorAll("*");
|
|
@@ -39917,7 +39923,7 @@ class MA {
|
|
|
39917
39923
|
const t = e.shadowRoot.querySelector(".content");
|
|
39918
39924
|
this.contentElement = t;
|
|
39919
39925
|
const i = e.shadowRoot.querySelector(".overlay-content");
|
|
39920
|
-
return i && t.appendChild(i), fl && !
|
|
39926
|
+
return i && t.appendChild(i), fl && !q.isMobileDevice() && this.ensureQuitARButton(t), t;
|
|
39921
39927
|
}
|
|
39922
39928
|
onRequestedEndAR() {
|
|
39923
39929
|
this.currentSession && (this.currentSession.end(), this.currentSession = null);
|
|
@@ -40092,7 +40098,7 @@ class Md {
|
|
|
40092
40098
|
Z_ && console.log("Loading UI has commercial license?", t);
|
|
40093
40099
|
const i = document.createElement("div");
|
|
40094
40100
|
i.style.paddingTop = ".6em", i.style.fontSize = ".8em", i.style.textTransform = "uppercase", i.innerText = `NEEDLE ENGINE NON COMMERCIAL VERSION
|
|
40095
|
-
CLICK HERE TO GET A LICENSE`, i.style.cursor = "pointer", i.style.userSelect = "none", i.style.textAlign = "center", i.style.pointerEvents = "all", i.addEventListener("click", () => window.open("https://needle.tools/pricing", "_self")), i.style.opacity = "0", e.appendChild(i), !
|
|
40101
|
+
CLICK HERE TO GET A LICENSE`, i.style.cursor = "pointer", i.style.userSelect = "none", i.style.textAlign = "center", i.style.pointerEvents = "all", i.addEventListener("click", () => window.open("https://needle.tools/pricing", "_self")), i.style.opacity = "0", e.appendChild(i), !D() && xa && (Z_ && console.log("Waiting for runtime license check"), await xa, t = vs()), !t && (i.style.transition = "opacity .5s ease-in-out", i.style.opacity = "1");
|
|
40096
40102
|
}
|
|
40097
40103
|
}
|
|
40098
40104
|
Xb(Ew);
|
|
@@ -40145,7 +40151,7 @@ class Uw extends HTMLElement {
|
|
|
40145
40151
|
/**
|
|
40146
40152
|
* Get the current context for this web component instance. The context is created when the src attribute is set and the loading has finished.
|
|
40147
40153
|
* The context is disposed when the needle engine is removed from the document (you can prevent this by setting the keep-alive attribute to true).
|
|
40148
|
-
* @returns
|
|
40154
|
+
* @returns a promise that resolves to the context when the loading has finished
|
|
40149
40155
|
*/
|
|
40150
40156
|
getContext() {
|
|
40151
40157
|
return new Promise((e, t) => {
|
|
@@ -40252,7 +40258,7 @@ class Uw extends HTMLElement {
|
|
|
40252
40258
|
<div class="content">
|
|
40253
40259
|
<slot class="overlay-content"></slot>
|
|
40254
40260
|
</div>
|
|
40255
|
-
`, this.shadowRoot && this.shadowRoot.appendChild(e.content.cloneNode(!0)), this._context = new
|
|
40261
|
+
`, this.shadowRoot && this.shadowRoot.appendChild(e.content.cloneNode(!0)), this._context = new U({ domElement: this }), this.addEventListener("error", this.onError);
|
|
40256
40262
|
}
|
|
40257
40263
|
/**
|
|
40258
40264
|
* @internal
|
|
@@ -40303,18 +40309,10 @@ changed from "`, t, '" to "', i, '"'), this.onLoad();
|
|
|
40303
40309
|
Pe && console.log("ktx2DecoderPath", i), s_(i);
|
|
40304
40310
|
break;
|
|
40305
40311
|
case "tonemapping":
|
|
40306
|
-
case "tone-mapping":
|
|
40307
|
-
|
|
40308
|
-
|
|
40309
|
-
|
|
40310
|
-
case "tone-mapping-exposure": {
|
|
40311
|
-
this.applyAttributes();
|
|
40312
|
-
break;
|
|
40313
|
-
}
|
|
40314
|
-
case "background-blurriness": {
|
|
40315
|
-
this.applyAttributes();
|
|
40316
|
-
break;
|
|
40317
|
-
}
|
|
40312
|
+
case "tone-mapping":
|
|
40313
|
+
case "tone-mapping-exposure":
|
|
40314
|
+
case "background-blurriness":
|
|
40315
|
+
case "background-color":
|
|
40318
40316
|
case "environment-intensity": {
|
|
40319
40317
|
this.applyAttributes();
|
|
40320
40318
|
break;
|
|
@@ -40339,7 +40337,7 @@ changed from "`, t, '" to "', i, '"'), this.onLoad();
|
|
|
40339
40337
|
_createContextPromise = null;
|
|
40340
40338
|
async onLoad() {
|
|
40341
40339
|
if (!this.isConnected) return;
|
|
40342
|
-
if (this._context || (Pe && console.warn("Create new context"), this._context = new
|
|
40340
|
+
if (this._context || (Pe && console.warn("Create new context"), this._context = new U({ domElement: this })), !this._context) {
|
|
40343
40341
|
console.error("Needle Engine: Context not initialized");
|
|
40344
40342
|
return;
|
|
40345
40343
|
}
|
|
@@ -40365,7 +40363,7 @@ changed from "`, t, '" to "', i, '"'), this.onLoad();
|
|
|
40365
40363
|
const g = this.getAttribute("hide-loading-overlay");
|
|
40366
40364
|
g != null && g !== "0" && (o = !1);
|
|
40367
40365
|
}
|
|
40368
|
-
o === !1 && !n && (
|
|
40366
|
+
o === !1 && !n && (D() || (o = !0), console.warn("Needle Engine: You need a commercial license to override the default loading view. Visit https://needle.tools/pricing"), D() && ge('You need a <a target="_blank" href="https://needle.tools/pricing">commercial license</a> to override the default loading view. This will not work in production.')), !this._loadingView && o && (this._loadingView = new Md(this)), o && (this._didFullyLoad !== !0 ? this._loadingView?.onLoadingBegin("begin load") : setTimeout(() => {
|
|
40369
40367
|
this._loadingView && this._loadingProgress01 < 0.3 && this._loadId === t && this._loadingView.onLoadingBegin("begin load");
|
|
40370
40368
|
}, 300)), Pe && console.warn(`--------------
|
|
40371
40369
|
Needle Engine: Begin loading ` + t + `
|
|
@@ -40589,9 +40587,9 @@ function EA(s) {
|
|
|
40589
40587
|
let f = t[d];
|
|
40590
40588
|
(f === "_" || f === "-") && (f = " "), !(f === " " && l.length <= 0 || h.includes(f) || (l.length === 0 && (f = f.toUpperCase()), c && f === " ")) && (c && (f = f.toUpperCase()), c = !1, l += f, f === " " && (c = !0));
|
|
40591
40589
|
}
|
|
40592
|
-
return
|
|
40590
|
+
return D() && t !== l && console.debug('Generated display name: "' + t + '" → "' + l + '"'), l.trim();
|
|
40593
40591
|
}
|
|
40594
|
-
return
|
|
40592
|
+
return D() && console.debug("Loading: use default name", t), t;
|
|
40595
40593
|
}
|
|
40596
40594
|
function AA(s) {
|
|
40597
40595
|
B0((e) => {
|
|
@@ -40678,7 +40676,7 @@ class Kl {
|
|
|
40678
40676
|
this.world?.removeCollider(o, !0);
|
|
40679
40677
|
const r = o.parent();
|
|
40680
40678
|
r && r.numColliders() <= 0 && (r[Yt] || this.world?.removeRigidBody(r));
|
|
40681
|
-
} else n instanceof R.RAPIER_PHYSICS.MODULE.RigidBody && (n.numColliders() <= 0 ? this.world?.removeRigidBody(n) :
|
|
40679
|
+
} else n instanceof R.RAPIER_PHYSICS.MODULE.RigidBody && (n.numColliders() <= 0 ? this.world?.removeRigidBody(n) : D() && (n.did_log_removing || setTimeout(() => {
|
|
40682
40680
|
n.numColliders() > 0 && (n.did_log_removing = !0, console.warn("RapierPhysics: removing rigidbody with colliders from the physics world is not possible right now, please remove the colliders first"));
|
|
40683
40681
|
}, 1)));
|
|
40684
40682
|
}
|
|
@@ -40779,7 +40777,7 @@ class Kl {
|
|
|
40779
40777
|
n === void 0 && (n = 1 / 0), o === void 0 && (o = !0);
|
|
40780
40778
|
const r = this.getPhysicsRay(this.rapierRay, e, t);
|
|
40781
40779
|
if (!r) return null;
|
|
40782
|
-
(this.debugRenderRaycasts || Oh) &&
|
|
40780
|
+
(this.debugRenderRaycasts || Oh) && z.DrawRay(r.origin, r.dir, 255, 1);
|
|
40783
40781
|
const a = this.world?.castRay(r, n, o, i?.queryFilterFlags, i?.filterGroups, void 0, void 0, (l) => {
|
|
40784
40782
|
const c = l[Yt];
|
|
40785
40783
|
return i?.filterPredicate ? i.filterPredicate(c) : i?.useIgnoreRaycastLayer !== !1 ? !c?.gameObject.layers.isEnabled(2) : !0;
|
|
@@ -40797,7 +40795,7 @@ class Kl {
|
|
|
40797
40795
|
n === void 0 && (n = 1 / 0), o === void 0 && (o = !0);
|
|
40798
40796
|
const r = this.getPhysicsRay(this.rapierRay, e, t);
|
|
40799
40797
|
if (!r) return null;
|
|
40800
|
-
(this.debugRenderRaycasts || Oh) &&
|
|
40798
|
+
(this.debugRenderRaycasts || Oh) && z.DrawRay(r.origin, r.dir, 255, 1);
|
|
40801
40799
|
const a = this.world?.castRayAndGetNormal(r, n, o, i?.queryFilterFlags, i?.filterGroups, void 0, void 0, (l) => {
|
|
40802
40800
|
const c = l[Yt];
|
|
40803
40801
|
return i?.filterPredicate ? i.filterPredicate(c) : i?.useIgnoreRaycastLayer !== !1 ? !c?.gameObject.layers.isEnabled(2) : !0;
|
|
@@ -40846,7 +40844,7 @@ class Kl {
|
|
|
40846
40844
|
* @returns array of colliders that overlap with the sphere. Note: they currently only contain the collider and the gameobject
|
|
40847
40845
|
*/
|
|
40848
40846
|
sphereOverlap(e, t) {
|
|
40849
|
-
return this.rapierSphere ??= new R.RAPIER_PHYSICS.MODULE.Ball(t), this.rapierSphere.radius = t, (this.debugRenderRaycasts || Oh) &&
|
|
40847
|
+
return this.rapierSphere ??= new R.RAPIER_PHYSICS.MODULE.Ball(t), this.rapierSphere.radius = t, (this.debugRenderRaycasts || Oh) && z.DrawWireSphere(e, t, 3359999, 1), this.shapeOverlap(e, this.rapierIdentityRotation, this.rapierSphere);
|
|
40850
40848
|
}
|
|
40851
40849
|
/** box overlap detection using rapier against colliders
|
|
40852
40850
|
* @param point center of the box in worldspace
|
|
@@ -40855,7 +40853,7 @@ class Kl {
|
|
|
40855
40853
|
* @returns array of colliders that overlap with the box. Note: they currently only contain the collider and the gameobject
|
|
40856
40854
|
*/
|
|
40857
40855
|
boxOverlap(e, t, i = null) {
|
|
40858
|
-
return i === null && (i = this.rapierIdentityRotation), this.rapierBox ??= new R.RAPIER_PHYSICS.MODULE.Cuboid(1, 1, 1), this.rapierBox.halfExtents.x = t.x * 0.5, this.rapierBox.halfExtents.y = t.y * 0.5, this.rapierBox.halfExtents.z = t.z * 0.5, (this.debugRenderRaycasts || Oh) &&
|
|
40856
|
+
return i === null && (i = this.rapierIdentityRotation), this.rapierBox ??= new R.RAPIER_PHYSICS.MODULE.Cuboid(1, 1, 1), this.rapierBox.halfExtents.x = t.x * 0.5, this.rapierBox.halfExtents.y = t.y * 0.5, this.rapierBox.halfExtents.z = t.z * 0.5, (this.debugRenderRaycasts || Oh) && z.DrawWireBox(e, t, 3359999, 1, !0, i), this.shapeOverlap(e, i, this.rapierBox);
|
|
40859
40857
|
}
|
|
40860
40858
|
shapeOverlap(e, t, i) {
|
|
40861
40859
|
return this.rapierColliderArray.length = 0, this._isInitialized ? this.world ? (this.world.intersectionsWithShape(
|
|
@@ -40882,7 +40880,7 @@ class Kl {
|
|
|
40882
40880
|
return this._world;
|
|
40883
40881
|
}
|
|
40884
40882
|
_tempPosition = new b();
|
|
40885
|
-
_tempQuaternion = new
|
|
40883
|
+
_tempQuaternion = new N();
|
|
40886
40884
|
_tempScale = new b();
|
|
40887
40885
|
_tempMatrix = new te();
|
|
40888
40886
|
static _didLoadPhysicsEngine = !1;
|
|
@@ -40971,7 +40969,7 @@ class Kl {
|
|
|
40971
40969
|
if (this._meshCache.has(d))
|
|
40972
40970
|
Qe && console.warn("Use cached mesh collider"), r = this._meshCache.get(d);
|
|
40973
40971
|
else {
|
|
40974
|
-
(Qe ||
|
|
40972
|
+
(Qe || D()) && console.debug(`[Performance] Your MeshCollider "${e.name}" is scaled: consider applying the scale to the collider mesh instead (${c.x}, ${c.y}, ${c.z})`);
|
|
40975
40973
|
const f = new Float32Array(r.length);
|
|
40976
40974
|
for (let p = 0; p < r.length; p += 3)
|
|
40977
40975
|
f[p] = r[p] * c.x, f[p + 1] = r[p + 1] * c.y, f[p + 2] = r[p + 2] * c.z;
|
|
@@ -41201,7 +41199,7 @@ Error:`, r), null;
|
|
|
41201
41199
|
}
|
|
41202
41200
|
const o = i.translation(), r = i.rotation();
|
|
41203
41201
|
if (Number.isNaN(o.x) || Number.isNaN(r.x)) {
|
|
41204
|
-
!n.__COLLIDER_NAN &&
|
|
41202
|
+
!n.__COLLIDER_NAN && D() && (console.warn("Collider has NaN values", n.name, n.gameObject, i), n.__COLLIDER_NAN = !0);
|
|
41205
41203
|
continue;
|
|
41206
41204
|
}
|
|
41207
41205
|
const a = t.center;
|
|
@@ -41241,7 +41239,7 @@ Error:`, r), null;
|
|
|
41241
41239
|
}
|
|
41242
41240
|
_tempCenterPos = new b();
|
|
41243
41241
|
_tempCenterVec = new b();
|
|
41244
|
-
_tempCenterQuaternion = new
|
|
41242
|
+
_tempCenterQuaternion = new N();
|
|
41245
41243
|
tryApplyCenter(e, t) {
|
|
41246
41244
|
const i = e.center;
|
|
41247
41245
|
i && e.gameObject && (i.x !== 0 || i.y !== 0 || i.z !== 0) && (this._tempCenterPos.x = i.x, this._tempCenterPos.y = i.y, this._tempCenterPos.z = i.z, $e(e.gameObject, this._tempCenterVec), this._tempCenterPos.multiply(this._tempCenterVec), e.attachedRigidbody ? this._tempCenterPos.applyQuaternion(e.gameObject.quaternion) : (be(e.gameObject, this._tempCenterQuaternion), this._tempCenterPos.applyQuaternion(this._tempCenterQuaternion)), t.x += this._tempCenterPos.x, t.y += this._tempCenterPos.y, t.z += this._tempCenterPos.z);
|
|
@@ -41331,7 +41329,7 @@ class jA {
|
|
|
41331
41329
|
const g = a.solverContactPoint(p), _ = a.contactImpulse(p);
|
|
41332
41330
|
if (g) {
|
|
41333
41331
|
const m = a.contactDist(p), v = a.solverContactFriction(p), y = a.solverContactTangentVelocity(p), x = new _k(g, m, f, _, v, y);
|
|
41334
|
-
d.push(x), ep &&
|
|
41332
|
+
d.push(x), ep && z.DrawDirection(g, f, 16711680, 3, !0);
|
|
41335
41333
|
}
|
|
41336
41334
|
}
|
|
41337
41335
|
o = new bk(r, i, d);
|
|
@@ -41540,7 +41538,7 @@ function zA(s, e, t) {
|
|
|
41540
41538
|
const i = new Set(t);
|
|
41541
41539
|
return Array.from(i);
|
|
41542
41540
|
}
|
|
41543
|
-
const sb = "needle-button", tp =
|
|
41541
|
+
const sb = "needle-button", tp = D();
|
|
41544
41542
|
class UA extends HTMLElement {
|
|
41545
41543
|
static observedAttributes = ["ar", "vr", "quicklook"];
|
|
41546
41544
|
constructor() {
|
|
@@ -41971,7 +41969,7 @@ const yL = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
41971
41969
|
VisibilityAction: uu,
|
|
41972
41970
|
Voip: _r,
|
|
41973
41971
|
Volume: Dc,
|
|
41974
|
-
VolumeParameter:
|
|
41972
|
+
VolumeParameter: F,
|
|
41975
41973
|
VolumeProfile: kg,
|
|
41976
41974
|
WebARCameraBackground: Nu,
|
|
41977
41975
|
WebARSessionRoot: Ni,
|
|
@@ -42176,7 +42174,7 @@ export {
|
|
|
42176
42174
|
v1 as ConnectionEvents,
|
|
42177
42175
|
_k as ContactPoint,
|
|
42178
42176
|
ou as ContactShadows,
|
|
42179
|
-
|
|
42177
|
+
U as Context,
|
|
42180
42178
|
NI as ContextArgs,
|
|
42181
42179
|
ce as ContextEvent,
|
|
42182
42180
|
he as ContextRegistry,
|
|
@@ -42188,7 +42186,7 @@ export {
|
|
|
42188
42186
|
er as DeleteBox,
|
|
42189
42187
|
Gn as DepthOfField,
|
|
42190
42188
|
eg as DeviceFlag,
|
|
42191
|
-
|
|
42189
|
+
q as DeviceUtilities,
|
|
42192
42190
|
$A as DocumentExtension,
|
|
42193
42191
|
Gr as DragControls,
|
|
42194
42192
|
nv as DragMode,
|
|
@@ -42213,7 +42211,7 @@ export {
|
|
|
42213
42211
|
xe as FrameEvent,
|
|
42214
42212
|
Sm as GENERATOR,
|
|
42215
42213
|
S as GameObject,
|
|
42216
|
-
|
|
42214
|
+
z as Gizmos,
|
|
42217
42215
|
bv as GltfExport,
|
|
42218
42216
|
_v as GltfExportBox,
|
|
42219
42217
|
$a as Gradient,
|
|
@@ -42432,7 +42430,7 @@ export {
|
|
|
42432
42430
|
uu as VisibilityAction,
|
|
42433
42431
|
_r as Voip,
|
|
42434
42432
|
Dc as Volume,
|
|
42435
|
-
|
|
42433
|
+
F as VolumeParameter,
|
|
42436
42434
|
kg as VolumeProfile,
|
|
42437
42435
|
FI as WaitForFrames,
|
|
42438
42436
|
WP as WaitForPromise,
|
|
@@ -42551,7 +42549,7 @@ export {
|
|
|
42551
42549
|
JA as isDebugMode,
|
|
42552
42550
|
sI as isDesktop,
|
|
42553
42551
|
_a as isDestroyed,
|
|
42554
|
-
|
|
42552
|
+
D as isDevEnvironment,
|
|
42555
42553
|
LI as isDisposed,
|
|
42556
42554
|
mL as isExporting,
|
|
42557
42555
|
gk as isGLTFModel,
|