@tomorrowevening/hermes 0.0.22 → 0.0.24
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.js +292 -271
- package/dist/hermes.umd.cjs +12 -12
- package/package.json +6 -3
- package/src/core/Application.ts +59 -13
- package/src/core/RemoteController.ts +3 -3
- package/src/core/remote/RemoteTheatre.ts +5 -0
- package/src/core/remote/RemoteThree.ts +5 -0
- package/types/core/Application.d.ts +12 -3
package/dist/hermes.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
var
|
2
|
-
var kn = (t, n, a) => n in t ?
|
3
|
-
var
|
4
|
-
import { PositionalAudio as Dn, EventDispatcher as cn, Texture as ln, CubeTexture as An, RepeatWrapping as
|
1
|
+
var jn = Object.defineProperty;
|
2
|
+
var kn = (t, n, a) => n in t ? jn(t, n, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[n] = a;
|
3
|
+
var L = (t, n, a) => (kn(t, typeof n != "symbol" ? n + "" : n, a), a);
|
4
|
+
import { PositionalAudio as Dn, EventDispatcher as cn, Texture as ln, CubeTexture as An, RepeatWrapping as Yt, ShaderMaterial as un, GLSL3 as In, DoubleSide as Ln, Color as Bt, Mesh as Nn, PlaneGeometry as Fn, Matrix4 as Un, Vector3 as Y, Euler as Bn, Ray as $n, Plane as Gn, MathUtils as Vn, MOUSE as We, TOUCH as Ke, Quaternion as Wt, Spherical as Kt, Vector2 as de, PerspectiveCamera as Lt, MeshDepthMaterial as Hn, MeshNormalMaterial as zn, MeshBasicMaterial as Yn, OrthographicCamera as dn, Scene as fn, Group as Wn, AxesHelper as hn, WebGLRenderer as Kn, Raycaster as Xn, CameraHelper as qn } from "three";
|
5
5
|
import { getProject as Zn, createRafDriver as Jn } from "@theatre/core";
|
6
6
|
import st from "@theatre/studio";
|
7
7
|
import { Pane as Qn } from "tweakpane";
|
@@ -31,14 +31,14 @@ function ra(t) {
|
|
31
31
|
function kt(t, n = 1) {
|
32
32
|
return Number(t.toFixed(n));
|
33
33
|
}
|
34
|
-
let
|
34
|
+
let Nt = 0;
|
35
35
|
const oa = () => {
|
36
|
-
|
36
|
+
Nt = 0;
|
37
37
|
}, gn = (t) => {
|
38
38
|
if (!t)
|
39
39
|
return;
|
40
40
|
let n = t.name.replace(" ", "");
|
41
|
-
n.length === 0 && (n = `obj_${
|
41
|
+
n.length === 0 && (n = `obj_${Nt}`, Nt++), t.parent !== null && (n = `${t.parent.uuid}.${n}`), t.uuid = n, t.children.forEach((a) => {
|
42
42
|
gn(a);
|
43
43
|
});
|
44
44
|
}, fi = (t) => {
|
@@ -60,31 +60,47 @@ const oa = () => {
|
|
60
60
|
}
|
61
61
|
};
|
62
62
|
class hi {
|
63
|
-
constructor(n, a, e = "editor") {
|
64
|
-
|
65
|
-
|
63
|
+
constructor(n, a, e = !0, r = "editor") {
|
64
|
+
L(this, "components", /* @__PURE__ */ new Map());
|
65
|
+
L(this, "listen");
|
66
66
|
// Protected
|
67
|
-
|
68
|
-
this
|
67
|
+
L(this, "_debugEnabled");
|
68
|
+
L(this, "broadcastChannel");
|
69
|
+
L(this, "webSocket");
|
70
|
+
L(this, "_mode", "app");
|
71
|
+
L(this, "_connected", !1);
|
72
|
+
L(this, "useBC", !1);
|
73
|
+
L(this, "messageHandler", (n) => {
|
74
|
+
this.listen !== void 0 && (this.useBC ? this.listen(n.data) : this.listen(JSON.parse(n.data)));
|
75
|
+
});
|
76
|
+
L(this, "openHandler", () => {
|
77
|
+
this._connected = !0;
|
78
|
+
});
|
79
|
+
L(this, "closeHandler", () => {
|
80
|
+
this._connected = !1;
|
81
|
+
});
|
82
|
+
this.editor = a && document.location.hash.search(r) > -1, this._debugEnabled = a, a && (this.useBC = e, e ? (this.broadcastChannel = new BroadcastChannel(n), this.broadcastChannel.addEventListener("message", this.messageHandler)) : (this.webSocket = new WebSocket(n), this.webSocket.addEventListener("open", this.openHandler), this.webSocket.addEventListener("close", this.closeHandler), this.webSocket.addEventListener("message", this.messageHandler)));
|
69
83
|
}
|
70
84
|
addComponent(n, a) {
|
71
85
|
this.components.set(n, a);
|
72
86
|
}
|
73
87
|
dispose() {
|
74
|
-
this.components.forEach((n) => {
|
88
|
+
this.broadcastChannel !== void 0 && this.broadcastChannel.removeEventListener("message", this.messageHandler), this.webSocket !== void 0 && (this.webSocket.removeEventListener("open", this.openHandler), this.webSocket.removeEventListener("close", this.closeHandler), this.webSocket.removeEventListener("message", this.messageHandler)), this.components.forEach((n) => {
|
75
89
|
n.dispose();
|
76
90
|
}), this.components.clear();
|
77
91
|
}
|
78
92
|
// Remote
|
79
93
|
send(n) {
|
80
|
-
|
81
|
-
|
82
|
-
listen(n) {
|
83
|
-
this.channel !== void 0 && (this.channel.onmessage = (a) => {
|
84
|
-
n(a.data);
|
85
|
-
});
|
94
|
+
var a, e;
|
95
|
+
this._mode !== n.target && (this.useBC ? (a = this.broadcastChannel) == null || a.postMessage(n) : this._connected && ((e = this.webSocket) == null || e.send(JSON.stringify(n))));
|
86
96
|
}
|
87
97
|
// Getters / Setters
|
98
|
+
get connected() {
|
99
|
+
return this._connected;
|
100
|
+
}
|
101
|
+
get debugEnabled() {
|
102
|
+
return this._debugEnabled;
|
103
|
+
}
|
88
104
|
get mode() {
|
89
105
|
return this._mode;
|
90
106
|
}
|
@@ -98,7 +114,7 @@ class hi {
|
|
98
114
|
n && (this._mode = "editor", document.title += " - Editor");
|
99
115
|
}
|
100
116
|
}
|
101
|
-
const
|
117
|
+
const _ = new cn(), j = {
|
102
118
|
CUSTOM: "ToolEvents::custom",
|
103
119
|
// Components
|
104
120
|
SELECT_DROPDOWN: "ToolEvents::selectDropdown",
|
@@ -116,7 +132,7 @@ const j = new cn(), _ = {
|
|
116
132
|
};
|
117
133
|
class Ot {
|
118
134
|
constructor(n) {
|
119
|
-
|
135
|
+
L(this, "app");
|
120
136
|
this.app = n;
|
121
137
|
}
|
122
138
|
dispose() {
|
@@ -147,10 +163,10 @@ class ca extends Ot {
|
|
147
163
|
function la(t, n) {
|
148
164
|
switch (n.event) {
|
149
165
|
case "selectComponent":
|
150
|
-
|
166
|
+
_.dispatchEvent({ type: j.SELECT_DROPDOWN, value: n.data });
|
151
167
|
break;
|
152
168
|
case "draggableListUpdate":
|
153
|
-
|
169
|
+
_.dispatchEvent({ type: j.DRAG_UPDATE, value: n.data });
|
154
170
|
break;
|
155
171
|
}
|
156
172
|
}
|
@@ -158,11 +174,11 @@ const bn = () => {
|
|
158
174
|
}, qe = class qe extends Ot {
|
159
175
|
constructor() {
|
160
176
|
super(...arguments);
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
177
|
+
L(this, "project");
|
178
|
+
L(this, "sheets", /* @__PURE__ */ new Map());
|
179
|
+
L(this, "sheetObjects", /* @__PURE__ */ new Map());
|
180
|
+
L(this, "sheetObjectCBs", /* @__PURE__ */ new Map());
|
181
|
+
L(this, "sheetObjectUnsubscribe", /* @__PURE__ */ new Map());
|
166
182
|
}
|
167
183
|
init(a, e) {
|
168
184
|
return this.project = Zn(a, e), this.project.ready;
|
@@ -231,6 +247,7 @@ const bn = () => {
|
|
231
247
|
event: "updateSheetObject",
|
232
248
|
target: "app",
|
233
249
|
data: {
|
250
|
+
sheet: a,
|
234
251
|
sheetObject: l,
|
235
252
|
values: v
|
236
253
|
}
|
@@ -255,7 +272,7 @@ const bn = () => {
|
|
255
272
|
return qe.rafDriver || (qe.rafDriver = Jn()), qe.rafDriver;
|
256
273
|
}
|
257
274
|
};
|
258
|
-
|
275
|
+
L(qe, "rafDriver", null);
|
259
276
|
let Ue = qe, Me;
|
260
277
|
function ua(t, n) {
|
261
278
|
t.components.forEach((a) => {
|
@@ -270,7 +287,7 @@ function ua(t, n) {
|
|
270
287
|
e = r.sheetObjects.get(`${n.data.sheet}_${n.data.key}`), e !== void 0 && st.setSelection([e]);
|
271
288
|
break;
|
272
289
|
case "updateSheetObject":
|
273
|
-
e = r.sheetObjectCBs.get(n.data.sheetObject), e !== void 0 && e(n.data.values);
|
290
|
+
e = r.sheets.get(n.data.sheet), e !== void 0 && e.sequence.pause(), e = r.sheetObjectCBs.get(n.data.sheetObject), e !== void 0 && e(n.data.values);
|
274
291
|
break;
|
275
292
|
case "updateTimeline":
|
276
293
|
e = r.sheets.get(n.data.sheet), Me !== void 0 && (Me.sequence.position = n.data.position);
|
@@ -501,17 +518,17 @@ function Ft(t) {
|
|
501
518
|
const e = new Image();
|
502
519
|
e.onload = () => {
|
503
520
|
const r = new ln(e);
|
504
|
-
r.wrapS =
|
521
|
+
r.wrapS = Yt, r.wrapT = Yt, r.needsUpdate = !0, n(r);
|
505
522
|
}, e.onerror = a, e.src = t;
|
506
523
|
});
|
507
524
|
}
|
508
525
|
class ga extends Ot {
|
509
526
|
constructor() {
|
510
527
|
super(...arguments);
|
511
|
-
|
528
|
+
L(this, "scene");
|
512
529
|
}
|
513
530
|
getObject(a) {
|
514
|
-
this.app.send({
|
531
|
+
this.app.debugEnabled && this.app.send({
|
515
532
|
event: "getObject",
|
516
533
|
target: "app",
|
517
534
|
data: a
|
@@ -559,9 +576,9 @@ class ga extends Ot {
|
|
559
576
|
});
|
560
577
|
}
|
561
578
|
setScene(a) {
|
562
|
-
if (a === void 0)
|
579
|
+
if (a === void 0 || (this.scene = a, !this.app.debugEnabled))
|
563
580
|
return;
|
564
|
-
|
581
|
+
oa(), gn(this.scene);
|
565
582
|
const e = yn(this.scene);
|
566
583
|
this.app.send({
|
567
584
|
event: "setScene",
|
@@ -570,6 +587,8 @@ class ga extends Ot {
|
|
570
587
|
});
|
571
588
|
}
|
572
589
|
addCamera(a) {
|
590
|
+
if (!this.app.debugEnabled)
|
591
|
+
return;
|
573
592
|
const e = Dt(a);
|
574
593
|
this.app.send({
|
575
594
|
event: "addCamera",
|
@@ -578,6 +597,8 @@ class ga extends Ot {
|
|
578
597
|
});
|
579
598
|
}
|
580
599
|
removeCamera(a) {
|
600
|
+
if (!this.app.debugEnabled)
|
601
|
+
return;
|
581
602
|
const e = Dt(a);
|
582
603
|
this.app.send({
|
583
604
|
event: "removeCamera",
|
@@ -589,44 +610,44 @@ class ga extends Ot {
|
|
589
610
|
function va(t, n) {
|
590
611
|
switch (n.event) {
|
591
612
|
case "getObject":
|
592
|
-
|
613
|
+
_.dispatchEvent({ type: j.GET_OBJECT, value: n.data });
|
593
614
|
break;
|
594
615
|
case "updateObject":
|
595
|
-
|
616
|
+
_.dispatchEvent({ type: j.UPDATE_OBJECT, value: n.data });
|
596
617
|
break;
|
597
618
|
case "createTexture":
|
598
|
-
|
619
|
+
_.dispatchEvent({ type: j.CREATE_TEXTURE, value: n.data });
|
599
620
|
break;
|
600
621
|
case "requestMethod":
|
601
|
-
|
622
|
+
_.dispatchEvent({ type: j.REQUEST_METHOD, value: n.data });
|
602
623
|
break;
|
603
624
|
}
|
604
625
|
}
|
605
626
|
function ba(t, n) {
|
606
627
|
switch (n.event) {
|
607
628
|
case "setObject":
|
608
|
-
|
629
|
+
_.dispatchEvent({ type: j.SET_OBJECT, value: n.data });
|
609
630
|
break;
|
610
631
|
case "setScene":
|
611
|
-
|
632
|
+
_.dispatchEvent({ type: j.SET_SCENE, value: n.data });
|
612
633
|
break;
|
613
634
|
case "addCamera":
|
614
|
-
|
635
|
+
_.dispatchEvent({ type: j.ADD_CAMERA, value: n.data });
|
615
636
|
break;
|
616
637
|
case "removeCamera":
|
617
|
-
|
638
|
+
_.dispatchEvent({ type: j.REMOVE_CAMERA, value: n.data });
|
618
639
|
break;
|
619
640
|
}
|
620
641
|
}
|
621
642
|
class En extends Ot {
|
622
643
|
constructor(a) {
|
623
644
|
super(a);
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
645
|
+
L(this, "bindCBs");
|
646
|
+
L(this, "buttonCBs");
|
647
|
+
L(this, "pane");
|
648
|
+
L(this, "appCallbacks", 0);
|
649
|
+
L(this, "editorCallbacks", 0);
|
650
|
+
L(this, "inspectorFolder");
|
630
651
|
this.bindCBs = /* @__PURE__ */ new Map(), this.buttonCBs = /* @__PURE__ */ new Map(), a.editor && this.createGUI();
|
631
652
|
}
|
632
653
|
createGUI() {
|
@@ -784,11 +805,11 @@ var rt = {};
|
|
784
805
|
var Zt;
|
785
806
|
function wa() {
|
786
807
|
return Zt || (Zt = 1, process.env.NODE_ENV !== "production" && function() {
|
787
|
-
var t = pn, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), e = Symbol.for("react.fragment"), r = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), l = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), C = Symbol.for("react.offscreen"), M = Symbol.iterator,
|
808
|
+
var t = pn, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), e = Symbol.for("react.fragment"), r = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), l = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), C = Symbol.for("react.offscreen"), M = Symbol.iterator, V = "@@iterator";
|
788
809
|
function se(i) {
|
789
810
|
if (i === null || typeof i != "object")
|
790
811
|
return null;
|
791
|
-
var h = M && i[M] || i[
|
812
|
+
var h = M && i[M] || i[V];
|
792
813
|
return typeof h == "function" ? h : null;
|
793
814
|
}
|
794
815
|
var K = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
@@ -803,10 +824,10 @@ function wa() {
|
|
803
824
|
{
|
804
825
|
var w = K.ReactDebugCurrentFrame, k = w.getStackAddendum();
|
805
826
|
k !== "" && (h += "%s", g = g.concat([k]));
|
806
|
-
var
|
827
|
+
var F = g.map(function(P) {
|
807
828
|
return String(P);
|
808
829
|
});
|
809
|
-
|
830
|
+
F.unshift("Warning: " + h), Function.prototype.apply.call(console[i], console, F);
|
810
831
|
}
|
811
832
|
}
|
812
833
|
var fe = !1, le = !1, ee = !1, f = !1, m = !1, b;
|
@@ -818,17 +839,17 @@ function wa() {
|
|
818
839
|
// with.
|
819
840
|
i.$$typeof === b || i.getModuleId !== void 0));
|
820
841
|
}
|
821
|
-
function
|
842
|
+
function $(i, h, g) {
|
822
843
|
var w = i.displayName;
|
823
844
|
if (w)
|
824
845
|
return w;
|
825
846
|
var k = h.displayName || h.name || "";
|
826
847
|
return k !== "" ? g + "(" + k + ")" : g;
|
827
848
|
}
|
828
|
-
function
|
849
|
+
function G(i) {
|
829
850
|
return i.displayName || "Context";
|
830
851
|
}
|
831
|
-
function
|
852
|
+
function U(i) {
|
832
853
|
if (i == null)
|
833
854
|
return null;
|
834
855
|
if (typeof i.tag == "number" && S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof i == "function")
|
@@ -853,19 +874,19 @@ function wa() {
|
|
853
874
|
switch (i.$$typeof) {
|
854
875
|
case l:
|
855
876
|
var h = i;
|
856
|
-
return
|
877
|
+
return G(h) + ".Consumer";
|
857
878
|
case u:
|
858
879
|
var g = i;
|
859
|
-
return
|
880
|
+
return G(g._context) + ".Provider";
|
860
881
|
case d:
|
861
|
-
return
|
882
|
+
return $(i, i.render, "ForwardRef");
|
862
883
|
case E:
|
863
884
|
var w = i.displayName || null;
|
864
|
-
return w !== null ? w :
|
885
|
+
return w !== null ? w : U(i.type) || "Memo";
|
865
886
|
case x: {
|
866
|
-
var k = i,
|
887
|
+
var k = i, F = k._payload, P = k._init;
|
867
888
|
try {
|
868
|
-
return
|
889
|
+
return U(P(F));
|
869
890
|
} catch {
|
870
891
|
return null;
|
871
892
|
}
|
@@ -873,13 +894,13 @@ function wa() {
|
|
873
894
|
}
|
874
895
|
return null;
|
875
896
|
}
|
876
|
-
var A = Object.assign,
|
897
|
+
var A = Object.assign, B = 0, J, R, I, q, me, Re, Ze;
|
877
898
|
function ut() {
|
878
899
|
}
|
879
900
|
ut.__reactDisabledLog = !0;
|
880
901
|
function Mt() {
|
881
902
|
{
|
882
|
-
if (
|
903
|
+
if (B === 0) {
|
883
904
|
J = console.log, R = console.info, I = console.warn, q = console.error, me = console.group, Re = console.groupCollapsed, Ze = console.groupEnd;
|
884
905
|
var i = {
|
885
906
|
configurable: !0,
|
@@ -897,12 +918,12 @@ function wa() {
|
|
897
918
|
groupEnd: i
|
898
919
|
});
|
899
920
|
}
|
900
|
-
|
921
|
+
B++;
|
901
922
|
}
|
902
923
|
}
|
903
924
|
function Rt() {
|
904
925
|
{
|
905
|
-
if (
|
926
|
+
if (B--, B === 0) {
|
906
927
|
var i = {
|
907
928
|
configurable: !0,
|
908
929
|
enumerable: !0,
|
@@ -932,7 +953,7 @@ function wa() {
|
|
932
953
|
})
|
933
954
|
});
|
934
955
|
}
|
935
|
-
|
956
|
+
B < 0 && S("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
936
957
|
}
|
937
958
|
}
|
938
959
|
var Je = K.ReactCurrentDispatcher, Qe;
|
@@ -949,16 +970,16 @@ function wa() {
|
|
949
970
|
` + Qe + i;
|
950
971
|
}
|
951
972
|
}
|
952
|
-
var Ge = !1,
|
973
|
+
var Ge = !1, _e;
|
953
974
|
{
|
954
975
|
var Pt = typeof WeakMap == "function" ? WeakMap : Map;
|
955
|
-
|
976
|
+
_e = new Pt();
|
956
977
|
}
|
957
978
|
function dt(i, h) {
|
958
979
|
if (!i || Ge)
|
959
980
|
return "";
|
960
981
|
{
|
961
|
-
var g =
|
982
|
+
var g = _e.get(i);
|
962
983
|
if (g !== void 0)
|
963
984
|
return g;
|
964
985
|
}
|
@@ -966,8 +987,8 @@ function wa() {
|
|
966
987
|
Ge = !0;
|
967
988
|
var k = Error.prepareStackTrace;
|
968
989
|
Error.prepareStackTrace = void 0;
|
969
|
-
var
|
970
|
-
|
990
|
+
var F;
|
991
|
+
F = Je.current, Je.current = null, Mt();
|
971
992
|
try {
|
972
993
|
if (h) {
|
973
994
|
var P = function() {
|
@@ -1013,17 +1034,17 @@ function wa() {
|
|
1013
1034
|
if (W--, Z--, Z < 0 || T[W] !== ce[Z]) {
|
1014
1035
|
var ge = `
|
1015
1036
|
` + T[W].replace(" at new ", " at ");
|
1016
|
-
return i.displayName && ge.includes("<anonymous>") && (ge = ge.replace("<anonymous>", i.displayName)), typeof i == "function" &&
|
1037
|
+
return i.displayName && ge.includes("<anonymous>") && (ge = ge.replace("<anonymous>", i.displayName)), typeof i == "function" && _e.set(i, ge), ge;
|
1017
1038
|
}
|
1018
1039
|
while (W >= 1 && Z >= 0);
|
1019
1040
|
break;
|
1020
1041
|
}
|
1021
1042
|
}
|
1022
1043
|
} finally {
|
1023
|
-
Ge = !1, Je.current =
|
1044
|
+
Ge = !1, Je.current = F, Rt(), Error.prepareStackTrace = k;
|
1024
1045
|
}
|
1025
|
-
var
|
1026
|
-
return typeof i == "function" &&
|
1046
|
+
var Ye = i ? i.displayName || i.name : "", zt = Ye ? Pe(Ye) : "";
|
1047
|
+
return typeof i == "function" && _e.set(i, zt), zt;
|
1027
1048
|
}
|
1028
1049
|
function ft(i, h, g) {
|
1029
1050
|
return dt(i, !1);
|
@@ -1032,7 +1053,7 @@ function wa() {
|
|
1032
1053
|
var h = i.prototype;
|
1033
1054
|
return !!(h && h.isReactComponent);
|
1034
1055
|
}
|
1035
|
-
function
|
1056
|
+
function je(i, h, g) {
|
1036
1057
|
if (i == null)
|
1037
1058
|
return "";
|
1038
1059
|
if (typeof i == "function")
|
@@ -1050,11 +1071,11 @@ function wa() {
|
|
1050
1071
|
case d:
|
1051
1072
|
return ft(i.render);
|
1052
1073
|
case E:
|
1053
|
-
return
|
1074
|
+
return je(i.type, h, g);
|
1054
1075
|
case x: {
|
1055
|
-
var w = i, k = w._payload,
|
1076
|
+
var w = i, k = w._payload, F = w._init;
|
1056
1077
|
try {
|
1057
|
-
return
|
1078
|
+
return je(F(k), h, g);
|
1058
1079
|
} catch {
|
1059
1080
|
}
|
1060
1081
|
}
|
@@ -1064,16 +1085,16 @@ function wa() {
|
|
1064
1085
|
var Ve = Object.prototype.hasOwnProperty, pt = {}, et = K.ReactDebugCurrentFrame;
|
1065
1086
|
function Se(i) {
|
1066
1087
|
if (i) {
|
1067
|
-
var h = i._owner, g =
|
1088
|
+
var h = i._owner, g = je(i.type, i._source, h ? h.type : null);
|
1068
1089
|
et.setExtraStackFrame(g);
|
1069
1090
|
} else
|
1070
1091
|
et.setExtraStackFrame(null);
|
1071
1092
|
}
|
1072
1093
|
function ke(i, h, g, w, k) {
|
1073
1094
|
{
|
1074
|
-
var
|
1095
|
+
var F = Function.call.bind(Ve);
|
1075
1096
|
for (var P in i)
|
1076
|
-
if (
|
1097
|
+
if (F(i, P)) {
|
1077
1098
|
var T = void 0;
|
1078
1099
|
try {
|
1079
1100
|
if (typeof i[P] != "function") {
|
@@ -1088,9 +1109,9 @@ function wa() {
|
|
1088
1109
|
}
|
1089
1110
|
}
|
1090
1111
|
}
|
1091
|
-
var
|
1112
|
+
var _t = Array.isArray;
|
1092
1113
|
function tt(i) {
|
1093
|
-
return
|
1114
|
+
return _t(i);
|
1094
1115
|
}
|
1095
1116
|
function mt(i) {
|
1096
1117
|
{
|
@@ -1112,7 +1133,7 @@ function wa() {
|
|
1112
1133
|
if (nt(i))
|
1113
1134
|
return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", mt(i)), gt(i);
|
1114
1135
|
}
|
1115
|
-
var Oe = K.ReactCurrentOwner,
|
1136
|
+
var Oe = K.ReactCurrentOwner, jt = {
|
1116
1137
|
key: !0,
|
1117
1138
|
ref: !0,
|
1118
1139
|
__self: !0,
|
@@ -1137,8 +1158,8 @@ function wa() {
|
|
1137
1158
|
}
|
1138
1159
|
function D(i, h) {
|
1139
1160
|
if (typeof i.ref == "string" && Oe.current && h && Oe.current.stateNode !== h) {
|
1140
|
-
var g =
|
1141
|
-
ve[g] || (S('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',
|
1161
|
+
var g = U(Oe.current.type);
|
1162
|
+
ve[g] || (S('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', U(Oe.current.type), i.ref), ve[g] = !0);
|
1142
1163
|
}
|
1143
1164
|
}
|
1144
1165
|
function N(i, h) {
|
@@ -1163,7 +1184,7 @@ function wa() {
|
|
1163
1184
|
});
|
1164
1185
|
}
|
1165
1186
|
}
|
1166
|
-
var be = function(i, h, g, w, k,
|
1187
|
+
var be = function(i, h, g, w, k, F, P) {
|
1167
1188
|
var T = {
|
1168
1189
|
// This tag allows us to uniquely identify this as a React Element
|
1169
1190
|
$$typeof: n,
|
@@ -1173,7 +1194,7 @@ function wa() {
|
|
1173
1194
|
ref: g,
|
1174
1195
|
props: P,
|
1175
1196
|
// Record the component responsible for creating this element.
|
1176
|
-
_owner:
|
1197
|
+
_owner: F
|
1177
1198
|
};
|
1178
1199
|
return T._store = {}, Object.defineProperty(T._store, "validated", {
|
1179
1200
|
configurable: !1,
|
@@ -1194,14 +1215,14 @@ function wa() {
|
|
1194
1215
|
};
|
1195
1216
|
function ue(i, h, g, w, k) {
|
1196
1217
|
{
|
1197
|
-
var
|
1218
|
+
var F, P = {}, T = null, ce = null;
|
1198
1219
|
g !== void 0 && (vt(g), T = "" + g), y(h) && (vt(h.key), T = "" + h.key), o(h) && (ce = h.ref, D(h, k));
|
1199
|
-
for (
|
1200
|
-
Ve.call(h,
|
1220
|
+
for (F in h)
|
1221
|
+
Ve.call(h, F) && !jt.hasOwnProperty(F) && (P[F] = h[F]);
|
1201
1222
|
if (i && i.defaultProps) {
|
1202
1223
|
var W = i.defaultProps;
|
1203
|
-
for (
|
1204
|
-
P[
|
1224
|
+
for (F in W)
|
1225
|
+
P[F] === void 0 && (P[F] = W[F]);
|
1205
1226
|
}
|
1206
1227
|
if (T || ce) {
|
1207
1228
|
var Z = typeof i == "function" ? i.displayName || i.name || "Unknown" : i;
|
@@ -1213,7 +1234,7 @@ function wa() {
|
|
1213
1234
|
var yt = K.ReactCurrentOwner, Et = K.ReactDebugCurrentFrame;
|
1214
1235
|
function ye(i) {
|
1215
1236
|
if (i) {
|
1216
|
-
var h = i._owner, g =
|
1237
|
+
var h = i._owner, g = je(i.type, i._source, h ? h.type : null);
|
1217
1238
|
Et.setExtraStackFrame(g);
|
1218
1239
|
} else
|
1219
1240
|
Et.setExtraStackFrame(null);
|
@@ -1223,10 +1244,10 @@ function wa() {
|
|
1223
1244
|
function pe(i) {
|
1224
1245
|
return typeof i == "object" && i !== null && i.$$typeof === n;
|
1225
1246
|
}
|
1226
|
-
function
|
1247
|
+
function He() {
|
1227
1248
|
{
|
1228
1249
|
if (yt.current) {
|
1229
|
-
var i =
|
1250
|
+
var i = U(yt.current.type);
|
1230
1251
|
if (i)
|
1231
1252
|
return `
|
1232
1253
|
|
@@ -1247,9 +1268,9 @@ Check your code at ` + h + ":" + g + ".";
|
|
1247
1268
|
}
|
1248
1269
|
}
|
1249
1270
|
var Te = {};
|
1250
|
-
function
|
1271
|
+
function ze(i) {
|
1251
1272
|
{
|
1252
|
-
var h =
|
1273
|
+
var h = He();
|
1253
1274
|
if (!h) {
|
1254
1275
|
var g = typeof i == "string" ? i : i.displayName || i.name;
|
1255
1276
|
g && (h = `
|
@@ -1264,12 +1285,12 @@ Check the top-level render call using <` + g + ">.");
|
|
1264
1285
|
if (!i._store || i._store.validated || i.key != null)
|
1265
1286
|
return;
|
1266
1287
|
i._store.validated = !0;
|
1267
|
-
var g =
|
1288
|
+
var g = ze(h);
|
1268
1289
|
if (Te[g])
|
1269
1290
|
return;
|
1270
1291
|
Te[g] = !0;
|
1271
1292
|
var w = "";
|
1272
|
-
i && i._owner && i._owner !== yt.current && (w = " It was passed a child from " +
|
1293
|
+
i && i._owner && i._owner !== yt.current && (w = " It was passed a child from " + U(i._owner.type) + "."), ye(i), S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', g, w), ye(null);
|
1273
1294
|
}
|
1274
1295
|
}
|
1275
1296
|
function Vt(i, h) {
|
@@ -1286,7 +1307,7 @@ Check the top-level render call using <` + g + ">.");
|
|
1286
1307
|
else if (i) {
|
1287
1308
|
var k = se(i);
|
1288
1309
|
if (typeof k == "function" && k !== i.entries)
|
1289
|
-
for (var
|
1310
|
+
for (var F = k.call(i), P; !(P = F.next()).done; )
|
1290
1311
|
pe(P.value) && Gt(P.value, h);
|
1291
1312
|
}
|
1292
1313
|
}
|
@@ -1306,11 +1327,11 @@ Check the top-level render call using <` + g + ">.");
|
|
1306
1327
|
else
|
1307
1328
|
return;
|
1308
1329
|
if (g) {
|
1309
|
-
var w =
|
1330
|
+
var w = U(h);
|
1310
1331
|
ke(g, i.props, "prop", w, i);
|
1311
1332
|
} else if (h.PropTypes !== void 0 && !he) {
|
1312
1333
|
he = !0;
|
1313
|
-
var k =
|
1334
|
+
var k = U(h);
|
1314
1335
|
S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", k || "Unknown");
|
1315
1336
|
}
|
1316
1337
|
typeof h.getDefaultProps == "function" && !h.getDefaultProps.isReactClassApproved && S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
@@ -1328,18 +1349,18 @@ Check the top-level render call using <` + g + ">.");
|
|
1328
1349
|
i.ref !== null && (ye(i), S("Invalid attribute `ref` supplied to `React.Fragment`."), ye(null));
|
1329
1350
|
}
|
1330
1351
|
}
|
1331
|
-
function
|
1352
|
+
function Ht(i, h, g, w, k, F) {
|
1332
1353
|
{
|
1333
1354
|
var P = O(i);
|
1334
1355
|
if (!P) {
|
1335
1356
|
var T = "";
|
1336
1357
|
(i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (T += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
1337
1358
|
var ce = De(k);
|
1338
|
-
ce ? T += ce : T +=
|
1359
|
+
ce ? T += ce : T += He();
|
1339
1360
|
var W;
|
1340
|
-
i === null ? W = "null" : tt(i) ? W = "array" : i !== void 0 && i.$$typeof === n ? (W = "<" + (
|
1361
|
+
i === null ? W = "null" : tt(i) ? W = "array" : i !== void 0 && i.$$typeof === n ? (W = "<" + (U(i.type) || "Unknown") + " />", T = " Did you accidentally export a JSX literal instead of a component?") : W = typeof i, S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", W, T);
|
1341
1362
|
}
|
1342
|
-
var Z = ue(i, h, g, k,
|
1363
|
+
var Z = ue(i, h, g, k, F);
|
1343
1364
|
if (Z == null)
|
1344
1365
|
return Z;
|
1345
1366
|
if (P) {
|
@@ -1347,8 +1368,8 @@ Check the top-level render call using <` + g + ">.");
|
|
1347
1368
|
if (ge !== void 0)
|
1348
1369
|
if (w)
|
1349
1370
|
if (tt(ge)) {
|
1350
|
-
for (var
|
1351
|
-
Vt(ge[
|
1371
|
+
for (var Ye = 0; Ye < ge.length; Ye++)
|
1372
|
+
Vt(ge[Ye], i);
|
1352
1373
|
Object.freeze && Object.freeze(ge);
|
1353
1374
|
} else
|
1354
1375
|
S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
@@ -1359,13 +1380,13 @@ Check the top-level render call using <` + g + ">.");
|
|
1359
1380
|
}
|
1360
1381
|
}
|
1361
1382
|
function Mn(i, h, g) {
|
1362
|
-
return
|
1383
|
+
return Ht(i, h, g, !0);
|
1363
1384
|
}
|
1364
1385
|
function Rn(i, h, g) {
|
1365
|
-
return
|
1386
|
+
return Ht(i, h, g, !1);
|
1366
1387
|
}
|
1367
|
-
var Pn = Rn,
|
1368
|
-
rt.Fragment = e, rt.jsx = Pn, rt.jsxs =
|
1388
|
+
var Pn = Rn, _n = Mn;
|
1389
|
+
rt.Fragment = e, rt.jsx = Pn, rt.jsxs = _n;
|
1369
1390
|
}()), rt;
|
1370
1391
|
}
|
1371
1392
|
process.env.NODE_ENV === "production" ? Ut.exports = Ea() : Ut.exports = wa();
|
@@ -1485,20 +1506,20 @@ function pi(t) {
|
|
1485
1506
|
function e(s) {
|
1486
1507
|
switch (n.forEach((u) => u(t, s)), s.event) {
|
1487
1508
|
case "custom":
|
1488
|
-
|
1509
|
+
_.dispatchEvent({ type: j.CUSTOM, value: s.data });
|
1489
1510
|
break;
|
1490
1511
|
}
|
1491
1512
|
}
|
1492
1513
|
function r(s) {
|
1493
1514
|
switch (a.forEach((u) => u(t, s)), s.event) {
|
1494
1515
|
case "custom":
|
1495
|
-
|
1516
|
+
_.dispatchEvent({ type: j.CUSTOM, value: s.data });
|
1496
1517
|
break;
|
1497
1518
|
}
|
1498
1519
|
}
|
1499
|
-
t.listen(
|
1500
|
-
|
1501
|
-
}
|
1520
|
+
t.listen = (s) => {
|
1521
|
+
s.target === "editor" ? r(s) : e(s);
|
1522
|
+
};
|
1502
1523
|
}
|
1503
1524
|
const Ra = `out vec3 worldPosition;
|
1504
1525
|
uniform float uDistance;
|
@@ -1577,14 +1598,14 @@ void main() {
|
|
1577
1598
|
|
1578
1599
|
if (fragColor.a <= 0.0) discard;
|
1579
1600
|
}`;
|
1580
|
-
class
|
1601
|
+
class _a extends un {
|
1581
1602
|
constructor(n) {
|
1582
1603
|
super({
|
1583
1604
|
extensions: {
|
1584
1605
|
derivatives: !0
|
1585
1606
|
},
|
1586
1607
|
glslVersion: In,
|
1587
|
-
side:
|
1608
|
+
side: Ln,
|
1588
1609
|
transparent: !0,
|
1589
1610
|
uniforms: {
|
1590
1611
|
uScale: {
|
@@ -1613,11 +1634,11 @@ class ja extends un {
|
|
1613
1634
|
});
|
1614
1635
|
}
|
1615
1636
|
}
|
1616
|
-
class
|
1637
|
+
class ja extends Nn {
|
1617
1638
|
constructor() {
|
1618
|
-
const a = new
|
1639
|
+
const a = new _a();
|
1619
1640
|
super(new Fn(2, 2), a);
|
1620
|
-
|
1641
|
+
L(this, "gridMaterial");
|
1621
1642
|
this.gridMaterial = a, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
|
1622
1643
|
}
|
1623
1644
|
update() {
|
@@ -1743,14 +1764,14 @@ function Ia(t) {
|
|
1743
1764
|
n.push(/* @__PURE__ */ c.jsx(xn, { child: a, three: t.three }, Math.random()));
|
1744
1765
|
}), /* @__PURE__ */ c.jsx("div", { className: `scene ${t.class !== void 0 ? t.class : ""}`, children: n });
|
1745
1766
|
}
|
1746
|
-
const
|
1747
|
-
function
|
1767
|
+
const La = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";
|
1768
|
+
function Na(t) {
|
1748
1769
|
return "items" in t;
|
1749
1770
|
}
|
1750
1771
|
function Be(t) {
|
1751
1772
|
const n = [];
|
1752
1773
|
return t.items.forEach((a) => {
|
1753
|
-
|
1774
|
+
Na(a) ? n.push(
|
1754
1775
|
/* @__PURE__ */ c.jsx(Be, { title: a.title, items: a.items }, Math.random())
|
1755
1776
|
) : n.push(
|
1756
1777
|
/* @__PURE__ */ c.jsx(
|
@@ -2014,8 +2035,8 @@ function Jt(t, n, a) {
|
|
2014
2035
|
var M;
|
2015
2036
|
a.createTexture(n.uuid, `material.${r}`, x);
|
2016
2037
|
const C = (M = a.scene) == null ? void 0 : M.getObjectByProperty("uuid", n.uuid);
|
2017
|
-
C !== void 0 && Ft(x).then((
|
2018
|
-
Q(C, `material.${r}`,
|
2038
|
+
C !== void 0 && Ft(x).then((V) => {
|
2039
|
+
Q(C, `material.${r}`, V), Q(C, "material.needsUpdate", !0);
|
2019
2040
|
});
|
2020
2041
|
}
|
2021
2042
|
}) : l.push({
|
@@ -2040,8 +2061,8 @@ function Jt(t, n, a) {
|
|
2040
2061
|
var M;
|
2041
2062
|
a.createTexture(n.uuid, `material.${r}.${d}.value`, x);
|
2042
2063
|
const C = (M = a.scene) == null ? void 0 : M.getObjectByProperty("uuid", n.uuid);
|
2043
|
-
C !== void 0 && Ft(x).then((
|
2044
|
-
Q(C, `material.${r}.${d}.value`,
|
2064
|
+
C !== void 0 && Ft(x).then((V) => {
|
2065
|
+
Q(C, `material.${r}.${d}.value`, V);
|
2045
2066
|
});
|
2046
2067
|
}
|
2047
2068
|
}) : l.push({
|
@@ -2108,7 +2129,7 @@ function ot(t) {
|
|
2108
2129
|
let v = !1, E = -1, x = 0, C = Number(a);
|
2109
2130
|
const M = (fe) => {
|
2110
2131
|
v = !0, x = C, E = fe.clientX;
|
2111
|
-
},
|
2132
|
+
}, V = (fe) => {
|
2112
2133
|
if (!v)
|
2113
2134
|
return;
|
2114
2135
|
const le = t.step !== void 0 ? t.step : 1, ee = (fe.clientX - E) * le;
|
@@ -2118,9 +2139,9 @@ function ot(t) {
|
|
2118
2139
|
}, K = () => {
|
2119
2140
|
v = !1;
|
2120
2141
|
}, S = t.type === "number";
|
2121
|
-
return S && ((X = r.current) == null || X.addEventListener("mousedown", M, !1), document.addEventListener("mouseup", se, !1), document.addEventListener("mousemove",
|
2142
|
+
return S && ((X = r.current) == null || X.addEventListener("mousedown", M, !1), document.addEventListener("mouseup", se, !1), document.addEventListener("mousemove", V, !1), document.addEventListener("contextmenu", K, !1)), () => {
|
2122
2143
|
var fe;
|
2123
|
-
S && ((fe = r.current) == null || fe.removeEventListener("mousedown", M), document.removeEventListener("mouseup", se), document.removeEventListener("mousemove",
|
2144
|
+
S && ((fe = r.current) == null || fe.removeEventListener("mousedown", M), document.removeEventListener("mouseup", se), document.removeEventListener("mousemove", V), document.removeEventListener("contextmenu", K));
|
2124
2145
|
};
|
2125
2146
|
}, [a]);
|
2126
2147
|
const l = t.type === "string" && (a.length > 100 || a.search(`
|
@@ -2202,7 +2223,7 @@ function ot(t) {
|
|
2202
2223
|
Ba().then((v) => {
|
2203
2224
|
u.current.src = v, t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, v);
|
2204
2225
|
});
|
2205
|
-
}, src: a.length > 0 ? a :
|
2226
|
+
}, src: a.length > 0 ? a : La })
|
2206
2227
|
] });
|
2207
2228
|
}
|
2208
2229
|
function Qt(t) {
|
@@ -2274,17 +2295,17 @@ function Ga(t, n) {
|
|
2274
2295
|
}
|
2275
2296
|
);
|
2276
2297
|
}
|
2277
|
-
const Va = Math.PI / 180,
|
2298
|
+
const Va = Math.PI / 180, Ha = 180 / Math.PI;
|
2278
2299
|
function Xe(t, n, a, e, r) {
|
2279
2300
|
return e + (t - n) * (r - e) / (a - n);
|
2280
2301
|
}
|
2281
|
-
function
|
2302
|
+
function za(t) {
|
2282
2303
|
return t * Va;
|
2283
2304
|
}
|
2284
2305
|
function At(t) {
|
2285
|
-
return t *
|
2306
|
+
return t * Ha;
|
2286
2307
|
}
|
2287
|
-
function
|
2308
|
+
function Ya(t, n) {
|
2288
2309
|
const a = new Un();
|
2289
2310
|
a.elements = t.matrix;
|
2290
2311
|
const e = new Y(), r = new Bn(), s = new Y();
|
@@ -2295,7 +2316,7 @@ function Wa(t, n) {
|
|
2295
2316
|
const v = (E = n.scene) == null ? void 0 : E.getObjectByProperty("uuid", t.uuid);
|
2296
2317
|
v !== void 0 && Q(v, d, p);
|
2297
2318
|
}, l = (d, p) => {
|
2298
|
-
u(d,
|
2319
|
+
u(d, za(p));
|
2299
2320
|
};
|
2300
2321
|
return /* @__PURE__ */ c.jsx(
|
2301
2322
|
Be,
|
@@ -2400,7 +2421,7 @@ function en(t) {
|
|
2400
2421
|
}
|
2401
2422
|
return t;
|
2402
2423
|
}
|
2403
|
-
function
|
2424
|
+
function Wa(t, n) {
|
2404
2425
|
const a = [];
|
2405
2426
|
if (t.lightInfo !== void 0)
|
2406
2427
|
for (const e in t.lightInfo) {
|
@@ -2503,8 +2524,8 @@ function Xa(t) {
|
|
2503
2524
|
function s() {
|
2504
2525
|
ae = { ...Cn }, a(Date.now());
|
2505
2526
|
}
|
2506
|
-
return
|
2507
|
-
|
2527
|
+
return _.addEventListener(j.SET_SCENE, s), _.addEventListener(j.SET_OBJECT, r), () => {
|
2528
|
+
_.removeEventListener(j.SET_SCENE, s), _.removeEventListener(j.SET_OBJECT, r);
|
2508
2529
|
};
|
2509
2530
|
}, []);
|
2510
2531
|
const e = ae.type.toLowerCase();
|
@@ -2557,10 +2578,10 @@ function Xa(t) {
|
|
2557
2578
|
)
|
2558
2579
|
] }),
|
2559
2580
|
/* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
2560
|
-
|
2581
|
+
Ya(ae, t.three),
|
2561
2582
|
ae.animations.length > 0 ? Ka(ae, t.three) : null,
|
2562
2583
|
e.search("camera") > -1 ? Ga(ae, t.three) : null,
|
2563
|
-
e.search("light") > -1 ?
|
2584
|
+
e.search("light") > -1 ? Wa(ae, t.three) : null,
|
2564
2585
|
e.search("mesh") > -1 ? $a(ae, t.three) : null
|
2565
2586
|
] })
|
2566
2587
|
] }) }, n) }, "Inspector");
|
@@ -2568,19 +2589,19 @@ function Xa(t) {
|
|
2568
2589
|
class mi extends ta {
|
2569
2590
|
constructor(a) {
|
2570
2591
|
super(a);
|
2571
|
-
|
2592
|
+
L(this, "three");
|
2572
2593
|
// Private
|
2573
|
-
|
2594
|
+
L(this, "setScene", (a) => {
|
2574
2595
|
this.setState(() => ({
|
2575
2596
|
scene: a.value
|
2576
2597
|
}));
|
2577
2598
|
});
|
2578
2599
|
this.state = {
|
2579
2600
|
scene: a.scene !== void 0 ? a.scene : null
|
2580
|
-
}, this.three = a.three,
|
2601
|
+
}, this.three = a.three, _.addEventListener(j.SET_SCENE, this.setScene);
|
2581
2602
|
}
|
2582
2603
|
componentWillUnmount() {
|
2583
|
-
|
2604
|
+
_.removeEventListener(j.SET_SCENE, this.setScene);
|
2584
2605
|
}
|
2585
2606
|
render() {
|
2586
2607
|
var r;
|
@@ -2635,14 +2656,14 @@ function gi(t) {
|
|
2635
2656
|
console.log("Error requesting method:"), console.log(C), console.log(d), console.log(v);
|
2636
2657
|
}
|
2637
2658
|
};
|
2638
|
-
return Fe(() => (
|
2639
|
-
|
2659
|
+
return Fe(() => (_.addEventListener(j.GET_OBJECT, a), _.addEventListener(j.UPDATE_OBJECT, r), _.addEventListener(j.CREATE_TEXTURE, s), _.addEventListener(j.REQUEST_METHOD, u), () => {
|
2660
|
+
_.removeEventListener(j.GET_OBJECT, a), _.removeEventListener(j.UPDATE_OBJECT, r), _.removeEventListener(j.CREATE_TEXTURE, s), _.removeEventListener(j.REQUEST_METHOD, u);
|
2640
2661
|
}), []), null;
|
2641
2662
|
}
|
2642
2663
|
const tn = { type: "change" }, It = { type: "start" }, nn = { type: "end" }, wt = new $n(), an = new Gn(), qa = Math.cos(70 * Vn.DEG2RAD);
|
2643
2664
|
class Za extends cn {
|
2644
2665
|
constructor(n, a) {
|
2645
|
-
super(), this.object = n, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new Y(), this.cursor = new Y(), 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:
|
2666
|
+
super(), this.object = n, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new Y(), this.cursor = new Y(), 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: We.ROTATE, MIDDLE: We.DOLLY, RIGHT: We.PAN }, this.touches = { ONE: Ke.ROTATE, TWO: Ke.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
|
2646
2667
|
return l.phi;
|
2647
2668
|
}, this.getAzimuthalAngle = function() {
|
2648
2669
|
return l.theta;
|
@@ -2657,31 +2678,31 @@ class Za extends cn {
|
|
2657
2678
|
}, this.reset = function() {
|
2658
2679
|
e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(tn), e.update(), s = r.NONE;
|
2659
2680
|
}, this.update = function() {
|
2660
|
-
const o = new Y(), y = new
|
2681
|
+
const o = new Y(), y = new Wt().setFromUnitVectors(n.up, new Y(0, 1, 0)), D = y.clone().invert(), N = new Y(), te = new Wt(), be = new Y(), ue = 2 * Math.PI;
|
2661
2682
|
return function(Et = null) {
|
2662
2683
|
const ye = e.object.position;
|
2663
|
-
o.copy(ye).sub(e.target), o.applyQuaternion(y), l.setFromVector3(o), e.autoRotate && s === r.NONE &&
|
2684
|
+
o.copy(ye).sub(e.target), o.applyQuaternion(y), l.setFromVector3(o), e.autoRotate && s === r.NONE && $(b(Et)), e.enableDamping ? (l.theta += d.theta * e.dampingFactor, l.phi += d.phi * e.dampingFactor) : (l.theta += d.theta, l.phi += d.phi);
|
2664
2685
|
let he = e.minAzimuthAngle, pe = e.maxAzimuthAngle;
|
2665
2686
|
isFinite(he) && isFinite(pe) && (he < -Math.PI ? he += ue : he > Math.PI && (he -= ue), pe < -Math.PI ? pe += ue : pe > Math.PI && (pe -= ue), he <= pe ? l.theta = Math.max(he, Math.min(pe, l.theta)) : l.theta = l.theta > (he + pe) / 2 ? Math.max(he, l.theta) : Math.min(pe, l.theta)), l.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, l.phi)), l.makeSafe(), e.enableDamping === !0 ? e.target.addScaledVector(v, e.dampingFactor) : e.target.add(v), e.target.sub(e.cursor), e.target.clampLength(e.minTargetRadius, e.maxTargetRadius), e.target.add(e.cursor), e.zoomToCursor && ee || e.object.isOrthographicCamera ? l.radius = q(l.radius) : l.radius = q(l.radius * p), o.setFromSpherical(l), o.applyQuaternion(D), ye.copy(e.target).add(o), e.object.lookAt(e.target), e.enableDamping === !0 ? (d.theta *= 1 - e.dampingFactor, d.phi *= 1 - e.dampingFactor, v.multiplyScalar(1 - e.dampingFactor)) : (d.set(0, 0, 0), v.set(0, 0, 0));
|
2666
|
-
let
|
2687
|
+
let He = !1;
|
2667
2688
|
if (e.zoomToCursor && ee) {
|
2668
2689
|
let De = null;
|
2669
2690
|
if (e.object.isPerspectiveCamera) {
|
2670
2691
|
const Te = o.length();
|
2671
2692
|
De = q(Te * p);
|
2672
|
-
const
|
2673
|
-
e.object.position.addScaledVector(fe,
|
2693
|
+
const ze = Te - De;
|
2694
|
+
e.object.position.addScaledVector(fe, ze), e.object.updateMatrixWorld();
|
2674
2695
|
} else if (e.object.isOrthographicCamera) {
|
2675
2696
|
const Te = new Y(le.x, le.y, 0);
|
2676
|
-
Te.unproject(e.object), e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / p)), e.object.updateProjectionMatrix(),
|
2677
|
-
const
|
2678
|
-
|
2697
|
+
Te.unproject(e.object), e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / p)), e.object.updateProjectionMatrix(), He = !0;
|
2698
|
+
const ze = new Y(le.x, le.y, 0);
|
2699
|
+
ze.unproject(e.object), e.object.position.sub(ze).add(Te), e.object.updateMatrixWorld(), De = o.length();
|
2679
2700
|
} else
|
2680
2701
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), e.zoomToCursor = !1;
|
2681
2702
|
De !== null && (this.screenSpacePanning ? e.target.set(0, 0, -1).transformDirection(e.object.matrix).multiplyScalar(De).add(e.object.position) : (wt.origin.copy(e.object.position), wt.direction.set(0, 0, -1).transformDirection(e.object.matrix), Math.abs(e.object.up.dot(wt.direction)) < qa ? n.lookAt(e.target) : (an.setFromNormalAndCoplanarPoint(e.object.up, e.target), wt.intersectPlane(an, e.target))));
|
2682
2703
|
} else
|
2683
|
-
e.object.isOrthographicCamera && (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / p)), e.object.updateProjectionMatrix(),
|
2684
|
-
return p = 1, ee = !1,
|
2704
|
+
e.object.isOrthographicCamera && (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / p)), e.object.updateProjectionMatrix(), He = !0);
|
2705
|
+
return p = 1, ee = !1, He || N.distanceToSquared(e.object.position) > u || 8 * (1 - te.dot(e.object.quaternion)) > u || be.distanceToSquared(e.target) > 0 ? (e.dispatchEvent(tn), N.copy(e.object.position), te.copy(e.object.quaternion), be.copy(e.target), !0) : !1;
|
2685
2706
|
};
|
2686
2707
|
}(), this.dispose = function() {
|
2687
2708
|
e.domElement.removeEventListener("contextmenu", Oe), e.domElement.removeEventListener("pointerdown", et), e.domElement.removeEventListener("pointercancel", ke), e.domElement.removeEventListener("wheel", mt), e.domElement.removeEventListener("pointermove", Se), e.domElement.removeEventListener("pointerup", ke), e._domElementKeyEvents !== null && (e._domElementKeyEvents.removeEventListener("keydown", nt), e._domElementKeyEvents = null);
|
@@ -2699,7 +2720,7 @@ class Za extends cn {
|
|
2699
2720
|
let s = r.NONE;
|
2700
2721
|
const u = 1e-6, l = new Kt(), d = new Kt();
|
2701
2722
|
let p = 1;
|
2702
|
-
const v = new Y(), E = new de(), x = new de(), C = new de(), M = new de(),
|
2723
|
+
const v = new Y(), E = new de(), x = new de(), C = new de(), M = new de(), V = new de(), se = new de(), K = new de(), S = new de(), X = new de(), fe = new Y(), le = new de();
|
2703
2724
|
let ee = !1;
|
2704
2725
|
const f = [], m = {};
|
2705
2726
|
function b(o) {
|
@@ -2709,13 +2730,13 @@ class Za extends cn {
|
|
2709
2730
|
const y = Math.abs(o) / (100 * (window.devicePixelRatio | 0));
|
2710
2731
|
return Math.pow(0.95, e.zoomSpeed * y);
|
2711
2732
|
}
|
2712
|
-
function
|
2733
|
+
function $(o) {
|
2713
2734
|
d.theta -= o;
|
2714
2735
|
}
|
2715
|
-
function
|
2736
|
+
function G(o) {
|
2716
2737
|
d.phi -= o;
|
2717
2738
|
}
|
2718
|
-
const
|
2739
|
+
const U = function() {
|
2719
2740
|
const o = new Y();
|
2720
2741
|
return function(D, N) {
|
2721
2742
|
o.setFromMatrixColumn(N, 0), o.multiplyScalar(-D), v.add(o);
|
@@ -2725,7 +2746,7 @@ class Za extends cn {
|
|
2725
2746
|
return function(D, N) {
|
2726
2747
|
e.screenSpacePanning === !0 ? o.setFromMatrixColumn(N, 1) : (o.setFromMatrixColumn(N, 0), o.crossVectors(e.object.up, o)), o.multiplyScalar(D), v.add(o);
|
2727
2748
|
};
|
2728
|
-
}(),
|
2749
|
+
}(), B = function() {
|
2729
2750
|
const o = new Y();
|
2730
2751
|
return function(D, N) {
|
2731
2752
|
const te = e.domElement;
|
@@ -2733,9 +2754,9 @@ class Za extends cn {
|
|
2733
2754
|
const be = e.object.position;
|
2734
2755
|
o.copy(be).sub(e.target);
|
2735
2756
|
let ue = o.length();
|
2736
|
-
ue *= Math.tan(e.object.fov / 2 * Math.PI / 180),
|
2757
|
+
ue *= Math.tan(e.object.fov / 2 * Math.PI / 180), U(2 * D * ue / te.clientHeight, e.object.matrix), A(2 * N * ue / te.clientHeight, e.object.matrix);
|
2737
2758
|
} else
|
2738
|
-
e.object.isOrthographicCamera ? (
|
2759
|
+
e.object.isOrthographicCamera ? (U(D * (e.object.right - e.object.left) / e.object.zoom / te.clientWidth, e.object.matrix), A(N * (e.object.top - e.object.bottom) / e.object.zoom / te.clientHeight, e.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), e.enablePan = !1);
|
2739
2760
|
};
|
2740
2761
|
}();
|
2741
2762
|
function J(o) {
|
@@ -2766,13 +2787,13 @@ class Za extends cn {
|
|
2766
2787
|
function ut(o) {
|
2767
2788
|
x.set(o.clientX, o.clientY), C.subVectors(x, E).multiplyScalar(e.rotateSpeed);
|
2768
2789
|
const y = e.domElement;
|
2769
|
-
|
2790
|
+
$(2 * Math.PI * C.x / y.clientHeight), G(2 * Math.PI * C.y / y.clientHeight), E.copy(x), e.update();
|
2770
2791
|
}
|
2771
2792
|
function Mt(o) {
|
2772
2793
|
S.set(o.clientX, o.clientY), X.subVectors(S, K), X.y > 0 ? J(O(X.y)) : X.y < 0 && R(O(X.y)), K.copy(S), e.update();
|
2773
2794
|
}
|
2774
2795
|
function Rt(o) {
|
2775
|
-
|
2796
|
+
V.set(o.clientX, o.clientY), se.subVectors(V, M).multiplyScalar(e.panSpeed), B(se.x, se.y), M.copy(V), e.update();
|
2776
2797
|
}
|
2777
2798
|
function Je(o) {
|
2778
2799
|
I(o.clientX, o.clientY), o.deltaY < 0 ? R(O(o.deltaY)) : o.deltaY > 0 && J(O(o.deltaY)), e.update();
|
@@ -2781,16 +2802,16 @@ class Za extends cn {
|
|
2781
2802
|
let y = !1;
|
2782
2803
|
switch (o.code) {
|
2783
2804
|
case e.keys.UP:
|
2784
|
-
o.ctrlKey || o.metaKey || o.shiftKey ?
|
2805
|
+
o.ctrlKey || o.metaKey || o.shiftKey ? G(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : B(0, e.keyPanSpeed), y = !0;
|
2785
2806
|
break;
|
2786
2807
|
case e.keys.BOTTOM:
|
2787
|
-
o.ctrlKey || o.metaKey || o.shiftKey ?
|
2808
|
+
o.ctrlKey || o.metaKey || o.shiftKey ? G(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : B(0, -e.keyPanSpeed), y = !0;
|
2788
2809
|
break;
|
2789
2810
|
case e.keys.LEFT:
|
2790
|
-
o.ctrlKey || o.metaKey || o.shiftKey ?
|
2811
|
+
o.ctrlKey || o.metaKey || o.shiftKey ? $(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : B(e.keyPanSpeed, 0), y = !0;
|
2791
2812
|
break;
|
2792
2813
|
case e.keys.RIGHT:
|
2793
|
-
o.ctrlKey || o.metaKey || o.shiftKey ?
|
2814
|
+
o.ctrlKey || o.metaKey || o.shiftKey ? $(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : B(-e.keyPanSpeed, 0), y = !0;
|
2794
2815
|
break;
|
2795
2816
|
}
|
2796
2817
|
y && (o.preventDefault(), e.update());
|
@@ -2811,15 +2832,15 @@ class Za extends cn {
|
|
2811
2832
|
M.set(D, N);
|
2812
2833
|
}
|
2813
2834
|
}
|
2814
|
-
function
|
2835
|
+
function _e(o) {
|
2815
2836
|
const y = ve(o), D = o.pageX - y.x, N = o.pageY - y.y, te = Math.sqrt(D * D + N * N);
|
2816
2837
|
K.set(0, te);
|
2817
2838
|
}
|
2818
2839
|
function Pt(o) {
|
2819
|
-
e.enableZoom &&
|
2840
|
+
e.enableZoom && _e(o), e.enablePan && Ge(o);
|
2820
2841
|
}
|
2821
2842
|
function dt(o) {
|
2822
|
-
e.enableZoom &&
|
2843
|
+
e.enableZoom && _e(o), e.enableRotate && Pe(o);
|
2823
2844
|
}
|
2824
2845
|
function ft(o) {
|
2825
2846
|
if (f.length == 1)
|
@@ -2830,31 +2851,31 @@ class Za extends cn {
|
|
2830
2851
|
}
|
2831
2852
|
C.subVectors(x, E).multiplyScalar(e.rotateSpeed);
|
2832
2853
|
const y = e.domElement;
|
2833
|
-
|
2854
|
+
$(2 * Math.PI * C.x / y.clientHeight), G(2 * Math.PI * C.y / y.clientHeight), E.copy(x);
|
2834
2855
|
}
|
2835
2856
|
function ht(o) {
|
2836
2857
|
if (f.length === 1)
|
2837
|
-
|
2858
|
+
V.set(o.pageX, o.pageY);
|
2838
2859
|
else {
|
2839
2860
|
const y = ve(o), D = 0.5 * (o.pageX + y.x), N = 0.5 * (o.pageY + y.y);
|
2840
|
-
|
2861
|
+
V.set(D, N);
|
2841
2862
|
}
|
2842
|
-
se.subVectors(
|
2863
|
+
se.subVectors(V, M).multiplyScalar(e.panSpeed), B(se.x, se.y), M.copy(V);
|
2843
2864
|
}
|
2844
|
-
function
|
2865
|
+
function je(o) {
|
2845
2866
|
const y = ve(o), D = o.pageX - y.x, N = o.pageY - y.y, te = Math.sqrt(D * D + N * N);
|
2846
2867
|
S.set(0, te), X.set(0, Math.pow(S.y / K.y, e.zoomSpeed)), J(X.y), K.copy(S);
|
2847
2868
|
const be = (o.pageX + y.x) * 0.5, ue = (o.pageY + y.y) * 0.5;
|
2848
2869
|
I(be, ue);
|
2849
2870
|
}
|
2850
2871
|
function Ve(o) {
|
2851
|
-
e.enableZoom &&
|
2872
|
+
e.enableZoom && je(o), e.enablePan && ht(o);
|
2852
2873
|
}
|
2853
2874
|
function pt(o) {
|
2854
|
-
e.enableZoom &&
|
2875
|
+
e.enableZoom && je(o), e.enableRotate && ft(o);
|
2855
2876
|
}
|
2856
2877
|
function et(o) {
|
2857
|
-
e.enabled !== !1 && (f.length === 0 && (e.domElement.setPointerCapture(o.pointerId), e.domElement.addEventListener("pointermove", Se), e.domElement.addEventListener("pointerup", ke)),
|
2878
|
+
e.enabled !== !1 && (f.length === 0 && (e.domElement.setPointerCapture(o.pointerId), e.domElement.addEventListener("pointermove", Se), e.domElement.addEventListener("pointerup", ke)), jt(o), o.pointerType === "touch" ? gt(o) : _t(o));
|
2858
2879
|
}
|
2859
2880
|
function Se(o) {
|
2860
2881
|
e.enabled !== !1 && (o.pointerType === "touch" ? vt(o) : tt(o));
|
@@ -2862,7 +2883,7 @@ class Za extends cn {
|
|
2862
2883
|
function ke(o) {
|
2863
2884
|
bt(o), f.length === 0 && (e.domElement.releasePointerCapture(o.pointerId), e.domElement.removeEventListener("pointermove", Se), e.domElement.removeEventListener("pointerup", ke)), e.dispatchEvent(nn), s = r.NONE;
|
2864
2885
|
}
|
2865
|
-
function
|
2886
|
+
function _t(o) {
|
2866
2887
|
let y;
|
2867
2888
|
switch (o.button) {
|
2868
2889
|
case 0:
|
@@ -2878,12 +2899,12 @@ class Za extends cn {
|
|
2878
2899
|
y = -1;
|
2879
2900
|
}
|
2880
2901
|
switch (y) {
|
2881
|
-
case
|
2902
|
+
case We.DOLLY:
|
2882
2903
|
if (e.enableZoom === !1)
|
2883
2904
|
return;
|
2884
2905
|
Re(o), s = r.DOLLY;
|
2885
2906
|
break;
|
2886
|
-
case
|
2907
|
+
case We.ROTATE:
|
2887
2908
|
if (o.ctrlKey || o.metaKey || o.shiftKey) {
|
2888
2909
|
if (e.enablePan === !1)
|
2889
2910
|
return;
|
@@ -2894,7 +2915,7 @@ class Za extends cn {
|
|
2894
2915
|
me(o), s = r.ROTATE;
|
2895
2916
|
}
|
2896
2917
|
break;
|
2897
|
-
case
|
2918
|
+
case We.PAN:
|
2898
2919
|
if (o.ctrlKey || o.metaKey || o.shiftKey) {
|
2899
2920
|
if (e.enableRotate === !1)
|
2900
2921
|
return;
|
@@ -3003,7 +3024,7 @@ class Za extends cn {
|
|
3003
3024
|
function Oe(o) {
|
3004
3025
|
e.enabled !== !1 && o.preventDefault();
|
3005
3026
|
}
|
3006
|
-
function
|
3027
|
+
function jt(o) {
|
3007
3028
|
f.push(o.pointerId);
|
3008
3029
|
}
|
3009
3030
|
function bt(o) {
|
@@ -3072,7 +3093,7 @@ $e("Right", new Y(1e3, 0, 0));
|
|
3072
3093
|
$e("Front", new Y(0, 0, 1e3));
|
3073
3094
|
$e("Back", new Y(0, 0, -1e3));
|
3074
3095
|
$e("Orthographic", new Y(1e3, 1e3, 1e3));
|
3075
|
-
const Tt = new
|
3096
|
+
const Tt = new Lt(60, 1, 50, 3e3);
|
3076
3097
|
Tt.name = "Debug";
|
3077
3098
|
Tt.position.set(500, 500, 500);
|
3078
3099
|
Tt.lookAt(0, 0, 0);
|
@@ -3083,7 +3104,7 @@ const on = [
|
|
3083
3104
|
"Normals",
|
3084
3105
|
"UVs",
|
3085
3106
|
"Wireframe"
|
3086
|
-
], Ja = new
|
3107
|
+
], Ja = new Hn(), Qa = new zn(), ei = new Aa(), ti = new Yn({
|
3087
3108
|
opacity: 0.33,
|
3088
3109
|
transparent: !0,
|
3089
3110
|
wireframe: !0
|
@@ -3093,10 +3114,10 @@ const z = new fn();
|
|
3093
3114
|
z.name = "Debug Scene";
|
3094
3115
|
let xe = new fn();
|
3095
3116
|
z.add(xe);
|
3096
|
-
const lt = new
|
3117
|
+
const lt = new Wn();
|
3097
3118
|
lt.name = "helpers";
|
3098
3119
|
z.add(lt);
|
3099
|
-
const ni = new
|
3120
|
+
const ni = new ja();
|
3100
3121
|
lt.add(ni);
|
3101
3122
|
const Sn = new hn(500);
|
3102
3123
|
Sn.name = "axisHelper";
|
@@ -3105,27 +3126,27 @@ const ct = new hn(100);
|
|
3105
3126
|
ct.name = "interactionHelper";
|
3106
3127
|
lt.add(ct);
|
3107
3128
|
ct.visible = !1;
|
3108
|
-
let Ct = !1,
|
3129
|
+
let Ct = !1, H = ne.get("Debug"), re = ne.get("Orthographic"), Le = ne.get("Front"), Ne = ne.get("Top"), sn = !1;
|
3109
3130
|
function vi(t) {
|
3110
|
-
const [n, a] = oe(t.mode !== void 0 ? t.mode : "Single"), [e, r] = oe(null), [s, u] = oe(!1), [l, d] = oe(!1), [p, v] = oe(!1), [, E] = oe(Date.now()), x = Ce(null), C = Ce(null), M = Ce(null),
|
3131
|
+
const [n, a] = oe(t.mode !== void 0 ? t.mode : "Single"), [e, r] = oe(null), [s, u] = oe(!1), [l, d] = oe(!1), [p, v] = oe(!1), [, E] = oe(Date.now()), x = Ce(null), C = Ce(null), M = Ce(null), V = Ce(null), se = Ce(null), K = Ce(null), S = (f, m) => {
|
3111
3132
|
const b = ie.get(f.name);
|
3112
3133
|
b !== void 0 && b.dispose(), ie.delete(f.name);
|
3113
3134
|
const O = we.get(f.name);
|
3114
3135
|
O !== void 0 && (z.remove(O), O.dispose()), we.delete(f.name);
|
3115
|
-
const
|
3116
|
-
switch (
|
3136
|
+
const $ = new Za(f, m);
|
3137
|
+
switch ($.enableDamping = !0, $.dampingFactor = 0.05, f.name) {
|
3117
3138
|
case "Top":
|
3118
3139
|
case "Bottom":
|
3119
3140
|
case "Left":
|
3120
3141
|
case "Right":
|
3121
3142
|
case "Front":
|
3122
3143
|
case "Back":
|
3123
|
-
|
3144
|
+
$.enableRotate = !1;
|
3124
3145
|
break;
|
3125
3146
|
}
|
3126
|
-
if (ie.set(f.name,
|
3127
|
-
const
|
3128
|
-
we.set(f.name,
|
3147
|
+
if (ie.set(f.name, $), f instanceof Lt) {
|
3148
|
+
const G = new qn(f);
|
3149
|
+
we.set(f.name, G), z.add(G);
|
3129
3150
|
}
|
3130
3151
|
}, X = (f) => {
|
3131
3152
|
const m = we.get(f.name);
|
@@ -3141,14 +3162,14 @@ function vi(t) {
|
|
3141
3162
|
}, le = () => {
|
3142
3163
|
switch (n) {
|
3143
3164
|
case "Single":
|
3144
|
-
S(
|
3165
|
+
S(H, M.current);
|
3145
3166
|
break;
|
3146
3167
|
case "Side by Side":
|
3147
3168
|
case "Stacked":
|
3148
|
-
S(
|
3169
|
+
S(H, M.current), S(re, V.current);
|
3149
3170
|
break;
|
3150
3171
|
case "Quad":
|
3151
|
-
S(
|
3172
|
+
S(H, M.current), S(re, V.current), S(Le, se.current), S(Ne, K.current);
|
3152
3173
|
break;
|
3153
3174
|
}
|
3154
3175
|
};
|
@@ -3161,26 +3182,26 @@ function vi(t) {
|
|
3161
3182
|
}, []), Fe(() => {
|
3162
3183
|
const f = (O) => {
|
3163
3184
|
vn(xe), z.remove(xe);
|
3164
|
-
const
|
3165
|
-
if (
|
3166
|
-
const
|
3167
|
-
t.onSceneSet !== void 0 && t.onSceneSet(
|
3185
|
+
const $ = t.scenes.get(O.value.name);
|
3186
|
+
if ($ !== void 0) {
|
3187
|
+
const G = new $();
|
3188
|
+
t.onSceneSet !== void 0 && t.onSceneSet(G), xe = G, t.three.scene = xe, z.add(xe), sn = !0;
|
3168
3189
|
}
|
3169
3190
|
}, m = (O) => {
|
3170
|
-
var
|
3171
|
-
const
|
3172
|
-
|
3191
|
+
var U;
|
3192
|
+
const $ = O.value, G = (U = t.three.scene) == null ? void 0 : U.getObjectByProperty("uuid", $.uuid);
|
3193
|
+
G !== void 0 && ne.set($.name, G), E(Date.now());
|
3173
3194
|
}, b = (O) => {
|
3174
3195
|
ne.delete(O.value.name), E(Date.now());
|
3175
3196
|
};
|
3176
|
-
return
|
3177
|
-
|
3197
|
+
return _.addEventListener(j.SET_SCENE, f), _.addEventListener(j.ADD_CAMERA, m), _.addEventListener(j.REMOVE_CAMERA, b), () => {
|
3198
|
+
_.removeEventListener(j.SET_SCENE, f), _.removeEventListener(j.ADD_CAMERA, m), _.removeEventListener(j.REMOVE_CAMERA, b);
|
3178
3199
|
};
|
3179
3200
|
}, []), Fe(() => {
|
3180
3201
|
if (e === null)
|
3181
3202
|
return;
|
3182
|
-
let f = window.innerWidth, m = window.innerHeight, b = Math.floor(f / 2), O = Math.floor(m / 2),
|
3183
|
-
const
|
3203
|
+
let f = window.innerWidth, m = window.innerHeight, b = Math.floor(f / 2), O = Math.floor(m / 2), $ = -1;
|
3204
|
+
const G = () => {
|
3184
3205
|
f = window.innerWidth - 300, m = window.innerHeight, b = Math.floor(f / 2), O = Math.floor(m / 2), e.setSize(f, m);
|
3185
3206
|
let R = f, I = m;
|
3186
3207
|
switch (n) {
|
@@ -3196,66 +3217,66 @@ function vi(t) {
|
|
3196
3217
|
}
|
3197
3218
|
ne.forEach((q) => {
|
3198
3219
|
var me;
|
3199
|
-
q instanceof dn ? (q.left = R / -2, q.right = R / 2, q.top = I / 2, q.bottom = I / -2, q.updateProjectionMatrix()) : q instanceof
|
3220
|
+
q instanceof dn ? (q.left = R / -2, q.right = R / 2, q.top = I / 2, q.bottom = I / -2, q.updateProjectionMatrix()) : q instanceof Lt && (q.aspect = R / I, q.updateProjectionMatrix(), (me = we.get(q.name)) == null || me.update());
|
3200
3221
|
});
|
3201
|
-
},
|
3202
|
-
e.setViewport(0, 0, f, m), e.setScissor(0, 0, f, m), e.render(z,
|
3222
|
+
}, U = () => {
|
3223
|
+
e.setViewport(0, 0, f, m), e.setScissor(0, 0, f, m), e.render(z, H);
|
3203
3224
|
}, A = () => {
|
3204
3225
|
if (n === "Side by Side")
|
3205
|
-
e.setViewport(0, 0, b, m), e.setScissor(0, 0, b, m), e.render(z,
|
3226
|
+
e.setViewport(0, 0, b, m), e.setScissor(0, 0, b, m), e.render(z, H), e.setViewport(b, 0, b, m), e.setScissor(b, 0, b, m), e.render(z, re);
|
3206
3227
|
else {
|
3207
3228
|
const R = m - O;
|
3208
|
-
e.setViewport(0, R, f, O), e.setScissor(0, R, f, O), e.render(z,
|
3229
|
+
e.setViewport(0, R, f, O), e.setScissor(0, R, f, O), e.render(z, H), e.setViewport(0, 0, f, O), e.setScissor(0, 0, f, O), e.render(z, re);
|
3209
3230
|
}
|
3210
|
-
},
|
3231
|
+
}, B = () => {
|
3211
3232
|
let R = 0, I = 0;
|
3212
|
-
I = m - O, R = 0, e.setViewport(R, I, b, O), e.setScissor(R, I, b, O), e.render(z,
|
3233
|
+
I = m - O, R = 0, e.setViewport(R, I, b, O), e.setScissor(R, I, b, O), e.render(z, H), R = b, e.setViewport(R, I, b, O), e.setScissor(R, I, b, O), e.render(z, re), I = 0, R = 0, e.setViewport(R, I, b, O), e.setScissor(R, I, b, O), e.render(z, Le), R = b, e.setViewport(R, I, b, O), e.setScissor(R, I, b, O), e.render(z, Ne);
|
3213
3234
|
}, J = () => {
|
3214
3235
|
switch (ie.forEach((R) => {
|
3215
3236
|
R.update();
|
3216
3237
|
}), t.onSceneUpdate !== void 0 && sn && t.onSceneUpdate(xe), e.clear(), n) {
|
3217
3238
|
case "Single":
|
3218
|
-
|
3239
|
+
U();
|
3219
3240
|
break;
|
3220
3241
|
case "Side by Side":
|
3221
3242
|
case "Stacked":
|
3222
3243
|
A();
|
3223
3244
|
break;
|
3224
3245
|
case "Quad":
|
3225
|
-
|
3246
|
+
B();
|
3226
3247
|
break;
|
3227
3248
|
}
|
3228
|
-
|
3249
|
+
$ = requestAnimationFrame(J);
|
3229
3250
|
};
|
3230
|
-
return le(), window.addEventListener("resize",
|
3231
|
-
window.removeEventListener("resize",
|
3251
|
+
return le(), window.addEventListener("resize", G), G(), J(), () => {
|
3252
|
+
window.removeEventListener("resize", G), cancelAnimationFrame($), $ = -1;
|
3232
3253
|
};
|
3233
3254
|
}, [n, e]), Fe(() => {
|
3234
3255
|
if (e !== null) {
|
3235
|
-
const f = new Xn(), m = new de(), b = (
|
3256
|
+
const f = new Xn(), m = new de(), b = (U, A, B, J) => {
|
3236
3257
|
switch (n) {
|
3237
3258
|
case "Quad":
|
3238
|
-
|
3259
|
+
U < B ? A < J ? f.setFromCamera(m, H) : f.setFromCamera(m, Le) : A < J ? f.setFromCamera(m, re) : f.setFromCamera(m, Ne);
|
3239
3260
|
break;
|
3240
3261
|
case "Side by Side":
|
3241
|
-
|
3262
|
+
U < B ? f.setFromCamera(m, H) : f.setFromCamera(m, re);
|
3242
3263
|
break;
|
3243
3264
|
case "Single":
|
3244
|
-
f.setFromCamera(m,
|
3265
|
+
f.setFromCamera(m, H);
|
3245
3266
|
break;
|
3246
3267
|
case "Stacked":
|
3247
|
-
A < J ? f.setFromCamera(m,
|
3268
|
+
A < J ? f.setFromCamera(m, H) : f.setFromCamera(m, re);
|
3248
3269
|
break;
|
3249
3270
|
}
|
3250
|
-
}, O = (
|
3271
|
+
}, O = (U) => {
|
3251
3272
|
if (!Ct)
|
3252
3273
|
return;
|
3253
3274
|
const A = new de();
|
3254
3275
|
e.getSize(A);
|
3255
|
-
const
|
3256
|
-
m.x = Xe(
|
3276
|
+
const B = Math.min(U.clientX, A.x), J = Math.min(U.clientY, A.y);
|
3277
|
+
m.x = Xe(B, 0, A.x, -1, 1), m.y = Xe(J, 0, A.y, 1, -1);
|
3257
3278
|
const R = A.x / 2, I = A.y / 2, q = () => {
|
3258
|
-
|
3279
|
+
B < R ? m.x = Xe(B, 0, R, -1, 1) : m.x = Xe(B, R, A.x, -1, 1);
|
3259
3280
|
}, me = () => {
|
3260
3281
|
J < I ? m.y = Xe(J, 0, I, 1, -1) : m.y = Xe(J, I, A.y, 1, -1);
|
3261
3282
|
};
|
@@ -3270,21 +3291,21 @@ function vi(t) {
|
|
3270
3291
|
me(), me();
|
3271
3292
|
break;
|
3272
3293
|
}
|
3273
|
-
b(
|
3294
|
+
b(B, J, R, I);
|
3274
3295
|
const Re = f.intersectObjects(xe.children);
|
3275
3296
|
Re.length > 0 && ct.position.copy(Re[0].point);
|
3276
|
-
},
|
3297
|
+
}, $ = (U) => {
|
3277
3298
|
if (!Ct)
|
3278
3299
|
return;
|
3279
3300
|
const A = new de();
|
3280
|
-
if (e.getSize(A),
|
3301
|
+
if (e.getSize(A), U.clientX >= A.x)
|
3281
3302
|
return;
|
3282
|
-
O(
|
3283
|
-
const
|
3284
|
-
|
3285
|
-
},
|
3286
|
-
return
|
3287
|
-
|
3303
|
+
O(U);
|
3304
|
+
const B = f.intersectObjects(xe.children);
|
3305
|
+
B.length > 0 && t.three.getObject(B[0].object.uuid);
|
3306
|
+
}, G = C.current;
|
3307
|
+
return G.addEventListener("mousemove", O, !1), G.addEventListener("click", $, !1), () => {
|
3308
|
+
G.removeEventListener("mousemove", O), G.removeEventListener("click", $);
|
3288
3309
|
};
|
3289
3310
|
}
|
3290
3311
|
}, [n, e]);
|
@@ -3294,50 +3315,50 @@ function vi(t) {
|
|
3294
3315
|
}), /* @__PURE__ */ c.jsxs("div", { className: "multiview", children: [
|
3295
3316
|
/* @__PURE__ */ c.jsx("canvas", { ref: x }),
|
3296
3317
|
/* @__PURE__ */ c.jsxs("div", { className: `cameras ${n === "Single" || n === "Stacked" ? "single" : ""}`, ref: C, children: [
|
3297
|
-
n === "Single" && /* @__PURE__ */ c.jsx(c.Fragment, { children: /* @__PURE__ */ c.jsx(Ie, { camera:
|
3318
|
+
n === "Single" && /* @__PURE__ */ c.jsx(c.Fragment, { children: /* @__PURE__ */ c.jsx(Ie, { camera: H, options: ee, ref: M, onSelect: (f) => {
|
3298
3319
|
var b;
|
3299
|
-
(b = ie.get(
|
3320
|
+
(b = ie.get(H.name)) == null || b.dispose();
|
3300
3321
|
const m = ne.get(f);
|
3301
|
-
m !== void 0 && (X(
|
3322
|
+
m !== void 0 && (X(H), H = m, S(m, M.current));
|
3302
3323
|
} }) }),
|
3303
3324
|
(n === "Side by Side" || n === "Stacked") && /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
3304
|
-
/* @__PURE__ */ c.jsx(Ie, { camera:
|
3325
|
+
/* @__PURE__ */ c.jsx(Ie, { camera: H, options: ee, ref: M, onSelect: (f) => {
|
3305
3326
|
var b;
|
3306
|
-
(b = ie.get(
|
3327
|
+
(b = ie.get(H.name)) == null || b.dispose();
|
3307
3328
|
const m = ne.get(f);
|
3308
|
-
m !== void 0 && (X(
|
3329
|
+
m !== void 0 && (X(H), H = m, S(m, M.current));
|
3309
3330
|
} }),
|
3310
|
-
/* @__PURE__ */ c.jsx(Ie, { camera: re, options: ee, ref:
|
3331
|
+
/* @__PURE__ */ c.jsx(Ie, { camera: re, options: ee, ref: V, onSelect: (f) => {
|
3311
3332
|
var b;
|
3312
3333
|
(b = ie.get(re.name)) == null || b.dispose();
|
3313
3334
|
const m = ne.get(f);
|
3314
|
-
m !== void 0 && (X(re), re = m, S(m,
|
3335
|
+
m !== void 0 && (X(re), re = m, S(m, V.current));
|
3315
3336
|
} })
|
3316
3337
|
] }),
|
3317
3338
|
n === "Quad" && /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
3318
|
-
/* @__PURE__ */ c.jsx(Ie, { camera:
|
3339
|
+
/* @__PURE__ */ c.jsx(Ie, { camera: H, options: ee, ref: M, onSelect: (f) => {
|
3319
3340
|
var b;
|
3320
|
-
(b = ie.get(
|
3341
|
+
(b = ie.get(H.name)) == null || b.dispose();
|
3321
3342
|
const m = ne.get(f);
|
3322
|
-
m !== void 0 && (X(
|
3343
|
+
m !== void 0 && (X(H), H = m, S(m, M.current));
|
3323
3344
|
} }),
|
3324
|
-
/* @__PURE__ */ c.jsx(Ie, { camera: re, options: ee, ref:
|
3345
|
+
/* @__PURE__ */ c.jsx(Ie, { camera: re, options: ee, ref: V, onSelect: (f) => {
|
3325
3346
|
var b;
|
3326
3347
|
(b = ie.get(re.name)) == null || b.dispose();
|
3327
3348
|
const m = ne.get(f);
|
3328
|
-
m !== void 0 && (X(re), re = m, S(m,
|
3349
|
+
m !== void 0 && (X(re), re = m, S(m, V.current));
|
3329
3350
|
} }),
|
3330
|
-
/* @__PURE__ */ c.jsx(Ie, { camera:
|
3351
|
+
/* @__PURE__ */ c.jsx(Ie, { camera: Le, options: ee, ref: se, onSelect: (f) => {
|
3331
3352
|
var b;
|
3332
|
-
(b = ie.get(
|
3353
|
+
(b = ie.get(Le.name)) == null || b.dispose();
|
3333
3354
|
const m = ne.get(f);
|
3334
|
-
m !== void 0 && (X(
|
3355
|
+
m !== void 0 && (X(Le), Le = m, S(m, se.current));
|
3335
3356
|
} }),
|
3336
|
-
/* @__PURE__ */ c.jsx(Ie, { camera:
|
3357
|
+
/* @__PURE__ */ c.jsx(Ie, { camera: Ne, options: ee, ref: K, onSelect: (f) => {
|
3337
3358
|
var b;
|
3338
|
-
(b = ie.get(
|
3359
|
+
(b = ie.get(Ne.name)) == null || b.dispose();
|
3339
3360
|
const m = ne.get(f);
|
3340
|
-
m !== void 0 && (X(
|
3361
|
+
m !== void 0 && (X(Ne), Ne = m, S(m, K.current));
|
3341
3362
|
} })
|
3342
3363
|
] })
|
3343
3364
|
] }),
|
@@ -3426,7 +3447,7 @@ export {
|
|
3426
3447
|
Ta as Dropdown,
|
3427
3448
|
Ma as DropdownItem,
|
3428
3449
|
bi as Editor,
|
3429
|
-
|
3450
|
+
ja as InfiniteGridHelper,
|
3430
3451
|
Xa as Inspector,
|
3431
3452
|
vi as MultiView,
|
3432
3453
|
wn as NavButton,
|
@@ -3437,11 +3458,11 @@ export {
|
|
3437
3458
|
En as RemoteTweakpane,
|
3438
3459
|
gi as SceneInspector,
|
3439
3460
|
mi as SidePanel,
|
3440
|
-
|
3461
|
+
j as ToolEvents,
|
3441
3462
|
Aa as UVMaterial,
|
3442
3463
|
ui as clamp,
|
3443
3464
|
ra as colorToHex,
|
3444
|
-
|
3465
|
+
_ as debugDispatcher,
|
3445
3466
|
vn as dispose,
|
3446
3467
|
sa as disposeMaterial,
|
3447
3468
|
fi as disposeTexture,
|
@@ -3451,5 +3472,5 @@ export {
|
|
3451
3472
|
aa as randomID,
|
3452
3473
|
oa as resetThreeObjects,
|
3453
3474
|
kt as round,
|
3454
|
-
|
3475
|
+
Nt as totalThreeObjects
|
3455
3476
|
};
|