@tomorrowevening/hermes 0.0.116 → 0.0.118
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/hermes.cjs.js +14 -14
- package/dist/hermes.es.js +611 -590
- package/package.json +1 -1
- package/types/core/remote/RemoteThree.d.ts +42 -42
- package/types/editor/utils.d.ts +5 -5
- package/types/index.d.ts +2 -1
- package/types/utils/detectSettings.d.ts +15 -15
- package/types/utils/math.d.ts +5 -5
- package/types/utils/three.d.ts +21 -21
package/dist/hermes.es.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { OrthographicCamera as Ai, Scene as Hs, MeshBasicMaterial as Je, BufferGeometry as gt, Float32BufferAttribute as Ke, Mesh as
|
2
|
-
import hn, { useState as
|
1
|
+
import { OrthographicCamera as Ai, Scene as Hs, MeshBasicMaterial as Je, BufferGeometry as gt, Float32BufferAttribute as Ke, Mesh as O, LinearSRGBColorSpace as Ut, EventDispatcher as Ys, Texture as Bn, RepeatWrapping as is, Color as et, ColorManagement as pt, WebGLRenderTarget as Vn, FrontSide as Zn, BackSide as Bs, DoubleSide as Ni, NoBlending as Wn, NormalBlending as Gn, AdditiveBlending as Xn, SubtractiveBlending as $n, MultiplyBlending as qn, CustomBlending as Kn, AddEquation as Qn, SubtractEquation as Jn, ReverseSubtractEquation as ea, MinEquation as ta, MaxEquation as ia, ZeroFactor as Vs, OneFactor as Zs, SrcColorFactor as Ws, OneMinusSrcColorFactor as Gs, SrcAlphaFactor as Xs, OneMinusSrcAlphaFactor as $s, DstAlphaFactor as qs, OneMinusDstAlphaFactor as Ks, DstColorFactor as Qs, OneMinusDstColorFactor as Js, SrcAlphaSaturateFactor as sa, ConstantColorFactor as en, OneMinusConstantColorFactor as tn, ConstantAlphaFactor as sn, OneMinusConstantAlphaFactor as nn, Line as Ie, LineBasicMaterial as Fi, Ray as na, Plane as aa, MathUtils as ra, Vector3 as A, Controls as an, MOUSE as ft, TOUCH as mt, Quaternion as Ee, Spherical as Pi, Vector2 as ue, ShaderMaterial as rn, GLSL3 as oa, PlaneGeometry as on, Raycaster as ii, Euler as ln, Matrix4 as ri, Object3D as _t, CylinderGeometry as _e, BoxGeometry as he, OctahedronGeometry as Bt, SphereGeometry as cn, TorusGeometry as bt, CatmullRomCurve3 as ss, Group as la, AxesHelper as ns, MeshDepthMaterial as ca, MeshNormalMaterial as ha, PerspectiveCamera as Et, WebGLRenderer as da, CameraHelper as ua, SkinnedMesh as pa, SpotLightHelper as ma, PointLightHelper as fa, HemisphereLightHelper as ga, DirectionalLightHelper as _a, Clock as va, Vector4 as ya, Box3 as ba, Sphere as Ea, SkeletonHelper as Ca, SRGBColorSpace as as, NoToneMapping as rs, NoColorSpace as Sa, LinearToneMapping as wa, ReinhardToneMapping as xa, CineonToneMapping as Oa, ACESFilmicToneMapping as Ta, AgXToneMapping as Ma, NeutralToneMapping as Aa, CustomToneMapping as Pa } from "three";
|
2
|
+
import hn, { useState as B, useRef as ne, useEffect as tt, useMemo as kt, Component as jt, createRef as Ve, forwardRef as Da } from "react";
|
3
3
|
import { Reorder as dn } from "framer-motion";
|
4
4
|
const un = () => {
|
5
5
|
}, _o = () => {
|
@@ -24,87 +24,6 @@ function os(s) {
|
|
24
24
|
}, r = n(e), a = n(t), o = n(i);
|
25
25
|
return "#" + r + a + o;
|
26
26
|
}
|
27
|
-
const vo = (s) => {
|
28
|
-
s?.dispose();
|
29
|
-
}, ka = (s) => {
|
30
|
-
s && (Array.isArray(s) ? s.forEach((e) => e.dispose()) : s.dispose());
|
31
|
-
}, He = (s) => {
|
32
|
-
if (s) {
|
33
|
-
for (; s.children.length > 0; ) {
|
34
|
-
const e = s.children[0];
|
35
|
-
e.type === "Audio" ? (e.pause(), e.parent && e.parent.remove(e)) : He(e);
|
36
|
-
}
|
37
|
-
if (s.parent && s.parent.remove(s), s.isMesh) {
|
38
|
-
const e = s;
|
39
|
-
e.geometry?.dispose(), ka(e.material);
|
40
|
-
}
|
41
|
-
s.dispose !== void 0 && s.dispose();
|
42
|
-
}
|
43
|
-
};
|
44
|
-
let Di = 0;
|
45
|
-
const ls = () => {
|
46
|
-
Di = 0;
|
47
|
-
}, Ri = (s) => {
|
48
|
-
if (!s)
|
49
|
-
return;
|
50
|
-
let e = s.name.replaceAll(" ", "").replaceAll("/", ".");
|
51
|
-
if (e.length === 0 && (e = `obj_${Di}`, Di++), s.parent !== null && s.parent.uuid.length > 0 && (e = `${s.parent.uuid}.${e}`), s.uuid = e, s.isMesh !== void 0) {
|
52
|
-
const t = s;
|
53
|
-
if (Array.isArray(t.material))
|
54
|
-
t.material.forEach((i, n) => {
|
55
|
-
i.uuid = `${e}.material.${n}`;
|
56
|
-
});
|
57
|
-
else {
|
58
|
-
const i = t.material;
|
59
|
-
i.uuid = `${e}.material`;
|
60
|
-
}
|
61
|
-
}
|
62
|
-
s.children.forEach((t) => Ri(t));
|
63
|
-
};
|
64
|
-
class Jt {
|
65
|
-
static renderer;
|
66
|
-
static canvas;
|
67
|
-
static context = null;
|
68
|
-
static scene = null;
|
69
|
-
static camera = null;
|
70
|
-
static material = null;
|
71
|
-
static inited = !1;
|
72
|
-
static width = 100;
|
73
|
-
static height = 100;
|
74
|
-
static init() {
|
75
|
-
this.inited || (this.canvas = document.createElement("canvas"), this.canvas.width = this.width, this.canvas.height = this.height, this.context = this.canvas.getContext("2d"), this.inited = !0);
|
76
|
-
}
|
77
|
-
static renderToBlob(e) {
|
78
|
-
this.init();
|
79
|
-
const t = e.repeat.clone(), i = e.offset.clone();
|
80
|
-
if (e.repeat.set(1, 1), e.offset.set(0, 0), this.context !== null) {
|
81
|
-
this.context.clearRect(0, 0, this.width, this.height);
|
82
|
-
const n = e.image;
|
83
|
-
if (n != null && n.width > 0) {
|
84
|
-
this.canvas.title = e.sourceFile;
|
85
|
-
const r = this.canvas.width / n.width, a = this.renderToCanvas(e);
|
86
|
-
this.context.drawImage(a, 0, 0, n.width * r, n.height * r);
|
87
|
-
}
|
88
|
-
}
|
89
|
-
return e.repeat.copy(t), e.offset.copy(i), this.canvas.toDataURL("image/png");
|
90
|
-
}
|
91
|
-
static renderToCanvas(e) {
|
92
|
-
if (this.material === null) {
|
93
|
-
this.camera = new Ai(-0.5, 0.5, 0.5, -0.5, 0, 100), this.scene = new Hs(), this.material = new Je();
|
94
|
-
const t = new gt();
|
95
|
-
t.setAttribute("position", new Ke([-0.5, -0.5, 0, 1.5, -0.5, 0, -0.5, 1.5, 0], 3)), t.setAttribute("normal", new Ke([0, 0, 1, 0, 0, 1], 3)), t.setAttribute("uv", new Ke([0, 0, 2, 0, 0, 2], 2));
|
96
|
-
const i = new M(t, this.material);
|
97
|
-
this.scene.add(i);
|
98
|
-
}
|
99
|
-
if (e.isRenderTargetTexture)
|
100
|
-
this.material.map = e, this.renderer.render(this.scene, this.camera);
|
101
|
-
else {
|
102
|
-
const t = this.renderer.outputColorSpace, i = e.colorSpace;
|
103
|
-
this.renderer.outputColorSpace = Ut, e.colorSpace = Ut, this.material.map = e, this.renderer.render(this.scene, this.camera), this.renderer.outputColorSpace = t, e.colorSpace = i;
|
104
|
-
}
|
105
|
-
return this.renderer.domElement;
|
106
|
-
}
|
107
|
-
}
|
108
27
|
function fi(s, e, t, i) {
|
109
28
|
return new (t || (t = Promise))(function(n, r) {
|
110
29
|
function a(l) {
|
@@ -130,8 +49,8 @@ function fi(s, e, t, i) {
|
|
130
49
|
c((i = i.apply(s, e || [])).next());
|
131
50
|
});
|
132
51
|
}
|
133
|
-
const
|
134
|
-
function
|
52
|
+
const ka = ["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 ls(s) {
|
135
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");
|
136
55
|
}
|
137
56
|
const pn = typeof window > "u", Le = (() => {
|
@@ -140,7 +59,7 @@ const pn = typeof window > "u", Le = (() => {
|
|
140
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;
|
141
60
|
return { isIpad: n, isMobile: /android/i.test(s) || i || n, isSafari12: /Version\/12.+Safari/.test(s), isFirefox: /Firefox/.test(s) };
|
142
61
|
})();
|
143
|
-
function
|
62
|
+
function Ua(s, e, t) {
|
144
63
|
if (!t)
|
145
64
|
return [e];
|
146
65
|
const i = function(l) {
|
@@ -161,27 +80,27 @@ function ja(s, e, t) {
|
|
161
80
|
enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);
|
162
81
|
gl_FragColor = enc;
|
163
82
|
}
|
164
|
-
`, m = l.createShader(35633),
|
165
|
-
if (!(
|
83
|
+
`, m = l.createShader(35633), g = l.createShader(35632), S = l.createProgram();
|
84
|
+
if (!(g && m && S))
|
166
85
|
return;
|
167
|
-
l.shaderSource(m, d), l.shaderSource(
|
168
|
-
const
|
169
|
-
l.bindBuffer(34962,
|
170
|
-
const
|
171
|
-
l.vertexAttribPointer(
|
86
|
+
l.shaderSource(m, d), l.shaderSource(g, p), l.compileShader(m), l.compileShader(g), l.attachShader(S, m), l.attachShader(S, g), l.linkProgram(S), l.detachShader(S, m), l.detachShader(S, g), l.deleteShader(m), l.deleteShader(g), l.useProgram(S);
|
87
|
+
const T = l.createBuffer();
|
88
|
+
l.bindBuffer(34962, T), l.bufferData(34962, new Float32Array([-1, -1, 0, 3, -1, 0, -1, 3, 0]), 35044);
|
89
|
+
const M = l.getAttribLocation(S, "aPosition");
|
90
|
+
l.vertexAttribPointer(M, 3, 5126, !1, 0, 0), l.enableVertexAttribArray(M), l.clearColor(1, 1, 1, 1), l.clear(16384), l.viewport(0, 0, 1, 1), l.drawArrays(4, 0, 3);
|
172
91
|
const f = new Uint8Array(4);
|
173
|
-
return l.readPixels(0, 0, 1, 1, 6408, 5121, f), l.deleteProgram(
|
92
|
+
return l.readPixels(0, 0, 1, 1, 6408, 5121, f), l.deleteProgram(S), l.deleteBuffer(T), f.join("");
|
174
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]];
|
175
94
|
let c;
|
176
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`);
|
177
96
|
}
|
178
|
-
class
|
97
|
+
class cs extends Error {
|
179
98
|
constructor(e) {
|
180
99
|
super(e), Object.setPrototypeOf(this, new.target.prototype);
|
181
100
|
}
|
182
101
|
}
|
183
|
-
const gi = [],
|
184
|
-
function
|
102
|
+
const gi = [], hs = [];
|
103
|
+
function ja(s, e) {
|
185
104
|
if (s === e)
|
186
105
|
return 0;
|
187
106
|
const t = s;
|
@@ -196,106 +115,106 @@ function Na(s, e) {
|
|
196
115
|
return n;
|
197
116
|
let o, c, l = 0, d = 0, p = 0;
|
198
117
|
for (; d < i; )
|
199
|
-
|
118
|
+
hs[d] = s.charCodeAt(a + d), gi[d] = ++d;
|
200
119
|
for (; p < n; )
|
201
120
|
for (r = e.charCodeAt(a + p), o = p++, l = p, d = 0; d < i; d++)
|
202
|
-
c = r ===
|
121
|
+
c = r === hs[d] ? o : o + 1, o = gi[d], l = gi[d] = o > l ? c > l ? l + 1 : c : c > o ? o + 1 : c;
|
203
122
|
return l;
|
204
123
|
}
|
205
|
-
function
|
124
|
+
function Na(s) {
|
206
125
|
return s != null;
|
207
126
|
}
|
208
|
-
const
|
127
|
+
const Fa = ({ 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" } = {}) => fi(void 0, void 0, void 0, function* () {
|
209
128
|
const a = {};
|
210
129
|
if (pn)
|
211
130
|
return { tier: 0, type: "SSR" };
|
212
|
-
const { isIpad: o = !!Le?.isIpad, isMobile: c = !!Le?.isMobile, screenSize: l = window.screen, loadBenchmarks: d = (
|
213
|
-
const w = yield fetch(`${r}/${
|
131
|
+
const { isIpad: o = !!Le?.isIpad, isMobile: c = !!Le?.isMobile, screenSize: l = window.screen, loadBenchmarks: d = (C) => fi(void 0, void 0, void 0, function* () {
|
132
|
+
const w = yield fetch(`${r}/${C}`).then((I) => I.json());
|
214
133
|
if (parseInt(w.shift().split(".")[0], 10) < 4)
|
215
|
-
throw new
|
134
|
+
throw new cs("Detect GPU benchmark data is out of date. Please update to version 4x");
|
216
135
|
return w;
|
217
136
|
}) } = t;
|
218
137
|
let { renderer: p } = t;
|
219
|
-
const m = (
|
220
|
-
let
|
138
|
+
const m = (C, w, I, U, K) => ({ device: K, fps: U, gpu: I, isMobile: c, tier: C, type: w });
|
139
|
+
let g, S = "";
|
221
140
|
if (p)
|
222
|
-
p =
|
141
|
+
p = ls(p), g = [p];
|
223
142
|
else {
|
224
|
-
const
|
143
|
+
const C = i || function(I, U = !1) {
|
225
144
|
const K = { alpha: !1, antialias: !1, depth: !1, failIfMajorPerformanceCaveat: U, powerPreference: "high-performance", stencil: !1 };
|
226
145
|
I && delete K.powerPreference;
|
227
146
|
const me = window.document.createElement("canvas"), Ae = me.getContext("webgl", K) || me.getContext("experimental-webgl", K);
|
228
147
|
return Ae ?? void 0;
|
229
148
|
}(Le?.isSafari12, n);
|
230
|
-
if (!
|
149
|
+
if (!C)
|
231
150
|
return m(0, "WEBGL_UNSUPPORTED");
|
232
|
-
const w = Le?.isFirefox ? null :
|
233
|
-
if (p = w ?
|
151
|
+
const w = Le?.isFirefox ? null : C.getExtension("WEBGL_debug_renderer_info");
|
152
|
+
if (p = w ? C.getParameter(w.UNMASKED_RENDERER_WEBGL) : C.getParameter(C.RENDERER), !p)
|
234
153
|
return m(1, "FALLBACK");
|
235
|
-
|
236
|
-
return U === "apple gpu" ?
|
237
|
-
}(
|
154
|
+
S = p, p = ls(p), g = function(I, U, K) {
|
155
|
+
return U === "apple gpu" ? Ua(I, U, K) : [U];
|
156
|
+
}(C, p, c);
|
238
157
|
}
|
239
|
-
const
|
158
|
+
const T = (yield Promise.all(g.map(function(C) {
|
240
159
|
var w;
|
241
160
|
return fi(this, void 0, void 0, function* () {
|
242
|
-
const I = ((
|
161
|
+
const I = ((V) => {
|
243
162
|
const re = c ? ["adreno", "apple", "mali-t", "mali", "nvidia", "powervr", "samsung"] : ["intel", "apple", "amd", "radeon", "nvidia", "geforce", "adreno"];
|
244
163
|
for (const Oe of re)
|
245
|
-
if (
|
164
|
+
if (V.includes(Oe))
|
246
165
|
return Oe;
|
247
|
-
})(
|
166
|
+
})(C);
|
248
167
|
if (!I)
|
249
168
|
return;
|
250
169
|
const U = `${c ? "m" : "d"}-${I}${o ? "-ipad" : ""}.json`, K = a[U] = (w = a[U]) !== null && w !== void 0 ? w : d(U);
|
251
170
|
let me;
|
252
171
|
try {
|
253
172
|
me = yield K;
|
254
|
-
} catch (
|
255
|
-
if (
|
256
|
-
throw
|
173
|
+
} catch (V) {
|
174
|
+
if (V instanceof cs)
|
175
|
+
throw V;
|
257
176
|
return;
|
258
177
|
}
|
259
|
-
const Ae = function(
|
178
|
+
const Ae = function(V) {
|
260
179
|
var re;
|
261
|
-
const Oe = (
|
180
|
+
const Oe = (V = V.replace(/\([^)]+\)/, "")).match(/\d+/) || V.match(/(\W|^)([A-Za-z]{1,3})(\W|$)/g);
|
262
181
|
return (re = Oe?.join("").replace(/\W|amd/g, "")) !== null && re !== void 0 ? re : "";
|
263
|
-
}(
|
264
|
-
let Ce = me.filter(([,
|
265
|
-
Ce.length || (Ce = me.filter(([
|
182
|
+
}(C);
|
183
|
+
let Ce = me.filter(([, V]) => V === Ae);
|
184
|
+
Ce.length || (Ce = me.filter(([V]) => V.includes(C)));
|
266
185
|
const le = Ce.length;
|
267
186
|
if (le === 0)
|
268
187
|
return;
|
269
|
-
const Q =
|
270
|
-
let
|
188
|
+
const Q = C.split(/[.,()\[\]/\s]/g).sort().filter((V, re, Oe) => re === 0 || V !== Oe[re - 1]).join(" ");
|
189
|
+
let G, [Ue, , , , ce] = le > 1 ? Ce.map((V) => [V, ja(Q, V[2])]).sort(([, V], [, re]) => V - re)[0][0] : Ce[0], be = Number.MAX_VALUE;
|
271
190
|
const { devicePixelRatio: te } = window, je = l.width * te * l.height * te;
|
272
|
-
for (const
|
273
|
-
const [re, Oe] =
|
274
|
-
it < be && (be = it,
|
191
|
+
for (const V of ce) {
|
192
|
+
const [re, Oe] = V, vt = re * Oe, it = Math.abs(je - vt);
|
193
|
+
it < be && (be = it, G = V);
|
275
194
|
}
|
276
|
-
if (!
|
195
|
+
if (!G)
|
277
196
|
return;
|
278
|
-
const [, , Ne, Fe] =
|
197
|
+
const [, , Ne, Fe] = G;
|
279
198
|
return [be, Ne, Ue, Fe];
|
280
199
|
});
|
281
|
-
}))).filter(
|
282
|
-
if (!
|
283
|
-
const
|
284
|
-
return
|
285
|
-
}
|
286
|
-
const [,
|
287
|
-
if (
|
288
|
-
return m(0, "BLOCKLISTED", f,
|
289
|
-
const
|
200
|
+
}))).filter(Na).sort(([C = Number.MAX_VALUE, w], [I = Number.MAX_VALUE, U]) => C === I ? w - U : C - I);
|
201
|
+
if (!T.length) {
|
202
|
+
const C = ka.find((w) => p.includes(w));
|
203
|
+
return C ? m(0, "BLOCKLISTED", C) : m(1, "FALLBACK", `${p} (${S})`);
|
204
|
+
}
|
205
|
+
const [, M, f, v] = T[0];
|
206
|
+
if (M === -1)
|
207
|
+
return m(0, "BLOCKLISTED", f, M, v);
|
208
|
+
const E = c ? s : e;
|
290
209
|
let b = 0;
|
291
|
-
for (let
|
292
|
-
|
293
|
-
return m(b, "BENCHMARK", f,
|
210
|
+
for (let C = 0; C < E.length; C++)
|
211
|
+
M >= E[C] && (b = C);
|
212
|
+
return m(b, "BENCHMARK", f, M, v);
|
294
213
|
});
|
295
|
-
var
|
296
|
-
function
|
214
|
+
var za = /* @__PURE__ */ ((s) => (s[s.High = 0] = "High", s[s.Medium = 1] = "Medium", s[s.Low = 2] = "Low", s))(za || {});
|
215
|
+
function vo(s) {
|
297
216
|
return new Promise((e) => {
|
298
|
-
|
217
|
+
Fa().then((t) => {
|
299
218
|
let i = !1;
|
300
219
|
const n = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
301
220
|
if (i = "transferControlToOffscreen" in s, n) {
|
@@ -316,7 +235,104 @@ function yo(s) {
|
|
316
235
|
});
|
317
236
|
});
|
318
237
|
}
|
319
|
-
|
238
|
+
function $e(s, e, t) {
|
239
|
+
return Math.min(e, Math.max(s, t));
|
240
|
+
}
|
241
|
+
function ds(s, e, t) {
|
242
|
+
return (t - s) / (e - s);
|
243
|
+
}
|
244
|
+
function Di(s, e, t) {
|
245
|
+
return s * (1 - t) + e * t;
|
246
|
+
}
|
247
|
+
function yo(s, e) {
|
248
|
+
const t = s - e;
|
249
|
+
return Math.sqrt(t * t);
|
250
|
+
}
|
251
|
+
function Me(s, e = 1) {
|
252
|
+
return Number(s.toFixed(e));
|
253
|
+
}
|
254
|
+
const bo = (s) => {
|
255
|
+
s?.dispose();
|
256
|
+
}, Ha = (s) => {
|
257
|
+
s && (Array.isArray(s) ? s.forEach((e) => e.dispose()) : s.dispose());
|
258
|
+
}, He = (s) => {
|
259
|
+
if (s) {
|
260
|
+
for (; s.children.length > 0; ) {
|
261
|
+
const e = s.children[0];
|
262
|
+
e.type === "Audio" ? (e.pause(), e.parent && e.parent.remove(e)) : He(e);
|
263
|
+
}
|
264
|
+
if (s.parent && s.parent.remove(s), s.isMesh) {
|
265
|
+
const e = s;
|
266
|
+
e.geometry?.dispose(), Ha(e.material);
|
267
|
+
}
|
268
|
+
s.dispose !== void 0 && s.dispose();
|
269
|
+
}
|
270
|
+
};
|
271
|
+
let Ri = 0;
|
272
|
+
const us = () => {
|
273
|
+
Ri = 0;
|
274
|
+
}, Ii = (s) => {
|
275
|
+
if (!s)
|
276
|
+
return;
|
277
|
+
let e = s.name.replaceAll(" ", "").replaceAll("/", ".");
|
278
|
+
if (e.length === 0 && (e = `obj_${Ri}`, Ri++), s.parent !== null && s.parent.uuid.length > 0 && (e = `${s.parent.uuid}.${e}`), s.uuid = e, s.isMesh !== void 0) {
|
279
|
+
const t = s;
|
280
|
+
if (Array.isArray(t.material))
|
281
|
+
t.material.forEach((i, n) => {
|
282
|
+
i.uuid = `${e}.material.${n}`;
|
283
|
+
});
|
284
|
+
else {
|
285
|
+
const i = t.material;
|
286
|
+
i.uuid = `${e}.material`;
|
287
|
+
}
|
288
|
+
}
|
289
|
+
s.children.forEach((t) => Ii(t));
|
290
|
+
};
|
291
|
+
class Jt {
|
292
|
+
static renderer;
|
293
|
+
static canvas;
|
294
|
+
static context = null;
|
295
|
+
static scene = null;
|
296
|
+
static camera = null;
|
297
|
+
static material = null;
|
298
|
+
static inited = !1;
|
299
|
+
static width = 100;
|
300
|
+
static height = 100;
|
301
|
+
static init() {
|
302
|
+
this.inited || (this.canvas = document.createElement("canvas"), this.canvas.width = this.width, this.canvas.height = this.height, this.context = this.canvas.getContext("2d"), this.inited = !0);
|
303
|
+
}
|
304
|
+
static renderToBlob(e) {
|
305
|
+
this.init();
|
306
|
+
const t = e.repeat.clone(), i = e.offset.clone();
|
307
|
+
if (e.repeat.set(1, 1), e.offset.set(0, 0), this.context !== null) {
|
308
|
+
this.context.clearRect(0, 0, this.width, this.height);
|
309
|
+
const n = e.image;
|
310
|
+
if (n != null && n.width > 0) {
|
311
|
+
this.canvas.title = e.sourceFile;
|
312
|
+
const r = this.canvas.width / n.width, a = this.renderToCanvas(e);
|
313
|
+
this.context.drawImage(a, 0, 0, n.width * r, n.height * r);
|
314
|
+
}
|
315
|
+
}
|
316
|
+
return e.repeat.copy(t), e.offset.copy(i), this.canvas.toDataURL("image/png");
|
317
|
+
}
|
318
|
+
static renderToCanvas(e) {
|
319
|
+
if (this.material === null) {
|
320
|
+
this.camera = new Ai(-0.5, 0.5, 0.5, -0.5, 0, 100), this.scene = new Hs(), this.material = new Je();
|
321
|
+
const t = new gt();
|
322
|
+
t.setAttribute("position", new Ke([-0.5, -0.5, 0, 1.5, -0.5, 0, -0.5, 1.5, 0], 3)), t.setAttribute("normal", new Ke([0, 0, 1, 0, 0, 1], 3)), t.setAttribute("uv", new Ke([0, 0, 2, 0, 0, 2], 2));
|
323
|
+
const i = new O(t, this.material);
|
324
|
+
this.scene.add(i);
|
325
|
+
}
|
326
|
+
if (e.isRenderTargetTexture)
|
327
|
+
this.material.map = e, this.renderer.render(this.scene, this.camera);
|
328
|
+
else {
|
329
|
+
const t = this.renderer.outputColorSpace, i = e.colorSpace;
|
330
|
+
this.renderer.outputColorSpace = Ut, e.colorSpace = Ut, this.material.map = e, this.renderer.render(this.scene, this.camera), this.renderer.outputColorSpace = t, e.colorSpace = i;
|
331
|
+
}
|
332
|
+
return this.renderer.domElement;
|
333
|
+
}
|
334
|
+
}
|
335
|
+
class Eo {
|
320
336
|
components = /* @__PURE__ */ new Map();
|
321
337
|
listen;
|
322
338
|
// Protected
|
@@ -388,7 +404,7 @@ class zi {
|
|
388
404
|
handleEditor(e, t, i) {
|
389
405
|
}
|
390
406
|
}
|
391
|
-
class
|
407
|
+
class Co extends zi {
|
392
408
|
selectDropdown(e, t) {
|
393
409
|
this.app.send({
|
394
410
|
event: "selectComponent",
|
@@ -420,7 +436,7 @@ class Eo extends zi {
|
|
420
436
|
}
|
421
437
|
}
|
422
438
|
}
|
423
|
-
function
|
439
|
+
function So(s, e, t) {
|
424
440
|
if (s.editor) {
|
425
441
|
t.ui.restore(), t.onSelectionChange((a) => {
|
426
442
|
a.length < 1 || a.forEach((o) => {
|
@@ -463,7 +479,7 @@ function Co(s, e, t) {
|
|
463
479
|
} else
|
464
480
|
t.ui.hide();
|
465
481
|
}
|
466
|
-
function
|
482
|
+
function wo() {
|
467
483
|
setTimeout(() => {
|
468
484
|
const s = document.getElementById("theatrejs-studio-root");
|
469
485
|
if (s === null || s.shadowRoot === null)
|
@@ -489,7 +505,7 @@ function So() {
|
|
489
505
|
}
|
490
506
|
}, 1e3);
|
491
507
|
}
|
492
|
-
class
|
508
|
+
class xo extends zi {
|
493
509
|
project;
|
494
510
|
sheets = /* @__PURE__ */ new Map();
|
495
511
|
sheetObjects = /* @__PURE__ */ new Map();
|
@@ -554,13 +570,13 @@ class wo extends zi {
|
|
554
570
|
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 : un);
|
555
571
|
const d = l.onValuesChange((p) => {
|
556
572
|
if (this.app.editor) {
|
557
|
-
for (const
|
558
|
-
const
|
559
|
-
typeof
|
560
|
-
r:
|
561
|
-
g:
|
562
|
-
b:
|
563
|
-
a:
|
573
|
+
for (const g in p) {
|
574
|
+
const S = p[g];
|
575
|
+
typeof S == "object" && La(S) && (p[g] = {
|
576
|
+
r: S.r,
|
577
|
+
g: S.g,
|
578
|
+
b: S.b,
|
579
|
+
a: S.a
|
564
580
|
});
|
565
581
|
}
|
566
582
|
this.app.send({
|
@@ -898,19 +914,7 @@ function mn(s) {
|
|
898
914
|
}, i.onerror = t, i.src = s;
|
899
915
|
});
|
900
916
|
}
|
901
|
-
|
902
|
-
return Math.min(e, Math.max(s, t));
|
903
|
-
}
|
904
|
-
function us(s, e, t) {
|
905
|
-
return (t - s) / (e - s);
|
906
|
-
}
|
907
|
-
function Ii(s, e, t) {
|
908
|
-
return s * (1 - t) + e * t;
|
909
|
-
}
|
910
|
-
function Me(s, e = 1) {
|
911
|
-
return Number(s.toFixed(e));
|
912
|
-
}
|
913
|
-
class xo extends zi {
|
917
|
+
class Oo extends zi {
|
914
918
|
canvas = null;
|
915
919
|
// Canvas or OffscreenCanvas
|
916
920
|
inputElement = null;
|
@@ -1055,7 +1059,7 @@ class xo extends zi {
|
|
1055
1059
|
addScene(e) {
|
1056
1060
|
if (e === void 0 || (this.scenes.set(e.name, e), !this.app.debugEnabled))
|
1057
1061
|
return;
|
1058
|
-
|
1062
|
+
us(), Ii(e);
|
1059
1063
|
const t = ut(e);
|
1060
1064
|
this.app.send({
|
1061
1065
|
event: "addScene",
|
@@ -1098,7 +1102,7 @@ class xo extends zi {
|
|
1098
1102
|
setScene(e) {
|
1099
1103
|
if (e === void 0 || (this.scene = e, !this.app.debugEnabled))
|
1100
1104
|
return;
|
1101
|
-
this.renderer !== void 0 && (Jt.renderer = this.renderer),
|
1105
|
+
this.renderer !== void 0 && (Jt.renderer = this.renderer), us(), Ii(e);
|
1102
1106
|
const t = ut(e);
|
1103
1107
|
this.app.send({
|
1104
1108
|
event: "setScene",
|
@@ -1237,14 +1241,14 @@ function Ga() {
|
|
1237
1241
|
ps = 1;
|
1238
1242
|
var s = hn, 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 };
|
1239
1243
|
function a(o, c, l) {
|
1240
|
-
var d, p = {}, m = null,
|
1241
|
-
l !== void 0 && (m = "" + l), c.key !== void 0 && (m = "" + c.key), c.ref !== void 0 && (
|
1244
|
+
var d, p = {}, m = null, g = null;
|
1245
|
+
l !== void 0 && (m = "" + l), c.key !== void 0 && (m = "" + c.key), c.ref !== void 0 && (g = c.ref);
|
1242
1246
|
for (d in c)
|
1243
1247
|
i.call(c, d) && !r.hasOwnProperty(d) && (p[d] = c[d]);
|
1244
1248
|
if (o && o.defaultProps)
|
1245
1249
|
for (d in c = o.defaultProps, c)
|
1246
1250
|
p[d] === void 0 && (p[d] = c[d]);
|
1247
|
-
return { $$typeof: e, type: o, key: m, ref:
|
1251
|
+
return { $$typeof: e, type: o, key: m, ref: g, props: p, _owner: n.current };
|
1248
1252
|
}
|
1249
1253
|
return Ct.Fragment = t, Ct.jsx = a, Ct.jsxs = a, Ct;
|
1250
1254
|
}
|
@@ -1261,11 +1265,11 @@ var St = {};
|
|
1261
1265
|
var ms;
|
1262
1266
|
function Xa() {
|
1263
1267
|
return ms || (ms = 1, process.env.NODE_ENV !== "production" && function() {
|
1264
|
-
var s = hn, 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"),
|
1265
|
-
function
|
1268
|
+
var s = hn, 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"), g = Symbol.for("react.offscreen"), S = Symbol.iterator, T = "@@iterator";
|
1269
|
+
function M(h) {
|
1266
1270
|
if (h === null || typeof h != "object")
|
1267
1271
|
return null;
|
1268
|
-
var y =
|
1272
|
+
var y = S && h[S] || h[T];
|
1269
1273
|
return typeof y == "function" ? y : null;
|
1270
1274
|
}
|
1271
1275
|
var f = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
@@ -1273,23 +1277,23 @@ function Xa() {
|
|
1273
1277
|
{
|
1274
1278
|
for (var y = arguments.length, x = new Array(y > 1 ? y - 1 : 0), L = 1; L < y; L++)
|
1275
1279
|
x[L - 1] = arguments[L];
|
1276
|
-
|
1280
|
+
E("error", h, x);
|
1277
1281
|
}
|
1278
1282
|
}
|
1279
|
-
function
|
1283
|
+
function E(h, y, x) {
|
1280
1284
|
{
|
1281
1285
|
var L = f.ReactDebugCurrentFrame, z = L.getStackAddendum();
|
1282
1286
|
z !== "" && (y += "%s", x = x.concat([z]));
|
1283
|
-
var
|
1287
|
+
var Z = x.map(function(N) {
|
1284
1288
|
return String(N);
|
1285
1289
|
});
|
1286
|
-
|
1290
|
+
Z.unshift("Warning: " + y), Function.prototype.apply.call(console[h], console, Z);
|
1287
1291
|
}
|
1288
1292
|
}
|
1289
|
-
var b = !1,
|
1293
|
+
var b = !1, C = !1, w = !1, I = !1, U = !1, K;
|
1290
1294
|
K = Symbol.for("react.module.reference");
|
1291
1295
|
function me(h) {
|
1292
|
-
return !!(typeof h == "string" || typeof h == "function" || h === i || h === r || U || h === n || h === l || h === d || I || h ===
|
1296
|
+
return !!(typeof h == "string" || typeof h == "function" || h === i || h === r || U || h === n || h === l || h === d || I || h === g || b || C || w || 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
|
1293
1297
|
// types supported by any Flight configuration anywhere since
|
1294
1298
|
// we don't know which Flight build this will end up being used
|
1295
1299
|
// with.
|
@@ -1340,9 +1344,9 @@ function Xa() {
|
|
1340
1344
|
var L = h.displayName || null;
|
1341
1345
|
return L !== null ? L : le(h.type) || "Memo";
|
1342
1346
|
case m: {
|
1343
|
-
var z = h,
|
1347
|
+
var z = h, Z = z._payload, N = z._init;
|
1344
1348
|
try {
|
1345
|
-
return le(N(
|
1349
|
+
return le(N(Z));
|
1346
1350
|
} catch {
|
1347
1351
|
return null;
|
1348
1352
|
}
|
@@ -1350,18 +1354,18 @@ function Xa() {
|
|
1350
1354
|
}
|
1351
1355
|
return null;
|
1352
1356
|
}
|
1353
|
-
var Q = Object.assign,
|
1354
|
-
function
|
1357
|
+
var Q = Object.assign, G = 0, Ue, ce, be, te, je, Ne, Fe;
|
1358
|
+
function V() {
|
1355
1359
|
}
|
1356
|
-
|
1360
|
+
V.__reactDisabledLog = !0;
|
1357
1361
|
function re() {
|
1358
1362
|
{
|
1359
|
-
if (
|
1363
|
+
if (G === 0) {
|
1360
1364
|
Ue = console.log, ce = console.info, be = console.warn, te = console.error, je = console.group, Ne = console.groupCollapsed, Fe = console.groupEnd;
|
1361
1365
|
var h = {
|
1362
1366
|
configurable: !0,
|
1363
1367
|
enumerable: !0,
|
1364
|
-
value:
|
1368
|
+
value: V,
|
1365
1369
|
writable: !0
|
1366
1370
|
};
|
1367
1371
|
Object.defineProperties(console, {
|
@@ -1374,12 +1378,12 @@ function Xa() {
|
|
1374
1378
|
groupEnd: h
|
1375
1379
|
});
|
1376
1380
|
}
|
1377
|
-
|
1381
|
+
G++;
|
1378
1382
|
}
|
1379
1383
|
}
|
1380
1384
|
function Oe() {
|
1381
1385
|
{
|
1382
|
-
if (
|
1386
|
+
if (G--, G === 0) {
|
1383
1387
|
var h = {
|
1384
1388
|
configurable: !0,
|
1385
1389
|
enumerable: !0,
|
@@ -1409,7 +1413,7 @@ function Xa() {
|
|
1409
1413
|
})
|
1410
1414
|
});
|
1411
1415
|
}
|
1412
|
-
|
1416
|
+
G < 0 && v("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
1413
1417
|
}
|
1414
1418
|
}
|
1415
1419
|
var vt = f.ReactCurrentDispatcher, it;
|
@@ -1443,8 +1447,8 @@ function Xa() {
|
|
1443
1447
|
ci = !0;
|
1444
1448
|
var z = Error.prepareStackTrace;
|
1445
1449
|
Error.prepareStackTrace = void 0;
|
1446
|
-
var
|
1447
|
-
|
1450
|
+
var Z;
|
1451
|
+
Z = vt.current, vt.current = null, re();
|
1448
1452
|
try {
|
1449
1453
|
if (y) {
|
1450
1454
|
var N = function() {
|
@@ -1497,7 +1501,7 @@ function Xa() {
|
|
1497
1501
|
}
|
1498
1502
|
}
|
1499
1503
|
} finally {
|
1500
|
-
ci = !1, vt.current =
|
1504
|
+
ci = !1, vt.current = Z, Oe(), Error.prepareStackTrace = z;
|
1501
1505
|
}
|
1502
1506
|
var nt = h ? h.displayName || h.name : "", ts = nt ? Nt(nt) : "";
|
1503
1507
|
return typeof h == "function" && Ft.set(h, ts), ts;
|
@@ -1529,9 +1533,9 @@ function Xa() {
|
|
1529
1533
|
case p:
|
1530
1534
|
return zt(h.type, y, x);
|
1531
1535
|
case m: {
|
1532
|
-
var L = h, z = L._payload,
|
1536
|
+
var L = h, z = L._payload, Z = L._init;
|
1533
1537
|
try {
|
1534
|
-
return zt(
|
1538
|
+
return zt(Z(z), y, x);
|
1535
1539
|
} catch {
|
1536
1540
|
}
|
1537
1541
|
}
|
@@ -1548,9 +1552,9 @@ function Xa() {
|
|
1548
1552
|
}
|
1549
1553
|
function Sn(h, y, x, L, z) {
|
1550
1554
|
{
|
1551
|
-
var
|
1555
|
+
var Z = Function.call.bind(Ht);
|
1552
1556
|
for (var N in h)
|
1553
|
-
if (
|
1557
|
+
if (Z(h, N)) {
|
1554
1558
|
var j = void 0;
|
1555
1559
|
try {
|
1556
1560
|
if (typeof h[N] != "function") {
|
@@ -1640,7 +1644,7 @@ function Xa() {
|
|
1640
1644
|
});
|
1641
1645
|
}
|
1642
1646
|
}
|
1643
|
-
var In = function(h, y, x, L, z,
|
1647
|
+
var In = function(h, y, x, L, z, Z, N) {
|
1644
1648
|
var j = {
|
1645
1649
|
// This tag allows us to uniquely identify this as a React Element
|
1646
1650
|
$$typeof: e,
|
@@ -1650,7 +1654,7 @@ function Xa() {
|
|
1650
1654
|
ref: x,
|
1651
1655
|
props: N,
|
1652
1656
|
// Record the component responsible for creating this element.
|
1653
|
-
_owner:
|
1657
|
+
_owner: Z
|
1654
1658
|
};
|
1655
1659
|
return j._store = {}, Object.defineProperty(j._store, "validated", {
|
1656
1660
|
configurable: !1,
|
@@ -1671,14 +1675,14 @@ function Xa() {
|
|
1671
1675
|
};
|
1672
1676
|
function Ln(h, y, x, L, z) {
|
1673
1677
|
{
|
1674
|
-
var
|
1678
|
+
var Z, N = {}, j = null, fe = null;
|
1675
1679
|
x !== void 0 && (Wi(x), j = "" + x), An(y) && (Wi(y.key), j = "" + y.key), Mn(y) && (fe = y.ref, Pn(y, z));
|
1676
|
-
for (
|
1677
|
-
Ht.call(y,
|
1680
|
+
for (Z in y)
|
1681
|
+
Ht.call(y, Z) && !Tn.hasOwnProperty(Z) && (N[Z] = y[Z]);
|
1678
1682
|
if (h && h.defaultProps) {
|
1679
1683
|
var J = h.defaultProps;
|
1680
|
-
for (
|
1681
|
-
N[
|
1684
|
+
for (Z in J)
|
1685
|
+
N[Z] === void 0 && (N[Z] = J[Z]);
|
1682
1686
|
}
|
1683
1687
|
if (j || fe) {
|
1684
1688
|
var ie = typeof h == "function" ? h.displayName || h.name || "Unknown" : h;
|
@@ -1761,9 +1765,9 @@ Check the top-level render call using <` + x + ">.");
|
|
1761
1765
|
else if (mi(h))
|
1762
1766
|
h._store && (h._store.validated = !0);
|
1763
1767
|
else if (h) {
|
1764
|
-
var z =
|
1768
|
+
var z = M(h);
|
1765
1769
|
if (typeof z == "function" && z !== h.entries)
|
1766
|
-
for (var
|
1770
|
+
for (var Z = z.call(h), N; !(N = Z.next()).done; )
|
1767
1771
|
mi(N.value) && Qi(N.value, y);
|
1768
1772
|
}
|
1769
1773
|
}
|
@@ -1805,7 +1809,7 @@ Check the top-level render call using <` + x + ">.");
|
|
1805
1809
|
h.ref !== null && (st(h), v("Invalid attribute `ref` supplied to `React.Fragment`."), st(null));
|
1806
1810
|
}
|
1807
1811
|
}
|
1808
|
-
function es(h, y, x, L, z,
|
1812
|
+
function es(h, y, x, L, z, Z) {
|
1809
1813
|
{
|
1810
1814
|
var N = me(h);
|
1811
1815
|
if (!N) {
|
@@ -1816,7 +1820,7 @@ Check the top-level render call using <` + x + ">.");
|
|
1816
1820
|
var J;
|
1817
1821
|
h === null ? J = "null" : hi(h) ? J = "array" : h !== void 0 && h.$$typeof === e ? (J = "<" + (le(h.type) || "Unknown") + " />", j = " Did you accidentally export a JSX literal instead of a component?") : J = 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", J, j);
|
1818
1822
|
}
|
1819
|
-
var ie = Ln(h, y, x, z,
|
1823
|
+
var ie = Ln(h, y, x, z, Z);
|
1820
1824
|
if (ie == null)
|
1821
1825
|
return ie;
|
1822
1826
|
if (N) {
|
@@ -1872,7 +1876,7 @@ function Ka(s) {
|
|
1872
1876
|
] }) }, s.title);
|
1873
1877
|
}
|
1874
1878
|
function Qa(s) {
|
1875
|
-
const [e, t] =
|
1879
|
+
const [e, t] = B(!1), [i, n] = B(s.options), r = (l) => {
|
1876
1880
|
s.onDragComplete(l), n(l);
|
1877
1881
|
}, a = (l) => {
|
1878
1882
|
const d = [...i];
|
@@ -1888,7 +1892,7 @@ function Qa(s) {
|
|
1888
1892
|
] });
|
1889
1893
|
}
|
1890
1894
|
function Ja(s) {
|
1891
|
-
const [e, t] =
|
1895
|
+
const [e, t] = B(!1), i = [];
|
1892
1896
|
s.options.map((r, a) => {
|
1893
1897
|
s.onSelect !== void 0 && (r.onSelect = s.onSelect), i.push(/* @__PURE__ */ u.jsx(er, { option: r }, a));
|
1894
1898
|
});
|
@@ -1913,7 +1917,7 @@ function Ja(s) {
|
|
1913
1917
|
);
|
1914
1918
|
}
|
1915
1919
|
function er(s) {
|
1916
|
-
const { option: e } = s, [t, i] =
|
1920
|
+
const { option: e } = s, [t, i] = B("");
|
1917
1921
|
let n;
|
1918
1922
|
switch (e.type) {
|
1919
1923
|
case "draggable":
|
@@ -1954,7 +1958,7 @@ function er(s) {
|
|
1954
1958
|
}
|
1955
1959
|
return /* @__PURE__ */ u.jsx("li", { className: t === e.title ? "selected" : "", children: n }, Ia());
|
1956
1960
|
}
|
1957
|
-
function
|
1961
|
+
function To(s, e, t) {
|
1958
1962
|
function i(r) {
|
1959
1963
|
switch (e.forEach((a) => {
|
1960
1964
|
a.callback(s, a.remote, r);
|
@@ -1978,7 +1982,7 @@ function Oo(s, e, t) {
|
|
1978
1982
|
};
|
1979
1983
|
}
|
1980
1984
|
function ni(s) {
|
1981
|
-
const [e, t] =
|
1985
|
+
const [e, t] = B(s.open !== void 0 ? s.open : !0), i = !e || s.children === void 0, n = () => {
|
1982
1986
|
D.dispatchEvent({ type: P.REMOVE_SCENE, value: s.scene });
|
1983
1987
|
};
|
1984
1988
|
return /* @__PURE__ */ u.jsxs("div", { className: `accordion ${i ? "hide" : ""}`, children: [
|
@@ -2011,7 +2015,7 @@ function ni(s) {
|
|
2011
2015
|
] });
|
2012
2016
|
}
|
2013
2017
|
function gn(s) {
|
2014
|
-
const e = ne(null), [t, i] =
|
2018
|
+
const e = ne(null), [t, i] = B(!1), n = s.child !== void 0 && s.child.children.length > 0, r = [];
|
2015
2019
|
return s.child !== void 0 && s.child.children.length > 0 && s.child.children.map((a, o) => {
|
2016
2020
|
r.push(/* @__PURE__ */ u.jsx(gn, { child: a, three: s.three }, o));
|
2017
2021
|
}), tt(() => {
|
@@ -2080,46 +2084,43 @@ function fs(s) {
|
|
2080
2084
|
}), /* @__PURE__ */ u.jsx("div", { className: `scene ${s.class !== void 0 ? s.class : ""}`, children: e });
|
2081
2085
|
}
|
2082
2086
|
function tr(s) {
|
2083
|
-
const [e, t] =
|
2087
|
+
const [e, t] = B(s.defaultValue);
|
2084
2088
|
return tt(() => {
|
2085
2089
|
let i = !1, n = -1, r = 0, a = s.defaultValue, o = !1;
|
2086
|
-
const c = (
|
2087
|
-
o =
|
2088
|
-
}, l = (
|
2089
|
-
i = !0, r = Number(s.input.current?.value), n =
|
2090
|
-
}, d = (
|
2090
|
+
const c = (g) => {
|
2091
|
+
o = g.ctrlKey;
|
2092
|
+
}, l = (g) => {
|
2093
|
+
i = !0, r = Number(s.input.current?.value), n = g.clientX, document.addEventListener("mouseup", p, !1), document.addEventListener("mousemove", d, !1), document.addEventListener("contextmenu", p, !1);
|
2094
|
+
}, d = (g) => {
|
2091
2095
|
if (!i)
|
2092
2096
|
return;
|
2093
|
-
const
|
2097
|
+
const S = s.step !== void 0 ? s.step : 1, T = (g.clientX - n) * S * (o ? 10 : 1);
|
2094
2098
|
a = Number((r + T).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);
|
2095
2099
|
}, p = () => {
|
2096
2100
|
i = !1, document.removeEventListener("mouseup", p), document.removeEventListener("mousemove", d), document.removeEventListener("contextmenu", p);
|
2097
|
-
}, m = (
|
2098
|
-
const
|
2099
|
-
t(
|
2100
|
-
}, _ = (E) => {
|
2101
|
-
const O = Number(E.target.value);
|
2102
|
-
s.onChange !== void 0 && s.onChange(O), t(O);
|
2101
|
+
}, m = (g) => {
|
2102
|
+
const S = Number(g.target.value);
|
2103
|
+
s.onChange !== void 0 && s.onChange(S), t(S);
|
2103
2104
|
};
|
2104
|
-
return s.
|
2105
|
-
s.
|
2105
|
+
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), () => {
|
2106
|
+
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);
|
2106
2107
|
};
|
2107
2108
|
}, []), e;
|
2108
2109
|
}
|
2109
2110
|
function Qe(s) {
|
2110
|
-
const e = ne(null), t = ne(null), i =
|
2111
|
+
const e = ne(null), t = ne(null), [i, n] = B(s.value);
|
2112
|
+
return tr({
|
2111
2113
|
label: s.labelRef,
|
2112
2114
|
input: e,
|
2113
2115
|
sliderRef: t,
|
2114
|
-
defaultValue:
|
2116
|
+
defaultValue: i,
|
2115
2117
|
min: s.min,
|
2116
2118
|
max: s.max,
|
2117
2119
|
step: s.step,
|
2118
|
-
onChange: (
|
2119
|
-
s.onChange !== void 0 && s.onChange(s.prop,
|
2120
|
+
onChange: (r) => {
|
2121
|
+
n(r), s.onChange !== void 0 && s.onChange(s.prop, r);
|
2120
2122
|
}
|
2121
|
-
})
|
2122
|
-
return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
2123
|
+
}), /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
2123
2124
|
s.type === "number" && /* @__PURE__ */ u.jsx(
|
2124
2125
|
"input",
|
2125
2126
|
{
|
@@ -2132,9 +2133,11 @@ function Qe(s) {
|
|
2132
2133
|
max: s.max,
|
2133
2134
|
step: s.step,
|
2134
2135
|
disabled: s.disabled,
|
2135
|
-
onChange: (
|
2136
|
-
|
2137
|
-
|
2136
|
+
onChange: (r) => {
|
2137
|
+
if (n(r.target.value), r.target.value.length === 0)
|
2138
|
+
return;
|
2139
|
+
const a = Number(r.target.value);
|
2140
|
+
isNaN(a) || s.onChange !== void 0 && s.onChange(s.prop, a);
|
2138
2141
|
}
|
2139
2142
|
}
|
2140
2143
|
),
|
@@ -2147,9 +2150,11 @@ function Qe(s) {
|
|
2147
2150
|
disabled: s.disabled,
|
2148
2151
|
ref: e,
|
2149
2152
|
className: "min",
|
2150
|
-
onChange: (
|
2151
|
-
|
2152
|
-
|
2153
|
+
onChange: (r) => {
|
2154
|
+
if (r.target.value.length === 0)
|
2155
|
+
return;
|
2156
|
+
const a = Number(r.target.value);
|
2157
|
+
isNaN(a) || s.onChange !== void 0 && s.onChange(s.prop, a);
|
2153
2158
|
}
|
2154
2159
|
}
|
2155
2160
|
),
|
@@ -2170,23 +2175,23 @@ function Qe(s) {
|
|
2170
2175
|
] });
|
2171
2176
|
}
|
2172
2177
|
function ir(s) {
|
2173
|
-
const e = ne(null), t = ne(null), i = ne(null), n = ne(null), r = ne(null), a = ne(null), [o, c] =
|
2178
|
+
const e = ne(null), t = ne(null), i = ne(null), n = ne(null), r = ne(null), a = ne(null), [o, c] = B(s.value), [l, d] = B({
|
2174
2179
|
min: Math.min(s.min, Math.min(s.value.x, s.value.y)),
|
2175
2180
|
max: Math.max(s.max, Math.max(s.value.x, s.value.y))
|
2176
|
-
}), [p, m] =
|
2177
|
-
function
|
2178
|
-
p || (window.addEventListener("mousemove",
|
2181
|
+
}), [p, m] = B(!1);
|
2182
|
+
function g() {
|
2183
|
+
p || (window.addEventListener("mousemove", T), window.addEventListener("mouseup", S), window.addEventListener("mouseup", S), m(!0));
|
2179
2184
|
}
|
2180
|
-
function
|
2181
|
-
window.removeEventListener("mousemove",
|
2185
|
+
function S() {
|
2186
|
+
window.removeEventListener("mousemove", T), window.removeEventListener("mouseup", S), m(!1);
|
2182
2187
|
}
|
2183
|
-
function
|
2184
|
-
const
|
2188
|
+
function T(b) {
|
2189
|
+
const C = r.current.getBoundingClientRect(), w = $e(0, 99, b.clientX - C.left) / 99, I = $e(0, 99, b.clientY - C.top) / 99, U = Me(Di(l.min, l.max, w), 3), K = Me(Di(l.min, l.max, I), 3);
|
2185
2190
|
s.onChange({ target: { value: { x: U, y: K } } }), c({ x: U, y: K });
|
2186
2191
|
}
|
2187
|
-
function
|
2188
|
-
let
|
2189
|
-
b.target === e.current ?
|
2192
|
+
function M(b) {
|
2193
|
+
let C = o.x, w = o.y;
|
2194
|
+
b.target === e.current ? C = Number(b.target.value) : w = Number(b.target.value), c({ x: C, y: w });
|
2190
2195
|
}
|
2191
2196
|
function f() {
|
2192
2197
|
const b = Number(i.current.value);
|
@@ -2197,10 +2202,10 @@ function ir(s) {
|
|
2197
2202
|
d({ min: l.min, max: b }), (o.x > b || o.y > b) && c({ x: $e(l.min, b, o.x), y: $e(l.min, b, o.y) });
|
2198
2203
|
}
|
2199
2204
|
tt(() => {
|
2200
|
-
const b =
|
2201
|
-
a.current.style.left = `${b * 100}%`, a.current.style.top = `${
|
2205
|
+
const b = ds(l.min, l.max, o.x), C = ds(l.min, l.max, o.y);
|
2206
|
+
a.current.style.left = `${b * 100}%`, a.current.style.top = `${C * 100}%`;
|
2202
2207
|
}, [l, o]);
|
2203
|
-
const
|
2208
|
+
const E = s.step !== void 0 ? s.step : 0.01;
|
2204
2209
|
return /* @__PURE__ */ u.jsxs("div", { className: "vector2", children: [
|
2205
2210
|
/* @__PURE__ */ u.jsxs("div", { className: "fields", children: [
|
2206
2211
|
/* @__PURE__ */ u.jsxs("div", { children: [
|
@@ -2213,8 +2218,8 @@ function ir(s) {
|
|
2213
2218
|
value: o.x,
|
2214
2219
|
min: l.min,
|
2215
2220
|
max: l.max,
|
2216
|
-
step:
|
2217
|
-
onChange:
|
2221
|
+
step: E,
|
2222
|
+
onChange: M
|
2218
2223
|
}
|
2219
2224
|
)
|
2220
2225
|
] }),
|
@@ -2228,8 +2233,8 @@ function ir(s) {
|
|
2228
2233
|
value: o.y,
|
2229
2234
|
min: l.min,
|
2230
2235
|
max: l.max,
|
2231
|
-
step:
|
2232
|
-
onChange:
|
2236
|
+
step: E,
|
2237
|
+
onChange: M
|
2233
2238
|
}
|
2234
2239
|
)
|
2235
2240
|
] }),
|
@@ -2241,7 +2246,7 @@ function ir(s) {
|
|
2241
2246
|
ref: i,
|
2242
2247
|
type: "number",
|
2243
2248
|
value: l.min,
|
2244
|
-
step:
|
2249
|
+
step: E,
|
2245
2250
|
onChange: f
|
2246
2251
|
}
|
2247
2252
|
)
|
@@ -2254,13 +2259,13 @@ function ir(s) {
|
|
2254
2259
|
ref: n,
|
2255
2260
|
type: "number",
|
2256
2261
|
value: l.max,
|
2257
|
-
step:
|
2262
|
+
step: E,
|
2258
2263
|
onChange: v
|
2259
2264
|
}
|
2260
2265
|
)
|
2261
2266
|
] })
|
2262
2267
|
] }),
|
2263
|
-
/* @__PURE__ */ u.jsxs("div", { className: "input", ref: r, onMouseDown:
|
2268
|
+
/* @__PURE__ */ u.jsxs("div", { className: "input", ref: r, onMouseDown: g, onMouseUp: S, children: [
|
2264
2269
|
/* @__PURE__ */ u.jsx("div", { className: "x" }),
|
2265
2270
|
/* @__PURE__ */ u.jsx("div", { className: "y" }),
|
2266
2271
|
/* @__PURE__ */ u.jsx("div", { className: "pt", ref: a })
|
@@ -2995,8 +3000,8 @@ function Rt(s, e, t, i, n = "", r = !1) {
|
|
2995
3000
|
i.updateObject(t.uuid, `material.${o}`, p);
|
2996
3001
|
const m = i.getScene(t.uuid);
|
2997
3002
|
if (m !== null) {
|
2998
|
-
const
|
2999
|
-
ee(
|
3003
|
+
const g = m.getObjectByProperty("uuid", t.uuid);
|
3004
|
+
ee(g, `material.${o}`, p);
|
3000
3005
|
}
|
3001
3006
|
}
|
3002
3007
|
};
|
@@ -3014,8 +3019,8 @@ function Rt(s, e, t, i, n = "", r = !1) {
|
|
3014
3019
|
i.updateObject(t.uuid, `material.${o}`, p);
|
3015
3020
|
const m = i.getScene(t.uuid);
|
3016
3021
|
if (m !== null) {
|
3017
|
-
const
|
3018
|
-
ee(
|
3022
|
+
const g = m.getObjectByProperty("uuid", t.uuid);
|
3023
|
+
ee(g, `material.${o}`, p);
|
3019
3024
|
}
|
3020
3025
|
}
|
3021
3026
|
};
|
@@ -3024,11 +3029,11 @@ function Rt(s, e, t, i, n = "", r = !1) {
|
|
3024
3029
|
for (const d in e) {
|
3025
3030
|
const p = e[d], m = `[${d.toString()}]`;
|
3026
3031
|
if (p.value !== void 0) {
|
3027
|
-
const
|
3028
|
-
|
3032
|
+
const g = Rt(`${m}.value`, p.value, t, i, o, r);
|
3033
|
+
g !== void 0 && l.push(g);
|
3029
3034
|
} else {
|
3030
|
-
const
|
3031
|
-
|
3035
|
+
const g = Rt(m, p, t, i, o, r);
|
3036
|
+
g !== void 0 && l.push(g);
|
3032
3037
|
}
|
3033
3038
|
}
|
3034
3039
|
if (l.length > 0)
|
@@ -3110,34 +3115,34 @@ function Rt(s, e, t, i, n = "", r = !1) {
|
|
3110
3115
|
onChange: (l, d) => {
|
3111
3116
|
const p = lr(s), m = n.length > 0 ? `${n}.${p}` : p;
|
3112
3117
|
i.createTexture(t.uuid, `material.${m}`, d);
|
3113
|
-
const
|
3114
|
-
if (
|
3115
|
-
const
|
3116
|
-
if (
|
3117
|
-
const
|
3118
|
-
const f =
|
3118
|
+
const g = i.getScene(t.uuid);
|
3119
|
+
if (g !== null) {
|
3120
|
+
const S = g.getObjectByProperty("uuid", t.uuid);
|
3121
|
+
if (S !== void 0) {
|
3122
|
+
const T = (M) => {
|
3123
|
+
const f = S.material, v = m.split(".");
|
3119
3124
|
switch (v.length) {
|
3120
3125
|
case 1:
|
3121
|
-
f[v[0]] =
|
3126
|
+
f[v[0]] = M;
|
3122
3127
|
break;
|
3123
3128
|
case 2:
|
3124
|
-
f[v[0]][v[1]] =
|
3129
|
+
f[v[0]][v[1]] = M;
|
3125
3130
|
break;
|
3126
3131
|
case 3:
|
3127
|
-
f[v[0]][v[1]][v[2]] =
|
3132
|
+
f[v[0]][v[1]][v[2]] = M;
|
3128
3133
|
break;
|
3129
3134
|
case 4:
|
3130
|
-
f[v[0]][v[1]][v[2]][v[3]] =
|
3135
|
+
f[v[0]][v[1]][v[2]][v[3]] = M;
|
3131
3136
|
break;
|
3132
3137
|
case 5:
|
3133
|
-
f[v[0]][v[1]][v[2]][v[3]][v[4]] =
|
3138
|
+
f[v[0]][v[1]][v[2]][v[3]][v[4]] = M;
|
3134
3139
|
break;
|
3135
3140
|
}
|
3136
3141
|
f.needsUpdate = !0;
|
3137
3142
|
};
|
3138
|
-
d.src.length > 0 ? mn(d.src).then((
|
3139
|
-
|
3140
|
-
}) :
|
3143
|
+
d.src.length > 0 ? mn(d.src).then((M) => {
|
3144
|
+
M.offset.set(d.offset[0], d.offset[1]), M.repeat.set(d.repeat[0], d.repeat[1]), T(M);
|
3145
|
+
}) : T(null);
|
3141
3146
|
}
|
3142
3147
|
}
|
3143
3148
|
}
|
@@ -3165,11 +3170,11 @@ function Rt(s, e, t, i, n = "", r = !1) {
|
|
3165
3170
|
const m = e[p];
|
3166
3171
|
if (m !== void 0)
|
3167
3172
|
if (m.value !== void 0) {
|
3168
|
-
const
|
3169
|
-
|
3173
|
+
const g = Rt(`${p}.value`, m.value, t, i, o, d);
|
3174
|
+
g !== void 0 && l.push(g);
|
3170
3175
|
} else {
|
3171
|
-
const
|
3172
|
-
|
3176
|
+
const g = Rt(p, m, t, i, o, d);
|
3177
|
+
g !== void 0 && l.push(g);
|
3173
3178
|
}
|
3174
3179
|
}
|
3175
3180
|
} catch {
|
@@ -3253,38 +3258,38 @@ function Er(s, e) {
|
|
3253
3258
|
}
|
3254
3259
|
const vs = "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==";
|
3255
3260
|
function Cr(s) {
|
3256
|
-
const e = s.step !== void 0 ? s.step : 0.01, t = ne(null), i = ne(null), n = ne(null), r = ne(null), a = ne(null), [o] =
|
3257
|
-
function
|
3261
|
+
const e = s.step !== void 0 ? s.step : 0.01, t = ne(null), i = ne(null), n = ne(null), r = ne(null), a = ne(null), [o] = B(s.value), [c, l] = B(s.value.offset[0]), [d, p] = B(s.value.offset[1]), [m, g] = B(s.value.repeat[0]), [S, T] = B(s.value.repeat[1]);
|
3262
|
+
function M(v, E, b, C, w) {
|
3258
3263
|
if (s.onChange !== void 0) {
|
3259
3264
|
const I = s.prop !== void 0 ? s.prop : s.title;
|
3260
3265
|
s.onChange(I, {
|
3261
3266
|
src: v,
|
3262
|
-
offset: [
|
3263
|
-
repeat: [
|
3267
|
+
offset: [E, b],
|
3268
|
+
repeat: [C, w]
|
3264
3269
|
});
|
3265
3270
|
}
|
3266
3271
|
}
|
3267
3272
|
function f(v) {
|
3268
|
-
const
|
3273
|
+
const E = t.current.src, b = v.target.value;
|
3269
3274
|
switch (v.target) {
|
3270
3275
|
case i.current:
|
3271
|
-
l(b),
|
3276
|
+
l(b), M(E, b, d, m, S);
|
3272
3277
|
break;
|
3273
3278
|
case n.current:
|
3274
|
-
p(b),
|
3279
|
+
p(b), M(E, c, b, m, S);
|
3275
3280
|
break;
|
3276
3281
|
case r.current:
|
3277
|
-
|
3282
|
+
g(b), M(E, c, d, b, S);
|
3278
3283
|
break;
|
3279
3284
|
case a.current:
|
3280
|
-
|
3285
|
+
T(b), M(E, c, d, m, b);
|
3281
3286
|
break;
|
3282
3287
|
}
|
3283
3288
|
}
|
3284
3289
|
return /* @__PURE__ */ u.jsxs("div", { className: "imageField", children: [
|
3285
3290
|
/* @__PURE__ */ u.jsx("img", { alt: s.title, ref: t, onClick: () => {
|
3286
3291
|
cr().then((v) => {
|
3287
|
-
t.current.src = v,
|
3292
|
+
t.current.src = v, M(v, c, d, m, S);
|
3288
3293
|
});
|
3289
3294
|
}, src: o.src.length > 0 ? o.src : vs }),
|
3290
3295
|
/* @__PURE__ */ u.jsxs("div", { className: "fields", children: [
|
@@ -3328,14 +3333,14 @@ function Cr(s) {
|
|
3328
3333
|
{
|
3329
3334
|
ref: a,
|
3330
3335
|
type: "number",
|
3331
|
-
value:
|
3336
|
+
value: S,
|
3332
3337
|
step: e,
|
3333
3338
|
onChange: f
|
3334
3339
|
}
|
3335
3340
|
)
|
3336
3341
|
] }),
|
3337
3342
|
/* @__PURE__ */ u.jsx("button", { onClick: () => {
|
3338
|
-
|
3343
|
+
M("", c, d, m, S), t.current.src = vs;
|
3339
3344
|
}, children: "Clear" })
|
3340
3345
|
] })
|
3341
3346
|
] });
|
@@ -3343,7 +3348,7 @@ function Cr(s) {
|
|
3343
3348
|
function ei(s) {
|
3344
3349
|
let e = s.value;
|
3345
3350
|
e !== void 0 && (e.isColor !== void 0 ? e = os(s.value) : s.type === "color" && (e = os(new et().setStyle(s.value, Ut))));
|
3346
|
-
const [t, i] =
|
3351
|
+
const [t, i] = B(e), n = ne(null), r = (l) => {
|
3347
3352
|
let d = l.target.value;
|
3348
3353
|
if (s.type === "boolean")
|
3349
3354
|
d = l.target.checked;
|
@@ -3719,7 +3724,7 @@ class xr extends Ie {
|
|
3719
3724
|
const r = new Fi({ fog: !1 });
|
3720
3725
|
super(n, r), this.light = e, this.color = t, this.type = "RectAreaLightHelper";
|
3721
3726
|
const a = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0], o = new gt();
|
3722
|
-
o.setAttribute("position", new Ke(a, 3)), o.computeBoundingSphere(), this.add(new
|
3727
|
+
o.setAttribute("position", new Ke(a, 3)), o.computeBoundingSphere(), this.add(new O(o, new Je({ side: Bs, fog: !1 })));
|
3723
3728
|
}
|
3724
3729
|
updateMatrixWorld() {
|
3725
3730
|
if (this.scale.set(0.5 * this.light.width, 0.5 * this.light.height, 1), this.color !== void 0)
|
@@ -4180,7 +4185,7 @@ const q = {
|
|
4180
4185
|
LEFT: 1,
|
4181
4186
|
RIGHT: 2,
|
4182
4187
|
MIDDLE: 4
|
4183
|
-
},
|
4188
|
+
}, _ = Object.freeze({
|
4184
4189
|
NONE: 0,
|
4185
4190
|
ROTATE: 1,
|
4186
4191
|
TRUCK: 2,
|
@@ -4213,11 +4218,11 @@ const ct = Math.PI * 2, Cs = Math.PI / 2, yn = 1e-5, xt = Math.PI / 180;
|
|
4213
4218
|
function Te(s, e, t) {
|
4214
4219
|
return Math.max(e, Math.min(t, s));
|
4215
4220
|
}
|
4216
|
-
function
|
4221
|
+
function X(s, e = yn) {
|
4217
4222
|
return Math.abs(s) < e;
|
4218
4223
|
}
|
4219
4224
|
function H(s, e, t = yn) {
|
4220
|
-
return
|
4225
|
+
return X(s - e, t);
|
4221
4226
|
}
|
4222
4227
|
function Ss(s, e) {
|
4223
4228
|
return Math.round(s / e) * e;
|
@@ -4236,23 +4241,23 @@ function Zt(s, e, t, i, n = 1 / 0, r) {
|
|
4236
4241
|
l = Te(l, -p, p), e = s - l;
|
4237
4242
|
const m = (t.value + a * l) * r;
|
4238
4243
|
t.value = (t.value - a * m) * c;
|
4239
|
-
let
|
4240
|
-
return d - s > 0 ==
|
4244
|
+
let g = e + (l + m) * c;
|
4245
|
+
return d - s > 0 == g > d && (g = d, t.value = (g - d) / r), g;
|
4241
4246
|
}
|
4242
4247
|
function ws(s, e, t, i, n = 1 / 0, r, a) {
|
4243
4248
|
i = Math.max(1e-4, i);
|
4244
4249
|
const o = 2 / i, c = o * r, l = 1 / (1 + c + 0.48 * c * c + 0.235 * c * c * c);
|
4245
|
-
let d = e.x, p = e.y, m = e.z,
|
4246
|
-
const
|
4247
|
-
if (
|
4248
|
-
const
|
4249
|
-
|
4250
|
-
}
|
4251
|
-
d = s.x -
|
4252
|
-
const w = (t.x + o *
|
4253
|
-
t.x = (t.x - o * w) * l, t.y = (t.y - o * I) * l, t.z = (t.z - o * U) * l, a.x = d + (
|
4254
|
-
const K =
|
4255
|
-
return K * Ce + me * le + Ae * Q > 0 && (a.x =
|
4250
|
+
let d = e.x, p = e.y, m = e.z, g = s.x - d, S = s.y - p, T = s.z - m;
|
4251
|
+
const M = d, f = p, v = m, E = n * i, b = E * E, C = g * g + S * S + T * T;
|
4252
|
+
if (C > b) {
|
4253
|
+
const G = Math.sqrt(C);
|
4254
|
+
g = g / G * E, S = S / G * E, T = T / G * E;
|
4255
|
+
}
|
4256
|
+
d = s.x - g, p = s.y - S, m = s.z - T;
|
4257
|
+
const w = (t.x + o * g) * r, I = (t.y + o * S) * r, U = (t.z + o * T) * r;
|
4258
|
+
t.x = (t.x - o * w) * l, t.y = (t.y - o * I) * l, t.z = (t.z - o * U) * l, a.x = d + (g + w) * l, a.y = p + (S + I) * l, a.z = m + (T + U) * l;
|
4259
|
+
const K = M - s.x, me = f - s.y, Ae = v - s.z, Ce = a.x - M, le = a.y - f, Q = a.z - v;
|
4260
|
+
return K * Ce + me * le + Ae * Q > 0 && (a.x = M, a.y = f, a.z = v, t.x = (a.x - M) / r, t.y = (a.y - f) / r, t.z = (a.z - v) / r), a;
|
4256
4261
|
}
|
4257
4262
|
function yi(s, e) {
|
4258
4263
|
e.set(0, 0), s.forEach((t) => {
|
@@ -4378,7 +4383,7 @@ class ke extends zr {
|
|
4378
4383
|
* @category Statics
|
4379
4384
|
*/
|
4380
4385
|
static get ACTION() {
|
4381
|
-
return
|
4386
|
+
return _;
|
4382
4387
|
}
|
4383
4388
|
/**
|
4384
4389
|
* Creates a `CameraControls` instance.
|
@@ -4399,47 +4404,47 @@ class ke extends zr {
|
|
4399
4404
|
*/
|
4400
4405
|
constructor(e, t) {
|
4401
4406
|
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 = () => {
|
4402
|
-
}, this._enabled = !0, this._state =
|
4403
|
-
let b,
|
4407
|
+
}, 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 = lt.NONE, this._thetaVelocity = { value: 0 }, this._phiVelocity = { value: 0 }, this._radiusVelocity = { value: 0 }, this._targetVelocity = new R.Vector3(), this._focalOffsetVelocity = new R.Vector3(), this._zoomVelocity = { value: 0 }, this._truckInternal = (f, v, E) => {
|
4408
|
+
let b, C;
|
4404
4409
|
if (Ze(this._camera)) {
|
4405
4410
|
const w = k.copy(this._camera.position).sub(this._target), I = this._camera.getEffectiveFOV() * xt, U = w.length() * Math.tan(I * 0.5);
|
4406
|
-
b = this.truckSpeed * f * U / this._elementRect.height,
|
4411
|
+
b = this.truckSpeed * f * U / this._elementRect.height, C = this.truckSpeed * v * U / this._elementRect.height;
|
4407
4412
|
} else if (Be(this._camera)) {
|
4408
4413
|
const w = this._camera;
|
4409
|
-
b = f * (w.right - w.left) / w.zoom / this._elementRect.width,
|
4414
|
+
b = f * (w.right - w.left) / w.zoom / this._elementRect.width, C = v * (w.top - w.bottom) / w.zoom / this._elementRect.height;
|
4410
4415
|
} else
|
4411
4416
|
return;
|
4412
|
-
this.verticalDragToForward ? (
|
4417
|
+
this.verticalDragToForward ? (E ? this.setFocalOffset(this._focalOffsetEnd.x + b, this._focalOffsetEnd.y, this._focalOffsetEnd.z, !0) : this.truck(b, 0, !0), this.forward(-C, !0)) : E ? this.setFocalOffset(this._focalOffsetEnd.x + b, this._focalOffsetEnd.y + C, this._focalOffsetEnd.z, !0) : this.truck(b, C, !0);
|
4413
4418
|
}, this._rotateInternal = (f, v) => {
|
4414
|
-
const
|
4415
|
-
this.rotate(
|
4416
|
-
}, this._dollyInternal = (f, v,
|
4417
|
-
const b = Math.pow(0.95, -f * this.dollySpeed),
|
4418
|
-
this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(w, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(U, !0), this._dollyToNoClamp(I, !0)) : this._dollyToNoClamp(I, !0), this.dollyToCursor && (this._changedDolly += (this.infinityDolly ? w : I) -
|
4419
|
-
}, this._zoomInternal = (f, v,
|
4420
|
-
const b = Math.pow(0.95, f * this.dollySpeed),
|
4421
|
-
this.zoomTo(w, !0), this.dollyToCursor && (this._changedZoom += w -
|
4422
|
-
}, typeof R > "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 R.Quaternion().setFromUnitVectors(this._camera.up, Gt), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state =
|
4419
|
+
const E = ct * this.azimuthRotateSpeed * f / this._elementRect.height, b = ct * this.polarRotateSpeed * v / this._elementRect.height;
|
4420
|
+
this.rotate(E, b, !0);
|
4421
|
+
}, this._dollyInternal = (f, v, E) => {
|
4422
|
+
const b = Math.pow(0.95, -f * this.dollySpeed), C = this._sphericalEnd.radius, w = this._sphericalEnd.radius * b, I = Te(w, this.minDistance, this.maxDistance), U = I - w;
|
4423
|
+
this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(w, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(U, !0), this._dollyToNoClamp(I, !0)) : this._dollyToNoClamp(I, !0), this.dollyToCursor && (this._changedDolly += (this.infinityDolly ? w : I) - C, this._dollyControlCoord.set(v, E)), this._lastDollyDirection = Math.sign(-f);
|
4424
|
+
}, this._zoomInternal = (f, v, E) => {
|
4425
|
+
const b = Math.pow(0.95, f * this.dollySpeed), C = this._zoom, w = this._zoom * b;
|
4426
|
+
this.zoomTo(w, !0), this.dollyToCursor && (this._changedZoom += w - C, this._dollyControlCoord.set(v, E));
|
4427
|
+
}, typeof R > "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 R.Quaternion().setFromUnitVectors(this._camera.up, Gt), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state = _.NONE, this._target = new R.Vector3(), this._targetEnd = this._target.clone(), this._focalOffset = new R.Vector3(), this._focalOffsetEnd = this._focalOffset.clone(), this._spherical = new R.Spherical().setFromVector3(k.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 = [
|
4423
4428
|
new R.Vector3(),
|
4424
4429
|
new R.Vector3(),
|
4425
4430
|
new R.Vector3(),
|
4426
4431
|
new R.Vector3()
|
4427
4432
|
], this._updateNearPlaneCorners(), this._boundary = new R.Box3(new R.Vector3(-1 / 0, -1 / 0, -1 / 0), new R.Vector3(1 / 0, 1 / 0, 1 / 0)), this._cameraUp0 = this._camera.up.clone(), this._target0 = this._target.clone(), this._position0 = this._camera.position.clone(), this._zoom0 = this._zoom, this._focalOffset0 = this._focalOffset.clone(), this._dollyControlCoord = new R.Vector2(), this.mouseButtons = {
|
4428
|
-
left:
|
4429
|
-
middle:
|
4430
|
-
right:
|
4431
|
-
wheel: Ze(this._camera) ?
|
4433
|
+
left: _.ROTATE,
|
4434
|
+
middle: _.DOLLY,
|
4435
|
+
right: _.TRUCK,
|
4436
|
+
wheel: Ze(this._camera) ? _.DOLLY : Be(this._camera) ? _.ZOOM : _.NONE
|
4432
4437
|
}, this.touches = {
|
4433
|
-
one:
|
4434
|
-
two: Ze(this._camera) ?
|
4435
|
-
three:
|
4438
|
+
one: _.TOUCH_ROTATE,
|
4439
|
+
two: Ze(this._camera) ? _.TOUCH_DOLLY_TRUCK : Be(this._camera) ? _.TOUCH_ZOOM_TRUCK : _.NONE,
|
4440
|
+
three: _.TOUCH_TRUCK
|
4436
4441
|
};
|
4437
4442
|
const i = new R.Vector2(), n = new R.Vector2(), r = new R.Vector2(), a = (f) => {
|
4438
4443
|
if (!this._enabled || !this._domElement)
|
4439
4444
|
return;
|
4440
4445
|
if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
|
4441
|
-
const b = this._domElement.getBoundingClientRect(),
|
4442
|
-
if (
|
4446
|
+
const b = this._domElement.getBoundingClientRect(), C = f.clientX / b.width, w = f.clientY / b.height;
|
4447
|
+
if (C < this._interactiveArea.left || C > this._interactiveArea.right || w < this._interactiveArea.top || w > this._interactiveArea.bottom)
|
4443
4448
|
return;
|
4444
4449
|
}
|
4445
4450
|
const v = f.pointerType !== "mouse" ? null : (f.buttons & q.LEFT) === q.LEFT ? q.LEFT : (f.buttons & q.MIDDLE) === q.MIDDLE ? q.MIDDLE : (f.buttons & q.RIGHT) === q.RIGHT ? q.RIGHT : null;
|
@@ -4449,7 +4454,7 @@ class ke extends zr {
|
|
4449
4454
|
}
|
4450
4455
|
if ((f.buttons & q.LEFT) === q.LEFT && this._lockedPointer)
|
4451
4456
|
return;
|
4452
|
-
const
|
4457
|
+
const E = {
|
4453
4458
|
pointerId: f.pointerId,
|
4454
4459
|
clientX: f.clientX,
|
4455
4460
|
clientY: f.clientY,
|
@@ -4457,12 +4462,12 @@ class ke extends zr {
|
|
4457
4462
|
deltaY: 0,
|
4458
4463
|
mouseButton: v
|
4459
4464
|
};
|
4460
|
-
this._activePointers.push(
|
4465
|
+
this._activePointers.push(E), this._domElement.ownerDocument.removeEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c), this._domElement.ownerDocument.addEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.addEventListener("pointerup", c), this._isDragging = !0, m(f);
|
4461
4466
|
}, o = (f) => {
|
4462
4467
|
f.cancelable && f.preventDefault();
|
4463
|
-
const v = f.pointerId,
|
4464
|
-
if (
|
4465
|
-
if (
|
4468
|
+
const v = f.pointerId, E = this._lockedPointer || this._findPointerById(v);
|
4469
|
+
if (E) {
|
4470
|
+
if (E.clientX = f.clientX, E.clientY = f.clientY, E.deltaX = f.movementX, E.deltaY = f.movementY, this._state = 0, f.pointerType === "touch")
|
4466
4471
|
switch (this._activePointers.length) {
|
4467
4472
|
case 1:
|
4468
4473
|
this._state = this.touches.one;
|
@@ -4476,7 +4481,7 @@ class ke extends zr {
|
|
4476
4481
|
}
|
4477
4482
|
else
|
4478
4483
|
(!this._isDragging && this._lockedPointer || this._isDragging && (f.buttons & q.LEFT) === q.LEFT) && (this._state = this._state | this.mouseButtons.left), this._isDragging && (f.buttons & q.MIDDLE) === q.MIDDLE && (this._state = this._state | this.mouseButtons.middle), this._isDragging && (f.buttons & q.RIGHT) === q.RIGHT && (this._state = this._state | this.mouseButtons.right);
|
4479
|
-
|
4484
|
+
g();
|
4480
4485
|
}
|
4481
4486
|
}, c = (f) => {
|
4482
4487
|
const v = this._findPointerById(f.pointerId);
|
@@ -4484,7 +4489,7 @@ class ke extends zr {
|
|
4484
4489
|
if (v && this._disposePointer(v), f.pointerType === "touch")
|
4485
4490
|
switch (this._activePointers.length) {
|
4486
4491
|
case 0:
|
4487
|
-
this._state =
|
4492
|
+
this._state = _.NONE;
|
4488
4493
|
break;
|
4489
4494
|
case 1:
|
4490
4495
|
this._state = this.touches.one;
|
@@ -4497,43 +4502,43 @@ class ke extends zr {
|
|
4497
4502
|
break;
|
4498
4503
|
}
|
4499
4504
|
else
|
4500
|
-
this._state =
|
4501
|
-
|
4505
|
+
this._state = _.NONE;
|
4506
|
+
S();
|
4502
4507
|
}
|
4503
4508
|
};
|
4504
4509
|
let l = -1;
|
4505
4510
|
const d = (f) => {
|
4506
|
-
if (!this._domElement || !this._enabled || this.mouseButtons.wheel ===
|
4511
|
+
if (!this._domElement || !this._enabled || this.mouseButtons.wheel === _.NONE)
|
4507
4512
|
return;
|
4508
4513
|
if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
|
4509
4514
|
const w = this._domElement.getBoundingClientRect(), I = f.clientX / w.width, U = f.clientY / w.height;
|
4510
4515
|
if (I < this._interactiveArea.left || I > this._interactiveArea.right || U < this._interactiveArea.top || U > this._interactiveArea.bottom)
|
4511
4516
|
return;
|
4512
4517
|
}
|
4513
|
-
if (f.preventDefault(), this.dollyToCursor || this.mouseButtons.wheel ===
|
4518
|
+
if (f.preventDefault(), this.dollyToCursor || this.mouseButtons.wheel === _.ROTATE || this.mouseButtons.wheel === _.TRUCK) {
|
4514
4519
|
const w = performance.now();
|
4515
4520
|
l - w < 1e3 && this._getClientRect(this._elementRect), l = w;
|
4516
4521
|
}
|
4517
|
-
const v = Yr ? -1 : -3,
|
4522
|
+
const v = Yr ? -1 : -3, E = f.deltaMode === 1 ? f.deltaY / v : f.deltaY / (v * 10), b = this.dollyToCursor ? (f.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, C = this.dollyToCursor ? (f.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
4518
4523
|
switch (this.mouseButtons.wheel) {
|
4519
|
-
case
|
4524
|
+
case _.ROTATE: {
|
4520
4525
|
this._rotateInternal(f.deltaX, f.deltaY), this._isUserControllingRotate = !0;
|
4521
4526
|
break;
|
4522
4527
|
}
|
4523
|
-
case
|
4528
|
+
case _.TRUCK: {
|
4524
4529
|
this._truckInternal(f.deltaX, f.deltaY, !1), this._isUserControllingTruck = !0;
|
4525
4530
|
break;
|
4526
4531
|
}
|
4527
|
-
case
|
4532
|
+
case _.OFFSET: {
|
4528
4533
|
this._truckInternal(f.deltaX, f.deltaY, !0), this._isUserControllingOffset = !0;
|
4529
4534
|
break;
|
4530
4535
|
}
|
4531
|
-
case
|
4532
|
-
this._dollyInternal(-
|
4536
|
+
case _.DOLLY: {
|
4537
|
+
this._dollyInternal(-E, b, C), this._isUserControllingDolly = !0;
|
4533
4538
|
break;
|
4534
4539
|
}
|
4535
|
-
case
|
4536
|
-
this._zoomInternal(-
|
4540
|
+
case _.ZOOM: {
|
4541
|
+
this._zoomInternal(-E, b, C), this._isUserControllingZoom = !0;
|
4537
4542
|
break;
|
4538
4543
|
}
|
4539
4544
|
}
|
@@ -4541,8 +4546,8 @@ class ke extends zr {
|
|
4541
4546
|
}, p = (f) => {
|
4542
4547
|
if (!(!this._domElement || !this._enabled)) {
|
4543
4548
|
if (this.mouseButtons.right === ke.ACTION.NONE) {
|
4544
|
-
const v = f instanceof PointerEvent ? f.pointerId : 0,
|
4545
|
-
|
4549
|
+
const v = f instanceof PointerEvent ? f.pointerId : 0, E = this._findPointerById(v);
|
4550
|
+
E && this._disposePointer(E), this._domElement.ownerDocument.removeEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c);
|
4546
4551
|
return;
|
4547
4552
|
}
|
4548
4553
|
f.preventDefault();
|
@@ -4551,8 +4556,8 @@ class ke extends zr {
|
|
4551
4556
|
if (!this._enabled)
|
4552
4557
|
return;
|
4553
4558
|
if (yi(this._activePointers, ye), this._getClientRect(this._elementRect), i.copy(ye), n.copy(ye), this._activePointers.length >= 2) {
|
4554
|
-
const
|
4555
|
-
r.set(0,
|
4559
|
+
const E = ye.x - this._activePointers[1].clientX, b = ye.y - this._activePointers[1].clientY, C = Math.sqrt(E * E + b * b);
|
4560
|
+
r.set(0, C);
|
4556
4561
|
const w = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, I = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
|
4557
4562
|
n.set(w, I);
|
4558
4563
|
}
|
@@ -4572,24 +4577,24 @@ class ke extends zr {
|
|
4572
4577
|
}
|
4573
4578
|
else
|
4574
4579
|
!this._lockedPointer && (f.buttons & q.LEFT) === q.LEFT && (this._state = this._state | this.mouseButtons.left), (f.buttons & q.MIDDLE) === q.MIDDLE && (this._state = this._state | this.mouseButtons.middle), (f.buttons & q.RIGHT) === q.RIGHT && (this._state = this._state | this.mouseButtons.right);
|
4575
|
-
((this._state &
|
4576
|
-
},
|
4580
|
+
((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._sphericalEnd.theta = this._spherical.theta, this._sphericalEnd.phi = this._spherical.phi, this._thetaVelocity.value = 0, this._phiVelocity.value = 0), ((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._targetEnd.copy(this._target), this._targetVelocity.set(0, 0, 0)), ((this._state & _.DOLLY) === _.DOLLY || (this._state & _.TOUCH_DOLLY) === _.TOUCH_DOLLY || (this._state & _.TOUCH_DOLLY_TRUCK) === _.TOUCH_DOLLY_TRUCK || (this._state & _.TOUCH_DOLLY_OFFSET) === _.TOUCH_DOLLY_OFFSET || (this._state & _.TOUCH_DOLLY_ROTATE) === _.TOUCH_DOLLY_ROTATE) && (this._sphericalEnd.radius = this._spherical.radius, this._radiusVelocity.value = 0), ((this._state & _.ZOOM) === _.ZOOM || (this._state & _.TOUCH_ZOOM) === _.TOUCH_ZOOM || (this._state & _.TOUCH_ZOOM_TRUCK) === _.TOUCH_ZOOM_TRUCK || (this._state & _.TOUCH_ZOOM_OFFSET) === _.TOUCH_ZOOM_OFFSET || (this._state & _.TOUCH_ZOOM_ROTATE) === _.TOUCH_ZOOM_ROTATE) && (this._zoomEnd = this._zoom, this._zoomVelocity.value = 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._focalOffsetEnd.copy(this._focalOffset), this._focalOffsetVelocity.set(0, 0, 0)), this.dispatchEvent({ type: "controlstart" });
|
4581
|
+
}, g = () => {
|
4577
4582
|
if (!this._enabled || !this._dragNeedsUpdate)
|
4578
4583
|
return;
|
4579
4584
|
this._dragNeedsUpdate = !1, yi(this._activePointers, ye);
|
4580
|
-
const v = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null,
|
4581
|
-
if (n.copy(ye), ((this._state &
|
4582
|
-
const
|
4583
|
-
(this._state &
|
4585
|
+
const v = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, E = v ? -v.deltaX : n.x - ye.x, b = v ? -v.deltaY : n.y - ye.y;
|
4586
|
+
if (n.copy(ye), ((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(E, b), this._isUserControllingRotate = !0), (this._state & _.DOLLY) === _.DOLLY || (this._state & _.ZOOM) === _.ZOOM) {
|
4587
|
+
const C = this.dollyToCursor ? (i.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, w = this.dollyToCursor ? (i.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0, I = this.dollyDragInverted ? -1 : 1;
|
4588
|
+
(this._state & _.DOLLY) === _.DOLLY ? (this._dollyInternal(I * b * Wt, C, w), this._isUserControllingDolly = !0) : (this._zoomInternal(I * b * Wt, C, w), this._isUserControllingZoom = !0);
|
4584
4589
|
}
|
4585
|
-
if ((this._state &
|
4586
|
-
const
|
4590
|
+
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) {
|
4591
|
+
const C = ye.x - this._activePointers[1].clientX, w = ye.y - this._activePointers[1].clientY, I = Math.sqrt(C * C + w * w), U = r.y - I;
|
4587
4592
|
r.set(0, I);
|
4588
4593
|
const K = this.dollyToCursor ? (n.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, me = this.dollyToCursor ? (n.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
4589
|
-
(this._state &
|
4594
|
+
(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(U * Wt, K, me), this._isUserControllingDolly = !0) : (this._zoomInternal(U * Wt, K, me), this._isUserControllingZoom = !0);
|
4590
4595
|
}
|
4591
|
-
((this._state &
|
4592
|
-
},
|
4596
|
+
((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(E, b, !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(E, b, !0), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
|
4597
|
+
}, S = () => {
|
4593
4598
|
yi(this._activePointers, ye), n.copy(ye), 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" }));
|
4594
4599
|
};
|
4595
4600
|
this.lockPointer = () => {
|
@@ -4600,22 +4605,22 @@ class ke extends zr {
|
|
4600
4605
|
deltaX: 0,
|
4601
4606
|
deltaY: 0,
|
4602
4607
|
mouseButton: null
|
4603
|
-
}, this._activePointers.push(this._lockedPointer), this._domElement.ownerDocument.removeEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c), this._domElement.requestPointerLock(), this._domElement.ownerDocument.addEventListener("pointerlockchange",
|
4608
|
+
}, this._activePointers.push(this._lockedPointer), this._domElement.ownerDocument.removeEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c), this._domElement.requestPointerLock(), this._domElement.ownerDocument.addEventListener("pointerlockchange", T), this._domElement.ownerDocument.addEventListener("pointerlockerror", M), this._domElement.ownerDocument.addEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.addEventListener("pointerup", c), m());
|
4604
4609
|
}, this.unlockPointer = () => {
|
4605
|
-
var f, v,
|
4606
|
-
this._lockedPointer !== null && (this._disposePointer(this._lockedPointer), this._lockedPointer = null), (f = this._domElement) === null || f === void 0 || f.ownerDocument.exitPointerLock(), (v = this._domElement) === null || v === void 0 || v.ownerDocument.removeEventListener("pointerlockchange",
|
4610
|
+
var f, v, E;
|
4611
|
+
this._lockedPointer !== null && (this._disposePointer(this._lockedPointer), this._lockedPointer = null), (f = this._domElement) === null || f === void 0 || f.ownerDocument.exitPointerLock(), (v = this._domElement) === null || v === void 0 || v.ownerDocument.removeEventListener("pointerlockchange", T), (E = this._domElement) === null || E === void 0 || E.ownerDocument.removeEventListener("pointerlockerror", M), this.cancel();
|
4607
4612
|
};
|
4608
|
-
const
|
4613
|
+
const T = () => {
|
4609
4614
|
this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement || this.unlockPointer();
|
4610
|
-
},
|
4615
|
+
}, M = () => {
|
4611
4616
|
this.unlockPointer();
|
4612
4617
|
};
|
4613
4618
|
this._addAllEventListeners = (f) => {
|
4614
4619
|
this._domElement = f, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", a), this._domElement.addEventListener("pointercancel", c), this._domElement.addEventListener("wheel", d, { passive: !1 }), this._domElement.addEventListener("contextmenu", p);
|
4615
4620
|
}, this._removeAllEventListeners = () => {
|
4616
|
-
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",
|
4621
|
+
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", T), this._domElement.ownerDocument.removeEventListener("pointerlockerror", M));
|
4617
4622
|
}, this.cancel = () => {
|
4618
|
-
this._state !==
|
4623
|
+
this._state !== _.NONE && (this._state = _.NONE, this._activePointers.length = 0, S());
|
4619
4624
|
}, t && this.connect(t), this.update(0);
|
4620
4625
|
}
|
4621
4626
|
/**
|
@@ -4982,17 +4987,17 @@ class ke extends zr {
|
|
4982
4987
|
l.isEmpty() && (console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"), Promise.resolve());
|
4983
4988
|
const d = Ss(this._sphericalEnd.theta, Cs), p = Ss(this._sphericalEnd.phi, Cs);
|
4984
4989
|
c.push(this.rotateTo(d, p, t));
|
4985
|
-
const m = k.setFromSpherical(this._sphericalEnd).normalize(),
|
4986
|
-
|
4987
|
-
const
|
4988
|
-
F.copy(l.min).applyQuaternion(
|
4989
|
-
const
|
4990
|
+
const m = k.setFromSpherical(this._sphericalEnd).normalize(), g = As.setFromUnitVectors(m, Ci), S = H(Math.abs(m.y), 1);
|
4991
|
+
S && g.multiply(wi.setFromAxisAngle(Gt, d)), g.multiply(this._yAxisUpSpaceInverse);
|
4992
|
+
const T = Ms.makeEmpty();
|
4993
|
+
F.copy(l.min).applyQuaternion(g), T.expandByPoint(F), F.copy(l.min).setX(l.max.x).applyQuaternion(g), T.expandByPoint(F), F.copy(l.min).setY(l.max.y).applyQuaternion(g), T.expandByPoint(F), F.copy(l.max).setZ(l.min.z).applyQuaternion(g), T.expandByPoint(F), F.copy(l.min).setZ(l.max.z).applyQuaternion(g), T.expandByPoint(F), F.copy(l.max).setY(l.min.y).applyQuaternion(g), T.expandByPoint(F), F.copy(l.max).setX(l.min.x).applyQuaternion(g), T.expandByPoint(F), F.copy(l.max).applyQuaternion(g), T.expandByPoint(F), T.min.x -= n, T.min.y -= a, T.max.x += r, T.max.y += o, g.setFromUnitVectors(Ci, m), S && g.premultiply(wi.invert()), g.premultiply(this._yAxisUpSpace);
|
4994
|
+
const M = T.getSize(k), f = T.getCenter(F).applyQuaternion(g);
|
4990
4995
|
if (Ze(this._camera)) {
|
4991
|
-
const v = this.getDistanceToFitBox(
|
4996
|
+
const v = this.getDistanceToFitBox(M.x, M.y, M.z, i);
|
4992
4997
|
c.push(this.moveTo(f.x, f.y, f.z, t)), c.push(this.dollyTo(v, t)), c.push(this.setFocalOffset(0, 0, 0, t));
|
4993
4998
|
} else if (Be(this._camera)) {
|
4994
|
-
const v = this._camera,
|
4995
|
-
c.push(this.moveTo(f.x, f.y, f.z, t)), c.push(this.zoomTo(
|
4999
|
+
const v = this._camera, E = v.right - v.left, b = v.top - v.bottom, C = i ? Math.max(E / M.x, b / M.y) : Math.min(E / M.x, b / M.y);
|
5000
|
+
c.push(this.moveTo(f.x, f.y, f.z, t)), c.push(this.zoomTo(C, t)), c.push(this.setFocalOffset(0, 0, 0, t));
|
4996
5001
|
}
|
4997
5002
|
return Promise.all(c);
|
4998
5003
|
}
|
@@ -5049,15 +5054,15 @@ class ke extends zr {
|
|
5049
5054
|
* @param enableTransition
|
5050
5055
|
* @category Methods
|
5051
5056
|
*/
|
5052
|
-
lerpLookAt(e, t, i, n, r, a, o, c, l, d, p, m,
|
5057
|
+
lerpLookAt(e, t, i, n, r, a, o, c, l, d, p, m, g, S = !1) {
|
5053
5058
|
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = lt.NONE, this._changedDolly = 0;
|
5054
|
-
const
|
5055
|
-
we.setFromVector3(
|
5059
|
+
const T = k.set(n, r, a), M = F.set(e, t, i);
|
5060
|
+
we.setFromVector3(M.sub(T).applyQuaternion(this._yAxisUpSpace));
|
5056
5061
|
const f = ht.set(d, p, m), v = F.set(o, c, l);
|
5057
|
-
At.setFromVector3(v.sub(f).applyQuaternion(this._yAxisUpSpace)), this._targetEnd.copy(
|
5058
|
-
const
|
5059
|
-
this._sphericalEnd.set(we.radius +
|
5060
|
-
const w = !
|
5062
|
+
At.setFromVector3(v.sub(f).applyQuaternion(this._yAxisUpSpace)), this._targetEnd.copy(T.lerp(f, g));
|
5063
|
+
const E = At.theta - we.theta, b = At.phi - we.phi, C = At.radius - we.radius;
|
5064
|
+
this._sphericalEnd.set(we.radius + C * g, we.phi + b * g, we.theta + E * g), this.normalizeRotations(), this._needsUpdate = !0, S || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
|
5065
|
+
const w = !S || H(this._target.x, this._targetEnd.x, this.restThreshold) && H(this._target.y, this._targetEnd.y, this.restThreshold) && H(this._target.z, this._targetEnd.z, this.restThreshold) && H(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && H(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold) && H(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
|
5061
5066
|
return this._createOnRestPromise(w);
|
5062
5067
|
}
|
5063
5068
|
/**
|
@@ -5267,37 +5272,37 @@ class ke extends zr {
|
|
5267
5272
|
*/
|
5268
5273
|
update(e) {
|
5269
5274
|
const t = this._sphericalEnd.theta - this._spherical.theta, i = this._sphericalEnd.phi - this._spherical.phi, n = this._sphericalEnd.radius - this._spherical.radius, r = Os.subVectors(this._targetEnd, this._target), a = Ts.subVectors(this._focalOffsetEnd, this._focalOffset), o = this._zoomEnd - this._zoom;
|
5270
|
-
if (
|
5275
|
+
if (X(t))
|
5271
5276
|
this._thetaVelocity.value = 0, this._spherical.theta = this._sphericalEnd.theta;
|
5272
5277
|
else {
|
5273
5278
|
const p = this._isUserControllingRotate ? this.draggingSmoothTime : this.smoothTime;
|
5274
5279
|
this._spherical.theta = Zt(this._spherical.theta, this._sphericalEnd.theta, this._thetaVelocity, p, 1 / 0, e), this._needsUpdate = !0;
|
5275
5280
|
}
|
5276
|
-
if (
|
5281
|
+
if (X(i))
|
5277
5282
|
this._phiVelocity.value = 0, this._spherical.phi = this._sphericalEnd.phi;
|
5278
5283
|
else {
|
5279
5284
|
const p = this._isUserControllingRotate ? this.draggingSmoothTime : this.smoothTime;
|
5280
5285
|
this._spherical.phi = Zt(this._spherical.phi, this._sphericalEnd.phi, this._phiVelocity, p, 1 / 0, e), this._needsUpdate = !0;
|
5281
5286
|
}
|
5282
|
-
if (
|
5287
|
+
if (X(n))
|
5283
5288
|
this._radiusVelocity.value = 0, this._spherical.radius = this._sphericalEnd.radius;
|
5284
5289
|
else {
|
5285
5290
|
const p = this._isUserControllingDolly ? this.draggingSmoothTime : this.smoothTime;
|
5286
5291
|
this._spherical.radius = Zt(this._spherical.radius, this._sphericalEnd.radius, this._radiusVelocity, p, this.maxSpeed, e), this._needsUpdate = !0;
|
5287
5292
|
}
|
5288
|
-
if (
|
5293
|
+
if (X(r.x) && X(r.y) && X(r.z))
|
5289
5294
|
this._targetVelocity.set(0, 0, 0), this._target.copy(this._targetEnd);
|
5290
5295
|
else {
|
5291
5296
|
const p = this._isUserControllingTruck ? this.draggingSmoothTime : this.smoothTime;
|
5292
5297
|
ws(this._target, this._targetEnd, this._targetVelocity, p, this.maxSpeed, e, this._target), this._needsUpdate = !0;
|
5293
5298
|
}
|
5294
|
-
if (
|
5299
|
+
if (X(a.x) && X(a.y) && X(a.z))
|
5295
5300
|
this._focalOffsetVelocity.set(0, 0, 0), this._focalOffset.copy(this._focalOffsetEnd);
|
5296
5301
|
else {
|
5297
5302
|
const p = this._isUserControllingOffset ? this.draggingSmoothTime : this.smoothTime;
|
5298
5303
|
ws(this._focalOffset, this._focalOffsetEnd, this._focalOffsetVelocity, p, this.maxSpeed, e, this._focalOffset), this._needsUpdate = !0;
|
5299
5304
|
}
|
5300
|
-
if (
|
5305
|
+
if (X(o))
|
5301
5306
|
this._zoomVelocity.value = 0, this._zoom = this._zoomEnd;
|
5302
5307
|
else {
|
5303
5308
|
const p = this._isUserControllingZoom ? this.draggingSmoothTime : this.smoothTime;
|
@@ -5305,29 +5310,29 @@ class ke extends zr {
|
|
5305
5310
|
}
|
5306
5311
|
if (this.dollyToCursor) {
|
5307
5312
|
if (Ze(this._camera) && this._changedDolly !== 0) {
|
5308
|
-
const p = this._spherical.radius - this._lastDistance, m = this._camera,
|
5309
|
-
|
5310
|
-
const
|
5311
|
-
if (this.infinityDolly && (
|
5313
|
+
const p = this._spherical.radius - this._lastDistance, m = this._camera, g = this._getCameraDirection(Mt), S = k.copy(g).cross(m.up).normalize();
|
5314
|
+
S.lengthSq() === 0 && (S.x = 1);
|
5315
|
+
const T = F.crossVectors(S, g), M = this._sphericalEnd.radius * Math.tan(m.getEffectiveFOV() * xt * 0.5), v = (this._sphericalEnd.radius - p - this._sphericalEnd.radius) / this._sphericalEnd.radius, E = ht.copy(this._targetEnd).add(S.multiplyScalar(this._dollyControlCoord.x * M * m.aspect)).add(T.multiplyScalar(this._dollyControlCoord.y * M)), b = k.copy(this._targetEnd).lerp(E, v), C = this._lastDollyDirection === lt.IN && this._spherical.radius <= this.minDistance, w = this._lastDollyDirection === lt.OUT && this.maxDistance <= this._spherical.radius;
|
5316
|
+
if (this.infinityDolly && (C || w)) {
|
5312
5317
|
this._sphericalEnd.radius -= p, this._spherical.radius -= p;
|
5313
|
-
const U = F.copy(
|
5318
|
+
const U = F.copy(g).multiplyScalar(-p);
|
5314
5319
|
b.add(U);
|
5315
5320
|
}
|
5316
5321
|
this._boundary.clampPoint(b, b);
|
5317
5322
|
const I = F.subVectors(b, this._targetEnd);
|
5318
|
-
this._targetEnd.copy(b), this._target.add(I), this._changedDolly -= p,
|
5323
|
+
this._targetEnd.copy(b), this._target.add(I), this._changedDolly -= p, X(this._changedDolly) && (this._changedDolly = 0);
|
5319
5324
|
} else if (Be(this._camera) && this._changedZoom !== 0) {
|
5320
|
-
const p = this._zoom - this._lastZoom, m = this._camera,
|
5325
|
+
const p = this._zoom - this._lastZoom, m = this._camera, g = k.set(this._dollyControlCoord.x, this._dollyControlCoord.y, (m.near + m.far) / (m.near - m.far)).unproject(m), S = F.set(0, 0, -1).applyQuaternion(m.quaternion), T = ht.copy(g).add(S.multiplyScalar(-g.dot(m.up))), f = -(this._zoom - p - this._zoom) / this._zoom, v = this._getCameraDirection(Mt), E = this._targetEnd.dot(v), b = k.copy(this._targetEnd).lerp(T, f), C = b.dot(v), w = v.multiplyScalar(C - E);
|
5321
5326
|
b.sub(w), this._boundary.clampPoint(b, b);
|
5322
5327
|
const I = F.subVectors(b, this._targetEnd);
|
5323
|
-
this._targetEnd.copy(b), this._target.add(I), this._changedZoom -= p,
|
5328
|
+
this._targetEnd.copy(b), this._target.add(I), this._changedZoom -= p, X(this._changedZoom) && (this._changedZoom = 0);
|
5324
5329
|
}
|
5325
5330
|
}
|
5326
5331
|
this._camera.zoom !== this._zoom && (this._camera.zoom = this._zoom, this._camera.updateProjectionMatrix(), this._updateNearPlaneCorners(), this._needsUpdate = !0), this._dragNeedsUpdate = !0;
|
5327
5332
|
const c = this._collisionTest();
|
5328
|
-
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), (!
|
5333
|
+
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), (!X(this._focalOffset.x) || !X(this._focalOffset.y) || !X(this._focalOffset.z)) && (this._camera.updateMatrixWorld(), Pe.setFromMatrixColumn(this._camera.matrix, 0), De.setFromMatrixColumn(this._camera.matrix, 1), We.setFromMatrixColumn(this._camera.matrix, 2), Pe.multiplyScalar(this._focalOffset.x), De.multiplyScalar(-this._focalOffset.y), We.multiplyScalar(this._focalOffset.z), k.copy(Pe).add(De).add(We), this._camera.position.add(k)), this._boundaryEnclosesCamera && this._encloseToBoundary(this._camera.position.copy(this._target), k.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse), 1);
|
5329
5334
|
const d = this._needsUpdate;
|
5330
|
-
return d && !this._updatedLastTime ? (this._hasRested = !1, this.dispatchEvent({ type: "wake" }), this.dispatchEvent({ type: "update" })) : d ? (this.dispatchEvent({ type: "update" }),
|
5335
|
+
return d && !this._updatedLastTime ? (this._hasRested = !1, this.dispatchEvent({ type: "wake" }), this.dispatchEvent({ type: "update" })) : d ? (this.dispatchEvent({ type: "update" }), X(t, this.restThreshold) && X(i, this.restThreshold) && X(n, this.restThreshold) && X(r.x, this.restThreshold) && X(r.y, this.restThreshold) && X(r.z, this.restThreshold) && X(a.x, this.restThreshold) && X(a.y, this.restThreshold) && X(a.z, this.restThreshold) && X(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;
|
5331
5336
|
}
|
5332
5337
|
/**
|
5333
5338
|
* Get all state in JSON string
|
@@ -5525,7 +5530,7 @@ class ke extends zr {
|
|
5525
5530
|
}
|
5526
5531
|
}
|
5527
5532
|
const ai = (s) => {
|
5528
|
-
const [e, t] =
|
5533
|
+
const [e, t] = B(s.options[s.index]), i = () => {
|
5529
5534
|
s.onToggle(!s.open);
|
5530
5535
|
}, n = (r) => {
|
5531
5536
|
r !== e && (s.onSelect(r), t(r)), s.onToggle(!1);
|
@@ -5541,7 +5546,7 @@ const ai = (s) => {
|
|
5541
5546
|
"Normals",
|
5542
5547
|
"UVs",
|
5543
5548
|
"Wireframe"
|
5544
|
-
], [n, r] =
|
5549
|
+
], [n, r] = B("Renderer"), [a, o] = B(!1), [c, l] = B(!1), [d, p] = B(!1);
|
5545
5550
|
return /* @__PURE__ */ u.jsxs("div", { className: `CameraWindow ${e.name}`, children: [
|
5546
5551
|
/* @__PURE__ */ u.jsx("div", { ref: t, className: "clickable", onClick: () => {
|
5547
5552
|
d && p(!1);
|
@@ -5571,8 +5576,8 @@ const ai = (s) => {
|
|
5571
5576
|
onSelect: (m) => {
|
5572
5577
|
if (m === n)
|
5573
5578
|
return;
|
5574
|
-
const
|
5575
|
-
e.onSelectRenderMode(
|
5579
|
+
const g = m;
|
5580
|
+
e.onSelectRenderMode(g), r(g);
|
5576
5581
|
},
|
5577
5582
|
onToggle: (m) => {
|
5578
5583
|
a && o(!1), l(m);
|
@@ -5696,7 +5701,7 @@ class Br extends rn {
|
|
5696
5701
|
});
|
5697
5702
|
}
|
5698
5703
|
}
|
5699
|
-
class Vr extends
|
5704
|
+
class Vr extends O {
|
5700
5705
|
gridMaterial;
|
5701
5706
|
constructor() {
|
5702
5707
|
const e = new Br();
|
@@ -5707,7 +5712,7 @@ class Vr extends M {
|
|
5707
5712
|
}
|
5708
5713
|
}
|
5709
5714
|
function Ps(s) {
|
5710
|
-
const [e, t] =
|
5715
|
+
const [e, t] = B(s.selected), i = "toggle" + (e ? " selected" : "");
|
5711
5716
|
return /* @__PURE__ */ u.jsx(
|
5712
5717
|
"button",
|
5713
5718
|
{
|
@@ -5790,20 +5795,20 @@ class Xr extends an {
|
|
5790
5795
|
const r = new io();
|
5791
5796
|
this._plane = r, i.add(r);
|
5792
5797
|
const a = this;
|
5793
|
-
function o(
|
5794
|
-
let
|
5795
|
-
Object.defineProperty(a,
|
5798
|
+
function o(E, b) {
|
5799
|
+
let C = b;
|
5800
|
+
Object.defineProperty(a, E, {
|
5796
5801
|
get: function() {
|
5797
|
-
return
|
5802
|
+
return C !== void 0 ? C : b;
|
5798
5803
|
},
|
5799
5804
|
set: function(w) {
|
5800
|
-
|
5805
|
+
C !== w && (C = w, r[E] = w, n[E] = w, a.dispatchEvent({ type: E + "-changed", value: w }), a.dispatchEvent(Oi));
|
5801
5806
|
}
|
5802
|
-
}), a[
|
5807
|
+
}), a[E] = b, r[E] = b, n[E] = b;
|
5803
5808
|
}
|
5804
5809
|
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);
|
5805
|
-
const c = new A(), l = new A(), d = new Ee(), p = new Ee(), m = new A(),
|
5806
|
-
o("worldPosition", c), o("worldPositionStart", l), o("worldQuaternion", d), o("worldQuaternionStart", p), o("cameraPosition", m), o("cameraQuaternion",
|
5810
|
+
const c = new A(), l = new A(), d = new Ee(), p = new Ee(), m = new A(), g = new Ee(), S = new A(), T = new A(), M = new A(), f = 0, v = new A();
|
5811
|
+
o("worldPosition", c), o("worldPositionStart", l), o("worldQuaternion", d), o("worldQuaternionStart", p), o("cameraPosition", m), o("cameraQuaternion", g), o("pointStart", S), o("pointEnd", T), o("rotationAxis", M), o("rotationAngle", f), o("eye", v), this._offset = new A(), this._startNorm = new A(), this._endNorm = new A(), this._cameraScale = new A(), this._parentPosition = new A(), this._parentQuaternion = new Ee(), this._parentQuaternionInv = new Ee(), this._parentScale = new A(), this._worldScaleStart = new A(), this._worldQuaternionInv = new Ee(), this._worldScale = new A(), this._positionStart = new A(), this._quaternionStart = new Ee(), this._scaleStart = new A(), this._getPointer = $r.bind(this), this._onPointerDown = Kr.bind(this), this._onPointerHover = qr.bind(this), this._onPointerMove = Qr.bind(this), this._onPointerUp = Jr.bind(this), t !== null && this.connect();
|
5807
5812
|
}
|
5808
5813
|
connect() {
|
5809
5814
|
this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp), this.domElement.style.touchAction = "none";
|
@@ -5940,7 +5945,7 @@ function Ti(s, e, t) {
|
|
5940
5945
|
return i[n];
|
5941
5946
|
return !1;
|
5942
5947
|
}
|
5943
|
-
const $t = new ln(),
|
5948
|
+
const $t = new ln(), W = new A(0, 1, 0), ks = new A(0, 0, 0), Us = new ri(), qt = new Ee(), ti = new Ee(), Re = new A(), js = new ri(), It = new A(1, 0, 0), qe = new A(0, 1, 0), Lt = new A(0, 0, 1), Kt = new A(), Pt = new A(), Dt = new A();
|
5944
5949
|
class eo extends _t {
|
5945
5950
|
constructor(e) {
|
5946
5951
|
super(), this.isTransformControlsRoot = !0, this.controls = e, this.visible = !1;
|
@@ -5986,83 +5991,83 @@ class to extends _t {
|
|
5986
5991
|
p.opacity = 0.25;
|
5987
5992
|
const m = e.clone();
|
5988
5993
|
m.color.setHex(16776960), m.opacity = 0.25, e.clone().color.setHex(16776960);
|
5989
|
-
const
|
5990
|
-
|
5991
|
-
const
|
5992
|
-
|
5993
|
-
const
|
5994
|
-
|
5994
|
+
const S = e.clone();
|
5995
|
+
S.color.setHex(7895160);
|
5996
|
+
const T = new _e(0, 0.04, 0.1, 12);
|
5997
|
+
T.translate(0, 0.05, 0);
|
5998
|
+
const M = new he(0.08, 0.08, 0.08);
|
5999
|
+
M.translate(0, 0.04, 0);
|
5995
6000
|
const f = new gt();
|
5996
6001
|
f.setAttribute("position", new Ke([0, 0, 0, 1, 0, 0], 3));
|
5997
6002
|
const v = new _e(75e-4, 75e-4, 0.5, 3);
|
5998
6003
|
v.translate(0, 0.25, 0);
|
5999
|
-
function
|
6000
|
-
const ce = new bt(
|
6004
|
+
function E(G, Ue) {
|
6005
|
+
const ce = new bt(G, 75e-4, 3, 64, Ue * Math.PI * 2);
|
6001
6006
|
return ce.rotateY(Math.PI / 2), ce.rotateX(Math.PI / 2), ce;
|
6002
6007
|
}
|
6003
6008
|
function b() {
|
6004
|
-
const
|
6005
|
-
return
|
6009
|
+
const G = new gt();
|
6010
|
+
return G.setAttribute("position", new Ke([0, 0, 0, 1, 1, 1], 3)), G;
|
6006
6011
|
}
|
6007
|
-
const
|
6012
|
+
const C = {
|
6008
6013
|
X: [
|
6009
|
-
[new
|
6010
|
-
[new
|
6011
|
-
[new
|
6014
|
+
[new O(T, r), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
|
6015
|
+
[new O(T, r), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
|
6016
|
+
[new O(v, r), [0, 0, 0], [0, 0, -Math.PI / 2]]
|
6012
6017
|
],
|
6013
6018
|
Y: [
|
6014
|
-
[new
|
6015
|
-
[new
|
6016
|
-
[new
|
6019
|
+
[new O(T, a), [0, 0.5, 0]],
|
6020
|
+
[new O(T, a), [0, -0.5, 0], [Math.PI, 0, 0]],
|
6021
|
+
[new O(v, a)]
|
6017
6022
|
],
|
6018
6023
|
Z: [
|
6019
|
-
[new
|
6020
|
-
[new
|
6021
|
-
[new
|
6024
|
+
[new O(T, o), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
|
6025
|
+
[new O(T, o), [0, 0, -0.5], [-Math.PI / 2, 0, 0]],
|
6026
|
+
[new O(v, o), null, [Math.PI / 2, 0, 0]]
|
6022
6027
|
],
|
6023
6028
|
XYZ: [
|
6024
|
-
[new
|
6029
|
+
[new O(new Bt(0.1, 0), p.clone()), [0, 0, 0]]
|
6025
6030
|
],
|
6026
6031
|
XY: [
|
6027
|
-
[new
|
6032
|
+
[new O(new he(0.15, 0.15, 0.01), d.clone()), [0.15, 0.15, 0]]
|
6028
6033
|
],
|
6029
6034
|
YZ: [
|
6030
|
-
[new
|
6035
|
+
[new O(new he(0.15, 0.15, 0.01), c.clone()), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
|
6031
6036
|
],
|
6032
6037
|
XZ: [
|
6033
|
-
[new
|
6038
|
+
[new O(new he(0.15, 0.15, 0.01), l.clone()), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
|
6034
6039
|
]
|
6035
6040
|
}, w = {
|
6036
6041
|
X: [
|
6037
|
-
[new
|
6038
|
-
[new
|
6042
|
+
[new O(new _e(0.2, 0, 0.6, 4), i), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
|
6043
|
+
[new O(new _e(0.2, 0, 0.6, 4), i), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
|
6039
6044
|
],
|
6040
6045
|
Y: [
|
6041
|
-
[new
|
6042
|
-
[new
|
6046
|
+
[new O(new _e(0.2, 0, 0.6, 4), i), [0, 0.3, 0]],
|
6047
|
+
[new O(new _e(0.2, 0, 0.6, 4), i), [0, -0.3, 0], [0, 0, Math.PI]]
|
6043
6048
|
],
|
6044
6049
|
Z: [
|
6045
|
-
[new
|
6046
|
-
[new
|
6050
|
+
[new O(new _e(0.2, 0, 0.6, 4), i), [0, 0, 0.3], [Math.PI / 2, 0, 0]],
|
6051
|
+
[new O(new _e(0.2, 0, 0.6, 4), i), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
|
6047
6052
|
],
|
6048
6053
|
XYZ: [
|
6049
|
-
[new
|
6054
|
+
[new O(new Bt(0.2, 0), i)]
|
6050
6055
|
],
|
6051
6056
|
XY: [
|
6052
|
-
[new
|
6057
|
+
[new O(new he(0.2, 0.2, 0.01), i), [0.15, 0.15, 0]]
|
6053
6058
|
],
|
6054
6059
|
YZ: [
|
6055
|
-
[new
|
6060
|
+
[new O(new he(0.2, 0.2, 0.01), i), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
|
6056
6061
|
],
|
6057
6062
|
XZ: [
|
6058
|
-
[new
|
6063
|
+
[new O(new he(0.2, 0.2, 0.01), i), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
|
6059
6064
|
]
|
6060
6065
|
}, I = {
|
6061
6066
|
START: [
|
6062
|
-
[new
|
6067
|
+
[new O(new Bt(0.01, 2), n), null, null, null, "helper"]
|
6063
6068
|
],
|
6064
6069
|
END: [
|
6065
|
-
[new
|
6070
|
+
[new O(new Bt(0.01, 2), n), null, null, null, "helper"]
|
6066
6071
|
],
|
6067
6072
|
DELTA: [
|
6068
6073
|
[new Ie(b(), n), null, null, null, "helper"]
|
@@ -6078,19 +6083,19 @@ class to extends _t {
|
|
6078
6083
|
]
|
6079
6084
|
}, U = {
|
6080
6085
|
XYZE: [
|
6081
|
-
[new
|
6086
|
+
[new O(E(0.5, 1), S), null, [0, Math.PI / 2, 0]]
|
6082
6087
|
],
|
6083
6088
|
X: [
|
6084
|
-
[new
|
6089
|
+
[new O(E(0.5, 0.5), r)]
|
6085
6090
|
],
|
6086
6091
|
Y: [
|
6087
|
-
[new
|
6092
|
+
[new O(E(0.5, 0.5), a), null, [0, 0, -Math.PI / 2]]
|
6088
6093
|
],
|
6089
6094
|
Z: [
|
6090
|
-
[new
|
6095
|
+
[new O(E(0.5, 0.5), o), null, [0, Math.PI / 2, 0]]
|
6091
6096
|
],
|
6092
6097
|
E: [
|
6093
|
-
[new
|
6098
|
+
[new O(E(0.75, 1), m), null, [0, Math.PI / 2, 0]]
|
6094
6099
|
]
|
6095
6100
|
}, K = {
|
6096
6101
|
AXIS: [
|
@@ -6098,72 +6103,72 @@ class to extends _t {
|
|
6098
6103
|
]
|
6099
6104
|
}, me = {
|
6100
6105
|
XYZE: [
|
6101
|
-
[new
|
6106
|
+
[new O(new cn(0.25, 10, 8), i)]
|
6102
6107
|
],
|
6103
6108
|
X: [
|
6104
|
-
[new
|
6109
|
+
[new O(new bt(0.5, 0.1, 4, 24), i), [0, 0, 0], [0, -Math.PI / 2, -Math.PI / 2]]
|
6105
6110
|
],
|
6106
6111
|
Y: [
|
6107
|
-
[new
|
6112
|
+
[new O(new bt(0.5, 0.1, 4, 24), i), [0, 0, 0], [Math.PI / 2, 0, 0]]
|
6108
6113
|
],
|
6109
6114
|
Z: [
|
6110
|
-
[new
|
6115
|
+
[new O(new bt(0.5, 0.1, 4, 24), i), [0, 0, 0], [0, 0, -Math.PI / 2]]
|
6111
6116
|
],
|
6112
6117
|
E: [
|
6113
|
-
[new
|
6118
|
+
[new O(new bt(0.75, 0.1, 2, 24), i)]
|
6114
6119
|
]
|
6115
6120
|
}, Ae = {
|
6116
6121
|
X: [
|
6117
|
-
[new M
|
6118
|
-
[new
|
6119
|
-
[new M
|
6122
|
+
[new O(M, r), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
|
6123
|
+
[new O(v, r), [0, 0, 0], [0, 0, -Math.PI / 2]],
|
6124
|
+
[new O(M, r), [-0.5, 0, 0], [0, 0, Math.PI / 2]]
|
6120
6125
|
],
|
6121
6126
|
Y: [
|
6122
|
-
[new M
|
6123
|
-
[new
|
6124
|
-
[new M
|
6127
|
+
[new O(M, a), [0, 0.5, 0]],
|
6128
|
+
[new O(v, a)],
|
6129
|
+
[new O(M, a), [0, -0.5, 0], [0, 0, Math.PI]]
|
6125
6130
|
],
|
6126
6131
|
Z: [
|
6127
|
-
[new M
|
6128
|
-
[new
|
6129
|
-
[new M
|
6132
|
+
[new O(M, o), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
|
6133
|
+
[new O(v, o), [0, 0, 0], [Math.PI / 2, 0, 0]],
|
6134
|
+
[new O(M, o), [0, 0, -0.5], [-Math.PI / 2, 0, 0]]
|
6130
6135
|
],
|
6131
6136
|
XY: [
|
6132
|
-
[new
|
6137
|
+
[new O(new he(0.15, 0.15, 0.01), d), [0.15, 0.15, 0]]
|
6133
6138
|
],
|
6134
6139
|
YZ: [
|
6135
|
-
[new
|
6140
|
+
[new O(new he(0.15, 0.15, 0.01), c), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
|
6136
6141
|
],
|
6137
6142
|
XZ: [
|
6138
|
-
[new
|
6143
|
+
[new O(new he(0.15, 0.15, 0.01), l), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
|
6139
6144
|
],
|
6140
6145
|
XYZ: [
|
6141
|
-
[new
|
6146
|
+
[new O(new he(0.1, 0.1, 0.1), p.clone())]
|
6142
6147
|
]
|
6143
6148
|
}, Ce = {
|
6144
6149
|
X: [
|
6145
|
-
[new
|
6146
|
-
[new
|
6150
|
+
[new O(new _e(0.2, 0, 0.6, 4), i), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
|
6151
|
+
[new O(new _e(0.2, 0, 0.6, 4), i), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
|
6147
6152
|
],
|
6148
6153
|
Y: [
|
6149
|
-
[new
|
6150
|
-
[new
|
6154
|
+
[new O(new _e(0.2, 0, 0.6, 4), i), [0, 0.3, 0]],
|
6155
|
+
[new O(new _e(0.2, 0, 0.6, 4), i), [0, -0.3, 0], [0, 0, Math.PI]]
|
6151
6156
|
],
|
6152
6157
|
Z: [
|
6153
|
-
[new
|
6154
|
-
[new
|
6158
|
+
[new O(new _e(0.2, 0, 0.6, 4), i), [0, 0, 0.3], [Math.PI / 2, 0, 0]],
|
6159
|
+
[new O(new _e(0.2, 0, 0.6, 4), i), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
|
6155
6160
|
],
|
6156
6161
|
XY: [
|
6157
|
-
[new
|
6162
|
+
[new O(new he(0.2, 0.2, 0.01), i), [0.15, 0.15, 0]]
|
6158
6163
|
],
|
6159
6164
|
YZ: [
|
6160
|
-
[new
|
6165
|
+
[new O(new he(0.2, 0.2, 0.01), i), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
|
6161
6166
|
],
|
6162
6167
|
XZ: [
|
6163
|
-
[new
|
6168
|
+
[new O(new he(0.2, 0.2, 0.01), i), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
|
6164
6169
|
],
|
6165
6170
|
XYZ: [
|
6166
|
-
[new
|
6171
|
+
[new O(new he(0.2, 0.2, 0.2), i), [0, 0, 0]]
|
6167
6172
|
]
|
6168
6173
|
}, le = {
|
6169
6174
|
X: [
|
@@ -6176,18 +6181,18 @@ class to extends _t {
|
|
6176
6181
|
[new Ie(f, n.clone()), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
|
6177
6182
|
]
|
6178
6183
|
};
|
6179
|
-
function Q(
|
6184
|
+
function Q(G) {
|
6180
6185
|
const Ue = new _t();
|
6181
|
-
for (const ce in
|
6182
|
-
for (let be =
|
6183
|
-
const te =
|
6184
|
-
te.name = ce, te.tag =
|
6186
|
+
for (const ce in G)
|
6187
|
+
for (let be = G[ce].length; be--; ) {
|
6188
|
+
const te = G[ce][be][0].clone(), je = G[ce][be][1], Ne = G[ce][be][2], Fe = G[ce][be][3], V = G[ce][be][4];
|
6189
|
+
te.name = ce, te.tag = V, je && te.position.set(je[0], je[1], je[2]), Ne && te.rotation.set(Ne[0], Ne[1], Ne[2]), Fe && te.scale.set(Fe[0], Fe[1], Fe[2]), te.updateMatrix();
|
6185
6190
|
const re = te.geometry.clone();
|
6186
6191
|
re.applyMatrix4(te.matrix), te.geometry = re, te.renderOrder = 1 / 0, te.position.set(0, 0, 0), te.rotation.set(0, 0, 0), te.scale.set(1, 1, 1), Ue.add(te);
|
6187
6192
|
}
|
6188
6193
|
return Ue;
|
6189
6194
|
}
|
6190
|
-
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = Q(
|
6195
|
+
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = Q(C)), this.add(this.gizmo.rotate = Q(U)), this.add(this.gizmo.scale = Q(Ae)), this.add(this.picker.translate = Q(w)), this.add(this.picker.rotate = Q(me)), this.add(this.picker.scale = Q(Ce)), this.add(this.helper.translate = Q(I)), this.add(this.helper.rotate = Q(K)), this.add(this.helper.scale = Q(le)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
|
6191
6196
|
}
|
6192
6197
|
// updateMatrixWorld will update transformations and appearance of individual handles
|
6193
6198
|
updateMatrixWorld(e) {
|
@@ -6200,17 +6205,17 @@ class to extends _t {
|
|
6200
6205
|
a.visible = !0, a.rotation.set(0, 0, 0), a.position.copy(this.worldPosition);
|
6201
6206
|
let o;
|
6202
6207
|
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") {
|
6203
|
-
a.visible = !1, a.name === "AXIS" ? (a.visible = !!this.axis, this.axis === "X" && ($.setFromEuler($t.set(0, 0, 0)), a.quaternion.copy(i).multiply($), Math.abs(
|
6208
|
+
a.visible = !1, a.name === "AXIS" ? (a.visible = !!this.axis, this.axis === "X" && ($.setFromEuler($t.set(0, 0, 0)), a.quaternion.copy(i).multiply($), Math.abs(W.copy(It).applyQuaternion(i).dot(this.eye)) > 0.9 && (a.visible = !1)), this.axis === "Y" && ($.setFromEuler($t.set(0, 0, Math.PI / 2)), a.quaternion.copy(i).multiply($), Math.abs(W.copy(qe).applyQuaternion(i).dot(this.eye)) > 0.9 && (a.visible = !1)), this.axis === "Z" && ($.setFromEuler($t.set(0, Math.PI / 2, 0)), a.quaternion.copy(i).multiply($), Math.abs(W.copy(Lt).applyQuaternion(i).dot(this.eye)) > 0.9 && (a.visible = !1)), this.axis === "XYZE" && ($.setFromEuler($t.set(0, Math.PI / 2, 0)), W.copy(this.rotationAxis), a.quaternion.setFromRotationMatrix(Us.lookAt(ks, W, qe)), a.quaternion.multiply($), 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), de.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), de.applyQuaternion(this.worldQuaternionStart.clone().invert()), a.scale.copy(de), 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));
|
6204
6209
|
continue;
|
6205
6210
|
}
|
6206
|
-
a.quaternion.copy(i), this.mode === "translate" || this.mode === "scale" ? (a.name === "X" && Math.abs(
|
6211
|
+
a.quaternion.copy(i), this.mode === "translate" || this.mode === "scale" ? (a.name === "X" && Math.abs(W.copy(It).applyQuaternion(i).dot(this.eye)) > 0.99 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "Y" && Math.abs(W.copy(qe).applyQuaternion(i).dot(this.eye)) > 0.99 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "Z" && Math.abs(W.copy(Lt).applyQuaternion(i).dot(this.eye)) > 0.99 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "XY" && Math.abs(W.copy(Lt).applyQuaternion(i).dot(this.eye)) < 0.2 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "YZ" && Math.abs(W.copy(It).applyQuaternion(i).dot(this.eye)) < 0.2 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "XZ" && Math.abs(W.copy(qe).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), W.copy(this.eye).applyQuaternion($.copy(i).invert()), a.name.search("E") !== -1 && a.quaternion.setFromRotationMatrix(Us.lookAt(this.eye, ks, qe)), a.name === "X" && ($.setFromAxisAngle(It, Math.atan2(-W.y, W.z)), $.multiplyQuaternions(qt, $), a.quaternion.copy($)), a.name === "Y" && ($.setFromAxisAngle(qe, Math.atan2(W.x, W.z)), $.multiplyQuaternions(qt, $), a.quaternion.copy($)), a.name === "Z" && ($.setFromAxisAngle(Lt, Math.atan2(W.y, W.x)), $.multiplyQuaternions(qt, $), a.quaternion.copy($))), 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) {
|
6207
6212
|
return a.name === c;
|
6208
6213
|
})) && (a.material.color.setHex(16776960), a.material.opacity = 1);
|
6209
6214
|
}
|
6210
6215
|
super.updateMatrixWorld(e);
|
6211
6216
|
}
|
6212
6217
|
}
|
6213
|
-
class io extends
|
6218
|
+
class io extends O {
|
6214
6219
|
constructor() {
|
6215
6220
|
super(
|
6216
6221
|
new on(1e5, 1e5, 2, 2),
|
@@ -6219,18 +6224,18 @@ class io extends M {
|
|
6219
6224
|
}
|
6220
6225
|
updateMatrixWorld(e) {
|
6221
6226
|
let t = this.space;
|
6222
|
-
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), Kt.copy(It).applyQuaternion(t === "local" ? this.worldQuaternion : ti), Pt.copy(qe).applyQuaternion(t === "local" ? this.worldQuaternion : ti), Dt.copy(Lt).applyQuaternion(t === "local" ? this.worldQuaternion : ti),
|
6227
|
+
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), Kt.copy(It).applyQuaternion(t === "local" ? this.worldQuaternion : ti), Pt.copy(qe).applyQuaternion(t === "local" ? this.worldQuaternion : ti), Dt.copy(Lt).applyQuaternion(t === "local" ? this.worldQuaternion : ti), W.copy(Pt), this.mode) {
|
6223
6228
|
case "translate":
|
6224
6229
|
case "scale":
|
6225
6230
|
switch (this.axis) {
|
6226
6231
|
case "X":
|
6227
|
-
|
6232
|
+
W.copy(this.eye).cross(Kt), Re.copy(Kt).cross(W);
|
6228
6233
|
break;
|
6229
6234
|
case "Y":
|
6230
|
-
|
6235
|
+
W.copy(this.eye).cross(Pt), Re.copy(Pt).cross(W);
|
6231
6236
|
break;
|
6232
6237
|
case "Z":
|
6233
|
-
|
6238
|
+
W.copy(this.eye).cross(Dt), Re.copy(Dt).cross(W);
|
6234
6239
|
break;
|
6235
6240
|
case "XY":
|
6236
6241
|
Re.copy(Dt);
|
@@ -6239,7 +6244,7 @@ class io extends M {
|
|
6239
6244
|
Re.copy(Kt);
|
6240
6245
|
break;
|
6241
6246
|
case "XZ":
|
6242
|
-
|
6247
|
+
W.copy(Dt), Re.copy(Pt);
|
6243
6248
|
break;
|
6244
6249
|
case "XYZ":
|
6245
6250
|
case "E":
|
@@ -6251,7 +6256,7 @@ class io extends M {
|
|
6251
6256
|
default:
|
6252
6257
|
Re.set(0, 0, 0);
|
6253
6258
|
}
|
6254
|
-
Re.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (js.lookAt(de.set(0, 0, 0), Re,
|
6259
|
+
Re.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (js.lookAt(de.set(0, 0, 0), Re, W), this.quaternion.setFromRotationMatrix(js)), super.updateMatrixWorld(e);
|
6255
6260
|
}
|
6256
6261
|
}
|
6257
6262
|
class ge extends Ys {
|
@@ -6346,7 +6351,7 @@ class Ns extends _t {
|
|
6346
6351
|
group;
|
6347
6352
|
constructor(e, t) {
|
6348
6353
|
const i = new et(ot(0.5, 1, Math.random()), ot(0.5, 1, Math.random()), ot(0.5, 1, Math.random()));
|
6349
|
-
super(), this.name = e, this.lineMaterial = new Fi({ color: i }), this.line = new Ie(new gt(), this.lineMaterial), this.line.name = "line", this.add(this.line), this._camera = t, this.curveType = "catmullrom", this.draggedMat.color = i, this.draggable = new _t(), this.draggable.name = "draggablePoints", this.add(this.draggable), this.curvePos = new
|
6354
|
+
super(), this.name = e, this.lineMaterial = new Fi({ color: i }), this.line = new Ie(new gt(), this.lineMaterial), this.line.name = "line", this.add(this.line), this._camera = t, this.curveType = "catmullrom", this.draggedMat.color = i, this.draggable = new _t(), this.draggable.name = "draggablePoints", this.add(this.draggable), this.curvePos = new O(new cn(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 ii(), this.raycaster.params.Line.threshold = 3, this.enable();
|
6350
6355
|
}
|
6351
6356
|
enable() {
|
6352
6357
|
document.addEventListener("pointerdown", this.onMouseClick);
|
@@ -6387,7 +6392,7 @@ class Ns extends _t {
|
|
6387
6392
|
this.addPoint(new A(-50, 0, 0), !1), this.addPoint(new A(50, 0, 0));
|
6388
6393
|
};
|
6389
6394
|
addPoint = (e, t = !0) => {
|
6390
|
-
const i = this.draggable.children.length, n = new
|
6395
|
+
const i = this.draggable.children.length, n = new O(so, this.draggedMat);
|
6391
6396
|
return n.name = `point_${i}`, n.position.copy(e), n.scale.setScalar(this._draggableScale), this.draggable.add(n), t && this.updateSpline(), n;
|
6392
6397
|
};
|
6393
6398
|
addNextPt = () => {
|
@@ -7218,7 +7223,7 @@ class pe extends jt {
|
|
7218
7223
|
if (this.currentCamera.name === "UI")
|
7219
7224
|
return;
|
7220
7225
|
const t = this.controls.get(this.currentCamera.name);
|
7221
|
-
e.key === "0" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ke(this.currentCamera, this.currentWindow.current), this.selectedItem instanceof
|
7226
|
+
e.key === "0" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ke(this.currentCamera, this.currentWindow.current), this.selectedItem instanceof O || this.selectedItem instanceof pa ? (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(ki(45), ki(45), !0), this.updateCameraControls(t));
|
7222
7227
|
} else if (this.currentTransform !== void 0)
|
7223
7228
|
switch (e.key) {
|
7224
7229
|
case "r":
|
@@ -7356,7 +7361,7 @@ class pe extends jt {
|
|
7356
7361
|
n.start(), this.selectedItem.getWorldPosition(e.target0);
|
7357
7362
|
const r = () => {
|
7358
7363
|
const a = n.getDelta();
|
7359
|
-
this.cameraControls && this.cameraControls.update(a), t && (e.target.lerp(e.target0, i), e.object.position.lerp(e.position0, i), e.object.zoom =
|
7364
|
+
this.cameraControls && this.cameraControls.update(a), t && (e.target.lerp(e.target0, i), e.object.position.lerp(e.position0, i), e.object.zoom = Di(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);
|
7360
7365
|
};
|
7361
7366
|
r();
|
7362
7367
|
};
|
@@ -7548,8 +7553,8 @@ function oo(s, e) {
|
|
7548
7553
|
e.updateObject(s.uuid, l, p);
|
7549
7554
|
const m = e.getScene(s.uuid);
|
7550
7555
|
if (m !== null) {
|
7551
|
-
const
|
7552
|
-
ee(
|
7556
|
+
const g = m.getObjectByProperty("uuid", s.uuid);
|
7557
|
+
ee(g, l, p);
|
7553
7558
|
}
|
7554
7559
|
}
|
7555
7560
|
}) : a.push({
|
@@ -7627,30 +7632,30 @@ function lo(s) {
|
|
7627
7632
|
if (p !== null) {
|
7628
7633
|
const m = p.getObjectByProperty("uuid", e.uuid);
|
7629
7634
|
if (m !== void 0) {
|
7630
|
-
const
|
7631
|
-
if (
|
7632
|
-
const
|
7635
|
+
const g = m.mixer;
|
7636
|
+
if (g !== void 0) {
|
7637
|
+
const T = [
|
7633
7638
|
{
|
7634
7639
|
title: "Time Scale",
|
7635
7640
|
type: "range",
|
7636
|
-
value:
|
7641
|
+
value: g.timeScale,
|
7637
7642
|
step: 0.01,
|
7638
7643
|
min: -1,
|
7639
7644
|
max: 2,
|
7640
|
-
onChange: (
|
7641
|
-
|
7645
|
+
onChange: (M, f) => {
|
7646
|
+
g.timeScale = f, t.updateObject(e.uuid, "mixer.timeScale", f);
|
7642
7647
|
}
|
7643
7648
|
}
|
7644
7649
|
];
|
7645
|
-
|
7650
|
+
T.push({
|
7646
7651
|
title: "Stop All",
|
7647
7652
|
type: "button",
|
7648
7653
|
onChange: () => {
|
7649
|
-
|
7654
|
+
g.stopAllAction(), t.requestMethod(e.uuid, "stopAllAction", void 0, "mixer");
|
7650
7655
|
}
|
7651
7656
|
}), o.push({
|
7652
7657
|
title: "Mixer",
|
7653
|
-
items:
|
7658
|
+
items: T
|
7654
7659
|
}), d = new Ca(m), pe.instance?.scene.add(d);
|
7655
7660
|
}
|
7656
7661
|
}
|
@@ -7684,7 +7689,7 @@ const ji = {
|
|
7684
7689
|
};
|
7685
7690
|
let oe = { ...ji };
|
7686
7691
|
function co(s) {
|
7687
|
-
const [e, t] =
|
7692
|
+
const [e, t] = B(-1);
|
7688
7693
|
tt(() => {
|
7689
7694
|
function a(c) {
|
7690
7695
|
oe = { ...c.value }, t(Date.now());
|
@@ -7967,60 +7972,71 @@ class ho extends jt {
|
|
7967
7972
|
}
|
7968
7973
|
}
|
7969
7974
|
function uo(s) {
|
7970
|
-
const [e] =
|
7971
|
-
const
|
7972
|
-
e.push(
|
7975
|
+
const [e] = B([]), [t] = B([]), [i, n] = B(0), [r, a] = B(0), o = (d) => {
|
7976
|
+
const p = d.value;
|
7977
|
+
e.push(p), t.push(
|
7973
7978
|
/* @__PURE__ */ u.jsx(
|
7974
7979
|
ni,
|
7975
7980
|
{
|
7976
|
-
label: `Scene: ${
|
7977
|
-
scene:
|
7981
|
+
label: `Scene: ${p.name}`,
|
7982
|
+
scene: p,
|
7978
7983
|
open: !0,
|
7979
7984
|
onRefresh: () => {
|
7980
|
-
s.three.refreshScene(
|
7985
|
+
s.three.refreshScene(p.name);
|
7981
7986
|
},
|
7982
|
-
children: /* @__PURE__ */ u.jsx(fs, { child:
|
7987
|
+
children: /* @__PURE__ */ u.jsx(fs, { child: p, scene: p, three: s.three })
|
7983
7988
|
},
|
7984
7989
|
Math.random()
|
7985
7990
|
)
|
7986
7991
|
), n(Date.now());
|
7987
|
-
},
|
7988
|
-
const
|
7989
|
-
for (let
|
7990
|
-
if (
|
7991
|
-
e[
|
7992
|
+
}, c = (d) => {
|
7993
|
+
const p = d.value;
|
7994
|
+
for (let m = 0; m < e.length; m++)
|
7995
|
+
if (p.uuid === e[m].uuid) {
|
7996
|
+
e[m] = p, t[m] = /* @__PURE__ */ u.jsx(
|
7992
7997
|
ni,
|
7993
7998
|
{
|
7994
|
-
label: `Scene: ${
|
7995
|
-
scene:
|
7999
|
+
label: `Scene: ${p.name}`,
|
8000
|
+
scene: p,
|
7996
8001
|
open: !0,
|
7997
8002
|
onRefresh: () => {
|
7998
|
-
s.three.refreshScene(
|
8003
|
+
s.three.refreshScene(p.name);
|
7999
8004
|
},
|
8000
|
-
children: /* @__PURE__ */ u.jsx(fs, { child:
|
8005
|
+
children: /* @__PURE__ */ u.jsx(fs, { child: p, scene: p, three: s.three })
|
8001
8006
|
},
|
8002
8007
|
Math.random()
|
8003
8008
|
), n(Date.now());
|
8004
8009
|
return;
|
8005
8010
|
}
|
8006
|
-
},
|
8007
|
-
const
|
8008
|
-
for (let
|
8009
|
-
if (
|
8010
|
-
e.splice(
|
8011
|
+
}, l = (d) => {
|
8012
|
+
const p = d.value;
|
8013
|
+
for (let m = 0; m < e.length; m++)
|
8014
|
+
if (p.uuid === e[m].uuid) {
|
8015
|
+
e.splice(m, 1), t.splice(m, 1), n(Date.now());
|
8011
8016
|
return;
|
8012
8017
|
}
|
8013
8018
|
};
|
8014
|
-
return tt(() => (D.addEventListener(P.ADD_SCENE,
|
8015
|
-
D.removeEventListener(P.ADD_SCENE,
|
8019
|
+
return tt(() => (D.addEventListener(P.ADD_SCENE, o), D.addEventListener(P.REFRESH_SCENE, c), D.addEventListener(P.REMOVE_SCENE, l), () => {
|
8020
|
+
D.removeEventListener(P.ADD_SCENE, o), D.removeEventListener(P.REFRESH_SCENE, c), D.removeEventListener(P.REMOVE_SCENE, l);
|
8016
8021
|
}), []), /* @__PURE__ */ u.jsxs("div", { id: "SidePanel", children: [
|
8017
8022
|
/* @__PURE__ */ u.jsx("div", { className: "scenes", children: t }, i),
|
8018
8023
|
/* @__PURE__ */ u.jsx(co, { three: s.three }),
|
8019
8024
|
/* @__PURE__ */ u.jsx(ho, { three: s.three }),
|
8020
|
-
/* @__PURE__ */ u.jsx(se, { three: s.three })
|
8025
|
+
/* @__PURE__ */ u.jsx(se, { three: s.three }),
|
8026
|
+
/* @__PURE__ */ u.jsx(
|
8027
|
+
"input",
|
8028
|
+
{
|
8029
|
+
type: "number",
|
8030
|
+
value: r,
|
8031
|
+
onChange: (d) => {
|
8032
|
+
const p = d.target.value;
|
8033
|
+
a(p);
|
8034
|
+
}
|
8035
|
+
}
|
8036
|
+
)
|
8021
8037
|
] });
|
8022
8038
|
}
|
8023
|
-
function
|
8039
|
+
function Mo(s) {
|
8024
8040
|
return tt(() => {
|
8025
8041
|
function e(o) {
|
8026
8042
|
let c = null;
|
@@ -8041,22 +8057,22 @@ function To(s) {
|
|
8041
8057
|
const c = o.value, d = e(c.uuid)?.getObjectByProperty("uuid", c.uuid);
|
8042
8058
|
if (d !== void 0) {
|
8043
8059
|
const p = (m) => {
|
8044
|
-
const
|
8045
|
-
switch (
|
8060
|
+
const g = c.key.split(".");
|
8061
|
+
switch (g.length) {
|
8046
8062
|
case 1:
|
8047
|
-
d[
|
8063
|
+
d[g[0]] = m;
|
8048
8064
|
break;
|
8049
8065
|
case 2:
|
8050
|
-
d[
|
8066
|
+
d[g[0]][g[1]] = m;
|
8051
8067
|
break;
|
8052
8068
|
case 3:
|
8053
|
-
d[
|
8069
|
+
d[g[0]][g[1]][g[2]] = m;
|
8054
8070
|
break;
|
8055
8071
|
case 4:
|
8056
|
-
d[
|
8072
|
+
d[g[0]][g[1]][g[2]][g[3]] = m;
|
8057
8073
|
break;
|
8058
8074
|
case 5:
|
8059
|
-
d[
|
8075
|
+
d[g[0]][g[1]][g[2]][g[3]][g[4]] = m;
|
8060
8076
|
break;
|
8061
8077
|
}
|
8062
8078
|
d.material.needsUpdate = !0;
|
@@ -8066,12 +8082,12 @@ function To(s) {
|
|
8066
8082
|
}) : p(null);
|
8067
8083
|
}
|
8068
8084
|
}, a = (o) => {
|
8069
|
-
const { key: c, uuid: l, value: d, subitem: p } = o.value,
|
8070
|
-
if (
|
8085
|
+
const { key: c, uuid: l, value: d, subitem: p } = o.value, g = e(l)?.getObjectByProperty("uuid", l);
|
8086
|
+
if (g !== void 0)
|
8071
8087
|
try {
|
8072
|
-
p !== void 0 ? Za(
|
8073
|
-
} catch (
|
8074
|
-
console.log("Error requesting method:"), console.log(
|
8088
|
+
p !== void 0 ? Za(g, p)[c](d) : g[c](d);
|
8089
|
+
} catch (S) {
|
8090
|
+
console.log("Error requesting method:"), console.log(S), console.log(c), console.log(d);
|
8075
8091
|
}
|
8076
8092
|
};
|
8077
8093
|
return D.addEventListener(P.GET_OBJECT, t), D.addEventListener(P.UPDATE_OBJECT, n), D.addEventListener(P.CREATE_TEXTURE, r), D.addEventListener(P.REQUEST_METHOD, a), () => {
|
@@ -8086,7 +8102,7 @@ function po(s) {
|
|
8086
8102
|
/* @__PURE__ */ u.jsx("div", { className: "footer", children: s.footer })
|
8087
8103
|
] });
|
8088
8104
|
}
|
8089
|
-
function
|
8105
|
+
function Ao(s) {
|
8090
8106
|
return /* @__PURE__ */ u.jsx(po, { children: /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
8091
8107
|
/* @__PURE__ */ u.jsx(
|
8092
8108
|
pe,
|
@@ -8103,7 +8119,7 @@ function Mo(s) {
|
|
8103
8119
|
}
|
8104
8120
|
export {
|
8105
8121
|
ni as Accordion,
|
8106
|
-
|
8122
|
+
Eo as Application,
|
8107
8123
|
zi as BaseRemote,
|
8108
8124
|
gn as ChildObject,
|
8109
8125
|
fs as ContainerObject,
|
@@ -8116,33 +8132,38 @@ export {
|
|
8116
8132
|
co as Inspector,
|
8117
8133
|
pe as MultiView,
|
8118
8134
|
fn as NavButton,
|
8119
|
-
|
8120
|
-
|
8121
|
-
|
8122
|
-
|
8123
|
-
|
8124
|
-
|
8135
|
+
za as QualityType,
|
8136
|
+
Co as RemoteComponents,
|
8137
|
+
To as RemoteController,
|
8138
|
+
xo as RemoteTheatre,
|
8139
|
+
Oo as RemoteThree,
|
8140
|
+
Mo as SceneInspector,
|
8125
8141
|
uo as SidePanel,
|
8126
8142
|
Ns as Spline,
|
8127
8143
|
no as SplineEditor,
|
8128
|
-
|
8144
|
+
Ao as ThreeEditor,
|
8129
8145
|
P as ToolEvents,
|
8130
8146
|
ge as Transform,
|
8131
8147
|
si as capitalize,
|
8148
|
+
$e as clamp,
|
8132
8149
|
os as colorToHex,
|
8133
8150
|
Ra as copyToClipboard,
|
8134
|
-
|
8151
|
+
wo as customizeTheatreElements,
|
8135
8152
|
D as debugDispatcher,
|
8136
8153
|
_o as defaultTheatreCallback,
|
8137
|
-
|
8154
|
+
vo as detectSettings,
|
8138
8155
|
He as dispose,
|
8139
|
-
|
8140
|
-
|
8141
|
-
|
8156
|
+
Ha as disposeMaterial,
|
8157
|
+
bo as disposeTexture,
|
8158
|
+
yo as distance,
|
8159
|
+
Ii as hierarchyUUID,
|
8142
8160
|
La as isColor,
|
8161
|
+
Di as mix,
|
8143
8162
|
un as noop,
|
8163
|
+
ds as normalize,
|
8144
8164
|
Ia as randomID,
|
8145
|
-
|
8146
|
-
|
8147
|
-
|
8165
|
+
us as resetThreeObjects,
|
8166
|
+
Me as round,
|
8167
|
+
So as theatreEditorApp,
|
8168
|
+
Ri as totalThreeObjects
|
8148
8169
|
};
|