@tomorrowevening/hermes 0.0.123 → 0.0.125
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hermes.cjs.js +15 -15
- package/dist/hermes.es.js +1047 -935
- package/package.json +1 -1
- package/types/index.d.ts +1 -1
- package/types/webworkers/EventHandling.d.ts +8 -0
- package/types/webworkers/ProxyManager.d.ts +1 -0
- package/types/webworkers/CreateLoadWorker.d.ts +0 -1
- package/types/webworkers/LoadWorker.d.ts +0 -1
package/dist/hermes.es.js
CHANGED
@@ -1,30 +1,30 @@
|
|
1
|
-
import { OrthographicCamera as
|
2
|
-
import
|
3
|
-
import { Reorder as
|
4
|
-
const
|
5
|
-
},
|
1
|
+
import { OrthographicCamera as Ii, Scene as Gs, MeshBasicMaterial as Je, BufferGeometry as _t, Float32BufferAttribute as qe, Mesh as M, LinearSRGBColorSpace as Nt, ObjectLoader as Gn, AnimationMixer as Xn, EventDispatcher as Yi, Texture as $n, RepeatWrapping as ls, Color as et, ColorManagement as mt, WebGLRenderTarget as Kn, FrontSide as qn, BackSide as Xs, DoubleSide as Bi, NoBlending as Qn, NormalBlending as Jn, AdditiveBlending as ea, SubtractiveBlending as ta, MultiplyBlending as ia, CustomBlending as sa, AddEquation as na, SubtractEquation as aa, ReverseSubtractEquation as ra, MinEquation as oa, MaxEquation as la, ZeroFactor as $s, OneFactor as Ks, SrcColorFactor as qs, OneMinusSrcColorFactor as Qs, SrcAlphaFactor as Js, OneMinusSrcAlphaFactor as en, DstAlphaFactor as tn, OneMinusDstAlphaFactor as sn, DstColorFactor as nn, OneMinusDstColorFactor as an, SrcAlphaSaturateFactor as ca, ConstantColorFactor as rn, OneMinusConstantColorFactor as on, ConstantAlphaFactor as ln, OneMinusConstantAlphaFactor as cn, Line as Ie, LineBasicMaterial as Vi, Ray as ha, Plane as da, MathUtils as ua, Vector3 as P, Controls as hn, MOUSE as gt, TOUCH as ft, Quaternion as Ce, Spherical as Li, Vector2 as pe, ShaderMaterial as dn, GLSL3 as pa, PlaneGeometry as un, Raycaster as ni, Euler as pn, Matrix4 as ci, Object3D as vt, CylinderGeometry as ve, BoxGeometry as de, OctahedronGeometry as Zt, SphereGeometry as mn, TorusGeometry as Et, CatmullRomCurve3 as cs, Group as ma, AxesHelper as hs, MeshDepthMaterial as fa, MeshNormalMaterial as ga, PerspectiveCamera as Ct, WebGLRenderer as _a, CameraHelper as va, SkinnedMesh as ya, SpotLightHelper as ba, PointLightHelper as Ea, HemisphereLightHelper as Ca, DirectionalLightHelper as Sa, Clock as wa, Vector4 as xa, Box3 as Oa, Sphere as Ta, SkeletonHelper as Ma, SRGBColorSpace as ds, NoToneMapping as us, NoColorSpace as Pa, LinearToneMapping as Aa, ReinhardToneMapping as Da, CineonToneMapping as Ra, ACESFilmicToneMapping as Ia, AgXToneMapping as La, NeutralToneMapping as ka, CustomToneMapping as Ua } from "three";
|
2
|
+
import fn, { useState as Z, useRef as J, useEffect as tt, useMemo as jt, Component as Ft, createRef as Ve, forwardRef as ja } from "react";
|
3
|
+
import { Reorder as gn } from "framer-motion";
|
4
|
+
const ai = () => {
|
5
|
+
}, Do = () => {
|
6
6
|
};
|
7
|
-
function
|
7
|
+
function ri(s) {
|
8
8
|
return s.substring(0, 1).toUpperCase() + s.substring(1);
|
9
9
|
}
|
10
|
-
function
|
10
|
+
function Na(s) {
|
11
11
|
const e = JSON.stringify(s);
|
12
12
|
return navigator.clipboard.writeText(e), e;
|
13
13
|
}
|
14
|
-
function
|
14
|
+
function Fa() {
|
15
15
|
return Math.round(Math.random() * 1e6).toString();
|
16
16
|
}
|
17
|
-
function
|
17
|
+
function za(s) {
|
18
18
|
return s.r !== void 0 && s.g !== void 0 && s.b !== void 0;
|
19
19
|
}
|
20
|
-
function
|
20
|
+
function ps(s) {
|
21
21
|
const e = Math.round(s.r * 255), t = Math.round(s.g * 255), i = Math.round(s.b * 255), n = (c) => {
|
22
22
|
const l = c.toString(16);
|
23
23
|
return l.length === 1 ? "0" + l : l;
|
24
24
|
}, r = n(e), a = n(t), o = n(i);
|
25
25
|
return "#" + r + a + o;
|
26
26
|
}
|
27
|
-
function
|
27
|
+
function vi(s, e, t, i) {
|
28
28
|
return new (t || (t = Promise))(function(n, r) {
|
29
29
|
function a(l) {
|
30
30
|
try {
|
@@ -49,17 +49,17 @@ function _i(s, e, t, i) {
|
|
49
49
|
c((i = i.apply(s, e || [])).next());
|
50
50
|
});
|
51
51
|
}
|
52
|
-
const
|
53
|
-
function
|
52
|
+
const Ha = ["geforce 320m", "geforce 8600", "geforce 8600m gt", "geforce 8800 gs", "geforce 8800 gt", "geforce 9400", "geforce 9400m g", "geforce 9400m", "geforce 9600m gt", "geforce 9600m", "geforce fx go5200", "geforce gt 120", "geforce gt 130", "geforce gt 330m", "geforce gtx 285", "google swiftshader", "intel g41", "intel g45", "intel gma 4500mhd", "intel gma x3100", "intel hd 3000", "intel q45", "legacy", "mali-2", "mali-3", "mali-4", "quadro fx 1500", "quadro fx 4", "quadro fx 5", "radeon hd 2400", "radeon hd 2600", "radeon hd 4670", "radeon hd 4850", "radeon hd 4870", "radeon hd 5670", "radeon hd 5750", "radeon hd 6290", "radeon hd 6300", "radeon hd 6310", "radeon hd 6320", "radeon hd 6490m", "radeon hd 6630m", "radeon hd 6750m", "radeon hd 6770m", "radeon hd 6970m", "sgx 543", "sgx543"];
|
53
|
+
function ms(s) {
|
54
54
|
return s = s.toLowerCase().replace(/.*angle ?\((.+)\)(?: on vulkan [0-9.]+)?$/i, "$1").replace(/\s(\d{1,2}gb|direct3d.+$)|\(r\)| \([^)]+\)$/g, "").replace(/(?:vulkan|opengl) \d+\.\d+(?:\.\d+)?(?: \((.*)\))?/, "$1");
|
55
55
|
}
|
56
|
-
const
|
57
|
-
if (
|
56
|
+
const _n = typeof window > "u", Le = (() => {
|
57
|
+
if (_n)
|
58
58
|
return;
|
59
59
|
const { userAgent: s, platform: e, maxTouchPoints: t } = window.navigator, i = /(iphone|ipod|ipad)/i.test(s), n = e === "iPad" || e === "MacIntel" && t > 0 && !window.MSStream;
|
60
60
|
return { isIpad: n, isMobile: /android/i.test(s) || i || n, isSafari12: /Version\/12.+Safari/.test(s), isFirefox: /Firefox/.test(s) };
|
61
61
|
})();
|
62
|
-
function
|
62
|
+
function Ya(s, e, t) {
|
63
63
|
if (!t)
|
64
64
|
return [e];
|
65
65
|
const i = function(l) {
|
@@ -80,27 +80,27 @@ function Fa(s, e, t) {
|
|
80
80
|
enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);
|
81
81
|
gl_FragColor = enc;
|
82
82
|
}
|
83
|
-
`, m = l.createShader(35633), f = l.createShader(35632),
|
84
|
-
if (!(f && m &&
|
83
|
+
`, m = l.createShader(35633), f = l.createShader(35632), C = l.createProgram();
|
84
|
+
if (!(f && m && C))
|
85
85
|
return;
|
86
|
-
l.shaderSource(m, d), l.shaderSource(f, p), l.compileShader(m), l.compileShader(f), l.attachShader(
|
86
|
+
l.shaderSource(m, d), l.shaderSource(f, p), l.compileShader(m), l.compileShader(f), l.attachShader(C, m), l.attachShader(C, f), l.linkProgram(C), l.detachShader(C, m), l.detachShader(C, f), l.deleteShader(m), l.deleteShader(f), l.useProgram(C);
|
87
87
|
const y = l.createBuffer();
|
88
88
|
l.bindBuffer(34962, y), l.bufferData(34962, new Float32Array([-1, -1, 0, 3, -1, 0, -1, 3, 0]), 35044);
|
89
|
-
const T = l.getAttribLocation(
|
89
|
+
const T = l.getAttribLocation(C, "aPosition");
|
90
90
|
l.vertexAttribPointer(T, 3, 5126, !1, 0, 0), l.enableVertexAttribArray(T), l.clearColor(1, 1, 1, 1), l.clear(16384), l.viewport(0, 0, 1, 1), l.drawArrays(4, 0, 3);
|
91
91
|
const g = new Uint8Array(4);
|
92
|
-
return l.readPixels(0, 0, 1, 1, 6408, 5121, g), l.deleteProgram(
|
92
|
+
return l.readPixels(0, 0, 1, 1, 6408, 5121, g), l.deleteProgram(C), l.deleteBuffer(y), g.join("");
|
93
93
|
}(s), n = "801621810", r = "8016218135", a = "80162181161", o = Le?.isIpad ? [["a7", a, 12], ["a8", r, 15], ["a8x", r, 15], ["a9", r, 15], ["a9x", r, 15], ["a10", r, 15], ["a10x", r, 15], ["a12", n, 15], ["a12x", n, 15], ["a12z", n, 15], ["a14", n, 15], ["a15", n, 15], ["m1", n, 15], ["m2", n, 15]] : [["a7", a, 12], ["a8", r, 12], ["a9", r, 15], ["a10", r, 15], ["a11", n, 15], ["a12", n, 15], ["a13", n, 15], ["a14", n, 15], ["a15", n, 15], ["a16", n, 15], ["a17", n, 15]];
|
94
94
|
let c;
|
95
95
|
return i === "80162181255" ? c = o.filter(([, , l]) => l >= 14) : (c = o.filter(([, l]) => l === i), c.length || (c = o)), c.map(([l]) => `apple ${l} gpu`);
|
96
96
|
}
|
97
|
-
class
|
97
|
+
class fs extends Error {
|
98
98
|
constructor(e) {
|
99
99
|
super(e), Object.setPrototypeOf(this, new.target.prototype);
|
100
100
|
}
|
101
101
|
}
|
102
|
-
const
|
103
|
-
function
|
102
|
+
const yi = [], gs = [];
|
103
|
+
function Ba(s, e) {
|
104
104
|
if (s === e)
|
105
105
|
return 0;
|
106
106
|
const t = s;
|
@@ -115,30 +115,30 @@ function za(s, e) {
|
|
115
115
|
return n;
|
116
116
|
let o, c, l = 0, d = 0, p = 0;
|
117
117
|
for (; d < i; )
|
118
|
-
|
118
|
+
gs[d] = s.charCodeAt(a + d), yi[d] = ++d;
|
119
119
|
for (; p < n; )
|
120
120
|
for (r = e.charCodeAt(a + p), o = p++, l = p, d = 0; d < i; d++)
|
121
|
-
c = r ===
|
121
|
+
c = r === gs[d] ? o : o + 1, o = yi[d], l = yi[d] = o > l ? c > l ? l + 1 : c : c > o ? o + 1 : c;
|
122
122
|
return l;
|
123
123
|
}
|
124
|
-
function
|
124
|
+
function Va(s) {
|
125
125
|
return s != null;
|
126
126
|
}
|
127
|
-
const
|
127
|
+
const Za = ({ mobileTiers: s = [0, 15, 30, 60], desktopTiers: e = [0, 15, 30, 60], override: t = {}, glContext: i, failIfMajorPerformanceCaveat: n = !1, benchmarksURL: r = "https://unpkg.com/detect-gpu@5.0.57/dist/benchmarks" } = {}) => vi(void 0, void 0, void 0, function* () {
|
128
128
|
const a = {};
|
129
|
-
if (
|
129
|
+
if (_n)
|
130
130
|
return { tier: 0, type: "SSR" };
|
131
|
-
const { isIpad: o = !!Le?.isIpad, isMobile: c = !!Le?.isMobile, screenSize: l = window.screen, loadBenchmarks: d = (w) =>
|
131
|
+
const { isIpad: o = !!Le?.isIpad, isMobile: c = !!Le?.isMobile, screenSize: l = window.screen, loadBenchmarks: d = (w) => vi(void 0, void 0, void 0, function* () {
|
132
132
|
const O = yield fetch(`${r}/${w}`).then((L) => L.json());
|
133
133
|
if (parseInt(O.shift().split(".")[0], 10) < 4)
|
134
|
-
throw new
|
134
|
+
throw new fs("Detect GPU benchmark data is out of date. Please update to version 4x");
|
135
135
|
return O;
|
136
136
|
}) } = t;
|
137
137
|
let { renderer: p } = t;
|
138
138
|
const m = (w, O, L, j, R) => ({ device: R, fps: j, gpu: L, isMobile: c, tier: w, type: O });
|
139
|
-
let f,
|
139
|
+
let f, C = "";
|
140
140
|
if (p)
|
141
|
-
p =
|
141
|
+
p = ms(p), f = [p];
|
142
142
|
else {
|
143
143
|
const w = i || function(L, j = !1) {
|
144
144
|
const R = { alpha: !1, antialias: !1, depth: !1, failIfMajorPerformanceCaveat: j, powerPreference: "high-performance", stencil: !1 };
|
@@ -151,13 +151,13 @@ const Ya = ({ mobileTiers: s = [0, 15, 30, 60], desktopTiers: e = [0, 15, 30, 60
|
|
151
151
|
const O = Le?.isFirefox ? null : w.getExtension("WEBGL_debug_renderer_info");
|
152
152
|
if (p = O ? w.getParameter(O.UNMASKED_RENDERER_WEBGL) : w.getParameter(w.RENDERER), !p)
|
153
153
|
return m(1, "FALLBACK");
|
154
|
-
|
155
|
-
return j === "apple gpu" ?
|
154
|
+
C = p, p = ms(p), f = function(L, j, R) {
|
155
|
+
return j === "apple gpu" ? Ya(L, j, R) : [j];
|
156
156
|
}(w, p, c);
|
157
157
|
}
|
158
158
|
const y = (yield Promise.all(f.map(function(w) {
|
159
159
|
var O;
|
160
|
-
return
|
160
|
+
return vi(this, void 0, void 0, function* () {
|
161
161
|
const L = ((W) => {
|
162
162
|
const le = c ? ["adreno", "apple", "mali-t", "mali", "nvidia", "powervr", "samsung"] : ["intel", "apple", "amd", "radeon", "nvidia", "geforce", "adreno"];
|
163
163
|
for (const Te of le)
|
@@ -171,7 +171,7 @@ const Ya = ({ mobileTiers: s = [0, 15, 30, 60], desktopTiers: e = [0, 15, 30, 60
|
|
171
171
|
try {
|
172
172
|
B = yield R;
|
173
173
|
} catch (W) {
|
174
|
-
if (W instanceof
|
174
|
+
if (W instanceof fs)
|
175
175
|
throw W;
|
176
176
|
return;
|
177
177
|
}
|
@@ -185,36 +185,36 @@ const Ya = ({ mobileTiers: s = [0, 15, 30, 60], desktopTiers: e = [0, 15, 30, 60
|
|
185
185
|
const re = _e.length;
|
186
186
|
if (re === 0)
|
187
187
|
return;
|
188
|
-
const
|
189
|
-
let $, [Ue, , , , he] = re > 1 ? _e.map((W) => [W,
|
188
|
+
const q = w.split(/[.,()\[\]/\s]/g).sort().filter((W, le, Te) => le === 0 || W !== Te[le - 1]).join(" ");
|
189
|
+
let $, [Ue, , , , he] = re > 1 ? _e.map((W) => [W, Ba(q, W[2])]).sort(([, W], [, le]) => W - le)[0][0] : _e[0], Ee = Number.MAX_VALUE;
|
190
190
|
const { devicePixelRatio: se } = window, je = l.width * se * l.height * se;
|
191
191
|
for (const W of he) {
|
192
|
-
const [le, Te] = W,
|
193
|
-
it <
|
192
|
+
const [le, Te] = W, yt = le * Te, it = Math.abs(je - yt);
|
193
|
+
it < Ee && (Ee = it, $ = W);
|
194
194
|
}
|
195
195
|
if (!$)
|
196
196
|
return;
|
197
197
|
const [, , Ne, Fe] = $;
|
198
|
-
return [
|
198
|
+
return [Ee, Ne, Ue, Fe];
|
199
199
|
});
|
200
|
-
}))).filter(
|
200
|
+
}))).filter(Va).sort(([w = Number.MAX_VALUE, O], [L = Number.MAX_VALUE, j]) => w === L ? O - j : w - L);
|
201
201
|
if (!y.length) {
|
202
|
-
const w =
|
203
|
-
return w ? m(0, "BLOCKLISTED", w) : m(1, "FALLBACK", `${p} (${
|
202
|
+
const w = Ha.find((O) => p.includes(O));
|
203
|
+
return w ? m(0, "BLOCKLISTED", w) : m(1, "FALLBACK", `${p} (${C})`);
|
204
204
|
}
|
205
205
|
const [, T, g, v] = y[0];
|
206
206
|
if (T === -1)
|
207
207
|
return m(0, "BLOCKLISTED", g, T, v);
|
208
208
|
const S = c ? s : e;
|
209
|
-
let
|
209
|
+
let E = 0;
|
210
210
|
for (let w = 0; w < S.length; w++)
|
211
|
-
T >= S[w] && (
|
212
|
-
return m(
|
211
|
+
T >= S[w] && (E = w);
|
212
|
+
return m(E, "BENCHMARK", g, T, v);
|
213
213
|
});
|
214
|
-
var
|
215
|
-
function
|
214
|
+
var Wa = /* @__PURE__ */ ((s) => (s[s.High = 0] = "High", s[s.Medium = 1] = "Medium", s[s.Low = 2] = "Low", s))(Wa || {});
|
215
|
+
function Ro(s) {
|
216
216
|
return new Promise((e) => {
|
217
|
-
|
217
|
+
Za().then((t) => {
|
218
218
|
let i = !1;
|
219
219
|
const n = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
220
220
|
if (i = "transferControlToOffscreen" in s, n) {
|
@@ -238,22 +238,22 @@ function Co(s) {
|
|
238
238
|
function $e(s, e, t) {
|
239
239
|
return Math.min(e, Math.max(s, t));
|
240
240
|
}
|
241
|
-
function
|
241
|
+
function _s(s, e, t) {
|
242
242
|
return (t - s) / (e - s);
|
243
243
|
}
|
244
|
-
function
|
244
|
+
function ki(s, e, t) {
|
245
245
|
return s * (1 - t) + e * t;
|
246
246
|
}
|
247
|
-
function
|
247
|
+
function Io(s, e) {
|
248
248
|
const t = s - e;
|
249
249
|
return Math.sqrt(t * t);
|
250
250
|
}
|
251
|
-
function
|
251
|
+
function Pe(s, e = 1) {
|
252
252
|
return Number(s.toFixed(e));
|
253
253
|
}
|
254
|
-
const
|
254
|
+
const Lo = (s) => {
|
255
255
|
s?.dispose();
|
256
|
-
},
|
256
|
+
}, Ga = (s) => {
|
257
257
|
s && (Array.isArray(s) ? s.forEach((e) => e.dispose()) : s.dispose());
|
258
258
|
}, He = (s) => {
|
259
259
|
if (s) {
|
@@ -263,19 +263,19 @@ const So = (s) => {
|
|
263
263
|
}
|
264
264
|
if (s.parent && s.parent.remove(s), s.isMesh) {
|
265
265
|
const e = s;
|
266
|
-
e.geometry?.dispose(),
|
266
|
+
e.geometry?.dispose(), Ga(e.material);
|
267
267
|
}
|
268
268
|
s.dispose !== void 0 && s.dispose();
|
269
269
|
}
|
270
270
|
};
|
271
|
-
let
|
272
|
-
const
|
273
|
-
|
274
|
-
},
|
271
|
+
let Ui = 0;
|
272
|
+
const vs = () => {
|
273
|
+
Ui = 0;
|
274
|
+
}, ji = (s) => {
|
275
275
|
if (!s)
|
276
276
|
return;
|
277
277
|
let e = s.name.replaceAll(" ", "").replaceAll("/", ".");
|
278
|
-
if (e.length === 0 && (e = `obj_${
|
278
|
+
if (e.length === 0 && (e = `obj_${Ui}`, Ui++), s.parent !== null && s.parent.uuid.length > 0 && (e = `${s.parent.uuid}.${e}`), s.uuid = e, s.isMesh !== void 0) {
|
279
279
|
const t = s;
|
280
280
|
if (Array.isArray(t.material))
|
281
281
|
t.material.forEach((i, n) => {
|
@@ -286,9 +286,9 @@ const fs = () => {
|
|
286
286
|
i.uuid = `${e}.material`;
|
287
287
|
}
|
288
288
|
}
|
289
|
-
s.children.forEach((t) =>
|
289
|
+
s.children.forEach((t) => ji(t));
|
290
290
|
};
|
291
|
-
class
|
291
|
+
class ti {
|
292
292
|
static renderer;
|
293
293
|
static canvas;
|
294
294
|
static context = null;
|
@@ -317,9 +317,9 @@ class ei {
|
|
317
317
|
}
|
318
318
|
static renderToCanvas(e) {
|
319
319
|
if (this.material === null) {
|
320
|
-
this.camera = new
|
321
|
-
const t = new
|
322
|
-
t.setAttribute("position", new
|
320
|
+
this.camera = new Ii(-0.5, 0.5, 0.5, -0.5, 0, 100), this.scene = new Gs(), this.material = new Je();
|
321
|
+
const t = new _t();
|
322
|
+
t.setAttribute("position", new qe([-0.5, -0.5, 0, 1.5, -0.5, 0, -0.5, 1.5, 0], 3)), t.setAttribute("normal", new qe([0, 0, 1, 0, 0, 1], 3)), t.setAttribute("uv", new qe([0, 0, 2, 0, 0, 2], 2));
|
323
323
|
const i = new M(t, this.material);
|
324
324
|
this.scene.add(i);
|
325
325
|
}
|
@@ -327,13 +327,13 @@ class ei {
|
|
327
327
|
this.material.map = e, this.renderer.render(this.scene, this.camera);
|
328
328
|
else {
|
329
329
|
const t = this.renderer.outputColorSpace, i = e.colorSpace;
|
330
|
-
this.renderer.outputColorSpace =
|
330
|
+
this.renderer.outputColorSpace = Nt, e.colorSpace = Nt, this.material.map = e, this.renderer.render(this.scene, this.camera), this.renderer.outputColorSpace = t, e.colorSpace = i;
|
331
331
|
}
|
332
332
|
return this.renderer.domElement;
|
333
333
|
}
|
334
334
|
}
|
335
|
-
function
|
336
|
-
const e = new
|
335
|
+
function ko(s) {
|
336
|
+
const e = new Gn(), t = e.parse(s.scene), i = new Xn(t);
|
337
337
|
if (s.animations.length > 0) {
|
338
338
|
const r = s.animations.map((o) => AnimationClip.parse(o));
|
339
339
|
i.clipAction(r[0]).play();
|
@@ -348,13 +348,127 @@ function wo(s) {
|
|
348
348
|
cameras: n
|
349
349
|
};
|
350
350
|
}
|
351
|
-
|
351
|
+
const at = Zi([
|
352
|
+
"ctrlKey",
|
353
|
+
"metaKey",
|
354
|
+
"shiftKey",
|
355
|
+
"button",
|
356
|
+
"pointerId",
|
357
|
+
"pointerType",
|
358
|
+
"clientX",
|
359
|
+
"clientY",
|
360
|
+
"pageX",
|
361
|
+
"pageY"
|
362
|
+
]), Xa = Zi([
|
363
|
+
"clientX",
|
364
|
+
"clientY",
|
365
|
+
"deltaX",
|
366
|
+
"deltaY",
|
367
|
+
"deltaMode"
|
368
|
+
]), $a = Zi([
|
369
|
+
"ctrlKey",
|
370
|
+
"metaKey",
|
371
|
+
"shiftKey",
|
372
|
+
"keyCode"
|
373
|
+
]);
|
374
|
+
function Ka(s, e) {
|
375
|
+
s.preventDefault(), Xa(s, e);
|
376
|
+
}
|
377
|
+
function qa(s) {
|
378
|
+
s.preventDefault();
|
379
|
+
}
|
380
|
+
function Qa(s, e, t) {
|
381
|
+
for (const i of e)
|
382
|
+
t[i] = s[i];
|
383
|
+
}
|
384
|
+
function Zi(s) {
|
385
|
+
return function(t, i) {
|
386
|
+
const n = { type: t.type };
|
387
|
+
Qa(t, s, n), i(n);
|
388
|
+
};
|
389
|
+
}
|
390
|
+
function bi(s, e) {
|
391
|
+
const t = [], i = { type: s.type, touches: t };
|
392
|
+
for (let n = 0; n < s.touches.length; ++n) {
|
393
|
+
const r = s.touches[n];
|
394
|
+
t.push({
|
395
|
+
pageX: r.pageX,
|
396
|
+
pageY: r.pageY
|
397
|
+
});
|
398
|
+
}
|
399
|
+
e(i);
|
400
|
+
}
|
401
|
+
const Ja = {
|
402
|
+
37: !0,
|
403
|
+
// left
|
404
|
+
38: !0,
|
405
|
+
// up
|
406
|
+
39: !0,
|
407
|
+
// right
|
408
|
+
40: !0
|
409
|
+
// down
|
410
|
+
};
|
411
|
+
function er(s, e) {
|
412
|
+
const { keyCode: t } = s;
|
413
|
+
Ja[t] && (s.preventDefault(), $a(s, e));
|
414
|
+
}
|
415
|
+
const Uo = {
|
416
|
+
contextmenu: qa,
|
417
|
+
mousedown: at,
|
418
|
+
mousemove: at,
|
419
|
+
mouseup: at,
|
420
|
+
pointerdown: at,
|
421
|
+
pointermove: at,
|
422
|
+
pointerup: at,
|
423
|
+
touchstart: bi,
|
424
|
+
touchmove: bi,
|
425
|
+
touchend: bi,
|
426
|
+
wheel: Ka,
|
427
|
+
keydown: er
|
428
|
+
};
|
429
|
+
let tr = 0;
|
430
|
+
class jo {
|
431
|
+
id;
|
432
|
+
worker;
|
433
|
+
constructor(e, t, i) {
|
434
|
+
this.id = tr++, this.worker = t;
|
435
|
+
const n = (a) => {
|
436
|
+
this.worker.postMessage({
|
437
|
+
type: "event",
|
438
|
+
id: this.id,
|
439
|
+
data: a
|
440
|
+
});
|
441
|
+
};
|
442
|
+
t.postMessage({
|
443
|
+
type: "makeProxy",
|
444
|
+
id: this.id
|
445
|
+
});
|
446
|
+
for (const [a, o] of Object.entries(i))
|
447
|
+
e.addEventListener(a, (c) => {
|
448
|
+
o(c, n);
|
449
|
+
});
|
450
|
+
function r() {
|
451
|
+
n({
|
452
|
+
type: "resize",
|
453
|
+
left: 0,
|
454
|
+
top: 0,
|
455
|
+
width: innerWidth,
|
456
|
+
height: innerHeight
|
457
|
+
});
|
458
|
+
}
|
459
|
+
window.addEventListener("resize", r), r();
|
460
|
+
}
|
461
|
+
}
|
462
|
+
class ir extends Yi {
|
352
463
|
style = {};
|
353
464
|
left = 0;
|
354
465
|
top = 0;
|
355
466
|
width = 0;
|
356
467
|
height = 0;
|
357
468
|
ownerDocument = void 0;
|
469
|
+
constructor() {
|
470
|
+
super(), this.ownerDocument = this;
|
471
|
+
}
|
358
472
|
get clientWidth() {
|
359
473
|
return this.width;
|
360
474
|
}
|
@@ -391,7 +505,7 @@ class Za extends zi {
|
|
391
505
|
this.left = e.left, this.top = e.top, this.width = e.width, this.height = e.height;
|
392
506
|
return;
|
393
507
|
}
|
394
|
-
e.preventDefault =
|
508
|
+
e.preventDefault = ai, e.stopPropagation = ai, this.dispatchEvent(e);
|
395
509
|
}
|
396
510
|
focus() {
|
397
511
|
}
|
@@ -399,13 +513,13 @@ class Za extends zi {
|
|
399
513
|
return this;
|
400
514
|
}
|
401
515
|
}
|
402
|
-
class
|
516
|
+
class No {
|
403
517
|
targets = {};
|
404
518
|
constructor() {
|
405
519
|
this.handleEvent = this.handleEvent.bind(this);
|
406
520
|
}
|
407
521
|
makeProxy(e) {
|
408
|
-
const { id: t } = e, i = new
|
522
|
+
const { id: t } = e, i = new ir();
|
409
523
|
this.targets[t] = i;
|
410
524
|
}
|
411
525
|
getProxy(e) {
|
@@ -415,10 +529,7 @@ class xo {
|
|
415
529
|
this.targets[e.id]?.handleEvent(e.data);
|
416
530
|
}
|
417
531
|
}
|
418
|
-
|
419
|
-
return new Worker(new URL("/assets/LoadWorker-5918cc62.js", self.location), { type: "module" });
|
420
|
-
}
|
421
|
-
class To {
|
532
|
+
class Fo {
|
422
533
|
components = /* @__PURE__ */ new Map();
|
423
534
|
listen;
|
424
535
|
// Protected
|
@@ -476,9 +587,9 @@ class To {
|
|
476
587
|
e && (this._mode = "editor");
|
477
588
|
}
|
478
589
|
}
|
479
|
-
var
|
480
|
-
const D = new
|
481
|
-
class
|
590
|
+
var A = /* @__PURE__ */ ((s) => (s.CUSTOM = "ToolEvents::custom", s.SELECT_DROPDOWN = "ToolEvents::selectDropdown", s.DRAG_UPDATE = "ToolEvents::dragUpdate", s.ADD_SCENE = "ToolEvents::addScene", s.REFRESH_SCENE = "ToolEvents::refreshScene", s.REMOVE_SCENE = "ToolEvents::removeScene", s.SET_SCENE = "ToolEvents::setScene", s.GET_OBJECT = "ToolEvents::getObject", s.SET_OBJECT = "ToolEvents::setObject", s.UPDATE_OBJECT = "ToolEvents::updateObject", s.CREATE_TEXTURE = "ToolEvents::createTexture", s.REQUEST_METHOD = "ToolEvents::requestMethod", s.ADD_CAMERA = "ToolEvents::addCamera", s.REMOVE_CAMERA = "ToolEvents::removeCamera", s.ADD_GROUP = "ToolEvents::addGroup", s.REMOVE_GROUP = "ToolEvents::removeGroup", s.ADD_SPLINE = "ToolEvents::addSpline", s.ADD_RENDERER = "ToolEvents::addRenderer", s.UPDATE_RENDERER = "ToolEvents::updateRenderer", s))(A || {});
|
591
|
+
const D = new Yi();
|
592
|
+
class Wi {
|
482
593
|
app;
|
483
594
|
constructor(e) {
|
484
595
|
this.app = e;
|
@@ -490,7 +601,7 @@ class Bi {
|
|
490
601
|
handleEditor(e, t, i) {
|
491
602
|
}
|
492
603
|
}
|
493
|
-
class
|
604
|
+
class zo extends Wi {
|
494
605
|
selectDropdown(e, t) {
|
495
606
|
this.app.send({
|
496
607
|
event: "selectComponent",
|
@@ -514,15 +625,15 @@ class Mo extends Bi {
|
|
514
625
|
handleApp(e, t, i) {
|
515
626
|
switch (i.event) {
|
516
627
|
case "selectComponent":
|
517
|
-
D.dispatchEvent({ type:
|
628
|
+
D.dispatchEvent({ type: A.SELECT_DROPDOWN, value: i.data });
|
518
629
|
break;
|
519
630
|
case "draggableListUpdate":
|
520
|
-
D.dispatchEvent({ type:
|
631
|
+
D.dispatchEvent({ type: A.DRAG_UPDATE, value: i.data });
|
521
632
|
break;
|
522
633
|
}
|
523
634
|
}
|
524
635
|
}
|
525
|
-
function
|
636
|
+
function Ho(s, e, t) {
|
526
637
|
if (s.editor) {
|
527
638
|
t.ui.restore(), t.onSelectionChange((a) => {
|
528
639
|
a.length < 1 || a.forEach((o) => {
|
@@ -565,7 +676,7 @@ function Ao(s, e, t) {
|
|
565
676
|
} else
|
566
677
|
t.ui.hide();
|
567
678
|
}
|
568
|
-
function
|
679
|
+
function Yo() {
|
569
680
|
setTimeout(() => {
|
570
681
|
const s = document.getElementById("theatrejs-studio-root");
|
571
682
|
if (s === null || s.shadowRoot === null)
|
@@ -591,7 +702,7 @@ function Po() {
|
|
591
702
|
}
|
592
703
|
}, 1e3);
|
593
704
|
}
|
594
|
-
class
|
705
|
+
class Bo extends Wi {
|
595
706
|
project;
|
596
707
|
sheets = /* @__PURE__ */ new Map();
|
597
708
|
sheetObjects = /* @__PURE__ */ new Map();
|
@@ -653,16 +764,16 @@ class Do extends Bi {
|
|
653
764
|
return;
|
654
765
|
const c = `${this.getSheetInstance(e, r)}_${t}`;
|
655
766
|
let l = this.sheetObjects.get(c);
|
656
|
-
l !== void 0 ? l = a.object(t, { ...i, ...l.value }, { reconfigure: !0 }) : l = a.object(t, i), this.sheetObjects.set(c, l), this.sheetObjectCBs.set(c, n !== void 0 ? n :
|
767
|
+
l !== void 0 ? l = a.object(t, { ...i, ...l.value }, { reconfigure: !0 }) : l = a.object(t, i), this.sheetObjects.set(c, l), this.sheetObjectCBs.set(c, n !== void 0 ? n : ai);
|
657
768
|
const d = l.onValuesChange((p) => {
|
658
769
|
if (this.app.editor) {
|
659
770
|
for (const f in p) {
|
660
|
-
const
|
661
|
-
typeof
|
662
|
-
r:
|
663
|
-
g:
|
664
|
-
b:
|
665
|
-
a:
|
771
|
+
const C = p[f];
|
772
|
+
typeof C == "object" && za(C) && (p[f] = {
|
773
|
+
r: C.r,
|
774
|
+
g: C.g,
|
775
|
+
b: C.b,
|
776
|
+
a: C.a
|
666
777
|
});
|
667
778
|
}
|
668
779
|
this.app.send({
|
@@ -765,7 +876,7 @@ class Do extends Bi {
|
|
765
876
|
this.studio?.ui.hide();
|
766
877
|
}
|
767
878
|
}
|
768
|
-
function
|
879
|
+
function sr(s) {
|
769
880
|
if (s.name === "cameras")
|
770
881
|
return "camera";
|
771
882
|
if (s.name === "interactive")
|
@@ -779,7 +890,7 @@ function Wa(s) {
|
|
779
890
|
const e = s.type;
|
780
891
|
return e.search("Helper") > -1 ? "icon_utils" : e.search("Camera") > -1 ? "camera" : e.search("Light") > -1 ? "light" : "obj3D";
|
781
892
|
}
|
782
|
-
function
|
893
|
+
function pt(s) {
|
783
894
|
const e = {
|
784
895
|
name: s.name,
|
785
896
|
type: s.type,
|
@@ -787,10 +898,10 @@ function ut(s) {
|
|
787
898
|
children: []
|
788
899
|
};
|
789
900
|
return s.children.forEach((t) => {
|
790
|
-
e.children.push(
|
901
|
+
e.children.push(pt(t));
|
791
902
|
}), e;
|
792
903
|
}
|
793
|
-
function
|
904
|
+
function nr(s) {
|
794
905
|
const e = {};
|
795
906
|
for (const t in s) {
|
796
907
|
const i = s[t].value;
|
@@ -806,7 +917,7 @@ function Ga(s) {
|
|
806
917
|
}
|
807
918
|
return e;
|
808
919
|
}
|
809
|
-
function
|
920
|
+
function ar(s) {
|
810
921
|
switch (s) {
|
811
922
|
case "blendSrcAlpha":
|
812
923
|
case "blendDstAlpha":
|
@@ -818,10 +929,10 @@ function Xa(s) {
|
|
818
929
|
}
|
819
930
|
return !1;
|
820
931
|
}
|
821
|
-
function
|
932
|
+
function rt(s) {
|
822
933
|
const e = {};
|
823
934
|
for (const t in s) {
|
824
|
-
if (t.substring(0, 1) === "_" || t.substring(0, 2) === "is" ||
|
935
|
+
if (t.substring(0, 1) === "_" || t.substring(0, 2) === "is" || ar(t))
|
825
936
|
continue;
|
826
937
|
const i = typeof s[t], n = s[t];
|
827
938
|
switch (i) {
|
@@ -832,10 +943,10 @@ function at(s) {
|
|
832
943
|
break;
|
833
944
|
case "object":
|
834
945
|
n !== null ? (e[t] = n, n.isTexture ? e[t] = {
|
835
|
-
src:
|
946
|
+
src: ti.renderToBlob(n),
|
836
947
|
offset: [n.offset.x, n.offset.y],
|
837
948
|
repeat: [n.repeat.x, n.repeat.y]
|
838
|
-
} : t === "uniforms" && (e[t] =
|
949
|
+
} : t === "uniforms" && (e[t] = nr(e[t]))) : t === "glslVersion" ? e[t] = "" : e[t] = {
|
839
950
|
src: "",
|
840
951
|
offset: [0, 0],
|
841
952
|
repeat: [1, 1]
|
@@ -845,7 +956,7 @@ function at(s) {
|
|
845
956
|
}
|
846
957
|
return s.anisotropy !== void 0 && (e.anisotropy = s.anisotropy), s.clearcoat !== void 0 && (e.clearcoat = s.clearcoat), s.iridescence !== void 0 && (e.iridescence = s.iridescence), s.dispersion !== void 0 && (e.dispersion = s.dispersion), s.sheen !== void 0 && (e.sheen = s.sheen), s.transmission !== void 0 && (e.transmission = s.transmission), s.transmission !== void 0 && (e.transmission = s.transmission), e;
|
847
958
|
}
|
848
|
-
function
|
959
|
+
function Ei(s) {
|
849
960
|
s.updateMatrix();
|
850
961
|
const e = {
|
851
962
|
name: s.name,
|
@@ -873,28 +984,28 @@ function yi(s) {
|
|
873
984
|
if (Array.isArray(i.material)) {
|
874
985
|
const n = [];
|
875
986
|
i.material.forEach((r) => {
|
876
|
-
n.push(
|
987
|
+
n.push(rt(r));
|
877
988
|
}), e.material = n;
|
878
989
|
} else
|
879
|
-
e.material =
|
990
|
+
e.material = rt(i.material);
|
880
991
|
} else if (t.search("points") > -1) {
|
881
992
|
const i = s;
|
882
993
|
if (Array.isArray(i.material)) {
|
883
994
|
const n = [];
|
884
995
|
i.material.forEach((r) => {
|
885
|
-
n.push(
|
996
|
+
n.push(rt(r));
|
886
997
|
}), e.material = n;
|
887
998
|
} else
|
888
|
-
e.material =
|
999
|
+
e.material = rt(i.material);
|
889
1000
|
} else if (t.search("line") > -1) {
|
890
1001
|
const i = s;
|
891
1002
|
if (Array.isArray(i.material)) {
|
892
1003
|
const n = [];
|
893
1004
|
i.material.forEach((r) => {
|
894
|
-
n.push(
|
1005
|
+
n.push(rt(r));
|
895
1006
|
}), e.material = n;
|
896
1007
|
} else
|
897
|
-
e.material =
|
1008
|
+
e.material = rt(i.material);
|
898
1009
|
} else
|
899
1010
|
t.search("camera") > -1 ? s.type === "PerspectiveCamera" ? e.perspectiveCameraInfo = {
|
900
1011
|
fov: s.fov,
|
@@ -926,7 +1037,7 @@ function yi(s) {
|
|
926
1037
|
});
|
927
1038
|
return e;
|
928
1039
|
}
|
929
|
-
function
|
1040
|
+
function rr(s, e) {
|
930
1041
|
const t = e.split(".");
|
931
1042
|
switch (t.length) {
|
932
1043
|
case 1:
|
@@ -943,7 +1054,7 @@ function $a(s, e) {
|
|
943
1054
|
return s[t[0]][t[1]][t[2]][t[3]][t[4]][t[5]];
|
944
1055
|
}
|
945
1056
|
}
|
946
|
-
function
|
1057
|
+
function or(s, e) {
|
947
1058
|
for (const t in e)
|
948
1059
|
s[t] = e[t];
|
949
1060
|
}
|
@@ -988,19 +1099,19 @@ function ie(s, e, t) {
|
|
988
1099
|
a = s[i[0]][i[1]][i[2]][i[3]][i[4]];
|
989
1100
|
break;
|
990
1101
|
}
|
991
|
-
a != null &&
|
1102
|
+
a != null && or(a, t);
|
992
1103
|
}
|
993
1104
|
}
|
994
|
-
function
|
1105
|
+
function vn(s) {
|
995
1106
|
return new Promise((e, t) => {
|
996
1107
|
const i = new Image();
|
997
1108
|
i.onload = () => {
|
998
|
-
const n = new
|
999
|
-
n.wrapS =
|
1109
|
+
const n = new $n(i);
|
1110
|
+
n.wrapS = ls, n.wrapT = ls, n.needsUpdate = !0, e(n);
|
1000
1111
|
}, i.onerror = t, i.src = s;
|
1001
1112
|
});
|
1002
1113
|
}
|
1003
|
-
class
|
1114
|
+
class Vo extends Wi {
|
1004
1115
|
canvas = null;
|
1005
1116
|
// Canvas or OffscreenCanvas
|
1006
1117
|
inputElement = null;
|
@@ -1018,15 +1129,15 @@ class Ro extends Bi {
|
|
1018
1129
|
}), this.renderTargets.clear(), this.renderer?.dispose();
|
1019
1130
|
}
|
1020
1131
|
getObject(e) {
|
1021
|
-
this.app.debugEnabled && (this.renderer !== void 0 && (
|
1132
|
+
this.app.debugEnabled && (this.renderer !== void 0 && (ti.renderer = this.renderer), this.app.send({
|
1022
1133
|
event: "getObject",
|
1023
1134
|
target: "app",
|
1024
1135
|
data: e
|
1025
1136
|
}));
|
1026
1137
|
}
|
1027
1138
|
setObject(e) {
|
1028
|
-
this.renderer !== void 0 && (
|
1029
|
-
const t =
|
1139
|
+
this.renderer !== void 0 && (ti.renderer = this.renderer);
|
1140
|
+
const t = Ei(e);
|
1030
1141
|
this.app.send({
|
1031
1142
|
event: "setObject",
|
1032
1143
|
target: "editor",
|
@@ -1128,7 +1239,7 @@ class Ro extends Bi {
|
|
1128
1239
|
localClippingEnabled: e.localClippingEnabled,
|
1129
1240
|
clearColor: i,
|
1130
1241
|
clearAlpha: e.getClearAlpha(),
|
1131
|
-
colorManagement:
|
1242
|
+
colorManagement: mt.enabled,
|
1132
1243
|
toneMapping: e.toneMapping,
|
1133
1244
|
toneMappingExposure: e.toneMappingExposure
|
1134
1245
|
}
|
@@ -1145,8 +1256,8 @@ class Ro extends Bi {
|
|
1145
1256
|
addScene(e) {
|
1146
1257
|
if (e === void 0 || (this.scenes.set(e.name, e), !this.app.debugEnabled))
|
1147
1258
|
return;
|
1148
|
-
|
1149
|
-
const t =
|
1259
|
+
vs(), ji(e);
|
1260
|
+
const t = pt(e);
|
1150
1261
|
this.app.send({
|
1151
1262
|
event: "addScene",
|
1152
1263
|
target: "editor",
|
@@ -1158,7 +1269,7 @@ class Ro extends Bi {
|
|
1158
1269
|
return;
|
1159
1270
|
const t = this.scenes.get(e);
|
1160
1271
|
if (t !== void 0) {
|
1161
|
-
const i =
|
1272
|
+
const i = pt(t);
|
1162
1273
|
this.app.send({
|
1163
1274
|
event: "refreshScene",
|
1164
1275
|
target: "app",
|
@@ -1169,7 +1280,7 @@ class Ro extends Bi {
|
|
1169
1280
|
removeScene(e) {
|
1170
1281
|
if (e === void 0 || (this.scenes.delete(e.name), !this.app.debugEnabled))
|
1171
1282
|
return;
|
1172
|
-
const t =
|
1283
|
+
const t = pt(e);
|
1173
1284
|
this.app.send({
|
1174
1285
|
event: "removeScene",
|
1175
1286
|
target: "editor",
|
@@ -1188,8 +1299,8 @@ class Ro extends Bi {
|
|
1188
1299
|
setScene(e) {
|
1189
1300
|
if (e === void 0 || (this.scene = e, !this.app.debugEnabled))
|
1190
1301
|
return;
|
1191
|
-
this.renderer !== void 0 && (
|
1192
|
-
const t =
|
1302
|
+
this.renderer !== void 0 && (ti.renderer = this.renderer), vs(), ji(e);
|
1303
|
+
const t = pt(e);
|
1193
1304
|
this.app.send({
|
1194
1305
|
event: "setScene",
|
1195
1306
|
target: "editor",
|
@@ -1200,7 +1311,7 @@ class Ro extends Bi {
|
|
1200
1311
|
addCamera(e) {
|
1201
1312
|
if (!this.app.debugEnabled)
|
1202
1313
|
return;
|
1203
|
-
const t =
|
1314
|
+
const t = Ei(e);
|
1204
1315
|
this.app.send({
|
1205
1316
|
event: "addCamera",
|
1206
1317
|
target: "editor",
|
@@ -1210,7 +1321,7 @@ class Ro extends Bi {
|
|
1210
1321
|
removeCamera(e) {
|
1211
1322
|
if (!this.app.debugEnabled)
|
1212
1323
|
return;
|
1213
|
-
const t =
|
1324
|
+
const t = Ei(e);
|
1214
1325
|
this.app.send({
|
1215
1326
|
event: "removeCamera",
|
1216
1327
|
target: "editor",
|
@@ -1221,26 +1332,26 @@ class Ro extends Bi {
|
|
1221
1332
|
const n = t;
|
1222
1333
|
switch (i.event) {
|
1223
1334
|
case "getObject":
|
1224
|
-
D.dispatchEvent({ type:
|
1335
|
+
D.dispatchEvent({ type: A.GET_OBJECT, value: i.data });
|
1225
1336
|
break;
|
1226
1337
|
case "updateObject":
|
1227
|
-
D.dispatchEvent({ type:
|
1338
|
+
D.dispatchEvent({ type: A.UPDATE_OBJECT, value: i.data });
|
1228
1339
|
break;
|
1229
1340
|
case "createTexture":
|
1230
|
-
D.dispatchEvent({ type:
|
1341
|
+
D.dispatchEvent({ type: A.CREATE_TEXTURE, value: i.data });
|
1231
1342
|
break;
|
1232
1343
|
case "requestMethod":
|
1233
|
-
D.dispatchEvent({ type:
|
1344
|
+
D.dispatchEvent({ type: A.REQUEST_METHOD, value: i.data });
|
1234
1345
|
break;
|
1235
1346
|
case "refreshScene":
|
1236
1347
|
e.send({
|
1237
1348
|
event: "refreshScene",
|
1238
1349
|
target: "editor",
|
1239
|
-
data:
|
1350
|
+
data: pt(n.scenes.get(i.data.name))
|
1240
1351
|
});
|
1241
1352
|
break;
|
1242
1353
|
case "updateRenderer":
|
1243
|
-
n.renderer && (n.renderer.autoClear = i.data.autoClear, n.renderer.autoClearColor = i.data.autoClearColor, n.renderer.autoClearDepth = i.data.autoClearDepth, n.renderer.autoClearStencil = i.data.autoClearStencil, n.renderer.outputColorSpace = i.data.outputColorSpace, n.renderer.localClippingEnabled = i.data.localClippingEnabled, n.renderer.setClearColor(i.data.clearColor, i.data.clearAlpha), n.renderer.toneMapping = i.data.toneMapping, n.renderer.toneMappingExposure = i.data.toneMappingExposure,
|
1354
|
+
n.renderer && (n.renderer.autoClear = i.data.autoClear, n.renderer.autoClearColor = i.data.autoClearColor, n.renderer.autoClearDepth = i.data.autoClearDepth, n.renderer.autoClearStencil = i.data.autoClearStencil, n.renderer.outputColorSpace = i.data.outputColorSpace, n.renderer.localClippingEnabled = i.data.localClippingEnabled, n.renderer.setClearColor(i.data.clearColor, i.data.clearAlpha), n.renderer.toneMapping = i.data.toneMapping, n.renderer.toneMappingExposure = i.data.toneMappingExposure, mt.enabled = i.data.colorManagement);
|
1244
1355
|
break;
|
1245
1356
|
}
|
1246
1357
|
if (i.event === "updateGroup") {
|
@@ -1251,42 +1362,42 @@ class Ro extends Bi {
|
|
1251
1362
|
handleEditor(e, t, i) {
|
1252
1363
|
switch (i.event) {
|
1253
1364
|
case "setObject":
|
1254
|
-
D.dispatchEvent({ type:
|
1365
|
+
D.dispatchEvent({ type: A.SET_OBJECT, value: i.data });
|
1255
1366
|
break;
|
1256
1367
|
case "addScene":
|
1257
|
-
D.dispatchEvent({ type:
|
1368
|
+
D.dispatchEvent({ type: A.ADD_SCENE, value: i.data });
|
1258
1369
|
break;
|
1259
1370
|
case "refreshScene":
|
1260
|
-
D.dispatchEvent({ type:
|
1371
|
+
D.dispatchEvent({ type: A.REFRESH_SCENE, value: i.data });
|
1261
1372
|
break;
|
1262
1373
|
case "removeScene":
|
1263
|
-
D.dispatchEvent({ type:
|
1374
|
+
D.dispatchEvent({ type: A.REMOVE_SCENE, value: i.data });
|
1264
1375
|
break;
|
1265
1376
|
case "setScene":
|
1266
|
-
D.dispatchEvent({ type:
|
1377
|
+
D.dispatchEvent({ type: A.SET_SCENE, value: i.data });
|
1267
1378
|
break;
|
1268
1379
|
case "addCamera":
|
1269
|
-
D.dispatchEvent({ type:
|
1380
|
+
D.dispatchEvent({ type: A.ADD_CAMERA, value: i.data });
|
1270
1381
|
break;
|
1271
1382
|
case "removeCamera":
|
1272
|
-
D.dispatchEvent({ type:
|
1383
|
+
D.dispatchEvent({ type: A.REMOVE_CAMERA, value: i.data });
|
1273
1384
|
break;
|
1274
1385
|
case "addGroup":
|
1275
|
-
D.dispatchEvent({ type:
|
1386
|
+
D.dispatchEvent({ type: A.ADD_GROUP, value: i.data });
|
1276
1387
|
break;
|
1277
1388
|
case "removeGroup":
|
1278
|
-
D.dispatchEvent({ type:
|
1389
|
+
D.dispatchEvent({ type: A.REMOVE_GROUP, value: i.data });
|
1279
1390
|
break;
|
1280
1391
|
case "addSpline":
|
1281
|
-
D.dispatchEvent({ type:
|
1392
|
+
D.dispatchEvent({ type: A.ADD_SPLINE, value: i.data });
|
1282
1393
|
break;
|
1283
1394
|
case "addRenderer":
|
1284
|
-
D.dispatchEvent({ type:
|
1395
|
+
D.dispatchEvent({ type: A.ADD_RENDERER, value: i.data });
|
1285
1396
|
}
|
1286
1397
|
}
|
1287
1398
|
// Renderer
|
1288
1399
|
addRT(e, t) {
|
1289
|
-
const i = new
|
1400
|
+
const i = new Kn(32, 32, t);
|
1290
1401
|
i.texture.name = e, this.renderTargets.set(e, i);
|
1291
1402
|
}
|
1292
1403
|
resize(e, t) {
|
@@ -1310,7 +1421,7 @@ class Ro extends Bi {
|
|
1310
1421
|
return this.renderer !== void 0 ? this.renderer.domElement.height / this.dpr : 0;
|
1311
1422
|
}
|
1312
1423
|
}
|
1313
|
-
var
|
1424
|
+
var Ni = { exports: {} }, St = {};
|
1314
1425
|
/**
|
1315
1426
|
* @license React
|
1316
1427
|
* react-jsx-runtime.production.min.js
|
@@ -1320,12 +1431,12 @@ var Ui = { exports: {} }, Et = {};
|
|
1320
1431
|
* This source code is licensed under the MIT license found in the
|
1321
1432
|
* LICENSE file in the root directory of this source tree.
|
1322
1433
|
*/
|
1323
|
-
var
|
1324
|
-
function
|
1325
|
-
if (
|
1326
|
-
return
|
1327
|
-
|
1328
|
-
var s =
|
1434
|
+
var ys;
|
1435
|
+
function lr() {
|
1436
|
+
if (ys)
|
1437
|
+
return St;
|
1438
|
+
ys = 1;
|
1439
|
+
var s = fn, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, n = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, r = { key: !0, ref: !0, __self: !0, __source: !0 };
|
1329
1440
|
function a(o, c, l) {
|
1330
1441
|
var d, p = {}, m = null, f = null;
|
1331
1442
|
l !== void 0 && (m = "" + l), c.key !== void 0 && (m = "" + c.key), c.ref !== void 0 && (f = c.ref);
|
@@ -1336,9 +1447,9 @@ function Ka() {
|
|
1336
1447
|
p[d] === void 0 && (p[d] = c[d]);
|
1337
1448
|
return { $$typeof: e, type: o, key: m, ref: f, props: p, _owner: n.current };
|
1338
1449
|
}
|
1339
|
-
return
|
1450
|
+
return St.Fragment = t, St.jsx = a, St.jsxs = a, St;
|
1340
1451
|
}
|
1341
|
-
var
|
1452
|
+
var wt = {};
|
1342
1453
|
/**
|
1343
1454
|
* @license React
|
1344
1455
|
* react-jsx-runtime.development.js
|
@@ -1348,14 +1459,14 @@ var St = {};
|
|
1348
1459
|
* This source code is licensed under the MIT license found in the
|
1349
1460
|
* LICENSE file in the root directory of this source tree.
|
1350
1461
|
*/
|
1351
|
-
var
|
1352
|
-
function
|
1353
|
-
return
|
1354
|
-
var s =
|
1462
|
+
var bs;
|
1463
|
+
function cr() {
|
1464
|
+
return bs || (bs = 1, process.env.NODE_ENV !== "production" && function() {
|
1465
|
+
var s = fn, e = Symbol.for("react.element"), t = Symbol.for("react.portal"), i = 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"), d = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), f = Symbol.for("react.offscreen"), C = Symbol.iterator, y = "@@iterator";
|
1355
1466
|
function T(h) {
|
1356
1467
|
if (h === null || typeof h != "object")
|
1357
1468
|
return null;
|
1358
|
-
var b =
|
1469
|
+
var b = C && h[C] || h[y];
|
1359
1470
|
return typeof b == "function" ? b : null;
|
1360
1471
|
}
|
1361
1472
|
var g = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
@@ -1376,10 +1487,10 @@ function Qa() {
|
|
1376
1487
|
G.unshift("Warning: " + b), Function.prototype.apply.call(console[h], console, G);
|
1377
1488
|
}
|
1378
1489
|
}
|
1379
|
-
var
|
1490
|
+
var E = !1, w = !1, O = !1, L = !1, j = !1, R;
|
1380
1491
|
R = Symbol.for("react.module.reference");
|
1381
1492
|
function B(h) {
|
1382
|
-
return !!(typeof h == "string" || typeof h == "function" || h === i || h === r || j || h === n || h === l || h === d || L || h === f ||
|
1493
|
+
return !!(typeof h == "string" || typeof h == "function" || h === i || h === r || j || h === n || h === l || h === d || L || h === f || E || w || O || typeof h == "object" && h !== null && (h.$$typeof === m || h.$$typeof === p || h.$$typeof === a || h.$$typeof === o || h.$$typeof === c || // This needs to include all possible module reference object
|
1383
1494
|
// types supported by any Flight configuration anywhere since
|
1384
1495
|
// we don't know which Flight build this will end up being used
|
1385
1496
|
// with.
|
@@ -1440,14 +1551,14 @@ function Qa() {
|
|
1440
1551
|
}
|
1441
1552
|
return null;
|
1442
1553
|
}
|
1443
|
-
var
|
1554
|
+
var q = Object.assign, $ = 0, Ue, he, Ee, se, je, Ne, Fe;
|
1444
1555
|
function W() {
|
1445
1556
|
}
|
1446
1557
|
W.__reactDisabledLog = !0;
|
1447
1558
|
function le() {
|
1448
1559
|
{
|
1449
1560
|
if ($ === 0) {
|
1450
|
-
Ue = console.log, he = console.info,
|
1561
|
+
Ue = console.log, he = console.info, Ee = console.warn, se = console.error, je = console.group, Ne = console.groupCollapsed, Fe = console.groupEnd;
|
1451
1562
|
var h = {
|
1452
1563
|
configurable: !0,
|
1453
1564
|
enumerable: !0,
|
@@ -1476,25 +1587,25 @@ function Qa() {
|
|
1476
1587
|
writable: !0
|
1477
1588
|
};
|
1478
1589
|
Object.defineProperties(console, {
|
1479
|
-
log:
|
1590
|
+
log: q({}, h, {
|
1480
1591
|
value: Ue
|
1481
1592
|
}),
|
1482
|
-
info:
|
1593
|
+
info: q({}, h, {
|
1483
1594
|
value: he
|
1484
1595
|
}),
|
1485
|
-
warn:
|
1486
|
-
value:
|
1596
|
+
warn: q({}, h, {
|
1597
|
+
value: Ee
|
1487
1598
|
}),
|
1488
|
-
error:
|
1599
|
+
error: q({}, h, {
|
1489
1600
|
value: se
|
1490
1601
|
}),
|
1491
|
-
group:
|
1602
|
+
group: q({}, h, {
|
1492
1603
|
value: je
|
1493
1604
|
}),
|
1494
|
-
groupCollapsed:
|
1605
|
+
groupCollapsed: q({}, h, {
|
1495
1606
|
value: Ne
|
1496
1607
|
}),
|
1497
|
-
groupEnd:
|
1608
|
+
groupEnd: q({}, h, {
|
1498
1609
|
value: Fe
|
1499
1610
|
})
|
1500
1611
|
});
|
@@ -1502,8 +1613,8 @@ function Qa() {
|
|
1502
1613
|
$ < 0 && v("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
1503
1614
|
}
|
1504
1615
|
}
|
1505
|
-
var
|
1506
|
-
function
|
1616
|
+
var yt = g.ReactCurrentDispatcher, it;
|
1617
|
+
function zt(h, b, x) {
|
1507
1618
|
{
|
1508
1619
|
if (it === void 0)
|
1509
1620
|
try {
|
@@ -1516,25 +1627,25 @@ function Qa() {
|
|
1516
1627
|
` + it + h;
|
1517
1628
|
}
|
1518
1629
|
}
|
1519
|
-
var
|
1630
|
+
var ui = !1, Ht;
|
1520
1631
|
{
|
1521
|
-
var
|
1522
|
-
|
1632
|
+
var wn = typeof WeakMap == "function" ? WeakMap : Map;
|
1633
|
+
Ht = new wn();
|
1523
1634
|
}
|
1524
|
-
function
|
1525
|
-
if (!h ||
|
1635
|
+
function Xi(h, b) {
|
1636
|
+
if (!h || ui)
|
1526
1637
|
return "";
|
1527
1638
|
{
|
1528
|
-
var x =
|
1639
|
+
var x = Ht.get(h);
|
1529
1640
|
if (x !== void 0)
|
1530
1641
|
return x;
|
1531
1642
|
}
|
1532
1643
|
var k;
|
1533
|
-
|
1644
|
+
ui = !0;
|
1534
1645
|
var H = Error.prepareStackTrace;
|
1535
1646
|
Error.prepareStackTrace = void 0;
|
1536
1647
|
var G;
|
1537
|
-
G =
|
1648
|
+
G = yt.current, yt.current = null, le();
|
1538
1649
|
try {
|
1539
1650
|
if (b) {
|
1540
1651
|
var F = function() {
|
@@ -1580,65 +1691,65 @@ function Qa() {
|
|
1580
1691
|
if (te--, ne--, ne < 0 || N[te] !== fe[ne]) {
|
1581
1692
|
var we = `
|
1582
1693
|
` + N[te].replace(" at new ", " at ");
|
1583
|
-
return h.displayName && we.includes("<anonymous>") && (we = we.replace("<anonymous>", h.displayName)), typeof h == "function" &&
|
1694
|
+
return h.displayName && we.includes("<anonymous>") && (we = we.replace("<anonymous>", h.displayName)), typeof h == "function" && Ht.set(h, we), we;
|
1584
1695
|
}
|
1585
1696
|
while (te >= 1 && ne >= 0);
|
1586
1697
|
break;
|
1587
1698
|
}
|
1588
1699
|
}
|
1589
1700
|
} finally {
|
1590
|
-
|
1701
|
+
ui = !1, yt.current = G, Te(), Error.prepareStackTrace = H;
|
1591
1702
|
}
|
1592
|
-
var nt = h ? h.displayName || h.name : "",
|
1593
|
-
return typeof h == "function" &&
|
1703
|
+
var nt = h ? h.displayName || h.name : "", os = nt ? zt(nt) : "";
|
1704
|
+
return typeof h == "function" && Ht.set(h, os), os;
|
1594
1705
|
}
|
1595
|
-
function
|
1596
|
-
return
|
1706
|
+
function xn(h, b, x) {
|
1707
|
+
return Xi(h, !1);
|
1597
1708
|
}
|
1598
|
-
function
|
1709
|
+
function On(h) {
|
1599
1710
|
var b = h.prototype;
|
1600
1711
|
return !!(b && b.isReactComponent);
|
1601
1712
|
}
|
1602
|
-
function
|
1713
|
+
function Yt(h, b, x) {
|
1603
1714
|
if (h == null)
|
1604
1715
|
return "";
|
1605
1716
|
if (typeof h == "function")
|
1606
|
-
return
|
1717
|
+
return Xi(h, On(h));
|
1607
1718
|
if (typeof h == "string")
|
1608
|
-
return
|
1719
|
+
return zt(h);
|
1609
1720
|
switch (h) {
|
1610
1721
|
case l:
|
1611
|
-
return
|
1722
|
+
return zt("Suspense");
|
1612
1723
|
case d:
|
1613
|
-
return
|
1724
|
+
return zt("SuspenseList");
|
1614
1725
|
}
|
1615
1726
|
if (typeof h == "object")
|
1616
1727
|
switch (h.$$typeof) {
|
1617
1728
|
case c:
|
1618
|
-
return
|
1729
|
+
return xn(h.render);
|
1619
1730
|
case p:
|
1620
|
-
return
|
1731
|
+
return Yt(h.type, b, x);
|
1621
1732
|
case m: {
|
1622
1733
|
var k = h, H = k._payload, G = k._init;
|
1623
1734
|
try {
|
1624
|
-
return
|
1735
|
+
return Yt(G(H), b, x);
|
1625
1736
|
} catch {
|
1626
1737
|
}
|
1627
1738
|
}
|
1628
1739
|
}
|
1629
1740
|
return "";
|
1630
1741
|
}
|
1631
|
-
var
|
1632
|
-
function
|
1742
|
+
var Bt = Object.prototype.hasOwnProperty, $i = {}, Ki = g.ReactDebugCurrentFrame;
|
1743
|
+
function Vt(h) {
|
1633
1744
|
if (h) {
|
1634
|
-
var b = h._owner, x =
|
1635
|
-
|
1745
|
+
var b = h._owner, x = Yt(h.type, h._source, b ? b.type : null);
|
1746
|
+
Ki.setExtraStackFrame(x);
|
1636
1747
|
} else
|
1637
|
-
|
1748
|
+
Ki.setExtraStackFrame(null);
|
1638
1749
|
}
|
1639
|
-
function
|
1750
|
+
function Tn(h, b, x, k, H) {
|
1640
1751
|
{
|
1641
|
-
var G = Function.call.bind(
|
1752
|
+
var G = Function.call.bind(Bt);
|
1642
1753
|
for (var F in h)
|
1643
1754
|
if (G(h, F)) {
|
1644
1755
|
var N = void 0;
|
@@ -1651,67 +1762,67 @@ function Qa() {
|
|
1651
1762
|
} catch (te) {
|
1652
1763
|
N = te;
|
1653
1764
|
}
|
1654
|
-
N && !(N instanceof Error) && (
|
1765
|
+
N && !(N instanceof Error) && (Vt(H), 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).", k || "React class", x, F, typeof N), Vt(null)), N instanceof Error && !(N.message in $i) && ($i[N.message] = !0, Vt(H), v("Failed %s type: %s", x, N.message), Vt(null));
|
1655
1766
|
}
|
1656
1767
|
}
|
1657
1768
|
}
|
1658
|
-
var
|
1659
|
-
function
|
1660
|
-
return
|
1769
|
+
var Mn = Array.isArray;
|
1770
|
+
function pi(h) {
|
1771
|
+
return Mn(h);
|
1661
1772
|
}
|
1662
|
-
function
|
1773
|
+
function Pn(h) {
|
1663
1774
|
{
|
1664
1775
|
var b = typeof Symbol == "function" && Symbol.toStringTag, x = b && h[Symbol.toStringTag] || h.constructor.name || "Object";
|
1665
1776
|
return x;
|
1666
1777
|
}
|
1667
1778
|
}
|
1668
|
-
function
|
1779
|
+
function An(h) {
|
1669
1780
|
try {
|
1670
|
-
return
|
1781
|
+
return qi(h), !1;
|
1671
1782
|
} catch {
|
1672
1783
|
return !0;
|
1673
1784
|
}
|
1674
1785
|
}
|
1675
|
-
function
|
1786
|
+
function qi(h) {
|
1676
1787
|
return "" + h;
|
1677
1788
|
}
|
1678
|
-
function
|
1679
|
-
if (
|
1680
|
-
return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
1789
|
+
function Qi(h) {
|
1790
|
+
if (An(h))
|
1791
|
+
return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Pn(h)), qi(h);
|
1681
1792
|
}
|
1682
|
-
var
|
1793
|
+
var bt = g.ReactCurrentOwner, Dn = {
|
1683
1794
|
key: !0,
|
1684
1795
|
ref: !0,
|
1685
1796
|
__self: !0,
|
1686
1797
|
__source: !0
|
1687
|
-
},
|
1688
|
-
|
1689
|
-
function
|
1690
|
-
if (
|
1798
|
+
}, Ji, es, mi;
|
1799
|
+
mi = {};
|
1800
|
+
function Rn(h) {
|
1801
|
+
if (Bt.call(h, "ref")) {
|
1691
1802
|
var b = Object.getOwnPropertyDescriptor(h, "ref").get;
|
1692
1803
|
if (b && b.isReactWarning)
|
1693
1804
|
return !1;
|
1694
1805
|
}
|
1695
1806
|
return h.ref !== void 0;
|
1696
1807
|
}
|
1697
|
-
function
|
1698
|
-
if (
|
1808
|
+
function In(h) {
|
1809
|
+
if (Bt.call(h, "key")) {
|
1699
1810
|
var b = Object.getOwnPropertyDescriptor(h, "key").get;
|
1700
1811
|
if (b && b.isReactWarning)
|
1701
1812
|
return !1;
|
1702
1813
|
}
|
1703
1814
|
return h.key !== void 0;
|
1704
1815
|
}
|
1705
|
-
function
|
1706
|
-
if (typeof h.ref == "string" &&
|
1707
|
-
var x = re(
|
1708
|
-
|
1816
|
+
function Ln(h, b) {
|
1817
|
+
if (typeof h.ref == "string" && bt.current && b && bt.current.stateNode !== b) {
|
1818
|
+
var x = re(bt.current.type);
|
1819
|
+
mi[x] || (v('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', re(bt.current.type), h.ref), mi[x] = !0);
|
1709
1820
|
}
|
1710
1821
|
}
|
1711
|
-
function
|
1822
|
+
function kn(h, b) {
|
1712
1823
|
{
|
1713
1824
|
var x = function() {
|
1714
|
-
|
1825
|
+
Ji || (Ji = !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)", b));
|
1715
1826
|
};
|
1716
1827
|
x.isReactWarning = !0, Object.defineProperty(h, "key", {
|
1717
1828
|
get: x,
|
@@ -1719,10 +1830,10 @@ function Qa() {
|
|
1719
1830
|
});
|
1720
1831
|
}
|
1721
1832
|
}
|
1722
|
-
function
|
1833
|
+
function Un(h, b) {
|
1723
1834
|
{
|
1724
1835
|
var x = function() {
|
1725
|
-
|
1836
|
+
es || (es = !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)", b));
|
1726
1837
|
};
|
1727
1838
|
x.isReactWarning = !0, Object.defineProperty(h, "ref", {
|
1728
1839
|
get: x,
|
@@ -1730,7 +1841,7 @@ function Qa() {
|
|
1730
1841
|
});
|
1731
1842
|
}
|
1732
1843
|
}
|
1733
|
-
var
|
1844
|
+
var jn = function(h, b, x, k, H, G, F) {
|
1734
1845
|
var N = {
|
1735
1846
|
// This tag allows us to uniquely identify this as a React Element
|
1736
1847
|
$$typeof: e,
|
@@ -1759,12 +1870,12 @@ function Qa() {
|
|
1759
1870
|
value: H
|
1760
1871
|
}), Object.freeze && (Object.freeze(N.props), Object.freeze(N)), N;
|
1761
1872
|
};
|
1762
|
-
function
|
1873
|
+
function Nn(h, b, x, k, H) {
|
1763
1874
|
{
|
1764
1875
|
var G, F = {}, N = null, fe = null;
|
1765
|
-
x !== void 0 && (
|
1876
|
+
x !== void 0 && (Qi(x), N = "" + x), In(b) && (Qi(b.key), N = "" + b.key), Rn(b) && (fe = b.ref, Ln(b, H));
|
1766
1877
|
for (G in b)
|
1767
|
-
|
1878
|
+
Bt.call(b, G) && !Dn.hasOwnProperty(G) && (F[G] = b[G]);
|
1768
1879
|
if (h && h.defaultProps) {
|
1769
1880
|
var te = h.defaultProps;
|
1770
1881
|
for (G in te)
|
@@ -1772,28 +1883,28 @@ function Qa() {
|
|
1772
1883
|
}
|
1773
1884
|
if (N || fe) {
|
1774
1885
|
var ne = typeof h == "function" ? h.displayName || h.name || "Unknown" : h;
|
1775
|
-
N &&
|
1886
|
+
N && kn(F, ne), fe && Un(F, ne);
|
1776
1887
|
}
|
1777
|
-
return
|
1888
|
+
return jn(h, N, fe, H, k, bt.current, F);
|
1778
1889
|
}
|
1779
1890
|
}
|
1780
|
-
var
|
1891
|
+
var fi = g.ReactCurrentOwner, ts = g.ReactDebugCurrentFrame;
|
1781
1892
|
function st(h) {
|
1782
1893
|
if (h) {
|
1783
|
-
var b = h._owner, x =
|
1784
|
-
|
1894
|
+
var b = h._owner, x = Yt(h.type, h._source, b ? b.type : null);
|
1895
|
+
ts.setExtraStackFrame(x);
|
1785
1896
|
} else
|
1786
|
-
|
1897
|
+
ts.setExtraStackFrame(null);
|
1787
1898
|
}
|
1788
|
-
var
|
1789
|
-
|
1790
|
-
function
|
1899
|
+
var gi;
|
1900
|
+
gi = !1;
|
1901
|
+
function _i(h) {
|
1791
1902
|
return typeof h == "object" && h !== null && h.$$typeof === e;
|
1792
1903
|
}
|
1793
|
-
function
|
1904
|
+
function is() {
|
1794
1905
|
{
|
1795
|
-
if (
|
1796
|
-
var h = re(
|
1906
|
+
if (fi.current) {
|
1907
|
+
var h = re(fi.current.type);
|
1797
1908
|
if (h)
|
1798
1909
|
return `
|
1799
1910
|
|
@@ -1802,7 +1913,7 @@ Check the render method of \`` + h + "`.";
|
|
1802
1913
|
return "";
|
1803
1914
|
}
|
1804
1915
|
}
|
1805
|
-
function
|
1916
|
+
function Fn(h) {
|
1806
1917
|
{
|
1807
1918
|
if (h !== void 0) {
|
1808
1919
|
var b = h.fileName.replace(/^.*[\\\/]/, ""), x = h.lineNumber;
|
@@ -1813,10 +1924,10 @@ Check your code at ` + b + ":" + x + ".";
|
|
1813
1924
|
return "";
|
1814
1925
|
}
|
1815
1926
|
}
|
1816
|
-
var
|
1817
|
-
function
|
1927
|
+
var ss = {};
|
1928
|
+
function zn(h) {
|
1818
1929
|
{
|
1819
|
-
var b =
|
1930
|
+
var b = is();
|
1820
1931
|
if (!b) {
|
1821
1932
|
var x = typeof h == "string" ? h : h.displayName || h.name;
|
1822
1933
|
x && (b = `
|
@@ -1826,39 +1937,39 @@ Check the top-level render call using <` + x + ">.");
|
|
1826
1937
|
return b;
|
1827
1938
|
}
|
1828
1939
|
}
|
1829
|
-
function
|
1940
|
+
function ns(h, b) {
|
1830
1941
|
{
|
1831
1942
|
if (!h._store || h._store.validated || h.key != null)
|
1832
1943
|
return;
|
1833
1944
|
h._store.validated = !0;
|
1834
|
-
var x =
|
1835
|
-
if (
|
1945
|
+
var x = zn(b);
|
1946
|
+
if (ss[x])
|
1836
1947
|
return;
|
1837
|
-
|
1948
|
+
ss[x] = !0;
|
1838
1949
|
var k = "";
|
1839
|
-
h && h._owner && h._owner !==
|
1950
|
+
h && h._owner && h._owner !== fi.current && (k = " It was passed a child from " + re(h._owner.type) + "."), st(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.', x, k), st(null);
|
1840
1951
|
}
|
1841
1952
|
}
|
1842
|
-
function
|
1953
|
+
function as(h, b) {
|
1843
1954
|
{
|
1844
1955
|
if (typeof h != "object")
|
1845
1956
|
return;
|
1846
|
-
if (
|
1957
|
+
if (pi(h))
|
1847
1958
|
for (var x = 0; x < h.length; x++) {
|
1848
1959
|
var k = h[x];
|
1849
|
-
|
1960
|
+
_i(k) && ns(k, b);
|
1850
1961
|
}
|
1851
|
-
else if (
|
1962
|
+
else if (_i(h))
|
1852
1963
|
h._store && (h._store.validated = !0);
|
1853
1964
|
else if (h) {
|
1854
1965
|
var H = T(h);
|
1855
1966
|
if (typeof H == "function" && H !== h.entries)
|
1856
1967
|
for (var G = H.call(h), F; !(F = G.next()).done; )
|
1857
|
-
|
1968
|
+
_i(F.value) && ns(F.value, b);
|
1858
1969
|
}
|
1859
1970
|
}
|
1860
1971
|
}
|
1861
|
-
function
|
1972
|
+
function Hn(h) {
|
1862
1973
|
{
|
1863
1974
|
var b = h.type;
|
1864
1975
|
if (b == null || typeof b == "string")
|
@@ -1874,16 +1985,16 @@ Check the top-level render call using <` + x + ">.");
|
|
1874
1985
|
return;
|
1875
1986
|
if (x) {
|
1876
1987
|
var k = re(b);
|
1877
|
-
|
1878
|
-
} else if (b.PropTypes !== void 0 && !
|
1879
|
-
|
1988
|
+
Tn(x, h.props, "prop", k, h);
|
1989
|
+
} else if (b.PropTypes !== void 0 && !gi) {
|
1990
|
+
gi = !0;
|
1880
1991
|
var H = re(b);
|
1881
1992
|
v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", H || "Unknown");
|
1882
1993
|
}
|
1883
1994
|
typeof b.getDefaultProps == "function" && !b.getDefaultProps.isReactClassApproved && v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
1884
1995
|
}
|
1885
1996
|
}
|
1886
|
-
function
|
1997
|
+
function Yn(h) {
|
1887
1998
|
{
|
1888
1999
|
for (var b = Object.keys(h.props), x = 0; x < b.length; x++) {
|
1889
2000
|
var k = b[x];
|
@@ -1895,56 +2006,56 @@ Check the top-level render call using <` + x + ">.");
|
|
1895
2006
|
h.ref !== null && (st(h), v("Invalid attribute `ref` supplied to `React.Fragment`."), st(null));
|
1896
2007
|
}
|
1897
2008
|
}
|
1898
|
-
function
|
2009
|
+
function rs(h, b, x, k, H, G) {
|
1899
2010
|
{
|
1900
2011
|
var F = B(h);
|
1901
2012
|
if (!F) {
|
1902
2013
|
var N = "";
|
1903
2014
|
(h === void 0 || typeof h == "object" && h !== null && Object.keys(h).length === 0) && (N += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
1904
|
-
var fe =
|
1905
|
-
fe ? N += fe : N +=
|
2015
|
+
var fe = Fn(H);
|
2016
|
+
fe ? N += fe : N += is();
|
1906
2017
|
var te;
|
1907
|
-
h === null ? te = "null" :
|
2018
|
+
h === null ? te = "null" : pi(h) ? te = "array" : h !== void 0 && h.$$typeof === e ? (te = "<" + (re(h.type) || "Unknown") + " />", N = " Did you accidentally export a JSX literal instead of a component?") : te = 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", te, N);
|
1908
2019
|
}
|
1909
|
-
var ne =
|
2020
|
+
var ne = Nn(h, b, x, H, G);
|
1910
2021
|
if (ne == null)
|
1911
2022
|
return ne;
|
1912
2023
|
if (F) {
|
1913
2024
|
var we = b.children;
|
1914
2025
|
if (we !== void 0)
|
1915
2026
|
if (k)
|
1916
|
-
if (
|
2027
|
+
if (pi(we)) {
|
1917
2028
|
for (var nt = 0; nt < we.length; nt++)
|
1918
|
-
|
2029
|
+
as(we[nt], h);
|
1919
2030
|
Object.freeze && Object.freeze(we);
|
1920
2031
|
} else
|
1921
2032
|
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.");
|
1922
2033
|
else
|
1923
|
-
|
2034
|
+
as(we, h);
|
1924
2035
|
}
|
1925
|
-
return h === i ?
|
2036
|
+
return h === i ? Yn(ne) : Hn(ne), ne;
|
1926
2037
|
}
|
1927
2038
|
}
|
1928
|
-
function
|
1929
|
-
return
|
2039
|
+
function Bn(h, b, x) {
|
2040
|
+
return rs(h, b, x, !0);
|
1930
2041
|
}
|
1931
|
-
function
|
1932
|
-
return
|
2042
|
+
function Vn(h, b, x) {
|
2043
|
+
return rs(h, b, x, !1);
|
1933
2044
|
}
|
1934
|
-
var
|
1935
|
-
|
1936
|
-
}()),
|
2045
|
+
var Zn = Vn, Wn = Bn;
|
2046
|
+
wt.Fragment = i, wt.jsx = Zn, wt.jsxs = Wn;
|
2047
|
+
}()), wt;
|
1937
2048
|
}
|
1938
|
-
process.env.NODE_ENV === "production" ?
|
1939
|
-
var u =
|
1940
|
-
function
|
2049
|
+
process.env.NODE_ENV === "production" ? Ni.exports = lr() : Ni.exports = cr();
|
2050
|
+
var u = Ni.exports;
|
2051
|
+
function yn(s) {
|
1941
2052
|
return s.title.search("<") > -1 ? /* @__PURE__ */ u.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: s.title } }) : /* @__PURE__ */ u.jsx("button", { children: s.title });
|
1942
2053
|
}
|
1943
|
-
const
|
2054
|
+
const hr = /* @__PURE__ */ u.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
|
1944
2055
|
/* @__PURE__ */ u.jsx("circle", { cx: "7", cy: "7", r: "6" }),
|
1945
2056
|
/* @__PURE__ */ u.jsx("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
|
1946
2057
|
/* @__PURE__ */ u.jsx("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
|
1947
|
-
] }),
|
2058
|
+
] }), dr = /* @__PURE__ */ u.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ u.jsx(
|
1948
2059
|
"path",
|
1949
2060
|
{
|
1950
2061
|
d: `M10.43,4H3.57C3.26,4,3,4.22,3,4.5v1C3,5.78,3.26,6,3.57,6h6.86C10.74,6,11,5.78,11,5.5v-1\r
|
@@ -1952,16 +2063,16 @@ C11,4.22,10.74,4,10.43,4z M10.43,8H3.57C3.26,8,3,8.22,3,8.5v1C3,9.78,3.26,10,3.5
|
|
1952
2063
|
C11,8.22,10.74,8,10.43,8z`
|
1953
2064
|
}
|
1954
2065
|
) });
|
1955
|
-
function
|
1956
|
-
return /* @__PURE__ */ u.jsx(
|
1957
|
-
|
2066
|
+
function ur(s) {
|
2067
|
+
return /* @__PURE__ */ u.jsx(gn.Item, { value: s.title, children: /* @__PURE__ */ u.jsxs("div", { children: [
|
2068
|
+
dr,
|
1958
2069
|
/* @__PURE__ */ u.jsx("span", { children: s.title }),
|
1959
2070
|
/* @__PURE__ */ u.jsx("button", { className: "closeIcon", onClick: () => {
|
1960
2071
|
s.onDelete(s.index);
|
1961
|
-
}, children:
|
2072
|
+
}, children: hr })
|
1962
2073
|
] }) }, s.title);
|
1963
2074
|
}
|
1964
|
-
function
|
2075
|
+
function pr(s) {
|
1965
2076
|
const [e, t] = Z(!1), [i, n] = Z(s.options), r = (l) => {
|
1966
2077
|
s.onDragComplete(l), n(l);
|
1967
2078
|
}, a = (l) => {
|
@@ -1969,18 +2080,18 @@ function ir(s) {
|
|
1969
2080
|
d.splice(l, 1), r(d);
|
1970
2081
|
}, o = [];
|
1971
2082
|
i.forEach((l, d) => {
|
1972
|
-
o.push(/* @__PURE__ */ u.jsx(
|
2083
|
+
o.push(/* @__PURE__ */ u.jsx(ur, { index: d, title: l, onDelete: a }, l));
|
1973
2084
|
});
|
1974
2085
|
let c = "dropdown draggable";
|
1975
2086
|
return s.subdropdown && (c += " subdropdown"), /* @__PURE__ */ u.jsxs("div", { className: c, onMouseEnter: () => t(!0), onMouseLeave: () => t(!1), children: [
|
1976
|
-
/* @__PURE__ */ u.jsx(
|
1977
|
-
/* @__PURE__ */ u.jsx(
|
2087
|
+
/* @__PURE__ */ u.jsx(yn, { title: s.title }),
|
2088
|
+
/* @__PURE__ */ u.jsx(gn.Group, { axis: "y", values: i, onReorder: r, style: { visibility: e ? "visible" : "hidden" }, children: o })
|
1978
2089
|
] });
|
1979
2090
|
}
|
1980
|
-
function
|
2091
|
+
function mr(s) {
|
1981
2092
|
const [e, t] = Z(!1), i = [];
|
1982
2093
|
s.options.map((r, a) => {
|
1983
|
-
s.onSelect !== void 0 && (r.onSelect = s.onSelect), i.push(/* @__PURE__ */ u.jsx(
|
2094
|
+
s.onSelect !== void 0 && (r.onSelect = s.onSelect), i.push(/* @__PURE__ */ u.jsx(fr, { option: r }, a));
|
1984
2095
|
});
|
1985
2096
|
let n = "dropdown";
|
1986
2097
|
return s.subdropdown && (n += " subdropdown"), /* @__PURE__ */ u.jsxs(
|
@@ -1990,7 +2101,7 @@ function sr(s) {
|
|
1990
2101
|
onMouseEnter: () => t(!0),
|
1991
2102
|
onMouseLeave: () => t(!1),
|
1992
2103
|
children: [
|
1993
|
-
/* @__PURE__ */ u.jsx(
|
2104
|
+
/* @__PURE__ */ u.jsx(yn, { title: s.title }),
|
1994
2105
|
/* @__PURE__ */ u.jsx(
|
1995
2106
|
"ul",
|
1996
2107
|
{
|
@@ -2002,13 +2113,13 @@ function sr(s) {
|
|
2002
2113
|
}
|
2003
2114
|
);
|
2004
2115
|
}
|
2005
|
-
function
|
2116
|
+
function fr(s) {
|
2006
2117
|
const { option: e } = s, [t, i] = Z("");
|
2007
2118
|
let n;
|
2008
2119
|
switch (e.type) {
|
2009
2120
|
case "draggable":
|
2010
2121
|
n = /* @__PURE__ */ u.jsx(
|
2011
|
-
|
2122
|
+
pr,
|
2012
2123
|
{
|
2013
2124
|
title: e.title,
|
2014
2125
|
options: e.value,
|
@@ -2021,7 +2132,7 @@ function nr(s) {
|
|
2021
2132
|
break;
|
2022
2133
|
case "dropdown":
|
2023
2134
|
n = /* @__PURE__ */ u.jsx(
|
2024
|
-
|
2135
|
+
mr,
|
2025
2136
|
{
|
2026
2137
|
title: e.title,
|
2027
2138
|
options: e.value,
|
@@ -2042,15 +2153,15 @@ function nr(s) {
|
|
2042
2153
|
);
|
2043
2154
|
break;
|
2044
2155
|
}
|
2045
|
-
return /* @__PURE__ */ u.jsx("li", { className: t === e.title ? "selected" : "", children: n },
|
2156
|
+
return /* @__PURE__ */ u.jsx("li", { className: t === e.title ? "selected" : "", children: n }, Fa());
|
2046
2157
|
}
|
2047
|
-
function
|
2158
|
+
function Zo(s, e, t) {
|
2048
2159
|
function i(r) {
|
2049
2160
|
switch (e.forEach((a) => {
|
2050
2161
|
a.callback(s, a.remote, r);
|
2051
2162
|
}), r.event) {
|
2052
2163
|
case "custom":
|
2053
|
-
D.dispatchEvent({ type:
|
2164
|
+
D.dispatchEvent({ type: A.CUSTOM, value: r.data });
|
2054
2165
|
break;
|
2055
2166
|
}
|
2056
2167
|
}
|
@@ -2059,7 +2170,7 @@ function Io(s, e, t) {
|
|
2059
2170
|
a.callback(s, a.remote, r);
|
2060
2171
|
}), r.event) {
|
2061
2172
|
case "custom":
|
2062
|
-
D.dispatchEvent({ type:
|
2173
|
+
D.dispatchEvent({ type: A.CUSTOM, value: r.data });
|
2063
2174
|
break;
|
2064
2175
|
}
|
2065
2176
|
}
|
@@ -2067,9 +2178,9 @@ function Io(s, e, t) {
|
|
2067
2178
|
r.target === "editor" ? n(r) : i(r);
|
2068
2179
|
};
|
2069
2180
|
}
|
2070
|
-
function
|
2181
|
+
function oi(s) {
|
2071
2182
|
const [e, t] = Z(s.open !== void 0 ? s.open : !0), i = !e || s.children === void 0, n = () => {
|
2072
|
-
D.dispatchEvent({ type:
|
2183
|
+
D.dispatchEvent({ type: A.REMOVE_SCENE, value: s.scene });
|
2073
2184
|
};
|
2074
2185
|
return /* @__PURE__ */ u.jsxs("div", { className: `accordion ${i ? "hide" : ""}`, children: [
|
2075
2186
|
/* @__PURE__ */ u.jsxs(
|
@@ -2088,7 +2199,7 @@ function ri(s) {
|
|
2088
2199
|
children: "Toggle"
|
2089
2200
|
}
|
2090
2201
|
),
|
2091
|
-
/* @__PURE__ */ u.jsx("p", { className: "label", children:
|
2202
|
+
/* @__PURE__ */ u.jsx("p", { className: "label", children: ri(s.label) })
|
2092
2203
|
]
|
2093
2204
|
}
|
2094
2205
|
),
|
@@ -2100,10 +2211,10 @@ function ri(s) {
|
|
2100
2211
|
/* @__PURE__ */ u.jsx("div", { className: e ? "open" : "", children: /* @__PURE__ */ u.jsx("div", { children: s.children }) }, Math.random())
|
2101
2212
|
] });
|
2102
2213
|
}
|
2103
|
-
function
|
2214
|
+
function bn(s) {
|
2104
2215
|
const e = J(null), [t, i] = Z(!1), n = s.child !== void 0 && s.child.children.length > 0, r = [];
|
2105
2216
|
return s.child !== void 0 && s.child.children.length > 0 && s.child.children.map((a, o) => {
|
2106
|
-
r.push(/* @__PURE__ */ u.jsx(
|
2217
|
+
r.push(/* @__PURE__ */ u.jsx(bn, { child: a, three: s.three }, o));
|
2107
2218
|
}), tt(() => {
|
2108
2219
|
if (s.child) {
|
2109
2220
|
const a = s.three.getScene(s.child.uuid);
|
@@ -2158,18 +2269,18 @@ function _n(s) {
|
|
2158
2269
|
}
|
2159
2270
|
}
|
2160
2271
|
),
|
2161
|
-
/* @__PURE__ */ u.jsx("div", { className: `icon ${
|
2272
|
+
/* @__PURE__ */ u.jsx("div", { className: `icon ${sr(s.child)}` })
|
2162
2273
|
] }),
|
2163
2274
|
/* @__PURE__ */ u.jsx("div", { className: t ? "open" : "", children: /* @__PURE__ */ u.jsx("div", { className: "container", children: r }) })
|
2164
2275
|
] }, Math.random()) });
|
2165
2276
|
}
|
2166
|
-
function
|
2277
|
+
function Es(s) {
|
2167
2278
|
const e = [];
|
2168
2279
|
return s.child?.children.map((t, i) => {
|
2169
|
-
e.push(/* @__PURE__ */ u.jsx(
|
2280
|
+
e.push(/* @__PURE__ */ u.jsx(bn, { child: t, scene: s.scene, three: s.three }, i));
|
2170
2281
|
}), /* @__PURE__ */ u.jsx("div", { className: `scene ${s.class !== void 0 ? s.class : ""}`, children: e });
|
2171
2282
|
}
|
2172
|
-
function
|
2283
|
+
function It(s) {
|
2173
2284
|
const [e, t] = Z(s.defaultValue);
|
2174
2285
|
return tt(() => {
|
2175
2286
|
let i = !1, n = -1, r = 0, a = s.defaultValue, o = !1;
|
@@ -2180,13 +2291,13 @@ function Rt(s) {
|
|
2180
2291
|
}, d = (f) => {
|
2181
2292
|
if (!i)
|
2182
2293
|
return;
|
2183
|
-
const
|
2294
|
+
const C = s.step !== void 0 ? s.step : 1, y = (f.clientX - n) * C * (o ? 10 : 1);
|
2184
2295
|
a = Number((r + y).toFixed(4)), s.min !== void 0 && (a = Math.max(a, s.min)), s.max !== void 0 && (a = Math.min(a, s.max)), s.onChange !== void 0 && s.onChange(a), t(a);
|
2185
2296
|
}, p = () => {
|
2186
2297
|
i = !1, document.removeEventListener("mouseup", p), document.removeEventListener("mousemove", d), document.removeEventListener("contextmenu", p);
|
2187
2298
|
}, m = (f) => {
|
2188
|
-
const
|
2189
|
-
s.onChange !== void 0 && s.onChange(
|
2299
|
+
const C = Number(f.target.value);
|
2300
|
+
s.onChange !== void 0 && s.onChange(C), t(C);
|
2190
2301
|
};
|
2191
2302
|
return s.label.current?.addEventListener("mousedown", l, !1), s.sliderRef !== void 0 && s.sliderRef.current?.addEventListener("input", m), document.addEventListener("keydown", c, !1), document.addEventListener("keyup", c, !1), () => {
|
2192
2303
|
s.label.current?.removeEventListener("mousedown", l), s.sliderRef !== void 0 && s.sliderRef.current?.removeEventListener("input", m), document.removeEventListener("mouseup", p), document.removeEventListener("mousemove", d), document.removeEventListener("contextmenu", p), document.removeEventListener("keydown", c), document.addEventListener("keyup", c, !1);
|
@@ -2195,7 +2306,7 @@ function Rt(s) {
|
|
2195
2306
|
}
|
2196
2307
|
function Qe(s) {
|
2197
2308
|
const e = J(null), t = J(null), [i, n] = Z(s.value);
|
2198
|
-
return
|
2309
|
+
return It({
|
2199
2310
|
label: s.labelRef,
|
2200
2311
|
input: e,
|
2201
2312
|
sliderRef: t,
|
@@ -2254,18 +2365,18 @@ function Qe(s) {
|
|
2254
2365
|
max: s.max,
|
2255
2366
|
step: s.step,
|
2256
2367
|
ref: t,
|
2257
|
-
onChange:
|
2368
|
+
onChange: ai
|
2258
2369
|
}
|
2259
2370
|
)
|
2260
2371
|
] })
|
2261
2372
|
] });
|
2262
2373
|
}
|
2263
|
-
function
|
2264
|
-
const e = J(null), t = J(null), i = J(null), n = J(null), r = J(null), a = J(null), o = J(null), c = J(null), l = J(null), d = J(null), [p, m] = Z(s.value.x), [f,
|
2374
|
+
function gr(s) {
|
2375
|
+
const e = J(null), t = J(null), i = J(null), n = J(null), r = J(null), a = J(null), o = J(null), c = J(null), l = J(null), d = J(null), [p, m] = Z(s.value.x), [f, C] = Z(s.value.y), [y, T] = Z({
|
2265
2376
|
min: Math.min(s.min, Math.min(s.value.x, s.value.y)),
|
2266
2377
|
max: Math.max(s.max, Math.max(s.value.x, s.value.y))
|
2267
2378
|
}), [g, v] = Z(!1);
|
2268
|
-
|
2379
|
+
It({
|
2269
2380
|
label: o,
|
2270
2381
|
input: e,
|
2271
2382
|
defaultValue: p,
|
@@ -2275,7 +2386,7 @@ function ar(s) {
|
|
2275
2386
|
onChange: (R) => {
|
2276
2387
|
m(R), s.onChange({ target: { value: { x: R, y: f } } });
|
2277
2388
|
}
|
2278
|
-
}),
|
2389
|
+
}), It({
|
2279
2390
|
label: c,
|
2280
2391
|
input: t,
|
2281
2392
|
defaultValue: f,
|
@@ -2283,9 +2394,9 @@ function ar(s) {
|
|
2283
2394
|
max: y.max,
|
2284
2395
|
step: 0.01,
|
2285
2396
|
onChange: (R) => {
|
2286
|
-
|
2397
|
+
C(R), s.onChange({ target: { value: { x: p, y: R } } });
|
2287
2398
|
}
|
2288
|
-
}),
|
2399
|
+
}), It({
|
2289
2400
|
label: l,
|
2290
2401
|
input: i,
|
2291
2402
|
defaultValue: y.min,
|
@@ -2295,7 +2406,7 @@ function ar(s) {
|
|
2295
2406
|
onChange: (R) => {
|
2296
2407
|
T({ min: R, max: y.max });
|
2297
2408
|
}
|
2298
|
-
}),
|
2409
|
+
}), It({
|
2299
2410
|
label: d,
|
2300
2411
|
input: n,
|
2301
2412
|
defaultValue: y.max,
|
@@ -2307,25 +2418,25 @@ function ar(s) {
|
|
2307
2418
|
}
|
2308
2419
|
});
|
2309
2420
|
function S() {
|
2310
|
-
g || (window.addEventListener("mousemove", w), window.addEventListener("mouseup",
|
2421
|
+
g || (window.addEventListener("mousemove", w), window.addEventListener("mouseup", E), v(!0));
|
2311
2422
|
}
|
2312
|
-
function
|
2313
|
-
window.removeEventListener("mousemove", w), window.removeEventListener("mouseup",
|
2423
|
+
function E() {
|
2424
|
+
window.removeEventListener("mousemove", w), window.removeEventListener("mouseup", E), v(!1);
|
2314
2425
|
}
|
2315
2426
|
function w(R) {
|
2316
|
-
const B = r.current.getBoundingClientRect(), Se = $e(0, 99, R.clientX - B.left) / 99, _e = 1 - $e(0, 99, R.clientY - B.top) / 99, re =
|
2317
|
-
s.onChange({ target: { value: { x: re, y:
|
2427
|
+
const B = r.current.getBoundingClientRect(), Se = $e(0, 99, R.clientX - B.left) / 99, _e = 1 - $e(0, 99, R.clientY - B.top) / 99, re = Pe(ki(y.min, y.max, Se), 3), q = Pe(ki(y.min, y.max, _e), 3);
|
2428
|
+
s.onChange({ target: { value: { x: re, y: q } } }), m(re), C(q);
|
2318
2429
|
}
|
2319
2430
|
function O() {
|
2320
2431
|
const R = Number(i.current.value);
|
2321
|
-
T({ min: R, max: y.max }), p < R && m($e(R, y.max, p)), f < R &&
|
2432
|
+
T({ min: R, max: y.max }), p < R && m($e(R, y.max, p)), f < R && C($e(R, y.max, f));
|
2322
2433
|
}
|
2323
2434
|
function L() {
|
2324
2435
|
const R = Number(n.current.value);
|
2325
|
-
T({ min: y.min, max: R }), p > R && m($e(y.min, R, p)), f > R &&
|
2436
|
+
T({ min: y.min, max: R }), p > R && m($e(y.min, R, p)), f > R && C($e(y.min, R, f));
|
2326
2437
|
}
|
2327
2438
|
tt(() => {
|
2328
|
-
a.current.style.left = `${
|
2439
|
+
a.current.style.left = `${_s(y.min, y.max, p) * 100}%`, a.current.style.top = `${(1 - _s(y.min, y.max, f)) * 100}%`;
|
2329
2440
|
}, [y, p, f]);
|
2330
2441
|
const j = s.step !== void 0 ? s.step : 0.01;
|
2331
2442
|
return /* @__PURE__ */ u.jsxs("div", { className: "vector2", children: [
|
@@ -2362,7 +2473,7 @@ function ar(s) {
|
|
2362
2473
|
max: y.max,
|
2363
2474
|
step: j,
|
2364
2475
|
onChange: (R) => {
|
2365
|
-
if (
|
2476
|
+
if (C(R.target.value), R.target.value.length === 0)
|
2366
2477
|
return;
|
2367
2478
|
const B = Number(R.target.value);
|
2368
2479
|
isNaN(B) || (s.onChange({ target: { value: { x: p, y: B } } }), B > y.max && T({ min: y.min, max: B }));
|
@@ -2397,30 +2508,30 @@ function ar(s) {
|
|
2397
2508
|
)
|
2398
2509
|
] })
|
2399
2510
|
] }),
|
2400
|
-
/* @__PURE__ */ u.jsxs("div", { className: "input", ref: r, onMouseDown: S, onMouseUp:
|
2511
|
+
/* @__PURE__ */ u.jsxs("div", { className: "input", ref: r, onMouseDown: S, onMouseUp: E, children: [
|
2401
2512
|
/* @__PURE__ */ u.jsx("div", { className: "x" }),
|
2402
2513
|
/* @__PURE__ */ u.jsx("div", { className: "y" }),
|
2403
2514
|
/* @__PURE__ */ u.jsx("div", { className: "pt", ref: a })
|
2404
2515
|
] })
|
2405
2516
|
] });
|
2406
2517
|
}
|
2407
|
-
const
|
2408
|
-
function
|
2518
|
+
const _r = Math.PI / 180, vr = 180 / Math.PI;
|
2519
|
+
function ot(s, e, t, i, n) {
|
2409
2520
|
return i + (s - e) * (n - i) / (t - e);
|
2410
2521
|
}
|
2411
|
-
function
|
2522
|
+
function lt(s, e, t) {
|
2412
2523
|
return (1 - t) * s + t * e;
|
2413
2524
|
}
|
2414
|
-
function
|
2415
|
-
return s *
|
2525
|
+
function Fi(s) {
|
2526
|
+
return s * _r;
|
2416
2527
|
}
|
2417
|
-
function
|
2418
|
-
return s *
|
2528
|
+
function yr(s) {
|
2529
|
+
return s * vr;
|
2419
2530
|
}
|
2420
|
-
function
|
2531
|
+
function Cs(s) {
|
2421
2532
|
const e = s.value.x !== void 0 && s.value.y !== void 0 && s.value.z !== void 0, t = s.value.isEuler !== void 0, i = s.value.elements !== void 0, n = s.step !== void 0 ? s.step : 0.01, r = [];
|
2422
2533
|
if (t) {
|
2423
|
-
const a =
|
2534
|
+
const a = jt(() => s.value, []);
|
2424
2535
|
["_x", "_y", "_z"].forEach((c) => {
|
2425
2536
|
const l = J(null);
|
2426
2537
|
r.push(
|
@@ -2429,13 +2540,13 @@ function ys(s) {
|
|
2429
2540
|
/* @__PURE__ */ u.jsx(
|
2430
2541
|
Qe,
|
2431
2542
|
{
|
2432
|
-
value:
|
2543
|
+
value: yr(a[c]),
|
2433
2544
|
type: "number",
|
2434
2545
|
prop: c,
|
2435
2546
|
step: 0.1,
|
2436
2547
|
labelRef: l,
|
2437
2548
|
onChange: (d, p) => {
|
2438
|
-
a[d] =
|
2549
|
+
a[d] = Fi(p), s.onChange({ target: { value: a } });
|
2439
2550
|
}
|
2440
2551
|
}
|
2441
2552
|
)
|
@@ -2443,7 +2554,7 @@ function ys(s) {
|
|
2443
2554
|
);
|
2444
2555
|
});
|
2445
2556
|
} else if (e) {
|
2446
|
-
const a =
|
2557
|
+
const a = jt(() => s.value, []), o = (l, d) => {
|
2447
2558
|
a[l] = d, s.onChange({ target: { value: a } });
|
2448
2559
|
};
|
2449
2560
|
["x", "y", "z"].forEach((l) => {
|
@@ -2466,7 +2577,7 @@ function ys(s) {
|
|
2466
2577
|
);
|
2467
2578
|
});
|
2468
2579
|
} else if (i) {
|
2469
|
-
const a =
|
2580
|
+
const a = jt(() => s.value, []), o = (c, l) => {
|
2470
2581
|
const d = Number(c);
|
2471
2582
|
a.elements[d] = l, s.onChange({ target: { value: a } });
|
2472
2583
|
};
|
@@ -2492,10 +2603,10 @@ function ys(s) {
|
|
2492
2603
|
}
|
2493
2604
|
return /* @__PURE__ */ u.jsx("div", { className: "grid3", children: r }, Math.random().toString());
|
2494
2605
|
}
|
2495
|
-
function
|
2606
|
+
function br(s) {
|
2496
2607
|
const e = s.value.x !== void 0, t = s.step !== void 0 ? s.step : 0.01, i = [];
|
2497
2608
|
if (e) {
|
2498
|
-
const n =
|
2609
|
+
const n = jt(() => s.value, []), r = (o, c) => {
|
2499
2610
|
n[o] = c, s.onChange({ target: { value: n } });
|
2500
2611
|
};
|
2501
2612
|
["x", "y", "z", "w"].forEach((o) => {
|
@@ -2518,7 +2629,7 @@ function cr(s) {
|
|
2518
2629
|
);
|
2519
2630
|
});
|
2520
2631
|
} else {
|
2521
|
-
const n =
|
2632
|
+
const n = jt(() => s.value, []), r = (a, o) => {
|
2522
2633
|
const c = Number(a);
|
2523
2634
|
n.elements[c] = o, s.onChange({ target: { value: n } });
|
2524
2635
|
};
|
@@ -2544,10 +2655,10 @@ function cr(s) {
|
|
2544
2655
|
}
|
2545
2656
|
return /* @__PURE__ */ u.jsx("div", { className: "grid4", children: i });
|
2546
2657
|
}
|
2547
|
-
function
|
2658
|
+
function Er(s) {
|
2548
2659
|
return !(s === "defaultAttributeValues" || s === "forceSinglePass" || s === "linecap" || s === "linejoin" || s === "linewidth" || s === "normalMapType" || s === "precision" || s === "shadowSide" || s === "uniformsGroups" || s === "uniformsNeedUpdate" || s === "userData" || s === "version" || s === "wireframeLinecap" || s === "wireframeLinejoin" || s === "wireframeLinewidth" || s.slice(0, 4) === "clip" || s.slice(0, 7) === "polygon" || s.slice(0, 7) === "stencil" || s.slice(0, 2) === "is");
|
2549
2660
|
}
|
2550
|
-
function
|
2661
|
+
function Cr(s) {
|
2551
2662
|
switch (s) {
|
2552
2663
|
case "Alpha Map":
|
2553
2664
|
return "alphaMap";
|
@@ -2596,7 +2707,7 @@ function dr(s) {
|
|
2596
2707
|
}
|
2597
2708
|
return s;
|
2598
2709
|
}
|
2599
|
-
function
|
2710
|
+
function hi(s) {
|
2600
2711
|
switch (s) {
|
2601
2712
|
case "alphaHash":
|
2602
2713
|
return "Alpha Hash";
|
@@ -2799,11 +2910,11 @@ function ci(s) {
|
|
2799
2910
|
}
|
2800
2911
|
return s;
|
2801
2912
|
}
|
2802
|
-
function
|
2913
|
+
function En(s) {
|
2803
2914
|
const e = s.toLowerCase();
|
2804
2915
|
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";
|
2805
2916
|
}
|
2806
|
-
function
|
2917
|
+
function Sr() {
|
2807
2918
|
const s = document.createElement("input");
|
2808
2919
|
return s.type = "file", new Promise((e, t) => {
|
2809
2920
|
s.addEventListener("change", function() {
|
@@ -2818,191 +2929,191 @@ function ur() {
|
|
2818
2929
|
}), s.click();
|
2819
2930
|
});
|
2820
2931
|
}
|
2821
|
-
const
|
2932
|
+
const wr = [
|
2822
2933
|
{
|
2823
2934
|
title: "Front",
|
2824
|
-
value:
|
2935
|
+
value: qn
|
2825
2936
|
},
|
2826
2937
|
{
|
2827
2938
|
title: "Back",
|
2828
|
-
value:
|
2939
|
+
value: Xs
|
2829
2940
|
},
|
2830
2941
|
{
|
2831
2942
|
title: "Double",
|
2832
|
-
value:
|
2943
|
+
value: Bi
|
2833
2944
|
}
|
2834
|
-
],
|
2945
|
+
], xr = [
|
2835
2946
|
{
|
2836
2947
|
title: "No Blending",
|
2837
|
-
value:
|
2948
|
+
value: Qn
|
2838
2949
|
},
|
2839
2950
|
{
|
2840
2951
|
title: "Normal",
|
2841
|
-
value:
|
2952
|
+
value: Jn
|
2842
2953
|
},
|
2843
2954
|
{
|
2844
2955
|
title: "Additive",
|
2845
|
-
value:
|
2956
|
+
value: ea
|
2846
2957
|
},
|
2847
2958
|
{
|
2848
2959
|
title: "Subtractive",
|
2849
|
-
value:
|
2960
|
+
value: ta
|
2850
2961
|
},
|
2851
2962
|
{
|
2852
2963
|
title: "Multiply",
|
2853
|
-
value:
|
2964
|
+
value: ia
|
2854
2965
|
},
|
2855
2966
|
{
|
2856
2967
|
title: "Custom",
|
2857
|
-
value:
|
2968
|
+
value: sa
|
2858
2969
|
}
|
2859
|
-
],
|
2970
|
+
], Or = [
|
2860
2971
|
{
|
2861
2972
|
title: "Add",
|
2862
|
-
value:
|
2973
|
+
value: na
|
2863
2974
|
},
|
2864
2975
|
{
|
2865
2976
|
title: "Subtract",
|
2866
|
-
value:
|
2977
|
+
value: aa
|
2867
2978
|
},
|
2868
2979
|
{
|
2869
2980
|
title: "Reverse Subtract",
|
2870
|
-
value:
|
2981
|
+
value: ra
|
2871
2982
|
},
|
2872
2983
|
{
|
2873
2984
|
title: "Min",
|
2874
|
-
value:
|
2985
|
+
value: oa
|
2875
2986
|
},
|
2876
2987
|
{
|
2877
2988
|
title: "Max",
|
2878
|
-
value:
|
2989
|
+
value: la
|
2879
2990
|
}
|
2880
|
-
],
|
2991
|
+
], Tr = [
|
2881
2992
|
{
|
2882
2993
|
title: "Zero",
|
2883
|
-
value:
|
2994
|
+
value: $s
|
2884
2995
|
},
|
2885
2996
|
{
|
2886
2997
|
title: "One",
|
2887
|
-
value:
|
2998
|
+
value: Ks
|
2888
2999
|
},
|
2889
3000
|
{
|
2890
3001
|
title: "Src Color",
|
2891
|
-
value:
|
3002
|
+
value: qs
|
2892
3003
|
},
|
2893
3004
|
{
|
2894
3005
|
title: "One Minus Src Color",
|
2895
|
-
value:
|
3006
|
+
value: Qs
|
2896
3007
|
},
|
2897
3008
|
{
|
2898
3009
|
title: "Src Alpha",
|
2899
|
-
value:
|
3010
|
+
value: Js
|
2900
3011
|
},
|
2901
3012
|
{
|
2902
3013
|
title: "One Minus Src Alpha",
|
2903
|
-
value:
|
3014
|
+
value: en
|
2904
3015
|
},
|
2905
3016
|
{
|
2906
3017
|
title: "Dst Alpha",
|
2907
|
-
value:
|
3018
|
+
value: tn
|
2908
3019
|
},
|
2909
3020
|
{
|
2910
3021
|
title: "One Minus Dst Alpha",
|
2911
|
-
value:
|
3022
|
+
value: sn
|
2912
3023
|
},
|
2913
3024
|
{
|
2914
3025
|
title: "Dst Color",
|
2915
|
-
value:
|
3026
|
+
value: nn
|
2916
3027
|
},
|
2917
3028
|
{
|
2918
3029
|
title: "One Minus Dst Color",
|
2919
|
-
value:
|
3030
|
+
value: an
|
2920
3031
|
},
|
2921
3032
|
{
|
2922
3033
|
title: "Src Alpha Saturate",
|
2923
|
-
value:
|
3034
|
+
value: ca
|
2924
3035
|
},
|
2925
3036
|
{
|
2926
3037
|
title: "Constant Color",
|
2927
|
-
value:
|
3038
|
+
value: rn
|
2928
3039
|
},
|
2929
3040
|
{
|
2930
3041
|
title: "One Minus Constant Color",
|
2931
|
-
value:
|
3042
|
+
value: on
|
2932
3043
|
},
|
2933
3044
|
{
|
2934
3045
|
title: "Constant Alpha",
|
2935
|
-
value:
|
3046
|
+
value: ln
|
2936
3047
|
},
|
2937
3048
|
{
|
2938
3049
|
title: "One Minus Constant Alpha",
|
2939
|
-
value:
|
3050
|
+
value: cn
|
2940
3051
|
}
|
2941
|
-
],
|
3052
|
+
], Mr = [
|
2942
3053
|
{
|
2943
3054
|
title: "Zero",
|
2944
|
-
value:
|
3055
|
+
value: $s
|
2945
3056
|
},
|
2946
3057
|
{
|
2947
3058
|
title: "One",
|
2948
|
-
value:
|
3059
|
+
value: Ks
|
2949
3060
|
},
|
2950
3061
|
{
|
2951
3062
|
title: "Src Color",
|
2952
|
-
value:
|
3063
|
+
value: qs
|
2953
3064
|
},
|
2954
3065
|
{
|
2955
3066
|
title: "One Minus Src Color",
|
2956
|
-
value:
|
3067
|
+
value: Qs
|
2957
3068
|
},
|
2958
3069
|
{
|
2959
3070
|
title: "Src Alpha",
|
2960
|
-
value:
|
3071
|
+
value: Js
|
2961
3072
|
},
|
2962
3073
|
{
|
2963
3074
|
title: "One Minus Src Alpha",
|
2964
|
-
value:
|
3075
|
+
value: en
|
2965
3076
|
},
|
2966
3077
|
{
|
2967
3078
|
title: "Dst Alpha",
|
2968
|
-
value:
|
3079
|
+
value: tn
|
2969
3080
|
},
|
2970
3081
|
{
|
2971
3082
|
title: "One Minus Dst Alpha",
|
2972
|
-
value:
|
3083
|
+
value: sn
|
2973
3084
|
},
|
2974
3085
|
{
|
2975
3086
|
title: "Dst Color",
|
2976
|
-
value:
|
3087
|
+
value: nn
|
2977
3088
|
},
|
2978
3089
|
{
|
2979
3090
|
title: "One Minus Dst Color",
|
2980
|
-
value:
|
3091
|
+
value: an
|
2981
3092
|
},
|
2982
3093
|
{
|
2983
3094
|
title: "Constant Color",
|
2984
|
-
value:
|
3095
|
+
value: rn
|
2985
3096
|
},
|
2986
3097
|
{
|
2987
3098
|
title: "One Minus Constant Color",
|
2988
|
-
value:
|
3099
|
+
value: on
|
2989
3100
|
},
|
2990
3101
|
{
|
2991
3102
|
title: "Constant Alpha",
|
2992
|
-
value:
|
3103
|
+
value: ln
|
2993
3104
|
},
|
2994
3105
|
{
|
2995
3106
|
title: "One Minus Constant Alpha",
|
2996
|
-
value:
|
3107
|
+
value: cn
|
2997
3108
|
}
|
2998
3109
|
];
|
2999
|
-
function
|
3110
|
+
function xt(s, e) {
|
3000
3111
|
s.needsUpdate = !0, s.type = "option", s.options = e;
|
3001
3112
|
}
|
3002
|
-
function
|
3113
|
+
function Pr(s, e, t, i) {
|
3003
3114
|
return {
|
3004
3115
|
type: "boolean",
|
3005
|
-
title:
|
3116
|
+
title: hi(s),
|
3006
3117
|
prop: s,
|
3007
3118
|
value: e,
|
3008
3119
|
needsUpdate: !0,
|
@@ -3016,10 +3127,10 @@ function vr(s, e, t, i) {
|
|
3016
3127
|
}
|
3017
3128
|
};
|
3018
3129
|
}
|
3019
|
-
function
|
3130
|
+
function Ar(s, e, t, i) {
|
3020
3131
|
const n = {
|
3021
3132
|
type: "number",
|
3022
|
-
title:
|
3133
|
+
title: hi(s),
|
3023
3134
|
prop: s,
|
3024
3135
|
value: e,
|
3025
3136
|
min: void 0,
|
@@ -3037,27 +3148,27 @@ function yr(s, e, t, i) {
|
|
3037
3148
|
};
|
3038
3149
|
switch (s) {
|
3039
3150
|
case "blending":
|
3040
|
-
|
3151
|
+
xt(n, xr);
|
3041
3152
|
break;
|
3042
3153
|
case "blendDst":
|
3043
|
-
|
3154
|
+
xt(n, Mr);
|
3044
3155
|
break;
|
3045
3156
|
case "blendEquation":
|
3046
|
-
|
3157
|
+
xt(n, Or);
|
3047
3158
|
break;
|
3048
3159
|
case "blendSrc":
|
3049
|
-
|
3160
|
+
xt(n, Tr);
|
3050
3161
|
break;
|
3051
3162
|
case "side":
|
3052
|
-
|
3163
|
+
xt(n, wr);
|
3053
3164
|
break;
|
3054
3165
|
}
|
3055
|
-
return
|
3166
|
+
return En(s) && (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;
|
3056
3167
|
}
|
3057
|
-
function
|
3168
|
+
function Dr(s, e, t, i) {
|
3058
3169
|
const n = {
|
3059
3170
|
type: "string",
|
3060
|
-
title:
|
3171
|
+
title: hi(s),
|
3061
3172
|
prop: s,
|
3062
3173
|
value: e,
|
3063
3174
|
needsUpdate: !0,
|
@@ -3090,20 +3201,20 @@ function br(s, e, t, i) {
|
|
3090
3201
|
}
|
3091
3202
|
}), n;
|
3092
3203
|
}
|
3093
|
-
function
|
3204
|
+
function Rr(s) {
|
3094
3205
|
return s.x !== void 0 && s.y !== void 0 && s.z === void 0;
|
3095
3206
|
}
|
3096
|
-
function
|
3207
|
+
function Ir(s) {
|
3097
3208
|
return s.x !== void 0 && s.y !== void 0 && s.z !== void 0 && s.w === void 0;
|
3098
3209
|
}
|
3099
|
-
function
|
3210
|
+
function Lr(s) {
|
3100
3211
|
return s.x !== void 0 && s.y !== void 0 && s.z !== void 0 && s.w !== void 0;
|
3101
3212
|
}
|
3102
|
-
function
|
3213
|
+
function zi(s) {
|
3103
3214
|
s.sort((e, t) => e.title < t.title ? -1 : e.title > t.title ? 1 : 0);
|
3104
3215
|
}
|
3105
|
-
function
|
3106
|
-
const a =
|
3216
|
+
function Lt(s, e, t, i, n = "", r = !1) {
|
3217
|
+
const a = hi(s).split(".")[0].replaceAll("[", "").replaceAll("]", ""), o = n.length > 0 ? `${n}.${s}` : s, c = typeof e;
|
3107
3218
|
if (c === "boolean" || c === "string")
|
3108
3219
|
return {
|
3109
3220
|
title: a,
|
@@ -3137,7 +3248,7 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3137
3248
|
}
|
3138
3249
|
}
|
3139
3250
|
};
|
3140
|
-
return
|
3251
|
+
return En(a) && (l.type = "range", l.min = 0, l.max = 1), l;
|
3141
3252
|
} else {
|
3142
3253
|
if (e.isColor)
|
3143
3254
|
return {
|
@@ -3161,20 +3272,20 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3161
3272
|
for (const d in e) {
|
3162
3273
|
const p = e[d], m = `[${d.toString()}]`;
|
3163
3274
|
if (p.value !== void 0) {
|
3164
|
-
const f =
|
3275
|
+
const f = Lt(`${m}.value`, p.value, t, i, o, r);
|
3165
3276
|
f !== void 0 && l.push(f);
|
3166
3277
|
} else {
|
3167
|
-
const f =
|
3278
|
+
const f = Lt(m, p, t, i, o, r);
|
3168
3279
|
f !== void 0 && l.push(f);
|
3169
3280
|
}
|
3170
3281
|
}
|
3171
3282
|
if (l.length > 0)
|
3172
|
-
return
|
3283
|
+
return zi(l), {
|
3173
3284
|
title: a,
|
3174
3285
|
items: l
|
3175
3286
|
};
|
3176
3287
|
} else {
|
3177
|
-
if (
|
3288
|
+
if (Rr(e))
|
3178
3289
|
return {
|
3179
3290
|
title: a,
|
3180
3291
|
prop: o,
|
@@ -3190,7 +3301,7 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3190
3301
|
}
|
3191
3302
|
}
|
3192
3303
|
};
|
3193
|
-
if (
|
3304
|
+
if (Ir(e))
|
3194
3305
|
return {
|
3195
3306
|
title: a,
|
3196
3307
|
prop: o,
|
@@ -3206,7 +3317,7 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3206
3317
|
}
|
3207
3318
|
}
|
3208
3319
|
};
|
3209
|
-
if (
|
3320
|
+
if (Lr(e))
|
3210
3321
|
return {
|
3211
3322
|
title: a,
|
3212
3323
|
prop: o,
|
@@ -3245,14 +3356,14 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3245
3356
|
value: e,
|
3246
3357
|
disabled: r,
|
3247
3358
|
onChange: (l, d) => {
|
3248
|
-
const p =
|
3359
|
+
const p = Cr(s), m = n.length > 0 ? `${n}.${p}` : p;
|
3249
3360
|
i.createTexture(t.uuid, `material.${m}`, d);
|
3250
3361
|
const f = i.getScene(t.uuid);
|
3251
3362
|
if (f !== null) {
|
3252
|
-
const
|
3253
|
-
if (
|
3363
|
+
const C = f.getObjectByProperty("uuid", t.uuid);
|
3364
|
+
if (C !== void 0) {
|
3254
3365
|
const y = (T) => {
|
3255
|
-
const g =
|
3366
|
+
const g = C.material, v = m.split(".");
|
3256
3367
|
switch (v.length) {
|
3257
3368
|
case 1:
|
3258
3369
|
g[v[0]] = T;
|
@@ -3272,7 +3383,7 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3272
3383
|
}
|
3273
3384
|
g.needsUpdate = !0;
|
3274
3385
|
};
|
3275
|
-
d.src.length > 0 ?
|
3386
|
+
d.src.length > 0 ? vn(d.src).then((T) => {
|
3276
3387
|
T.offset.set(d.offset[0], d.offset[1]), T.repeat.set(d.repeat[0], d.repeat[1]), y(T);
|
3277
3388
|
}) : y(null);
|
3278
3389
|
}
|
@@ -3302,10 +3413,10 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3302
3413
|
const m = e[p];
|
3303
3414
|
if (m !== void 0)
|
3304
3415
|
if (m.value !== void 0) {
|
3305
|
-
const f =
|
3416
|
+
const f = Lt(`${p}.value`, m.value, t, i, o, d);
|
3306
3417
|
f !== void 0 && l.push(f);
|
3307
3418
|
} else {
|
3308
|
-
const f =
|
3419
|
+
const f = Lt(p, m, t, i, o, d);
|
3309
3420
|
f !== void 0 && l.push(f);
|
3310
3421
|
}
|
3311
3422
|
}
|
@@ -3313,7 +3424,7 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3313
3424
|
console.log("Issue cycling through material object:", s, e);
|
3314
3425
|
}
|
3315
3426
|
if (l.length > 0)
|
3316
|
-
return
|
3427
|
+
return zi(l), {
|
3317
3428
|
title: a,
|
3318
3429
|
items: l
|
3319
3430
|
};
|
@@ -3321,25 +3432,25 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3321
3432
|
}
|
3322
3433
|
}
|
3323
3434
|
}
|
3324
|
-
function
|
3435
|
+
function Ss(s, e, t) {
|
3325
3436
|
const i = [];
|
3326
3437
|
for (const n in s) {
|
3327
|
-
if (!
|
3438
|
+
if (!Er(n))
|
3328
3439
|
continue;
|
3329
3440
|
const r = typeof s[n], a = s[n];
|
3330
3441
|
if (r === "boolean")
|
3331
|
-
i.push(
|
3442
|
+
i.push(Pr(n, a, e, t));
|
3332
3443
|
else if (r === "number")
|
3333
|
-
i.push(
|
3444
|
+
i.push(Ar(n, a, e, t));
|
3334
3445
|
else if (r === "string")
|
3335
|
-
i.push(
|
3446
|
+
i.push(Dr(n, a, e, t));
|
3336
3447
|
else if (r === "object") {
|
3337
|
-
const o =
|
3448
|
+
const o = Lt(n, a, e, t);
|
3338
3449
|
o !== void 0 && i.push(o);
|
3339
3450
|
} else
|
3340
3451
|
a !== void 0 && console.log("other:", n, r, a);
|
3341
3452
|
}
|
3342
|
-
return
|
3453
|
+
return zi(i), i.push({
|
3343
3454
|
title: "Update Material",
|
3344
3455
|
type: "button",
|
3345
3456
|
onChange: () => {
|
@@ -3352,7 +3463,7 @@ function bs(s, e, t) {
|
|
3352
3463
|
}
|
3353
3464
|
}), i;
|
3354
3465
|
}
|
3355
|
-
function
|
3466
|
+
function kr(s, e) {
|
3356
3467
|
function t() {
|
3357
3468
|
return `${e.app.appID}_material`;
|
3358
3469
|
}
|
@@ -3369,7 +3480,7 @@ function wr(s, e) {
|
|
3369
3480
|
Oe,
|
3370
3481
|
{
|
3371
3482
|
title: `Material ${l}`,
|
3372
|
-
items:
|
3483
|
+
items: Ss(a[l], s, e)
|
3373
3484
|
},
|
3374
3485
|
`Material ${l}`
|
3375
3486
|
)
|
@@ -3380,7 +3491,7 @@ function wr(s, e) {
|
|
3380
3491
|
Oe,
|
3381
3492
|
{
|
3382
3493
|
title: "Material",
|
3383
|
-
items:
|
3494
|
+
items: Ss(a, s, e),
|
3384
3495
|
expanded: n,
|
3385
3496
|
onToggle: (o) => {
|
3386
3497
|
r(o);
|
@@ -3388,42 +3499,42 @@ function wr(s, e) {
|
|
3388
3499
|
}
|
3389
3500
|
);
|
3390
3501
|
}
|
3391
|
-
const
|
3392
|
-
function
|
3393
|
-
const e = s.step !== void 0 ? s.step : 0.01, t = J(null), i = J(null), n = J(null), r = J(null), a = J(null), [o] = Z(s.value), [c, l] = Z(s.value.offset[0]), [d, p] = Z(s.value.offset[1]), [m, f] = Z(s.value.repeat[0]), [
|
3394
|
-
function T(v, S,
|
3502
|
+
const ws = "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==";
|
3503
|
+
function Ur(s) {
|
3504
|
+
const e = s.step !== void 0 ? s.step : 0.01, t = J(null), i = J(null), n = J(null), r = J(null), a = J(null), [o] = Z(s.value), [c, l] = Z(s.value.offset[0]), [d, p] = Z(s.value.offset[1]), [m, f] = Z(s.value.repeat[0]), [C, y] = Z(s.value.repeat[1]);
|
3505
|
+
function T(v, S, E, w, O) {
|
3395
3506
|
if (s.onChange !== void 0) {
|
3396
3507
|
const L = s.prop !== void 0 ? s.prop : s.title;
|
3397
3508
|
s.onChange(L, {
|
3398
3509
|
src: v,
|
3399
|
-
offset: [S,
|
3510
|
+
offset: [S, E],
|
3400
3511
|
repeat: [w, O]
|
3401
3512
|
});
|
3402
3513
|
}
|
3403
3514
|
}
|
3404
3515
|
function g(v) {
|
3405
|
-
const S = t.current.src,
|
3516
|
+
const S = t.current.src, E = v.target.value;
|
3406
3517
|
switch (v.target) {
|
3407
3518
|
case i.current:
|
3408
|
-
l(
|
3519
|
+
l(E), T(S, E, d, m, C);
|
3409
3520
|
break;
|
3410
3521
|
case n.current:
|
3411
|
-
p(
|
3522
|
+
p(E), T(S, c, E, m, C);
|
3412
3523
|
break;
|
3413
3524
|
case r.current:
|
3414
|
-
f(
|
3525
|
+
f(E), T(S, c, d, E, C);
|
3415
3526
|
break;
|
3416
3527
|
case a.current:
|
3417
|
-
y(
|
3528
|
+
y(E), T(S, c, d, m, E);
|
3418
3529
|
break;
|
3419
3530
|
}
|
3420
3531
|
}
|
3421
3532
|
return /* @__PURE__ */ u.jsxs("div", { className: "imageField", children: [
|
3422
3533
|
/* @__PURE__ */ u.jsx("img", { alt: s.title, ref: t, onClick: () => {
|
3423
|
-
|
3424
|
-
t.current.src = v, T(v, c, d, m,
|
3534
|
+
Sr().then((v) => {
|
3535
|
+
t.current.src = v, T(v, c, d, m, C);
|
3425
3536
|
});
|
3426
|
-
}, src: o.src.length > 0 ? o.src :
|
3537
|
+
}, src: o.src.length > 0 ? o.src : ws }),
|
3427
3538
|
/* @__PURE__ */ u.jsxs("div", { className: "fields", children: [
|
3428
3539
|
/* @__PURE__ */ u.jsxs("div", { children: [
|
3429
3540
|
/* @__PURE__ */ u.jsx("label", { children: "Offset:" }),
|
@@ -3465,21 +3576,21 @@ function xr(s) {
|
|
3465
3576
|
{
|
3466
3577
|
ref: a,
|
3467
3578
|
type: "number",
|
3468
|
-
value:
|
3579
|
+
value: C,
|
3469
3580
|
step: e,
|
3470
3581
|
onChange: g
|
3471
3582
|
}
|
3472
3583
|
)
|
3473
3584
|
] }),
|
3474
3585
|
/* @__PURE__ */ u.jsx("button", { onClick: () => {
|
3475
|
-
T("", c, d, m,
|
3586
|
+
T("", c, d, m, C), t.current.src = ws;
|
3476
3587
|
}, children: "Clear" })
|
3477
3588
|
] })
|
3478
3589
|
] });
|
3479
3590
|
}
|
3480
|
-
function
|
3591
|
+
function ii(s) {
|
3481
3592
|
let e = s.value;
|
3482
|
-
e !== void 0 && (e.isColor !== void 0 ? e =
|
3593
|
+
e !== void 0 && (e.isColor !== void 0 ? e = ps(s.value) : s.type === "color" && (e = ps(new et().setStyle(s.value, Nt))));
|
3483
3594
|
const [t, i] = Z(e), n = J(null), r = (l) => {
|
3484
3595
|
let d = l.target.value;
|
3485
3596
|
if (s.type === "boolean")
|
@@ -3495,7 +3606,7 @@ function ti(s) {
|
|
3495
3606
|
const o = s.type === "string" && (t.length > 100 || t.search(`
|
3496
3607
|
`) > -1), c = o || s.type === "image" || s.type === "vector2";
|
3497
3608
|
return /* @__PURE__ */ u.jsxs("div", { className: `field ${c ? "block" : ""}`, style: a, children: [
|
3498
|
-
s.type !== "button" && /* @__PURE__ */ u.jsx("label", { ref: n, children:
|
3609
|
+
s.type !== "button" && /* @__PURE__ */ u.jsx("label", { ref: n, children: ri(s.title) }, "fieldLabel"),
|
3499
3610
|
s.type === "string" && !o && /* @__PURE__ */ u.jsx(
|
3500
3611
|
"input",
|
3501
3612
|
{
|
@@ -3569,18 +3680,18 @@ function ti(s) {
|
|
3569
3680
|
children: s.title
|
3570
3681
|
}
|
3571
3682
|
),
|
3572
|
-
s.type === "image" && /* @__PURE__ */ u.jsx(
|
3573
|
-
s.type === "option" && /* @__PURE__ */ u.jsx(u.Fragment, { children: /* @__PURE__ */ u.jsx("select", { onChange: r, disabled: s.disabled, defaultValue: s.value, children: s.options?.map((l, d) => /* @__PURE__ */ u.jsx("option", { value: l.value, children:
|
3574
|
-
s.type === "vector2" && /* @__PURE__ */ u.jsx(
|
3575
|
-
s.type === "grid3" && /* @__PURE__ */ u.jsx(
|
3576
|
-
s.type === "grid4" && /* @__PURE__ */ u.jsx(
|
3577
|
-
s.type === "euler" && /* @__PURE__ */ u.jsx(
|
3683
|
+
s.type === "image" && /* @__PURE__ */ u.jsx(Ur, { title: s.title, prop: s.prop, value: s.value, onChange: s.onChange }),
|
3684
|
+
s.type === "option" && /* @__PURE__ */ u.jsx(u.Fragment, { children: /* @__PURE__ */ u.jsx("select", { onChange: r, disabled: s.disabled, defaultValue: s.value, children: s.options?.map((l, d) => /* @__PURE__ */ u.jsx("option", { value: l.value, children: ri(l.title) }, d)) }) }),
|
3685
|
+
s.type === "vector2" && /* @__PURE__ */ u.jsx(gr, { step: s.step, value: t, min: 0, max: 1, onChange: r }),
|
3686
|
+
s.type === "grid3" && /* @__PURE__ */ u.jsx(Cs, { step: s.step, value: t, onChange: r }),
|
3687
|
+
s.type === "grid4" && /* @__PURE__ */ u.jsx(br, { step: s.step, value: t, onChange: r }),
|
3688
|
+
s.type === "euler" && /* @__PURE__ */ u.jsx(Cs, { step: s.step, value: t, onChange: r })
|
3578
3689
|
] });
|
3579
3690
|
}
|
3580
|
-
function
|
3691
|
+
function jr(s) {
|
3581
3692
|
return "items" in s;
|
3582
3693
|
}
|
3583
|
-
class Oe extends
|
3694
|
+
class Oe extends Ft {
|
3584
3695
|
subgroupNames = [];
|
3585
3696
|
subgroupElements = [];
|
3586
3697
|
valueOverrides = /* @__PURE__ */ new Map();
|
@@ -3632,15 +3743,15 @@ class Oe extends Nt {
|
|
3632
3743
|
render() {
|
3633
3744
|
const e = [];
|
3634
3745
|
return this.props.items.forEach((t) => {
|
3635
|
-
if (
|
3746
|
+
if (jr(t))
|
3636
3747
|
e.push(
|
3637
|
-
/* @__PURE__ */ u.jsx(Oe, { title:
|
3748
|
+
/* @__PURE__ */ u.jsx(Oe, { title: ri(t.title), items: t.items }, Math.random())
|
3638
3749
|
);
|
3639
3750
|
else {
|
3640
3751
|
const i = this.valueOverrides.get(t.title), n = i !== void 0 ? i : t.value;
|
3641
3752
|
e.push(
|
3642
3753
|
/* @__PURE__ */ u.jsx(
|
3643
|
-
|
3754
|
+
ii,
|
3644
3755
|
{
|
3645
3756
|
title: t.title,
|
3646
3757
|
prop: t.prop,
|
@@ -3663,7 +3774,7 @@ class Oe extends Nt {
|
|
3663
3774
|
);
|
3664
3775
|
}
|
3665
3776
|
}), this.subgroupElements.forEach((t) => e.push(t)), /* @__PURE__ */ u.jsx(
|
3666
|
-
|
3777
|
+
oi,
|
3667
3778
|
{
|
3668
3779
|
label: this.props.title,
|
3669
3780
|
open: this.props.expanded === !0,
|
@@ -3675,16 +3786,16 @@ class Oe extends Nt {
|
|
3675
3786
|
);
|
3676
3787
|
}
|
3677
3788
|
}
|
3678
|
-
class ae extends
|
3789
|
+
class ae extends Ft {
|
3679
3790
|
static instance;
|
3680
3791
|
static groups = [];
|
3681
3792
|
static groupsRefs = [];
|
3682
3793
|
static groupTitles = [];
|
3683
3794
|
constructor(e) {
|
3684
|
-
super(e), this.state = { lastUpdate: Date.now() }, ae.instance = this, D.addEventListener(
|
3795
|
+
super(e), this.state = { lastUpdate: Date.now() }, ae.instance = this, D.addEventListener(A.ADD_GROUP, this.addGroup), D.addEventListener(A.REMOVE_GROUP, this.removeGroup);
|
3685
3796
|
}
|
3686
3797
|
componentWillUnmount() {
|
3687
|
-
D.removeEventListener(
|
3798
|
+
D.removeEventListener(A.ADD_GROUP, this.addGroup), D.removeEventListener(A.REMOVE_GROUP, this.removeGroup);
|
3688
3799
|
}
|
3689
3800
|
render() {
|
3690
3801
|
return /* @__PURE__ */ u.jsx("div", { className: "customGroups", children: ae.groups }, this.state.lastUpdate);
|
@@ -3765,7 +3876,7 @@ class ae extends Nt {
|
|
3765
3876
|
}
|
3766
3877
|
}
|
3767
3878
|
}
|
3768
|
-
function
|
3879
|
+
function xs(s) {
|
3769
3880
|
switch (s) {
|
3770
3881
|
case "fov":
|
3771
3882
|
return "FOV";
|
@@ -3794,7 +3905,7 @@ function Es(s) {
|
|
3794
3905
|
}
|
3795
3906
|
return s;
|
3796
3907
|
}
|
3797
|
-
function
|
3908
|
+
function Nr(s, e) {
|
3798
3909
|
function t() {
|
3799
3910
|
return `${e.app.appID}_camera`;
|
3800
3911
|
}
|
@@ -3806,7 +3917,7 @@ function Tr(s, e) {
|
|
3806
3917
|
if (s.perspectiveCameraInfo !== void 0)
|
3807
3918
|
for (const o in s.perspectiveCameraInfo)
|
3808
3919
|
a.push({
|
3809
|
-
title:
|
3920
|
+
title: xs(o),
|
3810
3921
|
prop: o,
|
3811
3922
|
type: "number",
|
3812
3923
|
step: 0.01,
|
@@ -3823,7 +3934,7 @@ function Tr(s, e) {
|
|
3823
3934
|
else if (s.orthographicCameraInfo !== void 0)
|
3824
3935
|
for (const o in s.orthographicCameraInfo)
|
3825
3936
|
a.push({
|
3826
|
-
title:
|
3937
|
+
title: xs(o),
|
3827
3938
|
prop: o,
|
3828
3939
|
type: "number",
|
3829
3940
|
step: 0.01,
|
@@ -3849,14 +3960,14 @@ function Tr(s, e) {
|
|
3849
3960
|
}
|
3850
3961
|
);
|
3851
3962
|
}
|
3852
|
-
class
|
3963
|
+
class Fr extends Ie {
|
3853
3964
|
constructor(e, t) {
|
3854
|
-
const i = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0, 1, 1, 0], n = new
|
3855
|
-
n.setAttribute("position", new
|
3856
|
-
const r = new
|
3965
|
+
const i = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0, 1, 1, 0], n = new _t();
|
3966
|
+
n.setAttribute("position", new qe(i, 3)), n.computeBoundingSphere();
|
3967
|
+
const r = new Vi({ fog: !1 });
|
3857
3968
|
super(n, r), this.light = e, this.color = t, this.type = "RectAreaLightHelper";
|
3858
|
-
const a = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0], o = new
|
3859
|
-
o.setAttribute("position", new
|
3969
|
+
const a = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0], o = new _t();
|
3970
|
+
o.setAttribute("position", new qe(a, 3)), o.computeBoundingSphere(), this.add(new M(o, new Je({ side: Xs, fog: !1 })));
|
3860
3971
|
}
|
3861
3972
|
updateMatrixWorld() {
|
3862
3973
|
if (this.scale.set(0.5 * this.light.width, 0.5 * this.light.height, 1), this.color !== void 0)
|
@@ -3872,7 +3983,7 @@ class Mr extends Ie {
|
|
3872
3983
|
this.geometry.dispose(), this.material.dispose(), this.children[0].geometry.dispose(), this.children[0].material.dispose();
|
3873
3984
|
}
|
3874
3985
|
}
|
3875
|
-
const
|
3986
|
+
const Os = { type: "change" }, Gi = { type: "start" }, Cn = { type: "end" }, Wt = new ha(), Ts = new da(), zr = Math.cos(70 * ua.DEG2RAD), oe = new P(), ye = 2 * Math.PI, V = {
|
3876
3987
|
NONE: -1,
|
3877
3988
|
ROTATE: 0,
|
3878
3989
|
DOLLY: 1,
|
@@ -3881,10 +3992,10 @@ const Ss = { type: "change" }, Vi = { type: "start" }, yn = { type: "end" }, Zt
|
|
3881
3992
|
TOUCH_PAN: 4,
|
3882
3993
|
TOUCH_DOLLY_PAN: 5,
|
3883
3994
|
TOUCH_DOLLY_ROTATE: 6
|
3884
|
-
},
|
3885
|
-
class
|
3995
|
+
}, Ci = 1e-6;
|
3996
|
+
class Hr extends hn {
|
3886
3997
|
constructor(e, t = null) {
|
3887
|
-
super(e, t), this.state = V.NONE, this.enabled = !0, this.target = new
|
3998
|
+
super(e, t), this.state = V.NONE, this.enabled = !0, this.target = new P(), this.cursor = new P(), 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: gt.ROTATE, MIDDLE: gt.DOLLY, RIGHT: gt.PAN }, this.touches = { ONE: ft.ROTATE, TWO: ft.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new P(), this._lastQuaternion = new Ce(), this._lastTargetPosition = new P(), this._quat = new Ce().setFromUnitVectors(e.up, new P(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Li(), this._sphericalDelta = new Li(), this._scale = 1, this._panOffset = new P(), this._rotateStart = new pe(), this._rotateEnd = new pe(), this._rotateDelta = new pe(), this._panStart = new pe(), this._panEnd = new pe(), this._panDelta = new pe(), this._dollyStart = new pe(), this._dollyEnd = new pe(), this._dollyDelta = new pe(), this._dollyDirection = new P(), this._mouse = new pe(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Br.bind(this), this._onPointerDown = Yr.bind(this), this._onPointerUp = Vr.bind(this), this._onContextMenu = qr.bind(this), this._onMouseWheel = Gr.bind(this), this._onKeyDown = Xr.bind(this), this._onTouchStart = $r.bind(this), this._onTouchMove = Kr.bind(this), this._onMouseDown = Zr.bind(this), this._onMouseMove = Wr.bind(this), this._interceptControlDown = Qr.bind(this), this._interceptControlUp = Jr.bind(this), this.domElement !== null && this.connect(), this.update();
|
3888
3999
|
}
|
3889
4000
|
connect() {
|
3890
4001
|
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";
|
@@ -3914,7 +4025,7 @@ class Pr extends on {
|
|
3914
4025
|
this.target0.copy(this.target), this.position0.copy(this.object.position), this.zoom0 = this.object.zoom;
|
3915
4026
|
}
|
3916
4027
|
reset() {
|
3917
|
-
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(
|
4028
|
+
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(Os), this.update(), this.state = V.NONE;
|
3918
4029
|
}
|
3919
4030
|
update(e = null) {
|
3920
4031
|
const t = this.object.position;
|
@@ -3936,20 +4047,20 @@ class Pr extends on {
|
|
3936
4047
|
const c = o - a;
|
3937
4048
|
this.object.position.addScaledVector(this._dollyDirection, c), this.object.updateMatrixWorld(), r = !!c;
|
3938
4049
|
} else if (this.object.isOrthographicCamera) {
|
3939
|
-
const o = new
|
4050
|
+
const o = new P(this._mouse.x, this._mouse.y, 0);
|
3940
4051
|
o.unproject(this.object);
|
3941
4052
|
const c = this.object.zoom;
|
3942
4053
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), r = c !== this.object.zoom;
|
3943
|
-
const l = new
|
4054
|
+
const l = new P(this._mouse.x, this._mouse.y, 0);
|
3944
4055
|
l.unproject(this.object), this.object.position.sub(l).add(o), this.object.updateMatrixWorld(), a = oe.length();
|
3945
4056
|
} else
|
3946
4057
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
3947
|
-
a !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position) : (
|
4058
|
+
a !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position) : (Wt.origin.copy(this.object.position), Wt.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Wt.direction)) < zr ? this.object.lookAt(this.target) : (Ts.setFromNormalAndCoplanarPoint(this.object.up, this.target), Wt.intersectPlane(Ts, this.target))));
|
3948
4059
|
} else if (this.object.isOrthographicCamera) {
|
3949
4060
|
const a = this.object.zoom;
|
3950
4061
|
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);
|
3951
4062
|
}
|
3952
|
-
return this._scale = 1, this._performCursorZoom = !1, r || this._lastPosition.distanceToSquared(this.object.position) >
|
4063
|
+
return this._scale = 1, this._performCursorZoom = !1, r || this._lastPosition.distanceToSquared(this.object.position) > Ci || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > Ci || this._lastTargetPosition.distanceToSquared(this.target) > Ci ? (this.dispatchEvent(Os), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
|
3953
4064
|
}
|
3954
4065
|
_getAutoRotationAngle(e) {
|
3955
4066
|
return e !== null ? ye / 60 * this.autoRotateSpeed * e : ye / 60 / 60 * this.autoRotateSpeed;
|
@@ -4143,16 +4254,16 @@ class Pr extends on {
|
|
4143
4254
|
return e.ctrlKey && !this._controlActive && (i.deltaY *= 10), i;
|
4144
4255
|
}
|
4145
4256
|
}
|
4146
|
-
function
|
4257
|
+
function Yr(s) {
|
4147
4258
|
this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(s.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(s) && (this._addPointer(s), s.pointerType === "touch" ? this._onTouchStart(s) : this._onMouseDown(s)));
|
4148
4259
|
}
|
4149
|
-
function
|
4260
|
+
function Br(s) {
|
4150
4261
|
this.enabled !== !1 && (s.pointerType === "touch" ? this._onTouchMove(s) : this._onMouseMove(s));
|
4151
4262
|
}
|
4152
|
-
function
|
4263
|
+
function Vr(s) {
|
4153
4264
|
switch (this._removePointer(s), this._pointers.length) {
|
4154
4265
|
case 0:
|
4155
|
-
this.domElement.releasePointerCapture(s.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(
|
4266
|
+
this.domElement.releasePointerCapture(s.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(Cn), this.state = V.NONE;
|
4156
4267
|
break;
|
4157
4268
|
case 1:
|
4158
4269
|
const e = this._pointers[0], t = this._pointerPositions[e];
|
@@ -4160,7 +4271,7 @@ function Ir(s) {
|
|
4160
4271
|
break;
|
4161
4272
|
}
|
4162
4273
|
}
|
4163
|
-
function
|
4274
|
+
function Zr(s) {
|
4164
4275
|
let e;
|
4165
4276
|
switch (s.button) {
|
4166
4277
|
case 0:
|
@@ -4176,12 +4287,12 @@ function Lr(s) {
|
|
4176
4287
|
e = -1;
|
4177
4288
|
}
|
4178
4289
|
switch (e) {
|
4179
|
-
case
|
4290
|
+
case gt.DOLLY:
|
4180
4291
|
if (this.enableZoom === !1)
|
4181
4292
|
return;
|
4182
4293
|
this._handleMouseDownDolly(s), this.state = V.DOLLY;
|
4183
4294
|
break;
|
4184
|
-
case
|
4295
|
+
case gt.ROTATE:
|
4185
4296
|
if (s.ctrlKey || s.metaKey || s.shiftKey) {
|
4186
4297
|
if (this.enablePan === !1)
|
4187
4298
|
return;
|
@@ -4192,7 +4303,7 @@ function Lr(s) {
|
|
4192
4303
|
this._handleMouseDownRotate(s), this.state = V.ROTATE;
|
4193
4304
|
}
|
4194
4305
|
break;
|
4195
|
-
case
|
4306
|
+
case gt.PAN:
|
4196
4307
|
if (s.ctrlKey || s.metaKey || s.shiftKey) {
|
4197
4308
|
if (this.enableRotate === !1)
|
4198
4309
|
return;
|
@@ -4206,9 +4317,9 @@ function Lr(s) {
|
|
4206
4317
|
default:
|
4207
4318
|
this.state = V.NONE;
|
4208
4319
|
}
|
4209
|
-
this.state !== V.NONE && this.dispatchEvent(
|
4320
|
+
this.state !== V.NONE && this.dispatchEvent(Gi);
|
4210
4321
|
}
|
4211
|
-
function
|
4322
|
+
function Wr(s) {
|
4212
4323
|
switch (this.state) {
|
4213
4324
|
case V.ROTATE:
|
4214
4325
|
if (this.enableRotate === !1)
|
@@ -4227,22 +4338,22 @@ function kr(s) {
|
|
4227
4338
|
break;
|
4228
4339
|
}
|
4229
4340
|
}
|
4230
|
-
function
|
4231
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !== V.NONE || (s.preventDefault(), this.dispatchEvent(
|
4341
|
+
function Gr(s) {
|
4342
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== V.NONE || (s.preventDefault(), this.dispatchEvent(Gi), this._handleMouseWheel(this._customWheelEvent(s)), this.dispatchEvent(Cn));
|
4232
4343
|
}
|
4233
|
-
function
|
4344
|
+
function Xr(s) {
|
4234
4345
|
this.enabled === !1 || this.enablePan === !1 || this._handleKeyDown(s);
|
4235
4346
|
}
|
4236
|
-
function
|
4347
|
+
function $r(s) {
|
4237
4348
|
switch (this._trackPointer(s), this._pointers.length) {
|
4238
4349
|
case 1:
|
4239
4350
|
switch (this.touches.ONE) {
|
4240
|
-
case
|
4351
|
+
case ft.ROTATE:
|
4241
4352
|
if (this.enableRotate === !1)
|
4242
4353
|
return;
|
4243
4354
|
this._handleTouchStartRotate(s), this.state = V.TOUCH_ROTATE;
|
4244
4355
|
break;
|
4245
|
-
case
|
4356
|
+
case ft.PAN:
|
4246
4357
|
if (this.enablePan === !1)
|
4247
4358
|
return;
|
4248
4359
|
this._handleTouchStartPan(s), this.state = V.TOUCH_PAN;
|
@@ -4253,12 +4364,12 @@ function Nr(s) {
|
|
4253
4364
|
break;
|
4254
4365
|
case 2:
|
4255
4366
|
switch (this.touches.TWO) {
|
4256
|
-
case
|
4367
|
+
case ft.DOLLY_PAN:
|
4257
4368
|
if (this.enableZoom === !1 && this.enablePan === !1)
|
4258
4369
|
return;
|
4259
4370
|
this._handleTouchStartDollyPan(s), this.state = V.TOUCH_DOLLY_PAN;
|
4260
4371
|
break;
|
4261
|
-
case
|
4372
|
+
case ft.DOLLY_ROTATE:
|
4262
4373
|
if (this.enableZoom === !1 && this.enableRotate === !1)
|
4263
4374
|
return;
|
4264
4375
|
this._handleTouchStartDollyRotate(s), this.state = V.TOUCH_DOLLY_ROTATE;
|
@@ -4270,9 +4381,9 @@ function Nr(s) {
|
|
4270
4381
|
default:
|
4271
4382
|
this.state = V.NONE;
|
4272
4383
|
}
|
4273
|
-
this.state !== V.NONE && this.dispatchEvent(
|
4384
|
+
this.state !== V.NONE && this.dispatchEvent(Gi);
|
4274
4385
|
}
|
4275
|
-
function
|
4386
|
+
function Kr(s) {
|
4276
4387
|
switch (this._trackPointer(s), this.state) {
|
4277
4388
|
case V.TOUCH_ROTATE:
|
4278
4389
|
if (this.enableRotate === !1)
|
@@ -4298,13 +4409,13 @@ function Fr(s) {
|
|
4298
4409
|
this.state = V.NONE;
|
4299
4410
|
}
|
4300
4411
|
}
|
4301
|
-
function
|
4412
|
+
function qr(s) {
|
4302
4413
|
this.enabled !== !1 && s.preventDefault();
|
4303
4414
|
}
|
4304
|
-
function
|
4415
|
+
function Qr(s) {
|
4305
4416
|
s.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
4306
4417
|
}
|
4307
|
-
function
|
4418
|
+
function Jr(s) {
|
4308
4419
|
s.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
4309
4420
|
}
|
4310
4421
|
/*!
|
@@ -4335,7 +4446,7 @@ const ee = {
|
|
4335
4446
|
TOUCH_ZOOM_TRUCK: 8192,
|
4336
4447
|
TOUCH_ZOOM_OFFSET: 16384,
|
4337
4448
|
TOUCH_ZOOM_ROTATE: 32768
|
4338
|
-
}),
|
4449
|
+
}), ct = {
|
4339
4450
|
NONE: 0,
|
4340
4451
|
IN: 1,
|
4341
4452
|
OUT: -1
|
@@ -4346,26 +4457,26 @@ function Ze(s) {
|
|
4346
4457
|
function Be(s) {
|
4347
4458
|
return s.isOrthographicCamera;
|
4348
4459
|
}
|
4349
|
-
const
|
4460
|
+
const ht = Math.PI * 2, Ms = Math.PI / 2, Sn = 1e-5, Ot = Math.PI / 180;
|
4350
4461
|
function Me(s, e, t) {
|
4351
4462
|
return Math.max(e, Math.min(t, s));
|
4352
4463
|
}
|
4353
|
-
function
|
4464
|
+
function K(s, e = Sn) {
|
4354
4465
|
return Math.abs(s) < e;
|
4355
4466
|
}
|
4356
|
-
function Y(s, e, t =
|
4357
|
-
return
|
4467
|
+
function Y(s, e, t = Sn) {
|
4468
|
+
return K(s - e, t);
|
4358
4469
|
}
|
4359
|
-
function
|
4470
|
+
function Ps(s, e) {
|
4360
4471
|
return Math.round(s / e) * e;
|
4361
4472
|
}
|
4362
|
-
function
|
4473
|
+
function Tt(s) {
|
4363
4474
|
return isFinite(s) ? s : s < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;
|
4364
4475
|
}
|
4365
|
-
function
|
4476
|
+
function Mt(s) {
|
4366
4477
|
return Math.abs(s) < Number.MAX_VALUE ? s : s * (1 / 0);
|
4367
4478
|
}
|
4368
|
-
function
|
4479
|
+
function Gt(s, e, t, i, n = 1 / 0, r) {
|
4369
4480
|
i = Math.max(1e-4, i);
|
4370
4481
|
const a = 2 / i, o = a * r, c = 1 / (1 + o + 0.48 * o * o + 0.235 * o * o * o);
|
4371
4482
|
let l = s - e;
|
@@ -4376,30 +4487,30 @@ function Wt(s, e, t, i, n = 1 / 0, r) {
|
|
4376
4487
|
let f = e + (l + m) * c;
|
4377
4488
|
return d - s > 0 == f > d && (f = d, t.value = (f - d) / r), f;
|
4378
4489
|
}
|
4379
|
-
function
|
4490
|
+
function As(s, e, t, i, n = 1 / 0, r, a) {
|
4380
4491
|
i = Math.max(1e-4, i);
|
4381
4492
|
const o = 2 / i, c = o * r, l = 1 / (1 + c + 0.48 * c * c + 0.235 * c * c * c);
|
4382
|
-
let d = e.x, p = e.y, m = e.z, f = s.x - d,
|
4383
|
-
const T = d, g = p, v = m, S = n * i,
|
4384
|
-
if (w >
|
4493
|
+
let d = e.x, p = e.y, m = e.z, f = s.x - d, C = s.y - p, y = s.z - m;
|
4494
|
+
const T = d, g = p, v = m, S = n * i, E = S * S, w = f * f + C * C + y * y;
|
4495
|
+
if (w > E) {
|
4385
4496
|
const $ = Math.sqrt(w);
|
4386
|
-
f = f / $ * S,
|
4497
|
+
f = f / $ * S, C = C / $ * S, y = y / $ * S;
|
4387
4498
|
}
|
4388
|
-
d = s.x - f, p = s.y -
|
4389
|
-
const O = (t.x + o * f) * r, L = (t.y + o *
|
4390
|
-
t.x = (t.x - o * O) * l, t.y = (t.y - o * L) * l, t.z = (t.z - o * j) * l, a.x = d + (f + O) * l, a.y = p + (
|
4391
|
-
const R = T - s.x, B = g - s.y, Se = v - s.z, _e = a.x - T, re = a.y - g,
|
4392
|
-
return R * _e + B * re + Se *
|
4499
|
+
d = s.x - f, p = s.y - C, m = s.z - y;
|
4500
|
+
const O = (t.x + o * f) * r, L = (t.y + o * C) * r, j = (t.z + o * y) * r;
|
4501
|
+
t.x = (t.x - o * O) * l, t.y = (t.y - o * L) * l, t.z = (t.z - o * j) * l, a.x = d + (f + O) * l, a.y = p + (C + L) * l, a.z = m + (y + j) * l;
|
4502
|
+
const R = T - s.x, B = g - s.y, Se = v - s.z, _e = a.x - T, re = a.y - g, q = a.z - v;
|
4503
|
+
return R * _e + B * re + Se * q > 0 && (a.x = T, a.y = g, a.z = v, t.x = (a.x - T) / r, t.y = (a.y - g) / r, t.z = (a.z - v) / r), a;
|
4393
4504
|
}
|
4394
|
-
function
|
4505
|
+
function Si(s, e) {
|
4395
4506
|
e.set(0, 0), s.forEach((t) => {
|
4396
4507
|
e.x += t.clientX, e.y += t.clientY;
|
4397
4508
|
}), e.x /= s.length, e.y /= s.length;
|
4398
4509
|
}
|
4399
|
-
function
|
4510
|
+
function wi(s, e) {
|
4400
4511
|
return Be(s) ? (console.warn(`${e} is not supported in OrthographicCamera`), !0) : !1;
|
4401
4512
|
}
|
4402
|
-
class
|
4513
|
+
class eo {
|
4403
4514
|
constructor() {
|
4404
4515
|
this._listeners = {};
|
4405
4516
|
}
|
@@ -4463,10 +4574,10 @@ class Br {
|
|
4463
4574
|
}
|
4464
4575
|
}
|
4465
4576
|
}
|
4466
|
-
var
|
4467
|
-
const
|
4468
|
-
let I,
|
4469
|
-
class ke extends
|
4577
|
+
var xi;
|
4578
|
+
const to = "2.9.0", Xt = 1 / 8, io = /Mac/.test((xi = globalThis?.navigator) === null || xi === void 0 ? void 0 : xi.platform);
|
4579
|
+
let I, Ds, $t, Oi, be, U, z, dt, Pt, Ae, De, We, Rs, Is, xe, At, ut, Ls, Ti, ks, Mi, Pi, Kt;
|
4580
|
+
class ke extends eo {
|
4470
4581
|
/**
|
4471
4582
|
* Injects THREE as the dependency. You can then proceed to use CameraControls.
|
4472
4583
|
*
|
@@ -4508,7 +4619,7 @@ class ke extends Br {
|
|
4508
4619
|
* @category Statics
|
4509
4620
|
*/
|
4510
4621
|
static install(e) {
|
4511
|
-
I = e.THREE,
|
4622
|
+
I = e.THREE, Ds = Object.freeze(new I.Vector3(0, 0, 0)), $t = Object.freeze(new I.Vector3(0, 1, 0)), Oi = Object.freeze(new I.Vector3(0, 0, 1)), be = new I.Vector2(), U = new I.Vector3(), z = new I.Vector3(), dt = new I.Vector3(), Pt = new I.Vector3(), Ae = new I.Vector3(), De = new I.Vector3(), We = new I.Vector3(), Rs = new I.Vector3(), Is = new I.Vector3(), xe = new I.Spherical(), At = new I.Spherical(), ut = new I.Box3(), Ls = new I.Box3(), Ti = new I.Sphere(), ks = new I.Quaternion(), Mi = new I.Quaternion(), Pi = new I.Matrix4(), Kt = new I.Raycaster();
|
4512
4623
|
}
|
4513
4624
|
/**
|
4514
4625
|
* list all ACTIONs
|
@@ -4536,27 +4647,27 @@ class ke extends Br {
|
|
4536
4647
|
*/
|
4537
4648
|
constructor(e, t) {
|
4538
4649
|
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 = () => {
|
4539
|
-
}, this._enabled = !0, this._state = _.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 =
|
4540
|
-
let
|
4650
|
+
}, this._enabled = !0, this._state = _.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 = ct.NONE, this._thetaVelocity = { value: 0 }, this._phiVelocity = { value: 0 }, this._radiusVelocity = { value: 0 }, this._targetVelocity = new I.Vector3(), this._focalOffsetVelocity = new I.Vector3(), this._zoomVelocity = { value: 0 }, this._truckInternal = (g, v, S) => {
|
4651
|
+
let E, w;
|
4541
4652
|
if (Ze(this._camera)) {
|
4542
|
-
const O = U.copy(this._camera.position).sub(this._target), L = this._camera.getEffectiveFOV() *
|
4543
|
-
|
4653
|
+
const O = U.copy(this._camera.position).sub(this._target), L = this._camera.getEffectiveFOV() * Ot, j = O.length() * Math.tan(L * 0.5);
|
4654
|
+
E = this.truckSpeed * g * j / this._elementRect.height, w = this.truckSpeed * v * j / this._elementRect.height;
|
4544
4655
|
} else if (Be(this._camera)) {
|
4545
4656
|
const O = this._camera;
|
4546
|
-
|
4657
|
+
E = g * (O.right - O.left) / O.zoom / this._elementRect.width, w = v * (O.top - O.bottom) / O.zoom / this._elementRect.height;
|
4547
4658
|
} else
|
4548
4659
|
return;
|
4549
|
-
this.verticalDragToForward ? (S ? this.setFocalOffset(this._focalOffsetEnd.x +
|
4660
|
+
this.verticalDragToForward ? (S ? this.setFocalOffset(this._focalOffsetEnd.x + E, this._focalOffsetEnd.y, this._focalOffsetEnd.z, !0) : this.truck(E, 0, !0), this.forward(-w, !0)) : S ? this.setFocalOffset(this._focalOffsetEnd.x + E, this._focalOffsetEnd.y + w, this._focalOffsetEnd.z, !0) : this.truck(E, w, !0);
|
4550
4661
|
}, this._rotateInternal = (g, v) => {
|
4551
|
-
const S =
|
4552
|
-
this.rotate(S,
|
4662
|
+
const S = ht * this.azimuthRotateSpeed * g / this._elementRect.height, E = ht * this.polarRotateSpeed * v / this._elementRect.height;
|
4663
|
+
this.rotate(S, E, !0);
|
4553
4664
|
}, this._dollyInternal = (g, v, S) => {
|
4554
|
-
const
|
4665
|
+
const E = Math.pow(0.95, -g * this.dollySpeed), w = this._sphericalEnd.radius, O = this._sphericalEnd.radius * E, L = Me(O, this.minDistance, this.maxDistance), j = L - O;
|
4555
4666
|
this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(O, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(j, !0), this._dollyToNoClamp(L, !0)) : this._dollyToNoClamp(L, !0), this.dollyToCursor && (this._changedDolly += (this.infinityDolly ? O : L) - w, this._dollyControlCoord.set(v, S)), this._lastDollyDirection = Math.sign(-g);
|
4556
4667
|
}, this._zoomInternal = (g, v, S) => {
|
4557
|
-
const
|
4668
|
+
const E = Math.pow(0.95, g * this.dollySpeed), w = this._zoom, O = this._zoom * E;
|
4558
4669
|
this.zoomTo(O, !0), this.dollyToCursor && (this._changedZoom += O - w, this._dollyControlCoord.set(v, S));
|
4559
|
-
}, typeof I > "u" && console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."), this._camera = e, this._yAxisUpSpace = new I.Quaternion().setFromUnitVectors(this._camera.up,
|
4670
|
+
}, typeof I > "u" && console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."), this._camera = e, this._yAxisUpSpace = new I.Quaternion().setFromUnitVectors(this._camera.up, $t), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state = _.NONE, this._target = new I.Vector3(), this._targetEnd = this._target.clone(), this._focalOffset = new I.Vector3(), this._focalOffsetEnd = this._focalOffset.clone(), this._spherical = new I.Spherical().setFromVector3(U.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)), this._sphericalEnd = this._spherical.clone(), this._lastDistance = this._spherical.radius, this._zoom = this._camera.zoom, this._zoomEnd = this._zoom, this._lastZoom = this._zoom, this._nearPlaneCorners = [
|
4560
4671
|
new I.Vector3(),
|
4561
4672
|
new I.Vector3(),
|
4562
4673
|
new I.Vector3(),
|
@@ -4575,14 +4686,14 @@ class ke extends Br {
|
|
4575
4686
|
if (!this._enabled || !this._domElement)
|
4576
4687
|
return;
|
4577
4688
|
if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
|
4578
|
-
const
|
4689
|
+
const E = this._domElement.getBoundingClientRect(), w = g.clientX / E.width, O = g.clientY / E.height;
|
4579
4690
|
if (w < this._interactiveArea.left || w > this._interactiveArea.right || O < this._interactiveArea.top || O > this._interactiveArea.bottom)
|
4580
4691
|
return;
|
4581
4692
|
}
|
4582
4693
|
const v = g.pointerType !== "mouse" ? null : (g.buttons & ee.LEFT) === ee.LEFT ? ee.LEFT : (g.buttons & ee.MIDDLE) === ee.MIDDLE ? ee.MIDDLE : (g.buttons & ee.RIGHT) === ee.RIGHT ? ee.RIGHT : null;
|
4583
4694
|
if (v !== null) {
|
4584
|
-
const
|
4585
|
-
|
4695
|
+
const E = this._findPointerByMouseButton(v);
|
4696
|
+
E && this._disposePointer(E);
|
4586
4697
|
}
|
4587
4698
|
if ((g.buttons & ee.LEFT) === ee.LEFT && this._lockedPointer)
|
4588
4699
|
return;
|
@@ -4635,7 +4746,7 @@ class ke extends Br {
|
|
4635
4746
|
}
|
4636
4747
|
else
|
4637
4748
|
this._state = _.NONE;
|
4638
|
-
|
4749
|
+
C();
|
4639
4750
|
}
|
4640
4751
|
};
|
4641
4752
|
let l = -1;
|
@@ -4651,7 +4762,7 @@ class ke extends Br {
|
|
4651
4762
|
const O = performance.now();
|
4652
4763
|
l - O < 1e3 && this._getClientRect(this._elementRect), l = O;
|
4653
4764
|
}
|
4654
|
-
const v =
|
4765
|
+
const v = io ? -1 : -3, S = g.deltaMode === 1 ? g.deltaY / v : g.deltaY / (v * 10), E = this.dollyToCursor ? (g.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, w = this.dollyToCursor ? (g.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
4655
4766
|
switch (this.mouseButtons.wheel) {
|
4656
4767
|
case _.ROTATE: {
|
4657
4768
|
this._rotateInternal(g.deltaX, g.deltaY), this._isUserControllingRotate = !0;
|
@@ -4666,11 +4777,11 @@ class ke extends Br {
|
|
4666
4777
|
break;
|
4667
4778
|
}
|
4668
4779
|
case _.DOLLY: {
|
4669
|
-
this._dollyInternal(-S,
|
4780
|
+
this._dollyInternal(-S, E, w), this._isUserControllingDolly = !0;
|
4670
4781
|
break;
|
4671
4782
|
}
|
4672
4783
|
case _.ZOOM: {
|
4673
|
-
this._zoomInternal(-S,
|
4784
|
+
this._zoomInternal(-S, E, w), this._isUserControllingZoom = !0;
|
4674
4785
|
break;
|
4675
4786
|
}
|
4676
4787
|
}
|
@@ -4687,8 +4798,8 @@ class ke extends Br {
|
|
4687
4798
|
}, m = (g) => {
|
4688
4799
|
if (!this._enabled)
|
4689
4800
|
return;
|
4690
|
-
if (
|
4691
|
-
const S = be.x - this._activePointers[1].clientX,
|
4801
|
+
if (Si(this._activePointers, be), this._getClientRect(this._elementRect), i.copy(be), n.copy(be), this._activePointers.length >= 2) {
|
4802
|
+
const S = be.x - this._activePointers[1].clientX, E = be.y - this._activePointers[1].clientY, w = Math.sqrt(S * S + E * E);
|
4692
4803
|
r.set(0, w);
|
4693
4804
|
const O = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, L = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
|
4694
4805
|
n.set(O, L);
|
@@ -4713,21 +4824,21 @@ class ke extends Br {
|
|
4713
4824
|
}, f = () => {
|
4714
4825
|
if (!this._enabled || !this._dragNeedsUpdate)
|
4715
4826
|
return;
|
4716
|
-
this._dragNeedsUpdate = !1,
|
4717
|
-
const v = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, S = v ? -v.deltaX : n.x - be.x,
|
4718
|
-
if (n.copy(be), ((this._state & _.ROTATE) === _.ROTATE || (this._state & _.TOUCH_ROTATE) === _.TOUCH_ROTATE || (this._state & _.TOUCH_DOLLY_ROTATE) === _.TOUCH_DOLLY_ROTATE || (this._state & _.TOUCH_ZOOM_ROTATE) === _.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(S,
|
4827
|
+
this._dragNeedsUpdate = !1, Si(this._activePointers, be);
|
4828
|
+
const v = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, S = v ? -v.deltaX : n.x - be.x, E = v ? -v.deltaY : n.y - be.y;
|
4829
|
+
if (n.copy(be), ((this._state & _.ROTATE) === _.ROTATE || (this._state & _.TOUCH_ROTATE) === _.TOUCH_ROTATE || (this._state & _.TOUCH_DOLLY_ROTATE) === _.TOUCH_DOLLY_ROTATE || (this._state & _.TOUCH_ZOOM_ROTATE) === _.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(S, E), this._isUserControllingRotate = !0), (this._state & _.DOLLY) === _.DOLLY || (this._state & _.ZOOM) === _.ZOOM) {
|
4719
4830
|
const w = this.dollyToCursor ? (i.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, O = this.dollyToCursor ? (i.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0, L = this.dollyDragInverted ? -1 : 1;
|
4720
|
-
(this._state & _.DOLLY) === _.DOLLY ? (this._dollyInternal(L *
|
4831
|
+
(this._state & _.DOLLY) === _.DOLLY ? (this._dollyInternal(L * E * Xt, w, O), this._isUserControllingDolly = !0) : (this._zoomInternal(L * E * Xt, w, O), this._isUserControllingZoom = !0);
|
4721
4832
|
}
|
4722
4833
|
if ((this._state & _.TOUCH_DOLLY) === _.TOUCH_DOLLY || (this._state & _.TOUCH_ZOOM) === _.TOUCH_ZOOM || (this._state & _.TOUCH_DOLLY_TRUCK) === _.TOUCH_DOLLY_TRUCK || (this._state & _.TOUCH_ZOOM_TRUCK) === _.TOUCH_ZOOM_TRUCK || (this._state & _.TOUCH_DOLLY_OFFSET) === _.TOUCH_DOLLY_OFFSET || (this._state & _.TOUCH_ZOOM_OFFSET) === _.TOUCH_ZOOM_OFFSET || (this._state & _.TOUCH_DOLLY_ROTATE) === _.TOUCH_DOLLY_ROTATE || (this._state & _.TOUCH_ZOOM_ROTATE) === _.TOUCH_ZOOM_ROTATE) {
|
4723
4834
|
const w = be.x - this._activePointers[1].clientX, O = be.y - this._activePointers[1].clientY, L = Math.sqrt(w * w + O * O), j = r.y - L;
|
4724
4835
|
r.set(0, L);
|
4725
4836
|
const R = this.dollyToCursor ? (n.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, B = this.dollyToCursor ? (n.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
4726
|
-
(this._state & _.TOUCH_DOLLY) === _.TOUCH_DOLLY || (this._state & _.TOUCH_DOLLY_ROTATE) === _.TOUCH_DOLLY_ROTATE || (this._state & _.TOUCH_DOLLY_TRUCK) === _.TOUCH_DOLLY_TRUCK || (this._state & _.TOUCH_DOLLY_OFFSET) === _.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(j *
|
4837
|
+
(this._state & _.TOUCH_DOLLY) === _.TOUCH_DOLLY || (this._state & _.TOUCH_DOLLY_ROTATE) === _.TOUCH_DOLLY_ROTATE || (this._state & _.TOUCH_DOLLY_TRUCK) === _.TOUCH_DOLLY_TRUCK || (this._state & _.TOUCH_DOLLY_OFFSET) === _.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(j * Xt, R, B), this._isUserControllingDolly = !0) : (this._zoomInternal(j * Xt, R, B), this._isUserControllingZoom = !0);
|
4727
4838
|
}
|
4728
|
-
((this._state & _.TRUCK) === _.TRUCK || (this._state & _.TOUCH_TRUCK) === _.TOUCH_TRUCK || (this._state & _.TOUCH_DOLLY_TRUCK) === _.TOUCH_DOLLY_TRUCK || (this._state & _.TOUCH_ZOOM_TRUCK) === _.TOUCH_ZOOM_TRUCK) && (this._truckInternal(S,
|
4729
|
-
},
|
4730
|
-
|
4839
|
+
((this._state & _.TRUCK) === _.TRUCK || (this._state & _.TOUCH_TRUCK) === _.TOUCH_TRUCK || (this._state & _.TOUCH_DOLLY_TRUCK) === _.TOUCH_DOLLY_TRUCK || (this._state & _.TOUCH_ZOOM_TRUCK) === _.TOUCH_ZOOM_TRUCK) && (this._truckInternal(S, E, !1), this._isUserControllingTruck = !0), ((this._state & _.OFFSET) === _.OFFSET || (this._state & _.TOUCH_OFFSET) === _.TOUCH_OFFSET || (this._state & _.TOUCH_DOLLY_OFFSET) === _.TOUCH_DOLLY_OFFSET || (this._state & _.TOUCH_ZOOM_OFFSET) === _.TOUCH_ZOOM_OFFSET) && (this._truckInternal(S, E, !0), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
|
4840
|
+
}, C = () => {
|
4841
|
+
Si(this._activePointers, be), n.copy(be), 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" }));
|
4731
4842
|
};
|
4732
4843
|
this.lockPointer = () => {
|
4733
4844
|
!this._enabled || !this._domElement || (this.cancel(), this._lockedPointer = {
|
@@ -4752,7 +4863,7 @@ class ke extends Br {
|
|
4752
4863
|
}, this._removeAllEventListeners = () => {
|
4753
4864
|
this._domElement && (this._domElement.style.touchAction = "", this._domElement.style.userSelect = "", this._domElement.style.webkitUserSelect = "", this._domElement.removeEventListener("pointerdown", a), this._domElement.removeEventListener("pointercancel", c), this._domElement.removeEventListener("wheel", d, { passive: !1 }), this._domElement.removeEventListener("contextmenu", p), this._domElement.ownerDocument.removeEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c), this._domElement.ownerDocument.removeEventListener("pointerlockchange", y), this._domElement.ownerDocument.removeEventListener("pointerlockerror", T));
|
4754
4865
|
}, this.cancel = () => {
|
4755
|
-
this._state !== _.NONE && (this._state = _.NONE, this._activePointers.length = 0,
|
4866
|
+
this._state !== _.NONE && (this._state = _.NONE, this._activePointers.length = 0, C());
|
4756
4867
|
}, t && this.connect(t), this.update(0);
|
4757
4868
|
}
|
4758
4869
|
/**
|
@@ -4985,7 +5096,7 @@ class ke extends Br {
|
|
4985
5096
|
* @category Methods
|
4986
5097
|
*/
|
4987
5098
|
dollyTo(e, t = !1) {
|
4988
|
-
return this._isUserControllingDolly = !1, this._lastDollyDirection =
|
5099
|
+
return this._isUserControllingDolly = !1, this._lastDollyDirection = ct.NONE, this._changedDolly = 0, this._dollyToNoClamp(Me(e, this.minDistance, this.maxDistance), t);
|
4989
5100
|
}
|
4990
5101
|
_dollyToNoClamp(e, t = !1) {
|
4991
5102
|
const i = this._sphericalEnd.radius;
|
@@ -5008,7 +5119,7 @@ class ke extends Br {
|
|
5008
5119
|
* @category Methods
|
5009
5120
|
*/
|
5010
5121
|
dollyInFixed(e, t = !1) {
|
5011
|
-
this._targetEnd.add(this._getCameraDirection(
|
5122
|
+
this._targetEnd.add(this._getCameraDirection(Pt).multiplyScalar(e)), t || this._target.copy(this._targetEnd);
|
5012
5123
|
const i = !t || Y(this._target.x, this._targetEnd.x, this.restThreshold) && Y(this._target.y, this._targetEnd.y, this.restThreshold) && Y(this._target.z, this._targetEnd.z, this.restThreshold);
|
5013
5124
|
return this._createOnRestPromise(i);
|
5014
5125
|
}
|
@@ -5049,8 +5160,8 @@ class ke extends Br {
|
|
5049
5160
|
* @category Methods
|
5050
5161
|
*/
|
5051
5162
|
truck(e, t, i = !1) {
|
5052
|
-
this._camera.updateMatrix(),
|
5053
|
-
const n = U.copy(
|
5163
|
+
this._camera.updateMatrix(), Ae.setFromMatrixColumn(this._camera.matrix, 0), De.setFromMatrixColumn(this._camera.matrix, 1), Ae.multiplyScalar(e), De.multiplyScalar(-t);
|
5164
|
+
const n = U.copy(Ae).add(De), r = z.copy(this._targetEnd).add(n);
|
5054
5165
|
return this.moveTo(r.x, r.y, r.z, i);
|
5055
5166
|
}
|
5056
5167
|
/**
|
@@ -5115,20 +5226,20 @@ class ke extends Br {
|
|
5115
5226
|
* @category Methods
|
5116
5227
|
*/
|
5117
5228
|
fitToBox(e, t, { cover: i = !1, paddingLeft: n = 0, paddingRight: r = 0, paddingBottom: a = 0, paddingTop: o = 0 } = {}) {
|
5118
|
-
const c = [], l = e.isBox3 ?
|
5229
|
+
const c = [], l = e.isBox3 ? ut.copy(e) : ut.setFromObject(e);
|
5119
5230
|
l.isEmpty() && (console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"), Promise.resolve());
|
5120
|
-
const d =
|
5231
|
+
const d = Ps(this._sphericalEnd.theta, Ms), p = Ps(this._sphericalEnd.phi, Ms);
|
5121
5232
|
c.push(this.rotateTo(d, p, t));
|
5122
|
-
const m = U.setFromSpherical(this._sphericalEnd).normalize(), f =
|
5123
|
-
|
5124
|
-
const y =
|
5125
|
-
z.copy(l.min).applyQuaternion(f), y.expandByPoint(z), z.copy(l.min).setX(l.max.x).applyQuaternion(f), y.expandByPoint(z), z.copy(l.min).setY(l.max.y).applyQuaternion(f), y.expandByPoint(z), z.copy(l.max).setZ(l.min.z).applyQuaternion(f), y.expandByPoint(z), z.copy(l.min).setZ(l.max.z).applyQuaternion(f), y.expandByPoint(z), z.copy(l.max).setY(l.min.y).applyQuaternion(f), y.expandByPoint(z), z.copy(l.max).setX(l.min.x).applyQuaternion(f), y.expandByPoint(z), z.copy(l.max).applyQuaternion(f), y.expandByPoint(z), y.min.x -= n, y.min.y -= a, y.max.x += r, y.max.y += o, f.setFromUnitVectors(
|
5233
|
+
const m = U.setFromSpherical(this._sphericalEnd).normalize(), f = ks.setFromUnitVectors(m, Oi), C = Y(Math.abs(m.y), 1);
|
5234
|
+
C && f.multiply(Mi.setFromAxisAngle($t, d)), f.multiply(this._yAxisUpSpaceInverse);
|
5235
|
+
const y = Ls.makeEmpty();
|
5236
|
+
z.copy(l.min).applyQuaternion(f), y.expandByPoint(z), z.copy(l.min).setX(l.max.x).applyQuaternion(f), y.expandByPoint(z), z.copy(l.min).setY(l.max.y).applyQuaternion(f), y.expandByPoint(z), z.copy(l.max).setZ(l.min.z).applyQuaternion(f), y.expandByPoint(z), z.copy(l.min).setZ(l.max.z).applyQuaternion(f), y.expandByPoint(z), z.copy(l.max).setY(l.min.y).applyQuaternion(f), y.expandByPoint(z), z.copy(l.max).setX(l.min.x).applyQuaternion(f), y.expandByPoint(z), z.copy(l.max).applyQuaternion(f), y.expandByPoint(z), y.min.x -= n, y.min.y -= a, y.max.x += r, y.max.y += o, f.setFromUnitVectors(Oi, m), C && f.premultiply(Mi.invert()), f.premultiply(this._yAxisUpSpace);
|
5126
5237
|
const T = y.getSize(U), g = y.getCenter(z).applyQuaternion(f);
|
5127
5238
|
if (Ze(this._camera)) {
|
5128
5239
|
const v = this.getDistanceToFitBox(T.x, T.y, T.z, i);
|
5129
5240
|
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));
|
5130
5241
|
} else if (Be(this._camera)) {
|
5131
|
-
const v = this._camera, S = v.right - v.left,
|
5242
|
+
const v = this._camera, S = v.right - v.left, E = v.top - v.bottom, w = i ? Math.max(S / T.x, E / T.y) : Math.min(S / T.x, E / T.y);
|
5132
5243
|
c.push(this.moveTo(g.x, g.y, g.z, t)), c.push(this.zoomTo(w, t)), c.push(this.setFocalOffset(0, 0, 0, t));
|
5133
5244
|
}
|
5134
5245
|
return Promise.all(c);
|
@@ -5140,7 +5251,7 @@ class ke extends Br {
|
|
5140
5251
|
* @category Methods
|
5141
5252
|
*/
|
5142
5253
|
fitToSphere(e, t) {
|
5143
|
-
const i = [], r = "isObject3D" in e ? ke.createBoundingSphere(e,
|
5254
|
+
const i = [], r = "isObject3D" in e ? ke.createBoundingSphere(e, Ti) : Ti.copy(e);
|
5144
5255
|
if (i.push(this.moveTo(r.center.x, r.center.y, r.center.z, t)), Ze(this._camera)) {
|
5145
5256
|
const a = this.getDistanceToFitSphere(r.radius);
|
5146
5257
|
i.push(this.dollyTo(a, t));
|
@@ -5162,7 +5273,7 @@ class ke extends Br {
|
|
5162
5273
|
* @category Methods
|
5163
5274
|
*/
|
5164
5275
|
setLookAt(e, t, i, n, r, a, o = !1) {
|
5165
|
-
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection =
|
5276
|
+
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = ct.NONE, this._changedDolly = 0;
|
5166
5277
|
const c = z.set(n, r, a), l = U.set(e, t, i);
|
5167
5278
|
this._targetEnd.copy(c), this._sphericalEnd.setFromVector3(l.sub(c).applyQuaternion(this._yAxisUpSpace)), this.normalizeRotations(), this._needsUpdate = !0, o || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
|
5168
5279
|
const d = !o || Y(this._target.x, this._targetEnd.x, this.restThreshold) && Y(this._target.y, this._targetEnd.y, this.restThreshold) && Y(this._target.z, this._targetEnd.z, this.restThreshold) && Y(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && Y(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold) && Y(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
|
@@ -5186,15 +5297,15 @@ class ke extends Br {
|
|
5186
5297
|
* @param enableTransition
|
5187
5298
|
* @category Methods
|
5188
5299
|
*/
|
5189
|
-
lerpLookAt(e, t, i, n, r, a, o, c, l, d, p, m, f,
|
5190
|
-
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection =
|
5300
|
+
lerpLookAt(e, t, i, n, r, a, o, c, l, d, p, m, f, C = !1) {
|
5301
|
+
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = ct.NONE, this._changedDolly = 0;
|
5191
5302
|
const y = U.set(n, r, a), T = z.set(e, t, i);
|
5192
5303
|
xe.setFromVector3(T.sub(y).applyQuaternion(this._yAxisUpSpace));
|
5193
|
-
const g =
|
5304
|
+
const g = dt.set(d, p, m), v = z.set(o, c, l);
|
5194
5305
|
At.setFromVector3(v.sub(g).applyQuaternion(this._yAxisUpSpace)), this._targetEnd.copy(y.lerp(g, f));
|
5195
|
-
const S = At.theta - xe.theta,
|
5196
|
-
this._sphericalEnd.set(xe.radius + w * f, xe.phi +
|
5197
|
-
const O = !
|
5306
|
+
const S = At.theta - xe.theta, E = At.phi - xe.phi, w = At.radius - xe.radius;
|
5307
|
+
this._sphericalEnd.set(xe.radius + w * f, xe.phi + E * f, xe.theta + S * f), this.normalizeRotations(), this._needsUpdate = !0, C || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
|
5308
|
+
const O = !C || Y(this._target.x, this._targetEnd.x, this.restThreshold) && Y(this._target.y, this._targetEnd.y, this.restThreshold) && Y(this._target.z, this._targetEnd.z, this.restThreshold) && Y(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && Y(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold) && Y(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
|
5198
5309
|
return this._createOnRestPromise(O);
|
5199
5310
|
}
|
5200
5311
|
/**
|
@@ -5244,9 +5355,9 @@ class ke extends Br {
|
|
5244
5355
|
* @category Methods
|
5245
5356
|
*/
|
5246
5357
|
setOrbitPoint(e, t, i) {
|
5247
|
-
this._camera.updateMatrixWorld(),
|
5358
|
+
this._camera.updateMatrixWorld(), Ae.setFromMatrixColumn(this._camera.matrixWorldInverse, 0), De.setFromMatrixColumn(this._camera.matrixWorldInverse, 1), We.setFromMatrixColumn(this._camera.matrixWorldInverse, 2);
|
5248
5359
|
const n = U.set(e, t, i), r = n.distanceTo(this._camera.position), a = n.sub(this._camera.position);
|
5249
|
-
|
5360
|
+
Ae.multiplyScalar(a.x), De.multiplyScalar(a.y), We.multiplyScalar(a.z), U.copy(Ae).add(De).add(We), U.z = U.z + r, this.dollyTo(r, !1), this.setFocalOffset(-U.x, U.y, -U.z, !1), this.moveTo(e, t, i, !1);
|
5250
5361
|
}
|
5251
5362
|
/**
|
5252
5363
|
* Set the boundary box that encloses the target of the camera. box3 is in THREE.Box3
|
@@ -5285,9 +5396,9 @@ class ke extends Br {
|
|
5285
5396
|
* @category Methods
|
5286
5397
|
*/
|
5287
5398
|
getDistanceToFitBox(e, t, i, n = !1) {
|
5288
|
-
if (
|
5399
|
+
if (wi(this._camera, "getDistanceToFitBox"))
|
5289
5400
|
return this._spherical.radius;
|
5290
|
-
const r = e / t, a = this._camera.getEffectiveFOV() *
|
5401
|
+
const r = e / t, a = this._camera.getEffectiveFOV() * Ot, o = this._camera.aspect;
|
5291
5402
|
return ((n ? r > o : r < o) ? t : e / o) * 0.5 / Math.tan(a * 0.5) + i * 0.5;
|
5292
5403
|
}
|
5293
5404
|
/**
|
@@ -5297,9 +5408,9 @@ class ke extends Br {
|
|
5297
5408
|
* @category Methods
|
5298
5409
|
*/
|
5299
5410
|
getDistanceToFitSphere(e) {
|
5300
|
-
if (
|
5411
|
+
if (wi(this._camera, "getDistanceToFitSphere"))
|
5301
5412
|
return this._spherical.radius;
|
5302
|
-
const t = this._camera.getEffectiveFOV() *
|
5413
|
+
const t = this._camera.getEffectiveFOV() * Ot, i = Math.atan(Math.tan(t * 0.5) * this._camera.aspect) * 2, n = 1 < this._camera.aspect ? t : i;
|
5303
5414
|
return e / Math.sin(n * 0.5);
|
5304
5415
|
}
|
5305
5416
|
/**
|
@@ -5343,7 +5454,7 @@ class ke extends Br {
|
|
5343
5454
|
* @category Methods
|
5344
5455
|
*/
|
5345
5456
|
normalizeRotations() {
|
5346
|
-
this._sphericalEnd.theta = this._sphericalEnd.theta %
|
5457
|
+
this._sphericalEnd.theta = this._sphericalEnd.theta % ht, this._sphericalEnd.theta < 0 && (this._sphericalEnd.theta += ht), this._spherical.theta += ht * Math.round((this._sphericalEnd.theta - this._spherical.theta) / ht);
|
5347
5458
|
}
|
5348
5459
|
/**
|
5349
5460
|
* stop all transitions.
|
@@ -5382,7 +5493,7 @@ class ke extends Br {
|
|
5382
5493
|
* @category Methods
|
5383
5494
|
*/
|
5384
5495
|
updateCameraUp() {
|
5385
|
-
this._yAxisUpSpace.setFromUnitVectors(this._camera.up,
|
5496
|
+
this._yAxisUpSpace.setFromUnitVectors(this._camera.up, $t), this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert();
|
5386
5497
|
}
|
5387
5498
|
/**
|
5388
5499
|
* Apply current camera-up direction to the camera.
|
@@ -5403,68 +5514,68 @@ class ke extends Br {
|
|
5403
5514
|
* @category Methods
|
5404
5515
|
*/
|
5405
5516
|
update(e) {
|
5406
|
-
const t = this._sphericalEnd.theta - this._spherical.theta, i = this._sphericalEnd.phi - this._spherical.phi, n = this._sphericalEnd.radius - this._spherical.radius, r =
|
5407
|
-
if (
|
5517
|
+
const t = this._sphericalEnd.theta - this._spherical.theta, i = this._sphericalEnd.phi - this._spherical.phi, n = this._sphericalEnd.radius - this._spherical.radius, r = Rs.subVectors(this._targetEnd, this._target), a = Is.subVectors(this._focalOffsetEnd, this._focalOffset), o = this._zoomEnd - this._zoom;
|
5518
|
+
if (K(t))
|
5408
5519
|
this._thetaVelocity.value = 0, this._spherical.theta = this._sphericalEnd.theta;
|
5409
5520
|
else {
|
5410
5521
|
const p = this._isUserControllingRotate ? this.draggingSmoothTime : this.smoothTime;
|
5411
|
-
this._spherical.theta =
|
5522
|
+
this._spherical.theta = Gt(this._spherical.theta, this._sphericalEnd.theta, this._thetaVelocity, p, 1 / 0, e), this._needsUpdate = !0;
|
5412
5523
|
}
|
5413
|
-
if (
|
5524
|
+
if (K(i))
|
5414
5525
|
this._phiVelocity.value = 0, this._spherical.phi = this._sphericalEnd.phi;
|
5415
5526
|
else {
|
5416
5527
|
const p = this._isUserControllingRotate ? this.draggingSmoothTime : this.smoothTime;
|
5417
|
-
this._spherical.phi =
|
5528
|
+
this._spherical.phi = Gt(this._spherical.phi, this._sphericalEnd.phi, this._phiVelocity, p, 1 / 0, e), this._needsUpdate = !0;
|
5418
5529
|
}
|
5419
|
-
if (
|
5530
|
+
if (K(n))
|
5420
5531
|
this._radiusVelocity.value = 0, this._spherical.radius = this._sphericalEnd.radius;
|
5421
5532
|
else {
|
5422
5533
|
const p = this._isUserControllingDolly ? this.draggingSmoothTime : this.smoothTime;
|
5423
|
-
this._spherical.radius =
|
5534
|
+
this._spherical.radius = Gt(this._spherical.radius, this._sphericalEnd.radius, this._radiusVelocity, p, this.maxSpeed, e), this._needsUpdate = !0;
|
5424
5535
|
}
|
5425
|
-
if (
|
5536
|
+
if (K(r.x) && K(r.y) && K(r.z))
|
5426
5537
|
this._targetVelocity.set(0, 0, 0), this._target.copy(this._targetEnd);
|
5427
5538
|
else {
|
5428
5539
|
const p = this._isUserControllingTruck ? this.draggingSmoothTime : this.smoothTime;
|
5429
|
-
|
5540
|
+
As(this._target, this._targetEnd, this._targetVelocity, p, this.maxSpeed, e, this._target), this._needsUpdate = !0;
|
5430
5541
|
}
|
5431
|
-
if (
|
5542
|
+
if (K(a.x) && K(a.y) && K(a.z))
|
5432
5543
|
this._focalOffsetVelocity.set(0, 0, 0), this._focalOffset.copy(this._focalOffsetEnd);
|
5433
5544
|
else {
|
5434
5545
|
const p = this._isUserControllingOffset ? this.draggingSmoothTime : this.smoothTime;
|
5435
|
-
|
5546
|
+
As(this._focalOffset, this._focalOffsetEnd, this._focalOffsetVelocity, p, this.maxSpeed, e, this._focalOffset), this._needsUpdate = !0;
|
5436
5547
|
}
|
5437
|
-
if (
|
5548
|
+
if (K(o))
|
5438
5549
|
this._zoomVelocity.value = 0, this._zoom = this._zoomEnd;
|
5439
5550
|
else {
|
5440
5551
|
const p = this._isUserControllingZoom ? this.draggingSmoothTime : this.smoothTime;
|
5441
|
-
this._zoom =
|
5552
|
+
this._zoom = Gt(this._zoom, this._zoomEnd, this._zoomVelocity, p, 1 / 0, e);
|
5442
5553
|
}
|
5443
5554
|
if (this.dollyToCursor) {
|
5444
5555
|
if (Ze(this._camera) && this._changedDolly !== 0) {
|
5445
|
-
const p = this._spherical.radius - this._lastDistance, m = this._camera, f = this._getCameraDirection(
|
5446
|
-
|
5447
|
-
const y = z.crossVectors(
|
5556
|
+
const p = this._spherical.radius - this._lastDistance, m = this._camera, f = this._getCameraDirection(Pt), C = U.copy(f).cross(m.up).normalize();
|
5557
|
+
C.lengthSq() === 0 && (C.x = 1);
|
5558
|
+
const y = z.crossVectors(C, f), T = this._sphericalEnd.radius * Math.tan(m.getEffectiveFOV() * Ot * 0.5), v = (this._sphericalEnd.radius - p - this._sphericalEnd.radius) / this._sphericalEnd.radius, S = dt.copy(this._targetEnd).add(C.multiplyScalar(this._dollyControlCoord.x * T * m.aspect)).add(y.multiplyScalar(this._dollyControlCoord.y * T)), E = U.copy(this._targetEnd).lerp(S, v), w = this._lastDollyDirection === ct.IN && this._spherical.radius <= this.minDistance, O = this._lastDollyDirection === ct.OUT && this.maxDistance <= this._spherical.radius;
|
5448
5559
|
if (this.infinityDolly && (w || O)) {
|
5449
5560
|
this._sphericalEnd.radius -= p, this._spherical.radius -= p;
|
5450
5561
|
const j = z.copy(f).multiplyScalar(-p);
|
5451
|
-
|
5562
|
+
E.add(j);
|
5452
5563
|
}
|
5453
|
-
this._boundary.clampPoint(
|
5454
|
-
const L = z.subVectors(
|
5455
|
-
this._targetEnd.copy(
|
5564
|
+
this._boundary.clampPoint(E, E);
|
5565
|
+
const L = z.subVectors(E, this._targetEnd);
|
5566
|
+
this._targetEnd.copy(E), this._target.add(L), this._changedDolly -= p, K(this._changedDolly) && (this._changedDolly = 0);
|
5456
5567
|
} else if (Be(this._camera) && this._changedZoom !== 0) {
|
5457
|
-
const p = this._zoom - this._lastZoom, m = this._camera, f = U.set(this._dollyControlCoord.x, this._dollyControlCoord.y, (m.near + m.far) / (m.near - m.far)).unproject(m),
|
5458
|
-
|
5459
|
-
const L = z.subVectors(
|
5460
|
-
this._targetEnd.copy(
|
5568
|
+
const p = this._zoom - this._lastZoom, m = this._camera, f = U.set(this._dollyControlCoord.x, this._dollyControlCoord.y, (m.near + m.far) / (m.near - m.far)).unproject(m), C = z.set(0, 0, -1).applyQuaternion(m.quaternion), y = dt.copy(f).add(C.multiplyScalar(-f.dot(m.up))), g = -(this._zoom - p - this._zoom) / this._zoom, v = this._getCameraDirection(Pt), S = this._targetEnd.dot(v), E = U.copy(this._targetEnd).lerp(y, g), w = E.dot(v), O = v.multiplyScalar(w - S);
|
5569
|
+
E.sub(O), this._boundary.clampPoint(E, E);
|
5570
|
+
const L = z.subVectors(E, this._targetEnd);
|
5571
|
+
this._targetEnd.copy(E), this._target.add(L), this._changedZoom -= p, K(this._changedZoom) && (this._changedZoom = 0);
|
5461
5572
|
}
|
5462
5573
|
}
|
5463
5574
|
this._camera.zoom !== this._zoom && (this._camera.zoom = this._zoom, this._camera.updateProjectionMatrix(), this._updateNearPlaneCorners(), this._needsUpdate = !0), this._dragNeedsUpdate = !0;
|
5464
5575
|
const c = this._collisionTest();
|
5465
|
-
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), (!
|
5576
|
+
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), (!K(this._focalOffset.x) || !K(this._focalOffset.y) || !K(this._focalOffset.z)) && (this._camera.updateMatrixWorld(), Ae.setFromMatrixColumn(this._camera.matrix, 0), De.setFromMatrixColumn(this._camera.matrix, 1), We.setFromMatrixColumn(this._camera.matrix, 2), Ae.multiplyScalar(this._focalOffset.x), De.multiplyScalar(-this._focalOffset.y), We.multiplyScalar(this._focalOffset.z), U.copy(Ae).add(De).add(We), this._camera.position.add(U)), this._boundaryEnclosesCamera && this._encloseToBoundary(this._camera.position.copy(this._target), U.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse), 1);
|
5466
5577
|
const d = this._needsUpdate;
|
5467
|
-
return d && !this._updatedLastTime ? (this._hasRested = !1, this.dispatchEvent({ type: "wake" }), this.dispatchEvent({ type: "update" })) : d ? (this.dispatchEvent({ type: "update" }),
|
5578
|
+
return d && !this._updatedLastTime ? (this._hasRested = !1, this.dispatchEvent({ type: "wake" }), this.dispatchEvent({ type: "update" })) : d ? (this.dispatchEvent({ type: "update" }), K(t, this.restThreshold) && K(i, this.restThreshold) && K(n, this.restThreshold) && K(r.x, this.restThreshold) && K(r.y, this.restThreshold) && K(r.z, this.restThreshold) && K(a.x, this.restThreshold) && K(a.y, this.restThreshold) && K(a.z, this.restThreshold) && K(o, this.restThreshold) && !this._hasRested && (this._hasRested = !0, this.dispatchEvent({ type: "rest" }))) : !d && this._updatedLastTime && this.dispatchEvent({ type: "sleep" }), this._lastDistance = this._spherical.radius, this._lastZoom = this._zoom, this._updatedLastTime = d, this._needsUpdate = !1, d;
|
5468
5579
|
}
|
5469
5580
|
/**
|
5470
5581
|
* Get all state in JSON string
|
@@ -5474,13 +5585,13 @@ class ke extends Br {
|
|
5474
5585
|
return JSON.stringify({
|
5475
5586
|
enabled: this._enabled,
|
5476
5587
|
minDistance: this.minDistance,
|
5477
|
-
maxDistance:
|
5588
|
+
maxDistance: Tt(this.maxDistance),
|
5478
5589
|
minZoom: this.minZoom,
|
5479
|
-
maxZoom:
|
5590
|
+
maxZoom: Tt(this.maxZoom),
|
5480
5591
|
minPolarAngle: this.minPolarAngle,
|
5481
|
-
maxPolarAngle:
|
5482
|
-
minAzimuthAngle:
|
5483
|
-
maxAzimuthAngle:
|
5592
|
+
maxPolarAngle: Tt(this.maxPolarAngle),
|
5593
|
+
minAzimuthAngle: Tt(this.minAzimuthAngle),
|
5594
|
+
maxAzimuthAngle: Tt(this.maxAzimuthAngle),
|
5484
5595
|
smoothTime: this.smoothTime,
|
5485
5596
|
draggingSmoothTime: this.draggingSmoothTime,
|
5486
5597
|
dollySpeed: this.dollySpeed,
|
@@ -5505,7 +5616,7 @@ class ke extends Br {
|
|
5505
5616
|
*/
|
5506
5617
|
fromJSON(e, t = !1) {
|
5507
5618
|
const i = JSON.parse(e);
|
5508
|
-
this.enabled = i.enabled, this.minDistance = i.minDistance, this.maxDistance =
|
5619
|
+
this.enabled = i.enabled, this.minDistance = i.minDistance, this.maxDistance = Mt(i.maxDistance), this.minZoom = i.minZoom, this.maxZoom = Mt(i.maxZoom), this.minPolarAngle = i.minPolarAngle, this.maxPolarAngle = Mt(i.maxPolarAngle), this.minAzimuthAngle = Mt(i.minAzimuthAngle), this.maxAzimuthAngle = Mt(i.maxAzimuthAngle), this.smoothTime = i.smoothTime, this.draggingSmoothTime = i.draggingSmoothTime, this.dollySpeed = i.dollySpeed, this.truckSpeed = i.truckSpeed, this.dollyToCursor = i.dollyToCursor, this.verticalDragToForward = i.verticalDragToForward, this._target0.fromArray(i.target0), this._position0.fromArray(i.position0), this._zoom0 = i.zoom0, this._focalOffset0.fromArray(i.focalOffset0), this.moveTo(i.target[0], i.target[1], i.target[2], t), xe.setFromVector3(U.fromArray(i.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)), this.rotateTo(xe.theta, xe.phi, t), this.dollyTo(xe.radius, t), this.zoomTo(i.zoom, t), this.setFocalOffset(i.focalOffset[0], i.focalOffset[1], i.focalOffset[2], t), this._needsUpdate = !0;
|
5509
5620
|
}
|
5510
5621
|
/**
|
5511
5622
|
* Attach all internal event handlers to enable drag control.
|
@@ -5516,7 +5627,7 @@ class ke extends Br {
|
|
5516
5627
|
console.warn("camera-controls is already connected.");
|
5517
5628
|
return;
|
5518
5629
|
}
|
5519
|
-
e.setAttribute("data-camera-controls-version",
|
5630
|
+
e.setAttribute("data-camera-controls-version", to), this._addAllEventListeners(e), this._getClientRect(this._elementRect);
|
5520
5631
|
}
|
5521
5632
|
/**
|
5522
5633
|
* Detach all internal event handlers to disable drag control.
|
@@ -5552,7 +5663,7 @@ class ke extends Br {
|
|
5552
5663
|
const n = t.lengthSq();
|
5553
5664
|
if (n === 0)
|
5554
5665
|
return e;
|
5555
|
-
const r = z.copy(t).add(e), o = this._boundary.clampPoint(r,
|
5666
|
+
const r = z.copy(t).add(e), o = this._boundary.clampPoint(r, dt).sub(r), c = o.lengthSq();
|
5556
5667
|
if (c === 0)
|
5557
5668
|
return e.add(t);
|
5558
5669
|
if (c === n)
|
@@ -5566,7 +5677,7 @@ class ke extends Br {
|
|
5566
5677
|
}
|
5567
5678
|
_updateNearPlaneCorners() {
|
5568
5679
|
if (Ze(this._camera)) {
|
5569
|
-
const e = this._camera, t = e.near, i = e.getEffectiveFOV() *
|
5680
|
+
const e = this._camera, t = e.near, i = e.getEffectiveFOV() * Ot, n = Math.tan(i * 0.5) * t, r = n * e.aspect;
|
5570
5681
|
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);
|
5571
5682
|
} else if (Be(this._camera)) {
|
5572
5683
|
const e = this._camera, t = 1 / e.zoom, i = e.left * t, n = e.right * t, r = e.top * t, a = e.bottom * t;
|
@@ -5576,16 +5687,16 @@ class ke extends Br {
|
|
5576
5687
|
// lateUpdate
|
5577
5688
|
_collisionTest() {
|
5578
5689
|
let e = 1 / 0;
|
5579
|
-
if (!(this.colliderMeshes.length >= 1) ||
|
5690
|
+
if (!(this.colliderMeshes.length >= 1) || wi(this._camera, "_collisionTest"))
|
5580
5691
|
return e;
|
5581
|
-
const i = this._getTargetDirection(
|
5582
|
-
|
5692
|
+
const i = this._getTargetDirection(Pt);
|
5693
|
+
Pi.lookAt(Ds, i, this._camera.up);
|
5583
5694
|
for (let n = 0; n < 4; n++) {
|
5584
5695
|
const r = z.copy(this._nearPlaneCorners[n]);
|
5585
|
-
r.applyMatrix4(
|
5586
|
-
const a =
|
5587
|
-
|
5588
|
-
const o =
|
5696
|
+
r.applyMatrix4(Pi);
|
5697
|
+
const a = dt.addVectors(this._target, r);
|
5698
|
+
Kt.set(a, i), Kt.far = this._spherical.radius + 1;
|
5699
|
+
const o = Kt.intersectObjects(this.colliderMeshes);
|
5589
5700
|
o.length !== 0 && o[0].distance < e && (e = o[0].distance);
|
5590
5701
|
}
|
5591
5702
|
return e;
|
@@ -5646,9 +5757,9 @@ class ke extends Br {
|
|
5646
5757
|
}
|
5647
5758
|
static createBoundingSphere(e, t = new I.Sphere()) {
|
5648
5759
|
const i = t, n = i.center;
|
5649
|
-
|
5650
|
-
a.isMesh &&
|
5651
|
-
}),
|
5760
|
+
ut.makeEmpty(), e.traverseVisible((a) => {
|
5761
|
+
a.isMesh && ut.expandByObject(a);
|
5762
|
+
}), ut.getCenter(n);
|
5652
5763
|
let r = 0;
|
5653
5764
|
return e.traverseVisible((a) => {
|
5654
5765
|
if (!a.isMesh)
|
@@ -5661,7 +5772,7 @@ class ke extends Br {
|
|
5661
5772
|
}), i.radius = Math.sqrt(r), i;
|
5662
5773
|
}
|
5663
5774
|
}
|
5664
|
-
const
|
5775
|
+
const li = (s) => {
|
5665
5776
|
const [e, t] = Z(s.options[s.index]), i = () => {
|
5666
5777
|
s.onToggle(!s.open);
|
5667
5778
|
}, n = (r) => {
|
@@ -5671,7 +5782,7 @@ const oi = (s) => {
|
|
5671
5782
|
/* @__PURE__ */ u.jsx("div", { className: "dropdown-toggle", onClick: i, children: `${s.title}: ${e}` }),
|
5672
5783
|
s.open && /* @__PURE__ */ u.jsx("ul", { className: "dropdown-menu", children: s.options.map((r) => /* @__PURE__ */ u.jsx("li", { onClick: () => n(r), children: r }, r)) })
|
5673
5784
|
] });
|
5674
|
-
}, Ge =
|
5785
|
+
}, Ge = ja(function(e, t) {
|
5675
5786
|
const i = [
|
5676
5787
|
"Renderer",
|
5677
5788
|
"Depth",
|
@@ -5685,7 +5796,7 @@ const oi = (s) => {
|
|
5685
5796
|
} }),
|
5686
5797
|
/* @__PURE__ */ u.jsxs("div", { className: "options", children: [
|
5687
5798
|
e.camera !== null && /* @__PURE__ */ u.jsx(
|
5688
|
-
|
5799
|
+
li,
|
5689
5800
|
{
|
5690
5801
|
title: "Camera",
|
5691
5802
|
index: e.options.indexOf(e.camera.name),
|
@@ -5699,7 +5810,7 @@ const oi = (s) => {
|
|
5699
5810
|
}
|
5700
5811
|
),
|
5701
5812
|
/* @__PURE__ */ u.jsx(
|
5702
|
-
|
5813
|
+
li,
|
5703
5814
|
{
|
5704
5815
|
title: "Mode",
|
5705
5816
|
index: i.indexOf(n),
|
@@ -5720,15 +5831,15 @@ const oi = (s) => {
|
|
5720
5831
|
] })
|
5721
5832
|
] });
|
5722
5833
|
});
|
5723
|
-
class
|
5834
|
+
class so extends dn {
|
5724
5835
|
constructor(e) {
|
5725
5836
|
super({
|
5726
5837
|
extensions: {
|
5727
5838
|
// @ts-ignore
|
5728
5839
|
derivatives: !0
|
5729
5840
|
},
|
5730
|
-
glslVersion:
|
5731
|
-
side:
|
5841
|
+
glslVersion: pa,
|
5842
|
+
side: Bi,
|
5732
5843
|
transparent: !0,
|
5733
5844
|
uniforms: {
|
5734
5845
|
uScale: {
|
@@ -5833,17 +5944,17 @@ class Wr extends ln {
|
|
5833
5944
|
});
|
5834
5945
|
}
|
5835
5946
|
}
|
5836
|
-
class
|
5947
|
+
class no extends M {
|
5837
5948
|
gridMaterial;
|
5838
5949
|
constructor() {
|
5839
|
-
const e = new
|
5840
|
-
super(new
|
5950
|
+
const e = new so();
|
5951
|
+
super(new un(2, 2), e), this.gridMaterial = e, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
|
5841
5952
|
}
|
5842
5953
|
update() {
|
5843
5954
|
this.gridMaterial.needsUpdate = !0;
|
5844
5955
|
}
|
5845
5956
|
}
|
5846
|
-
function
|
5957
|
+
function Us(s) {
|
5847
5958
|
const [e, t] = Z(s.selected), i = "toggle" + (e ? " selected" : "");
|
5848
5959
|
return /* @__PURE__ */ u.jsx(
|
5849
5960
|
"button",
|
@@ -5862,7 +5973,7 @@ function Is(s) {
|
|
5862
5973
|
s.name
|
5863
5974
|
);
|
5864
5975
|
}
|
5865
|
-
const
|
5976
|
+
const ao = `#include <common>
|
5866
5977
|
#include <batching_pars_vertex>
|
5867
5978
|
#include <uv_pars_vertex>
|
5868
5979
|
#include <color_pars_vertex>
|
@@ -5892,7 +6003,7 @@ void main() {
|
|
5892
6003
|
#include <logdepthbuf_vertex>
|
5893
6004
|
#include <clipping_planes_vertex>
|
5894
6005
|
#include <worldpos_vertex>
|
5895
|
-
}`,
|
6006
|
+
}`, ro = `
|
5896
6007
|
#include <common>
|
5897
6008
|
#include <uv_pars_fragment>
|
5898
6009
|
#include <clipping_planes_pars_fragment>
|
@@ -5901,46 +6012,46 @@ void main() {
|
|
5901
6012
|
#include <clipping_planes_fragment>
|
5902
6013
|
gl_FragColor = vec4(vec3(vUv, 0.0), 1.0);
|
5903
6014
|
}`;
|
5904
|
-
class
|
6015
|
+
class oo extends dn {
|
5905
6016
|
constructor() {
|
5906
6017
|
super({
|
5907
6018
|
defines: {
|
5908
6019
|
USE_UV: ""
|
5909
6020
|
},
|
5910
|
-
vertexShader:
|
5911
|
-
fragmentShader:
|
6021
|
+
vertexShader: ao,
|
6022
|
+
fragmentShader: ro
|
5912
6023
|
});
|
5913
6024
|
}
|
5914
6025
|
}
|
5915
|
-
const Xe = new
|
5916
|
-
X: new
|
5917
|
-
Y: new
|
5918
|
-
Z: new
|
5919
|
-
},
|
5920
|
-
class
|
6026
|
+
const Xe = new ni(), ue = new P(), Ye = new P(), Q = new Ce(), js = {
|
6027
|
+
X: new P(1, 0, 0),
|
6028
|
+
Y: new P(0, 1, 0),
|
6029
|
+
Z: new P(0, 0, 1)
|
6030
|
+
}, Ai = { type: "change" }, Ns = { type: "mouseDown", mode: null }, Fs = { type: "mouseUp", mode: null }, zs = { type: "objectChange" };
|
6031
|
+
class lo extends hn {
|
5921
6032
|
constructor(e, t = null) {
|
5922
6033
|
super(void 0, t);
|
5923
|
-
const i = new
|
6034
|
+
const i = new fo(this);
|
5924
6035
|
this._root = i;
|
5925
|
-
const n = new
|
6036
|
+
const n = new go();
|
5926
6037
|
this._gizmo = n, i.add(n);
|
5927
|
-
const r = new
|
6038
|
+
const r = new _o();
|
5928
6039
|
this._plane = r, i.add(r);
|
5929
6040
|
const a = this;
|
5930
|
-
function o(S,
|
5931
|
-
let w =
|
6041
|
+
function o(S, E) {
|
6042
|
+
let w = E;
|
5932
6043
|
Object.defineProperty(a, S, {
|
5933
6044
|
get: function() {
|
5934
|
-
return w !== void 0 ? w :
|
6045
|
+
return w !== void 0 ? w : E;
|
5935
6046
|
},
|
5936
6047
|
set: function(O) {
|
5937
|
-
w !== O && (w = O, r[S] = O, n[S] = O, a.dispatchEvent({ type: S + "-changed", value: O }), a.dispatchEvent(
|
6048
|
+
w !== O && (w = O, r[S] = O, n[S] = O, a.dispatchEvent({ type: S + "-changed", value: O }), a.dispatchEvent(Ai));
|
5938
6049
|
}
|
5939
|
-
}), a[S] =
|
6050
|
+
}), a[S] = E, r[S] = E, n[S] = E;
|
5940
6051
|
}
|
5941
6052
|
o("camera", e), o("object", void 0), o("enabled", !0), o("axis", null), o("mode", "translate"), o("translationSnap", null), o("rotationSnap", null), o("scaleSnap", null), o("space", "world"), o("size", 1), o("dragging", !1), o("showX", !0), o("showY", !0), o("showZ", !0);
|
5942
|
-
const c = new
|
5943
|
-
o("worldPosition", c), o("worldPositionStart", l), o("worldQuaternion", d), o("worldQuaternionStart", p), o("cameraPosition", m), o("cameraQuaternion", f), o("pointStart",
|
6053
|
+
const c = new P(), l = new P(), d = new Ce(), p = new Ce(), m = new P(), f = new Ce(), C = new P(), y = new P(), T = new P(), g = 0, v = new P();
|
6054
|
+
o("worldPosition", c), o("worldPositionStart", l), o("worldQuaternion", d), o("worldQuaternionStart", p), o("cameraPosition", m), o("cameraQuaternion", f), o("pointStart", C), o("pointEnd", y), o("rotationAxis", T), o("rotationAngle", g), o("eye", v), this._offset = new P(), this._startNorm = new P(), this._endNorm = new P(), this._cameraScale = new P(), this._parentPosition = new P(), this._parentQuaternion = new Ce(), this._parentQuaternionInv = new Ce(), this._parentScale = new P(), this._worldScaleStart = new P(), this._worldQuaternionInv = new Ce(), this._worldScale = new P(), this._positionStart = new P(), this._quaternionStart = new Ce(), this._scaleStart = new P(), this._getPointer = co.bind(this), this._onPointerDown = uo.bind(this), this._onPointerHover = ho.bind(this), this._onPointerMove = po.bind(this), this._onPointerUp = mo.bind(this), t !== null && this.connect();
|
5944
6055
|
}
|
5945
6056
|
connect() {
|
5946
6057
|
this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp), this.domElement.style.touchAction = "none";
|
@@ -5955,14 +6066,14 @@ class Kr extends on {
|
|
5955
6066
|
if (this.object === void 0 || this.dragging === !0)
|
5956
6067
|
return;
|
5957
6068
|
e !== null && Xe.setFromCamera(e, this.camera);
|
5958
|
-
const t =
|
6069
|
+
const t = Di(this._gizmo.picker[this.mode], Xe);
|
5959
6070
|
t ? this.axis = t.object.name : this.axis = null;
|
5960
6071
|
}
|
5961
6072
|
pointerDown(e) {
|
5962
6073
|
if (!(this.object === void 0 || this.dragging === !0 || e != null && e.button !== 0) && this.axis !== null) {
|
5963
6074
|
e !== null && Xe.setFromCamera(e, this.camera);
|
5964
|
-
const t =
|
5965
|
-
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,
|
6075
|
+
const t = Di(this._plane, Xe, !0);
|
6076
|
+
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, Ns.mode = this.mode, this.dispatchEvent(Ns);
|
5966
6077
|
}
|
5967
6078
|
}
|
5968
6079
|
pointerMove(e) {
|
@@ -5971,7 +6082,7 @@ class Kr extends on {
|
|
5971
6082
|
if (i === "scale" ? r = "local" : (t === "E" || t === "XYZE" || t === "XYZ") && (r = "world"), n === void 0 || t === null || this.dragging === !1 || e !== null && e.button !== -1)
|
5972
6083
|
return;
|
5973
6084
|
e !== null && Xe.setFromCamera(e, this.camera);
|
5974
|
-
const a =
|
6085
|
+
const a = Di(this._plane, Xe, !0);
|
5975
6086
|
if (a) {
|
5976
6087
|
if (this.pointEnd.copy(a.point).sub(this.worldPositionStart), i === "translate")
|
5977
6088
|
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(Q.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(ue.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(ue.setFromMatrixPosition(n.parent.matrixWorld))));
|
@@ -5986,13 +6097,13 @@ class Kr extends on {
|
|
5986
6097
|
this._offset.copy(this.pointEnd).sub(this.pointStart);
|
5987
6098
|
const o = 20 / this.worldPosition.distanceTo(ue.setFromMatrixPosition(this.camera.matrixWorld));
|
5988
6099
|
let c = !1;
|
5989
|
-
t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(ue.copy(this.rotationAxis).cross(this.eye)) * o) : (t === "X" || t === "Y" || t === "Z") && (this.rotationAxis.copy(
|
6100
|
+
t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(ue.copy(this.rotationAxis).cross(this.eye)) * o) : (t === "X" || t === "Y" || t === "Z") && (this.rotationAxis.copy(js[t]), ue.copy(js[t]), r === "local" && ue.applyQuaternion(this.worldQuaternion), ue.cross(this.eye), ue.length() === 0 ? c = !0 : this.rotationAngle = this._offset.dot(ue.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(Q.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), n.quaternion.copy(Q.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), n.quaternion.multiply(this._quaternionStart).normalize());
|
5990
6101
|
}
|
5991
|
-
this.dispatchEvent(
|
6102
|
+
this.dispatchEvent(Ai), this.dispatchEvent(zs);
|
5992
6103
|
}
|
5993
6104
|
}
|
5994
6105
|
pointerUp(e) {
|
5995
|
-
e !== null && e.button !== 0 || (this.dragging && this.axis !== null && (
|
6106
|
+
e !== null && e.button !== 0 || (this.dragging && this.axis !== null && (Fs.mode = this.mode, this.dispatchEvent(Fs)), this.dragging = !1, this.axis = null);
|
5996
6107
|
}
|
5997
6108
|
dispose() {
|
5998
6109
|
this.disconnect(), this.traverse(function(e) {
|
@@ -6008,7 +6119,7 @@ class Kr extends on {
|
|
6008
6119
|
return this.object = void 0, this.axis = null, this._root.visible = !1, this;
|
6009
6120
|
}
|
6010
6121
|
reset() {
|
6011
|
-
this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(
|
6122
|
+
this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(Ai), this.dispatchEvent(zs), this.pointStart.copy(this.pointEnd));
|
6012
6123
|
}
|
6013
6124
|
getRaycaster() {
|
6014
6125
|
return Xe;
|
@@ -6036,7 +6147,7 @@ class Kr extends on {
|
|
6036
6147
|
this.space = e;
|
6037
6148
|
}
|
6038
6149
|
}
|
6039
|
-
function
|
6150
|
+
function co(s) {
|
6040
6151
|
if (this.domElement.ownerDocument.pointerLockElement)
|
6041
6152
|
return {
|
6042
6153
|
x: 0,
|
@@ -6052,7 +6163,7 @@ function Qr(s) {
|
|
6052
6163
|
};
|
6053
6164
|
}
|
6054
6165
|
}
|
6055
|
-
function
|
6166
|
+
function ho(s) {
|
6056
6167
|
if (this.enabled)
|
6057
6168
|
switch (s.pointerType) {
|
6058
6169
|
case "mouse":
|
@@ -6061,24 +6172,24 @@ function Jr(s) {
|
|
6061
6172
|
break;
|
6062
6173
|
}
|
6063
6174
|
}
|
6064
|
-
function
|
6175
|
+
function uo(s) {
|
6065
6176
|
this.enabled && (document.pointerLockElement || this.domElement.setPointerCapture(s.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.pointerHover(this._getPointer(s)), this.pointerDown(this._getPointer(s)));
|
6066
6177
|
}
|
6067
|
-
function
|
6178
|
+
function po(s) {
|
6068
6179
|
this.enabled && this.pointerMove(this._getPointer(s));
|
6069
6180
|
}
|
6070
|
-
function
|
6181
|
+
function mo(s) {
|
6071
6182
|
this.enabled && (this.domElement.releasePointerCapture(s.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.pointerUp(this._getPointer(s)));
|
6072
6183
|
}
|
6073
|
-
function
|
6184
|
+
function Di(s, e, t) {
|
6074
6185
|
const i = e.intersectObject(s, !0);
|
6075
6186
|
for (let n = 0; n < i.length; n++)
|
6076
6187
|
if (i[n].object.visible || t)
|
6077
6188
|
return i[n];
|
6078
6189
|
return !1;
|
6079
6190
|
}
|
6080
|
-
const qt = new
|
6081
|
-
class
|
6191
|
+
const qt = new pn(), X = new P(0, 1, 0), Hs = new P(0, 0, 0), Ys = new ci(), Qt = new Ce(), si = new Ce(), Re = new P(), Bs = new ci(), kt = new P(1, 0, 0), Ke = new P(0, 1, 0), Ut = new P(0, 0, 1), Jt = new P(), Dt = new P(), Rt = new P();
|
6192
|
+
class fo extends vt {
|
6082
6193
|
constructor(e) {
|
6083
6194
|
super(), this.isTransformControlsRoot = !0, this.controls = e, this.visible = !1;
|
6084
6195
|
}
|
@@ -6088,7 +6199,7 @@ class so extends _t {
|
|
6088
6199
|
t.object !== void 0 && (t.object.updateMatrixWorld(), t.object.parent === null ? console.error("TransformControls: The attached 3D object must be a part of the scene graph.") : t.object.parent.matrixWorld.decompose(t._parentPosition, t._parentQuaternion, t._parentScale), t.object.matrixWorld.decompose(t.worldPosition, t.worldQuaternion, t._worldScale), t._parentQuaternionInv.copy(t._parentQuaternion).invert(), t._worldQuaternionInv.copy(t.worldQuaternion).invert()), t.camera.updateMatrixWorld(), t.camera.matrixWorld.decompose(t.cameraPosition, t.cameraQuaternion, t._cameraScale), t.camera.isOrthographicCamera ? t.camera.getWorldDirection(t.eye).negate() : t.eye.copy(t.cameraPosition).sub(t.worldPosition).normalize(), super.updateMatrixWorld(e);
|
6089
6200
|
}
|
6090
6201
|
}
|
6091
|
-
class
|
6202
|
+
class go extends vt {
|
6092
6203
|
constructor() {
|
6093
6204
|
super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
|
6094
6205
|
const e = new Je({
|
@@ -6097,7 +6208,7 @@ class no extends _t {
|
|
6097
6208
|
fog: !1,
|
6098
6209
|
toneMapped: !1,
|
6099
6210
|
transparent: !0
|
6100
|
-
}), t = new
|
6211
|
+
}), t = new Vi({
|
6101
6212
|
depthTest: !1,
|
6102
6213
|
depthWrite: !1,
|
6103
6214
|
fog: !1,
|
@@ -6123,23 +6234,23 @@ class no extends _t {
|
|
6123
6234
|
p.opacity = 0.25;
|
6124
6235
|
const m = e.clone();
|
6125
6236
|
m.color.setHex(16776960), m.opacity = 0.25, e.clone().color.setHex(16776960);
|
6126
|
-
const
|
6127
|
-
|
6237
|
+
const C = e.clone();
|
6238
|
+
C.color.setHex(7895160);
|
6128
6239
|
const y = new ve(0, 0.04, 0.1, 12);
|
6129
6240
|
y.translate(0, 0.05, 0);
|
6130
6241
|
const T = new de(0.08, 0.08, 0.08);
|
6131
6242
|
T.translate(0, 0.04, 0);
|
6132
|
-
const g = new
|
6133
|
-
g.setAttribute("position", new
|
6243
|
+
const g = new _t();
|
6244
|
+
g.setAttribute("position", new qe([0, 0, 0, 1, 0, 0], 3));
|
6134
6245
|
const v = new ve(75e-4, 75e-4, 0.5, 3);
|
6135
6246
|
v.translate(0, 0.25, 0);
|
6136
6247
|
function S($, Ue) {
|
6137
|
-
const he = new
|
6248
|
+
const he = new Et($, 75e-4, 3, 64, Ue * Math.PI * 2);
|
6138
6249
|
return he.rotateY(Math.PI / 2), he.rotateX(Math.PI / 2), he;
|
6139
6250
|
}
|
6140
|
-
function
|
6141
|
-
const $ = new
|
6142
|
-
return $.setAttribute("position", new
|
6251
|
+
function E() {
|
6252
|
+
const $ = new _t();
|
6253
|
+
return $.setAttribute("position", new qe([0, 0, 0, 1, 1, 1], 3)), $;
|
6143
6254
|
}
|
6144
6255
|
const w = {
|
6145
6256
|
X: [
|
@@ -6158,7 +6269,7 @@ class no extends _t {
|
|
6158
6269
|
[new M(v, o), null, [Math.PI / 2, 0, 0]]
|
6159
6270
|
],
|
6160
6271
|
XYZ: [
|
6161
|
-
[new M(new
|
6272
|
+
[new M(new Zt(0.1, 0), p.clone()), [0, 0, 0]]
|
6162
6273
|
],
|
6163
6274
|
XY: [
|
6164
6275
|
[new M(new de(0.15, 0.15, 0.01), d.clone()), [0.15, 0.15, 0]]
|
@@ -6183,7 +6294,7 @@ class no extends _t {
|
|
6183
6294
|
[new M(new ve(0.2, 0, 0.6, 4), i), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
|
6184
6295
|
],
|
6185
6296
|
XYZ: [
|
6186
|
-
[new M(new
|
6297
|
+
[new M(new Zt(0.2, 0), i)]
|
6187
6298
|
],
|
6188
6299
|
XY: [
|
6189
6300
|
[new M(new de(0.2, 0.2, 0.01), i), [0.15, 0.15, 0]]
|
@@ -6196,13 +6307,13 @@ class no extends _t {
|
|
6196
6307
|
]
|
6197
6308
|
}, L = {
|
6198
6309
|
START: [
|
6199
|
-
[new M(new
|
6310
|
+
[new M(new Zt(0.01, 2), n), null, null, null, "helper"]
|
6200
6311
|
],
|
6201
6312
|
END: [
|
6202
|
-
[new M(new
|
6313
|
+
[new M(new Zt(0.01, 2), n), null, null, null, "helper"]
|
6203
6314
|
],
|
6204
6315
|
DELTA: [
|
6205
|
-
[new Ie(
|
6316
|
+
[new Ie(E(), n), null, null, null, "helper"]
|
6206
6317
|
],
|
6207
6318
|
X: [
|
6208
6319
|
[new Ie(g, n.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
@@ -6215,7 +6326,7 @@ class no extends _t {
|
|
6215
6326
|
]
|
6216
6327
|
}, j = {
|
6217
6328
|
XYZE: [
|
6218
|
-
[new M(S(0.5, 1),
|
6329
|
+
[new M(S(0.5, 1), C), null, [0, Math.PI / 2, 0]]
|
6219
6330
|
],
|
6220
6331
|
X: [
|
6221
6332
|
[new M(S(0.5, 0.5), r)]
|
@@ -6235,19 +6346,19 @@ class no extends _t {
|
|
6235
6346
|
]
|
6236
6347
|
}, B = {
|
6237
6348
|
XYZE: [
|
6238
|
-
[new M(new
|
6349
|
+
[new M(new mn(0.25, 10, 8), i)]
|
6239
6350
|
],
|
6240
6351
|
X: [
|
6241
|
-
[new M(new
|
6352
|
+
[new M(new Et(0.5, 0.1, 4, 24), i), [0, 0, 0], [0, -Math.PI / 2, -Math.PI / 2]]
|
6242
6353
|
],
|
6243
6354
|
Y: [
|
6244
|
-
[new M(new
|
6355
|
+
[new M(new Et(0.5, 0.1, 4, 24), i), [0, 0, 0], [Math.PI / 2, 0, 0]]
|
6245
6356
|
],
|
6246
6357
|
Z: [
|
6247
|
-
[new M(new
|
6358
|
+
[new M(new Et(0.5, 0.1, 4, 24), i), [0, 0, 0], [0, 0, -Math.PI / 2]]
|
6248
6359
|
],
|
6249
6360
|
E: [
|
6250
|
-
[new M(new
|
6361
|
+
[new M(new Et(0.75, 0.1, 2, 24), i)]
|
6251
6362
|
]
|
6252
6363
|
}, Se = {
|
6253
6364
|
X: [
|
@@ -6313,22 +6424,22 @@ class no extends _t {
|
|
6313
6424
|
[new Ie(g, n.clone()), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
|
6314
6425
|
]
|
6315
6426
|
};
|
6316
|
-
function
|
6317
|
-
const Ue = new
|
6427
|
+
function q($) {
|
6428
|
+
const Ue = new vt();
|
6318
6429
|
for (const he in $)
|
6319
|
-
for (let
|
6320
|
-
const se = $[he][
|
6430
|
+
for (let Ee = $[he].length; Ee--; ) {
|
6431
|
+
const se = $[he][Ee][0].clone(), je = $[he][Ee][1], Ne = $[he][Ee][2], Fe = $[he][Ee][3], W = $[he][Ee][4];
|
6321
6432
|
se.name = he, se.tag = W, je && se.position.set(je[0], je[1], je[2]), Ne && se.rotation.set(Ne[0], Ne[1], Ne[2]), Fe && se.scale.set(Fe[0], Fe[1], Fe[2]), se.updateMatrix();
|
6322
6433
|
const le = se.geometry.clone();
|
6323
6434
|
le.applyMatrix4(se.matrix), se.geometry = le, se.renderOrder = 1 / 0, se.position.set(0, 0, 0), se.rotation.set(0, 0, 0), se.scale.set(1, 1, 1), Ue.add(se);
|
6324
6435
|
}
|
6325
6436
|
return Ue;
|
6326
6437
|
}
|
6327
|
-
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate =
|
6438
|
+
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = q(w)), this.add(this.gizmo.rotate = q(j)), this.add(this.gizmo.scale = q(Se)), this.add(this.picker.translate = q(O)), this.add(this.picker.rotate = q(B)), this.add(this.picker.scale = q(_e)), this.add(this.helper.translate = q(L)), this.add(this.helper.rotate = q(R)), this.add(this.helper.scale = q(re)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
|
6328
6439
|
}
|
6329
6440
|
// updateMatrixWorld will update transformations and appearance of individual handles
|
6330
6441
|
updateMatrixWorld(e) {
|
6331
|
-
const i = (this.mode === "scale" ? "local" : this.space) === "local" ? this.worldQuaternion :
|
6442
|
+
const i = (this.mode === "scale" ? "local" : this.space) === "local" ? this.worldQuaternion : si;
|
6332
6443
|
this.gizmo.translate.visible = this.mode === "translate", this.gizmo.rotate.visible = this.mode === "rotate", this.gizmo.scale.visible = this.mode === "scale", this.helper.translate.visible = this.mode === "translate", this.helper.rotate.visible = this.mode === "rotate", this.helper.scale.visible = this.mode === "scale";
|
6333
6444
|
let n = [];
|
6334
6445
|
n = n.concat(this.picker[this.mode].children), n = n.concat(this.gizmo[this.mode].children), n = n.concat(this.helper[this.mode].children);
|
@@ -6337,46 +6448,46 @@ class no extends _t {
|
|
6337
6448
|
a.visible = !0, a.rotation.set(0, 0, 0), a.position.copy(this.worldPosition);
|
6338
6449
|
let o;
|
6339
6450
|
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") {
|
6340
|
-
a.visible = !1, a.name === "AXIS" ? (a.visible = !!this.axis, this.axis === "X" && (Q.setFromEuler(qt.set(0, 0, 0)), a.quaternion.copy(i).multiply(Q), Math.abs(X.copy(
|
6451
|
+
a.visible = !1, a.name === "AXIS" ? (a.visible = !!this.axis, this.axis === "X" && (Q.setFromEuler(qt.set(0, 0, 0)), a.quaternion.copy(i).multiply(Q), Math.abs(X.copy(kt).applyQuaternion(i).dot(this.eye)) > 0.9 && (a.visible = !1)), this.axis === "Y" && (Q.setFromEuler(qt.set(0, 0, Math.PI / 2)), a.quaternion.copy(i).multiply(Q), Math.abs(X.copy(Ke).applyQuaternion(i).dot(this.eye)) > 0.9 && (a.visible = !1)), this.axis === "Z" && (Q.setFromEuler(qt.set(0, Math.PI / 2, 0)), a.quaternion.copy(i).multiply(Q), Math.abs(X.copy(Ut).applyQuaternion(i).dot(this.eye)) > 0.9 && (a.visible = !1)), this.axis === "XYZE" && (Q.setFromEuler(qt.set(0, Math.PI / 2, 0)), X.copy(this.rotationAxis), a.quaternion.setFromRotationMatrix(Ys.lookAt(Hs, X, Ke)), a.quaternion.multiply(Q), 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), ue.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), ue.applyQuaternion(this.worldQuaternionStart.clone().invert()), a.scale.copy(ue), a.visible = this.dragging) : (a.quaternion.copy(i), this.dragging ? a.position.copy(this.worldPositionStart) : a.position.copy(this.worldPosition), this.axis && (a.visible = this.axis.search(a.name) !== -1));
|
6341
6452
|
continue;
|
6342
6453
|
}
|
6343
|
-
a.quaternion.copy(i), this.mode === "translate" || this.mode === "scale" ? (a.name === "X" && Math.abs(X.copy(
|
6454
|
+
a.quaternion.copy(i), this.mode === "translate" || this.mode === "scale" ? (a.name === "X" && Math.abs(X.copy(kt).applyQuaternion(i).dot(this.eye)) > 0.99 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "Y" && Math.abs(X.copy(Ke).applyQuaternion(i).dot(this.eye)) > 0.99 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "Z" && Math.abs(X.copy(Ut).applyQuaternion(i).dot(this.eye)) > 0.99 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "XY" && Math.abs(X.copy(Ut).applyQuaternion(i).dot(this.eye)) < 0.2 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "YZ" && Math.abs(X.copy(kt).applyQuaternion(i).dot(this.eye)) < 0.2 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "XZ" && Math.abs(X.copy(Ke).applyQuaternion(i).dot(this.eye)) < 0.2 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1)) : this.mode === "rotate" && (Qt.copy(i), X.copy(this.eye).applyQuaternion(Q.copy(i).invert()), a.name.search("E") !== -1 && a.quaternion.setFromRotationMatrix(Ys.lookAt(this.eye, Hs, Ke)), a.name === "X" && (Q.setFromAxisAngle(kt, Math.atan2(-X.y, X.z)), Q.multiplyQuaternions(Qt, Q), a.quaternion.copy(Q)), a.name === "Y" && (Q.setFromAxisAngle(Ke, Math.atan2(X.x, X.z)), Q.multiplyQuaternions(Qt, Q), a.quaternion.copy(Q)), a.name === "Z" && (Q.setFromAxisAngle(Ut, Math.atan2(X.y, X.x)), Q.multiplyQuaternions(Qt, Q), a.quaternion.copy(Q))), 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) {
|
6344
6455
|
return a.name === c;
|
6345
6456
|
})) && (a.material.color.setHex(16776960), a.material.opacity = 1);
|
6346
6457
|
}
|
6347
6458
|
super.updateMatrixWorld(e);
|
6348
6459
|
}
|
6349
6460
|
}
|
6350
|
-
class
|
6461
|
+
class _o extends M {
|
6351
6462
|
constructor() {
|
6352
6463
|
super(
|
6353
|
-
new
|
6354
|
-
new Je({ visible: !1, wireframe: !0, side:
|
6464
|
+
new un(1e5, 1e5, 2, 2),
|
6465
|
+
new Je({ visible: !1, wireframe: !0, side: Bi, transparent: !0, opacity: 0.1, toneMapped: !1 })
|
6355
6466
|
), this.isTransformControlsPlane = !0, this.type = "TransformControlsPlane";
|
6356
6467
|
}
|
6357
6468
|
updateMatrixWorld(e) {
|
6358
6469
|
let t = this.space;
|
6359
|
-
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"),
|
6470
|
+
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), Jt.copy(kt).applyQuaternion(t === "local" ? this.worldQuaternion : si), Dt.copy(Ke).applyQuaternion(t === "local" ? this.worldQuaternion : si), Rt.copy(Ut).applyQuaternion(t === "local" ? this.worldQuaternion : si), X.copy(Dt), this.mode) {
|
6360
6471
|
case "translate":
|
6361
6472
|
case "scale":
|
6362
6473
|
switch (this.axis) {
|
6363
6474
|
case "X":
|
6364
|
-
X.copy(this.eye).cross(
|
6475
|
+
X.copy(this.eye).cross(Jt), Re.copy(Jt).cross(X);
|
6365
6476
|
break;
|
6366
6477
|
case "Y":
|
6367
|
-
X.copy(this.eye).cross(
|
6478
|
+
X.copy(this.eye).cross(Dt), Re.copy(Dt).cross(X);
|
6368
6479
|
break;
|
6369
6480
|
case "Z":
|
6370
|
-
X.copy(this.eye).cross(
|
6481
|
+
X.copy(this.eye).cross(Rt), Re.copy(Rt).cross(X);
|
6371
6482
|
break;
|
6372
6483
|
case "XY":
|
6373
|
-
Re.copy(
|
6484
|
+
Re.copy(Rt);
|
6374
6485
|
break;
|
6375
6486
|
case "YZ":
|
6376
|
-
Re.copy(
|
6487
|
+
Re.copy(Jt);
|
6377
6488
|
break;
|
6378
6489
|
case "XZ":
|
6379
|
-
X.copy(
|
6490
|
+
X.copy(Rt), Re.copy(Dt);
|
6380
6491
|
break;
|
6381
6492
|
case "XYZ":
|
6382
6493
|
case "E":
|
@@ -6388,10 +6499,10 @@ class ao extends M {
|
|
6388
6499
|
default:
|
6389
6500
|
Re.set(0, 0, 0);
|
6390
6501
|
}
|
6391
|
-
Re.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (
|
6502
|
+
Re.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (Bs.lookAt(ue.set(0, 0, 0), Re, X), this.quaternion.setFromRotationMatrix(Bs)), super.updateMatrixWorld(e);
|
6392
6503
|
}
|
6393
6504
|
}
|
6394
|
-
class ge extends
|
6505
|
+
class ge extends Yi {
|
6395
6506
|
static DRAG_START = "Transform::dragStart";
|
6396
6507
|
static DRAG_END = "Transform::dragEnd";
|
6397
6508
|
static _instance;
|
@@ -6400,7 +6511,7 @@ class ge extends zi {
|
|
6400
6511
|
controls = /* @__PURE__ */ new Map();
|
6401
6512
|
visibility = /* @__PURE__ */ new Map();
|
6402
6513
|
constructor() {
|
6403
|
-
super(), D.addEventListener(
|
6514
|
+
super(), D.addEventListener(A.SET_SCENE, this.setScene);
|
6404
6515
|
}
|
6405
6516
|
clear() {
|
6406
6517
|
for (const e of this.controls.values()) {
|
@@ -6414,7 +6525,7 @@ class ge extends zi {
|
|
6414
6525
|
let t = this.controls.get(e);
|
6415
6526
|
if (t === void 0) {
|
6416
6527
|
const i = document.querySelector(".clickable");
|
6417
|
-
t = new
|
6528
|
+
t = new lo(this.activeCamera, i), t.getHelper().name = e, t.setSpace("local"), this.controls.set(e, t), this.visibility.set(e, !0), t.addEventListener("mouseDown", () => {
|
6418
6529
|
this.dispatchEvent({ type: ge.DRAG_START });
|
6419
6530
|
}), t.addEventListener("mouseUp", () => {
|
6420
6531
|
this.dispatchEvent({ type: ge.DRAG_END });
|
@@ -6460,9 +6571,9 @@ class ge extends zi {
|
|
6460
6571
|
return ge._instance || (ge._instance = new ge()), ge._instance;
|
6461
6572
|
}
|
6462
6573
|
}
|
6463
|
-
const
|
6464
|
-
class
|
6465
|
-
curve = new
|
6574
|
+
const vo = new de(), Ri = new pe();
|
6575
|
+
class Vs extends vt {
|
6576
|
+
curve = new cs();
|
6466
6577
|
line;
|
6467
6578
|
draggable;
|
6468
6579
|
curvePos;
|
@@ -6482,8 +6593,8 @@ class Hs extends _t {
|
|
6482
6593
|
parentGroup;
|
6483
6594
|
group;
|
6484
6595
|
constructor(e, t) {
|
6485
|
-
const i = new et(
|
6486
|
-
super(), this.name = e, this.lineMaterial = new
|
6596
|
+
const i = new et(lt(0.5, 1, Math.random()), lt(0.5, 1, Math.random()), lt(0.5, 1, Math.random()));
|
6597
|
+
super(), this.name = e, this.lineMaterial = new Vi({ color: i }), this.line = new Ie(new _t(), this.lineMaterial), this.line.name = "line", this.add(this.line), this._camera = t, this.curveType = "catmullrom", this.draggedMat.color = i, this.draggable = new vt(), this.draggable.name = "draggablePoints", this.add(this.draggable), this.curvePos = new M(new mn(1.5), new Je({ color: i })), this.curvePos.name = "curvePos", this.curvePos.scale.setScalar(this._draggableScale), this.curvePos.visible = !1, this.add(this.curvePos), this.raycaster = new ni(), this.raycaster.params.Line.threshold = 3, this.enable();
|
6487
6598
|
}
|
6488
6599
|
enable() {
|
6489
6600
|
document.addEventListener("pointerdown", this.onMouseClick);
|
@@ -6500,8 +6611,8 @@ class Hs extends _t {
|
|
6500
6611
|
exportSpline = () => {
|
6501
6612
|
const e = [];
|
6502
6613
|
this.draggable.children.forEach((t) => {
|
6503
|
-
e.push([
|
6504
|
-
}),
|
6614
|
+
e.push([Pe(t.position.x, 3), Pe(t.position.y, 3), Pe(t.position.z, 3)]);
|
6615
|
+
}), Na({
|
6505
6616
|
name: this.name,
|
6506
6617
|
points: e,
|
6507
6618
|
tension: this.tension,
|
@@ -6521,17 +6632,17 @@ class Hs extends _t {
|
|
6521
6632
|
this.addPoint(e[i], !1);
|
6522
6633
|
this.addPoint(e[t]);
|
6523
6634
|
} else
|
6524
|
-
this.addPoint(new
|
6635
|
+
this.addPoint(new P(-50, 0, 0), !1), this.addPoint(new P(50, 0, 0));
|
6525
6636
|
};
|
6526
6637
|
addPoint = (e, t = !0) => {
|
6527
|
-
const i = this.draggable.children.length, n = new M(
|
6638
|
+
const i = this.draggable.children.length, n = new M(vo, this.draggedMat);
|
6528
6639
|
return n.name = `point_${i}`, n.position.copy(e), n.scale.setScalar(this._draggableScale), this.draggable.add(n), t && this.updateSpline(), n;
|
6529
6640
|
};
|
6530
6641
|
addNextPt = () => {
|
6531
|
-
const e = this.draggable.children.length, t = new
|
6532
|
-
|
6533
|
-
|
6534
|
-
|
6642
|
+
const e = this.draggable.children.length, t = new P(
|
6643
|
+
lt(-this.offset, this.offset, Math.random()),
|
6644
|
+
lt(-this.offset, this.offset, Math.random()),
|
6645
|
+
lt(-this.offset, this.offset, Math.random())
|
6535
6646
|
);
|
6536
6647
|
e > 0 && t.add(this.draggable.children[e - 1].position);
|
6537
6648
|
const i = this.addPoint(t);
|
@@ -6553,14 +6664,14 @@ class Hs extends _t {
|
|
6553
6664
|
this._transform?.object !== void 0 && this.removePoint(this._transform?.object);
|
6554
6665
|
};
|
6555
6666
|
updateSpline = () => {
|
6556
|
-
this.curve = new
|
6667
|
+
this.curve = new cs(this.points, this.closed, this.curveType, this.tension), this.line.geometry.setFromPoints(this.getPoints()), this.curvePos.position.copy(this.getPointAt(this._curvePercentage));
|
6557
6668
|
};
|
6558
6669
|
// Handlers
|
6559
6670
|
onMouseClick = (e) => {
|
6560
6671
|
if (!me.instance || this._transform && !this._transform.getHelper().visible)
|
6561
6672
|
return;
|
6562
6673
|
const i = me.instance.currentWindow.current.getBoundingClientRect();
|
6563
|
-
|
6674
|
+
Ri.x = (e.clientX - i.x) / i.width * 2 - 1, Ri.y = -((e.clientY - i.y) / i.height) * 2 + 1, this.raycaster.setFromCamera(Ri, this.camera);
|
6564
6675
|
const n = this.raycaster.intersectObjects(this.draggable.children, !1);
|
6565
6676
|
if (n.length > 0) {
|
6566
6677
|
const r = n[0].object;
|
@@ -6793,13 +6904,13 @@ class Hs extends _t {
|
|
6793
6904
|
e.name, e.visible = this.draggable.visible;
|
6794
6905
|
};
|
6795
6906
|
}
|
6796
|
-
let
|
6797
|
-
class
|
6907
|
+
let ei = 0;
|
6908
|
+
class yo extends vt {
|
6798
6909
|
defaultScale = 10;
|
6799
6910
|
_camera;
|
6800
6911
|
group = null;
|
6801
6912
|
constructor(e) {
|
6802
|
-
super(), this.name = "Spline Editor", this._camera = e, D.addEventListener(
|
6913
|
+
super(), this.name = "Spline Editor", this._camera = e, D.addEventListener(A.ADD_SPLINE, this.onAddSpline);
|
6803
6914
|
}
|
6804
6915
|
initDebug() {
|
6805
6916
|
this.group = ae.addEditorGroup({
|
@@ -6847,19 +6958,19 @@ class oo extends _t {
|
|
6847
6958
|
});
|
6848
6959
|
}
|
6849
6960
|
dispose() {
|
6850
|
-
D.removeEventListener(
|
6961
|
+
D.removeEventListener(A.ADD_SPLINE, this.onAddSpline), ae.removeEditorGroup(this.name);
|
6851
6962
|
}
|
6852
6963
|
addSpline(e) {
|
6853
6964
|
e.draggableScale = this.defaultScale, e.hideTransform(), this.group?.current !== null && e.initDebug(this.group.current), this.add(e);
|
6854
6965
|
}
|
6855
6966
|
createSpline = (e = []) => {
|
6856
|
-
const t = `Spline ${
|
6857
|
-
return i.addPoints(e), this.addSpline(i),
|
6967
|
+
const t = `Spline ${ei + 1}`, i = new Vs(t, this._camera);
|
6968
|
+
return i.addPoints(e), this.addSpline(i), ei++, i;
|
6858
6969
|
};
|
6859
6970
|
createSplineFromArray = (e) => {
|
6860
6971
|
const t = [];
|
6861
6972
|
return e.forEach((i) => {
|
6862
|
-
t.push(new
|
6973
|
+
t.push(new P(i[0], i[1], i[2]));
|
6863
6974
|
}), this.createSpline(t);
|
6864
6975
|
};
|
6865
6976
|
createSplineFromCatmullRom = (e) => this.createSpline(e.points);
|
@@ -6873,12 +6984,12 @@ class oo extends _t {
|
|
6873
6984
|
});
|
6874
6985
|
};
|
6875
6986
|
onAddSpline = (e) => {
|
6876
|
-
const t = JSON.parse(e.value), i = `Spline ${
|
6987
|
+
const t = JSON.parse(e.value), i = `Spline ${ei + 1}`, n = [];
|
6877
6988
|
t.points.forEach((a) => {
|
6878
|
-
n.push(new
|
6989
|
+
n.push(new P(a[0], a[1], a[2]));
|
6879
6990
|
});
|
6880
|
-
const r = new
|
6881
|
-
r.addPoints(n), this.addSpline(r),
|
6991
|
+
const r = new Vs(i, this.camera);
|
6992
|
+
r.addPoints(n), this.addSpline(r), ei++;
|
6882
6993
|
};
|
6883
6994
|
get camera() {
|
6884
6995
|
return this._camera;
|
@@ -6890,15 +7001,15 @@ class oo extends _t {
|
|
6890
7001
|
});
|
6891
7002
|
}
|
6892
7003
|
}
|
6893
|
-
const
|
7004
|
+
const Zs = [
|
6894
7005
|
"Single",
|
6895
7006
|
"Side by Side",
|
6896
7007
|
"Stacked",
|
6897
7008
|
"Quad"
|
6898
|
-
],
|
6899
|
-
class me extends
|
7009
|
+
], bo = "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", Eo = "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==";
|
7010
|
+
class me extends Ft {
|
6900
7011
|
static instance = null;
|
6901
|
-
scene = new
|
7012
|
+
scene = new Gs();
|
6902
7013
|
renderer;
|
6903
7014
|
currentScene;
|
6904
7015
|
cameras = /* @__PURE__ */ new Map();
|
@@ -6908,17 +7019,17 @@ class me extends Nt {
|
|
6908
7019
|
// RefObject to one of the "windows"
|
6909
7020
|
cameraHelpers = /* @__PURE__ */ new Map();
|
6910
7021
|
lightHelpers = /* @__PURE__ */ new Map();
|
6911
|
-
helpersContainer = new
|
6912
|
-
grid = new
|
6913
|
-
axisHelper = new
|
6914
|
-
interactionHelper = new
|
7022
|
+
helpersContainer = new ma();
|
7023
|
+
grid = new no();
|
7024
|
+
axisHelper = new hs(500);
|
7025
|
+
interactionHelper = new hs(100);
|
6915
7026
|
currentTransform;
|
6916
7027
|
// Tools
|
6917
7028
|
splineEditor;
|
6918
7029
|
// Override Materials
|
6919
|
-
depthMaterial = new
|
6920
|
-
normalsMaterial = new
|
6921
|
-
uvMaterial = new
|
7030
|
+
depthMaterial = new fa();
|
7031
|
+
normalsMaterial = new ga();
|
7032
|
+
uvMaterial = new oo();
|
6922
7033
|
wireframeMaterial = new Je({
|
6923
7034
|
opacity: 0.33,
|
6924
7035
|
transparent: !0,
|
@@ -6945,7 +7056,7 @@ class me extends Nt {
|
|
6945
7056
|
// Interactions
|
6946
7057
|
selectedItem = void 0;
|
6947
7058
|
debugCamera;
|
6948
|
-
raycaster = new
|
7059
|
+
raycaster = new ni();
|
6949
7060
|
pointer = new pe();
|
6950
7061
|
cameraControls = void 0;
|
6951
7062
|
// References
|
@@ -6968,14 +7079,14 @@ class me extends Nt {
|
|
6968
7079
|
}, i.setItem(`${t}_mode`, this.state.mode), i.setItem(`${t}_tlCam`, i.getItem(`${t}_tlCam`) !== null ? i.getItem(`${t}_tlCam`) : "Debug"), i.setItem(`${t}_trCam`, i.getItem(`${t}_trCam`) !== null ? i.getItem(`${t}_trCam`) : "Orthographic"), i.setItem(`${t}_blCam`, i.getItem(`${t}_blCam`) !== null ? i.getItem(`${t}_blCam`) : "Front"), i.setItem(`${t}_brCam`, i.getItem(`${t}_brCam`) !== null ? i.getItem(`${t}_brCam`) : "Top"), i.setItem(`${t}_tlRender`, i.getItem(`${t}_tlRender`) !== null ? i.getItem(`${t}_tlRender`) : "Renderer"), i.setItem(`${t}_trRender`, i.getItem(`${t}_trRender`) !== null ? i.getItem(`${t}_trRender`) : "Renderer"), i.setItem(`${t}_blRender`, i.getItem(`${t}_blRender`) !== null ? i.getItem(`${t}_blRender`) : "Renderer"), i.setItem(`${t}_brRender`, i.getItem(`${t}_brRender`) !== null ? i.getItem(`${t}_brRender`) : "Renderer");
|
6969
7080
|
const r = {
|
6970
7081
|
Vector2: pe,
|
6971
|
-
Vector3:
|
6972
|
-
Vector4:
|
6973
|
-
Quaternion:
|
6974
|
-
Matrix4:
|
6975
|
-
Spherical:
|
6976
|
-
Box3:
|
6977
|
-
Sphere:
|
6978
|
-
Raycaster:
|
7082
|
+
Vector3: P,
|
7083
|
+
Vector4: xa,
|
7084
|
+
Quaternion: Ce,
|
7085
|
+
Matrix4: ci,
|
7086
|
+
Spherical: Li,
|
7087
|
+
Box3: Oa,
|
7088
|
+
Sphere: Ta,
|
7089
|
+
Raycaster: ni
|
6979
7090
|
};
|
6980
7091
|
ke.install({ THREE: r }), this.setupScene(), this.setupTools();
|
6981
7092
|
const a = localStorage.getItem(this.expandedCameraVisibility);
|
@@ -7125,11 +7236,11 @@ class me extends Nt {
|
|
7125
7236
|
] }),
|
7126
7237
|
/* @__PURE__ */ u.jsxs("div", { className: "settings", children: [
|
7127
7238
|
/* @__PURE__ */ u.jsx(
|
7128
|
-
|
7239
|
+
li,
|
7129
7240
|
{
|
7130
7241
|
title: "View",
|
7131
|
-
index:
|
7132
|
-
options:
|
7242
|
+
index: Zs.indexOf(this.state.mode),
|
7243
|
+
options: Zs,
|
7133
7244
|
onSelect: (t) => {
|
7134
7245
|
t !== this.state.mode && (this.killControls(), this.setState({ mode: t }), localStorage.setItem(`${this.appID}_mode`, t));
|
7135
7246
|
},
|
@@ -7144,7 +7255,7 @@ class me extends Nt {
|
|
7144
7255
|
}
|
7145
7256
|
),
|
7146
7257
|
/* @__PURE__ */ u.jsx(
|
7147
|
-
|
7258
|
+
li,
|
7148
7259
|
{
|
7149
7260
|
title: "Interact",
|
7150
7261
|
index: this.state.interactionMode === "Orbit" ? 0 : 1,
|
@@ -7166,10 +7277,10 @@ class me extends Nt {
|
|
7166
7277
|
}
|
7167
7278
|
),
|
7168
7279
|
/* @__PURE__ */ u.jsx(
|
7169
|
-
|
7280
|
+
Us,
|
7170
7281
|
{
|
7171
7282
|
name: "cameraHelper",
|
7172
|
-
icon:
|
7283
|
+
icon: bo,
|
7173
7284
|
selected: this.cameraVisibility,
|
7174
7285
|
height: 24,
|
7175
7286
|
top: 2,
|
@@ -7184,10 +7295,10 @@ class me extends Nt {
|
|
7184
7295
|
}
|
7185
7296
|
),
|
7186
7297
|
/* @__PURE__ */ u.jsx(
|
7187
|
-
|
7298
|
+
Us,
|
7188
7299
|
{
|
7189
7300
|
name: "lightHelper",
|
7190
|
-
icon:
|
7301
|
+
icon: Eo,
|
7191
7302
|
selected: this.lightVisibility,
|
7192
7303
|
height: 24,
|
7193
7304
|
top: 4,
|
@@ -7206,7 +7317,7 @@ class me extends Nt {
|
|
7206
7317
|
}
|
7207
7318
|
// Setup
|
7208
7319
|
setupRenderer() {
|
7209
|
-
this.renderer = new
|
7320
|
+
this.renderer = new _a({
|
7210
7321
|
canvas: this.canvasRef.current,
|
7211
7322
|
stencil: !1
|
7212
7323
|
}), this.renderer.autoClear = !1, this.renderer.shadowMap.enabled = !0, this.renderer.setPixelRatio(devicePixelRatio), this.renderer.setClearColor(0), this.props.three.renderer = this.renderer;
|
@@ -7214,15 +7325,15 @@ class me extends Nt {
|
|
7214
7325
|
setupScene() {
|
7215
7326
|
this.scene.name = "Debug Scene", this.scene.uuid = "", this.helpersContainer.name = "helpers", this.scene.add(this.helpersContainer), this.helpersContainer.add(this.grid), this.axisHelper.name = "axisHelper", this.helpersContainer.add(this.axisHelper), this.interactionHelper.name = "interactionHelper", this.helpersContainer.add(this.interactionHelper), this.interactionHelper.visible = !1;
|
7216
7327
|
const e = (n, r) => {
|
7217
|
-
const a = new
|
7328
|
+
const a = new Ii(-100, 100, 100, -100, 50, 5e3);
|
7218
7329
|
return a.name = n, a.position.copy(r), a.lookAt(0, 0, 0), this.cameras.set(n, a), a;
|
7219
7330
|
};
|
7220
|
-
e("Top", new
|
7331
|
+
e("Top", new P(0, 1e3, 0)), e("Bottom", new P(0, -1e3, 0)), e("Left", new P(-1e3, 0, 0)), e("Right", new P(1e3, 0, 0)), e("Front", new P(0, 0, 1e3)), e("Back", new P(0, 0, -1e3)), e("Orthographic", new P(1e3, 1e3, 1e3)), e("UI", new P()), this.debugCamera = new Ct(60, 1, 50, 5e3), this.debugCamera.name = "Debug", this.debugCamera.position.set(500, 500, 500), this.debugCamera.lookAt(0, 0, 0), this.cameras.set("Debug", this.debugCamera), this.currentCamera = this.debugCamera;
|
7221
7332
|
const t = localStorage, i = this.props.three.app.appID;
|
7222
7333
|
this.tlCam = this.cameras.get(t.getItem(`${i}_tlCam`)), this.trCam = this.cameras.get(t.getItem(`${i}_trCam`)), this.blCam = this.cameras.get(t.getItem(`${i}_blCam`)), this.brCam = this.cameras.get(t.getItem(`${i}_brCam`)), this.tlCam === void 0 && (this.tlCam = this.cameras.get("Debug")), this.trCam === void 0 && (this.trCam = this.cameras.get("Orthographic")), this.blCam === void 0 && (this.blCam = this.cameras.get("Front")), this.brCam === void 0 && (this.brCam = this.cameras.get("Top"));
|
7223
7334
|
}
|
7224
7335
|
setupTools() {
|
7225
|
-
this.splineEditor = new
|
7336
|
+
this.splineEditor = new yo(this.currentCamera), this.splineEditor.initDebug(), this.scene.add(this.splineEditor);
|
7226
7337
|
}
|
7227
7338
|
// Public
|
7228
7339
|
play() {
|
@@ -7266,11 +7377,11 @@ class me extends Nt {
|
|
7266
7377
|
// Events
|
7267
7378
|
enable() {
|
7268
7379
|
const e = this.containerRef.current;
|
7269
|
-
e.addEventListener("mousemove", this.onMouseMove), e.addEventListener("click", this.onClick), window.addEventListener("keydown", this.onKey), window.addEventListener("resize", this.resize), D.addEventListener(
|
7380
|
+
e.addEventListener("mousemove", this.onMouseMove), e.addEventListener("click", this.onClick), window.addEventListener("keydown", this.onKey), window.addEventListener("resize", this.resize), D.addEventListener(A.SET_SCENE, this.sceneUpdate), D.addEventListener(A.ADD_CAMERA, this.addCamera), D.addEventListener(A.REMOVE_CAMERA, this.removeCamera), D.addEventListener(A.SET_OBJECT, this.onSetSelectedItem);
|
7270
7381
|
}
|
7271
7382
|
disable() {
|
7272
7383
|
const e = this.containerRef.current;
|
7273
|
-
e.removeEventListener("mousemove", this.onMouseMove), e.removeEventListener("click", this.onClick), window.removeEventListener("keydown", this.onKey), window.removeEventListener("resize", this.resize), D.removeEventListener(
|
7384
|
+
e.removeEventListener("mousemove", this.onMouseMove), e.removeEventListener("click", this.onClick), window.removeEventListener("keydown", this.onKey), window.removeEventListener("resize", this.resize), D.removeEventListener(A.SET_SCENE, this.sceneUpdate), D.removeEventListener(A.ADD_CAMERA, this.addCamera), D.removeEventListener(A.REMOVE_CAMERA, this.removeCamera), D.removeEventListener(A.SET_OBJECT, this.onSetSelectedItem);
|
7274
7385
|
}
|
7275
7386
|
resize = () => {
|
7276
7387
|
this.width = window.innerWidth - 300, this.height = window.innerHeight;
|
@@ -7290,7 +7401,7 @@ class me extends Nt {
|
|
7290
7401
|
}
|
7291
7402
|
const r = i / n;
|
7292
7403
|
this.cameras.forEach((a) => {
|
7293
|
-
a instanceof
|
7404
|
+
a instanceof Ii ? (a.left = i / -2, a.right = i / 2, a.top = n / 2, a.bottom = n / -2, a.name === "UI" && (a.position.x = this.width / 2, a.position.y = this.height / -2, a.position.z = 100), a.updateProjectionMatrix()) : a instanceof Ct && (a.aspect = r, a.updateProjectionMatrix(), this.cameraHelpers.get(a.name)?.update());
|
7294
7405
|
});
|
7295
7406
|
};
|
7296
7407
|
sceneUpdate = (e) => {
|
@@ -7304,7 +7415,7 @@ class me extends Nt {
|
|
7304
7415
|
addCamera = (e) => {
|
7305
7416
|
const t = e.value, i = this.props.three.scene?.getObjectByProperty("uuid", t.uuid);
|
7306
7417
|
if (i !== void 0 && this.cameras.set(t.name, i), i instanceof Ct) {
|
7307
|
-
const n = new
|
7418
|
+
const n = new va(i);
|
7308
7419
|
n.visible = this.cameraVisibility, this.cameraHelpers.set(i.name, n), this.scene.add(n);
|
7309
7420
|
}
|
7310
7421
|
this.setState({ lastUpdate: Date.now() });
|
@@ -7317,11 +7428,11 @@ class me extends Nt {
|
|
7317
7428
|
const t = new pe();
|
7318
7429
|
this.renderer.getSize(t);
|
7319
7430
|
const i = Math.min(e.clientX, t.x), n = Math.min(e.clientY, t.y);
|
7320
|
-
this.pointer.x =
|
7431
|
+
this.pointer.x = ot(i, 0, t.x, -1, 1), this.pointer.y = ot(n, 0, t.y, 1, -1);
|
7321
7432
|
const r = t.x / 2, a = t.y / 2, o = () => {
|
7322
|
-
i < r ? this.pointer.x =
|
7433
|
+
i < r ? this.pointer.x = ot(i, 0, r, -1, 1) : this.pointer.x = ot(i, r, t.x, -1, 1);
|
7323
7434
|
}, c = () => {
|
7324
|
-
n < a ? this.pointer.y =
|
7435
|
+
n < a ? this.pointer.y = ot(n, 0, a, 1, -1) : this.pointer.y = ot(n, a, t.y, 1, -1);
|
7325
7436
|
};
|
7326
7437
|
switch (this.state.mode) {
|
7327
7438
|
case "Quad":
|
@@ -7355,7 +7466,7 @@ class me extends Nt {
|
|
7355
7466
|
if (this.currentCamera.name === "UI")
|
7356
7467
|
return;
|
7357
7468
|
const t = this.controls.get(this.currentCamera.name);
|
7358
|
-
e.key === "0" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ke(this.currentCamera, this.currentWindow.current), this.selectedItem instanceof M || this.selectedItem instanceof
|
7469
|
+
e.key === "0" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ke(this.currentCamera, this.currentWindow.current), this.selectedItem instanceof M || this.selectedItem instanceof ya ? (this.selectedItem.geometry.computeBoundingBox(), this.cameraControls.fitToBox(this.selectedItem.geometry.boundingBox, !0)) : this.cameraControls.fitToSphere(this.selectedItem, !0), this.updateCameraControls(t, !0)) : e.key === "1" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ke(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(0, Math.PI * 0.5, !0), this.cameraControls.moveTo(this.selectedItem.position.x, this.selectedItem.position.y, 0, !0), this.updateCameraControls(t)) : e.key === "2" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ke(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(0, 0, !0), this.cameraControls.moveTo(this.selectedItem.position.x, 0, this.selectedItem.position.z, !0), this.updateCameraControls(t)) : e.key === "3" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ke(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(Math.PI / 2, Math.PI / 2, !0), this.cameraControls.moveTo(0, this.selectedItem.position.y, this.selectedItem.position.z, !0), this.updateCameraControls(t)) : e.key === "4" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ke(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(Math.PI, Math.PI / 2, !0), this.cameraControls.moveTo(this.selectedItem.position.x, this.selectedItem.position.y, 0, !0), this.updateCameraControls(t)) : e.key === "5" && (e.preventDefault(), this.clearControls(), this.cameraControls = new ke(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(Fi(45), Fi(45), !0), this.updateCameraControls(t));
|
7359
7470
|
} else if (this.currentTransform !== void 0)
|
7360
7471
|
switch (e.key) {
|
7361
7472
|
case "r":
|
@@ -7392,7 +7503,7 @@ class me extends Nt {
|
|
7392
7503
|
x: this.selectedItem.rotation.x,
|
7393
7504
|
y: this.selectedItem.rotation.y,
|
7394
7505
|
z: this.selectedItem.rotation.z
|
7395
|
-
}), this.props.three.updateObject(this.selectedItem.uuid, "scale", this.selectedItem.scale),
|
7506
|
+
}), this.props.three.updateObject(this.selectedItem.uuid, "scale", this.selectedItem.scale), di.instance.update());
|
7396
7507
|
};
|
7397
7508
|
// Utils
|
7398
7509
|
clearLightHelpers = () => {
|
@@ -7406,19 +7517,19 @@ class me extends Nt {
|
|
7406
7517
|
let t;
|
7407
7518
|
switch (e.type) {
|
7408
7519
|
case "DirectionalLight":
|
7409
|
-
t = new
|
7520
|
+
t = new Sa(e, 100), t.name = `${e.name}Helper`, t.visible = this.lightVisibility, this.lightHelpers.set(e.name, t), this.helpersContainer.add(t);
|
7410
7521
|
break;
|
7411
7522
|
case "HemisphereLight":
|
7412
|
-
t = new
|
7523
|
+
t = new Ca(e, 250), t.name = `${e.name}Helper`, t.visible = this.lightVisibility, this.lightHelpers.set(e.name, t), this.helpersContainer.add(t);
|
7413
7524
|
break;
|
7414
7525
|
case "RectAreaLight":
|
7415
|
-
t = new
|
7526
|
+
t = new Fr(e), t.name = `${e.name}Helper`, t.visible = this.lightVisibility, this.lightHelpers.set(e.name, t), this.helpersContainer.add(t);
|
7416
7527
|
break;
|
7417
7528
|
case "PointLight":
|
7418
|
-
t = new
|
7529
|
+
t = new Ea(e, 100), t.name = `${e.name}Helper`, t.visible = this.lightVisibility, this.lightHelpers.set(e.name, t), this.helpersContainer.add(t);
|
7419
7530
|
break;
|
7420
7531
|
case "SpotLight":
|
7421
|
-
t = new
|
7532
|
+
t = new ba(e), t.name = `${e.name}Helper`, t.visible = this.lightVisibility, this.lightHelpers.set(e.name, t), this.helpersContainer.add(t);
|
7422
7533
|
break;
|
7423
7534
|
}
|
7424
7535
|
}
|
@@ -7428,7 +7539,7 @@ class me extends Nt {
|
|
7428
7539
|
const i = this.controls.get(e.name);
|
7429
7540
|
if (i !== void 0 && i.dispose(), this.controls.delete(e.name), e.name === "UI")
|
7430
7541
|
return;
|
7431
|
-
const n = new
|
7542
|
+
const n = new Hr(e, t);
|
7432
7543
|
switch (n.enableDamping = !0, n.dampingFactor = 0.05, e.name) {
|
7433
7544
|
case "Top":
|
7434
7545
|
case "Bottom":
|
@@ -7489,11 +7600,11 @@ class me extends Nt {
|
|
7489
7600
|
if (this.selectedItem === void 0)
|
7490
7601
|
return;
|
7491
7602
|
cancelAnimationFrame(this.cameraControlsRafID), this.cameraControlsRafID = -1, this.cameraControls && (this.cameraControls.smoothTime = 0.1);
|
7492
|
-
const i = 0.15, n = new
|
7603
|
+
const i = 0.15, n = new wa();
|
7493
7604
|
n.start(), this.selectedItem.getWorldPosition(e.target0);
|
7494
7605
|
const r = () => {
|
7495
7606
|
const a = n.getDelta();
|
7496
|
-
this.cameraControls && this.cameraControls.update(a), t && (e.target.lerp(e.target0, i), e.object.position.lerp(e.position0, i), e.object.zoom =
|
7607
|
+
this.cameraControls && this.cameraControls.update(a), t && (e.target.lerp(e.target0, i), e.object.position.lerp(e.position0, i), e.object.zoom = ki(e.object.zoom, e.zoom0, i), e.object.updateProjectionMatrix(), e.dispatchEvent({ type: "change" })), n.getElapsedTime() >= 0.5 ? (cancelAnimationFrame(this.cameraControlsRafID), this.cameraControlsRafID = -1, this.clearControls()) : this.cameraControlsRafID = requestAnimationFrame(r);
|
7497
7608
|
};
|
7498
7609
|
r();
|
7499
7610
|
};
|
@@ -7557,12 +7668,12 @@ class me extends Nt {
|
|
7557
7668
|
return `${this.appID}_multiviewLightVisibility`;
|
7558
7669
|
}
|
7559
7670
|
}
|
7560
|
-
class
|
7671
|
+
class di extends Ft {
|
7561
7672
|
static instance;
|
7562
|
-
matrix = new
|
7563
|
-
position = new
|
7564
|
-
rotation = new
|
7565
|
-
scale = new
|
7673
|
+
matrix = new ci();
|
7674
|
+
position = new P();
|
7675
|
+
rotation = new pn();
|
7676
|
+
scale = new P();
|
7566
7677
|
open = !1;
|
7567
7678
|
constructor(e) {
|
7568
7679
|
super(e);
|
@@ -7570,14 +7681,14 @@ class hi extends Nt {
|
|
7570
7681
|
this.open = i, this.saveExpanded(), this.state = {
|
7571
7682
|
lastUpdated: 0,
|
7572
7683
|
expanded: i
|
7573
|
-
}, this.matrix.elements = e.object.matrix, e.object.uuid.length > 0 && (this.position.setFromMatrixPosition(this.matrix), this.rotation.setFromRotationMatrix(this.matrix), this.scale.setFromMatrixScale(this.matrix)),
|
7684
|
+
}, this.matrix.elements = e.object.matrix, e.object.uuid.length > 0 && (this.position.setFromMatrixPosition(this.matrix), this.rotation.setFromRotationMatrix(this.matrix), this.scale.setFromMatrixScale(this.matrix)), di.instance = this;
|
7574
7685
|
}
|
7575
7686
|
update() {
|
7576
7687
|
if (me.instance) {
|
7577
7688
|
const e = me.instance.selectedItem;
|
7578
7689
|
if (e === void 0)
|
7579
7690
|
return;
|
7580
|
-
this.position.x =
|
7691
|
+
this.position.x = Pe(e.position.x, 3), this.position.y = Pe(e.position.y, 3), this.position.z = Pe(e.position.z, 3), this.rotation.copy(e.rotation), this.scale.x = Pe(e.scale.x, 3), this.scale.y = Pe(e.scale.y, 3), this.scale.z = Pe(e.scale.z, 3), this.setState({ lastUpdated: Date.now() });
|
7581
7692
|
}
|
7582
7693
|
}
|
7583
7694
|
render() {
|
@@ -7640,7 +7751,7 @@ class hi extends Nt {
|
|
7640
7751
|
return `${this.props.three.app.appID}_transform`;
|
7641
7752
|
}
|
7642
7753
|
}
|
7643
|
-
function
|
7754
|
+
function Ws(s) {
|
7644
7755
|
switch (s) {
|
7645
7756
|
case "color":
|
7646
7757
|
return "Color";
|
@@ -7663,7 +7774,7 @@ function Bs(s) {
|
|
7663
7774
|
}
|
7664
7775
|
return s;
|
7665
7776
|
}
|
7666
|
-
function
|
7777
|
+
function Co(s, e) {
|
7667
7778
|
function t() {
|
7668
7779
|
return `${e.app.appID}_light`;
|
7669
7780
|
}
|
@@ -7676,7 +7787,7 @@ function ho(s, e) {
|
|
7676
7787
|
for (const o in s.lightInfo) {
|
7677
7788
|
const c = s.lightInfo[o];
|
7678
7789
|
c !== void 0 && (c.isColor !== void 0 ? a.push({
|
7679
|
-
title:
|
7790
|
+
title: Ws(o),
|
7680
7791
|
prop: o,
|
7681
7792
|
type: "color",
|
7682
7793
|
value: c,
|
@@ -7690,7 +7801,7 @@ function ho(s, e) {
|
|
7690
7801
|
}
|
7691
7802
|
}
|
7692
7803
|
}) : a.push({
|
7693
|
-
title:
|
7804
|
+
title: Ws(o),
|
7694
7805
|
prop: o,
|
7695
7806
|
type: typeof c,
|
7696
7807
|
value: c,
|
@@ -7717,7 +7828,7 @@ function ho(s, e) {
|
|
7717
7828
|
}
|
7718
7829
|
);
|
7719
7830
|
}
|
7720
|
-
function
|
7831
|
+
function So(s) {
|
7721
7832
|
const e = s.object, t = s.three;
|
7722
7833
|
function i() {
|
7723
7834
|
return `${t.app.appID}_animation`;
|
@@ -7788,7 +7899,7 @@ function uo(s) {
|
|
7788
7899
|
}), o.push({
|
7789
7900
|
title: "Mixer",
|
7790
7901
|
items: y
|
7791
|
-
}), d = new
|
7902
|
+
}), d = new Ma(m), me.instance?.scene.add(d);
|
7792
7903
|
}
|
7793
7904
|
}
|
7794
7905
|
}
|
@@ -7806,7 +7917,7 @@ function uo(s) {
|
|
7806
7917
|
}
|
7807
7918
|
);
|
7808
7919
|
}
|
7809
|
-
const
|
7920
|
+
const Hi = {
|
7810
7921
|
name: "",
|
7811
7922
|
uuid: "",
|
7812
7923
|
type: "",
|
@@ -7819,32 +7930,32 @@ const Fi = {
|
|
7819
7930
|
lightInfo: void 0,
|
7820
7931
|
children: []
|
7821
7932
|
};
|
7822
|
-
let ce = { ...
|
7823
|
-
function
|
7933
|
+
let ce = { ...Hi };
|
7934
|
+
function wo(s) {
|
7824
7935
|
const [e, t] = Z(-1);
|
7825
7936
|
tt(() => {
|
7826
7937
|
function a(c) {
|
7827
7938
|
ce = { ...c.value }, t(Date.now());
|
7828
7939
|
}
|
7829
7940
|
function o() {
|
7830
|
-
ce = { ...
|
7941
|
+
ce = { ...Hi }, t(Date.now());
|
7831
7942
|
}
|
7832
|
-
return D.addEventListener(
|
7833
|
-
D.removeEventListener(
|
7943
|
+
return D.addEventListener(A.SET_SCENE, o), D.addEventListener(A.SET_OBJECT, a), () => {
|
7944
|
+
D.removeEventListener(A.SET_SCENE, o), D.removeEventListener(A.SET_OBJECT, a);
|
7834
7945
|
};
|
7835
7946
|
}, []);
|
7836
7947
|
const i = ce.type.toLowerCase(), n = ce.animations.length > 0 || ce.mixer !== void 0, r = i.search("mesh") > -1 || i.search("line") > -1 || i.search("points") > -1;
|
7837
7948
|
return /* @__PURE__ */ u.jsx(
|
7838
|
-
|
7949
|
+
oi,
|
7839
7950
|
{
|
7840
7951
|
label: "Inspector",
|
7841
7952
|
button: ce.uuid.length > 0 ? /* @__PURE__ */ u.jsx("button", { className: "remove", onClick: () => {
|
7842
|
-
ge.instance.remove(ce.name), ce = { ...
|
7953
|
+
ge.instance.remove(ce.name), ce = { ...Hi }, t(Date.now());
|
7843
7954
|
} }) : void 0,
|
7844
7955
|
children: /* @__PURE__ */ u.jsx("div", { id: "Inspector", className: s.class, children: ce.uuid.length > 0 && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
7845
7956
|
/* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
7846
7957
|
/* @__PURE__ */ u.jsx(
|
7847
|
-
|
7958
|
+
ii,
|
7848
7959
|
{
|
7849
7960
|
type: "string",
|
7850
7961
|
title: "Name",
|
@@ -7854,7 +7965,7 @@ function po(s) {
|
|
7854
7965
|
}
|
7855
7966
|
),
|
7856
7967
|
/* @__PURE__ */ u.jsx(
|
7857
|
-
|
7968
|
+
ii,
|
7858
7969
|
{
|
7859
7970
|
type: "string",
|
7860
7971
|
title: "Type",
|
@@ -7864,7 +7975,7 @@ function po(s) {
|
|
7864
7975
|
}
|
7865
7976
|
),
|
7866
7977
|
/* @__PURE__ */ u.jsx(
|
7867
|
-
|
7978
|
+
ii,
|
7868
7979
|
{
|
7869
7980
|
type: "string",
|
7870
7981
|
title: "UUID",
|
@@ -7875,28 +7986,28 @@ function po(s) {
|
|
7875
7986
|
)
|
7876
7987
|
] }),
|
7877
7988
|
/* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
7878
|
-
/* @__PURE__ */ u.jsx(
|
7879
|
-
n ? /* @__PURE__ */ u.jsx(
|
7880
|
-
i.search("camera") > -1 ?
|
7881
|
-
i.search("light") > -1 ?
|
7882
|
-
r ?
|
7989
|
+
/* @__PURE__ */ u.jsx(di, { object: ce, three: s.three }),
|
7990
|
+
n ? /* @__PURE__ */ u.jsx(So, { object: ce, three: s.three }) : null,
|
7991
|
+
i.search("camera") > -1 ? Nr(ce, s.three) : null,
|
7992
|
+
i.search("light") > -1 ? Co(ce, s.three) : null,
|
7993
|
+
r ? kr(ce, s.three) : null
|
7883
7994
|
] })
|
7884
7995
|
] }) }, e)
|
7885
7996
|
},
|
7886
7997
|
"Inspector"
|
7887
7998
|
);
|
7888
7999
|
}
|
7889
|
-
class
|
8000
|
+
class xo extends Ft {
|
7890
8001
|
// Renderer
|
7891
8002
|
autoClear = !0;
|
7892
8003
|
autoClearColor = !0;
|
7893
8004
|
autoClearDepth = !0;
|
7894
8005
|
autoClearStencil = !0;
|
7895
|
-
outputColorSpace =
|
8006
|
+
outputColorSpace = ds;
|
7896
8007
|
localClippingEnabled = !1;
|
7897
8008
|
clearColor = new et(0);
|
7898
8009
|
clearAlpha = 1;
|
7899
|
-
toneMapping =
|
8010
|
+
toneMapping = us;
|
7900
8011
|
toneMappingExposure = 1;
|
7901
8012
|
constructor(e) {
|
7902
8013
|
super(e);
|
@@ -7908,14 +8019,14 @@ class mo extends Nt {
|
|
7908
8019
|
const n = me.instance.renderer;
|
7909
8020
|
n && (this.autoClear = n.autoClear, this.autoClearColor = n.autoClearColor, this.autoClearDepth = n.autoClearDepth, this.autoClearStencil = n.autoClearStencil, this.outputColorSpace = n.outputColorSpace, this.localClippingEnabled = n.localClippingEnabled, this.clearAlpha = n.getClearAlpha(), this.toneMapping = n.toneMapping, this.toneMappingExposure = n.toneMappingExposure, n.getClearColor(this.clearColor));
|
7910
8021
|
}
|
7911
|
-
D.addEventListener(
|
8022
|
+
D.addEventListener(A.ADD_RENDERER, this.onAddRenderer);
|
7912
8023
|
}
|
7913
8024
|
componentwillunmount() {
|
7914
|
-
D.removeEventListener(
|
8025
|
+
D.removeEventListener(A.ADD_RENDERER, this.onAddRenderer);
|
7915
8026
|
}
|
7916
8027
|
onAddRenderer = (e) => {
|
7917
8028
|
const t = e.value;
|
7918
|
-
if (this.autoClear = t.autoClear, this.autoClearColor = t.autoClearColor, this.autoClearDepth = t.autoClearDepth, this.autoClearStencil = t.autoClearStencil, this.outputColorSpace = t.outputColorSpace, this.localClippingEnabled = t.localClippingEnabled, this.clearAlpha = t.clearAlpha, this.toneMapping = t.toneMapping, this.toneMappingExposure = t.toneMappingExposure, this.clearColor.setStyle(t.clearColor,
|
8029
|
+
if (this.autoClear = t.autoClear, this.autoClearColor = t.autoClearColor, this.autoClearDepth = t.autoClearDepth, this.autoClearStencil = t.autoClearStencil, this.outputColorSpace = t.outputColorSpace, this.localClippingEnabled = t.localClippingEnabled, this.clearAlpha = t.clearAlpha, this.toneMapping = t.toneMapping, this.toneMappingExposure = t.toneMappingExposure, this.clearColor.setStyle(t.clearColor, Nt), mt.enabled = t.colorManagement, me.instance) {
|
7919
8030
|
const i = me.instance.renderer;
|
7920
8031
|
i && (i.autoClear = this.autoClear, i.autoClearColor = this.autoClearColor, i.autoClearDepth = this.autoClearDepth, i.autoClearStencil = this.autoClearStencil, i.outputColorSpace = this.outputColorSpace, i.localClippingEnabled = this.localClippingEnabled, i.toneMapping = this.toneMapping, i.toneMappingExposure = this.toneMappingExposure, i.setClearColor(t.clearColor, this.clearAlpha));
|
7921
8032
|
}
|
@@ -7934,7 +8045,7 @@ class mo extends Nt {
|
|
7934
8045
|
localClippingEnabled: this.localClippingEnabled,
|
7935
8046
|
clearAlpha: this.clearAlpha,
|
7936
8047
|
clearColor: this.clearColor.getStyle(),
|
7937
|
-
colorManagement:
|
8048
|
+
colorManagement: mt.enabled,
|
7938
8049
|
toneMapping: this.toneMapping,
|
7939
8050
|
toneMappingExposure: this.toneMappingExposure
|
7940
8051
|
}));
|
@@ -8008,9 +8119,9 @@ class mo extends Nt {
|
|
8008
8119
|
{
|
8009
8120
|
type: "boolean",
|
8010
8121
|
title: "Clear Management",
|
8011
|
-
value:
|
8122
|
+
value: mt.enabled,
|
8012
8123
|
onChange: (t, i) => {
|
8013
|
-
|
8124
|
+
mt.enabled = i, e();
|
8014
8125
|
}
|
8015
8126
|
},
|
8016
8127
|
{
|
@@ -8020,15 +8131,15 @@ class mo extends Nt {
|
|
8020
8131
|
options: [
|
8021
8132
|
{
|
8022
8133
|
title: "No Color Space",
|
8023
|
-
value:
|
8134
|
+
value: Pa
|
8024
8135
|
},
|
8025
8136
|
{
|
8026
8137
|
title: "SRB Color Space",
|
8027
|
-
value:
|
8138
|
+
value: ds
|
8028
8139
|
},
|
8029
8140
|
{
|
8030
8141
|
title: "Linear SRB Color Space",
|
8031
|
-
value:
|
8142
|
+
value: Nt
|
8032
8143
|
}
|
8033
8144
|
],
|
8034
8145
|
onChange: (t, i) => {
|
@@ -8042,35 +8153,35 @@ class mo extends Nt {
|
|
8042
8153
|
options: [
|
8043
8154
|
{
|
8044
8155
|
title: "None ",
|
8045
|
-
value:
|
8156
|
+
value: us
|
8046
8157
|
},
|
8047
8158
|
{
|
8048
8159
|
title: "Linear ",
|
8049
|
-
value:
|
8160
|
+
value: Aa
|
8050
8161
|
},
|
8051
8162
|
{
|
8052
8163
|
title: "Reinhard",
|
8053
|
-
value:
|
8164
|
+
value: Da
|
8054
8165
|
},
|
8055
8166
|
{
|
8056
8167
|
title: "Cineon ",
|
8057
|
-
value:
|
8168
|
+
value: Ra
|
8058
8169
|
},
|
8059
8170
|
{
|
8060
8171
|
title: "ACES Filmic",
|
8061
|
-
value:
|
8172
|
+
value: Ia
|
8062
8173
|
},
|
8063
8174
|
{
|
8064
8175
|
title: "AgX",
|
8065
|
-
value:
|
8176
|
+
value: La
|
8066
8177
|
},
|
8067
8178
|
{
|
8068
8179
|
title: "Neutral",
|
8069
|
-
value:
|
8180
|
+
value: ka
|
8070
8181
|
},
|
8071
8182
|
{
|
8072
8183
|
title: "Custom",
|
8073
|
-
value:
|
8184
|
+
value: Ua
|
8074
8185
|
}
|
8075
8186
|
],
|
8076
8187
|
onChange: (t, i) => {
|
@@ -8103,12 +8214,12 @@ class mo extends Nt {
|
|
8103
8214
|
return `${this.props.three.app.appID}_renderer`;
|
8104
8215
|
}
|
8105
8216
|
}
|
8106
|
-
function
|
8217
|
+
function Oo(s) {
|
8107
8218
|
const [e] = Z([]), [t] = Z([]), [i, n] = Z(0), r = (c) => {
|
8108
8219
|
const l = c.value;
|
8109
8220
|
e.push(l), t.push(
|
8110
8221
|
/* @__PURE__ */ u.jsx(
|
8111
|
-
|
8222
|
+
oi,
|
8112
8223
|
{
|
8113
8224
|
label: `Scene: ${l.name}`,
|
8114
8225
|
scene: l,
|
@@ -8116,7 +8227,7 @@ function fo(s) {
|
|
8116
8227
|
onRefresh: () => {
|
8117
8228
|
s.three.refreshScene(l.name);
|
8118
8229
|
},
|
8119
|
-
children: /* @__PURE__ */ u.jsx(
|
8230
|
+
children: /* @__PURE__ */ u.jsx(Es, { child: l, scene: l, three: s.three })
|
8120
8231
|
},
|
8121
8232
|
Math.random()
|
8122
8233
|
)
|
@@ -8126,7 +8237,7 @@ function fo(s) {
|
|
8126
8237
|
for (let d = 0; d < e.length; d++)
|
8127
8238
|
if (l.uuid === e[d].uuid) {
|
8128
8239
|
e[d] = l, t[d] = /* @__PURE__ */ u.jsx(
|
8129
|
-
|
8240
|
+
oi,
|
8130
8241
|
{
|
8131
8242
|
label: `Scene: ${l.name}`,
|
8132
8243
|
scene: l,
|
@@ -8134,7 +8245,7 @@ function fo(s) {
|
|
8134
8245
|
onRefresh: () => {
|
8135
8246
|
s.three.refreshScene(l.name);
|
8136
8247
|
},
|
8137
|
-
children: /* @__PURE__ */ u.jsx(
|
8248
|
+
children: /* @__PURE__ */ u.jsx(Es, { child: l, scene: l, three: s.three })
|
8138
8249
|
},
|
8139
8250
|
Math.random()
|
8140
8251
|
), n(Date.now());
|
@@ -8148,16 +8259,16 @@ function fo(s) {
|
|
8148
8259
|
return;
|
8149
8260
|
}
|
8150
8261
|
};
|
8151
|
-
return tt(() => (D.addEventListener(
|
8152
|
-
D.removeEventListener(
|
8262
|
+
return tt(() => (D.addEventListener(A.ADD_SCENE, r), D.addEventListener(A.REFRESH_SCENE, a), D.addEventListener(A.REMOVE_SCENE, o), () => {
|
8263
|
+
D.removeEventListener(A.ADD_SCENE, r), D.removeEventListener(A.REFRESH_SCENE, a), D.removeEventListener(A.REMOVE_SCENE, o);
|
8153
8264
|
}), []), /* @__PURE__ */ u.jsxs("div", { id: "SidePanel", children: [
|
8154
8265
|
/* @__PURE__ */ u.jsx("div", { className: "scenes", children: t }, i),
|
8155
|
-
/* @__PURE__ */ u.jsx(
|
8156
|
-
/* @__PURE__ */ u.jsx(
|
8266
|
+
/* @__PURE__ */ u.jsx(wo, { three: s.three }),
|
8267
|
+
/* @__PURE__ */ u.jsx(xo, { three: s.three }),
|
8157
8268
|
/* @__PURE__ */ u.jsx(ae, { three: s.three })
|
8158
8269
|
] });
|
8159
8270
|
}
|
8160
|
-
function
|
8271
|
+
function Wo(s) {
|
8161
8272
|
return tt(() => {
|
8162
8273
|
function e(o) {
|
8163
8274
|
let c = null;
|
@@ -8198,7 +8309,7 @@ function Lo(s) {
|
|
8198
8309
|
}
|
8199
8310
|
d.material.needsUpdate = !0;
|
8200
8311
|
};
|
8201
|
-
c.value.src.length > 0 ?
|
8312
|
+
c.value.src.length > 0 ? vn(c.value.src).then((m) => {
|
8202
8313
|
m.offset.set(c.value.offset[0], c.value.offset[1]), m.repeat.set(c.value.repeat[0], c.value.repeat[1]), p(m);
|
8203
8314
|
}) : p(null);
|
8204
8315
|
}
|
@@ -8206,25 +8317,25 @@ function Lo(s) {
|
|
8206
8317
|
const { key: c, uuid: l, value: d, subitem: p } = o.value, f = e(l)?.getObjectByProperty("uuid", l);
|
8207
8318
|
if (f !== void 0)
|
8208
8319
|
try {
|
8209
|
-
p !== void 0 ?
|
8210
|
-
} catch (
|
8211
|
-
console.log("Error requesting method:"), console.log(
|
8320
|
+
p !== void 0 ? rr(f, p)[c](d) : f[c](d);
|
8321
|
+
} catch (C) {
|
8322
|
+
console.log("Error requesting method:"), console.log(C), console.log(c), console.log(d);
|
8212
8323
|
}
|
8213
8324
|
};
|
8214
|
-
return D.addEventListener(
|
8215
|
-
D.removeEventListener(
|
8325
|
+
return D.addEventListener(A.GET_OBJECT, t), D.addEventListener(A.UPDATE_OBJECT, n), D.addEventListener(A.CREATE_TEXTURE, r), D.addEventListener(A.REQUEST_METHOD, a), () => {
|
8326
|
+
D.removeEventListener(A.GET_OBJECT, t), D.removeEventListener(A.UPDATE_OBJECT, n), D.removeEventListener(A.CREATE_TEXTURE, r), D.removeEventListener(A.REQUEST_METHOD, a);
|
8216
8327
|
};
|
8217
8328
|
}, []), null;
|
8218
8329
|
}
|
8219
|
-
function
|
8330
|
+
function To(s) {
|
8220
8331
|
return /* @__PURE__ */ u.jsxs("div", { className: "editor", ref: s.ref, style: s.style, children: [
|
8221
8332
|
/* @__PURE__ */ u.jsx("div", { className: "header", children: s.header }),
|
8222
8333
|
s.children,
|
8223
8334
|
/* @__PURE__ */ u.jsx("div", { className: "footer", children: s.footer })
|
8224
8335
|
] });
|
8225
8336
|
}
|
8226
|
-
function
|
8227
|
-
return /* @__PURE__ */ u.jsx(
|
8337
|
+
function Go(s) {
|
8338
|
+
return /* @__PURE__ */ u.jsx(To, { children: /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
8228
8339
|
/* @__PURE__ */ u.jsx(
|
8229
8340
|
me,
|
8230
8341
|
{
|
@@ -8235,60 +8346,61 @@ function ko(s) {
|
|
8235
8346
|
onSceneUpdate: s.onSceneUpdate
|
8236
8347
|
}
|
8237
8348
|
),
|
8238
|
-
/* @__PURE__ */ u.jsx(
|
8349
|
+
/* @__PURE__ */ u.jsx(Oo, { three: s.three })
|
8239
8350
|
] }) });
|
8240
8351
|
}
|
8241
8352
|
export {
|
8242
|
-
|
8243
|
-
|
8244
|
-
|
8245
|
-
|
8246
|
-
|
8247
|
-
|
8248
|
-
|
8249
|
-
|
8250
|
-
|
8251
|
-
|
8252
|
-
|
8253
|
-
|
8254
|
-
|
8255
|
-
|
8353
|
+
oi as Accordion,
|
8354
|
+
Fo as Application,
|
8355
|
+
Wi as BaseRemote,
|
8356
|
+
bn as ChildObject,
|
8357
|
+
Es as ContainerObject,
|
8358
|
+
pr as Draggable,
|
8359
|
+
ur as DraggableItem,
|
8360
|
+
mr as Dropdown,
|
8361
|
+
fr as DropdownItem,
|
8362
|
+
To as Editor,
|
8363
|
+
jo as ElementProxy,
|
8364
|
+
ir as ElementProxyReceiver,
|
8365
|
+
ti as ExportTexture,
|
8366
|
+
wo as Inspector,
|
8256
8367
|
me as MultiView,
|
8257
|
-
|
8258
|
-
|
8259
|
-
|
8260
|
-
|
8261
|
-
|
8262
|
-
|
8263
|
-
|
8264
|
-
|
8265
|
-
|
8266
|
-
|
8267
|
-
|
8268
|
-
|
8269
|
-
|
8368
|
+
yn as NavButton,
|
8369
|
+
No as ProxyManager,
|
8370
|
+
Wa as QualityType,
|
8371
|
+
zo as RemoteComponents,
|
8372
|
+
Zo as RemoteController,
|
8373
|
+
Bo as RemoteTheatre,
|
8374
|
+
Vo as RemoteThree,
|
8375
|
+
Wo as SceneInspector,
|
8376
|
+
Oo as SidePanel,
|
8377
|
+
Vs as Spline,
|
8378
|
+
yo as SplineEditor,
|
8379
|
+
Go as ThreeEditor,
|
8380
|
+
A as ToolEvents,
|
8270
8381
|
ge as Transform,
|
8271
|
-
|
8382
|
+
Uo as WebworkerEventHandlers,
|
8383
|
+
ri as capitalize,
|
8272
8384
|
$e as clamp,
|
8273
|
-
|
8274
|
-
|
8275
|
-
|
8385
|
+
ps as colorToHex,
|
8386
|
+
Na as copyToClipboard,
|
8387
|
+
Yo as customizeTheatreElements,
|
8276
8388
|
D as debugDispatcher,
|
8277
|
-
|
8278
|
-
|
8389
|
+
Do as defaultTheatreCallback,
|
8390
|
+
Ro as detectSettings,
|
8279
8391
|
He as dispose,
|
8280
|
-
|
8281
|
-
|
8282
|
-
|
8283
|
-
|
8284
|
-
|
8285
|
-
|
8286
|
-
|
8287
|
-
|
8288
|
-
|
8289
|
-
|
8290
|
-
|
8291
|
-
|
8292
|
-
|
8293
|
-
|
8392
|
+
Ga as disposeMaterial,
|
8393
|
+
Lo as disposeTexture,
|
8394
|
+
Io as distance,
|
8395
|
+
ji as hierarchyUUID,
|
8396
|
+
za as isColor,
|
8397
|
+
ki as mix,
|
8398
|
+
ai as noop,
|
8399
|
+
_s as normalize,
|
8400
|
+
ko as parseModelLite,
|
8401
|
+
Fa as randomID,
|
8402
|
+
vs as resetThreeObjects,
|
8403
|
+
Pe as round,
|
8404
|
+
Ho as theatreEditorApp,
|
8405
|
+
Ui as totalThreeObjects
|
8294
8406
|
};
|