@tomorrowevening/hermes 0.1.30 → 0.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hermes.cjs.js +7 -7
- package/dist/hermes.es.js +525 -504
- package/dist/{index-C9PVvFM6.js → index-B-fQeaYI.js} +368 -368
- package/dist/index.html +1 -1
- package/package.json +1 -1
package/dist/hermes.es.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { types as R, getProject as _s } from "@tomorrowevening/theatre-core";
|
|
2
|
-
import { useState as L, useEffect as ye, useRef as z, useMemo as Ze, Component as Qe, createRef as
|
|
3
|
-
import { BufferGeometry as zi, Float32BufferAttribute as
|
|
4
|
-
import { Color as dt, ColorManagement as St, WebGPURenderer as
|
|
2
|
+
import { useState as L, useEffect as ye, useRef as z, useMemo as Ze, Component as Qe, createRef as ue, forwardRef as Cs } from "react";
|
|
3
|
+
import { BufferGeometry as zi, Float32BufferAttribute as Ne, OrthographicCamera as Hi, Texture as Gt, Scene as ys, MeshBasicMaterial as bs, Mesh as Bi, LinearSRGBColorSpace as Xe, ObjectLoader as Es, AnimationMixer as Ss, AnimationClip as Os, Matrix4 as Vi, AlwaysStencilFunc as si, ReplaceStencilOp as Ee, NotEqualStencilFunc as ni, EqualStencilFunc as ri, KeepStencilOp as Se, NormalBlending as Gi, AddEquation as Je, SrcAlphaFactor as gt, OneMinusSrcAlphaFactor as vt, CustomBlending as _t, OneFactor as Ct, DstColorFactor as jt, OneMinusDstColorFactor as Qt, WebGLRenderTarget as xs, RGBAFormat as ws, EventDispatcher as $i, RepeatWrapping as ai, Color as et, FrontSide as Ts, BackSide as Ms, DoubleSide as Wi, ZeroFactor as Yi, SrcColorFactor as Zi, OneMinusSrcColorFactor as qi, DstAlphaFactor as Ki, OneMinusDstAlphaFactor as Xi, SrcAlphaSaturateFactor as As, ConstantColorFactor as ji, OneMinusConstantColorFactor as Qi, ConstantAlphaFactor as Ji, OneMinusConstantAlphaFactor as es, SubtractEquation as Rs, ReverseSubtractEquation as Ds, MinEquation as Ps, MaxEquation as Is, NoBlending as Us, AdditiveBlending as Ls, SubtractiveBlending as Ns, MultiplyBlending as ks, ShaderMaterial as ts, GLSL3 as Fs, PlaneGeometry as zs, Object3D as Hs, Vector3 as Le, Raycaster as Bs, Vector2 as Vs, WebGLRenderer as qe, Euler as Gs, SkeletonHelper as $s, SRGBColorSpace as oi, NoToneMapping as li, ColorManagement as tt, NoColorSpace as Ws, LinearToneMapping as Ys, ReinhardToneMapping as Zs, CineonToneMapping as qs, ACESFilmicToneMapping as Ks, AgXToneMapping as Xs, NeutralToneMapping as js, CustomToneMapping as Qs } from "three";
|
|
4
|
+
import { Color as dt, ColorManagement as St, WebGPURenderer as Ge, RenderTarget as Js, WebGLRenderTarget as en, ComputeNode as tn, NodeMaterial as sn, DoubleSide as nn, Mesh as ut, PlaneGeometry as rn, BoxGeometry as an, Vector2 as $e, Object3D as ci, CatmullRomCurve3 as hi, MeshBasicMaterial as $t, LineBasicMaterial as on, Line as ln, BufferGeometry as di, SphereGeometry as cn, Raycaster as Wt, Vector3 as ee, Group as hn, AxesHelper as dn, Scene as un, Sphere as pn, Box3 as mn, Spherical as fn, Matrix4 as gn, Quaternion as vn, Vector4 as _n, MeshDepthMaterial as Cn, MeshNormalMaterial as yn, MeshNormalNodeMaterial as bn, PerspectiveCamera as ui, OrthographicCamera as pi, CameraHelper as En, SkinnedMesh as Sn, SpotLightHelper as On, PointLightHelper as xn, HemisphereLightHelper as wn, DirectionalLightHelper as Tn, Clock as Mn } from "three/webgpu";
|
|
5
5
|
import { jsx as f, jsxs as M, Fragment as q } from "react/jsx-runtime";
|
|
6
|
-
import { radToDeg as
|
|
7
|
-
import { RectAreaLightHelper as
|
|
8
|
-
import { OrbitControls as
|
|
9
|
-
import { uniform as
|
|
6
|
+
import { radToDeg as An, degToRad as Yt, lerp as Ot, mapLinear as Oe } from "three/src/math/MathUtils.js";
|
|
7
|
+
import { RectAreaLightHelper as Rn } from "three/examples/jsm/helpers/RectAreaLightHelper.js";
|
|
8
|
+
import { OrbitControls as Dn } from "three/examples/jsm/controls/OrbitControls.js";
|
|
9
|
+
import { uniform as xe, varyingProperty as Pn, Fn as xt, positionLocal as In, vec3 as Un, cameraPosition as it, float as Y, fwidth as Ln, abs as mi, fract as Nn, min as wt, max as fi, distance as kn, log as gi, pow as vi, floor as Fn, mix as _i, If as zn, lessThanEqual as Hn, Discard as Bn, vec4 as Vn } from "three/tsl";
|
|
10
10
|
import is from "three/src/materials/nodes/MeshBasicNodeMaterial.js";
|
|
11
|
-
import { remapClamp as
|
|
12
|
-
import { TransformControls as
|
|
11
|
+
import { remapClamp as Gn, linearDepth as $n, vec4 as ss, uv as Wn } from "three/src/nodes/TSL.js";
|
|
12
|
+
import { TransformControls as Yn } from "three/examples/jsm/controls/TransformControls.js";
|
|
13
13
|
const pt = () => {
|
|
14
14
|
}, ka = () => {
|
|
15
15
|
};
|
|
16
16
|
function mt(i) {
|
|
17
17
|
return i.substring(0, 1).toUpperCase() + i.substring(1);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Zn(i) {
|
|
20
20
|
const e = JSON.stringify(i);
|
|
21
21
|
return navigator.clipboard.writeText(e), e;
|
|
22
22
|
}
|
|
23
23
|
function W() {
|
|
24
24
|
return Math.round(Math.random() * 1e6).toString();
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function qn(i) {
|
|
27
27
|
return i.r !== void 0 && i.g !== void 0 && i.b !== void 0;
|
|
28
28
|
}
|
|
29
29
|
function Ci(i) {
|
|
@@ -58,7 +58,7 @@ function Tt(i, e, t, s) {
|
|
|
58
58
|
c((s = s.apply(i, [])).next());
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
|
-
const
|
|
61
|
+
const Kn = ["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"];
|
|
62
62
|
function yi(i) {
|
|
63
63
|
return i = i.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");
|
|
64
64
|
}
|
|
@@ -67,7 +67,7 @@ const ns = typeof window > "u", ne = (() => {
|
|
|
67
67
|
const { userAgent: i, platform: e, maxTouchPoints: t } = window.navigator, s = /(iphone|ipod|ipad)/i.test(i), n = e === "iPad" || e === "MacIntel" && t > 0 && !window.MSStream;
|
|
68
68
|
return { isIpad: n, isMobile: /android/i.test(i) || s || n, isSafari12: /Version\/12.+Safari/.test(i), isFirefox: /Firefox/.test(i) };
|
|
69
69
|
})();
|
|
70
|
-
function
|
|
70
|
+
function Xn(i, e, t) {
|
|
71
71
|
if (!t) return [e];
|
|
72
72
|
const s = function(l) {
|
|
73
73
|
const h = `
|
|
@@ -106,7 +106,7 @@ class bi extends Error {
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
const Mt = [], Ei = [];
|
|
109
|
-
function
|
|
109
|
+
function jn(i, e) {
|
|
110
110
|
if (i === e) return 0;
|
|
111
111
|
const t = i;
|
|
112
112
|
i.length > e.length && (i = e, e = t);
|
|
@@ -120,47 +120,47 @@ function Xn(i, e) {
|
|
|
120
120
|
for (; d < n; ) for (a = e.charCodeAt(r + d), o = d++, l = d, h = 0; h < s; h++) c = a === Ei[h] ? o : o + 1, o = Mt[h], l = Mt[h] = o > l ? c > l ? l + 1 : c : c > o ? o + 1 : c;
|
|
121
121
|
return l;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function Qn(i) {
|
|
124
124
|
return i != null;
|
|
125
125
|
}
|
|
126
|
-
const
|
|
126
|
+
const Jn = ({ mobileTiers: i = [0, 15, 30, 60], desktopTiers: e = [0, 15, 30, 60], override: t = {}, glContext: s, failIfMajorPerformanceCaveat: n = !1, benchmarksURL: a = "https://unpkg.com/detect-gpu@5.0.70/dist/benchmarks" } = {}) => Tt(void 0, void 0, void 0, function* () {
|
|
127
127
|
const r = {};
|
|
128
128
|
if (ns) return { tier: 0, type: "SSR" };
|
|
129
129
|
const { isIpad: o = !!ne?.isIpad, isMobile: c = !!ne?.isMobile, screenSize: l = window.screen, loadBenchmarks: h = (b) => Tt(void 0, void 0, void 0, function* () {
|
|
130
|
-
const O = yield fetch(`${a}/${b}`).then((
|
|
130
|
+
const O = yield fetch(`${a}/${b}`).then((x) => x.json());
|
|
131
131
|
if (parseInt(O.shift().split(".")[0], 10) < 4) throw new bi("Detect GPU benchmark data is out of date. Please update to version 4x");
|
|
132
132
|
return O;
|
|
133
133
|
}) } = t;
|
|
134
134
|
let { renderer: d } = t;
|
|
135
|
-
const u = (b, O,
|
|
135
|
+
const u = (b, O, x, P, w) => ({ device: w, fps: P, gpu: x, isMobile: c, tier: b, type: O });
|
|
136
136
|
let m, C = "";
|
|
137
137
|
if (d) d = yi(d), m = [d];
|
|
138
138
|
else {
|
|
139
|
-
const b = s || function(
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
const
|
|
139
|
+
const b = s || function(x, P = !1) {
|
|
140
|
+
const w = { alpha: !1, antialias: !1, depth: !1, failIfMajorPerformanceCaveat: P, powerPreference: "high-performance", stencil: !1 };
|
|
141
|
+
x && delete w.powerPreference;
|
|
142
|
+
const k = window.document.createElement("canvas"), Q = k.getContext("webgl", w) || k.getContext("experimental-webgl", w);
|
|
143
143
|
return Q ?? void 0;
|
|
144
144
|
}(ne?.isSafari12, n);
|
|
145
145
|
if (!b) return u(0, "WEBGL_UNSUPPORTED");
|
|
146
146
|
const O = ne?.isFirefox ? null : b.getExtension("WEBGL_debug_renderer_info");
|
|
147
147
|
if (d = O ? b.getParameter(O.UNMASKED_RENDERER_WEBGL) : b.getParameter(b.RENDERER), !d) return u(1, "FALLBACK");
|
|
148
|
-
C = d, d = yi(d), m = function(
|
|
149
|
-
return P === "apple gpu" ?
|
|
148
|
+
C = d, d = yi(d), m = function(x, P, w) {
|
|
149
|
+
return P === "apple gpu" ? Xn(x, P, w) : [P];
|
|
150
150
|
}(b, d, c);
|
|
151
151
|
}
|
|
152
152
|
const v = (yield Promise.all(m.map(function(b) {
|
|
153
153
|
var O;
|
|
154
154
|
return Tt(this, void 0, void 0, function* () {
|
|
155
|
-
const
|
|
155
|
+
const x = ((B) => {
|
|
156
156
|
const K = c ? ["adreno", "apple", "mali-t", "mali", "nvidia", "powervr", "samsung"] : ["intel", "apple", "amd", "radeon", "nvidia", "geforce", "adreno"];
|
|
157
157
|
for (const oe of K) if (B.includes(oe)) return oe;
|
|
158
158
|
})(b);
|
|
159
|
-
if (!
|
|
160
|
-
const P = `${c ? "m" : "d"}-${
|
|
161
|
-
let
|
|
159
|
+
if (!x) return;
|
|
160
|
+
const P = `${c ? "m" : "d"}-${x}${o ? "-ipad" : ""}.json`, w = r[P] = (O = r[P]) !== null && O !== void 0 ? O : h(P);
|
|
161
|
+
let k;
|
|
162
162
|
try {
|
|
163
|
-
|
|
163
|
+
k = yield w;
|
|
164
164
|
} catch (B) {
|
|
165
165
|
if (B instanceof bi) throw B;
|
|
166
166
|
return;
|
|
@@ -170,12 +170,12 @@ const Qn = ({ mobileTiers: i = [0, 15, 30, 60], desktopTiers: e = [0, 15, 30, 60
|
|
|
170
170
|
const oe = (B = B.replace(/\([^)]+\)/, "")).match(/\d+/) || B.match(/(\W|^)([A-Za-z]{1,3})(\W|$)/g);
|
|
171
171
|
return (K = oe?.join("").replace(/\W|amd/g, "")) !== null && K !== void 0 ? K : "";
|
|
172
172
|
}(b);
|
|
173
|
-
let ae =
|
|
174
|
-
ae.length || (ae =
|
|
173
|
+
let ae = k.filter(([, B]) => B === Q);
|
|
174
|
+
ae.length || (ae = k.filter(([B]) => B.includes(b)));
|
|
175
175
|
const pe = ae.length;
|
|
176
176
|
if (pe === 0) return;
|
|
177
177
|
const be = b.split(/[.,()\[\]/\s]/g).sort().filter((B, K, oe) => K === 0 || B !== oe[K - 1]).join(" ");
|
|
178
|
-
let me, [us, , , , ps] = pe > 1 ? ae.map((B) => [B,
|
|
178
|
+
let me, [us, , , , ps] = pe > 1 ? ae.map((B) => [B, jn(be, B[2])]).sort(([, B], [, K]) => B - K)[0][0] : ae[0], Et = Number.MAX_VALUE;
|
|
179
179
|
const { devicePixelRatio: ti } = window, ms = l.width * ti * l.height * ti;
|
|
180
180
|
for (const B of ps) {
|
|
181
181
|
const [K, oe] = B, vs = K * oe, ii = Math.abs(ms - vs);
|
|
@@ -185,9 +185,9 @@ const Qn = ({ mobileTiers: i = [0, 15, 30, 60], desktopTiers: e = [0, 15, 30, 60
|
|
|
185
185
|
const [, , fs, gs] = me;
|
|
186
186
|
return [Et, fs, us, gs];
|
|
187
187
|
});
|
|
188
|
-
}))).filter(
|
|
188
|
+
}))).filter(Qn).sort(([b = Number.MAX_VALUE, O], [x = Number.MAX_VALUE, P]) => b === x ? O - P : b - x);
|
|
189
189
|
if (!v.length) {
|
|
190
|
-
const b =
|
|
190
|
+
const b = Kn.find((O) => d.includes(O));
|
|
191
191
|
return b ? u(0, "BLOCKLISTED", b) : u(1, "FALLBACK", `${d} (${C})`);
|
|
192
192
|
}
|
|
193
193
|
const [, y, g, _] = v[0];
|
|
@@ -197,7 +197,7 @@ const Qn = ({ mobileTiers: i = [0, 15, 30, 60], desktopTiers: e = [0, 15, 30, 60
|
|
|
197
197
|
for (let b = 0; b < E.length; b++) y >= E[b] && (S = b);
|
|
198
198
|
return u(S, "BENCHMARK", g, y, _);
|
|
199
199
|
});
|
|
200
|
-
function
|
|
200
|
+
function er(i) {
|
|
201
201
|
let e = 0;
|
|
202
202
|
const t = performance.now();
|
|
203
203
|
function s() {
|
|
@@ -211,9 +211,9 @@ function Jn(i) {
|
|
|
211
211
|
}
|
|
212
212
|
requestAnimationFrame(s);
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function tr(i = !1, e = !1) {
|
|
215
215
|
return new Promise((t) => {
|
|
216
|
-
|
|
216
|
+
Jn().then((s) => {
|
|
217
217
|
let n = !1;
|
|
218
218
|
const a = document.createElement("canvas"), r = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
219
219
|
if (n = "transferControlToOffscreen" in a, r) {
|
|
@@ -232,7 +232,7 @@ function er(i = !1, e = !1) {
|
|
|
232
232
|
dev: i,
|
|
233
233
|
editor: e
|
|
234
234
|
};
|
|
235
|
-
s.tier === 3 ? o.quality = "High" : s.tier === 2 && (o.quality = "Medium"),
|
|
235
|
+
s.tier === 3 ? o.quality = "High" : s.tier === 2 && (o.quality = "Medium"), er((c) => {
|
|
236
236
|
o.fps = c, t(o);
|
|
237
237
|
});
|
|
238
238
|
});
|
|
@@ -247,63 +247,63 @@ function Zt(i, e, t) {
|
|
|
247
247
|
function je(i, e, t) {
|
|
248
248
|
return i * (1 - t) + e * t;
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function Fa(i, e, t, s, n) {
|
|
251
251
|
return je(t, s, Zt(i, e, n));
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function za(i, e) {
|
|
254
254
|
const t = i - e;
|
|
255
255
|
return Math.sqrt(t * t);
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function Ha(i, e, t, s) {
|
|
258
258
|
return je(i, e, 1 - Math.exp(-t * s));
|
|
259
259
|
}
|
|
260
260
|
function te(i, e = 1) {
|
|
261
261
|
return Number(i.toFixed(e));
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function Ba(i, e, t, s) {
|
|
264
264
|
return Math.atan2(s - e, t - i);
|
|
265
265
|
}
|
|
266
|
-
function
|
|
266
|
+
function ir(i, e, t, s) {
|
|
267
267
|
return i === e && t === s;
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function sr(i, e, t, s) {
|
|
270
270
|
return 1 / (3 * e * i * i + 2 * t * i + s);
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function nr(i, e, t, s, n) {
|
|
273
273
|
return e * (i * i * i) + t * (i * i) + s * i + n;
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function rr(i, e, t, s, n) {
|
|
276
276
|
const a = i * i;
|
|
277
277
|
return e * (a * i) + t * a + s * i + n;
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function Va(i, e, t, s, n) {
|
|
280
280
|
if (i <= 0) return 0;
|
|
281
281
|
if (i >= 1) return 1;
|
|
282
|
-
if (
|
|
282
|
+
if (ir(e, t, s, n)) return i;
|
|
283
283
|
const a = 0, r = 0, o = e, c = t, l = s, h = n, d = 1, u = 1, m = d - 3 * l + 3 * o - a, C = 3 * l - 6 * o + 3 * a, v = 3 * o - 3 * a, y = a, g = u - 3 * h + 3 * c - r, _ = 3 * h - 6 * c + 3 * r, E = 3 * c - 3 * r, S = r;
|
|
284
284
|
let b = i;
|
|
285
285
|
for (let O = 0; O < 5; O++) {
|
|
286
|
-
const
|
|
287
|
-
let P =
|
|
288
|
-
P === 1 / 0 && (P = i), b -= (
|
|
286
|
+
const x = nr(b, m, C, v, y);
|
|
287
|
+
let P = sr(b, m, C, v);
|
|
288
|
+
P === 1 / 0 && (P = i), b -= (x - i) * P, b = Math.min(Math.max(b, 0), 1);
|
|
289
289
|
}
|
|
290
|
-
return
|
|
290
|
+
return rr(b, g, _, E, S);
|
|
291
291
|
}
|
|
292
292
|
const st = (i) => Math.round(Math.min(1, Math.max(0, i)) * 255).toString(16).padStart(2, "0");
|
|
293
|
-
function
|
|
293
|
+
function Ga({ r: i, g: e, b: t, a: s = 1 }) {
|
|
294
294
|
const n = `#${st(i)}${st(e)}${st(t)}`;
|
|
295
295
|
return s < 1 ? `${n}${st(s)}` : n;
|
|
296
296
|
}
|
|
297
|
-
let
|
|
298
|
-
function
|
|
299
|
-
const [i, e] = L(
|
|
297
|
+
let we;
|
|
298
|
+
function $a() {
|
|
299
|
+
const [i, e] = L(we);
|
|
300
300
|
return ye(() => {
|
|
301
|
-
|
|
302
|
-
|
|
301
|
+
we || import("@tomorrowevening/theatre-studio").then((t) => {
|
|
302
|
+
we = t.default, we.initialize(), we.ui.hide(), e(we);
|
|
303
303
|
});
|
|
304
304
|
}, []), i;
|
|
305
305
|
}
|
|
306
|
-
async function
|
|
306
|
+
async function Wa() {
|
|
307
307
|
for (; !document.getElementById("theatrejs-studio-root"); )
|
|
308
308
|
await new Promise((s) => setTimeout(s, 100));
|
|
309
309
|
const i = document.getElementById("theatrejs-studio-root");
|
|
@@ -324,7 +324,7 @@ async function $a() {
|
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function Ya(i, e, t, s) {
|
|
328
328
|
s.sheetObject(i, e, {
|
|
329
329
|
transform: {
|
|
330
330
|
position: {
|
|
@@ -349,7 +349,7 @@ function Wa(i, e, t, s) {
|
|
|
349
349
|
t.position.copy(a.position), t.rotation.copy(a.rotation), t.scale.copy(a.scale), t.visible = a.visible;
|
|
350
350
|
});
|
|
351
351
|
}
|
|
352
|
-
const
|
|
352
|
+
const ar = [
|
|
353
353
|
"allowOverride",
|
|
354
354
|
"alphaHash",
|
|
355
355
|
"alphaTest",
|
|
@@ -454,10 +454,10 @@ function Si(i) {
|
|
|
454
454
|
}
|
|
455
455
|
return "object";
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function or(i) {
|
|
458
458
|
const e = [];
|
|
459
459
|
for (const s in i) {
|
|
460
|
-
const n =
|
|
460
|
+
const n = ar.find((o) => o === s), a = s.indexOf("_") === 0 || s.indexOf("is") === 0;
|
|
461
461
|
if (!(n || a))
|
|
462
462
|
if (s === "uniforms") {
|
|
463
463
|
const o = i.uniforms;
|
|
@@ -482,7 +482,7 @@ function ar(i) {
|
|
|
482
482
|
(s) => s.type !== "array" && s.type !== "object" && s.type !== "texture"
|
|
483
483
|
);
|
|
484
484
|
}
|
|
485
|
-
function
|
|
485
|
+
function lr(i) {
|
|
486
486
|
const e = {}, t = { nudgeMultiplier: 0.01 };
|
|
487
487
|
return i.forEach((s) => {
|
|
488
488
|
let n = s.value;
|
|
@@ -569,7 +569,7 @@ function or(i) {
|
|
|
569
569
|
e[s.name] = n;
|
|
570
570
|
}), e;
|
|
571
571
|
}
|
|
572
|
-
function
|
|
572
|
+
function cr(i, e, t) {
|
|
573
573
|
e.forEach((s) => {
|
|
574
574
|
if (i[s.name] !== void 0)
|
|
575
575
|
switch (s.type) {
|
|
@@ -590,20 +590,20 @@ function lr(i, e, t) {
|
|
|
590
590
|
}
|
|
591
591
|
});
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function Za(i, e, t, s) {
|
|
594
594
|
if (!t.isMaterial) return;
|
|
595
|
-
const n =
|
|
595
|
+
const n = or(t), a = lr(n);
|
|
596
596
|
s.sheetObject(i, e, {
|
|
597
597
|
material: a
|
|
598
598
|
}, (r) => {
|
|
599
|
-
|
|
599
|
+
cr(t, n, r);
|
|
600
600
|
});
|
|
601
601
|
}
|
|
602
602
|
const Jt = new zi();
|
|
603
|
-
Jt.setAttribute("position", new
|
|
604
|
-
Jt.setAttribute("normal", new
|
|
605
|
-
Jt.setAttribute("uv", new
|
|
606
|
-
const
|
|
603
|
+
Jt.setAttribute("position", new Ne([-0.5, -0.5, 0, 1.5, -0.5, 0, -0.5, 1.5, 0], 3));
|
|
604
|
+
Jt.setAttribute("normal", new Ne([0, 0, 1, 0, 0, 1], 3));
|
|
605
|
+
Jt.setAttribute("uv", new Ne([0, 0, 2, 0, 0, 2], 2));
|
|
606
|
+
const qa = new Hi(-0.5, 0.5, 0.5, -0.5, 0, 100), Oi = (i) => {
|
|
607
607
|
i?.dispose();
|
|
608
608
|
}, rs = (i) => {
|
|
609
609
|
if (i)
|
|
@@ -623,11 +623,11 @@ const Za = new Hi(-0.5, 0.5, 0.5, -0.5, 0, 100), Oi = (i) => {
|
|
|
623
623
|
}
|
|
624
624
|
i.dispose();
|
|
625
625
|
}
|
|
626
|
-
},
|
|
626
|
+
}, ce = (i) => {
|
|
627
627
|
if (i) {
|
|
628
628
|
for (; i.children.length > 0; ) {
|
|
629
629
|
const e = i.children[0];
|
|
630
|
-
e.type === "Audio" ? (e.pause(), e.parent && e.parent.remove(e)) :
|
|
630
|
+
e.type === "Audio" ? (e.pause(), e.parent && e.parent.remove(e)) : ce(e);
|
|
631
631
|
}
|
|
632
632
|
if (i.parent && i.parent.remove(i), i.isMesh) {
|
|
633
633
|
const e = i;
|
|
@@ -639,7 +639,7 @@ const Za = new Hi(-0.5, 0.5, 0.5, -0.5, 0, 100), Oi = (i) => {
|
|
|
639
639
|
let qt = 0;
|
|
640
640
|
const nt = () => {
|
|
641
641
|
qt = 0;
|
|
642
|
-
},
|
|
642
|
+
}, We = (i) => {
|
|
643
643
|
if (!i) return;
|
|
644
644
|
let e = i.name.replaceAll(" ", "").replaceAll("/", ".");
|
|
645
645
|
if (e.length === 0 && (e = `obj_${qt}`, qt++), i.parent !== null && i.parent.uuid.length > 0 && (e = `${i.parent.uuid}.${e}`), i.uuid = e, i.isMesh !== void 0) {
|
|
@@ -653,9 +653,9 @@ const nt = () => {
|
|
|
653
653
|
s.uuid = `${e}.material`;
|
|
654
654
|
}
|
|
655
655
|
}
|
|
656
|
-
i.children.forEach((t) =>
|
|
656
|
+
i.children.forEach((t) => We(t));
|
|
657
657
|
};
|
|
658
|
-
class
|
|
658
|
+
class le {
|
|
659
659
|
static renderer;
|
|
660
660
|
static canvas;
|
|
661
661
|
static context = null;
|
|
@@ -686,7 +686,7 @@ class ue {
|
|
|
686
686
|
if (this.material === null) {
|
|
687
687
|
this.camera = new Hi(-0.5, 0.5, 0.5, -0.5, 0, 100), this.scene = new ys(), this.material = new bs();
|
|
688
688
|
const t = new zi();
|
|
689
|
-
t.setAttribute("position", new
|
|
689
|
+
t.setAttribute("position", new Ne([-0.5, -0.5, 0, 1.5, -0.5, 0, -0.5, 1.5, 0], 3)), t.setAttribute("normal", new Ne([0, 0, 1, 0, 0, 1], 3)), t.setAttribute("uv", new Ne([0, 0, 2, 0, 0, 2], 2));
|
|
690
690
|
const s = new Bi(t, this.material);
|
|
691
691
|
this.scene.add(s);
|
|
692
692
|
}
|
|
@@ -699,7 +699,7 @@ class ue {
|
|
|
699
699
|
return this.renderer.domElement;
|
|
700
700
|
}
|
|
701
701
|
}
|
|
702
|
-
function
|
|
702
|
+
function Ka(i) {
|
|
703
703
|
return new Promise((e) => {
|
|
704
704
|
const t = new Es();
|
|
705
705
|
t.parseAsync(i.scene).then((s) => {
|
|
@@ -721,26 +721,26 @@ function qa(i) {
|
|
|
721
721
|
});
|
|
722
722
|
});
|
|
723
723
|
}
|
|
724
|
-
const
|
|
724
|
+
const Xa = (i, e, t, s) => {
|
|
725
725
|
i.setRenderTarget(s), i.clear(), i.render(e, t);
|
|
726
726
|
};
|
|
727
|
-
function
|
|
727
|
+
function hr(i, e, t, s) {
|
|
728
728
|
i.applyMatrix4(new Vi().makeTranslation(e, -t, -s));
|
|
729
729
|
}
|
|
730
|
-
function
|
|
730
|
+
function ja(i) {
|
|
731
731
|
i.computeBoundingBox();
|
|
732
732
|
const e = i.boundingBox, t = (e.max.x - e.min.x) / 2, s = (e.max.y - e.min.y) / 2;
|
|
733
|
-
|
|
733
|
+
hr(i, t, s, 0);
|
|
734
734
|
}
|
|
735
|
-
function
|
|
735
|
+
function Qa(i, e, t) {
|
|
736
736
|
i.left = e / -2, i.right = e / 2, i.top = t / 2, i.bottom = t / -2, i.position.x = e / 2, i.position.y = t / -2, i.updateProjectionMatrix();
|
|
737
737
|
}
|
|
738
|
-
function
|
|
738
|
+
function Ja(i, e, t) {
|
|
739
739
|
const s = 1.7777777777777777, n = e / t;
|
|
740
740
|
let a = e, r = t;
|
|
741
741
|
n > s ? a = t * s : r = e / s, i.left = a / -2, i.right = a / 2, i.top = r / 2, i.bottom = r / -2, i.updateProjectionMatrix();
|
|
742
742
|
}
|
|
743
|
-
function
|
|
743
|
+
function eo() {
|
|
744
744
|
let e = "transferControlToOffscreen" in document.createElement("canvas");
|
|
745
745
|
if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
|
|
746
746
|
const s = navigator.userAgent.match(/version\/(\d+)/i);
|
|
@@ -748,34 +748,34 @@ function Ja() {
|
|
|
748
748
|
}
|
|
749
749
|
return e;
|
|
750
750
|
}
|
|
751
|
-
function
|
|
751
|
+
function to(i, e, t = !0, s = !1) {
|
|
752
752
|
i.renderOrder = -e;
|
|
753
753
|
const n = i.material;
|
|
754
754
|
Array.isArray(n) ? n.forEach((a) => {
|
|
755
755
|
a.colorWrite = t, a.depthWrite = s, a.stencilWrite = !0, a.stencilRef = e, a.stencilFunc = si, a.stencilFail = Ee, a.stencilZFail = Ee, a.stencilZPass = Ee;
|
|
756
756
|
}) : (n.colorWrite = t, n.depthWrite = s, n.stencilWrite = !0, n.stencilRef = e, n.stencilFunc = si, n.stencilFail = Ee, n.stencilZFail = Ee, n.stencilZPass = Ee);
|
|
757
757
|
}
|
|
758
|
-
function
|
|
758
|
+
function io(i, e, t = !1) {
|
|
759
759
|
const s = i.material;
|
|
760
760
|
Array.isArray(s) ? s.forEach((n) => {
|
|
761
761
|
n.stencilWrite = !0, n.stencilRef = e, n.stencilFunc = t ? ni : ri, n.stencilFail = Se, n.stencilZFail = Se, n.stencilZPass = Se;
|
|
762
762
|
}) : (s.stencilWrite = !0, s.stencilRef = e, s.stencilFunc = t ? ni : ri, s.stencilFail = Se, s.stencilZFail = Se, s.stencilZPass = Se);
|
|
763
763
|
}
|
|
764
|
-
function
|
|
764
|
+
function so(i) {
|
|
765
765
|
i.blending = Gi, i.blendEquation = Je, i.blendSrc = gt, i.blendDst = vt, i.needsUpdate = !0;
|
|
766
766
|
}
|
|
767
|
-
function
|
|
767
|
+
function no(i) {
|
|
768
768
|
i.blending = _t, i.blendEquation = Je, i.blendSrc = gt, i.blendDst = Ct, i.needsUpdate = !0;
|
|
769
769
|
}
|
|
770
|
-
function
|
|
770
|
+
function ro(i) {
|
|
771
771
|
i.blending = _t, i.blendEquation = Je, i.blendSrc = jt, i.blendDst = vt, i.needsUpdate = !0;
|
|
772
772
|
}
|
|
773
|
-
function
|
|
773
|
+
function ao(i) {
|
|
774
774
|
i.blending = _t, i.blendEquation = Je, i.blendSrc = Qt, i.blendDst = Ct, i.needsUpdate = !0;
|
|
775
775
|
}
|
|
776
776
|
let Kt = [];
|
|
777
|
-
function
|
|
778
|
-
|
|
777
|
+
function dr(i, e, t = !0) {
|
|
778
|
+
le.renderer = e.renderer;
|
|
779
779
|
const s = [];
|
|
780
780
|
s.push({
|
|
781
781
|
type: "boolean",
|
|
@@ -802,7 +802,7 @@ function hr(i, e, t = !0) {
|
|
|
802
802
|
}
|
|
803
803
|
});
|
|
804
804
|
else if (o.value.isTexture && t) {
|
|
805
|
-
const h = o.value, d =
|
|
805
|
+
const h = o.value, d = le.renderToBlob(h);
|
|
806
806
|
s.push({
|
|
807
807
|
prop: c,
|
|
808
808
|
title: l,
|
|
@@ -855,7 +855,7 @@ function hr(i, e, t = !0) {
|
|
|
855
855
|
}
|
|
856
856
|
});
|
|
857
857
|
else if (c.value.isTexture && t) {
|
|
858
|
-
const h = c.value, d =
|
|
858
|
+
const h = c.value, d = le.renderToBlob(h);
|
|
859
859
|
s.push({
|
|
860
860
|
title: l,
|
|
861
861
|
prop: o,
|
|
@@ -899,22 +899,22 @@ function hr(i, e, t = !0) {
|
|
|
899
899
|
}
|
|
900
900
|
}), Kt.push(a);
|
|
901
901
|
}
|
|
902
|
-
function
|
|
902
|
+
function oo(i, e) {
|
|
903
903
|
i.passes.forEach((t) => {
|
|
904
|
-
|
|
904
|
+
dr(t, e);
|
|
905
905
|
});
|
|
906
906
|
}
|
|
907
|
-
function
|
|
907
|
+
function lo(i) {
|
|
908
908
|
Kt.forEach((e) => {
|
|
909
909
|
i.removeGroup(e);
|
|
910
910
|
}), Kt = [];
|
|
911
911
|
}
|
|
912
|
-
function
|
|
912
|
+
function co(i, e, t, s = 1024) {
|
|
913
913
|
return new Promise((n) => {
|
|
914
914
|
const a = e.aspect, r = e.fov, o = e.rotation.clone(), c = t.outputBuffer;
|
|
915
915
|
e.aspect = 1, e.fov = 90, e.updateProjectionMatrix();
|
|
916
|
-
const l = new
|
|
917
|
-
format:
|
|
916
|
+
const l = new xs(s, s, {
|
|
917
|
+
format: ws,
|
|
918
918
|
depthBuffer: !0,
|
|
919
919
|
stencilBuffer: !1
|
|
920
920
|
});
|
|
@@ -982,32 +982,32 @@ const Me = ei([
|
|
|
982
982
|
"clientY",
|
|
983
983
|
"pageX",
|
|
984
984
|
"pageY"
|
|
985
|
-
]),
|
|
985
|
+
]), ur = ei([
|
|
986
986
|
"clientX",
|
|
987
987
|
"clientY",
|
|
988
988
|
"deltaX",
|
|
989
989
|
"deltaY",
|
|
990
990
|
"deltaMode"
|
|
991
|
-
]),
|
|
991
|
+
]), pr = ei([
|
|
992
992
|
"ctrlKey",
|
|
993
993
|
"metaKey",
|
|
994
994
|
"shiftKey",
|
|
995
995
|
"keyCode"
|
|
996
996
|
]);
|
|
997
|
-
function
|
|
998
|
-
i.preventDefault(),
|
|
997
|
+
function mr(i, e) {
|
|
998
|
+
i.preventDefault(), ur(i, e);
|
|
999
999
|
}
|
|
1000
|
-
function
|
|
1000
|
+
function fr(i) {
|
|
1001
1001
|
i.preventDefault();
|
|
1002
1002
|
}
|
|
1003
|
-
function
|
|
1003
|
+
function gr(i, e, t) {
|
|
1004
1004
|
for (const s of e)
|
|
1005
1005
|
t[s] = i[s];
|
|
1006
1006
|
}
|
|
1007
1007
|
function ei(i) {
|
|
1008
1008
|
return function(t, s) {
|
|
1009
1009
|
const n = { type: t.type };
|
|
1010
|
-
|
|
1010
|
+
gr(t, i, n), s(n);
|
|
1011
1011
|
};
|
|
1012
1012
|
}
|
|
1013
1013
|
function At(i, e) {
|
|
@@ -1021,7 +1021,7 @@ function At(i, e) {
|
|
|
1021
1021
|
}
|
|
1022
1022
|
e(s);
|
|
1023
1023
|
}
|
|
1024
|
-
const
|
|
1024
|
+
const vr = {
|
|
1025
1025
|
37: !0,
|
|
1026
1026
|
// left
|
|
1027
1027
|
38: !0,
|
|
@@ -1031,12 +1031,12 @@ const gr = {
|
|
|
1031
1031
|
40: !0
|
|
1032
1032
|
// down
|
|
1033
1033
|
};
|
|
1034
|
-
function
|
|
1034
|
+
function _r(i, e) {
|
|
1035
1035
|
const { keyCode: t } = i;
|
|
1036
|
-
|
|
1036
|
+
vr[t] && (i.preventDefault(), pr(i, e));
|
|
1037
1037
|
}
|
|
1038
|
-
const
|
|
1039
|
-
contextmenu:
|
|
1038
|
+
const ho = {
|
|
1039
|
+
contextmenu: fr,
|
|
1040
1040
|
mousedown: Me,
|
|
1041
1041
|
mousemove: Me,
|
|
1042
1042
|
mouseup: Me,
|
|
@@ -1046,15 +1046,15 @@ const co = {
|
|
|
1046
1046
|
touchstart: At,
|
|
1047
1047
|
touchmove: At,
|
|
1048
1048
|
touchend: At,
|
|
1049
|
-
wheel:
|
|
1050
|
-
keydown:
|
|
1049
|
+
wheel: mr,
|
|
1050
|
+
keydown: _r
|
|
1051
1051
|
};
|
|
1052
|
-
let
|
|
1053
|
-
class
|
|
1052
|
+
let Cr = 0;
|
|
1053
|
+
class uo {
|
|
1054
1054
|
id;
|
|
1055
1055
|
worker;
|
|
1056
1056
|
constructor(e, t, s) {
|
|
1057
|
-
this.id =
|
|
1057
|
+
this.id = Cr++, this.worker = t;
|
|
1058
1058
|
const n = (r) => {
|
|
1059
1059
|
this.worker.postMessage({
|
|
1060
1060
|
type: "event",
|
|
@@ -1082,7 +1082,7 @@ class ho {
|
|
|
1082
1082
|
window.addEventListener("resize", a), a();
|
|
1083
1083
|
}
|
|
1084
1084
|
}
|
|
1085
|
-
class
|
|
1085
|
+
class yr extends $i {
|
|
1086
1086
|
style = {};
|
|
1087
1087
|
left = 0;
|
|
1088
1088
|
top = 0;
|
|
@@ -1136,13 +1136,13 @@ class Cr extends $i {
|
|
|
1136
1136
|
return this;
|
|
1137
1137
|
}
|
|
1138
1138
|
}
|
|
1139
|
-
class
|
|
1139
|
+
class po {
|
|
1140
1140
|
targets = {};
|
|
1141
1141
|
constructor() {
|
|
1142
1142
|
this.handleEvent = this.handleEvent.bind(this);
|
|
1143
1143
|
}
|
|
1144
1144
|
makeProxy(e) {
|
|
1145
|
-
const { id: t } = e, s = new
|
|
1145
|
+
const { id: t } = e, s = new yr();
|
|
1146
1146
|
this.targets[t] = s;
|
|
1147
1147
|
}
|
|
1148
1148
|
getProxy(e) {
|
|
@@ -1152,7 +1152,7 @@ class uo {
|
|
|
1152
1152
|
this.targets[e.id]?.handleEvent(e.data);
|
|
1153
1153
|
}
|
|
1154
1154
|
}
|
|
1155
|
-
class
|
|
1155
|
+
class mo {
|
|
1156
1156
|
assets = {
|
|
1157
1157
|
audio: /* @__PURE__ */ new Map(),
|
|
1158
1158
|
image: /* @__PURE__ */ new Map(),
|
|
@@ -1182,7 +1182,7 @@ class po {
|
|
|
1182
1182
|
}
|
|
1183
1183
|
detectSettings(e = !1, t = !1) {
|
|
1184
1184
|
return new Promise((s) => {
|
|
1185
|
-
|
|
1185
|
+
tr(e, t).then((n) => {
|
|
1186
1186
|
this.settings = n, s();
|
|
1187
1187
|
});
|
|
1188
1188
|
});
|
|
@@ -1257,15 +1257,15 @@ class as {
|
|
|
1257
1257
|
handleEditor(e) {
|
|
1258
1258
|
}
|
|
1259
1259
|
}
|
|
1260
|
-
function
|
|
1260
|
+
function br(i, e, t, s, n) {
|
|
1261
1261
|
const a = 1 - i;
|
|
1262
1262
|
return a * a * a * e + 3 * a * a * i * t + 3 * a * i * i * s + i * i * i * n;
|
|
1263
1263
|
}
|
|
1264
|
-
function
|
|
1264
|
+
function Er(i, e, t) {
|
|
1265
1265
|
if (i.type !== "bezier" || i.handles.length !== 4)
|
|
1266
1266
|
throw new Error("Invalid keyframe data for Bézier interpolation.");
|
|
1267
1267
|
const [s, n] = i.handles, a = (t - i.position) / (e.position - i.position);
|
|
1268
|
-
return
|
|
1268
|
+
return br(
|
|
1269
1269
|
a,
|
|
1270
1270
|
i.value,
|
|
1271
1271
|
i.value + s,
|
|
@@ -1273,7 +1273,7 @@ function br(i, e, t) {
|
|
|
1273
1273
|
e.value
|
|
1274
1274
|
);
|
|
1275
1275
|
}
|
|
1276
|
-
class
|
|
1276
|
+
class fo extends as {
|
|
1277
1277
|
project;
|
|
1278
1278
|
sheets = /* @__PURE__ */ new Map();
|
|
1279
1279
|
sheetObjects = /* @__PURE__ */ new Map();
|
|
@@ -1350,7 +1350,7 @@ class mo extends as {
|
|
|
1350
1350
|
l !== void 0 && (h = { ...s, ...l.value }), l = r.object(t, h, { reconfigure: !0 }), this.sheetObjects.set(c, l), this.sheetObjectCBs.set(c, n !== void 0 ? n : pt);
|
|
1351
1351
|
function d(m, C, v) {
|
|
1352
1352
|
if (typeof v == "object")
|
|
1353
|
-
if (
|
|
1353
|
+
if (qn(v))
|
|
1354
1354
|
m[C] = {
|
|
1355
1355
|
r: v.r,
|
|
1356
1356
|
g: v.g,
|
|
@@ -1402,7 +1402,7 @@ class mo extends as {
|
|
|
1402
1402
|
if (!y) return g?.value || 0;
|
|
1403
1403
|
if (!g || y.position === v) return y.value;
|
|
1404
1404
|
if (y.type === "bezier")
|
|
1405
|
-
return
|
|
1405
|
+
return Er(y, g, v);
|
|
1406
1406
|
const _ = (v - y.position) / (g.position - y.position);
|
|
1407
1407
|
return y.value + _ * (g.value - y.value);
|
|
1408
1408
|
};
|
|
@@ -1503,7 +1503,7 @@ class mo extends as {
|
|
|
1503
1503
|
this.studio?.ui.hide();
|
|
1504
1504
|
}
|
|
1505
1505
|
}
|
|
1506
|
-
function
|
|
1506
|
+
function Sr(i) {
|
|
1507
1507
|
if (i.name === "cameras")
|
|
1508
1508
|
return "camera";
|
|
1509
1509
|
if (i.name === "interactive")
|
|
@@ -1517,7 +1517,7 @@ function Er(i) {
|
|
|
1517
1517
|
const e = i.type;
|
|
1518
1518
|
return e.search("Helper") > -1 ? "icon_utils" : e.search("Camera") > -1 ? "camera" : e.search("Light") > -1 ? "light" : "obj3D";
|
|
1519
1519
|
}
|
|
1520
|
-
function
|
|
1520
|
+
function he(i) {
|
|
1521
1521
|
const e = {
|
|
1522
1522
|
name: i.name,
|
|
1523
1523
|
type: i.type,
|
|
@@ -1525,10 +1525,10 @@ function ce(i) {
|
|
|
1525
1525
|
children: []
|
|
1526
1526
|
};
|
|
1527
1527
|
return i.children.forEach((t) => {
|
|
1528
|
-
e.children.push(
|
|
1528
|
+
e.children.push(he(t));
|
|
1529
1529
|
}), e;
|
|
1530
1530
|
}
|
|
1531
|
-
function
|
|
1531
|
+
function Or(i) {
|
|
1532
1532
|
const e = {};
|
|
1533
1533
|
for (const t in i) {
|
|
1534
1534
|
const s = i[t].value;
|
|
@@ -1544,7 +1544,7 @@ function Sr(i) {
|
|
|
1544
1544
|
}
|
|
1545
1545
|
return e;
|
|
1546
1546
|
}
|
|
1547
|
-
function
|
|
1547
|
+
function xr(i) {
|
|
1548
1548
|
switch (i) {
|
|
1549
1549
|
case "blendSrcAlpha":
|
|
1550
1550
|
case "blendDstAlpha":
|
|
@@ -1559,7 +1559,7 @@ function Or(i) {
|
|
|
1559
1559
|
function Ae(i) {
|
|
1560
1560
|
const e = {};
|
|
1561
1561
|
for (const t in i) {
|
|
1562
|
-
if (t.substring(0, 1) === "_" || t.substring(0, 2) === "is" ||
|
|
1562
|
+
if (t.substring(0, 1) === "_" || t.substring(0, 2) === "is" || xr(t)) continue;
|
|
1563
1563
|
const s = typeof i[t], n = i[t];
|
|
1564
1564
|
switch (s) {
|
|
1565
1565
|
case "boolean":
|
|
@@ -1568,15 +1568,26 @@ function Ae(i) {
|
|
|
1568
1568
|
e[t] = n;
|
|
1569
1569
|
break;
|
|
1570
1570
|
case "object":
|
|
1571
|
-
n !== null
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1571
|
+
if (n !== null)
|
|
1572
|
+
if (n.isTexture)
|
|
1573
|
+
e[t] = {
|
|
1574
|
+
src: le.renderToBlob(n),
|
|
1575
|
+
offset: [n.offset.x, n.offset.y],
|
|
1576
|
+
repeat: [n.repeat.x, n.repeat.y]
|
|
1577
|
+
};
|
|
1578
|
+
else if (n.isUniformNode) {
|
|
1579
|
+
const a = n.value;
|
|
1580
|
+
e[t] = {
|
|
1581
|
+
__isUniform: !0,
|
|
1582
|
+
value: a?.isTexture ? { src: le.renderToBlob(a), offset: [a.offset.x, a.offset.y], repeat: [a.repeat.x, a.repeat.y] } : a
|
|
1583
|
+
};
|
|
1584
|
+
} else t === "uniforms" ? e[t] = Or(n) : t.search("Node") > -1 || (e[t] = n);
|
|
1585
|
+
else
|
|
1586
|
+
t === "glslVersion" ? e[t] = "" : t.search("Node") > -1 || (e[t] = {
|
|
1587
|
+
src: "",
|
|
1588
|
+
offset: [0, 0],
|
|
1589
|
+
repeat: [1, 1]
|
|
1590
|
+
});
|
|
1580
1591
|
break;
|
|
1581
1592
|
}
|
|
1582
1593
|
}
|
|
@@ -1679,7 +1690,7 @@ function wr(i, e) {
|
|
|
1679
1690
|
return i[t[0]][t[1]][t[2]][t[3]][t[4]][t[5]];
|
|
1680
1691
|
}
|
|
1681
1692
|
}
|
|
1682
|
-
function
|
|
1693
|
+
function Tr(i, e) {
|
|
1683
1694
|
for (const t in e) i[t] = e[t];
|
|
1684
1695
|
}
|
|
1685
1696
|
function V(i, e, t) {
|
|
@@ -1725,7 +1736,7 @@ function V(i, e, t) {
|
|
|
1725
1736
|
r = i[s[0]][s[1]][s[2]][s[3]][s[4]];
|
|
1726
1737
|
break;
|
|
1727
1738
|
}
|
|
1728
|
-
r != null ?
|
|
1739
|
+
r != null ? Tr(r, t) : console.log(`Hermes - Can't set props because target isn't found: ${e}`, t);
|
|
1729
1740
|
}
|
|
1730
1741
|
}
|
|
1731
1742
|
function os(i) {
|
|
@@ -1738,7 +1749,7 @@ function os(i) {
|
|
|
1738
1749
|
});
|
|
1739
1750
|
}
|
|
1740
1751
|
var D = /* @__PURE__ */ ((i) => (i.CUSTOM = "ToolEvents::custom", i.SELECT_DROPDOWN = "ToolEvents::selectDropdown", i.DRAG_UPDATE = "ToolEvents::dragUpdate", i.ADD_SCENE = "ToolEvents::addScene", i.REFRESH_SCENE = "ToolEvents::refreshScene", i.REMOVE_SCENE = "ToolEvents::removeScene", i.SET_SCENE = "ToolEvents::setScene", i.SET_OBJECT = "ToolEvents::setObject", i.CLEAR_OBJECT = "ToolEvents::clearObject", i.ADD_CAMERA = "ToolEvents::addCamera", i.REMOVE_CAMERA = "ToolEvents::removeCamera", i.ADD_GROUP = "ToolEvents::addGroup", i.REMOVE_GROUP = "ToolEvents::removeGroup", i.ADD_SPLINE = "ToolEvents::addSpline", i.ADD_RENDERER = "ToolEvents::addRenderer", i.UPDATE_RENDERER = "ToolEvents::updateRenderer", i))(D || {});
|
|
1741
|
-
class
|
|
1752
|
+
class go extends as {
|
|
1742
1753
|
name;
|
|
1743
1754
|
canvas = null;
|
|
1744
1755
|
// Canvas or OffscreenCanvas
|
|
@@ -1756,8 +1767,8 @@ class fo extends as {
|
|
|
1756
1767
|
}
|
|
1757
1768
|
dispose() {
|
|
1758
1769
|
this.scenes.forEach((e) => {
|
|
1759
|
-
|
|
1760
|
-
}), this.scenes.clear(), this.scene &&
|
|
1770
|
+
ce(e);
|
|
1771
|
+
}), this.scenes.clear(), this.scene && ce(this.scene), this.renderTargets.forEach((e) => {
|
|
1761
1772
|
e.dispose();
|
|
1762
1773
|
}), this.renderTargets.clear(), this.renderer?.dispose();
|
|
1763
1774
|
}
|
|
@@ -1801,12 +1812,12 @@ class fo extends as {
|
|
|
1801
1812
|
}
|
|
1802
1813
|
getObject(e) {
|
|
1803
1814
|
if (!this.debug) return;
|
|
1804
|
-
this.renderer !== void 0 && (
|
|
1815
|
+
this.renderer !== void 0 && (le.renderer = this.renderer);
|
|
1805
1816
|
const t = this.getObjectByUUID(e);
|
|
1806
1817
|
t && this.setObject(t);
|
|
1807
1818
|
}
|
|
1808
1819
|
setObject(e) {
|
|
1809
|
-
this.renderer !== void 0 && (
|
|
1820
|
+
this.renderer !== void 0 && (le.renderer = this.renderer);
|
|
1810
1821
|
const t = Rt(e);
|
|
1811
1822
|
this.dispatchEvent({ type: "ToolEvents::setObject", value: t });
|
|
1812
1823
|
}
|
|
@@ -1952,8 +1963,8 @@ class fo extends as {
|
|
|
1952
1963
|
// Scenes
|
|
1953
1964
|
addScene(e) {
|
|
1954
1965
|
if (e === void 0 || (this.scenes.set(e.name, e), !this.debug)) return;
|
|
1955
|
-
nt(),
|
|
1956
|
-
const t =
|
|
1966
|
+
nt(), We(e);
|
|
1967
|
+
const t = he(e);
|
|
1957
1968
|
this.send({
|
|
1958
1969
|
event: "addScene",
|
|
1959
1970
|
target: "editor",
|
|
@@ -1964,7 +1975,7 @@ class fo extends as {
|
|
|
1964
1975
|
if (!this.debug) return;
|
|
1965
1976
|
const t = this.scenes.get(e);
|
|
1966
1977
|
if (t !== void 0) {
|
|
1967
|
-
const s =
|
|
1978
|
+
const s = he(t);
|
|
1968
1979
|
this.send({
|
|
1969
1980
|
event: "refreshScene",
|
|
1970
1981
|
target: "app",
|
|
@@ -1974,7 +1985,7 @@ class fo extends as {
|
|
|
1974
1985
|
}
|
|
1975
1986
|
removeScene(e) {
|
|
1976
1987
|
if (e === void 0 || (this.scenes.delete(e.name), !this.debug)) return;
|
|
1977
|
-
const t =
|
|
1988
|
+
const t = he(e);
|
|
1978
1989
|
this.send({
|
|
1979
1990
|
event: "removeScene",
|
|
1980
1991
|
target: "editor",
|
|
@@ -1992,8 +2003,8 @@ class fo extends as {
|
|
|
1992
2003
|
}
|
|
1993
2004
|
setScene(e) {
|
|
1994
2005
|
if (e === void 0 || (this.scene = e, !this.debug)) return;
|
|
1995
|
-
this.renderer !== void 0 && (
|
|
1996
|
-
const t =
|
|
2006
|
+
this.renderer !== void 0 && (le.renderer = this.renderer), nt(), We(e);
|
|
2007
|
+
const t = he(e);
|
|
1997
2008
|
this.send({
|
|
1998
2009
|
event: "setScene",
|
|
1999
2010
|
target: "editor",
|
|
@@ -2043,7 +2054,7 @@ class fo extends as {
|
|
|
2043
2054
|
this.send({
|
|
2044
2055
|
event: "refreshScene",
|
|
2045
2056
|
target: "editor",
|
|
2046
|
-
data:
|
|
2057
|
+
data: he(this.scenes.get(e.data.name))
|
|
2047
2058
|
});
|
|
2048
2059
|
break;
|
|
2049
2060
|
case "updateRenderer":
|
|
@@ -2074,15 +2085,15 @@ class fo extends as {
|
|
|
2074
2085
|
break;
|
|
2075
2086
|
case "requestScene":
|
|
2076
2087
|
this.scenes.forEach((t) => {
|
|
2077
|
-
nt(),
|
|
2088
|
+
nt(), We(t), this.send({
|
|
2078
2089
|
event: "addScene",
|
|
2079
2090
|
target: "editor",
|
|
2080
|
-
data:
|
|
2091
|
+
data: he(t)
|
|
2081
2092
|
});
|
|
2082
|
-
}), this.scene !== void 0 && (this.renderer !== void 0 && (
|
|
2093
|
+
}), this.scene !== void 0 && (this.renderer !== void 0 && (le.renderer = this.renderer), nt(), We(this.scene), this.send({
|
|
2083
2094
|
event: "setScene",
|
|
2084
2095
|
target: "editor",
|
|
2085
|
-
data:
|
|
2096
|
+
data: he(this.scene)
|
|
2086
2097
|
}));
|
|
2087
2098
|
break;
|
|
2088
2099
|
}
|
|
@@ -2151,7 +2162,7 @@ class fo extends as {
|
|
|
2151
2162
|
addRT(e, t = !0, s) {
|
|
2152
2163
|
if (!this.renderer) return;
|
|
2153
2164
|
let n;
|
|
2154
|
-
this.renderer instanceof
|
|
2165
|
+
this.renderer instanceof Ge ? n = new Js(32, 32, s) : n = new en(32, 32, s), n.texture.name = e, this.renderTargets.set(e, n), this.renderTargetsResize.set(e, t);
|
|
2155
2166
|
}
|
|
2156
2167
|
removeRT(e) {
|
|
2157
2168
|
this.renderTargets.delete(e), this.renderTargetsResize.delete(e);
|
|
@@ -2180,11 +2191,11 @@ class fo extends as {
|
|
|
2180
2191
|
function ls(i) {
|
|
2181
2192
|
return i.title.search("<") > -1 ? /* @__PURE__ */ f("button", { className: "svg", dangerouslySetInnerHTML: { __html: i.title } }) : /* @__PURE__ */ f("button", { children: i.title });
|
|
2182
2193
|
}
|
|
2183
|
-
const
|
|
2194
|
+
const Mr = /* @__PURE__ */ M("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
|
|
2184
2195
|
/* @__PURE__ */ f("circle", { cx: "7", cy: "7", r: "6" }),
|
|
2185
2196
|
/* @__PURE__ */ f("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
|
|
2186
2197
|
/* @__PURE__ */ f("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
|
|
2187
|
-
] }),
|
|
2198
|
+
] }), Ar = /* @__PURE__ */ f("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ f(
|
|
2188
2199
|
"path",
|
|
2189
2200
|
{
|
|
2190
2201
|
d: `M10.43,4H3.57C3.26,4,3,4.22,3,4.5v1C3,5.78,3.26,6,3.57,6h6.86C10.74,6,11,5.78,11,5.5v-1\r
|
|
@@ -2192,7 +2203,7 @@ C11,4.22,10.74,4,10.43,4z M10.43,8H3.57C3.26,8,3,8.22,3,8.5v1C3,9.78,3.26,10,3.5
|
|
|
2192
2203
|
C11,8.22,10.74,8,10.43,8z`
|
|
2193
2204
|
}
|
|
2194
2205
|
) });
|
|
2195
|
-
function
|
|
2206
|
+
function Rr(i) {
|
|
2196
2207
|
return /* @__PURE__ */ f(
|
|
2197
2208
|
"li",
|
|
2198
2209
|
{
|
|
@@ -2204,14 +2215,14 @@ function Ar(i) {
|
|
|
2204
2215
|
},
|
|
2205
2216
|
onDragEnd: i.onDragEnd,
|
|
2206
2217
|
children: /* @__PURE__ */ M("div", { children: [
|
|
2207
|
-
|
|
2218
|
+
Ar,
|
|
2208
2219
|
/* @__PURE__ */ f("span", { children: i.title }),
|
|
2209
|
-
/* @__PURE__ */ f("button", { className: "closeIcon", onClick: () => i.onDelete(i.index), children:
|
|
2220
|
+
/* @__PURE__ */ f("button", { className: "closeIcon", onClick: () => i.onDelete(i.index), children: Mr })
|
|
2210
2221
|
] })
|
|
2211
2222
|
}
|
|
2212
2223
|
);
|
|
2213
2224
|
}
|
|
2214
|
-
function
|
|
2225
|
+
function Dr(i) {
|
|
2215
2226
|
const [e, t] = L(!1), [s, n] = L(i.options), [a, r] = L(null), o = (m) => {
|
|
2216
2227
|
i.onDragComplete(m), n(m);
|
|
2217
2228
|
}, c = (m) => {
|
|
@@ -2230,7 +2241,7 @@ function Rr(i) {
|
|
|
2230
2241
|
return i.subdropdown && (u += " subdropdown"), /* @__PURE__ */ M("div", { className: u, onMouseEnter: () => t(!0), onMouseLeave: () => t(!1), children: [
|
|
2231
2242
|
/* @__PURE__ */ f(ls, { title: i.title }),
|
|
2232
2243
|
/* @__PURE__ */ f("ul", { className: "reorder-list", style: { display: e ? "block" : "none" }, children: s.map((m, C) => /* @__PURE__ */ f(
|
|
2233
|
-
|
|
2244
|
+
Rr,
|
|
2234
2245
|
{
|
|
2235
2246
|
title: m,
|
|
2236
2247
|
index: C,
|
|
@@ -2244,10 +2255,10 @@ function Rr(i) {
|
|
|
2244
2255
|
)) })
|
|
2245
2256
|
] });
|
|
2246
2257
|
}
|
|
2247
|
-
function
|
|
2258
|
+
function Pr(i) {
|
|
2248
2259
|
const [e, t] = L(!1), s = [];
|
|
2249
2260
|
i.options.map((a, r) => {
|
|
2250
|
-
i.onSelect !== void 0 && (a.onSelect = i.onSelect), s.push(/* @__PURE__ */ f(
|
|
2261
|
+
i.onSelect !== void 0 && (a.onSelect = i.onSelect), s.push(/* @__PURE__ */ f(Ir, { option: a }, r));
|
|
2251
2262
|
});
|
|
2252
2263
|
let n = "dropdown";
|
|
2253
2264
|
return i.subdropdown && (n += " subdropdown"), /* @__PURE__ */ M(
|
|
@@ -2269,13 +2280,13 @@ function Dr(i) {
|
|
|
2269
2280
|
}
|
|
2270
2281
|
);
|
|
2271
2282
|
}
|
|
2272
|
-
function
|
|
2283
|
+
function Ir(i) {
|
|
2273
2284
|
const { option: e } = i, [t, s] = L("");
|
|
2274
2285
|
let n;
|
|
2275
2286
|
switch (e.type) {
|
|
2276
2287
|
case "draggable":
|
|
2277
2288
|
n = /* @__PURE__ */ f(
|
|
2278
|
-
|
|
2289
|
+
Dr,
|
|
2279
2290
|
{
|
|
2280
2291
|
title: e.title,
|
|
2281
2292
|
options: e.value,
|
|
@@ -2288,7 +2299,7 @@ function Pr(i) {
|
|
|
2288
2299
|
break;
|
|
2289
2300
|
case "dropdown":
|
|
2290
2301
|
n = /* @__PURE__ */ f(
|
|
2291
|
-
|
|
2302
|
+
Pr,
|
|
2292
2303
|
{
|
|
2293
2304
|
title: e.title,
|
|
2294
2305
|
options: e.value,
|
|
@@ -2427,7 +2438,7 @@ function cs(i) {
|
|
|
2427
2438
|
}
|
|
2428
2439
|
}
|
|
2429
2440
|
),
|
|
2430
|
-
/* @__PURE__ */ f("div", { className: `icon ${
|
|
2441
|
+
/* @__PURE__ */ f("div", { className: `icon ${Sr(i.child)}` })
|
|
2431
2442
|
] }),
|
|
2432
2443
|
/* @__PURE__ */ f("div", { className: t ? "open" : "", children: /* @__PURE__ */ f("div", { className: "container", children: a }) })
|
|
2433
2444
|
] }, Math.random());
|
|
@@ -2438,7 +2449,7 @@ function Dt(i) {
|
|
|
2438
2449
|
e.push(/* @__PURE__ */ f(cs, { child: t, scene: i.scene, three: i.three }, s));
|
|
2439
2450
|
}), /* @__PURE__ */ f("div", { className: `scene ${i.class !== void 0 ? i.class : ""}`, children: e });
|
|
2440
2451
|
}
|
|
2441
|
-
function
|
|
2452
|
+
function Ye(i) {
|
|
2442
2453
|
const [e, t] = L(i.defaultValue);
|
|
2443
2454
|
return ye(() => {
|
|
2444
2455
|
let s = !1, n = -1, a = 0, r = i.defaultValue, o = !1;
|
|
@@ -2463,7 +2474,7 @@ function We(i) {
|
|
|
2463
2474
|
}
|
|
2464
2475
|
function Ce(i) {
|
|
2465
2476
|
const e = z(null), t = z(null), [s, n] = L(i.value);
|
|
2466
|
-
return
|
|
2477
|
+
return Ye({
|
|
2467
2478
|
label: i.labelRef,
|
|
2468
2479
|
input: e,
|
|
2469
2480
|
sliderRef: t,
|
|
@@ -2529,50 +2540,50 @@ function Ce(i) {
|
|
|
2529
2540
|
] })
|
|
2530
2541
|
] });
|
|
2531
2542
|
}
|
|
2532
|
-
function
|
|
2543
|
+
function Ur(i) {
|
|
2533
2544
|
const e = z(null), t = z(null), s = z(null), n = z(null), a = z(null), r = z(null), o = z(null), c = z(null), l = z(null), h = z(null), [d, u] = L(i.value.x), [m, C] = L(i.value.y), [v, y] = L({
|
|
2534
2545
|
min: Math.min(i.min, Math.min(i.value.x, i.value.y)),
|
|
2535
2546
|
max: Math.max(i.max, Math.max(i.value.x, i.value.y))
|
|
2536
2547
|
}), [g, _] = L(!1);
|
|
2537
|
-
|
|
2548
|
+
Ye({
|
|
2538
2549
|
label: o,
|
|
2539
2550
|
input: e,
|
|
2540
2551
|
defaultValue: d,
|
|
2541
2552
|
min: v.min,
|
|
2542
2553
|
max: v.max,
|
|
2543
2554
|
step: 0.01,
|
|
2544
|
-
onChange: (
|
|
2545
|
-
u(
|
|
2555
|
+
onChange: (w) => {
|
|
2556
|
+
u(w), i.onChange({ target: { value: { x: w, y: m } } });
|
|
2546
2557
|
}
|
|
2547
|
-
}),
|
|
2558
|
+
}), Ye({
|
|
2548
2559
|
label: c,
|
|
2549
2560
|
input: t,
|
|
2550
2561
|
defaultValue: m,
|
|
2551
2562
|
min: v.min,
|
|
2552
2563
|
max: v.max,
|
|
2553
2564
|
step: 0.01,
|
|
2554
|
-
onChange: (
|
|
2555
|
-
C(
|
|
2565
|
+
onChange: (w) => {
|
|
2566
|
+
C(w), i.onChange({ target: { value: { x: d, y: w } } });
|
|
2556
2567
|
}
|
|
2557
|
-
}),
|
|
2568
|
+
}), Ye({
|
|
2558
2569
|
label: l,
|
|
2559
2570
|
input: s,
|
|
2560
2571
|
defaultValue: v.min,
|
|
2561
2572
|
min: v.min - 1,
|
|
2562
2573
|
max: v.max + 1,
|
|
2563
2574
|
step: 0.01,
|
|
2564
|
-
onChange: (
|
|
2565
|
-
y({ min:
|
|
2575
|
+
onChange: (w) => {
|
|
2576
|
+
y({ min: w, max: v.max });
|
|
2566
2577
|
}
|
|
2567
|
-
}),
|
|
2578
|
+
}), Ye({
|
|
2568
2579
|
label: h,
|
|
2569
2580
|
input: n,
|
|
2570
2581
|
defaultValue: v.max,
|
|
2571
2582
|
min: v.min - 1,
|
|
2572
2583
|
max: v.max + 1,
|
|
2573
2584
|
step: 0.01,
|
|
2574
|
-
onChange: (
|
|
2575
|
-
y({ min: v.min, max:
|
|
2585
|
+
onChange: (w) => {
|
|
2586
|
+
y({ min: v.min, max: w });
|
|
2576
2587
|
}
|
|
2577
2588
|
});
|
|
2578
2589
|
function E() {
|
|
@@ -2581,17 +2592,17 @@ function Ir(i) {
|
|
|
2581
2592
|
function S() {
|
|
2582
2593
|
window.removeEventListener("mousemove", b), window.removeEventListener("mouseup", S), _(!1);
|
|
2583
2594
|
}
|
|
2584
|
-
function b(
|
|
2585
|
-
const
|
|
2595
|
+
function b(w) {
|
|
2596
|
+
const k = a.current.getBoundingClientRect(), Q = _e(0, 99, w.clientX - k.left) / 99, ae = 1 - _e(0, 99, w.clientY - k.top) / 99, pe = te(je(v.min, v.max, Q), 3), be = te(je(v.min, v.max, ae), 3);
|
|
2586
2597
|
i.onChange({ target: { value: { x: pe, y: be } } }), u(pe), C(be);
|
|
2587
2598
|
}
|
|
2588
2599
|
function O() {
|
|
2589
|
-
const
|
|
2590
|
-
y({ min:
|
|
2600
|
+
const w = Number(s.current.value);
|
|
2601
|
+
y({ min: w, max: v.max }), d < w && u(_e(w, v.max, d)), m < w && C(_e(w, v.max, m));
|
|
2591
2602
|
}
|
|
2592
|
-
function
|
|
2593
|
-
const
|
|
2594
|
-
y({ min: v.min, max:
|
|
2603
|
+
function x() {
|
|
2604
|
+
const w = Number(n.current.value);
|
|
2605
|
+
y({ min: v.min, max: w }), d > w && u(_e(v.min, w, d)), m > w && C(_e(v.min, w, m));
|
|
2595
2606
|
}
|
|
2596
2607
|
ye(() => {
|
|
2597
2608
|
r.current.style.left = `${Zt(v.min, v.max, d) * 100}%`, r.current.style.top = `${(1 - Zt(v.min, v.max, m)) * 100}%`;
|
|
@@ -2611,10 +2622,10 @@ function Ir(i) {
|
|
|
2611
2622
|
max: v.max,
|
|
2612
2623
|
step: P,
|
|
2613
2624
|
name: W(),
|
|
2614
|
-
onChange: (
|
|
2615
|
-
if (u(
|
|
2616
|
-
const
|
|
2617
|
-
isNaN(
|
|
2625
|
+
onChange: (w) => {
|
|
2626
|
+
if (u(w.target.value), w.target.value.length === 0) return;
|
|
2627
|
+
const k = Number(w.target.value);
|
|
2628
|
+
isNaN(k) || (i.onChange({ target: { value: { x: k, y: m } } }), k < v.min && y({ min: k, max: v.max }));
|
|
2618
2629
|
}
|
|
2619
2630
|
}
|
|
2620
2631
|
)
|
|
@@ -2631,10 +2642,10 @@ function Ir(i) {
|
|
|
2631
2642
|
max: v.max,
|
|
2632
2643
|
step: P,
|
|
2633
2644
|
name: W(),
|
|
2634
|
-
onChange: (
|
|
2635
|
-
if (C(
|
|
2636
|
-
const
|
|
2637
|
-
isNaN(
|
|
2645
|
+
onChange: (w) => {
|
|
2646
|
+
if (C(w.target.value), w.target.value.length === 0) return;
|
|
2647
|
+
const k = Number(w.target.value);
|
|
2648
|
+
isNaN(k) || (i.onChange({ target: { value: { x: d, y: k } } }), k > v.max && y({ min: v.min, max: k }));
|
|
2638
2649
|
}
|
|
2639
2650
|
}
|
|
2640
2651
|
)
|
|
@@ -2663,7 +2674,7 @@ function Ir(i) {
|
|
|
2663
2674
|
value: v.max,
|
|
2664
2675
|
step: P,
|
|
2665
2676
|
name: W(),
|
|
2666
|
-
onChange:
|
|
2677
|
+
onChange: x
|
|
2667
2678
|
}
|
|
2668
2679
|
)
|
|
2669
2680
|
] })
|
|
@@ -2675,7 +2686,7 @@ function Ir(i) {
|
|
|
2675
2686
|
] })
|
|
2676
2687
|
] });
|
|
2677
2688
|
}
|
|
2678
|
-
function
|
|
2689
|
+
function xi(i) {
|
|
2679
2690
|
const e = i.value.x !== void 0 && i.value.y !== void 0 && i.value.z !== void 0, t = i.value.isEuler !== void 0, s = i.value.elements !== void 0, n = i.step !== void 0 ? i.step : 0.01, a = [];
|
|
2680
2691
|
if (t) {
|
|
2681
2692
|
const r = Ze(() => i.value, []);
|
|
@@ -2687,7 +2698,7 @@ function wi(i) {
|
|
|
2687
2698
|
/* @__PURE__ */ f(
|
|
2688
2699
|
Ce,
|
|
2689
2700
|
{
|
|
2690
|
-
value:
|
|
2701
|
+
value: An(r[c]),
|
|
2691
2702
|
type: "number",
|
|
2692
2703
|
prop: c,
|
|
2693
2704
|
step: 0.1,
|
|
@@ -2750,7 +2761,7 @@ function wi(i) {
|
|
|
2750
2761
|
}
|
|
2751
2762
|
return /* @__PURE__ */ f("div", { className: "grid3", children: a }, Math.random().toString());
|
|
2752
2763
|
}
|
|
2753
|
-
function
|
|
2764
|
+
function Lr(i) {
|
|
2754
2765
|
const e = i.value.x !== void 0, t = i.step !== void 0 ? i.step : 0.01, s = [];
|
|
2755
2766
|
if (e) {
|
|
2756
2767
|
const n = Ze(() => i.value, []), a = (o, c) => {
|
|
@@ -2802,7 +2813,7 @@ function Ur(i) {
|
|
|
2802
2813
|
}
|
|
2803
2814
|
return /* @__PURE__ */ f("div", { className: "grid4", children: s });
|
|
2804
2815
|
}
|
|
2805
|
-
function
|
|
2816
|
+
function Nr(i) {
|
|
2806
2817
|
return !(i === "defaultAttributeValues" || i === "forceSinglePass" || i === "linecap" || i === "linejoin" || i === "linewidth" || i === "normalMapType" || i === "precision" || i === "shadowSide" || i === "uniformsGroups" || i === "uniformsNeedUpdate" || i === "userData" || i === "version" || i === "wireframeLinecap" || i === "wireframeLinejoin" || i === "wireframeLinewidth" || i.slice(0, 4) === "clip" || i.slice(0, 7) === "polygon" || i.slice(0, 7) === "stencil" || i.slice(0, 2) === "is");
|
|
2807
2818
|
}
|
|
2808
2819
|
function kr(i) {
|
|
@@ -3061,7 +3072,7 @@ function hs(i) {
|
|
|
3061
3072
|
const e = i.toLowerCase();
|
|
3062
3073
|
return e.search("intensity") > -1 || e === "anisotropyrotation" || e === "blendalpha" || e === "bumpscale" || e === "clearcoatroughness" || e === "displacementbias" || e === "displacementscale" || e === "metalness" || e === "opacity" || e === "reflectivity" || e === "refractionratio" || e === "roughness" || e === "sheenroughness";
|
|
3063
3074
|
}
|
|
3064
|
-
function
|
|
3075
|
+
function Fr() {
|
|
3065
3076
|
const i = document.createElement("input");
|
|
3066
3077
|
return i.type = "file", new Promise((e, t) => {
|
|
3067
3078
|
i.addEventListener("change", function() {
|
|
@@ -3076,7 +3087,7 @@ function Nr() {
|
|
|
3076
3087
|
}), i.click();
|
|
3077
3088
|
});
|
|
3078
3089
|
}
|
|
3079
|
-
const
|
|
3090
|
+
const zr = [
|
|
3080
3091
|
{
|
|
3081
3092
|
title: "Front",
|
|
3082
3093
|
value: Ts
|
|
@@ -3089,7 +3100,7 @@ const Fr = [
|
|
|
3089
3100
|
title: "Double",
|
|
3090
3101
|
value: Wi
|
|
3091
3102
|
}
|
|
3092
|
-
],
|
|
3103
|
+
], Hr = [
|
|
3093
3104
|
{
|
|
3094
3105
|
title: "No Blending",
|
|
3095
3106
|
value: Us
|
|
@@ -3104,17 +3115,17 @@ const Fr = [
|
|
|
3104
3115
|
},
|
|
3105
3116
|
{
|
|
3106
3117
|
title: "Subtractive",
|
|
3107
|
-
value:
|
|
3118
|
+
value: Ns
|
|
3108
3119
|
},
|
|
3109
3120
|
{
|
|
3110
3121
|
title: "Multiply",
|
|
3111
|
-
value:
|
|
3122
|
+
value: ks
|
|
3112
3123
|
},
|
|
3113
3124
|
{
|
|
3114
3125
|
title: "Custom",
|
|
3115
3126
|
value: _t
|
|
3116
3127
|
}
|
|
3117
|
-
],
|
|
3128
|
+
], Br = [
|
|
3118
3129
|
{
|
|
3119
3130
|
title: "Add",
|
|
3120
3131
|
value: Je
|
|
@@ -3135,7 +3146,7 @@ const Fr = [
|
|
|
3135
3146
|
title: "Max",
|
|
3136
3147
|
value: Is
|
|
3137
3148
|
}
|
|
3138
|
-
],
|
|
3149
|
+
], Vr = [
|
|
3139
3150
|
{
|
|
3140
3151
|
title: "Zero",
|
|
3141
3152
|
value: Yi
|
|
@@ -3196,7 +3207,7 @@ const Fr = [
|
|
|
3196
3207
|
title: "One Minus Constant Alpha",
|
|
3197
3208
|
value: es
|
|
3198
3209
|
}
|
|
3199
|
-
],
|
|
3210
|
+
], Gr = [
|
|
3200
3211
|
{
|
|
3201
3212
|
title: "Zero",
|
|
3202
3213
|
value: Yi
|
|
@@ -3257,7 +3268,7 @@ const Fr = [
|
|
|
3257
3268
|
function ke(i, e) {
|
|
3258
3269
|
i.needsUpdate = !0, i.type = "option", i.options = e;
|
|
3259
3270
|
}
|
|
3260
|
-
function
|
|
3271
|
+
function $r(i, e, t, s) {
|
|
3261
3272
|
return {
|
|
3262
3273
|
type: "boolean",
|
|
3263
3274
|
title: yt(i),
|
|
@@ -3274,7 +3285,7 @@ function Gr(i, e, t, s) {
|
|
|
3274
3285
|
}
|
|
3275
3286
|
};
|
|
3276
3287
|
}
|
|
3277
|
-
function
|
|
3288
|
+
function Wr(i, e, t, s) {
|
|
3278
3289
|
const n = {
|
|
3279
3290
|
type: "number",
|
|
3280
3291
|
title: yt(i),
|
|
@@ -3295,24 +3306,24 @@ function $r(i, e, t, s) {
|
|
|
3295
3306
|
};
|
|
3296
3307
|
switch (i) {
|
|
3297
3308
|
case "blending":
|
|
3298
|
-
ke(n,
|
|
3309
|
+
ke(n, Hr);
|
|
3299
3310
|
break;
|
|
3300
3311
|
case "blendDst":
|
|
3301
|
-
ke(n,
|
|
3312
|
+
ke(n, Gr);
|
|
3302
3313
|
break;
|
|
3303
3314
|
case "blendEquation":
|
|
3304
|
-
ke(n,
|
|
3315
|
+
ke(n, Br);
|
|
3305
3316
|
break;
|
|
3306
3317
|
case "blendSrc":
|
|
3307
|
-
ke(n,
|
|
3318
|
+
ke(n, Vr);
|
|
3308
3319
|
break;
|
|
3309
3320
|
case "side":
|
|
3310
|
-
ke(n,
|
|
3321
|
+
ke(n, zr);
|
|
3311
3322
|
break;
|
|
3312
3323
|
}
|
|
3313
3324
|
return hs(i) && (n.value = Number(e), n.type = "range", n.min = Math.min(0, n.value), n.max = Math.max(1, n.value), n.step = 0.01), n;
|
|
3314
3325
|
}
|
|
3315
|
-
function
|
|
3326
|
+
function Yr(i, e, t, s) {
|
|
3316
3327
|
const n = {
|
|
3317
3328
|
type: "string",
|
|
3318
3329
|
title: yt(i),
|
|
@@ -3348,20 +3359,22 @@ function Wr(i, e, t, s) {
|
|
|
3348
3359
|
}
|
|
3349
3360
|
}), n;
|
|
3350
3361
|
}
|
|
3351
|
-
function
|
|
3362
|
+
function Zr(i) {
|
|
3352
3363
|
return i.x !== void 0 && i.y !== void 0 && i.z === void 0;
|
|
3353
3364
|
}
|
|
3354
|
-
function
|
|
3365
|
+
function qr(i) {
|
|
3355
3366
|
return i.x !== void 0 && i.y !== void 0 && i.z !== void 0 && i.w === void 0;
|
|
3356
3367
|
}
|
|
3357
|
-
function
|
|
3368
|
+
function Kr(i) {
|
|
3358
3369
|
return i.x !== void 0 && i.y !== void 0 && i.z !== void 0 && i.w !== void 0;
|
|
3359
3370
|
}
|
|
3360
3371
|
function Xt(i) {
|
|
3361
3372
|
i.sort((e, t) => e.title < t.title ? -1 : e.title > t.title ? 1 : 0);
|
|
3362
3373
|
}
|
|
3363
|
-
function
|
|
3374
|
+
function Ue(i, e, t, s, n = "", a = !1) {
|
|
3364
3375
|
const r = yt(i).split(".")[0].replaceAll("[", "").replaceAll("]", ""), o = n.length > 0 ? `${n}.${i}` : i, c = typeof e;
|
|
3376
|
+
if (c === "object" && e !== null && e.__isUniform === !0)
|
|
3377
|
+
return Ue(`${i}.value`, e.value, t, s, n, a);
|
|
3365
3378
|
if (c === "boolean" || c === "string")
|
|
3366
3379
|
return {
|
|
3367
3380
|
title: r,
|
|
@@ -3419,10 +3432,10 @@ function Ye(i, e, t, s, n = "", a = !1) {
|
|
|
3419
3432
|
for (const h in e) {
|
|
3420
3433
|
const d = e[h], u = `[${h.toString()}]`;
|
|
3421
3434
|
if (d.value !== void 0) {
|
|
3422
|
-
const m =
|
|
3435
|
+
const m = Ue(`${u}.value`, d.value, t, s, o, a);
|
|
3423
3436
|
m !== void 0 && l.push(m);
|
|
3424
3437
|
} else {
|
|
3425
|
-
const m =
|
|
3438
|
+
const m = Ue(u, d, t, s, o, a);
|
|
3426
3439
|
m !== void 0 && l.push(m);
|
|
3427
3440
|
}
|
|
3428
3441
|
}
|
|
@@ -3432,7 +3445,7 @@ function Ye(i, e, t, s, n = "", a = !1) {
|
|
|
3432
3445
|
items: l
|
|
3433
3446
|
};
|
|
3434
3447
|
} else {
|
|
3435
|
-
if (
|
|
3448
|
+
if (Zr(e))
|
|
3436
3449
|
return {
|
|
3437
3450
|
title: r,
|
|
3438
3451
|
prop: o,
|
|
@@ -3448,7 +3461,7 @@ function Ye(i, e, t, s, n = "", a = !1) {
|
|
|
3448
3461
|
}
|
|
3449
3462
|
}
|
|
3450
3463
|
};
|
|
3451
|
-
if (
|
|
3464
|
+
if (qr(e))
|
|
3452
3465
|
return {
|
|
3453
3466
|
title: r,
|
|
3454
3467
|
prop: o,
|
|
@@ -3464,7 +3477,7 @@ function Ye(i, e, t, s, n = "", a = !1) {
|
|
|
3464
3477
|
}
|
|
3465
3478
|
}
|
|
3466
3479
|
};
|
|
3467
|
-
if (
|
|
3480
|
+
if (Kr(e))
|
|
3468
3481
|
return {
|
|
3469
3482
|
title: r,
|
|
3470
3483
|
prop: o,
|
|
@@ -3560,10 +3573,10 @@ function Ye(i, e, t, s, n = "", a = !1) {
|
|
|
3560
3573
|
const u = e[d];
|
|
3561
3574
|
if (u !== void 0)
|
|
3562
3575
|
if (u.value !== void 0) {
|
|
3563
|
-
const m =
|
|
3576
|
+
const m = Ue(`${d}.value`, u.value, t, s, o, h);
|
|
3564
3577
|
m !== void 0 && l.push(m);
|
|
3565
3578
|
} else {
|
|
3566
|
-
const m =
|
|
3579
|
+
const m = Ue(d, u, t, s, o, h);
|
|
3567
3580
|
m !== void 0 && l.push(m);
|
|
3568
3581
|
}
|
|
3569
3582
|
}
|
|
@@ -3579,19 +3592,20 @@ function Ye(i, e, t, s, n = "", a = !1) {
|
|
|
3579
3592
|
}
|
|
3580
3593
|
}
|
|
3581
3594
|
}
|
|
3582
|
-
function
|
|
3595
|
+
function wi(i, e, t) {
|
|
3583
3596
|
const s = [];
|
|
3584
3597
|
for (const n in i) {
|
|
3585
|
-
if (!
|
|
3598
|
+
if (!Nr(n) || n.search("Node") > -1 || i[n] instanceof tn)
|
|
3599
|
+
continue;
|
|
3586
3600
|
const a = typeof i[n], r = i[n];
|
|
3587
3601
|
if (a === "boolean")
|
|
3588
|
-
s.push(Gr(n, r, e, t));
|
|
3589
|
-
else if (a === "number")
|
|
3590
3602
|
s.push($r(n, r, e, t));
|
|
3591
|
-
else if (a === "
|
|
3603
|
+
else if (a === "number")
|
|
3592
3604
|
s.push(Wr(n, r, e, t));
|
|
3605
|
+
else if (a === "string")
|
|
3606
|
+
s.push(Yr(n, r, e, t));
|
|
3593
3607
|
else if (a === "object") {
|
|
3594
|
-
const o =
|
|
3608
|
+
const o = Ue(n, r, e, t);
|
|
3595
3609
|
o !== void 0 && s.push(o);
|
|
3596
3610
|
} else r !== void 0 && console.log("Hermes - Other Material Prop Type:", n, a, r);
|
|
3597
3611
|
}
|
|
@@ -3608,7 +3622,7 @@ function xi(i, e, t) {
|
|
|
3608
3622
|
}
|
|
3609
3623
|
}), s;
|
|
3610
3624
|
}
|
|
3611
|
-
function
|
|
3625
|
+
function Xr(i, e) {
|
|
3612
3626
|
function t() {
|
|
3613
3627
|
return `${e.name}_material`;
|
|
3614
3628
|
}
|
|
@@ -3626,7 +3640,7 @@ function Kr(i, e) {
|
|
|
3626
3640
|
{
|
|
3627
3641
|
three: e,
|
|
3628
3642
|
title: `Material ${l}`,
|
|
3629
|
-
items:
|
|
3643
|
+
items: wi(r[l], i, e)
|
|
3630
3644
|
},
|
|
3631
3645
|
`Material ${l}`
|
|
3632
3646
|
)
|
|
@@ -3638,7 +3652,7 @@ function Kr(i, e) {
|
|
|
3638
3652
|
{
|
|
3639
3653
|
three: e,
|
|
3640
3654
|
title: "Material",
|
|
3641
|
-
items:
|
|
3655
|
+
items: wi(r, i, e),
|
|
3642
3656
|
expanded: n,
|
|
3643
3657
|
onToggle: (o) => {
|
|
3644
3658
|
a(o);
|
|
@@ -3647,12 +3661,12 @@ function Kr(i, e) {
|
|
|
3647
3661
|
);
|
|
3648
3662
|
}
|
|
3649
3663
|
const Ti = "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==";
|
|
3650
|
-
function
|
|
3664
|
+
function jr(i) {
|
|
3651
3665
|
const e = i.step !== void 0 ? i.step : 0.01, t = z(null), s = z(null), n = z(null), a = z(null), r = z(null), [o] = L(i.value), [c, l] = L(i.value.offset[0]), [h, d] = L(i.value.offset[1]), [u, m] = L(i.value.repeat[0]), [C, v] = L(i.value.repeat[1]);
|
|
3652
3666
|
function y(_, E, S, b, O) {
|
|
3653
3667
|
if (i.onChange !== void 0) {
|
|
3654
|
-
const
|
|
3655
|
-
i.onChange(
|
|
3668
|
+
const x = i.prop !== void 0 ? i.prop : i.title;
|
|
3669
|
+
i.onChange(x, {
|
|
3656
3670
|
src: _,
|
|
3657
3671
|
offset: [E, S],
|
|
3658
3672
|
repeat: [b, O]
|
|
@@ -3678,7 +3692,7 @@ function Xr(i) {
|
|
|
3678
3692
|
}
|
|
3679
3693
|
return /* @__PURE__ */ M("div", { className: "imageField", children: [
|
|
3680
3694
|
/* @__PURE__ */ f("img", { alt: i.title, ref: t, onClick: () => {
|
|
3681
|
-
|
|
3695
|
+
Fr().then((_) => {
|
|
3682
3696
|
t.current.src = _, y(_, c, h, u, C);
|
|
3683
3697
|
});
|
|
3684
3698
|
}, src: o.src.length > 0 ? o.src : Ti }),
|
|
@@ -3834,7 +3848,7 @@ function ht(i) {
|
|
|
3834
3848
|
children: i.title
|
|
3835
3849
|
}
|
|
3836
3850
|
),
|
|
3837
|
-
i.type === "image" && /* @__PURE__ */ f(
|
|
3851
|
+
i.type === "image" && /* @__PURE__ */ f(jr, { title: i.title, prop: i.prop, value: i.value, onChange: i.onChange }),
|
|
3838
3852
|
i.type === "option" && /* @__PURE__ */ f(q, { children: /* @__PURE__ */ f(
|
|
3839
3853
|
"select",
|
|
3840
3854
|
{
|
|
@@ -3845,13 +3859,13 @@ function ht(i) {
|
|
|
3845
3859
|
children: i.options?.map((l, h) => /* @__PURE__ */ f("option", { value: l.value, children: mt(l.title) }, h))
|
|
3846
3860
|
}
|
|
3847
3861
|
) }),
|
|
3848
|
-
i.type === "vector2" && /* @__PURE__ */ f(
|
|
3849
|
-
i.type === "grid3" && /* @__PURE__ */ f(
|
|
3850
|
-
i.type === "grid4" && /* @__PURE__ */ f(
|
|
3851
|
-
i.type === "euler" && /* @__PURE__ */ f(
|
|
3862
|
+
i.type === "vector2" && /* @__PURE__ */ f(Ur, { step: i.step, value: t, min: 0, max: 1, onChange: a }),
|
|
3863
|
+
i.type === "grid3" && /* @__PURE__ */ f(xi, { step: i.step, value: t, onChange: a }),
|
|
3864
|
+
i.type === "grid4" && /* @__PURE__ */ f(Lr, { step: i.step, value: t, onChange: a }),
|
|
3865
|
+
i.type === "euler" && /* @__PURE__ */ f(xi, { step: i.step, value: t, onChange: a })
|
|
3852
3866
|
] });
|
|
3853
3867
|
}
|
|
3854
|
-
function
|
|
3868
|
+
function Qr(i) {
|
|
3855
3869
|
return "items" in i;
|
|
3856
3870
|
}
|
|
3857
3871
|
class j extends Qe {
|
|
@@ -3880,7 +3894,7 @@ class j extends Qe {
|
|
|
3880
3894
|
}
|
|
3881
3895
|
});
|
|
3882
3896
|
});
|
|
3883
|
-
const s =
|
|
3897
|
+
const s = ue(), n = /* @__PURE__ */ f(
|
|
3884
3898
|
j,
|
|
3885
3899
|
{
|
|
3886
3900
|
three: this.props.three,
|
|
@@ -3909,7 +3923,7 @@ class j extends Qe {
|
|
|
3909
3923
|
render() {
|
|
3910
3924
|
const e = [];
|
|
3911
3925
|
return this.props.items.forEach((t) => {
|
|
3912
|
-
if (
|
|
3926
|
+
if (Qr(t))
|
|
3913
3927
|
e.push(
|
|
3914
3928
|
/* @__PURE__ */ f(j, { three: this.props.three, title: mt(t.title), items: t.items }, Math.random())
|
|
3915
3929
|
);
|
|
@@ -4052,7 +4066,7 @@ class I extends Qe {
|
|
|
4052
4066
|
items: o
|
|
4053
4067
|
});
|
|
4054
4068
|
});
|
|
4055
|
-
const n =
|
|
4069
|
+
const n = ue(), a = /* @__PURE__ */ f(
|
|
4056
4070
|
j,
|
|
4057
4071
|
{
|
|
4058
4072
|
three: I.three,
|
|
@@ -4110,7 +4124,7 @@ function Mi(i) {
|
|
|
4110
4124
|
}
|
|
4111
4125
|
return i;
|
|
4112
4126
|
}
|
|
4113
|
-
function
|
|
4127
|
+
function Jr(i, e) {
|
|
4114
4128
|
function t() {
|
|
4115
4129
|
return `${e.name}_camera`;
|
|
4116
4130
|
}
|
|
@@ -4206,26 +4220,26 @@ const H = {
|
|
|
4206
4220
|
function fe(i) {
|
|
4207
4221
|
return i.isPerspectiveCamera;
|
|
4208
4222
|
}
|
|
4209
|
-
function
|
|
4223
|
+
function de(i) {
|
|
4210
4224
|
return i.isOrthographicCamera;
|
|
4211
4225
|
}
|
|
4212
|
-
const De = Math.PI * 2, Ai = Math.PI / 2, ds = 1e-5,
|
|
4226
|
+
const De = Math.PI * 2, Ai = Math.PI / 2, ds = 1e-5, Fe = Math.PI / 180;
|
|
4213
4227
|
function J(i, e, t) {
|
|
4214
4228
|
return Math.max(e, Math.min(t, i));
|
|
4215
4229
|
}
|
|
4216
4230
|
function F(i, e = ds) {
|
|
4217
4231
|
return Math.abs(i) < e;
|
|
4218
4232
|
}
|
|
4219
|
-
function
|
|
4233
|
+
function N(i, e, t = ds) {
|
|
4220
4234
|
return F(i - e, t);
|
|
4221
4235
|
}
|
|
4222
4236
|
function Ri(i, e) {
|
|
4223
4237
|
return Math.round(i / e) * e;
|
|
4224
4238
|
}
|
|
4225
|
-
function
|
|
4239
|
+
function ze(i) {
|
|
4226
4240
|
return isFinite(i) ? i : i < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;
|
|
4227
4241
|
}
|
|
4228
|
-
function
|
|
4242
|
+
function He(i) {
|
|
4229
4243
|
return Math.abs(i) < Number.MAX_VALUE ? i : i * (1 / 0);
|
|
4230
4244
|
}
|
|
4231
4245
|
function rt(i, e, t, s, n = 1 / 0, a) {
|
|
@@ -4249,10 +4263,10 @@ function Di(i, e, t, s, n = 1 / 0, a, r) {
|
|
|
4249
4263
|
m = m / me * E, C = C / me * E, v = v / me * E;
|
|
4250
4264
|
}
|
|
4251
4265
|
h = i.x - m, d = i.y - C, u = i.z - v;
|
|
4252
|
-
const O = (t.x + o * m) * a,
|
|
4253
|
-
t.x = (t.x - o * O) * l, t.y = (t.y - o *
|
|
4254
|
-
const
|
|
4255
|
-
return
|
|
4266
|
+
const O = (t.x + o * m) * a, x = (t.y + o * C) * a, P = (t.z + o * v) * a;
|
|
4267
|
+
t.x = (t.x - o * O) * l, t.y = (t.y - o * x) * l, t.z = (t.z - o * P) * l, r.x = h + (m + O) * l, r.y = d + (C + x) * l, r.z = u + (v + P) * l;
|
|
4268
|
+
const w = y - i.x, k = g - i.y, Q = _ - i.z, ae = r.x - y, pe = r.y - g, be = r.z - _;
|
|
4269
|
+
return w * ae + k * pe + Q * be > 0 && (r.x = y, r.y = g, r.z = _, t.x = (r.x - y) / a, t.y = (r.y - g) / a, t.z = (r.z - _) / a), r;
|
|
4256
4270
|
}
|
|
4257
4271
|
function Pt(i, e) {
|
|
4258
4272
|
e.set(0, 0), i.forEach((t) => {
|
|
@@ -4260,9 +4274,9 @@ function Pt(i, e) {
|
|
|
4260
4274
|
}), e.x /= i.length, e.y /= i.length;
|
|
4261
4275
|
}
|
|
4262
4276
|
function It(i, e) {
|
|
4263
|
-
return
|
|
4277
|
+
return de(i) ? (console.warn(`${e} is not supported in OrthographicCamera`), !0) : !1;
|
|
4264
4278
|
}
|
|
4265
|
-
class
|
|
4279
|
+
class ea {
|
|
4266
4280
|
constructor() {
|
|
4267
4281
|
this._listeners = {};
|
|
4268
4282
|
}
|
|
@@ -4327,9 +4341,9 @@ class Jr {
|
|
|
4327
4341
|
}
|
|
4328
4342
|
}
|
|
4329
4343
|
var Ut;
|
|
4330
|
-
const
|
|
4331
|
-
let T, Pi, ot, Lt, Z, A, U, Pe,
|
|
4332
|
-
class re extends
|
|
4344
|
+
const ta = "2.10.1", at = 1 / 8, ia = /Mac/.test((Ut = globalThis?.navigator) === null || Ut === void 0 ? void 0 : Ut.platform);
|
|
4345
|
+
let T, Pi, ot, Lt, Z, A, U, Pe, Be, ie, se, ge, Ii, Ui, X, Ve, Ie, Li, Nt, Ni, kt, Ft, lt;
|
|
4346
|
+
class re extends ea {
|
|
4333
4347
|
/**
|
|
4334
4348
|
* Injects THREE as the dependency. You can then proceed to use CameraControls.
|
|
4335
4349
|
*
|
|
@@ -4371,7 +4385,7 @@ class re extends Jr {
|
|
|
4371
4385
|
* @category Statics
|
|
4372
4386
|
*/
|
|
4373
4387
|
static install(e) {
|
|
4374
|
-
T = e.THREE, Pi = Object.freeze(new T.Vector3(0, 0, 0)), ot = Object.freeze(new T.Vector3(0, 1, 0)), Lt = Object.freeze(new T.Vector3(0, 0, 1)), Z = new T.Vector2(), A = new T.Vector3(), U = new T.Vector3(), Pe = new T.Vector3(),
|
|
4388
|
+
T = e.THREE, Pi = Object.freeze(new T.Vector3(0, 0, 0)), ot = Object.freeze(new T.Vector3(0, 1, 0)), Lt = Object.freeze(new T.Vector3(0, 0, 1)), Z = new T.Vector2(), A = new T.Vector3(), U = new T.Vector3(), Pe = new T.Vector3(), Be = new T.Vector3(), ie = new T.Vector3(), se = new T.Vector3(), ge = new T.Vector3(), Ii = new T.Vector3(), Ui = new T.Vector3(), X = new T.Spherical(), Ve = new T.Spherical(), Ie = new T.Box3(), Li = new T.Box3(), Nt = new T.Sphere(), Ni = new T.Quaternion(), kt = new T.Quaternion(), Ft = new T.Matrix4(), lt = new T.Raycaster();
|
|
4375
4389
|
}
|
|
4376
4390
|
/**
|
|
4377
4391
|
* list all ACTIONs
|
|
@@ -4408,11 +4422,11 @@ class re extends Jr {
|
|
|
4408
4422
|
}, this._enabled = !0, this._state = p.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 = Re.NONE, this._thetaVelocity = { value: 0 }, this._phiVelocity = { value: 0 }, this._radiusVelocity = { value: 0 }, this._targetVelocity = new T.Vector3(), this._focalOffsetVelocity = new T.Vector3(), this._zoomVelocity = { value: 0 }, this._truckInternal = (g, _, E, S) => {
|
|
4409
4423
|
let b, O;
|
|
4410
4424
|
if (fe(this._camera)) {
|
|
4411
|
-
const
|
|
4412
|
-
b = this.truckSpeed * g *
|
|
4413
|
-
} else if (
|
|
4414
|
-
const
|
|
4415
|
-
b = this.truckSpeed * g * (
|
|
4425
|
+
const x = A.copy(this._camera.position).sub(this._target), P = this._camera.getEffectiveFOV() * Fe, w = x.length() * Math.tan(P * 0.5);
|
|
4426
|
+
b = this.truckSpeed * g * w / this._elementRect.height, O = this.truckSpeed * _ * w / this._elementRect.height;
|
|
4427
|
+
} else if (de(this._camera)) {
|
|
4428
|
+
const x = this._camera;
|
|
4429
|
+
b = this.truckSpeed * g * (x.right - x.left) / x.zoom / this._elementRect.width, O = this.truckSpeed * _ * (x.top - x.bottom) / x.zoom / this._elementRect.height;
|
|
4416
4430
|
} else
|
|
4417
4431
|
return;
|
|
4418
4432
|
S ? (E ? this.setFocalOffset(this._focalOffsetEnd.x + b, this._focalOffsetEnd.y, this._focalOffsetEnd.z, !0) : this.truck(b, 0, !0), this.forward(-O, !0)) : E ? this.setFocalOffset(this._focalOffsetEnd.x + b, this._focalOffsetEnd.y + O, this._focalOffsetEnd.z, !0) : this.truck(b, O, !0);
|
|
@@ -4420,8 +4434,8 @@ class re extends Jr {
|
|
|
4420
4434
|
const E = De * this.azimuthRotateSpeed * g / this._elementRect.height, S = De * this.polarRotateSpeed * _ / this._elementRect.height;
|
|
4421
4435
|
this.rotate(E, S, !0);
|
|
4422
4436
|
}, this._dollyInternal = (g, _, E) => {
|
|
4423
|
-
const S = Math.pow(0.95, -g * this.dollySpeed), b = this._sphericalEnd.radius, O = this._sphericalEnd.radius * S,
|
|
4424
|
-
this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(O, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(P, !0), this._dollyToNoClamp(
|
|
4437
|
+
const S = Math.pow(0.95, -g * this.dollySpeed), b = this._sphericalEnd.radius, O = this._sphericalEnd.radius * S, x = J(O, this.minDistance, this.maxDistance), P = x - O;
|
|
4438
|
+
this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(O, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(P, !0), this._dollyToNoClamp(x, !0)) : this._dollyToNoClamp(x, !0), this.dollyToCursor && (this._changedDolly += (this.infinityDolly ? O : x) - b, this._dollyControlCoord.set(_, E)), this._lastDollyDirection = Math.sign(-g);
|
|
4425
4439
|
}, this._zoomInternal = (g, _, E) => {
|
|
4426
4440
|
const S = Math.pow(0.95, g * this.dollySpeed), b = this._zoom, O = this._zoom * S;
|
|
4427
4441
|
this.zoomTo(O, !0), this.dollyToCursor && (this._changedZoom += O - b, this._dollyControlCoord.set(_, E));
|
|
@@ -4434,10 +4448,10 @@ class re extends Jr {
|
|
|
4434
4448
|
left: p.ROTATE,
|
|
4435
4449
|
middle: p.DOLLY,
|
|
4436
4450
|
right: p.TRUCK,
|
|
4437
|
-
wheel: fe(this._camera) ? p.DOLLY :
|
|
4451
|
+
wheel: fe(this._camera) ? p.DOLLY : de(this._camera) ? p.ZOOM : p.NONE
|
|
4438
4452
|
}, this.touches = {
|
|
4439
4453
|
one: p.TOUCH_ROTATE,
|
|
4440
|
-
two: fe(this._camera) ? p.TOUCH_DOLLY_TRUCK :
|
|
4454
|
+
two: fe(this._camera) ? p.TOUCH_DOLLY_TRUCK : de(this._camera) ? p.TOUCH_ZOOM_TRUCK : p.NONE,
|
|
4441
4455
|
three: p.TOUCH_TRUCK
|
|
4442
4456
|
};
|
|
4443
4457
|
const s = new T.Vector2(), n = new T.Vector2(), a = new T.Vector2(), r = (g) => {
|
|
@@ -4512,15 +4526,15 @@ class re extends Jr {
|
|
|
4512
4526
|
if (!this._domElement || !this._enabled || this.mouseButtons.wheel === p.NONE)
|
|
4513
4527
|
return;
|
|
4514
4528
|
if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
|
|
4515
|
-
const O = this._domElement.getBoundingClientRect(),
|
|
4516
|
-
if (
|
|
4529
|
+
const O = this._domElement.getBoundingClientRect(), x = g.clientX / O.width, P = g.clientY / O.height;
|
|
4530
|
+
if (x < this._interactiveArea.left || x > this._interactiveArea.right || P < this._interactiveArea.top || P > this._interactiveArea.bottom)
|
|
4517
4531
|
return;
|
|
4518
4532
|
}
|
|
4519
4533
|
if (g.preventDefault(), this.dollyToCursor || this.mouseButtons.wheel === p.ROTATE || this.mouseButtons.wheel === p.TRUCK) {
|
|
4520
4534
|
const O = performance.now();
|
|
4521
4535
|
l - O < 1e3 && this._getClientRect(this._elementRect), l = O;
|
|
4522
4536
|
}
|
|
4523
|
-
const _ =
|
|
4537
|
+
const _ = ia ? -1 : -3, E = g.deltaMode === 1 || g.ctrlKey ? g.deltaY / _ : g.deltaY / (_ * 10), S = this.dollyToCursor ? (g.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, b = this.dollyToCursor ? (g.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
|
4524
4538
|
switch (this.mouseButtons.wheel) {
|
|
4525
4539
|
case p.ROTATE: {
|
|
4526
4540
|
this._rotateInternal(g.deltaX, g.deltaY), this._isUserControllingRotate = !0;
|
|
@@ -4563,8 +4577,8 @@ class re extends Jr {
|
|
|
4563
4577
|
if (Pt(this._activePointers, Z), this._getClientRect(this._elementRect), s.copy(Z), n.copy(Z), this._activePointers.length >= 2) {
|
|
4564
4578
|
const E = Z.x - this._activePointers[1].clientX, S = Z.y - this._activePointers[1].clientY, b = Math.sqrt(E * E + S * S);
|
|
4565
4579
|
a.set(0, b);
|
|
4566
|
-
const O = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5,
|
|
4567
|
-
n.set(O,
|
|
4580
|
+
const O = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, x = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
|
|
4581
|
+
n.set(O, x);
|
|
4568
4582
|
}
|
|
4569
4583
|
if (this._state = 0, !g)
|
|
4570
4584
|
this._lockedPointer && (this._state = this._state | this.mouseButtons.left);
|
|
@@ -4589,14 +4603,14 @@ class re extends Jr {
|
|
|
4589
4603
|
this._dragNeedsUpdate = !1, Pt(this._activePointers, Z);
|
|
4590
4604
|
const _ = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, E = _ ? -_.deltaX : n.x - Z.x, S = _ ? -_.deltaY : n.y - Z.y;
|
|
4591
4605
|
if (n.copy(Z), ((this._state & p.ROTATE) === p.ROTATE || (this._state & p.TOUCH_ROTATE) === p.TOUCH_ROTATE || (this._state & p.TOUCH_DOLLY_ROTATE) === p.TOUCH_DOLLY_ROTATE || (this._state & p.TOUCH_ZOOM_ROTATE) === p.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(E, S), this._isUserControllingRotate = !0), (this._state & p.DOLLY) === p.DOLLY || (this._state & p.ZOOM) === p.ZOOM) {
|
|
4592
|
-
const b = this.dollyToCursor ? (s.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, O = this.dollyToCursor ? (s.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0,
|
|
4593
|
-
(this._state & p.DOLLY) === p.DOLLY ? (this._dollyInternal(
|
|
4606
|
+
const b = this.dollyToCursor ? (s.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, O = this.dollyToCursor ? (s.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0, x = this.dollyDragInverted ? -1 : 1;
|
|
4607
|
+
(this._state & p.DOLLY) === p.DOLLY ? (this._dollyInternal(x * S * at, b, O), this._isUserControllingDolly = !0) : (this._zoomInternal(x * S * at, b, O), this._isUserControllingZoom = !0);
|
|
4594
4608
|
}
|
|
4595
4609
|
if ((this._state & p.TOUCH_DOLLY) === p.TOUCH_DOLLY || (this._state & p.TOUCH_ZOOM) === p.TOUCH_ZOOM || (this._state & p.TOUCH_DOLLY_TRUCK) === p.TOUCH_DOLLY_TRUCK || (this._state & p.TOUCH_ZOOM_TRUCK) === p.TOUCH_ZOOM_TRUCK || (this._state & p.TOUCH_DOLLY_SCREEN_PAN) === p.TOUCH_DOLLY_SCREEN_PAN || (this._state & p.TOUCH_ZOOM_SCREEN_PAN) === p.TOUCH_ZOOM_SCREEN_PAN || (this._state & p.TOUCH_DOLLY_OFFSET) === p.TOUCH_DOLLY_OFFSET || (this._state & p.TOUCH_ZOOM_OFFSET) === p.TOUCH_ZOOM_OFFSET || (this._state & p.TOUCH_DOLLY_ROTATE) === p.TOUCH_DOLLY_ROTATE || (this._state & p.TOUCH_ZOOM_ROTATE) === p.TOUCH_ZOOM_ROTATE) {
|
|
4596
|
-
const b = Z.x - this._activePointers[1].clientX, O = Z.y - this._activePointers[1].clientY,
|
|
4597
|
-
a.set(0,
|
|
4598
|
-
const
|
|
4599
|
-
(this._state & p.TOUCH_DOLLY) === p.TOUCH_DOLLY || (this._state & p.TOUCH_DOLLY_ROTATE) === p.TOUCH_DOLLY_ROTATE || (this._state & p.TOUCH_DOLLY_TRUCK) === p.TOUCH_DOLLY_TRUCK || (this._state & p.TOUCH_DOLLY_SCREEN_PAN) === p.TOUCH_DOLLY_SCREEN_PAN || (this._state & p.TOUCH_DOLLY_OFFSET) === p.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(P * at,
|
|
4610
|
+
const b = Z.x - this._activePointers[1].clientX, O = Z.y - this._activePointers[1].clientY, x = Math.sqrt(b * b + O * O), P = a.y - x;
|
|
4611
|
+
a.set(0, x);
|
|
4612
|
+
const w = this.dollyToCursor ? (n.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, k = this.dollyToCursor ? (n.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
|
4613
|
+
(this._state & p.TOUCH_DOLLY) === p.TOUCH_DOLLY || (this._state & p.TOUCH_DOLLY_ROTATE) === p.TOUCH_DOLLY_ROTATE || (this._state & p.TOUCH_DOLLY_TRUCK) === p.TOUCH_DOLLY_TRUCK || (this._state & p.TOUCH_DOLLY_SCREEN_PAN) === p.TOUCH_DOLLY_SCREEN_PAN || (this._state & p.TOUCH_DOLLY_OFFSET) === p.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(P * at, w, k), this._isUserControllingDolly = !0) : (this._zoomInternal(P * at, w, k), this._isUserControllingZoom = !0);
|
|
4600
4614
|
}
|
|
4601
4615
|
((this._state & p.TRUCK) === p.TRUCK || (this._state & p.TOUCH_TRUCK) === p.TOUCH_TRUCK || (this._state & p.TOUCH_DOLLY_TRUCK) === p.TOUCH_DOLLY_TRUCK || (this._state & p.TOUCH_ZOOM_TRUCK) === p.TOUCH_ZOOM_TRUCK) && (this._truckInternal(E, S, !1, !1), this._isUserControllingTruck = !0), ((this._state & p.SCREEN_PAN) === p.SCREEN_PAN || (this._state & p.TOUCH_SCREEN_PAN) === p.TOUCH_SCREEN_PAN || (this._state & p.TOUCH_DOLLY_SCREEN_PAN) === p.TOUCH_DOLLY_SCREEN_PAN || (this._state & p.TOUCH_ZOOM_SCREEN_PAN) === p.TOUCH_ZOOM_SCREEN_PAN) && (this._truckInternal(E, S, !1, !0), this._isUserControllingTruck = !0), ((this._state & p.OFFSET) === p.OFFSET || (this._state & p.TOUCH_OFFSET) === p.TOUCH_OFFSET || (this._state & p.TOUCH_DOLLY_OFFSET) === p.TOUCH_DOLLY_OFFSET || (this._state & p.TOUCH_ZOOM_OFFSET) === p.TOUCH_ZOOM_OFFSET) && (this._truckInternal(E, S, !0, !1), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
|
|
4602
4616
|
}, C = () => {
|
|
@@ -4839,7 +4853,7 @@ class re extends Jr {
|
|
|
4839
4853
|
this._isUserControllingRotate = !1;
|
|
4840
4854
|
const n = J(e, this.minAzimuthAngle, this.maxAzimuthAngle), a = J(t, this.minPolarAngle, this.maxPolarAngle);
|
|
4841
4855
|
this._sphericalEnd.theta = n, this._sphericalEnd.phi = a, this._sphericalEnd.makeSafe(), this._needsUpdate = !0, s || (this._spherical.theta = this._sphericalEnd.theta, this._spherical.phi = this._sphericalEnd.phi);
|
|
4842
|
-
const r = !s ||
|
|
4856
|
+
const r = !s || N(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && N(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold);
|
|
4843
4857
|
return this._createOnRestPromise(r);
|
|
4844
4858
|
}
|
|
4845
4859
|
/**
|
|
@@ -4863,14 +4877,14 @@ class re extends Jr {
|
|
|
4863
4877
|
_dollyToNoClamp(e, t = !1) {
|
|
4864
4878
|
const s = this._sphericalEnd.radius;
|
|
4865
4879
|
if (this.colliderMeshes.length >= 1) {
|
|
4866
|
-
const r = this._collisionTest(), o =
|
|
4880
|
+
const r = this._collisionTest(), o = N(r, this._spherical.radius);
|
|
4867
4881
|
if (!(s > e) && o)
|
|
4868
4882
|
return Promise.resolve();
|
|
4869
4883
|
this._sphericalEnd.radius = Math.min(e, r);
|
|
4870
4884
|
} else
|
|
4871
4885
|
this._sphericalEnd.radius = e;
|
|
4872
4886
|
this._needsUpdate = !0, t || (this._spherical.radius = this._sphericalEnd.radius);
|
|
4873
|
-
const a = !t ||
|
|
4887
|
+
const a = !t || N(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
|
|
4874
4888
|
return this._createOnRestPromise(a);
|
|
4875
4889
|
}
|
|
4876
4890
|
/**
|
|
@@ -4881,8 +4895,8 @@ class re extends Jr {
|
|
|
4881
4895
|
* @category Methods
|
|
4882
4896
|
*/
|
|
4883
4897
|
dollyInFixed(e, t = !1) {
|
|
4884
|
-
this._targetEnd.add(this._getCameraDirection(
|
|
4885
|
-
const s = !t ||
|
|
4898
|
+
this._targetEnd.add(this._getCameraDirection(Be).multiplyScalar(e)), t || this._target.copy(this._targetEnd);
|
|
4899
|
+
const s = !t || N(this._target.x, this._targetEnd.x, this.restThreshold) && N(this._target.y, this._targetEnd.y, this.restThreshold) && N(this._target.z, this._targetEnd.z, this.restThreshold);
|
|
4886
4900
|
return this._createOnRestPromise(s);
|
|
4887
4901
|
}
|
|
4888
4902
|
/**
|
|
@@ -4904,7 +4918,7 @@ class re extends Jr {
|
|
|
4904
4918
|
*/
|
|
4905
4919
|
zoomTo(e, t = !1) {
|
|
4906
4920
|
this._isUserControllingZoom = !1, this._zoomEnd = J(e, this.minZoom, this.maxZoom), this._needsUpdate = !0, t || (this._zoom = this._zoomEnd);
|
|
4907
|
-
const s = !t ||
|
|
4921
|
+
const s = !t || N(this._zoom, this._zoomEnd, this.restThreshold);
|
|
4908
4922
|
return this._changedZoom = 0, this._createOnRestPromise(s);
|
|
4909
4923
|
}
|
|
4910
4924
|
/**
|
|
@@ -4958,7 +4972,7 @@ class re extends Jr {
|
|
|
4958
4972
|
this._isUserControllingTruck = !1;
|
|
4959
4973
|
const a = A.set(e, t, s).sub(this._targetEnd);
|
|
4960
4974
|
this._encloseToBoundary(this._targetEnd, a, this.boundaryFriction), this._needsUpdate = !0, n || this._target.copy(this._targetEnd);
|
|
4961
|
-
const r = !n ||
|
|
4975
|
+
const r = !n || N(this._target.x, this._targetEnd.x, this.restThreshold) && N(this._target.y, this._targetEnd.y, this.restThreshold) && N(this._target.z, this._targetEnd.z, this.restThreshold);
|
|
4962
4976
|
return this._createOnRestPromise(r);
|
|
4963
4977
|
}
|
|
4964
4978
|
/**
|
|
@@ -4992,15 +5006,15 @@ class re extends Jr {
|
|
|
4992
5006
|
l.isEmpty() && (console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"), Promise.resolve());
|
|
4993
5007
|
const h = Ri(this._sphericalEnd.theta, Ai), d = Ri(this._sphericalEnd.phi, Ai);
|
|
4994
5008
|
c.push(this.rotateTo(h, d, t));
|
|
4995
|
-
const u = A.setFromSpherical(this._sphericalEnd).normalize(), m =
|
|
4996
|
-
C && m.multiply(
|
|
5009
|
+
const u = A.setFromSpherical(this._sphericalEnd).normalize(), m = Ni.setFromUnitVectors(u, Lt), C = N(Math.abs(u.y), 1);
|
|
5010
|
+
C && m.multiply(kt.setFromAxisAngle(ot, h)), m.multiply(this._yAxisUpSpaceInverse);
|
|
4997
5011
|
const v = Li.makeEmpty();
|
|
4998
|
-
U.copy(l.min).applyQuaternion(m), v.expandByPoint(U), U.copy(l.min).setX(l.max.x).applyQuaternion(m), v.expandByPoint(U), U.copy(l.min).setY(l.max.y).applyQuaternion(m), v.expandByPoint(U), U.copy(l.max).setZ(l.min.z).applyQuaternion(m), v.expandByPoint(U), U.copy(l.min).setZ(l.max.z).applyQuaternion(m), v.expandByPoint(U), U.copy(l.max).setY(l.min.y).applyQuaternion(m), v.expandByPoint(U), U.copy(l.max).setX(l.min.x).applyQuaternion(m), v.expandByPoint(U), U.copy(l.max).applyQuaternion(m), v.expandByPoint(U), v.min.x -= n, v.min.y -= r, v.max.x += a, v.max.y += o, m.setFromUnitVectors(Lt, u), C && m.premultiply(
|
|
5012
|
+
U.copy(l.min).applyQuaternion(m), v.expandByPoint(U), U.copy(l.min).setX(l.max.x).applyQuaternion(m), v.expandByPoint(U), U.copy(l.min).setY(l.max.y).applyQuaternion(m), v.expandByPoint(U), U.copy(l.max).setZ(l.min.z).applyQuaternion(m), v.expandByPoint(U), U.copy(l.min).setZ(l.max.z).applyQuaternion(m), v.expandByPoint(U), U.copy(l.max).setY(l.min.y).applyQuaternion(m), v.expandByPoint(U), U.copy(l.max).setX(l.min.x).applyQuaternion(m), v.expandByPoint(U), U.copy(l.max).applyQuaternion(m), v.expandByPoint(U), v.min.x -= n, v.min.y -= r, v.max.x += a, v.max.y += o, m.setFromUnitVectors(Lt, u), C && m.premultiply(kt.invert()), m.premultiply(this._yAxisUpSpace);
|
|
4999
5013
|
const y = v.getSize(A), g = v.getCenter(U).applyQuaternion(m);
|
|
5000
5014
|
if (fe(this._camera)) {
|
|
5001
5015
|
const _ = this.getDistanceToFitBox(y.x, y.y, y.z, s);
|
|
5002
5016
|
c.push(this.moveTo(g.x, g.y, g.z, t)), c.push(this.dollyTo(_, t)), c.push(this.setFocalOffset(0, 0, 0, t));
|
|
5003
|
-
} else if (
|
|
5017
|
+
} else if (de(this._camera)) {
|
|
5004
5018
|
const _ = this._camera, E = _.right - _.left, S = _.top - _.bottom, b = s ? Math.max(E / y.x, S / y.y) : Math.min(E / y.x, S / y.y);
|
|
5005
5019
|
c.push(this.moveTo(g.x, g.y, g.z, t)), c.push(this.zoomTo(b, t)), c.push(this.setFocalOffset(0, 0, 0, t));
|
|
5006
5020
|
}
|
|
@@ -5013,11 +5027,11 @@ class re extends Jr {
|
|
|
5013
5027
|
* @category Methods
|
|
5014
5028
|
*/
|
|
5015
5029
|
fitToSphere(e, t) {
|
|
5016
|
-
const s = [], a = "isObject3D" in e ? re.createBoundingSphere(e,
|
|
5030
|
+
const s = [], a = "isObject3D" in e ? re.createBoundingSphere(e, Nt) : Nt.copy(e);
|
|
5017
5031
|
if (s.push(this.moveTo(a.center.x, a.center.y, a.center.z, t)), fe(this._camera)) {
|
|
5018
5032
|
const r = this.getDistanceToFitSphere(a.radius);
|
|
5019
5033
|
s.push(this.dollyTo(r, t));
|
|
5020
|
-
} else if (
|
|
5034
|
+
} else if (de(this._camera)) {
|
|
5021
5035
|
const r = this._camera.right - this._camera.left, o = this._camera.top - this._camera.bottom, c = 2 * a.radius, l = Math.min(r / c, o / c);
|
|
5022
5036
|
s.push(this.zoomTo(l, t));
|
|
5023
5037
|
}
|
|
@@ -5038,7 +5052,7 @@ class re extends Jr {
|
|
|
5038
5052
|
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = Re.NONE, this._changedDolly = 0;
|
|
5039
5053
|
const c = U.set(n, a, r), l = A.set(e, t, s);
|
|
5040
5054
|
this._targetEnd.copy(c), this._sphericalEnd.setFromVector3(l.sub(c).applyQuaternion(this._yAxisUpSpace)), this.normalizeRotations(), this._needsUpdate = !0, o || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
|
|
5041
|
-
const h = !o ||
|
|
5055
|
+
const h = !o || N(this._target.x, this._targetEnd.x, this.restThreshold) && N(this._target.y, this._targetEnd.y, this.restThreshold) && N(this._target.z, this._targetEnd.z, this.restThreshold) && N(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && N(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold) && N(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
|
|
5042
5056
|
return this._createOnRestPromise(h);
|
|
5043
5057
|
}
|
|
5044
5058
|
/**
|
|
@@ -5064,10 +5078,10 @@ class re extends Jr {
|
|
|
5064
5078
|
const v = A.set(n, a, r), y = U.set(e, t, s);
|
|
5065
5079
|
X.setFromVector3(y.sub(v).applyQuaternion(this._yAxisUpSpace));
|
|
5066
5080
|
const g = Pe.set(h, d, u), _ = U.set(o, c, l);
|
|
5067
|
-
|
|
5068
|
-
const E =
|
|
5081
|
+
Ve.setFromVector3(_.sub(g).applyQuaternion(this._yAxisUpSpace)), this._targetEnd.copy(v.lerp(g, m));
|
|
5082
|
+
const E = Ve.theta - X.theta, S = Ve.phi - X.phi, b = Ve.radius - X.radius;
|
|
5069
5083
|
this._sphericalEnd.set(X.radius + b * m, X.phi + S * m, X.theta + E * m), this.normalizeRotations(), this._needsUpdate = !0, C || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
|
|
5070
|
-
const O = !C ||
|
|
5084
|
+
const O = !C || N(this._target.x, this._targetEnd.x, this.restThreshold) && N(this._target.y, this._targetEnd.y, this.restThreshold) && N(this._target.z, this._targetEnd.z, this.restThreshold) && N(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && N(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold) && N(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
|
|
5071
5085
|
return this._createOnRestPromise(O);
|
|
5072
5086
|
}
|
|
5073
5087
|
/**
|
|
@@ -5105,7 +5119,7 @@ class re extends Jr {
|
|
|
5105
5119
|
*/
|
|
5106
5120
|
setFocalOffset(e, t, s, n = !1) {
|
|
5107
5121
|
this._isUserControllingOffset = !1, this._focalOffsetEnd.set(e, t, s), this._needsUpdate = !0, n || this._focalOffset.copy(this._focalOffsetEnd);
|
|
5108
|
-
const a = !n ||
|
|
5122
|
+
const a = !n || N(this._focalOffset.x, this._focalOffsetEnd.x, this.restThreshold) && N(this._focalOffset.y, this._focalOffsetEnd.y, this.restThreshold) && N(this._focalOffset.z, this._focalOffsetEnd.z, this.restThreshold);
|
|
5109
5123
|
return this._createOnRestPromise(a);
|
|
5110
5124
|
}
|
|
5111
5125
|
/**
|
|
@@ -5160,7 +5174,7 @@ class re extends Jr {
|
|
|
5160
5174
|
getDistanceToFitBox(e, t, s, n = !1) {
|
|
5161
5175
|
if (It(this._camera, "getDistanceToFitBox"))
|
|
5162
5176
|
return this._spherical.radius;
|
|
5163
|
-
const a = e / t, r = this._camera.getEffectiveFOV() *
|
|
5177
|
+
const a = e / t, r = this._camera.getEffectiveFOV() * Fe, o = this._camera.aspect;
|
|
5164
5178
|
return ((n ? a > o : a < o) ? t : e / o) * 0.5 / Math.tan(r * 0.5) + s * 0.5;
|
|
5165
5179
|
}
|
|
5166
5180
|
/**
|
|
@@ -5172,7 +5186,7 @@ class re extends Jr {
|
|
|
5172
5186
|
getDistanceToFitSphere(e) {
|
|
5173
5187
|
if (It(this._camera, "getDistanceToFitSphere"))
|
|
5174
5188
|
return this._spherical.radius;
|
|
5175
|
-
const t = this._camera.getEffectiveFOV() *
|
|
5189
|
+
const t = this._camera.getEffectiveFOV() * Fe, s = Math.atan(Math.tan(t * 0.5) * this._camera.aspect) * 2, n = 1 < this._camera.aspect ? t : s;
|
|
5176
5190
|
return e / Math.sin(n * 0.5);
|
|
5177
5191
|
}
|
|
5178
5192
|
/**
|
|
@@ -5230,7 +5244,7 @@ class re extends Jr {
|
|
|
5230
5244
|
* @category Methods
|
|
5231
5245
|
*/
|
|
5232
5246
|
reset(e = !1) {
|
|
5233
|
-
if (!
|
|
5247
|
+
if (!N(this._camera.up.x, this._cameraUp0.x) || !N(this._camera.up.y, this._cameraUp0.y) || !N(this._camera.up.z, this._cameraUp0.z)) {
|
|
5234
5248
|
this._camera.up.copy(this._cameraUp0);
|
|
5235
5249
|
const s = this.getPosition(A);
|
|
5236
5250
|
this.updateCameraUp(), this.setPosition(s.x, s.y, s.z);
|
|
@@ -5315,22 +5329,22 @@ class re extends Jr {
|
|
|
5315
5329
|
}
|
|
5316
5330
|
if (this.dollyToCursor) {
|
|
5317
5331
|
if (fe(this._camera) && this._changedDolly !== 0) {
|
|
5318
|
-
const d = this._spherical.radius - this._lastDistance, u = this._camera, m = this._getCameraDirection(
|
|
5332
|
+
const d = this._spherical.radius - this._lastDistance, u = this._camera, m = this._getCameraDirection(Be), C = A.copy(m).cross(u.up).normalize();
|
|
5319
5333
|
C.lengthSq() === 0 && (C.x = 1);
|
|
5320
|
-
const v = U.crossVectors(C, m), y = this._sphericalEnd.radius * Math.tan(u.getEffectiveFOV() *
|
|
5334
|
+
const v = U.crossVectors(C, m), y = this._sphericalEnd.radius * Math.tan(u.getEffectiveFOV() * Fe * 0.5), _ = (this._sphericalEnd.radius - d - this._sphericalEnd.radius) / this._sphericalEnd.radius, E = Pe.copy(this._targetEnd).add(C.multiplyScalar(this._dollyControlCoord.x * y * u.aspect)).add(v.multiplyScalar(this._dollyControlCoord.y * y)), S = A.copy(this._targetEnd).lerp(E, _), b = this._lastDollyDirection === Re.IN && this._spherical.radius <= this.minDistance, O = this._lastDollyDirection === Re.OUT && this.maxDistance <= this._spherical.radius;
|
|
5321
5335
|
if (this.infinityDolly && (b || O)) {
|
|
5322
5336
|
this._sphericalEnd.radius -= d, this._spherical.radius -= d;
|
|
5323
5337
|
const P = U.copy(m).multiplyScalar(-d);
|
|
5324
5338
|
S.add(P);
|
|
5325
5339
|
}
|
|
5326
5340
|
this._boundary.clampPoint(S, S);
|
|
5327
|
-
const
|
|
5328
|
-
this._targetEnd.copy(S), this._target.add(
|
|
5329
|
-
} else if (
|
|
5330
|
-
const d = this._zoom - this._lastZoom, u = this._camera, m = A.set(this._dollyControlCoord.x, this._dollyControlCoord.y, (u.near + u.far) / (u.near - u.far)).unproject(u), C = U.set(0, 0, -1).applyQuaternion(u.quaternion), v = Pe.copy(m).add(C.multiplyScalar(-m.dot(u.up))), g = -(this._zoom - d - this._zoom) / this._zoom, _ = this._getCameraDirection(
|
|
5341
|
+
const x = U.subVectors(S, this._targetEnd);
|
|
5342
|
+
this._targetEnd.copy(S), this._target.add(x), this._changedDolly -= d, F(this._changedDolly) && (this._changedDolly = 0);
|
|
5343
|
+
} else if (de(this._camera) && this._changedZoom !== 0) {
|
|
5344
|
+
const d = this._zoom - this._lastZoom, u = this._camera, m = A.set(this._dollyControlCoord.x, this._dollyControlCoord.y, (u.near + u.far) / (u.near - u.far)).unproject(u), C = U.set(0, 0, -1).applyQuaternion(u.quaternion), v = Pe.copy(m).add(C.multiplyScalar(-m.dot(u.up))), g = -(this._zoom - d - this._zoom) / this._zoom, _ = this._getCameraDirection(Be), E = this._targetEnd.dot(_), S = A.copy(this._targetEnd).lerp(v, g), b = S.dot(_), O = _.multiplyScalar(b - E);
|
|
5331
5345
|
S.sub(O), this._boundary.clampPoint(S, S);
|
|
5332
|
-
const
|
|
5333
|
-
this._targetEnd.copy(S), this._target.add(
|
|
5346
|
+
const x = U.subVectors(S, this._targetEnd);
|
|
5347
|
+
this._targetEnd.copy(S), this._target.add(x), this._changedZoom -= d, F(this._changedZoom) && (this._changedZoom = 0);
|
|
5334
5348
|
}
|
|
5335
5349
|
}
|
|
5336
5350
|
this._camera.zoom !== this._zoom && (this._camera.zoom = this._zoom, this._camera.updateProjectionMatrix(), this._updateNearPlaneCorners(), this._needsUpdate = !0), this._dragNeedsUpdate = !0;
|
|
@@ -5347,13 +5361,13 @@ class re extends Jr {
|
|
|
5347
5361
|
return JSON.stringify({
|
|
5348
5362
|
enabled: this._enabled,
|
|
5349
5363
|
minDistance: this.minDistance,
|
|
5350
|
-
maxDistance:
|
|
5364
|
+
maxDistance: ze(this.maxDistance),
|
|
5351
5365
|
minZoom: this.minZoom,
|
|
5352
|
-
maxZoom:
|
|
5366
|
+
maxZoom: ze(this.maxZoom),
|
|
5353
5367
|
minPolarAngle: this.minPolarAngle,
|
|
5354
|
-
maxPolarAngle:
|
|
5355
|
-
minAzimuthAngle:
|
|
5356
|
-
maxAzimuthAngle:
|
|
5368
|
+
maxPolarAngle: ze(this.maxPolarAngle),
|
|
5369
|
+
minAzimuthAngle: ze(this.minAzimuthAngle),
|
|
5370
|
+
maxAzimuthAngle: ze(this.maxAzimuthAngle),
|
|
5357
5371
|
smoothTime: this.smoothTime,
|
|
5358
5372
|
draggingSmoothTime: this.draggingSmoothTime,
|
|
5359
5373
|
dollySpeed: this.dollySpeed,
|
|
@@ -5377,7 +5391,7 @@ class re extends Jr {
|
|
|
5377
5391
|
*/
|
|
5378
5392
|
fromJSON(e, t = !1) {
|
|
5379
5393
|
const s = JSON.parse(e);
|
|
5380
|
-
this.enabled = s.enabled, this.minDistance = s.minDistance, this.maxDistance =
|
|
5394
|
+
this.enabled = s.enabled, this.minDistance = s.minDistance, this.maxDistance = He(s.maxDistance), this.minZoom = s.minZoom, this.maxZoom = He(s.maxZoom), this.minPolarAngle = s.minPolarAngle, this.maxPolarAngle = He(s.maxPolarAngle), this.minAzimuthAngle = He(s.minAzimuthAngle), this.maxAzimuthAngle = He(s.maxAzimuthAngle), this.smoothTime = s.smoothTime, this.draggingSmoothTime = s.draggingSmoothTime, this.dollySpeed = s.dollySpeed, this.truckSpeed = s.truckSpeed, this.dollyToCursor = s.dollyToCursor, this._target0.fromArray(s.target0), this._position0.fromArray(s.position0), this._zoom0 = s.zoom0, this._focalOffset0.fromArray(s.focalOffset0), this.moveTo(s.target[0], s.target[1], s.target[2], t), X.setFromVector3(A.fromArray(s.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)), this.rotateTo(X.theta, X.phi, t), this.dollyTo(X.radius, t), this.zoomTo(s.zoom, t), this.setFocalOffset(s.focalOffset[0], s.focalOffset[1], s.focalOffset[2], t), this._needsUpdate = !0;
|
|
5381
5395
|
}
|
|
5382
5396
|
/**
|
|
5383
5397
|
* Attach all internal event handlers to enable drag control.
|
|
@@ -5388,7 +5402,7 @@ class re extends Jr {
|
|
|
5388
5402
|
console.warn("camera-controls is already connected.");
|
|
5389
5403
|
return;
|
|
5390
5404
|
}
|
|
5391
|
-
e.setAttribute("data-camera-controls-version",
|
|
5405
|
+
e.setAttribute("data-camera-controls-version", ta), this._addAllEventListeners(e), this._getClientRect(this._elementRect);
|
|
5392
5406
|
}
|
|
5393
5407
|
/**
|
|
5394
5408
|
* Detach all internal event handlers to disable drag control.
|
|
@@ -5438,9 +5452,9 @@ class re extends Jr {
|
|
|
5438
5452
|
}
|
|
5439
5453
|
_updateNearPlaneCorners() {
|
|
5440
5454
|
if (fe(this._camera)) {
|
|
5441
|
-
const e = this._camera, t = e.near, s = e.getEffectiveFOV() *
|
|
5455
|
+
const e = this._camera, t = e.near, s = e.getEffectiveFOV() * Fe, n = Math.tan(s * 0.5) * t, a = n * e.aspect;
|
|
5442
5456
|
this._nearPlaneCorners[0].set(-a, -n, 0), this._nearPlaneCorners[1].set(a, -n, 0), this._nearPlaneCorners[2].set(a, n, 0), this._nearPlaneCorners[3].set(-a, n, 0);
|
|
5443
|
-
} else if (
|
|
5457
|
+
} else if (de(this._camera)) {
|
|
5444
5458
|
const e = this._camera, t = 1 / e.zoom, s = e.left * t, n = e.right * t, a = e.top * t, r = e.bottom * t;
|
|
5445
5459
|
this._nearPlaneCorners[0].set(s, a, 0), this._nearPlaneCorners[1].set(n, a, 0), this._nearPlaneCorners[2].set(n, r, 0), this._nearPlaneCorners[3].set(s, r, 0);
|
|
5446
5460
|
}
|
|
@@ -5450,7 +5464,7 @@ class re extends Jr {
|
|
|
5450
5464
|
let e = 1 / 0;
|
|
5451
5465
|
if (!(this.colliderMeshes.length >= 1) || It(this._camera, "_collisionTest"))
|
|
5452
5466
|
return e;
|
|
5453
|
-
const s = this._getTargetDirection(
|
|
5467
|
+
const s = this._getTargetDirection(Be);
|
|
5454
5468
|
Ft.lookAt(Pi, s, this._camera.up);
|
|
5455
5469
|
for (let n = 0; n < 4; n++) {
|
|
5456
5470
|
const a = U.copy(this._nearPlaneCorners[n]);
|
|
@@ -5593,7 +5607,7 @@ const ft = (i) => {
|
|
|
5593
5607
|
)
|
|
5594
5608
|
] })
|
|
5595
5609
|
] });
|
|
5596
|
-
}),
|
|
5610
|
+
}), sa = `out vec3 worldPosition;
|
|
5597
5611
|
uniform float uDistance;
|
|
5598
5612
|
|
|
5599
5613
|
void main() {
|
|
@@ -5602,7 +5616,7 @@ void main() {
|
|
|
5602
5616
|
worldPosition.xz += cameraPosition.xz;
|
|
5603
5617
|
|
|
5604
5618
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(worldPosition, 1.0);
|
|
5605
|
-
}`,
|
|
5619
|
+
}`, na = `out vec4 fragColor;
|
|
5606
5620
|
in vec3 worldPosition;
|
|
5607
5621
|
uniform float uDivisions;
|
|
5608
5622
|
uniform float uScale;
|
|
@@ -5671,7 +5685,7 @@ void main() {
|
|
|
5671
5685
|
|
|
5672
5686
|
if (fragColor.a <= minAlpha) discard;
|
|
5673
5687
|
}`;
|
|
5674
|
-
class
|
|
5688
|
+
class ra extends ts {
|
|
5675
5689
|
constructor(e) {
|
|
5676
5690
|
super({
|
|
5677
5691
|
extensions: {
|
|
@@ -5702,8 +5716,8 @@ class na extends ts {
|
|
|
5702
5716
|
side: Wi,
|
|
5703
5717
|
transparent: !0,
|
|
5704
5718
|
name: "InfiniteGrid",
|
|
5705
|
-
vertexShader:
|
|
5706
|
-
fragmentShader:
|
|
5719
|
+
vertexShader: sa,
|
|
5720
|
+
fragmentShader: na
|
|
5707
5721
|
});
|
|
5708
5722
|
}
|
|
5709
5723
|
// Getters / Setters
|
|
@@ -5726,10 +5740,10 @@ class na extends ts {
|
|
|
5726
5740
|
this.uniforms.uSubgridOpacity.value = e;
|
|
5727
5741
|
}
|
|
5728
5742
|
}
|
|
5729
|
-
class
|
|
5743
|
+
class aa extends Bi {
|
|
5730
5744
|
gridMaterial;
|
|
5731
5745
|
constructor(e) {
|
|
5732
|
-
const t = new
|
|
5746
|
+
const t = new ra(e);
|
|
5733
5747
|
super(new zs(), t), this.gridMaterial = t, this.frustumCulled = !1, this.name = "InfiniteGridHelper";
|
|
5734
5748
|
}
|
|
5735
5749
|
// Getters / Setters
|
|
@@ -5752,7 +5766,7 @@ class ra extends Bi {
|
|
|
5752
5766
|
this.gridMaterial.subgridOpacity = e;
|
|
5753
5767
|
}
|
|
5754
5768
|
}
|
|
5755
|
-
class
|
|
5769
|
+
class oa extends sn {
|
|
5756
5770
|
uScale;
|
|
5757
5771
|
uDivisions;
|
|
5758
5772
|
uColor;
|
|
@@ -5760,34 +5774,34 @@ class aa extends tn {
|
|
|
5760
5774
|
uSubgridOpacity;
|
|
5761
5775
|
uGridOpacity;
|
|
5762
5776
|
constructor(e) {
|
|
5763
|
-
super(), this.name = "InfiniteGrid", this.side =
|
|
5764
|
-
const { uScale: t, uDivisions: s, uColor: n, uDistance: a, uSubgridOpacity: r, uGridOpacity: o } = this, c =
|
|
5765
|
-
this.positionNode =
|
|
5766
|
-
const h =
|
|
5767
|
-
|
|
5777
|
+
super(), this.name = "InfiniteGrid", this.side = nn, this.transparent = !0, this.uScale = xe(e?.scale ?? 0.1), this.uDivisions = xe(e?.divisions ?? 10), this.uColor = xe(e?.color ?? new dt(16777215)), this.uDistance = xe(e?.distance ?? 1e4), this.uSubgridOpacity = xe(e?.subgridOpacity ?? 0.15), this.uGridOpacity = xe(e?.gridOpacity ?? 0.25);
|
|
5778
|
+
const { uScale: t, uDivisions: s, uColor: n, uDistance: a, uSubgridOpacity: r, uGridOpacity: o } = this, c = Pn("vec3", "vWorldPosition");
|
|
5779
|
+
this.positionNode = xt(() => {
|
|
5780
|
+
const h = In.xzy.mul(a).add(
|
|
5781
|
+
Un(it.x, Y(0), it.z)
|
|
5768
5782
|
);
|
|
5769
5783
|
return c.assign(h), h;
|
|
5770
5784
|
})();
|
|
5771
|
-
const l =
|
|
5772
|
-
const d = c.xz.div(h), u =
|
|
5773
|
-
return Y(1).sub(
|
|
5785
|
+
const l = xt(([h]) => {
|
|
5786
|
+
const d = c.xz.div(h), u = Ln(d), m = mi(Nn(d.sub(0.5)).sub(0.5)).div(u).div(2), C = wt(m.x, m.y);
|
|
5787
|
+
return Y(1).sub(wt(C, Y(1)));
|
|
5774
5788
|
});
|
|
5775
|
-
this.outputNode =
|
|
5776
|
-
const h = c, d = fi(Y(200), mi(it.y.sub(h.y))), u = Y(kn(it, h)), m = gi(d).div(gi(s)), C = vi(s,
|
|
5789
|
+
this.outputNode = xt(() => {
|
|
5790
|
+
const h = c, d = fi(Y(200), mi(it.y.sub(h.y))), u = Y(kn(it, h)), m = gi(d).div(gi(s)), C = vi(s, Fn(m)), v = C.mul(s), y = v.mul(s), g = l(C.mul(t)), _ = l(v.mul(t)), E = l(y.mul(t)), S = d.sub(C).div(v.sub(C)), b = Y(0.3), O = fi(
|
|
5777
5791
|
S.sub(Y(1)).add(b),
|
|
5778
5792
|
Y(0)
|
|
5779
|
-
).div(b),
|
|
5780
|
-
vi(Y(1).sub(
|
|
5781
|
-
), P = Y(0.5),
|
|
5782
|
-
|
|
5783
|
-
|
|
5793
|
+
).div(b), x = g.mul(
|
|
5794
|
+
vi(Y(1).sub(wt(u.div(a), Y(1))), Y(3))
|
|
5795
|
+
), P = Y(0.5), w = x.sub(O).mul(r), k = _i(
|
|
5796
|
+
w,
|
|
5797
|
+
x.mul(o).sub(
|
|
5784
5798
|
O.mul(o.sub(r)).mul(P)
|
|
5785
5799
|
),
|
|
5786
5800
|
_
|
|
5787
|
-
), Q = Y(_i(
|
|
5788
|
-
return
|
|
5789
|
-
|
|
5790
|
-
}),
|
|
5801
|
+
), Q = Y(_i(k, x.mul(o), E));
|
|
5802
|
+
return zn(Hn(Q, Y(1 / 127)), () => {
|
|
5803
|
+
Bn();
|
|
5804
|
+
}), Vn(n, Q);
|
|
5791
5805
|
})();
|
|
5792
5806
|
}
|
|
5793
5807
|
// Getters / Setters
|
|
@@ -5810,11 +5824,11 @@ class aa extends tn {
|
|
|
5810
5824
|
this.uSubgridOpacity.value = e;
|
|
5811
5825
|
}
|
|
5812
5826
|
}
|
|
5813
|
-
class
|
|
5827
|
+
class la extends ut {
|
|
5814
5828
|
gridMaterial;
|
|
5815
5829
|
constructor(e) {
|
|
5816
|
-
const t = new
|
|
5817
|
-
super(new
|
|
5830
|
+
const t = new oa(e);
|
|
5831
|
+
super(new rn(), t), this.gridMaterial = t, this.frustumCulled = !1, this.name = "InfiniteGridHelper";
|
|
5818
5832
|
}
|
|
5819
5833
|
// Getters / Setters
|
|
5820
5834
|
get color() {
|
|
@@ -5856,14 +5870,14 @@ function zt(i) {
|
|
|
5856
5870
|
i.name
|
|
5857
5871
|
);
|
|
5858
5872
|
}
|
|
5859
|
-
class
|
|
5873
|
+
class ca extends is {
|
|
5860
5874
|
constructor() {
|
|
5861
5875
|
super();
|
|
5862
|
-
const e =
|
|
5876
|
+
const e = Gn($n(), 0.1, 0.5, 0, 1).oneMinus();
|
|
5863
5877
|
this.colorNode = ss(e, e, e, 1);
|
|
5864
5878
|
}
|
|
5865
5879
|
}
|
|
5866
|
-
const
|
|
5880
|
+
const ha = `#include <common>
|
|
5867
5881
|
#include <batching_pars_vertex>
|
|
5868
5882
|
#include <uv_pars_vertex>
|
|
5869
5883
|
#include <color_pars_vertex>
|
|
@@ -5893,7 +5907,7 @@ void main() {
|
|
|
5893
5907
|
#include <logdepthbuf_vertex>
|
|
5894
5908
|
#include <clipping_planes_vertex>
|
|
5895
5909
|
#include <worldpos_vertex>
|
|
5896
|
-
}`,
|
|
5910
|
+
}`, da = `
|
|
5897
5911
|
uniform float opacity;
|
|
5898
5912
|
#include <common>
|
|
5899
5913
|
#include <uv_pars_fragment>
|
|
@@ -5904,7 +5918,7 @@ void main() {
|
|
|
5904
5918
|
if (opacity < 0.015) discard;
|
|
5905
5919
|
gl_FragColor = vec4(vec3(vUv, 0.0), opacity);
|
|
5906
5920
|
}`;
|
|
5907
|
-
class
|
|
5921
|
+
class ua extends ts {
|
|
5908
5922
|
constructor() {
|
|
5909
5923
|
super({
|
|
5910
5924
|
defines: {
|
|
@@ -5913,15 +5927,15 @@ class da extends ts {
|
|
|
5913
5927
|
uniforms: {
|
|
5914
5928
|
opacity: { value: 1 }
|
|
5915
5929
|
},
|
|
5916
|
-
vertexShader:
|
|
5917
|
-
fragmentShader:
|
|
5930
|
+
vertexShader: ha,
|
|
5931
|
+
fragmentShader: da,
|
|
5918
5932
|
transparent: !0
|
|
5919
5933
|
});
|
|
5920
5934
|
}
|
|
5921
5935
|
}
|
|
5922
|
-
class
|
|
5936
|
+
class pa extends is {
|
|
5923
5937
|
constructor() {
|
|
5924
|
-
super(), this.colorNode = ss(
|
|
5938
|
+
super(), this.colorNode = ss(Wn(), 0, 1);
|
|
5925
5939
|
}
|
|
5926
5940
|
}
|
|
5927
5941
|
class $ extends $i {
|
|
@@ -5939,7 +5953,7 @@ class $ extends $i {
|
|
|
5939
5953
|
for (const e of this.controls.values()) {
|
|
5940
5954
|
e.detach(), e.disconnect();
|
|
5941
5955
|
const t = e.getHelper();
|
|
5942
|
-
|
|
5956
|
+
ce(t);
|
|
5943
5957
|
}
|
|
5944
5958
|
this.controls = /* @__PURE__ */ new Map(), this.visibility = /* @__PURE__ */ new Map();
|
|
5945
5959
|
}
|
|
@@ -5947,7 +5961,7 @@ class $ extends $i {
|
|
|
5947
5961
|
let t = this.controls.get(e);
|
|
5948
5962
|
if (t === void 0) {
|
|
5949
5963
|
const s = document.querySelector(".clickable");
|
|
5950
|
-
t = new
|
|
5964
|
+
t = new Yn(this.activeCamera, s), t.getHelper().name = e, t.setSize(0.5), t.setSpace("local"), this.controls.set(e, t), this.visibility.set(e, !0), t.addEventListener("mouseDown", () => {
|
|
5951
5965
|
this.dispatchEvent({ type: $.DRAG_START });
|
|
5952
5966
|
}), t.addEventListener("mouseUp", () => {
|
|
5953
5967
|
this.dispatchEvent({ type: $.DRAG_END });
|
|
@@ -5962,7 +5976,7 @@ class $ extends $i {
|
|
|
5962
5976
|
}
|
|
5963
5977
|
remove(e) {
|
|
5964
5978
|
const t = this.get(e);
|
|
5965
|
-
return t === void 0 ? !1 : (t.detach(), t.disconnect(),
|
|
5979
|
+
return t === void 0 ? !1 : (t.detach(), t.disconnect(), ce(t.getHelper()), this.controls.delete(e), !0);
|
|
5966
5980
|
}
|
|
5967
5981
|
enabled(e) {
|
|
5968
5982
|
this.controls.forEach((t) => {
|
|
@@ -5993,7 +6007,7 @@ class $ extends $i {
|
|
|
5993
6007
|
return $._instance || ($._instance = new $()), $._instance;
|
|
5994
6008
|
}
|
|
5995
6009
|
}
|
|
5996
|
-
const
|
|
6010
|
+
const ma = new an(), Ht = new $e();
|
|
5997
6011
|
class Bt extends ci {
|
|
5998
6012
|
curve = new hi();
|
|
5999
6013
|
line;
|
|
@@ -6016,7 +6030,7 @@ class Bt extends ci {
|
|
|
6016
6030
|
group;
|
|
6017
6031
|
constructor(e, t) {
|
|
6018
6032
|
const s = new dt(Ot(0.5, 1, Math.random()), Ot(0.5, 1, Math.random()), Ot(0.5, 1, Math.random()));
|
|
6019
|
-
super(), this.name = e, this.lineMaterial = new
|
|
6033
|
+
super(), this.name = e, this.lineMaterial = new on({ color: s }), this.line = new ln(new di(), this.lineMaterial), this.line.name = "line", this.line.visible = !1, this.add(this.line), this._camera = t, this.curveType = "catmullrom", this.draggedMat.color = s, this.draggable = new ci(), this.draggable.name = "draggablePoints", this.add(this.draggable), this.curvePos = new ut(new cn(1.5), new $t({ color: s })), this.curvePos.name = "curvePos", this.curvePos.scale.setScalar(this._draggableScale), this.curvePos.visible = !1, this.add(this.curvePos), this.raycaster = new Wt(), this.raycaster.params.Line.threshold = 3, this.enable();
|
|
6020
6034
|
}
|
|
6021
6035
|
enable() {
|
|
6022
6036
|
document.addEventListener("pointerdown", this.onMouseClick);
|
|
@@ -6038,7 +6052,7 @@ class Bt extends ci {
|
|
|
6038
6052
|
te(t.position.y, 3),
|
|
6039
6053
|
te(t.position.z, 3)
|
|
6040
6054
|
]);
|
|
6041
|
-
}),
|
|
6055
|
+
}), Zn({
|
|
6042
6056
|
name: this.name,
|
|
6043
6057
|
points: e,
|
|
6044
6058
|
tension: this.tension,
|
|
@@ -6060,7 +6074,7 @@ class Bt extends ci {
|
|
|
6060
6074
|
}
|
|
6061
6075
|
};
|
|
6062
6076
|
addPoint = (e, t = !0) => {
|
|
6063
|
-
const s = this.draggable.children.length, n = new ut(
|
|
6077
|
+
const s = this.draggable.children.length, n = new ut(ma, this.draggedMat);
|
|
6064
6078
|
n.name = `point_${s}`, n.position.copy(e), n.scale.setScalar(this._draggableScale), this.draggable.add(n), this._transform?.attach(n);
|
|
6065
6079
|
const a = this.points.length > 1;
|
|
6066
6080
|
return a && t && this.updateSpline(), this.line.visible = a, this.updateCurrentPoint(), n;
|
|
@@ -6075,7 +6089,7 @@ class Bt extends ci {
|
|
|
6075
6089
|
const t = this.draggable.children[this.draggable.children.length - 1];
|
|
6076
6090
|
this._transform?.attach(t), this.updateField(t.position);
|
|
6077
6091
|
}
|
|
6078
|
-
|
|
6092
|
+
ce(e), this.updateSpline();
|
|
6079
6093
|
};
|
|
6080
6094
|
removePointAt = (e) => {
|
|
6081
6095
|
const t = this.draggable.children[e];
|
|
@@ -6313,7 +6327,7 @@ class Bt extends ci {
|
|
|
6313
6327
|
this.exportSpline();
|
|
6314
6328
|
break;
|
|
6315
6329
|
case "Delete":
|
|
6316
|
-
this.parent.currentSpline = null,
|
|
6330
|
+
this.parent.currentSpline = null, ce(this);
|
|
6317
6331
|
break;
|
|
6318
6332
|
case "Current Point":
|
|
6319
6333
|
if (this.group.current && this._transform?.object) {
|
|
@@ -6332,7 +6346,7 @@ class Bt extends ci {
|
|
|
6332
6346
|
};
|
|
6333
6347
|
}
|
|
6334
6348
|
let ct = 0;
|
|
6335
|
-
class
|
|
6349
|
+
class fa extends Hs {
|
|
6336
6350
|
defaultScale = 10;
|
|
6337
6351
|
currentSpline = null;
|
|
6338
6352
|
_camera;
|
|
@@ -6424,14 +6438,14 @@ class ma extends Hs {
|
|
|
6424
6438
|
createSplineFromArray = (e) => {
|
|
6425
6439
|
const t = [];
|
|
6426
6440
|
return e.forEach((s) => {
|
|
6427
|
-
t.push(new
|
|
6441
|
+
t.push(new Le(s[0], s[1], s[2]));
|
|
6428
6442
|
}), this.createSpline(t);
|
|
6429
6443
|
};
|
|
6430
6444
|
createSplineFromCatmullRom = (e) => this.createSpline(e.points);
|
|
6431
6445
|
createSplineFromJSON = (e) => {
|
|
6432
6446
|
const t = [];
|
|
6433
6447
|
e.points.forEach((n) => {
|
|
6434
|
-
t.push(new
|
|
6448
|
+
t.push(new Le(n[0], n[1], n[2]));
|
|
6435
6449
|
});
|
|
6436
6450
|
const s = new Bt(e.name, this._camera);
|
|
6437
6451
|
return s.closed = e.closed, s.subdivide = e.subdivide, s.tension = e.tension, s.type = e.type, s.addPoints(t), s.updateSpline(), this.addSpline(s, !1), s;
|
|
@@ -6446,7 +6460,7 @@ class ma extends Hs {
|
|
|
6446
6460
|
t.tension !== void 0 && (n.tension = t.tension), t.closed !== void 0 && (n.closed = t.closed), t.subdivide !== void 0 && (n.subdivide = t.subdivide), t.type !== void 0 && (n.curveType = t.type);
|
|
6447
6461
|
const a = [];
|
|
6448
6462
|
t.points.forEach((r) => {
|
|
6449
|
-
a.push(new
|
|
6463
|
+
a.push(new Le(r[0], r[1], r[2]));
|
|
6450
6464
|
}), n.addPoints(a), this.addSpline(n, !1), ct++;
|
|
6451
6465
|
};
|
|
6452
6466
|
isMouseDown = !1;
|
|
@@ -6490,7 +6504,7 @@ class ma extends Hs {
|
|
|
6490
6504
|
this.isMouseDown = !1;
|
|
6491
6505
|
};
|
|
6492
6506
|
mouseToSplinePos(e, t, s, n) {
|
|
6493
|
-
const a = new
|
|
6507
|
+
const a = new Le(), r = Math.PI / 2, o = this._camera, c = o.zoom, l = o.rotation.x === -6123233995736766e-32 && o.rotation.y === 0 && o.rotation.z === 0, h = o.rotation.x === -Math.PI && o.rotation.y === 12246467991473532e-32 && o.rotation.z === Math.PI, d = o.rotation.x === -6162975822039155e-48 && o.rotation.y === -r && o.rotation.z === 0, u = o.rotation.x === -6162975822039155e-48 && o.rotation.y === r && o.rotation.z === 0, m = o.rotation.x === -1.5707953264174506 && o.rotation.y === 0 && o.rotation.z === 0, C = o.rotation.x === 1.5707953264174506 && o.rotation.y === 0 && o.rotation.z === 0;
|
|
6494
6508
|
let v = e, y = t;
|
|
6495
6509
|
h || u ? v *= -1 : m && (y *= -1);
|
|
6496
6510
|
const g = s / 2 / c, _ = n / 2 / c;
|
|
@@ -6516,12 +6530,12 @@ class ma extends Hs {
|
|
|
6516
6530
|
});
|
|
6517
6531
|
}
|
|
6518
6532
|
}
|
|
6519
|
-
const
|
|
6533
|
+
const ki = [
|
|
6520
6534
|
"Single",
|
|
6521
6535
|
"Side by Side",
|
|
6522
6536
|
"Stacked",
|
|
6523
6537
|
"Quad"
|
|
6524
|
-
],
|
|
6538
|
+
], ga = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAC60lEQVRYhe2YT4hNcRTHP48xpmYaNAvRyEQxEhnKQljYsRm9/EmSyJiMFAsMZWNhJYoNIUVJ2VGiyb9ZzIpMpkQSahbGv9GMYWrM+1rc2zjvzvvdd+99rzdvMd+6de75nd+5387vnN/v/G5KEuWMKRNNIB8mCRaKiiL5qQb2ApuBuUAV0Ad0AJeB3sSeJRX6LJbULTf6JTUn9Z+KWMUpPyp/Avoa4CNQZ3Sj/lNpdL/xottR7AjOkHRUUpekN5I6JbVLavDH75lIfZN0UFKTpCWS0pJem/HeJBEMG6yV1ONYtgFJbZJ+GF1jDh+zJb03NuliEuwMkMo4yErS2RA/LcbuYVyCrm1mA7Dal/8Cu4FG4JD/HsTTkCy6a+SVMTPQuc1sBKb78nHghi+/A+YBxwL2lbhRY+ThuARdEVxu5JdGFvACr0otdoZ8Y4+Rn0Sn5sFFsMvI6YB9MzA1YJ8mN8k1wAHzfj4uQVdyrpI0aJL7oqTtkq4FiqPLyCOSbktqlbRL0jlJQ2b8QdwCUZ4qvhRStZL0XFK1pMd57CRvq5mfhKBriRfiFUMY6oD7eOdwPlQAN4G10dfWg+uouwXsiOssAj4AC+JMcEWwvnAuOTEr7gTXPmg34zagOwkbIIOXAo9CbDYBrcBXYN+4UUdy2sRflyS5zVNlfPX7ugpJW5V9nI7mmh+lYU0lCZ2B3TOnAVuAk0BTwC5nuhWro46KauBOQJch5OpRaoIW34GreGf+YZdRqS9NAj4Bp4ClQDvwOWxCqSM4ADQEdKE5XvbXzlITrAVe4TW+M6NMKDXBFLAMuAD0ACfIc7pMZBXXA2cY3/xmodQRHAL2A2+NLtj8ZiEKwUL/z2WMPAJcAVYALWSf8dZuDFGWeBHwKxm3sWYhiGG8Tfo6sA2vSfiSy4GrH3wGrDcfKSSKKf6v1E9yF0XK9Q1XBPuMXMw8HXTonQFwETwNzMFr64v1jzgFHIk9ybHEZYPJo65QlD3Bf2/Q/eaHPiSWAAAAAElFTkSuQmCC", va = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAETklEQVRYhe2YXYhVVRTHf3d0/JhyUrMpFbImM+whSa3Mynww+4AeIgiKoozooQ+KyMyXIAujF6OXqHyI6iEKKYgIP/owsjSFqCkprdDUTEcjbWZ0HHV+Pex1ucfb9Z57Z9REXHA4Z++99l7/s/ZZ/7X2KaiczNLwfwPIk9MA+yunNMAG4DHgV+BvoB3YFff2TPstYEyfrajVroI6Sr1GvahsbJC63HzZq04pmztSvU5tVRuqYRiYg78JeBR4HPg5ntdmxovz9wJfA3uAxuibDLQCA+IqynnAQuBuYCnwMLC1rx48U12U8cZqdWqMDcx4cI16qTpYbVKHqa+ovWUeHKsujn7VL9ULq2HI+wY7gVeBJdGeFu3J4ZUiy/cAXeHRRuAQsC/GC0B3eG4BcH/0tUV7czUAeVsMsBF4Kha9HZgCvAncAuwPnXHA0wFuGLANuDrGuoGDwFxgTqzzQ7RX5FrP2eLsdb76vnogtme6+nE8H1YPlQXHwbi3q9eqn0e7Tb25VrsF68vFY0lb1AGcDTwItGQ8tQM4AIwGmqP/EPAu8A0wElgJfFGzxTo8mKWXu9Rd4ZF96jvqjSbauEC9Sn1O3R463epLaku99voCsFXdkAH3kNpcQW+IiT/bQne3eufxBtioPqP2mKhioXpWzpxb1T8C5Ifh4ZptVoriRmAIKdrI3Lujf3bobAPeJpF0NVkKrAFuI9HTOBIxnxFrF4OgQKKr/dnJlQA+AcwABgOHA4zAamA5cE7orQL+zAEHiWI+A2bFC7aSguheYCgpqAphZz3wSB7AecCICv2TgH8oFRib4gVqka0k0h8CXAxMBW6ooDejFoCvA9OBQUAvKWM0kDz4XUZvNKXtyZMWUl7vBbaQXq457PeEziDgx/KJlQAuIPFdMcEXv5OdYWBP9M8k8VpnDQCvB4aTSrCNJB5cSdrW3tBpIJVnR0qdUTxAfdGUOVTnmwqEanNmqltC/9OgqePKg5eom8PgdvW+oJ9Kupera0O3U50TL3lcAaI+oHaF4R3qa6Z822wq0Saq89T1lmSxOrxeW/Xm4uGkiqQDmECKuKHxHW0HdpMiewSpvGqKeR8Ay0iBsYIjg6261PE2o9Q3Yqv+MqWxO9R1Hl12qs+q49Vlppy82pSr+5xJKsko4AXgHlJ0t5NIeg3wLXAlqZhtIUV8J6nmWwX8QiLjdhL5TwMWkY4R6/rrwYKlMr1Y321QZ/vfwBijPqm+rF4Wc7PjE9QllurGVeoV5gRNHsAm9fnMom3qrKPoTjKdMXaYyrFygEWQ72XWW24qhPu8xcUc2UU6O8wFPjmK7jhgPHAuMJGUGQ6U6WwE5sfzTXGvei7KA9hFOiR9D/wOfFVFt4dS2tpfRe83Ur7/CPiJakfOGgBCypubatArl2r8VfOax/LfzABKtePAzHO/5FgC7KBEzB2kOrDfUm8mOeFySv9+OyFyGmB/5aQH+C9BVKmVCNuMZgAAAABJRU5ErkJggg==", _a = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAQ0lEQVQ4jWP8////fwYqAxYozUhFM/8zkaKYWIWkGEq0b0ZdSjQY5i79TyWagRGaTUdzFEEw6lLqGzqwLoVVJ1StpwA9sBwbUqAh5gAAAABJRU5ErkJggg==";
|
|
6525
6539
|
class G extends Qe {
|
|
6526
6540
|
static instance = null;
|
|
6527
6541
|
scene;
|
|
@@ -6533,11 +6547,11 @@ class G extends Qe {
|
|
|
6533
6547
|
currentCamera;
|
|
6534
6548
|
currentWindow;
|
|
6535
6549
|
// RefObject to one of the "windows"
|
|
6536
|
-
helpersContainer = new
|
|
6550
|
+
helpersContainer = new hn();
|
|
6537
6551
|
grid;
|
|
6538
6552
|
cameraHelpers = /* @__PURE__ */ new Map();
|
|
6539
6553
|
lightHelpers = /* @__PURE__ */ new Map();
|
|
6540
|
-
interactionHelper = new
|
|
6554
|
+
interactionHelper = new dn(25);
|
|
6541
6555
|
currentTransform;
|
|
6542
6556
|
// Tools
|
|
6543
6557
|
splineEditor;
|
|
@@ -6573,7 +6587,7 @@ class G extends Qe {
|
|
|
6573
6587
|
selectedItem = void 0;
|
|
6574
6588
|
debugCamera;
|
|
6575
6589
|
raycaster = new Wt();
|
|
6576
|
-
pointer = new
|
|
6590
|
+
pointer = new $e();
|
|
6577
6591
|
cameraControls = void 0;
|
|
6578
6592
|
// References
|
|
6579
6593
|
canvasRef;
|
|
@@ -6594,7 +6608,7 @@ class G extends Qe {
|
|
|
6594
6608
|
"Debug"
|
|
6595
6609
|
];
|
|
6596
6610
|
constructor(e) {
|
|
6597
|
-
super(e), this.props.three.addEventListener(D.ADD_RENDERER, this.setupRenderer), this.scene = new
|
|
6611
|
+
super(e), this.props.three.addEventListener(D.ADD_RENDERER, this.setupRenderer), this.scene = new un(), this.scene.name = this.scene.uuid = "", this.canvasRef = ue(), this.containerRef = ue(), this.tlWindow = ue(), this.trWindow = ue(), this.blWindow = ue(), this.brWindow = ue();
|
|
6598
6612
|
const t = e.three.name, s = localStorage, n = s.getItem(`${t}_mode`);
|
|
6599
6613
|
this.state = {
|
|
6600
6614
|
mode: n !== null ? n : "Single",
|
|
@@ -6605,14 +6619,14 @@ class G extends Qe {
|
|
|
6605
6619
|
lastUpdate: Date.now()
|
|
6606
6620
|
}, s.setItem(`${t}_mode`, this.state.mode), s.setItem(`${t}_tlCam`, s.getItem(`${t}_tlCam`) !== null ? s.getItem(`${t}_tlCam`) : "Debug"), s.setItem(`${t}_trCam`, s.getItem(`${t}_trCam`) !== null ? s.getItem(`${t}_trCam`) : "Orthographic"), s.setItem(`${t}_blCam`, s.getItem(`${t}_blCam`) !== null ? s.getItem(`${t}_blCam`) : "Front"), s.setItem(`${t}_brCam`, s.getItem(`${t}_brCam`) !== null ? s.getItem(`${t}_brCam`) : "Top"), s.setItem(`${t}_tlRender`, s.getItem(`${t}_tlRender`) !== null ? s.getItem(`${t}_tlRender`) : "Renderer"), s.setItem(`${t}_trRender`, s.getItem(`${t}_trRender`) !== null ? s.getItem(`${t}_trRender`) : "Renderer"), s.setItem(`${t}_blRender`, s.getItem(`${t}_blRender`) !== null ? s.getItem(`${t}_blRender`) : "Renderer"), s.setItem(`${t}_brRender`, s.getItem(`${t}_brRender`) !== null ? s.getItem(`${t}_brRender`) : "Renderer");
|
|
6607
6621
|
const a = {
|
|
6608
|
-
Vector2:
|
|
6622
|
+
Vector2: $e,
|
|
6609
6623
|
Vector3: ee,
|
|
6610
|
-
Vector4:
|
|
6611
|
-
Quaternion:
|
|
6612
|
-
Matrix4:
|
|
6613
|
-
Spherical:
|
|
6614
|
-
Box3:
|
|
6615
|
-
Sphere:
|
|
6624
|
+
Vector4: _n,
|
|
6625
|
+
Quaternion: vn,
|
|
6626
|
+
Matrix4: gn,
|
|
6627
|
+
Spherical: fn,
|
|
6628
|
+
Box3: mn,
|
|
6629
|
+
Sphere: pn,
|
|
6616
6630
|
Raycaster: Wt
|
|
6617
6631
|
};
|
|
6618
6632
|
re.install({ THREE: a }), this.setupScene(), this.setupTools();
|
|
@@ -6768,8 +6782,8 @@ class G extends Qe {
|
|
|
6768
6782
|
ft,
|
|
6769
6783
|
{
|
|
6770
6784
|
title: "View",
|
|
6771
|
-
index:
|
|
6772
|
-
options:
|
|
6785
|
+
index: ki.indexOf(this.state.mode),
|
|
6786
|
+
options: ki,
|
|
6773
6787
|
onSelect: (t) => {
|
|
6774
6788
|
t !== this.state.mode && (this.killControls(), this.setState({ mode: t }), localStorage.setItem(`${this.appID}_mode`, t));
|
|
6775
6789
|
},
|
|
@@ -6809,7 +6823,7 @@ class G extends Qe {
|
|
|
6809
6823
|
zt,
|
|
6810
6824
|
{
|
|
6811
6825
|
name: "cameraHelper",
|
|
6812
|
-
icon:
|
|
6826
|
+
icon: ga,
|
|
6813
6827
|
selected: this.cameraVisibility,
|
|
6814
6828
|
height: 24,
|
|
6815
6829
|
top: 2,
|
|
@@ -6827,7 +6841,7 @@ class G extends Qe {
|
|
|
6827
6841
|
zt,
|
|
6828
6842
|
{
|
|
6829
6843
|
name: "lightHelper",
|
|
6830
|
-
icon:
|
|
6844
|
+
icon: va,
|
|
6831
6845
|
selected: this.lightVisibility,
|
|
6832
6846
|
height: 24,
|
|
6833
6847
|
top: 4,
|
|
@@ -6845,7 +6859,7 @@ class G extends Qe {
|
|
|
6845
6859
|
zt,
|
|
6846
6860
|
{
|
|
6847
6861
|
name: "gridHelper",
|
|
6848
|
-
icon:
|
|
6862
|
+
icon: _a,
|
|
6849
6863
|
selected: this.gridVisibility,
|
|
6850
6864
|
height: 21,
|
|
6851
6865
|
width: 21,
|
|
@@ -6861,7 +6875,7 @@ class G extends Qe {
|
|
|
6861
6875
|
setupRenderer = (e) => {
|
|
6862
6876
|
const t = e.value;
|
|
6863
6877
|
if (this.renderer) {
|
|
6864
|
-
if (this.renderer instanceof qe && t.type === "WebGLRenderer" || this.renderer instanceof
|
|
6878
|
+
if (this.renderer instanceof qe && t.type === "WebGLRenderer" || this.renderer instanceof Ge && t.type === "WebGPURenderer") return;
|
|
6865
6879
|
this.renderer.dispose();
|
|
6866
6880
|
}
|
|
6867
6881
|
this.rendererReady = !1;
|
|
@@ -6869,10 +6883,10 @@ class G extends Qe {
|
|
|
6869
6883
|
this.props.three.canvas = s, t.type === "WebGLRenderer" ? (this.renderer = new qe({
|
|
6870
6884
|
canvas: s,
|
|
6871
6885
|
stencil: !1
|
|
6872
|
-
}), this.depthMaterial = new
|
|
6886
|
+
}), this.depthMaterial = new Cn(), this.normalsMaterial = new yn(), this.uvMaterial = new ua(), this.grid = new aa(), this.scene.add(this.grid), this.rendererReady = !0) : t.type === "WebGPURenderer" && (this.renderer = new Ge({
|
|
6873
6887
|
canvas: s,
|
|
6874
6888
|
stencil: !1
|
|
6875
|
-
}), this.grid = new
|
|
6889
|
+
}), this.grid = new la(), this.scene.add(this.grid)), this.renderer && (this.renderer.autoClear = !1, this.renderer.shadowMap.enabled = !0, this.renderer.setClearColor(0), this.renderer.setPixelRatio(devicePixelRatio), this.renderer.setScissorTest(!0), this.resize(), this.props.three.renderer = this.renderer, this.depthMaterial = new ca(), this.normalsMaterial = new bn(), this.uvMaterial = new pa(), t.type === "WebGPURenderer" ? this.renderer.init().then(() => {
|
|
6876
6890
|
this.rendererReady = !0, this.props.three.requestScene();
|
|
6877
6891
|
}) : this.props.three.requestScene());
|
|
6878
6892
|
};
|
|
@@ -6989,7 +7003,7 @@ class G extends Qe {
|
|
|
6989
7003
|
});
|
|
6990
7004
|
}
|
|
6991
7005
|
setupTools() {
|
|
6992
|
-
this.splineEditor = new
|
|
7006
|
+
this.splineEditor = new fa(this.currentCamera, this.three), this.splineEditor.initDebug(), this.helpersContainer.add(this.splineEditor);
|
|
6993
7007
|
}
|
|
6994
7008
|
// Public
|
|
6995
7009
|
play() {
|
|
@@ -7070,8 +7084,13 @@ class G extends Qe {
|
|
|
7070
7084
|
addScene = (e) => {
|
|
7071
7085
|
const t = this.props.scenes.get(e.value.name);
|
|
7072
7086
|
if (t !== void 0) {
|
|
7073
|
-
const s =
|
|
7074
|
-
s
|
|
7087
|
+
const s = this.scenes.get(e.value.name);
|
|
7088
|
+
if (s !== void 0) {
|
|
7089
|
+
this.props.onSceneAdd !== void 0 && this.props.onSceneAdd(s), this.props.three.scene = s;
|
|
7090
|
+
return;
|
|
7091
|
+
}
|
|
7092
|
+
const n = new t();
|
|
7093
|
+
n.visible = !1, this.props.onSceneAdd !== void 0 && this.props.onSceneAdd(n), this.props.three.scene = n, this.scenes.set(e.value.name, n), this.scene.add(n);
|
|
7075
7094
|
} else
|
|
7076
7095
|
console.log("Hermes - Scene not found:", e.value.name, this.props.scenes);
|
|
7077
7096
|
};
|
|
@@ -7085,7 +7104,7 @@ class G extends Qe {
|
|
|
7085
7104
|
this.scenes.delete(t);
|
|
7086
7105
|
const s = this.scene.getObjectByName(t);
|
|
7087
7106
|
s && setTimeout(() => {
|
|
7088
|
-
|
|
7107
|
+
ce(s);
|
|
7089
7108
|
}, 100), this.clearLightHelpers();
|
|
7090
7109
|
};
|
|
7091
7110
|
addCamera = (e) => {
|
|
@@ -7093,7 +7112,7 @@ class G extends Qe {
|
|
|
7093
7112
|
if (n !== void 0) {
|
|
7094
7113
|
const a = n;
|
|
7095
7114
|
this.cameras.set(s, a);
|
|
7096
|
-
const r = new
|
|
7115
|
+
const r = new En(a);
|
|
7097
7116
|
r.visible = this.cameraVisibility, this.cameraHelpers.set(s, r), this.helpersContainer.add(r), this.setState({ lastUpdate: Date.now() });
|
|
7098
7117
|
}
|
|
7099
7118
|
};
|
|
@@ -7102,7 +7121,7 @@ class G extends Qe {
|
|
|
7102
7121
|
n !== void 0 && (this.helpersContainer.remove(n), n.dispose()), this.cameras.delete(s), this.setState({ lastUpdate: Date.now() });
|
|
7103
7122
|
};
|
|
7104
7123
|
onMouseMove = (e) => {
|
|
7105
|
-
const t = new
|
|
7124
|
+
const t = new $e();
|
|
7106
7125
|
this.renderer?.getSize(t);
|
|
7107
7126
|
const s = Math.min(e.clientX, t.x), n = Math.min(e.clientY, t.y);
|
|
7108
7127
|
this.pointer.x = Oe(s, 0, t.x, -1, 1), this.pointer.y = Oe(n, 0, t.y, 1, -1);
|
|
@@ -7128,7 +7147,7 @@ class G extends Qe {
|
|
|
7128
7147
|
};
|
|
7129
7148
|
onClick = (e) => {
|
|
7130
7149
|
if (this.state.interactionMode === "Orbit" || this.currentScene === void 0) return;
|
|
7131
|
-
const t = new
|
|
7150
|
+
const t = new $e();
|
|
7132
7151
|
if (this.renderer.getSize(t), e.clientX >= t.x) return;
|
|
7133
7152
|
this.onMouseMove(e);
|
|
7134
7153
|
const s = this.raycaster.intersectObjects(this.currentScene.children);
|
|
@@ -7139,7 +7158,7 @@ class G extends Qe {
|
|
|
7139
7158
|
if (e.ctrlKey) {
|
|
7140
7159
|
if (this.currentCamera.name === "UI") return;
|
|
7141
7160
|
const t = this.controls.get(this.currentCamera.name);
|
|
7142
|
-
e.key === "0" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new re(this.currentCamera, this.currentWindow.current), this.selectedItem instanceof ut || this.selectedItem instanceof
|
|
7161
|
+
e.key === "0" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new re(this.currentCamera, this.currentWindow.current), this.selectedItem instanceof ut || this.selectedItem instanceof Sn ? (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 re(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 re(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 re(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 re(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 re(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(Yt(45), Yt(45), !0), this.updateCameraControls(t));
|
|
7143
7162
|
} else if (this.currentTransform !== void 0)
|
|
7144
7163
|
switch (e.key) {
|
|
7145
7164
|
case "r":
|
|
@@ -7199,19 +7218,19 @@ class G extends Qe {
|
|
|
7199
7218
|
let s;
|
|
7200
7219
|
switch (t.type) {
|
|
7201
7220
|
case "DirectionalLight":
|
|
7202
|
-
s = new
|
|
7221
|
+
s = new Tn(t, 100), s.name = `${t.name}Helper`, s.visible = this.lightVisibility, this.lightHelpers.set(t.name, s), this.helpersContainer.add(s);
|
|
7203
7222
|
break;
|
|
7204
7223
|
case "HemisphereLight":
|
|
7205
7224
|
s = new wn(t, 250), s.name = `${t.name}Helper`, s.visible = this.lightVisibility, this.lightHelpers.set(t.name, s), this.helpersContainer.add(s);
|
|
7206
7225
|
break;
|
|
7207
7226
|
case "RectAreaLight":
|
|
7208
|
-
s = new
|
|
7227
|
+
s = new Rn(t), s.name = `${t.name}Helper`, s.visible = this.lightVisibility, this.lightHelpers.set(t.name, s), this.helpersContainer.add(s);
|
|
7209
7228
|
break;
|
|
7210
7229
|
case "PointLight":
|
|
7211
|
-
s = new
|
|
7230
|
+
s = new xn(t, 100), s.name = `${t.name}Helper`, s.visible = this.lightVisibility, this.lightHelpers.set(t.name, s), this.helpersContainer.add(s);
|
|
7212
7231
|
break;
|
|
7213
7232
|
case "SpotLight":
|
|
7214
|
-
s = new
|
|
7233
|
+
s = new On(t), s.name = `${t.name}Helper`, s.visible = this.lightVisibility, this.lightHelpers.set(t.name, s), this.helpersContainer.add(s);
|
|
7215
7234
|
break;
|
|
7216
7235
|
}
|
|
7217
7236
|
}
|
|
@@ -7220,7 +7239,7 @@ class G extends Qe {
|
|
|
7220
7239
|
createControls(e, t) {
|
|
7221
7240
|
const s = this.controls.get(e.name);
|
|
7222
7241
|
if (s !== void 0 && s.dispose(), this.controls.delete(e.name), e.name === "UI") return;
|
|
7223
|
-
const n = new
|
|
7242
|
+
const n = new Dn(e, t);
|
|
7224
7243
|
switch (n.enableDamping = !0, n.dampingFactor = 0.1, e.name) {
|
|
7225
7244
|
case "Top":
|
|
7226
7245
|
case "Bottom":
|
|
@@ -7280,7 +7299,7 @@ class G extends Qe {
|
|
|
7280
7299
|
updateCameraControls = (e, t = !1) => {
|
|
7281
7300
|
if (this.selectedItem === void 0) return;
|
|
7282
7301
|
cancelAnimationFrame(this.cameraControlsRafID), this.cameraControlsRafID = -1, this.cameraControls && (this.cameraControls.smoothTime = 0.1);
|
|
7283
|
-
const s = 0.15, n = new
|
|
7302
|
+
const s = 0.15, n = new Mn();
|
|
7284
7303
|
n.start(), this.selectedItem.getWorldPosition(e.target0);
|
|
7285
7304
|
const a = () => {
|
|
7286
7305
|
const r = n.getDelta();
|
|
@@ -7334,7 +7353,7 @@ class G extends Qe {
|
|
|
7334
7353
|
this.drawTo(0, 0, this.width, this.height, this.tlCam, e);
|
|
7335
7354
|
}
|
|
7336
7355
|
drawDouble = () => {
|
|
7337
|
-
const e = this.getSceneOverride(this.tlRender), t = this.getSceneOverride(this.trRender), s = Math.floor(this.width / 2), n = Math.floor(this.height / 2), a = this.renderer instanceof
|
|
7356
|
+
const e = this.getSceneOverride(this.tlRender), t = this.getSceneOverride(this.trRender), s = Math.floor(this.width / 2), n = Math.floor(this.height / 2), a = this.renderer instanceof Ge;
|
|
7338
7357
|
if (this.state.mode === "Side by Side")
|
|
7339
7358
|
this.drawTo(0, 0, s, this.height, this.tlCam, e), this.drawTo(s, 0, s, this.height, this.trCam, t);
|
|
7340
7359
|
else {
|
|
@@ -7343,7 +7362,7 @@ class G extends Qe {
|
|
|
7343
7362
|
}
|
|
7344
7363
|
};
|
|
7345
7364
|
drawQuad = () => {
|
|
7346
|
-
const e = this.renderer instanceof
|
|
7365
|
+
const e = this.renderer instanceof Ge, t = this.getSceneOverride(this.tlRender), s = this.getSceneOverride(this.trRender), n = this.getSceneOverride(this.blRender), a = this.getSceneOverride(this.brRender), r = Math.floor(this.width / 2), o = Math.floor(this.height / 2), c = this.height - o;
|
|
7347
7366
|
let l = 0, h = e ? 0 : this.height - o;
|
|
7348
7367
|
l = 0, this.drawTo(l, h, r, o, this.tlCam, t), l = r, this.drawTo(l, h, r, o, this.trCam, s), h = e ? c : 0, l = 0, this.scene.overrideMaterial = n, this.drawTo(l, h, r, o, this.blCam, n), l = r, this.drawTo(l, h, r, o, this.brCam, a);
|
|
7349
7368
|
};
|
|
@@ -7370,9 +7389,9 @@ class G extends Qe {
|
|
|
7370
7389
|
class bt extends Qe {
|
|
7371
7390
|
static instance;
|
|
7372
7391
|
matrix = new Vi();
|
|
7373
|
-
position = new
|
|
7392
|
+
position = new Le();
|
|
7374
7393
|
rotation = new Gs();
|
|
7375
|
-
scale = new
|
|
7394
|
+
scale = new Le();
|
|
7376
7395
|
open = !1;
|
|
7377
7396
|
constructor(e) {
|
|
7378
7397
|
super(e);
|
|
@@ -7473,7 +7492,7 @@ function Fi(i) {
|
|
|
7473
7492
|
}
|
|
7474
7493
|
return i;
|
|
7475
7494
|
}
|
|
7476
|
-
function
|
|
7495
|
+
function Ca(i, e) {
|
|
7477
7496
|
function t() {
|
|
7478
7497
|
return `${e.name}_light`;
|
|
7479
7498
|
}
|
|
@@ -7528,7 +7547,7 @@ function _a(i, e) {
|
|
|
7528
7547
|
}
|
|
7529
7548
|
);
|
|
7530
7549
|
}
|
|
7531
|
-
function
|
|
7550
|
+
function ya(i) {
|
|
7532
7551
|
const e = i.object, t = i.three;
|
|
7533
7552
|
function s() {
|
|
7534
7553
|
return `${t.name}_animation`;
|
|
@@ -7604,7 +7623,7 @@ function Ca(i) {
|
|
|
7604
7623
|
}
|
|
7605
7624
|
}
|
|
7606
7625
|
return ye(() => () => {
|
|
7607
|
-
h !== void 0 &&
|
|
7626
|
+
h !== void 0 && ce(h);
|
|
7608
7627
|
}, []), /* @__PURE__ */ f(
|
|
7609
7628
|
j,
|
|
7610
7629
|
{
|
|
@@ -7631,7 +7650,7 @@ const Vt = {
|
|
|
7631
7650
|
lightInfo: void 0,
|
|
7632
7651
|
children: []
|
|
7633
7652
|
};
|
|
7634
|
-
function
|
|
7653
|
+
function ba(i) {
|
|
7635
7654
|
const [e, t] = L(Vt);
|
|
7636
7655
|
ye(() => {
|
|
7637
7656
|
function r(c) {
|
|
@@ -7688,17 +7707,17 @@ function ya(i) {
|
|
|
7688
7707
|
] }),
|
|
7689
7708
|
/* @__PURE__ */ M(q, { children: [
|
|
7690
7709
|
/* @__PURE__ */ f(bt, { object: e, three: i.three }),
|
|
7691
|
-
n ? /* @__PURE__ */ f(
|
|
7692
|
-
s.search("camera") > -1 ?
|
|
7693
|
-
s.search("light") > -1 ?
|
|
7694
|
-
a ?
|
|
7710
|
+
n ? /* @__PURE__ */ f(ya, { object: e, three: i.three }) : null,
|
|
7711
|
+
s.search("camera") > -1 ? Jr(e, i.three) : null,
|
|
7712
|
+
s.search("light") > -1 ? Ca(e, i.three) : null,
|
|
7713
|
+
a ? Xr(e, i.three) : null
|
|
7695
7714
|
] })
|
|
7696
7715
|
] }) })
|
|
7697
7716
|
},
|
|
7698
7717
|
"Inspector"
|
|
7699
7718
|
);
|
|
7700
7719
|
}
|
|
7701
|
-
class
|
|
7720
|
+
class Ea extends Qe {
|
|
7702
7721
|
// Renderer
|
|
7703
7722
|
autoClear = !0;
|
|
7704
7723
|
autoClearColor = !0;
|
|
@@ -7930,9 +7949,11 @@ class ba extends Qe {
|
|
|
7930
7949
|
return `${this.props.three.name}_renderer`;
|
|
7931
7950
|
}
|
|
7932
7951
|
}
|
|
7933
|
-
function
|
|
7952
|
+
function Sa(i) {
|
|
7934
7953
|
const [e] = L([]), [t] = L([]), [s, n] = L(0), a = (l) => {
|
|
7935
7954
|
const h = l.value;
|
|
7955
|
+
for (let d = 0; d < e.length; d++)
|
|
7956
|
+
if (h.uuid === e[d].uuid) return;
|
|
7936
7957
|
e.push(h), t.push(
|
|
7937
7958
|
/* @__PURE__ */ f(
|
|
7938
7959
|
Ke,
|
|
@@ -8004,20 +8025,20 @@ function Ea(i) {
|
|
|
8004
8025
|
i.three.removeEventListener(D.ADD_SCENE, a), i.three.removeEventListener(D.SET_SCENE, c), i.three.removeEventListener(D.REFRESH_SCENE, r), i.three.removeEventListener(D.REMOVE_SCENE, o);
|
|
8005
8026
|
}), []), /* @__PURE__ */ M("div", { id: "SidePanel", children: [
|
|
8006
8027
|
/* @__PURE__ */ f("div", { className: "scenes", children: t }, s),
|
|
8007
|
-
/* @__PURE__ */ f(ya, { three: i.three }),
|
|
8008
8028
|
/* @__PURE__ */ f(ba, { three: i.three }),
|
|
8029
|
+
/* @__PURE__ */ f(Ea, { three: i.three }),
|
|
8009
8030
|
/* @__PURE__ */ f(I, { three: i.three })
|
|
8010
8031
|
] });
|
|
8011
8032
|
}
|
|
8012
|
-
function
|
|
8033
|
+
function Oa(i) {
|
|
8013
8034
|
return /* @__PURE__ */ M("div", { className: "editor", ref: i.ref, style: i.style, children: [
|
|
8014
8035
|
/* @__PURE__ */ f("div", { className: "header", children: i.header }),
|
|
8015
8036
|
i.children,
|
|
8016
8037
|
/* @__PURE__ */ f("div", { className: "footer", children: i.footer })
|
|
8017
8038
|
] });
|
|
8018
8039
|
}
|
|
8019
|
-
function
|
|
8020
|
-
return /* @__PURE__ */ f(
|
|
8040
|
+
function vo(i) {
|
|
8041
|
+
return /* @__PURE__ */ f(Oa, { children: /* @__PURE__ */ M(q, { children: [
|
|
8021
8042
|
/* @__PURE__ */ f(
|
|
8022
8043
|
G,
|
|
8023
8044
|
{
|
|
@@ -8028,91 +8049,91 @@ function go(i) {
|
|
|
8028
8049
|
onSceneUpdate: i.onSceneUpdate
|
|
8029
8050
|
}
|
|
8030
8051
|
),
|
|
8031
|
-
/* @__PURE__ */ f(
|
|
8052
|
+
/* @__PURE__ */ f(Sa, { three: i.three })
|
|
8032
8053
|
] }) });
|
|
8033
8054
|
}
|
|
8034
8055
|
export {
|
|
8035
8056
|
Ke as Accordion,
|
|
8036
|
-
|
|
8057
|
+
mo as Application,
|
|
8037
8058
|
as as BaseRemote,
|
|
8038
8059
|
cs as ChildObject,
|
|
8039
8060
|
Dt as ContainerObject,
|
|
8040
|
-
|
|
8041
|
-
|
|
8042
|
-
|
|
8043
|
-
|
|
8044
|
-
|
|
8045
|
-
|
|
8046
|
-
|
|
8047
|
-
|
|
8048
|
-
|
|
8049
|
-
|
|
8050
|
-
|
|
8051
|
-
|
|
8052
|
-
|
|
8053
|
-
|
|
8061
|
+
ca as DepthNodeMaterial,
|
|
8062
|
+
Dr as Draggable,
|
|
8063
|
+
Rr as DraggableItem,
|
|
8064
|
+
Pr as Dropdown,
|
|
8065
|
+
Ir as DropdownItem,
|
|
8066
|
+
Oa as Editor,
|
|
8067
|
+
uo as ElementProxy,
|
|
8068
|
+
yr as ElementProxyReceiver,
|
|
8069
|
+
le as ExportTexture,
|
|
8070
|
+
aa as InfiniteGridHelper,
|
|
8071
|
+
la as InfiniteGridHelperGPU,
|
|
8072
|
+
ra as InfiniteGridMaterial,
|
|
8073
|
+
oa as InfiniteGridNodeMaterial,
|
|
8074
|
+
ba as Inspector,
|
|
8054
8075
|
G as MultiView,
|
|
8055
8076
|
ls as NavButton,
|
|
8056
|
-
|
|
8057
|
-
|
|
8058
|
-
|
|
8059
|
-
|
|
8077
|
+
po as ProxyManager,
|
|
8078
|
+
fo as RemoteTheatre,
|
|
8079
|
+
go as RemoteThree,
|
|
8080
|
+
Sa as SidePanel,
|
|
8060
8081
|
Bt as Spline,
|
|
8061
|
-
|
|
8062
|
-
|
|
8082
|
+
fa as SplineEditor,
|
|
8083
|
+
vo as ThreeEditor,
|
|
8063
8084
|
$ as Transform,
|
|
8064
|
-
|
|
8065
|
-
|
|
8066
|
-
|
|
8067
|
-
|
|
8068
|
-
|
|
8069
|
-
|
|
8070
|
-
|
|
8071
|
-
|
|
8085
|
+
ua as UVMaterial,
|
|
8086
|
+
pa as UVNodeMaterial,
|
|
8087
|
+
ho as WebworkerEventHandlers,
|
|
8088
|
+
hr as anchorGeometry,
|
|
8089
|
+
ja as anchorGeometryTL,
|
|
8090
|
+
Za as animateObjectMaterial,
|
|
8091
|
+
Ya as animateObjectTransform,
|
|
8092
|
+
cr as applyObjectMaterial,
|
|
8072
8093
|
mt as capitalize,
|
|
8073
8094
|
_e as clamp,
|
|
8074
|
-
|
|
8095
|
+
lo as clearComposerGroups,
|
|
8075
8096
|
Ci as colorToHex,
|
|
8076
|
-
|
|
8077
|
-
|
|
8078
|
-
|
|
8079
|
-
|
|
8080
|
-
|
|
8097
|
+
Zn as copyToClipboard,
|
|
8098
|
+
to as createMask,
|
|
8099
|
+
Va as cubicBezier,
|
|
8100
|
+
Wa as customizeTheatreElements,
|
|
8101
|
+
Ha as damp,
|
|
8081
8102
|
ka as defaultTheatreCallback,
|
|
8082
|
-
|
|
8083
|
-
|
|
8084
|
-
|
|
8103
|
+
er as detectMaxFrameRate,
|
|
8104
|
+
tr as detectSettings,
|
|
8105
|
+
ce as dispose,
|
|
8085
8106
|
rs as disposeMaterial,
|
|
8086
8107
|
Oi as disposeTexture,
|
|
8087
|
-
|
|
8088
|
-
|
|
8089
|
-
|
|
8090
|
-
|
|
8091
|
-
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
|
|
8096
|
-
|
|
8108
|
+
za as distance,
|
|
8109
|
+
co as generateCubemap,
|
|
8110
|
+
Ba as getAngle,
|
|
8111
|
+
lr as getObjectMaterialObject,
|
|
8112
|
+
or as getObjectMaterialProps,
|
|
8113
|
+
We as hierarchyUUID,
|
|
8114
|
+
oo as inspectComposer,
|
|
8115
|
+
dr as inspectComposerPass,
|
|
8116
|
+
qn as isColor,
|
|
8117
|
+
Fa as map,
|
|
8097
8118
|
je as mix,
|
|
8098
8119
|
pt as noop,
|
|
8099
8120
|
Zt as normalize,
|
|
8100
|
-
|
|
8101
|
-
|
|
8121
|
+
qa as orthoCamera,
|
|
8122
|
+
Ka as parseModelLite,
|
|
8102
8123
|
W as randomID,
|
|
8103
|
-
|
|
8124
|
+
Xa as renderToTexture,
|
|
8104
8125
|
nt as resetThreeObjects,
|
|
8105
|
-
|
|
8126
|
+
Ga as rgbaToHex,
|
|
8106
8127
|
te as roundTo,
|
|
8107
|
-
|
|
8108
|
-
|
|
8109
|
-
|
|
8110
|
-
|
|
8111
|
-
|
|
8128
|
+
no as setMaterialBlendAdd,
|
|
8129
|
+
ro as setMaterialBlendMultiply,
|
|
8130
|
+
so as setMaterialBlendNormal,
|
|
8131
|
+
ao as setMaterialBlendScreen,
|
|
8132
|
+
eo as supportsOffscreenCanvas,
|
|
8112
8133
|
qt as totalThreeObjects,
|
|
8113
8134
|
Jt as triangle,
|
|
8114
|
-
|
|
8115
|
-
|
|
8116
|
-
|
|
8117
|
-
|
|
8135
|
+
Qa as updateCameraOrtho,
|
|
8136
|
+
Ja as updateCameraOrtho16x9,
|
|
8137
|
+
io as useMask,
|
|
8138
|
+
$a as useStudio
|
|
8118
8139
|
};
|