@tomorrowevening/hermes 0.0.124 → 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 -931
- package/package.json +2 -3
- package/types/index.d.ts +1 -0
- package/types/webworkers/EventHandling.d.ts +8 -0
- package/types/webworkers/ProxyManager.d.ts +1 -0
- 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,7 +529,7 @@ class xo {
|
|
415
529
|
this.targets[e.id]?.handleEvent(e.data);
|
416
530
|
}
|
417
531
|
}
|
418
|
-
class
|
532
|
+
class Fo {
|
419
533
|
components = /* @__PURE__ */ new Map();
|
420
534
|
listen;
|
421
535
|
// Protected
|
@@ -473,9 +587,9 @@ class Oo {
|
|
473
587
|
e && (this._mode = "editor");
|
474
588
|
}
|
475
589
|
}
|
476
|
-
var
|
477
|
-
const D = new
|
478
|
-
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 {
|
479
593
|
app;
|
480
594
|
constructor(e) {
|
481
595
|
this.app = e;
|
@@ -487,7 +601,7 @@ class Bi {
|
|
487
601
|
handleEditor(e, t, i) {
|
488
602
|
}
|
489
603
|
}
|
490
|
-
class
|
604
|
+
class zo extends Wi {
|
491
605
|
selectDropdown(e, t) {
|
492
606
|
this.app.send({
|
493
607
|
event: "selectComponent",
|
@@ -511,15 +625,15 @@ class To extends Bi {
|
|
511
625
|
handleApp(e, t, i) {
|
512
626
|
switch (i.event) {
|
513
627
|
case "selectComponent":
|
514
|
-
D.dispatchEvent({ type:
|
628
|
+
D.dispatchEvent({ type: A.SELECT_DROPDOWN, value: i.data });
|
515
629
|
break;
|
516
630
|
case "draggableListUpdate":
|
517
|
-
D.dispatchEvent({ type:
|
631
|
+
D.dispatchEvent({ type: A.DRAG_UPDATE, value: i.data });
|
518
632
|
break;
|
519
633
|
}
|
520
634
|
}
|
521
635
|
}
|
522
|
-
function
|
636
|
+
function Ho(s, e, t) {
|
523
637
|
if (s.editor) {
|
524
638
|
t.ui.restore(), t.onSelectionChange((a) => {
|
525
639
|
a.length < 1 || a.forEach((o) => {
|
@@ -562,7 +676,7 @@ function Mo(s, e, t) {
|
|
562
676
|
} else
|
563
677
|
t.ui.hide();
|
564
678
|
}
|
565
|
-
function
|
679
|
+
function Yo() {
|
566
680
|
setTimeout(() => {
|
567
681
|
const s = document.getElementById("theatrejs-studio-root");
|
568
682
|
if (s === null || s.shadowRoot === null)
|
@@ -588,7 +702,7 @@ function Ao() {
|
|
588
702
|
}
|
589
703
|
}, 1e3);
|
590
704
|
}
|
591
|
-
class
|
705
|
+
class Bo extends Wi {
|
592
706
|
project;
|
593
707
|
sheets = /* @__PURE__ */ new Map();
|
594
708
|
sheetObjects = /* @__PURE__ */ new Map();
|
@@ -650,16 +764,16 @@ class Po extends Bi {
|
|
650
764
|
return;
|
651
765
|
const c = `${this.getSheetInstance(e, r)}_${t}`;
|
652
766
|
let l = this.sheetObjects.get(c);
|
653
|
-
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);
|
654
768
|
const d = l.onValuesChange((p) => {
|
655
769
|
if (this.app.editor) {
|
656
770
|
for (const f in p) {
|
657
|
-
const
|
658
|
-
typeof
|
659
|
-
r:
|
660
|
-
g:
|
661
|
-
b:
|
662
|
-
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
|
663
777
|
});
|
664
778
|
}
|
665
779
|
this.app.send({
|
@@ -762,7 +876,7 @@ class Po extends Bi {
|
|
762
876
|
this.studio?.ui.hide();
|
763
877
|
}
|
764
878
|
}
|
765
|
-
function
|
879
|
+
function sr(s) {
|
766
880
|
if (s.name === "cameras")
|
767
881
|
return "camera";
|
768
882
|
if (s.name === "interactive")
|
@@ -776,7 +890,7 @@ function Wa(s) {
|
|
776
890
|
const e = s.type;
|
777
891
|
return e.search("Helper") > -1 ? "icon_utils" : e.search("Camera") > -1 ? "camera" : e.search("Light") > -1 ? "light" : "obj3D";
|
778
892
|
}
|
779
|
-
function
|
893
|
+
function pt(s) {
|
780
894
|
const e = {
|
781
895
|
name: s.name,
|
782
896
|
type: s.type,
|
@@ -784,10 +898,10 @@ function ut(s) {
|
|
784
898
|
children: []
|
785
899
|
};
|
786
900
|
return s.children.forEach((t) => {
|
787
|
-
e.children.push(
|
901
|
+
e.children.push(pt(t));
|
788
902
|
}), e;
|
789
903
|
}
|
790
|
-
function
|
904
|
+
function nr(s) {
|
791
905
|
const e = {};
|
792
906
|
for (const t in s) {
|
793
907
|
const i = s[t].value;
|
@@ -803,7 +917,7 @@ function Ga(s) {
|
|
803
917
|
}
|
804
918
|
return e;
|
805
919
|
}
|
806
|
-
function
|
920
|
+
function ar(s) {
|
807
921
|
switch (s) {
|
808
922
|
case "blendSrcAlpha":
|
809
923
|
case "blendDstAlpha":
|
@@ -815,10 +929,10 @@ function Xa(s) {
|
|
815
929
|
}
|
816
930
|
return !1;
|
817
931
|
}
|
818
|
-
function
|
932
|
+
function rt(s) {
|
819
933
|
const e = {};
|
820
934
|
for (const t in s) {
|
821
|
-
if (t.substring(0, 1) === "_" || t.substring(0, 2) === "is" ||
|
935
|
+
if (t.substring(0, 1) === "_" || t.substring(0, 2) === "is" || ar(t))
|
822
936
|
continue;
|
823
937
|
const i = typeof s[t], n = s[t];
|
824
938
|
switch (i) {
|
@@ -829,10 +943,10 @@ function at(s) {
|
|
829
943
|
break;
|
830
944
|
case "object":
|
831
945
|
n !== null ? (e[t] = n, n.isTexture ? e[t] = {
|
832
|
-
src:
|
946
|
+
src: ti.renderToBlob(n),
|
833
947
|
offset: [n.offset.x, n.offset.y],
|
834
948
|
repeat: [n.repeat.x, n.repeat.y]
|
835
|
-
} : t === "uniforms" && (e[t] =
|
949
|
+
} : t === "uniforms" && (e[t] = nr(e[t]))) : t === "glslVersion" ? e[t] = "" : e[t] = {
|
836
950
|
src: "",
|
837
951
|
offset: [0, 0],
|
838
952
|
repeat: [1, 1]
|
@@ -842,7 +956,7 @@ function at(s) {
|
|
842
956
|
}
|
843
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;
|
844
958
|
}
|
845
|
-
function
|
959
|
+
function Ei(s) {
|
846
960
|
s.updateMatrix();
|
847
961
|
const e = {
|
848
962
|
name: s.name,
|
@@ -870,28 +984,28 @@ function yi(s) {
|
|
870
984
|
if (Array.isArray(i.material)) {
|
871
985
|
const n = [];
|
872
986
|
i.material.forEach((r) => {
|
873
|
-
n.push(
|
987
|
+
n.push(rt(r));
|
874
988
|
}), e.material = n;
|
875
989
|
} else
|
876
|
-
e.material =
|
990
|
+
e.material = rt(i.material);
|
877
991
|
} else if (t.search("points") > -1) {
|
878
992
|
const i = s;
|
879
993
|
if (Array.isArray(i.material)) {
|
880
994
|
const n = [];
|
881
995
|
i.material.forEach((r) => {
|
882
|
-
n.push(
|
996
|
+
n.push(rt(r));
|
883
997
|
}), e.material = n;
|
884
998
|
} else
|
885
|
-
e.material =
|
999
|
+
e.material = rt(i.material);
|
886
1000
|
} else if (t.search("line") > -1) {
|
887
1001
|
const i = s;
|
888
1002
|
if (Array.isArray(i.material)) {
|
889
1003
|
const n = [];
|
890
1004
|
i.material.forEach((r) => {
|
891
|
-
n.push(
|
1005
|
+
n.push(rt(r));
|
892
1006
|
}), e.material = n;
|
893
1007
|
} else
|
894
|
-
e.material =
|
1008
|
+
e.material = rt(i.material);
|
895
1009
|
} else
|
896
1010
|
t.search("camera") > -1 ? s.type === "PerspectiveCamera" ? e.perspectiveCameraInfo = {
|
897
1011
|
fov: s.fov,
|
@@ -923,7 +1037,7 @@ function yi(s) {
|
|
923
1037
|
});
|
924
1038
|
return e;
|
925
1039
|
}
|
926
|
-
function
|
1040
|
+
function rr(s, e) {
|
927
1041
|
const t = e.split(".");
|
928
1042
|
switch (t.length) {
|
929
1043
|
case 1:
|
@@ -940,7 +1054,7 @@ function $a(s, e) {
|
|
940
1054
|
return s[t[0]][t[1]][t[2]][t[3]][t[4]][t[5]];
|
941
1055
|
}
|
942
1056
|
}
|
943
|
-
function
|
1057
|
+
function or(s, e) {
|
944
1058
|
for (const t in e)
|
945
1059
|
s[t] = e[t];
|
946
1060
|
}
|
@@ -985,19 +1099,19 @@ function ie(s, e, t) {
|
|
985
1099
|
a = s[i[0]][i[1]][i[2]][i[3]][i[4]];
|
986
1100
|
break;
|
987
1101
|
}
|
988
|
-
a != null &&
|
1102
|
+
a != null && or(a, t);
|
989
1103
|
}
|
990
1104
|
}
|
991
|
-
function
|
1105
|
+
function vn(s) {
|
992
1106
|
return new Promise((e, t) => {
|
993
1107
|
const i = new Image();
|
994
1108
|
i.onload = () => {
|
995
|
-
const n = new
|
996
|
-
n.wrapS =
|
1109
|
+
const n = new $n(i);
|
1110
|
+
n.wrapS = ls, n.wrapT = ls, n.needsUpdate = !0, e(n);
|
997
1111
|
}, i.onerror = t, i.src = s;
|
998
1112
|
});
|
999
1113
|
}
|
1000
|
-
class
|
1114
|
+
class Vo extends Wi {
|
1001
1115
|
canvas = null;
|
1002
1116
|
// Canvas or OffscreenCanvas
|
1003
1117
|
inputElement = null;
|
@@ -1015,15 +1129,15 @@ class Do extends Bi {
|
|
1015
1129
|
}), this.renderTargets.clear(), this.renderer?.dispose();
|
1016
1130
|
}
|
1017
1131
|
getObject(e) {
|
1018
|
-
this.app.debugEnabled && (this.renderer !== void 0 && (
|
1132
|
+
this.app.debugEnabled && (this.renderer !== void 0 && (ti.renderer = this.renderer), this.app.send({
|
1019
1133
|
event: "getObject",
|
1020
1134
|
target: "app",
|
1021
1135
|
data: e
|
1022
1136
|
}));
|
1023
1137
|
}
|
1024
1138
|
setObject(e) {
|
1025
|
-
this.renderer !== void 0 && (
|
1026
|
-
const t =
|
1139
|
+
this.renderer !== void 0 && (ti.renderer = this.renderer);
|
1140
|
+
const t = Ei(e);
|
1027
1141
|
this.app.send({
|
1028
1142
|
event: "setObject",
|
1029
1143
|
target: "editor",
|
@@ -1125,7 +1239,7 @@ class Do extends Bi {
|
|
1125
1239
|
localClippingEnabled: e.localClippingEnabled,
|
1126
1240
|
clearColor: i,
|
1127
1241
|
clearAlpha: e.getClearAlpha(),
|
1128
|
-
colorManagement:
|
1242
|
+
colorManagement: mt.enabled,
|
1129
1243
|
toneMapping: e.toneMapping,
|
1130
1244
|
toneMappingExposure: e.toneMappingExposure
|
1131
1245
|
}
|
@@ -1142,8 +1256,8 @@ class Do extends Bi {
|
|
1142
1256
|
addScene(e) {
|
1143
1257
|
if (e === void 0 || (this.scenes.set(e.name, e), !this.app.debugEnabled))
|
1144
1258
|
return;
|
1145
|
-
|
1146
|
-
const t =
|
1259
|
+
vs(), ji(e);
|
1260
|
+
const t = pt(e);
|
1147
1261
|
this.app.send({
|
1148
1262
|
event: "addScene",
|
1149
1263
|
target: "editor",
|
@@ -1155,7 +1269,7 @@ class Do extends Bi {
|
|
1155
1269
|
return;
|
1156
1270
|
const t = this.scenes.get(e);
|
1157
1271
|
if (t !== void 0) {
|
1158
|
-
const i =
|
1272
|
+
const i = pt(t);
|
1159
1273
|
this.app.send({
|
1160
1274
|
event: "refreshScene",
|
1161
1275
|
target: "app",
|
@@ -1166,7 +1280,7 @@ class Do extends Bi {
|
|
1166
1280
|
removeScene(e) {
|
1167
1281
|
if (e === void 0 || (this.scenes.delete(e.name), !this.app.debugEnabled))
|
1168
1282
|
return;
|
1169
|
-
const t =
|
1283
|
+
const t = pt(e);
|
1170
1284
|
this.app.send({
|
1171
1285
|
event: "removeScene",
|
1172
1286
|
target: "editor",
|
@@ -1185,8 +1299,8 @@ class Do extends Bi {
|
|
1185
1299
|
setScene(e) {
|
1186
1300
|
if (e === void 0 || (this.scene = e, !this.app.debugEnabled))
|
1187
1301
|
return;
|
1188
|
-
this.renderer !== void 0 && (
|
1189
|
-
const t =
|
1302
|
+
this.renderer !== void 0 && (ti.renderer = this.renderer), vs(), ji(e);
|
1303
|
+
const t = pt(e);
|
1190
1304
|
this.app.send({
|
1191
1305
|
event: "setScene",
|
1192
1306
|
target: "editor",
|
@@ -1197,7 +1311,7 @@ class Do extends Bi {
|
|
1197
1311
|
addCamera(e) {
|
1198
1312
|
if (!this.app.debugEnabled)
|
1199
1313
|
return;
|
1200
|
-
const t =
|
1314
|
+
const t = Ei(e);
|
1201
1315
|
this.app.send({
|
1202
1316
|
event: "addCamera",
|
1203
1317
|
target: "editor",
|
@@ -1207,7 +1321,7 @@ class Do extends Bi {
|
|
1207
1321
|
removeCamera(e) {
|
1208
1322
|
if (!this.app.debugEnabled)
|
1209
1323
|
return;
|
1210
|
-
const t =
|
1324
|
+
const t = Ei(e);
|
1211
1325
|
this.app.send({
|
1212
1326
|
event: "removeCamera",
|
1213
1327
|
target: "editor",
|
@@ -1218,26 +1332,26 @@ class Do extends Bi {
|
|
1218
1332
|
const n = t;
|
1219
1333
|
switch (i.event) {
|
1220
1334
|
case "getObject":
|
1221
|
-
D.dispatchEvent({ type:
|
1335
|
+
D.dispatchEvent({ type: A.GET_OBJECT, value: i.data });
|
1222
1336
|
break;
|
1223
1337
|
case "updateObject":
|
1224
|
-
D.dispatchEvent({ type:
|
1338
|
+
D.dispatchEvent({ type: A.UPDATE_OBJECT, value: i.data });
|
1225
1339
|
break;
|
1226
1340
|
case "createTexture":
|
1227
|
-
D.dispatchEvent({ type:
|
1341
|
+
D.dispatchEvent({ type: A.CREATE_TEXTURE, value: i.data });
|
1228
1342
|
break;
|
1229
1343
|
case "requestMethod":
|
1230
|
-
D.dispatchEvent({ type:
|
1344
|
+
D.dispatchEvent({ type: A.REQUEST_METHOD, value: i.data });
|
1231
1345
|
break;
|
1232
1346
|
case "refreshScene":
|
1233
1347
|
e.send({
|
1234
1348
|
event: "refreshScene",
|
1235
1349
|
target: "editor",
|
1236
|
-
data:
|
1350
|
+
data: pt(n.scenes.get(i.data.name))
|
1237
1351
|
});
|
1238
1352
|
break;
|
1239
1353
|
case "updateRenderer":
|
1240
|
-
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);
|
1241
1355
|
break;
|
1242
1356
|
}
|
1243
1357
|
if (i.event === "updateGroup") {
|
@@ -1248,42 +1362,42 @@ class Do extends Bi {
|
|
1248
1362
|
handleEditor(e, t, i) {
|
1249
1363
|
switch (i.event) {
|
1250
1364
|
case "setObject":
|
1251
|
-
D.dispatchEvent({ type:
|
1365
|
+
D.dispatchEvent({ type: A.SET_OBJECT, value: i.data });
|
1252
1366
|
break;
|
1253
1367
|
case "addScene":
|
1254
|
-
D.dispatchEvent({ type:
|
1368
|
+
D.dispatchEvent({ type: A.ADD_SCENE, value: i.data });
|
1255
1369
|
break;
|
1256
1370
|
case "refreshScene":
|
1257
|
-
D.dispatchEvent({ type:
|
1371
|
+
D.dispatchEvent({ type: A.REFRESH_SCENE, value: i.data });
|
1258
1372
|
break;
|
1259
1373
|
case "removeScene":
|
1260
|
-
D.dispatchEvent({ type:
|
1374
|
+
D.dispatchEvent({ type: A.REMOVE_SCENE, value: i.data });
|
1261
1375
|
break;
|
1262
1376
|
case "setScene":
|
1263
|
-
D.dispatchEvent({ type:
|
1377
|
+
D.dispatchEvent({ type: A.SET_SCENE, value: i.data });
|
1264
1378
|
break;
|
1265
1379
|
case "addCamera":
|
1266
|
-
D.dispatchEvent({ type:
|
1380
|
+
D.dispatchEvent({ type: A.ADD_CAMERA, value: i.data });
|
1267
1381
|
break;
|
1268
1382
|
case "removeCamera":
|
1269
|
-
D.dispatchEvent({ type:
|
1383
|
+
D.dispatchEvent({ type: A.REMOVE_CAMERA, value: i.data });
|
1270
1384
|
break;
|
1271
1385
|
case "addGroup":
|
1272
|
-
D.dispatchEvent({ type:
|
1386
|
+
D.dispatchEvent({ type: A.ADD_GROUP, value: i.data });
|
1273
1387
|
break;
|
1274
1388
|
case "removeGroup":
|
1275
|
-
D.dispatchEvent({ type:
|
1389
|
+
D.dispatchEvent({ type: A.REMOVE_GROUP, value: i.data });
|
1276
1390
|
break;
|
1277
1391
|
case "addSpline":
|
1278
|
-
D.dispatchEvent({ type:
|
1392
|
+
D.dispatchEvent({ type: A.ADD_SPLINE, value: i.data });
|
1279
1393
|
break;
|
1280
1394
|
case "addRenderer":
|
1281
|
-
D.dispatchEvent({ type:
|
1395
|
+
D.dispatchEvent({ type: A.ADD_RENDERER, value: i.data });
|
1282
1396
|
}
|
1283
1397
|
}
|
1284
1398
|
// Renderer
|
1285
1399
|
addRT(e, t) {
|
1286
|
-
const i = new
|
1400
|
+
const i = new Kn(32, 32, t);
|
1287
1401
|
i.texture.name = e, this.renderTargets.set(e, i);
|
1288
1402
|
}
|
1289
1403
|
resize(e, t) {
|
@@ -1307,7 +1421,7 @@ class Do extends Bi {
|
|
1307
1421
|
return this.renderer !== void 0 ? this.renderer.domElement.height / this.dpr : 0;
|
1308
1422
|
}
|
1309
1423
|
}
|
1310
|
-
var
|
1424
|
+
var Ni = { exports: {} }, St = {};
|
1311
1425
|
/**
|
1312
1426
|
* @license React
|
1313
1427
|
* react-jsx-runtime.production.min.js
|
@@ -1317,12 +1431,12 @@ var Ui = { exports: {} }, Et = {};
|
|
1317
1431
|
* This source code is licensed under the MIT license found in the
|
1318
1432
|
* LICENSE file in the root directory of this source tree.
|
1319
1433
|
*/
|
1320
|
-
var
|
1321
|
-
function
|
1322
|
-
if (
|
1323
|
-
return
|
1324
|
-
|
1325
|
-
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 };
|
1326
1440
|
function a(o, c, l) {
|
1327
1441
|
var d, p = {}, m = null, f = null;
|
1328
1442
|
l !== void 0 && (m = "" + l), c.key !== void 0 && (m = "" + c.key), c.ref !== void 0 && (f = c.ref);
|
@@ -1333,9 +1447,9 @@ function Ka() {
|
|
1333
1447
|
p[d] === void 0 && (p[d] = c[d]);
|
1334
1448
|
return { $$typeof: e, type: o, key: m, ref: f, props: p, _owner: n.current };
|
1335
1449
|
}
|
1336
|
-
return
|
1450
|
+
return St.Fragment = t, St.jsx = a, St.jsxs = a, St;
|
1337
1451
|
}
|
1338
|
-
var
|
1452
|
+
var wt = {};
|
1339
1453
|
/**
|
1340
1454
|
* @license React
|
1341
1455
|
* react-jsx-runtime.development.js
|
@@ -1345,14 +1459,14 @@ var St = {};
|
|
1345
1459
|
* This source code is licensed under the MIT license found in the
|
1346
1460
|
* LICENSE file in the root directory of this source tree.
|
1347
1461
|
*/
|
1348
|
-
var
|
1349
|
-
function
|
1350
|
-
return
|
1351
|
-
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";
|
1352
1466
|
function T(h) {
|
1353
1467
|
if (h === null || typeof h != "object")
|
1354
1468
|
return null;
|
1355
|
-
var b =
|
1469
|
+
var b = C && h[C] || h[y];
|
1356
1470
|
return typeof b == "function" ? b : null;
|
1357
1471
|
}
|
1358
1472
|
var g = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
@@ -1373,10 +1487,10 @@ function Qa() {
|
|
1373
1487
|
G.unshift("Warning: " + b), Function.prototype.apply.call(console[h], console, G);
|
1374
1488
|
}
|
1375
1489
|
}
|
1376
|
-
var
|
1490
|
+
var E = !1, w = !1, O = !1, L = !1, j = !1, R;
|
1377
1491
|
R = Symbol.for("react.module.reference");
|
1378
1492
|
function B(h) {
|
1379
|
-
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
|
1380
1494
|
// types supported by any Flight configuration anywhere since
|
1381
1495
|
// we don't know which Flight build this will end up being used
|
1382
1496
|
// with.
|
@@ -1437,14 +1551,14 @@ function Qa() {
|
|
1437
1551
|
}
|
1438
1552
|
return null;
|
1439
1553
|
}
|
1440
|
-
var
|
1554
|
+
var q = Object.assign, $ = 0, Ue, he, Ee, se, je, Ne, Fe;
|
1441
1555
|
function W() {
|
1442
1556
|
}
|
1443
1557
|
W.__reactDisabledLog = !0;
|
1444
1558
|
function le() {
|
1445
1559
|
{
|
1446
1560
|
if ($ === 0) {
|
1447
|
-
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;
|
1448
1562
|
var h = {
|
1449
1563
|
configurable: !0,
|
1450
1564
|
enumerable: !0,
|
@@ -1473,25 +1587,25 @@ function Qa() {
|
|
1473
1587
|
writable: !0
|
1474
1588
|
};
|
1475
1589
|
Object.defineProperties(console, {
|
1476
|
-
log:
|
1590
|
+
log: q({}, h, {
|
1477
1591
|
value: Ue
|
1478
1592
|
}),
|
1479
|
-
info:
|
1593
|
+
info: q({}, h, {
|
1480
1594
|
value: he
|
1481
1595
|
}),
|
1482
|
-
warn:
|
1483
|
-
value:
|
1596
|
+
warn: q({}, h, {
|
1597
|
+
value: Ee
|
1484
1598
|
}),
|
1485
|
-
error:
|
1599
|
+
error: q({}, h, {
|
1486
1600
|
value: se
|
1487
1601
|
}),
|
1488
|
-
group:
|
1602
|
+
group: q({}, h, {
|
1489
1603
|
value: je
|
1490
1604
|
}),
|
1491
|
-
groupCollapsed:
|
1605
|
+
groupCollapsed: q({}, h, {
|
1492
1606
|
value: Ne
|
1493
1607
|
}),
|
1494
|
-
groupEnd:
|
1608
|
+
groupEnd: q({}, h, {
|
1495
1609
|
value: Fe
|
1496
1610
|
})
|
1497
1611
|
});
|
@@ -1499,8 +1613,8 @@ function Qa() {
|
|
1499
1613
|
$ < 0 && v("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
1500
1614
|
}
|
1501
1615
|
}
|
1502
|
-
var
|
1503
|
-
function
|
1616
|
+
var yt = g.ReactCurrentDispatcher, it;
|
1617
|
+
function zt(h, b, x) {
|
1504
1618
|
{
|
1505
1619
|
if (it === void 0)
|
1506
1620
|
try {
|
@@ -1513,25 +1627,25 @@ function Qa() {
|
|
1513
1627
|
` + it + h;
|
1514
1628
|
}
|
1515
1629
|
}
|
1516
|
-
var
|
1630
|
+
var ui = !1, Ht;
|
1517
1631
|
{
|
1518
|
-
var
|
1519
|
-
|
1632
|
+
var wn = typeof WeakMap == "function" ? WeakMap : Map;
|
1633
|
+
Ht = new wn();
|
1520
1634
|
}
|
1521
|
-
function
|
1522
|
-
if (!h ||
|
1635
|
+
function Xi(h, b) {
|
1636
|
+
if (!h || ui)
|
1523
1637
|
return "";
|
1524
1638
|
{
|
1525
|
-
var x =
|
1639
|
+
var x = Ht.get(h);
|
1526
1640
|
if (x !== void 0)
|
1527
1641
|
return x;
|
1528
1642
|
}
|
1529
1643
|
var k;
|
1530
|
-
|
1644
|
+
ui = !0;
|
1531
1645
|
var H = Error.prepareStackTrace;
|
1532
1646
|
Error.prepareStackTrace = void 0;
|
1533
1647
|
var G;
|
1534
|
-
G =
|
1648
|
+
G = yt.current, yt.current = null, le();
|
1535
1649
|
try {
|
1536
1650
|
if (b) {
|
1537
1651
|
var F = function() {
|
@@ -1577,65 +1691,65 @@ function Qa() {
|
|
1577
1691
|
if (te--, ne--, ne < 0 || N[te] !== fe[ne]) {
|
1578
1692
|
var we = `
|
1579
1693
|
` + N[te].replace(" at new ", " at ");
|
1580
|
-
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;
|
1581
1695
|
}
|
1582
1696
|
while (te >= 1 && ne >= 0);
|
1583
1697
|
break;
|
1584
1698
|
}
|
1585
1699
|
}
|
1586
1700
|
} finally {
|
1587
|
-
|
1701
|
+
ui = !1, yt.current = G, Te(), Error.prepareStackTrace = H;
|
1588
1702
|
}
|
1589
|
-
var nt = h ? h.displayName || h.name : "",
|
1590
|
-
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;
|
1591
1705
|
}
|
1592
|
-
function
|
1593
|
-
return
|
1706
|
+
function xn(h, b, x) {
|
1707
|
+
return Xi(h, !1);
|
1594
1708
|
}
|
1595
|
-
function
|
1709
|
+
function On(h) {
|
1596
1710
|
var b = h.prototype;
|
1597
1711
|
return !!(b && b.isReactComponent);
|
1598
1712
|
}
|
1599
|
-
function
|
1713
|
+
function Yt(h, b, x) {
|
1600
1714
|
if (h == null)
|
1601
1715
|
return "";
|
1602
1716
|
if (typeof h == "function")
|
1603
|
-
return
|
1717
|
+
return Xi(h, On(h));
|
1604
1718
|
if (typeof h == "string")
|
1605
|
-
return
|
1719
|
+
return zt(h);
|
1606
1720
|
switch (h) {
|
1607
1721
|
case l:
|
1608
|
-
return
|
1722
|
+
return zt("Suspense");
|
1609
1723
|
case d:
|
1610
|
-
return
|
1724
|
+
return zt("SuspenseList");
|
1611
1725
|
}
|
1612
1726
|
if (typeof h == "object")
|
1613
1727
|
switch (h.$$typeof) {
|
1614
1728
|
case c:
|
1615
|
-
return
|
1729
|
+
return xn(h.render);
|
1616
1730
|
case p:
|
1617
|
-
return
|
1731
|
+
return Yt(h.type, b, x);
|
1618
1732
|
case m: {
|
1619
1733
|
var k = h, H = k._payload, G = k._init;
|
1620
1734
|
try {
|
1621
|
-
return
|
1735
|
+
return Yt(G(H), b, x);
|
1622
1736
|
} catch {
|
1623
1737
|
}
|
1624
1738
|
}
|
1625
1739
|
}
|
1626
1740
|
return "";
|
1627
1741
|
}
|
1628
|
-
var
|
1629
|
-
function
|
1742
|
+
var Bt = Object.prototype.hasOwnProperty, $i = {}, Ki = g.ReactDebugCurrentFrame;
|
1743
|
+
function Vt(h) {
|
1630
1744
|
if (h) {
|
1631
|
-
var b = h._owner, x =
|
1632
|
-
|
1745
|
+
var b = h._owner, x = Yt(h.type, h._source, b ? b.type : null);
|
1746
|
+
Ki.setExtraStackFrame(x);
|
1633
1747
|
} else
|
1634
|
-
|
1748
|
+
Ki.setExtraStackFrame(null);
|
1635
1749
|
}
|
1636
|
-
function
|
1750
|
+
function Tn(h, b, x, k, H) {
|
1637
1751
|
{
|
1638
|
-
var G = Function.call.bind(
|
1752
|
+
var G = Function.call.bind(Bt);
|
1639
1753
|
for (var F in h)
|
1640
1754
|
if (G(h, F)) {
|
1641
1755
|
var N = void 0;
|
@@ -1648,67 +1762,67 @@ function Qa() {
|
|
1648
1762
|
} catch (te) {
|
1649
1763
|
N = te;
|
1650
1764
|
}
|
1651
|
-
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));
|
1652
1766
|
}
|
1653
1767
|
}
|
1654
1768
|
}
|
1655
|
-
var
|
1656
|
-
function
|
1657
|
-
return
|
1769
|
+
var Mn = Array.isArray;
|
1770
|
+
function pi(h) {
|
1771
|
+
return Mn(h);
|
1658
1772
|
}
|
1659
|
-
function
|
1773
|
+
function Pn(h) {
|
1660
1774
|
{
|
1661
1775
|
var b = typeof Symbol == "function" && Symbol.toStringTag, x = b && h[Symbol.toStringTag] || h.constructor.name || "Object";
|
1662
1776
|
return x;
|
1663
1777
|
}
|
1664
1778
|
}
|
1665
|
-
function
|
1779
|
+
function An(h) {
|
1666
1780
|
try {
|
1667
|
-
return
|
1781
|
+
return qi(h), !1;
|
1668
1782
|
} catch {
|
1669
1783
|
return !0;
|
1670
1784
|
}
|
1671
1785
|
}
|
1672
|
-
function
|
1786
|
+
function qi(h) {
|
1673
1787
|
return "" + h;
|
1674
1788
|
}
|
1675
|
-
function
|
1676
|
-
if (
|
1677
|
-
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);
|
1678
1792
|
}
|
1679
|
-
var
|
1793
|
+
var bt = g.ReactCurrentOwner, Dn = {
|
1680
1794
|
key: !0,
|
1681
1795
|
ref: !0,
|
1682
1796
|
__self: !0,
|
1683
1797
|
__source: !0
|
1684
|
-
},
|
1685
|
-
|
1686
|
-
function
|
1687
|
-
if (
|
1798
|
+
}, Ji, es, mi;
|
1799
|
+
mi = {};
|
1800
|
+
function Rn(h) {
|
1801
|
+
if (Bt.call(h, "ref")) {
|
1688
1802
|
var b = Object.getOwnPropertyDescriptor(h, "ref").get;
|
1689
1803
|
if (b && b.isReactWarning)
|
1690
1804
|
return !1;
|
1691
1805
|
}
|
1692
1806
|
return h.ref !== void 0;
|
1693
1807
|
}
|
1694
|
-
function
|
1695
|
-
if (
|
1808
|
+
function In(h) {
|
1809
|
+
if (Bt.call(h, "key")) {
|
1696
1810
|
var b = Object.getOwnPropertyDescriptor(h, "key").get;
|
1697
1811
|
if (b && b.isReactWarning)
|
1698
1812
|
return !1;
|
1699
1813
|
}
|
1700
1814
|
return h.key !== void 0;
|
1701
1815
|
}
|
1702
|
-
function
|
1703
|
-
if (typeof h.ref == "string" &&
|
1704
|
-
var x = re(
|
1705
|
-
|
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);
|
1706
1820
|
}
|
1707
1821
|
}
|
1708
|
-
function
|
1822
|
+
function kn(h, b) {
|
1709
1823
|
{
|
1710
1824
|
var x = function() {
|
1711
|
-
|
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));
|
1712
1826
|
};
|
1713
1827
|
x.isReactWarning = !0, Object.defineProperty(h, "key", {
|
1714
1828
|
get: x,
|
@@ -1716,10 +1830,10 @@ function Qa() {
|
|
1716
1830
|
});
|
1717
1831
|
}
|
1718
1832
|
}
|
1719
|
-
function
|
1833
|
+
function Un(h, b) {
|
1720
1834
|
{
|
1721
1835
|
var x = function() {
|
1722
|
-
|
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));
|
1723
1837
|
};
|
1724
1838
|
x.isReactWarning = !0, Object.defineProperty(h, "ref", {
|
1725
1839
|
get: x,
|
@@ -1727,7 +1841,7 @@ function Qa() {
|
|
1727
1841
|
});
|
1728
1842
|
}
|
1729
1843
|
}
|
1730
|
-
var
|
1844
|
+
var jn = function(h, b, x, k, H, G, F) {
|
1731
1845
|
var N = {
|
1732
1846
|
// This tag allows us to uniquely identify this as a React Element
|
1733
1847
|
$$typeof: e,
|
@@ -1756,12 +1870,12 @@ function Qa() {
|
|
1756
1870
|
value: H
|
1757
1871
|
}), Object.freeze && (Object.freeze(N.props), Object.freeze(N)), N;
|
1758
1872
|
};
|
1759
|
-
function
|
1873
|
+
function Nn(h, b, x, k, H) {
|
1760
1874
|
{
|
1761
1875
|
var G, F = {}, N = null, fe = null;
|
1762
|
-
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));
|
1763
1877
|
for (G in b)
|
1764
|
-
|
1878
|
+
Bt.call(b, G) && !Dn.hasOwnProperty(G) && (F[G] = b[G]);
|
1765
1879
|
if (h && h.defaultProps) {
|
1766
1880
|
var te = h.defaultProps;
|
1767
1881
|
for (G in te)
|
@@ -1769,28 +1883,28 @@ function Qa() {
|
|
1769
1883
|
}
|
1770
1884
|
if (N || fe) {
|
1771
1885
|
var ne = typeof h == "function" ? h.displayName || h.name || "Unknown" : h;
|
1772
|
-
N &&
|
1886
|
+
N && kn(F, ne), fe && Un(F, ne);
|
1773
1887
|
}
|
1774
|
-
return
|
1888
|
+
return jn(h, N, fe, H, k, bt.current, F);
|
1775
1889
|
}
|
1776
1890
|
}
|
1777
|
-
var
|
1891
|
+
var fi = g.ReactCurrentOwner, ts = g.ReactDebugCurrentFrame;
|
1778
1892
|
function st(h) {
|
1779
1893
|
if (h) {
|
1780
|
-
var b = h._owner, x =
|
1781
|
-
|
1894
|
+
var b = h._owner, x = Yt(h.type, h._source, b ? b.type : null);
|
1895
|
+
ts.setExtraStackFrame(x);
|
1782
1896
|
} else
|
1783
|
-
|
1897
|
+
ts.setExtraStackFrame(null);
|
1784
1898
|
}
|
1785
|
-
var
|
1786
|
-
|
1787
|
-
function
|
1899
|
+
var gi;
|
1900
|
+
gi = !1;
|
1901
|
+
function _i(h) {
|
1788
1902
|
return typeof h == "object" && h !== null && h.$$typeof === e;
|
1789
1903
|
}
|
1790
|
-
function
|
1904
|
+
function is() {
|
1791
1905
|
{
|
1792
|
-
if (
|
1793
|
-
var h = re(
|
1906
|
+
if (fi.current) {
|
1907
|
+
var h = re(fi.current.type);
|
1794
1908
|
if (h)
|
1795
1909
|
return `
|
1796
1910
|
|
@@ -1799,7 +1913,7 @@ Check the render method of \`` + h + "`.";
|
|
1799
1913
|
return "";
|
1800
1914
|
}
|
1801
1915
|
}
|
1802
|
-
function
|
1916
|
+
function Fn(h) {
|
1803
1917
|
{
|
1804
1918
|
if (h !== void 0) {
|
1805
1919
|
var b = h.fileName.replace(/^.*[\\\/]/, ""), x = h.lineNumber;
|
@@ -1810,10 +1924,10 @@ Check your code at ` + b + ":" + x + ".";
|
|
1810
1924
|
return "";
|
1811
1925
|
}
|
1812
1926
|
}
|
1813
|
-
var
|
1814
|
-
function
|
1927
|
+
var ss = {};
|
1928
|
+
function zn(h) {
|
1815
1929
|
{
|
1816
|
-
var b =
|
1930
|
+
var b = is();
|
1817
1931
|
if (!b) {
|
1818
1932
|
var x = typeof h == "string" ? h : h.displayName || h.name;
|
1819
1933
|
x && (b = `
|
@@ -1823,39 +1937,39 @@ Check the top-level render call using <` + x + ">.");
|
|
1823
1937
|
return b;
|
1824
1938
|
}
|
1825
1939
|
}
|
1826
|
-
function
|
1940
|
+
function ns(h, b) {
|
1827
1941
|
{
|
1828
1942
|
if (!h._store || h._store.validated || h.key != null)
|
1829
1943
|
return;
|
1830
1944
|
h._store.validated = !0;
|
1831
|
-
var x =
|
1832
|
-
if (
|
1945
|
+
var x = zn(b);
|
1946
|
+
if (ss[x])
|
1833
1947
|
return;
|
1834
|
-
|
1948
|
+
ss[x] = !0;
|
1835
1949
|
var k = "";
|
1836
|
-
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);
|
1837
1951
|
}
|
1838
1952
|
}
|
1839
|
-
function
|
1953
|
+
function as(h, b) {
|
1840
1954
|
{
|
1841
1955
|
if (typeof h != "object")
|
1842
1956
|
return;
|
1843
|
-
if (
|
1957
|
+
if (pi(h))
|
1844
1958
|
for (var x = 0; x < h.length; x++) {
|
1845
1959
|
var k = h[x];
|
1846
|
-
|
1960
|
+
_i(k) && ns(k, b);
|
1847
1961
|
}
|
1848
|
-
else if (
|
1962
|
+
else if (_i(h))
|
1849
1963
|
h._store && (h._store.validated = !0);
|
1850
1964
|
else if (h) {
|
1851
1965
|
var H = T(h);
|
1852
1966
|
if (typeof H == "function" && H !== h.entries)
|
1853
1967
|
for (var G = H.call(h), F; !(F = G.next()).done; )
|
1854
|
-
|
1968
|
+
_i(F.value) && ns(F.value, b);
|
1855
1969
|
}
|
1856
1970
|
}
|
1857
1971
|
}
|
1858
|
-
function
|
1972
|
+
function Hn(h) {
|
1859
1973
|
{
|
1860
1974
|
var b = h.type;
|
1861
1975
|
if (b == null || typeof b == "string")
|
@@ -1871,16 +1985,16 @@ Check the top-level render call using <` + x + ">.");
|
|
1871
1985
|
return;
|
1872
1986
|
if (x) {
|
1873
1987
|
var k = re(b);
|
1874
|
-
|
1875
|
-
} else if (b.PropTypes !== void 0 && !
|
1876
|
-
|
1988
|
+
Tn(x, h.props, "prop", k, h);
|
1989
|
+
} else if (b.PropTypes !== void 0 && !gi) {
|
1990
|
+
gi = !0;
|
1877
1991
|
var H = re(b);
|
1878
1992
|
v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", H || "Unknown");
|
1879
1993
|
}
|
1880
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.");
|
1881
1995
|
}
|
1882
1996
|
}
|
1883
|
-
function
|
1997
|
+
function Yn(h) {
|
1884
1998
|
{
|
1885
1999
|
for (var b = Object.keys(h.props), x = 0; x < b.length; x++) {
|
1886
2000
|
var k = b[x];
|
@@ -1892,56 +2006,56 @@ Check the top-level render call using <` + x + ">.");
|
|
1892
2006
|
h.ref !== null && (st(h), v("Invalid attribute `ref` supplied to `React.Fragment`."), st(null));
|
1893
2007
|
}
|
1894
2008
|
}
|
1895
|
-
function
|
2009
|
+
function rs(h, b, x, k, H, G) {
|
1896
2010
|
{
|
1897
2011
|
var F = B(h);
|
1898
2012
|
if (!F) {
|
1899
2013
|
var N = "";
|
1900
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.");
|
1901
|
-
var fe =
|
1902
|
-
fe ? N += fe : N +=
|
2015
|
+
var fe = Fn(H);
|
2016
|
+
fe ? N += fe : N += is();
|
1903
2017
|
var te;
|
1904
|
-
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);
|
1905
2019
|
}
|
1906
|
-
var ne =
|
2020
|
+
var ne = Nn(h, b, x, H, G);
|
1907
2021
|
if (ne == null)
|
1908
2022
|
return ne;
|
1909
2023
|
if (F) {
|
1910
2024
|
var we = b.children;
|
1911
2025
|
if (we !== void 0)
|
1912
2026
|
if (k)
|
1913
|
-
if (
|
2027
|
+
if (pi(we)) {
|
1914
2028
|
for (var nt = 0; nt < we.length; nt++)
|
1915
|
-
|
2029
|
+
as(we[nt], h);
|
1916
2030
|
Object.freeze && Object.freeze(we);
|
1917
2031
|
} else
|
1918
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.");
|
1919
2033
|
else
|
1920
|
-
|
2034
|
+
as(we, h);
|
1921
2035
|
}
|
1922
|
-
return h === i ?
|
2036
|
+
return h === i ? Yn(ne) : Hn(ne), ne;
|
1923
2037
|
}
|
1924
2038
|
}
|
1925
|
-
function
|
1926
|
-
return
|
2039
|
+
function Bn(h, b, x) {
|
2040
|
+
return rs(h, b, x, !0);
|
1927
2041
|
}
|
1928
|
-
function
|
1929
|
-
return
|
2042
|
+
function Vn(h, b, x) {
|
2043
|
+
return rs(h, b, x, !1);
|
1930
2044
|
}
|
1931
|
-
var
|
1932
|
-
|
1933
|
-
}()),
|
2045
|
+
var Zn = Vn, Wn = Bn;
|
2046
|
+
wt.Fragment = i, wt.jsx = Zn, wt.jsxs = Wn;
|
2047
|
+
}()), wt;
|
1934
2048
|
}
|
1935
|
-
process.env.NODE_ENV === "production" ?
|
1936
|
-
var u =
|
1937
|
-
function
|
2049
|
+
process.env.NODE_ENV === "production" ? Ni.exports = lr() : Ni.exports = cr();
|
2050
|
+
var u = Ni.exports;
|
2051
|
+
function yn(s) {
|
1938
2052
|
return s.title.search("<") > -1 ? /* @__PURE__ */ u.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: s.title } }) : /* @__PURE__ */ u.jsx("button", { children: s.title });
|
1939
2053
|
}
|
1940
|
-
const
|
2054
|
+
const hr = /* @__PURE__ */ u.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
|
1941
2055
|
/* @__PURE__ */ u.jsx("circle", { cx: "7", cy: "7", r: "6" }),
|
1942
2056
|
/* @__PURE__ */ u.jsx("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
|
1943
2057
|
/* @__PURE__ */ u.jsx("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
|
1944
|
-
] }),
|
2058
|
+
] }), dr = /* @__PURE__ */ u.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ u.jsx(
|
1945
2059
|
"path",
|
1946
2060
|
{
|
1947
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
|
@@ -1949,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
|
|
1949
2063
|
C11,8.22,10.74,8,10.43,8z`
|
1950
2064
|
}
|
1951
2065
|
) });
|
1952
|
-
function
|
1953
|
-
return /* @__PURE__ */ u.jsx(
|
1954
|
-
|
2066
|
+
function ur(s) {
|
2067
|
+
return /* @__PURE__ */ u.jsx(gn.Item, { value: s.title, children: /* @__PURE__ */ u.jsxs("div", { children: [
|
2068
|
+
dr,
|
1955
2069
|
/* @__PURE__ */ u.jsx("span", { children: s.title }),
|
1956
2070
|
/* @__PURE__ */ u.jsx("button", { className: "closeIcon", onClick: () => {
|
1957
2071
|
s.onDelete(s.index);
|
1958
|
-
}, children:
|
2072
|
+
}, children: hr })
|
1959
2073
|
] }) }, s.title);
|
1960
2074
|
}
|
1961
|
-
function
|
2075
|
+
function pr(s) {
|
1962
2076
|
const [e, t] = Z(!1), [i, n] = Z(s.options), r = (l) => {
|
1963
2077
|
s.onDragComplete(l), n(l);
|
1964
2078
|
}, a = (l) => {
|
@@ -1966,18 +2080,18 @@ function ir(s) {
|
|
1966
2080
|
d.splice(l, 1), r(d);
|
1967
2081
|
}, o = [];
|
1968
2082
|
i.forEach((l, d) => {
|
1969
|
-
o.push(/* @__PURE__ */ u.jsx(
|
2083
|
+
o.push(/* @__PURE__ */ u.jsx(ur, { index: d, title: l, onDelete: a }, l));
|
1970
2084
|
});
|
1971
2085
|
let c = "dropdown draggable";
|
1972
2086
|
return s.subdropdown && (c += " subdropdown"), /* @__PURE__ */ u.jsxs("div", { className: c, onMouseEnter: () => t(!0), onMouseLeave: () => t(!1), children: [
|
1973
|
-
/* @__PURE__ */ u.jsx(
|
1974
|
-
/* @__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 })
|
1975
2089
|
] });
|
1976
2090
|
}
|
1977
|
-
function
|
2091
|
+
function mr(s) {
|
1978
2092
|
const [e, t] = Z(!1), i = [];
|
1979
2093
|
s.options.map((r, a) => {
|
1980
|
-
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));
|
1981
2095
|
});
|
1982
2096
|
let n = "dropdown";
|
1983
2097
|
return s.subdropdown && (n += " subdropdown"), /* @__PURE__ */ u.jsxs(
|
@@ -1987,7 +2101,7 @@ function sr(s) {
|
|
1987
2101
|
onMouseEnter: () => t(!0),
|
1988
2102
|
onMouseLeave: () => t(!1),
|
1989
2103
|
children: [
|
1990
|
-
/* @__PURE__ */ u.jsx(
|
2104
|
+
/* @__PURE__ */ u.jsx(yn, { title: s.title }),
|
1991
2105
|
/* @__PURE__ */ u.jsx(
|
1992
2106
|
"ul",
|
1993
2107
|
{
|
@@ -1999,13 +2113,13 @@ function sr(s) {
|
|
1999
2113
|
}
|
2000
2114
|
);
|
2001
2115
|
}
|
2002
|
-
function
|
2116
|
+
function fr(s) {
|
2003
2117
|
const { option: e } = s, [t, i] = Z("");
|
2004
2118
|
let n;
|
2005
2119
|
switch (e.type) {
|
2006
2120
|
case "draggable":
|
2007
2121
|
n = /* @__PURE__ */ u.jsx(
|
2008
|
-
|
2122
|
+
pr,
|
2009
2123
|
{
|
2010
2124
|
title: e.title,
|
2011
2125
|
options: e.value,
|
@@ -2018,7 +2132,7 @@ function nr(s) {
|
|
2018
2132
|
break;
|
2019
2133
|
case "dropdown":
|
2020
2134
|
n = /* @__PURE__ */ u.jsx(
|
2021
|
-
|
2135
|
+
mr,
|
2022
2136
|
{
|
2023
2137
|
title: e.title,
|
2024
2138
|
options: e.value,
|
@@ -2039,15 +2153,15 @@ function nr(s) {
|
|
2039
2153
|
);
|
2040
2154
|
break;
|
2041
2155
|
}
|
2042
|
-
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());
|
2043
2157
|
}
|
2044
|
-
function
|
2158
|
+
function Zo(s, e, t) {
|
2045
2159
|
function i(r) {
|
2046
2160
|
switch (e.forEach((a) => {
|
2047
2161
|
a.callback(s, a.remote, r);
|
2048
2162
|
}), r.event) {
|
2049
2163
|
case "custom":
|
2050
|
-
D.dispatchEvent({ type:
|
2164
|
+
D.dispatchEvent({ type: A.CUSTOM, value: r.data });
|
2051
2165
|
break;
|
2052
2166
|
}
|
2053
2167
|
}
|
@@ -2056,7 +2170,7 @@ function Ro(s, e, t) {
|
|
2056
2170
|
a.callback(s, a.remote, r);
|
2057
2171
|
}), r.event) {
|
2058
2172
|
case "custom":
|
2059
|
-
D.dispatchEvent({ type:
|
2173
|
+
D.dispatchEvent({ type: A.CUSTOM, value: r.data });
|
2060
2174
|
break;
|
2061
2175
|
}
|
2062
2176
|
}
|
@@ -2064,9 +2178,9 @@ function Ro(s, e, t) {
|
|
2064
2178
|
r.target === "editor" ? n(r) : i(r);
|
2065
2179
|
};
|
2066
2180
|
}
|
2067
|
-
function
|
2181
|
+
function oi(s) {
|
2068
2182
|
const [e, t] = Z(s.open !== void 0 ? s.open : !0), i = !e || s.children === void 0, n = () => {
|
2069
|
-
D.dispatchEvent({ type:
|
2183
|
+
D.dispatchEvent({ type: A.REMOVE_SCENE, value: s.scene });
|
2070
2184
|
};
|
2071
2185
|
return /* @__PURE__ */ u.jsxs("div", { className: `accordion ${i ? "hide" : ""}`, children: [
|
2072
2186
|
/* @__PURE__ */ u.jsxs(
|
@@ -2085,7 +2199,7 @@ function ri(s) {
|
|
2085
2199
|
children: "Toggle"
|
2086
2200
|
}
|
2087
2201
|
),
|
2088
|
-
/* @__PURE__ */ u.jsx("p", { className: "label", children:
|
2202
|
+
/* @__PURE__ */ u.jsx("p", { className: "label", children: ri(s.label) })
|
2089
2203
|
]
|
2090
2204
|
}
|
2091
2205
|
),
|
@@ -2097,10 +2211,10 @@ function ri(s) {
|
|
2097
2211
|
/* @__PURE__ */ u.jsx("div", { className: e ? "open" : "", children: /* @__PURE__ */ u.jsx("div", { children: s.children }) }, Math.random())
|
2098
2212
|
] });
|
2099
2213
|
}
|
2100
|
-
function
|
2214
|
+
function bn(s) {
|
2101
2215
|
const e = J(null), [t, i] = Z(!1), n = s.child !== void 0 && s.child.children.length > 0, r = [];
|
2102
2216
|
return s.child !== void 0 && s.child.children.length > 0 && s.child.children.map((a, o) => {
|
2103
|
-
r.push(/* @__PURE__ */ u.jsx(
|
2217
|
+
r.push(/* @__PURE__ */ u.jsx(bn, { child: a, three: s.three }, o));
|
2104
2218
|
}), tt(() => {
|
2105
2219
|
if (s.child) {
|
2106
2220
|
const a = s.three.getScene(s.child.uuid);
|
@@ -2155,18 +2269,18 @@ function _n(s) {
|
|
2155
2269
|
}
|
2156
2270
|
}
|
2157
2271
|
),
|
2158
|
-
/* @__PURE__ */ u.jsx("div", { className: `icon ${
|
2272
|
+
/* @__PURE__ */ u.jsx("div", { className: `icon ${sr(s.child)}` })
|
2159
2273
|
] }),
|
2160
2274
|
/* @__PURE__ */ u.jsx("div", { className: t ? "open" : "", children: /* @__PURE__ */ u.jsx("div", { className: "container", children: r }) })
|
2161
2275
|
] }, Math.random()) });
|
2162
2276
|
}
|
2163
|
-
function
|
2277
|
+
function Es(s) {
|
2164
2278
|
const e = [];
|
2165
2279
|
return s.child?.children.map((t, i) => {
|
2166
|
-
e.push(/* @__PURE__ */ u.jsx(
|
2280
|
+
e.push(/* @__PURE__ */ u.jsx(bn, { child: t, scene: s.scene, three: s.three }, i));
|
2167
2281
|
}), /* @__PURE__ */ u.jsx("div", { className: `scene ${s.class !== void 0 ? s.class : ""}`, children: e });
|
2168
2282
|
}
|
2169
|
-
function
|
2283
|
+
function It(s) {
|
2170
2284
|
const [e, t] = Z(s.defaultValue);
|
2171
2285
|
return tt(() => {
|
2172
2286
|
let i = !1, n = -1, r = 0, a = s.defaultValue, o = !1;
|
@@ -2177,13 +2291,13 @@ function Rt(s) {
|
|
2177
2291
|
}, d = (f) => {
|
2178
2292
|
if (!i)
|
2179
2293
|
return;
|
2180
|
-
const
|
2294
|
+
const C = s.step !== void 0 ? s.step : 1, y = (f.clientX - n) * C * (o ? 10 : 1);
|
2181
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);
|
2182
2296
|
}, p = () => {
|
2183
2297
|
i = !1, document.removeEventListener("mouseup", p), document.removeEventListener("mousemove", d), document.removeEventListener("contextmenu", p);
|
2184
2298
|
}, m = (f) => {
|
2185
|
-
const
|
2186
|
-
s.onChange !== void 0 && s.onChange(
|
2299
|
+
const C = Number(f.target.value);
|
2300
|
+
s.onChange !== void 0 && s.onChange(C), t(C);
|
2187
2301
|
};
|
2188
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), () => {
|
2189
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);
|
@@ -2192,7 +2306,7 @@ function Rt(s) {
|
|
2192
2306
|
}
|
2193
2307
|
function Qe(s) {
|
2194
2308
|
const e = J(null), t = J(null), [i, n] = Z(s.value);
|
2195
|
-
return
|
2309
|
+
return It({
|
2196
2310
|
label: s.labelRef,
|
2197
2311
|
input: e,
|
2198
2312
|
sliderRef: t,
|
@@ -2251,18 +2365,18 @@ function Qe(s) {
|
|
2251
2365
|
max: s.max,
|
2252
2366
|
step: s.step,
|
2253
2367
|
ref: t,
|
2254
|
-
onChange:
|
2368
|
+
onChange: ai
|
2255
2369
|
}
|
2256
2370
|
)
|
2257
2371
|
] })
|
2258
2372
|
] });
|
2259
2373
|
}
|
2260
|
-
function
|
2261
|
-
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({
|
2262
2376
|
min: Math.min(s.min, Math.min(s.value.x, s.value.y)),
|
2263
2377
|
max: Math.max(s.max, Math.max(s.value.x, s.value.y))
|
2264
2378
|
}), [g, v] = Z(!1);
|
2265
|
-
|
2379
|
+
It({
|
2266
2380
|
label: o,
|
2267
2381
|
input: e,
|
2268
2382
|
defaultValue: p,
|
@@ -2272,7 +2386,7 @@ function ar(s) {
|
|
2272
2386
|
onChange: (R) => {
|
2273
2387
|
m(R), s.onChange({ target: { value: { x: R, y: f } } });
|
2274
2388
|
}
|
2275
|
-
}),
|
2389
|
+
}), It({
|
2276
2390
|
label: c,
|
2277
2391
|
input: t,
|
2278
2392
|
defaultValue: f,
|
@@ -2280,9 +2394,9 @@ function ar(s) {
|
|
2280
2394
|
max: y.max,
|
2281
2395
|
step: 0.01,
|
2282
2396
|
onChange: (R) => {
|
2283
|
-
|
2397
|
+
C(R), s.onChange({ target: { value: { x: p, y: R } } });
|
2284
2398
|
}
|
2285
|
-
}),
|
2399
|
+
}), It({
|
2286
2400
|
label: l,
|
2287
2401
|
input: i,
|
2288
2402
|
defaultValue: y.min,
|
@@ -2292,7 +2406,7 @@ function ar(s) {
|
|
2292
2406
|
onChange: (R) => {
|
2293
2407
|
T({ min: R, max: y.max });
|
2294
2408
|
}
|
2295
|
-
}),
|
2409
|
+
}), It({
|
2296
2410
|
label: d,
|
2297
2411
|
input: n,
|
2298
2412
|
defaultValue: y.max,
|
@@ -2304,25 +2418,25 @@ function ar(s) {
|
|
2304
2418
|
}
|
2305
2419
|
});
|
2306
2420
|
function S() {
|
2307
|
-
g || (window.addEventListener("mousemove", w), window.addEventListener("mouseup",
|
2421
|
+
g || (window.addEventListener("mousemove", w), window.addEventListener("mouseup", E), v(!0));
|
2308
2422
|
}
|
2309
|
-
function
|
2310
|
-
window.removeEventListener("mousemove", w), window.removeEventListener("mouseup",
|
2423
|
+
function E() {
|
2424
|
+
window.removeEventListener("mousemove", w), window.removeEventListener("mouseup", E), v(!1);
|
2311
2425
|
}
|
2312
2426
|
function w(R) {
|
2313
|
-
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 =
|
2314
|
-
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);
|
2315
2429
|
}
|
2316
2430
|
function O() {
|
2317
2431
|
const R = Number(i.current.value);
|
2318
|
-
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));
|
2319
2433
|
}
|
2320
2434
|
function L() {
|
2321
2435
|
const R = Number(n.current.value);
|
2322
|
-
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));
|
2323
2437
|
}
|
2324
2438
|
tt(() => {
|
2325
|
-
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}%`;
|
2326
2440
|
}, [y, p, f]);
|
2327
2441
|
const j = s.step !== void 0 ? s.step : 0.01;
|
2328
2442
|
return /* @__PURE__ */ u.jsxs("div", { className: "vector2", children: [
|
@@ -2359,7 +2473,7 @@ function ar(s) {
|
|
2359
2473
|
max: y.max,
|
2360
2474
|
step: j,
|
2361
2475
|
onChange: (R) => {
|
2362
|
-
if (
|
2476
|
+
if (C(R.target.value), R.target.value.length === 0)
|
2363
2477
|
return;
|
2364
2478
|
const B = Number(R.target.value);
|
2365
2479
|
isNaN(B) || (s.onChange({ target: { value: { x: p, y: B } } }), B > y.max && T({ min: y.min, max: B }));
|
@@ -2394,30 +2508,30 @@ function ar(s) {
|
|
2394
2508
|
)
|
2395
2509
|
] })
|
2396
2510
|
] }),
|
2397
|
-
/* @__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: [
|
2398
2512
|
/* @__PURE__ */ u.jsx("div", { className: "x" }),
|
2399
2513
|
/* @__PURE__ */ u.jsx("div", { className: "y" }),
|
2400
2514
|
/* @__PURE__ */ u.jsx("div", { className: "pt", ref: a })
|
2401
2515
|
] })
|
2402
2516
|
] });
|
2403
2517
|
}
|
2404
|
-
const
|
2405
|
-
function
|
2518
|
+
const _r = Math.PI / 180, vr = 180 / Math.PI;
|
2519
|
+
function ot(s, e, t, i, n) {
|
2406
2520
|
return i + (s - e) * (n - i) / (t - e);
|
2407
2521
|
}
|
2408
|
-
function
|
2522
|
+
function lt(s, e, t) {
|
2409
2523
|
return (1 - t) * s + t * e;
|
2410
2524
|
}
|
2411
|
-
function
|
2412
|
-
return s *
|
2525
|
+
function Fi(s) {
|
2526
|
+
return s * _r;
|
2413
2527
|
}
|
2414
|
-
function
|
2415
|
-
return s *
|
2528
|
+
function yr(s) {
|
2529
|
+
return s * vr;
|
2416
2530
|
}
|
2417
|
-
function
|
2531
|
+
function Cs(s) {
|
2418
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 = [];
|
2419
2533
|
if (t) {
|
2420
|
-
const a =
|
2534
|
+
const a = jt(() => s.value, []);
|
2421
2535
|
["_x", "_y", "_z"].forEach((c) => {
|
2422
2536
|
const l = J(null);
|
2423
2537
|
r.push(
|
@@ -2426,13 +2540,13 @@ function ys(s) {
|
|
2426
2540
|
/* @__PURE__ */ u.jsx(
|
2427
2541
|
Qe,
|
2428
2542
|
{
|
2429
|
-
value:
|
2543
|
+
value: yr(a[c]),
|
2430
2544
|
type: "number",
|
2431
2545
|
prop: c,
|
2432
2546
|
step: 0.1,
|
2433
2547
|
labelRef: l,
|
2434
2548
|
onChange: (d, p) => {
|
2435
|
-
a[d] =
|
2549
|
+
a[d] = Fi(p), s.onChange({ target: { value: a } });
|
2436
2550
|
}
|
2437
2551
|
}
|
2438
2552
|
)
|
@@ -2440,7 +2554,7 @@ function ys(s) {
|
|
2440
2554
|
);
|
2441
2555
|
});
|
2442
2556
|
} else if (e) {
|
2443
|
-
const a =
|
2557
|
+
const a = jt(() => s.value, []), o = (l, d) => {
|
2444
2558
|
a[l] = d, s.onChange({ target: { value: a } });
|
2445
2559
|
};
|
2446
2560
|
["x", "y", "z"].forEach((l) => {
|
@@ -2463,7 +2577,7 @@ function ys(s) {
|
|
2463
2577
|
);
|
2464
2578
|
});
|
2465
2579
|
} else if (i) {
|
2466
|
-
const a =
|
2580
|
+
const a = jt(() => s.value, []), o = (c, l) => {
|
2467
2581
|
const d = Number(c);
|
2468
2582
|
a.elements[d] = l, s.onChange({ target: { value: a } });
|
2469
2583
|
};
|
@@ -2489,10 +2603,10 @@ function ys(s) {
|
|
2489
2603
|
}
|
2490
2604
|
return /* @__PURE__ */ u.jsx("div", { className: "grid3", children: r }, Math.random().toString());
|
2491
2605
|
}
|
2492
|
-
function
|
2606
|
+
function br(s) {
|
2493
2607
|
const e = s.value.x !== void 0, t = s.step !== void 0 ? s.step : 0.01, i = [];
|
2494
2608
|
if (e) {
|
2495
|
-
const n =
|
2609
|
+
const n = jt(() => s.value, []), r = (o, c) => {
|
2496
2610
|
n[o] = c, s.onChange({ target: { value: n } });
|
2497
2611
|
};
|
2498
2612
|
["x", "y", "z", "w"].forEach((o) => {
|
@@ -2515,7 +2629,7 @@ function cr(s) {
|
|
2515
2629
|
);
|
2516
2630
|
});
|
2517
2631
|
} else {
|
2518
|
-
const n =
|
2632
|
+
const n = jt(() => s.value, []), r = (a, o) => {
|
2519
2633
|
const c = Number(a);
|
2520
2634
|
n.elements[c] = o, s.onChange({ target: { value: n } });
|
2521
2635
|
};
|
@@ -2541,10 +2655,10 @@ function cr(s) {
|
|
2541
2655
|
}
|
2542
2656
|
return /* @__PURE__ */ u.jsx("div", { className: "grid4", children: i });
|
2543
2657
|
}
|
2544
|
-
function
|
2658
|
+
function Er(s) {
|
2545
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");
|
2546
2660
|
}
|
2547
|
-
function
|
2661
|
+
function Cr(s) {
|
2548
2662
|
switch (s) {
|
2549
2663
|
case "Alpha Map":
|
2550
2664
|
return "alphaMap";
|
@@ -2593,7 +2707,7 @@ function dr(s) {
|
|
2593
2707
|
}
|
2594
2708
|
return s;
|
2595
2709
|
}
|
2596
|
-
function
|
2710
|
+
function hi(s) {
|
2597
2711
|
switch (s) {
|
2598
2712
|
case "alphaHash":
|
2599
2713
|
return "Alpha Hash";
|
@@ -2796,11 +2910,11 @@ function ci(s) {
|
|
2796
2910
|
}
|
2797
2911
|
return s;
|
2798
2912
|
}
|
2799
|
-
function
|
2913
|
+
function En(s) {
|
2800
2914
|
const e = s.toLowerCase();
|
2801
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";
|
2802
2916
|
}
|
2803
|
-
function
|
2917
|
+
function Sr() {
|
2804
2918
|
const s = document.createElement("input");
|
2805
2919
|
return s.type = "file", new Promise((e, t) => {
|
2806
2920
|
s.addEventListener("change", function() {
|
@@ -2815,191 +2929,191 @@ function ur() {
|
|
2815
2929
|
}), s.click();
|
2816
2930
|
});
|
2817
2931
|
}
|
2818
|
-
const
|
2932
|
+
const wr = [
|
2819
2933
|
{
|
2820
2934
|
title: "Front",
|
2821
|
-
value:
|
2935
|
+
value: qn
|
2822
2936
|
},
|
2823
2937
|
{
|
2824
2938
|
title: "Back",
|
2825
|
-
value:
|
2939
|
+
value: Xs
|
2826
2940
|
},
|
2827
2941
|
{
|
2828
2942
|
title: "Double",
|
2829
|
-
value:
|
2943
|
+
value: Bi
|
2830
2944
|
}
|
2831
|
-
],
|
2945
|
+
], xr = [
|
2832
2946
|
{
|
2833
2947
|
title: "No Blending",
|
2834
|
-
value:
|
2948
|
+
value: Qn
|
2835
2949
|
},
|
2836
2950
|
{
|
2837
2951
|
title: "Normal",
|
2838
|
-
value:
|
2952
|
+
value: Jn
|
2839
2953
|
},
|
2840
2954
|
{
|
2841
2955
|
title: "Additive",
|
2842
|
-
value:
|
2956
|
+
value: ea
|
2843
2957
|
},
|
2844
2958
|
{
|
2845
2959
|
title: "Subtractive",
|
2846
|
-
value:
|
2960
|
+
value: ta
|
2847
2961
|
},
|
2848
2962
|
{
|
2849
2963
|
title: "Multiply",
|
2850
|
-
value:
|
2964
|
+
value: ia
|
2851
2965
|
},
|
2852
2966
|
{
|
2853
2967
|
title: "Custom",
|
2854
|
-
value:
|
2968
|
+
value: sa
|
2855
2969
|
}
|
2856
|
-
],
|
2970
|
+
], Or = [
|
2857
2971
|
{
|
2858
2972
|
title: "Add",
|
2859
|
-
value:
|
2973
|
+
value: na
|
2860
2974
|
},
|
2861
2975
|
{
|
2862
2976
|
title: "Subtract",
|
2863
|
-
value:
|
2977
|
+
value: aa
|
2864
2978
|
},
|
2865
2979
|
{
|
2866
2980
|
title: "Reverse Subtract",
|
2867
|
-
value:
|
2981
|
+
value: ra
|
2868
2982
|
},
|
2869
2983
|
{
|
2870
2984
|
title: "Min",
|
2871
|
-
value:
|
2985
|
+
value: oa
|
2872
2986
|
},
|
2873
2987
|
{
|
2874
2988
|
title: "Max",
|
2875
|
-
value:
|
2989
|
+
value: la
|
2876
2990
|
}
|
2877
|
-
],
|
2991
|
+
], Tr = [
|
2878
2992
|
{
|
2879
2993
|
title: "Zero",
|
2880
|
-
value:
|
2994
|
+
value: $s
|
2881
2995
|
},
|
2882
2996
|
{
|
2883
2997
|
title: "One",
|
2884
|
-
value:
|
2998
|
+
value: Ks
|
2885
2999
|
},
|
2886
3000
|
{
|
2887
3001
|
title: "Src Color",
|
2888
|
-
value:
|
3002
|
+
value: qs
|
2889
3003
|
},
|
2890
3004
|
{
|
2891
3005
|
title: "One Minus Src Color",
|
2892
|
-
value:
|
3006
|
+
value: Qs
|
2893
3007
|
},
|
2894
3008
|
{
|
2895
3009
|
title: "Src Alpha",
|
2896
|
-
value:
|
3010
|
+
value: Js
|
2897
3011
|
},
|
2898
3012
|
{
|
2899
3013
|
title: "One Minus Src Alpha",
|
2900
|
-
value:
|
3014
|
+
value: en
|
2901
3015
|
},
|
2902
3016
|
{
|
2903
3017
|
title: "Dst Alpha",
|
2904
|
-
value:
|
3018
|
+
value: tn
|
2905
3019
|
},
|
2906
3020
|
{
|
2907
3021
|
title: "One Minus Dst Alpha",
|
2908
|
-
value:
|
3022
|
+
value: sn
|
2909
3023
|
},
|
2910
3024
|
{
|
2911
3025
|
title: "Dst Color",
|
2912
|
-
value:
|
3026
|
+
value: nn
|
2913
3027
|
},
|
2914
3028
|
{
|
2915
3029
|
title: "One Minus Dst Color",
|
2916
|
-
value:
|
3030
|
+
value: an
|
2917
3031
|
},
|
2918
3032
|
{
|
2919
3033
|
title: "Src Alpha Saturate",
|
2920
|
-
value:
|
3034
|
+
value: ca
|
2921
3035
|
},
|
2922
3036
|
{
|
2923
3037
|
title: "Constant Color",
|
2924
|
-
value:
|
3038
|
+
value: rn
|
2925
3039
|
},
|
2926
3040
|
{
|
2927
3041
|
title: "One Minus Constant Color",
|
2928
|
-
value:
|
3042
|
+
value: on
|
2929
3043
|
},
|
2930
3044
|
{
|
2931
3045
|
title: "Constant Alpha",
|
2932
|
-
value:
|
3046
|
+
value: ln
|
2933
3047
|
},
|
2934
3048
|
{
|
2935
3049
|
title: "One Minus Constant Alpha",
|
2936
|
-
value:
|
3050
|
+
value: cn
|
2937
3051
|
}
|
2938
|
-
],
|
3052
|
+
], Mr = [
|
2939
3053
|
{
|
2940
3054
|
title: "Zero",
|
2941
|
-
value:
|
3055
|
+
value: $s
|
2942
3056
|
},
|
2943
3057
|
{
|
2944
3058
|
title: "One",
|
2945
|
-
value:
|
3059
|
+
value: Ks
|
2946
3060
|
},
|
2947
3061
|
{
|
2948
3062
|
title: "Src Color",
|
2949
|
-
value:
|
3063
|
+
value: qs
|
2950
3064
|
},
|
2951
3065
|
{
|
2952
3066
|
title: "One Minus Src Color",
|
2953
|
-
value:
|
3067
|
+
value: Qs
|
2954
3068
|
},
|
2955
3069
|
{
|
2956
3070
|
title: "Src Alpha",
|
2957
|
-
value:
|
3071
|
+
value: Js
|
2958
3072
|
},
|
2959
3073
|
{
|
2960
3074
|
title: "One Minus Src Alpha",
|
2961
|
-
value:
|
3075
|
+
value: en
|
2962
3076
|
},
|
2963
3077
|
{
|
2964
3078
|
title: "Dst Alpha",
|
2965
|
-
value:
|
3079
|
+
value: tn
|
2966
3080
|
},
|
2967
3081
|
{
|
2968
3082
|
title: "One Minus Dst Alpha",
|
2969
|
-
value:
|
3083
|
+
value: sn
|
2970
3084
|
},
|
2971
3085
|
{
|
2972
3086
|
title: "Dst Color",
|
2973
|
-
value:
|
3087
|
+
value: nn
|
2974
3088
|
},
|
2975
3089
|
{
|
2976
3090
|
title: "One Minus Dst Color",
|
2977
|
-
value:
|
3091
|
+
value: an
|
2978
3092
|
},
|
2979
3093
|
{
|
2980
3094
|
title: "Constant Color",
|
2981
|
-
value:
|
3095
|
+
value: rn
|
2982
3096
|
},
|
2983
3097
|
{
|
2984
3098
|
title: "One Minus Constant Color",
|
2985
|
-
value:
|
3099
|
+
value: on
|
2986
3100
|
},
|
2987
3101
|
{
|
2988
3102
|
title: "Constant Alpha",
|
2989
|
-
value:
|
3103
|
+
value: ln
|
2990
3104
|
},
|
2991
3105
|
{
|
2992
3106
|
title: "One Minus Constant Alpha",
|
2993
|
-
value:
|
3107
|
+
value: cn
|
2994
3108
|
}
|
2995
3109
|
];
|
2996
|
-
function
|
3110
|
+
function xt(s, e) {
|
2997
3111
|
s.needsUpdate = !0, s.type = "option", s.options = e;
|
2998
3112
|
}
|
2999
|
-
function
|
3113
|
+
function Pr(s, e, t, i) {
|
3000
3114
|
return {
|
3001
3115
|
type: "boolean",
|
3002
|
-
title:
|
3116
|
+
title: hi(s),
|
3003
3117
|
prop: s,
|
3004
3118
|
value: e,
|
3005
3119
|
needsUpdate: !0,
|
@@ -3013,10 +3127,10 @@ function vr(s, e, t, i) {
|
|
3013
3127
|
}
|
3014
3128
|
};
|
3015
3129
|
}
|
3016
|
-
function
|
3130
|
+
function Ar(s, e, t, i) {
|
3017
3131
|
const n = {
|
3018
3132
|
type: "number",
|
3019
|
-
title:
|
3133
|
+
title: hi(s),
|
3020
3134
|
prop: s,
|
3021
3135
|
value: e,
|
3022
3136
|
min: void 0,
|
@@ -3034,27 +3148,27 @@ function yr(s, e, t, i) {
|
|
3034
3148
|
};
|
3035
3149
|
switch (s) {
|
3036
3150
|
case "blending":
|
3037
|
-
|
3151
|
+
xt(n, xr);
|
3038
3152
|
break;
|
3039
3153
|
case "blendDst":
|
3040
|
-
|
3154
|
+
xt(n, Mr);
|
3041
3155
|
break;
|
3042
3156
|
case "blendEquation":
|
3043
|
-
|
3157
|
+
xt(n, Or);
|
3044
3158
|
break;
|
3045
3159
|
case "blendSrc":
|
3046
|
-
|
3160
|
+
xt(n, Tr);
|
3047
3161
|
break;
|
3048
3162
|
case "side":
|
3049
|
-
|
3163
|
+
xt(n, wr);
|
3050
3164
|
break;
|
3051
3165
|
}
|
3052
|
-
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;
|
3053
3167
|
}
|
3054
|
-
function
|
3168
|
+
function Dr(s, e, t, i) {
|
3055
3169
|
const n = {
|
3056
3170
|
type: "string",
|
3057
|
-
title:
|
3171
|
+
title: hi(s),
|
3058
3172
|
prop: s,
|
3059
3173
|
value: e,
|
3060
3174
|
needsUpdate: !0,
|
@@ -3087,20 +3201,20 @@ function br(s, e, t, i) {
|
|
3087
3201
|
}
|
3088
3202
|
}), n;
|
3089
3203
|
}
|
3090
|
-
function
|
3204
|
+
function Rr(s) {
|
3091
3205
|
return s.x !== void 0 && s.y !== void 0 && s.z === void 0;
|
3092
3206
|
}
|
3093
|
-
function
|
3207
|
+
function Ir(s) {
|
3094
3208
|
return s.x !== void 0 && s.y !== void 0 && s.z !== void 0 && s.w === void 0;
|
3095
3209
|
}
|
3096
|
-
function
|
3210
|
+
function Lr(s) {
|
3097
3211
|
return s.x !== void 0 && s.y !== void 0 && s.z !== void 0 && s.w !== void 0;
|
3098
3212
|
}
|
3099
|
-
function
|
3213
|
+
function zi(s) {
|
3100
3214
|
s.sort((e, t) => e.title < t.title ? -1 : e.title > t.title ? 1 : 0);
|
3101
3215
|
}
|
3102
|
-
function
|
3103
|
-
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;
|
3104
3218
|
if (c === "boolean" || c === "string")
|
3105
3219
|
return {
|
3106
3220
|
title: a,
|
@@ -3134,7 +3248,7 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3134
3248
|
}
|
3135
3249
|
}
|
3136
3250
|
};
|
3137
|
-
return
|
3251
|
+
return En(a) && (l.type = "range", l.min = 0, l.max = 1), l;
|
3138
3252
|
} else {
|
3139
3253
|
if (e.isColor)
|
3140
3254
|
return {
|
@@ -3158,20 +3272,20 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3158
3272
|
for (const d in e) {
|
3159
3273
|
const p = e[d], m = `[${d.toString()}]`;
|
3160
3274
|
if (p.value !== void 0) {
|
3161
|
-
const f =
|
3275
|
+
const f = Lt(`${m}.value`, p.value, t, i, o, r);
|
3162
3276
|
f !== void 0 && l.push(f);
|
3163
3277
|
} else {
|
3164
|
-
const f =
|
3278
|
+
const f = Lt(m, p, t, i, o, r);
|
3165
3279
|
f !== void 0 && l.push(f);
|
3166
3280
|
}
|
3167
3281
|
}
|
3168
3282
|
if (l.length > 0)
|
3169
|
-
return
|
3283
|
+
return zi(l), {
|
3170
3284
|
title: a,
|
3171
3285
|
items: l
|
3172
3286
|
};
|
3173
3287
|
} else {
|
3174
|
-
if (
|
3288
|
+
if (Rr(e))
|
3175
3289
|
return {
|
3176
3290
|
title: a,
|
3177
3291
|
prop: o,
|
@@ -3187,7 +3301,7 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3187
3301
|
}
|
3188
3302
|
}
|
3189
3303
|
};
|
3190
|
-
if (
|
3304
|
+
if (Ir(e))
|
3191
3305
|
return {
|
3192
3306
|
title: a,
|
3193
3307
|
prop: o,
|
@@ -3203,7 +3317,7 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3203
3317
|
}
|
3204
3318
|
}
|
3205
3319
|
};
|
3206
|
-
if (
|
3320
|
+
if (Lr(e))
|
3207
3321
|
return {
|
3208
3322
|
title: a,
|
3209
3323
|
prop: o,
|
@@ -3242,14 +3356,14 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3242
3356
|
value: e,
|
3243
3357
|
disabled: r,
|
3244
3358
|
onChange: (l, d) => {
|
3245
|
-
const p =
|
3359
|
+
const p = Cr(s), m = n.length > 0 ? `${n}.${p}` : p;
|
3246
3360
|
i.createTexture(t.uuid, `material.${m}`, d);
|
3247
3361
|
const f = i.getScene(t.uuid);
|
3248
3362
|
if (f !== null) {
|
3249
|
-
const
|
3250
|
-
if (
|
3363
|
+
const C = f.getObjectByProperty("uuid", t.uuid);
|
3364
|
+
if (C !== void 0) {
|
3251
3365
|
const y = (T) => {
|
3252
|
-
const g =
|
3366
|
+
const g = C.material, v = m.split(".");
|
3253
3367
|
switch (v.length) {
|
3254
3368
|
case 1:
|
3255
3369
|
g[v[0]] = T;
|
@@ -3269,7 +3383,7 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3269
3383
|
}
|
3270
3384
|
g.needsUpdate = !0;
|
3271
3385
|
};
|
3272
|
-
d.src.length > 0 ?
|
3386
|
+
d.src.length > 0 ? vn(d.src).then((T) => {
|
3273
3387
|
T.offset.set(d.offset[0], d.offset[1]), T.repeat.set(d.repeat[0], d.repeat[1]), y(T);
|
3274
3388
|
}) : y(null);
|
3275
3389
|
}
|
@@ -3299,10 +3413,10 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3299
3413
|
const m = e[p];
|
3300
3414
|
if (m !== void 0)
|
3301
3415
|
if (m.value !== void 0) {
|
3302
|
-
const f =
|
3416
|
+
const f = Lt(`${p}.value`, m.value, t, i, o, d);
|
3303
3417
|
f !== void 0 && l.push(f);
|
3304
3418
|
} else {
|
3305
|
-
const f =
|
3419
|
+
const f = Lt(p, m, t, i, o, d);
|
3306
3420
|
f !== void 0 && l.push(f);
|
3307
3421
|
}
|
3308
3422
|
}
|
@@ -3310,7 +3424,7 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3310
3424
|
console.log("Issue cycling through material object:", s, e);
|
3311
3425
|
}
|
3312
3426
|
if (l.length > 0)
|
3313
|
-
return
|
3427
|
+
return zi(l), {
|
3314
3428
|
title: a,
|
3315
3429
|
items: l
|
3316
3430
|
};
|
@@ -3318,25 +3432,25 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3318
3432
|
}
|
3319
3433
|
}
|
3320
3434
|
}
|
3321
|
-
function
|
3435
|
+
function Ss(s, e, t) {
|
3322
3436
|
const i = [];
|
3323
3437
|
for (const n in s) {
|
3324
|
-
if (!
|
3438
|
+
if (!Er(n))
|
3325
3439
|
continue;
|
3326
3440
|
const r = typeof s[n], a = s[n];
|
3327
3441
|
if (r === "boolean")
|
3328
|
-
i.push(
|
3442
|
+
i.push(Pr(n, a, e, t));
|
3329
3443
|
else if (r === "number")
|
3330
|
-
i.push(
|
3444
|
+
i.push(Ar(n, a, e, t));
|
3331
3445
|
else if (r === "string")
|
3332
|
-
i.push(
|
3446
|
+
i.push(Dr(n, a, e, t));
|
3333
3447
|
else if (r === "object") {
|
3334
|
-
const o =
|
3448
|
+
const o = Lt(n, a, e, t);
|
3335
3449
|
o !== void 0 && i.push(o);
|
3336
3450
|
} else
|
3337
3451
|
a !== void 0 && console.log("other:", n, r, a);
|
3338
3452
|
}
|
3339
|
-
return
|
3453
|
+
return zi(i), i.push({
|
3340
3454
|
title: "Update Material",
|
3341
3455
|
type: "button",
|
3342
3456
|
onChange: () => {
|
@@ -3349,7 +3463,7 @@ function bs(s, e, t) {
|
|
3349
3463
|
}
|
3350
3464
|
}), i;
|
3351
3465
|
}
|
3352
|
-
function
|
3466
|
+
function kr(s, e) {
|
3353
3467
|
function t() {
|
3354
3468
|
return `${e.app.appID}_material`;
|
3355
3469
|
}
|
@@ -3366,7 +3480,7 @@ function wr(s, e) {
|
|
3366
3480
|
Oe,
|
3367
3481
|
{
|
3368
3482
|
title: `Material ${l}`,
|
3369
|
-
items:
|
3483
|
+
items: Ss(a[l], s, e)
|
3370
3484
|
},
|
3371
3485
|
`Material ${l}`
|
3372
3486
|
)
|
@@ -3377,7 +3491,7 @@ function wr(s, e) {
|
|
3377
3491
|
Oe,
|
3378
3492
|
{
|
3379
3493
|
title: "Material",
|
3380
|
-
items:
|
3494
|
+
items: Ss(a, s, e),
|
3381
3495
|
expanded: n,
|
3382
3496
|
onToggle: (o) => {
|
3383
3497
|
r(o);
|
@@ -3385,42 +3499,42 @@ function wr(s, e) {
|
|
3385
3499
|
}
|
3386
3500
|
);
|
3387
3501
|
}
|
3388
|
-
const
|
3389
|
-
function
|
3390
|
-
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]), [
|
3391
|
-
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) {
|
3392
3506
|
if (s.onChange !== void 0) {
|
3393
3507
|
const L = s.prop !== void 0 ? s.prop : s.title;
|
3394
3508
|
s.onChange(L, {
|
3395
3509
|
src: v,
|
3396
|
-
offset: [S,
|
3510
|
+
offset: [S, E],
|
3397
3511
|
repeat: [w, O]
|
3398
3512
|
});
|
3399
3513
|
}
|
3400
3514
|
}
|
3401
3515
|
function g(v) {
|
3402
|
-
const S = t.current.src,
|
3516
|
+
const S = t.current.src, E = v.target.value;
|
3403
3517
|
switch (v.target) {
|
3404
3518
|
case i.current:
|
3405
|
-
l(
|
3519
|
+
l(E), T(S, E, d, m, C);
|
3406
3520
|
break;
|
3407
3521
|
case n.current:
|
3408
|
-
p(
|
3522
|
+
p(E), T(S, c, E, m, C);
|
3409
3523
|
break;
|
3410
3524
|
case r.current:
|
3411
|
-
f(
|
3525
|
+
f(E), T(S, c, d, E, C);
|
3412
3526
|
break;
|
3413
3527
|
case a.current:
|
3414
|
-
y(
|
3528
|
+
y(E), T(S, c, d, m, E);
|
3415
3529
|
break;
|
3416
3530
|
}
|
3417
3531
|
}
|
3418
3532
|
return /* @__PURE__ */ u.jsxs("div", { className: "imageField", children: [
|
3419
3533
|
/* @__PURE__ */ u.jsx("img", { alt: s.title, ref: t, onClick: () => {
|
3420
|
-
|
3421
|
-
t.current.src = v, T(v, c, d, m,
|
3534
|
+
Sr().then((v) => {
|
3535
|
+
t.current.src = v, T(v, c, d, m, C);
|
3422
3536
|
});
|
3423
|
-
}, src: o.src.length > 0 ? o.src :
|
3537
|
+
}, src: o.src.length > 0 ? o.src : ws }),
|
3424
3538
|
/* @__PURE__ */ u.jsxs("div", { className: "fields", children: [
|
3425
3539
|
/* @__PURE__ */ u.jsxs("div", { children: [
|
3426
3540
|
/* @__PURE__ */ u.jsx("label", { children: "Offset:" }),
|
@@ -3462,21 +3576,21 @@ function xr(s) {
|
|
3462
3576
|
{
|
3463
3577
|
ref: a,
|
3464
3578
|
type: "number",
|
3465
|
-
value:
|
3579
|
+
value: C,
|
3466
3580
|
step: e,
|
3467
3581
|
onChange: g
|
3468
3582
|
}
|
3469
3583
|
)
|
3470
3584
|
] }),
|
3471
3585
|
/* @__PURE__ */ u.jsx("button", { onClick: () => {
|
3472
|
-
T("", c, d, m,
|
3586
|
+
T("", c, d, m, C), t.current.src = ws;
|
3473
3587
|
}, children: "Clear" })
|
3474
3588
|
] })
|
3475
3589
|
] });
|
3476
3590
|
}
|
3477
|
-
function
|
3591
|
+
function ii(s) {
|
3478
3592
|
let e = s.value;
|
3479
|
-
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))));
|
3480
3594
|
const [t, i] = Z(e), n = J(null), r = (l) => {
|
3481
3595
|
let d = l.target.value;
|
3482
3596
|
if (s.type === "boolean")
|
@@ -3492,7 +3606,7 @@ function ti(s) {
|
|
3492
3606
|
const o = s.type === "string" && (t.length > 100 || t.search(`
|
3493
3607
|
`) > -1), c = o || s.type === "image" || s.type === "vector2";
|
3494
3608
|
return /* @__PURE__ */ u.jsxs("div", { className: `field ${c ? "block" : ""}`, style: a, children: [
|
3495
|
-
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"),
|
3496
3610
|
s.type === "string" && !o && /* @__PURE__ */ u.jsx(
|
3497
3611
|
"input",
|
3498
3612
|
{
|
@@ -3566,18 +3680,18 @@ function ti(s) {
|
|
3566
3680
|
children: s.title
|
3567
3681
|
}
|
3568
3682
|
),
|
3569
|
-
s.type === "image" && /* @__PURE__ */ u.jsx(
|
3570
|
-
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:
|
3571
|
-
s.type === "vector2" && /* @__PURE__ */ u.jsx(
|
3572
|
-
s.type === "grid3" && /* @__PURE__ */ u.jsx(
|
3573
|
-
s.type === "grid4" && /* @__PURE__ */ u.jsx(
|
3574
|
-
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 })
|
3575
3689
|
] });
|
3576
3690
|
}
|
3577
|
-
function
|
3691
|
+
function jr(s) {
|
3578
3692
|
return "items" in s;
|
3579
3693
|
}
|
3580
|
-
class Oe extends
|
3694
|
+
class Oe extends Ft {
|
3581
3695
|
subgroupNames = [];
|
3582
3696
|
subgroupElements = [];
|
3583
3697
|
valueOverrides = /* @__PURE__ */ new Map();
|
@@ -3629,15 +3743,15 @@ class Oe extends Nt {
|
|
3629
3743
|
render() {
|
3630
3744
|
const e = [];
|
3631
3745
|
return this.props.items.forEach((t) => {
|
3632
|
-
if (
|
3746
|
+
if (jr(t))
|
3633
3747
|
e.push(
|
3634
|
-
/* @__PURE__ */ u.jsx(Oe, { title:
|
3748
|
+
/* @__PURE__ */ u.jsx(Oe, { title: ri(t.title), items: t.items }, Math.random())
|
3635
3749
|
);
|
3636
3750
|
else {
|
3637
3751
|
const i = this.valueOverrides.get(t.title), n = i !== void 0 ? i : t.value;
|
3638
3752
|
e.push(
|
3639
3753
|
/* @__PURE__ */ u.jsx(
|
3640
|
-
|
3754
|
+
ii,
|
3641
3755
|
{
|
3642
3756
|
title: t.title,
|
3643
3757
|
prop: t.prop,
|
@@ -3660,7 +3774,7 @@ class Oe extends Nt {
|
|
3660
3774
|
);
|
3661
3775
|
}
|
3662
3776
|
}), this.subgroupElements.forEach((t) => e.push(t)), /* @__PURE__ */ u.jsx(
|
3663
|
-
|
3777
|
+
oi,
|
3664
3778
|
{
|
3665
3779
|
label: this.props.title,
|
3666
3780
|
open: this.props.expanded === !0,
|
@@ -3672,16 +3786,16 @@ class Oe extends Nt {
|
|
3672
3786
|
);
|
3673
3787
|
}
|
3674
3788
|
}
|
3675
|
-
class ae extends
|
3789
|
+
class ae extends Ft {
|
3676
3790
|
static instance;
|
3677
3791
|
static groups = [];
|
3678
3792
|
static groupsRefs = [];
|
3679
3793
|
static groupTitles = [];
|
3680
3794
|
constructor(e) {
|
3681
|
-
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);
|
3682
3796
|
}
|
3683
3797
|
componentWillUnmount() {
|
3684
|
-
D.removeEventListener(
|
3798
|
+
D.removeEventListener(A.ADD_GROUP, this.addGroup), D.removeEventListener(A.REMOVE_GROUP, this.removeGroup);
|
3685
3799
|
}
|
3686
3800
|
render() {
|
3687
3801
|
return /* @__PURE__ */ u.jsx("div", { className: "customGroups", children: ae.groups }, this.state.lastUpdate);
|
@@ -3762,7 +3876,7 @@ class ae extends Nt {
|
|
3762
3876
|
}
|
3763
3877
|
}
|
3764
3878
|
}
|
3765
|
-
function
|
3879
|
+
function xs(s) {
|
3766
3880
|
switch (s) {
|
3767
3881
|
case "fov":
|
3768
3882
|
return "FOV";
|
@@ -3791,7 +3905,7 @@ function Es(s) {
|
|
3791
3905
|
}
|
3792
3906
|
return s;
|
3793
3907
|
}
|
3794
|
-
function
|
3908
|
+
function Nr(s, e) {
|
3795
3909
|
function t() {
|
3796
3910
|
return `${e.app.appID}_camera`;
|
3797
3911
|
}
|
@@ -3803,7 +3917,7 @@ function Tr(s, e) {
|
|
3803
3917
|
if (s.perspectiveCameraInfo !== void 0)
|
3804
3918
|
for (const o in s.perspectiveCameraInfo)
|
3805
3919
|
a.push({
|
3806
|
-
title:
|
3920
|
+
title: xs(o),
|
3807
3921
|
prop: o,
|
3808
3922
|
type: "number",
|
3809
3923
|
step: 0.01,
|
@@ -3820,7 +3934,7 @@ function Tr(s, e) {
|
|
3820
3934
|
else if (s.orthographicCameraInfo !== void 0)
|
3821
3935
|
for (const o in s.orthographicCameraInfo)
|
3822
3936
|
a.push({
|
3823
|
-
title:
|
3937
|
+
title: xs(o),
|
3824
3938
|
prop: o,
|
3825
3939
|
type: "number",
|
3826
3940
|
step: 0.01,
|
@@ -3846,14 +3960,14 @@ function Tr(s, e) {
|
|
3846
3960
|
}
|
3847
3961
|
);
|
3848
3962
|
}
|
3849
|
-
class
|
3963
|
+
class Fr extends Ie {
|
3850
3964
|
constructor(e, t) {
|
3851
|
-
const i = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0, 1, 1, 0], n = new
|
3852
|
-
n.setAttribute("position", new
|
3853
|
-
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 });
|
3854
3968
|
super(n, r), this.light = e, this.color = t, this.type = "RectAreaLightHelper";
|
3855
|
-
const a = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0], o = new
|
3856
|
-
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 })));
|
3857
3971
|
}
|
3858
3972
|
updateMatrixWorld() {
|
3859
3973
|
if (this.scale.set(0.5 * this.light.width, 0.5 * this.light.height, 1), this.color !== void 0)
|
@@ -3869,7 +3983,7 @@ class Mr extends Ie {
|
|
3869
3983
|
this.geometry.dispose(), this.material.dispose(), this.children[0].geometry.dispose(), this.children[0].material.dispose();
|
3870
3984
|
}
|
3871
3985
|
}
|
3872
|
-
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 = {
|
3873
3987
|
NONE: -1,
|
3874
3988
|
ROTATE: 0,
|
3875
3989
|
DOLLY: 1,
|
@@ -3878,10 +3992,10 @@ const Ss = { type: "change" }, Vi = { type: "start" }, yn = { type: "end" }, Zt
|
|
3878
3992
|
TOUCH_PAN: 4,
|
3879
3993
|
TOUCH_DOLLY_PAN: 5,
|
3880
3994
|
TOUCH_DOLLY_ROTATE: 6
|
3881
|
-
},
|
3882
|
-
class
|
3995
|
+
}, Ci = 1e-6;
|
3996
|
+
class Hr extends hn {
|
3883
3997
|
constructor(e, t = null) {
|
3884
|
-
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();
|
3885
3999
|
}
|
3886
4000
|
connect() {
|
3887
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";
|
@@ -3911,7 +4025,7 @@ class Pr extends on {
|
|
3911
4025
|
this.target0.copy(this.target), this.position0.copy(this.object.position), this.zoom0 = this.object.zoom;
|
3912
4026
|
}
|
3913
4027
|
reset() {
|
3914
|
-
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;
|
3915
4029
|
}
|
3916
4030
|
update(e = null) {
|
3917
4031
|
const t = this.object.position;
|
@@ -3933,20 +4047,20 @@ class Pr extends on {
|
|
3933
4047
|
const c = o - a;
|
3934
4048
|
this.object.position.addScaledVector(this._dollyDirection, c), this.object.updateMatrixWorld(), r = !!c;
|
3935
4049
|
} else if (this.object.isOrthographicCamera) {
|
3936
|
-
const o = new
|
4050
|
+
const o = new P(this._mouse.x, this._mouse.y, 0);
|
3937
4051
|
o.unproject(this.object);
|
3938
4052
|
const c = this.object.zoom;
|
3939
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;
|
3940
|
-
const l = new
|
4054
|
+
const l = new P(this._mouse.x, this._mouse.y, 0);
|
3941
4055
|
l.unproject(this.object), this.object.position.sub(l).add(o), this.object.updateMatrixWorld(), a = oe.length();
|
3942
4056
|
} else
|
3943
4057
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
3944
|
-
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))));
|
3945
4059
|
} else if (this.object.isOrthographicCamera) {
|
3946
4060
|
const a = this.object.zoom;
|
3947
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);
|
3948
4062
|
}
|
3949
|
-
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;
|
3950
4064
|
}
|
3951
4065
|
_getAutoRotationAngle(e) {
|
3952
4066
|
return e !== null ? ye / 60 * this.autoRotateSpeed * e : ye / 60 / 60 * this.autoRotateSpeed;
|
@@ -4140,16 +4254,16 @@ class Pr extends on {
|
|
4140
4254
|
return e.ctrlKey && !this._controlActive && (i.deltaY *= 10), i;
|
4141
4255
|
}
|
4142
4256
|
}
|
4143
|
-
function
|
4257
|
+
function Yr(s) {
|
4144
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)));
|
4145
4259
|
}
|
4146
|
-
function
|
4260
|
+
function Br(s) {
|
4147
4261
|
this.enabled !== !1 && (s.pointerType === "touch" ? this._onTouchMove(s) : this._onMouseMove(s));
|
4148
4262
|
}
|
4149
|
-
function
|
4263
|
+
function Vr(s) {
|
4150
4264
|
switch (this._removePointer(s), this._pointers.length) {
|
4151
4265
|
case 0:
|
4152
|
-
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;
|
4153
4267
|
break;
|
4154
4268
|
case 1:
|
4155
4269
|
const e = this._pointers[0], t = this._pointerPositions[e];
|
@@ -4157,7 +4271,7 @@ function Ir(s) {
|
|
4157
4271
|
break;
|
4158
4272
|
}
|
4159
4273
|
}
|
4160
|
-
function
|
4274
|
+
function Zr(s) {
|
4161
4275
|
let e;
|
4162
4276
|
switch (s.button) {
|
4163
4277
|
case 0:
|
@@ -4173,12 +4287,12 @@ function Lr(s) {
|
|
4173
4287
|
e = -1;
|
4174
4288
|
}
|
4175
4289
|
switch (e) {
|
4176
|
-
case
|
4290
|
+
case gt.DOLLY:
|
4177
4291
|
if (this.enableZoom === !1)
|
4178
4292
|
return;
|
4179
4293
|
this._handleMouseDownDolly(s), this.state = V.DOLLY;
|
4180
4294
|
break;
|
4181
|
-
case
|
4295
|
+
case gt.ROTATE:
|
4182
4296
|
if (s.ctrlKey || s.metaKey || s.shiftKey) {
|
4183
4297
|
if (this.enablePan === !1)
|
4184
4298
|
return;
|
@@ -4189,7 +4303,7 @@ function Lr(s) {
|
|
4189
4303
|
this._handleMouseDownRotate(s), this.state = V.ROTATE;
|
4190
4304
|
}
|
4191
4305
|
break;
|
4192
|
-
case
|
4306
|
+
case gt.PAN:
|
4193
4307
|
if (s.ctrlKey || s.metaKey || s.shiftKey) {
|
4194
4308
|
if (this.enableRotate === !1)
|
4195
4309
|
return;
|
@@ -4203,9 +4317,9 @@ function Lr(s) {
|
|
4203
4317
|
default:
|
4204
4318
|
this.state = V.NONE;
|
4205
4319
|
}
|
4206
|
-
this.state !== V.NONE && this.dispatchEvent(
|
4320
|
+
this.state !== V.NONE && this.dispatchEvent(Gi);
|
4207
4321
|
}
|
4208
|
-
function
|
4322
|
+
function Wr(s) {
|
4209
4323
|
switch (this.state) {
|
4210
4324
|
case V.ROTATE:
|
4211
4325
|
if (this.enableRotate === !1)
|
@@ -4224,22 +4338,22 @@ function kr(s) {
|
|
4224
4338
|
break;
|
4225
4339
|
}
|
4226
4340
|
}
|
4227
|
-
function
|
4228
|
-
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));
|
4229
4343
|
}
|
4230
|
-
function
|
4344
|
+
function Xr(s) {
|
4231
4345
|
this.enabled === !1 || this.enablePan === !1 || this._handleKeyDown(s);
|
4232
4346
|
}
|
4233
|
-
function
|
4347
|
+
function $r(s) {
|
4234
4348
|
switch (this._trackPointer(s), this._pointers.length) {
|
4235
4349
|
case 1:
|
4236
4350
|
switch (this.touches.ONE) {
|
4237
|
-
case
|
4351
|
+
case ft.ROTATE:
|
4238
4352
|
if (this.enableRotate === !1)
|
4239
4353
|
return;
|
4240
4354
|
this._handleTouchStartRotate(s), this.state = V.TOUCH_ROTATE;
|
4241
4355
|
break;
|
4242
|
-
case
|
4356
|
+
case ft.PAN:
|
4243
4357
|
if (this.enablePan === !1)
|
4244
4358
|
return;
|
4245
4359
|
this._handleTouchStartPan(s), this.state = V.TOUCH_PAN;
|
@@ -4250,12 +4364,12 @@ function Nr(s) {
|
|
4250
4364
|
break;
|
4251
4365
|
case 2:
|
4252
4366
|
switch (this.touches.TWO) {
|
4253
|
-
case
|
4367
|
+
case ft.DOLLY_PAN:
|
4254
4368
|
if (this.enableZoom === !1 && this.enablePan === !1)
|
4255
4369
|
return;
|
4256
4370
|
this._handleTouchStartDollyPan(s), this.state = V.TOUCH_DOLLY_PAN;
|
4257
4371
|
break;
|
4258
|
-
case
|
4372
|
+
case ft.DOLLY_ROTATE:
|
4259
4373
|
if (this.enableZoom === !1 && this.enableRotate === !1)
|
4260
4374
|
return;
|
4261
4375
|
this._handleTouchStartDollyRotate(s), this.state = V.TOUCH_DOLLY_ROTATE;
|
@@ -4267,9 +4381,9 @@ function Nr(s) {
|
|
4267
4381
|
default:
|
4268
4382
|
this.state = V.NONE;
|
4269
4383
|
}
|
4270
|
-
this.state !== V.NONE && this.dispatchEvent(
|
4384
|
+
this.state !== V.NONE && this.dispatchEvent(Gi);
|
4271
4385
|
}
|
4272
|
-
function
|
4386
|
+
function Kr(s) {
|
4273
4387
|
switch (this._trackPointer(s), this.state) {
|
4274
4388
|
case V.TOUCH_ROTATE:
|
4275
4389
|
if (this.enableRotate === !1)
|
@@ -4295,13 +4409,13 @@ function Fr(s) {
|
|
4295
4409
|
this.state = V.NONE;
|
4296
4410
|
}
|
4297
4411
|
}
|
4298
|
-
function
|
4412
|
+
function qr(s) {
|
4299
4413
|
this.enabled !== !1 && s.preventDefault();
|
4300
4414
|
}
|
4301
|
-
function
|
4415
|
+
function Qr(s) {
|
4302
4416
|
s.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
4303
4417
|
}
|
4304
|
-
function
|
4418
|
+
function Jr(s) {
|
4305
4419
|
s.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
4306
4420
|
}
|
4307
4421
|
/*!
|
@@ -4332,7 +4446,7 @@ const ee = {
|
|
4332
4446
|
TOUCH_ZOOM_TRUCK: 8192,
|
4333
4447
|
TOUCH_ZOOM_OFFSET: 16384,
|
4334
4448
|
TOUCH_ZOOM_ROTATE: 32768
|
4335
|
-
}),
|
4449
|
+
}), ct = {
|
4336
4450
|
NONE: 0,
|
4337
4451
|
IN: 1,
|
4338
4452
|
OUT: -1
|
@@ -4343,26 +4457,26 @@ function Ze(s) {
|
|
4343
4457
|
function Be(s) {
|
4344
4458
|
return s.isOrthographicCamera;
|
4345
4459
|
}
|
4346
|
-
const
|
4460
|
+
const ht = Math.PI * 2, Ms = Math.PI / 2, Sn = 1e-5, Ot = Math.PI / 180;
|
4347
4461
|
function Me(s, e, t) {
|
4348
4462
|
return Math.max(e, Math.min(t, s));
|
4349
4463
|
}
|
4350
|
-
function
|
4464
|
+
function K(s, e = Sn) {
|
4351
4465
|
return Math.abs(s) < e;
|
4352
4466
|
}
|
4353
|
-
function Y(s, e, t =
|
4354
|
-
return
|
4467
|
+
function Y(s, e, t = Sn) {
|
4468
|
+
return K(s - e, t);
|
4355
4469
|
}
|
4356
|
-
function
|
4470
|
+
function Ps(s, e) {
|
4357
4471
|
return Math.round(s / e) * e;
|
4358
4472
|
}
|
4359
|
-
function
|
4473
|
+
function Tt(s) {
|
4360
4474
|
return isFinite(s) ? s : s < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;
|
4361
4475
|
}
|
4362
|
-
function
|
4476
|
+
function Mt(s) {
|
4363
4477
|
return Math.abs(s) < Number.MAX_VALUE ? s : s * (1 / 0);
|
4364
4478
|
}
|
4365
|
-
function
|
4479
|
+
function Gt(s, e, t, i, n = 1 / 0, r) {
|
4366
4480
|
i = Math.max(1e-4, i);
|
4367
4481
|
const a = 2 / i, o = a * r, c = 1 / (1 + o + 0.48 * o * o + 0.235 * o * o * o);
|
4368
4482
|
let l = s - e;
|
@@ -4373,30 +4487,30 @@ function Wt(s, e, t, i, n = 1 / 0, r) {
|
|
4373
4487
|
let f = e + (l + m) * c;
|
4374
4488
|
return d - s > 0 == f > d && (f = d, t.value = (f - d) / r), f;
|
4375
4489
|
}
|
4376
|
-
function
|
4490
|
+
function As(s, e, t, i, n = 1 / 0, r, a) {
|
4377
4491
|
i = Math.max(1e-4, i);
|
4378
4492
|
const o = 2 / i, c = o * r, l = 1 / (1 + c + 0.48 * c * c + 0.235 * c * c * c);
|
4379
|
-
let d = e.x, p = e.y, m = e.z, f = s.x - d,
|
4380
|
-
const T = d, g = p, v = m, S = n * i,
|
4381
|
-
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) {
|
4382
4496
|
const $ = Math.sqrt(w);
|
4383
|
-
f = f / $ * S,
|
4497
|
+
f = f / $ * S, C = C / $ * S, y = y / $ * S;
|
4384
4498
|
}
|
4385
|
-
d = s.x - f, p = s.y -
|
4386
|
-
const O = (t.x + o * f) * r, L = (t.y + o *
|
4387
|
-
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 + (
|
4388
|
-
const R = T - s.x, B = g - s.y, Se = v - s.z, _e = a.x - T, re = a.y - g,
|
4389
|
-
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;
|
4390
4504
|
}
|
4391
|
-
function
|
4505
|
+
function Si(s, e) {
|
4392
4506
|
e.set(0, 0), s.forEach((t) => {
|
4393
4507
|
e.x += t.clientX, e.y += t.clientY;
|
4394
4508
|
}), e.x /= s.length, e.y /= s.length;
|
4395
4509
|
}
|
4396
|
-
function
|
4510
|
+
function wi(s, e) {
|
4397
4511
|
return Be(s) ? (console.warn(`${e} is not supported in OrthographicCamera`), !0) : !1;
|
4398
4512
|
}
|
4399
|
-
class
|
4513
|
+
class eo {
|
4400
4514
|
constructor() {
|
4401
4515
|
this._listeners = {};
|
4402
4516
|
}
|
@@ -4460,10 +4574,10 @@ class Br {
|
|
4460
4574
|
}
|
4461
4575
|
}
|
4462
4576
|
}
|
4463
|
-
var
|
4464
|
-
const
|
4465
|
-
let I,
|
4466
|
-
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 {
|
4467
4581
|
/**
|
4468
4582
|
* Injects THREE as the dependency. You can then proceed to use CameraControls.
|
4469
4583
|
*
|
@@ -4505,7 +4619,7 @@ class ke extends Br {
|
|
4505
4619
|
* @category Statics
|
4506
4620
|
*/
|
4507
4621
|
static install(e) {
|
4508
|
-
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();
|
4509
4623
|
}
|
4510
4624
|
/**
|
4511
4625
|
* list all ACTIONs
|
@@ -4533,27 +4647,27 @@ class ke extends Br {
|
|
4533
4647
|
*/
|
4534
4648
|
constructor(e, t) {
|
4535
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 = () => {
|
4536
|
-
}, 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 =
|
4537
|
-
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;
|
4538
4652
|
if (Ze(this._camera)) {
|
4539
|
-
const O = U.copy(this._camera.position).sub(this._target), L = this._camera.getEffectiveFOV() *
|
4540
|
-
|
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;
|
4541
4655
|
} else if (Be(this._camera)) {
|
4542
4656
|
const O = this._camera;
|
4543
|
-
|
4657
|
+
E = g * (O.right - O.left) / O.zoom / this._elementRect.width, w = v * (O.top - O.bottom) / O.zoom / this._elementRect.height;
|
4544
4658
|
} else
|
4545
4659
|
return;
|
4546
|
-
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);
|
4547
4661
|
}, this._rotateInternal = (g, v) => {
|
4548
|
-
const S =
|
4549
|
-
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);
|
4550
4664
|
}, this._dollyInternal = (g, v, S) => {
|
4551
|
-
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;
|
4552
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);
|
4553
4667
|
}, this._zoomInternal = (g, v, S) => {
|
4554
|
-
const
|
4668
|
+
const E = Math.pow(0.95, g * this.dollySpeed), w = this._zoom, O = this._zoom * E;
|
4555
4669
|
this.zoomTo(O, !0), this.dollyToCursor && (this._changedZoom += O - w, this._dollyControlCoord.set(v, S));
|
4556
|
-
}, 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 = [
|
4557
4671
|
new I.Vector3(),
|
4558
4672
|
new I.Vector3(),
|
4559
4673
|
new I.Vector3(),
|
@@ -4572,14 +4686,14 @@ class ke extends Br {
|
|
4572
4686
|
if (!this._enabled || !this._domElement)
|
4573
4687
|
return;
|
4574
4688
|
if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
|
4575
|
-
const
|
4689
|
+
const E = this._domElement.getBoundingClientRect(), w = g.clientX / E.width, O = g.clientY / E.height;
|
4576
4690
|
if (w < this._interactiveArea.left || w > this._interactiveArea.right || O < this._interactiveArea.top || O > this._interactiveArea.bottom)
|
4577
4691
|
return;
|
4578
4692
|
}
|
4579
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;
|
4580
4694
|
if (v !== null) {
|
4581
|
-
const
|
4582
|
-
|
4695
|
+
const E = this._findPointerByMouseButton(v);
|
4696
|
+
E && this._disposePointer(E);
|
4583
4697
|
}
|
4584
4698
|
if ((g.buttons & ee.LEFT) === ee.LEFT && this._lockedPointer)
|
4585
4699
|
return;
|
@@ -4632,7 +4746,7 @@ class ke extends Br {
|
|
4632
4746
|
}
|
4633
4747
|
else
|
4634
4748
|
this._state = _.NONE;
|
4635
|
-
|
4749
|
+
C();
|
4636
4750
|
}
|
4637
4751
|
};
|
4638
4752
|
let l = -1;
|
@@ -4648,7 +4762,7 @@ class ke extends Br {
|
|
4648
4762
|
const O = performance.now();
|
4649
4763
|
l - O < 1e3 && this._getClientRect(this._elementRect), l = O;
|
4650
4764
|
}
|
4651
|
-
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;
|
4652
4766
|
switch (this.mouseButtons.wheel) {
|
4653
4767
|
case _.ROTATE: {
|
4654
4768
|
this._rotateInternal(g.deltaX, g.deltaY), this._isUserControllingRotate = !0;
|
@@ -4663,11 +4777,11 @@ class ke extends Br {
|
|
4663
4777
|
break;
|
4664
4778
|
}
|
4665
4779
|
case _.DOLLY: {
|
4666
|
-
this._dollyInternal(-S,
|
4780
|
+
this._dollyInternal(-S, E, w), this._isUserControllingDolly = !0;
|
4667
4781
|
break;
|
4668
4782
|
}
|
4669
4783
|
case _.ZOOM: {
|
4670
|
-
this._zoomInternal(-S,
|
4784
|
+
this._zoomInternal(-S, E, w), this._isUserControllingZoom = !0;
|
4671
4785
|
break;
|
4672
4786
|
}
|
4673
4787
|
}
|
@@ -4684,8 +4798,8 @@ class ke extends Br {
|
|
4684
4798
|
}, m = (g) => {
|
4685
4799
|
if (!this._enabled)
|
4686
4800
|
return;
|
4687
|
-
if (
|
4688
|
-
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);
|
4689
4803
|
r.set(0, w);
|
4690
4804
|
const O = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, L = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
|
4691
4805
|
n.set(O, L);
|
@@ -4710,21 +4824,21 @@ class ke extends Br {
|
|
4710
4824
|
}, f = () => {
|
4711
4825
|
if (!this._enabled || !this._dragNeedsUpdate)
|
4712
4826
|
return;
|
4713
|
-
this._dragNeedsUpdate = !1,
|
4714
|
-
const v = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, S = v ? -v.deltaX : n.x - be.x,
|
4715
|
-
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) {
|
4716
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;
|
4717
|
-
(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);
|
4718
4832
|
}
|
4719
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) {
|
4720
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;
|
4721
4835
|
r.set(0, L);
|
4722
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;
|
4723
|
-
(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);
|
4724
4838
|
}
|
4725
|
-
((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,
|
4726
|
-
},
|
4727
|
-
|
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" }));
|
4728
4842
|
};
|
4729
4843
|
this.lockPointer = () => {
|
4730
4844
|
!this._enabled || !this._domElement || (this.cancel(), this._lockedPointer = {
|
@@ -4749,7 +4863,7 @@ class ke extends Br {
|
|
4749
4863
|
}, this._removeAllEventListeners = () => {
|
4750
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));
|
4751
4865
|
}, this.cancel = () => {
|
4752
|
-
this._state !== _.NONE && (this._state = _.NONE, this._activePointers.length = 0,
|
4866
|
+
this._state !== _.NONE && (this._state = _.NONE, this._activePointers.length = 0, C());
|
4753
4867
|
}, t && this.connect(t), this.update(0);
|
4754
4868
|
}
|
4755
4869
|
/**
|
@@ -4982,7 +5096,7 @@ class ke extends Br {
|
|
4982
5096
|
* @category Methods
|
4983
5097
|
*/
|
4984
5098
|
dollyTo(e, t = !1) {
|
4985
|
-
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);
|
4986
5100
|
}
|
4987
5101
|
_dollyToNoClamp(e, t = !1) {
|
4988
5102
|
const i = this._sphericalEnd.radius;
|
@@ -5005,7 +5119,7 @@ class ke extends Br {
|
|
5005
5119
|
* @category Methods
|
5006
5120
|
*/
|
5007
5121
|
dollyInFixed(e, t = !1) {
|
5008
|
-
this._targetEnd.add(this._getCameraDirection(
|
5122
|
+
this._targetEnd.add(this._getCameraDirection(Pt).multiplyScalar(e)), t || this._target.copy(this._targetEnd);
|
5009
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);
|
5010
5124
|
return this._createOnRestPromise(i);
|
5011
5125
|
}
|
@@ -5046,8 +5160,8 @@ class ke extends Br {
|
|
5046
5160
|
* @category Methods
|
5047
5161
|
*/
|
5048
5162
|
truck(e, t, i = !1) {
|
5049
|
-
this._camera.updateMatrix(),
|
5050
|
-
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);
|
5051
5165
|
return this.moveTo(r.x, r.y, r.z, i);
|
5052
5166
|
}
|
5053
5167
|
/**
|
@@ -5112,20 +5226,20 @@ class ke extends Br {
|
|
5112
5226
|
* @category Methods
|
5113
5227
|
*/
|
5114
5228
|
fitToBox(e, t, { cover: i = !1, paddingLeft: n = 0, paddingRight: r = 0, paddingBottom: a = 0, paddingTop: o = 0 } = {}) {
|
5115
|
-
const c = [], l = e.isBox3 ?
|
5229
|
+
const c = [], l = e.isBox3 ? ut.copy(e) : ut.setFromObject(e);
|
5116
5230
|
l.isEmpty() && (console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"), Promise.resolve());
|
5117
|
-
const d =
|
5231
|
+
const d = Ps(this._sphericalEnd.theta, Ms), p = Ps(this._sphericalEnd.phi, Ms);
|
5118
5232
|
c.push(this.rotateTo(d, p, t));
|
5119
|
-
const m = U.setFromSpherical(this._sphericalEnd).normalize(), f =
|
5120
|
-
|
5121
|
-
const y =
|
5122
|
-
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);
|
5123
5237
|
const T = y.getSize(U), g = y.getCenter(z).applyQuaternion(f);
|
5124
5238
|
if (Ze(this._camera)) {
|
5125
5239
|
const v = this.getDistanceToFitBox(T.x, T.y, T.z, i);
|
5126
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));
|
5127
5241
|
} else if (Be(this._camera)) {
|
5128
|
-
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);
|
5129
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));
|
5130
5244
|
}
|
5131
5245
|
return Promise.all(c);
|
@@ -5137,7 +5251,7 @@ class ke extends Br {
|
|
5137
5251
|
* @category Methods
|
5138
5252
|
*/
|
5139
5253
|
fitToSphere(e, t) {
|
5140
|
-
const i = [], r = "isObject3D" in e ? ke.createBoundingSphere(e,
|
5254
|
+
const i = [], r = "isObject3D" in e ? ke.createBoundingSphere(e, Ti) : Ti.copy(e);
|
5141
5255
|
if (i.push(this.moveTo(r.center.x, r.center.y, r.center.z, t)), Ze(this._camera)) {
|
5142
5256
|
const a = this.getDistanceToFitSphere(r.radius);
|
5143
5257
|
i.push(this.dollyTo(a, t));
|
@@ -5159,7 +5273,7 @@ class ke extends Br {
|
|
5159
5273
|
* @category Methods
|
5160
5274
|
*/
|
5161
5275
|
setLookAt(e, t, i, n, r, a, o = !1) {
|
5162
|
-
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;
|
5163
5277
|
const c = z.set(n, r, a), l = U.set(e, t, i);
|
5164
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));
|
5165
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);
|
@@ -5183,15 +5297,15 @@ class ke extends Br {
|
|
5183
5297
|
* @param enableTransition
|
5184
5298
|
* @category Methods
|
5185
5299
|
*/
|
5186
|
-
lerpLookAt(e, t, i, n, r, a, o, c, l, d, p, m, f,
|
5187
|
-
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;
|
5188
5302
|
const y = U.set(n, r, a), T = z.set(e, t, i);
|
5189
5303
|
xe.setFromVector3(T.sub(y).applyQuaternion(this._yAxisUpSpace));
|
5190
|
-
const g =
|
5304
|
+
const g = dt.set(d, p, m), v = z.set(o, c, l);
|
5191
5305
|
At.setFromVector3(v.sub(g).applyQuaternion(this._yAxisUpSpace)), this._targetEnd.copy(y.lerp(g, f));
|
5192
|
-
const S = At.theta - xe.theta,
|
5193
|
-
this._sphericalEnd.set(xe.radius + w * f, xe.phi +
|
5194
|
-
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);
|
5195
5309
|
return this._createOnRestPromise(O);
|
5196
5310
|
}
|
5197
5311
|
/**
|
@@ -5241,9 +5355,9 @@ class ke extends Br {
|
|
5241
5355
|
* @category Methods
|
5242
5356
|
*/
|
5243
5357
|
setOrbitPoint(e, t, i) {
|
5244
|
-
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);
|
5245
5359
|
const n = U.set(e, t, i), r = n.distanceTo(this._camera.position), a = n.sub(this._camera.position);
|
5246
|
-
|
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);
|
5247
5361
|
}
|
5248
5362
|
/**
|
5249
5363
|
* Set the boundary box that encloses the target of the camera. box3 is in THREE.Box3
|
@@ -5282,9 +5396,9 @@ class ke extends Br {
|
|
5282
5396
|
* @category Methods
|
5283
5397
|
*/
|
5284
5398
|
getDistanceToFitBox(e, t, i, n = !1) {
|
5285
|
-
if (
|
5399
|
+
if (wi(this._camera, "getDistanceToFitBox"))
|
5286
5400
|
return this._spherical.radius;
|
5287
|
-
const r = e / t, a = this._camera.getEffectiveFOV() *
|
5401
|
+
const r = e / t, a = this._camera.getEffectiveFOV() * Ot, o = this._camera.aspect;
|
5288
5402
|
return ((n ? r > o : r < o) ? t : e / o) * 0.5 / Math.tan(a * 0.5) + i * 0.5;
|
5289
5403
|
}
|
5290
5404
|
/**
|
@@ -5294,9 +5408,9 @@ class ke extends Br {
|
|
5294
5408
|
* @category Methods
|
5295
5409
|
*/
|
5296
5410
|
getDistanceToFitSphere(e) {
|
5297
|
-
if (
|
5411
|
+
if (wi(this._camera, "getDistanceToFitSphere"))
|
5298
5412
|
return this._spherical.radius;
|
5299
|
-
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;
|
5300
5414
|
return e / Math.sin(n * 0.5);
|
5301
5415
|
}
|
5302
5416
|
/**
|
@@ -5340,7 +5454,7 @@ class ke extends Br {
|
|
5340
5454
|
* @category Methods
|
5341
5455
|
*/
|
5342
5456
|
normalizeRotations() {
|
5343
|
-
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);
|
5344
5458
|
}
|
5345
5459
|
/**
|
5346
5460
|
* stop all transitions.
|
@@ -5379,7 +5493,7 @@ class ke extends Br {
|
|
5379
5493
|
* @category Methods
|
5380
5494
|
*/
|
5381
5495
|
updateCameraUp() {
|
5382
|
-
this._yAxisUpSpace.setFromUnitVectors(this._camera.up,
|
5496
|
+
this._yAxisUpSpace.setFromUnitVectors(this._camera.up, $t), this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert();
|
5383
5497
|
}
|
5384
5498
|
/**
|
5385
5499
|
* Apply current camera-up direction to the camera.
|
@@ -5400,68 +5514,68 @@ class ke extends Br {
|
|
5400
5514
|
* @category Methods
|
5401
5515
|
*/
|
5402
5516
|
update(e) {
|
5403
|
-
const t = this._sphericalEnd.theta - this._spherical.theta, i = this._sphericalEnd.phi - this._spherical.phi, n = this._sphericalEnd.radius - this._spherical.radius, r =
|
5404
|
-
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))
|
5405
5519
|
this._thetaVelocity.value = 0, this._spherical.theta = this._sphericalEnd.theta;
|
5406
5520
|
else {
|
5407
5521
|
const p = this._isUserControllingRotate ? this.draggingSmoothTime : this.smoothTime;
|
5408
|
-
this._spherical.theta =
|
5522
|
+
this._spherical.theta = Gt(this._spherical.theta, this._sphericalEnd.theta, this._thetaVelocity, p, 1 / 0, e), this._needsUpdate = !0;
|
5409
5523
|
}
|
5410
|
-
if (
|
5524
|
+
if (K(i))
|
5411
5525
|
this._phiVelocity.value = 0, this._spherical.phi = this._sphericalEnd.phi;
|
5412
5526
|
else {
|
5413
5527
|
const p = this._isUserControllingRotate ? this.draggingSmoothTime : this.smoothTime;
|
5414
|
-
this._spherical.phi =
|
5528
|
+
this._spherical.phi = Gt(this._spherical.phi, this._sphericalEnd.phi, this._phiVelocity, p, 1 / 0, e), this._needsUpdate = !0;
|
5415
5529
|
}
|
5416
|
-
if (
|
5530
|
+
if (K(n))
|
5417
5531
|
this._radiusVelocity.value = 0, this._spherical.radius = this._sphericalEnd.radius;
|
5418
5532
|
else {
|
5419
5533
|
const p = this._isUserControllingDolly ? this.draggingSmoothTime : this.smoothTime;
|
5420
|
-
this._spherical.radius =
|
5534
|
+
this._spherical.radius = Gt(this._spherical.radius, this._sphericalEnd.radius, this._radiusVelocity, p, this.maxSpeed, e), this._needsUpdate = !0;
|
5421
5535
|
}
|
5422
|
-
if (
|
5536
|
+
if (K(r.x) && K(r.y) && K(r.z))
|
5423
5537
|
this._targetVelocity.set(0, 0, 0), this._target.copy(this._targetEnd);
|
5424
5538
|
else {
|
5425
5539
|
const p = this._isUserControllingTruck ? this.draggingSmoothTime : this.smoothTime;
|
5426
|
-
|
5540
|
+
As(this._target, this._targetEnd, this._targetVelocity, p, this.maxSpeed, e, this._target), this._needsUpdate = !0;
|
5427
5541
|
}
|
5428
|
-
if (
|
5542
|
+
if (K(a.x) && K(a.y) && K(a.z))
|
5429
5543
|
this._focalOffsetVelocity.set(0, 0, 0), this._focalOffset.copy(this._focalOffsetEnd);
|
5430
5544
|
else {
|
5431
5545
|
const p = this._isUserControllingOffset ? this.draggingSmoothTime : this.smoothTime;
|
5432
|
-
|
5546
|
+
As(this._focalOffset, this._focalOffsetEnd, this._focalOffsetVelocity, p, this.maxSpeed, e, this._focalOffset), this._needsUpdate = !0;
|
5433
5547
|
}
|
5434
|
-
if (
|
5548
|
+
if (K(o))
|
5435
5549
|
this._zoomVelocity.value = 0, this._zoom = this._zoomEnd;
|
5436
5550
|
else {
|
5437
5551
|
const p = this._isUserControllingZoom ? this.draggingSmoothTime : this.smoothTime;
|
5438
|
-
this._zoom =
|
5552
|
+
this._zoom = Gt(this._zoom, this._zoomEnd, this._zoomVelocity, p, 1 / 0, e);
|
5439
5553
|
}
|
5440
5554
|
if (this.dollyToCursor) {
|
5441
5555
|
if (Ze(this._camera) && this._changedDolly !== 0) {
|
5442
|
-
const p = this._spherical.radius - this._lastDistance, m = this._camera, f = this._getCameraDirection(
|
5443
|
-
|
5444
|
-
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;
|
5445
5559
|
if (this.infinityDolly && (w || O)) {
|
5446
5560
|
this._sphericalEnd.radius -= p, this._spherical.radius -= p;
|
5447
5561
|
const j = z.copy(f).multiplyScalar(-p);
|
5448
|
-
|
5562
|
+
E.add(j);
|
5449
5563
|
}
|
5450
|
-
this._boundary.clampPoint(
|
5451
|
-
const L = z.subVectors(
|
5452
|
-
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);
|
5453
5567
|
} else if (Be(this._camera) && this._changedZoom !== 0) {
|
5454
|
-
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),
|
5455
|
-
|
5456
|
-
const L = z.subVectors(
|
5457
|
-
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);
|
5458
5572
|
}
|
5459
5573
|
}
|
5460
5574
|
this._camera.zoom !== this._zoom && (this._camera.zoom = this._zoom, this._camera.updateProjectionMatrix(), this._updateNearPlaneCorners(), this._needsUpdate = !0), this._dragNeedsUpdate = !0;
|
5461
5575
|
const c = this._collisionTest();
|
5462
|
-
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);
|
5463
5577
|
const d = this._needsUpdate;
|
5464
|
-
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;
|
5465
5579
|
}
|
5466
5580
|
/**
|
5467
5581
|
* Get all state in JSON string
|
@@ -5471,13 +5585,13 @@ class ke extends Br {
|
|
5471
5585
|
return JSON.stringify({
|
5472
5586
|
enabled: this._enabled,
|
5473
5587
|
minDistance: this.minDistance,
|
5474
|
-
maxDistance:
|
5588
|
+
maxDistance: Tt(this.maxDistance),
|
5475
5589
|
minZoom: this.minZoom,
|
5476
|
-
maxZoom:
|
5590
|
+
maxZoom: Tt(this.maxZoom),
|
5477
5591
|
minPolarAngle: this.minPolarAngle,
|
5478
|
-
maxPolarAngle:
|
5479
|
-
minAzimuthAngle:
|
5480
|
-
maxAzimuthAngle:
|
5592
|
+
maxPolarAngle: Tt(this.maxPolarAngle),
|
5593
|
+
minAzimuthAngle: Tt(this.minAzimuthAngle),
|
5594
|
+
maxAzimuthAngle: Tt(this.maxAzimuthAngle),
|
5481
5595
|
smoothTime: this.smoothTime,
|
5482
5596
|
draggingSmoothTime: this.draggingSmoothTime,
|
5483
5597
|
dollySpeed: this.dollySpeed,
|
@@ -5502,7 +5616,7 @@ class ke extends Br {
|
|
5502
5616
|
*/
|
5503
5617
|
fromJSON(e, t = !1) {
|
5504
5618
|
const i = JSON.parse(e);
|
5505
|
-
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;
|
5506
5620
|
}
|
5507
5621
|
/**
|
5508
5622
|
* Attach all internal event handlers to enable drag control.
|
@@ -5513,7 +5627,7 @@ class ke extends Br {
|
|
5513
5627
|
console.warn("camera-controls is already connected.");
|
5514
5628
|
return;
|
5515
5629
|
}
|
5516
|
-
e.setAttribute("data-camera-controls-version",
|
5630
|
+
e.setAttribute("data-camera-controls-version", to), this._addAllEventListeners(e), this._getClientRect(this._elementRect);
|
5517
5631
|
}
|
5518
5632
|
/**
|
5519
5633
|
* Detach all internal event handlers to disable drag control.
|
@@ -5549,7 +5663,7 @@ class ke extends Br {
|
|
5549
5663
|
const n = t.lengthSq();
|
5550
5664
|
if (n === 0)
|
5551
5665
|
return e;
|
5552
|
-
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();
|
5553
5667
|
if (c === 0)
|
5554
5668
|
return e.add(t);
|
5555
5669
|
if (c === n)
|
@@ -5563,7 +5677,7 @@ class ke extends Br {
|
|
5563
5677
|
}
|
5564
5678
|
_updateNearPlaneCorners() {
|
5565
5679
|
if (Ze(this._camera)) {
|
5566
|
-
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;
|
5567
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);
|
5568
5682
|
} else if (Be(this._camera)) {
|
5569
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;
|
@@ -5573,16 +5687,16 @@ class ke extends Br {
|
|
5573
5687
|
// lateUpdate
|
5574
5688
|
_collisionTest() {
|
5575
5689
|
let e = 1 / 0;
|
5576
|
-
if (!(this.colliderMeshes.length >= 1) ||
|
5690
|
+
if (!(this.colliderMeshes.length >= 1) || wi(this._camera, "_collisionTest"))
|
5577
5691
|
return e;
|
5578
|
-
const i = this._getTargetDirection(
|
5579
|
-
|
5692
|
+
const i = this._getTargetDirection(Pt);
|
5693
|
+
Pi.lookAt(Ds, i, this._camera.up);
|
5580
5694
|
for (let n = 0; n < 4; n++) {
|
5581
5695
|
const r = z.copy(this._nearPlaneCorners[n]);
|
5582
|
-
r.applyMatrix4(
|
5583
|
-
const a =
|
5584
|
-
|
5585
|
-
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);
|
5586
5700
|
o.length !== 0 && o[0].distance < e && (e = o[0].distance);
|
5587
5701
|
}
|
5588
5702
|
return e;
|
@@ -5643,9 +5757,9 @@ class ke extends Br {
|
|
5643
5757
|
}
|
5644
5758
|
static createBoundingSphere(e, t = new I.Sphere()) {
|
5645
5759
|
const i = t, n = i.center;
|
5646
|
-
|
5647
|
-
a.isMesh &&
|
5648
|
-
}),
|
5760
|
+
ut.makeEmpty(), e.traverseVisible((a) => {
|
5761
|
+
a.isMesh && ut.expandByObject(a);
|
5762
|
+
}), ut.getCenter(n);
|
5649
5763
|
let r = 0;
|
5650
5764
|
return e.traverseVisible((a) => {
|
5651
5765
|
if (!a.isMesh)
|
@@ -5658,7 +5772,7 @@ class ke extends Br {
|
|
5658
5772
|
}), i.radius = Math.sqrt(r), i;
|
5659
5773
|
}
|
5660
5774
|
}
|
5661
|
-
const
|
5775
|
+
const li = (s) => {
|
5662
5776
|
const [e, t] = Z(s.options[s.index]), i = () => {
|
5663
5777
|
s.onToggle(!s.open);
|
5664
5778
|
}, n = (r) => {
|
@@ -5668,7 +5782,7 @@ const oi = (s) => {
|
|
5668
5782
|
/* @__PURE__ */ u.jsx("div", { className: "dropdown-toggle", onClick: i, children: `${s.title}: ${e}` }),
|
5669
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)) })
|
5670
5784
|
] });
|
5671
|
-
}, Ge =
|
5785
|
+
}, Ge = ja(function(e, t) {
|
5672
5786
|
const i = [
|
5673
5787
|
"Renderer",
|
5674
5788
|
"Depth",
|
@@ -5682,7 +5796,7 @@ const oi = (s) => {
|
|
5682
5796
|
} }),
|
5683
5797
|
/* @__PURE__ */ u.jsxs("div", { className: "options", children: [
|
5684
5798
|
e.camera !== null && /* @__PURE__ */ u.jsx(
|
5685
|
-
|
5799
|
+
li,
|
5686
5800
|
{
|
5687
5801
|
title: "Camera",
|
5688
5802
|
index: e.options.indexOf(e.camera.name),
|
@@ -5696,7 +5810,7 @@ const oi = (s) => {
|
|
5696
5810
|
}
|
5697
5811
|
),
|
5698
5812
|
/* @__PURE__ */ u.jsx(
|
5699
|
-
|
5813
|
+
li,
|
5700
5814
|
{
|
5701
5815
|
title: "Mode",
|
5702
5816
|
index: i.indexOf(n),
|
@@ -5717,15 +5831,15 @@ const oi = (s) => {
|
|
5717
5831
|
] })
|
5718
5832
|
] });
|
5719
5833
|
});
|
5720
|
-
class
|
5834
|
+
class so extends dn {
|
5721
5835
|
constructor(e) {
|
5722
5836
|
super({
|
5723
5837
|
extensions: {
|
5724
5838
|
// @ts-ignore
|
5725
5839
|
derivatives: !0
|
5726
5840
|
},
|
5727
|
-
glslVersion:
|
5728
|
-
side:
|
5841
|
+
glslVersion: pa,
|
5842
|
+
side: Bi,
|
5729
5843
|
transparent: !0,
|
5730
5844
|
uniforms: {
|
5731
5845
|
uScale: {
|
@@ -5830,17 +5944,17 @@ class Wr extends ln {
|
|
5830
5944
|
});
|
5831
5945
|
}
|
5832
5946
|
}
|
5833
|
-
class
|
5947
|
+
class no extends M {
|
5834
5948
|
gridMaterial;
|
5835
5949
|
constructor() {
|
5836
|
-
const e = new
|
5837
|
-
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;
|
5838
5952
|
}
|
5839
5953
|
update() {
|
5840
5954
|
this.gridMaterial.needsUpdate = !0;
|
5841
5955
|
}
|
5842
5956
|
}
|
5843
|
-
function
|
5957
|
+
function Us(s) {
|
5844
5958
|
const [e, t] = Z(s.selected), i = "toggle" + (e ? " selected" : "");
|
5845
5959
|
return /* @__PURE__ */ u.jsx(
|
5846
5960
|
"button",
|
@@ -5859,7 +5973,7 @@ function Is(s) {
|
|
5859
5973
|
s.name
|
5860
5974
|
);
|
5861
5975
|
}
|
5862
|
-
const
|
5976
|
+
const ao = `#include <common>
|
5863
5977
|
#include <batching_pars_vertex>
|
5864
5978
|
#include <uv_pars_vertex>
|
5865
5979
|
#include <color_pars_vertex>
|
@@ -5889,7 +6003,7 @@ void main() {
|
|
5889
6003
|
#include <logdepthbuf_vertex>
|
5890
6004
|
#include <clipping_planes_vertex>
|
5891
6005
|
#include <worldpos_vertex>
|
5892
|
-
}`,
|
6006
|
+
}`, ro = `
|
5893
6007
|
#include <common>
|
5894
6008
|
#include <uv_pars_fragment>
|
5895
6009
|
#include <clipping_planes_pars_fragment>
|
@@ -5898,46 +6012,46 @@ void main() {
|
|
5898
6012
|
#include <clipping_planes_fragment>
|
5899
6013
|
gl_FragColor = vec4(vec3(vUv, 0.0), 1.0);
|
5900
6014
|
}`;
|
5901
|
-
class
|
6015
|
+
class oo extends dn {
|
5902
6016
|
constructor() {
|
5903
6017
|
super({
|
5904
6018
|
defines: {
|
5905
6019
|
USE_UV: ""
|
5906
6020
|
},
|
5907
|
-
vertexShader:
|
5908
|
-
fragmentShader:
|
6021
|
+
vertexShader: ao,
|
6022
|
+
fragmentShader: ro
|
5909
6023
|
});
|
5910
6024
|
}
|
5911
6025
|
}
|
5912
|
-
const Xe = new
|
5913
|
-
X: new
|
5914
|
-
Y: new
|
5915
|
-
Z: new
|
5916
|
-
},
|
5917
|
-
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 {
|
5918
6032
|
constructor(e, t = null) {
|
5919
6033
|
super(void 0, t);
|
5920
|
-
const i = new
|
6034
|
+
const i = new fo(this);
|
5921
6035
|
this._root = i;
|
5922
|
-
const n = new
|
6036
|
+
const n = new go();
|
5923
6037
|
this._gizmo = n, i.add(n);
|
5924
|
-
const r = new
|
6038
|
+
const r = new _o();
|
5925
6039
|
this._plane = r, i.add(r);
|
5926
6040
|
const a = this;
|
5927
|
-
function o(S,
|
5928
|
-
let w =
|
6041
|
+
function o(S, E) {
|
6042
|
+
let w = E;
|
5929
6043
|
Object.defineProperty(a, S, {
|
5930
6044
|
get: function() {
|
5931
|
-
return w !== void 0 ? w :
|
6045
|
+
return w !== void 0 ? w : E;
|
5932
6046
|
},
|
5933
6047
|
set: function(O) {
|
5934
|
-
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));
|
5935
6049
|
}
|
5936
|
-
}), a[S] =
|
6050
|
+
}), a[S] = E, r[S] = E, n[S] = E;
|
5937
6051
|
}
|
5938
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);
|
5939
|
-
const c = new
|
5940
|
-
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();
|
5941
6055
|
}
|
5942
6056
|
connect() {
|
5943
6057
|
this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp), this.domElement.style.touchAction = "none";
|
@@ -5952,14 +6066,14 @@ class Kr extends on {
|
|
5952
6066
|
if (this.object === void 0 || this.dragging === !0)
|
5953
6067
|
return;
|
5954
6068
|
e !== null && Xe.setFromCamera(e, this.camera);
|
5955
|
-
const t =
|
6069
|
+
const t = Di(this._gizmo.picker[this.mode], Xe);
|
5956
6070
|
t ? this.axis = t.object.name : this.axis = null;
|
5957
6071
|
}
|
5958
6072
|
pointerDown(e) {
|
5959
6073
|
if (!(this.object === void 0 || this.dragging === !0 || e != null && e.button !== 0) && this.axis !== null) {
|
5960
6074
|
e !== null && Xe.setFromCamera(e, this.camera);
|
5961
|
-
const t =
|
5962
|
-
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);
|
5963
6077
|
}
|
5964
6078
|
}
|
5965
6079
|
pointerMove(e) {
|
@@ -5968,7 +6082,7 @@ class Kr extends on {
|
|
5968
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)
|
5969
6083
|
return;
|
5970
6084
|
e !== null && Xe.setFromCamera(e, this.camera);
|
5971
|
-
const a =
|
6085
|
+
const a = Di(this._plane, Xe, !0);
|
5972
6086
|
if (a) {
|
5973
6087
|
if (this.pointEnd.copy(a.point).sub(this.worldPositionStart), i === "translate")
|
5974
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))));
|
@@ -5983,13 +6097,13 @@ class Kr extends on {
|
|
5983
6097
|
this._offset.copy(this.pointEnd).sub(this.pointStart);
|
5984
6098
|
const o = 20 / this.worldPosition.distanceTo(ue.setFromMatrixPosition(this.camera.matrixWorld));
|
5985
6099
|
let c = !1;
|
5986
|
-
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());
|
5987
6101
|
}
|
5988
|
-
this.dispatchEvent(
|
6102
|
+
this.dispatchEvent(Ai), this.dispatchEvent(zs);
|
5989
6103
|
}
|
5990
6104
|
}
|
5991
6105
|
pointerUp(e) {
|
5992
|
-
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);
|
5993
6107
|
}
|
5994
6108
|
dispose() {
|
5995
6109
|
this.disconnect(), this.traverse(function(e) {
|
@@ -6005,7 +6119,7 @@ class Kr extends on {
|
|
6005
6119
|
return this.object = void 0, this.axis = null, this._root.visible = !1, this;
|
6006
6120
|
}
|
6007
6121
|
reset() {
|
6008
|
-
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));
|
6009
6123
|
}
|
6010
6124
|
getRaycaster() {
|
6011
6125
|
return Xe;
|
@@ -6033,7 +6147,7 @@ class Kr extends on {
|
|
6033
6147
|
this.space = e;
|
6034
6148
|
}
|
6035
6149
|
}
|
6036
|
-
function
|
6150
|
+
function co(s) {
|
6037
6151
|
if (this.domElement.ownerDocument.pointerLockElement)
|
6038
6152
|
return {
|
6039
6153
|
x: 0,
|
@@ -6049,7 +6163,7 @@ function Qr(s) {
|
|
6049
6163
|
};
|
6050
6164
|
}
|
6051
6165
|
}
|
6052
|
-
function
|
6166
|
+
function ho(s) {
|
6053
6167
|
if (this.enabled)
|
6054
6168
|
switch (s.pointerType) {
|
6055
6169
|
case "mouse":
|
@@ -6058,24 +6172,24 @@ function Jr(s) {
|
|
6058
6172
|
break;
|
6059
6173
|
}
|
6060
6174
|
}
|
6061
|
-
function
|
6175
|
+
function uo(s) {
|
6062
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)));
|
6063
6177
|
}
|
6064
|
-
function
|
6178
|
+
function po(s) {
|
6065
6179
|
this.enabled && this.pointerMove(this._getPointer(s));
|
6066
6180
|
}
|
6067
|
-
function
|
6181
|
+
function mo(s) {
|
6068
6182
|
this.enabled && (this.domElement.releasePointerCapture(s.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.pointerUp(this._getPointer(s)));
|
6069
6183
|
}
|
6070
|
-
function
|
6184
|
+
function Di(s, e, t) {
|
6071
6185
|
const i = e.intersectObject(s, !0);
|
6072
6186
|
for (let n = 0; n < i.length; n++)
|
6073
6187
|
if (i[n].object.visible || t)
|
6074
6188
|
return i[n];
|
6075
6189
|
return !1;
|
6076
6190
|
}
|
6077
|
-
const qt = new
|
6078
|
-
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 {
|
6079
6193
|
constructor(e) {
|
6080
6194
|
super(), this.isTransformControlsRoot = !0, this.controls = e, this.visible = !1;
|
6081
6195
|
}
|
@@ -6085,7 +6199,7 @@ class so extends _t {
|
|
6085
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);
|
6086
6200
|
}
|
6087
6201
|
}
|
6088
|
-
class
|
6202
|
+
class go extends vt {
|
6089
6203
|
constructor() {
|
6090
6204
|
super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
|
6091
6205
|
const e = new Je({
|
@@ -6094,7 +6208,7 @@ class no extends _t {
|
|
6094
6208
|
fog: !1,
|
6095
6209
|
toneMapped: !1,
|
6096
6210
|
transparent: !0
|
6097
|
-
}), t = new
|
6211
|
+
}), t = new Vi({
|
6098
6212
|
depthTest: !1,
|
6099
6213
|
depthWrite: !1,
|
6100
6214
|
fog: !1,
|
@@ -6120,23 +6234,23 @@ class no extends _t {
|
|
6120
6234
|
p.opacity = 0.25;
|
6121
6235
|
const m = e.clone();
|
6122
6236
|
m.color.setHex(16776960), m.opacity = 0.25, e.clone().color.setHex(16776960);
|
6123
|
-
const
|
6124
|
-
|
6237
|
+
const C = e.clone();
|
6238
|
+
C.color.setHex(7895160);
|
6125
6239
|
const y = new ve(0, 0.04, 0.1, 12);
|
6126
6240
|
y.translate(0, 0.05, 0);
|
6127
6241
|
const T = new de(0.08, 0.08, 0.08);
|
6128
6242
|
T.translate(0, 0.04, 0);
|
6129
|
-
const g = new
|
6130
|
-
g.setAttribute("position", new
|
6243
|
+
const g = new _t();
|
6244
|
+
g.setAttribute("position", new qe([0, 0, 0, 1, 0, 0], 3));
|
6131
6245
|
const v = new ve(75e-4, 75e-4, 0.5, 3);
|
6132
6246
|
v.translate(0, 0.25, 0);
|
6133
6247
|
function S($, Ue) {
|
6134
|
-
const he = new
|
6248
|
+
const he = new Et($, 75e-4, 3, 64, Ue * Math.PI * 2);
|
6135
6249
|
return he.rotateY(Math.PI / 2), he.rotateX(Math.PI / 2), he;
|
6136
6250
|
}
|
6137
|
-
function
|
6138
|
-
const $ = new
|
6139
|
-
return $.setAttribute("position", new
|
6251
|
+
function E() {
|
6252
|
+
const $ = new _t();
|
6253
|
+
return $.setAttribute("position", new qe([0, 0, 0, 1, 1, 1], 3)), $;
|
6140
6254
|
}
|
6141
6255
|
const w = {
|
6142
6256
|
X: [
|
@@ -6155,7 +6269,7 @@ class no extends _t {
|
|
6155
6269
|
[new M(v, o), null, [Math.PI / 2, 0, 0]]
|
6156
6270
|
],
|
6157
6271
|
XYZ: [
|
6158
|
-
[new M(new
|
6272
|
+
[new M(new Zt(0.1, 0), p.clone()), [0, 0, 0]]
|
6159
6273
|
],
|
6160
6274
|
XY: [
|
6161
6275
|
[new M(new de(0.15, 0.15, 0.01), d.clone()), [0.15, 0.15, 0]]
|
@@ -6180,7 +6294,7 @@ class no extends _t {
|
|
6180
6294
|
[new M(new ve(0.2, 0, 0.6, 4), i), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
|
6181
6295
|
],
|
6182
6296
|
XYZ: [
|
6183
|
-
[new M(new
|
6297
|
+
[new M(new Zt(0.2, 0), i)]
|
6184
6298
|
],
|
6185
6299
|
XY: [
|
6186
6300
|
[new M(new de(0.2, 0.2, 0.01), i), [0.15, 0.15, 0]]
|
@@ -6193,13 +6307,13 @@ class no extends _t {
|
|
6193
6307
|
]
|
6194
6308
|
}, L = {
|
6195
6309
|
START: [
|
6196
|
-
[new M(new
|
6310
|
+
[new M(new Zt(0.01, 2), n), null, null, null, "helper"]
|
6197
6311
|
],
|
6198
6312
|
END: [
|
6199
|
-
[new M(new
|
6313
|
+
[new M(new Zt(0.01, 2), n), null, null, null, "helper"]
|
6200
6314
|
],
|
6201
6315
|
DELTA: [
|
6202
|
-
[new Ie(
|
6316
|
+
[new Ie(E(), n), null, null, null, "helper"]
|
6203
6317
|
],
|
6204
6318
|
X: [
|
6205
6319
|
[new Ie(g, n.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
@@ -6212,7 +6326,7 @@ class no extends _t {
|
|
6212
6326
|
]
|
6213
6327
|
}, j = {
|
6214
6328
|
XYZE: [
|
6215
|
-
[new M(S(0.5, 1),
|
6329
|
+
[new M(S(0.5, 1), C), null, [0, Math.PI / 2, 0]]
|
6216
6330
|
],
|
6217
6331
|
X: [
|
6218
6332
|
[new M(S(0.5, 0.5), r)]
|
@@ -6232,19 +6346,19 @@ class no extends _t {
|
|
6232
6346
|
]
|
6233
6347
|
}, B = {
|
6234
6348
|
XYZE: [
|
6235
|
-
[new M(new
|
6349
|
+
[new M(new mn(0.25, 10, 8), i)]
|
6236
6350
|
],
|
6237
6351
|
X: [
|
6238
|
-
[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]]
|
6239
6353
|
],
|
6240
6354
|
Y: [
|
6241
|
-
[new M(new
|
6355
|
+
[new M(new Et(0.5, 0.1, 4, 24), i), [0, 0, 0], [Math.PI / 2, 0, 0]]
|
6242
6356
|
],
|
6243
6357
|
Z: [
|
6244
|
-
[new M(new
|
6358
|
+
[new M(new Et(0.5, 0.1, 4, 24), i), [0, 0, 0], [0, 0, -Math.PI / 2]]
|
6245
6359
|
],
|
6246
6360
|
E: [
|
6247
|
-
[new M(new
|
6361
|
+
[new M(new Et(0.75, 0.1, 2, 24), i)]
|
6248
6362
|
]
|
6249
6363
|
}, Se = {
|
6250
6364
|
X: [
|
@@ -6310,22 +6424,22 @@ class no extends _t {
|
|
6310
6424
|
[new Ie(g, n.clone()), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
|
6311
6425
|
]
|
6312
6426
|
};
|
6313
|
-
function
|
6314
|
-
const Ue = new
|
6427
|
+
function q($) {
|
6428
|
+
const Ue = new vt();
|
6315
6429
|
for (const he in $)
|
6316
|
-
for (let
|
6317
|
-
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];
|
6318
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();
|
6319
6433
|
const le = se.geometry.clone();
|
6320
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);
|
6321
6435
|
}
|
6322
6436
|
return Ue;
|
6323
6437
|
}
|
6324
|
-
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;
|
6325
6439
|
}
|
6326
6440
|
// updateMatrixWorld will update transformations and appearance of individual handles
|
6327
6441
|
updateMatrixWorld(e) {
|
6328
|
-
const i = (this.mode === "scale" ? "local" : this.space) === "local" ? this.worldQuaternion :
|
6442
|
+
const i = (this.mode === "scale" ? "local" : this.space) === "local" ? this.worldQuaternion : si;
|
6329
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";
|
6330
6444
|
let n = [];
|
6331
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);
|
@@ -6334,46 +6448,46 @@ class no extends _t {
|
|
6334
6448
|
a.visible = !0, a.rotation.set(0, 0, 0), a.position.copy(this.worldPosition);
|
6335
6449
|
let o;
|
6336
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") {
|
6337
|
-
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));
|
6338
6452
|
continue;
|
6339
6453
|
}
|
6340
|
-
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) {
|
6341
6455
|
return a.name === c;
|
6342
6456
|
})) && (a.material.color.setHex(16776960), a.material.opacity = 1);
|
6343
6457
|
}
|
6344
6458
|
super.updateMatrixWorld(e);
|
6345
6459
|
}
|
6346
6460
|
}
|
6347
|
-
class
|
6461
|
+
class _o extends M {
|
6348
6462
|
constructor() {
|
6349
6463
|
super(
|
6350
|
-
new
|
6351
|
-
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 })
|
6352
6466
|
), this.isTransformControlsPlane = !0, this.type = "TransformControlsPlane";
|
6353
6467
|
}
|
6354
6468
|
updateMatrixWorld(e) {
|
6355
6469
|
let t = this.space;
|
6356
|
-
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) {
|
6357
6471
|
case "translate":
|
6358
6472
|
case "scale":
|
6359
6473
|
switch (this.axis) {
|
6360
6474
|
case "X":
|
6361
|
-
X.copy(this.eye).cross(
|
6475
|
+
X.copy(this.eye).cross(Jt), Re.copy(Jt).cross(X);
|
6362
6476
|
break;
|
6363
6477
|
case "Y":
|
6364
|
-
X.copy(this.eye).cross(
|
6478
|
+
X.copy(this.eye).cross(Dt), Re.copy(Dt).cross(X);
|
6365
6479
|
break;
|
6366
6480
|
case "Z":
|
6367
|
-
X.copy(this.eye).cross(
|
6481
|
+
X.copy(this.eye).cross(Rt), Re.copy(Rt).cross(X);
|
6368
6482
|
break;
|
6369
6483
|
case "XY":
|
6370
|
-
Re.copy(
|
6484
|
+
Re.copy(Rt);
|
6371
6485
|
break;
|
6372
6486
|
case "YZ":
|
6373
|
-
Re.copy(
|
6487
|
+
Re.copy(Jt);
|
6374
6488
|
break;
|
6375
6489
|
case "XZ":
|
6376
|
-
X.copy(
|
6490
|
+
X.copy(Rt), Re.copy(Dt);
|
6377
6491
|
break;
|
6378
6492
|
case "XYZ":
|
6379
6493
|
case "E":
|
@@ -6385,10 +6499,10 @@ class ao extends M {
|
|
6385
6499
|
default:
|
6386
6500
|
Re.set(0, 0, 0);
|
6387
6501
|
}
|
6388
|
-
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);
|
6389
6503
|
}
|
6390
6504
|
}
|
6391
|
-
class ge extends
|
6505
|
+
class ge extends Yi {
|
6392
6506
|
static DRAG_START = "Transform::dragStart";
|
6393
6507
|
static DRAG_END = "Transform::dragEnd";
|
6394
6508
|
static _instance;
|
@@ -6397,7 +6511,7 @@ class ge extends zi {
|
|
6397
6511
|
controls = /* @__PURE__ */ new Map();
|
6398
6512
|
visibility = /* @__PURE__ */ new Map();
|
6399
6513
|
constructor() {
|
6400
|
-
super(), D.addEventListener(
|
6514
|
+
super(), D.addEventListener(A.SET_SCENE, this.setScene);
|
6401
6515
|
}
|
6402
6516
|
clear() {
|
6403
6517
|
for (const e of this.controls.values()) {
|
@@ -6411,7 +6525,7 @@ class ge extends zi {
|
|
6411
6525
|
let t = this.controls.get(e);
|
6412
6526
|
if (t === void 0) {
|
6413
6527
|
const i = document.querySelector(".clickable");
|
6414
|
-
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", () => {
|
6415
6529
|
this.dispatchEvent({ type: ge.DRAG_START });
|
6416
6530
|
}), t.addEventListener("mouseUp", () => {
|
6417
6531
|
this.dispatchEvent({ type: ge.DRAG_END });
|
@@ -6457,9 +6571,9 @@ class ge extends zi {
|
|
6457
6571
|
return ge._instance || (ge._instance = new ge()), ge._instance;
|
6458
6572
|
}
|
6459
6573
|
}
|
6460
|
-
const
|
6461
|
-
class
|
6462
|
-
curve = new
|
6574
|
+
const vo = new de(), Ri = new pe();
|
6575
|
+
class Vs extends vt {
|
6576
|
+
curve = new cs();
|
6463
6577
|
line;
|
6464
6578
|
draggable;
|
6465
6579
|
curvePos;
|
@@ -6479,8 +6593,8 @@ class Hs extends _t {
|
|
6479
6593
|
parentGroup;
|
6480
6594
|
group;
|
6481
6595
|
constructor(e, t) {
|
6482
|
-
const i = new et(
|
6483
|
-
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();
|
6484
6598
|
}
|
6485
6599
|
enable() {
|
6486
6600
|
document.addEventListener("pointerdown", this.onMouseClick);
|
@@ -6497,8 +6611,8 @@ class Hs extends _t {
|
|
6497
6611
|
exportSpline = () => {
|
6498
6612
|
const e = [];
|
6499
6613
|
this.draggable.children.forEach((t) => {
|
6500
|
-
e.push([
|
6501
|
-
}),
|
6614
|
+
e.push([Pe(t.position.x, 3), Pe(t.position.y, 3), Pe(t.position.z, 3)]);
|
6615
|
+
}), Na({
|
6502
6616
|
name: this.name,
|
6503
6617
|
points: e,
|
6504
6618
|
tension: this.tension,
|
@@ -6518,17 +6632,17 @@ class Hs extends _t {
|
|
6518
6632
|
this.addPoint(e[i], !1);
|
6519
6633
|
this.addPoint(e[t]);
|
6520
6634
|
} else
|
6521
|
-
this.addPoint(new
|
6635
|
+
this.addPoint(new P(-50, 0, 0), !1), this.addPoint(new P(50, 0, 0));
|
6522
6636
|
};
|
6523
6637
|
addPoint = (e, t = !0) => {
|
6524
|
-
const i = this.draggable.children.length, n = new M(
|
6638
|
+
const i = this.draggable.children.length, n = new M(vo, this.draggedMat);
|
6525
6639
|
return n.name = `point_${i}`, n.position.copy(e), n.scale.setScalar(this._draggableScale), this.draggable.add(n), t && this.updateSpline(), n;
|
6526
6640
|
};
|
6527
6641
|
addNextPt = () => {
|
6528
|
-
const e = this.draggable.children.length, t = new
|
6529
|
-
|
6530
|
-
|
6531
|
-
|
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())
|
6532
6646
|
);
|
6533
6647
|
e > 0 && t.add(this.draggable.children[e - 1].position);
|
6534
6648
|
const i = this.addPoint(t);
|
@@ -6550,14 +6664,14 @@ class Hs extends _t {
|
|
6550
6664
|
this._transform?.object !== void 0 && this.removePoint(this._transform?.object);
|
6551
6665
|
};
|
6552
6666
|
updateSpline = () => {
|
6553
|
-
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));
|
6554
6668
|
};
|
6555
6669
|
// Handlers
|
6556
6670
|
onMouseClick = (e) => {
|
6557
6671
|
if (!me.instance || this._transform && !this._transform.getHelper().visible)
|
6558
6672
|
return;
|
6559
6673
|
const i = me.instance.currentWindow.current.getBoundingClientRect();
|
6560
|
-
|
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);
|
6561
6675
|
const n = this.raycaster.intersectObjects(this.draggable.children, !1);
|
6562
6676
|
if (n.length > 0) {
|
6563
6677
|
const r = n[0].object;
|
@@ -6790,13 +6904,13 @@ class Hs extends _t {
|
|
6790
6904
|
e.name, e.visible = this.draggable.visible;
|
6791
6905
|
};
|
6792
6906
|
}
|
6793
|
-
let
|
6794
|
-
class
|
6907
|
+
let ei = 0;
|
6908
|
+
class yo extends vt {
|
6795
6909
|
defaultScale = 10;
|
6796
6910
|
_camera;
|
6797
6911
|
group = null;
|
6798
6912
|
constructor(e) {
|
6799
|
-
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);
|
6800
6914
|
}
|
6801
6915
|
initDebug() {
|
6802
6916
|
this.group = ae.addEditorGroup({
|
@@ -6844,19 +6958,19 @@ class oo extends _t {
|
|
6844
6958
|
});
|
6845
6959
|
}
|
6846
6960
|
dispose() {
|
6847
|
-
D.removeEventListener(
|
6961
|
+
D.removeEventListener(A.ADD_SPLINE, this.onAddSpline), ae.removeEditorGroup(this.name);
|
6848
6962
|
}
|
6849
6963
|
addSpline(e) {
|
6850
6964
|
e.draggableScale = this.defaultScale, e.hideTransform(), this.group?.current !== null && e.initDebug(this.group.current), this.add(e);
|
6851
6965
|
}
|
6852
6966
|
createSpline = (e = []) => {
|
6853
|
-
const t = `Spline ${
|
6854
|
-
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;
|
6855
6969
|
};
|
6856
6970
|
createSplineFromArray = (e) => {
|
6857
6971
|
const t = [];
|
6858
6972
|
return e.forEach((i) => {
|
6859
|
-
t.push(new
|
6973
|
+
t.push(new P(i[0], i[1], i[2]));
|
6860
6974
|
}), this.createSpline(t);
|
6861
6975
|
};
|
6862
6976
|
createSplineFromCatmullRom = (e) => this.createSpline(e.points);
|
@@ -6870,12 +6984,12 @@ class oo extends _t {
|
|
6870
6984
|
});
|
6871
6985
|
};
|
6872
6986
|
onAddSpline = (e) => {
|
6873
|
-
const t = JSON.parse(e.value), i = `Spline ${
|
6987
|
+
const t = JSON.parse(e.value), i = `Spline ${ei + 1}`, n = [];
|
6874
6988
|
t.points.forEach((a) => {
|
6875
|
-
n.push(new
|
6989
|
+
n.push(new P(a[0], a[1], a[2]));
|
6876
6990
|
});
|
6877
|
-
const r = new
|
6878
|
-
r.addPoints(n), this.addSpline(r),
|
6991
|
+
const r = new Vs(i, this.camera);
|
6992
|
+
r.addPoints(n), this.addSpline(r), ei++;
|
6879
6993
|
};
|
6880
6994
|
get camera() {
|
6881
6995
|
return this._camera;
|
@@ -6887,15 +7001,15 @@ class oo extends _t {
|
|
6887
7001
|
});
|
6888
7002
|
}
|
6889
7003
|
}
|
6890
|
-
const
|
7004
|
+
const Zs = [
|
6891
7005
|
"Single",
|
6892
7006
|
"Side by Side",
|
6893
7007
|
"Stacked",
|
6894
7008
|
"Quad"
|
6895
|
-
],
|
6896
|
-
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 {
|
6897
7011
|
static instance = null;
|
6898
|
-
scene = new
|
7012
|
+
scene = new Gs();
|
6899
7013
|
renderer;
|
6900
7014
|
currentScene;
|
6901
7015
|
cameras = /* @__PURE__ */ new Map();
|
@@ -6905,17 +7019,17 @@ class me extends Nt {
|
|
6905
7019
|
// RefObject to one of the "windows"
|
6906
7020
|
cameraHelpers = /* @__PURE__ */ new Map();
|
6907
7021
|
lightHelpers = /* @__PURE__ */ new Map();
|
6908
|
-
helpersContainer = new
|
6909
|
-
grid = new
|
6910
|
-
axisHelper = new
|
6911
|
-
interactionHelper = new
|
7022
|
+
helpersContainer = new ma();
|
7023
|
+
grid = new no();
|
7024
|
+
axisHelper = new hs(500);
|
7025
|
+
interactionHelper = new hs(100);
|
6912
7026
|
currentTransform;
|
6913
7027
|
// Tools
|
6914
7028
|
splineEditor;
|
6915
7029
|
// Override Materials
|
6916
|
-
depthMaterial = new
|
6917
|
-
normalsMaterial = new
|
6918
|
-
uvMaterial = new
|
7030
|
+
depthMaterial = new fa();
|
7031
|
+
normalsMaterial = new ga();
|
7032
|
+
uvMaterial = new oo();
|
6919
7033
|
wireframeMaterial = new Je({
|
6920
7034
|
opacity: 0.33,
|
6921
7035
|
transparent: !0,
|
@@ -6942,7 +7056,7 @@ class me extends Nt {
|
|
6942
7056
|
// Interactions
|
6943
7057
|
selectedItem = void 0;
|
6944
7058
|
debugCamera;
|
6945
|
-
raycaster = new
|
7059
|
+
raycaster = new ni();
|
6946
7060
|
pointer = new pe();
|
6947
7061
|
cameraControls = void 0;
|
6948
7062
|
// References
|
@@ -6965,14 +7079,14 @@ class me extends Nt {
|
|
6965
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");
|
6966
7080
|
const r = {
|
6967
7081
|
Vector2: pe,
|
6968
|
-
Vector3:
|
6969
|
-
Vector4:
|
6970
|
-
Quaternion:
|
6971
|
-
Matrix4:
|
6972
|
-
Spherical:
|
6973
|
-
Box3:
|
6974
|
-
Sphere:
|
6975
|
-
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
|
6976
7090
|
};
|
6977
7091
|
ke.install({ THREE: r }), this.setupScene(), this.setupTools();
|
6978
7092
|
const a = localStorage.getItem(this.expandedCameraVisibility);
|
@@ -7122,11 +7236,11 @@ class me extends Nt {
|
|
7122
7236
|
] }),
|
7123
7237
|
/* @__PURE__ */ u.jsxs("div", { className: "settings", children: [
|
7124
7238
|
/* @__PURE__ */ u.jsx(
|
7125
|
-
|
7239
|
+
li,
|
7126
7240
|
{
|
7127
7241
|
title: "View",
|
7128
|
-
index:
|
7129
|
-
options:
|
7242
|
+
index: Zs.indexOf(this.state.mode),
|
7243
|
+
options: Zs,
|
7130
7244
|
onSelect: (t) => {
|
7131
7245
|
t !== this.state.mode && (this.killControls(), this.setState({ mode: t }), localStorage.setItem(`${this.appID}_mode`, t));
|
7132
7246
|
},
|
@@ -7141,7 +7255,7 @@ class me extends Nt {
|
|
7141
7255
|
}
|
7142
7256
|
),
|
7143
7257
|
/* @__PURE__ */ u.jsx(
|
7144
|
-
|
7258
|
+
li,
|
7145
7259
|
{
|
7146
7260
|
title: "Interact",
|
7147
7261
|
index: this.state.interactionMode === "Orbit" ? 0 : 1,
|
@@ -7163,10 +7277,10 @@ class me extends Nt {
|
|
7163
7277
|
}
|
7164
7278
|
),
|
7165
7279
|
/* @__PURE__ */ u.jsx(
|
7166
|
-
|
7280
|
+
Us,
|
7167
7281
|
{
|
7168
7282
|
name: "cameraHelper",
|
7169
|
-
icon:
|
7283
|
+
icon: bo,
|
7170
7284
|
selected: this.cameraVisibility,
|
7171
7285
|
height: 24,
|
7172
7286
|
top: 2,
|
@@ -7181,10 +7295,10 @@ class me extends Nt {
|
|
7181
7295
|
}
|
7182
7296
|
),
|
7183
7297
|
/* @__PURE__ */ u.jsx(
|
7184
|
-
|
7298
|
+
Us,
|
7185
7299
|
{
|
7186
7300
|
name: "lightHelper",
|
7187
|
-
icon:
|
7301
|
+
icon: Eo,
|
7188
7302
|
selected: this.lightVisibility,
|
7189
7303
|
height: 24,
|
7190
7304
|
top: 4,
|
@@ -7203,7 +7317,7 @@ class me extends Nt {
|
|
7203
7317
|
}
|
7204
7318
|
// Setup
|
7205
7319
|
setupRenderer() {
|
7206
|
-
this.renderer = new
|
7320
|
+
this.renderer = new _a({
|
7207
7321
|
canvas: this.canvasRef.current,
|
7208
7322
|
stencil: !1
|
7209
7323
|
}), this.renderer.autoClear = !1, this.renderer.shadowMap.enabled = !0, this.renderer.setPixelRatio(devicePixelRatio), this.renderer.setClearColor(0), this.props.three.renderer = this.renderer;
|
@@ -7211,15 +7325,15 @@ class me extends Nt {
|
|
7211
7325
|
setupScene() {
|
7212
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;
|
7213
7327
|
const e = (n, r) => {
|
7214
|
-
const a = new
|
7328
|
+
const a = new Ii(-100, 100, 100, -100, 50, 5e3);
|
7215
7329
|
return a.name = n, a.position.copy(r), a.lookAt(0, 0, 0), this.cameras.set(n, a), a;
|
7216
7330
|
};
|
7217
|
-
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;
|
7218
7332
|
const t = localStorage, i = this.props.three.app.appID;
|
7219
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"));
|
7220
7334
|
}
|
7221
7335
|
setupTools() {
|
7222
|
-
this.splineEditor = new
|
7336
|
+
this.splineEditor = new yo(this.currentCamera), this.splineEditor.initDebug(), this.scene.add(this.splineEditor);
|
7223
7337
|
}
|
7224
7338
|
// Public
|
7225
7339
|
play() {
|
@@ -7263,11 +7377,11 @@ class me extends Nt {
|
|
7263
7377
|
// Events
|
7264
7378
|
enable() {
|
7265
7379
|
const e = this.containerRef.current;
|
7266
|
-
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);
|
7267
7381
|
}
|
7268
7382
|
disable() {
|
7269
7383
|
const e = this.containerRef.current;
|
7270
|
-
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);
|
7271
7385
|
}
|
7272
7386
|
resize = () => {
|
7273
7387
|
this.width = window.innerWidth - 300, this.height = window.innerHeight;
|
@@ -7287,7 +7401,7 @@ class me extends Nt {
|
|
7287
7401
|
}
|
7288
7402
|
const r = i / n;
|
7289
7403
|
this.cameras.forEach((a) => {
|
7290
|
-
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());
|
7291
7405
|
});
|
7292
7406
|
};
|
7293
7407
|
sceneUpdate = (e) => {
|
@@ -7301,7 +7415,7 @@ class me extends Nt {
|
|
7301
7415
|
addCamera = (e) => {
|
7302
7416
|
const t = e.value, i = this.props.three.scene?.getObjectByProperty("uuid", t.uuid);
|
7303
7417
|
if (i !== void 0 && this.cameras.set(t.name, i), i instanceof Ct) {
|
7304
|
-
const n = new
|
7418
|
+
const n = new va(i);
|
7305
7419
|
n.visible = this.cameraVisibility, this.cameraHelpers.set(i.name, n), this.scene.add(n);
|
7306
7420
|
}
|
7307
7421
|
this.setState({ lastUpdate: Date.now() });
|
@@ -7314,11 +7428,11 @@ class me extends Nt {
|
|
7314
7428
|
const t = new pe();
|
7315
7429
|
this.renderer.getSize(t);
|
7316
7430
|
const i = Math.min(e.clientX, t.x), n = Math.min(e.clientY, t.y);
|
7317
|
-
this.pointer.x =
|
7431
|
+
this.pointer.x = ot(i, 0, t.x, -1, 1), this.pointer.y = ot(n, 0, t.y, 1, -1);
|
7318
7432
|
const r = t.x / 2, a = t.y / 2, o = () => {
|
7319
|
-
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);
|
7320
7434
|
}, c = () => {
|
7321
|
-
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);
|
7322
7436
|
};
|
7323
7437
|
switch (this.state.mode) {
|
7324
7438
|
case "Quad":
|
@@ -7352,7 +7466,7 @@ class me extends Nt {
|
|
7352
7466
|
if (this.currentCamera.name === "UI")
|
7353
7467
|
return;
|
7354
7468
|
const t = this.controls.get(this.currentCamera.name);
|
7355
|
-
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));
|
7356
7470
|
} else if (this.currentTransform !== void 0)
|
7357
7471
|
switch (e.key) {
|
7358
7472
|
case "r":
|
@@ -7389,7 +7503,7 @@ class me extends Nt {
|
|
7389
7503
|
x: this.selectedItem.rotation.x,
|
7390
7504
|
y: this.selectedItem.rotation.y,
|
7391
7505
|
z: this.selectedItem.rotation.z
|
7392
|
-
}), 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());
|
7393
7507
|
};
|
7394
7508
|
// Utils
|
7395
7509
|
clearLightHelpers = () => {
|
@@ -7403,19 +7517,19 @@ class me extends Nt {
|
|
7403
7517
|
let t;
|
7404
7518
|
switch (e.type) {
|
7405
7519
|
case "DirectionalLight":
|
7406
|
-
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);
|
7407
7521
|
break;
|
7408
7522
|
case "HemisphereLight":
|
7409
|
-
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);
|
7410
7524
|
break;
|
7411
7525
|
case "RectAreaLight":
|
7412
|
-
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);
|
7413
7527
|
break;
|
7414
7528
|
case "PointLight":
|
7415
|
-
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);
|
7416
7530
|
break;
|
7417
7531
|
case "SpotLight":
|
7418
|
-
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);
|
7419
7533
|
break;
|
7420
7534
|
}
|
7421
7535
|
}
|
@@ -7425,7 +7539,7 @@ class me extends Nt {
|
|
7425
7539
|
const i = this.controls.get(e.name);
|
7426
7540
|
if (i !== void 0 && i.dispose(), this.controls.delete(e.name), e.name === "UI")
|
7427
7541
|
return;
|
7428
|
-
const n = new
|
7542
|
+
const n = new Hr(e, t);
|
7429
7543
|
switch (n.enableDamping = !0, n.dampingFactor = 0.05, e.name) {
|
7430
7544
|
case "Top":
|
7431
7545
|
case "Bottom":
|
@@ -7486,11 +7600,11 @@ class me extends Nt {
|
|
7486
7600
|
if (this.selectedItem === void 0)
|
7487
7601
|
return;
|
7488
7602
|
cancelAnimationFrame(this.cameraControlsRafID), this.cameraControlsRafID = -1, this.cameraControls && (this.cameraControls.smoothTime = 0.1);
|
7489
|
-
const i = 0.15, n = new
|
7603
|
+
const i = 0.15, n = new wa();
|
7490
7604
|
n.start(), this.selectedItem.getWorldPosition(e.target0);
|
7491
7605
|
const r = () => {
|
7492
7606
|
const a = n.getDelta();
|
7493
|
-
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);
|
7494
7608
|
};
|
7495
7609
|
r();
|
7496
7610
|
};
|
@@ -7554,12 +7668,12 @@ class me extends Nt {
|
|
7554
7668
|
return `${this.appID}_multiviewLightVisibility`;
|
7555
7669
|
}
|
7556
7670
|
}
|
7557
|
-
class
|
7671
|
+
class di extends Ft {
|
7558
7672
|
static instance;
|
7559
|
-
matrix = new
|
7560
|
-
position = new
|
7561
|
-
rotation = new
|
7562
|
-
scale = new
|
7673
|
+
matrix = new ci();
|
7674
|
+
position = new P();
|
7675
|
+
rotation = new pn();
|
7676
|
+
scale = new P();
|
7563
7677
|
open = !1;
|
7564
7678
|
constructor(e) {
|
7565
7679
|
super(e);
|
@@ -7567,14 +7681,14 @@ class hi extends Nt {
|
|
7567
7681
|
this.open = i, this.saveExpanded(), this.state = {
|
7568
7682
|
lastUpdated: 0,
|
7569
7683
|
expanded: i
|
7570
|
-
}, 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;
|
7571
7685
|
}
|
7572
7686
|
update() {
|
7573
7687
|
if (me.instance) {
|
7574
7688
|
const e = me.instance.selectedItem;
|
7575
7689
|
if (e === void 0)
|
7576
7690
|
return;
|
7577
|
-
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() });
|
7578
7692
|
}
|
7579
7693
|
}
|
7580
7694
|
render() {
|
@@ -7637,7 +7751,7 @@ class hi extends Nt {
|
|
7637
7751
|
return `${this.props.three.app.appID}_transform`;
|
7638
7752
|
}
|
7639
7753
|
}
|
7640
|
-
function
|
7754
|
+
function Ws(s) {
|
7641
7755
|
switch (s) {
|
7642
7756
|
case "color":
|
7643
7757
|
return "Color";
|
@@ -7660,7 +7774,7 @@ function Bs(s) {
|
|
7660
7774
|
}
|
7661
7775
|
return s;
|
7662
7776
|
}
|
7663
|
-
function
|
7777
|
+
function Co(s, e) {
|
7664
7778
|
function t() {
|
7665
7779
|
return `${e.app.appID}_light`;
|
7666
7780
|
}
|
@@ -7673,7 +7787,7 @@ function ho(s, e) {
|
|
7673
7787
|
for (const o in s.lightInfo) {
|
7674
7788
|
const c = s.lightInfo[o];
|
7675
7789
|
c !== void 0 && (c.isColor !== void 0 ? a.push({
|
7676
|
-
title:
|
7790
|
+
title: Ws(o),
|
7677
7791
|
prop: o,
|
7678
7792
|
type: "color",
|
7679
7793
|
value: c,
|
@@ -7687,7 +7801,7 @@ function ho(s, e) {
|
|
7687
7801
|
}
|
7688
7802
|
}
|
7689
7803
|
}) : a.push({
|
7690
|
-
title:
|
7804
|
+
title: Ws(o),
|
7691
7805
|
prop: o,
|
7692
7806
|
type: typeof c,
|
7693
7807
|
value: c,
|
@@ -7714,7 +7828,7 @@ function ho(s, e) {
|
|
7714
7828
|
}
|
7715
7829
|
);
|
7716
7830
|
}
|
7717
|
-
function
|
7831
|
+
function So(s) {
|
7718
7832
|
const e = s.object, t = s.three;
|
7719
7833
|
function i() {
|
7720
7834
|
return `${t.app.appID}_animation`;
|
@@ -7785,7 +7899,7 @@ function uo(s) {
|
|
7785
7899
|
}), o.push({
|
7786
7900
|
title: "Mixer",
|
7787
7901
|
items: y
|
7788
|
-
}), d = new
|
7902
|
+
}), d = new Ma(m), me.instance?.scene.add(d);
|
7789
7903
|
}
|
7790
7904
|
}
|
7791
7905
|
}
|
@@ -7803,7 +7917,7 @@ function uo(s) {
|
|
7803
7917
|
}
|
7804
7918
|
);
|
7805
7919
|
}
|
7806
|
-
const
|
7920
|
+
const Hi = {
|
7807
7921
|
name: "",
|
7808
7922
|
uuid: "",
|
7809
7923
|
type: "",
|
@@ -7816,32 +7930,32 @@ const Fi = {
|
|
7816
7930
|
lightInfo: void 0,
|
7817
7931
|
children: []
|
7818
7932
|
};
|
7819
|
-
let ce = { ...
|
7820
|
-
function
|
7933
|
+
let ce = { ...Hi };
|
7934
|
+
function wo(s) {
|
7821
7935
|
const [e, t] = Z(-1);
|
7822
7936
|
tt(() => {
|
7823
7937
|
function a(c) {
|
7824
7938
|
ce = { ...c.value }, t(Date.now());
|
7825
7939
|
}
|
7826
7940
|
function o() {
|
7827
|
-
ce = { ...
|
7941
|
+
ce = { ...Hi }, t(Date.now());
|
7828
7942
|
}
|
7829
|
-
return D.addEventListener(
|
7830
|
-
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);
|
7831
7945
|
};
|
7832
7946
|
}, []);
|
7833
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;
|
7834
7948
|
return /* @__PURE__ */ u.jsx(
|
7835
|
-
|
7949
|
+
oi,
|
7836
7950
|
{
|
7837
7951
|
label: "Inspector",
|
7838
7952
|
button: ce.uuid.length > 0 ? /* @__PURE__ */ u.jsx("button", { className: "remove", onClick: () => {
|
7839
|
-
ge.instance.remove(ce.name), ce = { ...
|
7953
|
+
ge.instance.remove(ce.name), ce = { ...Hi }, t(Date.now());
|
7840
7954
|
} }) : void 0,
|
7841
7955
|
children: /* @__PURE__ */ u.jsx("div", { id: "Inspector", className: s.class, children: ce.uuid.length > 0 && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
7842
7956
|
/* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
7843
7957
|
/* @__PURE__ */ u.jsx(
|
7844
|
-
|
7958
|
+
ii,
|
7845
7959
|
{
|
7846
7960
|
type: "string",
|
7847
7961
|
title: "Name",
|
@@ -7851,7 +7965,7 @@ function po(s) {
|
|
7851
7965
|
}
|
7852
7966
|
),
|
7853
7967
|
/* @__PURE__ */ u.jsx(
|
7854
|
-
|
7968
|
+
ii,
|
7855
7969
|
{
|
7856
7970
|
type: "string",
|
7857
7971
|
title: "Type",
|
@@ -7861,7 +7975,7 @@ function po(s) {
|
|
7861
7975
|
}
|
7862
7976
|
),
|
7863
7977
|
/* @__PURE__ */ u.jsx(
|
7864
|
-
|
7978
|
+
ii,
|
7865
7979
|
{
|
7866
7980
|
type: "string",
|
7867
7981
|
title: "UUID",
|
@@ -7872,28 +7986,28 @@ function po(s) {
|
|
7872
7986
|
)
|
7873
7987
|
] }),
|
7874
7988
|
/* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
7875
|
-
/* @__PURE__ */ u.jsx(
|
7876
|
-
n ? /* @__PURE__ */ u.jsx(
|
7877
|
-
i.search("camera") > -1 ?
|
7878
|
-
i.search("light") > -1 ?
|
7879
|
-
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
|
7880
7994
|
] })
|
7881
7995
|
] }) }, e)
|
7882
7996
|
},
|
7883
7997
|
"Inspector"
|
7884
7998
|
);
|
7885
7999
|
}
|
7886
|
-
class
|
8000
|
+
class xo extends Ft {
|
7887
8001
|
// Renderer
|
7888
8002
|
autoClear = !0;
|
7889
8003
|
autoClearColor = !0;
|
7890
8004
|
autoClearDepth = !0;
|
7891
8005
|
autoClearStencil = !0;
|
7892
|
-
outputColorSpace =
|
8006
|
+
outputColorSpace = ds;
|
7893
8007
|
localClippingEnabled = !1;
|
7894
8008
|
clearColor = new et(0);
|
7895
8009
|
clearAlpha = 1;
|
7896
|
-
toneMapping =
|
8010
|
+
toneMapping = us;
|
7897
8011
|
toneMappingExposure = 1;
|
7898
8012
|
constructor(e) {
|
7899
8013
|
super(e);
|
@@ -7905,14 +8019,14 @@ class mo extends Nt {
|
|
7905
8019
|
const n = me.instance.renderer;
|
7906
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));
|
7907
8021
|
}
|
7908
|
-
D.addEventListener(
|
8022
|
+
D.addEventListener(A.ADD_RENDERER, this.onAddRenderer);
|
7909
8023
|
}
|
7910
8024
|
componentwillunmount() {
|
7911
|
-
D.removeEventListener(
|
8025
|
+
D.removeEventListener(A.ADD_RENDERER, this.onAddRenderer);
|
7912
8026
|
}
|
7913
8027
|
onAddRenderer = (e) => {
|
7914
8028
|
const t = e.value;
|
7915
|
-
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) {
|
7916
8030
|
const i = me.instance.renderer;
|
7917
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));
|
7918
8032
|
}
|
@@ -7931,7 +8045,7 @@ class mo extends Nt {
|
|
7931
8045
|
localClippingEnabled: this.localClippingEnabled,
|
7932
8046
|
clearAlpha: this.clearAlpha,
|
7933
8047
|
clearColor: this.clearColor.getStyle(),
|
7934
|
-
colorManagement:
|
8048
|
+
colorManagement: mt.enabled,
|
7935
8049
|
toneMapping: this.toneMapping,
|
7936
8050
|
toneMappingExposure: this.toneMappingExposure
|
7937
8051
|
}));
|
@@ -8005,9 +8119,9 @@ class mo extends Nt {
|
|
8005
8119
|
{
|
8006
8120
|
type: "boolean",
|
8007
8121
|
title: "Clear Management",
|
8008
|
-
value:
|
8122
|
+
value: mt.enabled,
|
8009
8123
|
onChange: (t, i) => {
|
8010
|
-
|
8124
|
+
mt.enabled = i, e();
|
8011
8125
|
}
|
8012
8126
|
},
|
8013
8127
|
{
|
@@ -8017,15 +8131,15 @@ class mo extends Nt {
|
|
8017
8131
|
options: [
|
8018
8132
|
{
|
8019
8133
|
title: "No Color Space",
|
8020
|
-
value:
|
8134
|
+
value: Pa
|
8021
8135
|
},
|
8022
8136
|
{
|
8023
8137
|
title: "SRB Color Space",
|
8024
|
-
value:
|
8138
|
+
value: ds
|
8025
8139
|
},
|
8026
8140
|
{
|
8027
8141
|
title: "Linear SRB Color Space",
|
8028
|
-
value:
|
8142
|
+
value: Nt
|
8029
8143
|
}
|
8030
8144
|
],
|
8031
8145
|
onChange: (t, i) => {
|
@@ -8039,35 +8153,35 @@ class mo extends Nt {
|
|
8039
8153
|
options: [
|
8040
8154
|
{
|
8041
8155
|
title: "None ",
|
8042
|
-
value:
|
8156
|
+
value: us
|
8043
8157
|
},
|
8044
8158
|
{
|
8045
8159
|
title: "Linear ",
|
8046
|
-
value:
|
8160
|
+
value: Aa
|
8047
8161
|
},
|
8048
8162
|
{
|
8049
8163
|
title: "Reinhard",
|
8050
|
-
value:
|
8164
|
+
value: Da
|
8051
8165
|
},
|
8052
8166
|
{
|
8053
8167
|
title: "Cineon ",
|
8054
|
-
value:
|
8168
|
+
value: Ra
|
8055
8169
|
},
|
8056
8170
|
{
|
8057
8171
|
title: "ACES Filmic",
|
8058
|
-
value:
|
8172
|
+
value: Ia
|
8059
8173
|
},
|
8060
8174
|
{
|
8061
8175
|
title: "AgX",
|
8062
|
-
value:
|
8176
|
+
value: La
|
8063
8177
|
},
|
8064
8178
|
{
|
8065
8179
|
title: "Neutral",
|
8066
|
-
value:
|
8180
|
+
value: ka
|
8067
8181
|
},
|
8068
8182
|
{
|
8069
8183
|
title: "Custom",
|
8070
|
-
value:
|
8184
|
+
value: Ua
|
8071
8185
|
}
|
8072
8186
|
],
|
8073
8187
|
onChange: (t, i) => {
|
@@ -8100,12 +8214,12 @@ class mo extends Nt {
|
|
8100
8214
|
return `${this.props.three.app.appID}_renderer`;
|
8101
8215
|
}
|
8102
8216
|
}
|
8103
|
-
function
|
8217
|
+
function Oo(s) {
|
8104
8218
|
const [e] = Z([]), [t] = Z([]), [i, n] = Z(0), r = (c) => {
|
8105
8219
|
const l = c.value;
|
8106
8220
|
e.push(l), t.push(
|
8107
8221
|
/* @__PURE__ */ u.jsx(
|
8108
|
-
|
8222
|
+
oi,
|
8109
8223
|
{
|
8110
8224
|
label: `Scene: ${l.name}`,
|
8111
8225
|
scene: l,
|
@@ -8113,7 +8227,7 @@ function fo(s) {
|
|
8113
8227
|
onRefresh: () => {
|
8114
8228
|
s.three.refreshScene(l.name);
|
8115
8229
|
},
|
8116
|
-
children: /* @__PURE__ */ u.jsx(
|
8230
|
+
children: /* @__PURE__ */ u.jsx(Es, { child: l, scene: l, three: s.three })
|
8117
8231
|
},
|
8118
8232
|
Math.random()
|
8119
8233
|
)
|
@@ -8123,7 +8237,7 @@ function fo(s) {
|
|
8123
8237
|
for (let d = 0; d < e.length; d++)
|
8124
8238
|
if (l.uuid === e[d].uuid) {
|
8125
8239
|
e[d] = l, t[d] = /* @__PURE__ */ u.jsx(
|
8126
|
-
|
8240
|
+
oi,
|
8127
8241
|
{
|
8128
8242
|
label: `Scene: ${l.name}`,
|
8129
8243
|
scene: l,
|
@@ -8131,7 +8245,7 @@ function fo(s) {
|
|
8131
8245
|
onRefresh: () => {
|
8132
8246
|
s.three.refreshScene(l.name);
|
8133
8247
|
},
|
8134
|
-
children: /* @__PURE__ */ u.jsx(
|
8248
|
+
children: /* @__PURE__ */ u.jsx(Es, { child: l, scene: l, three: s.three })
|
8135
8249
|
},
|
8136
8250
|
Math.random()
|
8137
8251
|
), n(Date.now());
|
@@ -8145,16 +8259,16 @@ function fo(s) {
|
|
8145
8259
|
return;
|
8146
8260
|
}
|
8147
8261
|
};
|
8148
|
-
return tt(() => (D.addEventListener(
|
8149
|
-
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);
|
8150
8264
|
}), []), /* @__PURE__ */ u.jsxs("div", { id: "SidePanel", children: [
|
8151
8265
|
/* @__PURE__ */ u.jsx("div", { className: "scenes", children: t }, i),
|
8152
|
-
/* @__PURE__ */ u.jsx(
|
8153
|
-
/* @__PURE__ */ u.jsx(
|
8266
|
+
/* @__PURE__ */ u.jsx(wo, { three: s.three }),
|
8267
|
+
/* @__PURE__ */ u.jsx(xo, { three: s.three }),
|
8154
8268
|
/* @__PURE__ */ u.jsx(ae, { three: s.three })
|
8155
8269
|
] });
|
8156
8270
|
}
|
8157
|
-
function
|
8271
|
+
function Wo(s) {
|
8158
8272
|
return tt(() => {
|
8159
8273
|
function e(o) {
|
8160
8274
|
let c = null;
|
@@ -8195,7 +8309,7 @@ function Io(s) {
|
|
8195
8309
|
}
|
8196
8310
|
d.material.needsUpdate = !0;
|
8197
8311
|
};
|
8198
|
-
c.value.src.length > 0 ?
|
8312
|
+
c.value.src.length > 0 ? vn(c.value.src).then((m) => {
|
8199
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);
|
8200
8314
|
}) : p(null);
|
8201
8315
|
}
|
@@ -8203,25 +8317,25 @@ function Io(s) {
|
|
8203
8317
|
const { key: c, uuid: l, value: d, subitem: p } = o.value, f = e(l)?.getObjectByProperty("uuid", l);
|
8204
8318
|
if (f !== void 0)
|
8205
8319
|
try {
|
8206
|
-
p !== void 0 ?
|
8207
|
-
} catch (
|
8208
|
-
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);
|
8209
8323
|
}
|
8210
8324
|
};
|
8211
|
-
return D.addEventListener(
|
8212
|
-
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);
|
8213
8327
|
};
|
8214
8328
|
}, []), null;
|
8215
8329
|
}
|
8216
|
-
function
|
8330
|
+
function To(s) {
|
8217
8331
|
return /* @__PURE__ */ u.jsxs("div", { className: "editor", ref: s.ref, style: s.style, children: [
|
8218
8332
|
/* @__PURE__ */ u.jsx("div", { className: "header", children: s.header }),
|
8219
8333
|
s.children,
|
8220
8334
|
/* @__PURE__ */ u.jsx("div", { className: "footer", children: s.footer })
|
8221
8335
|
] });
|
8222
8336
|
}
|
8223
|
-
function
|
8224
|
-
return /* @__PURE__ */ u.jsx(
|
8337
|
+
function Go(s) {
|
8338
|
+
return /* @__PURE__ */ u.jsx(To, { children: /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
8225
8339
|
/* @__PURE__ */ u.jsx(
|
8226
8340
|
me,
|
8227
8341
|
{
|
@@ -8232,59 +8346,61 @@ function Lo(s) {
|
|
8232
8346
|
onSceneUpdate: s.onSceneUpdate
|
8233
8347
|
}
|
8234
8348
|
),
|
8235
|
-
/* @__PURE__ */ u.jsx(
|
8349
|
+
/* @__PURE__ */ u.jsx(Oo, { three: s.three })
|
8236
8350
|
] }) });
|
8237
8351
|
}
|
8238
8352
|
export {
|
8239
|
-
|
8240
|
-
|
8241
|
-
|
8242
|
-
|
8243
|
-
|
8244
|
-
|
8245
|
-
|
8246
|
-
|
8247
|
-
|
8248
|
-
|
8249
|
-
|
8250
|
-
|
8251
|
-
|
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,
|
8252
8367
|
me as MultiView,
|
8253
|
-
|
8254
|
-
|
8255
|
-
|
8256
|
-
|
8257
|
-
|
8258
|
-
|
8259
|
-
|
8260
|
-
|
8261
|
-
|
8262
|
-
|
8263
|
-
|
8264
|
-
|
8265
|
-
|
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,
|
8266
8381
|
ge as Transform,
|
8267
|
-
|
8382
|
+
Uo as WebworkerEventHandlers,
|
8383
|
+
ri as capitalize,
|
8268
8384
|
$e as clamp,
|
8269
|
-
|
8270
|
-
|
8271
|
-
|
8385
|
+
ps as colorToHex,
|
8386
|
+
Na as copyToClipboard,
|
8387
|
+
Yo as customizeTheatreElements,
|
8272
8388
|
D as debugDispatcher,
|
8273
|
-
|
8274
|
-
|
8389
|
+
Do as defaultTheatreCallback,
|
8390
|
+
Ro as detectSettings,
|
8275
8391
|
He as dispose,
|
8276
|
-
|
8277
|
-
|
8278
|
-
|
8279
|
-
|
8280
|
-
|
8281
|
-
|
8282
|
-
|
8283
|
-
|
8284
|
-
|
8285
|
-
|
8286
|
-
|
8287
|
-
|
8288
|
-
|
8289
|
-
|
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
|
8290
8406
|
};
|