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