aptechka 0.7.3 → 0.7.4
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/lib/en3/core/en3.d.ts +3 -0
- package/lib/en3/helpers/En3ComposerManager.d.ts +5 -0
- package/lib/en3/helpers/En3ParametersManager.d.ts +12 -1
- package/lib/en3/helpers/index.cjs +1 -1
- package/lib/en3/helpers/index.js +941 -736
- package/lib/en3/index.cjs +1 -1
- package/lib/en3/index.js +1 -1
- package/lib/en3/loaders/index.cjs +1 -1
- package/lib/en3/loaders/index.js +1 -1
- package/lib/en3/utils/index.cjs +1 -1
- package/lib/en3/utils/index.js +2 -2
- package/lib/en3-CBBYE8rb.cjs +8 -0
- package/lib/en3-sDqjL5Mg.js +349 -0
- package/lib/order/index.cjs +1 -1
- package/lib/order/index.d.ts +2 -2
- package/lib/order/index.js +1 -1
- package/lib/store/Store.d.ts +1 -0
- package/lib/{traverseMaterials-Crv7f9BJ.cjs → traverseMaterials-BtBXV88O.cjs} +1 -1
- package/lib/{traverseMaterials-B87RMkV0.js → traverseMaterials-M-N1989i.js} +1 -1
- package/lib/tweaker/index.cjs +2 -2
- package/lib/tweaker/index.js +73 -73
- package/package.json +1 -1
- package/lib/en3-BQMd-J6t.cjs +0 -8
- package/lib/en3-CsNHRA0v.js +0 -343
package/lib/en3/helpers/index.js
CHANGED
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
for (var o in
|
|
6
|
-
|
|
7
|
-
if (
|
|
8
|
-
for (var o of
|
|
9
|
-
|
|
10
|
-
return
|
|
1
|
+
var ii = Object.defineProperty;
|
|
2
|
+
var dn = Object.getOwnPropertySymbols;
|
|
3
|
+
var si = Object.prototype.hasOwnProperty, oi = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var un = (m, t, o) => t in m ? ii(m, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : m[t] = o, pe = (m, t) => {
|
|
5
|
+
for (var o in t || (t = {}))
|
|
6
|
+
si.call(t, o) && un(m, o, t[o]);
|
|
7
|
+
if (dn)
|
|
8
|
+
for (var o of dn(t))
|
|
9
|
+
oi.call(t, o) && un(m, o, t[o]);
|
|
10
|
+
return m;
|
|
11
11
|
};
|
|
12
|
-
var
|
|
13
|
-
if (!
|
|
12
|
+
var Xt = (m, t, o) => {
|
|
13
|
+
if (!t.has(m))
|
|
14
14
|
throw TypeError("Cannot " + o);
|
|
15
15
|
};
|
|
16
|
-
var s = (
|
|
17
|
-
if (
|
|
16
|
+
var s = (m, t, o) => (Xt(m, t, "read from private field"), o ? o.call(m) : t.get(m)), d = (m, t, o) => {
|
|
17
|
+
if (t.has(m))
|
|
18
18
|
throw TypeError("Cannot add the same private member more than once");
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
var
|
|
22
|
-
import { e as
|
|
23
|
-
import { S as
|
|
24
|
-
import * as
|
|
25
|
-
import { Light as
|
|
26
|
-
import {
|
|
27
|
-
import { ticker as
|
|
28
|
-
import { C as
|
|
29
|
-
|
|
19
|
+
t instanceof WeakSet ? t.add(m) : t.set(m, o);
|
|
20
|
+
}, x = (m, t, o, e) => (Xt(m, t, "write to private field"), e ? e.call(m, o) : t.set(m, o), o);
|
|
21
|
+
var P = (m, t, o) => (Xt(m, t, "access private method"), o);
|
|
22
|
+
import { e as b } from "../../en3-sDqjL5Mg.js";
|
|
23
|
+
import { S as Z } from "../../Store-BI2xxXOA.js";
|
|
24
|
+
import * as Pe from "three";
|
|
25
|
+
import { Light as fn, PointLight as ai, PointLightHelper as ri, DirectionalLight as li, DirectionalLightHelper as ci, SpotLight as hi, SpotLightHelper as pi, HemisphereLight as mi, HemisphereLightHelper as di, Camera as yn, CameraHelper as ui, Mesh as p, Material as fi, Ray as yi, Plane as bi, MathUtils as wi, EventDispatcher as gi, Vector3 as y, MOUSE as Re, TOUCH as Ye, Quaternion as K, Spherical as bn, Vector2 as V, Raycaster as Ei, Object3D as Gt, Euler as Pi, Matrix4 as Dn, MeshBasicMaterial as On, LineBasicMaterial as Mi, CylinderGeometry as F, BoxGeometry as X, BufferGeometry as wn, Float32BufferAttribute as gn, OctahedronGeometry as vt, Line as me, SphereGeometry as Si, TorusGeometry as Ve, PlaneGeometry as xi, DoubleSide as vi, GridHelper as _i } from "three";
|
|
26
|
+
import { a as Ti } from "../../object-D6MVWB4l.js";
|
|
27
|
+
import { ticker as En } from "../../ticker/index.js";
|
|
28
|
+
import { C as Ii } from "../../Composed-DmLYTh1b.js";
|
|
29
|
+
import { t as Ai } from "../../traverseMaterials-M-N1989i.js";
|
|
30
|
+
const Li = [
|
|
30
31
|
"AddEquation",
|
|
31
32
|
"SubtractEquation",
|
|
32
33
|
"ReverseSubtractEquation",
|
|
33
34
|
"MinEquation",
|
|
34
35
|
"MaxEquation"
|
|
35
|
-
],
|
|
36
|
+
], jn = [
|
|
36
37
|
"ZeroFactor",
|
|
37
38
|
"OneFactor",
|
|
38
39
|
"SrcColorFactor",
|
|
@@ -48,14 +49,14 @@ const di = [
|
|
|
48
49
|
"OneMinusConstantColorFactor",
|
|
49
50
|
"ConstantAlphaFactor",
|
|
50
51
|
"OneMinusConstantAlphaFactor"
|
|
51
|
-
],
|
|
52
|
+
], Di = [...jn, "SrcAlphaSaturateFactor"], Oi = [
|
|
52
53
|
"NoBlending",
|
|
53
54
|
"NormalBlending",
|
|
54
55
|
"AdditiveBlending",
|
|
55
56
|
"SubtractiveBlending",
|
|
56
57
|
"MultiplyBlending",
|
|
57
58
|
"CustomBlending"
|
|
58
|
-
],
|
|
59
|
+
], ji = [
|
|
59
60
|
"NeverDepth",
|
|
60
61
|
"AlwaysDepth",
|
|
61
62
|
"EqualDepth",
|
|
@@ -64,7 +65,7 @@ const di = [
|
|
|
64
65
|
"GreaterEqualDepth ",
|
|
65
66
|
"GreaterDepth",
|
|
66
67
|
"NotEqualDepth"
|
|
67
|
-
],
|
|
68
|
+
], ki = [
|
|
68
69
|
"NeverStencilFunc",
|
|
69
70
|
"LessStencilFunc",
|
|
70
71
|
"EqualStencilFunc",
|
|
@@ -73,7 +74,7 @@ const di = [
|
|
|
73
74
|
"NotEqualStencilFunc ",
|
|
74
75
|
"GreaterEqualStencilFunc",
|
|
75
76
|
"AlwaysStencilFunc"
|
|
76
|
-
],
|
|
77
|
+
], Zt = [
|
|
77
78
|
"ZeroStencilOp",
|
|
78
79
|
"KeepStencilOp",
|
|
79
80
|
"ReplaceStencilOp",
|
|
@@ -82,7 +83,7 @@ const di = [
|
|
|
82
83
|
"IncrementWrapStencilOp",
|
|
83
84
|
"DecrementWrapStencilOp",
|
|
84
85
|
"InvertStencilOp"
|
|
85
|
-
],
|
|
86
|
+
], Ci = ["FrontSide", "BackSide", "DoubleSide"], Ri = ["TangentSpaceNormalMap", "ObjectSpaceNormalMap"], Yi = ["round", "bevel", "miter"], Hi = [
|
|
86
87
|
"NoToneMapping",
|
|
87
88
|
"LinearToneMapping",
|
|
88
89
|
"ReinhardToneMapping",
|
|
@@ -91,12 +92,7 @@ const di = [
|
|
|
91
92
|
"AgXToneMapping",
|
|
92
93
|
"NeutralToneMapping",
|
|
93
94
|
"CustomToneMapping"
|
|
94
|
-
],
|
|
95
|
-
"BasicShadowMap",
|
|
96
|
-
"PCFShadowMap",
|
|
97
|
-
"PCFSoftShadowMap",
|
|
98
|
-
"VSMShadowMap"
|
|
99
|
-
], Ne = {
|
|
95
|
+
], zi = {
|
|
100
96
|
intensity: {
|
|
101
97
|
type: "number",
|
|
102
98
|
min: 0,
|
|
@@ -121,7 +117,7 @@ const di = [
|
|
|
121
117
|
},
|
|
122
118
|
blendDst: {
|
|
123
119
|
type: "select",
|
|
124
|
-
variants:
|
|
120
|
+
variants: Di
|
|
125
121
|
},
|
|
126
122
|
blendDstAlpha: {
|
|
127
123
|
type: "number",
|
|
@@ -131,7 +127,7 @@ const di = [
|
|
|
131
127
|
},
|
|
132
128
|
blendEquation: {
|
|
133
129
|
type: "select",
|
|
134
|
-
variants:
|
|
130
|
+
variants: Li
|
|
135
131
|
},
|
|
136
132
|
blendEquationAlpha: {
|
|
137
133
|
type: "number",
|
|
@@ -141,11 +137,11 @@ const di = [
|
|
|
141
137
|
},
|
|
142
138
|
blending: {
|
|
143
139
|
type: "select",
|
|
144
|
-
variants:
|
|
140
|
+
variants: Oi
|
|
145
141
|
},
|
|
146
142
|
blendSrc: {
|
|
147
143
|
type: "select",
|
|
148
|
-
variants:
|
|
144
|
+
variants: jn
|
|
149
145
|
},
|
|
150
146
|
blendSrcAlpha: {
|
|
151
147
|
type: "number",
|
|
@@ -155,11 +151,11 @@ const di = [
|
|
|
155
151
|
},
|
|
156
152
|
depthFunc: {
|
|
157
153
|
type: "select",
|
|
158
|
-
variants:
|
|
154
|
+
variants: ji
|
|
159
155
|
},
|
|
160
156
|
stencilFunc: {
|
|
161
157
|
type: "select",
|
|
162
|
-
variants:
|
|
158
|
+
variants: ki
|
|
163
159
|
},
|
|
164
160
|
stencilRef: {
|
|
165
161
|
type: "number",
|
|
@@ -168,15 +164,15 @@ const di = [
|
|
|
168
164
|
},
|
|
169
165
|
stencilFail: {
|
|
170
166
|
type: "select",
|
|
171
|
-
variants:
|
|
167
|
+
variants: Zt
|
|
172
168
|
},
|
|
173
169
|
stencilZFail: {
|
|
174
170
|
type: "select",
|
|
175
|
-
variants:
|
|
171
|
+
variants: Zt
|
|
176
172
|
},
|
|
177
173
|
stencilZPass: {
|
|
178
174
|
type: "select",
|
|
179
|
-
variants:
|
|
175
|
+
variants: Zt
|
|
180
176
|
},
|
|
181
177
|
opacity: {
|
|
182
178
|
type: "number",
|
|
@@ -186,7 +182,7 @@ const di = [
|
|
|
186
182
|
},
|
|
187
183
|
side: {
|
|
188
184
|
type: "select",
|
|
189
|
-
variants:
|
|
185
|
+
variants: Ci
|
|
190
186
|
},
|
|
191
187
|
roughness: {
|
|
192
188
|
type: "number",
|
|
@@ -219,11 +215,11 @@ const di = [
|
|
|
219
215
|
},
|
|
220
216
|
normalMapType: {
|
|
221
217
|
type: "select",
|
|
222
|
-
variants:
|
|
218
|
+
variants: Ri
|
|
223
219
|
},
|
|
224
220
|
wireframeLinejoin: {
|
|
225
221
|
type: "select",
|
|
226
|
-
variants:
|
|
222
|
+
variants: Yi
|
|
227
223
|
},
|
|
228
224
|
envMapIntensity: {
|
|
229
225
|
type: "number",
|
|
@@ -329,7 +325,7 @@ const di = [
|
|
|
329
325
|
},
|
|
330
326
|
toneMapping: {
|
|
331
327
|
type: "select",
|
|
332
|
-
variants:
|
|
328
|
+
variants: Hi
|
|
333
329
|
},
|
|
334
330
|
toneMappingExposure: {
|
|
335
331
|
type: "number",
|
|
@@ -341,13 +337,25 @@ const di = [
|
|
|
341
337
|
type: "number",
|
|
342
338
|
min: 0,
|
|
343
339
|
step: 1
|
|
340
|
+
},
|
|
341
|
+
damp: {
|
|
342
|
+
type: "number",
|
|
343
|
+
min: 0,
|
|
344
|
+
max: 1,
|
|
345
|
+
step: 1e-6
|
|
346
|
+
},
|
|
347
|
+
strength: {
|
|
348
|
+
type: "number",
|
|
349
|
+
min: 0,
|
|
350
|
+
step: 0.01
|
|
351
|
+
},
|
|
352
|
+
threshold: {
|
|
353
|
+
type: "number",
|
|
354
|
+
min: 0,
|
|
355
|
+
max: 1,
|
|
356
|
+
step: 1e-4
|
|
344
357
|
}
|
|
345
|
-
},
|
|
346
|
-
type: {
|
|
347
|
-
type: "select",
|
|
348
|
-
variants: Si
|
|
349
|
-
}
|
|
350
|
-
}, xi = /* @__PURE__ */ new Set([
|
|
358
|
+
}, Ni = /* @__PURE__ */ new Set([
|
|
351
359
|
"stencilFuncMask",
|
|
352
360
|
"needsUpdate",
|
|
353
361
|
"version",
|
|
@@ -360,160 +368,230 @@ const di = [
|
|
|
360
368
|
"autoUpdate",
|
|
361
369
|
"up"
|
|
362
370
|
]);
|
|
363
|
-
var
|
|
364
|
-
class
|
|
365
|
-
constructor(
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
o.needsUpdate = !0;
|
|
387
|
-
});
|
|
388
|
-
const e = o.camera;
|
|
389
|
-
e && I(this, ce, Ee).call(this, e, `${s(this, D).name}.Parameters.Shadow.Camera`, Ne, () => {
|
|
390
|
-
o.camera.updateProjectionMatrix();
|
|
391
|
-
});
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
} else if (s(this, D) instanceof q.WebGLRenderer) {
|
|
395
|
-
const o = s(this, D);
|
|
396
|
-
I(this, ce, Ee).call(this, o, "Renderer", Ne), I(this, ce, Ee).call(this, o.shadowMap, "Renderer.shadowMap", Pi, () => {
|
|
397
|
-
o.shadowMap.needsUpdate = !0, pi(x.scene, (e) => {
|
|
398
|
-
e.needsUpdate = !0;
|
|
399
|
-
});
|
|
400
|
-
});
|
|
401
|
-
}
|
|
371
|
+
var He, ae, Ot, kn, jt, Cn, kt, Rn, Ct, Yn, Rt, Hn, nt, Wt, it, Ut, re, Se, le, xe;
|
|
372
|
+
class be {
|
|
373
|
+
constructor(t, o) {
|
|
374
|
+
d(this, Ot);
|
|
375
|
+
d(this, jt);
|
|
376
|
+
d(this, kt);
|
|
377
|
+
d(this, Ct);
|
|
378
|
+
d(this, Rt);
|
|
379
|
+
d(this, nt);
|
|
380
|
+
d(this, it);
|
|
381
|
+
d(this, re);
|
|
382
|
+
d(this, le);
|
|
383
|
+
d(this, He, void 0);
|
|
384
|
+
d(this, ae, []);
|
|
385
|
+
x(this, He, t);
|
|
386
|
+
const e = pe(pe({}, zi), o == null ? void 0 : o.optionsCatalog), a = /* @__PURE__ */ new Set([...Ni, ...(o == null ? void 0 : o.skipKeys) || []]), r = (o == null ? void 0 : o.folderName) || s(this, He).name, i = o == null ? void 0 : o.afterChange;
|
|
387
|
+
P(this, Ot, kn).call(this, {
|
|
388
|
+
subject: s(this, He),
|
|
389
|
+
skipKeys: a,
|
|
390
|
+
optionsCatalog: e,
|
|
391
|
+
folderKey: r,
|
|
392
|
+
afterChange: i
|
|
393
|
+
});
|
|
402
394
|
}
|
|
403
395
|
destroy() {
|
|
404
|
-
s(this,
|
|
405
|
-
|
|
396
|
+
s(this, ae).forEach((t) => {
|
|
397
|
+
t.close();
|
|
406
398
|
});
|
|
407
399
|
}
|
|
408
400
|
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
401
|
+
He = new WeakMap(), ae = new WeakMap(), Ot = new WeakSet(), kn = function(t) {
|
|
402
|
+
const { subject: o, folderKey: e, optionsCatalog: a, afterChange: r, skipKeys: i } = t;
|
|
403
|
+
for (const l in o) {
|
|
404
|
+
if (l.startsWith("_") || i.has(l))
|
|
412
405
|
continue;
|
|
413
|
-
const
|
|
414
|
-
typeof
|
|
406
|
+
const u = o[l], h = P(this, re, Se).call(this, u), f = `${e}.${l}`, g = a[l];
|
|
407
|
+
typeof h == "number" ? (g == null ? void 0 : g.type) === "select" ? P(this, nt, Wt).call(this, {
|
|
408
|
+
name: f,
|
|
409
|
+
value: u,
|
|
410
|
+
subject: o,
|
|
411
|
+
key: l,
|
|
412
|
+
managerOptions: g,
|
|
413
|
+
afterChange: r
|
|
414
|
+
}) : P(this, jt, Cn).call(this, {
|
|
415
|
+
name: f,
|
|
416
|
+
value: u,
|
|
417
|
+
subject: o,
|
|
418
|
+
key: l,
|
|
419
|
+
managerOptions: g,
|
|
420
|
+
afterChange: r
|
|
421
|
+
}) : h instanceof Pe.Vector2 || h instanceof Pe.Vector3 ? P(this, kt, Rn).call(this, {
|
|
422
|
+
name: f,
|
|
423
|
+
value: u,
|
|
424
|
+
subject: o,
|
|
425
|
+
key: l,
|
|
426
|
+
managerOptions: g,
|
|
427
|
+
afterChange: r
|
|
428
|
+
}) : typeof h == "boolean" && !l.startsWith("is") && !l.startsWith("matrix") ? P(this, Ct, Yn).call(this, {
|
|
429
|
+
name: f,
|
|
430
|
+
value: u,
|
|
431
|
+
subject: o,
|
|
432
|
+
key: l,
|
|
433
|
+
managerOptions: g,
|
|
434
|
+
afterChange: r
|
|
435
|
+
}) : h instanceof Pe.Color ? P(this, Rt, Hn).call(this, {
|
|
436
|
+
name: f,
|
|
437
|
+
value: u,
|
|
438
|
+
subject: o,
|
|
439
|
+
key: l,
|
|
440
|
+
managerOptions: g,
|
|
441
|
+
afterChange: r
|
|
442
|
+
}) : g && (g == null ? void 0 : g.type) === "select" && P(this, nt, Wt).call(this, {
|
|
443
|
+
name: f,
|
|
444
|
+
value: u,
|
|
445
|
+
subject: o,
|
|
446
|
+
key: l,
|
|
447
|
+
managerOptions: g,
|
|
448
|
+
afterChange: r
|
|
449
|
+
});
|
|
415
450
|
}
|
|
416
|
-
},
|
|
417
|
-
|
|
451
|
+
}, jt = new WeakSet(), Cn = function({
|
|
452
|
+
name: t,
|
|
453
|
+
value: o,
|
|
454
|
+
subject: e,
|
|
455
|
+
key: a,
|
|
456
|
+
managerOptions: r,
|
|
457
|
+
afterChange: i
|
|
458
|
+
}) {
|
|
459
|
+
const l = new Z(P(this, re, Se).call(this, o), {
|
|
418
460
|
passport: {
|
|
419
|
-
name:
|
|
420
|
-
manager:
|
|
461
|
+
name: t,
|
|
462
|
+
manager: pe({
|
|
421
463
|
type: "number"
|
|
422
464
|
}, r)
|
|
423
465
|
}
|
|
424
466
|
});
|
|
425
|
-
l.subscribe((
|
|
426
|
-
e[
|
|
427
|
-
}), s(this,
|
|
428
|
-
},
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
467
|
+
l.subscribe((u) => {
|
|
468
|
+
P(this, le, xe).call(this, e, a, (h, f) => h[f] = u.current), i == null || i();
|
|
469
|
+
}), s(this, ae).push(l);
|
|
470
|
+
}, kt = new WeakSet(), Rn = function({
|
|
471
|
+
name: t,
|
|
472
|
+
value: o,
|
|
473
|
+
subject: e,
|
|
474
|
+
key: a,
|
|
475
|
+
managerOptions: r,
|
|
476
|
+
afterChange: i
|
|
477
|
+
}) {
|
|
478
|
+
const l = (h) => {
|
|
479
|
+
const f = [h.x, h.y];
|
|
480
|
+
return h instanceof Pe.Vector3 && f.push(h.z), f;
|
|
481
|
+
}, u = new Z(l(P(this, re, Se).call(this, o)), {
|
|
433
482
|
passport: {
|
|
434
|
-
name:
|
|
435
|
-
manager:
|
|
483
|
+
name: t,
|
|
484
|
+
manager: pe({
|
|
436
485
|
type: "number"
|
|
437
486
|
}, r)
|
|
438
487
|
}
|
|
439
488
|
});
|
|
440
|
-
|
|
441
|
-
e[
|
|
442
|
-
}), s(this,
|
|
443
|
-
},
|
|
444
|
-
|
|
489
|
+
u.subscribe((h) => {
|
|
490
|
+
P(this, le, xe).call(this, e, a, (f, g) => f[g].set(...h.current)), i == null || i();
|
|
491
|
+
}), s(this, ae).push(u);
|
|
492
|
+
}, Ct = new WeakSet(), Yn = function({
|
|
493
|
+
name: t,
|
|
494
|
+
value: o,
|
|
495
|
+
subject: e,
|
|
496
|
+
key: a,
|
|
497
|
+
managerOptions: r,
|
|
498
|
+
afterChange: i
|
|
499
|
+
}) {
|
|
500
|
+
const l = new Z(P(this, re, Se).call(this, o), {
|
|
445
501
|
passport: {
|
|
446
|
-
name:
|
|
447
|
-
manager: {
|
|
502
|
+
name: t,
|
|
503
|
+
manager: pe({
|
|
448
504
|
type: "boolean"
|
|
449
|
-
}
|
|
505
|
+
}, r)
|
|
450
506
|
}
|
|
451
507
|
});
|
|
452
|
-
|
|
453
|
-
e[
|
|
454
|
-
}), s(this,
|
|
455
|
-
},
|
|
456
|
-
|
|
508
|
+
l.subscribe((u) => {
|
|
509
|
+
P(this, le, xe).call(this, e, a, (h, f) => h[f] = u.current), i == null || i();
|
|
510
|
+
}), s(this, ae).push(l);
|
|
511
|
+
}, Rt = new WeakSet(), Hn = function({
|
|
512
|
+
name: t,
|
|
513
|
+
value: o,
|
|
514
|
+
subject: e,
|
|
515
|
+
key: a,
|
|
516
|
+
managerOptions: r,
|
|
517
|
+
afterChange: i
|
|
518
|
+
}) {
|
|
519
|
+
const l = new Z(`#${P(this, re, Se).call(this, o).getHexString()}`, {
|
|
457
520
|
passport: {
|
|
458
|
-
name:
|
|
459
|
-
manager: {
|
|
521
|
+
name: t,
|
|
522
|
+
manager: pe({
|
|
460
523
|
type: "color"
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
});
|
|
464
|
-
i.subscribe((l) => {
|
|
465
|
-
e[a] = new q.Color(l.current), r == null || r();
|
|
466
|
-
}), s(this, le).push(i);
|
|
467
|
-
}, Ue = new WeakSet(), Yt = function(n, o, e, a, r, i) {
|
|
468
|
-
const l = r.variants;
|
|
469
|
-
let m = null;
|
|
470
|
-
for (const w of l)
|
|
471
|
-
o === q[w] && (m = w);
|
|
472
|
-
const f = new F(m || o, {
|
|
473
|
-
passport: {
|
|
474
|
-
name: n,
|
|
475
|
-
manager: ut({}, r)
|
|
524
|
+
}, r)
|
|
476
525
|
}
|
|
477
526
|
});
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
}), s(this,
|
|
527
|
+
l.subscribe((u) => {
|
|
528
|
+
P(this, le, xe).call(this, e, a, (h, f) => h[f] = new Pe.Color(u.current)), i == null || i();
|
|
529
|
+
}), s(this, ae).push(l);
|
|
530
|
+
}, nt = new WeakSet(), Wt = function({
|
|
531
|
+
name: t,
|
|
532
|
+
value: o,
|
|
533
|
+
subject: e,
|
|
534
|
+
key: a,
|
|
535
|
+
managerOptions: r,
|
|
536
|
+
afterChange: i
|
|
537
|
+
}) {
|
|
538
|
+
const l = r == null ? void 0 : r.variants;
|
|
539
|
+
if (l) {
|
|
540
|
+
let u = null;
|
|
541
|
+
for (const f of l)
|
|
542
|
+
o === Pe[f] && (u = f);
|
|
543
|
+
const h = new Z(u || P(this, re, Se).call(this, o), {
|
|
544
|
+
passport: {
|
|
545
|
+
name: t,
|
|
546
|
+
manager: pe({}, r)
|
|
547
|
+
}
|
|
548
|
+
});
|
|
549
|
+
h.subscribe((f) => {
|
|
550
|
+
typeof f.current == "string" && (f.current[0] === f.current[0].toUpperCase() ? P(this, le, xe).call(this, e, a, (g, L) => g[L] = Pe[f.current]) : P(this, le, xe).call(this, e, a, (g, L) => g[L] = f.current)), i == null || i();
|
|
551
|
+
}), s(this, ae).push(h);
|
|
552
|
+
}
|
|
553
|
+
}, it = new WeakSet(), Ut = function(t) {
|
|
554
|
+
return Ti(t) && "value" in t;
|
|
555
|
+
}, re = new WeakSet(), Se = function(t) {
|
|
556
|
+
return P(this, it, Ut).call(this, t) ? t.value : t;
|
|
557
|
+
}, le = new WeakSet(), xe = function(t, o, e) {
|
|
558
|
+
P(this, it, Ut).call(this, t[o]) ? e(t[o], "value") : e(t, o);
|
|
481
559
|
};
|
|
482
|
-
var E,
|
|
483
|
-
class
|
|
484
|
-
constructor(
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
s(this,
|
|
495
|
-
"update" in
|
|
560
|
+
var E, ue, _e, Te, Ie, st, $, ze, Lt, ot;
|
|
561
|
+
class zn {
|
|
562
|
+
constructor(t, o) {
|
|
563
|
+
d(this, ze);
|
|
564
|
+
d(this, E, void 0);
|
|
565
|
+
d(this, ue, []);
|
|
566
|
+
d(this, _e, void 0);
|
|
567
|
+
d(this, Te, void 0);
|
|
568
|
+
d(this, Ie, void 0);
|
|
569
|
+
d(this, st, !0);
|
|
570
|
+
d(this, $, []);
|
|
571
|
+
d(this, ot, () => {
|
|
572
|
+
s(this, $).forEach((t) => {
|
|
573
|
+
"update" in t && t.update();
|
|
496
574
|
});
|
|
497
575
|
});
|
|
498
|
-
var l,
|
|
499
|
-
|
|
576
|
+
var l, u;
|
|
577
|
+
x(this, E, t);
|
|
500
578
|
let e = !1;
|
|
501
|
-
|
|
502
|
-
const a =
|
|
579
|
+
t.name.startsWith("T.") && (t.name = t.name.slice(2)), t.name.includes("P.") && (e = !0, t.name = t.name.replace("P.", ""));
|
|
580
|
+
const a = t.name;
|
|
503
581
|
s(this, E).userData.controlled = !0;
|
|
504
|
-
const r = (o == null ? void 0 : o.step) || 1e-4, i = ((l =
|
|
505
|
-
if (s(this, E) instanceof
|
|
506
|
-
let
|
|
507
|
-
s(this, E) instanceof
|
|
508
|
-
const
|
|
509
|
-
if (
|
|
510
|
-
const
|
|
511
|
-
s(this,
|
|
582
|
+
const r = (o == null ? void 0 : o.step) || 1e-4, i = ((l = t.userData) == null ? void 0 : l.box) || t;
|
|
583
|
+
if (s(this, E) instanceof fn) {
|
|
584
|
+
let h;
|
|
585
|
+
s(this, E) instanceof ai ? h = new ri(s(this, E), 100) : s(this, E) instanceof li ? (s(this, E).scale.setScalar(100), h = new ci(s(this, E), 1)) : s(this, E) instanceof hi ? h = new pi(s(this, E)) : s(this, E) instanceof mi && (h = new di(s(this, E), 100)), s(this, $).push(h);
|
|
586
|
+
const f = (u = s(this, E).shadow) == null ? void 0 : u.camera;
|
|
587
|
+
if (f instanceof yn) {
|
|
588
|
+
const g = new ui(f);
|
|
589
|
+
s(this, $).push(g);
|
|
512
590
|
}
|
|
513
591
|
}
|
|
514
|
-
s(this,
|
|
515
|
-
|
|
516
|
-
}),
|
|
592
|
+
if (s(this, $).forEach((h) => {
|
|
593
|
+
b.view.add(h);
|
|
594
|
+
}), x(this, _e, new Z([i.position.x, i.position.y, i.position.z], {
|
|
517
595
|
passport: {
|
|
518
596
|
name: `${a}.Transformation.Position`,
|
|
519
597
|
manager: {
|
|
@@ -521,7 +599,7 @@ class Pn {
|
|
|
521
599
|
step: r
|
|
522
600
|
}
|
|
523
601
|
}
|
|
524
|
-
})),
|
|
602
|
+
})), x(this, Te, new Z([i.rotation.x, i.rotation.y, i.rotation.z], {
|
|
525
603
|
passport: {
|
|
526
604
|
name: `${a}.Transformation.Rotation`,
|
|
527
605
|
manager: {
|
|
@@ -530,7 +608,7 @@ class Pn {
|
|
|
530
608
|
ease: 0.01
|
|
531
609
|
}
|
|
532
610
|
}
|
|
533
|
-
})),
|
|
611
|
+
})), x(this, Ie, new Z([i.scale.x, i.scale.y, i.scale.z], {
|
|
534
612
|
passport: {
|
|
535
613
|
name: `${a}.Transformation.Scale`,
|
|
536
614
|
manager: {
|
|
@@ -538,37 +616,73 @@ class Pn {
|
|
|
538
616
|
step: r
|
|
539
617
|
}
|
|
540
618
|
}
|
|
541
|
-
})), this.save(),
|
|
542
|
-
|
|
543
|
-
}), s(this,
|
|
544
|
-
|
|
545
|
-
}), s(this,
|
|
546
|
-
|
|
547
|
-
}), e
|
|
619
|
+
})), this.save(), x(this, st, !1), s(this, _e).subscribe((h) => {
|
|
620
|
+
P(this, ze, Lt).call(this, "position", h.current);
|
|
621
|
+
}), s(this, Te).subscribe((h) => {
|
|
622
|
+
P(this, ze, Lt).call(this, "rotation", h.current);
|
|
623
|
+
}), s(this, Ie).subscribe((h) => {
|
|
624
|
+
P(this, ze, Lt).call(this, "scale", h.current);
|
|
625
|
+
}), e) {
|
|
626
|
+
if (s(this, ue).push(
|
|
627
|
+
new be(s(this, E), {
|
|
628
|
+
folderName: `${s(this, E).name}.Parameters`,
|
|
629
|
+
afterChange: s(this, E) instanceof yn ? () => {
|
|
630
|
+
b.view.resize();
|
|
631
|
+
} : void 0
|
|
632
|
+
})
|
|
633
|
+
), s(this, E) instanceof p) {
|
|
634
|
+
const h = s(this, E).material;
|
|
635
|
+
h instanceof fi && s(this, ue).push(
|
|
636
|
+
new be(h, {
|
|
637
|
+
folderName: `${s(this, E).name}.Parameters.Material`,
|
|
638
|
+
afterChange: () => {
|
|
639
|
+
h.needsUpdate = !0;
|
|
640
|
+
}
|
|
641
|
+
})
|
|
642
|
+
);
|
|
643
|
+
} else if (s(this, E) instanceof fn) {
|
|
644
|
+
const h = s(this, E).shadow;
|
|
645
|
+
h && s(this, ue).push(
|
|
646
|
+
new be(h, {
|
|
647
|
+
folderName: `${s(this, E).name}.Parameters.Shadow`,
|
|
648
|
+
afterChange: () => {
|
|
649
|
+
h.needsUpdate = !0;
|
|
650
|
+
}
|
|
651
|
+
})
|
|
652
|
+
), h.camera && s(this, ue).push(
|
|
653
|
+
new be(h, {
|
|
654
|
+
folderName: `${s(this, E).name}.Parameters.Shadow.Camera`,
|
|
655
|
+
afterChange: () => {
|
|
656
|
+
h.camera.updateProjectionMatrix();
|
|
657
|
+
}
|
|
658
|
+
})
|
|
659
|
+
);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
s(this, $).length && En.subscribe(s(this, ot));
|
|
548
663
|
}
|
|
549
664
|
get object3d() {
|
|
550
665
|
return s(this, E);
|
|
551
666
|
}
|
|
552
667
|
get helpers() {
|
|
553
|
-
return s(this,
|
|
668
|
+
return s(this, $);
|
|
554
669
|
}
|
|
555
670
|
get raycasterTarget() {
|
|
556
|
-
return s(this,
|
|
671
|
+
return s(this, $)[0] || s(this, E);
|
|
557
672
|
}
|
|
558
673
|
destroy() {
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
}), on.unsubscribe(s(this, Ve));
|
|
674
|
+
s(this, ue).forEach((t) => t.destroy()), s(this, _e).close(), s(this, Te).close(), s(this, Ie).close(), s(this, E).userData.controlled = !1, s(this, $).forEach((t) => {
|
|
675
|
+
t && "dispose" in t && (t.dispose(), b.view.remove(t));
|
|
676
|
+
}), En.unsubscribe(s(this, ot));
|
|
563
677
|
}
|
|
564
678
|
save() {
|
|
565
|
-
const
|
|
566
|
-
(!s(this,
|
|
679
|
+
const t = (o, e) => {
|
|
680
|
+
(!s(this, st) || o.initial === o.current) && (o.current = [e.x, e.y, e.z]);
|
|
567
681
|
};
|
|
568
|
-
|
|
682
|
+
t(s(this, _e), s(this, E).position), t(s(this, Te), s(this, E).rotation), t(s(this, Ie), s(this, E).scale);
|
|
569
683
|
}
|
|
570
684
|
}
|
|
571
|
-
E = new WeakMap(),
|
|
685
|
+
E = new WeakMap(), ue = new WeakMap(), _e = new WeakMap(), Te = new WeakMap(), Ie = new WeakMap(), st = new WeakMap(), $ = new WeakMap(), ze = new WeakSet(), Lt = function(t, o) {
|
|
572
686
|
const e = s(this, E).userData.box;
|
|
573
687
|
if (e) {
|
|
574
688
|
const a = (r) => ({
|
|
@@ -576,78 +690,78 @@ E = new WeakMap(), Ke = new WeakMap(), Se = new WeakMap(), Pe = new WeakMap(), x
|
|
|
576
690
|
y: o[1] - r.y,
|
|
577
691
|
z: o[2] - r.z
|
|
578
692
|
});
|
|
579
|
-
|
|
693
|
+
t === "position" ? e.setPositionStep(
|
|
580
694
|
"_manager",
|
|
581
695
|
"+",
|
|
582
696
|
a(e.getIncludedPositionSteps("_manager"))
|
|
583
|
-
) :
|
|
697
|
+
) : t === "rotation" ? e.setRotationStep(
|
|
584
698
|
"_manager",
|
|
585
699
|
"+",
|
|
586
700
|
a(e.getIncludedRotationSteps("_manager"))
|
|
587
|
-
) :
|
|
701
|
+
) : t === "scale" && e.setScaleStep(
|
|
588
702
|
"_manager",
|
|
589
703
|
"+",
|
|
590
704
|
a(e.getIncludedScaleSteps("_manager"))
|
|
591
705
|
);
|
|
592
706
|
} else
|
|
593
|
-
s(this, E)[
|
|
594
|
-
},
|
|
595
|
-
const
|
|
596
|
-
class
|
|
597
|
-
constructor(
|
|
598
|
-
super(), this.object =
|
|
707
|
+
s(this, E)[t].set(...o);
|
|
708
|
+
}, ot = new WeakMap();
|
|
709
|
+
const Pn = { type: "change" }, Ft = { type: "start" }, Mn = { type: "end" }, _t = new yi(), Sn = new bi(), Xi = Math.cos(70 * wi.DEG2RAD);
|
|
710
|
+
class Zi extends gi {
|
|
711
|
+
constructor(t, o) {
|
|
712
|
+
super(), this.object = t, this.domElement = o, 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: Re.ROTATE, MIDDLE: Re.DOLLY, RIGHT: Re.PAN }, this.touches = { ONE: Ye.ROTATE, TWO: Ye.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
|
|
599
713
|
return l.phi;
|
|
600
714
|
}, this.getAzimuthalAngle = function() {
|
|
601
715
|
return l.theta;
|
|
602
716
|
}, this.getDistance = function() {
|
|
603
717
|
return this.object.position.distanceTo(this.target);
|
|
604
|
-
}, this.listenToKeyEvents = function(
|
|
605
|
-
|
|
718
|
+
}, this.listenToKeyEvents = function(n) {
|
|
719
|
+
n.addEventListener("keydown", Nt), this._domElementKeyEvents = n;
|
|
606
720
|
}, this.stopListenToKeyEvents = function() {
|
|
607
|
-
this._domElementKeyEvents.removeEventListener("keydown",
|
|
721
|
+
this._domElementKeyEvents.removeEventListener("keydown", Nt), this._domElementKeyEvents = null;
|
|
608
722
|
}, this.saveState = function() {
|
|
609
723
|
e.target0.copy(e.target), e.position0.copy(e.object.position), e.zoom0 = e.object.zoom;
|
|
610
724
|
}, this.reset = function() {
|
|
611
|
-
e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(
|
|
725
|
+
e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(Pn), e.update(), r = a.NONE;
|
|
612
726
|
}, this.update = function() {
|
|
613
|
-
const
|
|
614
|
-
return function(
|
|
615
|
-
const
|
|
616
|
-
|
|
617
|
-
let
|
|
618
|
-
isFinite(
|
|
619
|
-
let
|
|
620
|
-
if (e.zoomToCursor &&
|
|
621
|
-
l.radius =
|
|
727
|
+
const n = new y(), c = new K().setFromUnitVectors(t.up, new y(0, 1, 0)), w = c.clone().invert(), S = new y(), N = new K(), he = new y(), G = 2 * Math.PI;
|
|
728
|
+
return function(ni = null) {
|
|
729
|
+
const pn = e.object.position;
|
|
730
|
+
n.copy(pn).sub(e.target), n.applyQuaternion(c), l.setFromVector3(n), e.autoRotate && r === a.NONE && ge(Ht(ni)), e.enableDamping ? (l.theta += u.theta * e.dampingFactor, l.phi += u.phi * e.dampingFactor) : (l.theta += u.theta, l.phi += u.phi);
|
|
731
|
+
let ie = e.minAzimuthAngle, se = e.maxAzimuthAngle;
|
|
732
|
+
isFinite(ie) && isFinite(se) && (ie < -Math.PI ? ie += G : ie > Math.PI && (ie -= G), se < -Math.PI ? se += G : se > Math.PI && (se -= G), ie <= se ? l.theta = Math.max(ie, Math.min(se, l.theta)) : l.theta = l.theta > (ie + se) / 2 ? Math.max(ie, l.theta) : Math.min(se, l.theta)), l.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, l.phi)), l.makeSafe(), e.enableDamping === !0 ? e.target.addScaledVector(f, e.dampingFactor) : e.target.add(f), e.target.sub(e.cursor), e.target.clampLength(e.minTargetRadius, e.maxTargetRadius), e.target.add(e.cursor);
|
|
733
|
+
let Ke = !1;
|
|
734
|
+
if (e.zoomToCursor && De || e.object.isOrthographicCamera)
|
|
735
|
+
l.radius = ce(l.radius);
|
|
622
736
|
else {
|
|
623
|
-
const
|
|
624
|
-
l.radius =
|
|
737
|
+
const oe = l.radius;
|
|
738
|
+
l.radius = ce(l.radius * h), Ke = oe != l.radius;
|
|
625
739
|
}
|
|
626
|
-
if (
|
|
627
|
-
let
|
|
740
|
+
if (n.setFromSpherical(l), n.applyQuaternion(w), pn.copy(e.target).add(n), e.object.lookAt(e.target), e.enableDamping === !0 ? (u.theta *= 1 - e.dampingFactor, u.phi *= 1 - e.dampingFactor, f.multiplyScalar(1 - e.dampingFactor)) : (u.set(0, 0, 0), f.set(0, 0, 0)), e.zoomToCursor && De) {
|
|
741
|
+
let oe = null;
|
|
628
742
|
if (e.object.isPerspectiveCamera) {
|
|
629
|
-
const
|
|
630
|
-
|
|
631
|
-
const
|
|
632
|
-
e.object.position.addScaledVector(
|
|
743
|
+
const Be = n.length();
|
|
744
|
+
oe = ce(Be * h);
|
|
745
|
+
const xt = Be - oe;
|
|
746
|
+
e.object.position.addScaledVector(te, xt), e.object.updateMatrixWorld(), Ke = !!xt;
|
|
633
747
|
} else if (e.object.isOrthographicCamera) {
|
|
634
|
-
const
|
|
635
|
-
|
|
636
|
-
const
|
|
637
|
-
e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom /
|
|
638
|
-
const
|
|
639
|
-
|
|
748
|
+
const Be = new y(C.x, C.y, 0);
|
|
749
|
+
Be.unproject(e.object);
|
|
750
|
+
const xt = e.object.zoom;
|
|
751
|
+
e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / h)), e.object.updateProjectionMatrix(), Ke = xt !== e.object.zoom;
|
|
752
|
+
const mn = new y(C.x, C.y, 0);
|
|
753
|
+
mn.unproject(e.object), e.object.position.sub(mn).add(Be), e.object.updateMatrixWorld(), oe = n.length();
|
|
640
754
|
} else
|
|
641
755
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), e.zoomToCursor = !1;
|
|
642
|
-
|
|
756
|
+
oe !== null && (this.screenSpacePanning ? e.target.set(0, 0, -1).transformDirection(e.object.matrix).multiplyScalar(oe).add(e.object.position) : (_t.origin.copy(e.object.position), _t.direction.set(0, 0, -1).transformDirection(e.object.matrix), Math.abs(e.object.up.dot(_t.direction)) < Xi ? t.lookAt(e.target) : (Sn.setFromNormalAndCoplanarPoint(e.object.up, e.target), _t.intersectPlane(Sn, e.target))));
|
|
643
757
|
} else if (e.object.isOrthographicCamera) {
|
|
644
|
-
const
|
|
645
|
-
e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom /
|
|
758
|
+
const oe = e.object.zoom;
|
|
759
|
+
e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / h)), oe !== e.object.zoom && (e.object.updateProjectionMatrix(), Ke = !0);
|
|
646
760
|
}
|
|
647
|
-
return
|
|
761
|
+
return h = 1, De = !1, Ke || S.distanceToSquared(e.object.position) > i || 8 * (1 - N.dot(e.object.quaternion)) > i || he.distanceToSquared(e.target) > i ? (e.dispatchEvent(Pn), S.copy(e.object.position), N.copy(e.object.quaternion), he.copy(e.target), !0) : !1;
|
|
648
762
|
};
|
|
649
763
|
}(), this.dispose = function() {
|
|
650
|
-
e.domElement.removeEventListener("contextmenu",
|
|
764
|
+
e.domElement.removeEventListener("contextmenu", cn), e.domElement.removeEventListener("pointerdown", sn), e.domElement.removeEventListener("pointercancel", Ue), e.domElement.removeEventListener("wheel", on), e.domElement.removeEventListener("pointermove", zt), e.domElement.removeEventListener("pointerup", Ue), e.domElement.getRootNode().removeEventListener("keydown", an, { capture: !0 }), e._domElementKeyEvents !== null && (e._domElementKeyEvents.removeEventListener("keydown", Nt), e._domElementKeyEvents = null);
|
|
651
765
|
};
|
|
652
766
|
const e = this, a = {
|
|
653
767
|
NONE: -1,
|
|
@@ -660,183 +774,183 @@ class _i extends ii {
|
|
|
660
774
|
TOUCH_DOLLY_ROTATE: 6
|
|
661
775
|
};
|
|
662
776
|
let r = a.NONE;
|
|
663
|
-
const i = 1e-6, l = new
|
|
664
|
-
let
|
|
665
|
-
const
|
|
666
|
-
let
|
|
667
|
-
const
|
|
668
|
-
let
|
|
669
|
-
function
|
|
670
|
-
return
|
|
777
|
+
const i = 1e-6, l = new bn(), u = new bn();
|
|
778
|
+
let h = 1;
|
|
779
|
+
const f = new y(), g = new V(), L = new V(), ee = new V(), Q = new V(), D = new V(), k = new V(), O = new V(), _ = new V(), T = new V(), te = new y(), C = new V();
|
|
780
|
+
let De = !1;
|
|
781
|
+
const I = [], we = {};
|
|
782
|
+
let We = !1;
|
|
783
|
+
function Ht(n) {
|
|
784
|
+
return n !== null ? 2 * Math.PI / 60 * e.autoRotateSpeed * n : 2 * Math.PI / 60 / 60 * e.autoRotateSpeed;
|
|
671
785
|
}
|
|
672
|
-
function
|
|
673
|
-
const c = Math.abs(
|
|
786
|
+
function Oe(n) {
|
|
787
|
+
const c = Math.abs(n * 0.01);
|
|
674
788
|
return Math.pow(0.95, e.zoomSpeed * c);
|
|
675
789
|
}
|
|
676
|
-
function
|
|
677
|
-
|
|
790
|
+
function ge(n) {
|
|
791
|
+
u.theta -= n;
|
|
678
792
|
}
|
|
679
|
-
function
|
|
680
|
-
|
|
793
|
+
function je(n) {
|
|
794
|
+
u.phi -= n;
|
|
681
795
|
}
|
|
682
|
-
const
|
|
683
|
-
const
|
|
684
|
-
return function(
|
|
685
|
-
|
|
796
|
+
const q = function() {
|
|
797
|
+
const n = new y();
|
|
798
|
+
return function(w, S) {
|
|
799
|
+
n.setFromMatrixColumn(S, 0), n.multiplyScalar(-w), f.add(n);
|
|
686
800
|
};
|
|
687
|
-
}(),
|
|
688
|
-
const
|
|
689
|
-
return function(
|
|
690
|
-
e.screenSpacePanning === !0 ?
|
|
801
|
+
}(), H = function() {
|
|
802
|
+
const n = new y();
|
|
803
|
+
return function(w, S) {
|
|
804
|
+
e.screenSpacePanning === !0 ? n.setFromMatrixColumn(S, 1) : (n.setFromMatrixColumn(S, 0), n.crossVectors(e.object.up, n)), n.multiplyScalar(w), f.add(n);
|
|
691
805
|
};
|
|
692
|
-
}(),
|
|
693
|
-
const
|
|
694
|
-
return function(
|
|
695
|
-
const
|
|
806
|
+
}(), B = function() {
|
|
807
|
+
const n = new y();
|
|
808
|
+
return function(w, S) {
|
|
809
|
+
const N = e.domElement;
|
|
696
810
|
if (e.object.isPerspectiveCamera) {
|
|
697
|
-
const
|
|
698
|
-
|
|
699
|
-
let
|
|
700
|
-
|
|
811
|
+
const he = e.object.position;
|
|
812
|
+
n.copy(he).sub(e.target);
|
|
813
|
+
let G = n.length();
|
|
814
|
+
G *= Math.tan(e.object.fov / 2 * Math.PI / 180), q(2 * w * G / N.clientHeight, e.object.matrix), H(2 * S * G / N.clientHeight, e.object.matrix);
|
|
701
815
|
} else
|
|
702
|
-
e.object.isOrthographicCamera ? (
|
|
816
|
+
e.object.isOrthographicCamera ? (q(w * (e.object.right - e.object.left) / e.object.zoom / N.clientWidth, e.object.matrix), H(S * (e.object.top - e.object.bottom) / e.object.zoom / N.clientHeight, e.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), e.enablePan = !1);
|
|
703
817
|
};
|
|
704
818
|
}();
|
|
705
|
-
function
|
|
706
|
-
e.object.isPerspectiveCamera || e.object.isOrthographicCamera ?
|
|
819
|
+
function z(n) {
|
|
820
|
+
e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? h /= n : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
|
|
707
821
|
}
|
|
708
|
-
function
|
|
709
|
-
e.object.isPerspectiveCamera || e.object.isOrthographicCamera ?
|
|
822
|
+
function ne(n) {
|
|
823
|
+
e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? h *= n : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
|
|
710
824
|
}
|
|
711
|
-
function
|
|
825
|
+
function A(n, c) {
|
|
712
826
|
if (!e.zoomToCursor)
|
|
713
827
|
return;
|
|
714
|
-
|
|
715
|
-
const
|
|
716
|
-
|
|
828
|
+
De = !0;
|
|
829
|
+
const w = e.domElement.getBoundingClientRect(), S = n - w.left, N = c - w.top, he = w.width, G = w.height;
|
|
830
|
+
C.x = S / he * 2 - 1, C.y = -(N / G) * 2 + 1, te.set(C.x, C.y, 1).unproject(e.object).sub(e.object.position).normalize();
|
|
717
831
|
}
|
|
718
|
-
function
|
|
719
|
-
return Math.max(e.minDistance, Math.min(e.maxDistance,
|
|
832
|
+
function ce(n) {
|
|
833
|
+
return Math.max(e.minDistance, Math.min(e.maxDistance, n));
|
|
720
834
|
}
|
|
721
|
-
function
|
|
722
|
-
|
|
835
|
+
function Ee(n) {
|
|
836
|
+
g.set(n.clientX, n.clientY);
|
|
723
837
|
}
|
|
724
|
-
function
|
|
725
|
-
|
|
838
|
+
function ke(n) {
|
|
839
|
+
A(n.clientX, n.clientX), O.set(n.clientX, n.clientY);
|
|
726
840
|
}
|
|
727
|
-
function
|
|
728
|
-
|
|
841
|
+
function Mt(n) {
|
|
842
|
+
Q.set(n.clientX, n.clientY);
|
|
729
843
|
}
|
|
730
|
-
function
|
|
731
|
-
|
|
844
|
+
function St(n) {
|
|
845
|
+
L.set(n.clientX, n.clientY), ee.subVectors(L, g).multiplyScalar(e.rotateSpeed);
|
|
732
846
|
const c = e.domElement;
|
|
733
|
-
|
|
847
|
+
ge(2 * Math.PI * ee.x / c.clientHeight), je(2 * Math.PI * ee.y / c.clientHeight), g.copy(L), e.update();
|
|
734
848
|
}
|
|
735
|
-
function
|
|
736
|
-
|
|
849
|
+
function Xn(n) {
|
|
850
|
+
_.set(n.clientX, n.clientY), T.subVectors(_, O), T.y > 0 ? z(Oe(T.y)) : T.y < 0 && ne(Oe(T.y)), O.copy(_), e.update();
|
|
737
851
|
}
|
|
738
|
-
function
|
|
739
|
-
|
|
852
|
+
function Zn(n) {
|
|
853
|
+
D.set(n.clientX, n.clientY), k.subVectors(D, Q).multiplyScalar(e.panSpeed), B(k.x, k.y), Q.copy(D), e.update();
|
|
740
854
|
}
|
|
741
|
-
function
|
|
742
|
-
|
|
855
|
+
function Fn(n) {
|
|
856
|
+
A(n.clientX, n.clientY), n.deltaY < 0 ? ne(Oe(n.deltaY)) : n.deltaY > 0 && z(Oe(n.deltaY)), e.update();
|
|
743
857
|
}
|
|
744
|
-
function
|
|
858
|
+
function Qn(n) {
|
|
745
859
|
let c = !1;
|
|
746
|
-
switch (
|
|
860
|
+
switch (n.code) {
|
|
747
861
|
case e.keys.UP:
|
|
748
|
-
|
|
862
|
+
n.ctrlKey || n.metaKey || n.shiftKey ? je(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : B(0, e.keyPanSpeed), c = !0;
|
|
749
863
|
break;
|
|
750
864
|
case e.keys.BOTTOM:
|
|
751
|
-
|
|
865
|
+
n.ctrlKey || n.metaKey || n.shiftKey ? je(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : B(0, -e.keyPanSpeed), c = !0;
|
|
752
866
|
break;
|
|
753
867
|
case e.keys.LEFT:
|
|
754
|
-
|
|
868
|
+
n.ctrlKey || n.metaKey || n.shiftKey ? ge(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : B(e.keyPanSpeed, 0), c = !0;
|
|
755
869
|
break;
|
|
756
870
|
case e.keys.RIGHT:
|
|
757
|
-
|
|
871
|
+
n.ctrlKey || n.metaKey || n.shiftKey ? ge(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : B(-e.keyPanSpeed, 0), c = !0;
|
|
758
872
|
break;
|
|
759
873
|
}
|
|
760
|
-
c && (
|
|
874
|
+
c && (n.preventDefault(), e.update());
|
|
761
875
|
}
|
|
762
|
-
function
|
|
763
|
-
if (
|
|
764
|
-
|
|
876
|
+
function Vt(n) {
|
|
877
|
+
if (I.length === 1)
|
|
878
|
+
g.set(n.pageX, n.pageY);
|
|
765
879
|
else {
|
|
766
|
-
const c =
|
|
767
|
-
|
|
880
|
+
const c = Ce(n), w = 0.5 * (n.pageX + c.x), S = 0.5 * (n.pageY + c.y);
|
|
881
|
+
g.set(w, S);
|
|
768
882
|
}
|
|
769
883
|
}
|
|
770
|
-
function
|
|
771
|
-
if (
|
|
772
|
-
|
|
884
|
+
function $t(n) {
|
|
885
|
+
if (I.length === 1)
|
|
886
|
+
Q.set(n.pageX, n.pageY);
|
|
773
887
|
else {
|
|
774
|
-
const c =
|
|
775
|
-
|
|
888
|
+
const c = Ce(n), w = 0.5 * (n.pageX + c.x), S = 0.5 * (n.pageY + c.y);
|
|
889
|
+
Q.set(w, S);
|
|
776
890
|
}
|
|
777
891
|
}
|
|
778
|
-
function
|
|
779
|
-
const c =
|
|
780
|
-
|
|
892
|
+
function Jt(n) {
|
|
893
|
+
const c = Ce(n), w = n.pageX - c.x, S = n.pageY - c.y, N = Math.sqrt(w * w + S * S);
|
|
894
|
+
O.set(0, N);
|
|
781
895
|
}
|
|
782
|
-
function
|
|
783
|
-
e.enableZoom &&
|
|
896
|
+
function qn(n) {
|
|
897
|
+
e.enableZoom && Jt(n), e.enablePan && $t(n);
|
|
784
898
|
}
|
|
785
|
-
function
|
|
786
|
-
e.enableZoom &&
|
|
899
|
+
function Gn(n) {
|
|
900
|
+
e.enableZoom && Jt(n), e.enableRotate && Vt(n);
|
|
787
901
|
}
|
|
788
|
-
function
|
|
789
|
-
if (
|
|
790
|
-
|
|
902
|
+
function en(n) {
|
|
903
|
+
if (I.length == 1)
|
|
904
|
+
L.set(n.pageX, n.pageY);
|
|
791
905
|
else {
|
|
792
|
-
const
|
|
793
|
-
|
|
906
|
+
const w = Ce(n), S = 0.5 * (n.pageX + w.x), N = 0.5 * (n.pageY + w.y);
|
|
907
|
+
L.set(S, N);
|
|
794
908
|
}
|
|
795
|
-
|
|
909
|
+
ee.subVectors(L, g).multiplyScalar(e.rotateSpeed);
|
|
796
910
|
const c = e.domElement;
|
|
797
|
-
|
|
911
|
+
ge(2 * Math.PI * ee.x / c.clientHeight), je(2 * Math.PI * ee.y / c.clientHeight), g.copy(L);
|
|
798
912
|
}
|
|
799
|
-
function
|
|
800
|
-
if (
|
|
801
|
-
|
|
913
|
+
function tn(n) {
|
|
914
|
+
if (I.length === 1)
|
|
915
|
+
D.set(n.pageX, n.pageY);
|
|
802
916
|
else {
|
|
803
|
-
const c =
|
|
804
|
-
|
|
917
|
+
const c = Ce(n), w = 0.5 * (n.pageX + c.x), S = 0.5 * (n.pageY + c.y);
|
|
918
|
+
D.set(w, S);
|
|
805
919
|
}
|
|
806
|
-
k.subVectors(
|
|
920
|
+
k.subVectors(D, Q).multiplyScalar(e.panSpeed), B(k.x, k.y), Q.copy(D);
|
|
807
921
|
}
|
|
808
|
-
function
|
|
809
|
-
const c =
|
|
810
|
-
|
|
811
|
-
const
|
|
812
|
-
|
|
922
|
+
function nn(n) {
|
|
923
|
+
const c = Ce(n), w = n.pageX - c.x, S = n.pageY - c.y, N = Math.sqrt(w * w + S * S);
|
|
924
|
+
_.set(0, N), T.set(0, Math.pow(_.y / O.y, e.zoomSpeed)), z(T.y), O.copy(_);
|
|
925
|
+
const he = (n.pageX + c.x) * 0.5, G = (n.pageY + c.y) * 0.5;
|
|
926
|
+
A(he, G);
|
|
813
927
|
}
|
|
814
|
-
function
|
|
815
|
-
e.enableZoom &&
|
|
928
|
+
function Wn(n) {
|
|
929
|
+
e.enableZoom && nn(n), e.enablePan && tn(n);
|
|
816
930
|
}
|
|
817
|
-
function
|
|
818
|
-
e.enableZoom &&
|
|
931
|
+
function Un(n) {
|
|
932
|
+
e.enableZoom && nn(n), e.enableRotate && en(n);
|
|
819
933
|
}
|
|
820
|
-
function
|
|
821
|
-
e.enabled !== !1 && (
|
|
934
|
+
function sn(n) {
|
|
935
|
+
e.enabled !== !1 && (I.length === 0 && (e.domElement.setPointerCapture(n.pointerId), e.domElement.addEventListener("pointermove", zt), e.domElement.addEventListener("pointerup", Ue)), !ti(n) && (Jn(n), n.pointerType === "touch" ? ln(n) : Kn(n)));
|
|
822
936
|
}
|
|
823
|
-
function
|
|
824
|
-
e.enabled !== !1 && (
|
|
937
|
+
function zt(n) {
|
|
938
|
+
e.enabled !== !1 && (n.pointerType === "touch" ? $n(n) : Bn(n));
|
|
825
939
|
}
|
|
826
|
-
function
|
|
827
|
-
switch (
|
|
940
|
+
function Ue(n) {
|
|
941
|
+
switch (ei(n), I.length) {
|
|
828
942
|
case 0:
|
|
829
|
-
e.domElement.releasePointerCapture(
|
|
943
|
+
e.domElement.releasePointerCapture(n.pointerId), e.domElement.removeEventListener("pointermove", zt), e.domElement.removeEventListener("pointerup", Ue), e.dispatchEvent(Mn), r = a.NONE;
|
|
830
944
|
break;
|
|
831
945
|
case 1:
|
|
832
|
-
const c =
|
|
833
|
-
|
|
946
|
+
const c = I[0], w = we[c];
|
|
947
|
+
ln({ pointerId: c, pageX: w.x, pageY: w.y });
|
|
834
948
|
break;
|
|
835
949
|
}
|
|
836
950
|
}
|
|
837
|
-
function
|
|
951
|
+
function Kn(n) {
|
|
838
952
|
let c;
|
|
839
|
-
switch (
|
|
953
|
+
switch (n.button) {
|
|
840
954
|
case 0:
|
|
841
955
|
c = e.mouseButtons.LEFT;
|
|
842
956
|
break;
|
|
@@ -850,98 +964,98 @@ class _i extends ii {
|
|
|
850
964
|
c = -1;
|
|
851
965
|
}
|
|
852
966
|
switch (c) {
|
|
853
|
-
case
|
|
967
|
+
case Re.DOLLY:
|
|
854
968
|
if (e.enableZoom === !1)
|
|
855
969
|
return;
|
|
856
|
-
|
|
970
|
+
ke(n), r = a.DOLLY;
|
|
857
971
|
break;
|
|
858
|
-
case
|
|
859
|
-
if (
|
|
972
|
+
case Re.ROTATE:
|
|
973
|
+
if (n.ctrlKey || n.metaKey || n.shiftKey) {
|
|
860
974
|
if (e.enablePan === !1)
|
|
861
975
|
return;
|
|
862
|
-
|
|
976
|
+
Mt(n), r = a.PAN;
|
|
863
977
|
} else {
|
|
864
978
|
if (e.enableRotate === !1)
|
|
865
979
|
return;
|
|
866
|
-
|
|
980
|
+
Ee(n), r = a.ROTATE;
|
|
867
981
|
}
|
|
868
982
|
break;
|
|
869
|
-
case
|
|
870
|
-
if (
|
|
983
|
+
case Re.PAN:
|
|
984
|
+
if (n.ctrlKey || n.metaKey || n.shiftKey) {
|
|
871
985
|
if (e.enableRotate === !1)
|
|
872
986
|
return;
|
|
873
|
-
|
|
987
|
+
Ee(n), r = a.ROTATE;
|
|
874
988
|
} else {
|
|
875
989
|
if (e.enablePan === !1)
|
|
876
990
|
return;
|
|
877
|
-
|
|
991
|
+
Mt(n), r = a.PAN;
|
|
878
992
|
}
|
|
879
993
|
break;
|
|
880
994
|
default:
|
|
881
995
|
r = a.NONE;
|
|
882
996
|
}
|
|
883
|
-
r !== a.NONE && e.dispatchEvent(
|
|
997
|
+
r !== a.NONE && e.dispatchEvent(Ft);
|
|
884
998
|
}
|
|
885
|
-
function
|
|
999
|
+
function Bn(n) {
|
|
886
1000
|
switch (r) {
|
|
887
1001
|
case a.ROTATE:
|
|
888
1002
|
if (e.enableRotate === !1)
|
|
889
1003
|
return;
|
|
890
|
-
|
|
1004
|
+
St(n);
|
|
891
1005
|
break;
|
|
892
1006
|
case a.DOLLY:
|
|
893
1007
|
if (e.enableZoom === !1)
|
|
894
1008
|
return;
|
|
895
|
-
|
|
1009
|
+
Xn(n);
|
|
896
1010
|
break;
|
|
897
1011
|
case a.PAN:
|
|
898
1012
|
if (e.enablePan === !1)
|
|
899
1013
|
return;
|
|
900
|
-
|
|
1014
|
+
Zn(n);
|
|
901
1015
|
break;
|
|
902
1016
|
}
|
|
903
1017
|
}
|
|
904
|
-
function
|
|
905
|
-
e.enabled === !1 || e.enableZoom === !1 || r !== a.NONE || (
|
|
1018
|
+
function on(n) {
|
|
1019
|
+
e.enabled === !1 || e.enableZoom === !1 || r !== a.NONE || (n.preventDefault(), e.dispatchEvent(Ft), Fn(Vn(n)), e.dispatchEvent(Mn));
|
|
906
1020
|
}
|
|
907
|
-
function
|
|
908
|
-
const c =
|
|
909
|
-
clientX:
|
|
910
|
-
clientY:
|
|
911
|
-
deltaY:
|
|
1021
|
+
function Vn(n) {
|
|
1022
|
+
const c = n.deltaMode, w = {
|
|
1023
|
+
clientX: n.clientX,
|
|
1024
|
+
clientY: n.clientY,
|
|
1025
|
+
deltaY: n.deltaY
|
|
912
1026
|
};
|
|
913
1027
|
switch (c) {
|
|
914
1028
|
case 1:
|
|
915
|
-
|
|
1029
|
+
w.deltaY *= 16;
|
|
916
1030
|
break;
|
|
917
1031
|
case 2:
|
|
918
|
-
|
|
1032
|
+
w.deltaY *= 100;
|
|
919
1033
|
break;
|
|
920
1034
|
}
|
|
921
|
-
return
|
|
1035
|
+
return n.ctrlKey && !We && (w.deltaY *= 10), w;
|
|
922
1036
|
}
|
|
923
|
-
function
|
|
924
|
-
|
|
1037
|
+
function an(n) {
|
|
1038
|
+
n.key === "Control" && (We = !0, e.domElement.getRootNode().addEventListener("keyup", rn, { passive: !0, capture: !0 }));
|
|
925
1039
|
}
|
|
926
|
-
function
|
|
927
|
-
|
|
1040
|
+
function rn(n) {
|
|
1041
|
+
n.key === "Control" && (We = !1, e.domElement.getRootNode().removeEventListener("keyup", rn, { passive: !0, capture: !0 }));
|
|
928
1042
|
}
|
|
929
|
-
function
|
|
930
|
-
e.enabled === !1 || e.enablePan === !1 ||
|
|
1043
|
+
function Nt(n) {
|
|
1044
|
+
e.enabled === !1 || e.enablePan === !1 || Qn(n);
|
|
931
1045
|
}
|
|
932
|
-
function
|
|
933
|
-
switch (
|
|
1046
|
+
function ln(n) {
|
|
1047
|
+
switch (hn(n), I.length) {
|
|
934
1048
|
case 1:
|
|
935
1049
|
switch (e.touches.ONE) {
|
|
936
|
-
case
|
|
1050
|
+
case Ye.ROTATE:
|
|
937
1051
|
if (e.enableRotate === !1)
|
|
938
1052
|
return;
|
|
939
|
-
|
|
1053
|
+
Vt(n), r = a.TOUCH_ROTATE;
|
|
940
1054
|
break;
|
|
941
|
-
case
|
|
1055
|
+
case Ye.PAN:
|
|
942
1056
|
if (e.enablePan === !1)
|
|
943
1057
|
return;
|
|
944
|
-
|
|
1058
|
+
$t(n), r = a.TOUCH_PAN;
|
|
945
1059
|
break;
|
|
946
1060
|
default:
|
|
947
1061
|
r = a.NONE;
|
|
@@ -949,15 +1063,15 @@ class _i extends ii {
|
|
|
949
1063
|
break;
|
|
950
1064
|
case 2:
|
|
951
1065
|
switch (e.touches.TWO) {
|
|
952
|
-
case
|
|
1066
|
+
case Ye.DOLLY_PAN:
|
|
953
1067
|
if (e.enableZoom === !1 && e.enablePan === !1)
|
|
954
1068
|
return;
|
|
955
|
-
|
|
1069
|
+
qn(n), r = a.TOUCH_DOLLY_PAN;
|
|
956
1070
|
break;
|
|
957
|
-
case
|
|
1071
|
+
case Ye.DOLLY_ROTATE:
|
|
958
1072
|
if (e.enableZoom === !1 && e.enableRotate === !1)
|
|
959
1073
|
return;
|
|
960
|
-
|
|
1074
|
+
Gn(n), r = a.TOUCH_DOLLY_ROTATE;
|
|
961
1075
|
break;
|
|
962
1076
|
default:
|
|
963
1077
|
r = a.NONE;
|
|
@@ -966,465 +1080,465 @@ class _i extends ii {
|
|
|
966
1080
|
default:
|
|
967
1081
|
r = a.NONE;
|
|
968
1082
|
}
|
|
969
|
-
r !== a.NONE && e.dispatchEvent(
|
|
1083
|
+
r !== a.NONE && e.dispatchEvent(Ft);
|
|
970
1084
|
}
|
|
971
|
-
function
|
|
972
|
-
switch (
|
|
1085
|
+
function $n(n) {
|
|
1086
|
+
switch (hn(n), r) {
|
|
973
1087
|
case a.TOUCH_ROTATE:
|
|
974
1088
|
if (e.enableRotate === !1)
|
|
975
1089
|
return;
|
|
976
|
-
|
|
1090
|
+
en(n), e.update();
|
|
977
1091
|
break;
|
|
978
1092
|
case a.TOUCH_PAN:
|
|
979
1093
|
if (e.enablePan === !1)
|
|
980
1094
|
return;
|
|
981
|
-
|
|
1095
|
+
tn(n), e.update();
|
|
982
1096
|
break;
|
|
983
1097
|
case a.TOUCH_DOLLY_PAN:
|
|
984
1098
|
if (e.enableZoom === !1 && e.enablePan === !1)
|
|
985
1099
|
return;
|
|
986
|
-
|
|
1100
|
+
Wn(n), e.update();
|
|
987
1101
|
break;
|
|
988
1102
|
case a.TOUCH_DOLLY_ROTATE:
|
|
989
1103
|
if (e.enableZoom === !1 && e.enableRotate === !1)
|
|
990
1104
|
return;
|
|
991
|
-
|
|
1105
|
+
Un(n), e.update();
|
|
992
1106
|
break;
|
|
993
1107
|
default:
|
|
994
1108
|
r = a.NONE;
|
|
995
1109
|
}
|
|
996
1110
|
}
|
|
997
|
-
function
|
|
998
|
-
e.enabled !== !1 &&
|
|
1111
|
+
function cn(n) {
|
|
1112
|
+
e.enabled !== !1 && n.preventDefault();
|
|
999
1113
|
}
|
|
1000
|
-
function
|
|
1001
|
-
|
|
1114
|
+
function Jn(n) {
|
|
1115
|
+
I.push(n.pointerId);
|
|
1002
1116
|
}
|
|
1003
|
-
function
|
|
1004
|
-
delete
|
|
1005
|
-
for (let c = 0; c <
|
|
1006
|
-
if (
|
|
1007
|
-
|
|
1117
|
+
function ei(n) {
|
|
1118
|
+
delete we[n.pointerId];
|
|
1119
|
+
for (let c = 0; c < I.length; c++)
|
|
1120
|
+
if (I[c] == n.pointerId) {
|
|
1121
|
+
I.splice(c, 1);
|
|
1008
1122
|
return;
|
|
1009
1123
|
}
|
|
1010
1124
|
}
|
|
1011
|
-
function
|
|
1012
|
-
for (let c = 0; c <
|
|
1013
|
-
if (
|
|
1125
|
+
function ti(n) {
|
|
1126
|
+
for (let c = 0; c < I.length; c++)
|
|
1127
|
+
if (I[c] == n.pointerId)
|
|
1014
1128
|
return !0;
|
|
1015
1129
|
return !1;
|
|
1016
1130
|
}
|
|
1017
|
-
function
|
|
1018
|
-
let c =
|
|
1019
|
-
c === void 0 && (c = new
|
|
1131
|
+
function hn(n) {
|
|
1132
|
+
let c = we[n.pointerId];
|
|
1133
|
+
c === void 0 && (c = new V(), we[n.pointerId] = c), c.set(n.pageX, n.pageY);
|
|
1020
1134
|
}
|
|
1021
|
-
function
|
|
1022
|
-
const c =
|
|
1023
|
-
return
|
|
1135
|
+
function Ce(n) {
|
|
1136
|
+
const c = n.pointerId === I[0] ? I[1] : I[0];
|
|
1137
|
+
return we[c];
|
|
1024
1138
|
}
|
|
1025
|
-
e.domElement.addEventListener("contextmenu",
|
|
1139
|
+
e.domElement.addEventListener("contextmenu", cn), e.domElement.addEventListener("pointerdown", sn), e.domElement.addEventListener("pointercancel", Ue), e.domElement.addEventListener("wheel", on, { passive: !1 }), e.domElement.getRootNode().addEventListener("keydown", an, { passive: !0, capture: !0 }), this.update();
|
|
1026
1140
|
}
|
|
1027
1141
|
}
|
|
1028
|
-
const
|
|
1029
|
-
X: new
|
|
1030
|
-
Y: new
|
|
1031
|
-
Z: new
|
|
1032
|
-
},
|
|
1033
|
-
class
|
|
1034
|
-
constructor(
|
|
1142
|
+
const Me = new Ei(), Y = new y(), de = new y(), v = new K(), xn = {
|
|
1143
|
+
X: new y(1, 0, 0),
|
|
1144
|
+
Y: new y(0, 1, 0),
|
|
1145
|
+
Z: new y(0, 0, 1)
|
|
1146
|
+
}, Qt = { type: "change" }, vn = { type: "mouseDown", mode: null }, _n = { type: "mouseUp", mode: null }, Tn = { type: "objectChange" };
|
|
1147
|
+
class Fi extends Gt {
|
|
1148
|
+
constructor(t, o) {
|
|
1035
1149
|
super(), o === void 0 && (console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'), o = document), this.isTransformControls = !0, this.visible = !1, this.domElement = o, this.domElement.style.touchAction = "none";
|
|
1036
|
-
const e = new
|
|
1150
|
+
const e = new Ki();
|
|
1037
1151
|
this._gizmo = e, this.add(e);
|
|
1038
|
-
const a = new
|
|
1152
|
+
const a = new Bi();
|
|
1039
1153
|
this._plane = a, this.add(a);
|
|
1040
1154
|
const r = this;
|
|
1041
|
-
function i(
|
|
1042
|
-
let
|
|
1043
|
-
Object.defineProperty(r,
|
|
1155
|
+
function i(_, T) {
|
|
1156
|
+
let te = T;
|
|
1157
|
+
Object.defineProperty(r, _, {
|
|
1044
1158
|
get: function() {
|
|
1045
|
-
return
|
|
1159
|
+
return te !== void 0 ? te : T;
|
|
1046
1160
|
},
|
|
1047
|
-
set: function(
|
|
1048
|
-
|
|
1161
|
+
set: function(C) {
|
|
1162
|
+
te !== C && (te = C, a[_] = C, e[_] = C, r.dispatchEvent({ type: _ + "-changed", value: C }), r.dispatchEvent(Qt));
|
|
1049
1163
|
}
|
|
1050
|
-
}), r[
|
|
1164
|
+
}), r[_] = T, a[_] = T, e[_] = T;
|
|
1051
1165
|
}
|
|
1052
|
-
i("camera",
|
|
1053
|
-
const l = new
|
|
1054
|
-
i("worldPosition", l), i("worldPositionStart",
|
|
1166
|
+
i("camera", t), i("object", void 0), i("enabled", !0), i("axis", null), i("mode", "translate"), i("translationSnap", null), i("rotationSnap", null), i("scaleSnap", null), i("space", "world"), i("size", 1), i("dragging", !1), i("showX", !0), i("showY", !0), i("showZ", !0);
|
|
1167
|
+
const l = new y(), u = new y(), h = new K(), f = new K(), g = new y(), L = new K(), ee = new y(), Q = new y(), D = new y(), k = 0, O = new y();
|
|
1168
|
+
i("worldPosition", l), i("worldPositionStart", u), i("worldQuaternion", h), i("worldQuaternionStart", f), i("cameraPosition", g), i("cameraQuaternion", L), i("pointStart", ee), i("pointEnd", Q), i("rotationAxis", D), i("rotationAngle", k), i("eye", O), this._offset = new y(), this._startNorm = new y(), this._endNorm = new y(), this._cameraScale = new y(), this._parentPosition = new y(), this._parentQuaternion = new K(), this._parentQuaternionInv = new K(), this._parentScale = new y(), this._worldScaleStart = new y(), this._worldQuaternionInv = new K(), this._worldScale = new y(), this._positionStart = new y(), this._quaternionStart = new K(), this._scaleStart = new y(), this._getPointer = Qi.bind(this), this._onPointerDown = Gi.bind(this), this._onPointerHover = qi.bind(this), this._onPointerMove = Wi.bind(this), this._onPointerUp = Ui.bind(this), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp);
|
|
1055
1169
|
}
|
|
1056
1170
|
// updateMatrixWorld updates key transformation variables
|
|
1057
|
-
updateMatrixWorld(
|
|
1058
|
-
this.object !== void 0 && (this.object.updateMatrixWorld(), this.object.parent === null ? console.error("TransformControls: The attached 3D object must be a part of the scene graph.") : this.object.parent.matrixWorld.decompose(this._parentPosition, this._parentQuaternion, this._parentScale), this.object.matrixWorld.decompose(this.worldPosition, this.worldQuaternion, this._worldScale), this._parentQuaternionInv.copy(this._parentQuaternion).invert(), this._worldQuaternionInv.copy(this.worldQuaternion).invert()), this.camera.updateMatrixWorld(), this.camera.matrixWorld.decompose(this.cameraPosition, this.cameraQuaternion, this._cameraScale), this.camera.isOrthographicCamera ? this.camera.getWorldDirection(this.eye).negate() : this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(), super.updateMatrixWorld(
|
|
1171
|
+
updateMatrixWorld(t) {
|
|
1172
|
+
this.object !== void 0 && (this.object.updateMatrixWorld(), this.object.parent === null ? console.error("TransformControls: The attached 3D object must be a part of the scene graph.") : this.object.parent.matrixWorld.decompose(this._parentPosition, this._parentQuaternion, this._parentScale), this.object.matrixWorld.decompose(this.worldPosition, this.worldQuaternion, this._worldScale), this._parentQuaternionInv.copy(this._parentQuaternion).invert(), this._worldQuaternionInv.copy(this.worldQuaternion).invert()), this.camera.updateMatrixWorld(), this.camera.matrixWorld.decompose(this.cameraPosition, this.cameraQuaternion, this._cameraScale), this.camera.isOrthographicCamera ? this.camera.getWorldDirection(this.eye).negate() : this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(), super.updateMatrixWorld(t);
|
|
1059
1173
|
}
|
|
1060
|
-
pointerHover(
|
|
1174
|
+
pointerHover(t) {
|
|
1061
1175
|
if (this.object === void 0 || this.dragging === !0)
|
|
1062
1176
|
return;
|
|
1063
|
-
|
|
1064
|
-
const o =
|
|
1177
|
+
t !== null && Me.setFromCamera(t, this.camera);
|
|
1178
|
+
const o = qt(this._gizmo.picker[this.mode], Me);
|
|
1065
1179
|
o ? this.axis = o.object.name : this.axis = null;
|
|
1066
1180
|
}
|
|
1067
|
-
pointerDown(
|
|
1068
|
-
if (!(this.object === void 0 || this.dragging === !0 ||
|
|
1069
|
-
|
|
1070
|
-
const o =
|
|
1071
|
-
o && (this.object.updateMatrixWorld(), this.object.parent.updateMatrixWorld(), this._positionStart.copy(this.object.position), this._quaternionStart.copy(this.object.quaternion), this._scaleStart.copy(this.object.scale), this.object.matrixWorld.decompose(this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart), this.pointStart.copy(o.point).sub(this.worldPositionStart)), this.dragging = !0,
|
|
1181
|
+
pointerDown(t) {
|
|
1182
|
+
if (!(this.object === void 0 || this.dragging === !0 || t != null && t.button !== 0) && this.axis !== null) {
|
|
1183
|
+
t !== null && Me.setFromCamera(t, this.camera);
|
|
1184
|
+
const o = qt(this._plane, Me, !0);
|
|
1185
|
+
o && (this.object.updateMatrixWorld(), this.object.parent.updateMatrixWorld(), this._positionStart.copy(this.object.position), this._quaternionStart.copy(this.object.quaternion), this._scaleStart.copy(this.object.scale), this.object.matrixWorld.decompose(this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart), this.pointStart.copy(o.point).sub(this.worldPositionStart)), this.dragging = !0, vn.mode = this.mode, this.dispatchEvent(vn);
|
|
1072
1186
|
}
|
|
1073
1187
|
}
|
|
1074
|
-
pointerMove(
|
|
1188
|
+
pointerMove(t) {
|
|
1075
1189
|
const o = this.axis, e = this.mode, a = this.object;
|
|
1076
1190
|
let r = this.space;
|
|
1077
|
-
if (e === "scale" ? r = "local" : (o === "E" || o === "XYZE" || o === "XYZ") && (r = "world"), a === void 0 || o === null || this.dragging === !1 ||
|
|
1191
|
+
if (e === "scale" ? r = "local" : (o === "E" || o === "XYZE" || o === "XYZ") && (r = "world"), a === void 0 || o === null || this.dragging === !1 || t !== null && t.button !== -1)
|
|
1078
1192
|
return;
|
|
1079
|
-
|
|
1080
|
-
const i =
|
|
1193
|
+
t !== null && Me.setFromCamera(t, this.camera);
|
|
1194
|
+
const i = qt(this._plane, Me, !0);
|
|
1081
1195
|
if (i) {
|
|
1082
1196
|
if (this.pointEnd.copy(i.point).sub(this.worldPositionStart), e === "translate")
|
|
1083
|
-
this._offset.copy(this.pointEnd).sub(this.pointStart), r === "local" && o !== "XYZ" && this._offset.applyQuaternion(this._worldQuaternionInv), o.indexOf("X") === -1 && (this._offset.x = 0), o.indexOf("Y") === -1 && (this._offset.y = 0), o.indexOf("Z") === -1 && (this._offset.z = 0), r === "local" && o !== "XYZ" ? this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale) : this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale), a.position.copy(this._offset).add(this._positionStart), this.translationSnap && (r === "local" && (a.position.applyQuaternion(
|
|
1197
|
+
this._offset.copy(this.pointEnd).sub(this.pointStart), r === "local" && o !== "XYZ" && this._offset.applyQuaternion(this._worldQuaternionInv), o.indexOf("X") === -1 && (this._offset.x = 0), o.indexOf("Y") === -1 && (this._offset.y = 0), o.indexOf("Z") === -1 && (this._offset.z = 0), r === "local" && o !== "XYZ" ? this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale) : this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale), a.position.copy(this._offset).add(this._positionStart), this.translationSnap && (r === "local" && (a.position.applyQuaternion(v.copy(this._quaternionStart).invert()), o.search("X") !== -1 && (a.position.x = Math.round(a.position.x / this.translationSnap) * this.translationSnap), o.search("Y") !== -1 && (a.position.y = Math.round(a.position.y / this.translationSnap) * this.translationSnap), o.search("Z") !== -1 && (a.position.z = Math.round(a.position.z / this.translationSnap) * this.translationSnap), a.position.applyQuaternion(this._quaternionStart)), r === "world" && (a.parent && a.position.add(Y.setFromMatrixPosition(a.parent.matrixWorld)), o.search("X") !== -1 && (a.position.x = Math.round(a.position.x / this.translationSnap) * this.translationSnap), o.search("Y") !== -1 && (a.position.y = Math.round(a.position.y / this.translationSnap) * this.translationSnap), o.search("Z") !== -1 && (a.position.z = Math.round(a.position.z / this.translationSnap) * this.translationSnap), a.parent && a.position.sub(Y.setFromMatrixPosition(a.parent.matrixWorld))));
|
|
1084
1198
|
else if (e === "scale") {
|
|
1085
1199
|
if (o.search("XYZ") !== -1) {
|
|
1086
1200
|
let l = this.pointEnd.length() / this.pointStart.length();
|
|
1087
1201
|
this.pointEnd.dot(this.pointStart) < 0 && (l *= -1), de.set(l, l, l);
|
|
1088
1202
|
} else
|
|
1089
|
-
|
|
1203
|
+
Y.copy(this.pointStart), de.copy(this.pointEnd), Y.applyQuaternion(this._worldQuaternionInv), de.applyQuaternion(this._worldQuaternionInv), de.divide(Y), o.search("X") === -1 && (de.x = 1), o.search("Y") === -1 && (de.y = 1), o.search("Z") === -1 && (de.z = 1);
|
|
1090
1204
|
a.scale.copy(this._scaleStart).multiply(de), this.scaleSnap && (o.search("X") !== -1 && (a.scale.x = Math.round(a.scale.x / this.scaleSnap) * this.scaleSnap || this.scaleSnap), o.search("Y") !== -1 && (a.scale.y = Math.round(a.scale.y / this.scaleSnap) * this.scaleSnap || this.scaleSnap), o.search("Z") !== -1 && (a.scale.z = Math.round(a.scale.z / this.scaleSnap) * this.scaleSnap || this.scaleSnap));
|
|
1091
1205
|
} else if (e === "rotate") {
|
|
1092
1206
|
this._offset.copy(this.pointEnd).sub(this.pointStart);
|
|
1093
|
-
const l = 20 / this.worldPosition.distanceTo(
|
|
1094
|
-
let
|
|
1095
|
-
o === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(
|
|
1207
|
+
const l = 20 / this.worldPosition.distanceTo(Y.setFromMatrixPosition(this.camera.matrixWorld));
|
|
1208
|
+
let u = !1;
|
|
1209
|
+
o === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(Y.copy(this.rotationAxis).cross(this.eye)) * l) : (o === "X" || o === "Y" || o === "Z") && (this.rotationAxis.copy(xn[o]), Y.copy(xn[o]), r === "local" && Y.applyQuaternion(this.worldQuaternion), Y.cross(this.eye), Y.length() === 0 ? u = !0 : this.rotationAngle = this._offset.dot(Y.normalize()) * l), (o === "E" || u) && (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this._startNorm.copy(this.pointStart).normalize(), this._endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this._endNorm.cross(this._startNorm).dot(this.eye) < 0 ? 1 : -1), this.rotationSnap && (this.rotationAngle = Math.round(this.rotationAngle / this.rotationSnap) * this.rotationSnap), r === "local" && o !== "E" && o !== "XYZE" ? (a.quaternion.copy(this._quaternionStart), a.quaternion.multiply(v.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), a.quaternion.copy(v.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), a.quaternion.multiply(this._quaternionStart).normalize());
|
|
1096
1210
|
}
|
|
1097
|
-
this.dispatchEvent(
|
|
1211
|
+
this.dispatchEvent(Qt), this.dispatchEvent(Tn);
|
|
1098
1212
|
}
|
|
1099
1213
|
}
|
|
1100
|
-
pointerUp(
|
|
1101
|
-
|
|
1214
|
+
pointerUp(t) {
|
|
1215
|
+
t !== null && t.button !== 0 || (this.dragging && this.axis !== null && (_n.mode = this.mode, this.dispatchEvent(_n)), this.dragging = !1, this.axis = null);
|
|
1102
1216
|
}
|
|
1103
1217
|
dispose() {
|
|
1104
|
-
this.domElement.removeEventListener("pointerdown", this._onPointerDown), this.domElement.removeEventListener("pointermove", this._onPointerHover), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.traverse(function(
|
|
1105
|
-
|
|
1218
|
+
this.domElement.removeEventListener("pointerdown", this._onPointerDown), this.domElement.removeEventListener("pointermove", this._onPointerHover), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.traverse(function(t) {
|
|
1219
|
+
t.geometry && t.geometry.dispose(), t.material && t.material.dispose();
|
|
1106
1220
|
});
|
|
1107
1221
|
}
|
|
1108
1222
|
// Set current object
|
|
1109
|
-
attach(
|
|
1110
|
-
return this.object =
|
|
1223
|
+
attach(t) {
|
|
1224
|
+
return this.object = t, this.visible = !0, this;
|
|
1111
1225
|
}
|
|
1112
1226
|
// Detach from object
|
|
1113
1227
|
detach() {
|
|
1114
1228
|
return this.object = void 0, this.visible = !1, this.axis = null, this;
|
|
1115
1229
|
}
|
|
1116
1230
|
reset() {
|
|
1117
|
-
this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(
|
|
1231
|
+
this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(Qt), this.dispatchEvent(Tn), this.pointStart.copy(this.pointEnd));
|
|
1118
1232
|
}
|
|
1119
1233
|
getRaycaster() {
|
|
1120
|
-
return
|
|
1234
|
+
return Me;
|
|
1121
1235
|
}
|
|
1122
1236
|
// TODO: deprecate
|
|
1123
1237
|
getMode() {
|
|
1124
1238
|
return this.mode;
|
|
1125
1239
|
}
|
|
1126
|
-
setMode(
|
|
1127
|
-
this.mode =
|
|
1240
|
+
setMode(t) {
|
|
1241
|
+
this.mode = t;
|
|
1128
1242
|
}
|
|
1129
|
-
setTranslationSnap(
|
|
1130
|
-
this.translationSnap =
|
|
1243
|
+
setTranslationSnap(t) {
|
|
1244
|
+
this.translationSnap = t;
|
|
1131
1245
|
}
|
|
1132
|
-
setRotationSnap(
|
|
1133
|
-
this.rotationSnap =
|
|
1246
|
+
setRotationSnap(t) {
|
|
1247
|
+
this.rotationSnap = t;
|
|
1134
1248
|
}
|
|
1135
|
-
setScaleSnap(
|
|
1136
|
-
this.scaleSnap =
|
|
1249
|
+
setScaleSnap(t) {
|
|
1250
|
+
this.scaleSnap = t;
|
|
1137
1251
|
}
|
|
1138
|
-
setSize(
|
|
1139
|
-
this.size =
|
|
1252
|
+
setSize(t) {
|
|
1253
|
+
this.size = t;
|
|
1140
1254
|
}
|
|
1141
|
-
setSpace(
|
|
1142
|
-
this.space =
|
|
1255
|
+
setSpace(t) {
|
|
1256
|
+
this.space = t;
|
|
1143
1257
|
}
|
|
1144
1258
|
}
|
|
1145
|
-
function
|
|
1259
|
+
function Qi(m) {
|
|
1146
1260
|
if (this.domElement.ownerDocument.pointerLockElement)
|
|
1147
1261
|
return {
|
|
1148
1262
|
x: 0,
|
|
1149
1263
|
y: 0,
|
|
1150
|
-
button:
|
|
1264
|
+
button: m.button
|
|
1151
1265
|
};
|
|
1152
1266
|
{
|
|
1153
|
-
const
|
|
1267
|
+
const t = this.domElement.getBoundingClientRect();
|
|
1154
1268
|
return {
|
|
1155
|
-
x: (
|
|
1156
|
-
y: -(
|
|
1157
|
-
button:
|
|
1269
|
+
x: (m.clientX - t.left) / t.width * 2 - 1,
|
|
1270
|
+
y: -(m.clientY - t.top) / t.height * 2 + 1,
|
|
1271
|
+
button: m.button
|
|
1158
1272
|
};
|
|
1159
1273
|
}
|
|
1160
1274
|
}
|
|
1161
|
-
function
|
|
1275
|
+
function qi(m) {
|
|
1162
1276
|
if (this.enabled)
|
|
1163
|
-
switch (
|
|
1277
|
+
switch (m.pointerType) {
|
|
1164
1278
|
case "mouse":
|
|
1165
1279
|
case "pen":
|
|
1166
|
-
this.pointerHover(this._getPointer(
|
|
1280
|
+
this.pointerHover(this._getPointer(m));
|
|
1167
1281
|
break;
|
|
1168
1282
|
}
|
|
1169
1283
|
}
|
|
1170
|
-
function
|
|
1171
|
-
this.enabled && (document.pointerLockElement || this.domElement.setPointerCapture(
|
|
1284
|
+
function Gi(m) {
|
|
1285
|
+
this.enabled && (document.pointerLockElement || this.domElement.setPointerCapture(m.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.pointerHover(this._getPointer(m)), this.pointerDown(this._getPointer(m)));
|
|
1172
1286
|
}
|
|
1173
|
-
function
|
|
1174
|
-
this.enabled && this.pointerMove(this._getPointer(
|
|
1287
|
+
function Wi(m) {
|
|
1288
|
+
this.enabled && this.pointerMove(this._getPointer(m));
|
|
1175
1289
|
}
|
|
1176
|
-
function
|
|
1177
|
-
this.enabled && (this.domElement.releasePointerCapture(
|
|
1290
|
+
function Ui(m) {
|
|
1291
|
+
this.enabled && (this.domElement.releasePointerCapture(m.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.pointerUp(this._getPointer(m)));
|
|
1178
1292
|
}
|
|
1179
|
-
function
|
|
1180
|
-
const e =
|
|
1293
|
+
function qt(m, t, o) {
|
|
1294
|
+
const e = t.intersectObject(m, !0);
|
|
1181
1295
|
for (let a = 0; a < e.length; a++)
|
|
1182
1296
|
if (e[a].object.visible || o)
|
|
1183
1297
|
return e[a];
|
|
1184
1298
|
return !1;
|
|
1185
1299
|
}
|
|
1186
|
-
const
|
|
1187
|
-
class
|
|
1300
|
+
const Tt = new Pi(), M = new y(0, 1, 0), In = new y(0, 0, 0), An = new Dn(), It = new K(), Dt = new K(), J = new y(), Ln = new Dn(), et = new y(1, 0, 0), ve = new y(0, 1, 0), tt = new y(0, 0, 1), At = new y(), $e = new y(), Je = new y();
|
|
1301
|
+
class Ki extends Gt {
|
|
1188
1302
|
constructor() {
|
|
1189
1303
|
super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
|
|
1190
|
-
const
|
|
1304
|
+
const t = new On({
|
|
1191
1305
|
depthTest: !1,
|
|
1192
1306
|
depthWrite: !1,
|
|
1193
1307
|
fog: !1,
|
|
1194
1308
|
toneMapped: !1,
|
|
1195
1309
|
transparent: !0
|
|
1196
|
-
}), o = new
|
|
1310
|
+
}), o = new Mi({
|
|
1197
1311
|
depthTest: !1,
|
|
1198
1312
|
depthWrite: !1,
|
|
1199
1313
|
fog: !1,
|
|
1200
1314
|
toneMapped: !1,
|
|
1201
1315
|
transparent: !0
|
|
1202
|
-
}), e =
|
|
1316
|
+
}), e = t.clone();
|
|
1203
1317
|
e.opacity = 0.15;
|
|
1204
1318
|
const a = o.clone();
|
|
1205
1319
|
a.opacity = 0.5;
|
|
1206
|
-
const r =
|
|
1320
|
+
const r = t.clone();
|
|
1207
1321
|
r.color.setHex(16711680);
|
|
1208
|
-
const i =
|
|
1322
|
+
const i = t.clone();
|
|
1209
1323
|
i.color.setHex(65280);
|
|
1210
|
-
const l =
|
|
1324
|
+
const l = t.clone();
|
|
1211
1325
|
l.color.setHex(255);
|
|
1212
|
-
const
|
|
1213
|
-
|
|
1214
|
-
const
|
|
1215
|
-
|
|
1216
|
-
const
|
|
1217
|
-
|
|
1218
|
-
const
|
|
1219
|
-
|
|
1220
|
-
const
|
|
1221
|
-
|
|
1222
|
-
const
|
|
1223
|
-
|
|
1224
|
-
const
|
|
1225
|
-
|
|
1226
|
-
const k = new
|
|
1326
|
+
const u = t.clone();
|
|
1327
|
+
u.color.setHex(16711680), u.opacity = 0.5;
|
|
1328
|
+
const h = t.clone();
|
|
1329
|
+
h.color.setHex(65280), h.opacity = 0.5;
|
|
1330
|
+
const f = t.clone();
|
|
1331
|
+
f.color.setHex(255), f.opacity = 0.5;
|
|
1332
|
+
const g = t.clone();
|
|
1333
|
+
g.opacity = 0.25;
|
|
1334
|
+
const L = t.clone();
|
|
1335
|
+
L.color.setHex(16776960), L.opacity = 0.25, t.clone().color.setHex(16776960);
|
|
1336
|
+
const Q = t.clone();
|
|
1337
|
+
Q.color.setHex(7895160);
|
|
1338
|
+
const D = new F(0, 0.04, 0.1, 12);
|
|
1339
|
+
D.translate(0, 0.05, 0);
|
|
1340
|
+
const k = new X(0.08, 0.08, 0.08);
|
|
1227
1341
|
k.translate(0, 0.04, 0);
|
|
1228
|
-
const
|
|
1229
|
-
|
|
1230
|
-
const
|
|
1231
|
-
|
|
1232
|
-
function
|
|
1233
|
-
const
|
|
1234
|
-
return
|
|
1342
|
+
const O = new wn();
|
|
1343
|
+
O.setAttribute("position", new gn([0, 0, 0, 1, 0, 0], 3));
|
|
1344
|
+
const _ = new F(75e-4, 75e-4, 0.5, 3);
|
|
1345
|
+
_.translate(0, 0.25, 0);
|
|
1346
|
+
function T(H, B) {
|
|
1347
|
+
const z = new Ve(H, 75e-4, 3, 64, B * Math.PI * 2);
|
|
1348
|
+
return z.rotateY(Math.PI / 2), z.rotateX(Math.PI / 2), z;
|
|
1235
1349
|
}
|
|
1236
|
-
function
|
|
1237
|
-
const
|
|
1238
|
-
return
|
|
1350
|
+
function te() {
|
|
1351
|
+
const H = new wn();
|
|
1352
|
+
return H.setAttribute("position", new gn([0, 0, 0, 1, 1, 1], 3)), H;
|
|
1239
1353
|
}
|
|
1240
|
-
const
|
|
1354
|
+
const C = {
|
|
1241
1355
|
X: [
|
|
1242
|
-
[new
|
|
1243
|
-
[new
|
|
1244
|
-
[new
|
|
1356
|
+
[new p(D, r), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
|
|
1357
|
+
[new p(D, r), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
|
|
1358
|
+
[new p(_, r), [0, 0, 0], [0, 0, -Math.PI / 2]]
|
|
1245
1359
|
],
|
|
1246
1360
|
Y: [
|
|
1247
|
-
[new
|
|
1248
|
-
[new
|
|
1249
|
-
[new
|
|
1361
|
+
[new p(D, i), [0, 0.5, 0]],
|
|
1362
|
+
[new p(D, i), [0, -0.5, 0], [Math.PI, 0, 0]],
|
|
1363
|
+
[new p(_, i)]
|
|
1250
1364
|
],
|
|
1251
1365
|
Z: [
|
|
1252
|
-
[new
|
|
1253
|
-
[new
|
|
1254
|
-
[new
|
|
1366
|
+
[new p(D, l), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
|
|
1367
|
+
[new p(D, l), [0, 0, -0.5], [-Math.PI / 2, 0, 0]],
|
|
1368
|
+
[new p(_, l), null, [Math.PI / 2, 0, 0]]
|
|
1255
1369
|
],
|
|
1256
1370
|
XYZ: [
|
|
1257
|
-
[new
|
|
1371
|
+
[new p(new vt(0.1, 0), g.clone()), [0, 0, 0]]
|
|
1258
1372
|
],
|
|
1259
1373
|
XY: [
|
|
1260
|
-
[new
|
|
1374
|
+
[new p(new X(0.15, 0.15, 0.01), f.clone()), [0.15, 0.15, 0]]
|
|
1261
1375
|
],
|
|
1262
1376
|
YZ: [
|
|
1263
|
-
[new
|
|
1377
|
+
[new p(new X(0.15, 0.15, 0.01), u.clone()), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
|
|
1264
1378
|
],
|
|
1265
1379
|
XZ: [
|
|
1266
|
-
[new
|
|
1380
|
+
[new p(new X(0.15, 0.15, 0.01), h.clone()), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
|
|
1267
1381
|
]
|
|
1268
|
-
},
|
|
1382
|
+
}, De = {
|
|
1269
1383
|
X: [
|
|
1270
|
-
[new
|
|
1271
|
-
[new
|
|
1384
|
+
[new p(new F(0.2, 0, 0.6, 4), e), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
|
|
1385
|
+
[new p(new F(0.2, 0, 0.6, 4), e), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
|
|
1272
1386
|
],
|
|
1273
1387
|
Y: [
|
|
1274
|
-
[new
|
|
1275
|
-
[new
|
|
1388
|
+
[new p(new F(0.2, 0, 0.6, 4), e), [0, 0.3, 0]],
|
|
1389
|
+
[new p(new F(0.2, 0, 0.6, 4), e), [0, -0.3, 0], [0, 0, Math.PI]]
|
|
1276
1390
|
],
|
|
1277
1391
|
Z: [
|
|
1278
|
-
[new
|
|
1279
|
-
[new
|
|
1392
|
+
[new p(new F(0.2, 0, 0.6, 4), e), [0, 0, 0.3], [Math.PI / 2, 0, 0]],
|
|
1393
|
+
[new p(new F(0.2, 0, 0.6, 4), e), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
|
|
1280
1394
|
],
|
|
1281
1395
|
XYZ: [
|
|
1282
|
-
[new
|
|
1396
|
+
[new p(new vt(0.2, 0), e)]
|
|
1283
1397
|
],
|
|
1284
1398
|
XY: [
|
|
1285
|
-
[new
|
|
1399
|
+
[new p(new X(0.2, 0.2, 0.01), e), [0.15, 0.15, 0]]
|
|
1286
1400
|
],
|
|
1287
1401
|
YZ: [
|
|
1288
|
-
[new
|
|
1402
|
+
[new p(new X(0.2, 0.2, 0.01), e), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
|
|
1289
1403
|
],
|
|
1290
1404
|
XZ: [
|
|
1291
|
-
[new
|
|
1405
|
+
[new p(new X(0.2, 0.2, 0.01), e), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
|
|
1292
1406
|
]
|
|
1293
|
-
},
|
|
1407
|
+
}, I = {
|
|
1294
1408
|
START: [
|
|
1295
|
-
[new
|
|
1409
|
+
[new p(new vt(0.01, 2), a), null, null, null, "helper"]
|
|
1296
1410
|
],
|
|
1297
1411
|
END: [
|
|
1298
|
-
[new
|
|
1412
|
+
[new p(new vt(0.01, 2), a), null, null, null, "helper"]
|
|
1299
1413
|
],
|
|
1300
1414
|
DELTA: [
|
|
1301
|
-
[new me(
|
|
1415
|
+
[new me(te(), a), null, null, null, "helper"]
|
|
1302
1416
|
],
|
|
1303
1417
|
X: [
|
|
1304
|
-
[new me(
|
|
1418
|
+
[new me(O, a.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
|
1305
1419
|
],
|
|
1306
1420
|
Y: [
|
|
1307
|
-
[new me(
|
|
1421
|
+
[new me(O, a.clone()), [0, -1e3, 0], [0, 0, Math.PI / 2], [1e6, 1, 1], "helper"]
|
|
1308
1422
|
],
|
|
1309
1423
|
Z: [
|
|
1310
|
-
[new me(
|
|
1424
|
+
[new me(O, a.clone()), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
|
|
1311
1425
|
]
|
|
1312
|
-
},
|
|
1426
|
+
}, we = {
|
|
1313
1427
|
XYZE: [
|
|
1314
|
-
[new
|
|
1428
|
+
[new p(T(0.5, 1), Q), null, [0, Math.PI / 2, 0]]
|
|
1315
1429
|
],
|
|
1316
1430
|
X: [
|
|
1317
|
-
[new
|
|
1431
|
+
[new p(T(0.5, 0.5), r)]
|
|
1318
1432
|
],
|
|
1319
1433
|
Y: [
|
|
1320
|
-
[new
|
|
1434
|
+
[new p(T(0.5, 0.5), i), null, [0, 0, -Math.PI / 2]]
|
|
1321
1435
|
],
|
|
1322
1436
|
Z: [
|
|
1323
|
-
[new
|
|
1437
|
+
[new p(T(0.5, 0.5), l), null, [0, Math.PI / 2, 0]]
|
|
1324
1438
|
],
|
|
1325
1439
|
E: [
|
|
1326
|
-
[new
|
|
1440
|
+
[new p(T(0.75, 1), L), null, [0, Math.PI / 2, 0]]
|
|
1327
1441
|
]
|
|
1328
|
-
},
|
|
1442
|
+
}, We = {
|
|
1329
1443
|
AXIS: [
|
|
1330
|
-
[new me(
|
|
1444
|
+
[new me(O, a.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
|
1331
1445
|
]
|
|
1332
|
-
},
|
|
1446
|
+
}, Ht = {
|
|
1333
1447
|
XYZE: [
|
|
1334
|
-
[new
|
|
1448
|
+
[new p(new Si(0.25, 10, 8), e)]
|
|
1335
1449
|
],
|
|
1336
1450
|
X: [
|
|
1337
|
-
[new
|
|
1451
|
+
[new p(new Ve(0.5, 0.1, 4, 24), e), [0, 0, 0], [0, -Math.PI / 2, -Math.PI / 2]]
|
|
1338
1452
|
],
|
|
1339
1453
|
Y: [
|
|
1340
|
-
[new
|
|
1454
|
+
[new p(new Ve(0.5, 0.1, 4, 24), e), [0, 0, 0], [Math.PI / 2, 0, 0]]
|
|
1341
1455
|
],
|
|
1342
1456
|
Z: [
|
|
1343
|
-
[new
|
|
1457
|
+
[new p(new Ve(0.5, 0.1, 4, 24), e), [0, 0, 0], [0, 0, -Math.PI / 2]]
|
|
1344
1458
|
],
|
|
1345
1459
|
E: [
|
|
1346
|
-
[new
|
|
1460
|
+
[new p(new Ve(0.75, 0.1, 2, 24), e)]
|
|
1347
1461
|
]
|
|
1348
|
-
},
|
|
1462
|
+
}, Oe = {
|
|
1349
1463
|
X: [
|
|
1350
|
-
[new
|
|
1351
|
-
[new
|
|
1352
|
-
[new
|
|
1464
|
+
[new p(k, r), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
|
|
1465
|
+
[new p(_, r), [0, 0, 0], [0, 0, -Math.PI / 2]],
|
|
1466
|
+
[new p(k, r), [-0.5, 0, 0], [0, 0, Math.PI / 2]]
|
|
1353
1467
|
],
|
|
1354
1468
|
Y: [
|
|
1355
|
-
[new
|
|
1356
|
-
[new
|
|
1357
|
-
[new
|
|
1469
|
+
[new p(k, i), [0, 0.5, 0]],
|
|
1470
|
+
[new p(_, i)],
|
|
1471
|
+
[new p(k, i), [0, -0.5, 0], [0, 0, Math.PI]]
|
|
1358
1472
|
],
|
|
1359
1473
|
Z: [
|
|
1360
|
-
[new
|
|
1361
|
-
[new
|
|
1362
|
-
[new
|
|
1474
|
+
[new p(k, l), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
|
|
1475
|
+
[new p(_, l), [0, 0, 0], [Math.PI / 2, 0, 0]],
|
|
1476
|
+
[new p(k, l), [0, 0, -0.5], [-Math.PI / 2, 0, 0]]
|
|
1363
1477
|
],
|
|
1364
1478
|
XY: [
|
|
1365
|
-
[new
|
|
1479
|
+
[new p(new X(0.15, 0.15, 0.01), f), [0.15, 0.15, 0]]
|
|
1366
1480
|
],
|
|
1367
1481
|
YZ: [
|
|
1368
|
-
[new
|
|
1482
|
+
[new p(new X(0.15, 0.15, 0.01), u), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
|
|
1369
1483
|
],
|
|
1370
1484
|
XZ: [
|
|
1371
|
-
[new
|
|
1485
|
+
[new p(new X(0.15, 0.15, 0.01), h), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
|
|
1372
1486
|
],
|
|
1373
1487
|
XYZ: [
|
|
1374
|
-
[new
|
|
1488
|
+
[new p(new X(0.1, 0.1, 0.1), g.clone())]
|
|
1375
1489
|
]
|
|
1376
|
-
},
|
|
1490
|
+
}, ge = {
|
|
1377
1491
|
X: [
|
|
1378
|
-
[new
|
|
1379
|
-
[new
|
|
1492
|
+
[new p(new F(0.2, 0, 0.6, 4), e), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
|
|
1493
|
+
[new p(new F(0.2, 0, 0.6, 4), e), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
|
|
1380
1494
|
],
|
|
1381
1495
|
Y: [
|
|
1382
|
-
[new
|
|
1383
|
-
[new
|
|
1496
|
+
[new p(new F(0.2, 0, 0.6, 4), e), [0, 0.3, 0]],
|
|
1497
|
+
[new p(new F(0.2, 0, 0.6, 4), e), [0, -0.3, 0], [0, 0, Math.PI]]
|
|
1384
1498
|
],
|
|
1385
1499
|
Z: [
|
|
1386
|
-
[new
|
|
1387
|
-
[new
|
|
1500
|
+
[new p(new F(0.2, 0, 0.6, 4), e), [0, 0, 0.3], [Math.PI / 2, 0, 0]],
|
|
1501
|
+
[new p(new F(0.2, 0, 0.6, 4), e), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
|
|
1388
1502
|
],
|
|
1389
1503
|
XY: [
|
|
1390
|
-
[new
|
|
1504
|
+
[new p(new X(0.2, 0.2, 0.01), e), [0.15, 0.15, 0]]
|
|
1391
1505
|
],
|
|
1392
1506
|
YZ: [
|
|
1393
|
-
[new
|
|
1507
|
+
[new p(new X(0.2, 0.2, 0.01), e), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
|
|
1394
1508
|
],
|
|
1395
1509
|
XZ: [
|
|
1396
|
-
[new
|
|
1510
|
+
[new p(new X(0.2, 0.2, 0.01), e), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
|
|
1397
1511
|
],
|
|
1398
1512
|
XYZ: [
|
|
1399
|
-
[new
|
|
1513
|
+
[new p(new X(0.2, 0.2, 0.2), e), [0, 0, 0]]
|
|
1400
1514
|
]
|
|
1401
|
-
},
|
|
1515
|
+
}, je = {
|
|
1402
1516
|
X: [
|
|
1403
|
-
[new me(
|
|
1517
|
+
[new me(O, a.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
|
1404
1518
|
],
|
|
1405
1519
|
Y: [
|
|
1406
|
-
[new me(
|
|
1520
|
+
[new me(O, a.clone()), [0, -1e3, 0], [0, 0, Math.PI / 2], [1e6, 1, 1], "helper"]
|
|
1407
1521
|
],
|
|
1408
1522
|
Z: [
|
|
1409
|
-
[new me(
|
|
1523
|
+
[new me(O, a.clone()), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
|
|
1410
1524
|
]
|
|
1411
1525
|
};
|
|
1412
|
-
function
|
|
1413
|
-
const
|
|
1414
|
-
for (const
|
|
1415
|
-
for (let
|
|
1416
|
-
const
|
|
1417
|
-
|
|
1418
|
-
const
|
|
1419
|
-
|
|
1526
|
+
function q(H) {
|
|
1527
|
+
const B = new Gt();
|
|
1528
|
+
for (const z in H)
|
|
1529
|
+
for (let ne = H[z].length; ne--; ) {
|
|
1530
|
+
const A = H[z][ne][0].clone(), ce = H[z][ne][1], Ee = H[z][ne][2], ke = H[z][ne][3], Mt = H[z][ne][4];
|
|
1531
|
+
A.name = z, A.tag = Mt, ce && A.position.set(ce[0], ce[1], ce[2]), Ee && A.rotation.set(Ee[0], Ee[1], Ee[2]), ke && A.scale.set(ke[0], ke[1], ke[2]), A.updateMatrix();
|
|
1532
|
+
const St = A.geometry.clone();
|
|
1533
|
+
St.applyMatrix4(A.matrix), A.geometry = St, A.renderOrder = 1 / 0, A.position.set(0, 0, 0), A.rotation.set(0, 0, 0), A.scale.set(1, 1, 1), B.add(A);
|
|
1420
1534
|
}
|
|
1421
|
-
return
|
|
1535
|
+
return B;
|
|
1422
1536
|
}
|
|
1423
|
-
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate =
|
|
1537
|
+
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = q(C)), this.add(this.gizmo.rotate = q(we)), this.add(this.gizmo.scale = q(Oe)), this.add(this.picker.translate = q(De)), this.add(this.picker.rotate = q(Ht)), this.add(this.picker.scale = q(ge)), this.add(this.helper.translate = q(I)), this.add(this.helper.rotate = q(We)), this.add(this.helper.scale = q(je)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
|
|
1424
1538
|
}
|
|
1425
1539
|
// updateMatrixWorld will update transformations and appearance of individual handles
|
|
1426
|
-
updateMatrixWorld(
|
|
1427
|
-
const e = (this.mode === "scale" ? "local" : this.space) === "local" ? this.worldQuaternion :
|
|
1540
|
+
updateMatrixWorld(t) {
|
|
1541
|
+
const e = (this.mode === "scale" ? "local" : this.space) === "local" ? this.worldQuaternion : Dt;
|
|
1428
1542
|
this.gizmo.translate.visible = this.mode === "translate", this.gizmo.rotate.visible = this.mode === "rotate", this.gizmo.scale.visible = this.mode === "scale", this.helper.translate.visible = this.mode === "translate", this.helper.rotate.visible = this.mode === "rotate", this.helper.scale.visible = this.mode === "scale";
|
|
1429
1543
|
let a = [];
|
|
1430
1544
|
a = a.concat(this.picker[this.mode].children), a = a.concat(this.gizmo[this.mode].children), a = a.concat(this.helper[this.mode].children);
|
|
@@ -1433,99 +1547,98 @@ class ki extends Rt {
|
|
|
1433
1547
|
i.visible = !0, i.rotation.set(0, 0, 0), i.position.copy(this.worldPosition);
|
|
1434
1548
|
let l;
|
|
1435
1549
|
if (this.camera.isOrthographicCamera ? l = (this.camera.top - this.camera.bottom) / this.camera.zoom : l = this.worldPosition.distanceTo(this.cameraPosition) * Math.min(1.9 * Math.tan(Math.PI * this.camera.fov / 360) / this.camera.zoom, 7), i.scale.set(1, 1, 1).multiplyScalar(l * this.size / 4), i.tag === "helper") {
|
|
1436
|
-
i.visible = !1, i.name === "AXIS" ? (i.visible = !!this.axis, this.axis === "X" && (
|
|
1550
|
+
i.visible = !1, i.name === "AXIS" ? (i.visible = !!this.axis, this.axis === "X" && (v.setFromEuler(Tt.set(0, 0, 0)), i.quaternion.copy(e).multiply(v), Math.abs(M.copy(et).applyQuaternion(e).dot(this.eye)) > 0.9 && (i.visible = !1)), this.axis === "Y" && (v.setFromEuler(Tt.set(0, 0, Math.PI / 2)), i.quaternion.copy(e).multiply(v), Math.abs(M.copy(ve).applyQuaternion(e).dot(this.eye)) > 0.9 && (i.visible = !1)), this.axis === "Z" && (v.setFromEuler(Tt.set(0, Math.PI / 2, 0)), i.quaternion.copy(e).multiply(v), Math.abs(M.copy(tt).applyQuaternion(e).dot(this.eye)) > 0.9 && (i.visible = !1)), this.axis === "XYZE" && (v.setFromEuler(Tt.set(0, Math.PI / 2, 0)), M.copy(this.rotationAxis), i.quaternion.setFromRotationMatrix(An.lookAt(In, M, ve)), i.quaternion.multiply(v), i.visible = this.dragging), this.axis === "E" && (i.visible = !1)) : i.name === "START" ? (i.position.copy(this.worldPositionStart), i.visible = this.dragging) : i.name === "END" ? (i.position.copy(this.worldPosition), i.visible = this.dragging) : i.name === "DELTA" ? (i.position.copy(this.worldPositionStart), i.quaternion.copy(this.worldQuaternionStart), Y.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), Y.applyQuaternion(this.worldQuaternionStart.clone().invert()), i.scale.copy(Y), i.visible = this.dragging) : (i.quaternion.copy(e), this.dragging ? i.position.copy(this.worldPositionStart) : i.position.copy(this.worldPosition), this.axis && (i.visible = this.axis.search(i.name) !== -1));
|
|
1437
1551
|
continue;
|
|
1438
1552
|
}
|
|
1439
|
-
i.quaternion.copy(e), this.mode === "translate" || this.mode === "scale" ? (i.name === "X" && Math.abs(
|
|
1440
|
-
return i.name ===
|
|
1553
|
+
i.quaternion.copy(e), this.mode === "translate" || this.mode === "scale" ? (i.name === "X" && Math.abs(M.copy(et).applyQuaternion(e).dot(this.eye)) > 0.99 && (i.scale.set(1e-10, 1e-10, 1e-10), i.visible = !1), i.name === "Y" && Math.abs(M.copy(ve).applyQuaternion(e).dot(this.eye)) > 0.99 && (i.scale.set(1e-10, 1e-10, 1e-10), i.visible = !1), i.name === "Z" && Math.abs(M.copy(tt).applyQuaternion(e).dot(this.eye)) > 0.99 && (i.scale.set(1e-10, 1e-10, 1e-10), i.visible = !1), i.name === "XY" && Math.abs(M.copy(tt).applyQuaternion(e).dot(this.eye)) < 0.2 && (i.scale.set(1e-10, 1e-10, 1e-10), i.visible = !1), i.name === "YZ" && Math.abs(M.copy(et).applyQuaternion(e).dot(this.eye)) < 0.2 && (i.scale.set(1e-10, 1e-10, 1e-10), i.visible = !1), i.name === "XZ" && Math.abs(M.copy(ve).applyQuaternion(e).dot(this.eye)) < 0.2 && (i.scale.set(1e-10, 1e-10, 1e-10), i.visible = !1)) : this.mode === "rotate" && (It.copy(e), M.copy(this.eye).applyQuaternion(v.copy(e).invert()), i.name.search("E") !== -1 && i.quaternion.setFromRotationMatrix(An.lookAt(this.eye, In, ve)), i.name === "X" && (v.setFromAxisAngle(et, Math.atan2(-M.y, M.z)), v.multiplyQuaternions(It, v), i.quaternion.copy(v)), i.name === "Y" && (v.setFromAxisAngle(ve, Math.atan2(M.x, M.z)), v.multiplyQuaternions(It, v), i.quaternion.copy(v)), i.name === "Z" && (v.setFromAxisAngle(tt, Math.atan2(M.y, M.x)), v.multiplyQuaternions(It, v), i.quaternion.copy(v))), i.visible = i.visible && (i.name.indexOf("X") === -1 || this.showX), i.visible = i.visible && (i.name.indexOf("Y") === -1 || this.showY), i.visible = i.visible && (i.name.indexOf("Z") === -1 || this.showZ), i.visible = i.visible && (i.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), i.material._color = i.material._color || i.material.color.clone(), i.material._opacity = i.material._opacity || i.material.opacity, i.material.color.copy(i.material._color), i.material.opacity = i.material._opacity, this.enabled && this.axis && (i.name === this.axis || this.axis.split("").some(function(u) {
|
|
1554
|
+
return i.name === u;
|
|
1441
1555
|
})) && (i.material.color.setHex(16776960), i.material.opacity = 1);
|
|
1442
1556
|
}
|
|
1443
|
-
super.updateMatrixWorld(
|
|
1557
|
+
super.updateMatrixWorld(t);
|
|
1444
1558
|
}
|
|
1445
1559
|
}
|
|
1446
|
-
class
|
|
1560
|
+
class Bi extends p {
|
|
1447
1561
|
constructor() {
|
|
1448
1562
|
super(
|
|
1449
|
-
new
|
|
1450
|
-
new
|
|
1563
|
+
new xi(1e5, 1e5, 2, 2),
|
|
1564
|
+
new On({ visible: !1, wireframe: !0, side: vi, transparent: !0, opacity: 0.1, toneMapped: !1 })
|
|
1451
1565
|
), this.isTransformControlsPlane = !0, this.type = "TransformControlsPlane";
|
|
1452
1566
|
}
|
|
1453
|
-
updateMatrixWorld(
|
|
1567
|
+
updateMatrixWorld(t) {
|
|
1454
1568
|
let o = this.space;
|
|
1455
|
-
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (o = "local"),
|
|
1569
|
+
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (o = "local"), At.copy(et).applyQuaternion(o === "local" ? this.worldQuaternion : Dt), $e.copy(ve).applyQuaternion(o === "local" ? this.worldQuaternion : Dt), Je.copy(tt).applyQuaternion(o === "local" ? this.worldQuaternion : Dt), M.copy($e), this.mode) {
|
|
1456
1570
|
case "translate":
|
|
1457
1571
|
case "scale":
|
|
1458
1572
|
switch (this.axis) {
|
|
1459
1573
|
case "X":
|
|
1460
|
-
|
|
1574
|
+
M.copy(this.eye).cross(At), J.copy(At).cross(M);
|
|
1461
1575
|
break;
|
|
1462
1576
|
case "Y":
|
|
1463
|
-
|
|
1577
|
+
M.copy(this.eye).cross($e), J.copy($e).cross(M);
|
|
1464
1578
|
break;
|
|
1465
1579
|
case "Z":
|
|
1466
|
-
|
|
1580
|
+
M.copy(this.eye).cross(Je), J.copy(Je).cross(M);
|
|
1467
1581
|
break;
|
|
1468
1582
|
case "XY":
|
|
1469
|
-
|
|
1583
|
+
J.copy(Je);
|
|
1470
1584
|
break;
|
|
1471
1585
|
case "YZ":
|
|
1472
|
-
|
|
1586
|
+
J.copy(At);
|
|
1473
1587
|
break;
|
|
1474
1588
|
case "XZ":
|
|
1475
|
-
|
|
1589
|
+
M.copy(Je), J.copy($e);
|
|
1476
1590
|
break;
|
|
1477
1591
|
case "XYZ":
|
|
1478
1592
|
case "E":
|
|
1479
|
-
|
|
1593
|
+
J.set(0, 0, 0);
|
|
1480
1594
|
break;
|
|
1481
1595
|
}
|
|
1482
1596
|
break;
|
|
1483
1597
|
case "rotate":
|
|
1484
1598
|
default:
|
|
1485
|
-
|
|
1599
|
+
J.set(0, 0, 0);
|
|
1486
1600
|
}
|
|
1487
|
-
|
|
1601
|
+
J.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (Ln.lookAt(Y.set(0, 0, 0), J, M), this.quaternion.setFromRotationMatrix(Ln)), super.updateMatrixWorld(t);
|
|
1488
1602
|
}
|
|
1489
1603
|
}
|
|
1490
|
-
var
|
|
1491
|
-
class
|
|
1604
|
+
var W, Ae;
|
|
1605
|
+
class Vi {
|
|
1492
1606
|
constructor() {
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1607
|
+
d(this, W, void 0);
|
|
1608
|
+
d(this, Ae, void 0);
|
|
1609
|
+
x(this, W, new Zi(b.camera, b.webglRenderer.domElement)), x(this, Ae, new Z([0, 0, 0], {
|
|
1496
1610
|
passport: {
|
|
1497
1611
|
name: "Controls.OrbitControls.Target",
|
|
1498
1612
|
manager: {
|
|
1499
1613
|
type: "number",
|
|
1500
|
-
|
|
1501
|
-
ease: 10
|
|
1614
|
+
invisible: !0
|
|
1502
1615
|
}
|
|
1503
1616
|
}
|
|
1504
1617
|
}));
|
|
1505
|
-
let
|
|
1506
|
-
s(this,
|
|
1507
|
-
s(this,
|
|
1508
|
-
}), s(this,
|
|
1509
|
-
|
|
1510
|
-
s(this,
|
|
1511
|
-
s(this,
|
|
1512
|
-
s(this,
|
|
1513
|
-
],
|
|
1618
|
+
let t = !0;
|
|
1619
|
+
s(this, Ae).subscribe((o) => {
|
|
1620
|
+
s(this, W).target.set(...o.current), t && s(this, W).update();
|
|
1621
|
+
}), s(this, W).addEventListener("change", () => {
|
|
1622
|
+
t = !1, s(this, Ae).current = [
|
|
1623
|
+
s(this, W).target.x,
|
|
1624
|
+
s(this, W).target.y,
|
|
1625
|
+
s(this, W).target.z
|
|
1626
|
+
], t = !0;
|
|
1514
1627
|
});
|
|
1515
1628
|
}
|
|
1516
1629
|
get controls() {
|
|
1517
|
-
return s(this,
|
|
1630
|
+
return s(this, W);
|
|
1518
1631
|
}
|
|
1519
1632
|
destroy() {
|
|
1520
|
-
s(this,
|
|
1633
|
+
s(this, W).dispose(), s(this, Ae).close();
|
|
1521
1634
|
}
|
|
1522
1635
|
}
|
|
1523
|
-
|
|
1524
|
-
var
|
|
1525
|
-
class
|
|
1636
|
+
W = new WeakMap(), Ae = new WeakMap();
|
|
1637
|
+
var R, at, rt, lt, ct, ht, pt, mt, dt;
|
|
1638
|
+
class $i {
|
|
1526
1639
|
constructor() {
|
|
1527
|
-
|
|
1528
|
-
|
|
1640
|
+
d(this, R, null);
|
|
1641
|
+
d(this, at, new Z(b.camera.far, {
|
|
1529
1642
|
passport: {
|
|
1530
1643
|
name: "Helpers.Grid.Size",
|
|
1531
1644
|
manager: {
|
|
@@ -1534,7 +1647,7 @@ class ji {
|
|
|
1534
1647
|
}
|
|
1535
1648
|
}
|
|
1536
1649
|
}));
|
|
1537
|
-
|
|
1650
|
+
d(this, rt, new Z(100, {
|
|
1538
1651
|
passport: {
|
|
1539
1652
|
name: "Helpers.Grid.Divisions",
|
|
1540
1653
|
manager: {
|
|
@@ -1542,7 +1655,7 @@ class ji {
|
|
|
1542
1655
|
}
|
|
1543
1656
|
}
|
|
1544
1657
|
}));
|
|
1545
|
-
|
|
1658
|
+
d(this, lt, new Z("#0000ff", {
|
|
1546
1659
|
passport: {
|
|
1547
1660
|
name: "Helpers.Grid.Color 1",
|
|
1548
1661
|
manager: {
|
|
@@ -1550,7 +1663,7 @@ class ji {
|
|
|
1550
1663
|
}
|
|
1551
1664
|
}
|
|
1552
1665
|
}));
|
|
1553
|
-
|
|
1666
|
+
d(this, ct, new Z("#808080", {
|
|
1554
1667
|
passport: {
|
|
1555
1668
|
name: "Helpers.Grid.Color 2",
|
|
1556
1669
|
manager: {
|
|
@@ -1558,7 +1671,7 @@ class ji {
|
|
|
1558
1671
|
}
|
|
1559
1672
|
}
|
|
1560
1673
|
}));
|
|
1561
|
-
|
|
1674
|
+
d(this, ht, new Z(!1, {
|
|
1562
1675
|
passport: {
|
|
1563
1676
|
name: "Helpers.Grid.Vertical",
|
|
1564
1677
|
manager: {
|
|
@@ -1566,7 +1679,7 @@ class ji {
|
|
|
1566
1679
|
}
|
|
1567
1680
|
}
|
|
1568
1681
|
}));
|
|
1569
|
-
|
|
1682
|
+
d(this, pt, new Z(!0, {
|
|
1570
1683
|
passport: {
|
|
1571
1684
|
name: "Helpers.Grid.Visible",
|
|
1572
1685
|
manager: {
|
|
@@ -1574,126 +1687,218 @@ class ji {
|
|
|
1574
1687
|
}
|
|
1575
1688
|
}
|
|
1576
1689
|
}));
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1690
|
+
d(this, mt, void 0);
|
|
1691
|
+
d(this, dt, (t) => {
|
|
1692
|
+
t.key === "g" && (s(this, R).visible = !s(this, R).visible);
|
|
1580
1693
|
});
|
|
1581
|
-
|
|
1694
|
+
x(this, mt, new Ii(
|
|
1582
1695
|
[
|
|
1583
|
-
s(this,
|
|
1584
|
-
s(this,
|
|
1585
|
-
s(this,
|
|
1586
|
-
s(this,
|
|
1587
|
-
s(this,
|
|
1588
|
-
s(this,
|
|
1696
|
+
s(this, at),
|
|
1697
|
+
s(this, rt),
|
|
1698
|
+
s(this, lt),
|
|
1699
|
+
s(this, ct),
|
|
1700
|
+
s(this, ht),
|
|
1701
|
+
s(this, pt)
|
|
1589
1702
|
],
|
|
1590
1703
|
() => {
|
|
1591
|
-
s(this,
|
|
1592
|
-
s(this,
|
|
1593
|
-
s(this,
|
|
1594
|
-
s(this,
|
|
1595
|
-
s(this,
|
|
1596
|
-
)), s(this,
|
|
1704
|
+
s(this, R) && (b.view.remove(s(this, R)), s(this, R).dispose()), x(this, R, new _i(
|
|
1705
|
+
s(this, at).current,
|
|
1706
|
+
s(this, rt).current,
|
|
1707
|
+
s(this, lt).current,
|
|
1708
|
+
s(this, ct).current
|
|
1709
|
+
)), s(this, R).rotation.x = s(this, ht).current ? Math.PI / 2 : 0, s(this, R).visible = s(this, pt).current, b.view.add(s(this, R));
|
|
1597
1710
|
}
|
|
1598
|
-
)), addEventListener("keydown", s(this,
|
|
1711
|
+
)), addEventListener("keydown", s(this, dt));
|
|
1599
1712
|
}
|
|
1600
1713
|
get helper() {
|
|
1601
|
-
return s(this,
|
|
1714
|
+
return s(this, R);
|
|
1602
1715
|
}
|
|
1603
1716
|
destroy() {
|
|
1604
|
-
s(this,
|
|
1717
|
+
s(this, mt).close(), s(this, R) && (b.view.remove(s(this, R)), s(this, R).dispose()), removeEventListener("keydown", s(this, dt));
|
|
1605
1718
|
}
|
|
1606
1719
|
}
|
|
1607
|
-
|
|
1608
|
-
var
|
|
1609
|
-
class
|
|
1720
|
+
R = new WeakMap(), at = new WeakMap(), rt = new WeakMap(), lt = new WeakMap(), ct = new WeakMap(), ht = new WeakMap(), pt = new WeakMap(), mt = new WeakMap(), dt = new WeakMap();
|
|
1721
|
+
var j, U, fe, ye, ut, Ne, ft, yt, Kt;
|
|
1722
|
+
class Ji {
|
|
1610
1723
|
constructor() {
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
if (
|
|
1617
|
-
const o = new
|
|
1618
|
-
s(this,
|
|
1724
|
+
d(this, yt);
|
|
1725
|
+
d(this, j, void 0);
|
|
1726
|
+
d(this, U, []);
|
|
1727
|
+
d(this, fe, null);
|
|
1728
|
+
d(this, ye, (t) => {
|
|
1729
|
+
if (t.child.name.startsWith("T.") && !s(this, U).find((o) => o.object3d === t.child)) {
|
|
1730
|
+
const o = new zn(t.child);
|
|
1731
|
+
s(this, U).push(o), b.raycaster.add(o.raycasterTarget, {
|
|
1619
1732
|
eventDispatcher: o.raycasterTarget
|
|
1620
1733
|
}), o.raycasterTarget.addEventListener(
|
|
1621
1734
|
"pointerDown",
|
|
1622
|
-
s(this,
|
|
1623
|
-
), o.object3d.addEventListener("childadded", s(this,
|
|
1735
|
+
s(this, Ne)
|
|
1736
|
+
), o.object3d.addEventListener("childadded", s(this, ye));
|
|
1624
1737
|
}
|
|
1625
1738
|
});
|
|
1626
|
-
|
|
1627
|
-
const o =
|
|
1628
|
-
o && (
|
|
1739
|
+
d(this, ut, (t) => {
|
|
1740
|
+
const o = P(this, yt, Kt).call(this, t.child);
|
|
1741
|
+
o && (b.raycaster.remove(o.raycasterTarget), o.destroy(), o.raycasterTarget.removeEventListener(
|
|
1629
1742
|
"pointerDown",
|
|
1630
|
-
s(this,
|
|
1743
|
+
s(this, Ne)
|
|
1631
1744
|
), o.object3d.removeEventListener(
|
|
1632
1745
|
"childadded",
|
|
1633
|
-
s(this,
|
|
1634
|
-
),
|
|
1746
|
+
s(this, ye)
|
|
1747
|
+
), x(this, U, s(this, U).filter((e) => e !== o)));
|
|
1635
1748
|
});
|
|
1636
|
-
|
|
1637
|
-
const o =
|
|
1638
|
-
o && (
|
|
1749
|
+
d(this, Ne, (t) => {
|
|
1750
|
+
const o = P(this, yt, Kt).call(this, t.target);
|
|
1751
|
+
o && (x(this, fe, s(this, U).find((e) => e.object3d === (o == null ? void 0 : o.object3d)) || null), s(this, fe) && s(this, j).attach(s(this, fe).object3d));
|
|
1639
1752
|
});
|
|
1640
|
-
|
|
1641
|
-
|
|
1753
|
+
d(this, ft, (t) => {
|
|
1754
|
+
t.key === "t" ? s(this, j).setMode("translate") : t.key === "r" ? s(this, j).setMode("rotate") : t.key === "s" ? s(this, j).setMode("scale") : t.key === "Escape" ? s(this, j).detach() : t.key === "+" || t.key === "=" ? s(this, j).setSize(s(this, j).size + 0.1) : t.key === "-" || t.key === "_" ? s(this, j).setSize(s(this, j).size - 0.1) : t.key === "h" && s(this, U).forEach((o) => {
|
|
1642
1755
|
o.helpers.forEach((e) => {
|
|
1643
1756
|
e.visible = !e.visible;
|
|
1644
1757
|
});
|
|
1645
1758
|
});
|
|
1646
1759
|
});
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
)), s(this,
|
|
1651
|
-
s(this,
|
|
1652
|
-
}),
|
|
1760
|
+
x(this, j, new Fi(
|
|
1761
|
+
b.camera,
|
|
1762
|
+
b.webglRenderer.domElement
|
|
1763
|
+
)), s(this, j).addEventListener("objectChange", (t) => {
|
|
1764
|
+
s(this, fe) && s(this, fe).save();
|
|
1765
|
+
}), b.view.add(s(this, j)), b.scene.addEventListener("childadded", s(this, ye)), b.scene.addEventListener("childremoved", s(this, ut)), window.addEventListener("keydown", s(this, ft));
|
|
1653
1766
|
}
|
|
1654
1767
|
get controls() {
|
|
1655
|
-
return s(this,
|
|
1768
|
+
return s(this, j);
|
|
1656
1769
|
}
|
|
1657
1770
|
destroy() {
|
|
1658
|
-
|
|
1659
|
-
|
|
1771
|
+
b.scene.removeEventListener("childadded", s(this, ye)), b.scene.removeEventListener("childremoved", s(this, ut)), window.removeEventListener("keydown", s(this, ft)), s(this, j).dispose(), s(this, U).forEach((t) => {
|
|
1772
|
+
t.raycasterTarget.removeEventListener(
|
|
1660
1773
|
"pointerDown",
|
|
1661
|
-
s(this,
|
|
1662
|
-
),
|
|
1774
|
+
s(this, Ne)
|
|
1775
|
+
), t.object3d.removeEventListener(
|
|
1663
1776
|
"childadded",
|
|
1664
|
-
s(this,
|
|
1665
|
-
),
|
|
1666
|
-
}),
|
|
1777
|
+
s(this, ye)
|
|
1778
|
+
), t.destroy();
|
|
1779
|
+
}), x(this, U, []);
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
j = new WeakMap(), U = new WeakMap(), fe = new WeakMap(), ye = new WeakMap(), ut = new WeakMap(), Ne = new WeakMap(), ft = new WeakMap(), yt = new WeakSet(), Kt = function(t) {
|
|
1783
|
+
return s(this, U).find(
|
|
1784
|
+
(e) => e.object3d === t || e.raycasterTarget === t
|
|
1785
|
+
);
|
|
1786
|
+
};
|
|
1787
|
+
var Xe, Ze, Fe, Qe, bt, Bt, Yt, Nn;
|
|
1788
|
+
class es {
|
|
1789
|
+
constructor() {
|
|
1790
|
+
d(this, bt);
|
|
1791
|
+
d(this, Yt);
|
|
1792
|
+
d(this, Xe, void 0);
|
|
1793
|
+
d(this, Ze, void 0);
|
|
1794
|
+
d(this, Fe, void 0);
|
|
1795
|
+
d(this, Qe, []);
|
|
1796
|
+
x(this, Xe, b.composer.addPass = b.composer.addPass.bind(
|
|
1797
|
+
b.composer
|
|
1798
|
+
)), b.composer.addPass = (...t) => {
|
|
1799
|
+
P(this, bt, Bt).call(this, t[0]), s(this, Xe).call(this, ...t);
|
|
1800
|
+
}, x(this, Ze, b.composer.removePass = b.composer.removePass.bind(b.composer)), b.composer.removePass = (...t) => {
|
|
1801
|
+
P(this, Yt, Nn).call(this, t[0]), s(this, Ze).call(this, ...t);
|
|
1802
|
+
}, x(this, Fe, b.composer.insertPass = b.composer.insertPass.bind(b.composer)), b.composer.insertPass = (...t) => {
|
|
1803
|
+
P(this, bt, Bt).call(this, t[0]), s(this, Fe).call(this, ...t);
|
|
1804
|
+
};
|
|
1805
|
+
}
|
|
1806
|
+
destroy() {
|
|
1807
|
+
b.composer.addPass = s(this, Xe), b.composer.removePass = s(this, Ze), b.composer.insertPass = s(this, Fe), s(this, Qe).forEach((t) => {
|
|
1808
|
+
t.destroy();
|
|
1809
|
+
});
|
|
1667
1810
|
}
|
|
1668
1811
|
}
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
(
|
|
1812
|
+
Xe = new WeakMap(), Ze = new WeakMap(), Fe = new WeakMap(), Qe = new WeakMap(), bt = new WeakSet(), Bt = function(t) {
|
|
1813
|
+
s(this, Qe).push(
|
|
1814
|
+
new be(t, {
|
|
1815
|
+
folderName: `EffectComposer.${t.constructor.name}`,
|
|
1816
|
+
skipKeys: [
|
|
1817
|
+
"renderToScreen",
|
|
1818
|
+
"needsSwap",
|
|
1819
|
+
"nMips",
|
|
1820
|
+
"oldClearAlpha",
|
|
1821
|
+
"clearColor",
|
|
1822
|
+
"resolution"
|
|
1823
|
+
]
|
|
1824
|
+
})
|
|
1825
|
+
), "uniforms" in t && s(this, Qe).push(
|
|
1826
|
+
new be(t.uniforms, {
|
|
1827
|
+
folderName: `EffectComposer.${t.constructor.name}.Uniforms`,
|
|
1828
|
+
optionsCatalog: {
|
|
1829
|
+
maxblur: {
|
|
1830
|
+
type: "number",
|
|
1831
|
+
min: 0,
|
|
1832
|
+
max: 1,
|
|
1833
|
+
step: 1e-5,
|
|
1834
|
+
ease: 0.1
|
|
1835
|
+
},
|
|
1836
|
+
aperture: {
|
|
1837
|
+
type: "number",
|
|
1838
|
+
min: 0,
|
|
1839
|
+
max: 0.01,
|
|
1840
|
+
step: 1e-6
|
|
1841
|
+
},
|
|
1842
|
+
focus: {
|
|
1843
|
+
type: "number",
|
|
1844
|
+
min: 0,
|
|
1845
|
+
step: 0.01
|
|
1846
|
+
}
|
|
1847
|
+
},
|
|
1848
|
+
skipKeys: ["time", "resolution"]
|
|
1849
|
+
})
|
|
1672
1850
|
);
|
|
1851
|
+
}, Yt = new WeakSet(), Nn = function(t) {
|
|
1673
1852
|
};
|
|
1674
|
-
var
|
|
1675
|
-
class
|
|
1853
|
+
var wt, gt, Et, Pt, qe, Le, Ge;
|
|
1854
|
+
class ps {
|
|
1676
1855
|
constructor() {
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1856
|
+
d(this, wt, void 0);
|
|
1857
|
+
d(this, gt, void 0);
|
|
1858
|
+
d(this, Et, null);
|
|
1859
|
+
d(this, Pt, void 0);
|
|
1860
|
+
d(this, qe, void 0);
|
|
1861
|
+
d(this, Le, void 0);
|
|
1862
|
+
d(this, Ge, void 0);
|
|
1863
|
+
x(this, wt, new be(b.webglRenderer, {
|
|
1864
|
+
folderName: "Renderer"
|
|
1865
|
+
})), x(this, gt, new be(
|
|
1866
|
+
b.webglRenderer.shadowMap,
|
|
1867
|
+
{
|
|
1868
|
+
folderName: "Renderer.shadowMap",
|
|
1869
|
+
optionsCatalog: {
|
|
1870
|
+
type: {
|
|
1871
|
+
type: "select",
|
|
1872
|
+
variants: [
|
|
1873
|
+
"BasicShadowMap",
|
|
1874
|
+
"PCFShadowMap",
|
|
1875
|
+
"PCFSoftShadowMap",
|
|
1876
|
+
"VSMShadowMap"
|
|
1877
|
+
]
|
|
1878
|
+
}
|
|
1879
|
+
},
|
|
1880
|
+
afterChange: () => {
|
|
1881
|
+
b.webglRenderer.shadowMap.needsUpdate = !0, Ai(b.scene, (t) => {
|
|
1882
|
+
t.needsUpdate = !0;
|
|
1883
|
+
});
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
)), b.composer && x(this, Et, new es()), x(this, Pt, new $i()), x(this, qe, new zn(b.camera)), x(this, Le, new Vi()), s(this, Le).controls.addEventListener("change", () => {
|
|
1887
|
+
s(this, qe).save();
|
|
1888
|
+
}), x(this, Ge, new Ji()), s(this, Ge).controls.addEventListener(
|
|
1685
1889
|
"dragging-changed",
|
|
1686
|
-
(
|
|
1687
|
-
s(this,
|
|
1890
|
+
(t) => {
|
|
1891
|
+
s(this, Le).controls.enabled = !t.value;
|
|
1688
1892
|
}
|
|
1689
1893
|
);
|
|
1690
1894
|
}
|
|
1691
1895
|
destroy() {
|
|
1692
|
-
|
|
1896
|
+
var t;
|
|
1897
|
+
s(this, wt).destroy(), s(this, gt).destroy(), (t = s(this, Et)) == null || t.destroy(), s(this, Pt).destroy(), s(this, qe).destroy(), s(this, Le).destroy(), s(this, Ge).destroy();
|
|
1693
1898
|
}
|
|
1694
1899
|
}
|
|
1695
|
-
|
|
1900
|
+
wt = new WeakMap(), gt = new WeakMap(), Et = new WeakMap(), Pt = new WeakMap(), qe = new WeakMap(), Le = new WeakMap(), Ge = new WeakMap();
|
|
1696
1901
|
export {
|
|
1697
|
-
|
|
1698
|
-
|
|
1902
|
+
ps as En3Helpers,
|
|
1903
|
+
zn as En3Object3dManager
|
|
1699
1904
|
};
|