@tomorrowevening/hermes 0.0.107 → 0.0.108
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/hermes.cjs.js +14 -14
- package/dist/hermes.es.js +408 -392
- package/package.json +1 -1
- package/types/core/remote/RemoteTheatre.d.ts +24 -24
- package/types/editor/multiView/MultiView.d.ts +115 -115
- package/types/editor/sidePanel/inspector/utils/InspectTransform.d.ts +27 -27
- package/types/editor/tools/Transform.d.ts +23 -21
package/dist/hermes.es.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
import { OrthographicCamera as wi, Scene as
|
2
|
-
import
|
3
|
-
import { Reorder as
|
4
|
-
const
|
1
|
+
import { OrthographicCamera as wi, Scene as Ds, MeshBasicMaterial as We, BufferGeometry as lt, Float32BufferAttribute as Ze, Mesh as w, LinearSRGBColorSpace as $i, EventDispatcher as Rs, Texture as In, RepeatWrapping as qi, WebGLRenderTarget as Ln, Color as Tt, FrontSide as kn, BackSide as Is, DoubleSide as Ri, NoBlending as Un, NormalBlending as jn, AdditiveBlending as Nn, SubtractiveBlending as Fn, MultiplyBlending as zn, CustomBlending as Hn, AddEquation as Yn, SubtractEquation as Bn, ReverseSubtractEquation as Vn, MinEquation as Zn, MaxEquation as Gn, ZeroFactor as Ls, OneFactor as ks, SrcColorFactor as Us, OneMinusSrcColorFactor as js, SrcAlphaFactor as Ns, OneMinusSrcAlphaFactor as Fs, DstAlphaFactor as zs, OneMinusDstAlphaFactor as Hs, DstColorFactor as Ys, OneMinusDstColorFactor as Bs, SrcAlphaSaturateFactor as Wn, ConstantColorFactor as Vs, OneMinusConstantColorFactor as Zs, ConstantAlphaFactor as Gs, OneMinusConstantAlphaFactor as Ws, Line as xe, LineBasicMaterial as Ii, Ray as Xn, Plane as Qn, MathUtils as $n, Vector3 as O, Controls as Xs, MOUSE as ot, TOUCH as rt, Quaternion as fe, Spherical as Si, Vector2 as oe, ShaderMaterial as Qs, GLSL3 as qn, PlaneGeometry as $s, Raycaster as Xt, Euler as qs, Matrix4 as Kt, Object3D as ct, CylinderGeometry as de, BoxGeometry as ae, OctahedronGeometry as kt, SphereGeometry as Ks, TorusGeometry as ut, CatmullRomCurve3 as Ki, Group as Kn, AxesHelper as Ji, MeshDepthMaterial as Jn, MeshNormalMaterial as ea, WebGLRenderer as ta, PerspectiveCamera as hi, CameraHelper as ia, SkinnedMesh as sa, SpotLightHelper as na, PointLightHelper as aa, HemisphereLightHelper as ra, DirectionalLightHelper as oa, Clock as la, Vector4 as ca, Box3 as ha, Sphere as da } from "three";
|
2
|
+
import Js, { useState as Z, useRef as ee, useEffect as Xe, useMemo as Ot, Component as Jt, createRef as Ie, forwardRef as ua } from "react";
|
3
|
+
import { Reorder as en } from "framer-motion";
|
4
|
+
const tn = () => {
|
5
5
|
}, Zr = () => {
|
6
6
|
};
|
7
7
|
function Qt(i) {
|
@@ -11,10 +11,10 @@ function pa(i) {
|
|
11
11
|
const e = JSON.stringify(i);
|
12
12
|
return navigator.clipboard.writeText(e), e;
|
13
13
|
}
|
14
|
-
function
|
14
|
+
function Be(i, e, t) {
|
15
15
|
return Math.min(e, Math.max(i, t));
|
16
16
|
}
|
17
|
-
function
|
17
|
+
function es(i, e, t) {
|
18
18
|
return (t - i) / (e - i);
|
19
19
|
}
|
20
20
|
function xi(i, e, t) {
|
@@ -30,7 +30,7 @@ function ma() {
|
|
30
30
|
function fa(i) {
|
31
31
|
return i.r !== void 0 && i.g !== void 0 && i.b !== void 0;
|
32
32
|
}
|
33
|
-
function
|
33
|
+
function ts(i) {
|
34
34
|
const e = Math.round(i.r * 255), t = Math.round(i.g * 255), s = Math.round(i.b * 255), n = (c) => {
|
35
35
|
const l = c.toString(16);
|
36
36
|
return l.length === 1 ? "0" + l : l;
|
@@ -41,7 +41,7 @@ function be(i, e = 1) {
|
|
41
41
|
return Number(i.toFixed(e));
|
42
42
|
}
|
43
43
|
let Oi = 0;
|
44
|
-
const
|
44
|
+
const is = () => {
|
45
45
|
Oi = 0;
|
46
46
|
}, Ti = (i) => {
|
47
47
|
if (!i)
|
@@ -63,11 +63,11 @@ const ts = () => {
|
|
63
63
|
i?.dispose();
|
64
64
|
}, ga = (i) => {
|
65
65
|
i && (Array.isArray(i) ? i.forEach((e) => e.dispose()) : i.dispose());
|
66
|
-
},
|
66
|
+
}, Le = (i) => {
|
67
67
|
if (i) {
|
68
68
|
for (; i.children.length > 0; ) {
|
69
69
|
const e = i.children[0];
|
70
|
-
e.type === "Audio" ? (e.pause(), e.parent && e.parent.remove(e)) :
|
70
|
+
e.type === "Audio" ? (e.pause(), e.parent && e.parent.remove(e)) : Le(e);
|
71
71
|
}
|
72
72
|
if (i.parent && i.parent.remove(i), i.isMesh) {
|
73
73
|
const e = i;
|
@@ -105,9 +105,9 @@ class Zt {
|
|
105
105
|
}
|
106
106
|
static renderToCanvas(e) {
|
107
107
|
if (this.material === null) {
|
108
|
-
this.camera = new wi(-0.5, 0.5, 0.5, -0.5, 0, 100), this.scene = new
|
108
|
+
this.camera = new wi(-0.5, 0.5, 0.5, -0.5, 0, 100), this.scene = new Ds(), this.material = new We();
|
109
109
|
const t = new lt();
|
110
|
-
t.setAttribute("position", new
|
110
|
+
t.setAttribute("position", new Ze([-0.5, -0.5, 0, 1.5, -0.5, 0, -0.5, 1.5, 0], 3)), t.setAttribute("normal", new Ze([0, 0, 1, 0, 0, 1], 3)), t.setAttribute("uv", new Ze([0, 0, 2, 0, 0, 2], 2));
|
111
111
|
const s = new w(t, this.material);
|
112
112
|
this.scene.add(s);
|
113
113
|
}
|
@@ -115,7 +115,7 @@ class Zt {
|
|
115
115
|
this.material.map = e, this.renderer.render(this.scene, this.camera);
|
116
116
|
else {
|
117
117
|
const t = this.renderer.outputColorSpace, s = e.colorSpace;
|
118
|
-
this.renderer.outputColorSpace =
|
118
|
+
this.renderer.outputColorSpace = $i, e.colorSpace = $i, this.material.map = e, this.renderer.render(this.scene, this.camera), this.renderer.outputColorSpace = t, e.colorSpace = s;
|
119
119
|
}
|
120
120
|
return this.renderer.domElement;
|
121
121
|
}
|
@@ -179,8 +179,8 @@ class Xr {
|
|
179
179
|
}
|
180
180
|
}
|
181
181
|
var A = /* @__PURE__ */ ((i) => (i.CUSTOM = "ToolEvents::custom", i.SELECT_DROPDOWN = "ToolEvents::selectDropdown", i.DRAG_UPDATE = "ToolEvents::dragUpdate", i.ADD_SCENE = "ToolEvents::addScene", i.REFRESH_SCENE = "ToolEvents::refreshScene", i.REMOVE_SCENE = "ToolEvents::removeScene", i.SET_SCENE = "ToolEvents::setScene", i.GET_OBJECT = "ToolEvents::getObject", i.SET_OBJECT = "ToolEvents::setObject", i.UPDATE_OBJECT = "ToolEvents::updateObject", i.CREATE_TEXTURE = "ToolEvents::createTexture", i.REQUEST_METHOD = "ToolEvents::requestMethod", i.ADD_CAMERA = "ToolEvents::addCamera", i.REMOVE_CAMERA = "ToolEvents::removeCamera", i.ADD_GROUP = "ToolEvents::addGroup", i.REMOVE_GROUP = "ToolEvents::removeGroup", i.ADD_SPLINE = "ToolEvents::addSpline", i))(A || {});
|
182
|
-
const D = new
|
183
|
-
class
|
182
|
+
const D = new Rs();
|
183
|
+
class Li {
|
184
184
|
app;
|
185
185
|
constructor(e) {
|
186
186
|
this.app = e;
|
@@ -192,7 +192,7 @@ class Ii {
|
|
192
192
|
handleEditor(e, t, s) {
|
193
193
|
}
|
194
194
|
}
|
195
|
-
class Qr extends
|
195
|
+
class Qr extends Li {
|
196
196
|
selectDropdown(e, t) {
|
197
197
|
this.app.send({
|
198
198
|
event: "selectComponent",
|
@@ -276,7 +276,7 @@ function _a() {
|
|
276
276
|
const s = i?.children[3];
|
277
277
|
s.style.top = "0", s.style.right = "300px";
|
278
278
|
}
|
279
|
-
class qr extends
|
279
|
+
class qr extends Li {
|
280
280
|
project;
|
281
281
|
sheets = /* @__PURE__ */ new Map();
|
282
282
|
sheetObjects = /* @__PURE__ */ new Map();
|
@@ -338,7 +338,7 @@ class qr extends Ii {
|
|
338
338
|
return;
|
339
339
|
const c = `${this.getSheetInstance(e, r)}_${t}`;
|
340
340
|
let l = this.sheetObjects.get(c);
|
341
|
-
l !== void 0 ? l = a.object(t, { ...s, ...l.value }, { reconfigure: !0 }) : l = a.object(t, s), this.sheetObjects.set(c, l), this.sheetObjectCBs.set(c, n !== void 0 ? n :
|
341
|
+
l !== void 0 ? l = a.object(t, { ...s, ...l.value }, { reconfigure: !0 }) : l = a.object(t, s), this.sheetObjects.set(c, l), this.sheetObjectCBs.set(c, n !== void 0 ? n : tn);
|
342
342
|
const u = l.onValuesChange((p) => {
|
343
343
|
if (this.app.editor) {
|
344
344
|
for (const _ in p) {
|
@@ -676,16 +676,16 @@ function K(i, e, t) {
|
|
676
676
|
a != null && Ca(a, t);
|
677
677
|
}
|
678
678
|
}
|
679
|
-
function
|
679
|
+
function sn(i) {
|
680
680
|
return new Promise((e, t) => {
|
681
681
|
const s = new Image();
|
682
682
|
s.onload = () => {
|
683
683
|
const n = new In(s);
|
684
|
-
n.wrapS =
|
684
|
+
n.wrapS = qi, n.wrapT = qi, n.needsUpdate = !0, e(n);
|
685
685
|
}, s.onerror = t, s.src = i;
|
686
686
|
});
|
687
687
|
}
|
688
|
-
class Kr extends
|
688
|
+
class Kr extends Li {
|
689
689
|
scene = void 0;
|
690
690
|
scenes = /* @__PURE__ */ new Map();
|
691
691
|
renderer = void 0;
|
@@ -693,8 +693,8 @@ class Kr extends Ii {
|
|
693
693
|
groups = /* @__PURE__ */ new Map();
|
694
694
|
dispose() {
|
695
695
|
this.scenes.forEach((e) => {
|
696
|
-
|
697
|
-
}), this.scenes.clear(), this.scene &&
|
696
|
+
Le(e);
|
697
|
+
}), this.scenes.clear(), this.scene && Le(this.scene), this.renderTargets.forEach((e) => {
|
698
698
|
e.dispose();
|
699
699
|
}), this.renderTargets.clear(), this.renderer?.dispose();
|
700
700
|
}
|
@@ -796,7 +796,7 @@ class Kr extends Ii {
|
|
796
796
|
addScene(e) {
|
797
797
|
if (e === void 0 || (this.scenes.set(e.name, e), !this.app.debugEnabled))
|
798
798
|
return;
|
799
|
-
|
799
|
+
is(), Ti(e);
|
800
800
|
const t = at(e);
|
801
801
|
this.app.send({
|
802
802
|
event: "addScene",
|
@@ -839,7 +839,7 @@ class Kr extends Ii {
|
|
839
839
|
setScene(e) {
|
840
840
|
if (e === void 0 || (this.scene = e, !this.app.debugEnabled))
|
841
841
|
return;
|
842
|
-
this.renderer !== void 0 && (Zt.renderer = this.renderer),
|
842
|
+
this.renderer !== void 0 && (Zt.renderer = this.renderer), is(), Ti(e);
|
843
843
|
const t = at(e);
|
844
844
|
this.app.send({
|
845
845
|
event: "setScene",
|
@@ -942,7 +942,7 @@ class Kr extends Ii {
|
|
942
942
|
}), this.renderer?.setSize(e, t);
|
943
943
|
}
|
944
944
|
set dpr(e) {
|
945
|
-
this.renderer?.setPixelRatio(
|
945
|
+
this.renderer?.setPixelRatio(Be(1, 2, e));
|
946
946
|
}
|
947
947
|
get dpr() {
|
948
948
|
return this.renderer !== void 0 ? this.renderer?.getPixelRatio() : 1;
|
@@ -967,12 +967,12 @@ var Mi = { exports: {} }, pt = {};
|
|
967
967
|
* This source code is licensed under the MIT license found in the
|
968
968
|
* LICENSE file in the root directory of this source tree.
|
969
969
|
*/
|
970
|
-
var
|
970
|
+
var ss;
|
971
971
|
function wa() {
|
972
|
-
if (
|
972
|
+
if (ss)
|
973
973
|
return pt;
|
974
|
-
|
975
|
-
var i =
|
974
|
+
ss = 1;
|
975
|
+
var i = Js, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, n = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, r = { key: !0, ref: !0, __self: !0, __source: !0 };
|
976
976
|
function a(o, c, l) {
|
977
977
|
var u, p = {}, m = null, _ = null;
|
978
978
|
l !== void 0 && (m = "" + l), c.key !== void 0 && (m = "" + c.key), c.ref !== void 0 && (_ = c.ref);
|
@@ -995,10 +995,10 @@ var mt = {};
|
|
995
995
|
* This source code is licensed under the MIT license found in the
|
996
996
|
* LICENSE file in the root directory of this source tree.
|
997
997
|
*/
|
998
|
-
var
|
998
|
+
var ns;
|
999
999
|
function Sa() {
|
1000
|
-
return
|
1001
|
-
var i =
|
1000
|
+
return ns || (ns = 1, process.env.NODE_ENV !== "production" && function() {
|
1001
|
+
var i = Js, e = Symbol.for("react.element"), t = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), r = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), o = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), u = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), _ = Symbol.for("react.offscreen"), S = Symbol.iterator, T = "@@iterator";
|
1002
1002
|
function M(h) {
|
1003
1003
|
if (h === null || typeof h != "object")
|
1004
1004
|
return null;
|
@@ -1087,14 +1087,14 @@ function Sa() {
|
|
1087
1087
|
}
|
1088
1088
|
return null;
|
1089
1089
|
}
|
1090
|
-
var te = Object.assign, Q = 0,
|
1090
|
+
var te = Object.assign, Q = 0, ke, he, Te, se, Ue, je, Ne;
|
1091
1091
|
function Mt() {
|
1092
1092
|
}
|
1093
1093
|
Mt.__reactDisabledLog = !0;
|
1094
1094
|
function Pt() {
|
1095
1095
|
{
|
1096
1096
|
if (Q === 0) {
|
1097
|
-
|
1097
|
+
ke = console.log, he = console.info, Te = console.warn, se = console.error, Ue = console.group, je = console.groupCollapsed, Ne = console.groupEnd;
|
1098
1098
|
var h = {
|
1099
1099
|
configurable: !0,
|
1100
1100
|
enumerable: !0,
|
@@ -1124,10 +1124,10 @@ function Sa() {
|
|
1124
1124
|
};
|
1125
1125
|
Object.defineProperties(console, {
|
1126
1126
|
log: te({}, h, {
|
1127
|
-
value:
|
1127
|
+
value: ke
|
1128
1128
|
}),
|
1129
1129
|
info: te({}, h, {
|
1130
|
-
value:
|
1130
|
+
value: he
|
1131
1131
|
}),
|
1132
1132
|
warn: te({}, h, {
|
1133
1133
|
value: Te
|
@@ -1136,13 +1136,13 @@ function Sa() {
|
|
1136
1136
|
value: se
|
1137
1137
|
}),
|
1138
1138
|
group: te({}, h, {
|
1139
|
-
value:
|
1139
|
+
value: Ue
|
1140
1140
|
}),
|
1141
1141
|
groupCollapsed: te({}, h, {
|
1142
|
-
value:
|
1142
|
+
value: je
|
1143
1143
|
}),
|
1144
1144
|
groupEnd: te({}, h, {
|
1145
|
-
value:
|
1145
|
+
value: Ne
|
1146
1146
|
})
|
1147
1147
|
});
|
1148
1148
|
}
|
@@ -1168,7 +1168,7 @@ function Sa() {
|
|
1168
1168
|
var hn = typeof WeakMap == "function" ? WeakMap : Map;
|
1169
1169
|
Dt = new hn();
|
1170
1170
|
}
|
1171
|
-
function
|
1171
|
+
function Ui(h, y) {
|
1172
1172
|
if (!h || ni)
|
1173
1173
|
return "";
|
1174
1174
|
{
|
@@ -1217,14 +1217,14 @@ function Sa() {
|
|
1217
1217
|
} catch (Me) {
|
1218
1218
|
if (Me && I && typeof Me.stack == "string") {
|
1219
1219
|
for (var k = Me.stack.split(`
|
1220
|
-
`),
|
1221
|
-
`), $ = k.length - 1, J =
|
1220
|
+
`), le = I.stack.split(`
|
1221
|
+
`), $ = k.length - 1, J = le.length - 1; $ >= 1 && J >= 0 && k[$] !== le[J]; )
|
1222
1222
|
J--;
|
1223
1223
|
for (; $ >= 1 && J >= 0; $--, J--)
|
1224
|
-
if (k[$] !==
|
1224
|
+
if (k[$] !== le[J]) {
|
1225
1225
|
if ($ !== 1 || J !== 1)
|
1226
1226
|
do
|
1227
|
-
if ($--, J--, J < 0 || k[$] !==
|
1227
|
+
if ($--, J--, J < 0 || k[$] !== le[J]) {
|
1228
1228
|
var _e = `
|
1229
1229
|
` + k[$].replace(" at new ", " at ");
|
1230
1230
|
return h.displayName && _e.includes("<anonymous>") && (_e = _e.replace("<anonymous>", h.displayName)), typeof h == "function" && Dt.set(h, _e), _e;
|
@@ -1236,11 +1236,11 @@ function Sa() {
|
|
1236
1236
|
} finally {
|
1237
1237
|
ni = !1, ii.current = Y, cn(), Error.prepareStackTrace = F;
|
1238
1238
|
}
|
1239
|
-
var qe = h ? h.displayName || h.name : "",
|
1240
|
-
return typeof h == "function" && Dt.set(h,
|
1239
|
+
var qe = h ? h.displayName || h.name : "", Qi = qe ? At(qe) : "";
|
1240
|
+
return typeof h == "function" && Dt.set(h, Qi), Qi;
|
1241
1241
|
}
|
1242
1242
|
function dn(h, y, C) {
|
1243
|
-
return
|
1243
|
+
return Ui(h, !1);
|
1244
1244
|
}
|
1245
1245
|
function un(h) {
|
1246
1246
|
var y = h.prototype;
|
@@ -1250,7 +1250,7 @@ function Sa() {
|
|
1250
1250
|
if (h == null)
|
1251
1251
|
return "";
|
1252
1252
|
if (typeof h == "function")
|
1253
|
-
return
|
1253
|
+
return Ui(h, un(h));
|
1254
1254
|
if (typeof h == "string")
|
1255
1255
|
return At(h);
|
1256
1256
|
switch (h) {
|
@@ -1275,13 +1275,13 @@ function Sa() {
|
|
1275
1275
|
}
|
1276
1276
|
return "";
|
1277
1277
|
}
|
1278
|
-
var It = Object.prototype.hasOwnProperty,
|
1278
|
+
var It = Object.prototype.hasOwnProperty, ji = {}, Ni = g.ReactDebugCurrentFrame;
|
1279
1279
|
function Lt(h) {
|
1280
1280
|
if (h) {
|
1281
1281
|
var y = h._owner, C = Rt(h.type, h._source, y ? y.type : null);
|
1282
|
-
|
1282
|
+
Ni.setExtraStackFrame(C);
|
1283
1283
|
} else
|
1284
|
-
|
1284
|
+
Ni.setExtraStackFrame(null);
|
1285
1285
|
}
|
1286
1286
|
function pn(h, y, C, I, F) {
|
1287
1287
|
{
|
@@ -1291,14 +1291,14 @@ function Sa() {
|
|
1291
1291
|
var k = void 0;
|
1292
1292
|
try {
|
1293
1293
|
if (typeof h[U] != "function") {
|
1294
|
-
var
|
1295
|
-
throw
|
1294
|
+
var le = Error((I || "React class") + ": " + C + " type `" + U + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof h[U] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
1295
|
+
throw le.name = "Invariant Violation", le;
|
1296
1296
|
}
|
1297
1297
|
k = h[U](y, U, I, C, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
1298
1298
|
} catch ($) {
|
1299
1299
|
k = $;
|
1300
1300
|
}
|
1301
|
-
k && !(k instanceof Error) && (Lt(F), v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", I || "React class", C, U, typeof k), Lt(null)), k instanceof Error && !(k.message in
|
1301
|
+
k && !(k instanceof Error) && (Lt(F), v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", I || "React class", C, U, typeof k), Lt(null)), k instanceof Error && !(k.message in ji) && (ji[k.message] = !0, Lt(F), v("Failed %s type: %s", C, k.message), Lt(null));
|
1302
1302
|
}
|
1303
1303
|
}
|
1304
1304
|
}
|
@@ -1314,24 +1314,24 @@ function Sa() {
|
|
1314
1314
|
}
|
1315
1315
|
function gn(h) {
|
1316
1316
|
try {
|
1317
|
-
return
|
1317
|
+
return Fi(h), !1;
|
1318
1318
|
} catch {
|
1319
1319
|
return !0;
|
1320
1320
|
}
|
1321
1321
|
}
|
1322
|
-
function
|
1322
|
+
function Fi(h) {
|
1323
1323
|
return "" + h;
|
1324
1324
|
}
|
1325
|
-
function
|
1325
|
+
function zi(h) {
|
1326
1326
|
if (gn(h))
|
1327
|
-
return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", fn(h)),
|
1327
|
+
return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", fn(h)), Fi(h);
|
1328
1328
|
}
|
1329
1329
|
var dt = g.ReactCurrentOwner, _n = {
|
1330
1330
|
key: !0,
|
1331
1331
|
ref: !0,
|
1332
1332
|
__self: !0,
|
1333
1333
|
__source: !0
|
1334
|
-
},
|
1334
|
+
}, Hi, Yi, ri;
|
1335
1335
|
ri = {};
|
1336
1336
|
function vn(h) {
|
1337
1337
|
if (It.call(h, "ref")) {
|
@@ -1358,7 +1358,7 @@ function Sa() {
|
|
1358
1358
|
function En(h, y) {
|
1359
1359
|
{
|
1360
1360
|
var C = function() {
|
1361
|
-
|
1361
|
+
Hi || (Hi = !0, v("%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)", y));
|
1362
1362
|
};
|
1363
1363
|
C.isReactWarning = !0, Object.defineProperty(h, "key", {
|
1364
1364
|
get: C,
|
@@ -1369,7 +1369,7 @@ function Sa() {
|
|
1369
1369
|
function Cn(h, y) {
|
1370
1370
|
{
|
1371
1371
|
var C = function() {
|
1372
|
-
|
1372
|
+
Yi || (Yi = !0, v("%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)", y));
|
1373
1373
|
};
|
1374
1374
|
C.isReactWarning = !0, Object.defineProperty(h, "ref", {
|
1375
1375
|
get: C,
|
@@ -1408,8 +1408,8 @@ function Sa() {
|
|
1408
1408
|
};
|
1409
1409
|
function Sn(h, y, C, I, F) {
|
1410
1410
|
{
|
1411
|
-
var Y, U = {}, k = null,
|
1412
|
-
C !== void 0 && (
|
1411
|
+
var Y, U = {}, k = null, le = null;
|
1412
|
+
C !== void 0 && (zi(C), k = "" + C), yn(y) && (zi(y.key), k = "" + y.key), vn(y) && (le = y.ref, bn(y, F));
|
1413
1413
|
for (Y in y)
|
1414
1414
|
It.call(y, Y) && !_n.hasOwnProperty(Y) && (U[Y] = y[Y]);
|
1415
1415
|
if (h && h.defaultProps) {
|
@@ -1417,27 +1417,27 @@ function Sa() {
|
|
1417
1417
|
for (Y in $)
|
1418
1418
|
U[Y] === void 0 && (U[Y] = $[Y]);
|
1419
1419
|
}
|
1420
|
-
if (k ||
|
1420
|
+
if (k || le) {
|
1421
1421
|
var J = typeof h == "function" ? h.displayName || h.name || "Unknown" : h;
|
1422
|
-
k && En(U, J),
|
1422
|
+
k && En(U, J), le && Cn(U, J);
|
1423
1423
|
}
|
1424
|
-
return wn(h, k,
|
1424
|
+
return wn(h, k, le, F, I, dt.current, U);
|
1425
1425
|
}
|
1426
1426
|
}
|
1427
|
-
var oi = g.ReactCurrentOwner,
|
1427
|
+
var oi = g.ReactCurrentOwner, Bi = g.ReactDebugCurrentFrame;
|
1428
1428
|
function $e(h) {
|
1429
1429
|
if (h) {
|
1430
1430
|
var y = h._owner, C = Rt(h.type, h._source, y ? y.type : null);
|
1431
|
-
|
1431
|
+
Bi.setExtraStackFrame(C);
|
1432
1432
|
} else
|
1433
|
-
|
1433
|
+
Bi.setExtraStackFrame(null);
|
1434
1434
|
}
|
1435
1435
|
var li;
|
1436
1436
|
li = !1;
|
1437
1437
|
function ci(h) {
|
1438
1438
|
return typeof h == "object" && h !== null && h.$$typeof === e;
|
1439
1439
|
}
|
1440
|
-
function
|
1440
|
+
function Vi() {
|
1441
1441
|
{
|
1442
1442
|
if (oi.current) {
|
1443
1443
|
var h = me(oi.current.type);
|
@@ -1460,10 +1460,10 @@ Check your code at ` + y + ":" + C + ".";
|
|
1460
1460
|
return "";
|
1461
1461
|
}
|
1462
1462
|
}
|
1463
|
-
var
|
1463
|
+
var Zi = {};
|
1464
1464
|
function On(h) {
|
1465
1465
|
{
|
1466
|
-
var y =
|
1466
|
+
var y = Vi();
|
1467
1467
|
if (!y) {
|
1468
1468
|
var C = typeof h == "string" ? h : h.displayName || h.name;
|
1469
1469
|
C && (y = `
|
@@ -1473,27 +1473,27 @@ Check the top-level render call using <` + C + ">.");
|
|
1473
1473
|
return y;
|
1474
1474
|
}
|
1475
1475
|
}
|
1476
|
-
function
|
1476
|
+
function Gi(h, y) {
|
1477
1477
|
{
|
1478
1478
|
if (!h._store || h._store.validated || h.key != null)
|
1479
1479
|
return;
|
1480
1480
|
h._store.validated = !0;
|
1481
1481
|
var C = On(y);
|
1482
|
-
if (
|
1482
|
+
if (Zi[C])
|
1483
1483
|
return;
|
1484
|
-
|
1484
|
+
Zi[C] = !0;
|
1485
1485
|
var I = "";
|
1486
1486
|
h && h._owner && h._owner !== oi.current && (I = " It was passed a child from " + me(h._owner.type) + "."), $e(h), v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', C, I), $e(null);
|
1487
1487
|
}
|
1488
1488
|
}
|
1489
|
-
function
|
1489
|
+
function Wi(h, y) {
|
1490
1490
|
{
|
1491
1491
|
if (typeof h != "object")
|
1492
1492
|
return;
|
1493
1493
|
if (ai(h))
|
1494
1494
|
for (var C = 0; C < h.length; C++) {
|
1495
1495
|
var I = h[C];
|
1496
|
-
ci(I) &&
|
1496
|
+
ci(I) && Gi(I, y);
|
1497
1497
|
}
|
1498
1498
|
else if (ci(h))
|
1499
1499
|
h._store && (h._store.validated = !0);
|
@@ -1501,7 +1501,7 @@ Check the top-level render call using <` + C + ">.");
|
|
1501
1501
|
var F = M(h);
|
1502
1502
|
if (typeof F == "function" && F !== h.entries)
|
1503
1503
|
for (var Y = F.call(h), U; !(U = Y.next()).done; )
|
1504
|
-
ci(U.value) &&
|
1504
|
+
ci(U.value) && Gi(U.value, y);
|
1505
1505
|
}
|
1506
1506
|
}
|
1507
1507
|
}
|
@@ -1542,14 +1542,14 @@ Check the top-level render call using <` + C + ">.");
|
|
1542
1542
|
h.ref !== null && ($e(h), v("Invalid attribute `ref` supplied to `React.Fragment`."), $e(null));
|
1543
1543
|
}
|
1544
1544
|
}
|
1545
|
-
function
|
1545
|
+
function Xi(h, y, C, I, F, Y) {
|
1546
1546
|
{
|
1547
1547
|
var U = Ae(h);
|
1548
1548
|
if (!U) {
|
1549
1549
|
var k = "";
|
1550
1550
|
(h === void 0 || typeof h == "object" && h !== null && Object.keys(h).length === 0) && (k += " 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
|
1552
|
-
|
1551
|
+
var le = xn(F);
|
1552
|
+
le ? k += le : k += Vi();
|
1553
1553
|
var $;
|
1554
1554
|
h === null ? $ = "null" : ai(h) ? $ = "array" : h !== void 0 && h.$$typeof === e ? ($ = "<" + (me(h.type) || "Unknown") + " />", k = " Did you accidentally export a JSX literal instead of a component?") : $ = typeof h, v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", $, k);
|
1555
1555
|
}
|
@@ -1562,21 +1562,21 @@ Check the top-level render call using <` + C + ">.");
|
|
1562
1562
|
if (I)
|
1563
1563
|
if (ai(_e)) {
|
1564
1564
|
for (var qe = 0; qe < _e.length; qe++)
|
1565
|
-
|
1565
|
+
Wi(_e[qe], h);
|
1566
1566
|
Object.freeze && Object.freeze(_e);
|
1567
1567
|
} else
|
1568
1568
|
v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
1569
1569
|
else
|
1570
|
-
|
1570
|
+
Wi(_e, h);
|
1571
1571
|
}
|
1572
1572
|
return h === s ? Mn(J) : Tn(J), J;
|
1573
1573
|
}
|
1574
1574
|
}
|
1575
1575
|
function Pn(h, y, C) {
|
1576
|
-
return
|
1576
|
+
return Xi(h, y, C, !0);
|
1577
1577
|
}
|
1578
1578
|
function An(h, y, C) {
|
1579
|
-
return
|
1579
|
+
return Xi(h, y, C, !1);
|
1580
1580
|
}
|
1581
1581
|
var Dn = An, Rn = Pn;
|
1582
1582
|
mt.Fragment = s, mt.jsx = Dn, mt.jsxs = Rn;
|
@@ -1584,7 +1584,7 @@ Check the top-level render call using <` + C + ">.");
|
|
1584
1584
|
}
|
1585
1585
|
process.env.NODE_ENV === "production" ? Mi.exports = wa() : Mi.exports = Sa();
|
1586
1586
|
var d = Mi.exports;
|
1587
|
-
function
|
1587
|
+
function nn(i) {
|
1588
1588
|
return i.title.search("<") > -1 ? /* @__PURE__ */ d.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: i.title } }) : /* @__PURE__ */ d.jsx("button", { children: i.title });
|
1589
1589
|
}
|
1590
1590
|
const xa = /* @__PURE__ */ d.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
|
@@ -1600,7 +1600,7 @@ C11,8.22,10.74,8,10.43,8z`
|
|
1600
1600
|
}
|
1601
1601
|
) });
|
1602
1602
|
function Ta(i) {
|
1603
|
-
return /* @__PURE__ */ d.jsx(
|
1603
|
+
return /* @__PURE__ */ d.jsx(en.Item, { value: i.title, children: /* @__PURE__ */ d.jsxs("div", { children: [
|
1604
1604
|
Oa,
|
1605
1605
|
/* @__PURE__ */ d.jsx("span", { children: i.title }),
|
1606
1606
|
/* @__PURE__ */ d.jsx("button", { className: "closeIcon", onClick: () => {
|
@@ -1620,8 +1620,8 @@ function Ma(i) {
|
|
1620
1620
|
});
|
1621
1621
|
let c = "dropdown draggable";
|
1622
1622
|
return i.subdropdown && (c += " subdropdown"), /* @__PURE__ */ d.jsxs("div", { className: c, onMouseEnter: () => t(!0), onMouseLeave: () => t(!1), children: [
|
1623
|
-
/* @__PURE__ */ d.jsx(
|
1624
|
-
/* @__PURE__ */ d.jsx(
|
1623
|
+
/* @__PURE__ */ d.jsx(nn, { title: i.title }),
|
1624
|
+
/* @__PURE__ */ d.jsx(en.Group, { axis: "y", values: s, onReorder: r, style: { visibility: e ? "visible" : "hidden" }, children: o })
|
1625
1625
|
] });
|
1626
1626
|
}
|
1627
1627
|
function Pa(i) {
|
@@ -1637,7 +1637,7 @@ function Pa(i) {
|
|
1637
1637
|
onMouseEnter: () => t(!0),
|
1638
1638
|
onMouseLeave: () => t(!1),
|
1639
1639
|
children: [
|
1640
|
-
/* @__PURE__ */ d.jsx(
|
1640
|
+
/* @__PURE__ */ d.jsx(nn, { title: i.title }),
|
1641
1641
|
/* @__PURE__ */ d.jsx(
|
1642
1642
|
"ul",
|
1643
1643
|
{
|
@@ -1747,10 +1747,10 @@ function $t(i) {
|
|
1747
1747
|
/* @__PURE__ */ d.jsx("div", { className: e ? "open" : "", children: /* @__PURE__ */ d.jsx("div", { children: i.children }) }, Math.random())
|
1748
1748
|
] });
|
1749
1749
|
}
|
1750
|
-
function
|
1750
|
+
function an(i) {
|
1751
1751
|
const e = ee(null), [t, s] = Z(!1), n = i.child !== void 0 && i.child.children.length > 0, r = [];
|
1752
1752
|
return i.child !== void 0 && i.child.children.length > 0 && i.child.children.map((a, o) => {
|
1753
|
-
r.push(/* @__PURE__ */ d.jsx(
|
1753
|
+
r.push(/* @__PURE__ */ d.jsx(an, { child: a, three: i.three }, o));
|
1754
1754
|
}), Xe(() => {
|
1755
1755
|
if (i.child) {
|
1756
1756
|
const a = i.three.getScene(i.child.uuid);
|
@@ -1810,10 +1810,10 @@ function nn(i) {
|
|
1810
1810
|
/* @__PURE__ */ d.jsx("div", { className: t ? "open" : "", children: /* @__PURE__ */ d.jsx("div", { className: "container", children: r }) })
|
1811
1811
|
] }, Math.random()) });
|
1812
1812
|
}
|
1813
|
-
function
|
1813
|
+
function as(i) {
|
1814
1814
|
const e = [];
|
1815
1815
|
return i.child?.children.map((t, s) => {
|
1816
|
-
e.push(/* @__PURE__ */ d.jsx(
|
1816
|
+
e.push(/* @__PURE__ */ d.jsx(an, { child: t, scene: i.scene, three: i.three }, s));
|
1817
1817
|
}), /* @__PURE__ */ d.jsx("div", { className: `scene ${i.class !== void 0 ? i.class : ""}`, children: e });
|
1818
1818
|
}
|
1819
1819
|
function Da(i) {
|
@@ -1841,7 +1841,7 @@ function Da(i) {
|
|
1841
1841
|
};
|
1842
1842
|
}, []), e;
|
1843
1843
|
}
|
1844
|
-
function
|
1844
|
+
function Ge(i) {
|
1845
1845
|
const e = ee(null), t = ee(null), s = Da({
|
1846
1846
|
label: i.labelRef,
|
1847
1847
|
input: e,
|
@@ -1898,7 +1898,7 @@ function Ze(i) {
|
|
1898
1898
|
max: i.max,
|
1899
1899
|
step: i.step,
|
1900
1900
|
ref: t,
|
1901
|
-
onChange:
|
1901
|
+
onChange: tn
|
1902
1902
|
}
|
1903
1903
|
)
|
1904
1904
|
] })
|
@@ -1916,7 +1916,7 @@ function Ra(i) {
|
|
1916
1916
|
window.removeEventListener("mousemove", T), window.removeEventListener("mouseup", S), m(!1);
|
1917
1917
|
}
|
1918
1918
|
function T(b) {
|
1919
|
-
const P = r.current.getBoundingClientRect(), x =
|
1919
|
+
const P = r.current.getBoundingClientRect(), x = Be(0, 99, b.clientX - P.left) / 99, j = Be(0, 99, b.clientY - P.top) / 99, X = be(xi(l.min, l.max, x), 3), ge = be(xi(l.min, l.max, j), 3);
|
1920
1920
|
i.onChange({ target: { value: { x: X, y: ge } } }), c({ x: X, y: ge });
|
1921
1921
|
}
|
1922
1922
|
function M(b) {
|
@@ -1925,14 +1925,14 @@ function Ra(i) {
|
|
1925
1925
|
}
|
1926
1926
|
function g() {
|
1927
1927
|
const b = Number(s.current.value);
|
1928
|
-
u({ min: b, max: l.max }), (o.x < b || o.y < b) && c({ x:
|
1928
|
+
u({ min: b, max: l.max }), (o.x < b || o.y < b) && c({ x: Be(b, l.max, o.x), y: Be(b, l.max, o.y) });
|
1929
1929
|
}
|
1930
1930
|
function v() {
|
1931
1931
|
const b = Number(n.current.value);
|
1932
|
-
u({ min: l.min, max: b }), (o.x > b || o.y > b) && c({ x:
|
1932
|
+
u({ min: l.min, max: b }), (o.x > b || o.y > b) && c({ x: Be(l.min, b, o.x), y: Be(l.min, b, o.y) });
|
1933
1933
|
}
|
1934
1934
|
Xe(() => {
|
1935
|
-
const b =
|
1935
|
+
const b = es(l.min, l.max, o.x), P = es(l.min, l.max, o.y);
|
1936
1936
|
a.current.style.left = `${b * 100}%`, a.current.style.top = `${P * 100}%`;
|
1937
1937
|
}, [l, o]);
|
1938
1938
|
const E = i.step !== void 0 ? i.step : 0.01;
|
@@ -2015,7 +2015,7 @@ function Pi(i) {
|
|
2015
2015
|
function ka(i) {
|
2016
2016
|
return i * La;
|
2017
2017
|
}
|
2018
|
-
function
|
2018
|
+
function rs(i) {
|
2019
2019
|
const e = i.value.x !== void 0 && i.value.y !== void 0 && i.value.z !== void 0, t = i.value.isEuler !== void 0, s = i.value.elements !== void 0, n = i.step !== void 0 ? i.step : 0.01, r = [];
|
2020
2020
|
if (t) {
|
2021
2021
|
const a = Ot(() => i.value, []);
|
@@ -2025,7 +2025,7 @@ function as(i) {
|
|
2025
2025
|
/* @__PURE__ */ d.jsxs("div", { children: [
|
2026
2026
|
/* @__PURE__ */ d.jsx("label", { ref: l, children: c.substring(1).toUpperCase() }),
|
2027
2027
|
/* @__PURE__ */ d.jsx(
|
2028
|
-
|
2028
|
+
Ge,
|
2029
2029
|
{
|
2030
2030
|
value: ka(a[c]),
|
2031
2031
|
type: "number",
|
@@ -2050,7 +2050,7 @@ function as(i) {
|
|
2050
2050
|
/* @__PURE__ */ d.jsxs("div", { children: [
|
2051
2051
|
/* @__PURE__ */ d.jsx("label", { ref: u, children: l.toUpperCase() }),
|
2052
2052
|
/* @__PURE__ */ d.jsx(
|
2053
|
-
|
2053
|
+
Ge,
|
2054
2054
|
{
|
2055
2055
|
value: a[l],
|
2056
2056
|
type: "number",
|
@@ -2074,7 +2074,7 @@ function as(i) {
|
|
2074
2074
|
/* @__PURE__ */ d.jsxs("div", { children: [
|
2075
2075
|
/* @__PURE__ */ d.jsx("label", { ref: l, children: c + 1 }),
|
2076
2076
|
/* @__PURE__ */ d.jsx(
|
2077
|
-
|
2077
|
+
Ge,
|
2078
2078
|
{
|
2079
2079
|
value: a.elements[c],
|
2080
2080
|
type: "number",
|
@@ -2102,7 +2102,7 @@ function Ua(i) {
|
|
2102
2102
|
/* @__PURE__ */ d.jsxs("div", { children: [
|
2103
2103
|
/* @__PURE__ */ d.jsx("label", { ref: c, children: o.toUpperCase() }),
|
2104
2104
|
/* @__PURE__ */ d.jsx(
|
2105
|
-
|
2105
|
+
Ge,
|
2106
2106
|
{
|
2107
2107
|
value: n.x,
|
2108
2108
|
type: "number",
|
@@ -2126,7 +2126,7 @@ function Ua(i) {
|
|
2126
2126
|
/* @__PURE__ */ d.jsxs("div", { children: [
|
2127
2127
|
/* @__PURE__ */ d.jsx("label", { ref: o, children: a + 1 }),
|
2128
2128
|
/* @__PURE__ */ d.jsx(
|
2129
|
-
|
2129
|
+
Ge,
|
2130
2130
|
{
|
2131
2131
|
value: n.elements[a],
|
2132
2132
|
type: "number",
|
@@ -2397,7 +2397,7 @@ function ei(i) {
|
|
2397
2397
|
}
|
2398
2398
|
return i;
|
2399
2399
|
}
|
2400
|
-
function
|
2400
|
+
function rn(i) {
|
2401
2401
|
const e = i.toLowerCase();
|
2402
2402
|
return e.search("intensity") > -1 || e === "anisotropyrotation" || e === "blendalpha" || e === "bumpscale" || e === "clearcoatroughness" || e === "displacementbias" || e === "displacementscale" || e === "metalness" || e === "opacity" || e === "reflectivity" || e === "refractionratio" || e === "roughness" || e === "sheenroughness";
|
2403
2403
|
}
|
@@ -2423,11 +2423,11 @@ const za = [
|
|
2423
2423
|
},
|
2424
2424
|
{
|
2425
2425
|
title: "Back",
|
2426
|
-
value:
|
2426
|
+
value: Is
|
2427
2427
|
},
|
2428
2428
|
{
|
2429
2429
|
title: "Double",
|
2430
|
-
value:
|
2430
|
+
value: Ri
|
2431
2431
|
}
|
2432
2432
|
], Ha = [
|
2433
2433
|
{
|
@@ -2478,43 +2478,43 @@ const za = [
|
|
2478
2478
|
], Ba = [
|
2479
2479
|
{
|
2480
2480
|
title: "Zero",
|
2481
|
-
value:
|
2481
|
+
value: Ls
|
2482
2482
|
},
|
2483
2483
|
{
|
2484
2484
|
title: "One",
|
2485
|
-
value:
|
2485
|
+
value: ks
|
2486
2486
|
},
|
2487
2487
|
{
|
2488
2488
|
title: "Src Color",
|
2489
|
-
value:
|
2489
|
+
value: Us
|
2490
2490
|
},
|
2491
2491
|
{
|
2492
2492
|
title: "One Minus Src Color",
|
2493
|
-
value:
|
2493
|
+
value: js
|
2494
2494
|
},
|
2495
2495
|
{
|
2496
2496
|
title: "Src Alpha",
|
2497
|
-
value:
|
2497
|
+
value: Ns
|
2498
2498
|
},
|
2499
2499
|
{
|
2500
2500
|
title: "One Minus Src Alpha",
|
2501
|
-
value:
|
2501
|
+
value: Fs
|
2502
2502
|
},
|
2503
2503
|
{
|
2504
2504
|
title: "Dst Alpha",
|
2505
|
-
value:
|
2505
|
+
value: zs
|
2506
2506
|
},
|
2507
2507
|
{
|
2508
2508
|
title: "One Minus Dst Alpha",
|
2509
|
-
value:
|
2509
|
+
value: Hs
|
2510
2510
|
},
|
2511
2511
|
{
|
2512
2512
|
title: "Dst Color",
|
2513
|
-
value:
|
2513
|
+
value: Ys
|
2514
2514
|
},
|
2515
2515
|
{
|
2516
2516
|
title: "One Minus Dst Color",
|
2517
|
-
value:
|
2517
|
+
value: Bs
|
2518
2518
|
},
|
2519
2519
|
{
|
2520
2520
|
title: "Src Alpha Saturate",
|
@@ -2522,76 +2522,76 @@ const za = [
|
|
2522
2522
|
},
|
2523
2523
|
{
|
2524
2524
|
title: "Constant Color",
|
2525
|
-
value:
|
2525
|
+
value: Vs
|
2526
2526
|
},
|
2527
2527
|
{
|
2528
2528
|
title: "One Minus Constant Color",
|
2529
|
-
value:
|
2529
|
+
value: Zs
|
2530
2530
|
},
|
2531
2531
|
{
|
2532
2532
|
title: "Constant Alpha",
|
2533
|
-
value:
|
2533
|
+
value: Gs
|
2534
2534
|
},
|
2535
2535
|
{
|
2536
2536
|
title: "One Minus Constant Alpha",
|
2537
|
-
value:
|
2537
|
+
value: Ws
|
2538
2538
|
}
|
2539
2539
|
], Va = [
|
2540
2540
|
{
|
2541
2541
|
title: "Zero",
|
2542
|
-
value:
|
2542
|
+
value: Ls
|
2543
2543
|
},
|
2544
2544
|
{
|
2545
2545
|
title: "One",
|
2546
|
-
value:
|
2546
|
+
value: ks
|
2547
2547
|
},
|
2548
2548
|
{
|
2549
2549
|
title: "Src Color",
|
2550
|
-
value:
|
2550
|
+
value: Us
|
2551
2551
|
},
|
2552
2552
|
{
|
2553
2553
|
title: "One Minus Src Color",
|
2554
|
-
value:
|
2554
|
+
value: js
|
2555
2555
|
},
|
2556
2556
|
{
|
2557
2557
|
title: "Src Alpha",
|
2558
|
-
value:
|
2558
|
+
value: Ns
|
2559
2559
|
},
|
2560
2560
|
{
|
2561
2561
|
title: "One Minus Src Alpha",
|
2562
|
-
value:
|
2562
|
+
value: Fs
|
2563
2563
|
},
|
2564
2564
|
{
|
2565
2565
|
title: "Dst Alpha",
|
2566
|
-
value:
|
2566
|
+
value: zs
|
2567
2567
|
},
|
2568
2568
|
{
|
2569
2569
|
title: "One Minus Dst Alpha",
|
2570
|
-
value:
|
2570
|
+
value: Hs
|
2571
2571
|
},
|
2572
2572
|
{
|
2573
2573
|
title: "Dst Color",
|
2574
|
-
value:
|
2574
|
+
value: Ys
|
2575
2575
|
},
|
2576
2576
|
{
|
2577
2577
|
title: "One Minus Dst Color",
|
2578
|
-
value:
|
2578
|
+
value: Bs
|
2579
2579
|
},
|
2580
2580
|
{
|
2581
2581
|
title: "Constant Color",
|
2582
|
-
value:
|
2582
|
+
value: Vs
|
2583
2583
|
},
|
2584
2584
|
{
|
2585
2585
|
title: "One Minus Constant Color",
|
2586
|
-
value:
|
2586
|
+
value: Zs
|
2587
2587
|
},
|
2588
2588
|
{
|
2589
2589
|
title: "Constant Alpha",
|
2590
|
-
value:
|
2590
|
+
value: Gs
|
2591
2591
|
},
|
2592
2592
|
{
|
2593
2593
|
title: "One Minus Constant Alpha",
|
2594
|
-
value:
|
2594
|
+
value: Ws
|
2595
2595
|
}
|
2596
2596
|
];
|
2597
2597
|
function ft(i, e) {
|
@@ -2650,7 +2650,7 @@ function Ga(i, e, t, s) {
|
|
2650
2650
|
ft(n, za);
|
2651
2651
|
break;
|
2652
2652
|
}
|
2653
|
-
return
|
2653
|
+
return rn(i) && (n.value = Number(e), n.type = "range", n.min = Math.min(0, n.value), n.max = Math.max(1, n.value), n.step = 0.01), n;
|
2654
2654
|
}
|
2655
2655
|
function Wa(i, e, t, s) {
|
2656
2656
|
const n = {
|
@@ -2735,7 +2735,7 @@ function wt(i, e, t, s, n = "", r = !1) {
|
|
2735
2735
|
}
|
2736
2736
|
}
|
2737
2737
|
};
|
2738
|
-
return
|
2738
|
+
return rn(a) && (l.type = "range", l.min = 0, l.max = 1), l;
|
2739
2739
|
} else {
|
2740
2740
|
if (e.isColor)
|
2741
2741
|
return {
|
@@ -2870,7 +2870,7 @@ function wt(i, e, t, s, n = "", r = !1) {
|
|
2870
2870
|
}
|
2871
2871
|
g.needsUpdate = !0;
|
2872
2872
|
};
|
2873
|
-
u.src.length > 0 ?
|
2873
|
+
u.src.length > 0 ? sn(u.src).then((M) => {
|
2874
2874
|
M.offset.set(u.offset[0], u.offset[1]), M.repeat.set(u.repeat[0], u.repeat[1]), T(M);
|
2875
2875
|
}) : T(null);
|
2876
2876
|
}
|
@@ -2919,7 +2919,7 @@ function wt(i, e, t, s, n = "", r = !1) {
|
|
2919
2919
|
}
|
2920
2920
|
}
|
2921
2921
|
}
|
2922
|
-
function
|
2922
|
+
function os(i, e, t) {
|
2923
2923
|
const s = [];
|
2924
2924
|
for (const n in i) {
|
2925
2925
|
if (!ja(n))
|
@@ -2967,7 +2967,7 @@ function qa(i, e) {
|
|
2967
2967
|
Ee,
|
2968
2968
|
{
|
2969
2969
|
title: `Material ${l}`,
|
2970
|
-
items:
|
2970
|
+
items: os(a[l], i, e)
|
2971
2971
|
},
|
2972
2972
|
`Material ${l}`
|
2973
2973
|
)
|
@@ -2978,7 +2978,7 @@ function qa(i, e) {
|
|
2978
2978
|
Ee,
|
2979
2979
|
{
|
2980
2980
|
title: "Material",
|
2981
|
-
items:
|
2981
|
+
items: os(a, i, e),
|
2982
2982
|
expanded: n,
|
2983
2983
|
onToggle: (o) => {
|
2984
2984
|
r(o);
|
@@ -2986,7 +2986,7 @@ function qa(i, e) {
|
|
2986
2986
|
}
|
2987
2987
|
);
|
2988
2988
|
}
|
2989
|
-
const
|
2989
|
+
const ls = "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==";
|
2990
2990
|
function Ka(i) {
|
2991
2991
|
const e = i.step !== void 0 ? i.step : 0.01, t = ee(null), s = ee(null), n = ee(null), r = ee(null), a = ee(null), [o] = Z(i.value), [c, l] = Z(i.value.offset[0]), [u, p] = Z(i.value.offset[1]), [m, _] = Z(i.value.repeat[0]), [S, T] = Z(i.value.repeat[1]);
|
2992
2992
|
function M(v, E, b, P, x) {
|
@@ -3021,7 +3021,7 @@ function Ka(i) {
|
|
3021
3021
|
Fa().then((v) => {
|
3022
3022
|
t.current.src = v, M(v, c, u, m, S);
|
3023
3023
|
});
|
3024
|
-
}, src: o.src.length > 0 ? o.src :
|
3024
|
+
}, src: o.src.length > 0 ? o.src : ls }),
|
3025
3025
|
/* @__PURE__ */ d.jsxs("div", { className: "fields", children: [
|
3026
3026
|
/* @__PURE__ */ d.jsxs("div", { children: [
|
3027
3027
|
/* @__PURE__ */ d.jsx("label", { children: "Offset:" }),
|
@@ -3070,14 +3070,14 @@ function Ka(i) {
|
|
3070
3070
|
)
|
3071
3071
|
] }),
|
3072
3072
|
/* @__PURE__ */ d.jsx("button", { onClick: () => {
|
3073
|
-
M("", c, u, m, S), t.current.src =
|
3073
|
+
M("", c, u, m, S), t.current.src = ls;
|
3074
3074
|
}, children: "Clear" })
|
3075
3075
|
] })
|
3076
3076
|
] });
|
3077
3077
|
}
|
3078
3078
|
function Gt(i) {
|
3079
3079
|
let e = i.value;
|
3080
|
-
e !== void 0 && (e.isColor !== void 0 ? e =
|
3080
|
+
e !== void 0 && (e.isColor !== void 0 ? e = ts(i.value) : i.type === "color" && (e = ts(new Tt(i.value))));
|
3081
3081
|
const [t, s] = Z(e), n = ee(null), r = (l) => {
|
3082
3082
|
let u = l.target.value;
|
3083
3083
|
if (i.type === "boolean")
|
@@ -3126,7 +3126,7 @@ function Gt(i) {
|
|
3126
3126
|
}
|
3127
3127
|
),
|
3128
3128
|
i.type === "number" && /* @__PURE__ */ d.jsx(
|
3129
|
-
|
3129
|
+
Ge,
|
3130
3130
|
{
|
3131
3131
|
value: t,
|
3132
3132
|
type: i.type,
|
@@ -3140,7 +3140,7 @@ function Gt(i) {
|
|
3140
3140
|
}
|
3141
3141
|
),
|
3142
3142
|
i.type === "range" && /* @__PURE__ */ d.jsx(
|
3143
|
-
|
3143
|
+
Ge,
|
3144
3144
|
{
|
3145
3145
|
value: t,
|
3146
3146
|
type: i.type,
|
@@ -3170,9 +3170,9 @@ function Gt(i) {
|
|
3170
3170
|
i.type === "image" && /* @__PURE__ */ d.jsx(Ka, { title: i.title, prop: i.prop, value: i.value, onChange: i.onChange }),
|
3171
3171
|
i.type === "option" && /* @__PURE__ */ d.jsx(d.Fragment, { children: /* @__PURE__ */ d.jsx("select", { onChange: r, disabled: i.disabled, defaultValue: i.value, children: i.options?.map((l, u) => /* @__PURE__ */ d.jsx("option", { value: l.value, children: Qt(l.title) }, u)) }) }),
|
3172
3172
|
i.type === "vector2" && /* @__PURE__ */ d.jsx(Ra, { step: i.step, value: t, min: 0, max: 1, onChange: r }),
|
3173
|
-
i.type === "grid3" && /* @__PURE__ */ d.jsx(
|
3173
|
+
i.type === "grid3" && /* @__PURE__ */ d.jsx(rs, { step: i.step, value: t, onChange: r }),
|
3174
3174
|
i.type === "grid4" && /* @__PURE__ */ d.jsx(Ua, { step: i.step, value: t, onChange: r }),
|
3175
|
-
i.type === "euler" && /* @__PURE__ */ d.jsx(
|
3175
|
+
i.type === "euler" && /* @__PURE__ */ d.jsx(rs, { step: i.step, value: t, onChange: r })
|
3176
3176
|
] });
|
3177
3177
|
}
|
3178
3178
|
function Ja(i) {
|
@@ -3364,7 +3364,7 @@ class q extends Jt {
|
|
3364
3364
|
}
|
3365
3365
|
}
|
3366
3366
|
}
|
3367
|
-
function
|
3367
|
+
function cs(i) {
|
3368
3368
|
switch (i) {
|
3369
3369
|
case "fov":
|
3370
3370
|
return "FOV";
|
@@ -3405,7 +3405,7 @@ function er(i, e) {
|
|
3405
3405
|
if (i.perspectiveCameraInfo !== void 0)
|
3406
3406
|
for (const o in i.perspectiveCameraInfo)
|
3407
3407
|
a.push({
|
3408
|
-
title:
|
3408
|
+
title: cs(o),
|
3409
3409
|
prop: o,
|
3410
3410
|
type: "number",
|
3411
3411
|
step: 0.01,
|
@@ -3422,7 +3422,7 @@ function er(i, e) {
|
|
3422
3422
|
else if (i.orthographicCameraInfo !== void 0)
|
3423
3423
|
for (const o in i.orthographicCameraInfo)
|
3424
3424
|
a.push({
|
3425
|
-
title:
|
3425
|
+
title: cs(o),
|
3426
3426
|
prop: o,
|
3427
3427
|
type: "number",
|
3428
3428
|
step: 0.01,
|
@@ -3451,11 +3451,11 @@ function er(i, e) {
|
|
3451
3451
|
class tr extends xe {
|
3452
3452
|
constructor(e, t) {
|
3453
3453
|
const s = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0, 1, 1, 0], n = new lt();
|
3454
|
-
n.setAttribute("position", new
|
3455
|
-
const r = new
|
3454
|
+
n.setAttribute("position", new Ze(s, 3)), n.computeBoundingSphere();
|
3455
|
+
const r = new Ii({ fog: !1 });
|
3456
3456
|
super(n, r), this.light = e, this.color = t, this.type = "RectAreaLightHelper";
|
3457
3457
|
const a = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0], o = new lt();
|
3458
|
-
o.setAttribute("position", new
|
3458
|
+
o.setAttribute("position", new Ze(a, 3)), o.computeBoundingSphere(), this.add(new w(o, new We({ side: Is, fog: !1 })));
|
3459
3459
|
}
|
3460
3460
|
updateMatrixWorld() {
|
3461
3461
|
if (this.scale.set(0.5 * this.light.width, 0.5 * this.light.height, 1), this.color !== void 0)
|
@@ -3471,7 +3471,7 @@ class tr extends xe {
|
|
3471
3471
|
this.geometry.dispose(), this.material.dispose(), this.children[0].geometry.dispose(), this.children[0].material.dispose();
|
3472
3472
|
}
|
3473
3473
|
}
|
3474
|
-
const
|
3474
|
+
const hs = { type: "change" }, ki = { type: "start" }, on = { type: "end" }, Ut = new Xn(), ds = new Qn(), ir = Math.cos(70 * $n.DEG2RAD), ie = new O(), ue = 2 * Math.PI, H = {
|
3475
3475
|
NONE: -1,
|
3476
3476
|
ROTATE: 0,
|
3477
3477
|
DOLLY: 1,
|
@@ -3481,9 +3481,9 @@ const cs = { type: "change" }, Li = { type: "start" }, rn = { type: "end" }, Ut
|
|
3481
3481
|
TOUCH_DOLLY_PAN: 5,
|
3482
3482
|
TOUCH_DOLLY_ROTATE: 6
|
3483
3483
|
}, ui = 1e-6;
|
3484
|
-
class sr extends
|
3484
|
+
class sr extends Xs {
|
3485
3485
|
constructor(e, t = null) {
|
3486
|
-
super(e, t), this.state = H.NONE, this.enabled = !0, this.target = new O(), this.cursor = new O(), 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: ot.ROTATE, MIDDLE: ot.DOLLY, RIGHT: ot.PAN }, this.touches = { ONE: rt.ROTATE, TWO: rt.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new O(), this._lastQuaternion = new fe(), this._lastTargetPosition = new O(), this._quat = new fe().setFromUnitVectors(e.up, new O(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Si(), this._sphericalDelta = new Si(), this._scale = 1, this._panOffset = new O(), this._rotateStart = new
|
3486
|
+
super(e, t), this.state = H.NONE, this.enabled = !0, this.target = new O(), this.cursor = new O(), 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: ot.ROTATE, MIDDLE: ot.DOLLY, RIGHT: ot.PAN }, this.touches = { ONE: rt.ROTATE, TWO: rt.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new O(), this._lastQuaternion = new fe(), this._lastTargetPosition = new O(), this._quat = new fe().setFromUnitVectors(e.up, new O(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Si(), this._sphericalDelta = new Si(), this._scale = 1, this._panOffset = new O(), this._rotateStart = new oe(), this._rotateEnd = new oe(), this._rotateDelta = new oe(), this._panStart = new oe(), this._panEnd = new oe(), this._panDelta = new oe(), this._dollyStart = new oe(), this._dollyEnd = new oe(), this._dollyDelta = new oe(), this._dollyDirection = new O(), this._mouse = new oe(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = ar.bind(this), this._onPointerDown = nr.bind(this), this._onPointerUp = rr.bind(this), this._onContextMenu = pr.bind(this), this._onMouseWheel = cr.bind(this), this._onKeyDown = hr.bind(this), this._onTouchStart = dr.bind(this), this._onTouchMove = ur.bind(this), this._onMouseDown = or.bind(this), this._onMouseMove = lr.bind(this), this._interceptControlDown = mr.bind(this), this._interceptControlUp = fr.bind(this), this.domElement !== null && this.connect(), this.update();
|
3487
3487
|
}
|
3488
3488
|
connect() {
|
3489
3489
|
this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
|
@@ -3513,13 +3513,13 @@ class sr extends Ws {
|
|
3513
3513
|
this.target0.copy(this.target), this.position0.copy(this.object.position), this.zoom0 = this.object.zoom;
|
3514
3514
|
}
|
3515
3515
|
reset() {
|
3516
|
-
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(
|
3516
|
+
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(hs), this.update(), this.state = H.NONE;
|
3517
3517
|
}
|
3518
3518
|
update(e = null) {
|
3519
3519
|
const t = this.object.position;
|
3520
3520
|
ie.copy(t).sub(this.target), ie.applyQuaternion(this._quat), this._spherical.setFromVector3(ie), this.autoRotate && this.state === H.NONE && this._rotateLeft(this._getAutoRotationAngle(e)), this.enableDamping ? (this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor, this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor) : (this._spherical.theta += this._sphericalDelta.theta, this._spherical.phi += this._sphericalDelta.phi);
|
3521
3521
|
let s = this.minAzimuthAngle, n = this.maxAzimuthAngle;
|
3522
|
-
isFinite(s) && isFinite(n) && (s < -Math.PI ? s +=
|
3522
|
+
isFinite(s) && isFinite(n) && (s < -Math.PI ? s += ue : s > Math.PI && (s -= ue), n < -Math.PI ? n += ue : n > Math.PI && (n -= ue), s <= n ? this._spherical.theta = Math.max(s, Math.min(n, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (s + n) / 2 ? Math.max(s, this._spherical.theta) : Math.min(n, this._spherical.theta)), this._spherical.phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, this._spherical.phi)), this._spherical.makeSafe(), this.enableDamping === !0 ? this.target.addScaledVector(this._panOffset, this.dampingFactor) : this.target.add(this._panOffset), this.target.sub(this.cursor), this.target.clampLength(this.minTargetRadius, this.maxTargetRadius), this.target.add(this.cursor);
|
3523
3523
|
let r = !1;
|
3524
3524
|
if (this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera)
|
3525
3525
|
this._spherical.radius = this._clampDistance(this._spherical.radius);
|
@@ -3543,15 +3543,15 @@ class sr extends Ws {
|
|
3543
3543
|
l.unproject(this.object), this.object.position.sub(l).add(o), this.object.updateMatrixWorld(), a = ie.length();
|
3544
3544
|
} else
|
3545
3545
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
3546
|
-
a !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position) : (Ut.origin.copy(this.object.position), Ut.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Ut.direction)) < ir ? this.object.lookAt(this.target) : (
|
3546
|
+
a !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position) : (Ut.origin.copy(this.object.position), Ut.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Ut.direction)) < ir ? this.object.lookAt(this.target) : (ds.setFromNormalAndCoplanarPoint(this.object.up, this.target), Ut.intersectPlane(ds, this.target))));
|
3547
3547
|
} else if (this.object.isOrthographicCamera) {
|
3548
3548
|
const a = this.object.zoom;
|
3549
3549
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), a !== this.object.zoom && (this.object.updateProjectionMatrix(), r = !0);
|
3550
3550
|
}
|
3551
|
-
return this._scale = 1, this._performCursorZoom = !1, r || this._lastPosition.distanceToSquared(this.object.position) > ui || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > ui || this._lastTargetPosition.distanceToSquared(this.target) > ui ? (this.dispatchEvent(
|
3551
|
+
return this._scale = 1, this._performCursorZoom = !1, r || this._lastPosition.distanceToSquared(this.object.position) > ui || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > ui || this._lastTargetPosition.distanceToSquared(this.target) > ui ? (this.dispatchEvent(hs), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
|
3552
3552
|
}
|
3553
3553
|
_getAutoRotationAngle(e) {
|
3554
|
-
return e !== null ?
|
3554
|
+
return e !== null ? ue / 60 * this.autoRotateSpeed * e : ue / 60 / 60 * this.autoRotateSpeed;
|
3555
3555
|
}
|
3556
3556
|
_getZoomScale(e) {
|
3557
3557
|
const t = Math.abs(e * 0.01);
|
@@ -3611,7 +3611,7 @@ class sr extends Ws {
|
|
3611
3611
|
_handleMouseMoveRotate(e) {
|
3612
3612
|
this._rotateEnd.set(e.clientX, e.clientY), this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
|
3613
3613
|
const t = this.domElement;
|
3614
|
-
this._rotateLeft(
|
3614
|
+
this._rotateLeft(ue * this._rotateDelta.x / t.clientHeight), this._rotateUp(ue * this._rotateDelta.y / t.clientHeight), this._rotateStart.copy(this._rotateEnd), this.update();
|
3615
3615
|
}
|
3616
3616
|
_handleMouseMoveDolly(e) {
|
3617
3617
|
this._dollyEnd.set(e.clientX, e.clientY), this._dollyDelta.subVectors(this._dollyEnd, this._dollyStart), this._dollyDelta.y > 0 ? this._dollyOut(this._getZoomScale(this._dollyDelta.y)) : this._dollyDelta.y < 0 && this._dollyIn(this._getZoomScale(this._dollyDelta.y)), this._dollyStart.copy(this._dollyEnd), this.update();
|
@@ -3626,16 +3626,16 @@ class sr extends Ws {
|
|
3626
3626
|
let t = !1;
|
3627
3627
|
switch (e.code) {
|
3628
3628
|
case this.keys.UP:
|
3629
|
-
e.ctrlKey || e.metaKey || e.shiftKey ? this._rotateUp(
|
3629
|
+
e.ctrlKey || e.metaKey || e.shiftKey ? this._rotateUp(ue * this.rotateSpeed / this.domElement.clientHeight) : this._pan(0, this.keyPanSpeed), t = !0;
|
3630
3630
|
break;
|
3631
3631
|
case this.keys.BOTTOM:
|
3632
|
-
e.ctrlKey || e.metaKey || e.shiftKey ? this._rotateUp(-
|
3632
|
+
e.ctrlKey || e.metaKey || e.shiftKey ? this._rotateUp(-ue * this.rotateSpeed / this.domElement.clientHeight) : this._pan(0, -this.keyPanSpeed), t = !0;
|
3633
3633
|
break;
|
3634
3634
|
case this.keys.LEFT:
|
3635
|
-
e.ctrlKey || e.metaKey || e.shiftKey ? this._rotateLeft(
|
3635
|
+
e.ctrlKey || e.metaKey || e.shiftKey ? this._rotateLeft(ue * this.rotateSpeed / this.domElement.clientHeight) : this._pan(this.keyPanSpeed, 0), t = !0;
|
3636
3636
|
break;
|
3637
3637
|
case this.keys.RIGHT:
|
3638
|
-
e.ctrlKey || e.metaKey || e.shiftKey ? this._rotateLeft(-
|
3638
|
+
e.ctrlKey || e.metaKey || e.shiftKey ? this._rotateLeft(-ue * this.rotateSpeed / this.domElement.clientHeight) : this._pan(-this.keyPanSpeed, 0), t = !0;
|
3639
3639
|
break;
|
3640
3640
|
}
|
3641
3641
|
t && (e.preventDefault(), this.update());
|
@@ -3675,7 +3675,7 @@ class sr extends Ws {
|
|
3675
3675
|
}
|
3676
3676
|
this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
|
3677
3677
|
const t = this.domElement;
|
3678
|
-
this._rotateLeft(
|
3678
|
+
this._rotateLeft(ue * this._rotateDelta.x / t.clientHeight), this._rotateUp(ue * this._rotateDelta.y / t.clientHeight), this._rotateStart.copy(this._rotateEnd);
|
3679
3679
|
}
|
3680
3680
|
_handleTouchMovePan(e) {
|
3681
3681
|
if (this._pointers.length === 1)
|
@@ -3718,7 +3718,7 @@ class sr extends Ws {
|
|
3718
3718
|
}
|
3719
3719
|
_trackPointer(e) {
|
3720
3720
|
let t = this._pointerPositions[e.pointerId];
|
3721
|
-
t === void 0 && (t = new
|
3721
|
+
t === void 0 && (t = new oe(), this._pointerPositions[e.pointerId] = t), t.set(e.pageX, e.pageY);
|
3722
3722
|
}
|
3723
3723
|
_getSecondPointerPosition(e) {
|
3724
3724
|
const t = e.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
|
@@ -3751,7 +3751,7 @@ function ar(i) {
|
|
3751
3751
|
function rr(i) {
|
3752
3752
|
switch (this._removePointer(i), this._pointers.length) {
|
3753
3753
|
case 0:
|
3754
|
-
this.domElement.releasePointerCapture(i.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(
|
3754
|
+
this.domElement.releasePointerCapture(i.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(on), this.state = H.NONE;
|
3755
3755
|
break;
|
3756
3756
|
case 1:
|
3757
3757
|
const e = this._pointers[0], t = this._pointerPositions[e];
|
@@ -3805,7 +3805,7 @@ function or(i) {
|
|
3805
3805
|
default:
|
3806
3806
|
this.state = H.NONE;
|
3807
3807
|
}
|
3808
|
-
this.state !== H.NONE && this.dispatchEvent(
|
3808
|
+
this.state !== H.NONE && this.dispatchEvent(ki);
|
3809
3809
|
}
|
3810
3810
|
function lr(i) {
|
3811
3811
|
switch (this.state) {
|
@@ -3827,7 +3827,7 @@ function lr(i) {
|
|
3827
3827
|
}
|
3828
3828
|
}
|
3829
3829
|
function cr(i) {
|
3830
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !== H.NONE || (i.preventDefault(), this.dispatchEvent(
|
3830
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== H.NONE || (i.preventDefault(), this.dispatchEvent(ki), this._handleMouseWheel(this._customWheelEvent(i)), this.dispatchEvent(on));
|
3831
3831
|
}
|
3832
3832
|
function hr(i) {
|
3833
3833
|
this.enabled === !1 || this.enablePan === !1 || this._handleKeyDown(i);
|
@@ -3869,7 +3869,7 @@ function dr(i) {
|
|
3869
3869
|
default:
|
3870
3870
|
this.state = H.NONE;
|
3871
3871
|
}
|
3872
|
-
this.state !== H.NONE && this.dispatchEvent(
|
3872
|
+
this.state !== H.NONE && this.dispatchEvent(ki);
|
3873
3873
|
}
|
3874
3874
|
function ur(i) {
|
3875
3875
|
switch (this._trackPointer(i), this.state) {
|
@@ -3939,23 +3939,23 @@ const W = {
|
|
3939
3939
|
IN: 1,
|
3940
3940
|
OUT: -1
|
3941
3941
|
};
|
3942
|
-
function
|
3942
|
+
function Fe(i) {
|
3943
3943
|
return i.isPerspectiveCamera;
|
3944
3944
|
}
|
3945
3945
|
function Re(i) {
|
3946
3946
|
return i.isOrthographicCamera;
|
3947
3947
|
}
|
3948
|
-
const it = Math.PI * 2,
|
3948
|
+
const it = Math.PI * 2, us = Math.PI / 2, ln = 1e-5, gt = Math.PI / 180;
|
3949
3949
|
function ye(i, e, t) {
|
3950
3950
|
return Math.max(e, Math.min(t, i));
|
3951
3951
|
}
|
3952
|
-
function V(i, e =
|
3952
|
+
function V(i, e = ln) {
|
3953
3953
|
return Math.abs(i) < e;
|
3954
3954
|
}
|
3955
|
-
function z(i, e, t =
|
3955
|
+
function z(i, e, t = ln) {
|
3956
3956
|
return V(i - e, t);
|
3957
3957
|
}
|
3958
|
-
function
|
3958
|
+
function ps(i, e) {
|
3959
3959
|
return Math.round(i / e) * e;
|
3960
3960
|
}
|
3961
3961
|
function _t(i) {
|
@@ -3975,7 +3975,7 @@ function jt(i, e, t, s, n = 1 / 0, r) {
|
|
3975
3975
|
let _ = e + (l + m) * c;
|
3976
3976
|
return u - i > 0 == _ > u && (_ = u, t.value = (_ - u) / r), _;
|
3977
3977
|
}
|
3978
|
-
function
|
3978
|
+
function ms(i, e, t, s, n = 1 / 0, r, a) {
|
3979
3979
|
s = Math.max(1e-4, s);
|
3980
3980
|
const o = 2 / s, c = o * r, l = 1 / (1 + c + 0.48 * c * c + 0.235 * c * c * c);
|
3981
3981
|
let u = e.x, p = e.y, m = e.z, _ = i.x - u, S = i.y - p, T = i.z - m;
|
@@ -4064,7 +4064,7 @@ class gr {
|
|
4064
4064
|
}
|
4065
4065
|
var fi;
|
4066
4066
|
const _r = "2.9.0", Nt = 1 / 8, vr = /Mac/.test((fi = globalThis?.navigator) === null || fi === void 0 ? void 0 : fi.platform);
|
4067
|
-
let R,
|
4067
|
+
let R, fs, Ft, gi, pe, L, N, st, yt, Ce, we, ze, gs, _s, ve, bt, nt, vs, _i, ys, vi, yi, zt;
|
4068
4068
|
class Oe extends gr {
|
4069
4069
|
/**
|
4070
4070
|
* Injects THREE as the dependency. You can then proceed to use CameraControls.
|
@@ -4107,7 +4107,7 @@ class Oe extends gr {
|
|
4107
4107
|
* @category Statics
|
4108
4108
|
*/
|
4109
4109
|
static install(e) {
|
4110
|
-
R = e.THREE,
|
4110
|
+
R = e.THREE, fs = Object.freeze(new R.Vector3(0, 0, 0)), Ft = Object.freeze(new R.Vector3(0, 1, 0)), gi = Object.freeze(new R.Vector3(0, 0, 1)), pe = new R.Vector2(), L = new R.Vector3(), N = new R.Vector3(), st = new R.Vector3(), yt = new R.Vector3(), Ce = new R.Vector3(), we = new R.Vector3(), ze = new R.Vector3(), gs = new R.Vector3(), _s = new R.Vector3(), ve = new R.Spherical(), bt = new R.Spherical(), nt = new R.Box3(), vs = new R.Box3(), _i = new R.Sphere(), ys = new R.Quaternion(), vi = new R.Quaternion(), yi = new R.Matrix4(), zt = new R.Raycaster();
|
4111
4111
|
}
|
4112
4112
|
/**
|
4113
4113
|
* list all ACTIONs
|
@@ -4137,7 +4137,7 @@ class Oe extends gr {
|
|
4137
4137
|
super(), this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.minDistance = Number.EPSILON, this.maxDistance = 1 / 0, this.infinityDolly = !1, this.minZoom = 0.01, this.maxZoom = 1 / 0, this.smoothTime = 0.25, this.draggingSmoothTime = 0.125, this.maxSpeed = 1 / 0, this.azimuthRotateSpeed = 1, this.polarRotateSpeed = 1, this.dollySpeed = 1, this.dollyDragInverted = !1, this.truckSpeed = 2, this.dollyToCursor = !1, this.dragToOffset = !1, this.verticalDragToForward = !1, this.boundaryFriction = 0, this.restThreshold = 0.01, this.colliderMeshes = [], this.cancel = () => {
|
4138
4138
|
}, this._enabled = !0, this._state = f.NONE, this._viewport = null, this._changedDolly = 0, this._changedZoom = 0, this._hasRested = !0, this._boundaryEnclosesCamera = !1, this._needsUpdate = !0, this._updatedLastTime = !1, this._elementRect = new DOMRect(), this._isDragging = !1, this._dragNeedsUpdate = !0, this._activePointers = [], this._lockedPointer = null, this._interactiveArea = new DOMRect(0, 0, 1, 1), this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._isUserControllingOffset = !1, this._isUserControllingZoom = !1, this._lastDollyDirection = tt.NONE, this._thetaVelocity = { value: 0 }, this._phiVelocity = { value: 0 }, this._radiusVelocity = { value: 0 }, this._targetVelocity = new R.Vector3(), this._focalOffsetVelocity = new R.Vector3(), this._zoomVelocity = { value: 0 }, this._truckInternal = (g, v, E) => {
|
4139
4139
|
let b, P;
|
4140
|
-
if (
|
4140
|
+
if (Fe(this._camera)) {
|
4141
4141
|
const x = L.copy(this._camera.position).sub(this._target), j = this._camera.getEffectiveFOV() * gt, X = x.length() * Math.tan(j * 0.5);
|
4142
4142
|
b = this.truckSpeed * g * X / this._elementRect.height, P = this.truckSpeed * v * X / this._elementRect.height;
|
4143
4143
|
} else if (Re(this._camera)) {
|
@@ -4164,10 +4164,10 @@ class Oe extends gr {
|
|
4164
4164
|
left: f.ROTATE,
|
4165
4165
|
middle: f.DOLLY,
|
4166
4166
|
right: f.TRUCK,
|
4167
|
-
wheel:
|
4167
|
+
wheel: Fe(this._camera) ? f.DOLLY : Re(this._camera) ? f.ZOOM : f.NONE
|
4168
4168
|
}, this.touches = {
|
4169
4169
|
one: f.TOUCH_ROTATE,
|
4170
|
-
two:
|
4170
|
+
two: Fe(this._camera) ? f.TOUCH_DOLLY_TRUCK : Re(this._camera) ? f.TOUCH_ZOOM_TRUCK : f.NONE,
|
4171
4171
|
three: f.TOUCH_TRUCK
|
4172
4172
|
};
|
4173
4173
|
const s = new R.Vector2(), n = new R.Vector2(), r = new R.Vector2(), a = (g) => {
|
@@ -4286,8 +4286,8 @@ class Oe extends gr {
|
|
4286
4286
|
}, m = (g) => {
|
4287
4287
|
if (!this._enabled)
|
4288
4288
|
return;
|
4289
|
-
if (pi(this._activePointers,
|
4290
|
-
const E =
|
4289
|
+
if (pi(this._activePointers, pe), this._getClientRect(this._elementRect), s.copy(pe), n.copy(pe), this._activePointers.length >= 2) {
|
4290
|
+
const E = pe.x - this._activePointers[1].clientX, b = pe.y - this._activePointers[1].clientY, P = Math.sqrt(E * E + b * b);
|
4291
4291
|
r.set(0, P);
|
4292
4292
|
const x = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, j = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
|
4293
4293
|
n.set(x, j);
|
@@ -4312,21 +4312,21 @@ class Oe extends gr {
|
|
4312
4312
|
}, _ = () => {
|
4313
4313
|
if (!this._enabled || !this._dragNeedsUpdate)
|
4314
4314
|
return;
|
4315
|
-
this._dragNeedsUpdate = !1, pi(this._activePointers,
|
4316
|
-
const v = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, E = v ? -v.deltaX : n.x -
|
4317
|
-
if (n.copy(
|
4315
|
+
this._dragNeedsUpdate = !1, pi(this._activePointers, pe);
|
4316
|
+
const v = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, E = v ? -v.deltaX : n.x - pe.x, b = v ? -v.deltaY : n.y - pe.y;
|
4317
|
+
if (n.copy(pe), ((this._state & f.ROTATE) === f.ROTATE || (this._state & f.TOUCH_ROTATE) === f.TOUCH_ROTATE || (this._state & f.TOUCH_DOLLY_ROTATE) === f.TOUCH_DOLLY_ROTATE || (this._state & f.TOUCH_ZOOM_ROTATE) === f.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(E, b), this._isUserControllingRotate = !0), (this._state & f.DOLLY) === f.DOLLY || (this._state & f.ZOOM) === f.ZOOM) {
|
4318
4318
|
const P = this.dollyToCursor ? (s.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, x = this.dollyToCursor ? (s.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0, j = this.dollyDragInverted ? -1 : 1;
|
4319
4319
|
(this._state & f.DOLLY) === f.DOLLY ? (this._dollyInternal(j * b * Nt, P, x), this._isUserControllingDolly = !0) : (this._zoomInternal(j * b * Nt, P, x), this._isUserControllingZoom = !0);
|
4320
4320
|
}
|
4321
4321
|
if ((this._state & f.TOUCH_DOLLY) === f.TOUCH_DOLLY || (this._state & f.TOUCH_ZOOM) === f.TOUCH_ZOOM || (this._state & f.TOUCH_DOLLY_TRUCK) === f.TOUCH_DOLLY_TRUCK || (this._state & f.TOUCH_ZOOM_TRUCK) === f.TOUCH_ZOOM_TRUCK || (this._state & f.TOUCH_DOLLY_OFFSET) === f.TOUCH_DOLLY_OFFSET || (this._state & f.TOUCH_ZOOM_OFFSET) === f.TOUCH_ZOOM_OFFSET || (this._state & f.TOUCH_DOLLY_ROTATE) === f.TOUCH_DOLLY_ROTATE || (this._state & f.TOUCH_ZOOM_ROTATE) === f.TOUCH_ZOOM_ROTATE) {
|
4322
|
-
const P =
|
4322
|
+
const P = pe.x - this._activePointers[1].clientX, x = pe.y - this._activePointers[1].clientY, j = Math.sqrt(P * P + x * x), X = r.y - j;
|
4323
4323
|
r.set(0, j);
|
4324
4324
|
const ge = this.dollyToCursor ? (n.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, Ae = this.dollyToCursor ? (n.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
4325
4325
|
(this._state & f.TOUCH_DOLLY) === f.TOUCH_DOLLY || (this._state & f.TOUCH_DOLLY_ROTATE) === f.TOUCH_DOLLY_ROTATE || (this._state & f.TOUCH_DOLLY_TRUCK) === f.TOUCH_DOLLY_TRUCK || (this._state & f.TOUCH_DOLLY_OFFSET) === f.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(X * Nt, ge, Ae), this._isUserControllingDolly = !0) : (this._zoomInternal(X * Nt, ge, Ae), this._isUserControllingZoom = !0);
|
4326
4326
|
}
|
4327
4327
|
((this._state & f.TRUCK) === f.TRUCK || (this._state & f.TOUCH_TRUCK) === f.TOUCH_TRUCK || (this._state & f.TOUCH_DOLLY_TRUCK) === f.TOUCH_DOLLY_TRUCK || (this._state & f.TOUCH_ZOOM_TRUCK) === f.TOUCH_ZOOM_TRUCK) && (this._truckInternal(E, b, !1), this._isUserControllingTruck = !0), ((this._state & f.OFFSET) === f.OFFSET || (this._state & f.TOUCH_OFFSET) === f.TOUCH_OFFSET || (this._state & f.TOUCH_DOLLY_OFFSET) === f.TOUCH_DOLLY_OFFSET || (this._state & f.TOUCH_ZOOM_OFFSET) === f.TOUCH_ZOOM_OFFSET) && (this._truckInternal(E, b, !0), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
|
4328
4328
|
}, S = () => {
|
4329
|
-
pi(this._activePointers,
|
4329
|
+
pi(this._activePointers, pe), n.copy(pe), this._dragNeedsUpdate = !1, (this._activePointers.length === 0 || this._activePointers.length === 1 && this._activePointers[0] === this._lockedPointer) && (this._isDragging = !1), this._activePointers.length === 0 && this._domElement && (this._domElement.ownerDocument.removeEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c), this.dispatchEvent({ type: "controlend" }));
|
4330
4330
|
};
|
4331
4331
|
this.lockPointer = () => {
|
4332
4332
|
!this._enabled || !this._domElement || (this.cancel(), this._lockedPointer = {
|
@@ -4716,14 +4716,14 @@ class Oe extends gr {
|
|
4716
4716
|
fitToBox(e, t, { cover: s = !1, paddingLeft: n = 0, paddingRight: r = 0, paddingBottom: a = 0, paddingTop: o = 0 } = {}) {
|
4717
4717
|
const c = [], l = e.isBox3 ? nt.copy(e) : nt.setFromObject(e);
|
4718
4718
|
l.isEmpty() && (console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"), Promise.resolve());
|
4719
|
-
const u =
|
4719
|
+
const u = ps(this._sphericalEnd.theta, us), p = ps(this._sphericalEnd.phi, us);
|
4720
4720
|
c.push(this.rotateTo(u, p, t));
|
4721
|
-
const m = L.setFromSpherical(this._sphericalEnd).normalize(), _ =
|
4721
|
+
const m = L.setFromSpherical(this._sphericalEnd).normalize(), _ = ys.setFromUnitVectors(m, gi), S = z(Math.abs(m.y), 1);
|
4722
4722
|
S && _.multiply(vi.setFromAxisAngle(Ft, u)), _.multiply(this._yAxisUpSpaceInverse);
|
4723
|
-
const T =
|
4723
|
+
const T = vs.makeEmpty();
|
4724
4724
|
N.copy(l.min).applyQuaternion(_), T.expandByPoint(N), N.copy(l.min).setX(l.max.x).applyQuaternion(_), T.expandByPoint(N), N.copy(l.min).setY(l.max.y).applyQuaternion(_), T.expandByPoint(N), N.copy(l.max).setZ(l.min.z).applyQuaternion(_), T.expandByPoint(N), N.copy(l.min).setZ(l.max.z).applyQuaternion(_), T.expandByPoint(N), N.copy(l.max).setY(l.min.y).applyQuaternion(_), T.expandByPoint(N), N.copy(l.max).setX(l.min.x).applyQuaternion(_), T.expandByPoint(N), N.copy(l.max).applyQuaternion(_), T.expandByPoint(N), T.min.x -= n, T.min.y -= a, T.max.x += r, T.max.y += o, _.setFromUnitVectors(gi, m), S && _.premultiply(vi.invert()), _.premultiply(this._yAxisUpSpace);
|
4725
4725
|
const M = T.getSize(L), g = T.getCenter(N).applyQuaternion(_);
|
4726
|
-
if (
|
4726
|
+
if (Fe(this._camera)) {
|
4727
4727
|
const v = this.getDistanceToFitBox(M.x, M.y, M.z, s);
|
4728
4728
|
c.push(this.moveTo(g.x, g.y, g.z, t)), c.push(this.dollyTo(v, t)), c.push(this.setFocalOffset(0, 0, 0, t));
|
4729
4729
|
} else if (Re(this._camera)) {
|
@@ -4740,7 +4740,7 @@ class Oe extends gr {
|
|
4740
4740
|
*/
|
4741
4741
|
fitToSphere(e, t) {
|
4742
4742
|
const s = [], r = "isObject3D" in e ? Oe.createBoundingSphere(e, _i) : _i.copy(e);
|
4743
|
-
if (s.push(this.moveTo(r.center.x, r.center.y, r.center.z, t)),
|
4743
|
+
if (s.push(this.moveTo(r.center.x, r.center.y, r.center.z, t)), Fe(this._camera)) {
|
4744
4744
|
const a = this.getDistanceToFitSphere(r.radius);
|
4745
4745
|
s.push(this.dollyTo(a, t));
|
4746
4746
|
} else if (Re(this._camera)) {
|
@@ -4843,9 +4843,9 @@ class Oe extends gr {
|
|
4843
4843
|
* @category Methods
|
4844
4844
|
*/
|
4845
4845
|
setOrbitPoint(e, t, s) {
|
4846
|
-
this._camera.updateMatrixWorld(), Ce.setFromMatrixColumn(this._camera.matrixWorldInverse, 0), we.setFromMatrixColumn(this._camera.matrixWorldInverse, 1),
|
4846
|
+
this._camera.updateMatrixWorld(), Ce.setFromMatrixColumn(this._camera.matrixWorldInverse, 0), we.setFromMatrixColumn(this._camera.matrixWorldInverse, 1), ze.setFromMatrixColumn(this._camera.matrixWorldInverse, 2);
|
4847
4847
|
const n = L.set(e, t, s), r = n.distanceTo(this._camera.position), a = n.sub(this._camera.position);
|
4848
|
-
Ce.multiplyScalar(a.x), we.multiplyScalar(a.y),
|
4848
|
+
Ce.multiplyScalar(a.x), we.multiplyScalar(a.y), ze.multiplyScalar(a.z), L.copy(Ce).add(we).add(ze), L.z = L.z + r, this.dollyTo(r, !1), this.setFocalOffset(-L.x, L.y, -L.z, !1), this.moveTo(e, t, s, !1);
|
4849
4849
|
}
|
4850
4850
|
/**
|
4851
4851
|
* Set the boundary box that encloses the target of the camera. box3 is in THREE.Box3
|
@@ -5002,7 +5002,7 @@ class Oe extends gr {
|
|
5002
5002
|
* @category Methods
|
5003
5003
|
*/
|
5004
5004
|
update(e) {
|
5005
|
-
const t = this._sphericalEnd.theta - this._spherical.theta, s = this._sphericalEnd.phi - this._spherical.phi, n = this._sphericalEnd.radius - this._spherical.radius, r =
|
5005
|
+
const t = this._sphericalEnd.theta - this._spherical.theta, s = this._sphericalEnd.phi - this._spherical.phi, n = this._sphericalEnd.radius - this._spherical.radius, r = gs.subVectors(this._targetEnd, this._target), a = _s.subVectors(this._focalOffsetEnd, this._focalOffset), o = this._zoomEnd - this._zoom;
|
5006
5006
|
if (V(t))
|
5007
5007
|
this._thetaVelocity.value = 0, this._spherical.theta = this._sphericalEnd.theta;
|
5008
5008
|
else {
|
@@ -5025,13 +5025,13 @@ class Oe extends gr {
|
|
5025
5025
|
this._targetVelocity.set(0, 0, 0), this._target.copy(this._targetEnd);
|
5026
5026
|
else {
|
5027
5027
|
const p = this._isUserControllingTruck ? this.draggingSmoothTime : this.smoothTime;
|
5028
|
-
|
5028
|
+
ms(this._target, this._targetEnd, this._targetVelocity, p, this.maxSpeed, e, this._target), this._needsUpdate = !0;
|
5029
5029
|
}
|
5030
5030
|
if (V(a.x) && V(a.y) && V(a.z))
|
5031
5031
|
this._focalOffsetVelocity.set(0, 0, 0), this._focalOffset.copy(this._focalOffsetEnd);
|
5032
5032
|
else {
|
5033
5033
|
const p = this._isUserControllingOffset ? this.draggingSmoothTime : this.smoothTime;
|
5034
|
-
|
5034
|
+
ms(this._focalOffset, this._focalOffsetEnd, this._focalOffsetVelocity, p, this.maxSpeed, e, this._focalOffset), this._needsUpdate = !0;
|
5035
5035
|
}
|
5036
5036
|
if (V(o))
|
5037
5037
|
this._zoomVelocity.value = 0, this._zoom = this._zoomEnd;
|
@@ -5040,7 +5040,7 @@ class Oe extends gr {
|
|
5040
5040
|
this._zoom = jt(this._zoom, this._zoomEnd, this._zoomVelocity, p, 1 / 0, e);
|
5041
5041
|
}
|
5042
5042
|
if (this.dollyToCursor) {
|
5043
|
-
if (
|
5043
|
+
if (Fe(this._camera) && this._changedDolly !== 0) {
|
5044
5044
|
const p = this._spherical.radius - this._lastDistance, m = this._camera, _ = this._getCameraDirection(yt), S = L.copy(_).cross(m.up).normalize();
|
5045
5045
|
S.lengthSq() === 0 && (S.x = 1);
|
5046
5046
|
const T = N.crossVectors(S, _), M = this._sphericalEnd.radius * Math.tan(m.getEffectiveFOV() * gt * 0.5), v = (this._sphericalEnd.radius - p - this._sphericalEnd.radius) / this._sphericalEnd.radius, E = st.copy(this._targetEnd).add(S.multiplyScalar(this._dollyControlCoord.x * M * m.aspect)).add(T.multiplyScalar(this._dollyControlCoord.y * M)), b = L.copy(this._targetEnd).lerp(E, v), P = this._lastDollyDirection === tt.IN && this._spherical.radius <= this.minDistance, x = this._lastDollyDirection === tt.OUT && this.maxDistance <= this._spherical.radius;
|
@@ -5061,7 +5061,7 @@ class Oe extends gr {
|
|
5061
5061
|
}
|
5062
5062
|
this._camera.zoom !== this._zoom && (this._camera.zoom = this._zoom, this._camera.updateProjectionMatrix(), this._updateNearPlaneCorners(), this._needsUpdate = !0), this._dragNeedsUpdate = !0;
|
5063
5063
|
const c = this._collisionTest();
|
5064
|
-
this._spherical.radius = Math.min(this._spherical.radius, c), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!V(this._focalOffset.x) || !V(this._focalOffset.y) || !V(this._focalOffset.z)) && (this._camera.updateMatrixWorld(), Ce.setFromMatrixColumn(this._camera.matrix, 0), we.setFromMatrixColumn(this._camera.matrix, 1),
|
5064
|
+
this._spherical.radius = Math.min(this._spherical.radius, c), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!V(this._focalOffset.x) || !V(this._focalOffset.y) || !V(this._focalOffset.z)) && (this._camera.updateMatrixWorld(), Ce.setFromMatrixColumn(this._camera.matrix, 0), we.setFromMatrixColumn(this._camera.matrix, 1), ze.setFromMatrixColumn(this._camera.matrix, 2), Ce.multiplyScalar(this._focalOffset.x), we.multiplyScalar(-this._focalOffset.y), ze.multiplyScalar(this._focalOffset.z), L.copy(Ce).add(we).add(ze), this._camera.position.add(L)), this._boundaryEnclosesCamera && this._encloseToBoundary(this._camera.position.copy(this._target), L.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse), 1);
|
5065
5065
|
const u = this._needsUpdate;
|
5066
5066
|
return u && !this._updatedLastTime ? (this._hasRested = !1, this.dispatchEvent({ type: "wake" }), this.dispatchEvent({ type: "update" })) : u ? (this.dispatchEvent({ type: "update" }), V(t, this.restThreshold) && V(s, this.restThreshold) && V(n, this.restThreshold) && V(r.x, this.restThreshold) && V(r.y, this.restThreshold) && V(r.z, this.restThreshold) && V(a.x, this.restThreshold) && V(a.y, this.restThreshold) && V(a.z, this.restThreshold) && V(o, this.restThreshold) && !this._hasRested && (this._hasRested = !0, this.dispatchEvent({ type: "rest" }))) : !u && this._updatedLastTime && this.dispatchEvent({ type: "sleep" }), this._lastDistance = this._spherical.radius, this._lastZoom = this._zoom, this._updatedLastTime = u, this._needsUpdate = !1, u;
|
5067
5067
|
}
|
@@ -5164,7 +5164,7 @@ class Oe extends gr {
|
|
5164
5164
|
}
|
5165
5165
|
}
|
5166
5166
|
_updateNearPlaneCorners() {
|
5167
|
-
if (
|
5167
|
+
if (Fe(this._camera)) {
|
5168
5168
|
const e = this._camera, t = e.near, s = e.getEffectiveFOV() * gt, n = Math.tan(s * 0.5) * t, r = n * e.aspect;
|
5169
5169
|
this._nearPlaneCorners[0].set(-r, -n, 0), this._nearPlaneCorners[1].set(r, -n, 0), this._nearPlaneCorners[2].set(r, n, 0), this._nearPlaneCorners[3].set(-r, n, 0);
|
5170
5170
|
} else if (Re(this._camera)) {
|
@@ -5178,7 +5178,7 @@ class Oe extends gr {
|
|
5178
5178
|
if (!(this.colliderMeshes.length >= 1) || mi(this._camera, "_collisionTest"))
|
5179
5179
|
return e;
|
5180
5180
|
const s = this._getTargetDirection(yt);
|
5181
|
-
yi.lookAt(
|
5181
|
+
yi.lookAt(fs, s, this._camera.up);
|
5182
5182
|
for (let n = 0; n < 4; n++) {
|
5183
5183
|
const r = N.copy(this._nearPlaneCorners[n]);
|
5184
5184
|
r.applyMatrix4(yi);
|
@@ -5270,7 +5270,7 @@ const qt = (i) => {
|
|
5270
5270
|
/* @__PURE__ */ d.jsx("div", { className: "dropdown-toggle", onClick: s, children: `${i.title}: ${e}` }),
|
5271
5271
|
i.open && /* @__PURE__ */ d.jsx("ul", { className: "dropdown-menu", children: i.options.map((r) => /* @__PURE__ */ d.jsx("li", { onClick: () => n(r), children: r }, r)) })
|
5272
5272
|
] });
|
5273
|
-
},
|
5273
|
+
}, He = ua(function(e, t) {
|
5274
5274
|
const s = [
|
5275
5275
|
"Renderer",
|
5276
5276
|
"Depth",
|
@@ -5319,7 +5319,7 @@ const qt = (i) => {
|
|
5319
5319
|
] })
|
5320
5320
|
] });
|
5321
5321
|
});
|
5322
|
-
class yr extends
|
5322
|
+
class yr extends Qs {
|
5323
5323
|
constructor(e) {
|
5324
5324
|
super({
|
5325
5325
|
extensions: {
|
@@ -5327,7 +5327,7 @@ class yr extends Xs {
|
|
5327
5327
|
derivatives: !0
|
5328
5328
|
},
|
5329
5329
|
glslVersion: qn,
|
5330
|
-
side:
|
5330
|
+
side: Ri,
|
5331
5331
|
transparent: !0,
|
5332
5332
|
uniforms: {
|
5333
5333
|
uScale: {
|
@@ -5436,13 +5436,13 @@ class br extends w {
|
|
5436
5436
|
gridMaterial;
|
5437
5437
|
constructor() {
|
5438
5438
|
const e = new yr();
|
5439
|
-
super(new
|
5439
|
+
super(new $s(2, 2), e), this.gridMaterial = e, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
|
5440
5440
|
}
|
5441
5441
|
update() {
|
5442
5442
|
this.gridMaterial.needsUpdate = !0;
|
5443
5443
|
}
|
5444
5444
|
}
|
5445
|
-
function
|
5445
|
+
function bs(i) {
|
5446
5446
|
const [e, t] = Z(i.selected), s = "toggle" + (e ? " selected" : "");
|
5447
5447
|
return /* @__PURE__ */ d.jsx(
|
5448
5448
|
"button",
|
@@ -5500,7 +5500,7 @@ void main() {
|
|
5500
5500
|
#include <clipping_planes_fragment>
|
5501
5501
|
gl_FragColor = vec4(vec3(vUv, 0.0), 1.0);
|
5502
5502
|
}`;
|
5503
|
-
class wr extends
|
5503
|
+
class wr extends Qs {
|
5504
5504
|
constructor() {
|
5505
5505
|
super({
|
5506
5506
|
defines: {
|
@@ -5511,12 +5511,12 @@ class wr extends Xs {
|
|
5511
5511
|
});
|
5512
5512
|
}
|
5513
5513
|
}
|
5514
|
-
const
|
5514
|
+
const Ye = new Xt(), re = new O(), De = new O(), G = new fe(), Es = {
|
5515
5515
|
X: new O(1, 0, 0),
|
5516
5516
|
Y: new O(0, 1, 0),
|
5517
5517
|
Z: new O(0, 0, 1)
|
5518
|
-
}, bi = { type: "change" },
|
5519
|
-
class Sr extends
|
5518
|
+
}, bi = { type: "change" }, Cs = { type: "mouseDown", mode: null }, ws = { type: "mouseUp", mode: null }, Ss = { type: "objectChange" };
|
5519
|
+
class Sr extends Xs {
|
5520
5520
|
constructor(e, t = null) {
|
5521
5521
|
super(void 0, t);
|
5522
5522
|
const s = new Ar(this);
|
@@ -5553,15 +5553,15 @@ class Sr extends Ws {
|
|
5553
5553
|
pointerHover(e) {
|
5554
5554
|
if (this.object === void 0 || this.dragging === !0)
|
5555
5555
|
return;
|
5556
|
-
e !== null &&
|
5557
|
-
const t = Ei(this._gizmo.picker[this.mode],
|
5556
|
+
e !== null && Ye.setFromCamera(e, this.camera);
|
5557
|
+
const t = Ei(this._gizmo.picker[this.mode], Ye);
|
5558
5558
|
t ? this.axis = t.object.name : this.axis = null;
|
5559
5559
|
}
|
5560
5560
|
pointerDown(e) {
|
5561
5561
|
if (!(this.object === void 0 || this.dragging === !0 || e != null && e.button !== 0) && this.axis !== null) {
|
5562
|
-
e !== null &&
|
5563
|
-
const t = Ei(this._plane,
|
5564
|
-
t && (this.object.updateMatrixWorld(), this.object.parent.updateMatrixWorld(), this._positionStart.copy(this.object.position), this._quaternionStart.copy(this.object.quaternion), this._scaleStart.copy(this.object.scale), this.object.matrixWorld.decompose(this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart), this.pointStart.copy(t.point).sub(this.worldPositionStart)), this.dragging = !0,
|
5562
|
+
e !== null && Ye.setFromCamera(e, this.camera);
|
5563
|
+
const t = Ei(this._plane, Ye, !0);
|
5564
|
+
t && (this.object.updateMatrixWorld(), this.object.parent.updateMatrixWorld(), this._positionStart.copy(this.object.position), this._quaternionStart.copy(this.object.quaternion), this._scaleStart.copy(this.object.scale), this.object.matrixWorld.decompose(this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart), this.pointStart.copy(t.point).sub(this.worldPositionStart)), this.dragging = !0, Cs.mode = this.mode, this.dispatchEvent(Cs);
|
5565
5565
|
}
|
5566
5566
|
}
|
5567
5567
|
pointerMove(e) {
|
@@ -5569,29 +5569,29 @@ class Sr extends Ws {
|
|
5569
5569
|
let r = this.space;
|
5570
5570
|
if (s === "scale" ? r = "local" : (t === "E" || t === "XYZE" || t === "XYZ") && (r = "world"), n === void 0 || t === null || this.dragging === !1 || e !== null && e.button !== -1)
|
5571
5571
|
return;
|
5572
|
-
e !== null &&
|
5573
|
-
const a = Ei(this._plane,
|
5572
|
+
e !== null && Ye.setFromCamera(e, this.camera);
|
5573
|
+
const a = Ei(this._plane, Ye, !0);
|
5574
5574
|
if (a) {
|
5575
5575
|
if (this.pointEnd.copy(a.point).sub(this.worldPositionStart), s === "translate")
|
5576
|
-
this._offset.copy(this.pointEnd).sub(this.pointStart), r === "local" && t !== "XYZ" && this._offset.applyQuaternion(this._worldQuaternionInv), t.indexOf("X") === -1 && (this._offset.x = 0), t.indexOf("Y") === -1 && (this._offset.y = 0), t.indexOf("Z") === -1 && (this._offset.z = 0), r === "local" && t !== "XYZ" ? this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale) : this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale), n.position.copy(this._offset).add(this._positionStart), this.translationSnap && (r === "local" && (n.position.applyQuaternion(G.copy(this._quaternionStart).invert()), t.search("X") !== -1 && (n.position.x = Math.round(n.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (n.position.y = Math.round(n.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (n.position.z = Math.round(n.position.z / this.translationSnap) * this.translationSnap), n.position.applyQuaternion(this._quaternionStart)), r === "world" && (n.parent && n.position.add(
|
5576
|
+
this._offset.copy(this.pointEnd).sub(this.pointStart), r === "local" && t !== "XYZ" && this._offset.applyQuaternion(this._worldQuaternionInv), t.indexOf("X") === -1 && (this._offset.x = 0), t.indexOf("Y") === -1 && (this._offset.y = 0), t.indexOf("Z") === -1 && (this._offset.z = 0), r === "local" && t !== "XYZ" ? this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale) : this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale), n.position.copy(this._offset).add(this._positionStart), this.translationSnap && (r === "local" && (n.position.applyQuaternion(G.copy(this._quaternionStart).invert()), t.search("X") !== -1 && (n.position.x = Math.round(n.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (n.position.y = Math.round(n.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (n.position.z = Math.round(n.position.z / this.translationSnap) * this.translationSnap), n.position.applyQuaternion(this._quaternionStart)), r === "world" && (n.parent && n.position.add(re.setFromMatrixPosition(n.parent.matrixWorld)), t.search("X") !== -1 && (n.position.x = Math.round(n.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (n.position.y = Math.round(n.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (n.position.z = Math.round(n.position.z / this.translationSnap) * this.translationSnap), n.parent && n.position.sub(re.setFromMatrixPosition(n.parent.matrixWorld))));
|
5577
5577
|
else if (s === "scale") {
|
5578
5578
|
if (t.search("XYZ") !== -1) {
|
5579
5579
|
let o = this.pointEnd.length() / this.pointStart.length();
|
5580
5580
|
this.pointEnd.dot(this.pointStart) < 0 && (o *= -1), De.set(o, o, o);
|
5581
5581
|
} else
|
5582
|
-
|
5582
|
+
re.copy(this.pointStart), De.copy(this.pointEnd), re.applyQuaternion(this._worldQuaternionInv), De.applyQuaternion(this._worldQuaternionInv), De.divide(re), t.search("X") === -1 && (De.x = 1), t.search("Y") === -1 && (De.y = 1), t.search("Z") === -1 && (De.z = 1);
|
5583
5583
|
n.scale.copy(this._scaleStart).multiply(De), this.scaleSnap && (t.search("X") !== -1 && (n.scale.x = Math.round(n.scale.x / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Y") !== -1 && (n.scale.y = Math.round(n.scale.y / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Z") !== -1 && (n.scale.z = Math.round(n.scale.z / this.scaleSnap) * this.scaleSnap || this.scaleSnap));
|
5584
5584
|
} else if (s === "rotate") {
|
5585
5585
|
this._offset.copy(this.pointEnd).sub(this.pointStart);
|
5586
|
-
const o = 20 / this.worldPosition.distanceTo(
|
5586
|
+
const o = 20 / this.worldPosition.distanceTo(re.setFromMatrixPosition(this.camera.matrixWorld));
|
5587
5587
|
let c = !1;
|
5588
|
-
t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(
|
5588
|
+
t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(re.copy(this.rotationAxis).cross(this.eye)) * o) : (t === "X" || t === "Y" || t === "Z") && (this.rotationAxis.copy(Es[t]), re.copy(Es[t]), r === "local" && re.applyQuaternion(this.worldQuaternion), re.cross(this.eye), re.length() === 0 ? c = !0 : this.rotationAngle = this._offset.dot(re.normalize()) * o), (t === "E" || c) && (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this._startNorm.copy(this.pointStart).normalize(), this._endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this._endNorm.cross(this._startNorm).dot(this.eye) < 0 ? 1 : -1), this.rotationSnap && (this.rotationAngle = Math.round(this.rotationAngle / this.rotationSnap) * this.rotationSnap), r === "local" && t !== "E" && t !== "XYZE" ? (n.quaternion.copy(this._quaternionStart), n.quaternion.multiply(G.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), n.quaternion.copy(G.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), n.quaternion.multiply(this._quaternionStart).normalize());
|
5589
5589
|
}
|
5590
|
-
this.dispatchEvent(bi), this.dispatchEvent(
|
5590
|
+
this.dispatchEvent(bi), this.dispatchEvent(Ss);
|
5591
5591
|
}
|
5592
5592
|
}
|
5593
5593
|
pointerUp(e) {
|
5594
|
-
e !== null && e.button !== 0 || (this.dragging && this.axis !== null && (
|
5594
|
+
e !== null && e.button !== 0 || (this.dragging && this.axis !== null && (ws.mode = this.mode, this.dispatchEvent(ws)), this.dragging = !1, this.axis = null);
|
5595
5595
|
}
|
5596
5596
|
dispose() {
|
5597
5597
|
this.disconnect(), this.traverse(function(e) {
|
@@ -5607,10 +5607,10 @@ class Sr extends Ws {
|
|
5607
5607
|
return this.object = void 0, this.axis = null, this._root.visible = !1, this;
|
5608
5608
|
}
|
5609
5609
|
reset() {
|
5610
|
-
this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(bi), this.dispatchEvent(
|
5610
|
+
this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(bi), this.dispatchEvent(Ss), this.pointStart.copy(this.pointEnd));
|
5611
5611
|
}
|
5612
5612
|
getRaycaster() {
|
5613
|
-
return
|
5613
|
+
return Ye;
|
5614
5614
|
}
|
5615
5615
|
// TODO: deprecate
|
5616
5616
|
getMode() {
|
@@ -5676,7 +5676,7 @@ function Ei(i, e, t) {
|
|
5676
5676
|
return s[n];
|
5677
5677
|
return !1;
|
5678
5678
|
}
|
5679
|
-
const Ht = new
|
5679
|
+
const Ht = new qs(), B = new O(0, 1, 0), xs = new O(0, 0, 0), Os = new Kt(), Yt = new fe(), Wt = new fe(), Se = new O(), Ts = new Kt(), St = new O(1, 0, 0), Ve = new O(0, 1, 0), xt = new O(0, 0, 1), Bt = new O(), Et = new O(), Ct = new O();
|
5680
5680
|
class Ar extends ct {
|
5681
5681
|
constructor(e) {
|
5682
5682
|
super(), this.isTransformControlsRoot = !0, this.controls = e, this.visible = !1;
|
@@ -5690,13 +5690,13 @@ class Ar extends ct {
|
|
5690
5690
|
class Dr extends ct {
|
5691
5691
|
constructor() {
|
5692
5692
|
super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
|
5693
|
-
const e = new
|
5693
|
+
const e = new We({
|
5694
5694
|
depthTest: !1,
|
5695
5695
|
depthWrite: !1,
|
5696
5696
|
fog: !1,
|
5697
5697
|
toneMapped: !1,
|
5698
5698
|
transparent: !0
|
5699
|
-
}), t = new
|
5699
|
+
}), t = new Ii({
|
5700
5700
|
depthTest: !1,
|
5701
5701
|
depthWrite: !1,
|
5702
5702
|
fog: !1,
|
@@ -5724,21 +5724,21 @@ class Dr extends ct {
|
|
5724
5724
|
m.color.setHex(16776960), m.opacity = 0.25, e.clone().color.setHex(16776960);
|
5725
5725
|
const S = e.clone();
|
5726
5726
|
S.color.setHex(7895160);
|
5727
|
-
const T = new
|
5727
|
+
const T = new de(0, 0.04, 0.1, 12);
|
5728
5728
|
T.translate(0, 0.05, 0);
|
5729
|
-
const M = new
|
5729
|
+
const M = new ae(0.08, 0.08, 0.08);
|
5730
5730
|
M.translate(0, 0.04, 0);
|
5731
5731
|
const g = new lt();
|
5732
|
-
g.setAttribute("position", new
|
5733
|
-
const v = new
|
5732
|
+
g.setAttribute("position", new Ze([0, 0, 0, 1, 0, 0], 3));
|
5733
|
+
const v = new de(75e-4, 75e-4, 0.5, 3);
|
5734
5734
|
v.translate(0, 0.25, 0);
|
5735
|
-
function E(Q,
|
5736
|
-
const
|
5737
|
-
return
|
5735
|
+
function E(Q, ke) {
|
5736
|
+
const he = new ut(Q, 75e-4, 3, 64, ke * Math.PI * 2);
|
5737
|
+
return he.rotateY(Math.PI / 2), he.rotateX(Math.PI / 2), he;
|
5738
5738
|
}
|
5739
5739
|
function b() {
|
5740
5740
|
const Q = new lt();
|
5741
|
-
return Q.setAttribute("position", new
|
5741
|
+
return Q.setAttribute("position", new Ze([0, 0, 0, 1, 1, 1], 3)), Q;
|
5742
5742
|
}
|
5743
5743
|
const P = {
|
5744
5744
|
X: [
|
@@ -5760,38 +5760,38 @@ class Dr extends ct {
|
|
5760
5760
|
[new w(new kt(0.1, 0), p.clone()), [0, 0, 0]]
|
5761
5761
|
],
|
5762
5762
|
XY: [
|
5763
|
-
[new w(new
|
5763
|
+
[new w(new ae(0.15, 0.15, 0.01), u.clone()), [0.15, 0.15, 0]]
|
5764
5764
|
],
|
5765
5765
|
YZ: [
|
5766
|
-
[new w(new
|
5766
|
+
[new w(new ae(0.15, 0.15, 0.01), c.clone()), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
|
5767
5767
|
],
|
5768
5768
|
XZ: [
|
5769
|
-
[new w(new
|
5769
|
+
[new w(new ae(0.15, 0.15, 0.01), l.clone()), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
|
5770
5770
|
]
|
5771
5771
|
}, x = {
|
5772
5772
|
X: [
|
5773
|
-
[new w(new
|
5774
|
-
[new w(new
|
5773
|
+
[new w(new de(0.2, 0, 0.6, 4), s), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
|
5774
|
+
[new w(new de(0.2, 0, 0.6, 4), s), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
|
5775
5775
|
],
|
5776
5776
|
Y: [
|
5777
|
-
[new w(new
|
5778
|
-
[new w(new
|
5777
|
+
[new w(new de(0.2, 0, 0.6, 4), s), [0, 0.3, 0]],
|
5778
|
+
[new w(new de(0.2, 0, 0.6, 4), s), [0, -0.3, 0], [0, 0, Math.PI]]
|
5779
5779
|
],
|
5780
5780
|
Z: [
|
5781
|
-
[new w(new
|
5782
|
-
[new w(new
|
5781
|
+
[new w(new de(0.2, 0, 0.6, 4), s), [0, 0, 0.3], [Math.PI / 2, 0, 0]],
|
5782
|
+
[new w(new de(0.2, 0, 0.6, 4), s), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
|
5783
5783
|
],
|
5784
5784
|
XYZ: [
|
5785
5785
|
[new w(new kt(0.2, 0), s)]
|
5786
5786
|
],
|
5787
5787
|
XY: [
|
5788
|
-
[new w(new
|
5788
|
+
[new w(new ae(0.2, 0.2, 0.01), s), [0.15, 0.15, 0]]
|
5789
5789
|
],
|
5790
5790
|
YZ: [
|
5791
|
-
[new w(new
|
5791
|
+
[new w(new ae(0.2, 0.2, 0.01), s), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
|
5792
5792
|
],
|
5793
5793
|
XZ: [
|
5794
|
-
[new w(new
|
5794
|
+
[new w(new ae(0.2, 0.2, 0.01), s), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
|
5795
5795
|
]
|
5796
5796
|
}, j = {
|
5797
5797
|
START: [
|
@@ -5834,7 +5834,7 @@ class Dr extends ct {
|
|
5834
5834
|
]
|
5835
5835
|
}, Ae = {
|
5836
5836
|
XYZE: [
|
5837
|
-
[new w(new
|
5837
|
+
[new w(new Ks(0.25, 10, 8), s)]
|
5838
5838
|
],
|
5839
5839
|
X: [
|
5840
5840
|
[new w(new ut(0.5, 0.1, 4, 24), s), [0, 0, 0], [0, -Math.PI / 2, -Math.PI / 2]]
|
@@ -5865,41 +5865,41 @@ class Dr extends ct {
|
|
5865
5865
|
[new w(M, o), [0, 0, -0.5], [-Math.PI / 2, 0, 0]]
|
5866
5866
|
],
|
5867
5867
|
XY: [
|
5868
|
-
[new w(new
|
5868
|
+
[new w(new ae(0.15, 0.15, 0.01), u), [0.15, 0.15, 0]]
|
5869
5869
|
],
|
5870
5870
|
YZ: [
|
5871
|
-
[new w(new
|
5871
|
+
[new w(new ae(0.15, 0.15, 0.01), c), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
|
5872
5872
|
],
|
5873
5873
|
XZ: [
|
5874
|
-
[new w(new
|
5874
|
+
[new w(new ae(0.15, 0.15, 0.01), l), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
|
5875
5875
|
],
|
5876
5876
|
XYZ: [
|
5877
|
-
[new w(new
|
5877
|
+
[new w(new ae(0.1, 0.1, 0.1), p.clone())]
|
5878
5878
|
]
|
5879
5879
|
}, Qe = {
|
5880
5880
|
X: [
|
5881
|
-
[new w(new
|
5882
|
-
[new w(new
|
5881
|
+
[new w(new de(0.2, 0, 0.6, 4), s), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
|
5882
|
+
[new w(new de(0.2, 0, 0.6, 4), s), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
|
5883
5883
|
],
|
5884
5884
|
Y: [
|
5885
|
-
[new w(new
|
5886
|
-
[new w(new
|
5885
|
+
[new w(new de(0.2, 0, 0.6, 4), s), [0, 0.3, 0]],
|
5886
|
+
[new w(new de(0.2, 0, 0.6, 4), s), [0, -0.3, 0], [0, 0, Math.PI]]
|
5887
5887
|
],
|
5888
5888
|
Z: [
|
5889
|
-
[new w(new
|
5890
|
-
[new w(new
|
5889
|
+
[new w(new de(0.2, 0, 0.6, 4), s), [0, 0, 0.3], [Math.PI / 2, 0, 0]],
|
5890
|
+
[new w(new de(0.2, 0, 0.6, 4), s), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
|
5891
5891
|
],
|
5892
5892
|
XY: [
|
5893
|
-
[new w(new
|
5893
|
+
[new w(new ae(0.2, 0.2, 0.01), s), [0.15, 0.15, 0]]
|
5894
5894
|
],
|
5895
5895
|
YZ: [
|
5896
|
-
[new w(new
|
5896
|
+
[new w(new ae(0.2, 0.2, 0.01), s), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
|
5897
5897
|
],
|
5898
5898
|
XZ: [
|
5899
|
-
[new w(new
|
5899
|
+
[new w(new ae(0.2, 0.2, 0.01), s), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
|
5900
5900
|
],
|
5901
5901
|
XYZ: [
|
5902
|
-
[new w(new
|
5902
|
+
[new w(new ae(0.2, 0.2, 0.2), s), [0, 0, 0]]
|
5903
5903
|
]
|
5904
5904
|
}, me = {
|
5905
5905
|
X: [
|
@@ -5913,15 +5913,15 @@ class Dr extends ct {
|
|
5913
5913
|
]
|
5914
5914
|
};
|
5915
5915
|
function te(Q) {
|
5916
|
-
const
|
5917
|
-
for (const
|
5918
|
-
for (let Te = Q[
|
5919
|
-
const se = Q[
|
5920
|
-
se.name =
|
5916
|
+
const ke = new ct();
|
5917
|
+
for (const he in Q)
|
5918
|
+
for (let Te = Q[he].length; Te--; ) {
|
5919
|
+
const se = Q[he][Te][0].clone(), Ue = Q[he][Te][1], je = Q[he][Te][2], Ne = Q[he][Te][3], Mt = Q[he][Te][4];
|
5920
|
+
se.name = he, se.tag = Mt, Ue && se.position.set(Ue[0], Ue[1], Ue[2]), je && se.rotation.set(je[0], je[1], je[2]), Ne && se.scale.set(Ne[0], Ne[1], Ne[2]), se.updateMatrix();
|
5921
5921
|
const Pt = se.geometry.clone();
|
5922
|
-
Pt.applyMatrix4(se.matrix), se.geometry = Pt, se.renderOrder = 1 / 0, se.position.set(0, 0, 0), se.rotation.set(0, 0, 0), se.scale.set(1, 1, 1),
|
5922
|
+
Pt.applyMatrix4(se.matrix), se.geometry = Pt, se.renderOrder = 1 / 0, se.position.set(0, 0, 0), se.rotation.set(0, 0, 0), se.scale.set(1, 1, 1), ke.add(se);
|
5923
5923
|
}
|
5924
|
-
return
|
5924
|
+
return ke;
|
5925
5925
|
}
|
5926
5926
|
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = te(P)), this.add(this.gizmo.rotate = te(X)), this.add(this.gizmo.scale = te(ht)), this.add(this.picker.translate = te(x)), this.add(this.picker.rotate = te(Ae)), this.add(this.picker.scale = te(Qe)), this.add(this.helper.translate = te(j)), this.add(this.helper.rotate = te(ge)), this.add(this.helper.scale = te(me)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
|
5927
5927
|
}
|
@@ -5936,10 +5936,10 @@ class Dr extends ct {
|
|
5936
5936
|
a.visible = !0, a.rotation.set(0, 0, 0), a.position.copy(this.worldPosition);
|
5937
5937
|
let o;
|
5938
5938
|
if (this.camera.isOrthographicCamera ? o = (this.camera.top - this.camera.bottom) / this.camera.zoom : o = this.worldPosition.distanceTo(this.cameraPosition) * Math.min(1.9 * Math.tan(Math.PI * this.camera.fov / 360) / this.camera.zoom, 7), a.scale.set(1, 1, 1).multiplyScalar(o * this.size / 4), a.tag === "helper") {
|
5939
|
-
a.visible = !1, a.name === "AXIS" ? (a.visible = !!this.axis, this.axis === "X" && (G.setFromEuler(Ht.set(0, 0, 0)), a.quaternion.copy(s).multiply(G), Math.abs(B.copy(St).applyQuaternion(s).dot(this.eye)) > 0.9 && (a.visible = !1)), this.axis === "Y" && (G.setFromEuler(Ht.set(0, 0, Math.PI / 2)), a.quaternion.copy(s).multiply(G), Math.abs(B.copy(
|
5939
|
+
a.visible = !1, a.name === "AXIS" ? (a.visible = !!this.axis, this.axis === "X" && (G.setFromEuler(Ht.set(0, 0, 0)), a.quaternion.copy(s).multiply(G), Math.abs(B.copy(St).applyQuaternion(s).dot(this.eye)) > 0.9 && (a.visible = !1)), this.axis === "Y" && (G.setFromEuler(Ht.set(0, 0, Math.PI / 2)), a.quaternion.copy(s).multiply(G), Math.abs(B.copy(Ve).applyQuaternion(s).dot(this.eye)) > 0.9 && (a.visible = !1)), this.axis === "Z" && (G.setFromEuler(Ht.set(0, Math.PI / 2, 0)), a.quaternion.copy(s).multiply(G), Math.abs(B.copy(xt).applyQuaternion(s).dot(this.eye)) > 0.9 && (a.visible = !1)), this.axis === "XYZE" && (G.setFromEuler(Ht.set(0, Math.PI / 2, 0)), B.copy(this.rotationAxis), a.quaternion.setFromRotationMatrix(Os.lookAt(xs, B, Ve)), a.quaternion.multiply(G), a.visible = this.dragging), this.axis === "E" && (a.visible = !1)) : a.name === "START" ? (a.position.copy(this.worldPositionStart), a.visible = this.dragging) : a.name === "END" ? (a.position.copy(this.worldPosition), a.visible = this.dragging) : a.name === "DELTA" ? (a.position.copy(this.worldPositionStart), a.quaternion.copy(this.worldQuaternionStart), re.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), re.applyQuaternion(this.worldQuaternionStart.clone().invert()), a.scale.copy(re), a.visible = this.dragging) : (a.quaternion.copy(s), this.dragging ? a.position.copy(this.worldPositionStart) : a.position.copy(this.worldPosition), this.axis && (a.visible = this.axis.search(a.name) !== -1));
|
5940
5940
|
continue;
|
5941
5941
|
}
|
5942
|
-
a.quaternion.copy(s), this.mode === "translate" || this.mode === "scale" ? (a.name === "X" && Math.abs(B.copy(St).applyQuaternion(s).dot(this.eye)) > 0.99 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "Y" && Math.abs(B.copy(
|
5942
|
+
a.quaternion.copy(s), this.mode === "translate" || this.mode === "scale" ? (a.name === "X" && Math.abs(B.copy(St).applyQuaternion(s).dot(this.eye)) > 0.99 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "Y" && Math.abs(B.copy(Ve).applyQuaternion(s).dot(this.eye)) > 0.99 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "Z" && Math.abs(B.copy(xt).applyQuaternion(s).dot(this.eye)) > 0.99 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "XY" && Math.abs(B.copy(xt).applyQuaternion(s).dot(this.eye)) < 0.2 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "YZ" && Math.abs(B.copy(St).applyQuaternion(s).dot(this.eye)) < 0.2 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "XZ" && Math.abs(B.copy(Ve).applyQuaternion(s).dot(this.eye)) < 0.2 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1)) : this.mode === "rotate" && (Yt.copy(s), B.copy(this.eye).applyQuaternion(G.copy(s).invert()), a.name.search("E") !== -1 && a.quaternion.setFromRotationMatrix(Os.lookAt(this.eye, xs, Ve)), a.name === "X" && (G.setFromAxisAngle(St, Math.atan2(-B.y, B.z)), G.multiplyQuaternions(Yt, G), a.quaternion.copy(G)), a.name === "Y" && (G.setFromAxisAngle(Ve, Math.atan2(B.x, B.z)), G.multiplyQuaternions(Yt, G), a.quaternion.copy(G)), a.name === "Z" && (G.setFromAxisAngle(xt, Math.atan2(B.y, B.x)), G.multiplyQuaternions(Yt, G), a.quaternion.copy(G))), a.visible = a.visible && (a.name.indexOf("X") === -1 || this.showX), a.visible = a.visible && (a.name.indexOf("Y") === -1 || this.showY), a.visible = a.visible && (a.name.indexOf("Z") === -1 || this.showZ), a.visible = a.visible && (a.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), a.material._color = a.material._color || a.material.color.clone(), a.material._opacity = a.material._opacity || a.material.opacity, a.material.color.copy(a.material._color), a.material.opacity = a.material._opacity, this.enabled && this.axis && (a.name === this.axis || this.axis.split("").some(function(c) {
|
5943
5943
|
return a.name === c;
|
5944
5944
|
})) && (a.material.color.setHex(16776960), a.material.opacity = 1);
|
5945
5945
|
}
|
@@ -5949,13 +5949,13 @@ class Dr extends ct {
|
|
5949
5949
|
class Rr extends w {
|
5950
5950
|
constructor() {
|
5951
5951
|
super(
|
5952
|
-
new
|
5953
|
-
new
|
5952
|
+
new $s(1e5, 1e5, 2, 2),
|
5953
|
+
new We({ visible: !1, wireframe: !0, side: Ri, transparent: !0, opacity: 0.1, toneMapped: !1 })
|
5954
5954
|
), this.isTransformControlsPlane = !0, this.type = "TransformControlsPlane";
|
5955
5955
|
}
|
5956
5956
|
updateMatrixWorld(e) {
|
5957
5957
|
let t = this.space;
|
5958
|
-
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), Bt.copy(St).applyQuaternion(t === "local" ? this.worldQuaternion : Wt), Et.copy(
|
5958
|
+
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), Bt.copy(St).applyQuaternion(t === "local" ? this.worldQuaternion : Wt), Et.copy(Ve).applyQuaternion(t === "local" ? this.worldQuaternion : Wt), Ct.copy(xt).applyQuaternion(t === "local" ? this.worldQuaternion : Wt), B.copy(Et), this.mode) {
|
5959
5959
|
case "translate":
|
5960
5960
|
case "scale":
|
5961
5961
|
switch (this.axis) {
|
@@ -5987,10 +5987,10 @@ class Rr extends w {
|
|
5987
5987
|
default:
|
5988
5988
|
Se.set(0, 0, 0);
|
5989
5989
|
}
|
5990
|
-
Se.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (
|
5990
|
+
Se.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (Ts.lookAt(re.set(0, 0, 0), Se, B), this.quaternion.setFromRotationMatrix(Ts)), super.updateMatrixWorld(e);
|
5991
5991
|
}
|
5992
5992
|
}
|
5993
|
-
class
|
5993
|
+
class ce extends Rs {
|
5994
5994
|
static DRAG_START = "Transform::dragStart";
|
5995
5995
|
static DRAG_END = "Transform::dragEnd";
|
5996
5996
|
static _instance;
|
@@ -5998,11 +5998,14 @@ class pe extends Ds {
|
|
5998
5998
|
activeCamera;
|
5999
5999
|
controls = /* @__PURE__ */ new Map();
|
6000
6000
|
visibility = /* @__PURE__ */ new Map();
|
6001
|
+
constructor() {
|
6002
|
+
super(), D.addEventListener(A.SET_SCENE, this.setScene);
|
6003
|
+
}
|
6001
6004
|
clear() {
|
6002
6005
|
for (const e of this.controls.values()) {
|
6003
|
-
e.detach(), e.
|
6006
|
+
e.detach(), e.disconnect();
|
6004
6007
|
const t = e.getHelper();
|
6005
|
-
|
6008
|
+
Le(t);
|
6006
6009
|
}
|
6007
6010
|
this.controls = /* @__PURE__ */ new Map(), this.visibility = /* @__PURE__ */ new Map();
|
6008
6011
|
}
|
@@ -6011,9 +6014,9 @@ class pe extends Ds {
|
|
6011
6014
|
if (t === void 0) {
|
6012
6015
|
const s = document.querySelector(".clickable");
|
6013
6016
|
t = new Sr(this.activeCamera, s), t.getHelper().name = e, t.setSpace("local"), this.controls.set(e, t), this.visibility.set(e, !0), t.addEventListener("mouseDown", () => {
|
6014
|
-
this.dispatchEvent({ type:
|
6017
|
+
this.dispatchEvent({ type: ce.DRAG_START });
|
6015
6018
|
}), t.addEventListener("mouseUp", () => {
|
6016
|
-
this.dispatchEvent({ type:
|
6019
|
+
this.dispatchEvent({ type: ce.DRAG_END });
|
6017
6020
|
}), t.addEventListener("dragging-changed", (n) => {
|
6018
6021
|
Pe.instance?.toggleOrbitControls(n.value);
|
6019
6022
|
});
|
@@ -6025,7 +6028,7 @@ class pe extends Ds {
|
|
6025
6028
|
}
|
6026
6029
|
remove(e) {
|
6027
6030
|
const t = this.get(e);
|
6028
|
-
return t === void 0 ? !1 : (t.detach(), t.disconnect(),
|
6031
|
+
return t === void 0 ? !1 : (t.detach(), t.disconnect(), Le(t.getHelper()), this.controls.delete(e), !0);
|
6029
6032
|
}
|
6030
6033
|
enabled(e) {
|
6031
6034
|
this.controls.forEach((t) => {
|
@@ -6049,13 +6052,16 @@ class pe extends Ds {
|
|
6049
6052
|
this.visibility.set(t.name, t.visible), t.visible = !1;
|
6050
6053
|
});
|
6051
6054
|
}
|
6055
|
+
setScene = () => {
|
6056
|
+
this.clear();
|
6057
|
+
};
|
6052
6058
|
static get instance() {
|
6053
|
-
return
|
6059
|
+
return ce._instance || (ce._instance = new ce()), ce._instance;
|
6054
6060
|
}
|
6055
6061
|
}
|
6056
|
-
const Ir = new
|
6057
|
-
class
|
6058
|
-
curve = new
|
6062
|
+
const Ir = new ae(), Ci = new oe();
|
6063
|
+
class Ms extends ct {
|
6064
|
+
curve = new Ki();
|
6059
6065
|
line;
|
6060
6066
|
draggable;
|
6061
6067
|
curvePos;
|
@@ -6071,12 +6077,12 @@ class Ts extends ct {
|
|
6071
6077
|
_draggableScale = 10;
|
6072
6078
|
_transform;
|
6073
6079
|
raycaster;
|
6074
|
-
draggedMat = new
|
6080
|
+
draggedMat = new We();
|
6075
6081
|
parentGroup;
|
6076
6082
|
group;
|
6077
6083
|
constructor(e, t) {
|
6078
6084
|
const s = new Tt(et(0.5, 1, Math.random()), et(0.5, 1, Math.random()), et(0.5, 1, Math.random()));
|
6079
|
-
super(), this.name = e, this.lineMaterial = new
|
6085
|
+
super(), this.name = e, this.lineMaterial = new Ii({ color: s }), this.line = new xe(new lt(), this.lineMaterial), this.line.name = "line", this.add(this.line), this._camera = t, this.curveType = "catmullrom", this.draggedMat.color = s, this.draggable = new ct(), this.draggable.name = "draggablePoints", this.add(this.draggable), this.curvePos = new w(new Ks(1.5), new We({ color: s })), this.curvePos.name = "curvePos", this.curvePos.scale.setScalar(this._draggableScale), this.curvePos.visible = !1, this.add(this.curvePos), this.raycaster = new Xt(), this.raycaster.params.Line.threshold = 3, this.enable();
|
6080
6086
|
}
|
6081
6087
|
enable() {
|
6082
6088
|
document.addEventListener("pointerdown", this.onMouseClick);
|
@@ -6085,7 +6091,7 @@ class Ts extends ct {
|
|
6085
6091
|
document.removeEventListener("pointerdown", this.onMouseClick);
|
6086
6092
|
}
|
6087
6093
|
dispose = () => {
|
6088
|
-
this._transform && (this._transform.removeEventListener("objectChange", this.updateSpline),
|
6094
|
+
this._transform && (this._transform.removeEventListener("objectChange", this.updateSpline), ce.instance.remove(this.name)), this.disable(), this.parentGroup.removeGroup(this.name);
|
6089
6095
|
};
|
6090
6096
|
hideTransform = () => {
|
6091
6097
|
this._transform?.detach();
|
@@ -6136,7 +6142,7 @@ class Ts extends ct {
|
|
6136
6142
|
const t = this.draggable.children[this.draggable.children.length - 1];
|
6137
6143
|
this._transform?.attach(t), this.group.current?.setField("Current Point", t.position);
|
6138
6144
|
}
|
6139
|
-
|
6145
|
+
Le(e), this.updateSpline();
|
6140
6146
|
};
|
6141
6147
|
removePointAt = (e) => {
|
6142
6148
|
const t = this.draggable.children[e];
|
@@ -6146,7 +6152,7 @@ class Ts extends ct {
|
|
6146
6152
|
this._transform?.object !== void 0 && this.removePoint(this._transform?.object);
|
6147
6153
|
};
|
6148
6154
|
updateSpline = () => {
|
6149
|
-
this.curve = new
|
6155
|
+
this.curve = new Ki(this.points, this.closed, this.curveType, this.tension), this.line.geometry.setFromPoints(this.getPoints()), this.curvePos.position.copy(this.getPointAt(this._curvePercentage));
|
6150
6156
|
};
|
6151
6157
|
// Handlers
|
6152
6158
|
onMouseClick = (e) => {
|
@@ -6207,7 +6213,7 @@ class Ts extends ct {
|
|
6207
6213
|
};
|
6208
6214
|
initDebug(e) {
|
6209
6215
|
const t = this.draggable.children;
|
6210
|
-
this.parentGroup = e, this._transform =
|
6216
|
+
this.parentGroup = e, this._transform = ce.instance.add(this.name), this._transform.camera = this._camera, this._transform.addEventListener("objectChange", this.onUpdateTransform), this._transform.attach(t.length > 0 ? t[t.length - 1] : this), Pe.instance?.scene.add(this._transform.getHelper());
|
6211
6217
|
const s = t.length > 0 ? t[t.length - 1].position : { x: 0, y: 0, z: 0 };
|
6212
6218
|
this.group = e.addGroup({
|
6213
6219
|
title: this.name,
|
@@ -6368,7 +6374,7 @@ class Ts extends ct {
|
|
6368
6374
|
this.exportSpline();
|
6369
6375
|
break;
|
6370
6376
|
case "Delete":
|
6371
|
-
|
6377
|
+
Le(this);
|
6372
6378
|
break;
|
6373
6379
|
case "Current Point":
|
6374
6380
|
if (this.group.current && this._transform?.object) {
|
@@ -6446,7 +6452,7 @@ class Lr extends ct {
|
|
6446
6452
|
e.draggableScale = this.defaultScale, e.hideTransform(), this.group?.current !== null && e.initDebug(this.group.current), this.add(e);
|
6447
6453
|
}
|
6448
6454
|
createSpline = (e = []) => {
|
6449
|
-
const t = `Spline ${Vt + 1}`, s = new
|
6455
|
+
const t = `Spline ${Vt + 1}`, s = new Ms(t, this._camera);
|
6450
6456
|
return s.addPoints(e), this.addSpline(s), Vt++, s;
|
6451
6457
|
};
|
6452
6458
|
createSplineFromArray = (e) => {
|
@@ -6470,7 +6476,7 @@ class Lr extends ct {
|
|
6470
6476
|
t.points.forEach((a) => {
|
6471
6477
|
n.push(new O(a[0], a[1], a[2]));
|
6472
6478
|
});
|
6473
|
-
const r = new
|
6479
|
+
const r = new Ms(s, this.camera);
|
6474
6480
|
r.addPoints(n), this.addSpline(r), Vt++;
|
6475
6481
|
};
|
6476
6482
|
get camera() {
|
@@ -6483,7 +6489,7 @@ class Lr extends ct {
|
|
6483
6489
|
});
|
6484
6490
|
}
|
6485
6491
|
}
|
6486
|
-
const
|
6492
|
+
const Ps = [
|
6487
6493
|
"Single",
|
6488
6494
|
"Side by Side",
|
6489
6495
|
"Stacked",
|
@@ -6491,7 +6497,7 @@ const Ms = [
|
|
6491
6497
|
], kr = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAC60lEQVRYhe2YT4hNcRTHP48xpmYaNAvRyEQxEhnKQljYsRm9/EmSyJiMFAsMZWNhJYoNIUVJ2VGiyb9ZzIpMpkQSahbGv9GMYWrM+1rc2zjvzvvdd+99rzdvMd+6de75nd+5387vnN/v/G5KEuWMKRNNIB8mCRaKiiL5qQb2ApuBuUAV0Ad0AJeB3sSeJRX6LJbULTf6JTUn9Z+KWMUpPyp/Avoa4CNQZ3Sj/lNpdL/xottR7AjOkHRUUpekN5I6JbVLavDH75lIfZN0UFKTpCWS0pJem/HeJBEMG6yV1ONYtgFJbZJ+GF1jDh+zJb03NuliEuwMkMo4yErS2RA/LcbuYVyCrm1mA7Dal/8Cu4FG4JD/HsTTkCy6a+SVMTPQuc1sBKb78nHghi+/A+YBxwL2lbhRY+ThuARdEVxu5JdGFvACr0otdoZ8Y4+Rn0Sn5sFFsMvI6YB9MzA1YJ8mN8k1wAHzfj4uQVdyrpI0aJL7oqTtkq4FiqPLyCOSbktqlbRL0jlJQ2b8QdwCUZ4qvhRStZL0XFK1pMd57CRvq5mfhKBriRfiFUMY6oD7eOdwPlQAN4G10dfWg+uouwXsiOssAj4AC+JMcEWwvnAuOTEr7gTXPmg34zagOwkbIIOXAo9CbDYBrcBXYN+4UUdy2sRflyS5zVNlfPX7ugpJW5V9nI7mmh+lYU0lCZ2B3TOnAVuAk0BTwC5nuhWro46KauBOQJch5OpRaoIW34GreGf+YZdRqS9NAj4Bp4ClQDvwOWxCqSM4ADQEdKE5XvbXzlITrAVe4TW+M6NMKDXBFLAMuAD0ACfIc7pMZBXXA2cY3/xmodQRHAL2A2+NLtj8ZiEKwUL/z2WMPAJcAVYALWSf8dZuDFGWeBHwKxm3sWYhiGG8Tfo6sA2vSfiSy4GrH3wGrDcfKSSKKf6v1E9yF0XK9Q1XBPuMXMw8HXTonQFwETwNzMFr64v1jzgFHIk9ybHEZYPJo65QlD3Bf2/Q/eaHPiSWAAAAAElFTkSuQmCC", Ur = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAETklEQVRYhe2YXYhVVRTHf3d0/JhyUrMpFbImM+whSa3Mynww+4AeIgiKoozooQ+KyMyXIAujF6OXqHyI6iEKKYgIP/owsjSFqCkprdDUTEcjbWZ0HHV+Pex1ucfb9Z57Z9REXHA4Z++99l7/s/ZZ/7X2KaiczNLwfwPIk9MA+yunNMAG4DHgV+BvoB3YFff2TPstYEyfrajVroI6Sr1GvahsbJC63HzZq04pmztSvU5tVRuqYRiYg78JeBR4HPg5ntdmxovz9wJfA3uAxuibDLQCA+IqynnAQuBuYCnwMLC1rx48U12U8cZqdWqMDcx4cI16qTpYbVKHqa+ovWUeHKsujn7VL9ULq2HI+wY7gVeBJdGeFu3J4ZUiy/cAXeHRRuAQsC/GC0B3eG4BcH/0tUV7czUAeVsMsBF4Kha9HZgCvAncAuwPnXHA0wFuGLANuDrGuoGDwFxgTqzzQ7RX5FrP2eLsdb76vnogtme6+nE8H1YPlQXHwbi3q9eqn0e7Tb25VrsF68vFY0lb1AGcDTwItGQ8tQM4AIwGmqP/EPAu8A0wElgJfFGzxTo8mKWXu9Rd4ZF96jvqjSbauEC9Sn1O3R463epLaku99voCsFXdkAH3kNpcQW+IiT/bQne3eufxBtioPqP2mKhioXpWzpxb1T8C5Ifh4ZptVoriRmAIKdrI3Lujf3bobAPeJpF0NVkKrAFuI9HTOBIxnxFrF4OgQKKr/dnJlQA+AcwABgOHA4zAamA5cE7orQL+zAEHiWI+A2bFC7aSguheYCgpqAphZz3wSB7AecCICv2TgH8oFRib4gVqka0k0h8CXAxMBW6ooDejFoCvA9OBQUAvKWM0kDz4XUZvNKXtyZMWUl7vBbaQXq457PeEziDgx/KJlQAuIPFdMcEXv5OdYWBP9M8k8VpnDQCvB4aTSrCNJB5cSdrW3tBpIJVnR0qdUTxAfdGUOVTnmwqEanNmqltC/9OgqePKg5eom8PgdvW+oJ9Kupera0O3U50TL3lcAaI+oHaF4R3qa6Z822wq0Saq89T1lmSxOrxeW/Xm4uGkiqQDmECKuKHxHW0HdpMiewSpvGqKeR8Ay0iBsYIjg6261PE2o9Q3Yqv+MqWxO9R1Hl12qs+q49Vlppy82pSr+5xJKsko4AXgHlJ0t5NIeg3wLXAlqZhtIUV8J6nmWwX8QiLjdhL5TwMWkY4R6/rrwYKlMr1Y321QZ/vfwBijPqm+rF4Wc7PjE9QllurGVeoV5gRNHsAm9fnMom3qrKPoTjKdMXaYyrFygEWQ72XWW24qhPu8xcUc2UU6O8wFPjmK7jhgPHAuMJGUGQ6U6WwE5sfzTXGvei7KA9hFOiR9D/wOfFVFt4dS2tpfRe83Ur7/CPiJakfOGgBCypubatArl2r8VfOax/LfzABKtePAzHO/5FgC7KBEzB2kOrDfUm8mOeFySv9+OyFyGmB/5aQH+C9BVKmVCNuMZgAAAABJRU5ErkJggg==";
|
6492
6498
|
class Pe extends Jt {
|
6493
6499
|
static instance = null;
|
6494
|
-
scene = new
|
6500
|
+
scene = new Ds();
|
6495
6501
|
renderer;
|
6496
6502
|
currentScene;
|
6497
6503
|
cameras = /* @__PURE__ */ new Map();
|
@@ -6503,8 +6509,8 @@ class Pe extends Jt {
|
|
6503
6509
|
lightHelpers = /* @__PURE__ */ new Map();
|
6504
6510
|
helpersContainer = new Kn();
|
6505
6511
|
grid = new br();
|
6506
|
-
axisHelper = new
|
6507
|
-
interactionHelper = new
|
6512
|
+
axisHelper = new Ji(500);
|
6513
|
+
interactionHelper = new Ji(100);
|
6508
6514
|
currentTransform;
|
6509
6515
|
// Tools
|
6510
6516
|
splineEditor;
|
@@ -6512,7 +6518,7 @@ class Pe extends Jt {
|
|
6512
6518
|
depthMaterial = new Jn();
|
6513
6519
|
normalsMaterial = new ea();
|
6514
6520
|
uvMaterial = new wr();
|
6515
|
-
wireframeMaterial = new
|
6521
|
+
wireframeMaterial = new We({
|
6516
6522
|
opacity: 0.33,
|
6517
6523
|
transparent: !0,
|
6518
6524
|
wireframe: !0
|
@@ -6538,7 +6544,7 @@ class Pe extends Jt {
|
|
6538
6544
|
selectedItem = void 0;
|
6539
6545
|
debugCamera;
|
6540
6546
|
raycaster = new Xt();
|
6541
|
-
pointer = new
|
6547
|
+
pointer = new oe();
|
6542
6548
|
cameraControls = void 0;
|
6543
6549
|
// References
|
6544
6550
|
canvasRef;
|
@@ -6559,7 +6565,7 @@ class Pe extends Jt {
|
|
6559
6565
|
lastUpdate: Date.now()
|
6560
6566
|
}, s.setItem(`${t}_mode`, this.state.mode), s.setItem(`${t}_tlCam`, s.getItem(`${t}_tlCam`) !== null ? s.getItem(`${t}_tlCam`) : "Debug"), s.setItem(`${t}_trCam`, s.getItem(`${t}_trCam`) !== null ? s.getItem(`${t}_trCam`) : "Orthographic"), s.setItem(`${t}_blCam`, s.getItem(`${t}_blCam`) !== null ? s.getItem(`${t}_blCam`) : "Front"), s.setItem(`${t}_brCam`, s.getItem(`${t}_brCam`) !== null ? s.getItem(`${t}_brCam`) : "Top"), s.setItem(`${t}_tlRender`, s.getItem(`${t}_tlRender`) !== null ? s.getItem(`${t}_tlRender`) : "Renderer"), s.setItem(`${t}_trRender`, s.getItem(`${t}_trRender`) !== null ? s.getItem(`${t}_trRender`) : "Renderer"), s.setItem(`${t}_blRender`, s.getItem(`${t}_blRender`) !== null ? s.getItem(`${t}_blRender`) : "Renderer"), s.setItem(`${t}_brRender`, s.getItem(`${t}_brRender`) !== null ? s.getItem(`${t}_brRender`) : "Renderer");
|
6561
6567
|
const r = {
|
6562
|
-
Vector2:
|
6568
|
+
Vector2: oe,
|
6563
6569
|
Vector3: O,
|
6564
6570
|
Vector4: ca,
|
6565
6571
|
Quaternion: fe,
|
@@ -6576,7 +6582,7 @@ class Pe extends Jt {
|
|
6576
6582
|
this.lightVisibility = o !== null ? o === "open" : !1, this.saveExpandedLightVisibility(), Pe.instance = this;
|
6577
6583
|
}
|
6578
6584
|
componentDidMount() {
|
6579
|
-
this.setupRenderer(), this.enable(), this.assignControls(), this.resize(), this.play(),
|
6585
|
+
this.setupRenderer(), this.enable(), this.assignControls(), this.resize(), this.play(), ce.instance.three = this.props.three, ce.instance.activeCamera = this.debugCamera;
|
6580
6586
|
}
|
6581
6587
|
componentDidUpdate(e, t, s) {
|
6582
6588
|
t.mode !== this.state.mode && (this.assignControls(), this.resize());
|
@@ -6592,7 +6598,7 @@ class Pe extends Jt {
|
|
6592
6598
|
/* @__PURE__ */ d.jsx("canvas", { ref: this.canvasRef }),
|
6593
6599
|
/* @__PURE__ */ d.jsxs("div", { className: `cameras ${this.state.mode === "Single" || this.state.mode === "Stacked" ? "single" : ""}`, ref: this.containerRef, children: [
|
6594
6600
|
this.state.mode === "Single" && /* @__PURE__ */ d.jsx(d.Fragment, { children: /* @__PURE__ */ d.jsx(
|
6595
|
-
|
6601
|
+
He,
|
6596
6602
|
{
|
6597
6603
|
name: "tl",
|
6598
6604
|
camera: this.tlCam,
|
@@ -6610,7 +6616,7 @@ class Pe extends Jt {
|
|
6610
6616
|
) }),
|
6611
6617
|
(this.state.mode === "Side by Side" || this.state.mode === "Stacked") && /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
6612
6618
|
/* @__PURE__ */ d.jsx(
|
6613
|
-
|
6619
|
+
He,
|
6614
6620
|
{
|
6615
6621
|
name: "tl",
|
6616
6622
|
camera: this.tlCam,
|
@@ -6627,7 +6633,7 @@ class Pe extends Jt {
|
|
6627
6633
|
}
|
6628
6634
|
),
|
6629
6635
|
/* @__PURE__ */ d.jsx(
|
6630
|
-
|
6636
|
+
He,
|
6631
6637
|
{
|
6632
6638
|
name: "tr",
|
6633
6639
|
camera: this.trCam,
|
@@ -6646,7 +6652,7 @@ class Pe extends Jt {
|
|
6646
6652
|
] }),
|
6647
6653
|
this.state.mode === "Quad" && /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
6648
6654
|
/* @__PURE__ */ d.jsx(
|
6649
|
-
|
6655
|
+
He,
|
6650
6656
|
{
|
6651
6657
|
name: "tl",
|
6652
6658
|
camera: this.tlCam,
|
@@ -6663,7 +6669,7 @@ class Pe extends Jt {
|
|
6663
6669
|
}
|
6664
6670
|
),
|
6665
6671
|
/* @__PURE__ */ d.jsx(
|
6666
|
-
|
6672
|
+
He,
|
6667
6673
|
{
|
6668
6674
|
name: "tr",
|
6669
6675
|
camera: this.trCam,
|
@@ -6680,7 +6686,7 @@ class Pe extends Jt {
|
|
6680
6686
|
}
|
6681
6687
|
),
|
6682
6688
|
/* @__PURE__ */ d.jsx(
|
6683
|
-
|
6689
|
+
He,
|
6684
6690
|
{
|
6685
6691
|
name: "bl",
|
6686
6692
|
camera: this.blCam,
|
@@ -6697,7 +6703,7 @@ class Pe extends Jt {
|
|
6697
6703
|
}
|
6698
6704
|
),
|
6699
6705
|
/* @__PURE__ */ d.jsx(
|
6700
|
-
|
6706
|
+
He,
|
6701
6707
|
{
|
6702
6708
|
name: "br",
|
6703
6709
|
camera: this.brCam,
|
@@ -6720,8 +6726,8 @@ class Pe extends Jt {
|
|
6720
6726
|
qt,
|
6721
6727
|
{
|
6722
6728
|
title: "View",
|
6723
|
-
index:
|
6724
|
-
options:
|
6729
|
+
index: Ps.indexOf(this.state.mode),
|
6730
|
+
options: Ps,
|
6725
6731
|
onSelect: (t) => {
|
6726
6732
|
t !== this.state.mode && (this.killControls(), this.setState({ mode: t }), localStorage.setItem(`${this.appID}_mode`, t));
|
6727
6733
|
},
|
@@ -6758,7 +6764,7 @@ class Pe extends Jt {
|
|
6758
6764
|
}
|
6759
6765
|
),
|
6760
6766
|
/* @__PURE__ */ d.jsx(
|
6761
|
-
|
6767
|
+
bs,
|
6762
6768
|
{
|
6763
6769
|
name: "cameraHelper",
|
6764
6770
|
icon: kr,
|
@@ -6773,7 +6779,7 @@ class Pe extends Jt {
|
|
6773
6779
|
}
|
6774
6780
|
),
|
6775
6781
|
/* @__PURE__ */ d.jsx(
|
6776
|
-
|
6782
|
+
bs,
|
6777
6783
|
{
|
6778
6784
|
name: "lightHelper",
|
6779
6785
|
icon: Ur,
|
@@ -6880,7 +6886,7 @@ class Pe extends Jt {
|
|
6880
6886
|
});
|
6881
6887
|
};
|
6882
6888
|
sceneUpdate = (e) => {
|
6883
|
-
this.helpersContainer.add(this.axisHelper), this.clearLightHelpers(), this.scene.remove(this.currentScene),
|
6889
|
+
this.helpersContainer.add(this.axisHelper), this.clearLightHelpers(), this.scene.remove(this.currentScene), Le(this.currentScene);
|
6884
6890
|
const t = this.props.scenes.get(e.value.name);
|
6885
6891
|
if (t !== void 0) {
|
6886
6892
|
const s = new t();
|
@@ -6900,7 +6906,7 @@ class Pe extends Jt {
|
|
6900
6906
|
t !== void 0 && (this.scene.remove(t), t.dispose()), this.cameras.delete(e.value.name), this.setState({ lastUpdate: Date.now() });
|
6901
6907
|
};
|
6902
6908
|
onMouseMove = (e) => {
|
6903
|
-
const t = new
|
6909
|
+
const t = new oe();
|
6904
6910
|
this.renderer.getSize(t);
|
6905
6911
|
const s = Math.min(e.clientX, t.x), n = Math.min(e.clientY, t.y);
|
6906
6912
|
this.pointer.x = Je(s, 0, t.x, -1, 1), this.pointer.y = Je(n, 0, t.y, 1, -1);
|
@@ -6928,7 +6934,7 @@ class Pe extends Jt {
|
|
6928
6934
|
onClick = (e) => {
|
6929
6935
|
if (this.state.interactionMode === "Orbit")
|
6930
6936
|
return;
|
6931
|
-
const t = new
|
6937
|
+
const t = new oe();
|
6932
6938
|
if (this.renderer.getSize(t), e.clientX >= t.x)
|
6933
6939
|
return;
|
6934
6940
|
this.onMouseMove(e);
|
@@ -6960,7 +6966,7 @@ class Pe extends Jt {
|
|
6960
6966
|
}
|
6961
6967
|
};
|
6962
6968
|
onSetSelectedItem = (e) => {
|
6963
|
-
this.selectedItem = this.currentScene.getObjectByProperty("uuid", e.value.uuid), this.selectedItem !== void 0 && (this.currentTransform !== void 0 && (this.currentTransform.removeEventListener("objectChange", this.onUpdateTransform),
|
6969
|
+
this.selectedItem = this.currentScene.getObjectByProperty("uuid", e.value.uuid), this.selectedItem !== void 0 && (this.currentTransform !== void 0 && (this.currentTransform.removeEventListener("objectChange", this.onUpdateTransform), ce.instance.remove(this.currentTransform.getHelper().name)), this.currentTransform = ce.instance.add(e.value.name), this.currentTransform.attach(this.selectedItem), this.scene.add(this.currentTransform.getHelper()), this.currentTransform.addEventListener("objectChange", this.onUpdateTransform));
|
6964
6970
|
};
|
6965
6971
|
onUpdateTransform = () => {
|
6966
6972
|
this.selectedItem !== void 0 && (this.props.three.updateObject(this.selectedItem.uuid, "position", this.selectedItem.position), this.props.three.updateObject(this.selectedItem.uuid, "rotation", {
|
@@ -7058,7 +7064,7 @@ class Pe extends Jt {
|
|
7058
7064
|
t < n ? this.currentCamera = this.tlCam : this.currentCamera = this.trCam;
|
7059
7065
|
break;
|
7060
7066
|
}
|
7061
|
-
this.splineEditor.camera = this.currentCamera, this.raycaster.setFromCamera(this.pointer, this.currentCamera), this.currentCamera === this.tlCam ? this.currentWindow = this.tlWindow : this.currentCamera === this.trCam ? this.currentWindow = this.trWindow : this.currentCamera === this.blCam ? this.currentWindow = this.blWindow : this.currentCamera === this.brCam && (this.currentWindow = this.brWindow),
|
7067
|
+
this.splineEditor.camera = this.currentCamera, this.raycaster.setFromCamera(this.pointer, this.currentCamera), this.currentCamera === this.tlCam ? this.currentWindow = this.tlWindow : this.currentCamera === this.trCam ? this.currentWindow = this.trWindow : this.currentCamera === this.blCam ? this.currentWindow = this.blWindow : this.currentCamera === this.brCam && (this.currentWindow = this.brWindow), ce.instance.updateCamera(this.currentCamera, this.currentWindow.current);
|
7062
7068
|
};
|
7063
7069
|
updateCameraControls = (e, t = !1) => {
|
7064
7070
|
if (this.selectedItem === void 0)
|
@@ -7136,7 +7142,7 @@ class ti extends Jt {
|
|
7136
7142
|
static instance;
|
7137
7143
|
matrix = new Kt();
|
7138
7144
|
position = new O();
|
7139
|
-
rotation = new
|
7145
|
+
rotation = new qs();
|
7140
7146
|
scale = new O();
|
7141
7147
|
open = !1;
|
7142
7148
|
constructor(e) {
|
@@ -7215,7 +7221,7 @@ class ti extends Jt {
|
|
7215
7221
|
return `${this.props.three.app.appID}_transform`;
|
7216
7222
|
}
|
7217
7223
|
}
|
7218
|
-
function
|
7224
|
+
function As(i) {
|
7219
7225
|
switch (i) {
|
7220
7226
|
case "color":
|
7221
7227
|
return "Color";
|
@@ -7251,7 +7257,7 @@ function jr(i, e) {
|
|
7251
7257
|
for (const o in i.lightInfo) {
|
7252
7258
|
const c = i.lightInfo[o];
|
7253
7259
|
c !== void 0 && (c.isColor !== void 0 ? a.push({
|
7254
|
-
title:
|
7260
|
+
title: As(o),
|
7255
7261
|
prop: o,
|
7256
7262
|
type: "color",
|
7257
7263
|
value: c,
|
@@ -7265,7 +7271,7 @@ function jr(i, e) {
|
|
7265
7271
|
}
|
7266
7272
|
}
|
7267
7273
|
}) : a.push({
|
7268
|
-
title:
|
7274
|
+
title: As(o),
|
7269
7275
|
prop: o,
|
7270
7276
|
type: typeof c,
|
7271
7277
|
value: c,
|
@@ -7378,7 +7384,7 @@ function Nr(i, e) {
|
|
7378
7384
|
}
|
7379
7385
|
);
|
7380
7386
|
}
|
7381
|
-
const
|
7387
|
+
const Di = {
|
7382
7388
|
name: "",
|
7383
7389
|
uuid: "",
|
7384
7390
|
type: "",
|
@@ -7391,62 +7397,72 @@ const ln = {
|
|
7391
7397
|
lightInfo: void 0,
|
7392
7398
|
children: []
|
7393
7399
|
};
|
7394
|
-
let
|
7400
|
+
let ne = { ...Di };
|
7395
7401
|
function Fr(i) {
|
7396
7402
|
const [e, t] = Z(-1);
|
7397
7403
|
Xe(() => {
|
7398
7404
|
function a(c) {
|
7399
|
-
|
7405
|
+
ne = { ...c.value }, t(Date.now());
|
7400
7406
|
}
|
7401
7407
|
function o() {
|
7402
|
-
|
7408
|
+
ne = { ...Di }, t(Date.now());
|
7403
7409
|
}
|
7404
7410
|
return D.addEventListener(A.SET_SCENE, o), D.addEventListener(A.SET_OBJECT, a), () => {
|
7405
7411
|
D.removeEventListener(A.SET_SCENE, o), D.removeEventListener(A.SET_OBJECT, a);
|
7406
7412
|
};
|
7407
7413
|
}, []);
|
7408
|
-
const s =
|
7409
|
-
return /* @__PURE__ */ d.jsx(
|
7410
|
-
|
7411
|
-
|
7412
|
-
|
7413
|
-
|
7414
|
-
|
7415
|
-
|
7416
|
-
|
7417
|
-
|
7418
|
-
|
7419
|
-
|
7420
|
-
|
7421
|
-
|
7422
|
-
|
7423
|
-
|
7424
|
-
|
7425
|
-
|
7426
|
-
|
7427
|
-
|
7428
|
-
|
7429
|
-
|
7430
|
-
|
7431
|
-
|
7432
|
-
|
7433
|
-
|
7434
|
-
|
7435
|
-
|
7436
|
-
|
7437
|
-
|
7438
|
-
|
7439
|
-
|
7440
|
-
|
7441
|
-
|
7442
|
-
|
7443
|
-
|
7444
|
-
|
7445
|
-
|
7446
|
-
|
7447
|
-
|
7448
|
-
|
7449
|
-
|
7414
|
+
const s = ne.type.toLowerCase(), n = ne.animations.length > 0 || ne.mixer !== void 0, r = s.search("mesh") > -1 || s.search("line") > -1 || s.search("points") > -1;
|
7415
|
+
return /* @__PURE__ */ d.jsx(
|
7416
|
+
$t,
|
7417
|
+
{
|
7418
|
+
label: "Inspector",
|
7419
|
+
button: ne.uuid.length > 0 ? /* @__PURE__ */ d.jsx("button", { className: "remove", onClick: () => {
|
7420
|
+
ce.instance.remove(ne.name), ne = { ...Di }, t(Date.now());
|
7421
|
+
} }) : void 0,
|
7422
|
+
children: /* @__PURE__ */ d.jsx("div", { id: "Inspector", className: i.class, children: ne.uuid.length > 0 && /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
7423
|
+
/* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
7424
|
+
/* @__PURE__ */ d.jsx(
|
7425
|
+
Gt,
|
7426
|
+
{
|
7427
|
+
type: "string",
|
7428
|
+
title: "Name",
|
7429
|
+
prop: "name",
|
7430
|
+
value: ne.name,
|
7431
|
+
disabled: !0
|
7432
|
+
}
|
7433
|
+
),
|
7434
|
+
/* @__PURE__ */ d.jsx(
|
7435
|
+
Gt,
|
7436
|
+
{
|
7437
|
+
type: "string",
|
7438
|
+
title: "Type",
|
7439
|
+
prop: "type",
|
7440
|
+
value: ne.type,
|
7441
|
+
disabled: !0
|
7442
|
+
}
|
7443
|
+
),
|
7444
|
+
/* @__PURE__ */ d.jsx(
|
7445
|
+
Gt,
|
7446
|
+
{
|
7447
|
+
type: "string",
|
7448
|
+
title: "UUID",
|
7449
|
+
prop: "uuid",
|
7450
|
+
value: ne.uuid,
|
7451
|
+
disabled: !0
|
7452
|
+
}
|
7453
|
+
)
|
7454
|
+
] }),
|
7455
|
+
/* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
7456
|
+
/* @__PURE__ */ d.jsx(ti, { object: ne, three: i.three }),
|
7457
|
+
n ? Nr(ne, i.three) : null,
|
7458
|
+
s.search("camera") > -1 ? er(ne, i.three) : null,
|
7459
|
+
s.search("light") > -1 ? jr(ne, i.three) : null,
|
7460
|
+
r ? qa(ne, i.three) : null
|
7461
|
+
] })
|
7462
|
+
] }) }, e)
|
7463
|
+
},
|
7464
|
+
"Inspector"
|
7465
|
+
);
|
7450
7466
|
}
|
7451
7467
|
function zr(i) {
|
7452
7468
|
const [e] = Z([]), [t] = Z([]), [s, n] = Z(0), r = (c) => {
|
@@ -7461,7 +7477,7 @@ function zr(i) {
|
|
7461
7477
|
onRefresh: () => {
|
7462
7478
|
i.three.refreshScene(l.name);
|
7463
7479
|
},
|
7464
|
-
children: /* @__PURE__ */ d.jsx(
|
7480
|
+
children: /* @__PURE__ */ d.jsx(as, { child: l, scene: l, three: i.three })
|
7465
7481
|
},
|
7466
7482
|
Math.random()
|
7467
7483
|
)
|
@@ -7479,7 +7495,7 @@ function zr(i) {
|
|
7479
7495
|
onRefresh: () => {
|
7480
7496
|
i.three.refreshScene(l.name);
|
7481
7497
|
},
|
7482
|
-
children: /* @__PURE__ */ d.jsx(
|
7498
|
+
children: /* @__PURE__ */ d.jsx(as, { child: l, scene: l, three: i.three })
|
7483
7499
|
},
|
7484
7500
|
Math.random()
|
7485
7501
|
), n(Date.now());
|
@@ -7542,7 +7558,7 @@ function eo(i) {
|
|
7542
7558
|
}
|
7543
7559
|
u.material.needsUpdate = !0;
|
7544
7560
|
};
|
7545
|
-
c.value.src.length > 0 ?
|
7561
|
+
c.value.src.length > 0 ? sn(c.value.src).then((m) => {
|
7546
7562
|
m.offset.set(c.value.offset[0], c.value.offset[1]), m.repeat.set(c.value.repeat[0], c.value.repeat[1]), p(m);
|
7547
7563
|
}) : p(null);
|
7548
7564
|
}
|
@@ -7587,9 +7603,9 @@ function to(i) {
|
|
7587
7603
|
export {
|
7588
7604
|
$t as Accordion,
|
7589
7605
|
Xr as Application,
|
7590
|
-
|
7591
|
-
|
7592
|
-
|
7606
|
+
Li as BaseRemote,
|
7607
|
+
an as ChildObject,
|
7608
|
+
as as ContainerObject,
|
7593
7609
|
Ma as Draggable,
|
7594
7610
|
Ta as DraggableItem,
|
7595
7611
|
Pa as Dropdown,
|
@@ -7598,36 +7614,36 @@ export {
|
|
7598
7614
|
Zt as ExportTexture,
|
7599
7615
|
Fr as Inspector,
|
7600
7616
|
Pe as MultiView,
|
7601
|
-
|
7617
|
+
nn as NavButton,
|
7602
7618
|
Qr as RemoteComponents,
|
7603
7619
|
Jr as RemoteController,
|
7604
7620
|
qr as RemoteTheatre,
|
7605
7621
|
Kr as RemoteThree,
|
7606
7622
|
eo as SceneInspector,
|
7607
7623
|
zr as SidePanel,
|
7608
|
-
|
7624
|
+
Ms as Spline,
|
7609
7625
|
Lr as SplineEditor,
|
7610
7626
|
to as ThreeEditor,
|
7611
7627
|
A as ToolEvents,
|
7612
|
-
|
7628
|
+
ce as Transform,
|
7613
7629
|
Qt as capitalize,
|
7614
|
-
|
7615
|
-
|
7630
|
+
Be as clamp,
|
7631
|
+
ts as colorToHex,
|
7616
7632
|
pa as copyToClipboard,
|
7617
7633
|
_a as customizeTheatreElements,
|
7618
7634
|
D as debugDispatcher,
|
7619
7635
|
Zr as defaultTheatreCallback,
|
7620
|
-
|
7636
|
+
Le as dispose,
|
7621
7637
|
ga as disposeMaterial,
|
7622
7638
|
Wr as disposeTexture,
|
7623
7639
|
Gr as distance,
|
7624
7640
|
Ti as hierarchyUUID,
|
7625
7641
|
fa as isColor,
|
7626
7642
|
xi as mix,
|
7627
|
-
|
7628
|
-
|
7643
|
+
tn as noop,
|
7644
|
+
es as normalize,
|
7629
7645
|
ma as randomID,
|
7630
|
-
|
7646
|
+
is as resetThreeObjects,
|
7631
7647
|
be as round,
|
7632
7648
|
$r as theatreEditorApp,
|
7633
7649
|
Oi as totalThreeObjects
|