@tomorrowevening/hermes 0.0.124 → 0.0.126
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 +1064 -943
- package/package.json +4 -5
- package/types/index.d.ts +1 -0
- package/types/utils/three.d.ts +5 -4
- 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, AnimationClip as $n, EventDispatcher as Yi, Texture as Kn, RepeatWrapping as ls, Color as et, ColorManagement as mt, WebGLRenderTarget as qn, FrontSide as Qn, BackSide as Xs, DoubleSide as Bi, NoBlending as Jn, NormalBlending as ea, AdditiveBlending as ta, SubtractiveBlending as ia, MultiplyBlending as sa, CustomBlending as na, AddEquation as aa, SubtractEquation as ra, ReverseSubtractEquation as oa, MinEquation as la, MaxEquation as ca, 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 ha, ConstantColorFactor as rn, OneMinusConstantColorFactor as on, ConstantAlphaFactor as ln, OneMinusConstantAlphaFactor as cn, Line as Ie, LineBasicMaterial as Vi, Ray as da, Plane as ua, MathUtils as pa, 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 ma, 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 fa, AxesHelper as hs, MeshDepthMaterial as ga, MeshNormalMaterial as _a, PerspectiveCamera as Ct, WebGLRenderer as va, CameraHelper as ya, SkinnedMesh as ba, SpotLightHelper as Ea, PointLightHelper as Ca, HemisphereLightHelper as Sa, DirectionalLightHelper as wa, Clock as xa, Vector4 as Oa, Box3 as Ta, Sphere as Ma, SkeletonHelper as Pa, SRGBColorSpace as ds, NoToneMapping as us, NoColorSpace as Aa, LinearToneMapping as Da, ReinhardToneMapping as Ra, CineonToneMapping as Ia, ACESFilmicToneMapping as La, AgXToneMapping as ka, NeutralToneMapping as Ua, CustomToneMapping as ja } 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 Na } from "react";
|
3
|
+
import { Reorder as gn } from "framer-motion";
|
4
|
+
const ai = () => {
|
5
|
+
}, Ro = () => {
|
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 Fa(s) {
|
11
11
|
const e = JSON.stringify(s);
|
12
12
|
return navigator.clipboard.writeText(e), e;
|
13
13
|
}
|
14
|
-
function
|
14
|
+
function za() {
|
15
15
|
return Math.round(Math.random() * 1e6).toString();
|
16
16
|
}
|
17
|
-
function
|
17
|
+
function Ha(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 Ya = ["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 Ba(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 Va(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 Za(s) {
|
125
125
|
return s != null;
|
126
126
|
}
|
127
|
-
const
|
127
|
+
const Wa = ({ 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" ? Ba(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, Va(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(Za).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 = Ya.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 Ga = /* @__PURE__ */ ((s) => (s[s.High = 0] = "High", s[s.Medium = 1] = "Medium", s[s.Low = 2] = "Low", s))(Ga || {});
|
215
|
+
function Io(s) {
|
216
216
|
return new Promise((e) => {
|
217
|
-
|
217
|
+
Wa().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 Lo(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 ko = (s) => {
|
255
255
|
s?.dispose();
|
256
|
-
},
|
256
|
+
}, Xa = (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(), Xa(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,34 +327,153 @@ 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
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
335
|
+
function Uo(s) {
|
336
|
+
return new Promise((e) => {
|
337
|
+
const t = new Gn();
|
338
|
+
t.parseAsync(s.scene).then((i) => {
|
339
|
+
const n = new Xn(i);
|
340
|
+
if (s.animations.length > 0) {
|
341
|
+
const a = s.animations.map((c) => $n.parse(c));
|
342
|
+
n.clipAction(a[0]).play();
|
343
|
+
}
|
344
|
+
const r = [];
|
345
|
+
s.cameras && s.cameras.length > 0 && s.cameras.forEach((a) => {
|
346
|
+
const o = t.parse(a);
|
347
|
+
r.push(o);
|
348
|
+
}), e({
|
349
|
+
model: i,
|
350
|
+
mixer: n,
|
351
|
+
cameras: r
|
352
|
+
});
|
353
|
+
});
|
354
|
+
});
|
355
|
+
}
|
356
|
+
const at = Zi([
|
357
|
+
"ctrlKey",
|
358
|
+
"metaKey",
|
359
|
+
"shiftKey",
|
360
|
+
"button",
|
361
|
+
"pointerId",
|
362
|
+
"pointerType",
|
363
|
+
"clientX",
|
364
|
+
"clientY",
|
365
|
+
"pageX",
|
366
|
+
"pageY"
|
367
|
+
]), $a = Zi([
|
368
|
+
"clientX",
|
369
|
+
"clientY",
|
370
|
+
"deltaX",
|
371
|
+
"deltaY",
|
372
|
+
"deltaMode"
|
373
|
+
]), Ka = Zi([
|
374
|
+
"ctrlKey",
|
375
|
+
"metaKey",
|
376
|
+
"shiftKey",
|
377
|
+
"keyCode"
|
378
|
+
]);
|
379
|
+
function qa(s, e) {
|
380
|
+
s.preventDefault(), $a(s, e);
|
381
|
+
}
|
382
|
+
function Qa(s) {
|
383
|
+
s.preventDefault();
|
384
|
+
}
|
385
|
+
function Ja(s, e, t) {
|
386
|
+
for (const i of e)
|
387
|
+
t[i] = s[i];
|
388
|
+
}
|
389
|
+
function Zi(s) {
|
390
|
+
return function(t, i) {
|
391
|
+
const n = { type: t.type };
|
392
|
+
Ja(t, s, n), i(n);
|
349
393
|
};
|
350
394
|
}
|
351
|
-
|
395
|
+
function bi(s, e) {
|
396
|
+
const t = [], i = { type: s.type, touches: t };
|
397
|
+
for (let n = 0; n < s.touches.length; ++n) {
|
398
|
+
const r = s.touches[n];
|
399
|
+
t.push({
|
400
|
+
pageX: r.pageX,
|
401
|
+
pageY: r.pageY
|
402
|
+
});
|
403
|
+
}
|
404
|
+
e(i);
|
405
|
+
}
|
406
|
+
const er = {
|
407
|
+
37: !0,
|
408
|
+
// left
|
409
|
+
38: !0,
|
410
|
+
// up
|
411
|
+
39: !0,
|
412
|
+
// right
|
413
|
+
40: !0
|
414
|
+
// down
|
415
|
+
};
|
416
|
+
function tr(s, e) {
|
417
|
+
const { keyCode: t } = s;
|
418
|
+
er[t] && (s.preventDefault(), Ka(s, e));
|
419
|
+
}
|
420
|
+
const jo = {
|
421
|
+
contextmenu: Qa,
|
422
|
+
mousedown: at,
|
423
|
+
mousemove: at,
|
424
|
+
mouseup: at,
|
425
|
+
pointerdown: at,
|
426
|
+
pointermove: at,
|
427
|
+
pointerup: at,
|
428
|
+
touchstart: bi,
|
429
|
+
touchmove: bi,
|
430
|
+
touchend: bi,
|
431
|
+
wheel: qa,
|
432
|
+
keydown: tr
|
433
|
+
};
|
434
|
+
let ir = 0;
|
435
|
+
class No {
|
436
|
+
id;
|
437
|
+
worker;
|
438
|
+
constructor(e, t, i) {
|
439
|
+
this.id = ir++, this.worker = t;
|
440
|
+
const n = (a) => {
|
441
|
+
this.worker.postMessage({
|
442
|
+
type: "event",
|
443
|
+
id: this.id,
|
444
|
+
data: a
|
445
|
+
});
|
446
|
+
};
|
447
|
+
t.postMessage({
|
448
|
+
type: "makeProxy",
|
449
|
+
id: this.id
|
450
|
+
});
|
451
|
+
for (const [a, o] of Object.entries(i))
|
452
|
+
e.addEventListener(a, (c) => {
|
453
|
+
o(c, n);
|
454
|
+
});
|
455
|
+
function r() {
|
456
|
+
n({
|
457
|
+
type: "resize",
|
458
|
+
left: 0,
|
459
|
+
top: 0,
|
460
|
+
width: innerWidth,
|
461
|
+
height: innerHeight
|
462
|
+
});
|
463
|
+
}
|
464
|
+
window.addEventListener("resize", r), r();
|
465
|
+
}
|
466
|
+
}
|
467
|
+
class sr extends Yi {
|
352
468
|
style = {};
|
353
469
|
left = 0;
|
354
470
|
top = 0;
|
355
471
|
width = 0;
|
356
472
|
height = 0;
|
357
473
|
ownerDocument = void 0;
|
474
|
+
constructor() {
|
475
|
+
super(), this.ownerDocument = this;
|
476
|
+
}
|
358
477
|
get clientWidth() {
|
359
478
|
return this.width;
|
360
479
|
}
|
@@ -391,7 +510,7 @@ class Za extends zi {
|
|
391
510
|
this.left = e.left, this.top = e.top, this.width = e.width, this.height = e.height;
|
392
511
|
return;
|
393
512
|
}
|
394
|
-
e.preventDefault =
|
513
|
+
e.preventDefault = ai, e.stopPropagation = ai, this.dispatchEvent(e);
|
395
514
|
}
|
396
515
|
focus() {
|
397
516
|
}
|
@@ -399,13 +518,13 @@ class Za extends zi {
|
|
399
518
|
return this;
|
400
519
|
}
|
401
520
|
}
|
402
|
-
class
|
521
|
+
class Fo {
|
403
522
|
targets = {};
|
404
523
|
constructor() {
|
405
524
|
this.handleEvent = this.handleEvent.bind(this);
|
406
525
|
}
|
407
526
|
makeProxy(e) {
|
408
|
-
const { id: t } = e, i = new
|
527
|
+
const { id: t } = e, i = new sr();
|
409
528
|
this.targets[t] = i;
|
410
529
|
}
|
411
530
|
getProxy(e) {
|
@@ -415,7 +534,7 @@ class xo {
|
|
415
534
|
this.targets[e.id]?.handleEvent(e.data);
|
416
535
|
}
|
417
536
|
}
|
418
|
-
class
|
537
|
+
class zo {
|
419
538
|
components = /* @__PURE__ */ new Map();
|
420
539
|
listen;
|
421
540
|
// Protected
|
@@ -473,9 +592,9 @@ class Oo {
|
|
473
592
|
e && (this._mode = "editor");
|
474
593
|
}
|
475
594
|
}
|
476
|
-
var
|
477
|
-
const D = new
|
478
|
-
class
|
595
|
+
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 || {});
|
596
|
+
const D = new Yi();
|
597
|
+
class Wi {
|
479
598
|
app;
|
480
599
|
constructor(e) {
|
481
600
|
this.app = e;
|
@@ -487,7 +606,7 @@ class Bi {
|
|
487
606
|
handleEditor(e, t, i) {
|
488
607
|
}
|
489
608
|
}
|
490
|
-
class
|
609
|
+
class Ho extends Wi {
|
491
610
|
selectDropdown(e, t) {
|
492
611
|
this.app.send({
|
493
612
|
event: "selectComponent",
|
@@ -511,15 +630,15 @@ class To extends Bi {
|
|
511
630
|
handleApp(e, t, i) {
|
512
631
|
switch (i.event) {
|
513
632
|
case "selectComponent":
|
514
|
-
D.dispatchEvent({ type:
|
633
|
+
D.dispatchEvent({ type: A.SELECT_DROPDOWN, value: i.data });
|
515
634
|
break;
|
516
635
|
case "draggableListUpdate":
|
517
|
-
D.dispatchEvent({ type:
|
636
|
+
D.dispatchEvent({ type: A.DRAG_UPDATE, value: i.data });
|
518
637
|
break;
|
519
638
|
}
|
520
639
|
}
|
521
640
|
}
|
522
|
-
function
|
641
|
+
function Yo(s, e, t) {
|
523
642
|
if (s.editor) {
|
524
643
|
t.ui.restore(), t.onSelectionChange((a) => {
|
525
644
|
a.length < 1 || a.forEach((o) => {
|
@@ -562,7 +681,7 @@ function Mo(s, e, t) {
|
|
562
681
|
} else
|
563
682
|
t.ui.hide();
|
564
683
|
}
|
565
|
-
function
|
684
|
+
function Bo() {
|
566
685
|
setTimeout(() => {
|
567
686
|
const s = document.getElementById("theatrejs-studio-root");
|
568
687
|
if (s === null || s.shadowRoot === null)
|
@@ -588,7 +707,7 @@ function Ao() {
|
|
588
707
|
}
|
589
708
|
}, 1e3);
|
590
709
|
}
|
591
|
-
class
|
710
|
+
class Vo extends Wi {
|
592
711
|
project;
|
593
712
|
sheets = /* @__PURE__ */ new Map();
|
594
713
|
sheetObjects = /* @__PURE__ */ new Map();
|
@@ -650,16 +769,16 @@ class Po extends Bi {
|
|
650
769
|
return;
|
651
770
|
const c = `${this.getSheetInstance(e, r)}_${t}`;
|
652
771
|
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 :
|
772
|
+
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
773
|
const d = l.onValuesChange((p) => {
|
655
774
|
if (this.app.editor) {
|
656
775
|
for (const f in p) {
|
657
|
-
const
|
658
|
-
typeof
|
659
|
-
r:
|
660
|
-
g:
|
661
|
-
b:
|
662
|
-
a:
|
776
|
+
const C = p[f];
|
777
|
+
typeof C == "object" && Ha(C) && (p[f] = {
|
778
|
+
r: C.r,
|
779
|
+
g: C.g,
|
780
|
+
b: C.b,
|
781
|
+
a: C.a
|
663
782
|
});
|
664
783
|
}
|
665
784
|
this.app.send({
|
@@ -762,7 +881,7 @@ class Po extends Bi {
|
|
762
881
|
this.studio?.ui.hide();
|
763
882
|
}
|
764
883
|
}
|
765
|
-
function
|
884
|
+
function nr(s) {
|
766
885
|
if (s.name === "cameras")
|
767
886
|
return "camera";
|
768
887
|
if (s.name === "interactive")
|
@@ -776,7 +895,7 @@ function Wa(s) {
|
|
776
895
|
const e = s.type;
|
777
896
|
return e.search("Helper") > -1 ? "icon_utils" : e.search("Camera") > -1 ? "camera" : e.search("Light") > -1 ? "light" : "obj3D";
|
778
897
|
}
|
779
|
-
function
|
898
|
+
function pt(s) {
|
780
899
|
const e = {
|
781
900
|
name: s.name,
|
782
901
|
type: s.type,
|
@@ -784,10 +903,10 @@ function ut(s) {
|
|
784
903
|
children: []
|
785
904
|
};
|
786
905
|
return s.children.forEach((t) => {
|
787
|
-
e.children.push(
|
906
|
+
e.children.push(pt(t));
|
788
907
|
}), e;
|
789
908
|
}
|
790
|
-
function
|
909
|
+
function ar(s) {
|
791
910
|
const e = {};
|
792
911
|
for (const t in s) {
|
793
912
|
const i = s[t].value;
|
@@ -803,7 +922,7 @@ function Ga(s) {
|
|
803
922
|
}
|
804
923
|
return e;
|
805
924
|
}
|
806
|
-
function
|
925
|
+
function rr(s) {
|
807
926
|
switch (s) {
|
808
927
|
case "blendSrcAlpha":
|
809
928
|
case "blendDstAlpha":
|
@@ -815,10 +934,10 @@ function Xa(s) {
|
|
815
934
|
}
|
816
935
|
return !1;
|
817
936
|
}
|
818
|
-
function
|
937
|
+
function rt(s) {
|
819
938
|
const e = {};
|
820
939
|
for (const t in s) {
|
821
|
-
if (t.substring(0, 1) === "_" || t.substring(0, 2) === "is" ||
|
940
|
+
if (t.substring(0, 1) === "_" || t.substring(0, 2) === "is" || rr(t))
|
822
941
|
continue;
|
823
942
|
const i = typeof s[t], n = s[t];
|
824
943
|
switch (i) {
|
@@ -829,10 +948,10 @@ function at(s) {
|
|
829
948
|
break;
|
830
949
|
case "object":
|
831
950
|
n !== null ? (e[t] = n, n.isTexture ? e[t] = {
|
832
|
-
src:
|
951
|
+
src: ti.renderToBlob(n),
|
833
952
|
offset: [n.offset.x, n.offset.y],
|
834
953
|
repeat: [n.repeat.x, n.repeat.y]
|
835
|
-
} : t === "uniforms" && (e[t] =
|
954
|
+
} : t === "uniforms" && (e[t] = ar(e[t]))) : t === "glslVersion" ? e[t] = "" : e[t] = {
|
836
955
|
src: "",
|
837
956
|
offset: [0, 0],
|
838
957
|
repeat: [1, 1]
|
@@ -842,7 +961,7 @@ function at(s) {
|
|
842
961
|
}
|
843
962
|
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
963
|
}
|
845
|
-
function
|
964
|
+
function Ei(s) {
|
846
965
|
s.updateMatrix();
|
847
966
|
const e = {
|
848
967
|
name: s.name,
|
@@ -870,28 +989,28 @@ function yi(s) {
|
|
870
989
|
if (Array.isArray(i.material)) {
|
871
990
|
const n = [];
|
872
991
|
i.material.forEach((r) => {
|
873
|
-
n.push(
|
992
|
+
n.push(rt(r));
|
874
993
|
}), e.material = n;
|
875
994
|
} else
|
876
|
-
e.material =
|
995
|
+
e.material = rt(i.material);
|
877
996
|
} else if (t.search("points") > -1) {
|
878
997
|
const i = s;
|
879
998
|
if (Array.isArray(i.material)) {
|
880
999
|
const n = [];
|
881
1000
|
i.material.forEach((r) => {
|
882
|
-
n.push(
|
1001
|
+
n.push(rt(r));
|
883
1002
|
}), e.material = n;
|
884
1003
|
} else
|
885
|
-
e.material =
|
1004
|
+
e.material = rt(i.material);
|
886
1005
|
} else if (t.search("line") > -1) {
|
887
1006
|
const i = s;
|
888
1007
|
if (Array.isArray(i.material)) {
|
889
1008
|
const n = [];
|
890
1009
|
i.material.forEach((r) => {
|
891
|
-
n.push(
|
1010
|
+
n.push(rt(r));
|
892
1011
|
}), e.material = n;
|
893
1012
|
} else
|
894
|
-
e.material =
|
1013
|
+
e.material = rt(i.material);
|
895
1014
|
} else
|
896
1015
|
t.search("camera") > -1 ? s.type === "PerspectiveCamera" ? e.perspectiveCameraInfo = {
|
897
1016
|
fov: s.fov,
|
@@ -923,7 +1042,7 @@ function yi(s) {
|
|
923
1042
|
});
|
924
1043
|
return e;
|
925
1044
|
}
|
926
|
-
function
|
1045
|
+
function or(s, e) {
|
927
1046
|
const t = e.split(".");
|
928
1047
|
switch (t.length) {
|
929
1048
|
case 1:
|
@@ -940,7 +1059,7 @@ function $a(s, e) {
|
|
940
1059
|
return s[t[0]][t[1]][t[2]][t[3]][t[4]][t[5]];
|
941
1060
|
}
|
942
1061
|
}
|
943
|
-
function
|
1062
|
+
function lr(s, e) {
|
944
1063
|
for (const t in e)
|
945
1064
|
s[t] = e[t];
|
946
1065
|
}
|
@@ -985,19 +1104,19 @@ function ie(s, e, t) {
|
|
985
1104
|
a = s[i[0]][i[1]][i[2]][i[3]][i[4]];
|
986
1105
|
break;
|
987
1106
|
}
|
988
|
-
a != null &&
|
1107
|
+
a != null && lr(a, t);
|
989
1108
|
}
|
990
1109
|
}
|
991
|
-
function
|
1110
|
+
function vn(s) {
|
992
1111
|
return new Promise((e, t) => {
|
993
1112
|
const i = new Image();
|
994
1113
|
i.onload = () => {
|
995
|
-
const n = new
|
996
|
-
n.wrapS =
|
1114
|
+
const n = new Kn(i);
|
1115
|
+
n.wrapS = ls, n.wrapT = ls, n.needsUpdate = !0, e(n);
|
997
1116
|
}, i.onerror = t, i.src = s;
|
998
1117
|
});
|
999
1118
|
}
|
1000
|
-
class
|
1119
|
+
class Zo extends Wi {
|
1001
1120
|
canvas = null;
|
1002
1121
|
// Canvas or OffscreenCanvas
|
1003
1122
|
inputElement = null;
|
@@ -1015,15 +1134,15 @@ class Do extends Bi {
|
|
1015
1134
|
}), this.renderTargets.clear(), this.renderer?.dispose();
|
1016
1135
|
}
|
1017
1136
|
getObject(e) {
|
1018
|
-
this.app.debugEnabled && (this.renderer !== void 0 && (
|
1137
|
+
this.app.debugEnabled && (this.renderer !== void 0 && (ti.renderer = this.renderer), this.app.send({
|
1019
1138
|
event: "getObject",
|
1020
1139
|
target: "app",
|
1021
1140
|
data: e
|
1022
1141
|
}));
|
1023
1142
|
}
|
1024
1143
|
setObject(e) {
|
1025
|
-
this.renderer !== void 0 && (
|
1026
|
-
const t =
|
1144
|
+
this.renderer !== void 0 && (ti.renderer = this.renderer);
|
1145
|
+
const t = Ei(e);
|
1027
1146
|
this.app.send({
|
1028
1147
|
event: "setObject",
|
1029
1148
|
target: "editor",
|
@@ -1125,7 +1244,7 @@ class Do extends Bi {
|
|
1125
1244
|
localClippingEnabled: e.localClippingEnabled,
|
1126
1245
|
clearColor: i,
|
1127
1246
|
clearAlpha: e.getClearAlpha(),
|
1128
|
-
colorManagement:
|
1247
|
+
colorManagement: mt.enabled,
|
1129
1248
|
toneMapping: e.toneMapping,
|
1130
1249
|
toneMappingExposure: e.toneMappingExposure
|
1131
1250
|
}
|
@@ -1142,8 +1261,8 @@ class Do extends Bi {
|
|
1142
1261
|
addScene(e) {
|
1143
1262
|
if (e === void 0 || (this.scenes.set(e.name, e), !this.app.debugEnabled))
|
1144
1263
|
return;
|
1145
|
-
|
1146
|
-
const t =
|
1264
|
+
vs(), ji(e);
|
1265
|
+
const t = pt(e);
|
1147
1266
|
this.app.send({
|
1148
1267
|
event: "addScene",
|
1149
1268
|
target: "editor",
|
@@ -1155,7 +1274,7 @@ class Do extends Bi {
|
|
1155
1274
|
return;
|
1156
1275
|
const t = this.scenes.get(e);
|
1157
1276
|
if (t !== void 0) {
|
1158
|
-
const i =
|
1277
|
+
const i = pt(t);
|
1159
1278
|
this.app.send({
|
1160
1279
|
event: "refreshScene",
|
1161
1280
|
target: "app",
|
@@ -1166,7 +1285,7 @@ class Do extends Bi {
|
|
1166
1285
|
removeScene(e) {
|
1167
1286
|
if (e === void 0 || (this.scenes.delete(e.name), !this.app.debugEnabled))
|
1168
1287
|
return;
|
1169
|
-
const t =
|
1288
|
+
const t = pt(e);
|
1170
1289
|
this.app.send({
|
1171
1290
|
event: "removeScene",
|
1172
1291
|
target: "editor",
|
@@ -1185,8 +1304,8 @@ class Do extends Bi {
|
|
1185
1304
|
setScene(e) {
|
1186
1305
|
if (e === void 0 || (this.scene = e, !this.app.debugEnabled))
|
1187
1306
|
return;
|
1188
|
-
this.renderer !== void 0 && (
|
1189
|
-
const t =
|
1307
|
+
this.renderer !== void 0 && (ti.renderer = this.renderer), vs(), ji(e);
|
1308
|
+
const t = pt(e);
|
1190
1309
|
this.app.send({
|
1191
1310
|
event: "setScene",
|
1192
1311
|
target: "editor",
|
@@ -1197,7 +1316,7 @@ class Do extends Bi {
|
|
1197
1316
|
addCamera(e) {
|
1198
1317
|
if (!this.app.debugEnabled)
|
1199
1318
|
return;
|
1200
|
-
const t =
|
1319
|
+
const t = Ei(e);
|
1201
1320
|
this.app.send({
|
1202
1321
|
event: "addCamera",
|
1203
1322
|
target: "editor",
|
@@ -1207,7 +1326,7 @@ class Do extends Bi {
|
|
1207
1326
|
removeCamera(e) {
|
1208
1327
|
if (!this.app.debugEnabled)
|
1209
1328
|
return;
|
1210
|
-
const t =
|
1329
|
+
const t = Ei(e);
|
1211
1330
|
this.app.send({
|
1212
1331
|
event: "removeCamera",
|
1213
1332
|
target: "editor",
|
@@ -1218,26 +1337,26 @@ class Do extends Bi {
|
|
1218
1337
|
const n = t;
|
1219
1338
|
switch (i.event) {
|
1220
1339
|
case "getObject":
|
1221
|
-
D.dispatchEvent({ type:
|
1340
|
+
D.dispatchEvent({ type: A.GET_OBJECT, value: i.data });
|
1222
1341
|
break;
|
1223
1342
|
case "updateObject":
|
1224
|
-
D.dispatchEvent({ type:
|
1343
|
+
D.dispatchEvent({ type: A.UPDATE_OBJECT, value: i.data });
|
1225
1344
|
break;
|
1226
1345
|
case "createTexture":
|
1227
|
-
D.dispatchEvent({ type:
|
1346
|
+
D.dispatchEvent({ type: A.CREATE_TEXTURE, value: i.data });
|
1228
1347
|
break;
|
1229
1348
|
case "requestMethod":
|
1230
|
-
D.dispatchEvent({ type:
|
1349
|
+
D.dispatchEvent({ type: A.REQUEST_METHOD, value: i.data });
|
1231
1350
|
break;
|
1232
1351
|
case "refreshScene":
|
1233
1352
|
e.send({
|
1234
1353
|
event: "refreshScene",
|
1235
1354
|
target: "editor",
|
1236
|
-
data:
|
1355
|
+
data: pt(n.scenes.get(i.data.name))
|
1237
1356
|
});
|
1238
1357
|
break;
|
1239
1358
|
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,
|
1359
|
+
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
1360
|
break;
|
1242
1361
|
}
|
1243
1362
|
if (i.event === "updateGroup") {
|
@@ -1248,42 +1367,42 @@ class Do extends Bi {
|
|
1248
1367
|
handleEditor(e, t, i) {
|
1249
1368
|
switch (i.event) {
|
1250
1369
|
case "setObject":
|
1251
|
-
D.dispatchEvent({ type:
|
1370
|
+
D.dispatchEvent({ type: A.SET_OBJECT, value: i.data });
|
1252
1371
|
break;
|
1253
1372
|
case "addScene":
|
1254
|
-
D.dispatchEvent({ type:
|
1373
|
+
D.dispatchEvent({ type: A.ADD_SCENE, value: i.data });
|
1255
1374
|
break;
|
1256
1375
|
case "refreshScene":
|
1257
|
-
D.dispatchEvent({ type:
|
1376
|
+
D.dispatchEvent({ type: A.REFRESH_SCENE, value: i.data });
|
1258
1377
|
break;
|
1259
1378
|
case "removeScene":
|
1260
|
-
D.dispatchEvent({ type:
|
1379
|
+
D.dispatchEvent({ type: A.REMOVE_SCENE, value: i.data });
|
1261
1380
|
break;
|
1262
1381
|
case "setScene":
|
1263
|
-
D.dispatchEvent({ type:
|
1382
|
+
D.dispatchEvent({ type: A.SET_SCENE, value: i.data });
|
1264
1383
|
break;
|
1265
1384
|
case "addCamera":
|
1266
|
-
D.dispatchEvent({ type:
|
1385
|
+
D.dispatchEvent({ type: A.ADD_CAMERA, value: i.data });
|
1267
1386
|
break;
|
1268
1387
|
case "removeCamera":
|
1269
|
-
D.dispatchEvent({ type:
|
1388
|
+
D.dispatchEvent({ type: A.REMOVE_CAMERA, value: i.data });
|
1270
1389
|
break;
|
1271
1390
|
case "addGroup":
|
1272
|
-
D.dispatchEvent({ type:
|
1391
|
+
D.dispatchEvent({ type: A.ADD_GROUP, value: i.data });
|
1273
1392
|
break;
|
1274
1393
|
case "removeGroup":
|
1275
|
-
D.dispatchEvent({ type:
|
1394
|
+
D.dispatchEvent({ type: A.REMOVE_GROUP, value: i.data });
|
1276
1395
|
break;
|
1277
1396
|
case "addSpline":
|
1278
|
-
D.dispatchEvent({ type:
|
1397
|
+
D.dispatchEvent({ type: A.ADD_SPLINE, value: i.data });
|
1279
1398
|
break;
|
1280
1399
|
case "addRenderer":
|
1281
|
-
D.dispatchEvent({ type:
|
1400
|
+
D.dispatchEvent({ type: A.ADD_RENDERER, value: i.data });
|
1282
1401
|
}
|
1283
1402
|
}
|
1284
1403
|
// Renderer
|
1285
1404
|
addRT(e, t) {
|
1286
|
-
const i = new
|
1405
|
+
const i = new qn(32, 32, t);
|
1287
1406
|
i.texture.name = e, this.renderTargets.set(e, i);
|
1288
1407
|
}
|
1289
1408
|
resize(e, t) {
|
@@ -1307,7 +1426,7 @@ class Do extends Bi {
|
|
1307
1426
|
return this.renderer !== void 0 ? this.renderer.domElement.height / this.dpr : 0;
|
1308
1427
|
}
|
1309
1428
|
}
|
1310
|
-
var
|
1429
|
+
var Ni = { exports: {} }, St = {};
|
1311
1430
|
/**
|
1312
1431
|
* @license React
|
1313
1432
|
* react-jsx-runtime.production.min.js
|
@@ -1317,12 +1436,12 @@ var Ui = { exports: {} }, Et = {};
|
|
1317
1436
|
* This source code is licensed under the MIT license found in the
|
1318
1437
|
* LICENSE file in the root directory of this source tree.
|
1319
1438
|
*/
|
1320
|
-
var
|
1321
|
-
function
|
1322
|
-
if (
|
1323
|
-
return
|
1324
|
-
|
1325
|
-
var s =
|
1439
|
+
var ys;
|
1440
|
+
function cr() {
|
1441
|
+
if (ys)
|
1442
|
+
return St;
|
1443
|
+
ys = 1;
|
1444
|
+
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
1445
|
function a(o, c, l) {
|
1327
1446
|
var d, p = {}, m = null, f = null;
|
1328
1447
|
l !== void 0 && (m = "" + l), c.key !== void 0 && (m = "" + c.key), c.ref !== void 0 && (f = c.ref);
|
@@ -1333,9 +1452,9 @@ function Ka() {
|
|
1333
1452
|
p[d] === void 0 && (p[d] = c[d]);
|
1334
1453
|
return { $$typeof: e, type: o, key: m, ref: f, props: p, _owner: n.current };
|
1335
1454
|
}
|
1336
|
-
return
|
1455
|
+
return St.Fragment = t, St.jsx = a, St.jsxs = a, St;
|
1337
1456
|
}
|
1338
|
-
var
|
1457
|
+
var wt = {};
|
1339
1458
|
/**
|
1340
1459
|
* @license React
|
1341
1460
|
* react-jsx-runtime.development.js
|
@@ -1345,14 +1464,14 @@ var St = {};
|
|
1345
1464
|
* This source code is licensed under the MIT license found in the
|
1346
1465
|
* LICENSE file in the root directory of this source tree.
|
1347
1466
|
*/
|
1348
|
-
var
|
1349
|
-
function
|
1350
|
-
return
|
1351
|
-
var s =
|
1467
|
+
var bs;
|
1468
|
+
function hr() {
|
1469
|
+
return bs || (bs = 1, process.env.NODE_ENV !== "production" && function() {
|
1470
|
+
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
1471
|
function T(h) {
|
1353
1472
|
if (h === null || typeof h != "object")
|
1354
1473
|
return null;
|
1355
|
-
var b =
|
1474
|
+
var b = C && h[C] || h[y];
|
1356
1475
|
return typeof b == "function" ? b : null;
|
1357
1476
|
}
|
1358
1477
|
var g = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
@@ -1373,10 +1492,10 @@ function Qa() {
|
|
1373
1492
|
G.unshift("Warning: " + b), Function.prototype.apply.call(console[h], console, G);
|
1374
1493
|
}
|
1375
1494
|
}
|
1376
|
-
var
|
1495
|
+
var E = !1, w = !1, O = !1, L = !1, j = !1, R;
|
1377
1496
|
R = Symbol.for("react.module.reference");
|
1378
1497
|
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 ||
|
1498
|
+
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
1499
|
// types supported by any Flight configuration anywhere since
|
1381
1500
|
// we don't know which Flight build this will end up being used
|
1382
1501
|
// with.
|
@@ -1437,14 +1556,14 @@ function Qa() {
|
|
1437
1556
|
}
|
1438
1557
|
return null;
|
1439
1558
|
}
|
1440
|
-
var
|
1559
|
+
var q = Object.assign, $ = 0, Ue, he, Ee, se, je, Ne, Fe;
|
1441
1560
|
function W() {
|
1442
1561
|
}
|
1443
1562
|
W.__reactDisabledLog = !0;
|
1444
1563
|
function le() {
|
1445
1564
|
{
|
1446
1565
|
if ($ === 0) {
|
1447
|
-
Ue = console.log, he = console.info,
|
1566
|
+
Ue = console.log, he = console.info, Ee = console.warn, se = console.error, je = console.group, Ne = console.groupCollapsed, Fe = console.groupEnd;
|
1448
1567
|
var h = {
|
1449
1568
|
configurable: !0,
|
1450
1569
|
enumerable: !0,
|
@@ -1473,25 +1592,25 @@ function Qa() {
|
|
1473
1592
|
writable: !0
|
1474
1593
|
};
|
1475
1594
|
Object.defineProperties(console, {
|
1476
|
-
log:
|
1595
|
+
log: q({}, h, {
|
1477
1596
|
value: Ue
|
1478
1597
|
}),
|
1479
|
-
info:
|
1598
|
+
info: q({}, h, {
|
1480
1599
|
value: he
|
1481
1600
|
}),
|
1482
|
-
warn:
|
1483
|
-
value:
|
1601
|
+
warn: q({}, h, {
|
1602
|
+
value: Ee
|
1484
1603
|
}),
|
1485
|
-
error:
|
1604
|
+
error: q({}, h, {
|
1486
1605
|
value: se
|
1487
1606
|
}),
|
1488
|
-
group:
|
1607
|
+
group: q({}, h, {
|
1489
1608
|
value: je
|
1490
1609
|
}),
|
1491
|
-
groupCollapsed:
|
1610
|
+
groupCollapsed: q({}, h, {
|
1492
1611
|
value: Ne
|
1493
1612
|
}),
|
1494
|
-
groupEnd:
|
1613
|
+
groupEnd: q({}, h, {
|
1495
1614
|
value: Fe
|
1496
1615
|
})
|
1497
1616
|
});
|
@@ -1499,8 +1618,8 @@ function Qa() {
|
|
1499
1618
|
$ < 0 && v("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
1500
1619
|
}
|
1501
1620
|
}
|
1502
|
-
var
|
1503
|
-
function
|
1621
|
+
var yt = g.ReactCurrentDispatcher, it;
|
1622
|
+
function zt(h, b, x) {
|
1504
1623
|
{
|
1505
1624
|
if (it === void 0)
|
1506
1625
|
try {
|
@@ -1513,25 +1632,25 @@ function Qa() {
|
|
1513
1632
|
` + it + h;
|
1514
1633
|
}
|
1515
1634
|
}
|
1516
|
-
var
|
1635
|
+
var ui = !1, Ht;
|
1517
1636
|
{
|
1518
|
-
var
|
1519
|
-
|
1637
|
+
var wn = typeof WeakMap == "function" ? WeakMap : Map;
|
1638
|
+
Ht = new wn();
|
1520
1639
|
}
|
1521
|
-
function
|
1522
|
-
if (!h ||
|
1640
|
+
function Xi(h, b) {
|
1641
|
+
if (!h || ui)
|
1523
1642
|
return "";
|
1524
1643
|
{
|
1525
|
-
var x =
|
1644
|
+
var x = Ht.get(h);
|
1526
1645
|
if (x !== void 0)
|
1527
1646
|
return x;
|
1528
1647
|
}
|
1529
1648
|
var k;
|
1530
|
-
|
1649
|
+
ui = !0;
|
1531
1650
|
var H = Error.prepareStackTrace;
|
1532
1651
|
Error.prepareStackTrace = void 0;
|
1533
1652
|
var G;
|
1534
|
-
G =
|
1653
|
+
G = yt.current, yt.current = null, le();
|
1535
1654
|
try {
|
1536
1655
|
if (b) {
|
1537
1656
|
var F = function() {
|
@@ -1577,65 +1696,65 @@ function Qa() {
|
|
1577
1696
|
if (te--, ne--, ne < 0 || N[te] !== fe[ne]) {
|
1578
1697
|
var we = `
|
1579
1698
|
` + N[te].replace(" at new ", " at ");
|
1580
|
-
return h.displayName && we.includes("<anonymous>") && (we = we.replace("<anonymous>", h.displayName)), typeof h == "function" &&
|
1699
|
+
return h.displayName && we.includes("<anonymous>") && (we = we.replace("<anonymous>", h.displayName)), typeof h == "function" && Ht.set(h, we), we;
|
1581
1700
|
}
|
1582
1701
|
while (te >= 1 && ne >= 0);
|
1583
1702
|
break;
|
1584
1703
|
}
|
1585
1704
|
}
|
1586
1705
|
} finally {
|
1587
|
-
|
1706
|
+
ui = !1, yt.current = G, Te(), Error.prepareStackTrace = H;
|
1588
1707
|
}
|
1589
|
-
var nt = h ? h.displayName || h.name : "",
|
1590
|
-
return typeof h == "function" &&
|
1708
|
+
var nt = h ? h.displayName || h.name : "", os = nt ? zt(nt) : "";
|
1709
|
+
return typeof h == "function" && Ht.set(h, os), os;
|
1591
1710
|
}
|
1592
|
-
function
|
1593
|
-
return
|
1711
|
+
function xn(h, b, x) {
|
1712
|
+
return Xi(h, !1);
|
1594
1713
|
}
|
1595
|
-
function
|
1714
|
+
function On(h) {
|
1596
1715
|
var b = h.prototype;
|
1597
1716
|
return !!(b && b.isReactComponent);
|
1598
1717
|
}
|
1599
|
-
function
|
1718
|
+
function Yt(h, b, x) {
|
1600
1719
|
if (h == null)
|
1601
1720
|
return "";
|
1602
1721
|
if (typeof h == "function")
|
1603
|
-
return
|
1722
|
+
return Xi(h, On(h));
|
1604
1723
|
if (typeof h == "string")
|
1605
|
-
return
|
1724
|
+
return zt(h);
|
1606
1725
|
switch (h) {
|
1607
1726
|
case l:
|
1608
|
-
return
|
1727
|
+
return zt("Suspense");
|
1609
1728
|
case d:
|
1610
|
-
return
|
1729
|
+
return zt("SuspenseList");
|
1611
1730
|
}
|
1612
1731
|
if (typeof h == "object")
|
1613
1732
|
switch (h.$$typeof) {
|
1614
1733
|
case c:
|
1615
|
-
return
|
1734
|
+
return xn(h.render);
|
1616
1735
|
case p:
|
1617
|
-
return
|
1736
|
+
return Yt(h.type, b, x);
|
1618
1737
|
case m: {
|
1619
1738
|
var k = h, H = k._payload, G = k._init;
|
1620
1739
|
try {
|
1621
|
-
return
|
1740
|
+
return Yt(G(H), b, x);
|
1622
1741
|
} catch {
|
1623
1742
|
}
|
1624
1743
|
}
|
1625
1744
|
}
|
1626
1745
|
return "";
|
1627
1746
|
}
|
1628
|
-
var
|
1629
|
-
function
|
1747
|
+
var Bt = Object.prototype.hasOwnProperty, $i = {}, Ki = g.ReactDebugCurrentFrame;
|
1748
|
+
function Vt(h) {
|
1630
1749
|
if (h) {
|
1631
|
-
var b = h._owner, x =
|
1632
|
-
|
1750
|
+
var b = h._owner, x = Yt(h.type, h._source, b ? b.type : null);
|
1751
|
+
Ki.setExtraStackFrame(x);
|
1633
1752
|
} else
|
1634
|
-
|
1753
|
+
Ki.setExtraStackFrame(null);
|
1635
1754
|
}
|
1636
|
-
function
|
1755
|
+
function Tn(h, b, x, k, H) {
|
1637
1756
|
{
|
1638
|
-
var G = Function.call.bind(
|
1757
|
+
var G = Function.call.bind(Bt);
|
1639
1758
|
for (var F in h)
|
1640
1759
|
if (G(h, F)) {
|
1641
1760
|
var N = void 0;
|
@@ -1648,67 +1767,67 @@ function Qa() {
|
|
1648
1767
|
} catch (te) {
|
1649
1768
|
N = te;
|
1650
1769
|
}
|
1651
|
-
N && !(N instanceof Error) && (
|
1770
|
+
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
1771
|
}
|
1653
1772
|
}
|
1654
1773
|
}
|
1655
|
-
var
|
1656
|
-
function
|
1657
|
-
return
|
1774
|
+
var Mn = Array.isArray;
|
1775
|
+
function pi(h) {
|
1776
|
+
return Mn(h);
|
1658
1777
|
}
|
1659
|
-
function
|
1778
|
+
function Pn(h) {
|
1660
1779
|
{
|
1661
1780
|
var b = typeof Symbol == "function" && Symbol.toStringTag, x = b && h[Symbol.toStringTag] || h.constructor.name || "Object";
|
1662
1781
|
return x;
|
1663
1782
|
}
|
1664
1783
|
}
|
1665
|
-
function
|
1784
|
+
function An(h) {
|
1666
1785
|
try {
|
1667
|
-
return
|
1786
|
+
return qi(h), !1;
|
1668
1787
|
} catch {
|
1669
1788
|
return !0;
|
1670
1789
|
}
|
1671
1790
|
}
|
1672
|
-
function
|
1791
|
+
function qi(h) {
|
1673
1792
|
return "" + h;
|
1674
1793
|
}
|
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.",
|
1794
|
+
function Qi(h) {
|
1795
|
+
if (An(h))
|
1796
|
+
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
1797
|
}
|
1679
|
-
var
|
1798
|
+
var bt = g.ReactCurrentOwner, Dn = {
|
1680
1799
|
key: !0,
|
1681
1800
|
ref: !0,
|
1682
1801
|
__self: !0,
|
1683
1802
|
__source: !0
|
1684
|
-
},
|
1685
|
-
|
1686
|
-
function
|
1687
|
-
if (
|
1803
|
+
}, Ji, es, mi;
|
1804
|
+
mi = {};
|
1805
|
+
function Rn(h) {
|
1806
|
+
if (Bt.call(h, "ref")) {
|
1688
1807
|
var b = Object.getOwnPropertyDescriptor(h, "ref").get;
|
1689
1808
|
if (b && b.isReactWarning)
|
1690
1809
|
return !1;
|
1691
1810
|
}
|
1692
1811
|
return h.ref !== void 0;
|
1693
1812
|
}
|
1694
|
-
function
|
1695
|
-
if (
|
1813
|
+
function In(h) {
|
1814
|
+
if (Bt.call(h, "key")) {
|
1696
1815
|
var b = Object.getOwnPropertyDescriptor(h, "key").get;
|
1697
1816
|
if (b && b.isReactWarning)
|
1698
1817
|
return !1;
|
1699
1818
|
}
|
1700
1819
|
return h.key !== void 0;
|
1701
1820
|
}
|
1702
|
-
function
|
1703
|
-
if (typeof h.ref == "string" &&
|
1704
|
-
var x = re(
|
1705
|
-
|
1821
|
+
function Ln(h, b) {
|
1822
|
+
if (typeof h.ref == "string" && bt.current && b && bt.current.stateNode !== b) {
|
1823
|
+
var x = re(bt.current.type);
|
1824
|
+
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
1825
|
}
|
1707
1826
|
}
|
1708
|
-
function
|
1827
|
+
function kn(h, b) {
|
1709
1828
|
{
|
1710
1829
|
var x = function() {
|
1711
|
-
|
1830
|
+
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
1831
|
};
|
1713
1832
|
x.isReactWarning = !0, Object.defineProperty(h, "key", {
|
1714
1833
|
get: x,
|
@@ -1716,10 +1835,10 @@ function Qa() {
|
|
1716
1835
|
});
|
1717
1836
|
}
|
1718
1837
|
}
|
1719
|
-
function
|
1838
|
+
function Un(h, b) {
|
1720
1839
|
{
|
1721
1840
|
var x = function() {
|
1722
|
-
|
1841
|
+
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
1842
|
};
|
1724
1843
|
x.isReactWarning = !0, Object.defineProperty(h, "ref", {
|
1725
1844
|
get: x,
|
@@ -1727,7 +1846,7 @@ function Qa() {
|
|
1727
1846
|
});
|
1728
1847
|
}
|
1729
1848
|
}
|
1730
|
-
var
|
1849
|
+
var jn = function(h, b, x, k, H, G, F) {
|
1731
1850
|
var N = {
|
1732
1851
|
// This tag allows us to uniquely identify this as a React Element
|
1733
1852
|
$$typeof: e,
|
@@ -1756,12 +1875,12 @@ function Qa() {
|
|
1756
1875
|
value: H
|
1757
1876
|
}), Object.freeze && (Object.freeze(N.props), Object.freeze(N)), N;
|
1758
1877
|
};
|
1759
|
-
function
|
1878
|
+
function Nn(h, b, x, k, H) {
|
1760
1879
|
{
|
1761
1880
|
var G, F = {}, N = null, fe = null;
|
1762
|
-
x !== void 0 && (
|
1881
|
+
x !== void 0 && (Qi(x), N = "" + x), In(b) && (Qi(b.key), N = "" + b.key), Rn(b) && (fe = b.ref, Ln(b, H));
|
1763
1882
|
for (G in b)
|
1764
|
-
|
1883
|
+
Bt.call(b, G) && !Dn.hasOwnProperty(G) && (F[G] = b[G]);
|
1765
1884
|
if (h && h.defaultProps) {
|
1766
1885
|
var te = h.defaultProps;
|
1767
1886
|
for (G in te)
|
@@ -1769,28 +1888,28 @@ function Qa() {
|
|
1769
1888
|
}
|
1770
1889
|
if (N || fe) {
|
1771
1890
|
var ne = typeof h == "function" ? h.displayName || h.name || "Unknown" : h;
|
1772
|
-
N &&
|
1891
|
+
N && kn(F, ne), fe && Un(F, ne);
|
1773
1892
|
}
|
1774
|
-
return
|
1893
|
+
return jn(h, N, fe, H, k, bt.current, F);
|
1775
1894
|
}
|
1776
1895
|
}
|
1777
|
-
var
|
1896
|
+
var fi = g.ReactCurrentOwner, ts = g.ReactDebugCurrentFrame;
|
1778
1897
|
function st(h) {
|
1779
1898
|
if (h) {
|
1780
|
-
var b = h._owner, x =
|
1781
|
-
|
1899
|
+
var b = h._owner, x = Yt(h.type, h._source, b ? b.type : null);
|
1900
|
+
ts.setExtraStackFrame(x);
|
1782
1901
|
} else
|
1783
|
-
|
1902
|
+
ts.setExtraStackFrame(null);
|
1784
1903
|
}
|
1785
|
-
var
|
1786
|
-
|
1787
|
-
function
|
1904
|
+
var gi;
|
1905
|
+
gi = !1;
|
1906
|
+
function _i(h) {
|
1788
1907
|
return typeof h == "object" && h !== null && h.$$typeof === e;
|
1789
1908
|
}
|
1790
|
-
function
|
1909
|
+
function is() {
|
1791
1910
|
{
|
1792
|
-
if (
|
1793
|
-
var h = re(
|
1911
|
+
if (fi.current) {
|
1912
|
+
var h = re(fi.current.type);
|
1794
1913
|
if (h)
|
1795
1914
|
return `
|
1796
1915
|
|
@@ -1799,7 +1918,7 @@ Check the render method of \`` + h + "`.";
|
|
1799
1918
|
return "";
|
1800
1919
|
}
|
1801
1920
|
}
|
1802
|
-
function
|
1921
|
+
function Fn(h) {
|
1803
1922
|
{
|
1804
1923
|
if (h !== void 0) {
|
1805
1924
|
var b = h.fileName.replace(/^.*[\\\/]/, ""), x = h.lineNumber;
|
@@ -1810,10 +1929,10 @@ Check your code at ` + b + ":" + x + ".";
|
|
1810
1929
|
return "";
|
1811
1930
|
}
|
1812
1931
|
}
|
1813
|
-
var
|
1814
|
-
function
|
1932
|
+
var ss = {};
|
1933
|
+
function zn(h) {
|
1815
1934
|
{
|
1816
|
-
var b =
|
1935
|
+
var b = is();
|
1817
1936
|
if (!b) {
|
1818
1937
|
var x = typeof h == "string" ? h : h.displayName || h.name;
|
1819
1938
|
x && (b = `
|
@@ -1823,39 +1942,39 @@ Check the top-level render call using <` + x + ">.");
|
|
1823
1942
|
return b;
|
1824
1943
|
}
|
1825
1944
|
}
|
1826
|
-
function
|
1945
|
+
function ns(h, b) {
|
1827
1946
|
{
|
1828
1947
|
if (!h._store || h._store.validated || h.key != null)
|
1829
1948
|
return;
|
1830
1949
|
h._store.validated = !0;
|
1831
|
-
var x =
|
1832
|
-
if (
|
1950
|
+
var x = zn(b);
|
1951
|
+
if (ss[x])
|
1833
1952
|
return;
|
1834
|
-
|
1953
|
+
ss[x] = !0;
|
1835
1954
|
var k = "";
|
1836
|
-
h && h._owner && h._owner !==
|
1955
|
+
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
1956
|
}
|
1838
1957
|
}
|
1839
|
-
function
|
1958
|
+
function as(h, b) {
|
1840
1959
|
{
|
1841
1960
|
if (typeof h != "object")
|
1842
1961
|
return;
|
1843
|
-
if (
|
1962
|
+
if (pi(h))
|
1844
1963
|
for (var x = 0; x < h.length; x++) {
|
1845
1964
|
var k = h[x];
|
1846
|
-
|
1965
|
+
_i(k) && ns(k, b);
|
1847
1966
|
}
|
1848
|
-
else if (
|
1967
|
+
else if (_i(h))
|
1849
1968
|
h._store && (h._store.validated = !0);
|
1850
1969
|
else if (h) {
|
1851
1970
|
var H = T(h);
|
1852
1971
|
if (typeof H == "function" && H !== h.entries)
|
1853
1972
|
for (var G = H.call(h), F; !(F = G.next()).done; )
|
1854
|
-
|
1973
|
+
_i(F.value) && ns(F.value, b);
|
1855
1974
|
}
|
1856
1975
|
}
|
1857
1976
|
}
|
1858
|
-
function
|
1977
|
+
function Hn(h) {
|
1859
1978
|
{
|
1860
1979
|
var b = h.type;
|
1861
1980
|
if (b == null || typeof b == "string")
|
@@ -1871,16 +1990,16 @@ Check the top-level render call using <` + x + ">.");
|
|
1871
1990
|
return;
|
1872
1991
|
if (x) {
|
1873
1992
|
var k = re(b);
|
1874
|
-
|
1875
|
-
} else if (b.PropTypes !== void 0 && !
|
1876
|
-
|
1993
|
+
Tn(x, h.props, "prop", k, h);
|
1994
|
+
} else if (b.PropTypes !== void 0 && !gi) {
|
1995
|
+
gi = !0;
|
1877
1996
|
var H = re(b);
|
1878
1997
|
v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", H || "Unknown");
|
1879
1998
|
}
|
1880
1999
|
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
2000
|
}
|
1882
2001
|
}
|
1883
|
-
function
|
2002
|
+
function Yn(h) {
|
1884
2003
|
{
|
1885
2004
|
for (var b = Object.keys(h.props), x = 0; x < b.length; x++) {
|
1886
2005
|
var k = b[x];
|
@@ -1892,56 +2011,56 @@ Check the top-level render call using <` + x + ">.");
|
|
1892
2011
|
h.ref !== null && (st(h), v("Invalid attribute `ref` supplied to `React.Fragment`."), st(null));
|
1893
2012
|
}
|
1894
2013
|
}
|
1895
|
-
function
|
2014
|
+
function rs(h, b, x, k, H, G) {
|
1896
2015
|
{
|
1897
2016
|
var F = B(h);
|
1898
2017
|
if (!F) {
|
1899
2018
|
var N = "";
|
1900
2019
|
(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 +=
|
2020
|
+
var fe = Fn(H);
|
2021
|
+
fe ? N += fe : N += is();
|
1903
2022
|
var te;
|
1904
|
-
h === null ? te = "null" :
|
2023
|
+
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
2024
|
}
|
1906
|
-
var ne =
|
2025
|
+
var ne = Nn(h, b, x, H, G);
|
1907
2026
|
if (ne == null)
|
1908
2027
|
return ne;
|
1909
2028
|
if (F) {
|
1910
2029
|
var we = b.children;
|
1911
2030
|
if (we !== void 0)
|
1912
2031
|
if (k)
|
1913
|
-
if (
|
2032
|
+
if (pi(we)) {
|
1914
2033
|
for (var nt = 0; nt < we.length; nt++)
|
1915
|
-
|
2034
|
+
as(we[nt], h);
|
1916
2035
|
Object.freeze && Object.freeze(we);
|
1917
2036
|
} else
|
1918
2037
|
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
2038
|
else
|
1920
|
-
|
2039
|
+
as(we, h);
|
1921
2040
|
}
|
1922
|
-
return h === i ?
|
2041
|
+
return h === i ? Yn(ne) : Hn(ne), ne;
|
1923
2042
|
}
|
1924
2043
|
}
|
1925
|
-
function
|
1926
|
-
return
|
2044
|
+
function Bn(h, b, x) {
|
2045
|
+
return rs(h, b, x, !0);
|
1927
2046
|
}
|
1928
|
-
function
|
1929
|
-
return
|
2047
|
+
function Vn(h, b, x) {
|
2048
|
+
return rs(h, b, x, !1);
|
1930
2049
|
}
|
1931
|
-
var
|
1932
|
-
|
1933
|
-
}()),
|
2050
|
+
var Zn = Vn, Wn = Bn;
|
2051
|
+
wt.Fragment = i, wt.jsx = Zn, wt.jsxs = Wn;
|
2052
|
+
}()), wt;
|
1934
2053
|
}
|
1935
|
-
process.env.NODE_ENV === "production" ?
|
1936
|
-
var u =
|
1937
|
-
function
|
2054
|
+
process.env.NODE_ENV === "production" ? Ni.exports = cr() : Ni.exports = hr();
|
2055
|
+
var u = Ni.exports;
|
2056
|
+
function yn(s) {
|
1938
2057
|
return s.title.search("<") > -1 ? /* @__PURE__ */ u.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: s.title } }) : /* @__PURE__ */ u.jsx("button", { children: s.title });
|
1939
2058
|
}
|
1940
|
-
const
|
2059
|
+
const dr = /* @__PURE__ */ u.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
|
1941
2060
|
/* @__PURE__ */ u.jsx("circle", { cx: "7", cy: "7", r: "6" }),
|
1942
2061
|
/* @__PURE__ */ u.jsx("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
|
1943
2062
|
/* @__PURE__ */ u.jsx("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
|
1944
|
-
] }),
|
2063
|
+
] }), ur = /* @__PURE__ */ u.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ u.jsx(
|
1945
2064
|
"path",
|
1946
2065
|
{
|
1947
2066
|
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 +2068,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
2068
|
C11,8.22,10.74,8,10.43,8z`
|
1950
2069
|
}
|
1951
2070
|
) });
|
1952
|
-
function
|
1953
|
-
return /* @__PURE__ */ u.jsx(
|
1954
|
-
|
2071
|
+
function pr(s) {
|
2072
|
+
return /* @__PURE__ */ u.jsx(gn.Item, { value: s.title, children: /* @__PURE__ */ u.jsxs("div", { children: [
|
2073
|
+
ur,
|
1955
2074
|
/* @__PURE__ */ u.jsx("span", { children: s.title }),
|
1956
2075
|
/* @__PURE__ */ u.jsx("button", { className: "closeIcon", onClick: () => {
|
1957
2076
|
s.onDelete(s.index);
|
1958
|
-
}, children:
|
2077
|
+
}, children: dr })
|
1959
2078
|
] }) }, s.title);
|
1960
2079
|
}
|
1961
|
-
function
|
2080
|
+
function mr(s) {
|
1962
2081
|
const [e, t] = Z(!1), [i, n] = Z(s.options), r = (l) => {
|
1963
2082
|
s.onDragComplete(l), n(l);
|
1964
2083
|
}, a = (l) => {
|
@@ -1966,18 +2085,18 @@ function ir(s) {
|
|
1966
2085
|
d.splice(l, 1), r(d);
|
1967
2086
|
}, o = [];
|
1968
2087
|
i.forEach((l, d) => {
|
1969
|
-
o.push(/* @__PURE__ */ u.jsx(
|
2088
|
+
o.push(/* @__PURE__ */ u.jsx(pr, { index: d, title: l, onDelete: a }, l));
|
1970
2089
|
});
|
1971
2090
|
let c = "dropdown draggable";
|
1972
2091
|
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(
|
2092
|
+
/* @__PURE__ */ u.jsx(yn, { title: s.title }),
|
2093
|
+
/* @__PURE__ */ u.jsx(gn.Group, { axis: "y", values: i, onReorder: r, style: { visibility: e ? "visible" : "hidden" }, children: o })
|
1975
2094
|
] });
|
1976
2095
|
}
|
1977
|
-
function
|
2096
|
+
function fr(s) {
|
1978
2097
|
const [e, t] = Z(!1), i = [];
|
1979
2098
|
s.options.map((r, a) => {
|
1980
|
-
s.onSelect !== void 0 && (r.onSelect = s.onSelect), i.push(/* @__PURE__ */ u.jsx(
|
2099
|
+
s.onSelect !== void 0 && (r.onSelect = s.onSelect), i.push(/* @__PURE__ */ u.jsx(gr, { option: r }, a));
|
1981
2100
|
});
|
1982
2101
|
let n = "dropdown";
|
1983
2102
|
return s.subdropdown && (n += " subdropdown"), /* @__PURE__ */ u.jsxs(
|
@@ -1987,7 +2106,7 @@ function sr(s) {
|
|
1987
2106
|
onMouseEnter: () => t(!0),
|
1988
2107
|
onMouseLeave: () => t(!1),
|
1989
2108
|
children: [
|
1990
|
-
/* @__PURE__ */ u.jsx(
|
2109
|
+
/* @__PURE__ */ u.jsx(yn, { title: s.title }),
|
1991
2110
|
/* @__PURE__ */ u.jsx(
|
1992
2111
|
"ul",
|
1993
2112
|
{
|
@@ -1999,13 +2118,13 @@ function sr(s) {
|
|
1999
2118
|
}
|
2000
2119
|
);
|
2001
2120
|
}
|
2002
|
-
function
|
2121
|
+
function gr(s) {
|
2003
2122
|
const { option: e } = s, [t, i] = Z("");
|
2004
2123
|
let n;
|
2005
2124
|
switch (e.type) {
|
2006
2125
|
case "draggable":
|
2007
2126
|
n = /* @__PURE__ */ u.jsx(
|
2008
|
-
|
2127
|
+
mr,
|
2009
2128
|
{
|
2010
2129
|
title: e.title,
|
2011
2130
|
options: e.value,
|
@@ -2018,7 +2137,7 @@ function nr(s) {
|
|
2018
2137
|
break;
|
2019
2138
|
case "dropdown":
|
2020
2139
|
n = /* @__PURE__ */ u.jsx(
|
2021
|
-
|
2140
|
+
fr,
|
2022
2141
|
{
|
2023
2142
|
title: e.title,
|
2024
2143
|
options: e.value,
|
@@ -2039,15 +2158,15 @@ function nr(s) {
|
|
2039
2158
|
);
|
2040
2159
|
break;
|
2041
2160
|
}
|
2042
|
-
return /* @__PURE__ */ u.jsx("li", { className: t === e.title ? "selected" : "", children: n },
|
2161
|
+
return /* @__PURE__ */ u.jsx("li", { className: t === e.title ? "selected" : "", children: n }, za());
|
2043
2162
|
}
|
2044
|
-
function
|
2163
|
+
function Wo(s, e, t) {
|
2045
2164
|
function i(r) {
|
2046
2165
|
switch (e.forEach((a) => {
|
2047
2166
|
a.callback(s, a.remote, r);
|
2048
2167
|
}), r.event) {
|
2049
2168
|
case "custom":
|
2050
|
-
D.dispatchEvent({ type:
|
2169
|
+
D.dispatchEvent({ type: A.CUSTOM, value: r.data });
|
2051
2170
|
break;
|
2052
2171
|
}
|
2053
2172
|
}
|
@@ -2056,7 +2175,7 @@ function Ro(s, e, t) {
|
|
2056
2175
|
a.callback(s, a.remote, r);
|
2057
2176
|
}), r.event) {
|
2058
2177
|
case "custom":
|
2059
|
-
D.dispatchEvent({ type:
|
2178
|
+
D.dispatchEvent({ type: A.CUSTOM, value: r.data });
|
2060
2179
|
break;
|
2061
2180
|
}
|
2062
2181
|
}
|
@@ -2064,9 +2183,9 @@ function Ro(s, e, t) {
|
|
2064
2183
|
r.target === "editor" ? n(r) : i(r);
|
2065
2184
|
};
|
2066
2185
|
}
|
2067
|
-
function
|
2186
|
+
function oi(s) {
|
2068
2187
|
const [e, t] = Z(s.open !== void 0 ? s.open : !0), i = !e || s.children === void 0, n = () => {
|
2069
|
-
D.dispatchEvent({ type:
|
2188
|
+
D.dispatchEvent({ type: A.REMOVE_SCENE, value: s.scene });
|
2070
2189
|
};
|
2071
2190
|
return /* @__PURE__ */ u.jsxs("div", { className: `accordion ${i ? "hide" : ""}`, children: [
|
2072
2191
|
/* @__PURE__ */ u.jsxs(
|
@@ -2085,7 +2204,7 @@ function ri(s) {
|
|
2085
2204
|
children: "Toggle"
|
2086
2205
|
}
|
2087
2206
|
),
|
2088
|
-
/* @__PURE__ */ u.jsx("p", { className: "label", children:
|
2207
|
+
/* @__PURE__ */ u.jsx("p", { className: "label", children: ri(s.label) })
|
2089
2208
|
]
|
2090
2209
|
}
|
2091
2210
|
),
|
@@ -2097,10 +2216,10 @@ function ri(s) {
|
|
2097
2216
|
/* @__PURE__ */ u.jsx("div", { className: e ? "open" : "", children: /* @__PURE__ */ u.jsx("div", { children: s.children }) }, Math.random())
|
2098
2217
|
] });
|
2099
2218
|
}
|
2100
|
-
function
|
2219
|
+
function bn(s) {
|
2101
2220
|
const e = J(null), [t, i] = Z(!1), n = s.child !== void 0 && s.child.children.length > 0, r = [];
|
2102
2221
|
return s.child !== void 0 && s.child.children.length > 0 && s.child.children.map((a, o) => {
|
2103
|
-
r.push(/* @__PURE__ */ u.jsx(
|
2222
|
+
r.push(/* @__PURE__ */ u.jsx(bn, { child: a, three: s.three }, o));
|
2104
2223
|
}), tt(() => {
|
2105
2224
|
if (s.child) {
|
2106
2225
|
const a = s.three.getScene(s.child.uuid);
|
@@ -2155,18 +2274,18 @@ function _n(s) {
|
|
2155
2274
|
}
|
2156
2275
|
}
|
2157
2276
|
),
|
2158
|
-
/* @__PURE__ */ u.jsx("div", { className: `icon ${
|
2277
|
+
/* @__PURE__ */ u.jsx("div", { className: `icon ${nr(s.child)}` })
|
2159
2278
|
] }),
|
2160
2279
|
/* @__PURE__ */ u.jsx("div", { className: t ? "open" : "", children: /* @__PURE__ */ u.jsx("div", { className: "container", children: r }) })
|
2161
2280
|
] }, Math.random()) });
|
2162
2281
|
}
|
2163
|
-
function
|
2282
|
+
function Es(s) {
|
2164
2283
|
const e = [];
|
2165
2284
|
return s.child?.children.map((t, i) => {
|
2166
|
-
e.push(/* @__PURE__ */ u.jsx(
|
2285
|
+
e.push(/* @__PURE__ */ u.jsx(bn, { child: t, scene: s.scene, three: s.three }, i));
|
2167
2286
|
}), /* @__PURE__ */ u.jsx("div", { className: `scene ${s.class !== void 0 ? s.class : ""}`, children: e });
|
2168
2287
|
}
|
2169
|
-
function
|
2288
|
+
function It(s) {
|
2170
2289
|
const [e, t] = Z(s.defaultValue);
|
2171
2290
|
return tt(() => {
|
2172
2291
|
let i = !1, n = -1, r = 0, a = s.defaultValue, o = !1;
|
@@ -2177,13 +2296,13 @@ function Rt(s) {
|
|
2177
2296
|
}, d = (f) => {
|
2178
2297
|
if (!i)
|
2179
2298
|
return;
|
2180
|
-
const
|
2299
|
+
const C = s.step !== void 0 ? s.step : 1, y = (f.clientX - n) * C * (o ? 10 : 1);
|
2181
2300
|
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
2301
|
}, p = () => {
|
2183
2302
|
i = !1, document.removeEventListener("mouseup", p), document.removeEventListener("mousemove", d), document.removeEventListener("contextmenu", p);
|
2184
2303
|
}, m = (f) => {
|
2185
|
-
const
|
2186
|
-
s.onChange !== void 0 && s.onChange(
|
2304
|
+
const C = Number(f.target.value);
|
2305
|
+
s.onChange !== void 0 && s.onChange(C), t(C);
|
2187
2306
|
};
|
2188
2307
|
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
2308
|
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 +2311,7 @@ function Rt(s) {
|
|
2192
2311
|
}
|
2193
2312
|
function Qe(s) {
|
2194
2313
|
const e = J(null), t = J(null), [i, n] = Z(s.value);
|
2195
|
-
return
|
2314
|
+
return It({
|
2196
2315
|
label: s.labelRef,
|
2197
2316
|
input: e,
|
2198
2317
|
sliderRef: t,
|
@@ -2251,18 +2370,18 @@ function Qe(s) {
|
|
2251
2370
|
max: s.max,
|
2252
2371
|
step: s.step,
|
2253
2372
|
ref: t,
|
2254
|
-
onChange:
|
2373
|
+
onChange: ai
|
2255
2374
|
}
|
2256
2375
|
)
|
2257
2376
|
] })
|
2258
2377
|
] });
|
2259
2378
|
}
|
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,
|
2379
|
+
function _r(s) {
|
2380
|
+
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
2381
|
min: Math.min(s.min, Math.min(s.value.x, s.value.y)),
|
2263
2382
|
max: Math.max(s.max, Math.max(s.value.x, s.value.y))
|
2264
2383
|
}), [g, v] = Z(!1);
|
2265
|
-
|
2384
|
+
It({
|
2266
2385
|
label: o,
|
2267
2386
|
input: e,
|
2268
2387
|
defaultValue: p,
|
@@ -2272,7 +2391,7 @@ function ar(s) {
|
|
2272
2391
|
onChange: (R) => {
|
2273
2392
|
m(R), s.onChange({ target: { value: { x: R, y: f } } });
|
2274
2393
|
}
|
2275
|
-
}),
|
2394
|
+
}), It({
|
2276
2395
|
label: c,
|
2277
2396
|
input: t,
|
2278
2397
|
defaultValue: f,
|
@@ -2280,9 +2399,9 @@ function ar(s) {
|
|
2280
2399
|
max: y.max,
|
2281
2400
|
step: 0.01,
|
2282
2401
|
onChange: (R) => {
|
2283
|
-
|
2402
|
+
C(R), s.onChange({ target: { value: { x: p, y: R } } });
|
2284
2403
|
}
|
2285
|
-
}),
|
2404
|
+
}), It({
|
2286
2405
|
label: l,
|
2287
2406
|
input: i,
|
2288
2407
|
defaultValue: y.min,
|
@@ -2292,7 +2411,7 @@ function ar(s) {
|
|
2292
2411
|
onChange: (R) => {
|
2293
2412
|
T({ min: R, max: y.max });
|
2294
2413
|
}
|
2295
|
-
}),
|
2414
|
+
}), It({
|
2296
2415
|
label: d,
|
2297
2416
|
input: n,
|
2298
2417
|
defaultValue: y.max,
|
@@ -2304,25 +2423,25 @@ function ar(s) {
|
|
2304
2423
|
}
|
2305
2424
|
});
|
2306
2425
|
function S() {
|
2307
|
-
g || (window.addEventListener("mousemove", w), window.addEventListener("mouseup",
|
2426
|
+
g || (window.addEventListener("mousemove", w), window.addEventListener("mouseup", E), v(!0));
|
2308
2427
|
}
|
2309
|
-
function
|
2310
|
-
window.removeEventListener("mousemove", w), window.removeEventListener("mouseup",
|
2428
|
+
function E() {
|
2429
|
+
window.removeEventListener("mousemove", w), window.removeEventListener("mouseup", E), v(!1);
|
2311
2430
|
}
|
2312
2431
|
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:
|
2432
|
+
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);
|
2433
|
+
s.onChange({ target: { value: { x: re, y: q } } }), m(re), C(q);
|
2315
2434
|
}
|
2316
2435
|
function O() {
|
2317
2436
|
const R = Number(i.current.value);
|
2318
|
-
T({ min: R, max: y.max }), p < R && m($e(R, y.max, p)), f < R &&
|
2437
|
+
T({ min: R, max: y.max }), p < R && m($e(R, y.max, p)), f < R && C($e(R, y.max, f));
|
2319
2438
|
}
|
2320
2439
|
function L() {
|
2321
2440
|
const R = Number(n.current.value);
|
2322
|
-
T({ min: y.min, max: R }), p > R && m($e(y.min, R, p)), f > R &&
|
2441
|
+
T({ min: y.min, max: R }), p > R && m($e(y.min, R, p)), f > R && C($e(y.min, R, f));
|
2323
2442
|
}
|
2324
2443
|
tt(() => {
|
2325
|
-
a.current.style.left = `${
|
2444
|
+
a.current.style.left = `${_s(y.min, y.max, p) * 100}%`, a.current.style.top = `${(1 - _s(y.min, y.max, f)) * 100}%`;
|
2326
2445
|
}, [y, p, f]);
|
2327
2446
|
const j = s.step !== void 0 ? s.step : 0.01;
|
2328
2447
|
return /* @__PURE__ */ u.jsxs("div", { className: "vector2", children: [
|
@@ -2359,7 +2478,7 @@ function ar(s) {
|
|
2359
2478
|
max: y.max,
|
2360
2479
|
step: j,
|
2361
2480
|
onChange: (R) => {
|
2362
|
-
if (
|
2481
|
+
if (C(R.target.value), R.target.value.length === 0)
|
2363
2482
|
return;
|
2364
2483
|
const B = Number(R.target.value);
|
2365
2484
|
isNaN(B) || (s.onChange({ target: { value: { x: p, y: B } } }), B > y.max && T({ min: y.min, max: B }));
|
@@ -2394,30 +2513,30 @@ function ar(s) {
|
|
2394
2513
|
)
|
2395
2514
|
] })
|
2396
2515
|
] }),
|
2397
|
-
/* @__PURE__ */ u.jsxs("div", { className: "input", ref: r, onMouseDown: S, onMouseUp:
|
2516
|
+
/* @__PURE__ */ u.jsxs("div", { className: "input", ref: r, onMouseDown: S, onMouseUp: E, children: [
|
2398
2517
|
/* @__PURE__ */ u.jsx("div", { className: "x" }),
|
2399
2518
|
/* @__PURE__ */ u.jsx("div", { className: "y" }),
|
2400
2519
|
/* @__PURE__ */ u.jsx("div", { className: "pt", ref: a })
|
2401
2520
|
] })
|
2402
2521
|
] });
|
2403
2522
|
}
|
2404
|
-
const
|
2405
|
-
function
|
2523
|
+
const vr = Math.PI / 180, yr = 180 / Math.PI;
|
2524
|
+
function ot(s, e, t, i, n) {
|
2406
2525
|
return i + (s - e) * (n - i) / (t - e);
|
2407
2526
|
}
|
2408
|
-
function
|
2527
|
+
function lt(s, e, t) {
|
2409
2528
|
return (1 - t) * s + t * e;
|
2410
2529
|
}
|
2411
|
-
function
|
2412
|
-
return s *
|
2530
|
+
function Fi(s) {
|
2531
|
+
return s * vr;
|
2413
2532
|
}
|
2414
|
-
function
|
2415
|
-
return s *
|
2533
|
+
function br(s) {
|
2534
|
+
return s * yr;
|
2416
2535
|
}
|
2417
|
-
function
|
2536
|
+
function Cs(s) {
|
2418
2537
|
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
2538
|
if (t) {
|
2420
|
-
const a =
|
2539
|
+
const a = jt(() => s.value, []);
|
2421
2540
|
["_x", "_y", "_z"].forEach((c) => {
|
2422
2541
|
const l = J(null);
|
2423
2542
|
r.push(
|
@@ -2426,13 +2545,13 @@ function ys(s) {
|
|
2426
2545
|
/* @__PURE__ */ u.jsx(
|
2427
2546
|
Qe,
|
2428
2547
|
{
|
2429
|
-
value:
|
2548
|
+
value: br(a[c]),
|
2430
2549
|
type: "number",
|
2431
2550
|
prop: c,
|
2432
2551
|
step: 0.1,
|
2433
2552
|
labelRef: l,
|
2434
2553
|
onChange: (d, p) => {
|
2435
|
-
a[d] =
|
2554
|
+
a[d] = Fi(p), s.onChange({ target: { value: a } });
|
2436
2555
|
}
|
2437
2556
|
}
|
2438
2557
|
)
|
@@ -2440,7 +2559,7 @@ function ys(s) {
|
|
2440
2559
|
);
|
2441
2560
|
});
|
2442
2561
|
} else if (e) {
|
2443
|
-
const a =
|
2562
|
+
const a = jt(() => s.value, []), o = (l, d) => {
|
2444
2563
|
a[l] = d, s.onChange({ target: { value: a } });
|
2445
2564
|
};
|
2446
2565
|
["x", "y", "z"].forEach((l) => {
|
@@ -2463,7 +2582,7 @@ function ys(s) {
|
|
2463
2582
|
);
|
2464
2583
|
});
|
2465
2584
|
} else if (i) {
|
2466
|
-
const a =
|
2585
|
+
const a = jt(() => s.value, []), o = (c, l) => {
|
2467
2586
|
const d = Number(c);
|
2468
2587
|
a.elements[d] = l, s.onChange({ target: { value: a } });
|
2469
2588
|
};
|
@@ -2489,10 +2608,10 @@ function ys(s) {
|
|
2489
2608
|
}
|
2490
2609
|
return /* @__PURE__ */ u.jsx("div", { className: "grid3", children: r }, Math.random().toString());
|
2491
2610
|
}
|
2492
|
-
function
|
2611
|
+
function Er(s) {
|
2493
2612
|
const e = s.value.x !== void 0, t = s.step !== void 0 ? s.step : 0.01, i = [];
|
2494
2613
|
if (e) {
|
2495
|
-
const n =
|
2614
|
+
const n = jt(() => s.value, []), r = (o, c) => {
|
2496
2615
|
n[o] = c, s.onChange({ target: { value: n } });
|
2497
2616
|
};
|
2498
2617
|
["x", "y", "z", "w"].forEach((o) => {
|
@@ -2515,7 +2634,7 @@ function cr(s) {
|
|
2515
2634
|
);
|
2516
2635
|
});
|
2517
2636
|
} else {
|
2518
|
-
const n =
|
2637
|
+
const n = jt(() => s.value, []), r = (a, o) => {
|
2519
2638
|
const c = Number(a);
|
2520
2639
|
n.elements[c] = o, s.onChange({ target: { value: n } });
|
2521
2640
|
};
|
@@ -2541,10 +2660,10 @@ function cr(s) {
|
|
2541
2660
|
}
|
2542
2661
|
return /* @__PURE__ */ u.jsx("div", { className: "grid4", children: i });
|
2543
2662
|
}
|
2544
|
-
function
|
2663
|
+
function Cr(s) {
|
2545
2664
|
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
2665
|
}
|
2547
|
-
function
|
2666
|
+
function Sr(s) {
|
2548
2667
|
switch (s) {
|
2549
2668
|
case "Alpha Map":
|
2550
2669
|
return "alphaMap";
|
@@ -2593,7 +2712,7 @@ function dr(s) {
|
|
2593
2712
|
}
|
2594
2713
|
return s;
|
2595
2714
|
}
|
2596
|
-
function
|
2715
|
+
function hi(s) {
|
2597
2716
|
switch (s) {
|
2598
2717
|
case "alphaHash":
|
2599
2718
|
return "Alpha Hash";
|
@@ -2796,11 +2915,11 @@ function ci(s) {
|
|
2796
2915
|
}
|
2797
2916
|
return s;
|
2798
2917
|
}
|
2799
|
-
function
|
2918
|
+
function En(s) {
|
2800
2919
|
const e = s.toLowerCase();
|
2801
2920
|
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
2921
|
}
|
2803
|
-
function
|
2922
|
+
function wr() {
|
2804
2923
|
const s = document.createElement("input");
|
2805
2924
|
return s.type = "file", new Promise((e, t) => {
|
2806
2925
|
s.addEventListener("change", function() {
|
@@ -2815,191 +2934,191 @@ function ur() {
|
|
2815
2934
|
}), s.click();
|
2816
2935
|
});
|
2817
2936
|
}
|
2818
|
-
const
|
2937
|
+
const xr = [
|
2819
2938
|
{
|
2820
2939
|
title: "Front",
|
2821
|
-
value:
|
2940
|
+
value: Qn
|
2822
2941
|
},
|
2823
2942
|
{
|
2824
2943
|
title: "Back",
|
2825
|
-
value:
|
2944
|
+
value: Xs
|
2826
2945
|
},
|
2827
2946
|
{
|
2828
2947
|
title: "Double",
|
2829
|
-
value:
|
2948
|
+
value: Bi
|
2830
2949
|
}
|
2831
|
-
],
|
2950
|
+
], Or = [
|
2832
2951
|
{
|
2833
2952
|
title: "No Blending",
|
2834
|
-
value:
|
2953
|
+
value: Jn
|
2835
2954
|
},
|
2836
2955
|
{
|
2837
2956
|
title: "Normal",
|
2838
|
-
value:
|
2957
|
+
value: ea
|
2839
2958
|
},
|
2840
2959
|
{
|
2841
2960
|
title: "Additive",
|
2842
|
-
value:
|
2961
|
+
value: ta
|
2843
2962
|
},
|
2844
2963
|
{
|
2845
2964
|
title: "Subtractive",
|
2846
|
-
value:
|
2965
|
+
value: ia
|
2847
2966
|
},
|
2848
2967
|
{
|
2849
2968
|
title: "Multiply",
|
2850
|
-
value:
|
2969
|
+
value: sa
|
2851
2970
|
},
|
2852
2971
|
{
|
2853
2972
|
title: "Custom",
|
2854
|
-
value:
|
2973
|
+
value: na
|
2855
2974
|
}
|
2856
|
-
],
|
2975
|
+
], Tr = [
|
2857
2976
|
{
|
2858
2977
|
title: "Add",
|
2859
|
-
value:
|
2978
|
+
value: aa
|
2860
2979
|
},
|
2861
2980
|
{
|
2862
2981
|
title: "Subtract",
|
2863
|
-
value:
|
2982
|
+
value: ra
|
2864
2983
|
},
|
2865
2984
|
{
|
2866
2985
|
title: "Reverse Subtract",
|
2867
|
-
value:
|
2986
|
+
value: oa
|
2868
2987
|
},
|
2869
2988
|
{
|
2870
2989
|
title: "Min",
|
2871
|
-
value:
|
2990
|
+
value: la
|
2872
2991
|
},
|
2873
2992
|
{
|
2874
2993
|
title: "Max",
|
2875
|
-
value:
|
2994
|
+
value: ca
|
2876
2995
|
}
|
2877
|
-
],
|
2996
|
+
], Mr = [
|
2878
2997
|
{
|
2879
2998
|
title: "Zero",
|
2880
|
-
value:
|
2999
|
+
value: $s
|
2881
3000
|
},
|
2882
3001
|
{
|
2883
3002
|
title: "One",
|
2884
|
-
value:
|
3003
|
+
value: Ks
|
2885
3004
|
},
|
2886
3005
|
{
|
2887
3006
|
title: "Src Color",
|
2888
|
-
value:
|
3007
|
+
value: qs
|
2889
3008
|
},
|
2890
3009
|
{
|
2891
3010
|
title: "One Minus Src Color",
|
2892
|
-
value:
|
3011
|
+
value: Qs
|
2893
3012
|
},
|
2894
3013
|
{
|
2895
3014
|
title: "Src Alpha",
|
2896
|
-
value:
|
3015
|
+
value: Js
|
2897
3016
|
},
|
2898
3017
|
{
|
2899
3018
|
title: "One Minus Src Alpha",
|
2900
|
-
value:
|
3019
|
+
value: en
|
2901
3020
|
},
|
2902
3021
|
{
|
2903
3022
|
title: "Dst Alpha",
|
2904
|
-
value:
|
3023
|
+
value: tn
|
2905
3024
|
},
|
2906
3025
|
{
|
2907
3026
|
title: "One Minus Dst Alpha",
|
2908
|
-
value:
|
3027
|
+
value: sn
|
2909
3028
|
},
|
2910
3029
|
{
|
2911
3030
|
title: "Dst Color",
|
2912
|
-
value:
|
3031
|
+
value: nn
|
2913
3032
|
},
|
2914
3033
|
{
|
2915
3034
|
title: "One Minus Dst Color",
|
2916
|
-
value:
|
3035
|
+
value: an
|
2917
3036
|
},
|
2918
3037
|
{
|
2919
3038
|
title: "Src Alpha Saturate",
|
2920
|
-
value:
|
3039
|
+
value: ha
|
2921
3040
|
},
|
2922
3041
|
{
|
2923
3042
|
title: "Constant Color",
|
2924
|
-
value:
|
3043
|
+
value: rn
|
2925
3044
|
},
|
2926
3045
|
{
|
2927
3046
|
title: "One Minus Constant Color",
|
2928
|
-
value:
|
3047
|
+
value: on
|
2929
3048
|
},
|
2930
3049
|
{
|
2931
3050
|
title: "Constant Alpha",
|
2932
|
-
value:
|
3051
|
+
value: ln
|
2933
3052
|
},
|
2934
3053
|
{
|
2935
3054
|
title: "One Minus Constant Alpha",
|
2936
|
-
value:
|
3055
|
+
value: cn
|
2937
3056
|
}
|
2938
|
-
],
|
3057
|
+
], Pr = [
|
2939
3058
|
{
|
2940
3059
|
title: "Zero",
|
2941
|
-
value:
|
3060
|
+
value: $s
|
2942
3061
|
},
|
2943
3062
|
{
|
2944
3063
|
title: "One",
|
2945
|
-
value:
|
3064
|
+
value: Ks
|
2946
3065
|
},
|
2947
3066
|
{
|
2948
3067
|
title: "Src Color",
|
2949
|
-
value:
|
3068
|
+
value: qs
|
2950
3069
|
},
|
2951
3070
|
{
|
2952
3071
|
title: "One Minus Src Color",
|
2953
|
-
value:
|
3072
|
+
value: Qs
|
2954
3073
|
},
|
2955
3074
|
{
|
2956
3075
|
title: "Src Alpha",
|
2957
|
-
value:
|
3076
|
+
value: Js
|
2958
3077
|
},
|
2959
3078
|
{
|
2960
3079
|
title: "One Minus Src Alpha",
|
2961
|
-
value:
|
3080
|
+
value: en
|
2962
3081
|
},
|
2963
3082
|
{
|
2964
3083
|
title: "Dst Alpha",
|
2965
|
-
value:
|
3084
|
+
value: tn
|
2966
3085
|
},
|
2967
3086
|
{
|
2968
3087
|
title: "One Minus Dst Alpha",
|
2969
|
-
value:
|
3088
|
+
value: sn
|
2970
3089
|
},
|
2971
3090
|
{
|
2972
3091
|
title: "Dst Color",
|
2973
|
-
value:
|
3092
|
+
value: nn
|
2974
3093
|
},
|
2975
3094
|
{
|
2976
3095
|
title: "One Minus Dst Color",
|
2977
|
-
value:
|
3096
|
+
value: an
|
2978
3097
|
},
|
2979
3098
|
{
|
2980
3099
|
title: "Constant Color",
|
2981
|
-
value:
|
3100
|
+
value: rn
|
2982
3101
|
},
|
2983
3102
|
{
|
2984
3103
|
title: "One Minus Constant Color",
|
2985
|
-
value:
|
3104
|
+
value: on
|
2986
3105
|
},
|
2987
3106
|
{
|
2988
3107
|
title: "Constant Alpha",
|
2989
|
-
value:
|
3108
|
+
value: ln
|
2990
3109
|
},
|
2991
3110
|
{
|
2992
3111
|
title: "One Minus Constant Alpha",
|
2993
|
-
value:
|
3112
|
+
value: cn
|
2994
3113
|
}
|
2995
3114
|
];
|
2996
|
-
function
|
3115
|
+
function xt(s, e) {
|
2997
3116
|
s.needsUpdate = !0, s.type = "option", s.options = e;
|
2998
3117
|
}
|
2999
|
-
function
|
3118
|
+
function Ar(s, e, t, i) {
|
3000
3119
|
return {
|
3001
3120
|
type: "boolean",
|
3002
|
-
title:
|
3121
|
+
title: hi(s),
|
3003
3122
|
prop: s,
|
3004
3123
|
value: e,
|
3005
3124
|
needsUpdate: !0,
|
@@ -3013,10 +3132,10 @@ function vr(s, e, t, i) {
|
|
3013
3132
|
}
|
3014
3133
|
};
|
3015
3134
|
}
|
3016
|
-
function
|
3135
|
+
function Dr(s, e, t, i) {
|
3017
3136
|
const n = {
|
3018
3137
|
type: "number",
|
3019
|
-
title:
|
3138
|
+
title: hi(s),
|
3020
3139
|
prop: s,
|
3021
3140
|
value: e,
|
3022
3141
|
min: void 0,
|
@@ -3034,27 +3153,27 @@ function yr(s, e, t, i) {
|
|
3034
3153
|
};
|
3035
3154
|
switch (s) {
|
3036
3155
|
case "blending":
|
3037
|
-
|
3156
|
+
xt(n, Or);
|
3038
3157
|
break;
|
3039
3158
|
case "blendDst":
|
3040
|
-
|
3159
|
+
xt(n, Pr);
|
3041
3160
|
break;
|
3042
3161
|
case "blendEquation":
|
3043
|
-
|
3162
|
+
xt(n, Tr);
|
3044
3163
|
break;
|
3045
3164
|
case "blendSrc":
|
3046
|
-
|
3165
|
+
xt(n, Mr);
|
3047
3166
|
break;
|
3048
3167
|
case "side":
|
3049
|
-
|
3168
|
+
xt(n, xr);
|
3050
3169
|
break;
|
3051
3170
|
}
|
3052
|
-
return
|
3171
|
+
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
3172
|
}
|
3054
|
-
function
|
3173
|
+
function Rr(s, e, t, i) {
|
3055
3174
|
const n = {
|
3056
3175
|
type: "string",
|
3057
|
-
title:
|
3176
|
+
title: hi(s),
|
3058
3177
|
prop: s,
|
3059
3178
|
value: e,
|
3060
3179
|
needsUpdate: !0,
|
@@ -3087,20 +3206,20 @@ function br(s, e, t, i) {
|
|
3087
3206
|
}
|
3088
3207
|
}), n;
|
3089
3208
|
}
|
3090
|
-
function
|
3209
|
+
function Ir(s) {
|
3091
3210
|
return s.x !== void 0 && s.y !== void 0 && s.z === void 0;
|
3092
3211
|
}
|
3093
|
-
function
|
3212
|
+
function Lr(s) {
|
3094
3213
|
return s.x !== void 0 && s.y !== void 0 && s.z !== void 0 && s.w === void 0;
|
3095
3214
|
}
|
3096
|
-
function
|
3215
|
+
function kr(s) {
|
3097
3216
|
return s.x !== void 0 && s.y !== void 0 && s.z !== void 0 && s.w !== void 0;
|
3098
3217
|
}
|
3099
|
-
function
|
3218
|
+
function zi(s) {
|
3100
3219
|
s.sort((e, t) => e.title < t.title ? -1 : e.title > t.title ? 1 : 0);
|
3101
3220
|
}
|
3102
|
-
function
|
3103
|
-
const a =
|
3221
|
+
function Lt(s, e, t, i, n = "", r = !1) {
|
3222
|
+
const a = hi(s).split(".")[0].replaceAll("[", "").replaceAll("]", ""), o = n.length > 0 ? `${n}.${s}` : s, c = typeof e;
|
3104
3223
|
if (c === "boolean" || c === "string")
|
3105
3224
|
return {
|
3106
3225
|
title: a,
|
@@ -3134,7 +3253,7 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3134
3253
|
}
|
3135
3254
|
}
|
3136
3255
|
};
|
3137
|
-
return
|
3256
|
+
return En(a) && (l.type = "range", l.min = 0, l.max = 1), l;
|
3138
3257
|
} else {
|
3139
3258
|
if (e.isColor)
|
3140
3259
|
return {
|
@@ -3158,20 +3277,20 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3158
3277
|
for (const d in e) {
|
3159
3278
|
const p = e[d], m = `[${d.toString()}]`;
|
3160
3279
|
if (p.value !== void 0) {
|
3161
|
-
const f =
|
3280
|
+
const f = Lt(`${m}.value`, p.value, t, i, o, r);
|
3162
3281
|
f !== void 0 && l.push(f);
|
3163
3282
|
} else {
|
3164
|
-
const f =
|
3283
|
+
const f = Lt(m, p, t, i, o, r);
|
3165
3284
|
f !== void 0 && l.push(f);
|
3166
3285
|
}
|
3167
3286
|
}
|
3168
3287
|
if (l.length > 0)
|
3169
|
-
return
|
3288
|
+
return zi(l), {
|
3170
3289
|
title: a,
|
3171
3290
|
items: l
|
3172
3291
|
};
|
3173
3292
|
} else {
|
3174
|
-
if (
|
3293
|
+
if (Ir(e))
|
3175
3294
|
return {
|
3176
3295
|
title: a,
|
3177
3296
|
prop: o,
|
@@ -3187,7 +3306,7 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3187
3306
|
}
|
3188
3307
|
}
|
3189
3308
|
};
|
3190
|
-
if (
|
3309
|
+
if (Lr(e))
|
3191
3310
|
return {
|
3192
3311
|
title: a,
|
3193
3312
|
prop: o,
|
@@ -3203,7 +3322,7 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3203
3322
|
}
|
3204
3323
|
}
|
3205
3324
|
};
|
3206
|
-
if (
|
3325
|
+
if (kr(e))
|
3207
3326
|
return {
|
3208
3327
|
title: a,
|
3209
3328
|
prop: o,
|
@@ -3242,14 +3361,14 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3242
3361
|
value: e,
|
3243
3362
|
disabled: r,
|
3244
3363
|
onChange: (l, d) => {
|
3245
|
-
const p =
|
3364
|
+
const p = Sr(s), m = n.length > 0 ? `${n}.${p}` : p;
|
3246
3365
|
i.createTexture(t.uuid, `material.${m}`, d);
|
3247
3366
|
const f = i.getScene(t.uuid);
|
3248
3367
|
if (f !== null) {
|
3249
|
-
const
|
3250
|
-
if (
|
3368
|
+
const C = f.getObjectByProperty("uuid", t.uuid);
|
3369
|
+
if (C !== void 0) {
|
3251
3370
|
const y = (T) => {
|
3252
|
-
const g =
|
3371
|
+
const g = C.material, v = m.split(".");
|
3253
3372
|
switch (v.length) {
|
3254
3373
|
case 1:
|
3255
3374
|
g[v[0]] = T;
|
@@ -3269,7 +3388,7 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3269
3388
|
}
|
3270
3389
|
g.needsUpdate = !0;
|
3271
3390
|
};
|
3272
|
-
d.src.length > 0 ?
|
3391
|
+
d.src.length > 0 ? vn(d.src).then((T) => {
|
3273
3392
|
T.offset.set(d.offset[0], d.offset[1]), T.repeat.set(d.repeat[0], d.repeat[1]), y(T);
|
3274
3393
|
}) : y(null);
|
3275
3394
|
}
|
@@ -3299,10 +3418,10 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3299
3418
|
const m = e[p];
|
3300
3419
|
if (m !== void 0)
|
3301
3420
|
if (m.value !== void 0) {
|
3302
|
-
const f =
|
3421
|
+
const f = Lt(`${p}.value`, m.value, t, i, o, d);
|
3303
3422
|
f !== void 0 && l.push(f);
|
3304
3423
|
} else {
|
3305
|
-
const f =
|
3424
|
+
const f = Lt(p, m, t, i, o, d);
|
3306
3425
|
f !== void 0 && l.push(f);
|
3307
3426
|
}
|
3308
3427
|
}
|
@@ -3310,7 +3429,7 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3310
3429
|
console.log("Issue cycling through material object:", s, e);
|
3311
3430
|
}
|
3312
3431
|
if (l.length > 0)
|
3313
|
-
return
|
3432
|
+
return zi(l), {
|
3314
3433
|
title: a,
|
3315
3434
|
items: l
|
3316
3435
|
};
|
@@ -3318,25 +3437,25 @@ function It(s, e, t, i, n = "", r = !1) {
|
|
3318
3437
|
}
|
3319
3438
|
}
|
3320
3439
|
}
|
3321
|
-
function
|
3440
|
+
function Ss(s, e, t) {
|
3322
3441
|
const i = [];
|
3323
3442
|
for (const n in s) {
|
3324
|
-
if (!
|
3443
|
+
if (!Cr(n))
|
3325
3444
|
continue;
|
3326
3445
|
const r = typeof s[n], a = s[n];
|
3327
3446
|
if (r === "boolean")
|
3328
|
-
i.push(
|
3447
|
+
i.push(Ar(n, a, e, t));
|
3329
3448
|
else if (r === "number")
|
3330
|
-
i.push(
|
3449
|
+
i.push(Dr(n, a, e, t));
|
3331
3450
|
else if (r === "string")
|
3332
|
-
i.push(
|
3451
|
+
i.push(Rr(n, a, e, t));
|
3333
3452
|
else if (r === "object") {
|
3334
|
-
const o =
|
3453
|
+
const o = Lt(n, a, e, t);
|
3335
3454
|
o !== void 0 && i.push(o);
|
3336
3455
|
} else
|
3337
3456
|
a !== void 0 && console.log("other:", n, r, a);
|
3338
3457
|
}
|
3339
|
-
return
|
3458
|
+
return zi(i), i.push({
|
3340
3459
|
title: "Update Material",
|
3341
3460
|
type: "button",
|
3342
3461
|
onChange: () => {
|
@@ -3349,7 +3468,7 @@ function bs(s, e, t) {
|
|
3349
3468
|
}
|
3350
3469
|
}), i;
|
3351
3470
|
}
|
3352
|
-
function
|
3471
|
+
function Ur(s, e) {
|
3353
3472
|
function t() {
|
3354
3473
|
return `${e.app.appID}_material`;
|
3355
3474
|
}
|
@@ -3366,7 +3485,7 @@ function wr(s, e) {
|
|
3366
3485
|
Oe,
|
3367
3486
|
{
|
3368
3487
|
title: `Material ${l}`,
|
3369
|
-
items:
|
3488
|
+
items: Ss(a[l], s, e)
|
3370
3489
|
},
|
3371
3490
|
`Material ${l}`
|
3372
3491
|
)
|
@@ -3377,7 +3496,7 @@ function wr(s, e) {
|
|
3377
3496
|
Oe,
|
3378
3497
|
{
|
3379
3498
|
title: "Material",
|
3380
|
-
items:
|
3499
|
+
items: Ss(a, s, e),
|
3381
3500
|
expanded: n,
|
3382
3501
|
onToggle: (o) => {
|
3383
3502
|
r(o);
|
@@ -3385,42 +3504,42 @@ function wr(s, e) {
|
|
3385
3504
|
}
|
3386
3505
|
);
|
3387
3506
|
}
|
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,
|
3507
|
+
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==";
|
3508
|
+
function jr(s) {
|
3509
|
+
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]);
|
3510
|
+
function T(v, S, E, w, O) {
|
3392
3511
|
if (s.onChange !== void 0) {
|
3393
3512
|
const L = s.prop !== void 0 ? s.prop : s.title;
|
3394
3513
|
s.onChange(L, {
|
3395
3514
|
src: v,
|
3396
|
-
offset: [S,
|
3515
|
+
offset: [S, E],
|
3397
3516
|
repeat: [w, O]
|
3398
3517
|
});
|
3399
3518
|
}
|
3400
3519
|
}
|
3401
3520
|
function g(v) {
|
3402
|
-
const S = t.current.src,
|
3521
|
+
const S = t.current.src, E = v.target.value;
|
3403
3522
|
switch (v.target) {
|
3404
3523
|
case i.current:
|
3405
|
-
l(
|
3524
|
+
l(E), T(S, E, d, m, C);
|
3406
3525
|
break;
|
3407
3526
|
case n.current:
|
3408
|
-
p(
|
3527
|
+
p(E), T(S, c, E, m, C);
|
3409
3528
|
break;
|
3410
3529
|
case r.current:
|
3411
|
-
f(
|
3530
|
+
f(E), T(S, c, d, E, C);
|
3412
3531
|
break;
|
3413
3532
|
case a.current:
|
3414
|
-
y(
|
3533
|
+
y(E), T(S, c, d, m, E);
|
3415
3534
|
break;
|
3416
3535
|
}
|
3417
3536
|
}
|
3418
3537
|
return /* @__PURE__ */ u.jsxs("div", { className: "imageField", children: [
|
3419
3538
|
/* @__PURE__ */ u.jsx("img", { alt: s.title, ref: t, onClick: () => {
|
3420
|
-
|
3421
|
-
t.current.src = v, T(v, c, d, m,
|
3539
|
+
wr().then((v) => {
|
3540
|
+
t.current.src = v, T(v, c, d, m, C);
|
3422
3541
|
});
|
3423
|
-
}, src: o.src.length > 0 ? o.src :
|
3542
|
+
}, src: o.src.length > 0 ? o.src : ws }),
|
3424
3543
|
/* @__PURE__ */ u.jsxs("div", { className: "fields", children: [
|
3425
3544
|
/* @__PURE__ */ u.jsxs("div", { children: [
|
3426
3545
|
/* @__PURE__ */ u.jsx("label", { children: "Offset:" }),
|
@@ -3462,21 +3581,21 @@ function xr(s) {
|
|
3462
3581
|
{
|
3463
3582
|
ref: a,
|
3464
3583
|
type: "number",
|
3465
|
-
value:
|
3584
|
+
value: C,
|
3466
3585
|
step: e,
|
3467
3586
|
onChange: g
|
3468
3587
|
}
|
3469
3588
|
)
|
3470
3589
|
] }),
|
3471
3590
|
/* @__PURE__ */ u.jsx("button", { onClick: () => {
|
3472
|
-
T("", c, d, m,
|
3591
|
+
T("", c, d, m, C), t.current.src = ws;
|
3473
3592
|
}, children: "Clear" })
|
3474
3593
|
] })
|
3475
3594
|
] });
|
3476
3595
|
}
|
3477
|
-
function
|
3596
|
+
function ii(s) {
|
3478
3597
|
let e = s.value;
|
3479
|
-
e !== void 0 && (e.isColor !== void 0 ? e =
|
3598
|
+
e !== void 0 && (e.isColor !== void 0 ? e = ps(s.value) : s.type === "color" && (e = ps(new et().setStyle(s.value, Nt))));
|
3480
3599
|
const [t, i] = Z(e), n = J(null), r = (l) => {
|
3481
3600
|
let d = l.target.value;
|
3482
3601
|
if (s.type === "boolean")
|
@@ -3492,7 +3611,7 @@ function ti(s) {
|
|
3492
3611
|
const o = s.type === "string" && (t.length > 100 || t.search(`
|
3493
3612
|
`) > -1), c = o || s.type === "image" || s.type === "vector2";
|
3494
3613
|
return /* @__PURE__ */ u.jsxs("div", { className: `field ${c ? "block" : ""}`, style: a, children: [
|
3495
|
-
s.type !== "button" && /* @__PURE__ */ u.jsx("label", { ref: n, children:
|
3614
|
+
s.type !== "button" && /* @__PURE__ */ u.jsx("label", { ref: n, children: ri(s.title) }, "fieldLabel"),
|
3496
3615
|
s.type === "string" && !o && /* @__PURE__ */ u.jsx(
|
3497
3616
|
"input",
|
3498
3617
|
{
|
@@ -3566,18 +3685,18 @@ function ti(s) {
|
|
3566
3685
|
children: s.title
|
3567
3686
|
}
|
3568
3687
|
),
|
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(
|
3688
|
+
s.type === "image" && /* @__PURE__ */ u.jsx(jr, { title: s.title, prop: s.prop, value: s.value, onChange: s.onChange }),
|
3689
|
+
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)) }) }),
|
3690
|
+
s.type === "vector2" && /* @__PURE__ */ u.jsx(_r, { step: s.step, value: t, min: 0, max: 1, onChange: r }),
|
3691
|
+
s.type === "grid3" && /* @__PURE__ */ u.jsx(Cs, { step: s.step, value: t, onChange: r }),
|
3692
|
+
s.type === "grid4" && /* @__PURE__ */ u.jsx(Er, { step: s.step, value: t, onChange: r }),
|
3693
|
+
s.type === "euler" && /* @__PURE__ */ u.jsx(Cs, { step: s.step, value: t, onChange: r })
|
3575
3694
|
] });
|
3576
3695
|
}
|
3577
|
-
function
|
3696
|
+
function Nr(s) {
|
3578
3697
|
return "items" in s;
|
3579
3698
|
}
|
3580
|
-
class Oe extends
|
3699
|
+
class Oe extends Ft {
|
3581
3700
|
subgroupNames = [];
|
3582
3701
|
subgroupElements = [];
|
3583
3702
|
valueOverrides = /* @__PURE__ */ new Map();
|
@@ -3629,15 +3748,15 @@ class Oe extends Nt {
|
|
3629
3748
|
render() {
|
3630
3749
|
const e = [];
|
3631
3750
|
return this.props.items.forEach((t) => {
|
3632
|
-
if (
|
3751
|
+
if (Nr(t))
|
3633
3752
|
e.push(
|
3634
|
-
/* @__PURE__ */ u.jsx(Oe, { title:
|
3753
|
+
/* @__PURE__ */ u.jsx(Oe, { title: ri(t.title), items: t.items }, Math.random())
|
3635
3754
|
);
|
3636
3755
|
else {
|
3637
3756
|
const i = this.valueOverrides.get(t.title), n = i !== void 0 ? i : t.value;
|
3638
3757
|
e.push(
|
3639
3758
|
/* @__PURE__ */ u.jsx(
|
3640
|
-
|
3759
|
+
ii,
|
3641
3760
|
{
|
3642
3761
|
title: t.title,
|
3643
3762
|
prop: t.prop,
|
@@ -3660,7 +3779,7 @@ class Oe extends Nt {
|
|
3660
3779
|
);
|
3661
3780
|
}
|
3662
3781
|
}), this.subgroupElements.forEach((t) => e.push(t)), /* @__PURE__ */ u.jsx(
|
3663
|
-
|
3782
|
+
oi,
|
3664
3783
|
{
|
3665
3784
|
label: this.props.title,
|
3666
3785
|
open: this.props.expanded === !0,
|
@@ -3672,16 +3791,16 @@ class Oe extends Nt {
|
|
3672
3791
|
);
|
3673
3792
|
}
|
3674
3793
|
}
|
3675
|
-
class ae extends
|
3794
|
+
class ae extends Ft {
|
3676
3795
|
static instance;
|
3677
3796
|
static groups = [];
|
3678
3797
|
static groupsRefs = [];
|
3679
3798
|
static groupTitles = [];
|
3680
3799
|
constructor(e) {
|
3681
|
-
super(e), this.state = { lastUpdate: Date.now() }, ae.instance = this, D.addEventListener(
|
3800
|
+
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
3801
|
}
|
3683
3802
|
componentWillUnmount() {
|
3684
|
-
D.removeEventListener(
|
3803
|
+
D.removeEventListener(A.ADD_GROUP, this.addGroup), D.removeEventListener(A.REMOVE_GROUP, this.removeGroup);
|
3685
3804
|
}
|
3686
3805
|
render() {
|
3687
3806
|
return /* @__PURE__ */ u.jsx("div", { className: "customGroups", children: ae.groups }, this.state.lastUpdate);
|
@@ -3762,7 +3881,7 @@ class ae extends Nt {
|
|
3762
3881
|
}
|
3763
3882
|
}
|
3764
3883
|
}
|
3765
|
-
function
|
3884
|
+
function xs(s) {
|
3766
3885
|
switch (s) {
|
3767
3886
|
case "fov":
|
3768
3887
|
return "FOV";
|
@@ -3791,7 +3910,7 @@ function Es(s) {
|
|
3791
3910
|
}
|
3792
3911
|
return s;
|
3793
3912
|
}
|
3794
|
-
function
|
3913
|
+
function Fr(s, e) {
|
3795
3914
|
function t() {
|
3796
3915
|
return `${e.app.appID}_camera`;
|
3797
3916
|
}
|
@@ -3803,7 +3922,7 @@ function Tr(s, e) {
|
|
3803
3922
|
if (s.perspectiveCameraInfo !== void 0)
|
3804
3923
|
for (const o in s.perspectiveCameraInfo)
|
3805
3924
|
a.push({
|
3806
|
-
title:
|
3925
|
+
title: xs(o),
|
3807
3926
|
prop: o,
|
3808
3927
|
type: "number",
|
3809
3928
|
step: 0.01,
|
@@ -3820,7 +3939,7 @@ function Tr(s, e) {
|
|
3820
3939
|
else if (s.orthographicCameraInfo !== void 0)
|
3821
3940
|
for (const o in s.orthographicCameraInfo)
|
3822
3941
|
a.push({
|
3823
|
-
title:
|
3942
|
+
title: xs(o),
|
3824
3943
|
prop: o,
|
3825
3944
|
type: "number",
|
3826
3945
|
step: 0.01,
|
@@ -3846,14 +3965,14 @@ function Tr(s, e) {
|
|
3846
3965
|
}
|
3847
3966
|
);
|
3848
3967
|
}
|
3849
|
-
class
|
3968
|
+
class zr extends Ie {
|
3850
3969
|
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
|
3970
|
+
const i = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0, 1, 1, 0], n = new _t();
|
3971
|
+
n.setAttribute("position", new qe(i, 3)), n.computeBoundingSphere();
|
3972
|
+
const r = new Vi({ fog: !1 });
|
3854
3973
|
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
|
3974
|
+
const a = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0], o = new _t();
|
3975
|
+
o.setAttribute("position", new qe(a, 3)), o.computeBoundingSphere(), this.add(new M(o, new Je({ side: Xs, fog: !1 })));
|
3857
3976
|
}
|
3858
3977
|
updateMatrixWorld() {
|
3859
3978
|
if (this.scale.set(0.5 * this.light.width, 0.5 * this.light.height, 1), this.color !== void 0)
|
@@ -3869,7 +3988,7 @@ class Mr extends Ie {
|
|
3869
3988
|
this.geometry.dispose(), this.material.dispose(), this.children[0].geometry.dispose(), this.children[0].material.dispose();
|
3870
3989
|
}
|
3871
3990
|
}
|
3872
|
-
const
|
3991
|
+
const Os = { type: "change" }, Gi = { type: "start" }, Cn = { type: "end" }, Wt = new da(), Ts = new ua(), Hr = Math.cos(70 * pa.DEG2RAD), oe = new P(), ye = 2 * Math.PI, V = {
|
3873
3992
|
NONE: -1,
|
3874
3993
|
ROTATE: 0,
|
3875
3994
|
DOLLY: 1,
|
@@ -3878,10 +3997,10 @@ const Ss = { type: "change" }, Vi = { type: "start" }, yn = { type: "end" }, Zt
|
|
3878
3997
|
TOUCH_PAN: 4,
|
3879
3998
|
TOUCH_DOLLY_PAN: 5,
|
3880
3999
|
TOUCH_DOLLY_ROTATE: 6
|
3881
|
-
},
|
3882
|
-
class
|
4000
|
+
}, Ci = 1e-6;
|
4001
|
+
class Yr extends hn {
|
3883
4002
|
constructor(e, t = null) {
|
3884
|
-
super(e, t), this.state = V.NONE, this.enabled = !0, this.target = new
|
4003
|
+
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 = Vr.bind(this), this._onPointerDown = Br.bind(this), this._onPointerUp = Zr.bind(this), this._onContextMenu = Qr.bind(this), this._onMouseWheel = Xr.bind(this), this._onKeyDown = $r.bind(this), this._onTouchStart = Kr.bind(this), this._onTouchMove = qr.bind(this), this._onMouseDown = Wr.bind(this), this._onMouseMove = Gr.bind(this), this._interceptControlDown = Jr.bind(this), this._interceptControlUp = eo.bind(this), this.domElement !== null && this.connect(), this.update();
|
3885
4004
|
}
|
3886
4005
|
connect() {
|
3887
4006
|
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 +4030,7 @@ class Pr extends on {
|
|
3911
4030
|
this.target0.copy(this.target), this.position0.copy(this.object.position), this.zoom0 = this.object.zoom;
|
3912
4031
|
}
|
3913
4032
|
reset() {
|
3914
|
-
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(
|
4033
|
+
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
4034
|
}
|
3916
4035
|
update(e = null) {
|
3917
4036
|
const t = this.object.position;
|
@@ -3933,20 +4052,20 @@ class Pr extends on {
|
|
3933
4052
|
const c = o - a;
|
3934
4053
|
this.object.position.addScaledVector(this._dollyDirection, c), this.object.updateMatrixWorld(), r = !!c;
|
3935
4054
|
} else if (this.object.isOrthographicCamera) {
|
3936
|
-
const o = new
|
4055
|
+
const o = new P(this._mouse.x, this._mouse.y, 0);
|
3937
4056
|
o.unproject(this.object);
|
3938
4057
|
const c = this.object.zoom;
|
3939
4058
|
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
|
4059
|
+
const l = new P(this._mouse.x, this._mouse.y, 0);
|
3941
4060
|
l.unproject(this.object), this.object.position.sub(l).add(o), this.object.updateMatrixWorld(), a = oe.length();
|
3942
4061
|
} else
|
3943
4062
|
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) : (
|
4063
|
+
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)) < Hr ? this.object.lookAt(this.target) : (Ts.setFromNormalAndCoplanarPoint(this.object.up, this.target), Wt.intersectPlane(Ts, this.target))));
|
3945
4064
|
} else if (this.object.isOrthographicCamera) {
|
3946
4065
|
const a = this.object.zoom;
|
3947
4066
|
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
4067
|
}
|
3949
|
-
return this._scale = 1, this._performCursorZoom = !1, r || this._lastPosition.distanceToSquared(this.object.position) >
|
4068
|
+
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
4069
|
}
|
3951
4070
|
_getAutoRotationAngle(e) {
|
3952
4071
|
return e !== null ? ye / 60 * this.autoRotateSpeed * e : ye / 60 / 60 * this.autoRotateSpeed;
|
@@ -4140,16 +4259,16 @@ class Pr extends on {
|
|
4140
4259
|
return e.ctrlKey && !this._controlActive && (i.deltaY *= 10), i;
|
4141
4260
|
}
|
4142
4261
|
}
|
4143
|
-
function
|
4262
|
+
function Br(s) {
|
4144
4263
|
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
4264
|
}
|
4146
|
-
function
|
4265
|
+
function Vr(s) {
|
4147
4266
|
this.enabled !== !1 && (s.pointerType === "touch" ? this._onTouchMove(s) : this._onMouseMove(s));
|
4148
4267
|
}
|
4149
|
-
function
|
4268
|
+
function Zr(s) {
|
4150
4269
|
switch (this._removePointer(s), this._pointers.length) {
|
4151
4270
|
case 0:
|
4152
|
-
this.domElement.releasePointerCapture(s.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(
|
4271
|
+
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
4272
|
break;
|
4154
4273
|
case 1:
|
4155
4274
|
const e = this._pointers[0], t = this._pointerPositions[e];
|
@@ -4157,7 +4276,7 @@ function Ir(s) {
|
|
4157
4276
|
break;
|
4158
4277
|
}
|
4159
4278
|
}
|
4160
|
-
function
|
4279
|
+
function Wr(s) {
|
4161
4280
|
let e;
|
4162
4281
|
switch (s.button) {
|
4163
4282
|
case 0:
|
@@ -4173,12 +4292,12 @@ function Lr(s) {
|
|
4173
4292
|
e = -1;
|
4174
4293
|
}
|
4175
4294
|
switch (e) {
|
4176
|
-
case
|
4295
|
+
case gt.DOLLY:
|
4177
4296
|
if (this.enableZoom === !1)
|
4178
4297
|
return;
|
4179
4298
|
this._handleMouseDownDolly(s), this.state = V.DOLLY;
|
4180
4299
|
break;
|
4181
|
-
case
|
4300
|
+
case gt.ROTATE:
|
4182
4301
|
if (s.ctrlKey || s.metaKey || s.shiftKey) {
|
4183
4302
|
if (this.enablePan === !1)
|
4184
4303
|
return;
|
@@ -4189,7 +4308,7 @@ function Lr(s) {
|
|
4189
4308
|
this._handleMouseDownRotate(s), this.state = V.ROTATE;
|
4190
4309
|
}
|
4191
4310
|
break;
|
4192
|
-
case
|
4311
|
+
case gt.PAN:
|
4193
4312
|
if (s.ctrlKey || s.metaKey || s.shiftKey) {
|
4194
4313
|
if (this.enableRotate === !1)
|
4195
4314
|
return;
|
@@ -4203,9 +4322,9 @@ function Lr(s) {
|
|
4203
4322
|
default:
|
4204
4323
|
this.state = V.NONE;
|
4205
4324
|
}
|
4206
|
-
this.state !== V.NONE && this.dispatchEvent(
|
4325
|
+
this.state !== V.NONE && this.dispatchEvent(Gi);
|
4207
4326
|
}
|
4208
|
-
function
|
4327
|
+
function Gr(s) {
|
4209
4328
|
switch (this.state) {
|
4210
4329
|
case V.ROTATE:
|
4211
4330
|
if (this.enableRotate === !1)
|
@@ -4224,22 +4343,22 @@ function kr(s) {
|
|
4224
4343
|
break;
|
4225
4344
|
}
|
4226
4345
|
}
|
4227
|
-
function
|
4228
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !== V.NONE || (s.preventDefault(), this.dispatchEvent(
|
4346
|
+
function Xr(s) {
|
4347
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== V.NONE || (s.preventDefault(), this.dispatchEvent(Gi), this._handleMouseWheel(this._customWheelEvent(s)), this.dispatchEvent(Cn));
|
4229
4348
|
}
|
4230
|
-
function
|
4349
|
+
function $r(s) {
|
4231
4350
|
this.enabled === !1 || this.enablePan === !1 || this._handleKeyDown(s);
|
4232
4351
|
}
|
4233
|
-
function
|
4352
|
+
function Kr(s) {
|
4234
4353
|
switch (this._trackPointer(s), this._pointers.length) {
|
4235
4354
|
case 1:
|
4236
4355
|
switch (this.touches.ONE) {
|
4237
|
-
case
|
4356
|
+
case ft.ROTATE:
|
4238
4357
|
if (this.enableRotate === !1)
|
4239
4358
|
return;
|
4240
4359
|
this._handleTouchStartRotate(s), this.state = V.TOUCH_ROTATE;
|
4241
4360
|
break;
|
4242
|
-
case
|
4361
|
+
case ft.PAN:
|
4243
4362
|
if (this.enablePan === !1)
|
4244
4363
|
return;
|
4245
4364
|
this._handleTouchStartPan(s), this.state = V.TOUCH_PAN;
|
@@ -4250,12 +4369,12 @@ function Nr(s) {
|
|
4250
4369
|
break;
|
4251
4370
|
case 2:
|
4252
4371
|
switch (this.touches.TWO) {
|
4253
|
-
case
|
4372
|
+
case ft.DOLLY_PAN:
|
4254
4373
|
if (this.enableZoom === !1 && this.enablePan === !1)
|
4255
4374
|
return;
|
4256
4375
|
this._handleTouchStartDollyPan(s), this.state = V.TOUCH_DOLLY_PAN;
|
4257
4376
|
break;
|
4258
|
-
case
|
4377
|
+
case ft.DOLLY_ROTATE:
|
4259
4378
|
if (this.enableZoom === !1 && this.enableRotate === !1)
|
4260
4379
|
return;
|
4261
4380
|
this._handleTouchStartDollyRotate(s), this.state = V.TOUCH_DOLLY_ROTATE;
|
@@ -4267,9 +4386,9 @@ function Nr(s) {
|
|
4267
4386
|
default:
|
4268
4387
|
this.state = V.NONE;
|
4269
4388
|
}
|
4270
|
-
this.state !== V.NONE && this.dispatchEvent(
|
4389
|
+
this.state !== V.NONE && this.dispatchEvent(Gi);
|
4271
4390
|
}
|
4272
|
-
function
|
4391
|
+
function qr(s) {
|
4273
4392
|
switch (this._trackPointer(s), this.state) {
|
4274
4393
|
case V.TOUCH_ROTATE:
|
4275
4394
|
if (this.enableRotate === !1)
|
@@ -4295,13 +4414,13 @@ function Fr(s) {
|
|
4295
4414
|
this.state = V.NONE;
|
4296
4415
|
}
|
4297
4416
|
}
|
4298
|
-
function
|
4417
|
+
function Qr(s) {
|
4299
4418
|
this.enabled !== !1 && s.preventDefault();
|
4300
4419
|
}
|
4301
|
-
function
|
4420
|
+
function Jr(s) {
|
4302
4421
|
s.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
4303
4422
|
}
|
4304
|
-
function
|
4423
|
+
function eo(s) {
|
4305
4424
|
s.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
4306
4425
|
}
|
4307
4426
|
/*!
|
@@ -4332,7 +4451,7 @@ const ee = {
|
|
4332
4451
|
TOUCH_ZOOM_TRUCK: 8192,
|
4333
4452
|
TOUCH_ZOOM_OFFSET: 16384,
|
4334
4453
|
TOUCH_ZOOM_ROTATE: 32768
|
4335
|
-
}),
|
4454
|
+
}), ct = {
|
4336
4455
|
NONE: 0,
|
4337
4456
|
IN: 1,
|
4338
4457
|
OUT: -1
|
@@ -4343,26 +4462,26 @@ function Ze(s) {
|
|
4343
4462
|
function Be(s) {
|
4344
4463
|
return s.isOrthographicCamera;
|
4345
4464
|
}
|
4346
|
-
const
|
4465
|
+
const ht = Math.PI * 2, Ms = Math.PI / 2, Sn = 1e-5, Ot = Math.PI / 180;
|
4347
4466
|
function Me(s, e, t) {
|
4348
4467
|
return Math.max(e, Math.min(t, s));
|
4349
4468
|
}
|
4350
|
-
function
|
4469
|
+
function K(s, e = Sn) {
|
4351
4470
|
return Math.abs(s) < e;
|
4352
4471
|
}
|
4353
|
-
function Y(s, e, t =
|
4354
|
-
return
|
4472
|
+
function Y(s, e, t = Sn) {
|
4473
|
+
return K(s - e, t);
|
4355
4474
|
}
|
4356
|
-
function
|
4475
|
+
function Ps(s, e) {
|
4357
4476
|
return Math.round(s / e) * e;
|
4358
4477
|
}
|
4359
|
-
function
|
4478
|
+
function Tt(s) {
|
4360
4479
|
return isFinite(s) ? s : s < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;
|
4361
4480
|
}
|
4362
|
-
function
|
4481
|
+
function Mt(s) {
|
4363
4482
|
return Math.abs(s) < Number.MAX_VALUE ? s : s * (1 / 0);
|
4364
4483
|
}
|
4365
|
-
function
|
4484
|
+
function Gt(s, e, t, i, n = 1 / 0, r) {
|
4366
4485
|
i = Math.max(1e-4, i);
|
4367
4486
|
const a = 2 / i, o = a * r, c = 1 / (1 + o + 0.48 * o * o + 0.235 * o * o * o);
|
4368
4487
|
let l = s - e;
|
@@ -4373,30 +4492,30 @@ function Wt(s, e, t, i, n = 1 / 0, r) {
|
|
4373
4492
|
let f = e + (l + m) * c;
|
4374
4493
|
return d - s > 0 == f > d && (f = d, t.value = (f - d) / r), f;
|
4375
4494
|
}
|
4376
|
-
function
|
4495
|
+
function As(s, e, t, i, n = 1 / 0, r, a) {
|
4377
4496
|
i = Math.max(1e-4, i);
|
4378
4497
|
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 >
|
4498
|
+
let d = e.x, p = e.y, m = e.z, f = s.x - d, C = s.y - p, y = s.z - m;
|
4499
|
+
const T = d, g = p, v = m, S = n * i, E = S * S, w = f * f + C * C + y * y;
|
4500
|
+
if (w > E) {
|
4382
4501
|
const $ = Math.sqrt(w);
|
4383
|
-
f = f / $ * S,
|
4502
|
+
f = f / $ * S, C = C / $ * S, y = y / $ * S;
|
4384
4503
|
}
|
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 *
|
4504
|
+
d = s.x - f, p = s.y - C, m = s.z - y;
|
4505
|
+
const O = (t.x + o * f) * r, L = (t.y + o * C) * r, j = (t.z + o * y) * r;
|
4506
|
+
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;
|
4507
|
+
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;
|
4508
|
+
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
4509
|
}
|
4391
|
-
function
|
4510
|
+
function Si(s, e) {
|
4392
4511
|
e.set(0, 0), s.forEach((t) => {
|
4393
4512
|
e.x += t.clientX, e.y += t.clientY;
|
4394
4513
|
}), e.x /= s.length, e.y /= s.length;
|
4395
4514
|
}
|
4396
|
-
function
|
4515
|
+
function wi(s, e) {
|
4397
4516
|
return Be(s) ? (console.warn(`${e} is not supported in OrthographicCamera`), !0) : !1;
|
4398
4517
|
}
|
4399
|
-
class
|
4518
|
+
class to {
|
4400
4519
|
constructor() {
|
4401
4520
|
this._listeners = {};
|
4402
4521
|
}
|
@@ -4460,10 +4579,10 @@ class Br {
|
|
4460
4579
|
}
|
4461
4580
|
}
|
4462
4581
|
}
|
4463
|
-
var
|
4464
|
-
const
|
4465
|
-
let I,
|
4466
|
-
class ke extends
|
4582
|
+
var xi;
|
4583
|
+
const io = "2.9.0", Xt = 1 / 8, so = /Mac/.test((xi = globalThis?.navigator) === null || xi === void 0 ? void 0 : xi.platform);
|
4584
|
+
let I, Ds, $t, Oi, be, U, z, dt, Pt, Ae, De, We, Rs, Is, xe, At, ut, Ls, Ti, ks, Mi, Pi, Kt;
|
4585
|
+
class ke extends to {
|
4467
4586
|
/**
|
4468
4587
|
* Injects THREE as the dependency. You can then proceed to use CameraControls.
|
4469
4588
|
*
|
@@ -4505,7 +4624,7 @@ class ke extends Br {
|
|
4505
4624
|
* @category Statics
|
4506
4625
|
*/
|
4507
4626
|
static install(e) {
|
4508
|
-
I = e.THREE,
|
4627
|
+
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
4628
|
}
|
4510
4629
|
/**
|
4511
4630
|
* list all ACTIONs
|
@@ -4533,27 +4652,27 @@ class ke extends Br {
|
|
4533
4652
|
*/
|
4534
4653
|
constructor(e, t) {
|
4535
4654
|
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
|
4655
|
+
}, 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) => {
|
4656
|
+
let E, w;
|
4538
4657
|
if (Ze(this._camera)) {
|
4539
|
-
const O = U.copy(this._camera.position).sub(this._target), L = this._camera.getEffectiveFOV() *
|
4540
|
-
|
4658
|
+
const O = U.copy(this._camera.position).sub(this._target), L = this._camera.getEffectiveFOV() * Ot, j = O.length() * Math.tan(L * 0.5);
|
4659
|
+
E = this.truckSpeed * g * j / this._elementRect.height, w = this.truckSpeed * v * j / this._elementRect.height;
|
4541
4660
|
} else if (Be(this._camera)) {
|
4542
4661
|
const O = this._camera;
|
4543
|
-
|
4662
|
+
E = g * (O.right - O.left) / O.zoom / this._elementRect.width, w = v * (O.top - O.bottom) / O.zoom / this._elementRect.height;
|
4544
4663
|
} else
|
4545
4664
|
return;
|
4546
|
-
this.verticalDragToForward ? (S ? this.setFocalOffset(this._focalOffsetEnd.x +
|
4665
|
+
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
4666
|
}, this._rotateInternal = (g, v) => {
|
4548
|
-
const S =
|
4549
|
-
this.rotate(S,
|
4667
|
+
const S = ht * this.azimuthRotateSpeed * g / this._elementRect.height, E = ht * this.polarRotateSpeed * v / this._elementRect.height;
|
4668
|
+
this.rotate(S, E, !0);
|
4550
4669
|
}, this._dollyInternal = (g, v, S) => {
|
4551
|
-
const
|
4670
|
+
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
4671
|
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
4672
|
}, this._zoomInternal = (g, v, S) => {
|
4554
|
-
const
|
4673
|
+
const E = Math.pow(0.95, g * this.dollySpeed), w = this._zoom, O = this._zoom * E;
|
4555
4674
|
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,
|
4675
|
+
}, 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
4676
|
new I.Vector3(),
|
4558
4677
|
new I.Vector3(),
|
4559
4678
|
new I.Vector3(),
|
@@ -4572,14 +4691,14 @@ class ke extends Br {
|
|
4572
4691
|
if (!this._enabled || !this._domElement)
|
4573
4692
|
return;
|
4574
4693
|
if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
|
4575
|
-
const
|
4694
|
+
const E = this._domElement.getBoundingClientRect(), w = g.clientX / E.width, O = g.clientY / E.height;
|
4576
4695
|
if (w < this._interactiveArea.left || w > this._interactiveArea.right || O < this._interactiveArea.top || O > this._interactiveArea.bottom)
|
4577
4696
|
return;
|
4578
4697
|
}
|
4579
4698
|
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
4699
|
if (v !== null) {
|
4581
|
-
const
|
4582
|
-
|
4700
|
+
const E = this._findPointerByMouseButton(v);
|
4701
|
+
E && this._disposePointer(E);
|
4583
4702
|
}
|
4584
4703
|
if ((g.buttons & ee.LEFT) === ee.LEFT && this._lockedPointer)
|
4585
4704
|
return;
|
@@ -4632,7 +4751,7 @@ class ke extends Br {
|
|
4632
4751
|
}
|
4633
4752
|
else
|
4634
4753
|
this._state = _.NONE;
|
4635
|
-
|
4754
|
+
C();
|
4636
4755
|
}
|
4637
4756
|
};
|
4638
4757
|
let l = -1;
|
@@ -4648,7 +4767,7 @@ class ke extends Br {
|
|
4648
4767
|
const O = performance.now();
|
4649
4768
|
l - O < 1e3 && this._getClientRect(this._elementRect), l = O;
|
4650
4769
|
}
|
4651
|
-
const v =
|
4770
|
+
const v = so ? -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
4771
|
switch (this.mouseButtons.wheel) {
|
4653
4772
|
case _.ROTATE: {
|
4654
4773
|
this._rotateInternal(g.deltaX, g.deltaY), this._isUserControllingRotate = !0;
|
@@ -4663,11 +4782,11 @@ class ke extends Br {
|
|
4663
4782
|
break;
|
4664
4783
|
}
|
4665
4784
|
case _.DOLLY: {
|
4666
|
-
this._dollyInternal(-S,
|
4785
|
+
this._dollyInternal(-S, E, w), this._isUserControllingDolly = !0;
|
4667
4786
|
break;
|
4668
4787
|
}
|
4669
4788
|
case _.ZOOM: {
|
4670
|
-
this._zoomInternal(-S,
|
4789
|
+
this._zoomInternal(-S, E, w), this._isUserControllingZoom = !0;
|
4671
4790
|
break;
|
4672
4791
|
}
|
4673
4792
|
}
|
@@ -4684,8 +4803,8 @@ class ke extends Br {
|
|
4684
4803
|
}, m = (g) => {
|
4685
4804
|
if (!this._enabled)
|
4686
4805
|
return;
|
4687
|
-
if (
|
4688
|
-
const S = be.x - this._activePointers[1].clientX,
|
4806
|
+
if (Si(this._activePointers, be), this._getClientRect(this._elementRect), i.copy(be), n.copy(be), this._activePointers.length >= 2) {
|
4807
|
+
const S = be.x - this._activePointers[1].clientX, E = be.y - this._activePointers[1].clientY, w = Math.sqrt(S * S + E * E);
|
4689
4808
|
r.set(0, w);
|
4690
4809
|
const O = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, L = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
|
4691
4810
|
n.set(O, L);
|
@@ -4710,21 +4829,21 @@ class ke extends Br {
|
|
4710
4829
|
}, f = () => {
|
4711
4830
|
if (!this._enabled || !this._dragNeedsUpdate)
|
4712
4831
|
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,
|
4832
|
+
this._dragNeedsUpdate = !1, Si(this._activePointers, be);
|
4833
|
+
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;
|
4834
|
+
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
4835
|
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 *
|
4836
|
+
(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
4837
|
}
|
4719
4838
|
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
4839
|
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
4840
|
r.set(0, L);
|
4722
4841
|
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 *
|
4842
|
+
(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
4843
|
}
|
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
|
-
|
4844
|
+
((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" });
|
4845
|
+
}, C = () => {
|
4846
|
+
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
4847
|
};
|
4729
4848
|
this.lockPointer = () => {
|
4730
4849
|
!this._enabled || !this._domElement || (this.cancel(), this._lockedPointer = {
|
@@ -4749,7 +4868,7 @@ class ke extends Br {
|
|
4749
4868
|
}, this._removeAllEventListeners = () => {
|
4750
4869
|
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
4870
|
}, this.cancel = () => {
|
4752
|
-
this._state !== _.NONE && (this._state = _.NONE, this._activePointers.length = 0,
|
4871
|
+
this._state !== _.NONE && (this._state = _.NONE, this._activePointers.length = 0, C());
|
4753
4872
|
}, t && this.connect(t), this.update(0);
|
4754
4873
|
}
|
4755
4874
|
/**
|
@@ -4982,7 +5101,7 @@ class ke extends Br {
|
|
4982
5101
|
* @category Methods
|
4983
5102
|
*/
|
4984
5103
|
dollyTo(e, t = !1) {
|
4985
|
-
return this._isUserControllingDolly = !1, this._lastDollyDirection =
|
5104
|
+
return this._isUserControllingDolly = !1, this._lastDollyDirection = ct.NONE, this._changedDolly = 0, this._dollyToNoClamp(Me(e, this.minDistance, this.maxDistance), t);
|
4986
5105
|
}
|
4987
5106
|
_dollyToNoClamp(e, t = !1) {
|
4988
5107
|
const i = this._sphericalEnd.radius;
|
@@ -5005,7 +5124,7 @@ class ke extends Br {
|
|
5005
5124
|
* @category Methods
|
5006
5125
|
*/
|
5007
5126
|
dollyInFixed(e, t = !1) {
|
5008
|
-
this._targetEnd.add(this._getCameraDirection(
|
5127
|
+
this._targetEnd.add(this._getCameraDirection(Pt).multiplyScalar(e)), t || this._target.copy(this._targetEnd);
|
5009
5128
|
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
5129
|
return this._createOnRestPromise(i);
|
5011
5130
|
}
|
@@ -5046,8 +5165,8 @@ class ke extends Br {
|
|
5046
5165
|
* @category Methods
|
5047
5166
|
*/
|
5048
5167
|
truck(e, t, i = !1) {
|
5049
|
-
this._camera.updateMatrix(),
|
5050
|
-
const n = U.copy(
|
5168
|
+
this._camera.updateMatrix(), Ae.setFromMatrixColumn(this._camera.matrix, 0), De.setFromMatrixColumn(this._camera.matrix, 1), Ae.multiplyScalar(e), De.multiplyScalar(-t);
|
5169
|
+
const n = U.copy(Ae).add(De), r = z.copy(this._targetEnd).add(n);
|
5051
5170
|
return this.moveTo(r.x, r.y, r.z, i);
|
5052
5171
|
}
|
5053
5172
|
/**
|
@@ -5112,20 +5231,20 @@ class ke extends Br {
|
|
5112
5231
|
* @category Methods
|
5113
5232
|
*/
|
5114
5233
|
fitToBox(e, t, { cover: i = !1, paddingLeft: n = 0, paddingRight: r = 0, paddingBottom: a = 0, paddingTop: o = 0 } = {}) {
|
5115
|
-
const c = [], l = e.isBox3 ?
|
5234
|
+
const c = [], l = e.isBox3 ? ut.copy(e) : ut.setFromObject(e);
|
5116
5235
|
l.isEmpty() && (console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"), Promise.resolve());
|
5117
|
-
const d =
|
5236
|
+
const d = Ps(this._sphericalEnd.theta, Ms), p = Ps(this._sphericalEnd.phi, Ms);
|
5118
5237
|
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(
|
5238
|
+
const m = U.setFromSpherical(this._sphericalEnd).normalize(), f = ks.setFromUnitVectors(m, Oi), C = Y(Math.abs(m.y), 1);
|
5239
|
+
C && f.multiply(Mi.setFromAxisAngle($t, d)), f.multiply(this._yAxisUpSpaceInverse);
|
5240
|
+
const y = Ls.makeEmpty();
|
5241
|
+
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
5242
|
const T = y.getSize(U), g = y.getCenter(z).applyQuaternion(f);
|
5124
5243
|
if (Ze(this._camera)) {
|
5125
5244
|
const v = this.getDistanceToFitBox(T.x, T.y, T.z, i);
|
5126
5245
|
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
5246
|
} else if (Be(this._camera)) {
|
5128
|
-
const v = this._camera, S = v.right - v.left,
|
5247
|
+
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
5248
|
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
5249
|
}
|
5131
5250
|
return Promise.all(c);
|
@@ -5137,7 +5256,7 @@ class ke extends Br {
|
|
5137
5256
|
* @category Methods
|
5138
5257
|
*/
|
5139
5258
|
fitToSphere(e, t) {
|
5140
|
-
const i = [], r = "isObject3D" in e ? ke.createBoundingSphere(e,
|
5259
|
+
const i = [], r = "isObject3D" in e ? ke.createBoundingSphere(e, Ti) : Ti.copy(e);
|
5141
5260
|
if (i.push(this.moveTo(r.center.x, r.center.y, r.center.z, t)), Ze(this._camera)) {
|
5142
5261
|
const a = this.getDistanceToFitSphere(r.radius);
|
5143
5262
|
i.push(this.dollyTo(a, t));
|
@@ -5159,7 +5278,7 @@ class ke extends Br {
|
|
5159
5278
|
* @category Methods
|
5160
5279
|
*/
|
5161
5280
|
setLookAt(e, t, i, n, r, a, o = !1) {
|
5162
|
-
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection =
|
5281
|
+
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = ct.NONE, this._changedDolly = 0;
|
5163
5282
|
const c = z.set(n, r, a), l = U.set(e, t, i);
|
5164
5283
|
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
5284
|
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 +5302,15 @@ class ke extends Br {
|
|
5183
5302
|
* @param enableTransition
|
5184
5303
|
* @category Methods
|
5185
5304
|
*/
|
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 =
|
5305
|
+
lerpLookAt(e, t, i, n, r, a, o, c, l, d, p, m, f, C = !1) {
|
5306
|
+
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = ct.NONE, this._changedDolly = 0;
|
5188
5307
|
const y = U.set(n, r, a), T = z.set(e, t, i);
|
5189
5308
|
xe.setFromVector3(T.sub(y).applyQuaternion(this._yAxisUpSpace));
|
5190
|
-
const g =
|
5309
|
+
const g = dt.set(d, p, m), v = z.set(o, c, l);
|
5191
5310
|
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 = !
|
5311
|
+
const S = At.theta - xe.theta, E = At.phi - xe.phi, w = At.radius - xe.radius;
|
5312
|
+
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));
|
5313
|
+
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
5314
|
return this._createOnRestPromise(O);
|
5196
5315
|
}
|
5197
5316
|
/**
|
@@ -5241,9 +5360,9 @@ class ke extends Br {
|
|
5241
5360
|
* @category Methods
|
5242
5361
|
*/
|
5243
5362
|
setOrbitPoint(e, t, i) {
|
5244
|
-
this._camera.updateMatrixWorld(),
|
5363
|
+
this._camera.updateMatrixWorld(), Ae.setFromMatrixColumn(this._camera.matrixWorldInverse, 0), De.setFromMatrixColumn(this._camera.matrixWorldInverse, 1), We.setFromMatrixColumn(this._camera.matrixWorldInverse, 2);
|
5245
5364
|
const n = U.set(e, t, i), r = n.distanceTo(this._camera.position), a = n.sub(this._camera.position);
|
5246
|
-
|
5365
|
+
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
5366
|
}
|
5248
5367
|
/**
|
5249
5368
|
* Set the boundary box that encloses the target of the camera. box3 is in THREE.Box3
|
@@ -5282,9 +5401,9 @@ class ke extends Br {
|
|
5282
5401
|
* @category Methods
|
5283
5402
|
*/
|
5284
5403
|
getDistanceToFitBox(e, t, i, n = !1) {
|
5285
|
-
if (
|
5404
|
+
if (wi(this._camera, "getDistanceToFitBox"))
|
5286
5405
|
return this._spherical.radius;
|
5287
|
-
const r = e / t, a = this._camera.getEffectiveFOV() *
|
5406
|
+
const r = e / t, a = this._camera.getEffectiveFOV() * Ot, o = this._camera.aspect;
|
5288
5407
|
return ((n ? r > o : r < o) ? t : e / o) * 0.5 / Math.tan(a * 0.5) + i * 0.5;
|
5289
5408
|
}
|
5290
5409
|
/**
|
@@ -5294,9 +5413,9 @@ class ke extends Br {
|
|
5294
5413
|
* @category Methods
|
5295
5414
|
*/
|
5296
5415
|
getDistanceToFitSphere(e) {
|
5297
|
-
if (
|
5416
|
+
if (wi(this._camera, "getDistanceToFitSphere"))
|
5298
5417
|
return this._spherical.radius;
|
5299
|
-
const t = this._camera.getEffectiveFOV() *
|
5418
|
+
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
5419
|
return e / Math.sin(n * 0.5);
|
5301
5420
|
}
|
5302
5421
|
/**
|
@@ -5340,7 +5459,7 @@ class ke extends Br {
|
|
5340
5459
|
* @category Methods
|
5341
5460
|
*/
|
5342
5461
|
normalizeRotations() {
|
5343
|
-
this._sphericalEnd.theta = this._sphericalEnd.theta %
|
5462
|
+
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
5463
|
}
|
5345
5464
|
/**
|
5346
5465
|
* stop all transitions.
|
@@ -5379,7 +5498,7 @@ class ke extends Br {
|
|
5379
5498
|
* @category Methods
|
5380
5499
|
*/
|
5381
5500
|
updateCameraUp() {
|
5382
|
-
this._yAxisUpSpace.setFromUnitVectors(this._camera.up,
|
5501
|
+
this._yAxisUpSpace.setFromUnitVectors(this._camera.up, $t), this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert();
|
5383
5502
|
}
|
5384
5503
|
/**
|
5385
5504
|
* Apply current camera-up direction to the camera.
|
@@ -5400,68 +5519,68 @@ class ke extends Br {
|
|
5400
5519
|
* @category Methods
|
5401
5520
|
*/
|
5402
5521
|
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 (
|
5522
|
+
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;
|
5523
|
+
if (K(t))
|
5405
5524
|
this._thetaVelocity.value = 0, this._spherical.theta = this._sphericalEnd.theta;
|
5406
5525
|
else {
|
5407
5526
|
const p = this._isUserControllingRotate ? this.draggingSmoothTime : this.smoothTime;
|
5408
|
-
this._spherical.theta =
|
5527
|
+
this._spherical.theta = Gt(this._spherical.theta, this._sphericalEnd.theta, this._thetaVelocity, p, 1 / 0, e), this._needsUpdate = !0;
|
5409
5528
|
}
|
5410
|
-
if (
|
5529
|
+
if (K(i))
|
5411
5530
|
this._phiVelocity.value = 0, this._spherical.phi = this._sphericalEnd.phi;
|
5412
5531
|
else {
|
5413
5532
|
const p = this._isUserControllingRotate ? this.draggingSmoothTime : this.smoothTime;
|
5414
|
-
this._spherical.phi =
|
5533
|
+
this._spherical.phi = Gt(this._spherical.phi, this._sphericalEnd.phi, this._phiVelocity, p, 1 / 0, e), this._needsUpdate = !0;
|
5415
5534
|
}
|
5416
|
-
if (
|
5535
|
+
if (K(n))
|
5417
5536
|
this._radiusVelocity.value = 0, this._spherical.radius = this._sphericalEnd.radius;
|
5418
5537
|
else {
|
5419
5538
|
const p = this._isUserControllingDolly ? this.draggingSmoothTime : this.smoothTime;
|
5420
|
-
this._spherical.radius =
|
5539
|
+
this._spherical.radius = Gt(this._spherical.radius, this._sphericalEnd.radius, this._radiusVelocity, p, this.maxSpeed, e), this._needsUpdate = !0;
|
5421
5540
|
}
|
5422
|
-
if (
|
5541
|
+
if (K(r.x) && K(r.y) && K(r.z))
|
5423
5542
|
this._targetVelocity.set(0, 0, 0), this._target.copy(this._targetEnd);
|
5424
5543
|
else {
|
5425
5544
|
const p = this._isUserControllingTruck ? this.draggingSmoothTime : this.smoothTime;
|
5426
|
-
|
5545
|
+
As(this._target, this._targetEnd, this._targetVelocity, p, this.maxSpeed, e, this._target), this._needsUpdate = !0;
|
5427
5546
|
}
|
5428
|
-
if (
|
5547
|
+
if (K(a.x) && K(a.y) && K(a.z))
|
5429
5548
|
this._focalOffsetVelocity.set(0, 0, 0), this._focalOffset.copy(this._focalOffsetEnd);
|
5430
5549
|
else {
|
5431
5550
|
const p = this._isUserControllingOffset ? this.draggingSmoothTime : this.smoothTime;
|
5432
|
-
|
5551
|
+
As(this._focalOffset, this._focalOffsetEnd, this._focalOffsetVelocity, p, this.maxSpeed, e, this._focalOffset), this._needsUpdate = !0;
|
5433
5552
|
}
|
5434
|
-
if (
|
5553
|
+
if (K(o))
|
5435
5554
|
this._zoomVelocity.value = 0, this._zoom = this._zoomEnd;
|
5436
5555
|
else {
|
5437
5556
|
const p = this._isUserControllingZoom ? this.draggingSmoothTime : this.smoothTime;
|
5438
|
-
this._zoom =
|
5557
|
+
this._zoom = Gt(this._zoom, this._zoomEnd, this._zoomVelocity, p, 1 / 0, e);
|
5439
5558
|
}
|
5440
5559
|
if (this.dollyToCursor) {
|
5441
5560
|
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(
|
5561
|
+
const p = this._spherical.radius - this._lastDistance, m = this._camera, f = this._getCameraDirection(Pt), C = U.copy(f).cross(m.up).normalize();
|
5562
|
+
C.lengthSq() === 0 && (C.x = 1);
|
5563
|
+
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
5564
|
if (this.infinityDolly && (w || O)) {
|
5446
5565
|
this._sphericalEnd.radius -= p, this._spherical.radius -= p;
|
5447
5566
|
const j = z.copy(f).multiplyScalar(-p);
|
5448
|
-
|
5567
|
+
E.add(j);
|
5449
5568
|
}
|
5450
|
-
this._boundary.clampPoint(
|
5451
|
-
const L = z.subVectors(
|
5452
|
-
this._targetEnd.copy(
|
5569
|
+
this._boundary.clampPoint(E, E);
|
5570
|
+
const L = z.subVectors(E, this._targetEnd);
|
5571
|
+
this._targetEnd.copy(E), this._target.add(L), this._changedDolly -= p, K(this._changedDolly) && (this._changedDolly = 0);
|
5453
5572
|
} 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(
|
5573
|
+
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);
|
5574
|
+
E.sub(O), this._boundary.clampPoint(E, E);
|
5575
|
+
const L = z.subVectors(E, this._targetEnd);
|
5576
|
+
this._targetEnd.copy(E), this._target.add(L), this._changedZoom -= p, K(this._changedZoom) && (this._changedZoom = 0);
|
5458
5577
|
}
|
5459
5578
|
}
|
5460
5579
|
this._camera.zoom !== this._zoom && (this._camera.zoom = this._zoom, this._camera.updateProjectionMatrix(), this._updateNearPlaneCorners(), this._needsUpdate = !0), this._dragNeedsUpdate = !0;
|
5461
5580
|
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), (!
|
5581
|
+
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
5582
|
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" }),
|
5583
|
+
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
5584
|
}
|
5466
5585
|
/**
|
5467
5586
|
* Get all state in JSON string
|
@@ -5471,13 +5590,13 @@ class ke extends Br {
|
|
5471
5590
|
return JSON.stringify({
|
5472
5591
|
enabled: this._enabled,
|
5473
5592
|
minDistance: this.minDistance,
|
5474
|
-
maxDistance:
|
5593
|
+
maxDistance: Tt(this.maxDistance),
|
5475
5594
|
minZoom: this.minZoom,
|
5476
|
-
maxZoom:
|
5595
|
+
maxZoom: Tt(this.maxZoom),
|
5477
5596
|
minPolarAngle: this.minPolarAngle,
|
5478
|
-
maxPolarAngle:
|
5479
|
-
minAzimuthAngle:
|
5480
|
-
maxAzimuthAngle:
|
5597
|
+
maxPolarAngle: Tt(this.maxPolarAngle),
|
5598
|
+
minAzimuthAngle: Tt(this.minAzimuthAngle),
|
5599
|
+
maxAzimuthAngle: Tt(this.maxAzimuthAngle),
|
5481
5600
|
smoothTime: this.smoothTime,
|
5482
5601
|
draggingSmoothTime: this.draggingSmoothTime,
|
5483
5602
|
dollySpeed: this.dollySpeed,
|
@@ -5502,7 +5621,7 @@ class ke extends Br {
|
|
5502
5621
|
*/
|
5503
5622
|
fromJSON(e, t = !1) {
|
5504
5623
|
const i = JSON.parse(e);
|
5505
|
-
this.enabled = i.enabled, this.minDistance = i.minDistance, this.maxDistance =
|
5624
|
+
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
5625
|
}
|
5507
5626
|
/**
|
5508
5627
|
* Attach all internal event handlers to enable drag control.
|
@@ -5513,7 +5632,7 @@ class ke extends Br {
|
|
5513
5632
|
console.warn("camera-controls is already connected.");
|
5514
5633
|
return;
|
5515
5634
|
}
|
5516
|
-
e.setAttribute("data-camera-controls-version",
|
5635
|
+
e.setAttribute("data-camera-controls-version", io), this._addAllEventListeners(e), this._getClientRect(this._elementRect);
|
5517
5636
|
}
|
5518
5637
|
/**
|
5519
5638
|
* Detach all internal event handlers to disable drag control.
|
@@ -5549,7 +5668,7 @@ class ke extends Br {
|
|
5549
5668
|
const n = t.lengthSq();
|
5550
5669
|
if (n === 0)
|
5551
5670
|
return e;
|
5552
|
-
const r = z.copy(t).add(e), o = this._boundary.clampPoint(r,
|
5671
|
+
const r = z.copy(t).add(e), o = this._boundary.clampPoint(r, dt).sub(r), c = o.lengthSq();
|
5553
5672
|
if (c === 0)
|
5554
5673
|
return e.add(t);
|
5555
5674
|
if (c === n)
|
@@ -5563,7 +5682,7 @@ class ke extends Br {
|
|
5563
5682
|
}
|
5564
5683
|
_updateNearPlaneCorners() {
|
5565
5684
|
if (Ze(this._camera)) {
|
5566
|
-
const e = this._camera, t = e.near, i = e.getEffectiveFOV() *
|
5685
|
+
const e = this._camera, t = e.near, i = e.getEffectiveFOV() * Ot, n = Math.tan(i * 0.5) * t, r = n * e.aspect;
|
5567
5686
|
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
5687
|
} else if (Be(this._camera)) {
|
5569
5688
|
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 +5692,16 @@ class ke extends Br {
|
|
5573
5692
|
// lateUpdate
|
5574
5693
|
_collisionTest() {
|
5575
5694
|
let e = 1 / 0;
|
5576
|
-
if (!(this.colliderMeshes.length >= 1) ||
|
5695
|
+
if (!(this.colliderMeshes.length >= 1) || wi(this._camera, "_collisionTest"))
|
5577
5696
|
return e;
|
5578
|
-
const i = this._getTargetDirection(
|
5579
|
-
|
5697
|
+
const i = this._getTargetDirection(Pt);
|
5698
|
+
Pi.lookAt(Ds, i, this._camera.up);
|
5580
5699
|
for (let n = 0; n < 4; n++) {
|
5581
5700
|
const r = z.copy(this._nearPlaneCorners[n]);
|
5582
|
-
r.applyMatrix4(
|
5583
|
-
const a =
|
5584
|
-
|
5585
|
-
const o =
|
5701
|
+
r.applyMatrix4(Pi);
|
5702
|
+
const a = dt.addVectors(this._target, r);
|
5703
|
+
Kt.set(a, i), Kt.far = this._spherical.radius + 1;
|
5704
|
+
const o = Kt.intersectObjects(this.colliderMeshes);
|
5586
5705
|
o.length !== 0 && o[0].distance < e && (e = o[0].distance);
|
5587
5706
|
}
|
5588
5707
|
return e;
|
@@ -5643,9 +5762,9 @@ class ke extends Br {
|
|
5643
5762
|
}
|
5644
5763
|
static createBoundingSphere(e, t = new I.Sphere()) {
|
5645
5764
|
const i = t, n = i.center;
|
5646
|
-
|
5647
|
-
a.isMesh &&
|
5648
|
-
}),
|
5765
|
+
ut.makeEmpty(), e.traverseVisible((a) => {
|
5766
|
+
a.isMesh && ut.expandByObject(a);
|
5767
|
+
}), ut.getCenter(n);
|
5649
5768
|
let r = 0;
|
5650
5769
|
return e.traverseVisible((a) => {
|
5651
5770
|
if (!a.isMesh)
|
@@ -5658,7 +5777,7 @@ class ke extends Br {
|
|
5658
5777
|
}), i.radius = Math.sqrt(r), i;
|
5659
5778
|
}
|
5660
5779
|
}
|
5661
|
-
const
|
5780
|
+
const li = (s) => {
|
5662
5781
|
const [e, t] = Z(s.options[s.index]), i = () => {
|
5663
5782
|
s.onToggle(!s.open);
|
5664
5783
|
}, n = (r) => {
|
@@ -5668,7 +5787,7 @@ const oi = (s) => {
|
|
5668
5787
|
/* @__PURE__ */ u.jsx("div", { className: "dropdown-toggle", onClick: i, children: `${s.title}: ${e}` }),
|
5669
5788
|
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
5789
|
] });
|
5671
|
-
}, Ge =
|
5790
|
+
}, Ge = Na(function(e, t) {
|
5672
5791
|
const i = [
|
5673
5792
|
"Renderer",
|
5674
5793
|
"Depth",
|
@@ -5682,7 +5801,7 @@ const oi = (s) => {
|
|
5682
5801
|
} }),
|
5683
5802
|
/* @__PURE__ */ u.jsxs("div", { className: "options", children: [
|
5684
5803
|
e.camera !== null && /* @__PURE__ */ u.jsx(
|
5685
|
-
|
5804
|
+
li,
|
5686
5805
|
{
|
5687
5806
|
title: "Camera",
|
5688
5807
|
index: e.options.indexOf(e.camera.name),
|
@@ -5696,7 +5815,7 @@ const oi = (s) => {
|
|
5696
5815
|
}
|
5697
5816
|
),
|
5698
5817
|
/* @__PURE__ */ u.jsx(
|
5699
|
-
|
5818
|
+
li,
|
5700
5819
|
{
|
5701
5820
|
title: "Mode",
|
5702
5821
|
index: i.indexOf(n),
|
@@ -5717,15 +5836,15 @@ const oi = (s) => {
|
|
5717
5836
|
] })
|
5718
5837
|
] });
|
5719
5838
|
});
|
5720
|
-
class
|
5839
|
+
class no extends dn {
|
5721
5840
|
constructor(e) {
|
5722
5841
|
super({
|
5723
5842
|
extensions: {
|
5724
5843
|
// @ts-ignore
|
5725
5844
|
derivatives: !0
|
5726
5845
|
},
|
5727
|
-
glslVersion:
|
5728
|
-
side:
|
5846
|
+
glslVersion: ma,
|
5847
|
+
side: Bi,
|
5729
5848
|
transparent: !0,
|
5730
5849
|
uniforms: {
|
5731
5850
|
uScale: {
|
@@ -5830,17 +5949,17 @@ class Wr extends ln {
|
|
5830
5949
|
});
|
5831
5950
|
}
|
5832
5951
|
}
|
5833
|
-
class
|
5952
|
+
class ao extends M {
|
5834
5953
|
gridMaterial;
|
5835
5954
|
constructor() {
|
5836
|
-
const e = new
|
5837
|
-
super(new
|
5955
|
+
const e = new no();
|
5956
|
+
super(new un(2, 2), e), this.gridMaterial = e, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
|
5838
5957
|
}
|
5839
5958
|
update() {
|
5840
5959
|
this.gridMaterial.needsUpdate = !0;
|
5841
5960
|
}
|
5842
5961
|
}
|
5843
|
-
function
|
5962
|
+
function Us(s) {
|
5844
5963
|
const [e, t] = Z(s.selected), i = "toggle" + (e ? " selected" : "");
|
5845
5964
|
return /* @__PURE__ */ u.jsx(
|
5846
5965
|
"button",
|
@@ -5859,7 +5978,7 @@ function Is(s) {
|
|
5859
5978
|
s.name
|
5860
5979
|
);
|
5861
5980
|
}
|
5862
|
-
const
|
5981
|
+
const ro = `#include <common>
|
5863
5982
|
#include <batching_pars_vertex>
|
5864
5983
|
#include <uv_pars_vertex>
|
5865
5984
|
#include <color_pars_vertex>
|
@@ -5889,7 +6008,7 @@ void main() {
|
|
5889
6008
|
#include <logdepthbuf_vertex>
|
5890
6009
|
#include <clipping_planes_vertex>
|
5891
6010
|
#include <worldpos_vertex>
|
5892
|
-
}`,
|
6011
|
+
}`, oo = `
|
5893
6012
|
#include <common>
|
5894
6013
|
#include <uv_pars_fragment>
|
5895
6014
|
#include <clipping_planes_pars_fragment>
|
@@ -5898,46 +6017,46 @@ void main() {
|
|
5898
6017
|
#include <clipping_planes_fragment>
|
5899
6018
|
gl_FragColor = vec4(vec3(vUv, 0.0), 1.0);
|
5900
6019
|
}`;
|
5901
|
-
class
|
6020
|
+
class lo extends dn {
|
5902
6021
|
constructor() {
|
5903
6022
|
super({
|
5904
6023
|
defines: {
|
5905
6024
|
USE_UV: ""
|
5906
6025
|
},
|
5907
|
-
vertexShader:
|
5908
|
-
fragmentShader:
|
6026
|
+
vertexShader: ro,
|
6027
|
+
fragmentShader: oo
|
5909
6028
|
});
|
5910
6029
|
}
|
5911
6030
|
}
|
5912
|
-
const Xe = new
|
5913
|
-
X: new
|
5914
|
-
Y: new
|
5915
|
-
Z: new
|
5916
|
-
},
|
5917
|
-
class
|
6031
|
+
const Xe = new ni(), ue = new P(), Ye = new P(), Q = new Ce(), js = {
|
6032
|
+
X: new P(1, 0, 0),
|
6033
|
+
Y: new P(0, 1, 0),
|
6034
|
+
Z: new P(0, 0, 1)
|
6035
|
+
}, Ai = { type: "change" }, Ns = { type: "mouseDown", mode: null }, Fs = { type: "mouseUp", mode: null }, zs = { type: "objectChange" };
|
6036
|
+
class co extends hn {
|
5918
6037
|
constructor(e, t = null) {
|
5919
6038
|
super(void 0, t);
|
5920
|
-
const i = new
|
6039
|
+
const i = new go(this);
|
5921
6040
|
this._root = i;
|
5922
|
-
const n = new
|
6041
|
+
const n = new _o();
|
5923
6042
|
this._gizmo = n, i.add(n);
|
5924
|
-
const r = new
|
6043
|
+
const r = new vo();
|
5925
6044
|
this._plane = r, i.add(r);
|
5926
6045
|
const a = this;
|
5927
|
-
function o(S,
|
5928
|
-
let w =
|
6046
|
+
function o(S, E) {
|
6047
|
+
let w = E;
|
5929
6048
|
Object.defineProperty(a, S, {
|
5930
6049
|
get: function() {
|
5931
|
-
return w !== void 0 ? w :
|
6050
|
+
return w !== void 0 ? w : E;
|
5932
6051
|
},
|
5933
6052
|
set: function(O) {
|
5934
|
-
w !== O && (w = O, r[S] = O, n[S] = O, a.dispatchEvent({ type: S + "-changed", value: O }), a.dispatchEvent(
|
6053
|
+
w !== O && (w = O, r[S] = O, n[S] = O, a.dispatchEvent({ type: S + "-changed", value: O }), a.dispatchEvent(Ai));
|
5935
6054
|
}
|
5936
|
-
}), a[S] =
|
6055
|
+
}), a[S] = E, r[S] = E, n[S] = E;
|
5937
6056
|
}
|
5938
6057
|
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",
|
6058
|
+
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();
|
6059
|
+
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 = ho.bind(this), this._onPointerDown = po.bind(this), this._onPointerHover = uo.bind(this), this._onPointerMove = mo.bind(this), this._onPointerUp = fo.bind(this), t !== null && this.connect();
|
5941
6060
|
}
|
5942
6061
|
connect() {
|
5943
6062
|
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 +6071,14 @@ class Kr extends on {
|
|
5952
6071
|
if (this.object === void 0 || this.dragging === !0)
|
5953
6072
|
return;
|
5954
6073
|
e !== null && Xe.setFromCamera(e, this.camera);
|
5955
|
-
const t =
|
6074
|
+
const t = Di(this._gizmo.picker[this.mode], Xe);
|
5956
6075
|
t ? this.axis = t.object.name : this.axis = null;
|
5957
6076
|
}
|
5958
6077
|
pointerDown(e) {
|
5959
6078
|
if (!(this.object === void 0 || this.dragging === !0 || e != null && e.button !== 0) && this.axis !== null) {
|
5960
6079
|
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,
|
6080
|
+
const t = Di(this._plane, Xe, !0);
|
6081
|
+
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
6082
|
}
|
5964
6083
|
}
|
5965
6084
|
pointerMove(e) {
|
@@ -5968,7 +6087,7 @@ class Kr extends on {
|
|
5968
6087
|
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
6088
|
return;
|
5970
6089
|
e !== null && Xe.setFromCamera(e, this.camera);
|
5971
|
-
const a =
|
6090
|
+
const a = Di(this._plane, Xe, !0);
|
5972
6091
|
if (a) {
|
5973
6092
|
if (this.pointEnd.copy(a.point).sub(this.worldPositionStart), i === "translate")
|
5974
6093
|
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 +6102,13 @@ class Kr extends on {
|
|
5983
6102
|
this._offset.copy(this.pointEnd).sub(this.pointStart);
|
5984
6103
|
const o = 20 / this.worldPosition.distanceTo(ue.setFromMatrixPosition(this.camera.matrixWorld));
|
5985
6104
|
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(
|
6105
|
+
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
6106
|
}
|
5988
|
-
this.dispatchEvent(
|
6107
|
+
this.dispatchEvent(Ai), this.dispatchEvent(zs);
|
5989
6108
|
}
|
5990
6109
|
}
|
5991
6110
|
pointerUp(e) {
|
5992
|
-
e !== null && e.button !== 0 || (this.dragging && this.axis !== null && (
|
6111
|
+
e !== null && e.button !== 0 || (this.dragging && this.axis !== null && (Fs.mode = this.mode, this.dispatchEvent(Fs)), this.dragging = !1, this.axis = null);
|
5993
6112
|
}
|
5994
6113
|
dispose() {
|
5995
6114
|
this.disconnect(), this.traverse(function(e) {
|
@@ -6005,7 +6124,7 @@ class Kr extends on {
|
|
6005
6124
|
return this.object = void 0, this.axis = null, this._root.visible = !1, this;
|
6006
6125
|
}
|
6007
6126
|
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(
|
6127
|
+
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
6128
|
}
|
6010
6129
|
getRaycaster() {
|
6011
6130
|
return Xe;
|
@@ -6033,7 +6152,7 @@ class Kr extends on {
|
|
6033
6152
|
this.space = e;
|
6034
6153
|
}
|
6035
6154
|
}
|
6036
|
-
function
|
6155
|
+
function ho(s) {
|
6037
6156
|
if (this.domElement.ownerDocument.pointerLockElement)
|
6038
6157
|
return {
|
6039
6158
|
x: 0,
|
@@ -6049,7 +6168,7 @@ function Qr(s) {
|
|
6049
6168
|
};
|
6050
6169
|
}
|
6051
6170
|
}
|
6052
|
-
function
|
6171
|
+
function uo(s) {
|
6053
6172
|
if (this.enabled)
|
6054
6173
|
switch (s.pointerType) {
|
6055
6174
|
case "mouse":
|
@@ -6058,24 +6177,24 @@ function Jr(s) {
|
|
6058
6177
|
break;
|
6059
6178
|
}
|
6060
6179
|
}
|
6061
|
-
function
|
6180
|
+
function po(s) {
|
6062
6181
|
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
6182
|
}
|
6064
|
-
function
|
6183
|
+
function mo(s) {
|
6065
6184
|
this.enabled && this.pointerMove(this._getPointer(s));
|
6066
6185
|
}
|
6067
|
-
function
|
6186
|
+
function fo(s) {
|
6068
6187
|
this.enabled && (this.domElement.releasePointerCapture(s.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.pointerUp(this._getPointer(s)));
|
6069
6188
|
}
|
6070
|
-
function
|
6189
|
+
function Di(s, e, t) {
|
6071
6190
|
const i = e.intersectObject(s, !0);
|
6072
6191
|
for (let n = 0; n < i.length; n++)
|
6073
6192
|
if (i[n].object.visible || t)
|
6074
6193
|
return i[n];
|
6075
6194
|
return !1;
|
6076
6195
|
}
|
6077
|
-
const qt = new
|
6078
|
-
class
|
6196
|
+
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();
|
6197
|
+
class go extends vt {
|
6079
6198
|
constructor(e) {
|
6080
6199
|
super(), this.isTransformControlsRoot = !0, this.controls = e, this.visible = !1;
|
6081
6200
|
}
|
@@ -6085,7 +6204,7 @@ class so extends _t {
|
|
6085
6204
|
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
6205
|
}
|
6087
6206
|
}
|
6088
|
-
class
|
6207
|
+
class _o extends vt {
|
6089
6208
|
constructor() {
|
6090
6209
|
super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
|
6091
6210
|
const e = new Je({
|
@@ -6094,7 +6213,7 @@ class no extends _t {
|
|
6094
6213
|
fog: !1,
|
6095
6214
|
toneMapped: !1,
|
6096
6215
|
transparent: !0
|
6097
|
-
}), t = new
|
6216
|
+
}), t = new Vi({
|
6098
6217
|
depthTest: !1,
|
6099
6218
|
depthWrite: !1,
|
6100
6219
|
fog: !1,
|
@@ -6120,23 +6239,23 @@ class no extends _t {
|
|
6120
6239
|
p.opacity = 0.25;
|
6121
6240
|
const m = e.clone();
|
6122
6241
|
m.color.setHex(16776960), m.opacity = 0.25, e.clone().color.setHex(16776960);
|
6123
|
-
const
|
6124
|
-
|
6242
|
+
const C = e.clone();
|
6243
|
+
C.color.setHex(7895160);
|
6125
6244
|
const y = new ve(0, 0.04, 0.1, 12);
|
6126
6245
|
y.translate(0, 0.05, 0);
|
6127
6246
|
const T = new de(0.08, 0.08, 0.08);
|
6128
6247
|
T.translate(0, 0.04, 0);
|
6129
|
-
const g = new
|
6130
|
-
g.setAttribute("position", new
|
6248
|
+
const g = new _t();
|
6249
|
+
g.setAttribute("position", new qe([0, 0, 0, 1, 0, 0], 3));
|
6131
6250
|
const v = new ve(75e-4, 75e-4, 0.5, 3);
|
6132
6251
|
v.translate(0, 0.25, 0);
|
6133
6252
|
function S($, Ue) {
|
6134
|
-
const he = new
|
6253
|
+
const he = new Et($, 75e-4, 3, 64, Ue * Math.PI * 2);
|
6135
6254
|
return he.rotateY(Math.PI / 2), he.rotateX(Math.PI / 2), he;
|
6136
6255
|
}
|
6137
|
-
function
|
6138
|
-
const $ = new
|
6139
|
-
return $.setAttribute("position", new
|
6256
|
+
function E() {
|
6257
|
+
const $ = new _t();
|
6258
|
+
return $.setAttribute("position", new qe([0, 0, 0, 1, 1, 1], 3)), $;
|
6140
6259
|
}
|
6141
6260
|
const w = {
|
6142
6261
|
X: [
|
@@ -6155,7 +6274,7 @@ class no extends _t {
|
|
6155
6274
|
[new M(v, o), null, [Math.PI / 2, 0, 0]]
|
6156
6275
|
],
|
6157
6276
|
XYZ: [
|
6158
|
-
[new M(new
|
6277
|
+
[new M(new Zt(0.1, 0), p.clone()), [0, 0, 0]]
|
6159
6278
|
],
|
6160
6279
|
XY: [
|
6161
6280
|
[new M(new de(0.15, 0.15, 0.01), d.clone()), [0.15, 0.15, 0]]
|
@@ -6180,7 +6299,7 @@ class no extends _t {
|
|
6180
6299
|
[new M(new ve(0.2, 0, 0.6, 4), i), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
|
6181
6300
|
],
|
6182
6301
|
XYZ: [
|
6183
|
-
[new M(new
|
6302
|
+
[new M(new Zt(0.2, 0), i)]
|
6184
6303
|
],
|
6185
6304
|
XY: [
|
6186
6305
|
[new M(new de(0.2, 0.2, 0.01), i), [0.15, 0.15, 0]]
|
@@ -6193,13 +6312,13 @@ class no extends _t {
|
|
6193
6312
|
]
|
6194
6313
|
}, L = {
|
6195
6314
|
START: [
|
6196
|
-
[new M(new
|
6315
|
+
[new M(new Zt(0.01, 2), n), null, null, null, "helper"]
|
6197
6316
|
],
|
6198
6317
|
END: [
|
6199
|
-
[new M(new
|
6318
|
+
[new M(new Zt(0.01, 2), n), null, null, null, "helper"]
|
6200
6319
|
],
|
6201
6320
|
DELTA: [
|
6202
|
-
[new Ie(
|
6321
|
+
[new Ie(E(), n), null, null, null, "helper"]
|
6203
6322
|
],
|
6204
6323
|
X: [
|
6205
6324
|
[new Ie(g, n.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
@@ -6212,7 +6331,7 @@ class no extends _t {
|
|
6212
6331
|
]
|
6213
6332
|
}, j = {
|
6214
6333
|
XYZE: [
|
6215
|
-
[new M(S(0.5, 1),
|
6334
|
+
[new M(S(0.5, 1), C), null, [0, Math.PI / 2, 0]]
|
6216
6335
|
],
|
6217
6336
|
X: [
|
6218
6337
|
[new M(S(0.5, 0.5), r)]
|
@@ -6232,19 +6351,19 @@ class no extends _t {
|
|
6232
6351
|
]
|
6233
6352
|
}, B = {
|
6234
6353
|
XYZE: [
|
6235
|
-
[new M(new
|
6354
|
+
[new M(new mn(0.25, 10, 8), i)]
|
6236
6355
|
],
|
6237
6356
|
X: [
|
6238
|
-
[new M(new
|
6357
|
+
[new M(new Et(0.5, 0.1, 4, 24), i), [0, 0, 0], [0, -Math.PI / 2, -Math.PI / 2]]
|
6239
6358
|
],
|
6240
6359
|
Y: [
|
6241
|
-
[new M(new
|
6360
|
+
[new M(new Et(0.5, 0.1, 4, 24), i), [0, 0, 0], [Math.PI / 2, 0, 0]]
|
6242
6361
|
],
|
6243
6362
|
Z: [
|
6244
|
-
[new M(new
|
6363
|
+
[new M(new Et(0.5, 0.1, 4, 24), i), [0, 0, 0], [0, 0, -Math.PI / 2]]
|
6245
6364
|
],
|
6246
6365
|
E: [
|
6247
|
-
[new M(new
|
6366
|
+
[new M(new Et(0.75, 0.1, 2, 24), i)]
|
6248
6367
|
]
|
6249
6368
|
}, Se = {
|
6250
6369
|
X: [
|
@@ -6310,22 +6429,22 @@ class no extends _t {
|
|
6310
6429
|
[new Ie(g, n.clone()), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
|
6311
6430
|
]
|
6312
6431
|
};
|
6313
|
-
function
|
6314
|
-
const Ue = new
|
6432
|
+
function q($) {
|
6433
|
+
const Ue = new vt();
|
6315
6434
|
for (const he in $)
|
6316
|
-
for (let
|
6317
|
-
const se = $[he][
|
6435
|
+
for (let Ee = $[he].length; Ee--; ) {
|
6436
|
+
const se = $[he][Ee][0].clone(), je = $[he][Ee][1], Ne = $[he][Ee][2], Fe = $[he][Ee][3], W = $[he][Ee][4];
|
6318
6437
|
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
6438
|
const le = se.geometry.clone();
|
6320
6439
|
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
6440
|
}
|
6322
6441
|
return Ue;
|
6323
6442
|
}
|
6324
|
-
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate =
|
6443
|
+
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
6444
|
}
|
6326
6445
|
// updateMatrixWorld will update transformations and appearance of individual handles
|
6327
6446
|
updateMatrixWorld(e) {
|
6328
|
-
const i = (this.mode === "scale" ? "local" : this.space) === "local" ? this.worldQuaternion :
|
6447
|
+
const i = (this.mode === "scale" ? "local" : this.space) === "local" ? this.worldQuaternion : si;
|
6329
6448
|
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
6449
|
let n = [];
|
6331
6450
|
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 +6453,46 @@ class no extends _t {
|
|
6334
6453
|
a.visible = !0, a.rotation.set(0, 0, 0), a.position.copy(this.worldPosition);
|
6335
6454
|
let o;
|
6336
6455
|
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(
|
6456
|
+
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
6457
|
continue;
|
6339
6458
|
}
|
6340
|
-
a.quaternion.copy(i), this.mode === "translate" || this.mode === "scale" ? (a.name === "X" && Math.abs(X.copy(
|
6459
|
+
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
6460
|
return a.name === c;
|
6342
6461
|
})) && (a.material.color.setHex(16776960), a.material.opacity = 1);
|
6343
6462
|
}
|
6344
6463
|
super.updateMatrixWorld(e);
|
6345
6464
|
}
|
6346
6465
|
}
|
6347
|
-
class
|
6466
|
+
class vo extends M {
|
6348
6467
|
constructor() {
|
6349
6468
|
super(
|
6350
|
-
new
|
6351
|
-
new Je({ visible: !1, wireframe: !0, side:
|
6469
|
+
new un(1e5, 1e5, 2, 2),
|
6470
|
+
new Je({ visible: !1, wireframe: !0, side: Bi, transparent: !0, opacity: 0.1, toneMapped: !1 })
|
6352
6471
|
), this.isTransformControlsPlane = !0, this.type = "TransformControlsPlane";
|
6353
6472
|
}
|
6354
6473
|
updateMatrixWorld(e) {
|
6355
6474
|
let t = this.space;
|
6356
|
-
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"),
|
6475
|
+
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
6476
|
case "translate":
|
6358
6477
|
case "scale":
|
6359
6478
|
switch (this.axis) {
|
6360
6479
|
case "X":
|
6361
|
-
X.copy(this.eye).cross(
|
6480
|
+
X.copy(this.eye).cross(Jt), Re.copy(Jt).cross(X);
|
6362
6481
|
break;
|
6363
6482
|
case "Y":
|
6364
|
-
X.copy(this.eye).cross(
|
6483
|
+
X.copy(this.eye).cross(Dt), Re.copy(Dt).cross(X);
|
6365
6484
|
break;
|
6366
6485
|
case "Z":
|
6367
|
-
X.copy(this.eye).cross(
|
6486
|
+
X.copy(this.eye).cross(Rt), Re.copy(Rt).cross(X);
|
6368
6487
|
break;
|
6369
6488
|
case "XY":
|
6370
|
-
Re.copy(
|
6489
|
+
Re.copy(Rt);
|
6371
6490
|
break;
|
6372
6491
|
case "YZ":
|
6373
|
-
Re.copy(
|
6492
|
+
Re.copy(Jt);
|
6374
6493
|
break;
|
6375
6494
|
case "XZ":
|
6376
|
-
X.copy(
|
6495
|
+
X.copy(Rt), Re.copy(Dt);
|
6377
6496
|
break;
|
6378
6497
|
case "XYZ":
|
6379
6498
|
case "E":
|
@@ -6385,10 +6504,10 @@ class ao extends M {
|
|
6385
6504
|
default:
|
6386
6505
|
Re.set(0, 0, 0);
|
6387
6506
|
}
|
6388
|
-
Re.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (
|
6507
|
+
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
6508
|
}
|
6390
6509
|
}
|
6391
|
-
class ge extends
|
6510
|
+
class ge extends Yi {
|
6392
6511
|
static DRAG_START = "Transform::dragStart";
|
6393
6512
|
static DRAG_END = "Transform::dragEnd";
|
6394
6513
|
static _instance;
|
@@ -6397,7 +6516,7 @@ class ge extends zi {
|
|
6397
6516
|
controls = /* @__PURE__ */ new Map();
|
6398
6517
|
visibility = /* @__PURE__ */ new Map();
|
6399
6518
|
constructor() {
|
6400
|
-
super(), D.addEventListener(
|
6519
|
+
super(), D.addEventListener(A.SET_SCENE, this.setScene);
|
6401
6520
|
}
|
6402
6521
|
clear() {
|
6403
6522
|
for (const e of this.controls.values()) {
|
@@ -6411,7 +6530,7 @@ class ge extends zi {
|
|
6411
6530
|
let t = this.controls.get(e);
|
6412
6531
|
if (t === void 0) {
|
6413
6532
|
const i = document.querySelector(".clickable");
|
6414
|
-
t = new
|
6533
|
+
t = new co(this.activeCamera, i), t.getHelper().name = e, t.setSpace("local"), this.controls.set(e, t), this.visibility.set(e, !0), t.addEventListener("mouseDown", () => {
|
6415
6534
|
this.dispatchEvent({ type: ge.DRAG_START });
|
6416
6535
|
}), t.addEventListener("mouseUp", () => {
|
6417
6536
|
this.dispatchEvent({ type: ge.DRAG_END });
|
@@ -6457,9 +6576,9 @@ class ge extends zi {
|
|
6457
6576
|
return ge._instance || (ge._instance = new ge()), ge._instance;
|
6458
6577
|
}
|
6459
6578
|
}
|
6460
|
-
const
|
6461
|
-
class
|
6462
|
-
curve = new
|
6579
|
+
const yo = new de(), Ri = new pe();
|
6580
|
+
class Vs extends vt {
|
6581
|
+
curve = new cs();
|
6463
6582
|
line;
|
6464
6583
|
draggable;
|
6465
6584
|
curvePos;
|
@@ -6479,8 +6598,8 @@ class Hs extends _t {
|
|
6479
6598
|
parentGroup;
|
6480
6599
|
group;
|
6481
6600
|
constructor(e, t) {
|
6482
|
-
const i = new et(
|
6483
|
-
super(), this.name = e, this.lineMaterial = new
|
6601
|
+
const i = new et(lt(0.5, 1, Math.random()), lt(0.5, 1, Math.random()), lt(0.5, 1, Math.random()));
|
6602
|
+
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
6603
|
}
|
6485
6604
|
enable() {
|
6486
6605
|
document.addEventListener("pointerdown", this.onMouseClick);
|
@@ -6497,8 +6616,8 @@ class Hs extends _t {
|
|
6497
6616
|
exportSpline = () => {
|
6498
6617
|
const e = [];
|
6499
6618
|
this.draggable.children.forEach((t) => {
|
6500
|
-
e.push([
|
6501
|
-
}),
|
6619
|
+
e.push([Pe(t.position.x, 3), Pe(t.position.y, 3), Pe(t.position.z, 3)]);
|
6620
|
+
}), Fa({
|
6502
6621
|
name: this.name,
|
6503
6622
|
points: e,
|
6504
6623
|
tension: this.tension,
|
@@ -6518,17 +6637,17 @@ class Hs extends _t {
|
|
6518
6637
|
this.addPoint(e[i], !1);
|
6519
6638
|
this.addPoint(e[t]);
|
6520
6639
|
} else
|
6521
|
-
this.addPoint(new
|
6640
|
+
this.addPoint(new P(-50, 0, 0), !1), this.addPoint(new P(50, 0, 0));
|
6522
6641
|
};
|
6523
6642
|
addPoint = (e, t = !0) => {
|
6524
|
-
const i = this.draggable.children.length, n = new M(
|
6643
|
+
const i = this.draggable.children.length, n = new M(yo, this.draggedMat);
|
6525
6644
|
return n.name = `point_${i}`, n.position.copy(e), n.scale.setScalar(this._draggableScale), this.draggable.add(n), t && this.updateSpline(), n;
|
6526
6645
|
};
|
6527
6646
|
addNextPt = () => {
|
6528
|
-
const e = this.draggable.children.length, t = new
|
6529
|
-
|
6530
|
-
|
6531
|
-
|
6647
|
+
const e = this.draggable.children.length, t = new P(
|
6648
|
+
lt(-this.offset, this.offset, Math.random()),
|
6649
|
+
lt(-this.offset, this.offset, Math.random()),
|
6650
|
+
lt(-this.offset, this.offset, Math.random())
|
6532
6651
|
);
|
6533
6652
|
e > 0 && t.add(this.draggable.children[e - 1].position);
|
6534
6653
|
const i = this.addPoint(t);
|
@@ -6550,14 +6669,14 @@ class Hs extends _t {
|
|
6550
6669
|
this._transform?.object !== void 0 && this.removePoint(this._transform?.object);
|
6551
6670
|
};
|
6552
6671
|
updateSpline = () => {
|
6553
|
-
this.curve = new
|
6672
|
+
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
6673
|
};
|
6555
6674
|
// Handlers
|
6556
6675
|
onMouseClick = (e) => {
|
6557
6676
|
if (!me.instance || this._transform && !this._transform.getHelper().visible)
|
6558
6677
|
return;
|
6559
6678
|
const i = me.instance.currentWindow.current.getBoundingClientRect();
|
6560
|
-
|
6679
|
+
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
6680
|
const n = this.raycaster.intersectObjects(this.draggable.children, !1);
|
6562
6681
|
if (n.length > 0) {
|
6563
6682
|
const r = n[0].object;
|
@@ -6790,13 +6909,13 @@ class Hs extends _t {
|
|
6790
6909
|
e.name, e.visible = this.draggable.visible;
|
6791
6910
|
};
|
6792
6911
|
}
|
6793
|
-
let
|
6794
|
-
class
|
6912
|
+
let ei = 0;
|
6913
|
+
class bo extends vt {
|
6795
6914
|
defaultScale = 10;
|
6796
6915
|
_camera;
|
6797
6916
|
group = null;
|
6798
6917
|
constructor(e) {
|
6799
|
-
super(), this.name = "Spline Editor", this._camera = e, D.addEventListener(
|
6918
|
+
super(), this.name = "Spline Editor", this._camera = e, D.addEventListener(A.ADD_SPLINE, this.onAddSpline);
|
6800
6919
|
}
|
6801
6920
|
initDebug() {
|
6802
6921
|
this.group = ae.addEditorGroup({
|
@@ -6844,19 +6963,19 @@ class oo extends _t {
|
|
6844
6963
|
});
|
6845
6964
|
}
|
6846
6965
|
dispose() {
|
6847
|
-
D.removeEventListener(
|
6966
|
+
D.removeEventListener(A.ADD_SPLINE, this.onAddSpline), ae.removeEditorGroup(this.name);
|
6848
6967
|
}
|
6849
6968
|
addSpline(e) {
|
6850
6969
|
e.draggableScale = this.defaultScale, e.hideTransform(), this.group?.current !== null && e.initDebug(this.group.current), this.add(e);
|
6851
6970
|
}
|
6852
6971
|
createSpline = (e = []) => {
|
6853
|
-
const t = `Spline ${
|
6854
|
-
return i.addPoints(e), this.addSpline(i),
|
6972
|
+
const t = `Spline ${ei + 1}`, i = new Vs(t, this._camera);
|
6973
|
+
return i.addPoints(e), this.addSpline(i), ei++, i;
|
6855
6974
|
};
|
6856
6975
|
createSplineFromArray = (e) => {
|
6857
6976
|
const t = [];
|
6858
6977
|
return e.forEach((i) => {
|
6859
|
-
t.push(new
|
6978
|
+
t.push(new P(i[0], i[1], i[2]));
|
6860
6979
|
}), this.createSpline(t);
|
6861
6980
|
};
|
6862
6981
|
createSplineFromCatmullRom = (e) => this.createSpline(e.points);
|
@@ -6870,12 +6989,12 @@ class oo extends _t {
|
|
6870
6989
|
});
|
6871
6990
|
};
|
6872
6991
|
onAddSpline = (e) => {
|
6873
|
-
const t = JSON.parse(e.value), i = `Spline ${
|
6992
|
+
const t = JSON.parse(e.value), i = `Spline ${ei + 1}`, n = [];
|
6874
6993
|
t.points.forEach((a) => {
|
6875
|
-
n.push(new
|
6994
|
+
n.push(new P(a[0], a[1], a[2]));
|
6876
6995
|
});
|
6877
|
-
const r = new
|
6878
|
-
r.addPoints(n), this.addSpline(r),
|
6996
|
+
const r = new Vs(i, this.camera);
|
6997
|
+
r.addPoints(n), this.addSpline(r), ei++;
|
6879
6998
|
};
|
6880
6999
|
get camera() {
|
6881
7000
|
return this._camera;
|
@@ -6887,15 +7006,15 @@ class oo extends _t {
|
|
6887
7006
|
});
|
6888
7007
|
}
|
6889
7008
|
}
|
6890
|
-
const
|
7009
|
+
const Zs = [
|
6891
7010
|
"Single",
|
6892
7011
|
"Side by Side",
|
6893
7012
|
"Stacked",
|
6894
7013
|
"Quad"
|
6895
|
-
],
|
6896
|
-
class me extends
|
7014
|
+
], Eo = "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", Co = "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==";
|
7015
|
+
class me extends Ft {
|
6897
7016
|
static instance = null;
|
6898
|
-
scene = new
|
7017
|
+
scene = new Gs();
|
6899
7018
|
renderer;
|
6900
7019
|
currentScene;
|
6901
7020
|
cameras = /* @__PURE__ */ new Map();
|
@@ -6905,17 +7024,17 @@ class me extends Nt {
|
|
6905
7024
|
// RefObject to one of the "windows"
|
6906
7025
|
cameraHelpers = /* @__PURE__ */ new Map();
|
6907
7026
|
lightHelpers = /* @__PURE__ */ new Map();
|
6908
|
-
helpersContainer = new
|
6909
|
-
grid = new
|
6910
|
-
axisHelper = new
|
6911
|
-
interactionHelper = new
|
7027
|
+
helpersContainer = new fa();
|
7028
|
+
grid = new ao();
|
7029
|
+
axisHelper = new hs(500);
|
7030
|
+
interactionHelper = new hs(100);
|
6912
7031
|
currentTransform;
|
6913
7032
|
// Tools
|
6914
7033
|
splineEditor;
|
6915
7034
|
// Override Materials
|
6916
|
-
depthMaterial = new
|
6917
|
-
normalsMaterial = new
|
6918
|
-
uvMaterial = new
|
7035
|
+
depthMaterial = new ga();
|
7036
|
+
normalsMaterial = new _a();
|
7037
|
+
uvMaterial = new lo();
|
6919
7038
|
wireframeMaterial = new Je({
|
6920
7039
|
opacity: 0.33,
|
6921
7040
|
transparent: !0,
|
@@ -6942,7 +7061,7 @@ class me extends Nt {
|
|
6942
7061
|
// Interactions
|
6943
7062
|
selectedItem = void 0;
|
6944
7063
|
debugCamera;
|
6945
|
-
raycaster = new
|
7064
|
+
raycaster = new ni();
|
6946
7065
|
pointer = new pe();
|
6947
7066
|
cameraControls = void 0;
|
6948
7067
|
// References
|
@@ -6965,14 +7084,14 @@ class me extends Nt {
|
|
6965
7084
|
}, 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
7085
|
const r = {
|
6967
7086
|
Vector2: pe,
|
6968
|
-
Vector3:
|
6969
|
-
Vector4:
|
6970
|
-
Quaternion:
|
6971
|
-
Matrix4:
|
6972
|
-
Spherical:
|
6973
|
-
Box3:
|
6974
|
-
Sphere:
|
6975
|
-
Raycaster:
|
7087
|
+
Vector3: P,
|
7088
|
+
Vector4: Oa,
|
7089
|
+
Quaternion: Ce,
|
7090
|
+
Matrix4: ci,
|
7091
|
+
Spherical: Li,
|
7092
|
+
Box3: Ta,
|
7093
|
+
Sphere: Ma,
|
7094
|
+
Raycaster: ni
|
6976
7095
|
};
|
6977
7096
|
ke.install({ THREE: r }), this.setupScene(), this.setupTools();
|
6978
7097
|
const a = localStorage.getItem(this.expandedCameraVisibility);
|
@@ -7122,11 +7241,11 @@ class me extends Nt {
|
|
7122
7241
|
] }),
|
7123
7242
|
/* @__PURE__ */ u.jsxs("div", { className: "settings", children: [
|
7124
7243
|
/* @__PURE__ */ u.jsx(
|
7125
|
-
|
7244
|
+
li,
|
7126
7245
|
{
|
7127
7246
|
title: "View",
|
7128
|
-
index:
|
7129
|
-
options:
|
7247
|
+
index: Zs.indexOf(this.state.mode),
|
7248
|
+
options: Zs,
|
7130
7249
|
onSelect: (t) => {
|
7131
7250
|
t !== this.state.mode && (this.killControls(), this.setState({ mode: t }), localStorage.setItem(`${this.appID}_mode`, t));
|
7132
7251
|
},
|
@@ -7141,7 +7260,7 @@ class me extends Nt {
|
|
7141
7260
|
}
|
7142
7261
|
),
|
7143
7262
|
/* @__PURE__ */ u.jsx(
|
7144
|
-
|
7263
|
+
li,
|
7145
7264
|
{
|
7146
7265
|
title: "Interact",
|
7147
7266
|
index: this.state.interactionMode === "Orbit" ? 0 : 1,
|
@@ -7163,10 +7282,10 @@ class me extends Nt {
|
|
7163
7282
|
}
|
7164
7283
|
),
|
7165
7284
|
/* @__PURE__ */ u.jsx(
|
7166
|
-
|
7285
|
+
Us,
|
7167
7286
|
{
|
7168
7287
|
name: "cameraHelper",
|
7169
|
-
icon:
|
7288
|
+
icon: Eo,
|
7170
7289
|
selected: this.cameraVisibility,
|
7171
7290
|
height: 24,
|
7172
7291
|
top: 2,
|
@@ -7181,10 +7300,10 @@ class me extends Nt {
|
|
7181
7300
|
}
|
7182
7301
|
),
|
7183
7302
|
/* @__PURE__ */ u.jsx(
|
7184
|
-
|
7303
|
+
Us,
|
7185
7304
|
{
|
7186
7305
|
name: "lightHelper",
|
7187
|
-
icon:
|
7306
|
+
icon: Co,
|
7188
7307
|
selected: this.lightVisibility,
|
7189
7308
|
height: 24,
|
7190
7309
|
top: 4,
|
@@ -7203,7 +7322,7 @@ class me extends Nt {
|
|
7203
7322
|
}
|
7204
7323
|
// Setup
|
7205
7324
|
setupRenderer() {
|
7206
|
-
this.renderer = new
|
7325
|
+
this.renderer = new va({
|
7207
7326
|
canvas: this.canvasRef.current,
|
7208
7327
|
stencil: !1
|
7209
7328
|
}), 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 +7330,15 @@ class me extends Nt {
|
|
7211
7330
|
setupScene() {
|
7212
7331
|
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
7332
|
const e = (n, r) => {
|
7214
|
-
const a = new
|
7333
|
+
const a = new Ii(-100, 100, 100, -100, 50, 5e3);
|
7215
7334
|
return a.name = n, a.position.copy(r), a.lookAt(0, 0, 0), this.cameras.set(n, a), a;
|
7216
7335
|
};
|
7217
|
-
e("Top", new
|
7336
|
+
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
7337
|
const t = localStorage, i = this.props.three.app.appID;
|
7219
7338
|
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
7339
|
}
|
7221
7340
|
setupTools() {
|
7222
|
-
this.splineEditor = new
|
7341
|
+
this.splineEditor = new bo(this.currentCamera), this.splineEditor.initDebug(), this.scene.add(this.splineEditor);
|
7223
7342
|
}
|
7224
7343
|
// Public
|
7225
7344
|
play() {
|
@@ -7263,11 +7382,11 @@ class me extends Nt {
|
|
7263
7382
|
// Events
|
7264
7383
|
enable() {
|
7265
7384
|
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(
|
7385
|
+
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
7386
|
}
|
7268
7387
|
disable() {
|
7269
7388
|
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(
|
7389
|
+
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
7390
|
}
|
7272
7391
|
resize = () => {
|
7273
7392
|
this.width = window.innerWidth - 300, this.height = window.innerHeight;
|
@@ -7287,7 +7406,7 @@ class me extends Nt {
|
|
7287
7406
|
}
|
7288
7407
|
const r = i / n;
|
7289
7408
|
this.cameras.forEach((a) => {
|
7290
|
-
a instanceof
|
7409
|
+
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
7410
|
});
|
7292
7411
|
};
|
7293
7412
|
sceneUpdate = (e) => {
|
@@ -7301,7 +7420,7 @@ class me extends Nt {
|
|
7301
7420
|
addCamera = (e) => {
|
7302
7421
|
const t = e.value, i = this.props.three.scene?.getObjectByProperty("uuid", t.uuid);
|
7303
7422
|
if (i !== void 0 && this.cameras.set(t.name, i), i instanceof Ct) {
|
7304
|
-
const n = new
|
7423
|
+
const n = new ya(i);
|
7305
7424
|
n.visible = this.cameraVisibility, this.cameraHelpers.set(i.name, n), this.scene.add(n);
|
7306
7425
|
}
|
7307
7426
|
this.setState({ lastUpdate: Date.now() });
|
@@ -7314,11 +7433,11 @@ class me extends Nt {
|
|
7314
7433
|
const t = new pe();
|
7315
7434
|
this.renderer.getSize(t);
|
7316
7435
|
const i = Math.min(e.clientX, t.x), n = Math.min(e.clientY, t.y);
|
7317
|
-
this.pointer.x =
|
7436
|
+
this.pointer.x = ot(i, 0, t.x, -1, 1), this.pointer.y = ot(n, 0, t.y, 1, -1);
|
7318
7437
|
const r = t.x / 2, a = t.y / 2, o = () => {
|
7319
|
-
i < r ? this.pointer.x =
|
7438
|
+
i < r ? this.pointer.x = ot(i, 0, r, -1, 1) : this.pointer.x = ot(i, r, t.x, -1, 1);
|
7320
7439
|
}, c = () => {
|
7321
|
-
n < a ? this.pointer.y =
|
7440
|
+
n < a ? this.pointer.y = ot(n, 0, a, 1, -1) : this.pointer.y = ot(n, a, t.y, 1, -1);
|
7322
7441
|
};
|
7323
7442
|
switch (this.state.mode) {
|
7324
7443
|
case "Quad":
|
@@ -7352,7 +7471,7 @@ class me extends Nt {
|
|
7352
7471
|
if (this.currentCamera.name === "UI")
|
7353
7472
|
return;
|
7354
7473
|
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
|
7474
|
+
e.key === "0" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ke(this.currentCamera, this.currentWindow.current), this.selectedItem instanceof M || this.selectedItem instanceof ba ? (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
7475
|
} else if (this.currentTransform !== void 0)
|
7357
7476
|
switch (e.key) {
|
7358
7477
|
case "r":
|
@@ -7389,7 +7508,7 @@ class me extends Nt {
|
|
7389
7508
|
x: this.selectedItem.rotation.x,
|
7390
7509
|
y: this.selectedItem.rotation.y,
|
7391
7510
|
z: this.selectedItem.rotation.z
|
7392
|
-
}), this.props.three.updateObject(this.selectedItem.uuid, "scale", this.selectedItem.scale),
|
7511
|
+
}), this.props.three.updateObject(this.selectedItem.uuid, "scale", this.selectedItem.scale), di.instance.update());
|
7393
7512
|
};
|
7394
7513
|
// Utils
|
7395
7514
|
clearLightHelpers = () => {
|
@@ -7403,19 +7522,19 @@ class me extends Nt {
|
|
7403
7522
|
let t;
|
7404
7523
|
switch (e.type) {
|
7405
7524
|
case "DirectionalLight":
|
7406
|
-
t = new
|
7525
|
+
t = new wa(e, 100), t.name = `${e.name}Helper`, t.visible = this.lightVisibility, this.lightHelpers.set(e.name, t), this.helpersContainer.add(t);
|
7407
7526
|
break;
|
7408
7527
|
case "HemisphereLight":
|
7409
|
-
t = new
|
7528
|
+
t = new Sa(e, 250), t.name = `${e.name}Helper`, t.visible = this.lightVisibility, this.lightHelpers.set(e.name, t), this.helpersContainer.add(t);
|
7410
7529
|
break;
|
7411
7530
|
case "RectAreaLight":
|
7412
|
-
t = new
|
7531
|
+
t = new zr(e), t.name = `${e.name}Helper`, t.visible = this.lightVisibility, this.lightHelpers.set(e.name, t), this.helpersContainer.add(t);
|
7413
7532
|
break;
|
7414
7533
|
case "PointLight":
|
7415
|
-
t = new
|
7534
|
+
t = new Ca(e, 100), t.name = `${e.name}Helper`, t.visible = this.lightVisibility, this.lightHelpers.set(e.name, t), this.helpersContainer.add(t);
|
7416
7535
|
break;
|
7417
7536
|
case "SpotLight":
|
7418
|
-
t = new
|
7537
|
+
t = new Ea(e), t.name = `${e.name}Helper`, t.visible = this.lightVisibility, this.lightHelpers.set(e.name, t), this.helpersContainer.add(t);
|
7419
7538
|
break;
|
7420
7539
|
}
|
7421
7540
|
}
|
@@ -7425,7 +7544,7 @@ class me extends Nt {
|
|
7425
7544
|
const i = this.controls.get(e.name);
|
7426
7545
|
if (i !== void 0 && i.dispose(), this.controls.delete(e.name), e.name === "UI")
|
7427
7546
|
return;
|
7428
|
-
const n = new
|
7547
|
+
const n = new Yr(e, t);
|
7429
7548
|
switch (n.enableDamping = !0, n.dampingFactor = 0.05, e.name) {
|
7430
7549
|
case "Top":
|
7431
7550
|
case "Bottom":
|
@@ -7486,11 +7605,11 @@ class me extends Nt {
|
|
7486
7605
|
if (this.selectedItem === void 0)
|
7487
7606
|
return;
|
7488
7607
|
cancelAnimationFrame(this.cameraControlsRafID), this.cameraControlsRafID = -1, this.cameraControls && (this.cameraControls.smoothTime = 0.1);
|
7489
|
-
const i = 0.15, n = new
|
7608
|
+
const i = 0.15, n = new xa();
|
7490
7609
|
n.start(), this.selectedItem.getWorldPosition(e.target0);
|
7491
7610
|
const r = () => {
|
7492
7611
|
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 =
|
7612
|
+
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
7613
|
};
|
7495
7614
|
r();
|
7496
7615
|
};
|
@@ -7554,12 +7673,12 @@ class me extends Nt {
|
|
7554
7673
|
return `${this.appID}_multiviewLightVisibility`;
|
7555
7674
|
}
|
7556
7675
|
}
|
7557
|
-
class
|
7676
|
+
class di extends Ft {
|
7558
7677
|
static instance;
|
7559
|
-
matrix = new
|
7560
|
-
position = new
|
7561
|
-
rotation = new
|
7562
|
-
scale = new
|
7678
|
+
matrix = new ci();
|
7679
|
+
position = new P();
|
7680
|
+
rotation = new pn();
|
7681
|
+
scale = new P();
|
7563
7682
|
open = !1;
|
7564
7683
|
constructor(e) {
|
7565
7684
|
super(e);
|
@@ -7567,14 +7686,14 @@ class hi extends Nt {
|
|
7567
7686
|
this.open = i, this.saveExpanded(), this.state = {
|
7568
7687
|
lastUpdated: 0,
|
7569
7688
|
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)),
|
7689
|
+
}, 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
7690
|
}
|
7572
7691
|
update() {
|
7573
7692
|
if (me.instance) {
|
7574
7693
|
const e = me.instance.selectedItem;
|
7575
7694
|
if (e === void 0)
|
7576
7695
|
return;
|
7577
|
-
this.position.x =
|
7696
|
+
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
7697
|
}
|
7579
7698
|
}
|
7580
7699
|
render() {
|
@@ -7637,7 +7756,7 @@ class hi extends Nt {
|
|
7637
7756
|
return `${this.props.three.app.appID}_transform`;
|
7638
7757
|
}
|
7639
7758
|
}
|
7640
|
-
function
|
7759
|
+
function Ws(s) {
|
7641
7760
|
switch (s) {
|
7642
7761
|
case "color":
|
7643
7762
|
return "Color";
|
@@ -7660,7 +7779,7 @@ function Bs(s) {
|
|
7660
7779
|
}
|
7661
7780
|
return s;
|
7662
7781
|
}
|
7663
|
-
function
|
7782
|
+
function So(s, e) {
|
7664
7783
|
function t() {
|
7665
7784
|
return `${e.app.appID}_light`;
|
7666
7785
|
}
|
@@ -7673,7 +7792,7 @@ function ho(s, e) {
|
|
7673
7792
|
for (const o in s.lightInfo) {
|
7674
7793
|
const c = s.lightInfo[o];
|
7675
7794
|
c !== void 0 && (c.isColor !== void 0 ? a.push({
|
7676
|
-
title:
|
7795
|
+
title: Ws(o),
|
7677
7796
|
prop: o,
|
7678
7797
|
type: "color",
|
7679
7798
|
value: c,
|
@@ -7687,7 +7806,7 @@ function ho(s, e) {
|
|
7687
7806
|
}
|
7688
7807
|
}
|
7689
7808
|
}) : a.push({
|
7690
|
-
title:
|
7809
|
+
title: Ws(o),
|
7691
7810
|
prop: o,
|
7692
7811
|
type: typeof c,
|
7693
7812
|
value: c,
|
@@ -7714,7 +7833,7 @@ function ho(s, e) {
|
|
7714
7833
|
}
|
7715
7834
|
);
|
7716
7835
|
}
|
7717
|
-
function
|
7836
|
+
function wo(s) {
|
7718
7837
|
const e = s.object, t = s.three;
|
7719
7838
|
function i() {
|
7720
7839
|
return `${t.app.appID}_animation`;
|
@@ -7785,7 +7904,7 @@ function uo(s) {
|
|
7785
7904
|
}), o.push({
|
7786
7905
|
title: "Mixer",
|
7787
7906
|
items: y
|
7788
|
-
}), d = new
|
7907
|
+
}), d = new Pa(m), me.instance?.scene.add(d);
|
7789
7908
|
}
|
7790
7909
|
}
|
7791
7910
|
}
|
@@ -7803,7 +7922,7 @@ function uo(s) {
|
|
7803
7922
|
}
|
7804
7923
|
);
|
7805
7924
|
}
|
7806
|
-
const
|
7925
|
+
const Hi = {
|
7807
7926
|
name: "",
|
7808
7927
|
uuid: "",
|
7809
7928
|
type: "",
|
@@ -7816,32 +7935,32 @@ const Fi = {
|
|
7816
7935
|
lightInfo: void 0,
|
7817
7936
|
children: []
|
7818
7937
|
};
|
7819
|
-
let ce = { ...
|
7820
|
-
function
|
7938
|
+
let ce = { ...Hi };
|
7939
|
+
function xo(s) {
|
7821
7940
|
const [e, t] = Z(-1);
|
7822
7941
|
tt(() => {
|
7823
7942
|
function a(c) {
|
7824
7943
|
ce = { ...c.value }, t(Date.now());
|
7825
7944
|
}
|
7826
7945
|
function o() {
|
7827
|
-
ce = { ...
|
7946
|
+
ce = { ...Hi }, t(Date.now());
|
7828
7947
|
}
|
7829
|
-
return D.addEventListener(
|
7830
|
-
D.removeEventListener(
|
7948
|
+
return D.addEventListener(A.SET_SCENE, o), D.addEventListener(A.SET_OBJECT, a), () => {
|
7949
|
+
D.removeEventListener(A.SET_SCENE, o), D.removeEventListener(A.SET_OBJECT, a);
|
7831
7950
|
};
|
7832
7951
|
}, []);
|
7833
7952
|
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
7953
|
return /* @__PURE__ */ u.jsx(
|
7835
|
-
|
7954
|
+
oi,
|
7836
7955
|
{
|
7837
7956
|
label: "Inspector",
|
7838
7957
|
button: ce.uuid.length > 0 ? /* @__PURE__ */ u.jsx("button", { className: "remove", onClick: () => {
|
7839
|
-
ge.instance.remove(ce.name), ce = { ...
|
7958
|
+
ge.instance.remove(ce.name), ce = { ...Hi }, t(Date.now());
|
7840
7959
|
} }) : void 0,
|
7841
7960
|
children: /* @__PURE__ */ u.jsx("div", { id: "Inspector", className: s.class, children: ce.uuid.length > 0 && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
7842
7961
|
/* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
7843
7962
|
/* @__PURE__ */ u.jsx(
|
7844
|
-
|
7963
|
+
ii,
|
7845
7964
|
{
|
7846
7965
|
type: "string",
|
7847
7966
|
title: "Name",
|
@@ -7851,7 +7970,7 @@ function po(s) {
|
|
7851
7970
|
}
|
7852
7971
|
),
|
7853
7972
|
/* @__PURE__ */ u.jsx(
|
7854
|
-
|
7973
|
+
ii,
|
7855
7974
|
{
|
7856
7975
|
type: "string",
|
7857
7976
|
title: "Type",
|
@@ -7861,7 +7980,7 @@ function po(s) {
|
|
7861
7980
|
}
|
7862
7981
|
),
|
7863
7982
|
/* @__PURE__ */ u.jsx(
|
7864
|
-
|
7983
|
+
ii,
|
7865
7984
|
{
|
7866
7985
|
type: "string",
|
7867
7986
|
title: "UUID",
|
@@ -7872,28 +7991,28 @@ function po(s) {
|
|
7872
7991
|
)
|
7873
7992
|
] }),
|
7874
7993
|
/* @__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 ?
|
7994
|
+
/* @__PURE__ */ u.jsx(di, { object: ce, three: s.three }),
|
7995
|
+
n ? /* @__PURE__ */ u.jsx(wo, { object: ce, three: s.three }) : null,
|
7996
|
+
i.search("camera") > -1 ? Fr(ce, s.three) : null,
|
7997
|
+
i.search("light") > -1 ? So(ce, s.three) : null,
|
7998
|
+
r ? Ur(ce, s.three) : null
|
7880
7999
|
] })
|
7881
8000
|
] }) }, e)
|
7882
8001
|
},
|
7883
8002
|
"Inspector"
|
7884
8003
|
);
|
7885
8004
|
}
|
7886
|
-
class
|
8005
|
+
class Oo extends Ft {
|
7887
8006
|
// Renderer
|
7888
8007
|
autoClear = !0;
|
7889
8008
|
autoClearColor = !0;
|
7890
8009
|
autoClearDepth = !0;
|
7891
8010
|
autoClearStencil = !0;
|
7892
|
-
outputColorSpace =
|
8011
|
+
outputColorSpace = ds;
|
7893
8012
|
localClippingEnabled = !1;
|
7894
8013
|
clearColor = new et(0);
|
7895
8014
|
clearAlpha = 1;
|
7896
|
-
toneMapping =
|
8015
|
+
toneMapping = us;
|
7897
8016
|
toneMappingExposure = 1;
|
7898
8017
|
constructor(e) {
|
7899
8018
|
super(e);
|
@@ -7905,14 +8024,14 @@ class mo extends Nt {
|
|
7905
8024
|
const n = me.instance.renderer;
|
7906
8025
|
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
8026
|
}
|
7908
|
-
D.addEventListener(
|
8027
|
+
D.addEventListener(A.ADD_RENDERER, this.onAddRenderer);
|
7909
8028
|
}
|
7910
8029
|
componentwillunmount() {
|
7911
|
-
D.removeEventListener(
|
8030
|
+
D.removeEventListener(A.ADD_RENDERER, this.onAddRenderer);
|
7912
8031
|
}
|
7913
8032
|
onAddRenderer = (e) => {
|
7914
8033
|
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,
|
8034
|
+
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
8035
|
const i = me.instance.renderer;
|
7917
8036
|
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
8037
|
}
|
@@ -7931,7 +8050,7 @@ class mo extends Nt {
|
|
7931
8050
|
localClippingEnabled: this.localClippingEnabled,
|
7932
8051
|
clearAlpha: this.clearAlpha,
|
7933
8052
|
clearColor: this.clearColor.getStyle(),
|
7934
|
-
colorManagement:
|
8053
|
+
colorManagement: mt.enabled,
|
7935
8054
|
toneMapping: this.toneMapping,
|
7936
8055
|
toneMappingExposure: this.toneMappingExposure
|
7937
8056
|
}));
|
@@ -8005,9 +8124,9 @@ class mo extends Nt {
|
|
8005
8124
|
{
|
8006
8125
|
type: "boolean",
|
8007
8126
|
title: "Clear Management",
|
8008
|
-
value:
|
8127
|
+
value: mt.enabled,
|
8009
8128
|
onChange: (t, i) => {
|
8010
|
-
|
8129
|
+
mt.enabled = i, e();
|
8011
8130
|
}
|
8012
8131
|
},
|
8013
8132
|
{
|
@@ -8017,15 +8136,15 @@ class mo extends Nt {
|
|
8017
8136
|
options: [
|
8018
8137
|
{
|
8019
8138
|
title: "No Color Space",
|
8020
|
-
value:
|
8139
|
+
value: Aa
|
8021
8140
|
},
|
8022
8141
|
{
|
8023
8142
|
title: "SRB Color Space",
|
8024
|
-
value:
|
8143
|
+
value: ds
|
8025
8144
|
},
|
8026
8145
|
{
|
8027
8146
|
title: "Linear SRB Color Space",
|
8028
|
-
value:
|
8147
|
+
value: Nt
|
8029
8148
|
}
|
8030
8149
|
],
|
8031
8150
|
onChange: (t, i) => {
|
@@ -8039,35 +8158,35 @@ class mo extends Nt {
|
|
8039
8158
|
options: [
|
8040
8159
|
{
|
8041
8160
|
title: "None ",
|
8042
|
-
value:
|
8161
|
+
value: us
|
8043
8162
|
},
|
8044
8163
|
{
|
8045
8164
|
title: "Linear ",
|
8046
|
-
value:
|
8165
|
+
value: Da
|
8047
8166
|
},
|
8048
8167
|
{
|
8049
8168
|
title: "Reinhard",
|
8050
|
-
value:
|
8169
|
+
value: Ra
|
8051
8170
|
},
|
8052
8171
|
{
|
8053
8172
|
title: "Cineon ",
|
8054
|
-
value:
|
8173
|
+
value: Ia
|
8055
8174
|
},
|
8056
8175
|
{
|
8057
8176
|
title: "ACES Filmic",
|
8058
|
-
value:
|
8177
|
+
value: La
|
8059
8178
|
},
|
8060
8179
|
{
|
8061
8180
|
title: "AgX",
|
8062
|
-
value:
|
8181
|
+
value: ka
|
8063
8182
|
},
|
8064
8183
|
{
|
8065
8184
|
title: "Neutral",
|
8066
|
-
value:
|
8185
|
+
value: Ua
|
8067
8186
|
},
|
8068
8187
|
{
|
8069
8188
|
title: "Custom",
|
8070
|
-
value:
|
8189
|
+
value: ja
|
8071
8190
|
}
|
8072
8191
|
],
|
8073
8192
|
onChange: (t, i) => {
|
@@ -8100,12 +8219,12 @@ class mo extends Nt {
|
|
8100
8219
|
return `${this.props.three.app.appID}_renderer`;
|
8101
8220
|
}
|
8102
8221
|
}
|
8103
|
-
function
|
8222
|
+
function To(s) {
|
8104
8223
|
const [e] = Z([]), [t] = Z([]), [i, n] = Z(0), r = (c) => {
|
8105
8224
|
const l = c.value;
|
8106
8225
|
e.push(l), t.push(
|
8107
8226
|
/* @__PURE__ */ u.jsx(
|
8108
|
-
|
8227
|
+
oi,
|
8109
8228
|
{
|
8110
8229
|
label: `Scene: ${l.name}`,
|
8111
8230
|
scene: l,
|
@@ -8113,7 +8232,7 @@ function fo(s) {
|
|
8113
8232
|
onRefresh: () => {
|
8114
8233
|
s.three.refreshScene(l.name);
|
8115
8234
|
},
|
8116
|
-
children: /* @__PURE__ */ u.jsx(
|
8235
|
+
children: /* @__PURE__ */ u.jsx(Es, { child: l, scene: l, three: s.three })
|
8117
8236
|
},
|
8118
8237
|
Math.random()
|
8119
8238
|
)
|
@@ -8123,7 +8242,7 @@ function fo(s) {
|
|
8123
8242
|
for (let d = 0; d < e.length; d++)
|
8124
8243
|
if (l.uuid === e[d].uuid) {
|
8125
8244
|
e[d] = l, t[d] = /* @__PURE__ */ u.jsx(
|
8126
|
-
|
8245
|
+
oi,
|
8127
8246
|
{
|
8128
8247
|
label: `Scene: ${l.name}`,
|
8129
8248
|
scene: l,
|
@@ -8131,7 +8250,7 @@ function fo(s) {
|
|
8131
8250
|
onRefresh: () => {
|
8132
8251
|
s.three.refreshScene(l.name);
|
8133
8252
|
},
|
8134
|
-
children: /* @__PURE__ */ u.jsx(
|
8253
|
+
children: /* @__PURE__ */ u.jsx(Es, { child: l, scene: l, three: s.three })
|
8135
8254
|
},
|
8136
8255
|
Math.random()
|
8137
8256
|
), n(Date.now());
|
@@ -8145,16 +8264,16 @@ function fo(s) {
|
|
8145
8264
|
return;
|
8146
8265
|
}
|
8147
8266
|
};
|
8148
|
-
return tt(() => (D.addEventListener(
|
8149
|
-
D.removeEventListener(
|
8267
|
+
return tt(() => (D.addEventListener(A.ADD_SCENE, r), D.addEventListener(A.REFRESH_SCENE, a), D.addEventListener(A.REMOVE_SCENE, o), () => {
|
8268
|
+
D.removeEventListener(A.ADD_SCENE, r), D.removeEventListener(A.REFRESH_SCENE, a), D.removeEventListener(A.REMOVE_SCENE, o);
|
8150
8269
|
}), []), /* @__PURE__ */ u.jsxs("div", { id: "SidePanel", children: [
|
8151
8270
|
/* @__PURE__ */ u.jsx("div", { className: "scenes", children: t }, i),
|
8152
|
-
/* @__PURE__ */ u.jsx(
|
8153
|
-
/* @__PURE__ */ u.jsx(
|
8271
|
+
/* @__PURE__ */ u.jsx(xo, { three: s.three }),
|
8272
|
+
/* @__PURE__ */ u.jsx(Oo, { three: s.three }),
|
8154
8273
|
/* @__PURE__ */ u.jsx(ae, { three: s.three })
|
8155
8274
|
] });
|
8156
8275
|
}
|
8157
|
-
function
|
8276
|
+
function Go(s) {
|
8158
8277
|
return tt(() => {
|
8159
8278
|
function e(o) {
|
8160
8279
|
let c = null;
|
@@ -8195,7 +8314,7 @@ function Io(s) {
|
|
8195
8314
|
}
|
8196
8315
|
d.material.needsUpdate = !0;
|
8197
8316
|
};
|
8198
|
-
c.value.src.length > 0 ?
|
8317
|
+
c.value.src.length > 0 ? vn(c.value.src).then((m) => {
|
8199
8318
|
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
8319
|
}) : p(null);
|
8201
8320
|
}
|
@@ -8203,25 +8322,25 @@ function Io(s) {
|
|
8203
8322
|
const { key: c, uuid: l, value: d, subitem: p } = o.value, f = e(l)?.getObjectByProperty("uuid", l);
|
8204
8323
|
if (f !== void 0)
|
8205
8324
|
try {
|
8206
|
-
p !== void 0 ?
|
8207
|
-
} catch (
|
8208
|
-
console.log("Error requesting method:"), console.log(
|
8325
|
+
p !== void 0 ? or(f, p)[c](d) : f[c](d);
|
8326
|
+
} catch (C) {
|
8327
|
+
console.log("Error requesting method:"), console.log(C), console.log(c), console.log(d);
|
8209
8328
|
}
|
8210
8329
|
};
|
8211
|
-
return D.addEventListener(
|
8212
|
-
D.removeEventListener(
|
8330
|
+
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), () => {
|
8331
|
+
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
8332
|
};
|
8214
8333
|
}, []), null;
|
8215
8334
|
}
|
8216
|
-
function
|
8335
|
+
function Mo(s) {
|
8217
8336
|
return /* @__PURE__ */ u.jsxs("div", { className: "editor", ref: s.ref, style: s.style, children: [
|
8218
8337
|
/* @__PURE__ */ u.jsx("div", { className: "header", children: s.header }),
|
8219
8338
|
s.children,
|
8220
8339
|
/* @__PURE__ */ u.jsx("div", { className: "footer", children: s.footer })
|
8221
8340
|
] });
|
8222
8341
|
}
|
8223
|
-
function
|
8224
|
-
return /* @__PURE__ */ u.jsx(
|
8342
|
+
function Xo(s) {
|
8343
|
+
return /* @__PURE__ */ u.jsx(Mo, { children: /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
8225
8344
|
/* @__PURE__ */ u.jsx(
|
8226
8345
|
me,
|
8227
8346
|
{
|
@@ -8232,59 +8351,61 @@ function Lo(s) {
|
|
8232
8351
|
onSceneUpdate: s.onSceneUpdate
|
8233
8352
|
}
|
8234
8353
|
),
|
8235
|
-
/* @__PURE__ */ u.jsx(
|
8354
|
+
/* @__PURE__ */ u.jsx(To, { three: s.three })
|
8236
8355
|
] }) });
|
8237
8356
|
}
|
8238
8357
|
export {
|
8239
|
-
|
8240
|
-
|
8241
|
-
|
8242
|
-
|
8243
|
-
|
8244
|
-
|
8245
|
-
|
8246
|
-
|
8247
|
-
|
8248
|
-
|
8249
|
-
|
8250
|
-
|
8251
|
-
|
8358
|
+
oi as Accordion,
|
8359
|
+
zo as Application,
|
8360
|
+
Wi as BaseRemote,
|
8361
|
+
bn as ChildObject,
|
8362
|
+
Es as ContainerObject,
|
8363
|
+
mr as Draggable,
|
8364
|
+
pr as DraggableItem,
|
8365
|
+
fr as Dropdown,
|
8366
|
+
gr as DropdownItem,
|
8367
|
+
Mo as Editor,
|
8368
|
+
No as ElementProxy,
|
8369
|
+
sr as ElementProxyReceiver,
|
8370
|
+
ti as ExportTexture,
|
8371
|
+
xo as Inspector,
|
8252
8372
|
me as MultiView,
|
8253
|
-
|
8254
|
-
|
8255
|
-
|
8256
|
-
|
8257
|
-
|
8258
|
-
|
8259
|
-
|
8260
|
-
|
8261
|
-
|
8262
|
-
|
8263
|
-
|
8264
|
-
|
8265
|
-
|
8373
|
+
yn as NavButton,
|
8374
|
+
Fo as ProxyManager,
|
8375
|
+
Ga as QualityType,
|
8376
|
+
Ho as RemoteComponents,
|
8377
|
+
Wo as RemoteController,
|
8378
|
+
Vo as RemoteTheatre,
|
8379
|
+
Zo as RemoteThree,
|
8380
|
+
Go as SceneInspector,
|
8381
|
+
To as SidePanel,
|
8382
|
+
Vs as Spline,
|
8383
|
+
bo as SplineEditor,
|
8384
|
+
Xo as ThreeEditor,
|
8385
|
+
A as ToolEvents,
|
8266
8386
|
ge as Transform,
|
8267
|
-
|
8387
|
+
jo as WebworkerEventHandlers,
|
8388
|
+
ri as capitalize,
|
8268
8389
|
$e as clamp,
|
8269
|
-
|
8270
|
-
|
8271
|
-
|
8390
|
+
ps as colorToHex,
|
8391
|
+
Fa as copyToClipboard,
|
8392
|
+
Bo as customizeTheatreElements,
|
8272
8393
|
D as debugDispatcher,
|
8273
|
-
|
8274
|
-
|
8394
|
+
Ro as defaultTheatreCallback,
|
8395
|
+
Io as detectSettings,
|
8275
8396
|
He as dispose,
|
8276
|
-
|
8277
|
-
|
8278
|
-
|
8279
|
-
|
8280
|
-
|
8281
|
-
|
8282
|
-
|
8283
|
-
|
8284
|
-
|
8285
|
-
|
8286
|
-
|
8287
|
-
|
8288
|
-
|
8289
|
-
|
8397
|
+
Xa as disposeMaterial,
|
8398
|
+
ko as disposeTexture,
|
8399
|
+
Lo as distance,
|
8400
|
+
ji as hierarchyUUID,
|
8401
|
+
Ha as isColor,
|
8402
|
+
ki as mix,
|
8403
|
+
ai as noop,
|
8404
|
+
_s as normalize,
|
8405
|
+
Uo as parseModelLite,
|
8406
|
+
za as randomID,
|
8407
|
+
vs as resetThreeObjects,
|
8408
|
+
Pe as round,
|
8409
|
+
Yo as theatreEditorApp,
|
8410
|
+
Ui as totalThreeObjects
|
8290
8411
|
};
|