@tomorrowevening/hermes 0.0.68 → 0.0.70
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/dist/hermes.cjs.js +8 -8
- package/dist/hermes.es.js +123 -126
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/hermes.es.js
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
import { EventDispatcher as pn, Texture as gn, CubeTexture as
|
1
|
+
import { EventDispatcher as pn, Texture as gn, CubeTexture as Hn, RepeatWrapping as qt, WebGLRenderTarget as Yn, Color as $t, FrontSide as Vn, BackSide as vn, DoubleSide as bn, NoBlending as qn, NormalBlending as Kn, AdditiveBlending as Xn, SubtractiveBlending as Zn, MultiplyBlending as Jn, CustomBlending as Qn, AddEquation as ea, SubtractEquation as ta, ReverseSubtractEquation as na, MinEquation as aa, MaxEquation as ia, ZeroFactor as yn, OneFactor as En, SrcColorFactor as xn, OneMinusSrcColorFactor as Sn, SrcAlphaFactor as Cn, OneMinusSrcAlphaFactor as wn, DstAlphaFactor as Mn, OneMinusDstAlphaFactor as On, DstColorFactor as Tn, OneMinusDstColorFactor as Rn, SrcAlphaSaturateFactor as ra, ConstantColorFactor as _n, OneMinusConstantColorFactor as kn, ConstantAlphaFactor as Dn, OneMinusConstantAlphaFactor as Pn, Matrix4 as sa, Vector3 as J, Euler as oa, Line as ca, BufferGeometry as Kt, Float32BufferAttribute as Xt, LineBasicMaterial as la, Mesh as An, MeshBasicMaterial as jn, Ray as ua, Plane as da, MathUtils as ha, MOUSE as nt, TOUCH as at, Quaternion as Zt, Spherical as Jt, Vector2 as me, ShaderMaterial as In, GLSL3 as fa, PlaneGeometry as ma, Scene as pa, Group as ga, AxesHelper as Qt, MeshDepthMaterial as va, MeshNormalMaterial as ba, WebGLRenderer as ya, PerspectiveCamera as At, Raycaster as Ea, OrthographicCamera as en, CameraHelper as xa, SpotLightHelper as Sa, PointLightHelper as Ca, HemisphereLightHelper as wa, DirectionalLightHelper as Ma } from "three";
|
2
2
|
import { Pane as Oa } from "tweakpane";
|
3
3
|
import * as Ta from "@tweakpane/plugin-essentials";
|
4
|
-
import Nn, { useState as
|
4
|
+
import Nn, { useState as H, useRef as Y, useEffect as Re, useMemo as se, forwardRef as Ra } from "react";
|
5
5
|
import { Reorder as Ln } from "framer-motion";
|
6
6
|
const zt = () => {
|
7
7
|
}, Di = () => {
|
8
8
|
};
|
9
|
-
function
|
9
|
+
function Ot(e) {
|
10
10
|
return e.substring(0, 1).toUpperCase() + e.substring(1);
|
11
11
|
}
|
12
12
|
function Ke(e, n, a) {
|
@@ -44,7 +44,7 @@ const rn = () => {
|
|
44
44
|
}, Bt = (e) => {
|
45
45
|
if (!e)
|
46
46
|
return;
|
47
|
-
let n = e.name.
|
47
|
+
let n = e.name.replaceAll(" ", "").replaceAll("/", ".");
|
48
48
|
n.length === 0 && (n = `obj_${Lt}`, Lt++), e.parent !== null && e.parent.uuid.length > 0 && (n = `${e.parent.uuid}.${n}`), e.uuid = n, e.children.forEach((a) => {
|
49
49
|
Bt(a);
|
50
50
|
});
|
@@ -52,11 +52,11 @@ const rn = () => {
|
|
52
52
|
e?.dispose();
|
53
53
|
}, Pa = (e) => {
|
54
54
|
e && (Array.isArray(e) ? e.forEach((n) => n.dispose()) : e.dispose());
|
55
|
-
},
|
55
|
+
}, Tt = (e) => {
|
56
56
|
if (e) {
|
57
57
|
for (; e.children.length > 0; ) {
|
58
58
|
const n = e.children[0];
|
59
|
-
n.type === "Audio" ? (n.pause(), n.parent && n.parent.remove(n)) :
|
59
|
+
n.type === "Audio" ? (n.pause(), n.parent && n.parent.remove(n)) : Tt(n);
|
60
60
|
}
|
61
61
|
if (e.parent && e.parent.remove(e), e.isMesh) {
|
62
62
|
const n = e;
|
@@ -414,7 +414,7 @@ function Aa(e) {
|
|
414
414
|
const n = e.type;
|
415
415
|
return n.search("Helper") > -1 ? "icon_utils" : n.search("Camera") > -1 ? "camera" : n.search("Light") > -1 ? "light" : "obj3D";
|
416
416
|
}
|
417
|
-
function
|
417
|
+
function Ct(e) {
|
418
418
|
const n = {
|
419
419
|
name: e.name,
|
420
420
|
type: e.type,
|
@@ -422,7 +422,7 @@ function wt(e) {
|
|
422
422
|
children: []
|
423
423
|
};
|
424
424
|
return e.children.forEach((a) => {
|
425
|
-
n.children.push(
|
425
|
+
n.children.push(Ct(a));
|
426
426
|
}), n;
|
427
427
|
}
|
428
428
|
function ja(e) {
|
@@ -476,7 +476,7 @@ function it(e) {
|
|
476
476
|
repeat: [i.repeat.x, i.repeat.y]
|
477
477
|
};
|
478
478
|
} else
|
479
|
-
i instanceof
|
479
|
+
i instanceof Hn && (console.log("env map"), console.log(i.source.data), console.log(i.source.toJSON()), n[a] = {
|
480
480
|
src: "",
|
481
481
|
offset: [i.offset.x, i.offset.y],
|
482
482
|
repeat: [i.repeat.x, i.repeat.y]
|
@@ -654,8 +654,8 @@ class Li extends Rt {
|
|
654
654
|
renderTargets = /* @__PURE__ */ new Map();
|
655
655
|
dispose() {
|
656
656
|
this.scenes.forEach((n) => {
|
657
|
-
|
658
|
-
}), this.scenes.clear(), this.scene &&
|
657
|
+
Tt(n);
|
658
|
+
}), this.scenes.clear(), this.scene && Tt(this.scene), this.renderTargets.forEach((n) => {
|
659
659
|
n.dispose();
|
660
660
|
}), this.renderTargets.clear(), this.renderer?.dispose();
|
661
661
|
}
|
@@ -712,7 +712,7 @@ class Li extends Rt {
|
|
712
712
|
if (n === void 0 || (this.scenes.set(n.name, n), !this.app.debugEnabled))
|
713
713
|
return;
|
714
714
|
rn(), Bt(n);
|
715
|
-
const a =
|
715
|
+
const a = Ct(n);
|
716
716
|
this.app.send({
|
717
717
|
event: "addScene",
|
718
718
|
target: "editor",
|
@@ -720,16 +720,13 @@ class Li extends Rt {
|
|
720
720
|
});
|
721
721
|
}
|
722
722
|
removeScene(n) {
|
723
|
-
if (n === void 0)
|
724
|
-
return;
|
725
|
-
const a = n.name, t = this.scenes.get(a);
|
726
|
-
if (this.scenes.delete(n.name), ft(t), !this.app.debugEnabled)
|
723
|
+
if (n === void 0 || (this.scenes.delete(n.name), !this.app.debugEnabled))
|
727
724
|
return;
|
728
|
-
const
|
725
|
+
const a = Ct(n);
|
729
726
|
this.app.send({
|
730
727
|
event: "removeScene",
|
731
728
|
target: "editor",
|
732
|
-
data:
|
729
|
+
data: a
|
733
730
|
});
|
734
731
|
}
|
735
732
|
removeAllScenes() {
|
@@ -745,7 +742,7 @@ class Li extends Rt {
|
|
745
742
|
if (n === void 0 || (this.scene = n, !this.app.debugEnabled))
|
746
743
|
return;
|
747
744
|
rn(), Bt(n);
|
748
|
-
const a =
|
745
|
+
const a = Ct(n);
|
749
746
|
this.app.send({
|
750
747
|
event: "setScene",
|
751
748
|
target: "editor",
|
@@ -814,7 +811,7 @@ class Li extends Rt {
|
|
814
811
|
rendererWidth = 300;
|
815
812
|
rendererHeight = 150;
|
816
813
|
addRT(n, a) {
|
817
|
-
const t = new
|
814
|
+
const t = new Yn(32, 32, a);
|
818
815
|
t.texture.name = n, this.renderTargets.set(n, t);
|
819
816
|
}
|
820
817
|
resize(n, a) {
|
@@ -1149,18 +1146,18 @@ function Fa() {
|
|
1149
1146
|
O < 0 && I("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
1150
1147
|
}
|
1151
1148
|
}
|
1152
|
-
var
|
1149
|
+
var He = R.ReactCurrentDispatcher, Ye;
|
1153
1150
|
function ue(s, g, y) {
|
1154
1151
|
{
|
1155
|
-
if (
|
1152
|
+
if (Ye === void 0)
|
1156
1153
|
try {
|
1157
1154
|
throw Error();
|
1158
1155
|
} catch ($) {
|
1159
1156
|
var w = $.stack.trim().match(/\n( *(at )?)/);
|
1160
|
-
|
1157
|
+
Ye = w && w[1] || "";
|
1161
1158
|
}
|
1162
1159
|
return `
|
1163
|
-
` +
|
1160
|
+
` + Ye + s;
|
1164
1161
|
}
|
1165
1162
|
}
|
1166
1163
|
var v = !1, b;
|
@@ -1181,7 +1178,7 @@ function Fa() {
|
|
1181
1178
|
var $ = Error.prepareStackTrace;
|
1182
1179
|
Error.prepareStackTrace = void 0;
|
1183
1180
|
var W;
|
1184
|
-
W =
|
1181
|
+
W = He.current, He.current = null, re();
|
1185
1182
|
try {
|
1186
1183
|
if (g) {
|
1187
1184
|
var L = function() {
|
@@ -1234,7 +1231,7 @@ function Fa() {
|
|
1234
1231
|
}
|
1235
1232
|
}
|
1236
1233
|
} finally {
|
1237
|
-
v = !1,
|
1234
|
+
v = !1, He.current = W, Me(), Error.prepareStackTrace = $;
|
1238
1235
|
}
|
1239
1236
|
var tt = s ? s.displayName || s.name : "", Vt = tt ? ue(tt) : "";
|
1240
1237
|
return typeof s == "function" && b.set(s, Vt), Vt;
|
@@ -1312,26 +1309,26 @@ function Fa() {
|
|
1312
1309
|
return y;
|
1313
1310
|
}
|
1314
1311
|
}
|
1315
|
-
function
|
1312
|
+
function ft(s) {
|
1316
1313
|
try {
|
1317
|
-
return
|
1314
|
+
return mt(s), !1;
|
1318
1315
|
} catch {
|
1319
1316
|
return !0;
|
1320
1317
|
}
|
1321
1318
|
}
|
1322
|
-
function
|
1319
|
+
function mt(s) {
|
1323
1320
|
return "" + s;
|
1324
1321
|
}
|
1325
1322
|
function st(s) {
|
1326
|
-
if (
|
1327
|
-
return I("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(s)),
|
1323
|
+
if (ft(s))
|
1324
|
+
return I("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(s)), mt(s);
|
1328
1325
|
}
|
1329
1326
|
var Ue = R.ReactCurrentOwner, ot = {
|
1330
1327
|
key: !0,
|
1331
1328
|
ref: !0,
|
1332
1329
|
__self: !0,
|
1333
1330
|
__source: !0
|
1334
|
-
}, ct,
|
1331
|
+
}, ct, pt, Qe;
|
1335
1332
|
Qe = {};
|
1336
1333
|
function kt(s) {
|
1337
1334
|
if (x.call(s, "ref")) {
|
@@ -1355,7 +1352,7 @@ function Fa() {
|
|
1355
1352
|
Qe[y] || (I('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', U(Ue.current.type), s.ref), Qe[y] = !0);
|
1356
1353
|
}
|
1357
1354
|
}
|
1358
|
-
function
|
1355
|
+
function gt(s, g) {
|
1359
1356
|
{
|
1360
1357
|
var y = function() {
|
1361
1358
|
ct || (ct = !0, I("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", g));
|
@@ -1369,7 +1366,7 @@ function Fa() {
|
|
1369
1366
|
function $e(s, g) {
|
1370
1367
|
{
|
1371
1368
|
var y = function() {
|
1372
|
-
|
1369
|
+
pt || (pt = !0, I("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", g));
|
1373
1370
|
};
|
1374
1371
|
y.isReactWarning = !0, Object.defineProperty(s, "ref", {
|
1375
1372
|
get: y,
|
@@ -1377,7 +1374,7 @@ function Fa() {
|
|
1377
1374
|
});
|
1378
1375
|
}
|
1379
1376
|
}
|
1380
|
-
var
|
1377
|
+
var Ht = function(s, g, y, w, $, W, L) {
|
1381
1378
|
var j = {
|
1382
1379
|
// This tag allows us to uniquely identify this as a React Element
|
1383
1380
|
$$typeof: n,
|
@@ -1419,9 +1416,9 @@ function Fa() {
|
|
1419
1416
|
}
|
1420
1417
|
if (j || he) {
|
1421
1418
|
var ae = typeof s == "function" ? s.displayName || s.name || "Unknown" : s;
|
1422
|
-
j &&
|
1419
|
+
j && gt(L, ae), he && $e(L, ae);
|
1423
1420
|
}
|
1424
|
-
return
|
1421
|
+
return Ht(s, j, he, $, w, Ue.current, L);
|
1425
1422
|
}
|
1426
1423
|
}
|
1427
1424
|
var E = R.ReactCurrentOwner, k = R.ReactDebugCurrentFrame;
|
@@ -1449,7 +1446,7 @@ Check the render method of \`` + s + "`.";
|
|
1449
1446
|
return "";
|
1450
1447
|
}
|
1451
1448
|
}
|
1452
|
-
function
|
1449
|
+
function Yt(s) {
|
1453
1450
|
{
|
1454
1451
|
if (s !== void 0) {
|
1455
1452
|
var g = s.fileName.replace(/^.*[\\\/]/, ""), y = s.lineNumber;
|
@@ -1460,8 +1457,8 @@ Check your code at ` + g + ":" + y + ".";
|
|
1460
1457
|
return "";
|
1461
1458
|
}
|
1462
1459
|
}
|
1463
|
-
var
|
1464
|
-
function
|
1460
|
+
var vt = {};
|
1461
|
+
function bt(s) {
|
1465
1462
|
{
|
1466
1463
|
var g = de();
|
1467
1464
|
if (!g) {
|
@@ -1478,10 +1475,10 @@ Check the top-level render call using <` + y + ">.");
|
|
1478
1475
|
if (!s._store || s._store.validated || s.key != null)
|
1479
1476
|
return;
|
1480
1477
|
s._store.validated = !0;
|
1481
|
-
var y =
|
1482
|
-
if (
|
1478
|
+
var y = bt(g);
|
1479
|
+
if (vt[y])
|
1483
1480
|
return;
|
1484
|
-
|
1481
|
+
vt[y] = !0;
|
1485
1482
|
var w = "";
|
1486
1483
|
s && s._owner && s._owner !== E.current && (w = " It was passed a child from " + U(s._owner.type) + "."), B(s), I('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', y, w), B(null);
|
1487
1484
|
}
|
@@ -1548,7 +1545,7 @@ Check the top-level render call using <` + y + ">.");
|
|
1548
1545
|
if (!L) {
|
1549
1546
|
var j = "";
|
1550
1547
|
(s === void 0 || typeof s == "object" && s !== null && Object.keys(s).length === 0) && (j += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
1551
|
-
var he =
|
1548
|
+
var he = Yt($);
|
1552
1549
|
he ? j += he : j += de();
|
1553
1550
|
var Q;
|
1554
1551
|
s === null ? Q = "null" : Ne(s) ? Q = "array" : s !== void 0 && s.$$typeof === n ? (Q = "<" + (U(s.type) || "Unknown") + " />", j = " Did you accidentally export a JSX literal instead of a component?") : Q = typeof s, I("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Q, j);
|
@@ -1575,10 +1572,10 @@ Check the top-level render call using <` + y + ">.");
|
|
1575
1572
|
function et(s, g, y) {
|
1576
1573
|
return ze(s, g, y, !0);
|
1577
1574
|
}
|
1578
|
-
function
|
1575
|
+
function yt(s, g, y) {
|
1579
1576
|
return ze(s, g, y, !1);
|
1580
1577
|
}
|
1581
|
-
var Gn =
|
1578
|
+
var Gn = yt, Wn = et;
|
1582
1579
|
ut.Fragment = t, ut.jsx = Gn, ut.jsxs = Wn;
|
1583
1580
|
}()), ut;
|
1584
1581
|
}
|
@@ -1609,7 +1606,7 @@ function za(e) {
|
|
1609
1606
|
] }) }, e.title);
|
1610
1607
|
}
|
1611
1608
|
function Ga(e) {
|
1612
|
-
const [n, a] =
|
1609
|
+
const [n, a] = H(!1), [t, i] = H(e.options), o = (u) => {
|
1613
1610
|
e.onDragComplete(u), i(u);
|
1614
1611
|
}, d = (u) => {
|
1615
1612
|
const f = [...t];
|
@@ -1625,9 +1622,9 @@ function Ga(e) {
|
|
1625
1622
|
] });
|
1626
1623
|
}
|
1627
1624
|
function Wa(e) {
|
1628
|
-
const [n, a] =
|
1625
|
+
const [n, a] = H(!1), t = [];
|
1629
1626
|
e.options.map((o, d) => {
|
1630
|
-
e.onSelect !== void 0 && (o.onSelect = e.onSelect), t.push(/* @__PURE__ */ l.jsx(
|
1627
|
+
e.onSelect !== void 0 && (o.onSelect = e.onSelect), t.push(/* @__PURE__ */ l.jsx(Ha, { option: o }, d));
|
1631
1628
|
});
|
1632
1629
|
let i = "dropdown";
|
1633
1630
|
return e.subdropdown && (i += " subdropdown"), /* @__PURE__ */ l.jsxs(
|
@@ -1649,8 +1646,8 @@ function Wa(e) {
|
|
1649
1646
|
}
|
1650
1647
|
);
|
1651
1648
|
}
|
1652
|
-
function
|
1653
|
-
const { option: n } = e, [a, t] =
|
1649
|
+
function Ha(e) {
|
1650
|
+
const { option: n } = e, [a, t] = H("");
|
1654
1651
|
let i;
|
1655
1652
|
switch (n.type) {
|
1656
1653
|
case "draggable":
|
@@ -1715,7 +1712,7 @@ function Fi(e, n, a) {
|
|
1715
1712
|
};
|
1716
1713
|
}
|
1717
1714
|
function Wt(e) {
|
1718
|
-
const [n, a] =
|
1715
|
+
const [n, a] = H(e.open !== void 0 ? e.open : !0), t = !n || e.children === void 0;
|
1719
1716
|
return /* @__PURE__ */ l.jsxs("div", { className: `accordion ${t ? "hide" : ""}`, children: [
|
1720
1717
|
/* @__PURE__ */ l.jsxs(
|
1721
1718
|
"button",
|
@@ -1733,7 +1730,7 @@ function Wt(e) {
|
|
1733
1730
|
children: "Toggle"
|
1734
1731
|
}
|
1735
1732
|
),
|
1736
|
-
/* @__PURE__ */ l.jsx("p", { className: "label", children:
|
1733
|
+
/* @__PURE__ */ l.jsx("p", { className: "label", children: Ot(e.label) })
|
1737
1734
|
]
|
1738
1735
|
}
|
1739
1736
|
),
|
@@ -1742,7 +1739,7 @@ function Wt(e) {
|
|
1742
1739
|
] });
|
1743
1740
|
}
|
1744
1741
|
function Un(e) {
|
1745
|
-
const n =
|
1742
|
+
const n = Y(null), [a, t] = H(!1), i = e.child !== void 0 && e.child.children.length > 0, o = [];
|
1746
1743
|
return e.child !== void 0 && e.child.children.length > 0 && e.child.children.map((d, r) => {
|
1747
1744
|
o.push(/* @__PURE__ */ l.jsx(Un, { child: d, three: e.three }, r));
|
1748
1745
|
}), Re(() => {
|
@@ -1802,14 +1799,14 @@ function Un(e) {
|
|
1802
1799
|
/* @__PURE__ */ l.jsx("div", { className: a ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { className: "container", children: o }) })
|
1803
1800
|
] }, Math.random()) });
|
1804
1801
|
}
|
1805
|
-
function
|
1802
|
+
function Ya(e) {
|
1806
1803
|
const n = [];
|
1807
1804
|
return e.child?.children.map((a, t) => {
|
1808
1805
|
n.push(/* @__PURE__ */ l.jsx(Un, { child: a, scene: e.scene, three: e.three }, t));
|
1809
1806
|
}), /* @__PURE__ */ l.jsx("div", { className: `scene ${e.class !== void 0 ? e.class : ""}`, children: n });
|
1810
1807
|
}
|
1811
1808
|
function Va(e) {
|
1812
|
-
const [n, a] =
|
1809
|
+
const [n, a] = H(e.defaultValue);
|
1813
1810
|
return Re(() => {
|
1814
1811
|
let t = !1, i = -1, o = 0, d = e.defaultValue;
|
1815
1812
|
const r = (p) => {
|
@@ -1834,7 +1831,7 @@ function Va(e) {
|
|
1834
1831
|
}, []), n;
|
1835
1832
|
}
|
1836
1833
|
function Xe(e) {
|
1837
|
-
const n =
|
1834
|
+
const n = Y(null), a = Y(null), t = Va({
|
1838
1835
|
label: e.labelRef,
|
1839
1836
|
input: n,
|
1840
1837
|
sliderRef: a,
|
@@ -1897,10 +1894,10 @@ function Xe(e) {
|
|
1897
1894
|
] });
|
1898
1895
|
}
|
1899
1896
|
function qa(e) {
|
1900
|
-
const n =
|
1897
|
+
const n = Y(null), a = Y(null), t = Y(null), i = Y(null), o = Y(null), d = Y(null), [r, h] = H(e.value), [u, f] = H({
|
1901
1898
|
min: Math.min(e.min, Math.min(e.value.x, e.value.y)),
|
1902
1899
|
max: Math.max(e.max, Math.max(e.value.x, e.value.y))
|
1903
|
-
}), [m, p] =
|
1900
|
+
}), [m, p] = H(!1);
|
1904
1901
|
function S() {
|
1905
1902
|
m || (window.addEventListener("mousemove", F), window.addEventListener("mouseup", A), window.addEventListener("mouseup", A), p(!0));
|
1906
1903
|
}
|
@@ -1999,7 +1996,7 @@ function cn(e) {
|
|
1999
1996
|
o[h] = u, e.onChange({ target: { value: o } });
|
2000
1997
|
};
|
2001
1998
|
["x", "y", "z"].forEach((h) => {
|
2002
|
-
const u =
|
1999
|
+
const u = Y(null);
|
2003
2000
|
i.push(
|
2004
2001
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2005
2002
|
/* @__PURE__ */ l.jsx("label", { ref: u, children: h.toUpperCase() }),
|
@@ -2022,7 +2019,7 @@ function cn(e) {
|
|
2022
2019
|
o[h] = u, e.onChange({ target: { value: o } });
|
2023
2020
|
};
|
2024
2021
|
["_x", "_y", "_z"].forEach((h) => {
|
2025
|
-
const u =
|
2022
|
+
const u = Y(null);
|
2026
2023
|
i.push(
|
2027
2024
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2028
2025
|
/* @__PURE__ */ l.jsx("label", { ref: u, children: h.substring(1).toUpperCase() }),
|
@@ -2046,7 +2043,7 @@ function cn(e) {
|
|
2046
2043
|
o.elements[u] = h, e.onChange({ target: { value: o } });
|
2047
2044
|
};
|
2048
2045
|
for (let r = 0; r < 9; r++) {
|
2049
|
-
const h =
|
2046
|
+
const h = Y(null);
|
2050
2047
|
i.push(
|
2051
2048
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2052
2049
|
/* @__PURE__ */ l.jsx("label", { ref: h, children: r + 1 }),
|
@@ -2074,7 +2071,7 @@ function Ka(e) {
|
|
2074
2071
|
t[d] = r, e.onChange({ target: { value: t } });
|
2075
2072
|
};
|
2076
2073
|
["x", "y", "z", "w"].forEach((d) => {
|
2077
|
-
const r =
|
2074
|
+
const r = Y(null);
|
2078
2075
|
a.push(
|
2079
2076
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2080
2077
|
/* @__PURE__ */ l.jsx("label", { ref: r, children: d.toUpperCase() }),
|
@@ -2098,7 +2095,7 @@ function Ka(e) {
|
|
2098
2095
|
t.elements[r] = d, e.onChange({ target: { value: t } });
|
2099
2096
|
};
|
2100
2097
|
for (let o = 0; o < 16; o++) {
|
2101
|
-
const d =
|
2098
|
+
const d = Y(null);
|
2102
2099
|
a.push(
|
2103
2100
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2104
2101
|
/* @__PURE__ */ l.jsx("label", { ref: d, children: o + 1 }),
|
@@ -2126,10 +2123,10 @@ function Ze(e) {
|
|
2126
2123
|
const n = [];
|
2127
2124
|
return e.items.forEach((a) => {
|
2128
2125
|
Xa(a) ? n.push(
|
2129
|
-
/* @__PURE__ */ l.jsx(Ze, { title:
|
2126
|
+
/* @__PURE__ */ l.jsx(Ze, { title: Ot(a.title), items: a.items }, Math.random())
|
2130
2127
|
) : n.push(
|
2131
2128
|
/* @__PURE__ */ l.jsx(
|
2132
|
-
|
2129
|
+
wt,
|
2133
2130
|
{
|
2134
2131
|
title: a.title,
|
2135
2132
|
prop: a.prop,
|
@@ -2951,7 +2948,7 @@ function di(e, n) {
|
|
2951
2948
|
}
|
2952
2949
|
const hi = "data:image/gif;base64,R0lGODlhDgFkAIAAAP///wAAACH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4xLWMwMDIgNzkuZGJhM2RhM2I1LCAyMDIzLzEyLzE1LTEwOjQyOjM3ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjUuNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoyMDk3M0NEODAxQjQxMUVGODVGNENDMkUyMUExNDk1NSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyMDk3M0NEOTAxQjQxMUVGODVGNENDMkUyMUExNDk1NSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkE4ODc3Qzg5MDFCMzExRUY4NUY0Q0MyRTIxQTE0OTU1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkE4ODc3QzhBMDFCMzExRUY4NUY0Q0MyRTIxQTE0OTU1Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAAAAAAAsAAAAAA4BZAAAAv+Mj6nL7Q+jnLTai7PevPsPhuJIluaJpurKtu4Lx/JM1/aN5/rO9/4PDAqHxKLxiEwql8ym8wmNSqfUqvWKzWq33K73Cw6Lx+Sy+YxOq9fstvsNj8vn9Lr9js/r9/y+/w8YKDhIWGh4iJiouMjY6PgIGSk5SVlpeYmZqTkJAGDQ+dnpuekmGgAKejpKuiZqmprKqoZKGyrbOlqrejub6xvLGyw8TFzcprurGuvqybxq7ETbrItsCz0l7Zpc+6p9/cS967w9/S2FTF0u/mzehK4Oqz3eTl9vf4+fr7/P3+//DzCgwIEECxo8iDChwoUMGzp8CDGixIkUK1q8iDGjxo0XHDt6/AgypMiRJEuaPIkypcqVLFt+KwAAOw==";
|
2953
2950
|
function fi(e) {
|
2954
|
-
const n =
|
2951
|
+
const n = Y(null), a = Y(null), t = Y(null), i = Y(null), o = Y(null), [d] = H(e.value), [r, h] = H(e.value.offset[0]), [u, f] = H(e.value.offset[1]), [m, p] = H(e.value.repeat[0]), [S, A] = H(e.value.repeat[1]);
|
2955
2952
|
function F(R, I, T, Z, te) {
|
2956
2953
|
if (e.onChange !== void 0) {
|
2957
2954
|
const pe = e.prop !== void 0 ? e.prop : e.title;
|
@@ -3035,10 +3032,10 @@ function fi(e) {
|
|
3035
3032
|
] })
|
3036
3033
|
] });
|
3037
3034
|
}
|
3038
|
-
function
|
3035
|
+
function wt(e) {
|
3039
3036
|
let n = e.value;
|
3040
3037
|
n !== void 0 && n.isColor !== void 0 && (n = Da(e.value));
|
3041
|
-
const [a, t] =
|
3038
|
+
const [a, t] = H(n), i = Y(null), o = (u) => {
|
3042
3039
|
let f = u.target.value;
|
3043
3040
|
e.type === "boolean" ? f = u.target.checked : e.type === "option" && (f = e.options[f].value), t(f), e.onChange !== void 0 && e.onChange(e.prop !== void 0 ? e.prop : e.title, f);
|
3044
3041
|
}, d = {};
|
@@ -3046,7 +3043,7 @@ function Mt(e) {
|
|
3046
3043
|
const r = e.type === "string" && (a.length > 100 || a.search(`
|
3047
3044
|
`) > -1), h = r || e.type === "image" || e.type === "vector2";
|
3048
3045
|
return /* @__PURE__ */ l.jsxs("div", { className: `field ${h ? "block" : ""}`, style: d, children: [
|
3049
|
-
e.type !== "button" && /* @__PURE__ */ l.jsx("label", { ref: i, children:
|
3046
|
+
e.type !== "button" && /* @__PURE__ */ l.jsx("label", { ref: i, children: Ot(e.title) }, "fieldLabel"),
|
3050
3047
|
e.type === "string" && !r && /* @__PURE__ */ l.jsx(
|
3051
3048
|
"input",
|
3052
3049
|
{
|
@@ -3121,7 +3118,7 @@ function Mt(e) {
|
|
3121
3118
|
}
|
3122
3119
|
),
|
3123
3120
|
e.type === "image" && /* @__PURE__ */ l.jsx(fi, { title: e.title, prop: e.prop, value: e.value, onChange: e.onChange }),
|
3124
|
-
e.type === "option" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx("select", { onChange: o, disabled: e.disabled, defaultValue: e.value, children: e.options?.map((u, f) => /* @__PURE__ */ l.jsx("option", { value: u.value, children:
|
3121
|
+
e.type === "option" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx("select", { onChange: o, disabled: e.disabled, defaultValue: e.value, children: e.options?.map((u, f) => /* @__PURE__ */ l.jsx("option", { value: u.value, children: Ot(u.title) }, f)) }) }),
|
3125
3122
|
e.type === "vector2" && /* @__PURE__ */ l.jsx(qa, { value: a, min: 0, max: 1, onChange: o }),
|
3126
3123
|
e.type === "grid3" && /* @__PURE__ */ l.jsx(cn, { value: a, onChange: o }),
|
3127
3124
|
e.type === "grid4" && /* @__PURE__ */ l.jsx(Ka, { value: a, onChange: o }),
|
@@ -3395,7 +3392,7 @@ const zn = {
|
|
3395
3392
|
};
|
3396
3393
|
let fe = { ...zn };
|
3397
3394
|
function bi(e) {
|
3398
|
-
const [n, a] =
|
3395
|
+
const [n, a] = H(-1);
|
3399
3396
|
Re(() => {
|
3400
3397
|
function d(h) {
|
3401
3398
|
fe = { ...h.value }, a(Date.now());
|
@@ -3411,7 +3408,7 @@ function bi(e) {
|
|
3411
3408
|
return /* @__PURE__ */ l.jsx(Wt, { label: "Inspector", children: /* @__PURE__ */ l.jsx("div", { id: "Inspector", className: e.class, children: fe.uuid.length > 0 && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
3412
3409
|
/* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
3413
3410
|
/* @__PURE__ */ l.jsx(
|
3414
|
-
|
3411
|
+
wt,
|
3415
3412
|
{
|
3416
3413
|
type: "string",
|
3417
3414
|
title: "Name",
|
@@ -3421,7 +3418,7 @@ function bi(e) {
|
|
3421
3418
|
}
|
3422
3419
|
),
|
3423
3420
|
/* @__PURE__ */ l.jsx(
|
3424
|
-
|
3421
|
+
wt,
|
3425
3422
|
{
|
3426
3423
|
type: "string",
|
3427
3424
|
title: "Type",
|
@@ -3431,7 +3428,7 @@ function bi(e) {
|
|
3431
3428
|
}
|
3432
3429
|
),
|
3433
3430
|
/* @__PURE__ */ l.jsx(
|
3434
|
-
|
3431
|
+
wt,
|
3435
3432
|
{
|
3436
3433
|
type: "string",
|
3437
3434
|
title: "UUID",
|
@@ -3451,7 +3448,7 @@ function bi(e) {
|
|
3451
3448
|
] }) }, n) }, "Inspector");
|
3452
3449
|
}
|
3453
3450
|
function Ui(e) {
|
3454
|
-
const [n] =
|
3451
|
+
const [n] = H([]), [a, t] = H(0), i = (r) => {
|
3455
3452
|
n.push(r.value), t(Date.now());
|
3456
3453
|
}, o = (r) => {
|
3457
3454
|
const h = r.value;
|
@@ -3467,7 +3464,7 @@ function Ui(e) {
|
|
3467
3464
|
const d = [];
|
3468
3465
|
return n.forEach((r, h) => {
|
3469
3466
|
d.push(
|
3470
|
-
/* @__PURE__ */ l.jsx(Wt, { label: `Scene: ${r.name}`, open: !0, children: /* @__PURE__ */ l.jsx(
|
3467
|
+
/* @__PURE__ */ l.jsx(Wt, { label: `Scene: ${r.name}`, open: !0, children: /* @__PURE__ */ l.jsx(Ya, { child: r, scene: r, three: e.three }) }, `scene_${h}`)
|
3471
3468
|
);
|
3472
3469
|
}), /* @__PURE__ */ l.jsxs("div", { id: "SidePanel", children: [
|
3473
3470
|
d,
|
@@ -3483,11 +3480,11 @@ function $i(e) {
|
|
3483
3480
|
}), h;
|
3484
3481
|
}
|
3485
3482
|
const a = (r) => {
|
3486
|
-
const h = r.value,
|
3487
|
-
f !== void 0
|
3483
|
+
const h = r.value, u = n(h), f = u?.getObjectByProperty("uuid", h);
|
3484
|
+
f !== void 0 ? e.three.setObject(f) : console.log(`Hermes - can't find object: ${h}`, u);
|
3488
3485
|
}, t = (r, h, u) => {
|
3489
|
-
const
|
3490
|
-
m !== void 0
|
3486
|
+
const f = n(r), m = f?.getObjectByProperty("uuid", r);
|
3487
|
+
m !== void 0 ? ee(m, h, u) : console.log(`Hermes - can't set object: ${r}`, f);
|
3491
3488
|
}, i = (r) => {
|
3492
3489
|
const h = r.value, { key: u, value: f, uuid: m } = h;
|
3493
3490
|
t(m, u, f);
|
@@ -3552,7 +3549,7 @@ class yi extends ca {
|
|
3552
3549
|
this.geometry.dispose(), this.material.dispose(), this.children[0].geometry.dispose(), this.children[0].material.dispose();
|
3553
3550
|
}
|
3554
3551
|
}
|
3555
|
-
const hn = { type: "change" }, It = { type: "start" }, fn = { type: "end" },
|
3552
|
+
const hn = { type: "change" }, It = { type: "start" }, fn = { type: "end" }, Et = new ua(), mn = new da(), Ei = Math.cos(70 * ha.DEG2RAD);
|
3556
3553
|
class xi extends pn {
|
3557
3554
|
constructor(n, a) {
|
3558
3555
|
super(), this.object = n, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new J(), this.cursor = new J(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: nt.ROTATE, MIDDLE: nt.DOLLY, RIGHT: nt.PAN }, this.touches = { ONE: at.ROTATE, TWO: at.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
|
@@ -3571,9 +3568,9 @@ class xi extends pn {
|
|
3571
3568
|
t.target.copy(t.target0), t.object.position.copy(t.position0), t.object.zoom = t.zoom0, t.object.updateProjectionMatrix(), t.dispatchEvent(hn), t.update(), o = i.NONE;
|
3572
3569
|
}, this.update = function() {
|
3573
3570
|
const c = new J(), E = new Zt().setFromUnitVectors(n.up, new J(0, 1, 0)), k = E.clone().invert(), B = new J(), ie = new Zt(), Ee = new J(), de = 2 * Math.PI;
|
3574
|
-
return function(
|
3575
|
-
const
|
3576
|
-
c.copy(
|
3571
|
+
return function(vt = null) {
|
3572
|
+
const bt = t.object.position;
|
3573
|
+
c.copy(bt).sub(t.target), c.applyQuaternion(E), r.setFromVector3(c), t.autoRotate && o === i.NONE && be(_e(vt)), t.enableDamping ? (r.theta += h.theta * t.dampingFactor, r.phi += h.phi * t.dampingFactor) : (r.theta += h.theta, r.phi += h.phi);
|
3577
3574
|
let xe = t.minAzimuthAngle, Se = t.maxAzimuthAngle;
|
3578
3575
|
isFinite(xe) && isFinite(Se) && (xe < -Math.PI ? xe += de : xe > Math.PI && (xe -= de), Se < -Math.PI ? Se += de : Se > Math.PI && (Se -= de), xe <= Se ? r.theta = Math.max(xe, Math.min(Se, r.theta)) : r.theta = r.theta > (xe + Se) / 2 ? Math.max(xe, r.theta) : Math.min(Se, r.theta)), r.phi = Math.max(t.minPolarAngle, Math.min(t.maxPolarAngle, r.phi)), r.makeSafe(), t.enableDamping === !0 ? t.target.addScaledVector(f, t.dampingFactor) : t.target.add(f), t.target.sub(t.cursor), t.target.clampLength(t.minTargetRadius, t.maxTargetRadius), t.target.add(t.cursor);
|
3579
3576
|
let Ve = !1;
|
@@ -3583,7 +3580,7 @@ class xi extends pn {
|
|
3583
3580
|
const Oe = r.radius;
|
3584
3581
|
r.radius = Ae(r.radius * u), Ve = Oe != r.radius;
|
3585
3582
|
}
|
3586
|
-
if (c.setFromSpherical(r), c.applyQuaternion(k),
|
3583
|
+
if (c.setFromSpherical(r), c.applyQuaternion(k), bt.copy(t.target).add(c), t.object.lookAt(t.target), t.enableDamping === !0 ? (h.theta *= 1 - t.dampingFactor, h.phi *= 1 - t.dampingFactor, f.multiplyScalar(1 - t.dampingFactor)) : (h.set(0, 0, 0), f.set(0, 0, 0)), t.zoomToCursor && pe) {
|
3587
3584
|
let Oe = null;
|
3588
3585
|
if (t.object.isPerspectiveCamera) {
|
3589
3586
|
const ze = c.length();
|
@@ -3595,11 +3592,11 @@ class xi extends pn {
|
|
3595
3592
|
ze.unproject(t.object);
|
3596
3593
|
const et = t.object.zoom;
|
3597
3594
|
t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom / u)), t.object.updateProjectionMatrix(), Ve = et !== t.object.zoom;
|
3598
|
-
const
|
3599
|
-
|
3595
|
+
const yt = new J(te.x, te.y, 0);
|
3596
|
+
yt.unproject(t.object), t.object.position.sub(yt).add(ze), t.object.updateMatrixWorld(), Oe = c.length();
|
3600
3597
|
} else
|
3601
3598
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), t.zoomToCursor = !1;
|
3602
|
-
Oe !== null && (this.screenSpacePanning ? t.target.set(0, 0, -1).transformDirection(t.object.matrix).multiplyScalar(Oe).add(t.object.position) : (
|
3599
|
+
Oe !== null && (this.screenSpacePanning ? t.target.set(0, 0, -1).transformDirection(t.object.matrix).multiplyScalar(Oe).add(t.object.position) : (Et.origin.copy(t.object.position), Et.direction.set(0, 0, -1).transformDirection(t.object.matrix), Math.abs(t.object.up.dot(Et.direction)) < Ei ? n.lookAt(t.target) : (mn.setFromNormalAndCoplanarPoint(t.object.up, t.target), Et.intersectPlane(mn, t.target))));
|
3603
3600
|
} else if (t.object.isOrthographicCamera) {
|
3604
3601
|
const Oe = t.object.zoom;
|
3605
3602
|
t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom / u)), Oe !== t.object.zoom && (t.object.updateProjectionMatrix(), Ve = !0);
|
@@ -3607,7 +3604,7 @@ class xi extends pn {
|
|
3607
3604
|
return u = 1, pe = !1, Ve || B.distanceToSquared(t.object.position) > d || 8 * (1 - ie.dot(t.object.quaternion)) > d || Ee.distanceToSquared(t.target) > d ? (t.dispatchEvent(hn), B.copy(t.object.position), ie.copy(t.object.quaternion), Ee.copy(t.target), !0) : !1;
|
3608
3605
|
};
|
3609
3606
|
}(), this.dispose = function() {
|
3610
|
-
t.domElement.removeEventListener("contextmenu", Qe), t.domElement.removeEventListener("pointerdown", _), t.domElement.removeEventListener("pointercancel", K), t.domElement.removeEventListener("wheel",
|
3607
|
+
t.domElement.removeEventListener("contextmenu", Qe), t.domElement.removeEventListener("pointerdown", _), t.domElement.removeEventListener("pointercancel", K), t.domElement.removeEventListener("wheel", ft), t.domElement.removeEventListener("pointermove", z), t.domElement.removeEventListener("pointerup", K), t.domElement.getRootNode().removeEventListener("keydown", st, { capture: !0 }), t._domElementKeyEvents !== null && (t._domElementKeyEvents.removeEventListener("keydown", ot), t._domElementKeyEvents = null);
|
3611
3608
|
};
|
3612
3609
|
const t = this, i = {
|
3613
3610
|
NONE: -1,
|
@@ -3695,10 +3692,10 @@ class xi extends pn {
|
|
3695
3692
|
function Me(c) {
|
3696
3693
|
I.set(c.clientX, c.clientY), T.subVectors(I, R), T.y > 0 ? De(ke(T.y)) : T.y < 0 && je(ke(T.y)), R.copy(I), t.update();
|
3697
3694
|
}
|
3698
|
-
function
|
3695
|
+
function He(c) {
|
3699
3696
|
F.set(c.clientX, c.clientY), V.subVectors(F, A).multiplyScalar(t.panSpeed), we(V.x, V.y), A.copy(F), t.update();
|
3700
3697
|
}
|
3701
|
-
function
|
3698
|
+
function Ye(c) {
|
3702
3699
|
Pe(c.clientX, c.clientY), c.deltaY < 0 ? je(ke(c.deltaY)) : c.deltaY > 0 && De(ke(c.deltaY)), t.update();
|
3703
3700
|
}
|
3704
3701
|
function ue(c) {
|
@@ -3781,7 +3778,7 @@ class xi extends pn {
|
|
3781
3778
|
t.enabled !== !1 && (q.length === 0 && (t.domElement.setPointerCapture(c.pointerId), t.domElement.addEventListener("pointermove", z), t.domElement.addEventListener("pointerup", K)), !Pt(c) && (kt(c), c.pointerType === "touch" ? ct(c) : Ne(c)));
|
3782
3779
|
}
|
3783
3780
|
function z(c) {
|
3784
|
-
t.enabled !== !1 && (c.pointerType === "touch" ?
|
3781
|
+
t.enabled !== !1 && (c.pointerType === "touch" ? pt(c) : Je(c));
|
3785
3782
|
}
|
3786
3783
|
function K(c) {
|
3787
3784
|
switch (Dt(c), q.length) {
|
@@ -3857,14 +3854,14 @@ class xi extends pn {
|
|
3857
3854
|
case i.PAN:
|
3858
3855
|
if (t.enablePan === !1)
|
3859
3856
|
return;
|
3860
|
-
|
3857
|
+
He(c);
|
3861
3858
|
break;
|
3862
3859
|
}
|
3863
3860
|
}
|
3864
|
-
function
|
3865
|
-
t.enabled === !1 || t.enableZoom === !1 || o !== i.NONE || (c.preventDefault(), t.dispatchEvent(It),
|
3861
|
+
function ft(c) {
|
3862
|
+
t.enabled === !1 || t.enableZoom === !1 || o !== i.NONE || (c.preventDefault(), t.dispatchEvent(It), Ye(mt(c)), t.dispatchEvent(fn));
|
3866
3863
|
}
|
3867
|
-
function
|
3864
|
+
function mt(c) {
|
3868
3865
|
const E = c.deltaMode, k = {
|
3869
3866
|
clientX: c.clientX,
|
3870
3867
|
clientY: c.clientY,
|
@@ -3890,7 +3887,7 @@ class xi extends pn {
|
|
3890
3887
|
t.enabled === !1 || t.enablePan === !1 || ue(c);
|
3891
3888
|
}
|
3892
3889
|
function ct(c) {
|
3893
|
-
switch (
|
3890
|
+
switch (gt(c), q.length) {
|
3894
3891
|
case 1:
|
3895
3892
|
switch (t.touches.ONE) {
|
3896
3893
|
case at.ROTATE:
|
@@ -3928,8 +3925,8 @@ class xi extends pn {
|
|
3928
3925
|
}
|
3929
3926
|
o !== i.NONE && t.dispatchEvent(It);
|
3930
3927
|
}
|
3931
|
-
function
|
3932
|
-
switch (
|
3928
|
+
function pt(c) {
|
3929
|
+
switch (gt(c), o) {
|
3933
3930
|
case i.TOUCH_ROTATE:
|
3934
3931
|
if (t.enableRotate === !1)
|
3935
3932
|
return;
|
@@ -3974,7 +3971,7 @@ class xi extends pn {
|
|
3974
3971
|
return !0;
|
3975
3972
|
return !1;
|
3976
3973
|
}
|
3977
|
-
function
|
3974
|
+
function gt(c) {
|
3978
3975
|
let E = ge[c.pointerId];
|
3979
3976
|
E === void 0 && (E = new me(), ge[c.pointerId] = E), E.set(c.pageX, c.pageY);
|
3980
3977
|
}
|
@@ -3982,14 +3979,14 @@ class xi extends pn {
|
|
3982
3979
|
const E = c.pointerId === q[0] ? q[1] : q[0];
|
3983
3980
|
return ge[E];
|
3984
3981
|
}
|
3985
|
-
t.domElement.addEventListener("contextmenu", Qe), t.domElement.addEventListener("pointerdown", _), t.domElement.addEventListener("pointercancel", K), t.domElement.addEventListener("wheel",
|
3982
|
+
t.domElement.addEventListener("contextmenu", Qe), t.domElement.addEventListener("pointerdown", _), t.domElement.addEventListener("pointercancel", K), t.domElement.addEventListener("wheel", ft, { passive: !1 }), t.domElement.getRootNode().addEventListener("keydown", st, { passive: !0, capture: !0 }), this.update();
|
3986
3983
|
}
|
3987
3984
|
}
|
3988
3985
|
function rt(e, n, a, t, i) {
|
3989
3986
|
return t + (e - n) * (i - t) / (a - n);
|
3990
3987
|
}
|
3991
|
-
const
|
3992
|
-
const [n, a] =
|
3988
|
+
const Mt = (e) => {
|
3989
|
+
const [n, a] = H(e.options[e.index]), t = () => {
|
3993
3990
|
e.onToggle(!e.open);
|
3994
3991
|
}, i = (o) => {
|
3995
3992
|
o !== n && (e.onSelect(o), a(o)), e.onToggle(!1);
|
@@ -3999,13 +3996,13 @@ const Ot = (e) => {
|
|
3999
3996
|
e.open && /* @__PURE__ */ l.jsx("ul", { className: "dropdown-menu", children: e.options.map((o) => /* @__PURE__ */ l.jsx("li", { onClick: () => i(o), children: o }, o)) })
|
4000
3997
|
] });
|
4001
3998
|
}, qe = Ra(function(n, a) {
|
4002
|
-
const [t, i] =
|
3999
|
+
const [t, i] = H(!1), o = n.options.indexOf(n.camera.name);
|
4003
4000
|
return /* @__PURE__ */ l.jsxs("div", { className: "CameraWindow", children: [
|
4004
4001
|
/* @__PURE__ */ l.jsx("div", { ref: a, className: "clickable", onClick: () => {
|
4005
4002
|
t && i(!1);
|
4006
4003
|
} }),
|
4007
4004
|
/* @__PURE__ */ l.jsx(
|
4008
|
-
|
4005
|
+
Mt,
|
4009
4006
|
{
|
4010
4007
|
index: o,
|
4011
4008
|
open: t,
|
@@ -4192,7 +4189,7 @@ class Oi extends In {
|
|
4192
4189
|
});
|
4193
4190
|
}
|
4194
4191
|
}
|
4195
|
-
let
|
4192
|
+
let xt = "Renderer", Te, St = !1, Nt = !1, X = null, oe = null, Ge = null, We = null;
|
4196
4193
|
function zi(e) {
|
4197
4194
|
const n = e.three.app.appID, a = localStorage.getItem(`${n}_mode`), t = localStorage.getItem(`${n}_tlCam`) !== null ? localStorage.getItem(`${n}_tlCam`) : "Debug", i = localStorage.getItem(`${n}_trCam`) !== null ? localStorage.getItem(`${n}_trCam`) : "Orthographic", o = localStorage.getItem(`${n}_blCam`) !== null ? localStorage.getItem(`${n}_blCam`) : "Front", d = localStorage.getItem(`${n}_brCam`) !== null ? localStorage.getItem(`${n}_brCam`) : "Top", r = se(() => /* @__PURE__ */ new Map(), []), h = se(() => /* @__PURE__ */ new Map(), []), u = se(() => /* @__PURE__ */ new Map(), []), f = se(() => /* @__PURE__ */ new Map(), []), m = se(() => new pa(), []), p = se(() => new ga(), []), S = se(() => new Ci(), []), A = se(() => new Qt(500), []), F = se(() => new Qt(100), []), V = se(() => new va(), []), R = se(() => new ba(), []), I = se(() => new Oi(), []), T = se(() => new jn({
|
4198
4195
|
opacity: 0.33,
|
@@ -4214,7 +4211,7 @@ function zi(e) {
|
|
4214
4211
|
"Side by Side",
|
4215
4212
|
"Stacked",
|
4216
4213
|
"Quad"
|
4217
|
-
], q =
|
4214
|
+
], q = Y(null), ge = Y(null), ce = Y(null), _e = Y(null), ke = Y(null), be = Y(null), [U, ye] = H(a !== null ? a : "Single"), [O, we] = H(null), [De, je] = H(!1), [Pe, Ae] = H(!1), [Ie, Be] = H(!1), [, Fe] = H(Date.now());
|
4218
4215
|
localStorage.setItem(`${n}_mode`, U), localStorage.setItem(`${n}_tlCam`, t), localStorage.setItem(`${n}_trCam`, i), localStorage.setItem(`${n}_blCam`, o), localStorage.setItem(`${n}_brCam`, d);
|
4219
4216
|
const re = (v, b) => {
|
4220
4217
|
const M = h.get(v.name);
|
@@ -4237,13 +4234,13 @@ function zi(e) {
|
|
4237
4234
|
b !== void 0 && (m.remove(b), b.dispose(), u.delete(v.name));
|
4238
4235
|
const M = h.get(v.name);
|
4239
4236
|
M !== void 0 && (M.dispose(), h.delete(v.name));
|
4240
|
-
},
|
4237
|
+
}, He = () => {
|
4241
4238
|
h.forEach((v, b) => {
|
4242
4239
|
v.dispose();
|
4243
4240
|
const M = u.get(b);
|
4244
4241
|
M !== void 0 && (m.remove(M), M.dispose()), u.delete(b), h.delete(b);
|
4245
4242
|
}), h.clear(), u.clear();
|
4246
|
-
},
|
4243
|
+
}, Ye = () => {
|
4247
4244
|
switch (U) {
|
4248
4245
|
case "Single":
|
4249
4246
|
re(X, ce.current);
|
@@ -4296,7 +4293,7 @@ function zi(e) {
|
|
4296
4293
|
}
|
4297
4294
|
});
|
4298
4295
|
}, M = (C) => {
|
4299
|
-
p.add(A), v(),
|
4296
|
+
p.add(A), v(), Tt(Te), m.remove(Te);
|
4300
4297
|
const x = e.scenes.get(C.value.name);
|
4301
4298
|
if (x !== void 0) {
|
4302
4299
|
const G = new x();
|
@@ -4373,7 +4370,7 @@ function zi(e) {
|
|
4373
4370
|
}
|
4374
4371
|
ve = requestAnimationFrame(ne);
|
4375
4372
|
};
|
4376
|
-
return
|
4373
|
+
return Ye(), window.addEventListener("resize", le), le(), ne(), () => {
|
4377
4374
|
window.removeEventListener("resize", le), cancelAnimationFrame(ve), ve = -1;
|
4378
4375
|
};
|
4379
4376
|
}, [U, O]), Re(() => {
|
@@ -4394,7 +4391,7 @@ function zi(e) {
|
|
4394
4391
|
break;
|
4395
4392
|
}
|
4396
4393
|
}, N = (C) => {
|
4397
|
-
if (!
|
4394
|
+
if (!St)
|
4398
4395
|
return;
|
4399
4396
|
const x = new me();
|
4400
4397
|
O.getSize(x);
|
@@ -4420,7 +4417,7 @@ function zi(e) {
|
|
4420
4417
|
const Je = v.intersectObjects(Te.children);
|
4421
4418
|
Je.length > 0 && F.position.copy(Je[0].point);
|
4422
4419
|
}, ve = (C) => {
|
4423
|
-
if (!
|
4420
|
+
if (!St)
|
4424
4421
|
return;
|
4425
4422
|
const x = new me();
|
4426
4423
|
if (O.getSize(x), C.clientX >= x.x)
|
@@ -4483,12 +4480,12 @@ function zi(e) {
|
|
4483
4480
|
] }),
|
4484
4481
|
/* @__PURE__ */ l.jsxs("div", { className: "settings", children: [
|
4485
4482
|
/* @__PURE__ */ l.jsx(
|
4486
|
-
|
4483
|
+
Mt,
|
4487
4484
|
{
|
4488
4485
|
index: pe.indexOf(U),
|
4489
4486
|
options: pe,
|
4490
4487
|
onSelect: (v) => {
|
4491
|
-
v !== U && (
|
4488
|
+
v !== U && (He(), ye(v));
|
4492
4489
|
},
|
4493
4490
|
open: De,
|
4494
4491
|
onToggle: (v) => {
|
@@ -4497,13 +4494,13 @@ function zi(e) {
|
|
4497
4494
|
}
|
4498
4495
|
),
|
4499
4496
|
/* @__PURE__ */ l.jsx(
|
4500
|
-
|
4497
|
+
Mt,
|
4501
4498
|
{
|
4502
|
-
index: te.indexOf(
|
4499
|
+
index: te.indexOf(xt),
|
4503
4500
|
options: te,
|
4504
4501
|
onSelect: (v) => {
|
4505
|
-
if (v !==
|
4506
|
-
switch (
|
4502
|
+
if (v !== xt)
|
4503
|
+
switch (xt = v, xt) {
|
4507
4504
|
case "Depth":
|
4508
4505
|
m.overrideMaterial = V;
|
4509
4506
|
break;
|
@@ -4529,7 +4526,7 @@ function zi(e) {
|
|
4529
4526
|
}
|
4530
4527
|
),
|
4531
4528
|
/* @__PURE__ */ l.jsx(
|
4532
|
-
|
4529
|
+
Mt,
|
4533
4530
|
{
|
4534
4531
|
index: 0,
|
4535
4532
|
options: [
|
@@ -4537,7 +4534,7 @@ function zi(e) {
|
|
4537
4534
|
"Selection Mode"
|
4538
4535
|
],
|
4539
4536
|
onSelect: (v) => {
|
4540
|
-
|
4537
|
+
St = v === "Selection Mode", F.visible = St;
|
4541
4538
|
},
|
4542
4539
|
open: Ie,
|
4543
4540
|
onToggle: (v) => {
|
@@ -4561,11 +4558,11 @@ export {
|
|
4561
4558
|
ji as Application,
|
4562
4559
|
Rt as BaseRemote,
|
4563
4560
|
Un as ChildObject,
|
4564
|
-
|
4561
|
+
Ya as ContainerObject,
|
4565
4562
|
Ga as Draggable,
|
4566
4563
|
za as DraggableItem,
|
4567
4564
|
Wa as Dropdown,
|
4568
|
-
|
4565
|
+
Ha as DropdownItem,
|
4569
4566
|
Gi as Editor,
|
4570
4567
|
bi as Inspector,
|
4571
4568
|
zi as MultiView,
|
@@ -4578,12 +4575,12 @@ export {
|
|
4578
4575
|
$i as SceneInspector,
|
4579
4576
|
Ui as SidePanel,
|
4580
4577
|
P as ToolEvents,
|
4581
|
-
|
4578
|
+
Ot as capitalize,
|
4582
4579
|
Ke as clamp,
|
4583
4580
|
Da as colorToHex,
|
4584
4581
|
D as debugDispatcher,
|
4585
4582
|
Di as defaultTheatreCallback,
|
4586
|
-
|
4583
|
+
Tt as dispose,
|
4587
4584
|
Pa as disposeMaterial,
|
4588
4585
|
Ai as disposeTexture,
|
4589
4586
|
Pi as distance,
|