@tomorrowevening/hermes 0.1.33 → 0.1.34
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 +10 -10
- package/dist/hermes.es.js +651 -616
- package/dist/{index-Ci6QewTa.js → index-BgT-wgDk.js} +688 -703
- package/dist/{index-D82t4hmO.css → index-s97l09lN.css} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/types/core/Application.d.ts +3 -2
- package/types/core/remote/BaseRemote.d.ts +2 -1
- package/types/core/remote/RemoteThree.d.ts +1 -1
- package/types/editor/Editor.d.ts +3 -4
- package/types/editor/HermesApp.d.ts +17 -0
- package/types/index.d.ts +1 -0
package/dist/hermes.es.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { types as P, getProject as
|
|
2
|
-
import { useState as L, useEffect as
|
|
3
|
-
import { BufferGeometry as
|
|
4
|
-
import { Color as dt, ColorManagement as St, WebGPURenderer as Ge, RenderTarget as
|
|
5
|
-
import { jsx as f, jsxs as M, Fragment as
|
|
6
|
-
import { radToDeg as
|
|
7
|
-
import { RectAreaLightHelper as
|
|
8
|
-
import { OrbitControls as
|
|
9
|
-
import { uniform as we, varyingProperty as
|
|
10
|
-
import
|
|
11
|
-
import { remapClamp as
|
|
12
|
-
import { TransformControls as
|
|
1
|
+
import { types as P, getProject as Cs } from "@tomorrowevening/theatre-core";
|
|
2
|
+
import { useState as L, useEffect as pe, useRef as z, useMemo as Ze, Component as Qe, createRef as ue, forwardRef as zi } from "react";
|
|
3
|
+
import { BufferGeometry as Hi, Float32BufferAttribute as ke, OrthographicCamera as Bi, Texture as Gt, Scene as bs, MeshBasicMaterial as Es, Mesh as Vi, LinearSRGBColorSpace as Ke, ObjectLoader as Ss, AnimationMixer as Os, AnimationClip as ws, Matrix4 as Gi, AlwaysStencilFunc as si, ReplaceStencilOp as Ee, NotEqualStencilFunc as ni, EqualStencilFunc as ri, KeepStencilOp as Se, NormalBlending as $i, AddEquation as Je, SrcAlphaFactor as gt, OneMinusSrcAlphaFactor as vt, CustomBlending as _t, OneFactor as yt, DstColorFactor as Xt, OneMinusDstColorFactor as Qt, WebGLRenderTarget as xs, RGBAFormat as Ts, EventDispatcher as Wi, RepeatWrapping as ai, Color as et, FrontSide as Ms, BackSide as As, DoubleSide as Yi, ZeroFactor as Zi, SrcColorFactor as qi, OneMinusSrcColorFactor as ji, DstAlphaFactor as Ki, OneMinusDstAlphaFactor as Xi, SrcAlphaSaturateFactor as Rs, ConstantColorFactor as Qi, OneMinusConstantColorFactor as Ji, ConstantAlphaFactor as es, OneMinusConstantAlphaFactor as ts, SubtractEquation as Ps, ReverseSubtractEquation as Ds, MinEquation as Is, MaxEquation as Us, NoBlending as Ls, AdditiveBlending as ks, SubtractiveBlending as Ns, MultiplyBlending as Fs, ShaderMaterial as is, GLSL3 as zs, PlaneGeometry as Hs, Object3D as Bs, Vector3 as Le, Raycaster as Vs, Vector2 as Gs, WebGLRenderer as qe, Euler as $s, SkeletonHelper as Ws, SRGBColorSpace as oi, NoToneMapping as li, ColorManagement as tt, NoColorSpace as Ys, LinearToneMapping as Zs, ReinhardToneMapping as qs, CineonToneMapping as js, ACESFilmicToneMapping as Ks, AgXToneMapping as Xs, NeutralToneMapping as Qs, CustomToneMapping as Js } from "three";
|
|
4
|
+
import { Color as dt, ColorManagement as St, WebGPURenderer as Ge, RenderTarget as en, WebGLRenderTarget as tn, ComputeNode as sn, NodeMaterial as nn, DoubleSide as rn, Mesh as ut, PlaneGeometry as an, BoxGeometry as on, Vector2 as $e, Object3D as ci, CatmullRomCurve3 as hi, MeshBasicMaterial as $t, LineBasicMaterial as ln, Line as cn, BufferGeometry as di, SphereGeometry as hn, Raycaster as Wt, Vector3 as ee, Group as dn, AxesHelper as un, Scene as pn, Sphere as mn, Box3 as fn, Spherical as gn, Matrix4 as vn, Quaternion as _n, Vector4 as yn, MeshNormalNodeMaterial as Cn, PerspectiveCamera as ui, OrthographicCamera as pi, CameraHelper as bn, SkinnedMesh as En, SpotLightHelper as Sn, PointLightHelper as On, HemisphereLightHelper as wn, DirectionalLightHelper as xn } from "three/webgpu";
|
|
5
|
+
import { jsx as f, jsxs as M, Fragment as Y } from "react/jsx-runtime";
|
|
6
|
+
import { radToDeg as Tn, degToRad as Yt, lerp as Ot, mapLinear as Oe } from "three/src/math/MathUtils.js";
|
|
7
|
+
import { RectAreaLightHelper as Mn } from "three/examples/jsm/helpers/RectAreaLightHelper.js";
|
|
8
|
+
import { OrbitControls as An } from "three/examples/jsm/controls/OrbitControls.js";
|
|
9
|
+
import { uniform as we, varyingProperty as Rn, Fn as wt, positionLocal as Pn, vec3 as Dn, cameraPosition as it, float as Z, fwidth as In, abs as mi, fract as Un, min as xt, max as fi, distance as Ln, log as gi, pow as vi, floor as kn, mix as _i, If as Nn, lessThanEqual as Fn, Discard as zn, vec4 as Hn } from "three/tsl";
|
|
10
|
+
import ss from "three/src/materials/nodes/MeshBasicNodeMaterial.js";
|
|
11
|
+
import { remapClamp as Bn, linearDepth as Vn, vec4 as ns, uv as Gn } from "three/src/nodes/TSL.js";
|
|
12
|
+
import { TransformControls as $n } from "three/examples/jsm/controls/TransformControls.js";
|
|
13
13
|
const pt = () => {
|
|
14
|
-
},
|
|
14
|
+
}, La = () => {
|
|
15
15
|
};
|
|
16
16
|
function mt(i) {
|
|
17
17
|
return i.substring(0, 1).toUpperCase() + i.substring(1);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Wn(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 Yn(i) {
|
|
27
27
|
return i.r !== void 0 && i.g !== void 0 && i.b !== void 0;
|
|
28
28
|
}
|
|
29
29
|
function yi(i) {
|
|
@@ -58,16 +58,16 @@ function Tt(i, e, t, s) {
|
|
|
58
58
|
c((s = s.apply(i, [])).next());
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
|
-
const
|
|
61
|
+
const Zn = ["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 Ci(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
|
}
|
|
65
|
-
const
|
|
66
|
-
if (
|
|
65
|
+
const rs = typeof window > "u", re = (() => {
|
|
66
|
+
if (rs) return;
|
|
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 qn(i, e, t) {
|
|
71
71
|
if (!t) return [e];
|
|
72
72
|
const s = function(l) {
|
|
73
73
|
const h = `
|
|
@@ -87,9 +87,9 @@ function Zn(i, e, t) {
|
|
|
87
87
|
enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);
|
|
88
88
|
gl_FragColor = enc;
|
|
89
89
|
}
|
|
90
|
-
`, u = l.createShader(35633),
|
|
91
|
-
if (!(
|
|
92
|
-
l.shaderSource(u, h), l.shaderSource(
|
|
90
|
+
`, u = l.createShader(35633), p = l.createShader(35632), y = l.createProgram();
|
|
91
|
+
if (!(p && u && y)) return;
|
|
92
|
+
l.shaderSource(u, h), l.shaderSource(p, d), l.compileShader(u), l.compileShader(p), l.attachShader(y, u), l.attachShader(y, p), l.linkProgram(y), l.detachShader(y, u), l.detachShader(y, p), l.deleteShader(u), l.deleteShader(p), l.useProgram(y);
|
|
93
93
|
const v = l.createBuffer();
|
|
94
94
|
l.bindBuffer(34962, v), l.bufferData(34962, new Float32Array([-1, -1, 0, 3, -1, 0, -1, 3, 0]), 35044);
|
|
95
95
|
const C = l.getAttribLocation(y, "aPosition");
|
|
@@ -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,12 +120,12 @@ function qn(i, e) {
|
|
|
120
120
|
for (; d < n; ) for (r = e.charCodeAt(a + d), o = d++, l = d, h = 0; h < s; h++) c = r === 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 Kn(i) {
|
|
124
124
|
return i != null;
|
|
125
125
|
}
|
|
126
|
-
const
|
|
126
|
+
const Xn = ({ mobileTiers: i = [0, 15, 30, 60], desktopTiers: e = [0, 15, 30, 60], override: t = {}, glContext: s, failIfMajorPerformanceCaveat: n = !1, benchmarksURL: r = "https://unpkg.com/detect-gpu@5.0.70/dist/benchmarks" } = {}) => Tt(void 0, void 0, void 0, function* () {
|
|
127
127
|
const a = {};
|
|
128
|
-
if (
|
|
128
|
+
if (rs) return { tier: 0, type: "SSR" };
|
|
129
129
|
const { isIpad: o = !!re?.isIpad, isMobile: c = !!re?.isMobile, screenSize: l = window.screen, loadBenchmarks: h = (b) => Tt(void 0, void 0, void 0, function* () {
|
|
130
130
|
const O = yield fetch(`${r}/${b}`).then((w) => w.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");
|
|
@@ -133,8 +133,8 @@ const Kn = ({ mobileTiers: i = [0, 15, 30, 60], desktopTiers: e = [0, 15, 30, 60
|
|
|
133
133
|
}) } = t;
|
|
134
134
|
let { renderer: d } = t;
|
|
135
135
|
const u = (b, O, w, D, x) => ({ device: x, fps: D, gpu: w, isMobile: c, tier: b, type: O });
|
|
136
|
-
let
|
|
137
|
-
if (d) d = Ci(d),
|
|
136
|
+
let p, y = "";
|
|
137
|
+
if (d) d = Ci(d), p = [d];
|
|
138
138
|
else {
|
|
139
139
|
const b = s || function(w, D = !1) {
|
|
140
140
|
const x = { alpha: !1, antialias: !1, depth: !1, failIfMajorPerformanceCaveat: D, powerPreference: "high-performance", stencil: !1 };
|
|
@@ -145,11 +145,11 @@ const Kn = ({ mobileTiers: i = [0, 15, 30, 60], desktopTiers: e = [0, 15, 30, 60
|
|
|
145
145
|
if (!b) return u(0, "WEBGL_UNSUPPORTED");
|
|
146
146
|
const O = re?.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
|
-
y = d, d = Ci(d),
|
|
149
|
-
return D === "apple gpu" ?
|
|
148
|
+
y = d, d = Ci(d), p = function(w, D, x) {
|
|
149
|
+
return D === "apple gpu" ? qn(w, D, x) : [D];
|
|
150
150
|
}(b, d, c);
|
|
151
151
|
}
|
|
152
|
-
const v = (yield Promise.all(
|
|
152
|
+
const v = (yield Promise.all(p.map(function(b) {
|
|
153
153
|
var O;
|
|
154
154
|
return Tt(this, void 0, void 0, function* () {
|
|
155
155
|
const w = ((B) => {
|
|
@@ -172,22 +172,22 @@ const Kn = ({ mobileTiers: i = [0, 15, 30, 60], desktopTiers: e = [0, 15, 30, 60
|
|
|
172
172
|
}(b);
|
|
173
173
|
let oe = N.filter(([, B]) => B === Q);
|
|
174
174
|
oe.length || (oe = N.filter(([B]) => B.includes(b)));
|
|
175
|
-
const
|
|
176
|
-
if (
|
|
175
|
+
const me = oe.length;
|
|
176
|
+
if (me === 0) return;
|
|
177
177
|
const be = b.split(/[.,()\[\]/\s]/g).sort().filter((B, j, le) => j === 0 || B !== le[j - 1]).join(" ");
|
|
178
|
-
let
|
|
179
|
-
const { devicePixelRatio: ti } = window,
|
|
180
|
-
for (const B of
|
|
181
|
-
const [j, le] = B,
|
|
182
|
-
ii < Et && (Et = ii,
|
|
178
|
+
let fe, [ms, , , , fs] = me > 1 ? oe.map((B) => [B, jn(be, B[2])]).sort(([, B], [, j]) => B - j)[0][0] : oe[0], Et = Number.MAX_VALUE;
|
|
179
|
+
const { devicePixelRatio: ti } = window, gs = l.width * ti * l.height * ti;
|
|
180
|
+
for (const B of fs) {
|
|
181
|
+
const [j, le] = B, ys = j * le, ii = Math.abs(gs - ys);
|
|
182
|
+
ii < Et && (Et = ii, fe = B);
|
|
183
183
|
}
|
|
184
|
-
if (!
|
|
185
|
-
const [, ,
|
|
186
|
-
return [Et,
|
|
184
|
+
if (!fe) return;
|
|
185
|
+
const [, , vs, _s] = fe;
|
|
186
|
+
return [Et, vs, ms, _s];
|
|
187
187
|
});
|
|
188
|
-
}))).filter(
|
|
188
|
+
}))).filter(Kn).sort(([b = Number.MAX_VALUE, O], [w = Number.MAX_VALUE, D]) => b === w ? O - D : b - w);
|
|
189
189
|
if (!v.length) {
|
|
190
|
-
const b =
|
|
190
|
+
const b = Zn.find((O) => d.includes(O));
|
|
191
191
|
return b ? u(0, "BLOCKLISTED", b) : u(1, "FALLBACK", `${d} (${y})`);
|
|
192
192
|
}
|
|
193
193
|
const [, C, g, _] = v[0];
|
|
@@ -197,7 +197,7 @@ const Kn = ({ mobileTiers: i = [0, 15, 30, 60], desktopTiers: e = [0, 15, 30, 60
|
|
|
197
197
|
for (let b = 0; b < E.length; b++) C >= E[b] && (S = b);
|
|
198
198
|
return u(S, "BENCHMARK", g, C, _);
|
|
199
199
|
});
|
|
200
|
-
function
|
|
200
|
+
function Qn(i) {
|
|
201
201
|
let e = 0;
|
|
202
202
|
const t = performance.now();
|
|
203
203
|
function s() {
|
|
@@ -211,9 +211,9 @@ function Xn(i) {
|
|
|
211
211
|
}
|
|
212
212
|
requestAnimationFrame(s);
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function Jn(i = !1, e = !1) {
|
|
215
215
|
return new Promise((t) => {
|
|
216
|
-
|
|
216
|
+
Xn().then((s) => {
|
|
217
217
|
let n = !1;
|
|
218
218
|
const r = document.createElement("canvas"), a = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
219
219
|
if (n = "transferControlToOffscreen" in r, a) {
|
|
@@ -232,13 +232,13 @@ function Qn(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"), Qn((c) => {
|
|
236
236
|
o.fps = c, t(o);
|
|
237
237
|
});
|
|
238
238
|
});
|
|
239
239
|
});
|
|
240
240
|
}
|
|
241
|
-
const
|
|
241
|
+
const er = (
|
|
242
242
|
/* js */
|
|
243
243
|
`
|
|
244
244
|
self.onmessage = async ({ data }) => {
|
|
@@ -254,7 +254,7 @@ self.onmessage = async ({ data }) => {
|
|
|
254
254
|
};
|
|
255
255
|
`
|
|
256
256
|
);
|
|
257
|
-
class
|
|
257
|
+
class ka {
|
|
258
258
|
worker;
|
|
259
259
|
source;
|
|
260
260
|
/** Intermediate 2D canvas used for GPU→CPU readback. Works with WebGPU and WebGL. */
|
|
@@ -279,7 +279,7 @@ class La {
|
|
|
279
279
|
}),
|
|
280
280
|
onError: t.onError ?? ((r) => console.error("[ImageSequenceCapturer]", r))
|
|
281
281
|
};
|
|
282
|
-
const s = new Blob([
|
|
282
|
+
const s = new Blob([er], { type: "application/javascript" }), n = URL.createObjectURL(s);
|
|
283
283
|
this.worker = new Worker(n), URL.revokeObjectURL(n), this.worker.onmessage = ({ data: r }) => {
|
|
284
284
|
r.type === "encoded" && (this.frames.set(r.index, r.blob), this._pending--, this._encoded++, this.opts.onProgress(this._captured, this._encoded));
|
|
285
285
|
}, this.worker.onerror = (r) => this.opts.onError(new Error(r.message));
|
|
@@ -383,7 +383,7 @@ class La {
|
|
|
383
383
|
this.reset(), this.worker.terminate();
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function ye(i, e, t) {
|
|
387
387
|
return Math.min(e, Math.max(i, t));
|
|
388
388
|
}
|
|
389
389
|
function Zt(i, e, t) {
|
|
@@ -392,63 +392,63 @@ function Zt(i, e, t) {
|
|
|
392
392
|
function Xe(i, e, t) {
|
|
393
393
|
return i * (1 - t) + e * t;
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function Na(i, e, t, s, n) {
|
|
396
396
|
return Xe(t, s, Zt(i, e, n));
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function Fa(i, e) {
|
|
399
399
|
const t = i - e;
|
|
400
400
|
return Math.sqrt(t * t);
|
|
401
401
|
}
|
|
402
|
-
function
|
|
402
|
+
function za(i, e, t, s) {
|
|
403
403
|
return Xe(i, e, 1 - Math.exp(-t * s));
|
|
404
404
|
}
|
|
405
405
|
function te(i, e = 1) {
|
|
406
406
|
return Number(i.toFixed(e));
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function Ha(i, e, t, s) {
|
|
409
409
|
return Math.atan2(s - e, t - i);
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function tr(i, e, t, s) {
|
|
412
412
|
return i === e && t === s;
|
|
413
413
|
}
|
|
414
|
-
function
|
|
414
|
+
function ir(i, e, t, s) {
|
|
415
415
|
return 1 / (3 * e * i * i + 2 * t * i + s);
|
|
416
416
|
}
|
|
417
|
-
function
|
|
417
|
+
function sr(i, e, t, s, n) {
|
|
418
418
|
return e * (i * i * i) + t * (i * i) + s * i + n;
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function nr(i, e, t, s, n) {
|
|
421
421
|
const r = i * i;
|
|
422
422
|
return e * (r * i) + t * r + s * i + n;
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function Ba(i, e, t, s, n) {
|
|
425
425
|
if (i <= 0) return 0;
|
|
426
426
|
if (i >= 1) return 1;
|
|
427
|
-
if (
|
|
428
|
-
const r = 0, a = 0, o = e, c = t, l = s, h = n, d = 1, u = 1,
|
|
427
|
+
if (tr(e, t, s, n)) return i;
|
|
428
|
+
const r = 0, a = 0, o = e, c = t, l = s, h = n, d = 1, u = 1, p = d - 3 * l + 3 * o - r, y = 3 * l - 6 * o + 3 * r, v = 3 * o - 3 * r, C = r, g = u - 3 * h + 3 * c - a, _ = 3 * h - 6 * c + 3 * a, E = 3 * c - 3 * a, S = a;
|
|
429
429
|
let b = i;
|
|
430
430
|
for (let O = 0; O < 5; O++) {
|
|
431
|
-
const w =
|
|
432
|
-
let D =
|
|
431
|
+
const w = sr(b, p, y, v, C);
|
|
432
|
+
let D = ir(b, p, y, v);
|
|
433
433
|
D === 1 / 0 && (D = i), b -= (w - i) * D, b = Math.min(Math.max(b, 0), 1);
|
|
434
434
|
}
|
|
435
|
-
return
|
|
435
|
+
return nr(b, g, _, E, S);
|
|
436
436
|
}
|
|
437
437
|
const st = (i) => Math.round(Math.min(1, Math.max(0, i)) * 255).toString(16).padStart(2, "0");
|
|
438
|
-
function
|
|
438
|
+
function Va({ r: i, g: e, b: t, a: s = 1 }) {
|
|
439
439
|
const n = `#${st(i)}${st(e)}${st(t)}`;
|
|
440
440
|
return s < 1 ? `${n}${st(s)}` : n;
|
|
441
441
|
}
|
|
442
442
|
let xe;
|
|
443
|
-
function
|
|
443
|
+
function Ga() {
|
|
444
444
|
const [i, e] = L(xe);
|
|
445
|
-
return
|
|
445
|
+
return pe(() => {
|
|
446
446
|
xe || import("@tomorrowevening/theatre-studio").then((t) => {
|
|
447
447
|
xe = t.default, xe.initialize(), xe.ui.hide(), e(xe);
|
|
448
448
|
});
|
|
449
449
|
}, []), i;
|
|
450
450
|
}
|
|
451
|
-
async function
|
|
451
|
+
async function $a() {
|
|
452
452
|
for (; !document.getElementById("theatrejs-studio-root"); )
|
|
453
453
|
await new Promise((s) => setTimeout(s, 100));
|
|
454
454
|
const i = document.getElementById("theatrejs-studio-root");
|
|
@@ -469,7 +469,7 @@ async function Ga() {
|
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
function
|
|
472
|
+
function Wa(i, e, t, s) {
|
|
473
473
|
s.sheetObject(i, e, {
|
|
474
474
|
transform: {
|
|
475
475
|
position: {
|
|
@@ -494,7 +494,7 @@ function $a(i, e, t, s) {
|
|
|
494
494
|
t.position.copy(r.position), t.rotation.copy(r.rotation), t.scale.copy(r.scale), t.visible = r.visible;
|
|
495
495
|
});
|
|
496
496
|
}
|
|
497
|
-
const
|
|
497
|
+
const rr = [
|
|
498
498
|
"allowOverride",
|
|
499
499
|
"alphaHash",
|
|
500
500
|
"alphaTest",
|
|
@@ -599,10 +599,10 @@ function Si(i) {
|
|
|
599
599
|
}
|
|
600
600
|
return "object";
|
|
601
601
|
}
|
|
602
|
-
function
|
|
602
|
+
function ar(i) {
|
|
603
603
|
const e = [];
|
|
604
604
|
for (const s in i) {
|
|
605
|
-
const n =
|
|
605
|
+
const n = rr.find((o) => o === s), r = s.indexOf("_") === 0 || s.indexOf("is") === 0;
|
|
606
606
|
if (!(n || r))
|
|
607
607
|
if (s === "uniforms") {
|
|
608
608
|
const o = i.uniforms;
|
|
@@ -627,7 +627,7 @@ function rr(i) {
|
|
|
627
627
|
(s) => s.type !== "array" && s.type !== "object" && s.type !== "texture"
|
|
628
628
|
);
|
|
629
629
|
}
|
|
630
|
-
function
|
|
630
|
+
function or(i) {
|
|
631
631
|
const e = {}, t = { nudgeMultiplier: 0.01 };
|
|
632
632
|
return i.forEach((s) => {
|
|
633
633
|
let n = s.value;
|
|
@@ -714,7 +714,7 @@ function ar(i) {
|
|
|
714
714
|
e[s.name] = n;
|
|
715
715
|
}), e;
|
|
716
716
|
}
|
|
717
|
-
function
|
|
717
|
+
function lr(i, e, t) {
|
|
718
718
|
e.forEach((s) => {
|
|
719
719
|
if (i[s.name] !== void 0)
|
|
720
720
|
switch (s.type) {
|
|
@@ -735,25 +735,25 @@ function or(i, e, t) {
|
|
|
735
735
|
}
|
|
736
736
|
});
|
|
737
737
|
}
|
|
738
|
-
function
|
|
738
|
+
function Ya(i, e, t, s) {
|
|
739
739
|
if (!t.isMaterial) return;
|
|
740
|
-
const n =
|
|
740
|
+
const n = ar(t), r = or(n);
|
|
741
741
|
s.sheetObject(i, e, {
|
|
742
742
|
material: r
|
|
743
743
|
}, (a) => {
|
|
744
|
-
|
|
744
|
+
lr(t, n, a);
|
|
745
745
|
});
|
|
746
746
|
}
|
|
747
|
-
const Jt = new
|
|
747
|
+
const Jt = new Hi();
|
|
748
748
|
Jt.setAttribute("position", new ke([-0.5, -0.5, 0, 1.5, -0.5, 0, -0.5, 1.5, 0], 3));
|
|
749
749
|
Jt.setAttribute("normal", new ke([0, 0, 1, 0, 0, 1], 3));
|
|
750
750
|
Jt.setAttribute("uv", new ke([0, 0, 2, 0, 0, 2], 2));
|
|
751
|
-
const
|
|
751
|
+
const Za = new Bi(-0.5, 0.5, 0.5, -0.5, 0, 100), Oi = (i) => {
|
|
752
752
|
i?.dispose();
|
|
753
|
-
},
|
|
753
|
+
}, as = (i) => {
|
|
754
754
|
if (i)
|
|
755
755
|
if (Array.isArray(i))
|
|
756
|
-
i.forEach((e) =>
|
|
756
|
+
i.forEach((e) => as(e));
|
|
757
757
|
else {
|
|
758
758
|
for (const e in i) {
|
|
759
759
|
const t = i[e];
|
|
@@ -776,7 +776,7 @@ const Ya = new Hi(-0.5, 0.5, 0.5, -0.5, 0, 100), Oi = (i) => {
|
|
|
776
776
|
}
|
|
777
777
|
if (i.parent && i.parent.remove(i), i.isMesh) {
|
|
778
778
|
const e = i;
|
|
779
|
-
e.geometry?.dispose(),
|
|
779
|
+
e.geometry?.dispose(), as(e.material);
|
|
780
780
|
}
|
|
781
781
|
i.dispose !== void 0 && i.dispose();
|
|
782
782
|
}
|
|
@@ -829,10 +829,10 @@ class ce {
|
|
|
829
829
|
}
|
|
830
830
|
static renderToCanvas(e) {
|
|
831
831
|
if (this.material === null) {
|
|
832
|
-
this.camera = new
|
|
833
|
-
const t = new
|
|
832
|
+
this.camera = new Bi(-0.5, 0.5, 0.5, -0.5, 0, 100), this.scene = new bs(), this.material = new Es();
|
|
833
|
+
const t = new Hi();
|
|
834
834
|
t.setAttribute("position", new ke([-0.5, -0.5, 0, 1.5, -0.5, 0, -0.5, 1.5, 0], 3)), t.setAttribute("normal", new ke([0, 0, 1, 0, 0, 1], 3)), t.setAttribute("uv", new ke([0, 0, 2, 0, 0, 2], 2));
|
|
835
|
-
const s = new
|
|
835
|
+
const s = new Vi(t, this.material);
|
|
836
836
|
this.scene.add(s);
|
|
837
837
|
}
|
|
838
838
|
if (e.isRenderTargetTexture)
|
|
@@ -844,13 +844,13 @@ class ce {
|
|
|
844
844
|
return this.renderer.domElement;
|
|
845
845
|
}
|
|
846
846
|
}
|
|
847
|
-
function
|
|
847
|
+
function qa(i) {
|
|
848
848
|
return new Promise((e) => {
|
|
849
|
-
const t = new
|
|
849
|
+
const t = new Ss();
|
|
850
850
|
t.parseAsync(i.scene).then((s) => {
|
|
851
|
-
const n = new
|
|
851
|
+
const n = new Os(s);
|
|
852
852
|
if (i.animations.length > 0) {
|
|
853
|
-
const a = i.animations.map((c) =>
|
|
853
|
+
const a = i.animations.map((c) => ws.parse(c));
|
|
854
854
|
n.clipAction(a[0]).play(), n.getRoot().animations = i.animations, n.getRoot().mixer = n;
|
|
855
855
|
}
|
|
856
856
|
const r = [];
|
|
@@ -866,26 +866,26 @@ function Za(i) {
|
|
|
866
866
|
});
|
|
867
867
|
});
|
|
868
868
|
}
|
|
869
|
-
const
|
|
869
|
+
const ja = (i, e, t, s) => {
|
|
870
870
|
i.setRenderTarget(s), i.clear(), i.render(e, t);
|
|
871
871
|
};
|
|
872
|
-
function
|
|
873
|
-
i.applyMatrix4(new
|
|
872
|
+
function cr(i, e, t, s) {
|
|
873
|
+
i.applyMatrix4(new Gi().makeTranslation(e, -t, -s));
|
|
874
874
|
}
|
|
875
|
-
function
|
|
875
|
+
function Ka(i) {
|
|
876
876
|
i.computeBoundingBox();
|
|
877
877
|
const e = i.boundingBox, t = (e.max.x - e.min.x) / 2, s = (e.max.y - e.min.y) / 2;
|
|
878
|
-
|
|
878
|
+
cr(i, t, s, 0);
|
|
879
879
|
}
|
|
880
|
-
function
|
|
880
|
+
function Xa(i, e, t) {
|
|
881
881
|
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();
|
|
882
882
|
}
|
|
883
|
-
function
|
|
883
|
+
function Qa(i, e, t) {
|
|
884
884
|
const s = 1.7777777777777777, n = e / t;
|
|
885
885
|
let r = e, a = t;
|
|
886
886
|
n > s ? r = t * s : a = e / s, i.left = r / -2, i.right = r / 2, i.top = a / 2, i.bottom = a / -2, i.updateProjectionMatrix();
|
|
887
887
|
}
|
|
888
|
-
function
|
|
888
|
+
function Ja() {
|
|
889
889
|
let e = "transferControlToOffscreen" in document.createElement("canvas");
|
|
890
890
|
if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
|
|
891
891
|
const s = navigator.userAgent.match(/version\/(\d+)/i);
|
|
@@ -893,33 +893,33 @@ function Qa() {
|
|
|
893
893
|
}
|
|
894
894
|
return e;
|
|
895
895
|
}
|
|
896
|
-
function
|
|
896
|
+
function eo(i, e, t = !0, s = !1) {
|
|
897
897
|
i.renderOrder = -e;
|
|
898
898
|
const n = i.material;
|
|
899
899
|
Array.isArray(n) ? n.forEach((r) => {
|
|
900
900
|
r.colorWrite = t, r.depthWrite = s, r.stencilWrite = !0, r.stencilRef = e, r.stencilFunc = si, r.stencilFail = Ee, r.stencilZFail = Ee, r.stencilZPass = Ee;
|
|
901
901
|
}) : (n.colorWrite = t, n.depthWrite = s, n.stencilWrite = !0, n.stencilRef = e, n.stencilFunc = si, n.stencilFail = Ee, n.stencilZFail = Ee, n.stencilZPass = Ee);
|
|
902
902
|
}
|
|
903
|
-
function
|
|
903
|
+
function to(i, e, t = !1) {
|
|
904
904
|
const s = i.material;
|
|
905
905
|
Array.isArray(s) ? s.forEach((n) => {
|
|
906
906
|
n.stencilWrite = !0, n.stencilRef = e, n.stencilFunc = t ? ni : ri, n.stencilFail = Se, n.stencilZFail = Se, n.stencilZPass = Se;
|
|
907
907
|
}) : (s.stencilWrite = !0, s.stencilRef = e, s.stencilFunc = t ? ni : ri, s.stencilFail = Se, s.stencilZFail = Se, s.stencilZPass = Se);
|
|
908
908
|
}
|
|
909
|
-
function to(i) {
|
|
910
|
-
i.blending = Gi, i.blendEquation = Je, i.blendSrc = gt, i.blendDst = vt, i.needsUpdate = !0;
|
|
911
|
-
}
|
|
912
909
|
function io(i) {
|
|
913
|
-
i.blending =
|
|
910
|
+
i.blending = $i, i.blendEquation = Je, i.blendSrc = gt, i.blendDst = vt, i.needsUpdate = !0;
|
|
914
911
|
}
|
|
915
912
|
function so(i) {
|
|
916
|
-
i.blending = _t, i.blendEquation = Je, i.blendSrc =
|
|
913
|
+
i.blending = _t, i.blendEquation = Je, i.blendSrc = gt, i.blendDst = yt, i.needsUpdate = !0;
|
|
917
914
|
}
|
|
918
915
|
function no(i) {
|
|
916
|
+
i.blending = _t, i.blendEquation = Je, i.blendSrc = Xt, i.blendDst = vt, i.needsUpdate = !0;
|
|
917
|
+
}
|
|
918
|
+
function ro(i) {
|
|
919
919
|
i.blending = _t, i.blendEquation = Je, i.blendSrc = Qt, i.blendDst = yt, i.needsUpdate = !0;
|
|
920
920
|
}
|
|
921
921
|
let jt = [];
|
|
922
|
-
function
|
|
922
|
+
function hr(i, e, t = !0) {
|
|
923
923
|
ce.renderer = e.renderer;
|
|
924
924
|
const s = [];
|
|
925
925
|
s.push({
|
|
@@ -1044,22 +1044,22 @@ function cr(i, e, t = !0) {
|
|
|
1044
1044
|
}
|
|
1045
1045
|
}), jt.push(r);
|
|
1046
1046
|
}
|
|
1047
|
-
function
|
|
1047
|
+
function ao(i, e) {
|
|
1048
1048
|
i.passes.forEach((t) => {
|
|
1049
|
-
|
|
1049
|
+
hr(t, e);
|
|
1050
1050
|
});
|
|
1051
1051
|
}
|
|
1052
|
-
function
|
|
1052
|
+
function oo(i) {
|
|
1053
1053
|
jt.forEach((e) => {
|
|
1054
1054
|
i.removeGroup(e);
|
|
1055
1055
|
}), jt = [];
|
|
1056
1056
|
}
|
|
1057
|
-
function
|
|
1057
|
+
function lo(i, e, t, s = 1024) {
|
|
1058
1058
|
return new Promise((n) => {
|
|
1059
1059
|
const r = e.aspect, a = e.fov, o = e.rotation.clone(), c = t.outputBuffer;
|
|
1060
1060
|
e.aspect = 1, e.fov = 90, e.updateProjectionMatrix();
|
|
1061
|
-
const l = new
|
|
1062
|
-
format:
|
|
1061
|
+
const l = new xs(s, s, {
|
|
1062
|
+
format: Ts,
|
|
1063
1063
|
depthBuffer: !0,
|
|
1064
1064
|
stencilBuffer: !1
|
|
1065
1065
|
});
|
|
@@ -1110,8 +1110,8 @@ function Te(i, e, t, s, n, r) {
|
|
|
1110
1110
|
d.data.set(c), h.putImageData(d, 0, 0);
|
|
1111
1111
|
const u = document.createElement("canvas");
|
|
1112
1112
|
u.width = u.height = r;
|
|
1113
|
-
const
|
|
1114
|
-
|
|
1113
|
+
const p = u.getContext("2d");
|
|
1114
|
+
p.translate(0, r), p.scale(1, -1), p.drawImage(l, 0, 0);
|
|
1115
1115
|
const y = u.toDataURL("image/png"), v = document.createElement("a");
|
|
1116
1116
|
v.href = y, v.download = `${t.name}_${s}.png`, document.body.appendChild(v), v.click(), v.remove(), a();
|
|
1117
1117
|
});
|
|
@@ -1127,32 +1127,32 @@ const Me = ei([
|
|
|
1127
1127
|
"clientY",
|
|
1128
1128
|
"pageX",
|
|
1129
1129
|
"pageY"
|
|
1130
|
-
]),
|
|
1130
|
+
]), dr = ei([
|
|
1131
1131
|
"clientX",
|
|
1132
1132
|
"clientY",
|
|
1133
1133
|
"deltaX",
|
|
1134
1134
|
"deltaY",
|
|
1135
1135
|
"deltaMode"
|
|
1136
|
-
]),
|
|
1136
|
+
]), ur = ei([
|
|
1137
1137
|
"ctrlKey",
|
|
1138
1138
|
"metaKey",
|
|
1139
1139
|
"shiftKey",
|
|
1140
1140
|
"keyCode"
|
|
1141
1141
|
]);
|
|
1142
|
-
function
|
|
1143
|
-
i.preventDefault(),
|
|
1142
|
+
function pr(i, e) {
|
|
1143
|
+
i.preventDefault(), dr(i, e);
|
|
1144
1144
|
}
|
|
1145
|
-
function
|
|
1145
|
+
function mr(i) {
|
|
1146
1146
|
i.preventDefault();
|
|
1147
1147
|
}
|
|
1148
|
-
function
|
|
1148
|
+
function fr(i, e, t) {
|
|
1149
1149
|
for (const s of e)
|
|
1150
1150
|
t[s] = i[s];
|
|
1151
1151
|
}
|
|
1152
1152
|
function ei(i) {
|
|
1153
1153
|
return function(t, s) {
|
|
1154
1154
|
const n = { type: t.type };
|
|
1155
|
-
|
|
1155
|
+
fr(t, i, n), s(n);
|
|
1156
1156
|
};
|
|
1157
1157
|
}
|
|
1158
1158
|
function At(i, e) {
|
|
@@ -1166,7 +1166,7 @@ function At(i, e) {
|
|
|
1166
1166
|
}
|
|
1167
1167
|
e(s);
|
|
1168
1168
|
}
|
|
1169
|
-
const
|
|
1169
|
+
const gr = {
|
|
1170
1170
|
37: !0,
|
|
1171
1171
|
// left
|
|
1172
1172
|
38: !0,
|
|
@@ -1176,12 +1176,12 @@ const fr = {
|
|
|
1176
1176
|
40: !0
|
|
1177
1177
|
// down
|
|
1178
1178
|
};
|
|
1179
|
-
function
|
|
1179
|
+
function vr(i, e) {
|
|
1180
1180
|
const { keyCode: t } = i;
|
|
1181
|
-
|
|
1181
|
+
gr[t] && (i.preventDefault(), ur(i, e));
|
|
1182
1182
|
}
|
|
1183
|
-
const
|
|
1184
|
-
contextmenu:
|
|
1183
|
+
const co = {
|
|
1184
|
+
contextmenu: mr,
|
|
1185
1185
|
mousedown: Me,
|
|
1186
1186
|
mousemove: Me,
|
|
1187
1187
|
mouseup: Me,
|
|
@@ -1191,15 +1191,15 @@ const lo = {
|
|
|
1191
1191
|
touchstart: At,
|
|
1192
1192
|
touchmove: At,
|
|
1193
1193
|
touchend: At,
|
|
1194
|
-
wheel:
|
|
1195
|
-
keydown:
|
|
1194
|
+
wheel: pr,
|
|
1195
|
+
keydown: vr
|
|
1196
1196
|
};
|
|
1197
|
-
let
|
|
1198
|
-
class
|
|
1197
|
+
let _r = 0;
|
|
1198
|
+
class ho {
|
|
1199
1199
|
id;
|
|
1200
1200
|
worker;
|
|
1201
1201
|
constructor(e, t, s) {
|
|
1202
|
-
this.id =
|
|
1202
|
+
this.id = _r++, this.worker = t;
|
|
1203
1203
|
const n = (a) => {
|
|
1204
1204
|
this.worker.postMessage({
|
|
1205
1205
|
type: "event",
|
|
@@ -1227,7 +1227,7 @@ class co {
|
|
|
1227
1227
|
window.addEventListener("resize", r), r();
|
|
1228
1228
|
}
|
|
1229
1229
|
}
|
|
1230
|
-
class
|
|
1230
|
+
class yr extends Wi {
|
|
1231
1231
|
style = {};
|
|
1232
1232
|
left = 0;
|
|
1233
1233
|
top = 0;
|
|
@@ -1281,13 +1281,13 @@ class _r extends $i {
|
|
|
1281
1281
|
return this;
|
|
1282
1282
|
}
|
|
1283
1283
|
}
|
|
1284
|
-
class
|
|
1284
|
+
class uo {
|
|
1285
1285
|
targets = {};
|
|
1286
1286
|
constructor() {
|
|
1287
1287
|
this.handleEvent = this.handleEvent.bind(this);
|
|
1288
1288
|
}
|
|
1289
1289
|
makeProxy(e) {
|
|
1290
|
-
const { id: t } = e, s = new
|
|
1290
|
+
const { id: t } = e, s = new yr();
|
|
1291
1291
|
this.targets[t] = s;
|
|
1292
1292
|
}
|
|
1293
1293
|
getProxy(e) {
|
|
@@ -1297,7 +1297,7 @@ class ho {
|
|
|
1297
1297
|
this.targets[e.id]?.handleEvent(e.data);
|
|
1298
1298
|
}
|
|
1299
1299
|
}
|
|
1300
|
-
class
|
|
1300
|
+
class po {
|
|
1301
1301
|
assets = {
|
|
1302
1302
|
audio: /* @__PURE__ */ new Map(),
|
|
1303
1303
|
image: /* @__PURE__ */ new Map(),
|
|
@@ -1322,13 +1322,16 @@ class uo {
|
|
|
1322
1322
|
// Protected
|
|
1323
1323
|
playing = !1;
|
|
1324
1324
|
rafID = -1;
|
|
1325
|
+
constructor(e, t = !1) {
|
|
1326
|
+
this.settings.dev = e, this.settings.editor = t;
|
|
1327
|
+
}
|
|
1325
1328
|
dispose() {
|
|
1326
1329
|
this.pause(), this.components.forEach((e) => e.dispose()), this.components.clear();
|
|
1327
1330
|
}
|
|
1328
|
-
detectSettings(
|
|
1329
|
-
return new Promise((
|
|
1330
|
-
|
|
1331
|
-
this.settings =
|
|
1331
|
+
detectSettings() {
|
|
1332
|
+
return new Promise((e) => {
|
|
1333
|
+
Jn(this.settings.dev, this.settings.editor).then((t) => {
|
|
1334
|
+
this.settings = t, e();
|
|
1332
1335
|
});
|
|
1333
1336
|
});
|
|
1334
1337
|
}
|
|
@@ -1367,16 +1370,17 @@ class uo {
|
|
|
1367
1370
|
this.settings.editor = e;
|
|
1368
1371
|
}
|
|
1369
1372
|
}
|
|
1370
|
-
class
|
|
1373
|
+
class os {
|
|
1371
1374
|
name;
|
|
1372
1375
|
_debug = !1;
|
|
1373
1376
|
_editor = !1;
|
|
1374
1377
|
broadcastChannel;
|
|
1378
|
+
onMessageHandler;
|
|
1375
1379
|
constructor(e, t = !1, s = !1) {
|
|
1376
|
-
this.name = e, this._debug = t, this._editor = s, t && (this.broadcastChannel = new BroadcastChannel(e), this.broadcastChannel.addEventListener("message", this.
|
|
1380
|
+
this.name = e, this._debug = t, this._editor = s, t && (this.broadcastChannel = new BroadcastChannel(e), this.onMessageHandler = this.messageHandler.bind(this), this.broadcastChannel.addEventListener("message", this.onMessageHandler));
|
|
1377
1381
|
}
|
|
1378
1382
|
dispose() {
|
|
1379
|
-
this.broadcastChannel?.removeEventListener("message", this.
|
|
1383
|
+
this.broadcastChannel?.removeEventListener("message", this.onMessageHandler), this.broadcastChannel?.close();
|
|
1380
1384
|
}
|
|
1381
1385
|
get debug() {
|
|
1382
1386
|
return this._debug;
|
|
@@ -1393,24 +1397,24 @@ class as {
|
|
|
1393
1397
|
console.log("Hermes - Error sending message:"), console.log(s), console.log(e);
|
|
1394
1398
|
}
|
|
1395
1399
|
}
|
|
1396
|
-
messageHandler
|
|
1400
|
+
messageHandler(e) {
|
|
1397
1401
|
const t = e.data;
|
|
1398
1402
|
t.target === "app" ? this.handleApp(t) : this.handleEditor(t);
|
|
1399
|
-
}
|
|
1403
|
+
}
|
|
1400
1404
|
handleApp(e) {
|
|
1401
1405
|
}
|
|
1402
1406
|
handleEditor(e) {
|
|
1403
1407
|
}
|
|
1404
1408
|
}
|
|
1405
|
-
function
|
|
1409
|
+
function Cr(i, e, t, s, n) {
|
|
1406
1410
|
const r = 1 - i;
|
|
1407
1411
|
return r * r * r * e + 3 * r * r * i * t + 3 * r * i * i * s + i * i * i * n;
|
|
1408
1412
|
}
|
|
1409
|
-
function
|
|
1413
|
+
function br(i, e, t) {
|
|
1410
1414
|
if (i.type !== "bezier" || i.handles.length !== 4)
|
|
1411
1415
|
throw new Error("Invalid keyframe data for Bézier interpolation.");
|
|
1412
1416
|
const [s, n] = i.handles, r = (t - i.position) / (e.position - i.position);
|
|
1413
|
-
return
|
|
1417
|
+
return Cr(
|
|
1414
1418
|
r,
|
|
1415
1419
|
i.value,
|
|
1416
1420
|
i.value + s,
|
|
@@ -1418,7 +1422,7 @@ function Cr(i, e, t) {
|
|
|
1418
1422
|
e.value
|
|
1419
1423
|
);
|
|
1420
1424
|
}
|
|
1421
|
-
class
|
|
1425
|
+
class mo extends os {
|
|
1422
1426
|
project;
|
|
1423
1427
|
sheets = /* @__PURE__ */ new Map();
|
|
1424
1428
|
sheetObjects = /* @__PURE__ */ new Map();
|
|
@@ -1433,7 +1437,7 @@ class po extends as {
|
|
|
1433
1437
|
this.project = void 0, this.sheets = /* @__PURE__ */ new Map(), this.sheetObjects = /* @__PURE__ */ new Map(), this.sheetObjectCBs = /* @__PURE__ */ new Map(), this.sheetObjectUnsubscribe = /* @__PURE__ */ new Map();
|
|
1434
1438
|
}
|
|
1435
1439
|
loadProject(e, t) {
|
|
1436
|
-
return this.project =
|
|
1440
|
+
return this.project = Cs(e, { state: t }), new Promise((s, n) => {
|
|
1437
1441
|
this.project?.ready.then(() => {
|
|
1438
1442
|
if (t) {
|
|
1439
1443
|
const r = t.sheetsById;
|
|
@@ -1493,10 +1497,10 @@ class po extends as {
|
|
|
1493
1497
|
const c = `${this.getSheetInstance(e, r)}_${t}`;
|
|
1494
1498
|
let l = this.sheetObjects.get(c), h = s;
|
|
1495
1499
|
l !== void 0 && (h = { ...s, ...l.value }), l = a.object(t, h, { reconfigure: !0 }), this.sheetObjects.set(c, l), this.sheetObjectCBs.set(c, n !== void 0 ? n : pt);
|
|
1496
|
-
function d(
|
|
1500
|
+
function d(p, y, v) {
|
|
1497
1501
|
if (typeof v == "object")
|
|
1498
|
-
if (
|
|
1499
|
-
|
|
1502
|
+
if (Yn(v))
|
|
1503
|
+
p[y] = {
|
|
1500
1504
|
r: v.r,
|
|
1501
1505
|
g: v.g,
|
|
1502
1506
|
b: v.b,
|
|
@@ -1508,12 +1512,12 @@ class po extends as {
|
|
|
1508
1512
|
typeof g == "object" && d(v, C, g);
|
|
1509
1513
|
}
|
|
1510
1514
|
}
|
|
1511
|
-
const u = l.onValuesChange((
|
|
1515
|
+
const u = l.onValuesChange((p) => {
|
|
1512
1516
|
const y = this.sheetObjectCBs.get(c);
|
|
1513
1517
|
if (this.editor) {
|
|
1514
|
-
for (const v in
|
|
1515
|
-
const C =
|
|
1516
|
-
typeof C == "object" && d(
|
|
1518
|
+
for (const v in p) {
|
|
1519
|
+
const C = p[v];
|
|
1520
|
+
typeof C == "object" && d(p, v, C);
|
|
1517
1521
|
}
|
|
1518
1522
|
this.send({
|
|
1519
1523
|
event: "updateSheetObject",
|
|
@@ -1521,11 +1525,11 @@ class po extends as {
|
|
|
1521
1525
|
data: {
|
|
1522
1526
|
sheet: e,
|
|
1523
1527
|
sheetObject: c,
|
|
1524
|
-
values:
|
|
1528
|
+
values: p
|
|
1525
1529
|
}
|
|
1526
|
-
}), y && y(
|
|
1530
|
+
}), y && y(p);
|
|
1527
1531
|
} else
|
|
1528
|
-
y && y(
|
|
1532
|
+
y && y(p);
|
|
1529
1533
|
});
|
|
1530
1534
|
return this.sheetObjectUnsubscribe.set(c, u), l;
|
|
1531
1535
|
}
|
|
@@ -1541,21 +1545,21 @@ class po extends as {
|
|
|
1541
1545
|
const n = `${e}_${t}`, r = this.sheetObjects.get(n);
|
|
1542
1546
|
if (r === void 0) return [];
|
|
1543
1547
|
const a = [], o = s.sequence.__experimental_getKeyframes(r.props.x), c = s.sequence.__experimental_getKeyframes(r.props.y), l = s.sequence.__experimental_getKeyframes(r.props.z), h = /* @__PURE__ */ new Set();
|
|
1544
|
-
return o.forEach((u) => h.add(u.position)), c.forEach((u) => h.add(u.position)), l.forEach((u) => h.add(u.position)), Array.from(h).sort((u,
|
|
1545
|
-
const
|
|
1548
|
+
return o.forEach((u) => h.add(u.position)), c.forEach((u) => h.add(u.position)), l.forEach((u) => h.add(u.position)), Array.from(h).sort((u, p) => u - p).forEach((u) => {
|
|
1549
|
+
const p = (y, v) => {
|
|
1546
1550
|
const C = y.find((E, S) => E.position <= v && (y[S + 1]?.position || 1 / 0) > v), g = y.find((E) => E.position > v);
|
|
1547
1551
|
if (!C) return g?.value || 0;
|
|
1548
1552
|
if (!g || C.position === v) return C.value;
|
|
1549
1553
|
if (C.type === "bezier")
|
|
1550
|
-
return
|
|
1554
|
+
return br(C, g, v);
|
|
1551
1555
|
const _ = (v - C.position) / (g.position - C.position);
|
|
1552
1556
|
return C.value + _ * (g.value - C.value);
|
|
1553
1557
|
};
|
|
1554
1558
|
a.push({
|
|
1555
1559
|
position: u,
|
|
1556
|
-
x:
|
|
1557
|
-
y:
|
|
1558
|
-
z:
|
|
1560
|
+
x: p(o, u),
|
|
1561
|
+
y: p(c, u),
|
|
1562
|
+
z: p(l, u)
|
|
1559
1563
|
});
|
|
1560
1564
|
}), a;
|
|
1561
1565
|
}
|
|
@@ -1648,7 +1652,7 @@ class po extends as {
|
|
|
1648
1652
|
this.studio?.ui.hide();
|
|
1649
1653
|
}
|
|
1650
1654
|
}
|
|
1651
|
-
function
|
|
1655
|
+
function Er(i) {
|
|
1652
1656
|
if (i.name === "cameras")
|
|
1653
1657
|
return "camera";
|
|
1654
1658
|
if (i.name === "interactive")
|
|
@@ -1673,7 +1677,7 @@ function he(i) {
|
|
|
1673
1677
|
e.children.push(he(t));
|
|
1674
1678
|
}), e;
|
|
1675
1679
|
}
|
|
1676
|
-
function
|
|
1680
|
+
function Sr(i) {
|
|
1677
1681
|
const e = {};
|
|
1678
1682
|
for (const t in i) {
|
|
1679
1683
|
const s = i[t].value;
|
|
@@ -1689,7 +1693,7 @@ function Er(i) {
|
|
|
1689
1693
|
}
|
|
1690
1694
|
return e;
|
|
1691
1695
|
}
|
|
1692
|
-
function
|
|
1696
|
+
function Or(i) {
|
|
1693
1697
|
switch (i) {
|
|
1694
1698
|
case "blendSrcAlpha":
|
|
1695
1699
|
case "blendDstAlpha":
|
|
@@ -1704,7 +1708,7 @@ function Sr(i) {
|
|
|
1704
1708
|
function Ae(i) {
|
|
1705
1709
|
const e = {};
|
|
1706
1710
|
for (const t in i) {
|
|
1707
|
-
if (t.substring(0, 1) === "_" || t.substring(0, 2) === "is" ||
|
|
1711
|
+
if (t.substring(0, 1) === "_" || t.substring(0, 2) === "is" || Or(t)) continue;
|
|
1708
1712
|
const s = typeof i[t], n = i[t];
|
|
1709
1713
|
switch (s) {
|
|
1710
1714
|
case "boolean":
|
|
@@ -1726,7 +1730,7 @@ function Ae(i) {
|
|
|
1726
1730
|
__isUniform: !0,
|
|
1727
1731
|
value: r?.isTexture ? { src: ce.renderToBlob(r), offset: [r.offset.x, r.offset.y], repeat: [r.repeat.x, r.repeat.y] } : r
|
|
1728
1732
|
};
|
|
1729
|
-
} else t === "uniforms" ? e[t] =
|
|
1733
|
+
} else t === "uniforms" ? e[t] = Sr(n) : t.search("Node") > -1 || (e[t] = n);
|
|
1730
1734
|
else
|
|
1731
1735
|
t === "glslVersion" ? e[t] = "" : t.search("Node") > -1 || (e[t] = {
|
|
1732
1736
|
src: "",
|
|
@@ -1818,7 +1822,7 @@ function Rt(i) {
|
|
|
1818
1822
|
});
|
|
1819
1823
|
return e;
|
|
1820
1824
|
}
|
|
1821
|
-
function
|
|
1825
|
+
function wr(i, e) {
|
|
1822
1826
|
const t = e.split(".");
|
|
1823
1827
|
switch (t.length) {
|
|
1824
1828
|
case 1:
|
|
@@ -1835,7 +1839,7 @@ function Or(i, e) {
|
|
|
1835
1839
|
return i[t[0]][t[1]][t[2]][t[3]][t[4]][t[5]];
|
|
1836
1840
|
}
|
|
1837
1841
|
}
|
|
1838
|
-
function
|
|
1842
|
+
function xr(i, e) {
|
|
1839
1843
|
for (const t in e) i[t] = e[t];
|
|
1840
1844
|
}
|
|
1841
1845
|
function V(i, e, t) {
|
|
@@ -1881,10 +1885,10 @@ function V(i, e, t) {
|
|
|
1881
1885
|
a = i[s[0]][s[1]][s[2]][s[3]][s[4]];
|
|
1882
1886
|
break;
|
|
1883
1887
|
}
|
|
1884
|
-
a != null ?
|
|
1888
|
+
a != null ? xr(a, t) : console.log(`Hermes - Can't set props because target isn't found: ${e}`, t);
|
|
1885
1889
|
}
|
|
1886
1890
|
}
|
|
1887
|
-
function
|
|
1891
|
+
function ls(i) {
|
|
1888
1892
|
return new Promise((e, t) => {
|
|
1889
1893
|
const s = new Image();
|
|
1890
1894
|
s.onload = () => {
|
|
@@ -1894,7 +1898,7 @@ function os(i) {
|
|
|
1894
1898
|
});
|
|
1895
1899
|
}
|
|
1896
1900
|
var R = /* @__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))(R || {});
|
|
1897
|
-
class
|
|
1901
|
+
class fo extends os {
|
|
1898
1902
|
name;
|
|
1899
1903
|
canvas = null;
|
|
1900
1904
|
// Canvas or OffscreenCanvas
|
|
@@ -1970,7 +1974,7 @@ class mo extends as {
|
|
|
1970
1974
|
const r = this.getObjectByUUID(e);
|
|
1971
1975
|
if (r)
|
|
1972
1976
|
try {
|
|
1973
|
-
n !== void 0 ?
|
|
1977
|
+
n !== void 0 ? wr(r, n)[t](s) : r[t](s);
|
|
1974
1978
|
} catch (a) {
|
|
1975
1979
|
console.log("Hermes - Error requesting method:", e, t, s), console.log(a);
|
|
1976
1980
|
}
|
|
@@ -2027,7 +2031,7 @@ class mo extends as {
|
|
|
2027
2031
|
}
|
|
2028
2032
|
n.material.needsUpdate = !0;
|
|
2029
2033
|
};
|
|
2030
|
-
s.src.length > 0 ?
|
|
2034
|
+
s.src.length > 0 ? ls(s.src).then((a) => {
|
|
2031
2035
|
a.offset.set(s.offset[0], s.offset[1]), a.repeat.set(s.repeat[0], s.repeat[1]), r(a);
|
|
2032
2036
|
}) : r(null);
|
|
2033
2037
|
}
|
|
@@ -2280,7 +2284,7 @@ class mo extends as {
|
|
|
2280
2284
|
this.dispatchEvent({ type: "ToolEvents::addRenderer", value: e.data });
|
|
2281
2285
|
}
|
|
2282
2286
|
}
|
|
2283
|
-
messageHandler
|
|
2287
|
+
messageHandler(e) {
|
|
2284
2288
|
const t = e.data;
|
|
2285
2289
|
if (t.event === "updateObject") {
|
|
2286
2290
|
this.onUpdateObject(t.data.uuid, t.data.key, t.data.value);
|
|
@@ -2302,12 +2306,12 @@ class mo extends as {
|
|
|
2302
2306
|
return;
|
|
2303
2307
|
}
|
|
2304
2308
|
t.target === "app" ? this.handleApp(t) : this.handleEditor(t);
|
|
2305
|
-
}
|
|
2309
|
+
}
|
|
2306
2310
|
// Renderer
|
|
2307
2311
|
addRT(e, t = !0, s) {
|
|
2308
2312
|
if (!this.renderer) return;
|
|
2309
2313
|
let n;
|
|
2310
|
-
this.renderer instanceof Ge ? n = new
|
|
2314
|
+
this.renderer instanceof Ge ? n = new en(32, 32, s) : n = new tn(32, 32, s), n.texture.name = e, this.renderTargets.set(e, n), this.renderTargetsResize.set(e, t);
|
|
2311
2315
|
}
|
|
2312
2316
|
removeRT(e) {
|
|
2313
2317
|
this.renderTargets.delete(e), this.renderTargetsResize.delete(e);
|
|
@@ -2321,7 +2325,7 @@ class mo extends as {
|
|
|
2321
2325
|
this.renderer?.setSize(e, t, n);
|
|
2322
2326
|
}
|
|
2323
2327
|
set dpr(e) {
|
|
2324
|
-
this.renderer?.setPixelRatio(
|
|
2328
|
+
this.renderer?.setPixelRatio(ye(1, 2, e));
|
|
2325
2329
|
}
|
|
2326
2330
|
get dpr() {
|
|
2327
2331
|
return this.renderer !== void 0 ? this.renderer?.getPixelRatio() : 1;
|
|
@@ -2333,14 +2337,14 @@ class mo extends as {
|
|
|
2333
2337
|
return this.renderer !== void 0 ? this.renderer.domElement.height / this.dpr : 0;
|
|
2334
2338
|
}
|
|
2335
2339
|
}
|
|
2336
|
-
function
|
|
2340
|
+
function cs(i) {
|
|
2337
2341
|
return i.title.search("<") > -1 ? /* @__PURE__ */ f("button", { className: "svg", dangerouslySetInnerHTML: { __html: i.title } }) : /* @__PURE__ */ f("button", { children: i.title });
|
|
2338
2342
|
}
|
|
2339
|
-
const
|
|
2343
|
+
const Tr = /* @__PURE__ */ M("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
|
|
2340
2344
|
/* @__PURE__ */ f("circle", { cx: "7", cy: "7", r: "6" }),
|
|
2341
2345
|
/* @__PURE__ */ f("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
|
|
2342
2346
|
/* @__PURE__ */ f("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
|
|
2343
|
-
] }),
|
|
2347
|
+
] }), Mr = /* @__PURE__ */ f("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ f(
|
|
2344
2348
|
"path",
|
|
2345
2349
|
{
|
|
2346
2350
|
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
|
|
@@ -2348,7 +2352,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
|
|
|
2348
2352
|
C11,8.22,10.74,8,10.43,8z`
|
|
2349
2353
|
}
|
|
2350
2354
|
) });
|
|
2351
|
-
function
|
|
2355
|
+
function Ar(i) {
|
|
2352
2356
|
return /* @__PURE__ */ f(
|
|
2353
2357
|
"li",
|
|
2354
2358
|
{
|
|
@@ -2360,35 +2364,35 @@ function Mr(i) {
|
|
|
2360
2364
|
},
|
|
2361
2365
|
onDragEnd: i.onDragEnd,
|
|
2362
2366
|
children: /* @__PURE__ */ M("div", { children: [
|
|
2363
|
-
|
|
2367
|
+
Mr,
|
|
2364
2368
|
/* @__PURE__ */ f("span", { children: i.title }),
|
|
2365
|
-
/* @__PURE__ */ f("button", { className: "closeIcon", onClick: () => i.onDelete(i.index), children:
|
|
2369
|
+
/* @__PURE__ */ f("button", { className: "closeIcon", onClick: () => i.onDelete(i.index), children: Tr })
|
|
2366
2370
|
] })
|
|
2367
2371
|
}
|
|
2368
2372
|
);
|
|
2369
2373
|
}
|
|
2370
|
-
function
|
|
2371
|
-
const [e, t] = L(!1), [s, n] = L(i.options), [r, a] = L(null), o = (
|
|
2372
|
-
i.onDragComplete(
|
|
2373
|
-
}, c = (
|
|
2374
|
+
function Rr(i) {
|
|
2375
|
+
const [e, t] = L(!1), [s, n] = L(i.options), [r, a] = L(null), o = (p) => {
|
|
2376
|
+
i.onDragComplete(p), n(p);
|
|
2377
|
+
}, c = (p) => {
|
|
2374
2378
|
const y = [...s];
|
|
2375
|
-
y.splice(
|
|
2376
|
-
}, l = (
|
|
2377
|
-
a(
|
|
2378
|
-
}, h = (
|
|
2379
|
-
if (r ===
|
|
2379
|
+
y.splice(p, 1), o(y);
|
|
2380
|
+
}, l = (p) => {
|
|
2381
|
+
a(p);
|
|
2382
|
+
}, h = (p) => {
|
|
2383
|
+
if (r === p || r === null) return;
|
|
2380
2384
|
const y = [...s], v = y.splice(r, 1)[0];
|
|
2381
|
-
y.splice(
|
|
2385
|
+
y.splice(p, 0, v), a(p), n(y);
|
|
2382
2386
|
}, d = () => {
|
|
2383
2387
|
i.onDragComplete(s), a(null);
|
|
2384
2388
|
};
|
|
2385
2389
|
let u = "dropdown draggable";
|
|
2386
2390
|
return i.subdropdown && (u += " subdropdown"), /* @__PURE__ */ M("div", { className: u, onMouseEnter: () => t(!0), onMouseLeave: () => t(!1), children: [
|
|
2387
|
-
/* @__PURE__ */ f(
|
|
2388
|
-
/* @__PURE__ */ f("ul", { className: "reorder-list", style: { display: e ? "block" : "none" }, children: s.map((
|
|
2389
|
-
|
|
2391
|
+
/* @__PURE__ */ f(cs, { title: i.title }),
|
|
2392
|
+
/* @__PURE__ */ f("ul", { className: "reorder-list", style: { display: e ? "block" : "none" }, children: s.map((p, y) => /* @__PURE__ */ f(
|
|
2393
|
+
Ar,
|
|
2390
2394
|
{
|
|
2391
|
-
title:
|
|
2395
|
+
title: p,
|
|
2392
2396
|
index: y,
|
|
2393
2397
|
draggingIndex: r,
|
|
2394
2398
|
onDelete: c,
|
|
@@ -2396,14 +2400,14 @@ function Ar(i) {
|
|
|
2396
2400
|
onDragOver: h,
|
|
2397
2401
|
onDragEnd: d
|
|
2398
2402
|
},
|
|
2399
|
-
|
|
2403
|
+
p
|
|
2400
2404
|
)) })
|
|
2401
2405
|
] });
|
|
2402
2406
|
}
|
|
2403
|
-
function
|
|
2407
|
+
function Pr(i) {
|
|
2404
2408
|
const [e, t] = L(!1), s = [];
|
|
2405
2409
|
i.options.map((r, a) => {
|
|
2406
|
-
i.onSelect !== void 0 && (r.onSelect = i.onSelect), s.push(/* @__PURE__ */ f(
|
|
2410
|
+
i.onSelect !== void 0 && (r.onSelect = i.onSelect), s.push(/* @__PURE__ */ f(Dr, { option: r }, a));
|
|
2407
2411
|
});
|
|
2408
2412
|
let n = "dropdown";
|
|
2409
2413
|
return i.subdropdown && (n += " subdropdown"), /* @__PURE__ */ M(
|
|
@@ -2413,7 +2417,7 @@ function Rr(i) {
|
|
|
2413
2417
|
onMouseEnter: () => t(!0),
|
|
2414
2418
|
onMouseLeave: () => t(!1),
|
|
2415
2419
|
children: [
|
|
2416
|
-
/* @__PURE__ */ f(
|
|
2420
|
+
/* @__PURE__ */ f(cs, { title: i.title }),
|
|
2417
2421
|
/* @__PURE__ */ f(
|
|
2418
2422
|
"ul",
|
|
2419
2423
|
{
|
|
@@ -2425,13 +2429,13 @@ function Rr(i) {
|
|
|
2425
2429
|
}
|
|
2426
2430
|
);
|
|
2427
2431
|
}
|
|
2428
|
-
function
|
|
2432
|
+
function Dr(i) {
|
|
2429
2433
|
const { option: e } = i, [t, s] = L("");
|
|
2430
2434
|
let n;
|
|
2431
2435
|
switch (e.type) {
|
|
2432
2436
|
case "draggable":
|
|
2433
2437
|
n = /* @__PURE__ */ f(
|
|
2434
|
-
|
|
2438
|
+
Rr,
|
|
2435
2439
|
{
|
|
2436
2440
|
title: e.title,
|
|
2437
2441
|
options: e.value,
|
|
@@ -2444,7 +2448,7 @@ function Pr(i) {
|
|
|
2444
2448
|
break;
|
|
2445
2449
|
case "dropdown":
|
|
2446
2450
|
n = /* @__PURE__ */ f(
|
|
2447
|
-
|
|
2451
|
+
Pr,
|
|
2448
2452
|
{
|
|
2449
2453
|
title: e.title,
|
|
2450
2454
|
options: e.value,
|
|
@@ -2492,7 +2496,7 @@ function je(i) {
|
|
|
2492
2496
|
]
|
|
2493
2497
|
}
|
|
2494
2498
|
),
|
|
2495
|
-
i.onRefresh ? /* @__PURE__ */ M(
|
|
2499
|
+
i.onRefresh ? /* @__PURE__ */ M(Y, { children: [
|
|
2496
2500
|
/* @__PURE__ */ f(
|
|
2497
2501
|
"button",
|
|
2498
2502
|
{
|
|
@@ -2516,13 +2520,13 @@ function je(i) {
|
|
|
2516
2520
|
/* @__PURE__ */ f("div", { className: e ? "open" : "", children: /* @__PURE__ */ f("div", { children: i.children }) })
|
|
2517
2521
|
] });
|
|
2518
2522
|
}
|
|
2519
|
-
function
|
|
2523
|
+
function hs(i) {
|
|
2520
2524
|
if (i.child === void 0)
|
|
2521
2525
|
return console.log("Hermes - No child attached"), null;
|
|
2522
2526
|
const e = z(null), [t, s] = L(!1), n = i.child.children.length > 0, r = [];
|
|
2523
2527
|
return i.child.children.length > 0 && i.child.children.map((a, o) => {
|
|
2524
|
-
r.push(/* @__PURE__ */ f(
|
|
2525
|
-
}),
|
|
2528
|
+
r.push(/* @__PURE__ */ f(hs, { child: a, three: i.three }, o));
|
|
2529
|
+
}), pe(() => {
|
|
2526
2530
|
if (i.child) {
|
|
2527
2531
|
const a = i.child.uuid.split(".")[0], o = i.three.getScene(a);
|
|
2528
2532
|
if (o !== null)
|
|
@@ -2583,7 +2587,7 @@ function cs(i) {
|
|
|
2583
2587
|
}
|
|
2584
2588
|
}
|
|
2585
2589
|
),
|
|
2586
|
-
/* @__PURE__ */ f("div", { className: `icon ${
|
|
2590
|
+
/* @__PURE__ */ f("div", { className: `icon ${Er(i.child)}` })
|
|
2587
2591
|
] }),
|
|
2588
2592
|
/* @__PURE__ */ f("div", { className: t ? "open" : "", children: /* @__PURE__ */ f("div", { className: "container", children: r }) })
|
|
2589
2593
|
] });
|
|
@@ -2591,25 +2595,25 @@ function cs(i) {
|
|
|
2591
2595
|
function Pt(i) {
|
|
2592
2596
|
const e = [];
|
|
2593
2597
|
return i.child?.children.map((t, s) => {
|
|
2594
|
-
e.push(/* @__PURE__ */ f(
|
|
2598
|
+
e.push(/* @__PURE__ */ f(hs, { child: t, scene: i.scene, three: i.three }, s));
|
|
2595
2599
|
}), /* @__PURE__ */ f("div", { className: `scene ${i.class !== void 0 ? i.class : ""}`, children: e });
|
|
2596
2600
|
}
|
|
2597
2601
|
function Ye(i) {
|
|
2598
2602
|
const [e, t] = L(i.defaultValue);
|
|
2599
|
-
return
|
|
2603
|
+
return pe(() => {
|
|
2600
2604
|
let s = !1, n = -1, r = 0, a = i.defaultValue, o = !1;
|
|
2601
|
-
const c = (
|
|
2602
|
-
o =
|
|
2603
|
-
}, l = (
|
|
2604
|
-
s = !0, r = Number(i.input.current?.value), n =
|
|
2605
|
-
}, h = (
|
|
2605
|
+
const c = (p) => {
|
|
2606
|
+
o = p.ctrlKey;
|
|
2607
|
+
}, l = (p) => {
|
|
2608
|
+
s = !0, r = Number(i.input.current?.value), n = p.clientX, document.addEventListener("mouseup", d, !1), document.addEventListener("mousemove", h, !1), document.addEventListener("contextmenu", d, !1);
|
|
2609
|
+
}, h = (p) => {
|
|
2606
2610
|
if (!s) return;
|
|
2607
|
-
const y = i.step !== void 0 ? i.step : 1, v = (
|
|
2611
|
+
const y = i.step !== void 0 ? i.step : 1, v = (p.clientX - n) * y * (o ? 10 : 1);
|
|
2608
2612
|
a = Number((r + v).toFixed(4)), i.min !== void 0 && (a = Math.max(a, i.min)), i.max !== void 0 && (a = Math.min(a, i.max)), i.onChange !== void 0 && i.onChange(a), t(a);
|
|
2609
2613
|
}, d = () => {
|
|
2610
2614
|
s = !1, document.removeEventListener("mouseup", d), document.removeEventListener("mousemove", h), document.removeEventListener("contextmenu", d);
|
|
2611
|
-
}, u = (
|
|
2612
|
-
const y = Number(
|
|
2615
|
+
}, u = (p) => {
|
|
2616
|
+
const y = Number(p.target.value);
|
|
2613
2617
|
i.onChange !== void 0 && i.onChange(y), t(y);
|
|
2614
2618
|
};
|
|
2615
2619
|
return i.label.current?.addEventListener("mousedown", l, !1), i.sliderRef !== void 0 && i.sliderRef.current?.addEventListener("input", u), document.addEventListener("keydown", c, !1), document.addEventListener("keyup", c, !1), () => {
|
|
@@ -2617,7 +2621,7 @@ function Ye(i) {
|
|
|
2617
2621
|
};
|
|
2618
2622
|
}, []), e;
|
|
2619
2623
|
}
|
|
2620
|
-
function
|
|
2624
|
+
function Ce(i) {
|
|
2621
2625
|
const e = z(null), t = z(null), [s, n] = L(i.value);
|
|
2622
2626
|
return Ye({
|
|
2623
2627
|
label: i.labelRef,
|
|
@@ -2630,7 +2634,7 @@ function ye(i) {
|
|
|
2630
2634
|
onChange: (r) => {
|
|
2631
2635
|
n(r), i.onChange !== void 0 && i.onChange(i.prop, r);
|
|
2632
2636
|
}
|
|
2633
|
-
}), /* @__PURE__ */ M(
|
|
2637
|
+
}), /* @__PURE__ */ M(Y, { children: [
|
|
2634
2638
|
i.type === "number" && /* @__PURE__ */ f(
|
|
2635
2639
|
"input",
|
|
2636
2640
|
{
|
|
@@ -2651,7 +2655,7 @@ function ye(i) {
|
|
|
2651
2655
|
}
|
|
2652
2656
|
}
|
|
2653
2657
|
),
|
|
2654
|
-
i.type === "range" && /* @__PURE__ */ M(
|
|
2658
|
+
i.type === "range" && /* @__PURE__ */ M(Y, { children: [
|
|
2655
2659
|
/* @__PURE__ */ f(
|
|
2656
2660
|
"input",
|
|
2657
2661
|
{
|
|
@@ -2685,8 +2689,8 @@ function ye(i) {
|
|
|
2685
2689
|
] })
|
|
2686
2690
|
] });
|
|
2687
2691
|
}
|
|
2688
|
-
function
|
|
2689
|
-
const e = z(null), t = z(null), s = z(null), n = z(null), r = z(null), a = z(null), o = z(null), c = z(null), l = z(null), h = z(null), [d, u] = L(i.value.x), [
|
|
2692
|
+
function Ir(i) {
|
|
2693
|
+
const e = z(null), t = z(null), s = z(null), n = z(null), r = z(null), a = z(null), o = z(null), c = z(null), l = z(null), h = z(null), [d, u] = L(i.value.x), [p, y] = L(i.value.y), [v, C] = L({
|
|
2690
2694
|
min: Math.min(i.min, Math.min(i.value.x, i.value.y)),
|
|
2691
2695
|
max: Math.max(i.max, Math.max(i.value.x, i.value.y))
|
|
2692
2696
|
}), [g, _] = L(!1);
|
|
@@ -2698,12 +2702,12 @@ function Dr(i) {
|
|
|
2698
2702
|
max: v.max,
|
|
2699
2703
|
step: 0.01,
|
|
2700
2704
|
onChange: (x) => {
|
|
2701
|
-
u(x), i.onChange({ target: { value: { x, y:
|
|
2705
|
+
u(x), i.onChange({ target: { value: { x, y: p } } });
|
|
2702
2706
|
}
|
|
2703
2707
|
}), Ye({
|
|
2704
2708
|
label: c,
|
|
2705
2709
|
input: t,
|
|
2706
|
-
defaultValue:
|
|
2710
|
+
defaultValue: p,
|
|
2707
2711
|
min: v.min,
|
|
2708
2712
|
max: v.max,
|
|
2709
2713
|
step: 0.01,
|
|
@@ -2738,20 +2742,20 @@ function Dr(i) {
|
|
|
2738
2742
|
window.removeEventListener("mousemove", b), window.removeEventListener("mouseup", S), _(!1);
|
|
2739
2743
|
}
|
|
2740
2744
|
function b(x) {
|
|
2741
|
-
const N = r.current.getBoundingClientRect(), Q =
|
|
2742
|
-
i.onChange({ target: { value: { x:
|
|
2745
|
+
const N = r.current.getBoundingClientRect(), Q = ye(0, 99, x.clientX - N.left) / 99, oe = 1 - ye(0, 99, x.clientY - N.top) / 99, me = te(Xe(v.min, v.max, Q), 3), be = te(Xe(v.min, v.max, oe), 3);
|
|
2746
|
+
i.onChange({ target: { value: { x: me, y: be } } }), u(me), y(be);
|
|
2743
2747
|
}
|
|
2744
2748
|
function O() {
|
|
2745
2749
|
const x = Number(s.current.value);
|
|
2746
|
-
C({ min: x, max: v.max }), d < x && u(
|
|
2750
|
+
C({ min: x, max: v.max }), d < x && u(ye(x, v.max, d)), p < x && y(ye(x, v.max, p));
|
|
2747
2751
|
}
|
|
2748
2752
|
function w() {
|
|
2749
2753
|
const x = Number(n.current.value);
|
|
2750
|
-
C({ min: v.min, max: x }), d > x && u(
|
|
2754
|
+
C({ min: v.min, max: x }), d > x && u(ye(v.min, x, d)), p > x && y(ye(v.min, x, p));
|
|
2751
2755
|
}
|
|
2752
|
-
|
|
2753
|
-
a.current.style.left = `${Zt(v.min, v.max, d) * 100}%`, a.current.style.top = `${(1 - Zt(v.min, v.max,
|
|
2754
|
-
}, [v, d,
|
|
2756
|
+
pe(() => {
|
|
2757
|
+
a.current.style.left = `${Zt(v.min, v.max, d) * 100}%`, a.current.style.top = `${(1 - Zt(v.min, v.max, p)) * 100}%`;
|
|
2758
|
+
}, [v, d, p]);
|
|
2755
2759
|
const D = i.step !== void 0 ? i.step : 0.01;
|
|
2756
2760
|
return /* @__PURE__ */ M("div", { className: "vector2", children: [
|
|
2757
2761
|
/* @__PURE__ */ M("div", { className: "fields", children: [
|
|
@@ -2770,7 +2774,7 @@ function Dr(i) {
|
|
|
2770
2774
|
onChange: (x) => {
|
|
2771
2775
|
if (u(x.target.value), x.target.value.length === 0) return;
|
|
2772
2776
|
const N = Number(x.target.value);
|
|
2773
|
-
isNaN(N) || (i.onChange({ target: { value: { x: N, y:
|
|
2777
|
+
isNaN(N) || (i.onChange({ target: { value: { x: N, y: p } } }), N < v.min && C({ min: N, max: v.max }));
|
|
2774
2778
|
}
|
|
2775
2779
|
}
|
|
2776
2780
|
)
|
|
@@ -2782,7 +2786,7 @@ function Dr(i) {
|
|
|
2782
2786
|
{
|
|
2783
2787
|
ref: t,
|
|
2784
2788
|
type: "number",
|
|
2785
|
-
value:
|
|
2789
|
+
value: p,
|
|
2786
2790
|
min: v.min,
|
|
2787
2791
|
max: v.max,
|
|
2788
2792
|
step: D,
|
|
@@ -2841,9 +2845,9 @@ function wi(i) {
|
|
|
2841
2845
|
/* @__PURE__ */ M("div", { children: [
|
|
2842
2846
|
/* @__PURE__ */ f("span", { ref: l, children: c.substring(1).toUpperCase() }),
|
|
2843
2847
|
/* @__PURE__ */ f(
|
|
2844
|
-
|
|
2848
|
+
Ce,
|
|
2845
2849
|
{
|
|
2846
|
-
value:
|
|
2850
|
+
value: Tn(a[c]),
|
|
2847
2851
|
type: "number",
|
|
2848
2852
|
prop: c,
|
|
2849
2853
|
step: 0.1,
|
|
@@ -2866,7 +2870,7 @@ function wi(i) {
|
|
|
2866
2870
|
/* @__PURE__ */ M("div", { children: [
|
|
2867
2871
|
/* @__PURE__ */ f("label", { ref: h, children: l.toUpperCase() }),
|
|
2868
2872
|
/* @__PURE__ */ f(
|
|
2869
|
-
|
|
2873
|
+
Ce,
|
|
2870
2874
|
{
|
|
2871
2875
|
value: a[l],
|
|
2872
2876
|
type: "number",
|
|
@@ -2890,7 +2894,7 @@ function wi(i) {
|
|
|
2890
2894
|
/* @__PURE__ */ M("div", { children: [
|
|
2891
2895
|
/* @__PURE__ */ f("label", { ref: l, children: c + 1 }),
|
|
2892
2896
|
/* @__PURE__ */ f(
|
|
2893
|
-
|
|
2897
|
+
Ce,
|
|
2894
2898
|
{
|
|
2895
2899
|
value: a.elements[c],
|
|
2896
2900
|
type: "number",
|
|
@@ -2906,7 +2910,7 @@ function wi(i) {
|
|
|
2906
2910
|
}
|
|
2907
2911
|
return /* @__PURE__ */ f("div", { className: "grid3", children: r }, Math.random().toString());
|
|
2908
2912
|
}
|
|
2909
|
-
function
|
|
2913
|
+
function Ur(i) {
|
|
2910
2914
|
const e = i.value.x !== void 0, t = i.step !== void 0 ? i.step : 0.01, s = [];
|
|
2911
2915
|
if (e) {
|
|
2912
2916
|
const n = Ze(() => i.value, []), r = (o, c) => {
|
|
@@ -2918,7 +2922,7 @@ function Ir(i) {
|
|
|
2918
2922
|
/* @__PURE__ */ M("div", { children: [
|
|
2919
2923
|
/* @__PURE__ */ f("label", { ref: c, children: o.toUpperCase() }),
|
|
2920
2924
|
/* @__PURE__ */ f(
|
|
2921
|
-
|
|
2925
|
+
Ce,
|
|
2922
2926
|
{
|
|
2923
2927
|
value: n[o],
|
|
2924
2928
|
type: "number",
|
|
@@ -2942,7 +2946,7 @@ function Ir(i) {
|
|
|
2942
2946
|
/* @__PURE__ */ M("div", { children: [
|
|
2943
2947
|
/* @__PURE__ */ f("span", { ref: o, children: a + 1 }),
|
|
2944
2948
|
/* @__PURE__ */ f(
|
|
2945
|
-
|
|
2949
|
+
Ce,
|
|
2946
2950
|
{
|
|
2947
2951
|
value: n.elements[a],
|
|
2948
2952
|
type: "number",
|
|
@@ -2958,10 +2962,10 @@ function Ir(i) {
|
|
|
2958
2962
|
}
|
|
2959
2963
|
return /* @__PURE__ */ f("div", { className: "grid4", children: s });
|
|
2960
2964
|
}
|
|
2961
|
-
function
|
|
2965
|
+
function Lr(i) {
|
|
2962
2966
|
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");
|
|
2963
2967
|
}
|
|
2964
|
-
function
|
|
2968
|
+
function kr(i) {
|
|
2965
2969
|
switch (i) {
|
|
2966
2970
|
case "Alpha Map":
|
|
2967
2971
|
return "alphaMap";
|
|
@@ -3213,11 +3217,11 @@ function Ct(i) {
|
|
|
3213
3217
|
}
|
|
3214
3218
|
return i;
|
|
3215
3219
|
}
|
|
3216
|
-
function
|
|
3220
|
+
function ds(i) {
|
|
3217
3221
|
const e = i.toLowerCase();
|
|
3218
3222
|
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";
|
|
3219
3223
|
}
|
|
3220
|
-
function
|
|
3224
|
+
function Nr() {
|
|
3221
3225
|
const i = document.createElement("input");
|
|
3222
3226
|
return i.type = "file", new Promise((e, t) => {
|
|
3223
3227
|
i.addEventListener("change", function() {
|
|
@@ -3232,69 +3236,69 @@ function kr() {
|
|
|
3232
3236
|
}), i.click();
|
|
3233
3237
|
});
|
|
3234
3238
|
}
|
|
3235
|
-
const
|
|
3239
|
+
const Fr = [
|
|
3236
3240
|
{
|
|
3237
3241
|
title: "Front",
|
|
3238
|
-
value:
|
|
3242
|
+
value: Ms
|
|
3239
3243
|
},
|
|
3240
3244
|
{
|
|
3241
3245
|
title: "Back",
|
|
3242
|
-
value:
|
|
3246
|
+
value: As
|
|
3243
3247
|
},
|
|
3244
3248
|
{
|
|
3245
3249
|
title: "Double",
|
|
3246
|
-
value:
|
|
3250
|
+
value: Yi
|
|
3247
3251
|
}
|
|
3248
|
-
],
|
|
3252
|
+
], zr = [
|
|
3249
3253
|
{
|
|
3250
3254
|
title: "No Blending",
|
|
3251
|
-
value:
|
|
3255
|
+
value: Ls
|
|
3252
3256
|
},
|
|
3253
3257
|
{
|
|
3254
3258
|
title: "Normal",
|
|
3255
|
-
value:
|
|
3259
|
+
value: $i
|
|
3256
3260
|
},
|
|
3257
3261
|
{
|
|
3258
3262
|
title: "Additive",
|
|
3259
|
-
value:
|
|
3263
|
+
value: ks
|
|
3260
3264
|
},
|
|
3261
3265
|
{
|
|
3262
3266
|
title: "Subtractive",
|
|
3263
|
-
value:
|
|
3267
|
+
value: Ns
|
|
3264
3268
|
},
|
|
3265
3269
|
{
|
|
3266
3270
|
title: "Multiply",
|
|
3267
|
-
value:
|
|
3271
|
+
value: Fs
|
|
3268
3272
|
},
|
|
3269
3273
|
{
|
|
3270
3274
|
title: "Custom",
|
|
3271
3275
|
value: _t
|
|
3272
3276
|
}
|
|
3273
|
-
],
|
|
3277
|
+
], Hr = [
|
|
3274
3278
|
{
|
|
3275
3279
|
title: "Add",
|
|
3276
3280
|
value: Je
|
|
3277
3281
|
},
|
|
3278
3282
|
{
|
|
3279
3283
|
title: "Subtract",
|
|
3280
|
-
value:
|
|
3284
|
+
value: Ps
|
|
3281
3285
|
},
|
|
3282
3286
|
{
|
|
3283
3287
|
title: "Reverse Subtract",
|
|
3284
|
-
value:
|
|
3288
|
+
value: Ds
|
|
3285
3289
|
},
|
|
3286
3290
|
{
|
|
3287
3291
|
title: "Min",
|
|
3288
|
-
value:
|
|
3292
|
+
value: Is
|
|
3289
3293
|
},
|
|
3290
3294
|
{
|
|
3291
3295
|
title: "Max",
|
|
3292
|
-
value:
|
|
3296
|
+
value: Us
|
|
3293
3297
|
}
|
|
3294
|
-
],
|
|
3298
|
+
], Br = [
|
|
3295
3299
|
{
|
|
3296
3300
|
title: "Zero",
|
|
3297
|
-
value:
|
|
3301
|
+
value: Zi
|
|
3298
3302
|
},
|
|
3299
3303
|
{
|
|
3300
3304
|
title: "One",
|
|
@@ -3302,11 +3306,11 @@ const Nr = [
|
|
|
3302
3306
|
},
|
|
3303
3307
|
{
|
|
3304
3308
|
title: "Src Color",
|
|
3305
|
-
value:
|
|
3309
|
+
value: qi
|
|
3306
3310
|
},
|
|
3307
3311
|
{
|
|
3308
3312
|
title: "One Minus Src Color",
|
|
3309
|
-
value:
|
|
3313
|
+
value: ji
|
|
3310
3314
|
},
|
|
3311
3315
|
{
|
|
3312
3316
|
title: "Src Alpha",
|
|
@@ -3318,11 +3322,11 @@ const Nr = [
|
|
|
3318
3322
|
},
|
|
3319
3323
|
{
|
|
3320
3324
|
title: "Dst Alpha",
|
|
3321
|
-
value:
|
|
3325
|
+
value: Ki
|
|
3322
3326
|
},
|
|
3323
3327
|
{
|
|
3324
3328
|
title: "One Minus Dst Alpha",
|
|
3325
|
-
value:
|
|
3329
|
+
value: Xi
|
|
3326
3330
|
},
|
|
3327
3331
|
{
|
|
3328
3332
|
title: "Dst Color",
|
|
@@ -3334,28 +3338,28 @@ const Nr = [
|
|
|
3334
3338
|
},
|
|
3335
3339
|
{
|
|
3336
3340
|
title: "Src Alpha Saturate",
|
|
3337
|
-
value:
|
|
3341
|
+
value: Rs
|
|
3338
3342
|
},
|
|
3339
3343
|
{
|
|
3340
3344
|
title: "Constant Color",
|
|
3341
|
-
value:
|
|
3345
|
+
value: Qi
|
|
3342
3346
|
},
|
|
3343
3347
|
{
|
|
3344
3348
|
title: "One Minus Constant Color",
|
|
3345
|
-
value:
|
|
3349
|
+
value: Ji
|
|
3346
3350
|
},
|
|
3347
3351
|
{
|
|
3348
3352
|
title: "Constant Alpha",
|
|
3349
|
-
value:
|
|
3353
|
+
value: es
|
|
3350
3354
|
},
|
|
3351
3355
|
{
|
|
3352
3356
|
title: "One Minus Constant Alpha",
|
|
3353
|
-
value:
|
|
3357
|
+
value: ts
|
|
3354
3358
|
}
|
|
3355
|
-
],
|
|
3359
|
+
], Vr = [
|
|
3356
3360
|
{
|
|
3357
3361
|
title: "Zero",
|
|
3358
|
-
value:
|
|
3362
|
+
value: Zi
|
|
3359
3363
|
},
|
|
3360
3364
|
{
|
|
3361
3365
|
title: "One",
|
|
@@ -3363,11 +3367,11 @@ const Nr = [
|
|
|
3363
3367
|
},
|
|
3364
3368
|
{
|
|
3365
3369
|
title: "Src Color",
|
|
3366
|
-
value:
|
|
3370
|
+
value: qi
|
|
3367
3371
|
},
|
|
3368
3372
|
{
|
|
3369
3373
|
title: "One Minus Src Color",
|
|
3370
|
-
value:
|
|
3374
|
+
value: ji
|
|
3371
3375
|
},
|
|
3372
3376
|
{
|
|
3373
3377
|
title: "Src Alpha",
|
|
@@ -3379,11 +3383,11 @@ const Nr = [
|
|
|
3379
3383
|
},
|
|
3380
3384
|
{
|
|
3381
3385
|
title: "Dst Alpha",
|
|
3382
|
-
value:
|
|
3386
|
+
value: Ki
|
|
3383
3387
|
},
|
|
3384
3388
|
{
|
|
3385
3389
|
title: "One Minus Dst Alpha",
|
|
3386
|
-
value:
|
|
3390
|
+
value: Xi
|
|
3387
3391
|
},
|
|
3388
3392
|
{
|
|
3389
3393
|
title: "Dst Color",
|
|
@@ -3395,25 +3399,25 @@ const Nr = [
|
|
|
3395
3399
|
},
|
|
3396
3400
|
{
|
|
3397
3401
|
title: "Constant Color",
|
|
3398
|
-
value:
|
|
3402
|
+
value: Qi
|
|
3399
3403
|
},
|
|
3400
3404
|
{
|
|
3401
3405
|
title: "One Minus Constant Color",
|
|
3402
|
-
value:
|
|
3406
|
+
value: Ji
|
|
3403
3407
|
},
|
|
3404
3408
|
{
|
|
3405
3409
|
title: "Constant Alpha",
|
|
3406
|
-
value:
|
|
3410
|
+
value: es
|
|
3407
3411
|
},
|
|
3408
3412
|
{
|
|
3409
3413
|
title: "One Minus Constant Alpha",
|
|
3410
|
-
value:
|
|
3414
|
+
value: ts
|
|
3411
3415
|
}
|
|
3412
3416
|
];
|
|
3413
3417
|
function Ne(i, e) {
|
|
3414
3418
|
i.needsUpdate = !0, i.type = "option", i.options = e;
|
|
3415
3419
|
}
|
|
3416
|
-
function
|
|
3420
|
+
function Gr(i, e, t, s) {
|
|
3417
3421
|
return {
|
|
3418
3422
|
type: "boolean",
|
|
3419
3423
|
title: Ct(i),
|
|
@@ -3430,7 +3434,7 @@ function Vr(i, e, t, s) {
|
|
|
3430
3434
|
}
|
|
3431
3435
|
};
|
|
3432
3436
|
}
|
|
3433
|
-
function
|
|
3437
|
+
function $r(i, e, t, s) {
|
|
3434
3438
|
const n = {
|
|
3435
3439
|
type: "number",
|
|
3436
3440
|
title: Ct(i),
|
|
@@ -3451,24 +3455,24 @@ function Gr(i, e, t, s) {
|
|
|
3451
3455
|
};
|
|
3452
3456
|
switch (i) {
|
|
3453
3457
|
case "blending":
|
|
3454
|
-
Ne(n,
|
|
3458
|
+
Ne(n, zr);
|
|
3455
3459
|
break;
|
|
3456
3460
|
case "blendDst":
|
|
3457
|
-
Ne(n,
|
|
3461
|
+
Ne(n, Vr);
|
|
3458
3462
|
break;
|
|
3459
3463
|
case "blendEquation":
|
|
3460
|
-
Ne(n,
|
|
3464
|
+
Ne(n, Hr);
|
|
3461
3465
|
break;
|
|
3462
3466
|
case "blendSrc":
|
|
3463
|
-
Ne(n,
|
|
3467
|
+
Ne(n, Br);
|
|
3464
3468
|
break;
|
|
3465
3469
|
case "side":
|
|
3466
|
-
Ne(n,
|
|
3470
|
+
Ne(n, Fr);
|
|
3467
3471
|
break;
|
|
3468
3472
|
}
|
|
3469
|
-
return
|
|
3473
|
+
return ds(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;
|
|
3470
3474
|
}
|
|
3471
|
-
function
|
|
3475
|
+
function Wr(i, e, t, s) {
|
|
3472
3476
|
const n = {
|
|
3473
3477
|
type: "string",
|
|
3474
3478
|
title: Ct(i),
|
|
@@ -3504,13 +3508,13 @@ function $r(i, e, t, s) {
|
|
|
3504
3508
|
}
|
|
3505
3509
|
}), n;
|
|
3506
3510
|
}
|
|
3507
|
-
function
|
|
3511
|
+
function Yr(i) {
|
|
3508
3512
|
return i.x !== void 0 && i.y !== void 0 && i.z === void 0;
|
|
3509
3513
|
}
|
|
3510
|
-
function
|
|
3514
|
+
function Zr(i) {
|
|
3511
3515
|
return i.x !== void 0 && i.y !== void 0 && i.z !== void 0 && i.w === void 0;
|
|
3512
3516
|
}
|
|
3513
|
-
function
|
|
3517
|
+
function qr(i) {
|
|
3514
3518
|
return i.x !== void 0 && i.y !== void 0 && i.z !== void 0 && i.w !== void 0;
|
|
3515
3519
|
}
|
|
3516
3520
|
function Kt(i) {
|
|
@@ -3548,12 +3552,12 @@ function Ue(i, e, t, s, n = "", r = !1) {
|
|
|
3548
3552
|
s.updateObject(t.uuid, `material.${o}`, d);
|
|
3549
3553
|
const u = s.getScene(t.uuid);
|
|
3550
3554
|
if (u !== null) {
|
|
3551
|
-
const
|
|
3552
|
-
V(
|
|
3555
|
+
const p = u.getObjectByProperty("uuid", t.uuid);
|
|
3556
|
+
V(p, `material.${o}`, d);
|
|
3553
3557
|
}
|
|
3554
3558
|
}
|
|
3555
3559
|
};
|
|
3556
|
-
return
|
|
3560
|
+
return ds(a) && (l.type = "range", l.min = 0, l.max = 1), l;
|
|
3557
3561
|
} else {
|
|
3558
3562
|
if (e.isColor)
|
|
3559
3563
|
return {
|
|
@@ -3567,8 +3571,8 @@ function Ue(i, e, t, s, n = "", r = !1) {
|
|
|
3567
3571
|
s.updateObject(t.uuid, `material.${o}`, d);
|
|
3568
3572
|
const u = s.getScene(t.uuid);
|
|
3569
3573
|
if (u !== null) {
|
|
3570
|
-
const
|
|
3571
|
-
V(
|
|
3574
|
+
const p = u.getObjectByProperty("uuid", t.uuid);
|
|
3575
|
+
V(p, `material.${o}`, d);
|
|
3572
3576
|
}
|
|
3573
3577
|
}
|
|
3574
3578
|
};
|
|
@@ -3577,11 +3581,11 @@ function Ue(i, e, t, s, n = "", r = !1) {
|
|
|
3577
3581
|
for (const h in e) {
|
|
3578
3582
|
const d = e[h], u = `[${h.toString()}]`;
|
|
3579
3583
|
if (d.value !== void 0) {
|
|
3580
|
-
const
|
|
3581
|
-
|
|
3584
|
+
const p = Ue(`${u}.value`, d.value, t, s, o, r);
|
|
3585
|
+
p !== void 0 && l.push(p);
|
|
3582
3586
|
} else {
|
|
3583
|
-
const
|
|
3584
|
-
|
|
3587
|
+
const p = Ue(u, d, t, s, o, r);
|
|
3588
|
+
p !== void 0 && l.push(p);
|
|
3585
3589
|
}
|
|
3586
3590
|
}
|
|
3587
3591
|
if (l.length > 0)
|
|
@@ -3590,7 +3594,7 @@ function Ue(i, e, t, s, n = "", r = !1) {
|
|
|
3590
3594
|
items: l
|
|
3591
3595
|
};
|
|
3592
3596
|
} else {
|
|
3593
|
-
if (
|
|
3597
|
+
if (Yr(e))
|
|
3594
3598
|
return {
|
|
3595
3599
|
title: a,
|
|
3596
3600
|
prop: o,
|
|
@@ -3606,7 +3610,7 @@ function Ue(i, e, t, s, n = "", r = !1) {
|
|
|
3606
3610
|
}
|
|
3607
3611
|
}
|
|
3608
3612
|
};
|
|
3609
|
-
if (
|
|
3613
|
+
if (Zr(e))
|
|
3610
3614
|
return {
|
|
3611
3615
|
title: a,
|
|
3612
3616
|
prop: o,
|
|
@@ -3622,7 +3626,7 @@ function Ue(i, e, t, s, n = "", r = !1) {
|
|
|
3622
3626
|
}
|
|
3623
3627
|
}
|
|
3624
3628
|
};
|
|
3625
|
-
if (
|
|
3629
|
+
if (qr(e))
|
|
3626
3630
|
return {
|
|
3627
3631
|
title: a,
|
|
3628
3632
|
prop: o,
|
|
@@ -3661,11 +3665,11 @@ function Ue(i, e, t, s, n = "", r = !1) {
|
|
|
3661
3665
|
value: e,
|
|
3662
3666
|
disabled: r,
|
|
3663
3667
|
onChange: (l, h) => {
|
|
3664
|
-
const d =
|
|
3668
|
+
const d = kr(i), u = n.length > 0 ? `${n}.${d}` : d;
|
|
3665
3669
|
s.createTexture(t.uuid, `material.${u}`, h);
|
|
3666
|
-
const
|
|
3667
|
-
if (
|
|
3668
|
-
const y =
|
|
3670
|
+
const p = s.getScene(t.uuid);
|
|
3671
|
+
if (p !== null) {
|
|
3672
|
+
const y = p.getObjectByProperty("uuid", t.uuid);
|
|
3669
3673
|
if (y !== void 0) {
|
|
3670
3674
|
const v = (C) => {
|
|
3671
3675
|
const g = y.material, _ = u.split(".");
|
|
@@ -3688,7 +3692,7 @@ function Ue(i, e, t, s, n = "", r = !1) {
|
|
|
3688
3692
|
}
|
|
3689
3693
|
g.needsUpdate = !0;
|
|
3690
3694
|
};
|
|
3691
|
-
h.src.length > 0 ?
|
|
3695
|
+
h.src.length > 0 ? ls(h.src).then((C) => {
|
|
3692
3696
|
C.offset.set(h.offset[0], h.offset[1]), C.repeat.set(h.repeat[0], h.repeat[1]), v(C);
|
|
3693
3697
|
}) : v(null);
|
|
3694
3698
|
}
|
|
@@ -3718,11 +3722,11 @@ function Ue(i, e, t, s, n = "", r = !1) {
|
|
|
3718
3722
|
const u = e[d];
|
|
3719
3723
|
if (u !== void 0)
|
|
3720
3724
|
if (u.value !== void 0) {
|
|
3721
|
-
const
|
|
3722
|
-
|
|
3725
|
+
const p = Ue(`${d}.value`, u.value, t, s, o, h);
|
|
3726
|
+
p !== void 0 && l.push(p);
|
|
3723
3727
|
} else {
|
|
3724
|
-
const
|
|
3725
|
-
|
|
3728
|
+
const p = Ue(d, u, t, s, o, h);
|
|
3729
|
+
p !== void 0 && l.push(p);
|
|
3726
3730
|
}
|
|
3727
3731
|
}
|
|
3728
3732
|
} catch {
|
|
@@ -3740,15 +3744,15 @@ function Ue(i, e, t, s, n = "", r = !1) {
|
|
|
3740
3744
|
function xi(i, e, t) {
|
|
3741
3745
|
const s = [];
|
|
3742
3746
|
for (const n in i) {
|
|
3743
|
-
if (!
|
|
3747
|
+
if (!Lr(n) || n.search("Node") > -1 || i[n] instanceof sn)
|
|
3744
3748
|
continue;
|
|
3745
3749
|
const r = typeof i[n], a = i[n];
|
|
3746
3750
|
if (r === "boolean")
|
|
3747
|
-
s.push(Vr(n, a, e, t));
|
|
3748
|
-
else if (r === "number")
|
|
3749
3751
|
s.push(Gr(n, a, e, t));
|
|
3750
|
-
else if (r === "
|
|
3752
|
+
else if (r === "number")
|
|
3751
3753
|
s.push($r(n, a, e, t));
|
|
3754
|
+
else if (r === "string")
|
|
3755
|
+
s.push(Wr(n, a, e, t));
|
|
3752
3756
|
else if (r === "object") {
|
|
3753
3757
|
const o = Ue(n, a, e, t);
|
|
3754
3758
|
o !== void 0 && s.push(o);
|
|
@@ -3767,7 +3771,7 @@ function xi(i, e, t) {
|
|
|
3767
3771
|
}
|
|
3768
3772
|
}), s;
|
|
3769
3773
|
}
|
|
3770
|
-
function
|
|
3774
|
+
function jr(i, e) {
|
|
3771
3775
|
function t() {
|
|
3772
3776
|
return `${e.name}_material`;
|
|
3773
3777
|
}
|
|
@@ -3790,7 +3794,7 @@ function qr(i, e) {
|
|
|
3790
3794
|
`Material ${l}`
|
|
3791
3795
|
)
|
|
3792
3796
|
);
|
|
3793
|
-
return /* @__PURE__ */ f(
|
|
3797
|
+
return /* @__PURE__ */ f(Y, { children: o });
|
|
3794
3798
|
} else
|
|
3795
3799
|
return /* @__PURE__ */ f(
|
|
3796
3800
|
X,
|
|
@@ -3806,8 +3810,8 @@ function qr(i, e) {
|
|
|
3806
3810
|
);
|
|
3807
3811
|
}
|
|
3808
3812
|
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==";
|
|
3809
|
-
function
|
|
3810
|
-
const e = i.step !== void 0 ? i.step : 0.01, t = z(null), s = z(null), n = z(null), r = z(null), a = z(null), [o] = L(i.value), [c, l] = L(i.value.offset[0]), [h, d] = L(i.value.offset[1]), [u,
|
|
3813
|
+
function Kr(i) {
|
|
3814
|
+
const e = i.step !== void 0 ? i.step : 0.01, t = z(null), s = z(null), n = z(null), r = z(null), a = z(null), [o] = L(i.value), [c, l] = L(i.value.offset[0]), [h, d] = L(i.value.offset[1]), [u, p] = L(i.value.repeat[0]), [y, v] = L(i.value.repeat[1]);
|
|
3811
3815
|
function C(_, E, S, b, O) {
|
|
3812
3816
|
if (i.onChange !== void 0) {
|
|
3813
3817
|
const w = i.prop !== void 0 ? i.prop : i.title;
|
|
@@ -3828,7 +3832,7 @@ function jr(i) {
|
|
|
3828
3832
|
d(S), C(E, c, S, u, y);
|
|
3829
3833
|
break;
|
|
3830
3834
|
case r.current:
|
|
3831
|
-
|
|
3835
|
+
p(S), C(E, c, h, S, y);
|
|
3832
3836
|
break;
|
|
3833
3837
|
case a.current:
|
|
3834
3838
|
v(S), C(E, c, h, u, S);
|
|
@@ -3837,7 +3841,7 @@ function jr(i) {
|
|
|
3837
3841
|
}
|
|
3838
3842
|
return /* @__PURE__ */ M("div", { className: "imageField", children: [
|
|
3839
3843
|
/* @__PURE__ */ f("img", { alt: i.title, ref: t, onClick: () => {
|
|
3840
|
-
|
|
3844
|
+
Nr().then((_) => {
|
|
3841
3845
|
t.current.src = _, C(_, c, h, u, y);
|
|
3842
3846
|
});
|
|
3843
3847
|
}, src: o.src.length > 0 ? o.src : Ti }),
|
|
@@ -3952,7 +3956,7 @@ function ht(i) {
|
|
|
3952
3956
|
}
|
|
3953
3957
|
),
|
|
3954
3958
|
i.type === "number" && /* @__PURE__ */ f(
|
|
3955
|
-
|
|
3959
|
+
Ce,
|
|
3956
3960
|
{
|
|
3957
3961
|
value: t,
|
|
3958
3962
|
type: i.type,
|
|
@@ -3966,7 +3970,7 @@ function ht(i) {
|
|
|
3966
3970
|
}
|
|
3967
3971
|
),
|
|
3968
3972
|
i.type === "range" && /* @__PURE__ */ f(
|
|
3969
|
-
|
|
3973
|
+
Ce,
|
|
3970
3974
|
{
|
|
3971
3975
|
value: t,
|
|
3972
3976
|
type: i.type,
|
|
@@ -3979,7 +3983,7 @@ function ht(i) {
|
|
|
3979
3983
|
onChange: i.onChange
|
|
3980
3984
|
}
|
|
3981
3985
|
),
|
|
3982
|
-
i.type === "color" && /* @__PURE__ */ M(
|
|
3986
|
+
i.type === "color" && /* @__PURE__ */ M(Y, { children: [
|
|
3983
3987
|
/* @__PURE__ */ f("input", { type: "text", value: t.toString(), onChange: r, disabled: i.disabled, className: "color", name: W() }),
|
|
3984
3988
|
/* @__PURE__ */ f("input", { type: "color", value: t, onChange: r, disabled: i.disabled, name: W() })
|
|
3985
3989
|
] }),
|
|
@@ -3993,8 +3997,8 @@ function ht(i) {
|
|
|
3993
3997
|
children: i.title
|
|
3994
3998
|
}
|
|
3995
3999
|
),
|
|
3996
|
-
i.type === "image" && /* @__PURE__ */ f(
|
|
3997
|
-
i.type === "option" && /* @__PURE__ */ f(
|
|
4000
|
+
i.type === "image" && /* @__PURE__ */ f(Kr, { title: i.title, prop: i.prop, value: i.value, onChange: i.onChange }),
|
|
4001
|
+
i.type === "option" && /* @__PURE__ */ f(Y, { children: /* @__PURE__ */ f(
|
|
3998
4002
|
"select",
|
|
3999
4003
|
{
|
|
4000
4004
|
onChange: r,
|
|
@@ -4004,13 +4008,13 @@ function ht(i) {
|
|
|
4004
4008
|
children: i.options?.map((l, h) => /* @__PURE__ */ f("option", { value: l.value, children: mt(l.title) }, h))
|
|
4005
4009
|
}
|
|
4006
4010
|
) }),
|
|
4007
|
-
i.type === "vector2" && /* @__PURE__ */ f(
|
|
4011
|
+
i.type === "vector2" && /* @__PURE__ */ f(Ir, { step: i.step, value: t, min: 0, max: 1, onChange: r }),
|
|
4008
4012
|
i.type === "grid3" && /* @__PURE__ */ f(wi, { step: i.step, value: t, onChange: r }),
|
|
4009
|
-
i.type === "grid4" && /* @__PURE__ */ f(
|
|
4013
|
+
i.type === "grid4" && /* @__PURE__ */ f(Ur, { step: i.step, value: t, onChange: r }),
|
|
4010
4014
|
i.type === "euler" && /* @__PURE__ */ f(wi, { step: i.step, value: t, onChange: r })
|
|
4011
4015
|
] });
|
|
4012
4016
|
}
|
|
4013
|
-
function
|
|
4017
|
+
function Xr(i) {
|
|
4014
4018
|
return "items" in i;
|
|
4015
4019
|
}
|
|
4016
4020
|
class X extends Qe {
|
|
@@ -4068,7 +4072,7 @@ class X extends Qe {
|
|
|
4068
4072
|
render() {
|
|
4069
4073
|
const e = [];
|
|
4070
4074
|
return this.props.items.forEach((t) => {
|
|
4071
|
-
if (
|
|
4075
|
+
if (Xr(t))
|
|
4072
4076
|
e.push(
|
|
4073
4077
|
/* @__PURE__ */ f(X, { three: this.props.three, title: mt(t.title), items: t.items }, t.title)
|
|
4074
4078
|
);
|
|
@@ -4267,7 +4271,7 @@ function Mi(i) {
|
|
|
4267
4271
|
}
|
|
4268
4272
|
return i;
|
|
4269
4273
|
}
|
|
4270
|
-
function
|
|
4274
|
+
function Qr(i, e) {
|
|
4271
4275
|
function t() {
|
|
4272
4276
|
return `${e.name}_camera`;
|
|
4273
4277
|
}
|
|
@@ -4333,7 +4337,7 @@ const H = {
|
|
|
4333
4337
|
LEFT: 1,
|
|
4334
4338
|
RIGHT: 2,
|
|
4335
4339
|
MIDDLE: 4
|
|
4336
|
-
},
|
|
4340
|
+
}, m = Object.freeze({
|
|
4337
4341
|
NONE: 0,
|
|
4338
4342
|
ROTATE: 1,
|
|
4339
4343
|
TRUCK: 2,
|
|
@@ -4360,20 +4364,20 @@ const H = {
|
|
|
4360
4364
|
IN: 1,
|
|
4361
4365
|
OUT: -1
|
|
4362
4366
|
};
|
|
4363
|
-
function
|
|
4367
|
+
function ge(i) {
|
|
4364
4368
|
return i.isPerspectiveCamera;
|
|
4365
4369
|
}
|
|
4366
4370
|
function de(i) {
|
|
4367
4371
|
return i.isOrthographicCamera;
|
|
4368
4372
|
}
|
|
4369
|
-
const Pe = Math.PI * 2, Ai = Math.PI / 2,
|
|
4373
|
+
const Pe = Math.PI * 2, Ai = Math.PI / 2, us = 1e-5, Fe = Math.PI / 180;
|
|
4370
4374
|
function J(i, e, t) {
|
|
4371
4375
|
return Math.max(e, Math.min(t, i));
|
|
4372
4376
|
}
|
|
4373
|
-
function F(i, e =
|
|
4377
|
+
function F(i, e = us) {
|
|
4374
4378
|
return Math.abs(i) < e;
|
|
4375
4379
|
}
|
|
4376
|
-
function k(i, e, t =
|
|
4380
|
+
function k(i, e, t = us) {
|
|
4377
4381
|
return F(i - e, t);
|
|
4378
4382
|
}
|
|
4379
4383
|
function Ri(i, e) {
|
|
@@ -4393,23 +4397,23 @@ function rt(i, e, t, s, n = 1 / 0, r) {
|
|
|
4393
4397
|
l = J(l, -d, d), e = i - l;
|
|
4394
4398
|
const u = (t.value + a * l) * r;
|
|
4395
4399
|
t.value = (t.value - a * u) * c;
|
|
4396
|
-
let
|
|
4397
|
-
return h - i > 0 ==
|
|
4400
|
+
let p = e + (l + u) * c;
|
|
4401
|
+
return h - i > 0 == p > h && (p = h, t.value = (p - h) / r), p;
|
|
4398
4402
|
}
|
|
4399
4403
|
function Pi(i, e, t, s, n = 1 / 0, r, a) {
|
|
4400
4404
|
s = Math.max(1e-4, s);
|
|
4401
4405
|
const o = 2 / s, c = o * r, l = 1 / (1 + c + 0.48 * c * c + 0.235 * c * c * c);
|
|
4402
|
-
let h = e.x, d = e.y, u = e.z,
|
|
4403
|
-
const C = h, g = d, _ = u, E = n * s, S = E * E, b =
|
|
4406
|
+
let h = e.x, d = e.y, u = e.z, p = i.x - h, y = i.y - d, v = i.z - u;
|
|
4407
|
+
const C = h, g = d, _ = u, E = n * s, S = E * E, b = p * p + y * y + v * v;
|
|
4404
4408
|
if (b > S) {
|
|
4405
|
-
const
|
|
4406
|
-
|
|
4409
|
+
const fe = Math.sqrt(b);
|
|
4410
|
+
p = p / fe * E, y = y / fe * E, v = v / fe * E;
|
|
4407
4411
|
}
|
|
4408
|
-
h = i.x -
|
|
4409
|
-
const O = (t.x + o *
|
|
4410
|
-
t.x = (t.x - o * O) * l, t.y = (t.y - o * w) * l, t.z = (t.z - o * D) * l, a.x = h + (
|
|
4411
|
-
const x = C - i.x, N = g - i.y, Q = _ - i.z, oe = a.x - C,
|
|
4412
|
-
return x * oe + N *
|
|
4412
|
+
h = i.x - p, d = i.y - y, u = i.z - v;
|
|
4413
|
+
const O = (t.x + o * p) * r, w = (t.y + o * y) * r, D = (t.z + o * v) * r;
|
|
4414
|
+
t.x = (t.x - o * O) * l, t.y = (t.y - o * w) * l, t.z = (t.z - o * D) * l, a.x = h + (p + O) * l, a.y = d + (y + w) * l, a.z = u + (v + D) * l;
|
|
4415
|
+
const x = C - i.x, N = g - i.y, Q = _ - i.z, oe = a.x - C, me = a.y - g, be = a.z - _;
|
|
4416
|
+
return x * oe + N * me + Q * be > 0 && (a.x = C, a.y = g, a.z = _, t.x = (a.x - C) / r, t.y = (a.y - g) / r, t.z = (a.z - _) / r), a;
|
|
4413
4417
|
}
|
|
4414
4418
|
function Dt(i, e) {
|
|
4415
4419
|
e.set(0, 0), i.forEach((t) => {
|
|
@@ -4419,7 +4423,7 @@ function Dt(i, e) {
|
|
|
4419
4423
|
function It(i, e) {
|
|
4420
4424
|
return de(i) ? (console.warn(`${e} is not supported in OrthographicCamera`), !0) : !1;
|
|
4421
4425
|
}
|
|
4422
|
-
class
|
|
4426
|
+
class Jr {
|
|
4423
4427
|
constructor() {
|
|
4424
4428
|
this._listeners = {};
|
|
4425
4429
|
}
|
|
@@ -4484,9 +4488,9 @@ class Qr {
|
|
|
4484
4488
|
}
|
|
4485
4489
|
}
|
|
4486
4490
|
var Ut;
|
|
4487
|
-
const
|
|
4488
|
-
let T, Di, ot, Lt,
|
|
4489
|
-
class ae extends
|
|
4491
|
+
const ea = "2.10.1", at = 1 / 8, ta = /Mac/.test((Ut = globalThis?.navigator) === null || Ut === void 0 ? void 0 : Ut.platform);
|
|
4492
|
+
let T, Di, ot, Lt, q, A, U, De, Be, se, ne, ve, Ii, Ui, K, Ve, Ie, Li, kt, ki, Nt, Ft, lt;
|
|
4493
|
+
class ae extends Jr {
|
|
4490
4494
|
/**
|
|
4491
4495
|
* Injects THREE as the dependency. You can then proceed to use CameraControls.
|
|
4492
4496
|
*
|
|
@@ -4528,14 +4532,14 @@ class ae extends Qr {
|
|
|
4528
4532
|
* @category Statics
|
|
4529
4533
|
*/
|
|
4530
4534
|
static install(e) {
|
|
4531
|
-
T = e.THREE, Di = 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)),
|
|
4535
|
+
T = e.THREE, Di = 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)), q = new T.Vector2(), A = new T.Vector3(), U = new T.Vector3(), De = new T.Vector3(), Be = new T.Vector3(), se = new T.Vector3(), ne = new T.Vector3(), ve = new T.Vector3(), Ii = new T.Vector3(), Ui = new T.Vector3(), K = new T.Spherical(), Ve = new T.Spherical(), Ie = new T.Box3(), Li = new T.Box3(), kt = new T.Sphere(), ki = new T.Quaternion(), Nt = new T.Quaternion(), Ft = new T.Matrix4(), lt = new T.Raycaster();
|
|
4532
4536
|
}
|
|
4533
4537
|
/**
|
|
4534
4538
|
* list all ACTIONs
|
|
4535
4539
|
* @category Statics
|
|
4536
4540
|
*/
|
|
4537
4541
|
static get ACTION() {
|
|
4538
|
-
return
|
|
4542
|
+
return m;
|
|
4539
4543
|
}
|
|
4540
4544
|
/**
|
|
4541
4545
|
* @deprecated Use `cameraControls.mouseButtons.left = CameraControls.ACTION.SCREEN_PAN` instead.
|
|
@@ -4562,9 +4566,9 @@ class ae extends Qr {
|
|
|
4562
4566
|
*/
|
|
4563
4567
|
constructor(e, t) {
|
|
4564
4568
|
super(), this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.minDistance = Number.EPSILON, this.maxDistance = 1 / 0, this.infinityDolly = !1, this.minZoom = 0.01, this.maxZoom = 1 / 0, this.smoothTime = 0.25, this.draggingSmoothTime = 0.125, this.maxSpeed = 1 / 0, this.azimuthRotateSpeed = 1, this.polarRotateSpeed = 1, this.dollySpeed = 1, this.dollyDragInverted = !1, this.truckSpeed = 2, this.dollyToCursor = !1, this.dragToOffset = !1, this.boundaryFriction = 0, this.restThreshold = 0.01, this.colliderMeshes = [], this.cancel = () => {
|
|
4565
|
-
}, this._enabled = !0, this._state =
|
|
4569
|
+
}, this._enabled = !0, this._state = m.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) => {
|
|
4566
4570
|
let b, O;
|
|
4567
|
-
if (
|
|
4571
|
+
if (ge(this._camera)) {
|
|
4568
4572
|
const w = A.copy(this._camera.position).sub(this._target), D = this._camera.getEffectiveFOV() * Fe, x = w.length() * Math.tan(D * 0.5);
|
|
4569
4573
|
b = this.truckSpeed * g * x / this._elementRect.height, O = this.truckSpeed * _ * x / this._elementRect.height;
|
|
4570
4574
|
} else if (de(this._camera)) {
|
|
@@ -4582,20 +4586,20 @@ class ae extends Qr {
|
|
|
4582
4586
|
}, this._zoomInternal = (g, _, E) => {
|
|
4583
4587
|
const S = Math.pow(0.95, g * this.dollySpeed), b = this._zoom, O = this._zoom * S;
|
|
4584
4588
|
this.zoomTo(O, !0), this.dollyToCursor && (this._changedZoom += O - b, this._dollyControlCoord.set(_, E));
|
|
4585
|
-
}, typeof T > "u" && console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."), this._camera = e, this._yAxisUpSpace = new T.Quaternion().setFromUnitVectors(this._camera.up, ot), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state =
|
|
4589
|
+
}, typeof T > "u" && console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."), this._camera = e, this._yAxisUpSpace = new T.Quaternion().setFromUnitVectors(this._camera.up, ot), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state = m.NONE, this._target = new T.Vector3(), this._targetEnd = this._target.clone(), this._focalOffset = new T.Vector3(), this._focalOffsetEnd = this._focalOffset.clone(), this._spherical = new T.Spherical().setFromVector3(A.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)), this._sphericalEnd = this._spherical.clone(), this._lastDistance = this._spherical.radius, this._zoom = this._camera.zoom, this._zoomEnd = this._zoom, this._lastZoom = this._zoom, this._nearPlaneCorners = [
|
|
4586
4590
|
new T.Vector3(),
|
|
4587
4591
|
new T.Vector3(),
|
|
4588
4592
|
new T.Vector3(),
|
|
4589
4593
|
new T.Vector3()
|
|
4590
4594
|
], this._updateNearPlaneCorners(), this._boundary = new T.Box3(new T.Vector3(-1 / 0, -1 / 0, -1 / 0), new T.Vector3(1 / 0, 1 / 0, 1 / 0)), this._cameraUp0 = this._camera.up.clone(), this._target0 = this._target.clone(), this._position0 = this._camera.position.clone(), this._zoom0 = this._zoom, this._focalOffset0 = this._focalOffset.clone(), this._dollyControlCoord = new T.Vector2(), this.mouseButtons = {
|
|
4591
|
-
left:
|
|
4592
|
-
middle:
|
|
4593
|
-
right:
|
|
4594
|
-
wheel:
|
|
4595
|
+
left: m.ROTATE,
|
|
4596
|
+
middle: m.DOLLY,
|
|
4597
|
+
right: m.TRUCK,
|
|
4598
|
+
wheel: ge(this._camera) ? m.DOLLY : de(this._camera) ? m.ZOOM : m.NONE
|
|
4595
4599
|
}, this.touches = {
|
|
4596
|
-
one:
|
|
4597
|
-
two:
|
|
4598
|
-
three:
|
|
4600
|
+
one: m.TOUCH_ROTATE,
|
|
4601
|
+
two: ge(this._camera) ? m.TOUCH_DOLLY_TRUCK : de(this._camera) ? m.TOUCH_ZOOM_TRUCK : m.NONE,
|
|
4602
|
+
three: m.TOUCH_TRUCK
|
|
4599
4603
|
};
|
|
4600
4604
|
const s = new T.Vector2(), n = new T.Vector2(), r = new T.Vector2(), a = (g) => {
|
|
4601
4605
|
if (!this._enabled || !this._domElement)
|
|
@@ -4639,7 +4643,7 @@ class ae extends Qr {
|
|
|
4639
4643
|
}
|
|
4640
4644
|
else
|
|
4641
4645
|
(!this._isDragging && this._lockedPointer || this._isDragging && (g.buttons & H.LEFT) === H.LEFT) && (this._state = this._state | this.mouseButtons.left), this._isDragging && (g.buttons & H.MIDDLE) === H.MIDDLE && (this._state = this._state | this.mouseButtons.middle), this._isDragging && (g.buttons & H.RIGHT) === H.RIGHT && (this._state = this._state | this.mouseButtons.right);
|
|
4642
|
-
|
|
4646
|
+
p();
|
|
4643
4647
|
}
|
|
4644
4648
|
}, c = (g) => {
|
|
4645
4649
|
const _ = this._findPointerById(g.pointerId);
|
|
@@ -4647,7 +4651,7 @@ class ae extends Qr {
|
|
|
4647
4651
|
if (_ && this._disposePointer(_), g.pointerType === "touch")
|
|
4648
4652
|
switch (this._activePointers.length) {
|
|
4649
4653
|
case 0:
|
|
4650
|
-
this._state =
|
|
4654
|
+
this._state = m.NONE;
|
|
4651
4655
|
break;
|
|
4652
4656
|
case 1:
|
|
4653
4657
|
this._state = this.touches.one;
|
|
@@ -4660,46 +4664,46 @@ class ae extends Qr {
|
|
|
4660
4664
|
break;
|
|
4661
4665
|
}
|
|
4662
4666
|
else
|
|
4663
|
-
this._state =
|
|
4667
|
+
this._state = m.NONE;
|
|
4664
4668
|
y();
|
|
4665
4669
|
}
|
|
4666
4670
|
};
|
|
4667
4671
|
let l = -1;
|
|
4668
4672
|
const h = (g) => {
|
|
4669
|
-
if (!this._domElement || !this._enabled || this.mouseButtons.wheel ===
|
|
4673
|
+
if (!this._domElement || !this._enabled || this.mouseButtons.wheel === m.NONE)
|
|
4670
4674
|
return;
|
|
4671
4675
|
if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
|
|
4672
4676
|
const O = this._domElement.getBoundingClientRect(), w = g.clientX / O.width, D = g.clientY / O.height;
|
|
4673
4677
|
if (w < this._interactiveArea.left || w > this._interactiveArea.right || D < this._interactiveArea.top || D > this._interactiveArea.bottom)
|
|
4674
4678
|
return;
|
|
4675
4679
|
}
|
|
4676
|
-
if (g.preventDefault(), this.dollyToCursor || this.mouseButtons.wheel ===
|
|
4680
|
+
if (g.preventDefault(), this.dollyToCursor || this.mouseButtons.wheel === m.ROTATE || this.mouseButtons.wheel === m.TRUCK) {
|
|
4677
4681
|
const O = performance.now();
|
|
4678
4682
|
l - O < 1e3 && this._getClientRect(this._elementRect), l = O;
|
|
4679
4683
|
}
|
|
4680
|
-
const _ =
|
|
4684
|
+
const _ = ta ? -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;
|
|
4681
4685
|
switch (this.mouseButtons.wheel) {
|
|
4682
|
-
case
|
|
4686
|
+
case m.ROTATE: {
|
|
4683
4687
|
this._rotateInternal(g.deltaX, g.deltaY), this._isUserControllingRotate = !0;
|
|
4684
4688
|
break;
|
|
4685
4689
|
}
|
|
4686
|
-
case
|
|
4690
|
+
case m.TRUCK: {
|
|
4687
4691
|
this._truckInternal(g.deltaX, g.deltaY, !1, !1), this._isUserControllingTruck = !0;
|
|
4688
4692
|
break;
|
|
4689
4693
|
}
|
|
4690
|
-
case
|
|
4694
|
+
case m.SCREEN_PAN: {
|
|
4691
4695
|
this._truckInternal(g.deltaX, g.deltaY, !1, !0), this._isUserControllingTruck = !0;
|
|
4692
4696
|
break;
|
|
4693
4697
|
}
|
|
4694
|
-
case
|
|
4698
|
+
case m.OFFSET: {
|
|
4695
4699
|
this._truckInternal(g.deltaX, g.deltaY, !0, !1), this._isUserControllingOffset = !0;
|
|
4696
4700
|
break;
|
|
4697
4701
|
}
|
|
4698
|
-
case
|
|
4702
|
+
case m.DOLLY: {
|
|
4699
4703
|
this._dollyInternal(-E, S, b), this._isUserControllingDolly = !0;
|
|
4700
4704
|
break;
|
|
4701
4705
|
}
|
|
4702
|
-
case
|
|
4706
|
+
case m.ZOOM: {
|
|
4703
4707
|
this._zoomInternal(-E, S, b), this._isUserControllingZoom = !0;
|
|
4704
4708
|
break;
|
|
4705
4709
|
}
|
|
@@ -4717,8 +4721,8 @@ class ae extends Qr {
|
|
|
4717
4721
|
}, u = (g) => {
|
|
4718
4722
|
if (!this._enabled)
|
|
4719
4723
|
return;
|
|
4720
|
-
if (Dt(this._activePointers,
|
|
4721
|
-
const E =
|
|
4724
|
+
if (Dt(this._activePointers, q), this._getClientRect(this._elementRect), s.copy(q), n.copy(q), this._activePointers.length >= 2) {
|
|
4725
|
+
const E = q.x - this._activePointers[1].clientX, S = q.y - this._activePointers[1].clientY, b = Math.sqrt(E * E + S * S);
|
|
4722
4726
|
r.set(0, b);
|
|
4723
4727
|
const O = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, w = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
|
|
4724
4728
|
n.set(O, w);
|
|
@@ -4739,25 +4743,25 @@ class ae extends Qr {
|
|
|
4739
4743
|
}
|
|
4740
4744
|
else
|
|
4741
4745
|
!this._lockedPointer && (g.buttons & H.LEFT) === H.LEFT && (this._state = this._state | this.mouseButtons.left), (g.buttons & H.MIDDLE) === H.MIDDLE && (this._state = this._state | this.mouseButtons.middle), (g.buttons & H.RIGHT) === H.RIGHT && (this._state = this._state | this.mouseButtons.right);
|
|
4742
|
-
((this._state &
|
|
4743
|
-
},
|
|
4746
|
+
((this._state & m.ROTATE) === m.ROTATE || (this._state & m.TOUCH_ROTATE) === m.TOUCH_ROTATE || (this._state & m.TOUCH_DOLLY_ROTATE) === m.TOUCH_DOLLY_ROTATE || (this._state & m.TOUCH_ZOOM_ROTATE) === m.TOUCH_ZOOM_ROTATE) && (this._sphericalEnd.theta = this._spherical.theta, this._sphericalEnd.phi = this._spherical.phi, this._thetaVelocity.value = 0, this._phiVelocity.value = 0), ((this._state & m.TRUCK) === m.TRUCK || (this._state & m.SCREEN_PAN) === m.SCREEN_PAN || (this._state & m.TOUCH_TRUCK) === m.TOUCH_TRUCK || (this._state & m.TOUCH_SCREEN_PAN) === m.TOUCH_SCREEN_PAN || (this._state & m.TOUCH_DOLLY_TRUCK) === m.TOUCH_DOLLY_TRUCK || (this._state & m.TOUCH_DOLLY_SCREEN_PAN) === m.TOUCH_DOLLY_SCREEN_PAN || (this._state & m.TOUCH_ZOOM_TRUCK) === m.TOUCH_ZOOM_TRUCK || (this._state & m.TOUCH_ZOOM_SCREEN_PAN) === m.TOUCH_DOLLY_SCREEN_PAN) && (this._targetEnd.copy(this._target), this._targetVelocity.set(0, 0, 0)), ((this._state & m.DOLLY) === m.DOLLY || (this._state & m.TOUCH_DOLLY) === m.TOUCH_DOLLY || (this._state & m.TOUCH_DOLLY_TRUCK) === m.TOUCH_DOLLY_TRUCK || (this._state & m.TOUCH_DOLLY_SCREEN_PAN) === m.TOUCH_DOLLY_SCREEN_PAN || (this._state & m.TOUCH_DOLLY_OFFSET) === m.TOUCH_DOLLY_OFFSET || (this._state & m.TOUCH_DOLLY_ROTATE) === m.TOUCH_DOLLY_ROTATE) && (this._sphericalEnd.radius = this._spherical.radius, this._radiusVelocity.value = 0), ((this._state & m.ZOOM) === m.ZOOM || (this._state & m.TOUCH_ZOOM) === m.TOUCH_ZOOM || (this._state & m.TOUCH_ZOOM_TRUCK) === m.TOUCH_ZOOM_TRUCK || (this._state & m.TOUCH_ZOOM_SCREEN_PAN) === m.TOUCH_ZOOM_SCREEN_PAN || (this._state & m.TOUCH_ZOOM_OFFSET) === m.TOUCH_ZOOM_OFFSET || (this._state & m.TOUCH_ZOOM_ROTATE) === m.TOUCH_ZOOM_ROTATE) && (this._zoomEnd = this._zoom, this._zoomVelocity.value = 0), ((this._state & m.OFFSET) === m.OFFSET || (this._state & m.TOUCH_OFFSET) === m.TOUCH_OFFSET || (this._state & m.TOUCH_DOLLY_OFFSET) === m.TOUCH_DOLLY_OFFSET || (this._state & m.TOUCH_ZOOM_OFFSET) === m.TOUCH_ZOOM_OFFSET) && (this._focalOffsetEnd.copy(this._focalOffset), this._focalOffsetVelocity.set(0, 0, 0)), this.dispatchEvent({ type: "controlstart" });
|
|
4747
|
+
}, p = () => {
|
|
4744
4748
|
if (!this._enabled || !this._dragNeedsUpdate)
|
|
4745
4749
|
return;
|
|
4746
|
-
this._dragNeedsUpdate = !1, Dt(this._activePointers,
|
|
4747
|
-
const _ = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, E = _ ? -_.deltaX : n.x -
|
|
4748
|
-
if (n.copy(
|
|
4750
|
+
this._dragNeedsUpdate = !1, Dt(this._activePointers, q);
|
|
4751
|
+
const _ = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, E = _ ? -_.deltaX : n.x - q.x, S = _ ? -_.deltaY : n.y - q.y;
|
|
4752
|
+
if (n.copy(q), ((this._state & m.ROTATE) === m.ROTATE || (this._state & m.TOUCH_ROTATE) === m.TOUCH_ROTATE || (this._state & m.TOUCH_DOLLY_ROTATE) === m.TOUCH_DOLLY_ROTATE || (this._state & m.TOUCH_ZOOM_ROTATE) === m.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(E, S), this._isUserControllingRotate = !0), (this._state & m.DOLLY) === m.DOLLY || (this._state & m.ZOOM) === m.ZOOM) {
|
|
4749
4753
|
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, w = this.dollyDragInverted ? -1 : 1;
|
|
4750
|
-
(this._state &
|
|
4754
|
+
(this._state & m.DOLLY) === m.DOLLY ? (this._dollyInternal(w * S * at, b, O), this._isUserControllingDolly = !0) : (this._zoomInternal(w * S * at, b, O), this._isUserControllingZoom = !0);
|
|
4751
4755
|
}
|
|
4752
|
-
if ((this._state &
|
|
4753
|
-
const b =
|
|
4756
|
+
if ((this._state & m.TOUCH_DOLLY) === m.TOUCH_DOLLY || (this._state & m.TOUCH_ZOOM) === m.TOUCH_ZOOM || (this._state & m.TOUCH_DOLLY_TRUCK) === m.TOUCH_DOLLY_TRUCK || (this._state & m.TOUCH_ZOOM_TRUCK) === m.TOUCH_ZOOM_TRUCK || (this._state & m.TOUCH_DOLLY_SCREEN_PAN) === m.TOUCH_DOLLY_SCREEN_PAN || (this._state & m.TOUCH_ZOOM_SCREEN_PAN) === m.TOUCH_ZOOM_SCREEN_PAN || (this._state & m.TOUCH_DOLLY_OFFSET) === m.TOUCH_DOLLY_OFFSET || (this._state & m.TOUCH_ZOOM_OFFSET) === m.TOUCH_ZOOM_OFFSET || (this._state & m.TOUCH_DOLLY_ROTATE) === m.TOUCH_DOLLY_ROTATE || (this._state & m.TOUCH_ZOOM_ROTATE) === m.TOUCH_ZOOM_ROTATE) {
|
|
4757
|
+
const b = q.x - this._activePointers[1].clientX, O = q.y - this._activePointers[1].clientY, w = Math.sqrt(b * b + O * O), D = r.y - w;
|
|
4754
4758
|
r.set(0, w);
|
|
4755
4759
|
const x = this.dollyToCursor ? (n.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, N = this.dollyToCursor ? (n.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
|
4756
|
-
(this._state &
|
|
4760
|
+
(this._state & m.TOUCH_DOLLY) === m.TOUCH_DOLLY || (this._state & m.TOUCH_DOLLY_ROTATE) === m.TOUCH_DOLLY_ROTATE || (this._state & m.TOUCH_DOLLY_TRUCK) === m.TOUCH_DOLLY_TRUCK || (this._state & m.TOUCH_DOLLY_SCREEN_PAN) === m.TOUCH_DOLLY_SCREEN_PAN || (this._state & m.TOUCH_DOLLY_OFFSET) === m.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(D * at, x, N), this._isUserControllingDolly = !0) : (this._zoomInternal(D * at, x, N), this._isUserControllingZoom = !0);
|
|
4757
4761
|
}
|
|
4758
|
-
((this._state &
|
|
4762
|
+
((this._state & m.TRUCK) === m.TRUCK || (this._state & m.TOUCH_TRUCK) === m.TOUCH_TRUCK || (this._state & m.TOUCH_DOLLY_TRUCK) === m.TOUCH_DOLLY_TRUCK || (this._state & m.TOUCH_ZOOM_TRUCK) === m.TOUCH_ZOOM_TRUCK) && (this._truckInternal(E, S, !1, !1), this._isUserControllingTruck = !0), ((this._state & m.SCREEN_PAN) === m.SCREEN_PAN || (this._state & m.TOUCH_SCREEN_PAN) === m.TOUCH_SCREEN_PAN || (this._state & m.TOUCH_DOLLY_SCREEN_PAN) === m.TOUCH_DOLLY_SCREEN_PAN || (this._state & m.TOUCH_ZOOM_SCREEN_PAN) === m.TOUCH_ZOOM_SCREEN_PAN) && (this._truckInternal(E, S, !1, !0), this._isUserControllingTruck = !0), ((this._state & m.OFFSET) === m.OFFSET || (this._state & m.TOUCH_OFFSET) === m.TOUCH_OFFSET || (this._state & m.TOUCH_DOLLY_OFFSET) === m.TOUCH_DOLLY_OFFSET || (this._state & m.TOUCH_ZOOM_OFFSET) === m.TOUCH_ZOOM_OFFSET) && (this._truckInternal(E, S, !0, !1), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
|
|
4759
4763
|
}, y = () => {
|
|
4760
|
-
Dt(this._activePointers,
|
|
4764
|
+
Dt(this._activePointers, q), n.copy(q), this._dragNeedsUpdate = !1, (this._activePointers.length === 0 || this._activePointers.length === 1 && this._activePointers[0] === this._lockedPointer) && (this._isDragging = !1), this._activePointers.length === 0 && this._domElement && (this._domElement.ownerDocument.removeEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c), this.dispatchEvent({ type: "controlend" }));
|
|
4761
4765
|
};
|
|
4762
4766
|
this.lockPointer = () => {
|
|
4763
4767
|
!this._enabled || !this._domElement || (this.cancel(), this._lockedPointer = {
|
|
@@ -4782,7 +4786,7 @@ class ae extends Qr {
|
|
|
4782
4786
|
}, this._removeAllEventListeners = () => {
|
|
4783
4787
|
this._domElement && (this._domElement.style.touchAction = "", this._domElement.style.userSelect = "", this._domElement.style.webkitUserSelect = "", this._domElement.removeEventListener("pointerdown", a), this._domElement.removeEventListener("pointercancel", c), this._domElement.removeEventListener("wheel", h, { passive: !1 }), this._domElement.removeEventListener("contextmenu", d), this._domElement.ownerDocument.removeEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c), this._domElement.ownerDocument.removeEventListener("pointerlockchange", v), this._domElement.ownerDocument.removeEventListener("pointerlockerror", C));
|
|
4784
4788
|
}, this.cancel = () => {
|
|
4785
|
-
this._state !==
|
|
4789
|
+
this._state !== m.NONE && (this._state = m.NONE, this._activePointers.length = 0, y());
|
|
4786
4790
|
}, t && this.connect(t), this.update(0);
|
|
4787
4791
|
}
|
|
4788
4792
|
/**
|
|
@@ -5149,12 +5153,12 @@ class ae extends Qr {
|
|
|
5149
5153
|
l.isEmpty() && (console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"), Promise.resolve());
|
|
5150
5154
|
const h = Ri(this._sphericalEnd.theta, Ai), d = Ri(this._sphericalEnd.phi, Ai);
|
|
5151
5155
|
c.push(this.rotateTo(h, d, t));
|
|
5152
|
-
const u = A.setFromSpherical(this._sphericalEnd).normalize(),
|
|
5153
|
-
y &&
|
|
5156
|
+
const u = A.setFromSpherical(this._sphericalEnd).normalize(), p = ki.setFromUnitVectors(u, Lt), y = k(Math.abs(u.y), 1);
|
|
5157
|
+
y && p.multiply(Nt.setFromAxisAngle(ot, h)), p.multiply(this._yAxisUpSpaceInverse);
|
|
5154
5158
|
const v = Li.makeEmpty();
|
|
5155
|
-
U.copy(l.min).applyQuaternion(
|
|
5156
|
-
const C = v.getSize(A), g = v.getCenter(U).applyQuaternion(
|
|
5157
|
-
if (
|
|
5159
|
+
U.copy(l.min).applyQuaternion(p), v.expandByPoint(U), U.copy(l.min).setX(l.max.x).applyQuaternion(p), v.expandByPoint(U), U.copy(l.min).setY(l.max.y).applyQuaternion(p), v.expandByPoint(U), U.copy(l.max).setZ(l.min.z).applyQuaternion(p), v.expandByPoint(U), U.copy(l.min).setZ(l.max.z).applyQuaternion(p), v.expandByPoint(U), U.copy(l.max).setY(l.min.y).applyQuaternion(p), v.expandByPoint(U), U.copy(l.max).setX(l.min.x).applyQuaternion(p), v.expandByPoint(U), U.copy(l.max).applyQuaternion(p), v.expandByPoint(U), v.min.x -= n, v.min.y -= a, v.max.x += r, v.max.y += o, p.setFromUnitVectors(Lt, u), y && p.premultiply(Nt.invert()), p.premultiply(this._yAxisUpSpace);
|
|
5160
|
+
const C = v.getSize(A), g = v.getCenter(U).applyQuaternion(p);
|
|
5161
|
+
if (ge(this._camera)) {
|
|
5158
5162
|
const _ = this.getDistanceToFitBox(C.x, C.y, C.z, s);
|
|
5159
5163
|
c.push(this.moveTo(g.x, g.y, g.z, t)), c.push(this.dollyTo(_, t)), c.push(this.setFocalOffset(0, 0, 0, t));
|
|
5160
5164
|
} else if (de(this._camera)) {
|
|
@@ -5171,7 +5175,7 @@ class ae extends Qr {
|
|
|
5171
5175
|
*/
|
|
5172
5176
|
fitToSphere(e, t) {
|
|
5173
5177
|
const s = [], r = "isObject3D" in e ? ae.createBoundingSphere(e, kt) : kt.copy(e);
|
|
5174
|
-
if (s.push(this.moveTo(r.center.x, r.center.y, r.center.z, t)),
|
|
5178
|
+
if (s.push(this.moveTo(r.center.x, r.center.y, r.center.z, t)), ge(this._camera)) {
|
|
5175
5179
|
const a = this.getDistanceToFitSphere(r.radius);
|
|
5176
5180
|
s.push(this.dollyTo(a, t));
|
|
5177
5181
|
} else if (de(this._camera)) {
|
|
@@ -5216,14 +5220,14 @@ class ae extends Qr {
|
|
|
5216
5220
|
* @param enableTransition
|
|
5217
5221
|
* @category Methods
|
|
5218
5222
|
*/
|
|
5219
|
-
lerpLookAt(e, t, s, n, r, a, o, c, l, h, d, u,
|
|
5223
|
+
lerpLookAt(e, t, s, n, r, a, o, c, l, h, d, u, p, y = !1) {
|
|
5220
5224
|
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = Re.NONE, this._changedDolly = 0;
|
|
5221
5225
|
const v = A.set(n, r, a), C = U.set(e, t, s);
|
|
5222
5226
|
K.setFromVector3(C.sub(v).applyQuaternion(this._yAxisUpSpace));
|
|
5223
5227
|
const g = De.set(h, d, u), _ = U.set(o, c, l);
|
|
5224
|
-
Ve.setFromVector3(_.sub(g).applyQuaternion(this._yAxisUpSpace)), this._targetEnd.copy(v.lerp(g,
|
|
5228
|
+
Ve.setFromVector3(_.sub(g).applyQuaternion(this._yAxisUpSpace)), this._targetEnd.copy(v.lerp(g, p));
|
|
5225
5229
|
const E = Ve.theta - K.theta, S = Ve.phi - K.phi, b = Ve.radius - K.radius;
|
|
5226
|
-
this._sphericalEnd.set(K.radius + b *
|
|
5230
|
+
this._sphericalEnd.set(K.radius + b * p, K.phi + S * p, K.theta + E * p), this.normalizeRotations(), this._needsUpdate = !0, y || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
|
|
5227
5231
|
const O = !y || k(this._target.x, this._targetEnd.x, this.restThreshold) && k(this._target.y, this._targetEnd.y, this.restThreshold) && k(this._target.z, this._targetEnd.z, this.restThreshold) && k(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && k(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold) && k(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
|
|
5228
5232
|
return this._createOnRestPromise(O);
|
|
5229
5233
|
}
|
|
@@ -5274,9 +5278,9 @@ class ae extends Qr {
|
|
|
5274
5278
|
* @category Methods
|
|
5275
5279
|
*/
|
|
5276
5280
|
setOrbitPoint(e, t, s) {
|
|
5277
|
-
this._camera.updateMatrixWorld(), se.setFromMatrixColumn(this._camera.matrixWorldInverse, 0), ne.setFromMatrixColumn(this._camera.matrixWorldInverse, 1),
|
|
5281
|
+
this._camera.updateMatrixWorld(), se.setFromMatrixColumn(this._camera.matrixWorldInverse, 0), ne.setFromMatrixColumn(this._camera.matrixWorldInverse, 1), ve.setFromMatrixColumn(this._camera.matrixWorldInverse, 2);
|
|
5278
5282
|
const n = A.set(e, t, s), r = n.distanceTo(this._camera.position), a = n.sub(this._camera.position);
|
|
5279
|
-
se.multiplyScalar(a.x), ne.multiplyScalar(a.y),
|
|
5283
|
+
se.multiplyScalar(a.x), ne.multiplyScalar(a.y), ve.multiplyScalar(a.z), A.copy(se).add(ne).add(ve), A.z = A.z + r, this.dollyTo(r, !1), this.setFocalOffset(-A.x, A.y, -A.z, !1), this.moveTo(e, t, s, !1);
|
|
5280
5284
|
}
|
|
5281
5285
|
/**
|
|
5282
5286
|
* Set the boundary box that encloses the target of the camera. box3 is in THREE.Box3
|
|
@@ -5471,20 +5475,20 @@ class ae extends Qr {
|
|
|
5471
5475
|
this._zoom = rt(this._zoom, this._zoomEnd, this._zoomVelocity, d, 1 / 0, e);
|
|
5472
5476
|
}
|
|
5473
5477
|
if (this.dollyToCursor) {
|
|
5474
|
-
if (
|
|
5475
|
-
const d = this._spherical.radius - this._lastDistance, u = this._camera,
|
|
5478
|
+
if (ge(this._camera) && this._changedDolly !== 0) {
|
|
5479
|
+
const d = this._spherical.radius - this._lastDistance, u = this._camera, p = this._getCameraDirection(Be), y = A.copy(p).cross(u.up).normalize();
|
|
5476
5480
|
y.lengthSq() === 0 && (y.x = 1);
|
|
5477
|
-
const v = U.crossVectors(y,
|
|
5481
|
+
const v = U.crossVectors(y, p), C = this._sphericalEnd.radius * Math.tan(u.getEffectiveFOV() * Fe * 0.5), _ = (this._sphericalEnd.radius - d - this._sphericalEnd.radius) / this._sphericalEnd.radius, E = De.copy(this._targetEnd).add(y.multiplyScalar(this._dollyControlCoord.x * C * u.aspect)).add(v.multiplyScalar(this._dollyControlCoord.y * C)), 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;
|
|
5478
5482
|
if (this.infinityDolly && (b || O)) {
|
|
5479
5483
|
this._sphericalEnd.radius -= d, this._spherical.radius -= d;
|
|
5480
|
-
const D = U.copy(
|
|
5484
|
+
const D = U.copy(p).multiplyScalar(-d);
|
|
5481
5485
|
S.add(D);
|
|
5482
5486
|
}
|
|
5483
5487
|
this._boundary.clampPoint(S, S);
|
|
5484
5488
|
const w = U.subVectors(S, this._targetEnd);
|
|
5485
5489
|
this._targetEnd.copy(S), this._target.add(w), this._changedDolly -= d, F(this._changedDolly) && (this._changedDolly = 0);
|
|
5486
5490
|
} else if (de(this._camera) && this._changedZoom !== 0) {
|
|
5487
|
-
const d = this._zoom - this._lastZoom, u = this._camera,
|
|
5491
|
+
const d = this._zoom - this._lastZoom, u = this._camera, p = A.set(this._dollyControlCoord.x, this._dollyControlCoord.y, (u.near + u.far) / (u.near - u.far)).unproject(u), y = U.set(0, 0, -1).applyQuaternion(u.quaternion), v = De.copy(p).add(y.multiplyScalar(-p.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);
|
|
5488
5492
|
S.sub(O), this._boundary.clampPoint(S, S);
|
|
5489
5493
|
const w = U.subVectors(S, this._targetEnd);
|
|
5490
5494
|
this._targetEnd.copy(S), this._target.add(w), this._changedZoom -= d, F(this._changedZoom) && (this._changedZoom = 0);
|
|
@@ -5492,7 +5496,7 @@ class ae extends Qr {
|
|
|
5492
5496
|
}
|
|
5493
5497
|
this._camera.zoom !== this._zoom && (this._camera.zoom = this._zoom, this._camera.updateProjectionMatrix(), this._updateNearPlaneCorners(), this._needsUpdate = !0), this._dragNeedsUpdate = !0;
|
|
5494
5498
|
const c = this._collisionTest();
|
|
5495
|
-
this._spherical.radius = Math.min(this._spherical.radius, c), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!F(this._focalOffset.x) || !F(this._focalOffset.y) || !F(this._focalOffset.z)) && (se.setFromMatrixColumn(this._camera.matrix, 0), ne.setFromMatrixColumn(this._camera.matrix, 1),
|
|
5499
|
+
this._spherical.radius = Math.min(this._spherical.radius, c), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!F(this._focalOffset.x) || !F(this._focalOffset.y) || !F(this._focalOffset.z)) && (se.setFromMatrixColumn(this._camera.matrix, 0), ne.setFromMatrixColumn(this._camera.matrix, 1), ve.setFromMatrixColumn(this._camera.matrix, 2), se.multiplyScalar(this._focalOffset.x), ne.multiplyScalar(-this._focalOffset.y), ve.multiplyScalar(this._focalOffset.z), A.copy(se).add(ne).add(ve), this._camera.position.add(A), this._camera.updateMatrixWorld()), this._boundaryEnclosesCamera && this._encloseToBoundary(this._camera.position.copy(this._target), A.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse), 1);
|
|
5496
5500
|
const h = this._needsUpdate;
|
|
5497
5501
|
return h && !this._updatedLastTime ? (this._hasRested = !1, this.dispatchEvent({ type: "wake" }), this.dispatchEvent({ type: "update" })) : h ? (this.dispatchEvent({ type: "update" }), F(t, this.restThreshold) && F(s, this.restThreshold) && F(n, this.restThreshold) && F(r.x, this.restThreshold) && F(r.y, this.restThreshold) && F(r.z, this.restThreshold) && F(a.x, this.restThreshold) && F(a.y, this.restThreshold) && F(a.z, this.restThreshold) && F(o, this.restThreshold) && !this._hasRested && (this._hasRested = !0, this.dispatchEvent({ type: "rest" }))) : !h && this._updatedLastTime && this.dispatchEvent({ type: "sleep" }), this._lastDistance = this._spherical.radius, this._lastZoom = this._zoom, this._updatedLastTime = h, this._needsUpdate = !1, h;
|
|
5498
5502
|
}
|
|
@@ -5545,7 +5549,7 @@ class ae extends Qr {
|
|
|
5545
5549
|
console.warn("camera-controls is already connected.");
|
|
5546
5550
|
return;
|
|
5547
5551
|
}
|
|
5548
|
-
e.setAttribute("data-camera-controls-version",
|
|
5552
|
+
e.setAttribute("data-camera-controls-version", ea), this._addAllEventListeners(e), this._getClientRect(this._elementRect);
|
|
5549
5553
|
}
|
|
5550
5554
|
/**
|
|
5551
5555
|
* Detach all internal event handlers to disable drag control.
|
|
@@ -5594,7 +5598,7 @@ class ae extends Qr {
|
|
|
5594
5598
|
}
|
|
5595
5599
|
}
|
|
5596
5600
|
_updateNearPlaneCorners() {
|
|
5597
|
-
if (
|
|
5601
|
+
if (ge(this._camera)) {
|
|
5598
5602
|
const e = this._camera, t = e.near, s = e.getEffectiveFOV() * Fe, n = Math.tan(s * 0.5) * t, r = n * e.aspect;
|
|
5599
5603
|
this._nearPlaneCorners[0].set(-r, -n, 0), this._nearPlaneCorners[1].set(r, -n, 0), this._nearPlaneCorners[2].set(r, n, 0), this._nearPlaneCorners[3].set(-r, n, 0);
|
|
5600
5604
|
} else if (de(this._camera)) {
|
|
@@ -5703,7 +5707,7 @@ const ft = (i) => {
|
|
|
5703
5707
|
/* @__PURE__ */ f("div", { className: "dropdown-toggle", onClick: s, children: `${i.title}: ${e}` }),
|
|
5704
5708
|
/* @__PURE__ */ f("ul", { className: "dropdown-menu", style: { height: r }, children: i.options.map((a) => /* @__PURE__ */ f("li", { onClick: () => n(a), children: a }, a)) })
|
|
5705
5709
|
] });
|
|
5706
|
-
},
|
|
5710
|
+
}, _e = zi(function(e, t) {
|
|
5707
5711
|
const s = [
|
|
5708
5712
|
"Renderer",
|
|
5709
5713
|
"Depth",
|
|
@@ -5739,8 +5743,8 @@ const ft = (i) => {
|
|
|
5739
5743
|
options: s,
|
|
5740
5744
|
onSelect: (u) => {
|
|
5741
5745
|
if (u === n) return;
|
|
5742
|
-
const
|
|
5743
|
-
e.onSelectRenderMode(
|
|
5746
|
+
const p = u;
|
|
5747
|
+
e.onSelectRenderMode(p), r(p);
|
|
5744
5748
|
},
|
|
5745
5749
|
onToggle: (u) => {
|
|
5746
5750
|
u && h && d(!1), a && o(!1), l(u);
|
|
@@ -5750,7 +5754,7 @@ const ft = (i) => {
|
|
|
5750
5754
|
)
|
|
5751
5755
|
] })
|
|
5752
5756
|
] });
|
|
5753
|
-
}),
|
|
5757
|
+
}), ia = `out vec3 worldPosition;
|
|
5754
5758
|
uniform float uDistance;
|
|
5755
5759
|
|
|
5756
5760
|
void main() {
|
|
@@ -5759,7 +5763,7 @@ void main() {
|
|
|
5759
5763
|
worldPosition.xz += cameraPosition.xz;
|
|
5760
5764
|
|
|
5761
5765
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(worldPosition, 1.0);
|
|
5762
|
-
}`,
|
|
5766
|
+
}`, sa = `out vec4 fragColor;
|
|
5763
5767
|
in vec3 worldPosition;
|
|
5764
5768
|
uniform float uDivisions;
|
|
5765
5769
|
uniform float uScale;
|
|
@@ -5828,7 +5832,7 @@ void main() {
|
|
|
5828
5832
|
|
|
5829
5833
|
if (fragColor.a <= minAlpha) discard;
|
|
5830
5834
|
}`;
|
|
5831
|
-
class
|
|
5835
|
+
class na extends is {
|
|
5832
5836
|
constructor(e) {
|
|
5833
5837
|
super({
|
|
5834
5838
|
extensions: {
|
|
@@ -5855,12 +5859,12 @@ class sa extends ts {
|
|
|
5855
5859
|
value: e?.gridOpacity !== void 0 ? e?.gridOpacity : 0.25
|
|
5856
5860
|
}
|
|
5857
5861
|
},
|
|
5858
|
-
glslVersion:
|
|
5859
|
-
side:
|
|
5862
|
+
glslVersion: zs,
|
|
5863
|
+
side: Yi,
|
|
5860
5864
|
transparent: !0,
|
|
5861
5865
|
name: "InfiniteGrid",
|
|
5862
|
-
vertexShader:
|
|
5863
|
-
fragmentShader:
|
|
5866
|
+
vertexShader: ia,
|
|
5867
|
+
fragmentShader: sa
|
|
5864
5868
|
});
|
|
5865
5869
|
}
|
|
5866
5870
|
// Getters / Setters
|
|
@@ -5883,11 +5887,11 @@ class sa extends ts {
|
|
|
5883
5887
|
this.uniforms.uSubgridOpacity.value = e;
|
|
5884
5888
|
}
|
|
5885
5889
|
}
|
|
5886
|
-
class
|
|
5890
|
+
class ra extends Vi {
|
|
5887
5891
|
gridMaterial;
|
|
5888
5892
|
constructor(e) {
|
|
5889
|
-
const t = new
|
|
5890
|
-
super(new
|
|
5893
|
+
const t = new na(e);
|
|
5894
|
+
super(new Hs(), t), this.gridMaterial = t, this.frustumCulled = !1, this.name = "InfiniteGridHelper";
|
|
5891
5895
|
}
|
|
5892
5896
|
// Getters / Setters
|
|
5893
5897
|
get color() {
|
|
@@ -5909,7 +5913,7 @@ class na extends Bi {
|
|
|
5909
5913
|
this.gridMaterial.subgridOpacity = e;
|
|
5910
5914
|
}
|
|
5911
5915
|
}
|
|
5912
|
-
class
|
|
5916
|
+
class aa extends nn {
|
|
5913
5917
|
uScale;
|
|
5914
5918
|
uDivisions;
|
|
5915
5919
|
uColor;
|
|
@@ -5917,34 +5921,34 @@ class ra extends sn {
|
|
|
5917
5921
|
uSubgridOpacity;
|
|
5918
5922
|
uGridOpacity;
|
|
5919
5923
|
constructor(e) {
|
|
5920
|
-
super(), this.name = "InfiniteGrid", this.side =
|
|
5921
|
-
const { uScale: t, uDivisions: s, uColor: n, uDistance: r, uSubgridOpacity: a, uGridOpacity: o } = this, c =
|
|
5924
|
+
super(), this.name = "InfiniteGrid", this.side = rn, this.transparent = !0, this.uScale = we(e?.scale ?? 0.1), this.uDivisions = we(e?.divisions ?? 10), this.uColor = we(e?.color ?? new dt(16777215)), this.uDistance = we(e?.distance ?? 1e4), this.uSubgridOpacity = we(e?.subgridOpacity ?? 0.15), this.uGridOpacity = we(e?.gridOpacity ?? 0.25);
|
|
5925
|
+
const { uScale: t, uDivisions: s, uColor: n, uDistance: r, uSubgridOpacity: a, uGridOpacity: o } = this, c = Rn("vec3", "vWorldPosition");
|
|
5922
5926
|
this.positionNode = wt(() => {
|
|
5923
|
-
const h =
|
|
5924
|
-
|
|
5927
|
+
const h = Pn.xzy.mul(r).add(
|
|
5928
|
+
Dn(it.x, Z(0), it.z)
|
|
5925
5929
|
);
|
|
5926
5930
|
return c.assign(h), h;
|
|
5927
5931
|
})();
|
|
5928
5932
|
const l = wt(([h]) => {
|
|
5929
|
-
const d = c.xz.div(h), u =
|
|
5930
|
-
return
|
|
5933
|
+
const d = c.xz.div(h), u = In(d), p = mi(Un(d.sub(0.5)).sub(0.5)).div(u).div(2), y = xt(p.x, p.y);
|
|
5934
|
+
return Z(1).sub(xt(y, Z(1)));
|
|
5931
5935
|
});
|
|
5932
5936
|
this.outputNode = wt(() => {
|
|
5933
|
-
const h = c, d = fi(
|
|
5934
|
-
S.sub(
|
|
5935
|
-
|
|
5937
|
+
const h = c, d = fi(Z(200), mi(it.y.sub(h.y))), u = Z(Ln(it, h)), p = gi(d).div(gi(s)), y = vi(s, kn(p)), v = y.mul(s), C = v.mul(s), g = l(y.mul(t)), _ = l(v.mul(t)), E = l(C.mul(t)), S = d.sub(y).div(v.sub(y)), b = Z(0.3), O = fi(
|
|
5938
|
+
S.sub(Z(1)).add(b),
|
|
5939
|
+
Z(0)
|
|
5936
5940
|
).div(b), w = g.mul(
|
|
5937
|
-
vi(
|
|
5938
|
-
), D =
|
|
5941
|
+
vi(Z(1).sub(xt(u.div(r), Z(1))), Z(3))
|
|
5942
|
+
), D = Z(0.5), x = w.sub(O).mul(a), N = _i(
|
|
5939
5943
|
x,
|
|
5940
5944
|
w.mul(o).sub(
|
|
5941
5945
|
O.mul(o.sub(a)).mul(D)
|
|
5942
5946
|
),
|
|
5943
5947
|
_
|
|
5944
|
-
), Q =
|
|
5945
|
-
return
|
|
5946
|
-
|
|
5947
|
-
}),
|
|
5948
|
+
), Q = Z(_i(N, w.mul(o), E));
|
|
5949
|
+
return Nn(Fn(Q, Z(1 / 127)), () => {
|
|
5950
|
+
zn();
|
|
5951
|
+
}), Hn(n, Q);
|
|
5948
5952
|
})();
|
|
5949
5953
|
}
|
|
5950
5954
|
// Getters / Setters
|
|
@@ -5967,11 +5971,11 @@ class ra extends sn {
|
|
|
5967
5971
|
this.uSubgridOpacity.value = e;
|
|
5968
5972
|
}
|
|
5969
5973
|
}
|
|
5970
|
-
class
|
|
5974
|
+
class oa extends ut {
|
|
5971
5975
|
gridMaterial;
|
|
5972
5976
|
constructor(e) {
|
|
5973
|
-
const t = new
|
|
5974
|
-
super(new
|
|
5977
|
+
const t = new aa(e);
|
|
5978
|
+
super(new an(), t), this.gridMaterial = t, this.frustumCulled = !1, this.name = "InfiniteGridHelper";
|
|
5975
5979
|
}
|
|
5976
5980
|
// Getters / Setters
|
|
5977
5981
|
get color() {
|
|
@@ -6013,19 +6017,19 @@ function zt(i) {
|
|
|
6013
6017
|
i.name
|
|
6014
6018
|
);
|
|
6015
6019
|
}
|
|
6016
|
-
class
|
|
6020
|
+
class la extends ss {
|
|
6017
6021
|
constructor() {
|
|
6018
6022
|
super();
|
|
6019
|
-
const e =
|
|
6020
|
-
this.colorNode =
|
|
6023
|
+
const e = Bn(Vn(), 0.1, 0.5, 0, 1).oneMinus();
|
|
6024
|
+
this.colorNode = ns(e, e, e, 1);
|
|
6021
6025
|
}
|
|
6022
6026
|
}
|
|
6023
|
-
class
|
|
6027
|
+
class ca extends ss {
|
|
6024
6028
|
constructor() {
|
|
6025
|
-
super(), this.colorNode =
|
|
6029
|
+
super(), this.colorNode = ns(Gn(), 0, 1);
|
|
6026
6030
|
}
|
|
6027
6031
|
}
|
|
6028
|
-
class $ extends
|
|
6032
|
+
class $ extends Wi {
|
|
6029
6033
|
static DRAG_START = "Transform::dragStart";
|
|
6030
6034
|
static DRAG_END = "Transform::dragEnd";
|
|
6031
6035
|
static _instance;
|
|
@@ -6048,7 +6052,7 @@ class $ extends $i {
|
|
|
6048
6052
|
let t = this.controls.get(e);
|
|
6049
6053
|
if (t === void 0) {
|
|
6050
6054
|
const s = document.querySelector(".clickable");
|
|
6051
|
-
t = new
|
|
6055
|
+
t = new $n(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", () => {
|
|
6052
6056
|
this.dispatchEvent({ type: $.DRAG_START });
|
|
6053
6057
|
}), t.addEventListener("mouseUp", () => {
|
|
6054
6058
|
this.dispatchEvent({ type: $.DRAG_END });
|
|
@@ -6094,7 +6098,7 @@ class $ extends $i {
|
|
|
6094
6098
|
return $._instance || ($._instance = new $()), $._instance;
|
|
6095
6099
|
}
|
|
6096
6100
|
}
|
|
6097
|
-
const
|
|
6101
|
+
const ha = new on(), Ht = new $e();
|
|
6098
6102
|
class Bt extends ci {
|
|
6099
6103
|
curve = new hi();
|
|
6100
6104
|
line;
|
|
@@ -6117,7 +6121,7 @@ class Bt extends ci {
|
|
|
6117
6121
|
group;
|
|
6118
6122
|
constructor(e, t) {
|
|
6119
6123
|
const s = new dt(Ot(0.5, 1, Math.random()), Ot(0.5, 1, Math.random()), Ot(0.5, 1, Math.random()));
|
|
6120
|
-
super(), this.name = e, this.lineMaterial = new
|
|
6124
|
+
super(), this.name = e, this.lineMaterial = new ln({ color: s }), this.line = new cn(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 hn(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();
|
|
6121
6125
|
}
|
|
6122
6126
|
enable() {
|
|
6123
6127
|
document.addEventListener("pointerdown", this.onMouseClick);
|
|
@@ -6139,7 +6143,7 @@ class Bt extends ci {
|
|
|
6139
6143
|
te(t.position.y, 3),
|
|
6140
6144
|
te(t.position.z, 3)
|
|
6141
6145
|
]);
|
|
6142
|
-
}),
|
|
6146
|
+
}), Wn({
|
|
6143
6147
|
name: this.name,
|
|
6144
6148
|
points: e,
|
|
6145
6149
|
tension: this.tension,
|
|
@@ -6161,7 +6165,7 @@ class Bt extends ci {
|
|
|
6161
6165
|
}
|
|
6162
6166
|
};
|
|
6163
6167
|
addPoint = (e, t = !0) => {
|
|
6164
|
-
const s = this.draggable.children.length, n = new ut(
|
|
6168
|
+
const s = this.draggable.children.length, n = new ut(ha, this.draggedMat);
|
|
6165
6169
|
n.name = `point_${s}`, n.position.copy(e), n.scale.setScalar(this._draggableScale), this.draggable.add(n), this._transform?.attach(n);
|
|
6166
6170
|
const r = this.points.length > 1;
|
|
6167
6171
|
return r && t && this.updateSpline(), this.line.visible = r, this.updateCurrentPoint(), n;
|
|
@@ -6433,7 +6437,7 @@ class Bt extends ci {
|
|
|
6433
6437
|
};
|
|
6434
6438
|
}
|
|
6435
6439
|
let ct = 0;
|
|
6436
|
-
class
|
|
6440
|
+
class da extends Bs {
|
|
6437
6441
|
defaultScale = 10;
|
|
6438
6442
|
currentSpline = null;
|
|
6439
6443
|
_camera;
|
|
@@ -6569,8 +6573,8 @@ class ha extends Hs {
|
|
|
6569
6573
|
}
|
|
6570
6574
|
const s = e.target.getBoundingClientRect(), n = (e.clientX - s.left) / s.width * 2 - 1, r = -((e.clientY - s.top) / s.height) * 2 + 1;
|
|
6571
6575
|
if (G.instance) {
|
|
6572
|
-
const o = new
|
|
6573
|
-
o.setFromCamera(new
|
|
6576
|
+
const o = new Vs();
|
|
6577
|
+
o.setFromCamera(new Gs(n, r), this._camera);
|
|
6574
6578
|
const c = o.intersectObjects(G.instance.helpersContainer.children, !0);
|
|
6575
6579
|
for (let l = 0; l < c.length; l++) {
|
|
6576
6580
|
const h = c[l];
|
|
@@ -6591,9 +6595,9 @@ class ha extends Hs {
|
|
|
6591
6595
|
this.isMouseDown = !1;
|
|
6592
6596
|
};
|
|
6593
6597
|
mouseToSplinePos(e, t, s, n) {
|
|
6594
|
-
const r = new Le(), a = 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 === -a && o.rotation.z === 0, u = o.rotation.x === -6162975822039155e-48 && o.rotation.y === a && o.rotation.z === 0,
|
|
6598
|
+
const r = new Le(), a = 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 === -a && o.rotation.z === 0, u = o.rotation.x === -6162975822039155e-48 && o.rotation.y === a && o.rotation.z === 0, p = o.rotation.x === -1.5707953264174506 && o.rotation.y === 0 && o.rotation.z === 0, y = o.rotation.x === 1.5707953264174506 && o.rotation.y === 0 && o.rotation.z === 0;
|
|
6595
6599
|
let v = e, C = t;
|
|
6596
|
-
h || u ? v *= -1 :
|
|
6600
|
+
h || u ? v *= -1 : p && (C *= -1);
|
|
6597
6601
|
const g = s / 2 / c, _ = n / 2 / c;
|
|
6598
6602
|
if (this.currentSpline === null && (this.currentSpline = this.createSpline()), l || h) {
|
|
6599
6603
|
const E = v * g + o.position.x, S = C * _ + o.position.y;
|
|
@@ -6601,7 +6605,7 @@ class ha extends Hs {
|
|
|
6601
6605
|
} else if (d || u) {
|
|
6602
6606
|
const E = v * g + o.position.z, S = C * _ + o.position.y;
|
|
6603
6607
|
r.set(0, S, E);
|
|
6604
|
-
} else if (
|
|
6608
|
+
} else if (p || y) {
|
|
6605
6609
|
const E = v * g + o.position.x, S = C * _ + o.position.z;
|
|
6606
6610
|
r.set(E, 0, S);
|
|
6607
6611
|
}
|
|
@@ -6622,7 +6626,7 @@ const Ni = [
|
|
|
6622
6626
|
"Side by Side",
|
|
6623
6627
|
"Stacked",
|
|
6624
6628
|
"Quad"
|
|
6625
|
-
],
|
|
6629
|
+
], ua = "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", pa = "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==", ma = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAQ0lEQVQ4jWP8////fwYqAxYozUhFM/8zkaKYWIWkGEq0b0ZdSjQY5i79TyWagRGaTUdzFEEw6lLqGzqwLoVVJ1StpwA9sBwbUqAh5gAAAABJRU5ErkJggg==";
|
|
6626
6630
|
class G extends Qe {
|
|
6627
6631
|
static instance = null;
|
|
6628
6632
|
scene;
|
|
@@ -6634,11 +6638,11 @@ class G extends Qe {
|
|
|
6634
6638
|
currentCamera;
|
|
6635
6639
|
currentWindow;
|
|
6636
6640
|
// RefObject to one of the "windows"
|
|
6637
|
-
helpersContainer = new
|
|
6641
|
+
helpersContainer = new dn();
|
|
6638
6642
|
grid;
|
|
6639
6643
|
cameraHelpers = /* @__PURE__ */ new Map();
|
|
6640
6644
|
lightHelpers = /* @__PURE__ */ new Map();
|
|
6641
|
-
interactionHelper = new
|
|
6645
|
+
interactionHelper = new un(25);
|
|
6642
6646
|
currentTransform;
|
|
6643
6647
|
// Tools
|
|
6644
6648
|
splineEditor;
|
|
@@ -6697,7 +6701,7 @@ class G extends Qe {
|
|
|
6697
6701
|
"Debug"
|
|
6698
6702
|
];
|
|
6699
6703
|
constructor(e) {
|
|
6700
|
-
super(e), this.props.three.addEventListener(R.ADD_RENDERER, this.setupRenderer), this.scene = new
|
|
6704
|
+
super(e), this.props.three.addEventListener(R.ADD_RENDERER, this.setupRenderer), this.scene = new pn(), this.scene.name = this.scene.uuid = "", this.canvasRef = ue(), this.containerRef = ue(), this.tlWindow = ue(), this.trWindow = ue(), this.blWindow = ue(), this.brWindow = ue();
|
|
6701
6705
|
const t = e.three.name, s = localStorage, n = s.getItem(`${t}_mode`);
|
|
6702
6706
|
this.state = {
|
|
6703
6707
|
mode: n !== null ? n : "Single",
|
|
@@ -6710,12 +6714,12 @@ class G extends Qe {
|
|
|
6710
6714
|
const r = {
|
|
6711
6715
|
Vector2: $e,
|
|
6712
6716
|
Vector3: ee,
|
|
6713
|
-
Vector4:
|
|
6714
|
-
Quaternion:
|
|
6715
|
-
Matrix4:
|
|
6716
|
-
Spherical:
|
|
6717
|
-
Box3:
|
|
6718
|
-
Sphere:
|
|
6717
|
+
Vector4: yn,
|
|
6718
|
+
Quaternion: _n,
|
|
6719
|
+
Matrix4: vn,
|
|
6720
|
+
Spherical: gn,
|
|
6721
|
+
Box3: fn,
|
|
6722
|
+
Sphere: mn,
|
|
6719
6723
|
Raycaster: Wt
|
|
6720
6724
|
};
|
|
6721
6725
|
ae.install({ THREE: r }), this.setupScene(), this.setupTools();
|
|
@@ -6742,8 +6746,8 @@ class G extends Qe {
|
|
|
6742
6746
|
}), /* @__PURE__ */ M("div", { className: "multiview", children: [
|
|
6743
6747
|
/* @__PURE__ */ f("canvas", { ref: this.canvasRef }),
|
|
6744
6748
|
/* @__PURE__ */ M("div", { className: `cameras ${this.state.mode === "Single" || this.state.mode === "Stacked" ? "single" : ""}`, ref: this.containerRef, children: [
|
|
6745
|
-
this.state.mode === "Single" && /* @__PURE__ */ f(
|
|
6746
|
-
|
|
6749
|
+
this.state.mode === "Single" && /* @__PURE__ */ f(Y, { children: /* @__PURE__ */ f(
|
|
6750
|
+
_e,
|
|
6747
6751
|
{
|
|
6748
6752
|
name: "tl",
|
|
6749
6753
|
camera: this.tlCam,
|
|
@@ -6759,9 +6763,9 @@ class G extends Qe {
|
|
|
6759
6763
|
}
|
|
6760
6764
|
}
|
|
6761
6765
|
) }),
|
|
6762
|
-
(this.state.mode === "Side by Side" || this.state.mode === "Stacked") && /* @__PURE__ */ M(
|
|
6766
|
+
(this.state.mode === "Side by Side" || this.state.mode === "Stacked") && /* @__PURE__ */ M(Y, { children: [
|
|
6763
6767
|
/* @__PURE__ */ f(
|
|
6764
|
-
|
|
6768
|
+
_e,
|
|
6765
6769
|
{
|
|
6766
6770
|
name: "tl",
|
|
6767
6771
|
camera: this.tlCam,
|
|
@@ -6778,7 +6782,7 @@ class G extends Qe {
|
|
|
6778
6782
|
}
|
|
6779
6783
|
),
|
|
6780
6784
|
/* @__PURE__ */ f(
|
|
6781
|
-
|
|
6785
|
+
_e,
|
|
6782
6786
|
{
|
|
6783
6787
|
name: "tr",
|
|
6784
6788
|
camera: this.trCam,
|
|
@@ -6795,9 +6799,9 @@ class G extends Qe {
|
|
|
6795
6799
|
}
|
|
6796
6800
|
)
|
|
6797
6801
|
] }),
|
|
6798
|
-
this.state.mode === "Quad" && /* @__PURE__ */ M(
|
|
6802
|
+
this.state.mode === "Quad" && /* @__PURE__ */ M(Y, { children: [
|
|
6799
6803
|
/* @__PURE__ */ f(
|
|
6800
|
-
|
|
6804
|
+
_e,
|
|
6801
6805
|
{
|
|
6802
6806
|
name: "tl",
|
|
6803
6807
|
camera: this.tlCam,
|
|
@@ -6814,7 +6818,7 @@ class G extends Qe {
|
|
|
6814
6818
|
}
|
|
6815
6819
|
),
|
|
6816
6820
|
/* @__PURE__ */ f(
|
|
6817
|
-
|
|
6821
|
+
_e,
|
|
6818
6822
|
{
|
|
6819
6823
|
name: "tr",
|
|
6820
6824
|
camera: this.trCam,
|
|
@@ -6831,7 +6835,7 @@ class G extends Qe {
|
|
|
6831
6835
|
}
|
|
6832
6836
|
),
|
|
6833
6837
|
/* @__PURE__ */ f(
|
|
6834
|
-
|
|
6838
|
+
_e,
|
|
6835
6839
|
{
|
|
6836
6840
|
name: "bl",
|
|
6837
6841
|
camera: this.blCam,
|
|
@@ -6848,7 +6852,7 @@ class G extends Qe {
|
|
|
6848
6852
|
}
|
|
6849
6853
|
),
|
|
6850
6854
|
/* @__PURE__ */ f(
|
|
6851
|
-
|
|
6855
|
+
_e,
|
|
6852
6856
|
{
|
|
6853
6857
|
name: "br",
|
|
6854
6858
|
camera: this.brCam,
|
|
@@ -6912,7 +6916,7 @@ class G extends Qe {
|
|
|
6912
6916
|
zt,
|
|
6913
6917
|
{
|
|
6914
6918
|
name: "cameraHelper",
|
|
6915
|
-
icon:
|
|
6919
|
+
icon: ua,
|
|
6916
6920
|
selected: this.cameraVisibility,
|
|
6917
6921
|
height: 24,
|
|
6918
6922
|
top: 2,
|
|
@@ -6930,7 +6934,7 @@ class G extends Qe {
|
|
|
6930
6934
|
zt,
|
|
6931
6935
|
{
|
|
6932
6936
|
name: "lightHelper",
|
|
6933
|
-
icon:
|
|
6937
|
+
icon: pa,
|
|
6934
6938
|
selected: this.lightVisibility,
|
|
6935
6939
|
height: 24,
|
|
6936
6940
|
top: 4,
|
|
@@ -6948,7 +6952,7 @@ class G extends Qe {
|
|
|
6948
6952
|
zt,
|
|
6949
6953
|
{
|
|
6950
6954
|
name: "gridHelper",
|
|
6951
|
-
icon:
|
|
6955
|
+
icon: ma,
|
|
6952
6956
|
selected: this.gridVisibility,
|
|
6953
6957
|
height: 21,
|
|
6954
6958
|
width: 21,
|
|
@@ -6972,10 +6976,10 @@ class G extends Qe {
|
|
|
6972
6976
|
this.props.three.canvas = s, t.type === "WebGLRenderer" ? (this.renderer = new qe({
|
|
6973
6977
|
canvas: s,
|
|
6974
6978
|
stencil: !1
|
|
6975
|
-
}), this.grid && (this.scene.remove(this.grid), ie(this.grid)), this.grid = new
|
|
6979
|
+
}), this.grid && (this.scene.remove(this.grid), ie(this.grid)), this.grid = new ra(), this.scene.add(this.grid), this.rendererReady = !0) : t.type === "WebGPURenderer" && (this.renderer = new Ge({
|
|
6976
6980
|
canvas: s,
|
|
6977
6981
|
stencil: !1
|
|
6978
|
-
}), this.grid && (this.scene.remove(this.grid), ie(this.grid)), this.grid = new
|
|
6982
|
+
}), this.grid && (this.scene.remove(this.grid), ie(this.grid)), this.grid = new oa(), 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?.dispose(), this.normalsMaterial?.dispose(), this.uvMaterial?.dispose(), this.depthMaterial = new la(), this.normalsMaterial = new Cn(), this.uvMaterial = new ca(), t.type === "WebGPURenderer" ? this.renderer.init().then(() => {
|
|
6979
6983
|
this.rendererReady = !0, this.props.three.requestScene();
|
|
6980
6984
|
}) : this.props.three.requestScene());
|
|
6981
6985
|
};
|
|
@@ -7092,7 +7096,7 @@ class G extends Qe {
|
|
|
7092
7096
|
});
|
|
7093
7097
|
}
|
|
7094
7098
|
setupTools() {
|
|
7095
|
-
this.splineEditor = new
|
|
7099
|
+
this.splineEditor = new da(this.currentCamera, this.three), this.splineEditor.initDebug(), this.helpersContainer.add(this.splineEditor);
|
|
7096
7100
|
}
|
|
7097
7101
|
// Public
|
|
7098
7102
|
play() {
|
|
@@ -7204,7 +7208,7 @@ class G extends Qe {
|
|
|
7204
7208
|
if (n !== void 0) {
|
|
7205
7209
|
const r = n;
|
|
7206
7210
|
this.cameras.set(s, r);
|
|
7207
|
-
const a = new
|
|
7211
|
+
const a = new bn(r), o = this.currentScene !== void 0 && this.currentScene.getObjectByProperty("uuid", s) !== void 0;
|
|
7208
7212
|
a.visible = this.cameraVisibility && o, this.cameraHelpers.set(s, a), this.helpersContainer.add(a), this.setState({ lastUpdate: Date.now() });
|
|
7209
7213
|
}
|
|
7210
7214
|
};
|
|
@@ -7250,7 +7254,7 @@ class G extends Qe {
|
|
|
7250
7254
|
if (e.ctrlKey) {
|
|
7251
7255
|
if (this.currentCamera.name === "UI") return;
|
|
7252
7256
|
const t = this.controls.get(this.currentCamera.name);
|
|
7253
|
-
e.key === "0" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ae(this.currentCamera, this.currentWindow.current), this.selectedItem instanceof ut || this.selectedItem instanceof
|
|
7257
|
+
e.key === "0" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ae(this.currentCamera, this.currentWindow.current), this.selectedItem instanceof ut || this.selectedItem instanceof En ? (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 ae(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 ae(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 ae(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 ae(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 ae(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(Yt(45), Yt(45), !0), this.updateCameraControls(t));
|
|
7254
7258
|
} else if (this.currentTransform !== void 0)
|
|
7255
7259
|
switch (e.key) {
|
|
7256
7260
|
case "r":
|
|
@@ -7310,19 +7314,19 @@ class G extends Qe {
|
|
|
7310
7314
|
let s;
|
|
7311
7315
|
switch (t.type) {
|
|
7312
7316
|
case "DirectionalLight":
|
|
7313
|
-
s = new
|
|
7317
|
+
s = new xn(t, 100), s.name = `${t.name}Helper`, s.visible = this.lightVisibility, this.lightHelpers.set(t.name, s), this.helpersContainer.add(s);
|
|
7314
7318
|
break;
|
|
7315
7319
|
case "HemisphereLight":
|
|
7316
|
-
s = new
|
|
7320
|
+
s = new wn(t, 250), s.name = `${t.name}Helper`, s.visible = this.lightVisibility, this.lightHelpers.set(t.name, s), this.helpersContainer.add(s);
|
|
7317
7321
|
break;
|
|
7318
7322
|
case "RectAreaLight":
|
|
7319
|
-
s = new
|
|
7323
|
+
s = new Mn(t), s.name = `${t.name}Helper`, s.visible = this.lightVisibility, this.lightHelpers.set(t.name, s), this.helpersContainer.add(s);
|
|
7320
7324
|
break;
|
|
7321
7325
|
case "PointLight":
|
|
7322
|
-
s = new
|
|
7326
|
+
s = new On(t, 100), s.name = `${t.name}Helper`, s.visible = this.lightVisibility, this.lightHelpers.set(t.name, s), this.helpersContainer.add(s);
|
|
7323
7327
|
break;
|
|
7324
7328
|
case "SpotLight":
|
|
7325
|
-
s = new
|
|
7329
|
+
s = new Sn(t), s.name = `${t.name}Helper`, s.visible = this.lightVisibility, this.lightHelpers.set(t.name, s), this.helpersContainer.add(s);
|
|
7326
7330
|
break;
|
|
7327
7331
|
}
|
|
7328
7332
|
}
|
|
@@ -7331,7 +7335,7 @@ class G extends Qe {
|
|
|
7331
7335
|
createControls(e, t) {
|
|
7332
7336
|
const s = this.controls.get(e.name);
|
|
7333
7337
|
if (s !== void 0 && s.dispose(), this.controls.delete(e.name), e.name === "UI") return;
|
|
7334
|
-
const n = new
|
|
7338
|
+
const n = new An(e, t);
|
|
7335
7339
|
switch (n.enableDamping = !0, n.dampingFactor = 0.1, e.name) {
|
|
7336
7340
|
case "Top":
|
|
7337
7341
|
case "Bottom":
|
|
@@ -7480,9 +7484,9 @@ class G extends Qe {
|
|
|
7480
7484
|
}
|
|
7481
7485
|
class bt extends Qe {
|
|
7482
7486
|
static instance;
|
|
7483
|
-
matrix = new
|
|
7487
|
+
matrix = new Gi();
|
|
7484
7488
|
position = new Le();
|
|
7485
|
-
rotation = new
|
|
7489
|
+
rotation = new $s();
|
|
7486
7490
|
scale = new Le();
|
|
7487
7491
|
open = !1;
|
|
7488
7492
|
constructor(e) {
|
|
@@ -7584,7 +7588,7 @@ function Fi(i) {
|
|
|
7584
7588
|
}
|
|
7585
7589
|
return i;
|
|
7586
7590
|
}
|
|
7587
|
-
function
|
|
7591
|
+
function fa(i, e) {
|
|
7588
7592
|
function t() {
|
|
7589
7593
|
return `${e.name}_light`;
|
|
7590
7594
|
}
|
|
@@ -7606,8 +7610,8 @@ function ma(i, e) {
|
|
|
7606
7610
|
e.updateObject(i.uuid, l, d);
|
|
7607
7611
|
const u = e.getScene(i.uuid);
|
|
7608
7612
|
if (u !== null) {
|
|
7609
|
-
const
|
|
7610
|
-
V(
|
|
7613
|
+
const p = u.getObjectByProperty("uuid", i.uuid);
|
|
7614
|
+
V(p, l, d);
|
|
7611
7615
|
}
|
|
7612
7616
|
}
|
|
7613
7617
|
}) : a.push({
|
|
@@ -7639,7 +7643,7 @@ function ma(i, e) {
|
|
|
7639
7643
|
}
|
|
7640
7644
|
);
|
|
7641
7645
|
}
|
|
7642
|
-
function
|
|
7646
|
+
function ga(i) {
|
|
7643
7647
|
const e = i.object, t = i.three;
|
|
7644
7648
|
function s() {
|
|
7645
7649
|
return `${t.name}_animation`;
|
|
@@ -7686,18 +7690,18 @@ function fa(i) {
|
|
|
7686
7690
|
if (d !== null) {
|
|
7687
7691
|
const u = d.getObjectByProperty("uuid", e.uuid);
|
|
7688
7692
|
if (u !== void 0) {
|
|
7689
|
-
const
|
|
7690
|
-
if (
|
|
7693
|
+
const p = u.mixer;
|
|
7694
|
+
if (p !== void 0) {
|
|
7691
7695
|
const v = [
|
|
7692
7696
|
{
|
|
7693
7697
|
title: "Time Scale",
|
|
7694
7698
|
type: "range",
|
|
7695
|
-
value:
|
|
7699
|
+
value: p.timeScale,
|
|
7696
7700
|
step: 0.01,
|
|
7697
7701
|
min: -1,
|
|
7698
7702
|
max: 2,
|
|
7699
7703
|
onChange: (C, g) => {
|
|
7700
|
-
|
|
7704
|
+
p.timeScale = g, t.updateObject(e.uuid, "mixer.timeScale", g);
|
|
7701
7705
|
}
|
|
7702
7706
|
}
|
|
7703
7707
|
];
|
|
@@ -7705,16 +7709,16 @@ function fa(i) {
|
|
|
7705
7709
|
title: "Stop All",
|
|
7706
7710
|
type: "button",
|
|
7707
7711
|
onChange: () => {
|
|
7708
|
-
|
|
7712
|
+
p.stopAllAction(), t.requestMethod(e.uuid, "stopAllAction", void 0, "mixer");
|
|
7709
7713
|
}
|
|
7710
7714
|
}), o.push({
|
|
7711
7715
|
title: "Mixer",
|
|
7712
7716
|
items: v
|
|
7713
|
-
}), h = new
|
|
7717
|
+
}), h = new Ws(u), G.instance?.scene.add(h);
|
|
7714
7718
|
}
|
|
7715
7719
|
}
|
|
7716
7720
|
}
|
|
7717
|
-
return
|
|
7721
|
+
return pe(() => () => {
|
|
7718
7722
|
h !== void 0 && ie(h);
|
|
7719
7723
|
}, []), /* @__PURE__ */ f(
|
|
7720
7724
|
X,
|
|
@@ -7742,9 +7746,9 @@ const Vt = {
|
|
|
7742
7746
|
lightInfo: void 0,
|
|
7743
7747
|
children: []
|
|
7744
7748
|
};
|
|
7745
|
-
function
|
|
7749
|
+
function va(i) {
|
|
7746
7750
|
const [e, t] = L(Vt);
|
|
7747
|
-
|
|
7751
|
+
pe(() => {
|
|
7748
7752
|
function a(c) {
|
|
7749
7753
|
t(c.value);
|
|
7750
7754
|
}
|
|
@@ -7764,8 +7768,8 @@ function ga(i) {
|
|
|
7764
7768
|
button: e.uuid.length > 0 ? /* @__PURE__ */ f("button", { className: "remove", onClick: () => {
|
|
7765
7769
|
$.instance.remove(e.name), t(Vt);
|
|
7766
7770
|
} }) : void 0,
|
|
7767
|
-
children: /* @__PURE__ */ f("div", { id: "Inspector", className: i.class, children: e.uuid.length > 0 && /* @__PURE__ */ M(
|
|
7768
|
-
/* @__PURE__ */ M(
|
|
7771
|
+
children: /* @__PURE__ */ f("div", { id: "Inspector", className: i.class, children: e.uuid.length > 0 && /* @__PURE__ */ M(Y, { children: [
|
|
7772
|
+
/* @__PURE__ */ M(Y, { children: [
|
|
7769
7773
|
/* @__PURE__ */ f(
|
|
7770
7774
|
ht,
|
|
7771
7775
|
{
|
|
@@ -7797,19 +7801,19 @@ function ga(i) {
|
|
|
7797
7801
|
}
|
|
7798
7802
|
)
|
|
7799
7803
|
] }),
|
|
7800
|
-
/* @__PURE__ */ M(
|
|
7804
|
+
/* @__PURE__ */ M(Y, { children: [
|
|
7801
7805
|
/* @__PURE__ */ f(bt, { object: e, three: i.three }),
|
|
7802
|
-
n ? /* @__PURE__ */ f(
|
|
7803
|
-
s.search("camera") > -1 ?
|
|
7804
|
-
s.search("light") > -1 ?
|
|
7805
|
-
r ?
|
|
7806
|
+
n ? /* @__PURE__ */ f(ga, { object: e, three: i.three }) : null,
|
|
7807
|
+
s.search("camera") > -1 ? Qr(e, i.three) : null,
|
|
7808
|
+
s.search("light") > -1 ? fa(e, i.three) : null,
|
|
7809
|
+
r ? jr(e, i.three) : null
|
|
7806
7810
|
] })
|
|
7807
7811
|
] }) })
|
|
7808
7812
|
},
|
|
7809
7813
|
"Inspector"
|
|
7810
7814
|
);
|
|
7811
7815
|
}
|
|
7812
|
-
class
|
|
7816
|
+
class _a extends Qe {
|
|
7813
7817
|
// Renderer
|
|
7814
7818
|
autoClear = !0;
|
|
7815
7819
|
autoClearColor = !0;
|
|
@@ -7945,7 +7949,7 @@ class va extends Qe {
|
|
|
7945
7949
|
options: [
|
|
7946
7950
|
{
|
|
7947
7951
|
title: "No Color Space",
|
|
7948
|
-
value:
|
|
7952
|
+
value: Ys
|
|
7949
7953
|
},
|
|
7950
7954
|
{
|
|
7951
7955
|
title: "SRB Color Space",
|
|
@@ -7971,31 +7975,31 @@ class va extends Qe {
|
|
|
7971
7975
|
},
|
|
7972
7976
|
{
|
|
7973
7977
|
title: "Linear ",
|
|
7974
|
-
value:
|
|
7978
|
+
value: Zs
|
|
7975
7979
|
},
|
|
7976
7980
|
{
|
|
7977
7981
|
title: "Reinhard",
|
|
7978
|
-
value:
|
|
7982
|
+
value: qs
|
|
7979
7983
|
},
|
|
7980
7984
|
{
|
|
7981
7985
|
title: "Cineon ",
|
|
7982
|
-
value:
|
|
7986
|
+
value: js
|
|
7983
7987
|
},
|
|
7984
7988
|
{
|
|
7985
7989
|
title: "ACES Filmic",
|
|
7986
|
-
value:
|
|
7990
|
+
value: Ks
|
|
7987
7991
|
},
|
|
7988
7992
|
{
|
|
7989
7993
|
title: "AgX",
|
|
7990
|
-
value:
|
|
7994
|
+
value: Xs
|
|
7991
7995
|
},
|
|
7992
7996
|
{
|
|
7993
7997
|
title: "Neutral",
|
|
7994
|
-
value:
|
|
7998
|
+
value: Qs
|
|
7995
7999
|
},
|
|
7996
8000
|
{
|
|
7997
8001
|
title: "Custom",
|
|
7998
|
-
value:
|
|
8002
|
+
value: Js
|
|
7999
8003
|
}
|
|
8000
8004
|
],
|
|
8001
8005
|
onChange: (t, s) => {
|
|
@@ -8041,7 +8045,7 @@ class va extends Qe {
|
|
|
8041
8045
|
return `${this.props.three.name}_renderer`;
|
|
8042
8046
|
}
|
|
8043
8047
|
}
|
|
8044
|
-
function
|
|
8048
|
+
function ya(i) {
|
|
8045
8049
|
const [e] = L([]), [t] = L([]), [s, n] = L(0), r = (l) => {
|
|
8046
8050
|
const h = l.value;
|
|
8047
8051
|
for (let d = 0; d < e.length; d++)
|
|
@@ -8094,15 +8098,15 @@ function _a(i) {
|
|
|
8094
8098
|
}, c = (l) => {
|
|
8095
8099
|
const h = l.value.name;
|
|
8096
8100
|
for (let d = 0; d < e.length; d++) {
|
|
8097
|
-
const u = e[d],
|
|
8101
|
+
const u = e[d], p = u.name === h;
|
|
8098
8102
|
t[d] = /* @__PURE__ */ f(
|
|
8099
8103
|
je,
|
|
8100
8104
|
{
|
|
8101
8105
|
three: i.three,
|
|
8102
8106
|
label: `Scene: ${u.name}`,
|
|
8103
8107
|
scene: u,
|
|
8104
|
-
open:
|
|
8105
|
-
visible:
|
|
8108
|
+
open: p,
|
|
8109
|
+
visible: p,
|
|
8106
8110
|
onRefresh: () => {
|
|
8107
8111
|
i.three.refreshScene(u.name);
|
|
8108
8112
|
},
|
|
@@ -8113,24 +8117,23 @@ function _a(i) {
|
|
|
8113
8117
|
}
|
|
8114
8118
|
n(Date.now());
|
|
8115
8119
|
};
|
|
8116
|
-
return
|
|
8120
|
+
return pe(() => (i.three.addEventListener(R.ADD_SCENE, r), i.three.addEventListener(R.SET_SCENE, c), i.three.addEventListener(R.REFRESH_SCENE, a), i.three.addEventListener(R.REMOVE_SCENE, o), () => {
|
|
8117
8121
|
i.three.removeEventListener(R.ADD_SCENE, r), i.three.removeEventListener(R.SET_SCENE, c), i.three.removeEventListener(R.REFRESH_SCENE, a), i.three.removeEventListener(R.REMOVE_SCENE, o);
|
|
8118
8122
|
}), []), /* @__PURE__ */ M("div", { id: "SidePanel", children: [
|
|
8119
8123
|
/* @__PURE__ */ f("div", { className: "scenes", children: t }, s),
|
|
8120
|
-
/* @__PURE__ */ f(ga, { three: i.three }),
|
|
8121
8124
|
/* @__PURE__ */ f(va, { three: i.three }),
|
|
8125
|
+
/* @__PURE__ */ f(_a, { three: i.three }),
|
|
8122
8126
|
/* @__PURE__ */ f(I, { three: i.three })
|
|
8123
8127
|
] });
|
|
8124
8128
|
}
|
|
8125
|
-
|
|
8126
|
-
|
|
8127
|
-
|
|
8128
|
-
|
|
8129
|
-
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
|
|
8133
|
-
return /* @__PURE__ */ f(ya, { children: /* @__PURE__ */ M(q, { children: [
|
|
8129
|
+
const ps = zi((i, e) => /* @__PURE__ */ M("div", { className: "editor", ref: e, style: i.style, children: [
|
|
8130
|
+
i.header && /* @__PURE__ */ f("div", { className: "header", children: i.header }),
|
|
8131
|
+
i.children,
|
|
8132
|
+
i.footer && /* @__PURE__ */ f("div", { className: "footer", children: i.footer })
|
|
8133
|
+
] }));
|
|
8134
|
+
ps.displayName = "Editor";
|
|
8135
|
+
function Ca(i) {
|
|
8136
|
+
return /* @__PURE__ */ f(ps, { children: /* @__PURE__ */ M(Y, { children: [
|
|
8134
8137
|
/* @__PURE__ */ f(
|
|
8135
8138
|
G,
|
|
8136
8139
|
{
|
|
@@ -8141,10 +8144,41 @@ function fo(i) {
|
|
|
8141
8144
|
onSceneUpdate: i.onSceneUpdate
|
|
8142
8145
|
}
|
|
8143
8146
|
),
|
|
8144
|
-
/* @__PURE__ */ f(
|
|
8147
|
+
/* @__PURE__ */ f(ya, { three: i.three })
|
|
8145
8148
|
] }) });
|
|
8146
8149
|
}
|
|
8147
|
-
|
|
8150
|
+
function go(i) {
|
|
8151
|
+
const {
|
|
8152
|
+
app: e,
|
|
8153
|
+
scenes: t = /* @__PURE__ */ new Map(),
|
|
8154
|
+
onSceneAdd: s,
|
|
8155
|
+
onSceneUpdate: n,
|
|
8156
|
+
onSceneResize: r,
|
|
8157
|
+
renderEditor: a,
|
|
8158
|
+
onLoad: o,
|
|
8159
|
+
renderLoading: c = null,
|
|
8160
|
+
children: l
|
|
8161
|
+
} = i, [h, d] = L(!1);
|
|
8162
|
+
if (pe(() => {
|
|
8163
|
+
e.detectSettings().then(() => {
|
|
8164
|
+
o ? o(e).then(() => d(!0)) : d(!0);
|
|
8165
|
+
});
|
|
8166
|
+
}, []), !h) return /* @__PURE__ */ f(Y, { children: c });
|
|
8167
|
+
const u = e.components.get("three");
|
|
8168
|
+
return e.editor ? a ? /* @__PURE__ */ f(Y, { children: a(e, u) }) : /* @__PURE__ */ f(
|
|
8169
|
+
Ca,
|
|
8170
|
+
{
|
|
8171
|
+
three: u,
|
|
8172
|
+
scenes: t,
|
|
8173
|
+
onSceneAdd: (p) => {
|
|
8174
|
+
s && s(p, e, G.instance?.renderer);
|
|
8175
|
+
},
|
|
8176
|
+
onSceneUpdate: n,
|
|
8177
|
+
onSceneResize: r
|
|
8178
|
+
}
|
|
8179
|
+
) : /* @__PURE__ */ f(Y, { children: l?.(e) });
|
|
8180
|
+
}
|
|
8181
|
+
const ba = `#include <common>
|
|
8148
8182
|
#include <batching_pars_vertex>
|
|
8149
8183
|
#include <uv_pars_vertex>
|
|
8150
8184
|
#include <color_pars_vertex>
|
|
@@ -8174,7 +8208,7 @@ void main() {
|
|
|
8174
8208
|
#include <logdepthbuf_vertex>
|
|
8175
8209
|
#include <clipping_planes_vertex>
|
|
8176
8210
|
#include <worldpos_vertex>
|
|
8177
|
-
}`,
|
|
8211
|
+
}`, Ea = `
|
|
8178
8212
|
uniform float opacity;
|
|
8179
8213
|
#include <common>
|
|
8180
8214
|
#include <uv_pars_fragment>
|
|
@@ -8185,7 +8219,7 @@ void main() {
|
|
|
8185
8219
|
if (opacity < 0.015) discard;
|
|
8186
8220
|
gl_FragColor = vec4(vec3(vUv, 0.0), opacity);
|
|
8187
8221
|
}`;
|
|
8188
|
-
class
|
|
8222
|
+
class vo extends is {
|
|
8189
8223
|
constructor() {
|
|
8190
8224
|
super({
|
|
8191
8225
|
defines: {
|
|
@@ -8194,95 +8228,96 @@ class go extends ts {
|
|
|
8194
8228
|
uniforms: {
|
|
8195
8229
|
opacity: { value: 1 }
|
|
8196
8230
|
},
|
|
8197
|
-
vertexShader:
|
|
8198
|
-
fragmentShader:
|
|
8231
|
+
vertexShader: ba,
|
|
8232
|
+
fragmentShader: Ea,
|
|
8199
8233
|
transparent: !0
|
|
8200
8234
|
});
|
|
8201
8235
|
}
|
|
8202
8236
|
}
|
|
8203
8237
|
export {
|
|
8204
8238
|
je as Accordion,
|
|
8205
|
-
|
|
8206
|
-
|
|
8207
|
-
|
|
8239
|
+
po as Application,
|
|
8240
|
+
os as BaseRemote,
|
|
8241
|
+
hs as ChildObject,
|
|
8208
8242
|
Pt as ContainerObject,
|
|
8209
|
-
|
|
8210
|
-
|
|
8211
|
-
|
|
8212
|
-
|
|
8213
|
-
|
|
8214
|
-
|
|
8215
|
-
|
|
8216
|
-
|
|
8243
|
+
la as DepthNodeMaterial,
|
|
8244
|
+
Rr as Draggable,
|
|
8245
|
+
Ar as DraggableItem,
|
|
8246
|
+
Pr as Dropdown,
|
|
8247
|
+
Dr as DropdownItem,
|
|
8248
|
+
ps as Editor,
|
|
8249
|
+
ho as ElementProxy,
|
|
8250
|
+
yr as ElementProxyReceiver,
|
|
8217
8251
|
ce as ExportTexture,
|
|
8218
|
-
|
|
8219
|
-
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
|
|
8223
|
-
|
|
8252
|
+
go as HermesApp,
|
|
8253
|
+
ka as ImageSequenceCapturer,
|
|
8254
|
+
ra as InfiniteGridHelper,
|
|
8255
|
+
oa as InfiniteGridHelperGPU,
|
|
8256
|
+
na as InfiniteGridMaterial,
|
|
8257
|
+
aa as InfiniteGridNodeMaterial,
|
|
8258
|
+
va as Inspector,
|
|
8224
8259
|
G as MultiView,
|
|
8225
|
-
|
|
8226
|
-
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8260
|
+
cs as NavButton,
|
|
8261
|
+
uo as ProxyManager,
|
|
8262
|
+
mo as RemoteTheatre,
|
|
8263
|
+
fo as RemoteThree,
|
|
8264
|
+
ya as SidePanel,
|
|
8230
8265
|
Bt as Spline,
|
|
8231
|
-
|
|
8232
|
-
|
|
8266
|
+
da as SplineEditor,
|
|
8267
|
+
Ca as ThreeEditor,
|
|
8233
8268
|
$ as Transform,
|
|
8234
|
-
|
|
8235
|
-
|
|
8236
|
-
|
|
8237
|
-
|
|
8238
|
-
|
|
8239
|
-
|
|
8240
|
-
|
|
8241
|
-
|
|
8269
|
+
vo as UVMaterial,
|
|
8270
|
+
ca as UVNodeMaterial,
|
|
8271
|
+
co as WebworkerEventHandlers,
|
|
8272
|
+
cr as anchorGeometry,
|
|
8273
|
+
Ka as anchorGeometryTL,
|
|
8274
|
+
Ya as animateObjectMaterial,
|
|
8275
|
+
Wa as animateObjectTransform,
|
|
8276
|
+
lr as applyObjectMaterial,
|
|
8242
8277
|
mt as capitalize,
|
|
8243
|
-
|
|
8244
|
-
|
|
8278
|
+
ye as clamp,
|
|
8279
|
+
oo as clearComposerGroups,
|
|
8245
8280
|
yi as colorToHex,
|
|
8246
|
-
|
|
8247
|
-
|
|
8248
|
-
|
|
8249
|
-
|
|
8250
|
-
|
|
8251
|
-
|
|
8252
|
-
|
|
8253
|
-
|
|
8281
|
+
Wn as copyToClipboard,
|
|
8282
|
+
eo as createMask,
|
|
8283
|
+
Ba as cubicBezier,
|
|
8284
|
+
$a as customizeTheatreElements,
|
|
8285
|
+
za as damp,
|
|
8286
|
+
La as defaultTheatreCallback,
|
|
8287
|
+
Qn as detectMaxFrameRate,
|
|
8288
|
+
Jn as detectSettings,
|
|
8254
8289
|
ie as dispose,
|
|
8255
|
-
|
|
8290
|
+
as as disposeMaterial,
|
|
8256
8291
|
Oi as disposeTexture,
|
|
8257
|
-
|
|
8258
|
-
|
|
8259
|
-
|
|
8260
|
-
|
|
8261
|
-
|
|
8292
|
+
Fa as distance,
|
|
8293
|
+
lo as generateCubemap,
|
|
8294
|
+
Ha as getAngle,
|
|
8295
|
+
or as getObjectMaterialObject,
|
|
8296
|
+
ar as getObjectMaterialProps,
|
|
8262
8297
|
We as hierarchyUUID,
|
|
8263
|
-
|
|
8264
|
-
|
|
8265
|
-
|
|
8266
|
-
|
|
8298
|
+
ao as inspectComposer,
|
|
8299
|
+
hr as inspectComposerPass,
|
|
8300
|
+
Yn as isColor,
|
|
8301
|
+
Na as map,
|
|
8267
8302
|
Xe as mix,
|
|
8268
8303
|
pt as noop,
|
|
8269
8304
|
Zt as normalize,
|
|
8270
|
-
|
|
8271
|
-
|
|
8305
|
+
Za as orthoCamera,
|
|
8306
|
+
qa as parseModelLite,
|
|
8272
8307
|
W as randomID,
|
|
8273
|
-
|
|
8308
|
+
ja as renderToTexture,
|
|
8274
8309
|
nt as resetThreeObjects,
|
|
8275
|
-
|
|
8310
|
+
Va as rgbaToHex,
|
|
8276
8311
|
te as roundTo,
|
|
8277
|
-
|
|
8278
|
-
|
|
8279
|
-
|
|
8280
|
-
|
|
8281
|
-
|
|
8312
|
+
so as setMaterialBlendAdd,
|
|
8313
|
+
no as setMaterialBlendMultiply,
|
|
8314
|
+
io as setMaterialBlendNormal,
|
|
8315
|
+
ro as setMaterialBlendScreen,
|
|
8316
|
+
Ja as supportsOffscreenCanvas,
|
|
8282
8317
|
qt as totalThreeObjects,
|
|
8283
8318
|
Jt as triangle,
|
|
8284
|
-
|
|
8285
|
-
|
|
8286
|
-
|
|
8287
|
-
|
|
8319
|
+
Xa as updateCameraOrtho,
|
|
8320
|
+
Qa as updateCameraOrtho16x9,
|
|
8321
|
+
to as useMask,
|
|
8322
|
+
Ga as useStudio
|
|
8288
8323
|
};
|