@tomorrowevening/hermes 0.0.73 → 0.0.75
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 +12 -12
- package/dist/hermes.es.js +1267 -1253
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/types/editor/sidePanel/inspector/InspectGrid3.d.ts +1 -0
- package/types/editor/sidePanel/inspector/InspectGrid4.d.ts +1 -0
- package/types/editor/sidePanel/inspector/InspectImage.d.ts +1 -0
- package/types/editor/sidePanel/inspector/InspectVector2.d.ts +1 -0
package/dist/hermes.es.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { EventDispatcher as
|
2
|
-
import { Pane as
|
3
|
-
import * as
|
4
|
-
import
|
5
|
-
import { Reorder as
|
1
|
+
import { EventDispatcher as pn, Texture as gn, CubeTexture as Hn, RepeatWrapping as Vt, WebGLRenderTarget as Yn, Color as Ut, FrontSide as Vn, BackSide as vn, DoubleSide as bn, NoBlending as qn, NormalBlending as Kn, AdditiveBlending as Xn, SubtractiveBlending as Zn, MultiplyBlending as Jn, CustomBlending as Qn, AddEquation as ea, SubtractEquation as ta, ReverseSubtractEquation as na, MinEquation as aa, MaxEquation as ia, ZeroFactor as yn, OneFactor as En, SrcColorFactor as xn, OneMinusSrcColorFactor as Sn, SrcAlphaFactor as Cn, OneMinusSrcAlphaFactor as wn, DstAlphaFactor as Mn, OneMinusDstAlphaFactor as On, DstColorFactor as Tn, OneMinusDstColorFactor as Rn, SrcAlphaSaturateFactor as ra, ConstantColorFactor as _n, OneMinusConstantColorFactor as kn, ConstantAlphaFactor as Dn, OneMinusConstantAlphaFactor as Pn, Matrix4 as sa, Vector3 as Q, Euler as oa, Line as ca, BufferGeometry as qt, Float32BufferAttribute as Kt, LineBasicMaterial as la, Mesh as An, MeshBasicMaterial as jn, Ray as ua, Plane as da, MathUtils as ha, MOUSE as it, TOUCH as rt, Quaternion as Xt, Spherical as Zt, Vector2 as ge, ShaderMaterial as In, GLSL3 as fa, PlaneGeometry as ma, Scene as pa, Group as ga, AxesHelper as Jt, MeshDepthMaterial as va, MeshNormalMaterial as ba, WebGLRenderer as ya, PerspectiveCamera as Pt, Raycaster as Ea, OrthographicCamera as Qt, CameraHelper as xa, SpotLightHelper as Sa, PointLightHelper as Ca, HemisphereLightHelper as wa, DirectionalLightHelper as Ma } from "three";
|
2
|
+
import { Pane as Oa } from "tweakpane";
|
3
|
+
import * as Ta from "@tweakpane/plugin-essentials";
|
4
|
+
import Nn, { useState as G, useRef as V, useEffect as Re, useMemo as oe, forwardRef as Ra } from "react";
|
5
|
+
import { Reorder as Ln } from "framer-motion";
|
6
6
|
const $t = () => {
|
7
7
|
}, ki = () => {
|
8
8
|
};
|
@@ -22,18 +22,18 @@ function Di(e, n) {
|
|
22
22
|
const a = e - n;
|
23
23
|
return Math.sqrt(a * a);
|
24
24
|
}
|
25
|
-
function
|
25
|
+
function _a() {
|
26
26
|
return Math.round(Math.random() * 1e6).toString();
|
27
27
|
}
|
28
|
-
function
|
28
|
+
function ka(e) {
|
29
29
|
return e.r !== void 0 && e.g !== void 0 && e.b !== void 0;
|
30
30
|
}
|
31
|
-
function
|
31
|
+
function Da(e) {
|
32
32
|
const n = Math.round(e.r * 255), a = Math.round(e.g * 255), t = Math.round(e.b * 255), i = (h) => {
|
33
|
-
const
|
34
|
-
return
|
35
|
-
},
|
36
|
-
return "#" +
|
33
|
+
const d = h.toString(16);
|
34
|
+
return d.length === 1 ? "0" + d : d;
|
35
|
+
}, c = i(n), u = i(a), r = i(t);
|
36
|
+
return "#" + c + u + r;
|
37
37
|
}
|
38
38
|
function nn(e, n = 1) {
|
39
39
|
return Number(e.toFixed(n));
|
@@ -59,7 +59,7 @@ const an = () => {
|
|
59
59
|
e.children.forEach((a) => Lt(a));
|
60
60
|
}, Pi = (e) => {
|
61
61
|
e?.dispose();
|
62
|
-
},
|
62
|
+
}, Pa = (e) => {
|
63
63
|
e && (Array.isArray(e) ? e.forEach((n) => n.dispose()) : e.dispose());
|
64
64
|
}, Ot = (e) => {
|
65
65
|
if (e) {
|
@@ -69,7 +69,7 @@ const an = () => {
|
|
69
69
|
}
|
70
70
|
if (e.parent && e.parent.remove(e), e.isMesh) {
|
71
71
|
const n = e;
|
72
|
-
n.geometry?.dispose(),
|
72
|
+
n.geometry?.dispose(), Pa(n.material);
|
73
73
|
}
|
74
74
|
e.dispose !== void 0 && e.dispose();
|
75
75
|
}
|
@@ -132,7 +132,7 @@ class Ai {
|
|
132
132
|
n && (this._mode = "editor");
|
133
133
|
}
|
134
134
|
}
|
135
|
-
const
|
135
|
+
const P = new pn(), A = {
|
136
136
|
CUSTOM: "ToolEvents::custom",
|
137
137
|
// Components
|
138
138
|
SELECT_DROPDOWN: "ToolEvents::selectDropdown",
|
@@ -186,10 +186,10 @@ class ji extends Tt {
|
|
186
186
|
handleApp(n, a, t) {
|
187
187
|
switch (t.event) {
|
188
188
|
case "selectComponent":
|
189
|
-
|
189
|
+
P.dispatchEvent({ type: A.SELECT_DROPDOWN, value: t.data });
|
190
190
|
break;
|
191
191
|
case "draggableListUpdate":
|
192
|
-
|
192
|
+
P.dispatchEvent({ type: A.DRAG_UPDATE, value: t.data });
|
193
193
|
break;
|
194
194
|
}
|
195
195
|
}
|
@@ -244,26 +244,26 @@ class zt extends Tt {
|
|
244
244
|
t.search(`${n}_`) > -1 && this.unsubscribe(a);
|
245
245
|
});
|
246
246
|
}
|
247
|
-
sheetObject(n, a, t, i,
|
247
|
+
sheetObject(n, a, t, i, c) {
|
248
248
|
if (this.project === void 0) {
|
249
249
|
console.error("Theatre Project hasn't been created yet.");
|
250
250
|
return;
|
251
251
|
}
|
252
|
-
const
|
253
|
-
if (
|
252
|
+
const u = this.sheet(n, c);
|
253
|
+
if (u === void 0)
|
254
254
|
return;
|
255
|
-
const h = `${this.getSheetInstance(n,
|
256
|
-
let
|
257
|
-
|
258
|
-
const f =
|
255
|
+
const h = `${this.getSheetInstance(n, c)}_${a}`;
|
256
|
+
let d = this.sheetObjects.get(h);
|
257
|
+
d !== void 0 ? d = u.object(a, { ...t, ...d.value }, { reconfigure: !0 }) : d = u.object(a, t), this.sheetObjects.set(h, d), this.sheetObjectCBs.set(h, i !== void 0 ? i : $t);
|
258
|
+
const f = d.onValuesChange((m) => {
|
259
259
|
if (this.app.editor) {
|
260
|
-
for (const
|
261
|
-
const
|
262
|
-
typeof
|
263
|
-
r:
|
264
|
-
g:
|
265
|
-
b:
|
266
|
-
a:
|
260
|
+
for (const x in m) {
|
261
|
+
const _ = m[x];
|
262
|
+
typeof _ == "object" && ka(_) && (m[x] = {
|
263
|
+
r: _.r,
|
264
|
+
g: _.g,
|
265
|
+
b: _.b,
|
266
|
+
a: _.a
|
267
267
|
});
|
268
268
|
}
|
269
269
|
this.app.send({
|
@@ -276,10 +276,10 @@ class zt extends Tt {
|
|
276
276
|
}
|
277
277
|
});
|
278
278
|
}
|
279
|
-
const
|
280
|
-
|
279
|
+
const v = this.sheetObjectCBs.get(h);
|
280
|
+
v !== void 0 && v(m);
|
281
281
|
});
|
282
|
-
return this.sheetObjectUnsubscribe.set(h, f),
|
282
|
+
return this.sheetObjectUnsubscribe.set(h, f), d;
|
283
283
|
}
|
284
284
|
unsubscribe(n) {
|
285
285
|
if (this.project === void 0) {
|
@@ -288,24 +288,24 @@ class zt extends Tt {
|
|
288
288
|
}
|
289
289
|
const a = n.address.sheetId, t = n.address.objectKey;
|
290
290
|
this.sheets.get(a)?.detachObject(t);
|
291
|
-
const
|
292
|
-
|
291
|
+
const c = `${a}_${t}`, u = this.sheetObjectUnsubscribe.get(c);
|
292
|
+
u !== void 0 && (this.sheetObjects.delete(c), this.sheetObjectCBs.delete(c), this.sheetObjectUnsubscribe.delete(c), u());
|
293
293
|
}
|
294
294
|
handleApp(n, a, t) {
|
295
295
|
const i = a;
|
296
|
-
let
|
296
|
+
let c;
|
297
297
|
switch (t.event) {
|
298
298
|
case "setSheet":
|
299
|
-
|
299
|
+
c = i.sheets.get(t.data.sheet), c !== void 0 && (i.activeSheet = c, this.studio?.setSelection([c]));
|
300
300
|
break;
|
301
301
|
case "setSheetObject":
|
302
|
-
|
302
|
+
c = i.sheetObjects.get(`${t.data.sheet}_${t.data.key}`), c !== void 0 && this.studio?.setSelection([c]);
|
303
303
|
break;
|
304
304
|
case "updateSheetObject":
|
305
|
-
|
305
|
+
c = i.sheets.get(t.data.sheet), c !== void 0 && c.sequence.pause(), c = i.sheetObjectCBs.get(t.data.sheetObject), c !== void 0 && c(t.data.values);
|
306
306
|
break;
|
307
307
|
case "updateTimeline":
|
308
|
-
|
308
|
+
c = i.sheets.get(t.data.sheet), i.activeSheet !== void 0 && (i.activeSheet.sequence.position = t.data.position);
|
309
309
|
break;
|
310
310
|
}
|
311
311
|
}
|
@@ -324,92 +324,92 @@ class zt extends Tt {
|
|
324
324
|
}
|
325
325
|
handleEditorApp(n, a) {
|
326
326
|
if (n.editor) {
|
327
|
-
this.studio?.ui.restore(), this.studio?.onSelectionChange((
|
328
|
-
|
329
|
-
let h = r.address.sheetId,
|
327
|
+
this.studio?.ui.restore(), this.studio?.onSelectionChange((u) => {
|
328
|
+
u.length < 1 || u.forEach((r) => {
|
329
|
+
let h = r.address.sheetId, d = "setSheet", f = {};
|
330
330
|
switch (r.type) {
|
331
331
|
case "Theatre_Sheet_PublicAPI":
|
332
|
-
|
332
|
+
d = "setSheet", f = {
|
333
333
|
sheet: r.address.sheetId
|
334
334
|
}, a.activeSheet = a.sheets.get(r.address.sheetId);
|
335
335
|
break;
|
336
336
|
case "Theatre_SheetObject_PublicAPI":
|
337
|
-
|
337
|
+
d = "setSheetObject", h += `_${r.address.objectKey}`, f = {
|
338
338
|
id: h,
|
339
339
|
sheet: r.address.sheetId,
|
340
340
|
key: r.address.objectKey
|
341
341
|
}, a.activeSheet = a.sheets.get(r.address.sheetId);
|
342
342
|
break;
|
343
343
|
}
|
344
|
-
n.send({ event:
|
344
|
+
n.send({ event: d, target: "app", data: f });
|
345
345
|
});
|
346
346
|
});
|
347
347
|
let t = -1;
|
348
348
|
const i = () => {
|
349
349
|
if (zt.rafDriver?.tick(performance.now()), a.activeSheet !== void 0 && t !== a.activeSheet.sequence.position) {
|
350
350
|
t = a.activeSheet.sequence.position;
|
351
|
-
const
|
351
|
+
const u = a.activeSheet;
|
352
352
|
n.send({
|
353
353
|
event: "updateTimeline",
|
354
354
|
target: "app",
|
355
355
|
data: {
|
356
356
|
position: t,
|
357
|
-
sheet:
|
357
|
+
sheet: u.address.sheetId
|
358
358
|
}
|
359
359
|
});
|
360
360
|
}
|
361
|
-
},
|
362
|
-
i(), requestAnimationFrame(
|
361
|
+
}, c = () => {
|
362
|
+
i(), requestAnimationFrame(c);
|
363
363
|
};
|
364
|
-
i(),
|
364
|
+
i(), c();
|
365
365
|
} else
|
366
366
|
this.studio?.ui.hide();
|
367
367
|
}
|
368
368
|
}
|
369
369
|
function Ii(e, n, a) {
|
370
370
|
if (e.editor) {
|
371
|
-
a.ui.restore(), a.onSelectionChange((
|
372
|
-
|
373
|
-
let h = r.address.sheetId,
|
371
|
+
a.ui.restore(), a.onSelectionChange((u) => {
|
372
|
+
u.length < 1 || u.forEach((r) => {
|
373
|
+
let h = r.address.sheetId, d = "setSheet", f = {};
|
374
374
|
switch (r.type) {
|
375
375
|
case "Theatre_Sheet_PublicAPI":
|
376
|
-
|
376
|
+
d = "setSheet", f = {
|
377
377
|
sheet: r.address.sheetId
|
378
378
|
}, n.activeSheet = n.sheets.get(r.address.sheetId);
|
379
379
|
break;
|
380
380
|
case "Theatre_SheetObject_PublicAPI":
|
381
|
-
|
381
|
+
d = "setSheetObject", h += `_${r.address.objectKey}`, f = {
|
382
382
|
id: h,
|
383
383
|
sheet: r.address.sheetId,
|
384
384
|
key: r.address.objectKey
|
385
385
|
}, n.activeSheet = n.sheets.get(r.address.sheetId);
|
386
386
|
break;
|
387
387
|
}
|
388
|
-
e.send({ event:
|
388
|
+
e.send({ event: d, target: "app", data: f });
|
389
389
|
});
|
390
390
|
});
|
391
391
|
let t = -1;
|
392
392
|
const i = () => {
|
393
393
|
if (zt.rafDriver?.tick(performance.now()), n.activeSheet !== void 0 && t !== n.activeSheet.sequence.position) {
|
394
394
|
t = n.activeSheet.sequence.position;
|
395
|
-
const
|
395
|
+
const u = n.activeSheet;
|
396
396
|
e.send({
|
397
397
|
event: "updateTimeline",
|
398
398
|
target: "app",
|
399
399
|
data: {
|
400
400
|
position: t,
|
401
|
-
sheet:
|
401
|
+
sheet: u.address.sheetId
|
402
402
|
}
|
403
403
|
});
|
404
404
|
}
|
405
|
-
},
|
406
|
-
i(), requestAnimationFrame(
|
405
|
+
}, c = () => {
|
406
|
+
i(), requestAnimationFrame(c);
|
407
407
|
};
|
408
|
-
i(),
|
408
|
+
i(), c();
|
409
409
|
} else
|
410
410
|
a.ui.hide();
|
411
411
|
}
|
412
|
-
function
|
412
|
+
function Aa(e) {
|
413
413
|
if (e.name === "cameras")
|
414
414
|
return "camera";
|
415
415
|
if (e.name === "interactive")
|
@@ -434,7 +434,7 @@ function St(e) {
|
|
434
434
|
n.children.push(St(a));
|
435
435
|
}), n;
|
436
436
|
}
|
437
|
-
function
|
437
|
+
function ja(e) {
|
438
438
|
const n = {};
|
439
439
|
for (const a in e) {
|
440
440
|
const t = e[a].value;
|
@@ -450,7 +450,7 @@ function Aa(e) {
|
|
450
450
|
}
|
451
451
|
return n;
|
452
452
|
}
|
453
|
-
function
|
453
|
+
function Ia(e) {
|
454
454
|
switch (e) {
|
455
455
|
case "blendSrcAlpha":
|
456
456
|
case "blendDstAlpha":
|
@@ -465,7 +465,7 @@ function ja(e) {
|
|
465
465
|
function st(e) {
|
466
466
|
const n = {};
|
467
467
|
for (const a in e) {
|
468
|
-
if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" ||
|
468
|
+
if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" || Ia(a))
|
469
469
|
continue;
|
470
470
|
const t = typeof e[a], i = e[a];
|
471
471
|
switch (t) {
|
@@ -477,21 +477,21 @@ function st(e) {
|
|
477
477
|
case "object":
|
478
478
|
if (i !== null)
|
479
479
|
if (n[a] = i, i.isTexture)
|
480
|
-
if (i instanceof
|
481
|
-
const
|
480
|
+
if (i instanceof gn) {
|
481
|
+
const u = i.source.toJSON().url;
|
482
482
|
n[a] = {
|
483
|
-
src:
|
483
|
+
src: u,
|
484
484
|
offset: [i.offset.x, i.offset.y],
|
485
485
|
repeat: [i.repeat.x, i.repeat.y]
|
486
486
|
};
|
487
487
|
} else
|
488
|
-
i instanceof
|
488
|
+
i instanceof Hn && (console.log("env map"), console.log(i.source.data), console.log(i.source.toJSON()), n[a] = {
|
489
489
|
src: "",
|
490
490
|
offset: [i.offset.x, i.offset.y],
|
491
491
|
repeat: [i.repeat.x, i.repeat.y]
|
492
492
|
});
|
493
493
|
else
|
494
|
-
a === "uniforms" && (n[a] =
|
494
|
+
a === "uniforms" && (n[a] = ja(n[a]));
|
495
495
|
else
|
496
496
|
n[a] = {
|
497
497
|
src: "",
|
@@ -530,8 +530,8 @@ function At(e) {
|
|
530
530
|
const t = e;
|
531
531
|
if (Array.isArray(t.material)) {
|
532
532
|
const i = [];
|
533
|
-
t.material.forEach((
|
534
|
-
i.push(st(
|
533
|
+
t.material.forEach((c) => {
|
534
|
+
i.push(st(c));
|
535
535
|
}), n.material = i;
|
536
536
|
} else
|
537
537
|
n.material = st(t.material);
|
@@ -539,8 +539,8 @@ function At(e) {
|
|
539
539
|
const t = e;
|
540
540
|
if (Array.isArray(t.material)) {
|
541
541
|
const i = [];
|
542
|
-
t.material.forEach((
|
543
|
-
i.push(st(
|
542
|
+
t.material.forEach((c) => {
|
543
|
+
i.push(st(c));
|
544
544
|
}), n.material = i;
|
545
545
|
} else
|
546
546
|
n.material = st(t.material);
|
@@ -548,8 +548,8 @@ function At(e) {
|
|
548
548
|
const t = e;
|
549
549
|
if (Array.isArray(t.material)) {
|
550
550
|
const i = [];
|
551
|
-
t.material.forEach((
|
552
|
-
i.push(st(
|
551
|
+
t.material.forEach((c) => {
|
552
|
+
i.push(st(c));
|
553
553
|
}), n.material = i;
|
554
554
|
} else
|
555
555
|
n.material = st(t.material);
|
@@ -584,7 +584,7 @@ function At(e) {
|
|
584
584
|
});
|
585
585
|
return n;
|
586
586
|
}
|
587
|
-
function
|
587
|
+
function Na(e, n) {
|
588
588
|
const a = n.split(".");
|
589
589
|
switch (a.length) {
|
590
590
|
case 1:
|
@@ -601,11 +601,11 @@ function Ia(e, n) {
|
|
601
601
|
return e[a[0]][a[1]][a[2]][a[3]][a[4]][a[5]];
|
602
602
|
}
|
603
603
|
}
|
604
|
-
function
|
604
|
+
function La(e, n) {
|
605
605
|
for (const a in n)
|
606
606
|
e[a] = n[a];
|
607
607
|
}
|
608
|
-
function
|
608
|
+
function ne(e, n, a) {
|
609
609
|
if (e === void 0) {
|
610
610
|
console.log(`Hermes - Can't set props: ${n}`, a);
|
611
611
|
return;
|
@@ -630,32 +630,32 @@ function te(e, n, a) {
|
|
630
630
|
break;
|
631
631
|
}
|
632
632
|
else {
|
633
|
-
let
|
633
|
+
let u;
|
634
634
|
switch (i) {
|
635
635
|
case 1:
|
636
|
-
|
636
|
+
u = e[t[0]];
|
637
637
|
break;
|
638
638
|
case 2:
|
639
|
-
|
639
|
+
u = e[t[0]][t[1]];
|
640
640
|
break;
|
641
641
|
case 3:
|
642
|
-
|
642
|
+
u = e[t[0]][t[1]][t[2]];
|
643
643
|
break;
|
644
644
|
case 4:
|
645
|
-
|
645
|
+
u = e[t[0]][t[1]][t[2]][t[3]];
|
646
646
|
break;
|
647
647
|
case 5:
|
648
|
-
|
648
|
+
u = e[t[0]][t[1]][t[2]][t[3]][t[4]];
|
649
649
|
break;
|
650
650
|
}
|
651
|
-
|
651
|
+
u != null && La(u, a);
|
652
652
|
}
|
653
653
|
}
|
654
|
-
function
|
654
|
+
function Bn(e) {
|
655
655
|
return new Promise((n, a) => {
|
656
656
|
const t = new Image();
|
657
657
|
t.onload = () => {
|
658
|
-
const i = new
|
658
|
+
const i = new gn(t);
|
659
659
|
i.wrapS = Vt, i.wrapT = Vt, i.needsUpdate = !0, n(i);
|
660
660
|
}, t.onerror = a, t.src = e;
|
661
661
|
});
|
@@ -785,38 +785,38 @@ class Ni extends Tt {
|
|
785
785
|
handleApp(n, a, t) {
|
786
786
|
switch (t.event) {
|
787
787
|
case "getObject":
|
788
|
-
|
788
|
+
P.dispatchEvent({ type: A.GET_OBJECT, value: t.data });
|
789
789
|
break;
|
790
790
|
case "updateObject":
|
791
|
-
|
791
|
+
P.dispatchEvent({ type: A.UPDATE_OBJECT, value: t.data });
|
792
792
|
break;
|
793
793
|
case "createTexture":
|
794
|
-
|
794
|
+
P.dispatchEvent({ type: A.CREATE_TEXTURE, value: t.data });
|
795
795
|
break;
|
796
796
|
case "requestMethod":
|
797
|
-
|
797
|
+
P.dispatchEvent({ type: A.REQUEST_METHOD, value: t.data });
|
798
798
|
break;
|
799
799
|
}
|
800
800
|
}
|
801
801
|
handleEditor(n, a, t) {
|
802
802
|
switch (t.event) {
|
803
803
|
case "setObject":
|
804
|
-
|
804
|
+
P.dispatchEvent({ type: A.SET_OBJECT, value: t.data });
|
805
805
|
break;
|
806
806
|
case "addScene":
|
807
|
-
|
807
|
+
P.dispatchEvent({ type: A.ADD_SCENE, value: t.data });
|
808
808
|
break;
|
809
809
|
case "removeScene":
|
810
|
-
|
810
|
+
P.dispatchEvent({ type: A.REMOVE_SCENE, value: t.data });
|
811
811
|
break;
|
812
812
|
case "setScene":
|
813
|
-
|
813
|
+
P.dispatchEvent({ type: A.SET_SCENE, value: t.data });
|
814
814
|
break;
|
815
815
|
case "addCamera":
|
816
|
-
|
816
|
+
P.dispatchEvent({ type: A.ADD_CAMERA, value: t.data });
|
817
817
|
break;
|
818
818
|
case "removeCamera":
|
819
|
-
|
819
|
+
P.dispatchEvent({ type: A.REMOVE_CAMERA, value: t.data });
|
820
820
|
break;
|
821
821
|
}
|
822
822
|
}
|
@@ -824,7 +824,7 @@ class Ni extends Tt {
|
|
824
824
|
rendererWidth = 300;
|
825
825
|
rendererHeight = 150;
|
826
826
|
addRT(n, a) {
|
827
|
-
const t = new
|
827
|
+
const t = new Yn(32, 32, a);
|
828
828
|
t.texture.name = n, this.renderTargets.set(n, t);
|
829
829
|
}
|
830
830
|
resize(n, a) {
|
@@ -860,7 +860,7 @@ class Li extends Tt {
|
|
860
860
|
super(n), this.bindCBs = /* @__PURE__ */ new Map(), this.buttonCBs = /* @__PURE__ */ new Map(), n.editor && this.createGUI();
|
861
861
|
}
|
862
862
|
createGUI() {
|
863
|
-
this.pane = new
|
863
|
+
this.pane = new Oa({ title: "GUI" }), this.pane.registerPlugin(Ta);
|
864
864
|
}
|
865
865
|
dispose() {
|
866
866
|
this.bindCBs.clear(), this.buttonCBs.clear(), this.appCallbacks = 0, this.editorCallbacks = 0, this.app.editor && (this.pane?.dispose(), this.pane = void 0);
|
@@ -886,13 +886,13 @@ class Li extends Tt {
|
|
886
886
|
}
|
887
887
|
// Binding
|
888
888
|
bind(n, a, t, i = void 0) {
|
889
|
-
const
|
890
|
-
this.bindCBs.set(
|
889
|
+
const c = this.bindID, u = t.onChange !== void 0 ? t.onChange : $t;
|
890
|
+
this.bindCBs.set(c, u), this.app.editor ? (this.pane === void 0 && this.createGUI(), (i !== void 0 ? i : this.pane).addBinding(n, a, t).on("change", (h) => {
|
891
891
|
this.app.send({
|
892
892
|
event: "updateBind",
|
893
893
|
target: "app",
|
894
894
|
data: {
|
895
|
-
id:
|
895
|
+
id: c,
|
896
896
|
value: h.value
|
897
897
|
}
|
898
898
|
});
|
@@ -900,7 +900,7 @@ class Li extends Tt {
|
|
900
900
|
event: "bindObject",
|
901
901
|
target: "app",
|
902
902
|
data: {
|
903
|
-
id:
|
903
|
+
id: c,
|
904
904
|
name: a,
|
905
905
|
params: t,
|
906
906
|
parent: i
|
@@ -978,22 +978,22 @@ var Bt = { exports: {} }, dt = {};
|
|
978
978
|
* LICENSE file in the root directory of this source tree.
|
979
979
|
*/
|
980
980
|
var rn;
|
981
|
-
function
|
981
|
+
function Ba() {
|
982
982
|
if (rn)
|
983
983
|
return dt;
|
984
984
|
rn = 1;
|
985
|
-
var e =
|
986
|
-
function
|
987
|
-
var f, m = {},
|
988
|
-
|
985
|
+
var e = Nn, n = Symbol.for("react.element"), a = Symbol.for("react.fragment"), t = Object.prototype.hasOwnProperty, i = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
|
986
|
+
function u(r, h, d) {
|
987
|
+
var f, m = {}, v = null, x = null;
|
988
|
+
d !== void 0 && (v = "" + d), h.key !== void 0 && (v = "" + h.key), h.ref !== void 0 && (x = h.ref);
|
989
989
|
for (f in h)
|
990
|
-
t.call(h, f) && !
|
990
|
+
t.call(h, f) && !c.hasOwnProperty(f) && (m[f] = h[f]);
|
991
991
|
if (r && r.defaultProps)
|
992
992
|
for (f in h = r.defaultProps, h)
|
993
993
|
m[f] === void 0 && (m[f] = h[f]);
|
994
|
-
return { $$typeof: n, type: r, key:
|
994
|
+
return { $$typeof: n, type: r, key: v, ref: x, props: m, _owner: i.current };
|
995
995
|
}
|
996
|
-
return dt.Fragment = a, dt.jsx =
|
996
|
+
return dt.Fragment = a, dt.jsx = u, dt.jsxs = u, dt;
|
997
997
|
}
|
998
998
|
var ht = {};
|
999
999
|
/**
|
@@ -1006,56 +1006,56 @@ var ht = {};
|
|
1006
1006
|
* LICENSE file in the root directory of this source tree.
|
1007
1007
|
*/
|
1008
1008
|
var sn;
|
1009
|
-
function
|
1009
|
+
function Fa() {
|
1010
1010
|
return sn || (sn = 1, process.env.NODE_ENV !== "production" && function() {
|
1011
|
-
var e =
|
1012
|
-
function
|
1011
|
+
var e = Nn, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), t = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), r = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), v = Symbol.for("react.lazy"), x = Symbol.for("react.offscreen"), _ = Symbol.iterator, q = "@@iterator";
|
1012
|
+
function U(s) {
|
1013
1013
|
if (s === null || typeof s != "object")
|
1014
1014
|
return null;
|
1015
|
-
var p =
|
1015
|
+
var p = _ && s[_] || s[q];
|
1016
1016
|
return typeof p == "function" ? p : null;
|
1017
1017
|
}
|
1018
|
-
var
|
1019
|
-
function
|
1018
|
+
var $ = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
1019
|
+
function C(s) {
|
1020
1020
|
{
|
1021
|
-
for (var p = arguments.length, y = new Array(p > 1 ? p - 1 : 0),
|
1022
|
-
y[
|
1023
|
-
|
1021
|
+
for (var p = arguments.length, y = new Array(p > 1 ? p - 1 : 0), w = 1; w < p; w++)
|
1022
|
+
y[w - 1] = arguments[w];
|
1023
|
+
K("error", s, y);
|
1024
1024
|
}
|
1025
1025
|
}
|
1026
|
-
function
|
1026
|
+
function K(s, p, y) {
|
1027
1027
|
{
|
1028
|
-
var
|
1029
|
-
|
1030
|
-
var W = y.map(function(
|
1031
|
-
return String(
|
1028
|
+
var w = $.ReactDebugCurrentFrame, F = w.getStackAddendum();
|
1029
|
+
F !== "" && (p += "%s", y = y.concat([F]));
|
1030
|
+
var W = y.map(function(N) {
|
1031
|
+
return String(N);
|
1032
1032
|
});
|
1033
1033
|
W.unshift("Warning: " + p), Function.prototype.apply.call(console[s], console, W);
|
1034
1034
|
}
|
1035
1035
|
}
|
1036
|
-
var
|
1037
|
-
|
1036
|
+
var M = !1, Z = !1, ue = !1, H = !1, ve = !1, re;
|
1037
|
+
re = Symbol.for("react.module.reference");
|
1038
1038
|
function _e(s) {
|
1039
|
-
return !!(typeof s == "string" || typeof s == "function" || s === t || s ===
|
1039
|
+
return !!(typeof s == "string" || typeof s == "function" || s === t || s === c || ve || s === i || s === d || s === f || H || s === x || M || Z || ue || typeof s == "object" && s !== null && (s.$$typeof === v || s.$$typeof === m || s.$$typeof === u || s.$$typeof === r || s.$$typeof === h || // This needs to include all possible module reference object
|
1040
1040
|
// types supported by any Flight configuration anywhere since
|
1041
1041
|
// we don't know which Flight build this will end up being used
|
1042
1042
|
// with.
|
1043
|
-
s.$$typeof ===
|
1043
|
+
s.$$typeof === re || s.getModuleId !== void 0));
|
1044
1044
|
}
|
1045
1045
|
function ke(s, p, y) {
|
1046
|
-
var
|
1047
|
-
if (
|
1048
|
-
return
|
1049
|
-
var
|
1050
|
-
return
|
1046
|
+
var w = s.displayName;
|
1047
|
+
if (w)
|
1048
|
+
return w;
|
1049
|
+
var F = p.displayName || p.name || "";
|
1050
|
+
return F !== "" ? y + "(" + F + ")" : y;
|
1051
1051
|
}
|
1052
1052
|
function ye(s) {
|
1053
1053
|
return s.displayName || "Context";
|
1054
1054
|
}
|
1055
|
-
function
|
1055
|
+
function B(s) {
|
1056
1056
|
if (s == null)
|
1057
1057
|
return null;
|
1058
|
-
if (typeof s.tag == "number" &&
|
1058
|
+
if (typeof s.tag == "number" && C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof s == "function")
|
1059
1059
|
return s.displayName || s.name || null;
|
1060
1060
|
if (typeof s == "string")
|
1061
1061
|
return s;
|
@@ -1064,11 +1064,11 @@ function Ba() {
|
|
1064
1064
|
return "Fragment";
|
1065
1065
|
case a:
|
1066
1066
|
return "Portal";
|
1067
|
-
case
|
1067
|
+
case c:
|
1068
1068
|
return "Profiler";
|
1069
1069
|
case i:
|
1070
1070
|
return "StrictMode";
|
1071
|
-
case
|
1071
|
+
case d:
|
1072
1072
|
return "Suspense";
|
1073
1073
|
case f:
|
1074
1074
|
return "SuspenseList";
|
@@ -1078,18 +1078,18 @@ function Ba() {
|
|
1078
1078
|
case r:
|
1079
1079
|
var p = s;
|
1080
1080
|
return ye(p) + ".Consumer";
|
1081
|
-
case
|
1081
|
+
case u:
|
1082
1082
|
var y = s;
|
1083
1083
|
return ye(y._context) + ".Provider";
|
1084
1084
|
case h:
|
1085
1085
|
return ke(s, s.render, "ForwardRef");
|
1086
1086
|
case m:
|
1087
|
-
var
|
1088
|
-
return
|
1089
|
-
case
|
1090
|
-
var
|
1087
|
+
var w = s.displayName || null;
|
1088
|
+
return w !== null ? w : B(s.type) || "Memo";
|
1089
|
+
case v: {
|
1090
|
+
var F = s, W = F._payload, N = F._init;
|
1091
1091
|
try {
|
1092
|
-
return
|
1092
|
+
return B(N(W));
|
1093
1093
|
} catch {
|
1094
1094
|
return null;
|
1095
1095
|
}
|
@@ -1097,13 +1097,13 @@ function Ba() {
|
|
1097
1097
|
}
|
1098
1098
|
return null;
|
1099
1099
|
}
|
1100
|
-
var Ee = Object.assign,
|
1100
|
+
var Ee = Object.assign, R = 0, Me, De, Ie, Pe, Ae, je, qe;
|
1101
1101
|
function Ne() {
|
1102
1102
|
}
|
1103
1103
|
Ne.__reactDisabledLog = !0;
|
1104
1104
|
function Ke() {
|
1105
1105
|
{
|
1106
|
-
if (
|
1106
|
+
if (R === 0) {
|
1107
1107
|
Me = console.log, De = console.info, Ie = console.warn, Pe = console.error, Ae = console.group, je = console.groupCollapsed, qe = console.groupEnd;
|
1108
1108
|
var s = {
|
1109
1109
|
configurable: !0,
|
@@ -1121,12 +1121,12 @@ function Ba() {
|
|
1121
1121
|
groupEnd: s
|
1122
1122
|
});
|
1123
1123
|
}
|
1124
|
-
|
1124
|
+
R++;
|
1125
1125
|
}
|
1126
1126
|
}
|
1127
1127
|
function ct() {
|
1128
1128
|
{
|
1129
|
-
if (
|
1129
|
+
if (R--, R === 0) {
|
1130
1130
|
var s = {
|
1131
1131
|
configurable: !0,
|
1132
1132
|
enumerable: !0,
|
@@ -1156,18 +1156,18 @@ function Ba() {
|
|
1156
1156
|
})
|
1157
1157
|
});
|
1158
1158
|
}
|
1159
|
-
|
1159
|
+
R < 0 && C("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
1160
1160
|
}
|
1161
1161
|
}
|
1162
|
-
var Le =
|
1163
|
-
function
|
1162
|
+
var Le = $.ReactCurrentDispatcher, ae;
|
1163
|
+
function me(s, p, y) {
|
1164
1164
|
{
|
1165
1165
|
if (ae === void 0)
|
1166
1166
|
try {
|
1167
1167
|
throw Error();
|
1168
|
-
} catch (
|
1169
|
-
var
|
1170
|
-
ae =
|
1168
|
+
} catch (F) {
|
1169
|
+
var w = F.stack.trim().match(/\n( *(at )?)/);
|
1170
|
+
ae = w && w[1] || "";
|
1171
1171
|
}
|
1172
1172
|
return `
|
1173
1173
|
` + ae + s;
|
@@ -1178,7 +1178,7 @@ function Ba() {
|
|
1178
1178
|
var be = typeof WeakMap == "function" ? WeakMap : Map;
|
1179
1179
|
Be = new be();
|
1180
1180
|
}
|
1181
|
-
function
|
1181
|
+
function g(s, p) {
|
1182
1182
|
if (!s || Ue)
|
1183
1183
|
return "";
|
1184
1184
|
{
|
@@ -1186,73 +1186,73 @@ function Ba() {
|
|
1186
1186
|
if (y !== void 0)
|
1187
1187
|
return y;
|
1188
1188
|
}
|
1189
|
-
var
|
1189
|
+
var w;
|
1190
1190
|
Ue = !0;
|
1191
|
-
var
|
1191
|
+
var F = Error.prepareStackTrace;
|
1192
1192
|
Error.prepareStackTrace = void 0;
|
1193
1193
|
var W;
|
1194
1194
|
W = Le.current, Le.current = null, Ke();
|
1195
1195
|
try {
|
1196
1196
|
if (p) {
|
1197
|
-
var
|
1197
|
+
var N = function() {
|
1198
1198
|
throw Error();
|
1199
1199
|
};
|
1200
|
-
if (Object.defineProperty(
|
1200
|
+
if (Object.defineProperty(N.prototype, "props", {
|
1201
1201
|
set: function() {
|
1202
1202
|
throw Error();
|
1203
1203
|
}
|
1204
1204
|
}), typeof Reflect == "object" && Reflect.construct) {
|
1205
1205
|
try {
|
1206
|
-
Reflect.construct(
|
1206
|
+
Reflect.construct(N, []);
|
1207
1207
|
} catch (Fe) {
|
1208
|
-
|
1208
|
+
w = Fe;
|
1209
1209
|
}
|
1210
|
-
Reflect.construct(s, [],
|
1210
|
+
Reflect.construct(s, [], N);
|
1211
1211
|
} else {
|
1212
1212
|
try {
|
1213
|
-
|
1213
|
+
N.call();
|
1214
1214
|
} catch (Fe) {
|
1215
|
-
|
1215
|
+
w = Fe;
|
1216
1216
|
}
|
1217
|
-
s.call(
|
1217
|
+
s.call(N.prototype);
|
1218
1218
|
}
|
1219
1219
|
} else {
|
1220
1220
|
try {
|
1221
1221
|
throw Error();
|
1222
1222
|
} catch (Fe) {
|
1223
|
-
|
1223
|
+
w = Fe;
|
1224
1224
|
}
|
1225
1225
|
s();
|
1226
1226
|
}
|
1227
1227
|
} catch (Fe) {
|
1228
|
-
if (Fe &&
|
1228
|
+
if (Fe && w && typeof Fe.stack == "string") {
|
1229
1229
|
for (var I = Fe.stack.split(`
|
1230
|
-
`),
|
1231
|
-
`),
|
1230
|
+
`), fe = w.stack.split(`
|
1231
|
+
`), te = I.length - 1, ie = fe.length - 1; te >= 1 && ie >= 0 && I[te] !== fe[ie]; )
|
1232
1232
|
ie--;
|
1233
|
-
for (;
|
1234
|
-
if (I[
|
1235
|
-
if (
|
1233
|
+
for (; te >= 1 && ie >= 0; te--, ie--)
|
1234
|
+
if (I[te] !== fe[ie]) {
|
1235
|
+
if (te !== 1 || ie !== 1)
|
1236
1236
|
do
|
1237
|
-
if (
|
1237
|
+
if (te--, ie--, ie < 0 || I[te] !== fe[ie]) {
|
1238
1238
|
var we = `
|
1239
|
-
` + I[
|
1239
|
+
` + I[te].replace(" at new ", " at ");
|
1240
1240
|
return s.displayName && we.includes("<anonymous>") && (we = we.replace("<anonymous>", s.displayName)), typeof s == "function" && Be.set(s, we), we;
|
1241
1241
|
}
|
1242
|
-
while (
|
1242
|
+
while (te >= 1 && ie >= 0);
|
1243
1243
|
break;
|
1244
1244
|
}
|
1245
1245
|
}
|
1246
1246
|
} finally {
|
1247
|
-
Ue = !1, Le.current = W, ct(), Error.prepareStackTrace =
|
1247
|
+
Ue = !1, Le.current = W, ct(), Error.prepareStackTrace = F;
|
1248
1248
|
}
|
1249
|
-
var at = s ? s.displayName || s.name : "", Yt = at ?
|
1249
|
+
var at = s ? s.displayName || s.name : "", Yt = at ? me(at) : "";
|
1250
1250
|
return typeof s == "function" && Be.set(s, Yt), Yt;
|
1251
1251
|
}
|
1252
1252
|
function b(s, p, y) {
|
1253
|
-
return
|
1253
|
+
return g(s, !1);
|
1254
1254
|
}
|
1255
|
-
function
|
1255
|
+
function O(s) {
|
1256
1256
|
var p = s.prototype;
|
1257
1257
|
return !!(p && p.isReactComponent);
|
1258
1258
|
}
|
@@ -1260,14 +1260,14 @@ function Ba() {
|
|
1260
1260
|
if (s == null)
|
1261
1261
|
return "";
|
1262
1262
|
if (typeof s == "function")
|
1263
|
-
return
|
1263
|
+
return g(s, O(s));
|
1264
1264
|
if (typeof s == "string")
|
1265
|
-
return
|
1265
|
+
return me(s);
|
1266
1266
|
switch (s) {
|
1267
|
-
case
|
1268
|
-
return
|
1267
|
+
case d:
|
1268
|
+
return me("Suspense");
|
1269
1269
|
case f:
|
1270
|
-
return
|
1270
|
+
return me("SuspenseList");
|
1271
1271
|
}
|
1272
1272
|
if (typeof s == "object")
|
1273
1273
|
switch (s.$$typeof) {
|
@@ -1275,54 +1275,54 @@ function Ba() {
|
|
1275
1275
|
return b(s.render);
|
1276
1276
|
case m:
|
1277
1277
|
return j(s.type, p, y);
|
1278
|
-
case
|
1279
|
-
var
|
1278
|
+
case v: {
|
1279
|
+
var w = s, F = w._payload, W = w._init;
|
1280
1280
|
try {
|
1281
|
-
return j(W(
|
1281
|
+
return j(W(F), p, y);
|
1282
1282
|
} catch {
|
1283
1283
|
}
|
1284
1284
|
}
|
1285
1285
|
}
|
1286
1286
|
return "";
|
1287
1287
|
}
|
1288
|
-
var
|
1289
|
-
function
|
1288
|
+
var ce = Object.prototype.hasOwnProperty, de = {}, T = $.ReactDebugCurrentFrame;
|
1289
|
+
function S(s) {
|
1290
1290
|
if (s) {
|
1291
1291
|
var p = s._owner, y = j(s.type, s._source, p ? p.type : null);
|
1292
|
-
|
1292
|
+
T.setExtraStackFrame(y);
|
1293
1293
|
} else
|
1294
|
-
|
1294
|
+
T.setExtraStackFrame(null);
|
1295
1295
|
}
|
1296
|
-
function z(s, p, y,
|
1296
|
+
function z(s, p, y, w, F) {
|
1297
1297
|
{
|
1298
|
-
var W = Function.call.bind(
|
1299
|
-
for (var
|
1300
|
-
if (W(s,
|
1298
|
+
var W = Function.call.bind(ce);
|
1299
|
+
for (var N in s)
|
1300
|
+
if (W(s, N)) {
|
1301
1301
|
var I = void 0;
|
1302
1302
|
try {
|
1303
|
-
if (typeof s[
|
1304
|
-
var
|
1305
|
-
throw
|
1303
|
+
if (typeof s[N] != "function") {
|
1304
|
+
var fe = Error((w || "React class") + ": " + y + " type `" + N + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof s[N] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
1305
|
+
throw fe.name = "Invariant Violation", fe;
|
1306
1306
|
}
|
1307
|
-
I = s[
|
1308
|
-
} catch (
|
1309
|
-
I =
|
1307
|
+
I = s[N](p, N, w, y, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
1308
|
+
} catch (te) {
|
1309
|
+
I = te;
|
1310
1310
|
}
|
1311
|
-
I && !(I instanceof Error) && (
|
1311
|
+
I && !(I instanceof Error) && (S(F), C("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", w || "React class", y, N, typeof I), S(null)), I instanceof Error && !(I.message in de) && (de[I.message] = !0, S(F), C("Failed %s type: %s", y, I.message), S(null));
|
1312
1312
|
}
|
1313
1313
|
}
|
1314
1314
|
}
|
1315
|
-
var
|
1316
|
-
function
|
1317
|
-
return
|
1315
|
+
var J = Array.isArray;
|
1316
|
+
function k(s) {
|
1317
|
+
return J(s);
|
1318
1318
|
}
|
1319
|
-
function
|
1319
|
+
function Y(s) {
|
1320
1320
|
{
|
1321
1321
|
var p = typeof Symbol == "function" && Symbol.toStringTag, y = p && s[Symbol.toStringTag] || s.constructor.name || "Object";
|
1322
1322
|
return y;
|
1323
1323
|
}
|
1324
1324
|
}
|
1325
|
-
function
|
1325
|
+
function ee(s) {
|
1326
1326
|
try {
|
1327
1327
|
return $e(s), !1;
|
1328
1328
|
} catch {
|
@@ -1333,10 +1333,10 @@ function Ba() {
|
|
1333
1333
|
return "" + s;
|
1334
1334
|
}
|
1335
1335
|
function ze(s) {
|
1336
|
-
if (
|
1337
|
-
return
|
1336
|
+
if (ee(s))
|
1337
|
+
return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Y(s)), $e(s);
|
1338
1338
|
}
|
1339
|
-
var Ge =
|
1339
|
+
var Ge = $.ReactCurrentOwner, lt = {
|
1340
1340
|
key: !0,
|
1341
1341
|
ref: !0,
|
1342
1342
|
__self: !0,
|
@@ -1344,7 +1344,7 @@ function Ba() {
|
|
1344
1344
|
}, ut, pt, tt;
|
1345
1345
|
tt = {};
|
1346
1346
|
function _t(s) {
|
1347
|
-
if (
|
1347
|
+
if (ce.call(s, "ref")) {
|
1348
1348
|
var p = Object.getOwnPropertyDescriptor(s, "ref").get;
|
1349
1349
|
if (p && p.isReactWarning)
|
1350
1350
|
return !1;
|
@@ -1352,7 +1352,7 @@ function Ba() {
|
|
1352
1352
|
return s.ref !== void 0;
|
1353
1353
|
}
|
1354
1354
|
function kt(s) {
|
1355
|
-
if (
|
1355
|
+
if (ce.call(s, "key")) {
|
1356
1356
|
var p = Object.getOwnPropertyDescriptor(s, "key").get;
|
1357
1357
|
if (p && p.isReactWarning)
|
1358
1358
|
return !1;
|
@@ -1361,14 +1361,14 @@ function Ba() {
|
|
1361
1361
|
}
|
1362
1362
|
function Dt(s, p) {
|
1363
1363
|
if (typeof s.ref == "string" && Ge.current && p && Ge.current.stateNode !== p) {
|
1364
|
-
var y =
|
1365
|
-
tt[y] || (
|
1364
|
+
var y = B(Ge.current.type);
|
1365
|
+
tt[y] || (C('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', B(Ge.current.type), s.ref), tt[y] = !0);
|
1366
1366
|
}
|
1367
1367
|
}
|
1368
1368
|
function gt(s, p) {
|
1369
1369
|
{
|
1370
1370
|
var y = function() {
|
1371
|
-
ut || (ut = !0,
|
1371
|
+
ut || (ut = !0, C("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", p));
|
1372
1372
|
};
|
1373
1373
|
y.isReactWarning = !0, Object.defineProperty(s, "key", {
|
1374
1374
|
get: y,
|
@@ -1379,7 +1379,7 @@ function Ba() {
|
|
1379
1379
|
function We(s, p) {
|
1380
1380
|
{
|
1381
1381
|
var y = function() {
|
1382
|
-
pt || (pt = !0,
|
1382
|
+
pt || (pt = !0, C("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", p));
|
1383
1383
|
};
|
1384
1384
|
y.isReactWarning = !0, Object.defineProperty(s, "ref", {
|
1385
1385
|
get: y,
|
@@ -1387,7 +1387,7 @@ function Ba() {
|
|
1387
1387
|
});
|
1388
1388
|
}
|
1389
1389
|
}
|
1390
|
-
var Wt = function(s, p, y,
|
1390
|
+
var Wt = function(s, p, y, w, F, W, N) {
|
1391
1391
|
var I = {
|
1392
1392
|
// This tag allows us to uniquely identify this as a React Element
|
1393
1393
|
$$typeof: n,
|
@@ -1395,7 +1395,7 @@ function Ba() {
|
|
1395
1395
|
type: s,
|
1396
1396
|
key: p,
|
1397
1397
|
ref: y,
|
1398
|
-
props:
|
1398
|
+
props: N,
|
1399
1399
|
// Record the component responsible for creating this element.
|
1400
1400
|
_owner: W
|
1401
1401
|
};
|
@@ -1408,49 +1408,49 @@ function Ba() {
|
|
1408
1408
|
configurable: !1,
|
1409
1409
|
enumerable: !1,
|
1410
1410
|
writable: !1,
|
1411
|
-
value:
|
1411
|
+
value: w
|
1412
1412
|
}), Object.defineProperty(I, "_source", {
|
1413
1413
|
configurable: !1,
|
1414
1414
|
enumerable: !1,
|
1415
1415
|
writable: !1,
|
1416
|
-
value:
|
1416
|
+
value: F
|
1417
1417
|
}), Object.freeze && (Object.freeze(I.props), Object.freeze(I)), I;
|
1418
1418
|
};
|
1419
|
-
function
|
1419
|
+
function o(s, p, y, w, F) {
|
1420
1420
|
{
|
1421
|
-
var W,
|
1422
|
-
y !== void 0 && (ze(y), I = "" + y), kt(p) && (ze(p.key), I = "" + p.key), _t(p) && (
|
1421
|
+
var W, N = {}, I = null, fe = null;
|
1422
|
+
y !== void 0 && (ze(y), I = "" + y), kt(p) && (ze(p.key), I = "" + p.key), _t(p) && (fe = p.ref, Dt(p, F));
|
1423
1423
|
for (W in p)
|
1424
|
-
|
1424
|
+
ce.call(p, W) && !lt.hasOwnProperty(W) && (N[W] = p[W]);
|
1425
1425
|
if (s && s.defaultProps) {
|
1426
|
-
var
|
1427
|
-
for (W in
|
1428
|
-
|
1426
|
+
var te = s.defaultProps;
|
1427
|
+
for (W in te)
|
1428
|
+
N[W] === void 0 && (N[W] = te[W]);
|
1429
1429
|
}
|
1430
|
-
if (I ||
|
1430
|
+
if (I || fe) {
|
1431
1431
|
var ie = typeof s == "function" ? s.displayName || s.name || "Unknown" : s;
|
1432
|
-
I && gt(
|
1432
|
+
I && gt(N, ie), fe && We(N, ie);
|
1433
1433
|
}
|
1434
|
-
return Wt(s, I,
|
1434
|
+
return Wt(s, I, fe, F, w, Ge.current, N);
|
1435
1435
|
}
|
1436
1436
|
}
|
1437
|
-
var E =
|
1438
|
-
function
|
1437
|
+
var E = $.ReactCurrentOwner, D = $.ReactDebugCurrentFrame;
|
1438
|
+
function L(s) {
|
1439
1439
|
if (s) {
|
1440
1440
|
var p = s._owner, y = j(s.type, s._source, p ? p.type : null);
|
1441
|
-
|
1441
|
+
D.setExtraStackFrame(y);
|
1442
1442
|
} else
|
1443
|
-
|
1443
|
+
D.setExtraStackFrame(null);
|
1444
1444
|
}
|
1445
|
-
var
|
1446
|
-
|
1445
|
+
var se;
|
1446
|
+
se = !1;
|
1447
1447
|
function xe(s) {
|
1448
1448
|
return typeof s == "object" && s !== null && s.$$typeof === n;
|
1449
1449
|
}
|
1450
|
-
function
|
1450
|
+
function he() {
|
1451
1451
|
{
|
1452
1452
|
if (E.current) {
|
1453
|
-
var s =
|
1453
|
+
var s = B(E.current.type);
|
1454
1454
|
if (s)
|
1455
1455
|
return `
|
1456
1456
|
|
@@ -1473,7 +1473,7 @@ Check your code at ` + p + ":" + y + ".";
|
|
1473
1473
|
var vt = {};
|
1474
1474
|
function bt(s) {
|
1475
1475
|
{
|
1476
|
-
var p =
|
1476
|
+
var p = he();
|
1477
1477
|
if (!p) {
|
1478
1478
|
var y = typeof s == "string" ? s : s.displayName || s.name;
|
1479
1479
|
y && (p = `
|
@@ -1492,26 +1492,26 @@ Check the top-level render call using <` + y + ">.");
|
|
1492
1492
|
if (vt[y])
|
1493
1493
|
return;
|
1494
1494
|
vt[y] = !0;
|
1495
|
-
var
|
1496
|
-
s && s._owner && s._owner !== E.current && (
|
1495
|
+
var w = "";
|
1496
|
+
s && s._owner && s._owner !== E.current && (w = " It was passed a child from " + B(s._owner.type) + "."), L(s), C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', y, w), L(null);
|
1497
1497
|
}
|
1498
1498
|
}
|
1499
1499
|
function Ce(s, p) {
|
1500
1500
|
{
|
1501
1501
|
if (typeof s != "object")
|
1502
1502
|
return;
|
1503
|
-
if (
|
1503
|
+
if (k(s))
|
1504
1504
|
for (var y = 0; y < s.length; y++) {
|
1505
|
-
var
|
1506
|
-
xe(
|
1505
|
+
var w = s[y];
|
1506
|
+
xe(w) && Se(w, p);
|
1507
1507
|
}
|
1508
1508
|
else if (xe(s))
|
1509
1509
|
s._store && (s._store.validated = !0);
|
1510
1510
|
else if (s) {
|
1511
|
-
var
|
1512
|
-
if (typeof
|
1513
|
-
for (var W =
|
1514
|
-
xe(
|
1511
|
+
var F = U(s);
|
1512
|
+
if (typeof F == "function" && F !== s.entries)
|
1513
|
+
for (var W = F.call(s), N; !(N = W.next()).done; )
|
1514
|
+
xe(N.value) && Se(N.value, p);
|
1515
1515
|
}
|
1516
1516
|
}
|
1517
1517
|
}
|
@@ -1530,52 +1530,52 @@ Check the top-level render call using <` + y + ">.");
|
|
1530
1530
|
else
|
1531
1531
|
return;
|
1532
1532
|
if (y) {
|
1533
|
-
var
|
1534
|
-
z(y, s.props, "prop",
|
1535
|
-
} else if (p.PropTypes !== void 0 && !
|
1536
|
-
|
1537
|
-
var
|
1538
|
-
|
1533
|
+
var w = B(p);
|
1534
|
+
z(y, s.props, "prop", w, s);
|
1535
|
+
} else if (p.PropTypes !== void 0 && !se) {
|
1536
|
+
se = !0;
|
1537
|
+
var F = B(p);
|
1538
|
+
C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", F || "Unknown");
|
1539
1539
|
}
|
1540
|
-
typeof p.getDefaultProps == "function" && !p.getDefaultProps.isReactClassApproved &&
|
1540
|
+
typeof p.getDefaultProps == "function" && !p.getDefaultProps.isReactClassApproved && C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
1541
1541
|
}
|
1542
1542
|
}
|
1543
1543
|
function Oe(s) {
|
1544
1544
|
{
|
1545
1545
|
for (var p = Object.keys(s.props), y = 0; y < p.length; y++) {
|
1546
|
-
var
|
1547
|
-
if (
|
1548
|
-
|
1546
|
+
var w = p[y];
|
1547
|
+
if (w !== "children" && w !== "key") {
|
1548
|
+
L(s), C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", w), L(null);
|
1549
1549
|
break;
|
1550
1550
|
}
|
1551
1551
|
}
|
1552
|
-
s.ref !== null && (
|
1552
|
+
s.ref !== null && (L(s), C("Invalid attribute `ref` supplied to `React.Fragment`."), L(null));
|
1553
1553
|
}
|
1554
1554
|
}
|
1555
|
-
function He(s, p, y,
|
1555
|
+
function He(s, p, y, w, F, W) {
|
1556
1556
|
{
|
1557
|
-
var
|
1558
|
-
if (!
|
1557
|
+
var N = _e(s);
|
1558
|
+
if (!N) {
|
1559
1559
|
var I = "";
|
1560
1560
|
(s === void 0 || typeof s == "object" && s !== null && Object.keys(s).length === 0) && (I += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
1561
|
-
var
|
1562
|
-
|
1563
|
-
var
|
1564
|
-
s === null ?
|
1561
|
+
var fe = Ht(F);
|
1562
|
+
fe ? I += fe : I += he();
|
1563
|
+
var te;
|
1564
|
+
s === null ? te = "null" : k(s) ? te = "array" : s !== void 0 && s.$$typeof === n ? (te = "<" + (B(s.type) || "Unknown") + " />", I = " Did you accidentally export a JSX literal instead of a component?") : te = typeof s, C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", te, I);
|
1565
1565
|
}
|
1566
|
-
var ie =
|
1566
|
+
var ie = o(s, p, y, F, W);
|
1567
1567
|
if (ie == null)
|
1568
1568
|
return ie;
|
1569
|
-
if (
|
1569
|
+
if (N) {
|
1570
1570
|
var we = p.children;
|
1571
1571
|
if (we !== void 0)
|
1572
|
-
if (
|
1573
|
-
if (
|
1572
|
+
if (w)
|
1573
|
+
if (k(we)) {
|
1574
1574
|
for (var at = 0; at < we.length; at++)
|
1575
1575
|
Ce(we[at], s);
|
1576
1576
|
Object.freeze && Object.freeze(we);
|
1577
1577
|
} else
|
1578
|
-
|
1578
|
+
C("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
1579
1579
|
else
|
1580
1580
|
Ce(we, s);
|
1581
1581
|
}
|
@@ -1588,20 +1588,20 @@ Check the top-level render call using <` + y + ">.");
|
|
1588
1588
|
function yt(s, p, y) {
|
1589
1589
|
return He(s, p, y, !1);
|
1590
1590
|
}
|
1591
|
-
var
|
1592
|
-
ht.Fragment = t, ht.jsx =
|
1591
|
+
var Gn = yt, Wn = nt;
|
1592
|
+
ht.Fragment = t, ht.jsx = Gn, ht.jsxs = Wn;
|
1593
1593
|
}()), ht;
|
1594
1594
|
}
|
1595
|
-
process.env.NODE_ENV === "production" ? Bt.exports =
|
1595
|
+
process.env.NODE_ENV === "production" ? Bt.exports = Ba() : Bt.exports = Fa();
|
1596
1596
|
var l = Bt.exports;
|
1597
|
-
function
|
1597
|
+
function Fn(e) {
|
1598
1598
|
return e.title.search("<") > -1 ? /* @__PURE__ */ l.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: e.title } }) : /* @__PURE__ */ l.jsx("button", { children: e.title });
|
1599
1599
|
}
|
1600
|
-
const
|
1600
|
+
const Ua = /* @__PURE__ */ l.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
|
1601
1601
|
/* @__PURE__ */ l.jsx("circle", { cx: "7", cy: "7", r: "6" }),
|
1602
1602
|
/* @__PURE__ */ l.jsx("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
|
1603
1603
|
/* @__PURE__ */ l.jsx("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
|
1604
|
-
] }),
|
1604
|
+
] }), $a = /* @__PURE__ */ l.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ l.jsx(
|
1605
1605
|
"path",
|
1606
1606
|
{
|
1607
1607
|
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
|
@@ -1609,35 +1609,35 @@ 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
|
|
1609
1609
|
C11,8.22,10.74,8,10.43,8z`
|
1610
1610
|
}
|
1611
1611
|
) });
|
1612
|
-
function
|
1613
|
-
return /* @__PURE__ */ l.jsx(
|
1614
|
-
|
1612
|
+
function za(e) {
|
1613
|
+
return /* @__PURE__ */ l.jsx(Ln.Item, { value: e.title, children: /* @__PURE__ */ l.jsxs("div", { children: [
|
1614
|
+
$a,
|
1615
1615
|
/* @__PURE__ */ l.jsx("span", { children: e.title }),
|
1616
1616
|
/* @__PURE__ */ l.jsx("button", { className: "closeIcon", onClick: () => {
|
1617
1617
|
e.onDelete(e.index);
|
1618
|
-
}, children:
|
1618
|
+
}, children: Ua })
|
1619
1619
|
] }) }, e.title);
|
1620
1620
|
}
|
1621
|
-
function
|
1622
|
-
const [n, a] = G(!1), [t, i] = G(e.options),
|
1623
|
-
e.onDragComplete(
|
1624
|
-
},
|
1621
|
+
function Ga(e) {
|
1622
|
+
const [n, a] = G(!1), [t, i] = G(e.options), c = (d) => {
|
1623
|
+
e.onDragComplete(d), i(d);
|
1624
|
+
}, u = (d) => {
|
1625
1625
|
const f = [...t];
|
1626
|
-
f.splice(
|
1626
|
+
f.splice(d, 1), c(f);
|
1627
1627
|
}, r = [];
|
1628
|
-
t.forEach((
|
1629
|
-
r.push(/* @__PURE__ */ l.jsx(
|
1628
|
+
t.forEach((d, f) => {
|
1629
|
+
r.push(/* @__PURE__ */ l.jsx(za, { index: f, title: d, onDelete: u }, d));
|
1630
1630
|
});
|
1631
1631
|
let h = "dropdown draggable";
|
1632
1632
|
return e.subdropdown && (h += " subdropdown"), /* @__PURE__ */ l.jsxs("div", { className: h, onMouseEnter: () => a(!0), onMouseLeave: () => a(!1), children: [
|
1633
|
-
/* @__PURE__ */ l.jsx(
|
1634
|
-
/* @__PURE__ */ l.jsx(
|
1633
|
+
/* @__PURE__ */ l.jsx(Fn, { title: e.title }),
|
1634
|
+
/* @__PURE__ */ l.jsx(Ln.Group, { axis: "y", values: t, onReorder: c, style: { visibility: n ? "visible" : "hidden" }, children: r })
|
1635
1635
|
] });
|
1636
1636
|
}
|
1637
|
-
function
|
1637
|
+
function Wa(e) {
|
1638
1638
|
const [n, a] = G(!1), t = [];
|
1639
|
-
e.options.map((
|
1640
|
-
e.onSelect !== void 0 && (
|
1639
|
+
e.options.map((c, u) => {
|
1640
|
+
e.onSelect !== void 0 && (c.onSelect = e.onSelect), t.push(/* @__PURE__ */ l.jsx(Ha, { option: c }, u));
|
1641
1641
|
});
|
1642
1642
|
let i = "dropdown";
|
1643
1643
|
return e.subdropdown && (i += " subdropdown"), /* @__PURE__ */ l.jsxs(
|
@@ -1647,7 +1647,7 @@ function Ga(e) {
|
|
1647
1647
|
onMouseEnter: () => a(!0),
|
1648
1648
|
onMouseLeave: () => a(!1),
|
1649
1649
|
children: [
|
1650
|
-
/* @__PURE__ */ l.jsx(
|
1650
|
+
/* @__PURE__ */ l.jsx(Fn, { title: e.title }),
|
1651
1651
|
/* @__PURE__ */ l.jsx(
|
1652
1652
|
"ul",
|
1653
1653
|
{
|
@@ -1659,18 +1659,18 @@ function Ga(e) {
|
|
1659
1659
|
}
|
1660
1660
|
);
|
1661
1661
|
}
|
1662
|
-
function
|
1662
|
+
function Ha(e) {
|
1663
1663
|
const { option: n } = e, [a, t] = G("");
|
1664
1664
|
let i;
|
1665
1665
|
switch (n.type) {
|
1666
1666
|
case "draggable":
|
1667
1667
|
i = /* @__PURE__ */ l.jsx(
|
1668
|
-
|
1668
|
+
Ga,
|
1669
1669
|
{
|
1670
1670
|
title: n.title,
|
1671
1671
|
options: n.value,
|
1672
|
-
onDragComplete: (
|
1673
|
-
n.onDragComplete !== void 0 && n.onDragComplete(
|
1672
|
+
onDragComplete: (c) => {
|
1673
|
+
n.onDragComplete !== void 0 && n.onDragComplete(c);
|
1674
1674
|
},
|
1675
1675
|
subdropdown: !0
|
1676
1676
|
}
|
@@ -1678,7 +1678,7 @@ function Wa(e) {
|
|
1678
1678
|
break;
|
1679
1679
|
case "dropdown":
|
1680
1680
|
i = /* @__PURE__ */ l.jsx(
|
1681
|
-
|
1681
|
+
Wa,
|
1682
1682
|
{
|
1683
1683
|
title: n.title,
|
1684
1684
|
options: n.value,
|
@@ -1699,29 +1699,29 @@ function Wa(e) {
|
|
1699
1699
|
);
|
1700
1700
|
break;
|
1701
1701
|
}
|
1702
|
-
return /* @__PURE__ */ l.jsx("li", { className: a === n.title ? "selected" : "", children: i },
|
1702
|
+
return /* @__PURE__ */ l.jsx("li", { className: a === n.title ? "selected" : "", children: i }, _a());
|
1703
1703
|
}
|
1704
1704
|
function Bi(e, n, a) {
|
1705
|
-
function t(
|
1706
|
-
switch (n.forEach((
|
1707
|
-
|
1708
|
-
}),
|
1705
|
+
function t(c) {
|
1706
|
+
switch (n.forEach((u) => {
|
1707
|
+
u.callback(e, u.remote, c);
|
1708
|
+
}), c.event) {
|
1709
1709
|
case "custom":
|
1710
|
-
|
1710
|
+
P.dispatchEvent({ type: A.CUSTOM, value: c.data });
|
1711
1711
|
break;
|
1712
1712
|
}
|
1713
1713
|
}
|
1714
|
-
function i(
|
1715
|
-
switch (a.forEach((
|
1716
|
-
|
1717
|
-
}),
|
1714
|
+
function i(c) {
|
1715
|
+
switch (a.forEach((u) => {
|
1716
|
+
u.callback(e, u.remote, c);
|
1717
|
+
}), c.event) {
|
1718
1718
|
case "custom":
|
1719
|
-
|
1719
|
+
P.dispatchEvent({ type: A.CUSTOM, value: c.data });
|
1720
1720
|
break;
|
1721
1721
|
}
|
1722
1722
|
}
|
1723
|
-
e.listen = (
|
1724
|
-
|
1723
|
+
e.listen = (c) => {
|
1724
|
+
c.target === "editor" ? i(c) : t(c);
|
1725
1725
|
};
|
1726
1726
|
}
|
1727
1727
|
function Gt(e) {
|
@@ -1751,14 +1751,14 @@ function Gt(e) {
|
|
1751
1751
|
/* @__PURE__ */ l.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { children: e.children }) })
|
1752
1752
|
] });
|
1753
1753
|
}
|
1754
|
-
function
|
1755
|
-
const n =
|
1756
|
-
return e.child !== void 0 && e.child.children.length > 0 && e.child.children.map((
|
1757
|
-
|
1754
|
+
function Un(e) {
|
1755
|
+
const n = V(null), [a, t] = G(!1), i = e.child !== void 0 && e.child.children.length > 0, c = [];
|
1756
|
+
return e.child !== void 0 && e.child.children.length > 0 && e.child.children.map((u, r) => {
|
1757
|
+
c.push(/* @__PURE__ */ l.jsx(Un, { child: u, three: e.three }, r));
|
1758
1758
|
}), Re(() => {
|
1759
|
-
const
|
1759
|
+
const u = e.child.uuid, r = e.three.getScene(u);
|
1760
1760
|
if (r !== null) {
|
1761
|
-
const h = r.getObjectByProperty("uuid",
|
1761
|
+
const h = r.getObjectByProperty("uuid", u);
|
1762
1762
|
h !== void 0 && (n.current.style.opacity = h.visible ? "1" : "0.25");
|
1763
1763
|
}
|
1764
1764
|
}, []), /* @__PURE__ */ l.jsx(l.Fragment, { children: e.child !== void 0 && /* @__PURE__ */ l.jsxs("div", { className: "childObject", children: [
|
@@ -1795,58 +1795,58 @@ function Fn(e) {
|
|
1795
1795
|
ref: n,
|
1796
1796
|
onClick: () => {
|
1797
1797
|
if (e.child) {
|
1798
|
-
const
|
1799
|
-
if (
|
1800
|
-
const r =
|
1798
|
+
const u = e.three.getScene(e.child.uuid);
|
1799
|
+
if (u !== null) {
|
1800
|
+
const r = u.getObjectByProperty("uuid", e.child.uuid);
|
1801
1801
|
if (r !== void 0) {
|
1802
|
-
const h = "visible",
|
1803
|
-
n.current.style.opacity =
|
1802
|
+
const h = "visible", d = !r.visible;
|
1803
|
+
n.current.style.opacity = d ? "1" : "0.25", e.three.updateObject(e.child.uuid, h, d), ne(r, h, d);
|
1804
1804
|
} else
|
1805
|
-
console.log(`Hermes - Couldn't find object: ${e.child.uuid}`,
|
1805
|
+
console.log(`Hermes - Couldn't find object: ${e.child.uuid}`, u);
|
1806
1806
|
} else
|
1807
1807
|
console.log(`Hermes - Couldn't find object in scene: ${e.child.uuid}, ${e.child.name}`);
|
1808
1808
|
}
|
1809
1809
|
}
|
1810
1810
|
}
|
1811
1811
|
),
|
1812
|
-
/* @__PURE__ */ l.jsx("div", { className: `icon ${
|
1812
|
+
/* @__PURE__ */ l.jsx("div", { className: `icon ${Aa(e.child)}` })
|
1813
1813
|
] }),
|
1814
|
-
/* @__PURE__ */ l.jsx("div", { className: a ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { className: "container", children:
|
1814
|
+
/* @__PURE__ */ l.jsx("div", { className: a ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { className: "container", children: c }) })
|
1815
1815
|
] }, Math.random()) });
|
1816
1816
|
}
|
1817
|
-
function
|
1817
|
+
function Ya(e) {
|
1818
1818
|
const n = [];
|
1819
1819
|
return e.child?.children.map((a, t) => {
|
1820
|
-
n.push(/* @__PURE__ */ l.jsx(
|
1820
|
+
n.push(/* @__PURE__ */ l.jsx(Un, { child: a, scene: e.scene, three: e.three }, t));
|
1821
1821
|
}), /* @__PURE__ */ l.jsx("div", { className: `scene ${e.class !== void 0 ? e.class : ""}`, children: n });
|
1822
1822
|
}
|
1823
|
-
function
|
1823
|
+
function Va(e) {
|
1824
1824
|
const [n, a] = G(e.defaultValue);
|
1825
1825
|
return Re(() => {
|
1826
|
-
let t = !1, i = -1,
|
1827
|
-
const r = (
|
1828
|
-
t = !0,
|
1829
|
-
}, h = (
|
1826
|
+
let t = !1, i = -1, c = 0, u = e.defaultValue;
|
1827
|
+
const r = (v) => {
|
1828
|
+
t = !0, c = Number(e.input.current?.value), i = v.clientX, document.addEventListener("mouseup", d, !1), document.addEventListener("mousemove", h, !1), document.addEventListener("contextmenu", d, !1);
|
1829
|
+
}, h = (v) => {
|
1830
1830
|
if (!t)
|
1831
1831
|
return;
|
1832
|
-
const
|
1833
|
-
|
1834
|
-
},
|
1835
|
-
t = !1, document.removeEventListener("mouseup",
|
1836
|
-
}, f = (
|
1837
|
-
const
|
1838
|
-
a(
|
1839
|
-
}, m = (
|
1840
|
-
const
|
1841
|
-
e.onChange !== void 0 && e.onChange(
|
1832
|
+
const x = e.step !== void 0 ? e.step : 1, _ = (v.clientX - i) * x;
|
1833
|
+
u = Number((c + _).toFixed(4)), e.min !== void 0 && (u = Math.max(u, e.min)), e.max !== void 0 && (u = Math.min(u, e.max)), e.onChange !== void 0 && e.onChange(u), a(u);
|
1834
|
+
}, d = () => {
|
1835
|
+
t = !1, document.removeEventListener("mouseup", d), document.removeEventListener("mousemove", h), document.removeEventListener("contextmenu", d);
|
1836
|
+
}, f = (v) => {
|
1837
|
+
const x = Number(v.target.value);
|
1838
|
+
a(x);
|
1839
|
+
}, m = (v) => {
|
1840
|
+
const x = Number(v.target.value);
|
1841
|
+
e.onChange !== void 0 && e.onChange(x), a(x);
|
1842
1842
|
};
|
1843
1843
|
return e.input.current?.addEventListener("input", f), e.label.current?.addEventListener("mousedown", r, !1), e.sliderRef !== void 0 && e.sliderRef.current?.addEventListener("input", m), () => {
|
1844
|
-
e.input.current?.removeEventListener("input", f), e.label.current?.removeEventListener("mousedown", r), e.sliderRef !== void 0 && e.sliderRef.current?.removeEventListener("input", m), document.removeEventListener("mouseup",
|
1844
|
+
e.input.current?.removeEventListener("input", f), e.label.current?.removeEventListener("mousedown", r), e.sliderRef !== void 0 && e.sliderRef.current?.removeEventListener("input", m), document.removeEventListener("mouseup", d), document.removeEventListener("mousemove", h), document.removeEventListener("contextmenu", d);
|
1845
1845
|
};
|
1846
1846
|
}, []), n;
|
1847
1847
|
}
|
1848
1848
|
function Qe(e) {
|
1849
|
-
const n =
|
1849
|
+
const n = V(null), a = V(null), t = Va({
|
1850
1850
|
label: e.labelRef,
|
1851
1851
|
input: n,
|
1852
1852
|
sliderRef: a,
|
@@ -1872,8 +1872,8 @@ function Qe(e) {
|
|
1872
1872
|
step: e.step,
|
1873
1873
|
disabled: e.disabled,
|
1874
1874
|
onChange: (i) => {
|
1875
|
-
const
|
1876
|
-
e.onChange !== void 0 && e.onChange(e.prop,
|
1875
|
+
const c = Number(i.target.value);
|
1876
|
+
e.onChange !== void 0 && e.onChange(e.prop, c);
|
1877
1877
|
}
|
1878
1878
|
}
|
1879
1879
|
),
|
@@ -1887,8 +1887,8 @@ function Qe(e) {
|
|
1887
1887
|
ref: n,
|
1888
1888
|
className: "min",
|
1889
1889
|
onChange: (i) => {
|
1890
|
-
const
|
1891
|
-
e.onChange !== void 0 && e.onChange(e.prop,
|
1890
|
+
const c = Number(i.target.value);
|
1891
|
+
e.onChange !== void 0 && e.onChange(e.prop, c);
|
1892
1892
|
}
|
1893
1893
|
}
|
1894
1894
|
),
|
@@ -1908,37 +1908,39 @@ function Qe(e) {
|
|
1908
1908
|
] })
|
1909
1909
|
] });
|
1910
1910
|
}
|
1911
|
-
function
|
1912
|
-
const n =
|
1911
|
+
function qa(e) {
|
1912
|
+
const n = V(null), a = V(null), t = V(null), i = V(null), c = V(null), u = V(null), [r, h] = G(e.value), [d, f] = G({
|
1913
1913
|
min: Math.min(e.min, Math.min(e.value.x, e.value.y)),
|
1914
1914
|
max: Math.max(e.max, Math.max(e.value.x, e.value.y))
|
1915
|
-
}), [m,
|
1916
|
-
function
|
1917
|
-
m || (window.addEventListener("mousemove",
|
1915
|
+
}), [m, v] = G(!1);
|
1916
|
+
function x() {
|
1917
|
+
m || (window.addEventListener("mousemove", q), window.addEventListener("mouseup", _), window.addEventListener("mouseup", _), v(!0));
|
1918
1918
|
}
|
1919
|
-
function
|
1920
|
-
window.removeEventListener("mousemove",
|
1919
|
+
function _() {
|
1920
|
+
window.removeEventListener("mousemove", q), window.removeEventListener("mouseup", _), v(!1);
|
1921
1921
|
}
|
1922
|
-
function
|
1923
|
-
const
|
1924
|
-
e.onChange({ target: { value: { x:
|
1922
|
+
function q(M) {
|
1923
|
+
const Z = c.current.getBoundingClientRect(), ue = Je(0, 99, M.clientX - Z.left) / 99, H = Je(0, 99, M.clientY - Z.top) / 99, ve = nn(tn(d.min, d.max, ue), 3), re = nn(tn(d.min, d.max, H), 3);
|
1924
|
+
e.onChange({ target: { value: { x: ve, y: re } } }), h({ x: ve, y: re });
|
1925
1925
|
}
|
1926
|
-
function
|
1927
|
-
let
|
1928
|
-
|
1926
|
+
function U(M) {
|
1927
|
+
let Z = r.x, ue = r.y;
|
1928
|
+
M.target === n.current ? Z = Number(M.target.value) : ue = Number(M.target.value), h({ x: Z, y: ue });
|
1929
1929
|
}
|
1930
|
-
function
|
1931
|
-
const
|
1932
|
-
f({ min:
|
1930
|
+
function $() {
|
1931
|
+
const M = Number(t.current.value);
|
1932
|
+
f({ min: M, max: d.max }), (r.x < M || r.y < M) && h({ x: Je(M, d.max, r.x), y: Je(M, d.max, r.y) });
|
1933
1933
|
}
|
1934
|
-
function
|
1935
|
-
const
|
1936
|
-
f({ min:
|
1934
|
+
function C() {
|
1935
|
+
const M = Number(i.current.value);
|
1936
|
+
f({ min: d.min, max: M }), (r.x > M || r.y > M) && h({ x: Je(d.min, M, r.x), y: Je(d.min, M, r.y) });
|
1937
1937
|
}
|
1938
|
-
|
1939
|
-
const
|
1940
|
-
|
1941
|
-
}, [
|
1938
|
+
Re(() => {
|
1939
|
+
const M = en(d.min, d.max, r.x), Z = en(d.min, d.max, r.y);
|
1940
|
+
u.current.style.left = `${M * 100}%`, u.current.style.top = `${Z * 100}%`;
|
1941
|
+
}, [d, r]);
|
1942
|
+
const K = e.step !== void 0 ? e.step : 0.01;
|
1943
|
+
return /* @__PURE__ */ l.jsxs("div", { className: "vector2", children: [
|
1942
1944
|
/* @__PURE__ */ l.jsxs("div", { className: "fields", children: [
|
1943
1945
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
1944
1946
|
/* @__PURE__ */ l.jsx("label", { children: "X:" }),
|
@@ -1948,10 +1950,10 @@ function Va(e) {
|
|
1948
1950
|
ref: n,
|
1949
1951
|
type: "number",
|
1950
1952
|
value: r.x,
|
1951
|
-
min:
|
1952
|
-
max:
|
1953
|
-
step:
|
1954
|
-
onChange:
|
1953
|
+
min: d.min,
|
1954
|
+
max: d.max,
|
1955
|
+
step: K,
|
1956
|
+
onChange: U
|
1955
1957
|
}
|
1956
1958
|
)
|
1957
1959
|
] }),
|
@@ -1963,10 +1965,10 @@ function Va(e) {
|
|
1963
1965
|
ref: a,
|
1964
1966
|
type: "number",
|
1965
1967
|
value: r.y,
|
1966
|
-
min:
|
1967
|
-
max:
|
1968
|
-
step:
|
1969
|
-
onChange:
|
1968
|
+
min: d.min,
|
1969
|
+
max: d.max,
|
1970
|
+
step: K,
|
1971
|
+
onChange: U
|
1970
1972
|
}
|
1971
1973
|
)
|
1972
1974
|
] }),
|
@@ -1977,9 +1979,9 @@ function Va(e) {
|
|
1977
1979
|
{
|
1978
1980
|
ref: t,
|
1979
1981
|
type: "number",
|
1980
|
-
value:
|
1981
|
-
step:
|
1982
|
-
onChange:
|
1982
|
+
value: d.min,
|
1983
|
+
step: K,
|
1984
|
+
onChange: $
|
1983
1985
|
}
|
1984
1986
|
)
|
1985
1987
|
] }),
|
@@ -1990,154 +1992,154 @@ function Va(e) {
|
|
1990
1992
|
{
|
1991
1993
|
ref: i,
|
1992
1994
|
type: "number",
|
1993
|
-
value:
|
1994
|
-
step:
|
1995
|
-
onChange:
|
1995
|
+
value: d.max,
|
1996
|
+
step: K,
|
1997
|
+
onChange: C
|
1996
1998
|
}
|
1997
1999
|
)
|
1998
2000
|
] })
|
1999
2001
|
] }),
|
2000
|
-
/* @__PURE__ */ l.jsxs("div", { className: "input", ref:
|
2002
|
+
/* @__PURE__ */ l.jsxs("div", { className: "input", ref: c, onMouseDown: x, onMouseUp: _, children: [
|
2001
2003
|
/* @__PURE__ */ l.jsx("div", { className: "x" }),
|
2002
2004
|
/* @__PURE__ */ l.jsx("div", { className: "y" }),
|
2003
|
-
/* @__PURE__ */ l.jsx("div", { className: "pt", ref:
|
2005
|
+
/* @__PURE__ */ l.jsx("div", { className: "pt", ref: u })
|
2004
2006
|
] })
|
2005
2007
|
] });
|
2006
2008
|
}
|
2007
2009
|
function on(e) {
|
2008
|
-
const n = e.value.isVector3 !== void 0, a = e.value.isEuler !== void 0, t = e.value.elements !== void 0, i = [];
|
2010
|
+
const n = e.value.isVector3 !== void 0, a = e.value.isEuler !== void 0, t = e.value.elements !== void 0, i = e.step !== void 0 ? e.step : 0.01, c = [];
|
2009
2011
|
if (n) {
|
2010
|
-
const
|
2011
|
-
|
2012
|
+
const u = oe(() => e.value, []), r = (d, f) => {
|
2013
|
+
u[d] = f, e.onChange({ target: { value: u } });
|
2012
2014
|
};
|
2013
|
-
["x", "y", "z"].forEach((
|
2014
|
-
const
|
2015
|
-
|
2015
|
+
["x", "y", "z"].forEach((d) => {
|
2016
|
+
const f = V(null);
|
2017
|
+
c.push(
|
2016
2018
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2017
|
-
/* @__PURE__ */ l.jsx("label", { ref:
|
2019
|
+
/* @__PURE__ */ l.jsx("label", { ref: f, children: d.toUpperCase() }),
|
2018
2020
|
/* @__PURE__ */ l.jsx(
|
2019
2021
|
Qe,
|
2020
2022
|
{
|
2021
|
-
value:
|
2023
|
+
value: u[d],
|
2022
2024
|
type: "number",
|
2023
|
-
prop:
|
2024
|
-
step:
|
2025
|
-
labelRef:
|
2026
|
-
onChange:
|
2025
|
+
prop: d,
|
2026
|
+
step: i,
|
2027
|
+
labelRef: f,
|
2028
|
+
onChange: r
|
2027
2029
|
}
|
2028
2030
|
)
|
2029
|
-
] },
|
2031
|
+
] }, d)
|
2030
2032
|
);
|
2031
2033
|
});
|
2032
2034
|
} else if (a) {
|
2033
|
-
const
|
2034
|
-
|
2035
|
+
const u = oe(() => e.value, []), r = (d, f) => {
|
2036
|
+
u[d] = f, e.onChange({ target: { value: u } });
|
2035
2037
|
};
|
2036
|
-
["_x", "_y", "_z"].forEach((
|
2037
|
-
const
|
2038
|
-
|
2038
|
+
["_x", "_y", "_z"].forEach((d) => {
|
2039
|
+
const f = V(null);
|
2040
|
+
c.push(
|
2039
2041
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2040
|
-
/* @__PURE__ */ l.jsx("label", { ref:
|
2042
|
+
/* @__PURE__ */ l.jsx("label", { ref: f, children: d.substring(1).toUpperCase() }),
|
2041
2043
|
/* @__PURE__ */ l.jsx(
|
2042
2044
|
Qe,
|
2043
2045
|
{
|
2044
|
-
value:
|
2046
|
+
value: u[d],
|
2045
2047
|
type: "number",
|
2046
|
-
prop:
|
2047
|
-
step:
|
2048
|
-
labelRef:
|
2049
|
-
onChange:
|
2048
|
+
prop: d,
|
2049
|
+
step: i,
|
2050
|
+
labelRef: f,
|
2051
|
+
onChange: r
|
2050
2052
|
}
|
2051
2053
|
)
|
2052
|
-
] },
|
2054
|
+
] }, d)
|
2053
2055
|
);
|
2054
2056
|
});
|
2055
2057
|
} else if (t) {
|
2056
|
-
const
|
2057
|
-
const
|
2058
|
-
|
2058
|
+
const u = oe(() => e.value, []), r = (h, d) => {
|
2059
|
+
const f = Number(h);
|
2060
|
+
u.elements[f] = d, e.onChange({ target: { value: u } });
|
2059
2061
|
};
|
2060
|
-
for (let
|
2061
|
-
const
|
2062
|
-
|
2062
|
+
for (let h = 0; h < 9; h++) {
|
2063
|
+
const d = V(null);
|
2064
|
+
c.push(
|
2063
2065
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2064
|
-
/* @__PURE__ */ l.jsx("label", { ref:
|
2066
|
+
/* @__PURE__ */ l.jsx("label", { ref: d, children: h + 1 }),
|
2065
2067
|
/* @__PURE__ */ l.jsx(
|
2066
2068
|
Qe,
|
2067
2069
|
{
|
2068
|
-
value:
|
2070
|
+
value: u.elements[h],
|
2069
2071
|
type: "number",
|
2070
|
-
prop:
|
2071
|
-
step:
|
2072
|
-
labelRef:
|
2073
|
-
onChange:
|
2072
|
+
prop: h.toString(),
|
2073
|
+
step: i,
|
2074
|
+
labelRef: d,
|
2075
|
+
onChange: r
|
2074
2076
|
}
|
2075
2077
|
)
|
2076
|
-
] },
|
2078
|
+
] }, h.toString())
|
2077
2079
|
);
|
2078
2080
|
}
|
2079
2081
|
}
|
2080
|
-
return /* @__PURE__ */ l.jsx("div", { className: "grid3", children:
|
2082
|
+
return /* @__PURE__ */ l.jsx("div", { className: "grid3", children: c }, Math.random().toString());
|
2081
2083
|
}
|
2082
|
-
function
|
2083
|
-
const n = e.value.x !== void 0, a = [];
|
2084
|
+
function Ka(e) {
|
2085
|
+
const n = e.value.x !== void 0, a = e.step !== void 0 ? e.step : 0.01, t = [];
|
2084
2086
|
if (n) {
|
2085
|
-
const
|
2086
|
-
|
2087
|
+
const i = oe(() => e.value, []), c = (r, h) => {
|
2088
|
+
i[r] = h, e.onChange({ target: { value: i } });
|
2087
2089
|
};
|
2088
|
-
["x", "y", "z", "w"].forEach((
|
2089
|
-
const
|
2090
|
-
|
2090
|
+
["x", "y", "z", "w"].forEach((r) => {
|
2091
|
+
const h = V(null);
|
2092
|
+
t.push(
|
2091
2093
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2092
|
-
/* @__PURE__ */ l.jsx("label", { ref:
|
2094
|
+
/* @__PURE__ */ l.jsx("label", { ref: h, children: r.toUpperCase() }),
|
2093
2095
|
/* @__PURE__ */ l.jsx(
|
2094
2096
|
Qe,
|
2095
2097
|
{
|
2096
|
-
value:
|
2098
|
+
value: i.x,
|
2097
2099
|
type: "number",
|
2098
|
-
prop:
|
2099
|
-
step:
|
2100
|
-
labelRef:
|
2101
|
-
onChange:
|
2100
|
+
prop: r,
|
2101
|
+
step: a,
|
2102
|
+
labelRef: h,
|
2103
|
+
onChange: c
|
2102
2104
|
}
|
2103
2105
|
)
|
2104
|
-
] },
|
2106
|
+
] }, r)
|
2105
2107
|
);
|
2106
2108
|
});
|
2107
2109
|
} else {
|
2108
|
-
const
|
2109
|
-
const
|
2110
|
-
|
2110
|
+
const i = oe(() => e.value, []), c = (u, r) => {
|
2111
|
+
const h = Number(u);
|
2112
|
+
i.elements[h] = r, e.onChange({ target: { value: i } });
|
2111
2113
|
};
|
2112
|
-
for (let
|
2113
|
-
const
|
2114
|
-
|
2114
|
+
for (let u = 0; u < 16; u++) {
|
2115
|
+
const r = V(null);
|
2116
|
+
t.push(
|
2115
2117
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2116
|
-
/* @__PURE__ */ l.jsx("label", { ref:
|
2118
|
+
/* @__PURE__ */ l.jsx("label", { ref: r, children: u + 1 }),
|
2117
2119
|
/* @__PURE__ */ l.jsx(
|
2118
2120
|
Qe,
|
2119
2121
|
{
|
2120
|
-
value:
|
2122
|
+
value: i.elements[u],
|
2121
2123
|
type: "number",
|
2122
|
-
prop:
|
2123
|
-
step:
|
2124
|
-
labelRef:
|
2125
|
-
onChange:
|
2124
|
+
prop: u.toString(),
|
2125
|
+
step: a,
|
2126
|
+
labelRef: r,
|
2127
|
+
onChange: c
|
2126
2128
|
}
|
2127
2129
|
)
|
2128
|
-
] },
|
2130
|
+
] }, u.toString())
|
2129
2131
|
);
|
2130
2132
|
}
|
2131
2133
|
}
|
2132
|
-
return /* @__PURE__ */ l.jsx("div", { className: "grid4", children:
|
2134
|
+
return /* @__PURE__ */ l.jsx("div", { className: "grid4", children: t });
|
2133
2135
|
}
|
2134
|
-
function
|
2136
|
+
function Xa(e) {
|
2135
2137
|
return "items" in e;
|
2136
2138
|
}
|
2137
2139
|
function et(e) {
|
2138
2140
|
const n = [];
|
2139
2141
|
return e.items.forEach((a) => {
|
2140
|
-
|
2142
|
+
Xa(a) ? n.push(
|
2141
2143
|
/* @__PURE__ */ l.jsx(et, { title: Mt(a.title), items: a.items }, Math.random())
|
2142
2144
|
) : n.push(
|
2143
2145
|
/* @__PURE__ */ l.jsx(
|
@@ -2164,10 +2166,10 @@ function et(e) {
|
|
2164
2166
|
);
|
2165
2167
|
}), /* @__PURE__ */ l.jsx(Gt, { label: e.title, open: e.expanded === !0, children: n });
|
2166
2168
|
}
|
2167
|
-
function
|
2169
|
+
function Za(e) {
|
2168
2170
|
return !(e === "alphaHash" || e === "alphaToCoverage" || e === "attenuationDistance" || e === "blendAlpha" || e === "blendColor" || e === "blendDstAlpha" || e === "colorWrite" || e === "combine" || e === "defaultAttributeValues" || e === "depthFunc" || e === "forceSinglePass" || e === "glslVersion" || e === "linecap" || e === "linejoin" || e === "linewidth" || e === "normalMapType" || e === "precision" || e === "premultipliedAlpha" || e === "shadowSide" || e === "toneMapped" || e === "uniformsGroups" || e === "uniformsNeedUpdate" || e === "userData" || e === "vertexColors" || e === "version" || e === "wireframeLinecap" || e === "wireframeLinejoin" || e === "wireframeLinewidth" || e.slice(0, 4) === "clip" || e.slice(0, 7) === "polygon" || e.slice(0, 7) === "stencil" || e.slice(0, 2) === "is");
|
2169
2171
|
}
|
2170
|
-
function
|
2172
|
+
function Ja(e) {
|
2171
2173
|
switch (e) {
|
2172
2174
|
case "Alpha Map":
|
2173
2175
|
return "alphaMap";
|
@@ -2387,11 +2389,11 @@ function Rt(e) {
|
|
2387
2389
|
}
|
2388
2390
|
return e;
|
2389
2391
|
}
|
2390
|
-
function
|
2392
|
+
function $n(e) {
|
2391
2393
|
const n = e.toLowerCase();
|
2392
2394
|
return n.search("intensity") > -1 || n === "anisotropyrotation" || n === "blendalpha" || n === "bumpscale" || n === "clearcoatroughness" || n === "displacementbias" || n === "displacementscale" || n === "metalness" || n === "opacity" || n === "reflectivity" || n === "refractionratio" || n === "roughness" || n === "sheenroughness" || n === "thickness";
|
2393
2395
|
}
|
2394
|
-
function
|
2396
|
+
function Qa() {
|
2395
2397
|
const e = document.createElement("input");
|
2396
2398
|
return e.type = "file", new Promise((n, a) => {
|
2397
2399
|
e.addEventListener("change", function() {
|
@@ -2399,212 +2401,212 @@ function Ja() {
|
|
2399
2401
|
a();
|
2400
2402
|
else {
|
2401
2403
|
const t = e.files[0], i = new FileReader();
|
2402
|
-
i.onload = function(
|
2403
|
-
n(
|
2404
|
+
i.onload = function(c) {
|
2405
|
+
n(c.target.result);
|
2404
2406
|
}, i.readAsDataURL(t);
|
2405
2407
|
}
|
2406
2408
|
}), e.click();
|
2407
2409
|
});
|
2408
2410
|
}
|
2409
|
-
const
|
2411
|
+
const ei = [
|
2410
2412
|
{
|
2411
2413
|
title: "Front",
|
2412
|
-
value:
|
2414
|
+
value: Vn
|
2413
2415
|
},
|
2414
2416
|
{
|
2415
2417
|
title: "Back",
|
2416
|
-
value:
|
2418
|
+
value: vn
|
2417
2419
|
},
|
2418
2420
|
{
|
2419
2421
|
title: "Double",
|
2420
|
-
value:
|
2422
|
+
value: bn
|
2421
2423
|
}
|
2422
|
-
],
|
2424
|
+
], ti = [
|
2423
2425
|
{
|
2424
2426
|
title: "No Blending",
|
2425
|
-
value:
|
2427
|
+
value: qn
|
2426
2428
|
},
|
2427
2429
|
{
|
2428
2430
|
title: "Normal",
|
2429
|
-
value:
|
2431
|
+
value: Kn
|
2430
2432
|
},
|
2431
2433
|
{
|
2432
2434
|
title: "Additive",
|
2433
|
-
value:
|
2435
|
+
value: Xn
|
2434
2436
|
},
|
2435
2437
|
{
|
2436
2438
|
title: "Subtractive",
|
2437
|
-
value:
|
2439
|
+
value: Zn
|
2438
2440
|
},
|
2439
2441
|
{
|
2440
2442
|
title: "Multiply",
|
2441
|
-
value:
|
2443
|
+
value: Jn
|
2442
2444
|
},
|
2443
2445
|
{
|
2444
2446
|
title: "Custom",
|
2445
|
-
value:
|
2447
|
+
value: Qn
|
2446
2448
|
}
|
2447
|
-
],
|
2449
|
+
], ni = [
|
2448
2450
|
{
|
2449
2451
|
title: "Add",
|
2450
|
-
value:
|
2452
|
+
value: ea
|
2451
2453
|
},
|
2452
2454
|
{
|
2453
2455
|
title: "Subtract",
|
2454
|
-
value:
|
2456
|
+
value: ta
|
2455
2457
|
},
|
2456
2458
|
{
|
2457
2459
|
title: "Reverse Subtract",
|
2458
|
-
value:
|
2460
|
+
value: na
|
2459
2461
|
},
|
2460
2462
|
{
|
2461
2463
|
title: "Min",
|
2462
|
-
value:
|
2464
|
+
value: aa
|
2463
2465
|
},
|
2464
2466
|
{
|
2465
2467
|
title: "Max",
|
2466
|
-
value:
|
2468
|
+
value: ia
|
2467
2469
|
}
|
2468
|
-
],
|
2470
|
+
], ai = [
|
2469
2471
|
{
|
2470
2472
|
title: "Zero",
|
2471
|
-
valye:
|
2473
|
+
valye: yn
|
2472
2474
|
},
|
2473
2475
|
{
|
2474
2476
|
title: "One",
|
2475
|
-
valye:
|
2477
|
+
valye: En
|
2476
2478
|
},
|
2477
2479
|
{
|
2478
2480
|
title: "Src Color",
|
2479
|
-
valye:
|
2481
|
+
valye: xn
|
2480
2482
|
},
|
2481
2483
|
{
|
2482
2484
|
title: "One Minus Src Color",
|
2483
|
-
valye:
|
2485
|
+
valye: Sn
|
2484
2486
|
},
|
2485
2487
|
{
|
2486
2488
|
title: "Src Alpha",
|
2487
|
-
valye:
|
2489
|
+
valye: Cn
|
2488
2490
|
},
|
2489
2491
|
{
|
2490
2492
|
title: "One Minus Src Alpha",
|
2491
|
-
valye:
|
2493
|
+
valye: wn
|
2492
2494
|
},
|
2493
2495
|
{
|
2494
2496
|
title: "Dst Alpha",
|
2495
|
-
valye:
|
2497
|
+
valye: Mn
|
2496
2498
|
},
|
2497
2499
|
{
|
2498
2500
|
title: "One Minus Dst Alpha",
|
2499
|
-
valye:
|
2501
|
+
valye: On
|
2500
2502
|
},
|
2501
2503
|
{
|
2502
2504
|
title: "Dst Color",
|
2503
|
-
valye:
|
2505
|
+
valye: Tn
|
2504
2506
|
},
|
2505
2507
|
{
|
2506
2508
|
title: "One Minus Dst Color",
|
2507
|
-
valye:
|
2509
|
+
valye: Rn
|
2508
2510
|
},
|
2509
2511
|
{
|
2510
2512
|
title: "Src Alpha Saturate",
|
2511
|
-
valye:
|
2513
|
+
valye: ra
|
2512
2514
|
},
|
2513
2515
|
{
|
2514
2516
|
title: "Constant Color",
|
2515
|
-
valye:
|
2517
|
+
valye: _n
|
2516
2518
|
},
|
2517
2519
|
{
|
2518
2520
|
title: "One Minus Constant Color",
|
2519
|
-
valye:
|
2521
|
+
valye: kn
|
2520
2522
|
},
|
2521
2523
|
{
|
2522
2524
|
title: "Constant Alpha",
|
2523
|
-
valye:
|
2525
|
+
valye: Dn
|
2524
2526
|
},
|
2525
2527
|
{
|
2526
2528
|
title: "One Minus Constant Alpha",
|
2527
|
-
valye:
|
2529
|
+
valye: Pn
|
2528
2530
|
}
|
2529
|
-
],
|
2531
|
+
], ii = [
|
2530
2532
|
{
|
2531
2533
|
title: "Zero",
|
2532
|
-
valye:
|
2534
|
+
valye: yn
|
2533
2535
|
},
|
2534
2536
|
{
|
2535
2537
|
title: "One",
|
2536
|
-
valye:
|
2538
|
+
valye: En
|
2537
2539
|
},
|
2538
2540
|
{
|
2539
2541
|
title: "Src Color",
|
2540
|
-
valye:
|
2542
|
+
valye: xn
|
2541
2543
|
},
|
2542
2544
|
{
|
2543
2545
|
title: "One Minus Src Color",
|
2544
|
-
valye:
|
2546
|
+
valye: Sn
|
2545
2547
|
},
|
2546
2548
|
{
|
2547
2549
|
title: "Src Alpha",
|
2548
|
-
valye:
|
2550
|
+
valye: Cn
|
2549
2551
|
},
|
2550
2552
|
{
|
2551
2553
|
title: "One Minus Src Alpha",
|
2552
|
-
valye:
|
2554
|
+
valye: wn
|
2553
2555
|
},
|
2554
2556
|
{
|
2555
2557
|
title: "Dst Alpha",
|
2556
|
-
valye:
|
2558
|
+
valye: Mn
|
2557
2559
|
},
|
2558
2560
|
{
|
2559
2561
|
title: "One Minus Dst Alpha",
|
2560
|
-
valye:
|
2562
|
+
valye: On
|
2561
2563
|
},
|
2562
2564
|
{
|
2563
2565
|
title: "Dst Color",
|
2564
|
-
valye:
|
2566
|
+
valye: Tn
|
2565
2567
|
},
|
2566
2568
|
{
|
2567
2569
|
title: "One Minus Dst Color",
|
2568
|
-
valye:
|
2570
|
+
valye: Rn
|
2569
2571
|
},
|
2570
2572
|
{
|
2571
2573
|
title: "Constant Color",
|
2572
|
-
valye:
|
2574
|
+
valye: _n
|
2573
2575
|
},
|
2574
2576
|
{
|
2575
2577
|
title: "One Minus Constant Color",
|
2576
|
-
valye:
|
2578
|
+
valye: kn
|
2577
2579
|
},
|
2578
2580
|
{
|
2579
2581
|
title: "Constant Alpha",
|
2580
|
-
valye:
|
2582
|
+
valye: Dn
|
2581
2583
|
},
|
2582
2584
|
{
|
2583
2585
|
title: "One Minus Constant Alpha",
|
2584
|
-
valye:
|
2586
|
+
valye: Pn
|
2585
2587
|
}
|
2586
2588
|
];
|
2587
2589
|
function ft(e, n) {
|
2588
2590
|
e.needsUpdate = !0, e.type = "option", e.options = n;
|
2589
2591
|
}
|
2590
|
-
function
|
2592
|
+
function ri(e, n, a, t) {
|
2591
2593
|
return {
|
2592
2594
|
type: "boolean",
|
2593
2595
|
title: Rt(e),
|
2594
2596
|
prop: e,
|
2595
2597
|
value: n,
|
2596
2598
|
needsUpdate: !0,
|
2597
|
-
onChange: (i,
|
2598
|
-
t.updateObject(a.uuid, `material.${e}`,
|
2599
|
-
const
|
2600
|
-
if (
|
2601
|
-
const r =
|
2602
|
-
|
2599
|
+
onChange: (i, c) => {
|
2600
|
+
t.updateObject(a.uuid, `material.${e}`, c), t.updateObject(a.uuid, "material.needsUpdate", !0);
|
2601
|
+
const u = t.getScene(a.uuid);
|
2602
|
+
if (u !== null) {
|
2603
|
+
const r = u.getObjectByProperty("uuid", a.uuid);
|
2604
|
+
ne(r, `material.${e}`, c);
|
2603
2605
|
}
|
2604
2606
|
}
|
2605
2607
|
};
|
2606
2608
|
}
|
2607
|
-
function
|
2609
|
+
function si(e, n, a, t) {
|
2608
2610
|
const i = {
|
2609
2611
|
type: "number",
|
2610
2612
|
title: Rt(e),
|
@@ -2614,292 +2616,296 @@ function ri(e, n, a, t) {
|
|
2614
2616
|
max: void 0,
|
2615
2617
|
step: 0.01,
|
2616
2618
|
needsUpdate: !0,
|
2617
|
-
onChange: (
|
2618
|
-
t.updateObject(a.uuid, `material.${e}`,
|
2619
|
+
onChange: (c, u) => {
|
2620
|
+
t.updateObject(a.uuid, `material.${e}`, u), t.updateObject(a.uuid, "material.needsUpdate", !0);
|
2619
2621
|
const r = t.getScene(a.uuid);
|
2620
2622
|
if (r !== null) {
|
2621
2623
|
const h = r.getObjectByProperty("uuid", a.uuid);
|
2622
|
-
|
2624
|
+
ne(h, `material.${e}`, u);
|
2623
2625
|
}
|
2624
2626
|
}
|
2625
2627
|
};
|
2626
2628
|
switch (e) {
|
2627
2629
|
case "blending":
|
2628
|
-
ft(i,
|
2630
|
+
ft(i, ti);
|
2629
2631
|
break;
|
2630
2632
|
case "blendDst":
|
2631
|
-
ft(i,
|
2633
|
+
ft(i, ii);
|
2632
2634
|
break;
|
2633
2635
|
case "blendEquation":
|
2634
|
-
ft(i,
|
2636
|
+
ft(i, ni);
|
2635
2637
|
break;
|
2636
2638
|
case "blendSrc":
|
2637
|
-
ft(i,
|
2639
|
+
ft(i, ai);
|
2638
2640
|
break;
|
2639
2641
|
case "side":
|
2640
|
-
ft(i,
|
2642
|
+
ft(i, ei);
|
2641
2643
|
break;
|
2642
2644
|
}
|
2643
|
-
return
|
2645
|
+
return $n(e) && (i.value = Number(n), i.type = "range", i.min = Math.min(0, i.value), i.max = Math.max(1, i.value), i.step = 0.01), i;
|
2644
2646
|
}
|
2645
|
-
function
|
2647
|
+
function oi(e, n, a, t) {
|
2646
2648
|
const i = {
|
2647
2649
|
type: "string",
|
2648
2650
|
title: Rt(e),
|
2649
2651
|
prop: e,
|
2650
2652
|
value: n,
|
2651
2653
|
needsUpdate: !0,
|
2652
|
-
onChange: (
|
2654
|
+
onChange: (u, r) => {
|
2653
2655
|
t.updateObject(a.uuid, `material.${e}`, r), t.updateObject(a.uuid, "material.needsUpdate", !0);
|
2654
2656
|
const h = t.getScene(a.uuid);
|
2655
2657
|
if (h !== null) {
|
2656
|
-
const
|
2657
|
-
|
2658
|
+
const d = h.getObjectByProperty("uuid", a.uuid);
|
2659
|
+
ne(d, `material.${e}`, r);
|
2658
2660
|
}
|
2659
2661
|
},
|
2660
|
-
onKeyDown: (
|
2662
|
+
onKeyDown: (u) => {
|
2661
2663
|
}
|
2662
2664
|
};
|
2663
|
-
return (e === "vertexShader" || e === "fragmentShader") && (i.disabled = !1, i.latest = i.value, i.onChange = (
|
2665
|
+
return (e === "vertexShader" || e === "fragmentShader") && (i.disabled = !1, i.latest = i.value, i.onChange = (u, r) => {
|
2664
2666
|
i.latest = r, t.updateObject(a.uuid, `material.${e}`, r);
|
2665
2667
|
const h = t.getScene(a.uuid);
|
2666
2668
|
if (h !== null) {
|
2667
|
-
const
|
2668
|
-
|
2669
|
+
const d = h.getObjectByProperty("uuid", a.uuid);
|
2670
|
+
ne(d, `material.${e}`, r);
|
2669
2671
|
}
|
2670
|
-
}, i.onKeyDown = (
|
2671
|
-
if (
|
2672
|
+
}, i.onKeyDown = (u) => {
|
2673
|
+
if (u.key === "Enter" && (u.altKey || u.metaKey)) {
|
2672
2674
|
t.updateObject(a.uuid, "material.needsUpdate", !0);
|
2673
2675
|
const r = t.getScene(a.uuid);
|
2674
2676
|
if (r !== null) {
|
2675
2677
|
const h = r.getObjectByProperty("uuid", a.uuid);
|
2676
|
-
|
2678
|
+
ne(h, "material.needsUpdate", !0);
|
2677
2679
|
}
|
2678
2680
|
}
|
2679
2681
|
}), i;
|
2680
2682
|
}
|
2681
|
-
function
|
2683
|
+
function ci(e) {
|
2682
2684
|
return e.x !== void 0 && e.y !== void 0 && e.z === void 0;
|
2683
2685
|
}
|
2684
|
-
function
|
2686
|
+
function li(e) {
|
2685
2687
|
return e.x !== void 0 && e.y !== void 0 && e.z !== void 0 && e.w === void 0;
|
2686
2688
|
}
|
2687
|
-
function
|
2689
|
+
function ui(e) {
|
2688
2690
|
return e.x !== void 0 && e.y !== void 0 && e.z !== void 0 && e.w !== void 0;
|
2689
2691
|
}
|
2690
2692
|
function Ft(e) {
|
2691
2693
|
e.sort((n, a) => n.title < a.title ? -1 : n.title > a.title ? 1 : 0);
|
2692
2694
|
}
|
2693
|
-
function mt(e, n, a, t, i = "",
|
2694
|
-
const
|
2695
|
+
function mt(e, n, a, t, i = "", c = !1) {
|
2696
|
+
const u = Rt(e).split(".")[0].replaceAll("[", "").replaceAll("]", ""), r = i.length > 0 ? `${i}.${e}` : e, h = typeof n;
|
2695
2697
|
if (h === "boolean" || h === "string")
|
2696
2698
|
return {
|
2697
|
-
title:
|
2699
|
+
title: u,
|
2698
2700
|
prop: r,
|
2699
2701
|
type: h,
|
2700
2702
|
value: n,
|
2701
|
-
disabled:
|
2702
|
-
onChange: (
|
2703
|
+
disabled: c,
|
2704
|
+
onChange: (d, f) => {
|
2703
2705
|
t.updateObject(a.uuid, `material.${r}`, f);
|
2704
2706
|
const m = t.getScene(a.uuid);
|
2705
2707
|
if (m !== null) {
|
2706
|
-
const
|
2707
|
-
|
2708
|
+
const v = m.getObjectByProperty("uuid", a.uuid);
|
2709
|
+
ne(v, `material.${r}`, f);
|
2708
2710
|
}
|
2709
2711
|
}
|
2710
2712
|
};
|
2711
2713
|
if (h === "number") {
|
2712
|
-
const
|
2713
|
-
title:
|
2714
|
+
const d = {
|
2715
|
+
title: u,
|
2714
2716
|
prop: r,
|
2715
2717
|
type: "number",
|
2716
2718
|
value: n,
|
2717
2719
|
step: 0.01,
|
2718
|
-
disabled:
|
2720
|
+
disabled: c,
|
2719
2721
|
onChange: (f, m) => {
|
2720
2722
|
t.updateObject(a.uuid, `material.${r}`, m);
|
2721
|
-
const
|
2722
|
-
if (
|
2723
|
-
const
|
2724
|
-
|
2723
|
+
const v = t.getScene(a.uuid);
|
2724
|
+
if (v !== null) {
|
2725
|
+
const x = v.getObjectByProperty("uuid", a.uuid);
|
2726
|
+
ne(x, `material.${r}`, m);
|
2725
2727
|
}
|
2726
2728
|
}
|
2727
2729
|
};
|
2728
|
-
return
|
2730
|
+
return $n(u) && (d.type = "range", d.min = 0, d.max = 1), d;
|
2729
2731
|
} else {
|
2730
2732
|
if (n.isColor)
|
2731
2733
|
return {
|
2732
|
-
title:
|
2734
|
+
title: u,
|
2733
2735
|
prop: r,
|
2734
2736
|
type: "color",
|
2735
2737
|
value: n,
|
2736
|
-
disabled:
|
2737
|
-
onChange: (
|
2738
|
+
disabled: c,
|
2739
|
+
onChange: (d, f) => {
|
2738
2740
|
const m = new Ut(f);
|
2739
2741
|
t.updateObject(a.uuid, `material.${r}`, m);
|
2740
|
-
const
|
2741
|
-
if (
|
2742
|
-
const
|
2743
|
-
|
2742
|
+
const v = t.getScene(a.uuid);
|
2743
|
+
if (v !== null) {
|
2744
|
+
const x = v.getObjectByProperty("uuid", a.uuid);
|
2745
|
+
ne(x, `material.${r}`, m);
|
2744
2746
|
}
|
2745
2747
|
}
|
2746
2748
|
};
|
2747
2749
|
if (Array.isArray(n)) {
|
2748
|
-
const
|
2750
|
+
const d = [];
|
2749
2751
|
for (const f in n) {
|
2750
|
-
const m = n[f],
|
2752
|
+
const m = n[f], v = `[${f.toString()}]`;
|
2751
2753
|
if (m.value !== void 0) {
|
2752
|
-
const
|
2753
|
-
|
2754
|
+
const x = mt(`${v}.value`, m.value, a, t, r, c);
|
2755
|
+
x !== void 0 && d.push(x);
|
2754
2756
|
} else {
|
2755
|
-
const
|
2756
|
-
|
2757
|
+
const x = mt(v, m, a, t, r, c);
|
2758
|
+
x !== void 0 && d.push(x);
|
2757
2759
|
}
|
2758
2760
|
}
|
2759
|
-
if (
|
2760
|
-
return Ft(
|
2761
|
-
title:
|
2762
|
-
items:
|
2761
|
+
if (d.length > 0)
|
2762
|
+
return Ft(d), {
|
2763
|
+
title: u,
|
2764
|
+
items: d
|
2763
2765
|
};
|
2764
2766
|
} else {
|
2765
|
-
if (
|
2767
|
+
if (ci(n))
|
2766
2768
|
return {
|
2767
|
-
title:
|
2769
|
+
title: u,
|
2768
2770
|
prop: r,
|
2769
2771
|
type: "vector2",
|
2770
2772
|
value: n,
|
2771
|
-
disabled:
|
2772
|
-
onChange: (
|
2773
|
+
disabled: c,
|
2774
|
+
onChange: (d, f) => {
|
2773
2775
|
t.updateObject(a.uuid, `material.${r}`, f);
|
2774
2776
|
const m = t.getScene(a.uuid);
|
2775
2777
|
if (m !== null) {
|
2776
|
-
const
|
2777
|
-
|
2778
|
+
const v = m.getObjectByProperty("uuid", a.uuid);
|
2779
|
+
ne(v, `material.${r}`, f);
|
2778
2780
|
}
|
2779
2781
|
}
|
2780
2782
|
};
|
2781
|
-
if (
|
2783
|
+
if (li(n))
|
2782
2784
|
return {
|
2783
|
-
title:
|
2785
|
+
title: u,
|
2784
2786
|
prop: r,
|
2785
2787
|
type: "grid3",
|
2786
2788
|
value: n,
|
2787
|
-
disabled:
|
2788
|
-
onChange: (
|
2789
|
+
disabled: c,
|
2790
|
+
onChange: (d, f) => {
|
2789
2791
|
t.updateObject(a.uuid, `material.${r}`, f);
|
2790
2792
|
const m = t.getScene(a.uuid);
|
2791
2793
|
if (m !== null) {
|
2792
|
-
const
|
2793
|
-
|
2794
|
+
const v = m.getObjectByProperty("uuid", a.uuid);
|
2795
|
+
ne(v, `material.${r}`, f);
|
2794
2796
|
}
|
2795
2797
|
}
|
2796
2798
|
};
|
2797
|
-
if (
|
2799
|
+
if (ui(n))
|
2798
2800
|
return {
|
2799
|
-
title:
|
2801
|
+
title: u,
|
2800
2802
|
prop: r,
|
2801
2803
|
type: "grid4",
|
2802
2804
|
value: n,
|
2803
|
-
disabled:
|
2804
|
-
onChange: (
|
2805
|
+
disabled: c,
|
2806
|
+
onChange: (d, f) => {
|
2805
2807
|
t.updateObject(a.uuid, `material.${r}`, f);
|
2806
2808
|
const m = t.getScene(a.uuid);
|
2807
2809
|
if (m !== null) {
|
2808
|
-
const
|
2809
|
-
|
2810
|
+
const v = m.getObjectByProperty("uuid", a.uuid);
|
2811
|
+
ne(v, `material.${r}`, f);
|
2810
2812
|
}
|
2811
2813
|
}
|
2812
2814
|
};
|
2813
2815
|
if (n.isEuler)
|
2814
2816
|
return {
|
2815
|
-
title:
|
2817
|
+
title: u,
|
2816
2818
|
prop: r,
|
2817
2819
|
type: "euler",
|
2818
2820
|
value: n,
|
2819
|
-
disabled:
|
2820
|
-
onChange: (
|
2821
|
+
disabled: c,
|
2822
|
+
onChange: (d, f) => {
|
2821
2823
|
t.updateObject(a.uuid, `material.${r}`, f);
|
2822
2824
|
const m = t.getScene(a.uuid);
|
2823
2825
|
if (m !== null) {
|
2824
|
-
const
|
2825
|
-
|
2826
|
+
const v = m.getObjectByProperty("uuid", a.uuid);
|
2827
|
+
ne(v, `material.${r}`, f);
|
2826
2828
|
}
|
2827
2829
|
}
|
2828
2830
|
};
|
2829
2831
|
if (n.src !== void 0)
|
2830
2832
|
return {
|
2831
|
-
title:
|
2833
|
+
title: u,
|
2832
2834
|
type: "image",
|
2833
2835
|
value: n,
|
2834
|
-
disabled:
|
2835
|
-
onChange: (
|
2836
|
-
const m =
|
2837
|
-
t.createTexture(a.uuid, `material.${
|
2838
|
-
const
|
2839
|
-
if (
|
2840
|
-
const
|
2841
|
-
|
2842
|
-
|
2843
|
-
|
2844
|
-
|
2845
|
-
|
2846
|
-
|
2847
|
-
|
2848
|
-
|
2849
|
-
|
2850
|
-
|
2851
|
-
|
2852
|
-
|
2853
|
-
|
2854
|
-
|
2855
|
-
|
2856
|
-
|
2857
|
-
|
2858
|
-
|
2859
|
-
|
2860
|
-
|
2861
|
-
|
2862
|
-
|
2836
|
+
disabled: c,
|
2837
|
+
onChange: (d, f) => {
|
2838
|
+
const m = Ja(e), v = i.length > 0 ? `${i}.${m}` : m;
|
2839
|
+
t.createTexture(a.uuid, `material.${v}`, f);
|
2840
|
+
const x = t.getScene(a.uuid);
|
2841
|
+
if (x !== null) {
|
2842
|
+
const _ = x.getObjectByProperty("uuid", a.uuid);
|
2843
|
+
if (_ !== void 0) {
|
2844
|
+
const q = (U) => {
|
2845
|
+
const $ = _.material, C = v.split(".");
|
2846
|
+
switch (C.length) {
|
2847
|
+
case 1:
|
2848
|
+
$[C[0]] = U;
|
2849
|
+
break;
|
2850
|
+
case 2:
|
2851
|
+
$[C[0]][C[1]] = U;
|
2852
|
+
break;
|
2853
|
+
case 3:
|
2854
|
+
$[C[0]][C[1]][C[2]] = U;
|
2855
|
+
break;
|
2856
|
+
case 4:
|
2857
|
+
$[C[0]][C[1]][C[2]][C[3]] = U;
|
2858
|
+
break;
|
2859
|
+
case 5:
|
2860
|
+
$[C[0]][C[1]][C[2]][C[3]][C[4]] = U;
|
2861
|
+
break;
|
2862
|
+
}
|
2863
|
+
$.needsUpdate = !0;
|
2864
|
+
};
|
2865
|
+
f.src.length > 0 ? Bn(f.src).then((U) => {
|
2866
|
+
U.offset.set(f.offset[0], f.offset[1]), U.repeat.set(f.repeat[0], f.repeat[1]), q(U);
|
2867
|
+
}) : q(null);
|
2868
|
+
}
|
2863
2869
|
}
|
2864
2870
|
}
|
2865
2871
|
};
|
2866
2872
|
if (n.elements !== void 0)
|
2867
2873
|
return {
|
2868
|
-
title:
|
2874
|
+
title: u,
|
2869
2875
|
prop: r,
|
2870
2876
|
type: n.elements.length > 9 ? "grid4" : "grid3",
|
2871
2877
|
value: n,
|
2872
|
-
disabled:
|
2873
|
-
onChange: (
|
2878
|
+
disabled: c,
|
2879
|
+
onChange: (d, f) => {
|
2874
2880
|
t.updateObject(a.uuid, `material.${r}`, f);
|
2875
2881
|
const m = t.getScene(a.uuid);
|
2876
2882
|
if (m !== null) {
|
2877
|
-
const
|
2878
|
-
|
2883
|
+
const v = m.getObjectByProperty("uuid", a.uuid);
|
2884
|
+
ne(v, `material.${r}`, f);
|
2879
2885
|
}
|
2880
2886
|
}
|
2881
2887
|
};
|
2882
2888
|
{
|
2883
|
-
const
|
2889
|
+
const d = [], f = e === "defines" || e === "extensions";
|
2884
2890
|
try {
|
2885
2891
|
for (const m in n) {
|
2886
|
-
const
|
2887
|
-
if (
|
2888
|
-
if (
|
2889
|
-
const
|
2890
|
-
|
2892
|
+
const v = n[m];
|
2893
|
+
if (v !== void 0)
|
2894
|
+
if (v.value !== void 0) {
|
2895
|
+
const x = mt(`${m}.value`, v.value, a, t, r, f);
|
2896
|
+
x !== void 0 && d.push(x);
|
2891
2897
|
} else {
|
2892
|
-
const
|
2893
|
-
|
2898
|
+
const x = mt(m, v, a, t, r, f);
|
2899
|
+
x !== void 0 && d.push(x);
|
2894
2900
|
}
|
2895
2901
|
}
|
2896
2902
|
} catch {
|
2897
2903
|
console.log("Issue cycling through material object:", e, n);
|
2898
2904
|
}
|
2899
|
-
if (
|
2900
|
-
return Ft(
|
2901
|
-
title:
|
2902
|
-
items:
|
2905
|
+
if (d.length > 0)
|
2906
|
+
return Ft(d), {
|
2907
|
+
title: u,
|
2908
|
+
items: d
|
2903
2909
|
};
|
2904
2910
|
}
|
2905
2911
|
}
|
@@ -2908,20 +2914,20 @@ function mt(e, n, a, t, i = "", o = !1) {
|
|
2908
2914
|
function cn(e, n, a) {
|
2909
2915
|
const t = [];
|
2910
2916
|
for (const i in e) {
|
2911
|
-
if (!
|
2917
|
+
if (!Za(i))
|
2912
2918
|
continue;
|
2913
|
-
const
|
2914
|
-
if (
|
2915
|
-
t.push(
|
2916
|
-
else if (
|
2917
|
-
t.push(
|
2918
|
-
else if (
|
2919
|
-
t.push(
|
2920
|
-
else if (
|
2921
|
-
const r = mt(i,
|
2919
|
+
const c = typeof e[i], u = e[i];
|
2920
|
+
if (c === "boolean")
|
2921
|
+
t.push(ri(i, u, n, a));
|
2922
|
+
else if (c === "number")
|
2923
|
+
t.push(si(i, u, n, a));
|
2924
|
+
else if (c === "string")
|
2925
|
+
t.push(oi(i, u, n, a));
|
2926
|
+
else if (c === "object") {
|
2927
|
+
const r = mt(i, u, n, a);
|
2922
2928
|
r !== void 0 && t.push(r);
|
2923
2929
|
} else
|
2924
|
-
|
2930
|
+
u !== void 0 && console.log("other:", i, c, u);
|
2925
2931
|
}
|
2926
2932
|
return Ft(t), t.push({
|
2927
2933
|
title: "Update Material",
|
@@ -2930,25 +2936,25 @@ function cn(e, n, a) {
|
|
2930
2936
|
a.updateObject(n.uuid, "material.needsUpdate", !0);
|
2931
2937
|
const i = a.getScene(n.uuid);
|
2932
2938
|
if (i !== null) {
|
2933
|
-
const
|
2934
|
-
|
2939
|
+
const c = i.getObjectByProperty("uuid", n.uuid);
|
2940
|
+
ne(c, "material.needsUpdate", !0);
|
2935
2941
|
}
|
2936
2942
|
}
|
2937
2943
|
}), t;
|
2938
2944
|
}
|
2939
|
-
function
|
2945
|
+
function di(e, n) {
|
2940
2946
|
const a = e.material;
|
2941
2947
|
if (Array.isArray(a)) {
|
2942
2948
|
const t = [], i = a.length;
|
2943
|
-
for (let
|
2949
|
+
for (let c = 0; c < i; c++)
|
2944
2950
|
t.push(
|
2945
2951
|
/* @__PURE__ */ l.jsx(
|
2946
2952
|
et,
|
2947
2953
|
{
|
2948
|
-
title: `Material ${
|
2949
|
-
items: cn(a[
|
2954
|
+
title: `Material ${c}`,
|
2955
|
+
items: cn(a[c], e, n)
|
2950
2956
|
},
|
2951
|
-
`Material ${
|
2957
|
+
`Material ${c}`
|
2952
2958
|
)
|
2953
2959
|
);
|
2954
2960
|
return /* @__PURE__ */ l.jsx(l.Fragment, { children: t });
|
@@ -2961,63 +2967,63 @@ function ui(e, n) {
|
|
2961
2967
|
}
|
2962
2968
|
);
|
2963
2969
|
}
|
2964
|
-
const
|
2970
|
+
const ln = "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==";
|
2965
2971
|
function hi(e) {
|
2966
|
-
const n =
|
2967
|
-
function
|
2972
|
+
const n = e.step !== void 0 ? e.step : 0.01, a = V(null), t = V(null), i = V(null), c = V(null), u = V(null), [r] = G(e.value), [h, d] = G(e.value.offset[0]), [f, m] = G(e.value.offset[1]), [v, x] = G(e.value.repeat[0]), [_, q] = G(e.value.repeat[1]);
|
2973
|
+
function U(C, K, M, Z, ue) {
|
2968
2974
|
if (e.onChange !== void 0) {
|
2969
|
-
const
|
2970
|
-
e.onChange(
|
2971
|
-
src:
|
2972
|
-
offset: [
|
2973
|
-
repeat: [
|
2975
|
+
const H = e.prop !== void 0 ? e.prop : e.title;
|
2976
|
+
e.onChange(H, {
|
2977
|
+
src: C,
|
2978
|
+
offset: [K, M],
|
2979
|
+
repeat: [Z, ue]
|
2974
2980
|
});
|
2975
2981
|
}
|
2976
2982
|
}
|
2977
|
-
function
|
2978
|
-
const
|
2979
|
-
switch (
|
2980
|
-
case a.current:
|
2981
|
-
h(T), N(L, T, u, m, S);
|
2982
|
-
break;
|
2983
|
+
function $(C) {
|
2984
|
+
const K = a.current.src, M = C.target.value;
|
2985
|
+
switch (C.target) {
|
2983
2986
|
case t.current:
|
2984
|
-
|
2987
|
+
d(M), U(K, M, f, v, _);
|
2985
2988
|
break;
|
2986
2989
|
case i.current:
|
2987
|
-
|
2990
|
+
m(M), U(K, h, M, v, _);
|
2991
|
+
break;
|
2992
|
+
case c.current:
|
2993
|
+
x(M), U(K, h, f, M, _);
|
2988
2994
|
break;
|
2989
|
-
case
|
2990
|
-
|
2995
|
+
case u.current:
|
2996
|
+
q(M), U(K, h, f, v, M);
|
2991
2997
|
break;
|
2992
2998
|
}
|
2993
2999
|
}
|
2994
3000
|
return /* @__PURE__ */ l.jsxs("div", { className: "imageField", children: [
|
2995
|
-
/* @__PURE__ */ l.jsx("img", { alt: e.title, ref:
|
2996
|
-
|
2997
|
-
|
3001
|
+
/* @__PURE__ */ l.jsx("img", { alt: e.title, ref: a, onClick: () => {
|
3002
|
+
Qa().then((C) => {
|
3003
|
+
a.current.src = C, U(C, h, f, v, _);
|
2998
3004
|
});
|
2999
|
-
}, src:
|
3005
|
+
}, src: r.src.length > 0 ? r.src : ln }),
|
3000
3006
|
/* @__PURE__ */ l.jsxs("div", { className: "fields", children: [
|
3001
3007
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
3002
3008
|
/* @__PURE__ */ l.jsx("label", { children: "Offset:" }),
|
3003
3009
|
/* @__PURE__ */ l.jsx(
|
3004
3010
|
"input",
|
3005
3011
|
{
|
3006
|
-
ref:
|
3012
|
+
ref: t,
|
3007
3013
|
type: "number",
|
3008
|
-
value:
|
3009
|
-
step:
|
3010
|
-
onChange:
|
3014
|
+
value: h,
|
3015
|
+
step: n,
|
3016
|
+
onChange: $
|
3011
3017
|
}
|
3012
3018
|
),
|
3013
3019
|
/* @__PURE__ */ l.jsx(
|
3014
3020
|
"input",
|
3015
3021
|
{
|
3016
|
-
ref:
|
3022
|
+
ref: i,
|
3017
3023
|
type: "number",
|
3018
|
-
value:
|
3019
|
-
step:
|
3020
|
-
onChange:
|
3024
|
+
value: f,
|
3025
|
+
step: n,
|
3026
|
+
onChange: $
|
3021
3027
|
}
|
3022
3028
|
)
|
3023
3029
|
] }),
|
@@ -3026,45 +3032,48 @@ function hi(e) {
|
|
3026
3032
|
/* @__PURE__ */ l.jsx(
|
3027
3033
|
"input",
|
3028
3034
|
{
|
3029
|
-
ref:
|
3035
|
+
ref: c,
|
3030
3036
|
type: "number",
|
3031
|
-
value:
|
3032
|
-
step:
|
3033
|
-
onChange:
|
3037
|
+
value: v,
|
3038
|
+
step: n,
|
3039
|
+
onChange: $
|
3034
3040
|
}
|
3035
3041
|
),
|
3036
3042
|
/* @__PURE__ */ l.jsx(
|
3037
3043
|
"input",
|
3038
3044
|
{
|
3039
|
-
ref:
|
3045
|
+
ref: u,
|
3040
3046
|
type: "number",
|
3041
|
-
value:
|
3042
|
-
step:
|
3043
|
-
onChange:
|
3047
|
+
value: _,
|
3048
|
+
step: n,
|
3049
|
+
onChange: $
|
3044
3050
|
}
|
3045
3051
|
)
|
3046
|
-
] })
|
3052
|
+
] }),
|
3053
|
+
/* @__PURE__ */ l.jsx("button", { onClick: () => {
|
3054
|
+
U("", h, f, v, _), a.current.src = ln;
|
3055
|
+
}, children: "Clear" })
|
3047
3056
|
] })
|
3048
3057
|
] });
|
3049
3058
|
}
|
3050
3059
|
function Ct(e) {
|
3051
3060
|
let n = e.value;
|
3052
|
-
n !== void 0 && n.isColor !== void 0 && (n =
|
3053
|
-
const [a, t] = G(n), i =
|
3054
|
-
let f =
|
3055
|
-
e.type === "boolean" ? f =
|
3056
|
-
},
|
3057
|
-
e.disabled && (
|
3061
|
+
n !== void 0 && n.isColor !== void 0 && (n = Da(e.value));
|
3062
|
+
const [a, t] = G(n), i = V(null), c = (d) => {
|
3063
|
+
let f = d.target.value;
|
3064
|
+
e.type === "boolean" ? f = d.target.checked : e.type === "option" && (f = e.options[f].value), t(f), e.onChange !== void 0 && e.onChange(e.prop !== void 0 ? e.prop : e.title, f);
|
3065
|
+
}, u = {};
|
3066
|
+
e.disabled && (u.opacity = 0.8);
|
3058
3067
|
const r = e.type === "string" && (a.length > 100 || a.search(`
|
3059
3068
|
`) > -1), h = r || e.type === "image" || e.type === "vector2";
|
3060
|
-
return /* @__PURE__ */ l.jsxs("div", { className: `field ${h ? "block" : ""}`, style:
|
3069
|
+
return /* @__PURE__ */ l.jsxs("div", { className: `field ${h ? "block" : ""}`, style: u, children: [
|
3061
3070
|
e.type !== "button" && /* @__PURE__ */ l.jsx("label", { ref: i, children: Mt(e.title) }, "fieldLabel"),
|
3062
3071
|
e.type === "string" && !r && /* @__PURE__ */ l.jsx(
|
3063
3072
|
"input",
|
3064
3073
|
{
|
3065
3074
|
type: "text",
|
3066
3075
|
disabled: e.disabled,
|
3067
|
-
onChange:
|
3076
|
+
onChange: c,
|
3068
3077
|
value: a
|
3069
3078
|
}
|
3070
3079
|
),
|
@@ -3074,9 +3083,9 @@ function Ct(e) {
|
|
3074
3083
|
cols: 50,
|
3075
3084
|
rows: 10,
|
3076
3085
|
disabled: e.disabled !== void 0 ? e.disabled : !0,
|
3077
|
-
onChange:
|
3078
|
-
onKeyDown: (
|
3079
|
-
e.onKeyDown !== void 0 && e.onKeyDown(
|
3086
|
+
onChange: c,
|
3087
|
+
onKeyDown: (d) => {
|
3088
|
+
e.onKeyDown !== void 0 && e.onKeyDown(d);
|
3080
3089
|
},
|
3081
3090
|
value: a
|
3082
3091
|
}
|
@@ -3086,7 +3095,7 @@ function Ct(e) {
|
|
3086
3095
|
{
|
3087
3096
|
type: "checkbox",
|
3088
3097
|
disabled: e.disabled,
|
3089
|
-
onChange:
|
3098
|
+
onChange: c,
|
3090
3099
|
checked: a
|
3091
3100
|
}
|
3092
3101
|
),
|
@@ -3119,8 +3128,8 @@ function Ct(e) {
|
|
3119
3128
|
}
|
3120
3129
|
),
|
3121
3130
|
e.type === "color" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
3122
|
-
/* @__PURE__ */ l.jsx("input", { type: "text", value: a.toString(), onChange:
|
3123
|
-
/* @__PURE__ */ l.jsx("input", { type: "color", value: a, onChange:
|
3131
|
+
/* @__PURE__ */ l.jsx("input", { type: "text", value: a.toString(), onChange: c, disabled: e.disabled, className: "color" }),
|
3132
|
+
/* @__PURE__ */ l.jsx("input", { type: "color", value: a, onChange: c, disabled: e.disabled })
|
3124
3133
|
] }),
|
3125
3134
|
e.type === "button" && /* @__PURE__ */ l.jsx(
|
3126
3135
|
"button",
|
@@ -3133,14 +3142,14 @@ function Ct(e) {
|
|
3133
3142
|
}
|
3134
3143
|
),
|
3135
3144
|
e.type === "image" && /* @__PURE__ */ l.jsx(hi, { title: e.title, prop: e.prop, value: e.value, onChange: e.onChange }),
|
3136
|
-
e.type === "option" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx("select", { onChange:
|
3137
|
-
e.type === "vector2" && /* @__PURE__ */ l.jsx(
|
3138
|
-
e.type === "grid3" && /* @__PURE__ */ l.jsx(on, { value: a, onChange:
|
3139
|
-
e.type === "grid4" && /* @__PURE__ */ l.jsx(
|
3140
|
-
e.type === "euler" && /* @__PURE__ */ l.jsx(on, { value: a, onChange:
|
3145
|
+
e.type === "option" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx("select", { onChange: c, disabled: e.disabled, defaultValue: e.value, children: e.options?.map((d, f) => /* @__PURE__ */ l.jsx("option", { value: d.value, children: Mt(d.title) }, f)) }) }),
|
3146
|
+
e.type === "vector2" && /* @__PURE__ */ l.jsx(qa, { step: e.step, value: a, min: 0, max: 1, onChange: c }),
|
3147
|
+
e.type === "grid3" && /* @__PURE__ */ l.jsx(on, { step: e.step, value: a, onChange: c }),
|
3148
|
+
e.type === "grid4" && /* @__PURE__ */ l.jsx(Ka, { step: e.step, value: a, onChange: c }),
|
3149
|
+
e.type === "euler" && /* @__PURE__ */ l.jsx(on, { step: e.step, value: a, onChange: c })
|
3141
3150
|
] });
|
3142
3151
|
}
|
3143
|
-
function
|
3152
|
+
function un(e) {
|
3144
3153
|
switch (e) {
|
3145
3154
|
case "fov":
|
3146
3155
|
return "FOV";
|
@@ -3174,34 +3183,34 @@ function fi(e, n) {
|
|
3174
3183
|
if (e.perspectiveCameraInfo !== void 0)
|
3175
3184
|
for (const t in e.perspectiveCameraInfo)
|
3176
3185
|
a.push({
|
3177
|
-
title:
|
3186
|
+
title: un(t),
|
3178
3187
|
prop: t,
|
3179
3188
|
type: "number",
|
3180
3189
|
step: 0.01,
|
3181
3190
|
value: e.perspectiveCameraInfo[t],
|
3182
|
-
onChange: (i,
|
3183
|
-
n.updateObject(e.uuid, i,
|
3184
|
-
const
|
3185
|
-
if (
|
3186
|
-
const r =
|
3187
|
-
r !== void 0 && (
|
3191
|
+
onChange: (i, c) => {
|
3192
|
+
n.updateObject(e.uuid, i, c), n.requestMethod(e.uuid, "updateProjectionMatrix");
|
3193
|
+
const u = n.getScene(e.uuid);
|
3194
|
+
if (u !== null) {
|
3195
|
+
const r = u.getObjectByProperty("uuid", e.uuid);
|
3196
|
+
r !== void 0 && (ne(r, i, c), r.updateProjectionMatrix());
|
3188
3197
|
}
|
3189
3198
|
}
|
3190
3199
|
});
|
3191
3200
|
else if (e.orthographicCameraInfo !== void 0)
|
3192
3201
|
for (const t in e.orthographicCameraInfo)
|
3193
3202
|
a.push({
|
3194
|
-
title:
|
3203
|
+
title: un(t),
|
3195
3204
|
prop: t,
|
3196
3205
|
type: "number",
|
3197
3206
|
step: 0.01,
|
3198
3207
|
value: e.perspectiveCameraInfo[t],
|
3199
|
-
onChange: (i,
|
3200
|
-
n.updateObject(e.uuid, i,
|
3201
|
-
const
|
3202
|
-
if (
|
3203
|
-
const r =
|
3204
|
-
r !== void 0 && (
|
3208
|
+
onChange: (i, c) => {
|
3209
|
+
n.updateObject(e.uuid, i, c), n.requestMethod(e.uuid, "updateProjectionMatrix");
|
3210
|
+
const u = n.getScene(e.uuid);
|
3211
|
+
if (u !== null) {
|
3212
|
+
const r = u.getObjectByProperty("uuid", e.uuid);
|
3213
|
+
r !== void 0 && (ne(r, i, c), r.updateProjectionMatrix());
|
3205
3214
|
}
|
3206
3215
|
}
|
3207
3216
|
});
|
@@ -3214,17 +3223,17 @@ function fi(e, n) {
|
|
3214
3223
|
);
|
3215
3224
|
}
|
3216
3225
|
function mi(e, n) {
|
3217
|
-
const a = new
|
3226
|
+
const a = new sa();
|
3218
3227
|
a.elements = e.matrix;
|
3219
|
-
const t = new
|
3220
|
-
e.uuid.length > 0 && (t.setFromMatrixPosition(a), i.setFromRotationMatrix(a),
|
3221
|
-
const
|
3222
|
-
const
|
3223
|
-
n.updateObject(e.uuid, r,
|
3228
|
+
const t = new Q(), i = new oa(), c = new Q();
|
3229
|
+
e.uuid.length > 0 && (t.setFromMatrixPosition(a), i.setFromRotationMatrix(a), c.setFromMatrixScale(a));
|
3230
|
+
const u = (r, h) => {
|
3231
|
+
const d = r === "rotation" ? { x: h._x, y: h._y, z: h._z } : h;
|
3232
|
+
n.updateObject(e.uuid, r, d);
|
3224
3233
|
const f = n.getScene(e.uuid);
|
3225
3234
|
if (f !== null) {
|
3226
3235
|
const m = f.getObjectByProperty("uuid", e.uuid);
|
3227
|
-
|
3236
|
+
ne(m, r, d);
|
3228
3237
|
}
|
3229
3238
|
};
|
3230
3239
|
return /* @__PURE__ */ l.jsx(
|
@@ -3236,28 +3245,29 @@ function mi(e, n) {
|
|
3236
3245
|
title: "Position",
|
3237
3246
|
prop: "position",
|
3238
3247
|
type: "grid3",
|
3248
|
+
step: 0.1,
|
3239
3249
|
value: t,
|
3240
|
-
onChange:
|
3250
|
+
onChange: u
|
3241
3251
|
},
|
3242
3252
|
{
|
3243
3253
|
title: "Rotation",
|
3244
3254
|
prop: "rotation",
|
3245
3255
|
type: "grid3",
|
3246
3256
|
value: i,
|
3247
|
-
onChange:
|
3257
|
+
onChange: u
|
3248
3258
|
},
|
3249
3259
|
{
|
3250
3260
|
title: "Scale",
|
3251
3261
|
prop: "scale",
|
3252
3262
|
type: "grid3",
|
3253
|
-
value:
|
3254
|
-
onChange:
|
3263
|
+
value: c,
|
3264
|
+
onChange: u
|
3255
3265
|
}
|
3256
3266
|
]
|
3257
3267
|
}
|
3258
3268
|
);
|
3259
3269
|
}
|
3260
|
-
function
|
3270
|
+
function dn(e) {
|
3261
3271
|
switch (e) {
|
3262
3272
|
case "color":
|
3263
3273
|
return "Color";
|
@@ -3286,31 +3296,31 @@ function pi(e, n) {
|
|
3286
3296
|
for (const t in e.lightInfo) {
|
3287
3297
|
const i = e.lightInfo[t];
|
3288
3298
|
i !== void 0 && (i.isColor !== void 0 ? a.push({
|
3289
|
-
title:
|
3299
|
+
title: dn(t),
|
3290
3300
|
prop: t,
|
3291
3301
|
type: "color",
|
3292
3302
|
value: i,
|
3293
|
-
onChange: (
|
3294
|
-
const r = new Ut(
|
3295
|
-
n.updateObject(e.uuid,
|
3303
|
+
onChange: (c, u) => {
|
3304
|
+
const r = new Ut(u);
|
3305
|
+
n.updateObject(e.uuid, c, r);
|
3296
3306
|
const h = n.getScene(e.uuid);
|
3297
3307
|
if (h !== null) {
|
3298
|
-
const
|
3299
|
-
|
3308
|
+
const d = h.getObjectByProperty("uuid", e.uuid);
|
3309
|
+
ne(d, c, r);
|
3300
3310
|
}
|
3301
3311
|
}
|
3302
3312
|
}) : a.push({
|
3303
|
-
title:
|
3313
|
+
title: dn(t),
|
3304
3314
|
prop: t,
|
3305
3315
|
type: typeof i,
|
3306
3316
|
value: i,
|
3307
3317
|
step: typeof i == "number" ? 0.01 : void 0,
|
3308
|
-
onChange: (
|
3309
|
-
n.updateObject(e.uuid,
|
3318
|
+
onChange: (c, u) => {
|
3319
|
+
n.updateObject(e.uuid, c, u);
|
3310
3320
|
const r = n.getScene(e.uuid);
|
3311
3321
|
if (r !== null) {
|
3312
3322
|
const h = r.getObjectByProperty("uuid", e.uuid);
|
3313
|
-
|
3323
|
+
ne(h, c, u);
|
3314
3324
|
}
|
3315
3325
|
}
|
3316
3326
|
}));
|
@@ -3326,14 +3336,14 @@ function pi(e, n) {
|
|
3326
3336
|
function gi(e, n) {
|
3327
3337
|
const a = [], t = [];
|
3328
3338
|
let i = 0;
|
3329
|
-
e.animations.forEach((
|
3330
|
-
i = Math.max(i,
|
3331
|
-
title:
|
3339
|
+
e.animations.forEach((u) => {
|
3340
|
+
i = Math.max(i, u.duration), u.duration > 0 && t.push({
|
3341
|
+
title: u.name,
|
3332
3342
|
items: [
|
3333
3343
|
{
|
3334
3344
|
title: "Duration",
|
3335
3345
|
type: "number",
|
3336
|
-
value:
|
3346
|
+
value: u.duration,
|
3337
3347
|
disabled: !0
|
3338
3348
|
},
|
3339
3349
|
{
|
@@ -3357,14 +3367,14 @@ function gi(e, n) {
|
|
3357
3367
|
title: "Animations",
|
3358
3368
|
items: t
|
3359
3369
|
});
|
3360
|
-
const
|
3361
|
-
if (
|
3362
|
-
const
|
3370
|
+
const c = n.getScene(e.uuid);
|
3371
|
+
if (c !== null) {
|
3372
|
+
const u = c.getObjectByProperty("uuid", e.uuid);
|
3363
3373
|
let r = !1;
|
3364
|
-
if (
|
3365
|
-
const h =
|
3374
|
+
if (u !== void 0) {
|
3375
|
+
const h = u.mixer;
|
3366
3376
|
if (r = h !== void 0, r) {
|
3367
|
-
const
|
3377
|
+
const d = [
|
3368
3378
|
{
|
3369
3379
|
title: "Time Scale",
|
3370
3380
|
type: "range",
|
@@ -3377,7 +3387,7 @@ function gi(e, n) {
|
|
3377
3387
|
}
|
3378
3388
|
}
|
3379
3389
|
];
|
3380
|
-
|
3390
|
+
d.push({
|
3381
3391
|
title: "Stop All",
|
3382
3392
|
type: "button",
|
3383
3393
|
onChange: () => {
|
@@ -3385,14 +3395,14 @@ function gi(e, n) {
|
|
3385
3395
|
}
|
3386
3396
|
}), a.push({
|
3387
3397
|
title: "Mixer",
|
3388
|
-
items:
|
3398
|
+
items: d
|
3389
3399
|
});
|
3390
3400
|
}
|
3391
3401
|
}
|
3392
3402
|
}
|
3393
3403
|
return /* @__PURE__ */ l.jsx(et, { title: "Animation", items: a });
|
3394
3404
|
}
|
3395
|
-
const
|
3405
|
+
const zn = {
|
3396
3406
|
name: "",
|
3397
3407
|
uuid: "",
|
3398
3408
|
type: "",
|
@@ -3405,22 +3415,22 @@ const $n = {
|
|
3405
3415
|
lightInfo: void 0,
|
3406
3416
|
children: []
|
3407
3417
|
};
|
3408
|
-
let
|
3418
|
+
let pe = { ...zn };
|
3409
3419
|
function vi(e) {
|
3410
3420
|
const [n, a] = G(-1);
|
3411
3421
|
Re(() => {
|
3412
|
-
function
|
3413
|
-
|
3422
|
+
function u(h) {
|
3423
|
+
pe = { ...h.value }, a(Date.now());
|
3414
3424
|
}
|
3415
3425
|
function r() {
|
3416
|
-
|
3426
|
+
pe = { ...zn }, a(Date.now());
|
3417
3427
|
}
|
3418
|
-
return
|
3419
|
-
|
3428
|
+
return P.addEventListener(A.SET_SCENE, r), P.addEventListener(A.SET_OBJECT, u), () => {
|
3429
|
+
P.removeEventListener(A.SET_SCENE, r), P.removeEventListener(A.SET_OBJECT, u);
|
3420
3430
|
};
|
3421
3431
|
}, []);
|
3422
|
-
const t =
|
3423
|
-
return /* @__PURE__ */ l.jsx(Gt, { label: "Inspector", children: /* @__PURE__ */ l.jsx("div", { id: "Inspector", className: e.class, children:
|
3432
|
+
const t = pe.type.toLowerCase(), i = pe.animations.length > 0 || pe.mixer !== void 0, c = t.search("mesh") > -1 || t.search("line") > -1 || t.search("points") > -1;
|
3433
|
+
return /* @__PURE__ */ l.jsx(Gt, { label: "Inspector", children: /* @__PURE__ */ l.jsx("div", { id: "Inspector", className: e.class, children: pe.uuid.length > 0 && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
3424
3434
|
/* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
3425
3435
|
/* @__PURE__ */ l.jsx(
|
3426
3436
|
Ct,
|
@@ -3428,7 +3438,7 @@ function vi(e) {
|
|
3428
3438
|
type: "string",
|
3429
3439
|
title: "Name",
|
3430
3440
|
prop: "name",
|
3431
|
-
value:
|
3441
|
+
value: pe.name,
|
3432
3442
|
disabled: !0
|
3433
3443
|
}
|
3434
3444
|
),
|
@@ -3438,7 +3448,7 @@ function vi(e) {
|
|
3438
3448
|
type: "string",
|
3439
3449
|
title: "Type",
|
3440
3450
|
prop: "type",
|
3441
|
-
value:
|
3451
|
+
value: pe.type,
|
3442
3452
|
disabled: !0
|
3443
3453
|
}
|
3444
3454
|
),
|
@@ -3448,41 +3458,41 @@ function vi(e) {
|
|
3448
3458
|
type: "string",
|
3449
3459
|
title: "UUID",
|
3450
3460
|
prop: "uuid",
|
3451
|
-
value:
|
3461
|
+
value: pe.uuid,
|
3452
3462
|
disabled: !0
|
3453
3463
|
}
|
3454
3464
|
)
|
3455
3465
|
] }),
|
3456
3466
|
/* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
3457
|
-
mi(
|
3458
|
-
i ? gi(
|
3459
|
-
t.search("camera") > -1 ? fi(
|
3460
|
-
t.search("light") > -1 ? pi(
|
3461
|
-
|
3467
|
+
mi(pe, e.three),
|
3468
|
+
i ? gi(pe, e.three) : null,
|
3469
|
+
t.search("camera") > -1 ? fi(pe, e.three) : null,
|
3470
|
+
t.search("light") > -1 ? pi(pe, e.three) : null,
|
3471
|
+
c ? di(pe, e.three) : null
|
3462
3472
|
] })
|
3463
3473
|
] }) }, n) }, "Inspector");
|
3464
3474
|
}
|
3465
3475
|
function Fi(e) {
|
3466
3476
|
const [n] = G([]), [a, t] = G(0), i = (r) => {
|
3467
3477
|
n.push(r.value), t(Date.now());
|
3468
|
-
},
|
3478
|
+
}, c = (r) => {
|
3469
3479
|
const h = r.value;
|
3470
|
-
for (let
|
3471
|
-
if (h.uuid === n[
|
3472
|
-
n.splice(
|
3480
|
+
for (let d = 0; d < n.length; d++)
|
3481
|
+
if (h.uuid === n[d].uuid) {
|
3482
|
+
n.splice(d, 1), t(Date.now());
|
3473
3483
|
return;
|
3474
3484
|
}
|
3475
3485
|
};
|
3476
|
-
Re(() => (
|
3477
|
-
|
3486
|
+
Re(() => (P.addEventListener(A.ADD_SCENE, i), P.addEventListener(A.REMOVE_SCENE, c), () => {
|
3487
|
+
P.removeEventListener(A.ADD_SCENE, i), P.removeEventListener(A.REMOVE_SCENE, c);
|
3478
3488
|
}), []);
|
3479
|
-
const
|
3489
|
+
const u = [];
|
3480
3490
|
return n.forEach((r, h) => {
|
3481
|
-
|
3482
|
-
/* @__PURE__ */ l.jsx(Gt, { label: `Scene: ${r.name}`, open: !0, children: /* @__PURE__ */ l.jsx(
|
3491
|
+
u.push(
|
3492
|
+
/* @__PURE__ */ l.jsx(Gt, { label: `Scene: ${r.name}`, open: !0, children: /* @__PURE__ */ l.jsx(Ya, { child: r, scene: r, three: e.three }) }, `scene_${h}`)
|
3483
3493
|
);
|
3484
3494
|
}), /* @__PURE__ */ l.jsxs("div", { id: "SidePanel", children: [
|
3485
|
-
|
3495
|
+
u,
|
3486
3496
|
/* @__PURE__ */ l.jsx(vi, { three: e.three })
|
3487
3497
|
] }, `SidePanel ${a}`);
|
3488
3498
|
}
|
@@ -3490,65 +3500,69 @@ function Ui(e) {
|
|
3490
3500
|
return Re(() => {
|
3491
3501
|
function n(r) {
|
3492
3502
|
let h = null;
|
3493
|
-
return e.three.scenes.forEach((
|
3494
|
-
r.search(
|
3503
|
+
return e.three.scenes.forEach((d) => {
|
3504
|
+
r.search(d.uuid) > -1 && (h = d);
|
3495
3505
|
}), h;
|
3496
3506
|
}
|
3497
3507
|
const a = (r) => {
|
3498
|
-
const h = r.value,
|
3499
|
-
f !== void 0 ? e.three.setObject(f) : console.log(`Hermes - can't find object: ${h}`,
|
3500
|
-
}, t = (r, h,
|
3508
|
+
const h = r.value, d = n(h), f = d?.getObjectByProperty("uuid", h);
|
3509
|
+
f !== void 0 ? e.three.setObject(f) : console.log(`Hermes - can't find object: ${h}`, d);
|
3510
|
+
}, t = (r, h, d) => {
|
3501
3511
|
const f = n(r), m = f?.getObjectByProperty("uuid", r);
|
3502
|
-
m !== void 0 ?
|
3512
|
+
m !== void 0 ? ne(m, h, d) : console.log(`Hermes - can't set object: ${r}`, f);
|
3503
3513
|
}, i = (r) => {
|
3504
|
-
const h = r.value, { key:
|
3505
|
-
t(m,
|
3506
|
-
},
|
3514
|
+
const h = r.value, { key: d, value: f, uuid: m } = h;
|
3515
|
+
t(m, d, f);
|
3516
|
+
}, c = (r) => {
|
3507
3517
|
const h = r.value, f = n(h.uuid)?.getObjectByProperty("uuid", h.uuid);
|
3508
|
-
f !== void 0
|
3509
|
-
m
|
3510
|
-
|
3511
|
-
|
3512
|
-
|
3513
|
-
|
3514
|
-
|
3515
|
-
|
3516
|
-
|
3517
|
-
|
3518
|
-
|
3519
|
-
|
3520
|
-
|
3521
|
-
|
3522
|
-
|
3523
|
-
|
3524
|
-
|
3525
|
-
|
3526
|
-
|
3527
|
-
|
3528
|
-
|
3529
|
-
|
3530
|
-
|
3531
|
-
|
3532
|
-
|
3518
|
+
if (f !== void 0) {
|
3519
|
+
const m = (v) => {
|
3520
|
+
const x = h.key.split(".");
|
3521
|
+
switch (x.length) {
|
3522
|
+
case 1:
|
3523
|
+
f[x[0]] = v;
|
3524
|
+
break;
|
3525
|
+
case 2:
|
3526
|
+
f[x[0]][x[1]] = v;
|
3527
|
+
break;
|
3528
|
+
case 3:
|
3529
|
+
f[x[0]][x[1]][x[2]] = v;
|
3530
|
+
break;
|
3531
|
+
case 4:
|
3532
|
+
f[x[0]][x[1]][x[2]][x[3]] = v;
|
3533
|
+
break;
|
3534
|
+
case 5:
|
3535
|
+
f[x[0]][x[1]][x[2]][x[3]][x[4]] = v;
|
3536
|
+
break;
|
3537
|
+
}
|
3538
|
+
f.material.needsUpdate = !0;
|
3539
|
+
};
|
3540
|
+
h.value.src.length > 0 ? Bn(h.value.src).then((v) => {
|
3541
|
+
v.offset.set(h.value.offset[0], h.value.offset[1]), v.repeat.set(h.value.repeat[0], h.value.repeat[1]), m(v);
|
3542
|
+
}) : m(null);
|
3543
|
+
}
|
3544
|
+
}, u = (r) => {
|
3545
|
+
const { key: h, uuid: d, value: f, subitem: m } = r.value, x = n(d)?.getObjectByProperty("uuid", d);
|
3546
|
+
if (x !== void 0)
|
3533
3547
|
try {
|
3534
|
-
m !== void 0 ?
|
3535
|
-
} catch (
|
3536
|
-
console.log("Error requesting method:"), console.log(
|
3548
|
+
m !== void 0 ? Na(x, m)[h](f) : x[h](f);
|
3549
|
+
} catch (_) {
|
3550
|
+
console.log("Error requesting method:"), console.log(_), console.log(h), console.log(f);
|
3537
3551
|
}
|
3538
3552
|
};
|
3539
|
-
return
|
3540
|
-
|
3553
|
+
return P.addEventListener(A.GET_OBJECT, a), P.addEventListener(A.UPDATE_OBJECT, i), P.addEventListener(A.CREATE_TEXTURE, c), P.addEventListener(A.REQUEST_METHOD, u), () => {
|
3554
|
+
P.removeEventListener(A.GET_OBJECT, a), P.removeEventListener(A.UPDATE_OBJECT, i), P.removeEventListener(A.CREATE_TEXTURE, c), P.removeEventListener(A.REQUEST_METHOD, u);
|
3541
3555
|
};
|
3542
3556
|
}, []), null;
|
3543
3557
|
}
|
3544
|
-
class bi extends
|
3558
|
+
class bi extends ca {
|
3545
3559
|
constructor(n, a) {
|
3546
3560
|
const t = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0, 1, 1, 0], i = new qt();
|
3547
3561
|
i.setAttribute("position", new Kt(t, 3)), i.computeBoundingSphere();
|
3548
|
-
const
|
3549
|
-
super(i,
|
3550
|
-
const
|
3551
|
-
r.setAttribute("position", new Kt(
|
3562
|
+
const c = new la({ fog: !1 });
|
3563
|
+
super(i, c), this.light = n, this.color = a, this.type = "RectAreaLightHelper";
|
3564
|
+
const u = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0], r = new qt();
|
3565
|
+
r.setAttribute("position", new Kt(u, 3)), r.computeBoundingSphere(), this.add(new An(r, new jn({ side: vn, fog: !1 })));
|
3552
3566
|
}
|
3553
3567
|
updateMatrixWorld() {
|
3554
3568
|
if (this.scale.set(0.5 * this.light.width, 0.5 * this.light.height, 1), this.color !== void 0)
|
@@ -3564,62 +3578,62 @@ class bi extends oa {
|
|
3564
3578
|
this.geometry.dispose(), this.material.dispose(), this.children[0].geometry.dispose(), this.children[0].material.dispose();
|
3565
3579
|
}
|
3566
3580
|
}
|
3567
|
-
const
|
3568
|
-
class Ei extends
|
3581
|
+
const hn = { type: "change" }, jt = { type: "start" }, fn = { type: "end" }, Et = new ua(), mn = new da(), yi = Math.cos(70 * ha.DEG2RAD);
|
3582
|
+
class Ei extends pn {
|
3569
3583
|
constructor(n, a) {
|
3570
|
-
super(), this.object = n, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new
|
3584
|
+
super(), this.object = n, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new Q(), this.cursor = new Q(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: it.ROTATE, MIDDLE: it.DOLLY, RIGHT: it.PAN }, this.touches = { ONE: rt.ROTATE, TWO: rt.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
|
3571
3585
|
return r.phi;
|
3572
3586
|
}, this.getAzimuthalAngle = function() {
|
3573
3587
|
return r.theta;
|
3574
3588
|
}, this.getDistance = function() {
|
3575
3589
|
return this.object.position.distanceTo(this.target);
|
3576
|
-
}, this.listenToKeyEvents = function(
|
3577
|
-
|
3590
|
+
}, this.listenToKeyEvents = function(o) {
|
3591
|
+
o.addEventListener("keydown", lt), this._domElementKeyEvents = o;
|
3578
3592
|
}, this.stopListenToKeyEvents = function() {
|
3579
3593
|
this._domElementKeyEvents.removeEventListener("keydown", lt), this._domElementKeyEvents = null;
|
3580
3594
|
}, this.saveState = function() {
|
3581
3595
|
t.target0.copy(t.target), t.position0.copy(t.object.position), t.zoom0 = t.object.zoom;
|
3582
3596
|
}, this.reset = function() {
|
3583
|
-
t.target.copy(t.target0), t.object.position.copy(t.position0), t.object.zoom = t.zoom0, t.object.updateProjectionMatrix(), t.dispatchEvent(
|
3597
|
+
t.target.copy(t.target0), t.object.position.copy(t.position0), t.object.zoom = t.zoom0, t.object.updateProjectionMatrix(), t.dispatchEvent(hn), t.update(), c = i.NONE;
|
3584
3598
|
}, this.update = function() {
|
3585
|
-
const
|
3599
|
+
const o = new Q(), E = new Xt().setFromUnitVectors(n.up, new Q(0, 1, 0)), D = E.clone().invert(), L = new Q(), se = new Xt(), xe = new Q(), he = 2 * Math.PI;
|
3586
3600
|
return function(vt = null) {
|
3587
3601
|
const bt = t.object.position;
|
3588
|
-
|
3602
|
+
o.copy(bt).sub(t.target), o.applyQuaternion(E), r.setFromVector3(o), t.autoRotate && c === i.NONE && ye(_e(vt)), t.enableDamping ? (r.theta += h.theta * t.dampingFactor, r.phi += h.phi * t.dampingFactor) : (r.theta += h.theta, r.phi += h.phi);
|
3589
3603
|
let Se = t.minAzimuthAngle, Ce = t.maxAzimuthAngle;
|
3590
|
-
isFinite(Se) && isFinite(Ce) && (Se < -Math.PI ? Se +=
|
3604
|
+
isFinite(Se) && isFinite(Ce) && (Se < -Math.PI ? Se += he : Se > Math.PI && (Se -= he), Ce < -Math.PI ? Ce += he : Ce > Math.PI && (Ce -= he), Se <= Ce ? r.theta = Math.max(Se, Math.min(Ce, r.theta)) : r.theta = r.theta > (Se + Ce) / 2 ? Math.max(Se, r.theta) : Math.min(Ce, r.theta)), r.phi = Math.max(t.minPolarAngle, Math.min(t.maxPolarAngle, r.phi)), r.makeSafe(), t.enableDamping === !0 ? t.target.addScaledVector(f, t.dampingFactor) : t.target.add(f), t.target.sub(t.cursor), t.target.clampLength(t.minTargetRadius, t.maxTargetRadius), t.target.add(t.cursor);
|
3591
3605
|
let Xe = !1;
|
3592
|
-
if (t.zoomToCursor &&
|
3606
|
+
if (t.zoomToCursor && ue || t.object.isOrthographicCamera)
|
3593
3607
|
r.radius = Ae(r.radius);
|
3594
3608
|
else {
|
3595
3609
|
const Oe = r.radius;
|
3596
|
-
r.radius = Ae(r.radius *
|
3610
|
+
r.radius = Ae(r.radius * d), Xe = Oe != r.radius;
|
3597
3611
|
}
|
3598
|
-
if (
|
3612
|
+
if (o.setFromSpherical(r), o.applyQuaternion(D), bt.copy(t.target).add(o), t.object.lookAt(t.target), t.enableDamping === !0 ? (h.theta *= 1 - t.dampingFactor, h.phi *= 1 - t.dampingFactor, f.multiplyScalar(1 - t.dampingFactor)) : (h.set(0, 0, 0), f.set(0, 0, 0)), t.zoomToCursor && ue) {
|
3599
3613
|
let Oe = null;
|
3600
3614
|
if (t.object.isPerspectiveCamera) {
|
3601
|
-
const He =
|
3602
|
-
Oe = Ae(He *
|
3615
|
+
const He = o.length();
|
3616
|
+
Oe = Ae(He * d);
|
3603
3617
|
const nt = He - Oe;
|
3604
|
-
t.object.position.addScaledVector(
|
3618
|
+
t.object.position.addScaledVector(M, nt), t.object.updateMatrixWorld(), Xe = !!nt;
|
3605
3619
|
} else if (t.object.isOrthographicCamera) {
|
3606
|
-
const He = new
|
3620
|
+
const He = new Q(Z.x, Z.y, 0);
|
3607
3621
|
He.unproject(t.object);
|
3608
3622
|
const nt = t.object.zoom;
|
3609
|
-
t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom /
|
3610
|
-
const yt = new
|
3611
|
-
yt.unproject(t.object), t.object.position.sub(yt).add(He), t.object.updateMatrixWorld(), Oe =
|
3623
|
+
t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom / d)), t.object.updateProjectionMatrix(), Xe = nt !== t.object.zoom;
|
3624
|
+
const yt = new Q(Z.x, Z.y, 0);
|
3625
|
+
yt.unproject(t.object), t.object.position.sub(yt).add(He), t.object.updateMatrixWorld(), Oe = o.length();
|
3612
3626
|
} else
|
3613
3627
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), t.zoomToCursor = !1;
|
3614
|
-
Oe !== null && (this.screenSpacePanning ? t.target.set(0, 0, -1).transformDirection(t.object.matrix).multiplyScalar(Oe).add(t.object.position) : (Et.origin.copy(t.object.position), Et.direction.set(0, 0, -1).transformDirection(t.object.matrix), Math.abs(t.object.up.dot(Et.direction)) < yi ? n.lookAt(t.target) : (
|
3628
|
+
Oe !== null && (this.screenSpacePanning ? t.target.set(0, 0, -1).transformDirection(t.object.matrix).multiplyScalar(Oe).add(t.object.position) : (Et.origin.copy(t.object.position), Et.direction.set(0, 0, -1).transformDirection(t.object.matrix), Math.abs(t.object.up.dot(Et.direction)) < yi ? n.lookAt(t.target) : (mn.setFromNormalAndCoplanarPoint(t.object.up, t.target), Et.intersectPlane(mn, t.target))));
|
3615
3629
|
} else if (t.object.isOrthographicCamera) {
|
3616
3630
|
const Oe = t.object.zoom;
|
3617
|
-
t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom /
|
3631
|
+
t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom / d)), Oe !== t.object.zoom && (t.object.updateProjectionMatrix(), Xe = !0);
|
3618
3632
|
}
|
3619
|
-
return
|
3633
|
+
return d = 1, ue = !1, Xe || L.distanceToSquared(t.object.position) > u || 8 * (1 - se.dot(t.object.quaternion)) > u || xe.distanceToSquared(t.target) > u ? (t.dispatchEvent(hn), L.copy(t.object.position), se.copy(t.object.quaternion), xe.copy(t.target), !0) : !1;
|
3620
3634
|
};
|
3621
3635
|
}(), this.dispose = function() {
|
3622
|
-
t.domElement.removeEventListener("contextmenu", tt), t.domElement.removeEventListener("pointerdown",
|
3636
|
+
t.domElement.removeEventListener("contextmenu", tt), t.domElement.removeEventListener("pointerdown", S), t.domElement.removeEventListener("pointercancel", J), t.domElement.removeEventListener("wheel", ee), t.domElement.removeEventListener("pointermove", z), t.domElement.removeEventListener("pointerup", J), t.domElement.getRootNode().removeEventListener("keydown", ze, { capture: !0 }), t._domElementKeyEvents !== null && (t._domElementKeyEvents.removeEventListener("keydown", lt), t._domElementKeyEvents = null);
|
3623
3637
|
};
|
3624
3638
|
const t = this, i = {
|
3625
3639
|
NONE: -1,
|
@@ -3631,184 +3645,184 @@ class Ei extends mn {
|
|
3631
3645
|
TOUCH_DOLLY_PAN: 5,
|
3632
3646
|
TOUCH_DOLLY_ROTATE: 6
|
3633
3647
|
};
|
3634
|
-
let
|
3635
|
-
const
|
3636
|
-
let
|
3637
|
-
const f = new
|
3638
|
-
let
|
3639
|
-
const
|
3640
|
-
let
|
3641
|
-
function _e(
|
3642
|
-
return
|
3643
|
-
}
|
3644
|
-
function ke(
|
3645
|
-
const E = Math.abs(
|
3648
|
+
let c = i.NONE;
|
3649
|
+
const u = 1e-6, r = new Zt(), h = new Zt();
|
3650
|
+
let d = 1;
|
3651
|
+
const f = new Q(), m = new ge(), v = new ge(), x = new ge(), _ = new ge(), q = new ge(), U = new ge(), $ = new ge(), C = new ge(), K = new ge(), M = new Q(), Z = new ge();
|
3652
|
+
let ue = !1;
|
3653
|
+
const H = [], ve = {};
|
3654
|
+
let re = !1;
|
3655
|
+
function _e(o) {
|
3656
|
+
return o !== null ? 2 * Math.PI / 60 * t.autoRotateSpeed * o : 2 * Math.PI / 60 / 60 * t.autoRotateSpeed;
|
3657
|
+
}
|
3658
|
+
function ke(o) {
|
3659
|
+
const E = Math.abs(o * 0.01);
|
3646
3660
|
return Math.pow(0.95, t.zoomSpeed * E);
|
3647
3661
|
}
|
3648
|
-
function ye(
|
3649
|
-
h.theta -=
|
3662
|
+
function ye(o) {
|
3663
|
+
h.theta -= o;
|
3650
3664
|
}
|
3651
|
-
function
|
3652
|
-
h.phi -=
|
3665
|
+
function B(o) {
|
3666
|
+
h.phi -= o;
|
3653
3667
|
}
|
3654
3668
|
const Ee = function() {
|
3655
|
-
const
|
3656
|
-
return function(
|
3657
|
-
|
3669
|
+
const o = new Q();
|
3670
|
+
return function(D, L) {
|
3671
|
+
o.setFromMatrixColumn(L, 0), o.multiplyScalar(-D), f.add(o);
|
3658
3672
|
};
|
3659
|
-
}(),
|
3660
|
-
const
|
3661
|
-
return function(
|
3662
|
-
t.screenSpacePanning === !0 ?
|
3673
|
+
}(), R = function() {
|
3674
|
+
const o = new Q();
|
3675
|
+
return function(D, L) {
|
3676
|
+
t.screenSpacePanning === !0 ? o.setFromMatrixColumn(L, 1) : (o.setFromMatrixColumn(L, 0), o.crossVectors(t.object.up, o)), o.multiplyScalar(D), f.add(o);
|
3663
3677
|
};
|
3664
3678
|
}(), Me = function() {
|
3665
|
-
const
|
3666
|
-
return function(
|
3667
|
-
const
|
3679
|
+
const o = new Q();
|
3680
|
+
return function(D, L) {
|
3681
|
+
const se = t.domElement;
|
3668
3682
|
if (t.object.isPerspectiveCamera) {
|
3669
3683
|
const xe = t.object.position;
|
3670
|
-
|
3671
|
-
let
|
3672
|
-
|
3684
|
+
o.copy(xe).sub(t.target);
|
3685
|
+
let he = o.length();
|
3686
|
+
he *= Math.tan(t.object.fov / 2 * Math.PI / 180), Ee(2 * D * he / se.clientHeight, t.object.matrix), R(2 * L * he / se.clientHeight, t.object.matrix);
|
3673
3687
|
} else
|
3674
|
-
t.object.isOrthographicCamera ? (Ee(
|
3688
|
+
t.object.isOrthographicCamera ? (Ee(D * (t.object.right - t.object.left) / t.object.zoom / se.clientWidth, t.object.matrix), R(L * (t.object.top - t.object.bottom) / t.object.zoom / se.clientHeight, t.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), t.enablePan = !1);
|
3675
3689
|
};
|
3676
3690
|
}();
|
3677
|
-
function De(
|
3678
|
-
t.object.isPerspectiveCamera || t.object.isOrthographicCamera ?
|
3691
|
+
function De(o) {
|
3692
|
+
t.object.isPerspectiveCamera || t.object.isOrthographicCamera ? d /= o : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), t.enableZoom = !1);
|
3679
3693
|
}
|
3680
|
-
function Ie(
|
3681
|
-
t.object.isPerspectiveCamera || t.object.isOrthographicCamera ?
|
3694
|
+
function Ie(o) {
|
3695
|
+
t.object.isPerspectiveCamera || t.object.isOrthographicCamera ? d *= o : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), t.enableZoom = !1);
|
3682
3696
|
}
|
3683
|
-
function Pe(
|
3697
|
+
function Pe(o, E) {
|
3684
3698
|
if (!t.zoomToCursor)
|
3685
3699
|
return;
|
3686
|
-
|
3687
|
-
const
|
3688
|
-
|
3700
|
+
ue = !0;
|
3701
|
+
const D = t.domElement.getBoundingClientRect(), L = o - D.left, se = E - D.top, xe = D.width, he = D.height;
|
3702
|
+
Z.x = L / xe * 2 - 1, Z.y = -(se / he) * 2 + 1, M.set(Z.x, Z.y, 1).unproject(t.object).sub(t.object.position).normalize();
|
3689
3703
|
}
|
3690
|
-
function Ae(
|
3691
|
-
return Math.max(t.minDistance, Math.min(t.maxDistance,
|
3704
|
+
function Ae(o) {
|
3705
|
+
return Math.max(t.minDistance, Math.min(t.maxDistance, o));
|
3692
3706
|
}
|
3693
|
-
function je(
|
3694
|
-
m.set(
|
3707
|
+
function je(o) {
|
3708
|
+
m.set(o.clientX, o.clientY);
|
3695
3709
|
}
|
3696
|
-
function qe(
|
3697
|
-
Pe(
|
3710
|
+
function qe(o) {
|
3711
|
+
Pe(o.clientX, o.clientX), $.set(o.clientX, o.clientY);
|
3698
3712
|
}
|
3699
|
-
function Ne(
|
3700
|
-
|
3713
|
+
function Ne(o) {
|
3714
|
+
_.set(o.clientX, o.clientY);
|
3701
3715
|
}
|
3702
|
-
function Ke(
|
3703
|
-
|
3716
|
+
function Ke(o) {
|
3717
|
+
v.set(o.clientX, o.clientY), x.subVectors(v, m).multiplyScalar(t.rotateSpeed);
|
3704
3718
|
const E = t.domElement;
|
3705
|
-
ye(2 * Math.PI *
|
3719
|
+
ye(2 * Math.PI * x.x / E.clientHeight), B(2 * Math.PI * x.y / E.clientHeight), m.copy(v), t.update();
|
3706
3720
|
}
|
3707
|
-
function ct(
|
3708
|
-
|
3721
|
+
function ct(o) {
|
3722
|
+
C.set(o.clientX, o.clientY), K.subVectors(C, $), K.y > 0 ? De(ke(K.y)) : K.y < 0 && Ie(ke(K.y)), $.copy(C), t.update();
|
3709
3723
|
}
|
3710
|
-
function Le(
|
3711
|
-
|
3724
|
+
function Le(o) {
|
3725
|
+
q.set(o.clientX, o.clientY), U.subVectors(q, _).multiplyScalar(t.panSpeed), Me(U.x, U.y), _.copy(q), t.update();
|
3712
3726
|
}
|
3713
|
-
function ae(
|
3714
|
-
Pe(
|
3727
|
+
function ae(o) {
|
3728
|
+
Pe(o.clientX, o.clientY), o.deltaY < 0 ? Ie(ke(o.deltaY)) : o.deltaY > 0 && De(ke(o.deltaY)), t.update();
|
3715
3729
|
}
|
3716
|
-
function
|
3730
|
+
function me(o) {
|
3717
3731
|
let E = !1;
|
3718
|
-
switch (
|
3732
|
+
switch (o.code) {
|
3719
3733
|
case t.keys.UP:
|
3720
|
-
|
3734
|
+
o.ctrlKey || o.metaKey || o.shiftKey ? B(2 * Math.PI * t.rotateSpeed / t.domElement.clientHeight) : Me(0, t.keyPanSpeed), E = !0;
|
3721
3735
|
break;
|
3722
3736
|
case t.keys.BOTTOM:
|
3723
|
-
|
3737
|
+
o.ctrlKey || o.metaKey || o.shiftKey ? B(-2 * Math.PI * t.rotateSpeed / t.domElement.clientHeight) : Me(0, -t.keyPanSpeed), E = !0;
|
3724
3738
|
break;
|
3725
3739
|
case t.keys.LEFT:
|
3726
|
-
|
3740
|
+
o.ctrlKey || o.metaKey || o.shiftKey ? ye(2 * Math.PI * t.rotateSpeed / t.domElement.clientHeight) : Me(t.keyPanSpeed, 0), E = !0;
|
3727
3741
|
break;
|
3728
3742
|
case t.keys.RIGHT:
|
3729
|
-
|
3743
|
+
o.ctrlKey || o.metaKey || o.shiftKey ? ye(-2 * Math.PI * t.rotateSpeed / t.domElement.clientHeight) : Me(-t.keyPanSpeed, 0), E = !0;
|
3730
3744
|
break;
|
3731
3745
|
}
|
3732
|
-
E && (
|
3746
|
+
E && (o.preventDefault(), t.update());
|
3733
3747
|
}
|
3734
|
-
function Ue(
|
3735
|
-
if (
|
3736
|
-
m.set(
|
3748
|
+
function Ue(o) {
|
3749
|
+
if (H.length === 1)
|
3750
|
+
m.set(o.pageX, o.pageY);
|
3737
3751
|
else {
|
3738
|
-
const E = We(
|
3739
|
-
m.set(
|
3752
|
+
const E = We(o), D = 0.5 * (o.pageX + E.x), L = 0.5 * (o.pageY + E.y);
|
3753
|
+
m.set(D, L);
|
3740
3754
|
}
|
3741
3755
|
}
|
3742
|
-
function Be(
|
3743
|
-
if (
|
3744
|
-
|
3756
|
+
function Be(o) {
|
3757
|
+
if (H.length === 1)
|
3758
|
+
_.set(o.pageX, o.pageY);
|
3745
3759
|
else {
|
3746
|
-
const E = We(
|
3747
|
-
|
3760
|
+
const E = We(o), D = 0.5 * (o.pageX + E.x), L = 0.5 * (o.pageY + E.y);
|
3761
|
+
_.set(D, L);
|
3748
3762
|
}
|
3749
3763
|
}
|
3750
|
-
function be(
|
3751
|
-
const E = We(
|
3752
|
-
|
3764
|
+
function be(o) {
|
3765
|
+
const E = We(o), D = o.pageX - E.x, L = o.pageY - E.y, se = Math.sqrt(D * D + L * L);
|
3766
|
+
$.set(0, se);
|
3753
3767
|
}
|
3754
|
-
function
|
3755
|
-
t.enableZoom && be(
|
3768
|
+
function g(o) {
|
3769
|
+
t.enableZoom && be(o), t.enablePan && Be(o);
|
3756
3770
|
}
|
3757
|
-
function b(
|
3758
|
-
t.enableZoom && be(
|
3771
|
+
function b(o) {
|
3772
|
+
t.enableZoom && be(o), t.enableRotate && Ue(o);
|
3759
3773
|
}
|
3760
|
-
function
|
3761
|
-
if (
|
3762
|
-
|
3774
|
+
function O(o) {
|
3775
|
+
if (H.length == 1)
|
3776
|
+
v.set(o.pageX, o.pageY);
|
3763
3777
|
else {
|
3764
|
-
const
|
3765
|
-
|
3778
|
+
const D = We(o), L = 0.5 * (o.pageX + D.x), se = 0.5 * (o.pageY + D.y);
|
3779
|
+
v.set(L, se);
|
3766
3780
|
}
|
3767
|
-
|
3781
|
+
x.subVectors(v, m).multiplyScalar(t.rotateSpeed);
|
3768
3782
|
const E = t.domElement;
|
3769
|
-
ye(2 * Math.PI *
|
3783
|
+
ye(2 * Math.PI * x.x / E.clientHeight), B(2 * Math.PI * x.y / E.clientHeight), m.copy(v);
|
3770
3784
|
}
|
3771
|
-
function j(
|
3772
|
-
if (
|
3773
|
-
|
3785
|
+
function j(o) {
|
3786
|
+
if (H.length === 1)
|
3787
|
+
q.set(o.pageX, o.pageY);
|
3774
3788
|
else {
|
3775
|
-
const E = We(
|
3776
|
-
|
3789
|
+
const E = We(o), D = 0.5 * (o.pageX + E.x), L = 0.5 * (o.pageY + E.y);
|
3790
|
+
q.set(D, L);
|
3777
3791
|
}
|
3778
|
-
|
3792
|
+
U.subVectors(q, _).multiplyScalar(t.panSpeed), Me(U.x, U.y), _.copy(q);
|
3779
3793
|
}
|
3780
|
-
function
|
3781
|
-
const E = We(
|
3782
|
-
|
3783
|
-
const xe = (
|
3784
|
-
Pe(xe,
|
3794
|
+
function ce(o) {
|
3795
|
+
const E = We(o), D = o.pageX - E.x, L = o.pageY - E.y, se = Math.sqrt(D * D + L * L);
|
3796
|
+
C.set(0, se), K.set(0, Math.pow(C.y / $.y, t.zoomSpeed)), De(K.y), $.copy(C);
|
3797
|
+
const xe = (o.pageX + E.x) * 0.5, he = (o.pageY + E.y) * 0.5;
|
3798
|
+
Pe(xe, he);
|
3785
3799
|
}
|
3786
|
-
function
|
3787
|
-
t.enableZoom &&
|
3800
|
+
function de(o) {
|
3801
|
+
t.enableZoom && ce(o), t.enablePan && j(o);
|
3788
3802
|
}
|
3789
|
-
function
|
3790
|
-
t.enableZoom &&
|
3803
|
+
function T(o) {
|
3804
|
+
t.enableZoom && ce(o), t.enableRotate && O(o);
|
3791
3805
|
}
|
3792
|
-
function
|
3793
|
-
t.enabled !== !1 && (
|
3806
|
+
function S(o) {
|
3807
|
+
t.enabled !== !1 && (H.length === 0 && (t.domElement.setPointerCapture(o.pointerId), t.domElement.addEventListener("pointermove", z), t.domElement.addEventListener("pointerup", J)), !Dt(o) && (_t(o), o.pointerType === "touch" ? ut(o) : k(o)));
|
3794
3808
|
}
|
3795
|
-
function z(
|
3796
|
-
t.enabled !== !1 && (
|
3809
|
+
function z(o) {
|
3810
|
+
t.enabled !== !1 && (o.pointerType === "touch" ? pt(o) : Y(o));
|
3797
3811
|
}
|
3798
|
-
function
|
3799
|
-
switch (kt(
|
3812
|
+
function J(o) {
|
3813
|
+
switch (kt(o), H.length) {
|
3800
3814
|
case 0:
|
3801
|
-
t.domElement.releasePointerCapture(
|
3815
|
+
t.domElement.releasePointerCapture(o.pointerId), t.domElement.removeEventListener("pointermove", z), t.domElement.removeEventListener("pointerup", J), t.dispatchEvent(fn), c = i.NONE;
|
3802
3816
|
break;
|
3803
3817
|
case 1:
|
3804
|
-
const E =
|
3805
|
-
ut({ pointerId: E, pageX:
|
3818
|
+
const E = H[0], D = ve[E];
|
3819
|
+
ut({ pointerId: E, pageX: D.x, pageY: D.y });
|
3806
3820
|
break;
|
3807
3821
|
}
|
3808
3822
|
}
|
3809
|
-
function
|
3823
|
+
function k(o) {
|
3810
3824
|
let E;
|
3811
|
-
switch (
|
3825
|
+
switch (o.button) {
|
3812
3826
|
case 0:
|
3813
3827
|
E = t.mouseButtons.LEFT;
|
3814
3828
|
break;
|
@@ -3825,98 +3839,98 @@ class Ei extends mn {
|
|
3825
3839
|
case it.DOLLY:
|
3826
3840
|
if (t.enableZoom === !1)
|
3827
3841
|
return;
|
3828
|
-
qe(
|
3842
|
+
qe(o), c = i.DOLLY;
|
3829
3843
|
break;
|
3830
3844
|
case it.ROTATE:
|
3831
|
-
if (
|
3845
|
+
if (o.ctrlKey || o.metaKey || o.shiftKey) {
|
3832
3846
|
if (t.enablePan === !1)
|
3833
3847
|
return;
|
3834
|
-
Ne(
|
3848
|
+
Ne(o), c = i.PAN;
|
3835
3849
|
} else {
|
3836
3850
|
if (t.enableRotate === !1)
|
3837
3851
|
return;
|
3838
|
-
je(
|
3852
|
+
je(o), c = i.ROTATE;
|
3839
3853
|
}
|
3840
3854
|
break;
|
3841
3855
|
case it.PAN:
|
3842
|
-
if (
|
3856
|
+
if (o.ctrlKey || o.metaKey || o.shiftKey) {
|
3843
3857
|
if (t.enableRotate === !1)
|
3844
3858
|
return;
|
3845
|
-
je(
|
3859
|
+
je(o), c = i.ROTATE;
|
3846
3860
|
} else {
|
3847
3861
|
if (t.enablePan === !1)
|
3848
3862
|
return;
|
3849
|
-
Ne(
|
3863
|
+
Ne(o), c = i.PAN;
|
3850
3864
|
}
|
3851
3865
|
break;
|
3852
3866
|
default:
|
3853
|
-
|
3867
|
+
c = i.NONE;
|
3854
3868
|
}
|
3855
|
-
|
3869
|
+
c !== i.NONE && t.dispatchEvent(jt);
|
3856
3870
|
}
|
3857
|
-
function
|
3858
|
-
switch (
|
3871
|
+
function Y(o) {
|
3872
|
+
switch (c) {
|
3859
3873
|
case i.ROTATE:
|
3860
3874
|
if (t.enableRotate === !1)
|
3861
3875
|
return;
|
3862
|
-
Ke(
|
3876
|
+
Ke(o);
|
3863
3877
|
break;
|
3864
3878
|
case i.DOLLY:
|
3865
3879
|
if (t.enableZoom === !1)
|
3866
3880
|
return;
|
3867
|
-
ct(
|
3881
|
+
ct(o);
|
3868
3882
|
break;
|
3869
3883
|
case i.PAN:
|
3870
3884
|
if (t.enablePan === !1)
|
3871
3885
|
return;
|
3872
|
-
Le(
|
3886
|
+
Le(o);
|
3873
3887
|
break;
|
3874
3888
|
}
|
3875
3889
|
}
|
3876
|
-
function
|
3877
|
-
t.enabled === !1 || t.enableZoom === !1 ||
|
3890
|
+
function ee(o) {
|
3891
|
+
t.enabled === !1 || t.enableZoom === !1 || c !== i.NONE || (o.preventDefault(), t.dispatchEvent(jt), ae($e(o)), t.dispatchEvent(fn));
|
3878
3892
|
}
|
3879
|
-
function $e(
|
3880
|
-
const E =
|
3881
|
-
clientX:
|
3882
|
-
clientY:
|
3883
|
-
deltaY:
|
3893
|
+
function $e(o) {
|
3894
|
+
const E = o.deltaMode, D = {
|
3895
|
+
clientX: o.clientX,
|
3896
|
+
clientY: o.clientY,
|
3897
|
+
deltaY: o.deltaY
|
3884
3898
|
};
|
3885
3899
|
switch (E) {
|
3886
3900
|
case 1:
|
3887
|
-
|
3901
|
+
D.deltaY *= 16;
|
3888
3902
|
break;
|
3889
3903
|
case 2:
|
3890
|
-
|
3904
|
+
D.deltaY *= 100;
|
3891
3905
|
break;
|
3892
3906
|
}
|
3893
|
-
return
|
3907
|
+
return o.ctrlKey && !re && (D.deltaY *= 10), D;
|
3894
3908
|
}
|
3895
|
-
function ze(
|
3896
|
-
|
3909
|
+
function ze(o) {
|
3910
|
+
o.key === "Control" && (re = !0, t.domElement.getRootNode().addEventListener("keyup", Ge, { passive: !0, capture: !0 }));
|
3897
3911
|
}
|
3898
|
-
function Ge(
|
3899
|
-
|
3912
|
+
function Ge(o) {
|
3913
|
+
o.key === "Control" && (re = !1, t.domElement.getRootNode().removeEventListener("keyup", Ge, { passive: !0, capture: !0 }));
|
3900
3914
|
}
|
3901
|
-
function lt(
|
3902
|
-
t.enabled === !1 || t.enablePan === !1 ||
|
3915
|
+
function lt(o) {
|
3916
|
+
t.enabled === !1 || t.enablePan === !1 || me(o);
|
3903
3917
|
}
|
3904
|
-
function ut(
|
3905
|
-
switch (gt(
|
3918
|
+
function ut(o) {
|
3919
|
+
switch (gt(o), H.length) {
|
3906
3920
|
case 1:
|
3907
3921
|
switch (t.touches.ONE) {
|
3908
3922
|
case rt.ROTATE:
|
3909
3923
|
if (t.enableRotate === !1)
|
3910
3924
|
return;
|
3911
|
-
Ue(
|
3925
|
+
Ue(o), c = i.TOUCH_ROTATE;
|
3912
3926
|
break;
|
3913
3927
|
case rt.PAN:
|
3914
3928
|
if (t.enablePan === !1)
|
3915
3929
|
return;
|
3916
|
-
Be(
|
3930
|
+
Be(o), c = i.TOUCH_PAN;
|
3917
3931
|
break;
|
3918
3932
|
default:
|
3919
|
-
|
3933
|
+
c = i.NONE;
|
3920
3934
|
}
|
3921
3935
|
break;
|
3922
3936
|
case 2:
|
@@ -3924,77 +3938,77 @@ class Ei extends mn {
|
|
3924
3938
|
case rt.DOLLY_PAN:
|
3925
3939
|
if (t.enableZoom === !1 && t.enablePan === !1)
|
3926
3940
|
return;
|
3927
|
-
|
3941
|
+
g(o), c = i.TOUCH_DOLLY_PAN;
|
3928
3942
|
break;
|
3929
3943
|
case rt.DOLLY_ROTATE:
|
3930
3944
|
if (t.enableZoom === !1 && t.enableRotate === !1)
|
3931
3945
|
return;
|
3932
|
-
b(
|
3946
|
+
b(o), c = i.TOUCH_DOLLY_ROTATE;
|
3933
3947
|
break;
|
3934
3948
|
default:
|
3935
|
-
|
3949
|
+
c = i.NONE;
|
3936
3950
|
}
|
3937
3951
|
break;
|
3938
3952
|
default:
|
3939
|
-
|
3953
|
+
c = i.NONE;
|
3940
3954
|
}
|
3941
|
-
|
3955
|
+
c !== i.NONE && t.dispatchEvent(jt);
|
3942
3956
|
}
|
3943
|
-
function pt(
|
3944
|
-
switch (gt(
|
3957
|
+
function pt(o) {
|
3958
|
+
switch (gt(o), c) {
|
3945
3959
|
case i.TOUCH_ROTATE:
|
3946
3960
|
if (t.enableRotate === !1)
|
3947
3961
|
return;
|
3948
|
-
|
3962
|
+
O(o), t.update();
|
3949
3963
|
break;
|
3950
3964
|
case i.TOUCH_PAN:
|
3951
3965
|
if (t.enablePan === !1)
|
3952
3966
|
return;
|
3953
|
-
j(
|
3967
|
+
j(o), t.update();
|
3954
3968
|
break;
|
3955
3969
|
case i.TOUCH_DOLLY_PAN:
|
3956
3970
|
if (t.enableZoom === !1 && t.enablePan === !1)
|
3957
3971
|
return;
|
3958
|
-
|
3972
|
+
de(o), t.update();
|
3959
3973
|
break;
|
3960
3974
|
case i.TOUCH_DOLLY_ROTATE:
|
3961
3975
|
if (t.enableZoom === !1 && t.enableRotate === !1)
|
3962
3976
|
return;
|
3963
|
-
|
3977
|
+
T(o), t.update();
|
3964
3978
|
break;
|
3965
3979
|
default:
|
3966
|
-
|
3980
|
+
c = i.NONE;
|
3967
3981
|
}
|
3968
3982
|
}
|
3969
|
-
function tt(
|
3970
|
-
t.enabled !== !1 &&
|
3983
|
+
function tt(o) {
|
3984
|
+
t.enabled !== !1 && o.preventDefault();
|
3971
3985
|
}
|
3972
|
-
function _t(
|
3973
|
-
|
3986
|
+
function _t(o) {
|
3987
|
+
H.push(o.pointerId);
|
3974
3988
|
}
|
3975
|
-
function kt(
|
3976
|
-
delete ve[
|
3977
|
-
for (let E = 0; E <
|
3978
|
-
if (
|
3979
|
-
|
3989
|
+
function kt(o) {
|
3990
|
+
delete ve[o.pointerId];
|
3991
|
+
for (let E = 0; E < H.length; E++)
|
3992
|
+
if (H[E] == o.pointerId) {
|
3993
|
+
H.splice(E, 1);
|
3980
3994
|
return;
|
3981
3995
|
}
|
3982
3996
|
}
|
3983
|
-
function Dt(
|
3984
|
-
for (let E = 0; E <
|
3985
|
-
if (
|
3997
|
+
function Dt(o) {
|
3998
|
+
for (let E = 0; E < H.length; E++)
|
3999
|
+
if (H[E] == o.pointerId)
|
3986
4000
|
return !0;
|
3987
4001
|
return !1;
|
3988
4002
|
}
|
3989
|
-
function gt(
|
3990
|
-
let E = ve[
|
3991
|
-
E === void 0 && (E = new
|
4003
|
+
function gt(o) {
|
4004
|
+
let E = ve[o.pointerId];
|
4005
|
+
E === void 0 && (E = new ge(), ve[o.pointerId] = E), E.set(o.pageX, o.pageY);
|
3992
4006
|
}
|
3993
|
-
function We(
|
3994
|
-
const E =
|
4007
|
+
function We(o) {
|
4008
|
+
const E = o.pointerId === H[0] ? H[1] : H[0];
|
3995
4009
|
return ve[E];
|
3996
4010
|
}
|
3997
|
-
t.domElement.addEventListener("contextmenu", tt), t.domElement.addEventListener("pointerdown",
|
4011
|
+
t.domElement.addEventListener("contextmenu", tt), t.domElement.addEventListener("pointerdown", S), t.domElement.addEventListener("pointercancel", J), t.domElement.addEventListener("wheel", ee, { passive: !1 }), t.domElement.getRootNode().addEventListener("keydown", ze, { passive: !0, capture: !0 }), this.update();
|
3998
4012
|
}
|
3999
4013
|
}
|
4000
4014
|
function ot(e, n, a, t, i) {
|
@@ -4003,15 +4017,15 @@ function ot(e, n, a, t, i) {
|
|
4003
4017
|
const wt = (e) => {
|
4004
4018
|
const [n, a] = G(e.options[e.index]), t = () => {
|
4005
4019
|
e.onToggle(!e.open);
|
4006
|
-
}, i = (
|
4007
|
-
|
4020
|
+
}, i = (c) => {
|
4021
|
+
c !== n && (e.onSelect(c), a(c)), e.onToggle(!1);
|
4008
4022
|
};
|
4009
4023
|
return /* @__PURE__ */ l.jsxs("div", { className: `dropdown ${e.up === !0 ? "up" : ""}`, children: [
|
4010
4024
|
/* @__PURE__ */ l.jsx("div", { className: "dropdown-toggle", onClick: t, children: n }),
|
4011
|
-
e.open && /* @__PURE__ */ l.jsx("ul", { className: "dropdown-menu", children: e.options.map((
|
4025
|
+
e.open && /* @__PURE__ */ l.jsx("ul", { className: "dropdown-menu", children: e.options.map((c) => /* @__PURE__ */ l.jsx("li", { onClick: () => i(c), children: c }, c)) })
|
4012
4026
|
] });
|
4013
|
-
}, Ze =
|
4014
|
-
const [t, i] = G(!1),
|
4027
|
+
}, Ze = Ra(function(n, a) {
|
4028
|
+
const [t, i] = G(!1), c = n.options.indexOf(n.camera.name);
|
4015
4029
|
return /* @__PURE__ */ l.jsxs("div", { className: "CameraWindow", children: [
|
4016
4030
|
/* @__PURE__ */ l.jsx("div", { ref: a, className: "clickable", onClick: () => {
|
4017
4031
|
t && i(!1);
|
@@ -4019,27 +4033,27 @@ const wt = (e) => {
|
|
4019
4033
|
/* @__PURE__ */ l.jsx(
|
4020
4034
|
wt,
|
4021
4035
|
{
|
4022
|
-
index:
|
4036
|
+
index: c,
|
4023
4037
|
open: t,
|
4024
4038
|
options: n.options,
|
4025
4039
|
onSelect: n.onSelect,
|
4026
|
-
onToggle: (
|
4027
|
-
i(
|
4040
|
+
onToggle: (u) => {
|
4041
|
+
i(u);
|
4028
4042
|
},
|
4029
4043
|
up: !0
|
4030
4044
|
}
|
4031
4045
|
)
|
4032
4046
|
] });
|
4033
4047
|
});
|
4034
|
-
class xi extends
|
4048
|
+
class xi extends In {
|
4035
4049
|
constructor(n) {
|
4036
4050
|
super({
|
4037
4051
|
extensions: {
|
4038
4052
|
// @ts-ignore
|
4039
4053
|
derivatives: !0
|
4040
4054
|
},
|
4041
|
-
glslVersion:
|
4042
|
-
side:
|
4055
|
+
glslVersion: fa,
|
4056
|
+
side: bn,
|
4043
4057
|
transparent: !0,
|
4044
4058
|
uniforms: {
|
4045
4059
|
uScale: {
|
@@ -4144,11 +4158,11 @@ class xi extends jn {
|
|
4144
4158
|
});
|
4145
4159
|
}
|
4146
4160
|
}
|
4147
|
-
class Si extends
|
4161
|
+
class Si extends An {
|
4148
4162
|
gridMaterial;
|
4149
4163
|
constructor() {
|
4150
4164
|
const n = new xi();
|
4151
|
-
super(new
|
4165
|
+
super(new ma(2, 2), n), this.gridMaterial = n, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
|
4152
4166
|
}
|
4153
4167
|
update() {
|
4154
4168
|
this.gridMaterial.needsUpdate = !0;
|
@@ -4193,7 +4207,7 @@ void main() {
|
|
4193
4207
|
#include <clipping_planes_fragment>
|
4194
4208
|
gl_FragColor = vec4(vec3(vUv, 0.0), 1.0);
|
4195
4209
|
}`;
|
4196
|
-
class Mi extends
|
4210
|
+
class Mi extends In {
|
4197
4211
|
constructor() {
|
4198
4212
|
super({
|
4199
4213
|
defines: {
|
@@ -4204,36 +4218,36 @@ class Mi extends jn {
|
|
4204
4218
|
});
|
4205
4219
|
}
|
4206
4220
|
}
|
4207
|
-
let xt = "Renderer", Te, It = !1,
|
4221
|
+
let xt = "Renderer", Te, It = !1, X = null, le = null, Ye = null, Ve = null;
|
4208
4222
|
function $i(e) {
|
4209
|
-
const n = e.three.app.appID, a = localStorage.getItem(`${n}_mode`), t = localStorage.getItem(`${n}_tlCam`) !== null ? localStorage.getItem(`${n}_tlCam`) : "Debug", i = localStorage.getItem(`${n}_trCam`) !== null ? localStorage.getItem(`${n}_trCam`) : "Orthographic",
|
4223
|
+
const n = e.three.app.appID, a = localStorage.getItem(`${n}_mode`), t = localStorage.getItem(`${n}_tlCam`) !== null ? localStorage.getItem(`${n}_tlCam`) : "Debug", i = localStorage.getItem(`${n}_trCam`) !== null ? localStorage.getItem(`${n}_trCam`) : "Orthographic", c = localStorage.getItem(`${n}_blCam`) !== null ? localStorage.getItem(`${n}_blCam`) : "Front", u = localStorage.getItem(`${n}_brCam`) !== null ? localStorage.getItem(`${n}_brCam`) : "Top", r = oe(() => /* @__PURE__ */ new Map(), []), h = oe(() => /* @__PURE__ */ new Map(), []), d = oe(() => /* @__PURE__ */ new Map(), []), f = oe(() => /* @__PURE__ */ new Map(), []), m = oe(() => new pa(), []), v = oe(() => new ga(), []), x = oe(() => new Si(), []), _ = oe(() => new Jt(500), []), q = oe(() => new Jt(100), []), U = oe(() => new va(), []), $ = oe(() => new ba(), []), C = oe(() => new Mi(), []), K = oe(() => new jn({
|
4210
4224
|
opacity: 0.33,
|
4211
4225
|
transparent: !0,
|
4212
4226
|
wireframe: !0
|
4213
4227
|
}), []);
|
4214
|
-
function
|
4215
|
-
const
|
4216
|
-
return
|
4228
|
+
function M(g, b) {
|
4229
|
+
const O = new Qt(-100, 100, 100, -100, 50, 5e3);
|
4230
|
+
return O.name = g, O.position.copy(b), O.lookAt(0, 0, 0), r.set(g, O), O;
|
4217
4231
|
}
|
4218
|
-
const
|
4232
|
+
const Z = [
|
4219
4233
|
"Renderer",
|
4220
4234
|
"Depth",
|
4221
4235
|
"Normals",
|
4222
4236
|
"UVs",
|
4223
4237
|
"Wireframe"
|
4224
|
-
],
|
4238
|
+
], ue = [
|
4225
4239
|
"Single",
|
4226
4240
|
"Side by Side",
|
4227
4241
|
"Stacked",
|
4228
4242
|
"Quad"
|
4229
|
-
],
|
4230
|
-
localStorage.setItem(`${n}_mode`,
|
4231
|
-
const ae = (
|
4232
|
-
const
|
4233
|
-
if (
|
4243
|
+
], H = V(null), ve = V(null), re = V(null), _e = V(null), ke = V(null), ye = V(null), [B, Ee] = G(a !== null ? a : "Single"), [R, Me] = G(null), [De, Ie] = G(!1), [Pe, Ae] = G(!1), [je, qe] = G("Orbit"), [Ne, Ke] = G(!1), [ct, Le] = G(Date.now());
|
4244
|
+
localStorage.setItem(`${n}_mode`, B), localStorage.setItem(`${n}_tlCam`, t), localStorage.setItem(`${n}_trCam`, i), localStorage.setItem(`${n}_blCam`, c), localStorage.setItem(`${n}_brCam`, u);
|
4245
|
+
const ae = (g, b) => {
|
4246
|
+
const O = h.get(g.name);
|
4247
|
+
if (O !== void 0 && O.dispose(), h.delete(g.name), g.name === "UI")
|
4234
4248
|
return;
|
4235
|
-
const j = new Ei(
|
4236
|
-
switch (j.enableDamping = !0, j.dampingFactor = 0.05,
|
4249
|
+
const j = new Ei(g, b);
|
4250
|
+
switch (j.enableDamping = !0, j.dampingFactor = 0.05, g.name) {
|
4237
4251
|
case "Top":
|
4238
4252
|
case "Bottom":
|
4239
4253
|
case "Left":
|
@@ -4243,253 +4257,253 @@ function $i(e) {
|
|
4243
4257
|
j.enableRotate = !1;
|
4244
4258
|
break;
|
4245
4259
|
}
|
4246
|
-
h.set(
|
4247
|
-
},
|
4248
|
-
const b =
|
4249
|
-
b !== void 0 && (m.remove(b), b.dispose(),
|
4250
|
-
const
|
4251
|
-
|
4260
|
+
h.set(g.name, j);
|
4261
|
+
}, me = (g) => {
|
4262
|
+
const b = d.get(g.name);
|
4263
|
+
b !== void 0 && (m.remove(b), b.dispose(), d.delete(g.name));
|
4264
|
+
const O = h.get(g.name);
|
4265
|
+
O !== void 0 && (O.dispose(), h.delete(g.name));
|
4252
4266
|
}, Ue = () => {
|
4253
|
-
h.forEach((
|
4254
|
-
|
4255
|
-
const
|
4256
|
-
|
4257
|
-
}), h.clear(),
|
4267
|
+
h.forEach((g, b) => {
|
4268
|
+
g.dispose();
|
4269
|
+
const O = d.get(b);
|
4270
|
+
O !== void 0 && (m.remove(O), O.dispose()), d.delete(b), h.delete(b);
|
4271
|
+
}), h.clear(), d.clear();
|
4258
4272
|
}, Be = () => {
|
4259
|
-
switch (
|
4273
|
+
switch (B) {
|
4260
4274
|
case "Single":
|
4261
|
-
ae(
|
4275
|
+
ae(X, re.current);
|
4262
4276
|
break;
|
4263
4277
|
case "Side by Side":
|
4264
4278
|
case "Stacked":
|
4265
|
-
ae(
|
4279
|
+
ae(X, re.current), ae(le, _e.current);
|
4266
4280
|
break;
|
4267
4281
|
case "Quad":
|
4268
|
-
ae(
|
4282
|
+
ae(X, re.current), ae(le, _e.current), ae(Ye, ke.current), ae(Ve, ye.current);
|
4269
4283
|
break;
|
4270
4284
|
}
|
4271
4285
|
};
|
4272
4286
|
Re(() => {
|
4273
|
-
const
|
4274
|
-
canvas:
|
4287
|
+
const g = new ya({
|
4288
|
+
canvas: H.current,
|
4275
4289
|
stencil: !1
|
4276
4290
|
});
|
4277
|
-
|
4291
|
+
g.autoClear = !1, g.shadowMap.enabled = !0, g.setPixelRatio(devicePixelRatio), g.setClearColor(0), e.three.renderer = g, Me(g);
|
4278
4292
|
}, []), Re(() => {
|
4279
|
-
m.name = "Debug Scene", m.uuid = "",
|
4280
|
-
const
|
4281
|
-
|
4293
|
+
m.name = "Debug Scene", m.uuid = "", v.name = "helpers", m.add(v), v.add(x), _.name = "axisHelper", v.add(_), q.name = "interactionHelper", v.add(q), q.visible = !1, M("Top", new Q(0, 1e3, 0)), M("Bottom", new Q(0, -1e3, 0)), M("Left", new Q(-1e3, 0, 0)), M("Right", new Q(1e3, 0, 0)), M("Front", new Q(0, 0, 1e3)), M("Back", new Q(0, 0, -1e3)), M("Orthographic", new Q(1e3, 1e3, 1e3)), M("UI", new Q());
|
4294
|
+
const g = new Pt(60, 1, 50, 5e3);
|
4295
|
+
g.name = "Debug", g.position.set(500, 500, 500), g.lookAt(0, 0, 0), r.set("Debug", g), X = r.get(localStorage.getItem(`${n}_tlCam`)), le = r.get(localStorage.getItem(`${n}_trCam`)), Ye = r.get(localStorage.getItem(`${n}_blCam`)), Ve = r.get(localStorage.getItem(`${n}_brCam`));
|
4282
4296
|
}, []), Re(() => {
|
4283
|
-
const
|
4284
|
-
f.forEach((
|
4285
|
-
|
4297
|
+
const g = () => {
|
4298
|
+
f.forEach((T) => {
|
4299
|
+
v.remove(T), T.dispose();
|
4286
4300
|
}), f.clear();
|
4287
4301
|
}, b = () => {
|
4288
|
-
Te.traverse((
|
4289
|
-
if (
|
4290
|
-
let
|
4291
|
-
switch (
|
4302
|
+
Te.traverse((T) => {
|
4303
|
+
if (T.type.search("Light") > -1) {
|
4304
|
+
let S;
|
4305
|
+
switch (T.type) {
|
4292
4306
|
case "DirectionalLight":
|
4293
|
-
|
4307
|
+
S = new Ma(T, 100), S.name = `${T.name}Helper`, f.set(T.name, S), v.add(S);
|
4294
4308
|
break;
|
4295
4309
|
case "HemisphereLight":
|
4296
|
-
|
4310
|
+
S = new wa(T, 250), S.name = `${T.name}Helper`, f.set(T.name, S), v.add(S);
|
4297
4311
|
break;
|
4298
4312
|
case "RectAreaLight":
|
4299
|
-
|
4313
|
+
S = new bi(T), S.name = `${T.name}Helper`, f.set(T.name, S), v.add(S);
|
4300
4314
|
break;
|
4301
4315
|
case "PointLight":
|
4302
|
-
|
4316
|
+
S = new Ca(T, 100), S.name = `${T.name}Helper`, f.set(T.name, S), v.add(S);
|
4303
4317
|
break;
|
4304
4318
|
case "SpotLight":
|
4305
|
-
|
4319
|
+
S = new Sa(T), S.name = `${T.name}Helper`, f.set(T.name, S), v.add(S);
|
4306
4320
|
break;
|
4307
4321
|
}
|
4308
4322
|
}
|
4309
4323
|
});
|
4310
|
-
},
|
4311
|
-
|
4312
|
-
const
|
4313
|
-
if (
|
4314
|
-
const z = new
|
4324
|
+
}, O = (T) => {
|
4325
|
+
v.add(_), g(), Ot(Te), m.remove(Te);
|
4326
|
+
const S = e.scenes.get(T.value.name);
|
4327
|
+
if (S !== void 0) {
|
4328
|
+
const z = new S();
|
4315
4329
|
e.onSceneSet !== void 0 && e.onSceneSet(z), Te = z, e.three.scene = Te, m.add(Te), It = !0, b();
|
4316
4330
|
}
|
4317
|
-
}, j = (
|
4318
|
-
const
|
4319
|
-
if (z !== void 0 && r.set(
|
4320
|
-
const
|
4321
|
-
|
4331
|
+
}, j = (T) => {
|
4332
|
+
const S = T.value, z = e.three.scene?.getObjectByProperty("uuid", S.uuid);
|
4333
|
+
if (z !== void 0 && r.set(S.name, z), z instanceof Pt) {
|
4334
|
+
const J = new xa(z);
|
4335
|
+
d.set(z.name, J), m.add(J);
|
4322
4336
|
}
|
4323
4337
|
Le(Date.now());
|
4324
|
-
},
|
4325
|
-
const
|
4326
|
-
|
4327
|
-
},
|
4328
|
-
const
|
4329
|
-
|
4338
|
+
}, ce = (T) => {
|
4339
|
+
const S = d.get(T.value.name);
|
4340
|
+
S !== void 0 && (m.remove(S), S.dispose()), r.delete(T.value.name), Le(Date.now());
|
4341
|
+
}, de = (T) => {
|
4342
|
+
const S = Te.getObjectByProperty("uuid", T.value.uuid);
|
4343
|
+
S && S.add(_);
|
4330
4344
|
};
|
4331
|
-
return
|
4332
|
-
|
4345
|
+
return P.addEventListener(A.SET_SCENE, O), P.addEventListener(A.ADD_CAMERA, j), P.addEventListener(A.REMOVE_CAMERA, ce), P.addEventListener(A.SET_OBJECT, de), () => {
|
4346
|
+
P.removeEventListener(A.SET_SCENE, O), P.removeEventListener(A.ADD_CAMERA, j), P.removeEventListener(A.REMOVE_CAMERA, ce), P.removeEventListener(A.SET_OBJECT, de);
|
4333
4347
|
};
|
4334
4348
|
}, []), Re(() => {
|
4335
|
-
if (
|
4349
|
+
if (R === null)
|
4336
4350
|
return;
|
4337
|
-
let
|
4338
|
-
const
|
4339
|
-
|
4340
|
-
let
|
4341
|
-
switch (
|
4351
|
+
let g = window.innerWidth, b = window.innerHeight, O = Math.floor(g / 2), j = Math.floor(b / 2), ce = -1;
|
4352
|
+
const de = () => {
|
4353
|
+
g = window.innerWidth - 300, b = window.innerHeight, O = Math.floor(g / 2), j = Math.floor(b / 2), e.three.resize(g, b), e.onSceneResize !== void 0 && It && e.onSceneResize(Te, g, b);
|
4354
|
+
let k = g, Y = b;
|
4355
|
+
switch (B) {
|
4342
4356
|
case "Side by Side":
|
4343
|
-
|
4357
|
+
k = O, Y = b;
|
4344
4358
|
break;
|
4345
4359
|
case "Stacked":
|
4346
|
-
|
4360
|
+
k = g, Y = j;
|
4347
4361
|
break;
|
4348
4362
|
case "Quad":
|
4349
|
-
|
4363
|
+
k = O, Y = j;
|
4350
4364
|
break;
|
4351
4365
|
}
|
4352
|
-
r.forEach((
|
4353
|
-
|
4366
|
+
r.forEach((ee) => {
|
4367
|
+
ee instanceof Qt ? (ee.left = k / -2, ee.right = k / 2, ee.top = Y / 2, ee.bottom = Y / -2, ee.name === "UI" && (ee.position.x = g / 2, ee.position.y = b / -2, ee.position.z = 100), ee.updateProjectionMatrix()) : ee instanceof Pt && (ee.aspect = k / Y, ee.updateProjectionMatrix(), d.get(ee.name)?.update());
|
4354
4368
|
});
|
4355
|
-
},
|
4356
|
-
|
4357
|
-
},
|
4358
|
-
if (
|
4359
|
-
|
4369
|
+
}, T = () => {
|
4370
|
+
R.setViewport(0, 0, g, b), R.setScissor(0, 0, g, b), R.render(m, X);
|
4371
|
+
}, S = () => {
|
4372
|
+
if (B === "Side by Side")
|
4373
|
+
R.setViewport(0, 0, O, b), R.setScissor(0, 0, O, b), R.render(m, X), R.setViewport(O, 0, O, b), R.setScissor(O, 0, O, b), R.render(m, le);
|
4360
4374
|
else {
|
4361
|
-
const
|
4362
|
-
|
4375
|
+
const k = b - j;
|
4376
|
+
R.setViewport(0, k, g, j), R.setScissor(0, k, g, j), R.render(m, X), R.setViewport(0, 0, g, j), R.setScissor(0, 0, g, j), R.render(m, le);
|
4363
4377
|
}
|
4364
4378
|
}, z = () => {
|
4365
|
-
let
|
4366
|
-
|
4367
|
-
},
|
4368
|
-
switch (h.forEach((
|
4369
|
-
|
4370
|
-
}),
|
4371
|
-
|
4372
|
-
}), f.forEach((
|
4373
|
-
|
4374
|
-
}), e.onSceneUpdate !== void 0 && It && e.onSceneUpdate(Te),
|
4379
|
+
let k = 0, Y = 0;
|
4380
|
+
Y = b - j, k = 0, R.setViewport(k, Y, O, j), R.setScissor(k, Y, O, j), R.render(m, X), k = O, R.setViewport(k, Y, O, j), R.setScissor(k, Y, O, j), R.render(m, le), Y = 0, k = 0, R.setViewport(k, Y, O, j), R.setScissor(k, Y, O, j), R.render(m, Ye), k = O, R.setViewport(k, Y, O, j), R.setScissor(k, Y, O, j), R.render(m, Ve);
|
4381
|
+
}, J = () => {
|
4382
|
+
switch (h.forEach((k) => {
|
4383
|
+
k.update();
|
4384
|
+
}), d.forEach((k) => {
|
4385
|
+
k.update();
|
4386
|
+
}), f.forEach((k) => {
|
4387
|
+
k.update !== void 0 && k.update();
|
4388
|
+
}), e.onSceneUpdate !== void 0 && It && e.onSceneUpdate(Te), R.clear(), B) {
|
4375
4389
|
case "Single":
|
4376
|
-
|
4390
|
+
T();
|
4377
4391
|
break;
|
4378
4392
|
case "Side by Side":
|
4379
4393
|
case "Stacked":
|
4380
|
-
|
4394
|
+
S();
|
4381
4395
|
break;
|
4382
4396
|
case "Quad":
|
4383
4397
|
z();
|
4384
4398
|
break;
|
4385
4399
|
}
|
4386
|
-
|
4400
|
+
ce = requestAnimationFrame(J);
|
4387
4401
|
};
|
4388
|
-
return Be(), window.addEventListener("resize",
|
4389
|
-
window.removeEventListener("resize",
|
4402
|
+
return Be(), window.addEventListener("resize", de), de(), J(), () => {
|
4403
|
+
window.removeEventListener("resize", de), cancelAnimationFrame(ce), ce = -1;
|
4390
4404
|
};
|
4391
|
-
}, [
|
4392
|
-
if (
|
4393
|
-
const
|
4394
|
-
switch (
|
4405
|
+
}, [B, R]), Re(() => {
|
4406
|
+
if (R !== null) {
|
4407
|
+
const g = new Ea(), b = new ge(), O = (T, S, z, J) => {
|
4408
|
+
switch (B) {
|
4395
4409
|
case "Quad":
|
4396
|
-
|
4410
|
+
T < z ? S < J ? g.setFromCamera(b, X) : g.setFromCamera(b, Ye) : S < J ? g.setFromCamera(b, le) : g.setFromCamera(b, Ve);
|
4397
4411
|
break;
|
4398
4412
|
case "Side by Side":
|
4399
|
-
|
4413
|
+
T < z ? g.setFromCamera(b, X) : g.setFromCamera(b, le);
|
4400
4414
|
break;
|
4401
4415
|
case "Single":
|
4402
|
-
|
4416
|
+
g.setFromCamera(b, X);
|
4403
4417
|
break;
|
4404
4418
|
case "Stacked":
|
4405
|
-
|
4419
|
+
S < J ? g.setFromCamera(b, X) : g.setFromCamera(b, le);
|
4406
4420
|
break;
|
4407
4421
|
}
|
4408
|
-
}, j = (
|
4422
|
+
}, j = (T) => {
|
4409
4423
|
if (je === "Orbit")
|
4410
4424
|
return;
|
4411
|
-
const
|
4412
|
-
|
4413
|
-
const z = Math.min(
|
4414
|
-
b.x = ot(z, 0,
|
4415
|
-
const
|
4416
|
-
z <
|
4425
|
+
const S = new ge();
|
4426
|
+
R.getSize(S);
|
4427
|
+
const z = Math.min(T.clientX, S.x), J = Math.min(T.clientY, S.y);
|
4428
|
+
b.x = ot(z, 0, S.x, -1, 1), b.y = ot(J, 0, S.y, 1, -1);
|
4429
|
+
const k = S.x / 2, Y = S.y / 2, ee = () => {
|
4430
|
+
z < k ? b.x = ot(z, 0, k, -1, 1) : b.x = ot(z, k, S.x, -1, 1);
|
4417
4431
|
}, $e = () => {
|
4418
|
-
|
4432
|
+
J < Y ? b.y = ot(J, 0, Y, 1, -1) : b.y = ot(J, Y, S.y, 1, -1);
|
4419
4433
|
};
|
4420
|
-
switch (
|
4434
|
+
switch (B) {
|
4421
4435
|
case "Quad":
|
4422
|
-
|
4436
|
+
ee(), $e();
|
4423
4437
|
break;
|
4424
4438
|
case "Side by Side":
|
4425
|
-
|
4439
|
+
ee();
|
4426
4440
|
break;
|
4427
4441
|
case "Stacked":
|
4428
4442
|
$e(), $e();
|
4429
4443
|
break;
|
4430
4444
|
}
|
4431
|
-
|
4432
|
-
const ze =
|
4433
|
-
ze.length > 0 &&
|
4434
|
-
},
|
4445
|
+
O(z, J, k, Y);
|
4446
|
+
const ze = g.intersectObjects(Te.children);
|
4447
|
+
ze.length > 0 && q.position.copy(ze[0].point);
|
4448
|
+
}, ce = (T) => {
|
4435
4449
|
if (je === "Orbit")
|
4436
4450
|
return;
|
4437
|
-
const
|
4438
|
-
if (
|
4451
|
+
const S = new ge();
|
4452
|
+
if (R.getSize(S), T.clientX >= S.x)
|
4439
4453
|
return;
|
4440
|
-
j(
|
4441
|
-
const z =
|
4442
|
-
z.length > 0 && (e.three.getObject(z[0].object.uuid),
|
4443
|
-
},
|
4444
|
-
return
|
4445
|
-
|
4454
|
+
j(T);
|
4455
|
+
const z = g.intersectObjects(Te.children);
|
4456
|
+
z.length > 0 && (e.three.getObject(z[0].object.uuid), q.visible = !1, qe("Orbit"), Le(Date.now()));
|
4457
|
+
}, de = ve.current;
|
4458
|
+
return de.addEventListener("mousemove", j, !1), de.addEventListener("click", ce, !1), () => {
|
4459
|
+
de.removeEventListener("mousemove", j), de.removeEventListener("click", ce);
|
4446
4460
|
};
|
4447
4461
|
}
|
4448
|
-
}, [
|
4462
|
+
}, [B, R, je]);
|
4449
4463
|
const be = [];
|
4450
|
-
return r.forEach((
|
4464
|
+
return r.forEach((g, b) => {
|
4451
4465
|
be.push(b);
|
4452
4466
|
}), /* @__PURE__ */ l.jsxs("div", { className: "multiview", children: [
|
4453
|
-
/* @__PURE__ */ l.jsx("canvas", { ref:
|
4454
|
-
|
4455
|
-
/* @__PURE__ */ l.jsxs("div", { className: `cameras ${
|
4456
|
-
|
4457
|
-
h.get(
|
4458
|
-
const b = r.get(
|
4459
|
-
b !== void 0 && (
|
4467
|
+
/* @__PURE__ */ l.jsx("canvas", { ref: H }),
|
4468
|
+
R !== null && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
4469
|
+
/* @__PURE__ */ l.jsxs("div", { className: `cameras ${B === "Single" || B === "Stacked" ? "single" : ""}`, ref: ve, children: [
|
4470
|
+
B === "Single" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx(Ze, { camera: X, options: be, ref: re, onSelect: (g) => {
|
4471
|
+
h.get(X.name)?.dispose();
|
4472
|
+
const b = r.get(g);
|
4473
|
+
b !== void 0 && (me(X), X = b, localStorage.setItem(`${n}_tlCam`, b.name), ae(b, re.current));
|
4460
4474
|
} }) }),
|
4461
|
-
(
|
4462
|
-
/* @__PURE__ */ l.jsx(Ze, { camera:
|
4463
|
-
h.get(
|
4464
|
-
const b = r.get(
|
4465
|
-
b !== void 0 && (
|
4475
|
+
(B === "Side by Side" || B === "Stacked") && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
4476
|
+
/* @__PURE__ */ l.jsx(Ze, { camera: X, options: be, ref: re, onSelect: (g) => {
|
4477
|
+
h.get(X.name)?.dispose();
|
4478
|
+
const b = r.get(g);
|
4479
|
+
b !== void 0 && (me(X), X = b, localStorage.setItem(`${n}_tlCam`, b.name), ae(b, re.current));
|
4466
4480
|
} }),
|
4467
|
-
/* @__PURE__ */ l.jsx(Ze, { camera:
|
4468
|
-
h.get(
|
4469
|
-
const b = r.get(
|
4470
|
-
b !== void 0 && (
|
4481
|
+
/* @__PURE__ */ l.jsx(Ze, { camera: le, options: be, ref: _e, onSelect: (g) => {
|
4482
|
+
h.get(le.name)?.dispose();
|
4483
|
+
const b = r.get(g);
|
4484
|
+
b !== void 0 && (me(le), le = b, localStorage.setItem(`${n}_trCam`, b.name), ae(b, _e.current));
|
4471
4485
|
} })
|
4472
4486
|
] }),
|
4473
|
-
|
4474
|
-
/* @__PURE__ */ l.jsx(Ze, { camera:
|
4475
|
-
h.get(
|
4476
|
-
const b = r.get(
|
4477
|
-
b !== void 0 && (
|
4487
|
+
B === "Quad" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
4488
|
+
/* @__PURE__ */ l.jsx(Ze, { camera: X, options: be, ref: re, onSelect: (g) => {
|
4489
|
+
h.get(X.name)?.dispose();
|
4490
|
+
const b = r.get(g);
|
4491
|
+
b !== void 0 && (me(X), X = b, localStorage.setItem(`${n}_tlCam`, b.name), ae(b, re.current));
|
4478
4492
|
} }),
|
4479
|
-
/* @__PURE__ */ l.jsx(Ze, { camera:
|
4480
|
-
h.get(
|
4481
|
-
const b = r.get(
|
4482
|
-
b !== void 0 && (
|
4493
|
+
/* @__PURE__ */ l.jsx(Ze, { camera: le, options: be, ref: _e, onSelect: (g) => {
|
4494
|
+
h.get(le.name)?.dispose();
|
4495
|
+
const b = r.get(g);
|
4496
|
+
b !== void 0 && (me(le), le = b, localStorage.setItem(`${n}_trCam`, b.name), ae(b, _e.current));
|
4483
4497
|
} }),
|
4484
|
-
/* @__PURE__ */ l.jsx(Ze, { camera: Ye, options: be, ref: ke, onSelect: (
|
4498
|
+
/* @__PURE__ */ l.jsx(Ze, { camera: Ye, options: be, ref: ke, onSelect: (g) => {
|
4485
4499
|
h.get(Ye.name)?.dispose();
|
4486
|
-
const b = r.get(
|
4487
|
-
b !== void 0 && (
|
4500
|
+
const b = r.get(g);
|
4501
|
+
b !== void 0 && (me(Ye), Ye = b, localStorage.setItem(`${n}_blCam`, b.name), ae(b, ke.current));
|
4488
4502
|
} }),
|
4489
|
-
/* @__PURE__ */ l.jsx(Ze, { camera: Ve, options: be, ref: ye, onSelect: (
|
4503
|
+
/* @__PURE__ */ l.jsx(Ze, { camera: Ve, options: be, ref: ye, onSelect: (g) => {
|
4490
4504
|
h.get(Ve.name)?.dispose();
|
4491
|
-
const b = r.get(
|
4492
|
-
b !== void 0 && (
|
4505
|
+
const b = r.get(g);
|
4506
|
+
b !== void 0 && (me(Ve), Ve = b, localStorage.setItem(`${n}_brCam`, b.name), ae(b, ye.current));
|
4493
4507
|
} })
|
4494
4508
|
] })
|
4495
4509
|
] }),
|
@@ -4497,46 +4511,46 @@ function $i(e) {
|
|
4497
4511
|
/* @__PURE__ */ l.jsx(
|
4498
4512
|
wt,
|
4499
4513
|
{
|
4500
|
-
index:
|
4501
|
-
options:
|
4502
|
-
onSelect: (
|
4503
|
-
|
4514
|
+
index: ue.indexOf(B),
|
4515
|
+
options: ue,
|
4516
|
+
onSelect: (g) => {
|
4517
|
+
g !== B && (Ue(), Ee(g));
|
4504
4518
|
},
|
4505
4519
|
open: De,
|
4506
|
-
onToggle: (
|
4507
|
-
Ie(
|
4520
|
+
onToggle: (g) => {
|
4521
|
+
Ie(g), Pe && Ae(!1), Ne && Ke(!1);
|
4508
4522
|
}
|
4509
4523
|
}
|
4510
4524
|
),
|
4511
4525
|
/* @__PURE__ */ l.jsx(
|
4512
4526
|
wt,
|
4513
4527
|
{
|
4514
|
-
index:
|
4515
|
-
options:
|
4516
|
-
onSelect: (
|
4517
|
-
if (
|
4518
|
-
switch (xt =
|
4528
|
+
index: Z.indexOf(xt),
|
4529
|
+
options: Z,
|
4530
|
+
onSelect: (g) => {
|
4531
|
+
if (g !== xt)
|
4532
|
+
switch (xt = g, xt) {
|
4519
4533
|
case "Depth":
|
4520
|
-
m.overrideMaterial =
|
4534
|
+
m.overrideMaterial = U;
|
4521
4535
|
break;
|
4522
4536
|
case "Normals":
|
4523
|
-
m.overrideMaterial =
|
4537
|
+
m.overrideMaterial = $;
|
4524
4538
|
break;
|
4525
4539
|
default:
|
4526
4540
|
case "Renderer":
|
4527
4541
|
m.overrideMaterial = null;
|
4528
4542
|
break;
|
4529
4543
|
case "Wireframe":
|
4530
|
-
m.overrideMaterial =
|
4544
|
+
m.overrideMaterial = K;
|
4531
4545
|
break;
|
4532
4546
|
case "UVs":
|
4533
|
-
m.overrideMaterial =
|
4547
|
+
m.overrideMaterial = C;
|
4534
4548
|
break;
|
4535
4549
|
}
|
4536
4550
|
},
|
4537
4551
|
open: Pe,
|
4538
|
-
onToggle: (
|
4539
|
-
De && Ie(!1), Ae(
|
4552
|
+
onToggle: (g) => {
|
4553
|
+
De && Ie(!1), Ae(g), Ne && Ke(!1);
|
4540
4554
|
}
|
4541
4555
|
}
|
4542
4556
|
),
|
@@ -4548,12 +4562,12 @@ function $i(e) {
|
|
4548
4562
|
"Orbit Mode",
|
4549
4563
|
"Selection Mode"
|
4550
4564
|
],
|
4551
|
-
onSelect: (
|
4552
|
-
|
4565
|
+
onSelect: (g) => {
|
4566
|
+
q.visible = g === "Selection Mode", qe(q.visible ? "Selection" : "Orbit");
|
4553
4567
|
},
|
4554
4568
|
open: Ne,
|
4555
|
-
onToggle: (
|
4556
|
-
De && Ie(!1), Pe && Ae(!1), Ke(
|
4569
|
+
onToggle: (g) => {
|
4570
|
+
De && Ie(!1), Pe && Ae(!1), Ke(g);
|
4557
4571
|
}
|
4558
4572
|
}
|
4559
4573
|
)
|
@@ -4572,16 +4586,16 @@ export {
|
|
4572
4586
|
Gt as Accordion,
|
4573
4587
|
Ai as Application,
|
4574
4588
|
Tt as BaseRemote,
|
4575
|
-
|
4576
|
-
|
4577
|
-
|
4578
|
-
|
4579
|
-
|
4580
|
-
|
4589
|
+
Un as ChildObject,
|
4590
|
+
Ya as ContainerObject,
|
4591
|
+
Ga as Draggable,
|
4592
|
+
za as DraggableItem,
|
4593
|
+
Wa as Dropdown,
|
4594
|
+
Ha as DropdownItem,
|
4581
4595
|
zi as Editor,
|
4582
4596
|
vi as Inspector,
|
4583
4597
|
$i as MultiView,
|
4584
|
-
|
4598
|
+
Fn as NavButton,
|
4585
4599
|
ji as RemoteComponents,
|
4586
4600
|
Bi as RemoteController,
|
4587
4601
|
zt as RemoteTheatre,
|
@@ -4589,22 +4603,22 @@ export {
|
|
4589
4603
|
Li as RemoteTweakpane,
|
4590
4604
|
Ui as SceneInspector,
|
4591
4605
|
Fi as SidePanel,
|
4592
|
-
|
4606
|
+
A as ToolEvents,
|
4593
4607
|
Mt as capitalize,
|
4594
4608
|
Je as clamp,
|
4595
|
-
|
4596
|
-
|
4609
|
+
Da as colorToHex,
|
4610
|
+
P as debugDispatcher,
|
4597
4611
|
ki as defaultTheatreCallback,
|
4598
4612
|
Ot as dispose,
|
4599
|
-
|
4613
|
+
Pa as disposeMaterial,
|
4600
4614
|
Pi as disposeTexture,
|
4601
4615
|
Di as distance,
|
4602
4616
|
Lt as hierarchyUUID,
|
4603
|
-
|
4617
|
+
ka as isColor,
|
4604
4618
|
tn as mix,
|
4605
4619
|
$t as noop,
|
4606
4620
|
en as normalize,
|
4607
|
-
|
4621
|
+
_a as randomID,
|
4608
4622
|
an as resetThreeObjects,
|
4609
4623
|
nn as round,
|
4610
4624
|
Ii as theatreEditorApp,
|