ss-component-new 1.3.882 → 1.3.883
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{array-0Dv5wA0B.js → array-BE5-Lp71.js} +2 -2
- package/dist/{index-DodjEuLF.js → index--O22zc53.js} +2 -2
- package/dist/{index-BLjOAzqD.js → index-B6G7g1fz.js} +2 -2
- package/dist/{index-D2eGznaq.js → index-B6ucCCwS.js} +2 -2
- package/dist/{index-DY6Ud0CB.js → index-BIjmykhy.js} +1 -1
- package/dist/{index-De3OLFSD.js → index-Behw03q4.js} +4 -4
- package/dist/{index-CxrF-I9V.js → index-BwvzlRrV.js} +1 -1
- package/dist/{index-DKjHCtzj.js → index-CJFRjrgj.js} +1 -1
- package/dist/{index-g9y6kMY3.js → index-DNAqQ6Ts.js} +3 -3
- package/dist/{index-CAotDRAh.js → index-EEfroyfS.js} +1 -1
- package/dist/{index-CT9AmRJY.js → index-jjJsAlHI.js} +2302 -2295
- package/dist/index-pGnCEQo0.js +20986 -0
- package/dist/{index-Dv6TC5Ab.js → index-pWCewfrU.js} +1 -1
- package/dist/{main-hBDStGQ7.js → main-CILUQFih.js} +2 -2
- package/dist/ss-component.css +2 -2
- package/dist/ss-component.js +5 -5
- package/dist/ss-component2.js +8 -8
- package/dist/{threeModel-BBTwstcP.js → threeModel-DQE1Tq_a.js} +1 -1
- package/dist/{threePreview-POTR8gIo.js → threePreview-CP2ATOg0.js} +1263 -1240
- package/dist/{threeSceneView-dJv_6pl5.js → threeSceneView-CiZ4B2u_.js} +3 -3
- package/dist/{threeSceneViewForCPMPIP-DyCNU1Sm.js → threeSceneViewForCPMPIP-CY3IRn00.js} +1 -1
- package/dist/{threeViewerHost-CjC-mF9r.js → threeViewerHost-DUu8xy_f.js} +1 -1
- package/package.json +1 -1
- package/dist/index-43Q12vHD.js +0 -20812
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { b as I2, p as
|
|
3
|
-
import { aj as w2, ak as
|
|
4
|
-
import { u as ni, a as di, b as oi, T as
|
|
5
|
-
import { M as
|
|
6
|
-
import { a as hi } from "./index-
|
|
7
|
-
import { _ as
|
|
8
|
-
import { B as gi, M as _i, K as Ai, L as pi, N as mi, a1 as ji, T as Ii, cj as yi, E as
|
|
1
|
+
import { ref as de, shallowRef as g2, watch as Ye, onBeforeUnmount as za, onUnmounted as Qa, defineComponent as q0, computed as S0, createBlock as x0, openBlock as Ce, Teleport as Za, createElementBlock as j0, createCommentVNode as $0, withModifiers as _2, normalizeStyle as A2, createElementVNode as se, toDisplayString as ea, createVNode as Ie, unref as Re, nextTick as Ja, onMounted as Ya, resolveComponent as p2, withDirectives as Ta, vShow as Ra, renderSlot as Ma, withCtx as m2, isRef as j2 } from "vue";
|
|
2
|
+
import { b as I2, p as Ka, s as Xa, a as y2 } from "./index-CD8ntnXQ.js";
|
|
3
|
+
import { aj as w2, ak as aa, al as $a, Y as e2, am as p0, Z as P0, an as xe, ao as fa, C as Ge, ap as Ue, c as Ke, aq as F2, j as v2, D as N2, n as B0, V as j, ar as T2, as as ee, at as R2, au as a2, av as M2, aw as D2, a3 as m0, ax as O2, ay as i2, az as E2, aA as G2, aB as U2, aC as ia, aD as b2, aE as ba, aF as x2, aG as P2, a0 as B2, aH as z0, a4 as q2, t as r2, l as W2, aI as A0, aJ as C2, u as H2, aK as V2, h as ta, aL as L2, w as S2, aM as z2, a1 as Q2, s as Q0, P as Z2, o as J2, aN as Y2, aO as K2, aP as X2, aQ as $2, aR as ei, aS as c2, aT as ai, aU as Da, aV as Oa, aW as Ea, aX as Ga, aY as ra, a6 as ii, aZ as bi, B as I0, a_ as ri, k as Hi, a$ as ci, b0 as fi, ai as ti } from "./index.vue_vue_type_style_index_0_scoped_05e3a1d8_lang-DZleBV8W.js";
|
|
4
|
+
import { u as ni, a as di, b as oi, T as e0, C as si } from "./iconfont-DQXt5WPU.js";
|
|
5
|
+
import { M as li, O as ki, S as ui } from "./MTLLoader-DjveDb4X.js";
|
|
6
|
+
import { a as hi } from "./index-jjJsAlHI.js";
|
|
7
|
+
import { _ as na } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
|
+
import { B as gi, M as _i, K as Ai, L as pi, N as mi, a1 as ji, T as Ii, cj as yi, E as Ua } from "./request-BQZTUjLG.js";
|
|
9
9
|
var wi = "[object Map]", Fi = "[object Set]", vi = Object.prototype, Ni = vi.hasOwnProperty;
|
|
10
|
-
function
|
|
10
|
+
function xa(n) {
|
|
11
11
|
if (n == null)
|
|
12
12
|
return !0;
|
|
13
13
|
if (gi(n) && (_i(n) || typeof n == "string" || typeof n.splice == "function" || Ai(n) || pi(n) || mi(n)))
|
|
@@ -22,34 +22,34 @@ function Ua(n) {
|
|
|
22
22
|
return !1;
|
|
23
23
|
return !0;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function Pa(n, a) {
|
|
26
26
|
if (a === w2)
|
|
27
27
|
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), n;
|
|
28
|
-
if (a ===
|
|
28
|
+
if (a === aa || a === $a) {
|
|
29
29
|
let e = n.getIndex();
|
|
30
30
|
if (e === null) {
|
|
31
|
-
const
|
|
31
|
+
const b = [], f = n.getAttribute("position");
|
|
32
32
|
if (f !== void 0) {
|
|
33
33
|
for (let c = 0; c < f.count; c++)
|
|
34
|
-
|
|
35
|
-
n.setIndex(
|
|
34
|
+
b.push(c);
|
|
35
|
+
n.setIndex(b), e = n.getIndex();
|
|
36
36
|
} else
|
|
37
37
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), n;
|
|
38
38
|
}
|
|
39
39
|
const H = e.count - 2, i = [];
|
|
40
|
-
if (a ===
|
|
41
|
-
for (let
|
|
42
|
-
i.push(e.getX(0)), i.push(e.getX(
|
|
40
|
+
if (a === aa)
|
|
41
|
+
for (let b = 1; b <= H; b++)
|
|
42
|
+
i.push(e.getX(0)), i.push(e.getX(b)), i.push(e.getX(b + 1));
|
|
43
43
|
else
|
|
44
|
-
for (let
|
|
45
|
-
|
|
44
|
+
for (let b = 0; b < H; b++)
|
|
45
|
+
b % 2 === 0 ? (i.push(e.getX(b)), i.push(e.getX(b + 1)), i.push(e.getX(b + 2))) : (i.push(e.getX(b + 2)), i.push(e.getX(b + 1)), i.push(e.getX(b)));
|
|
46
46
|
i.length / 3 !== H && console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");
|
|
47
|
-
const
|
|
48
|
-
return
|
|
47
|
+
const r = n.clone();
|
|
48
|
+
return r.setIndex(i), r.clearGroups(), r;
|
|
49
49
|
} else
|
|
50
50
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", a), n;
|
|
51
51
|
}
|
|
52
|
-
class Ti extends
|
|
52
|
+
class Ti extends e2 {
|
|
53
53
|
/**
|
|
54
54
|
* Constructs a new glTF loader.
|
|
55
55
|
*
|
|
@@ -102,23 +102,23 @@ class Ti extends $a {
|
|
|
102
102
|
* @param {onErrorCallback} onError - Executed when errors occur.
|
|
103
103
|
*/
|
|
104
104
|
load(a, e, H, i) {
|
|
105
|
-
const
|
|
106
|
-
let
|
|
105
|
+
const r = this;
|
|
106
|
+
let b;
|
|
107
107
|
if (this.resourcePath !== "")
|
|
108
|
-
|
|
108
|
+
b = this.resourcePath;
|
|
109
109
|
else if (this.path !== "") {
|
|
110
|
-
const t =
|
|
111
|
-
|
|
110
|
+
const t = p0.extractUrlBase(a);
|
|
111
|
+
b = p0.resolveURL(t, this.path);
|
|
112
112
|
} else
|
|
113
|
-
|
|
113
|
+
b = p0.extractUrlBase(a);
|
|
114
114
|
this.manager.itemStart(a);
|
|
115
115
|
const f = function(t) {
|
|
116
|
-
i ? i(t) : console.error(t),
|
|
117
|
-
}, c = new
|
|
116
|
+
i ? i(t) : console.error(t), r.manager.itemError(a), r.manager.itemEnd(a);
|
|
117
|
+
}, c = new P0(this.manager);
|
|
118
118
|
c.setPath(this.path), c.setResponseType("arraybuffer"), c.setRequestHeader(this.requestHeader), c.setWithCredentials(this.withCredentials), c.load(a, function(t) {
|
|
119
119
|
try {
|
|
120
|
-
|
|
121
|
-
e(o),
|
|
120
|
+
r.parse(t, b, function(o) {
|
|
121
|
+
e(o), r.manager.itemEnd(a);
|
|
122
122
|
}, f);
|
|
123
123
|
} catch (o) {
|
|
124
124
|
f(o);
|
|
@@ -184,28 +184,28 @@ class Ti extends $a {
|
|
|
184
184
|
* @param {onErrorCallback} onError - Executed when errors occur.
|
|
185
185
|
*/
|
|
186
186
|
parse(a, e, H, i) {
|
|
187
|
-
let
|
|
188
|
-
const
|
|
187
|
+
let r;
|
|
188
|
+
const b = {}, f = {}, c = new TextDecoder();
|
|
189
189
|
if (typeof a == "string")
|
|
190
|
-
|
|
190
|
+
r = JSON.parse(a);
|
|
191
191
|
else if (a instanceof ArrayBuffer)
|
|
192
|
-
if (c.decode(new Uint8Array(a, 0, 4)) ===
|
|
192
|
+
if (c.decode(new Uint8Array(a, 0, 4)) === f2) {
|
|
193
193
|
try {
|
|
194
|
-
|
|
194
|
+
b[x.KHR_BINARY_GLTF] = new Ji(a);
|
|
195
195
|
} catch (d) {
|
|
196
196
|
i && i(d);
|
|
197
197
|
return;
|
|
198
198
|
}
|
|
199
|
-
|
|
199
|
+
r = JSON.parse(b[x.KHR_BINARY_GLTF].content);
|
|
200
200
|
} else
|
|
201
|
-
|
|
201
|
+
r = JSON.parse(c.decode(a));
|
|
202
202
|
else
|
|
203
|
-
|
|
204
|
-
if (
|
|
203
|
+
r = a;
|
|
204
|
+
if (r.asset === void 0 || r.asset.version[0] < 2) {
|
|
205
205
|
i && i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
|
|
206
206
|
return;
|
|
207
207
|
}
|
|
208
|
-
const t = new tb(
|
|
208
|
+
const t = new tb(r, {
|
|
209
209
|
path: e || this.resourcePath || "",
|
|
210
210
|
crossOrigin: this.crossOrigin,
|
|
211
211
|
requestHeader: this.requestHeader,
|
|
@@ -216,29 +216,29 @@ class Ti extends $a {
|
|
|
216
216
|
t.fileLoader.setRequestHeader(this.requestHeader);
|
|
217
217
|
for (let o = 0; o < this.pluginCallbacks.length; o++) {
|
|
218
218
|
const d = this.pluginCallbacks[o](t);
|
|
219
|
-
d.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), f[d.name] = d,
|
|
219
|
+
d.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), f[d.name] = d, b[d.name] = !0;
|
|
220
220
|
}
|
|
221
|
-
if (
|
|
222
|
-
for (let o = 0; o <
|
|
223
|
-
const d =
|
|
221
|
+
if (r.extensionsUsed)
|
|
222
|
+
for (let o = 0; o < r.extensionsUsed.length; ++o) {
|
|
223
|
+
const d = r.extensionsUsed[o], s = r.extensionsRequired || [];
|
|
224
224
|
switch (d) {
|
|
225
225
|
case x.KHR_MATERIALS_UNLIT:
|
|
226
|
-
|
|
226
|
+
b[d] = new Di();
|
|
227
227
|
break;
|
|
228
228
|
case x.KHR_DRACO_MESH_COMPRESSION:
|
|
229
|
-
|
|
229
|
+
b[d] = new Yi(r, this.dracoLoader);
|
|
230
230
|
break;
|
|
231
231
|
case x.KHR_TEXTURE_TRANSFORM:
|
|
232
|
-
|
|
232
|
+
b[d] = new Ki();
|
|
233
233
|
break;
|
|
234
234
|
case x.KHR_MESH_QUANTIZATION:
|
|
235
|
-
|
|
235
|
+
b[d] = new Xi();
|
|
236
236
|
break;
|
|
237
237
|
default:
|
|
238
238
|
s.indexOf(d) >= 0 && f[d] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + d + '".');
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
t.setExtensions(
|
|
241
|
+
t.setExtensions(b), t.setPlugins(f), t.parse(H, i);
|
|
242
242
|
}
|
|
243
243
|
/**
|
|
244
244
|
* Async version of {@link GLTFLoader#parse}.
|
|
@@ -250,8 +250,8 @@ class Ti extends $a {
|
|
|
250
250
|
*/
|
|
251
251
|
parseAsync(a, e) {
|
|
252
252
|
const H = this;
|
|
253
|
-
return new Promise(function(i,
|
|
254
|
-
H.parse(a, e, i,
|
|
253
|
+
return new Promise(function(i, r) {
|
|
254
|
+
H.parse(a, e, i, r);
|
|
255
255
|
});
|
|
256
256
|
}
|
|
257
257
|
}
|
|
@@ -303,18 +303,18 @@ class Mi {
|
|
|
303
303
|
_markDefs() {
|
|
304
304
|
const a = this.parser, e = this.parser.json.nodes || [];
|
|
305
305
|
for (let H = 0, i = e.length; H < i; H++) {
|
|
306
|
-
const
|
|
307
|
-
|
|
306
|
+
const r = e[H];
|
|
307
|
+
r.extensions && r.extensions[this.name] && r.extensions[this.name].light !== void 0 && a._addNodeRef(this.cache, r.extensions[this.name].light);
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
310
|
_loadLight(a) {
|
|
311
311
|
const e = this.parser, H = "light:" + a;
|
|
312
312
|
let i = e.cache.get(H);
|
|
313
313
|
if (i) return i;
|
|
314
|
-
const
|
|
314
|
+
const r = e.json, c = ((r.extensions && r.extensions[this.name] || {}).lights || [])[a];
|
|
315
315
|
let t;
|
|
316
|
-
const o = new
|
|
317
|
-
c.color !== void 0 && o.setRGB(c.color[0], c.color[1], c.color[2],
|
|
316
|
+
const o = new Ge(16777215);
|
|
317
|
+
c.color !== void 0 && o.setRGB(c.color[0], c.color[1], c.color[2], Ue);
|
|
318
318
|
const d = c.range !== void 0 ? c.range : 0;
|
|
319
319
|
switch (c.type) {
|
|
320
320
|
case "directional":
|
|
@@ -329,14 +329,14 @@ class Mi {
|
|
|
329
329
|
default:
|
|
330
330
|
throw new Error("THREE.GLTFLoader: Unexpected light type: " + c.type);
|
|
331
331
|
}
|
|
332
|
-
return t.position.set(0, 0, 0),
|
|
332
|
+
return t.position.set(0, 0, 0), We(t, c), c.intensity !== void 0 && (t.intensity = c.intensity), t.name = e.createUniqueName(c.name || "light_" + a), i = Promise.resolve(t), e.cache.add(H, i), i;
|
|
333
333
|
}
|
|
334
334
|
getDependency(a, e) {
|
|
335
335
|
if (a === "light")
|
|
336
336
|
return this._loadLight(e);
|
|
337
337
|
}
|
|
338
338
|
createNodeAttachment(a) {
|
|
339
|
-
const e = this, H = this.parser,
|
|
339
|
+
const e = this, H = this.parser, r = H.json.nodes[a], f = (r.extensions && r.extensions[this.name] || {}).light;
|
|
340
340
|
return f === void 0 ? null : this._loadLight(f).then(function(c) {
|
|
341
341
|
return H._getNodeRef(e.cache, f, c);
|
|
342
342
|
});
|
|
@@ -347,18 +347,18 @@ class Di {
|
|
|
347
347
|
this.name = x.KHR_MATERIALS_UNLIT;
|
|
348
348
|
}
|
|
349
349
|
getMaterialType() {
|
|
350
|
-
return
|
|
350
|
+
return A0;
|
|
351
351
|
}
|
|
352
352
|
extendParams(a, e, H) {
|
|
353
353
|
const i = [];
|
|
354
|
-
a.color = new
|
|
355
|
-
const
|
|
356
|
-
if (
|
|
357
|
-
if (Array.isArray(
|
|
358
|
-
const
|
|
359
|
-
a.color.setRGB(
|
|
354
|
+
a.color = new Ge(1, 1, 1), a.opacity = 1;
|
|
355
|
+
const r = e.pbrMetallicRoughness;
|
|
356
|
+
if (r) {
|
|
357
|
+
if (Array.isArray(r.baseColorFactor)) {
|
|
358
|
+
const b = r.baseColorFactor;
|
|
359
|
+
a.color.setRGB(b[0], b[1], b[2], Ue), a.opacity = b[3];
|
|
360
360
|
}
|
|
361
|
-
|
|
361
|
+
r.baseColorTexture !== void 0 && i.push(H.assignTexture(a, "map", r.baseColorTexture, Ke));
|
|
362
362
|
}
|
|
363
363
|
return Promise.all(i);
|
|
364
364
|
}
|
|
@@ -371,8 +371,8 @@ class Oi {
|
|
|
371
371
|
const i = this.parser.json.materials[a];
|
|
372
372
|
if (!i.extensions || !i.extensions[this.name])
|
|
373
373
|
return Promise.resolve();
|
|
374
|
-
const
|
|
375
|
-
return
|
|
374
|
+
const r = i.extensions[this.name].emissiveStrength;
|
|
375
|
+
return r !== void 0 && (e.emissiveIntensity = r), Promise.resolve();
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
class Ei {
|
|
@@ -381,18 +381,18 @@ class Ei {
|
|
|
381
381
|
}
|
|
382
382
|
getMaterialType(a) {
|
|
383
383
|
const H = this.parser.json.materials[a];
|
|
384
|
-
return !H.extensions || !H.extensions[this.name] ? null :
|
|
384
|
+
return !H.extensions || !H.extensions[this.name] ? null : xe;
|
|
385
385
|
}
|
|
386
386
|
extendMaterialParams(a, e) {
|
|
387
387
|
const H = this.parser, i = H.json.materials[a];
|
|
388
388
|
if (!i.extensions || !i.extensions[this.name])
|
|
389
389
|
return Promise.resolve();
|
|
390
|
-
const
|
|
391
|
-
if (
|
|
392
|
-
const f =
|
|
393
|
-
e.clearcoatNormalScale = new
|
|
390
|
+
const r = [], b = i.extensions[this.name];
|
|
391
|
+
if (b.clearcoatFactor !== void 0 && (e.clearcoat = b.clearcoatFactor), b.clearcoatTexture !== void 0 && r.push(H.assignTexture(e, "clearcoatMap", b.clearcoatTexture)), b.clearcoatRoughnessFactor !== void 0 && (e.clearcoatRoughness = b.clearcoatRoughnessFactor), b.clearcoatRoughnessTexture !== void 0 && r.push(H.assignTexture(e, "clearcoatRoughnessMap", b.clearcoatRoughnessTexture)), b.clearcoatNormalTexture !== void 0 && (r.push(H.assignTexture(e, "clearcoatNormalMap", b.clearcoatNormalTexture)), b.clearcoatNormalTexture.scale !== void 0)) {
|
|
392
|
+
const f = b.clearcoatNormalTexture.scale;
|
|
393
|
+
e.clearcoatNormalScale = new fa(f, f);
|
|
394
394
|
}
|
|
395
|
-
return Promise.all(
|
|
395
|
+
return Promise.all(r);
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
398
|
class Gi {
|
|
@@ -401,14 +401,14 @@ class Gi {
|
|
|
401
401
|
}
|
|
402
402
|
getMaterialType(a) {
|
|
403
403
|
const H = this.parser.json.materials[a];
|
|
404
|
-
return !H.extensions || !H.extensions[this.name] ? null :
|
|
404
|
+
return !H.extensions || !H.extensions[this.name] ? null : xe;
|
|
405
405
|
}
|
|
406
406
|
extendMaterialParams(a, e) {
|
|
407
407
|
const i = this.parser.json.materials[a];
|
|
408
408
|
if (!i.extensions || !i.extensions[this.name])
|
|
409
409
|
return Promise.resolve();
|
|
410
|
-
const
|
|
411
|
-
return e.dispersion =
|
|
410
|
+
const r = i.extensions[this.name];
|
|
411
|
+
return e.dispersion = r.dispersion !== void 0 ? r.dispersion : 0, Promise.resolve();
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
414
|
class Ui {
|
|
@@ -417,14 +417,14 @@ class Ui {
|
|
|
417
417
|
}
|
|
418
418
|
getMaterialType(a) {
|
|
419
419
|
const H = this.parser.json.materials[a];
|
|
420
|
-
return !H.extensions || !H.extensions[this.name] ? null :
|
|
420
|
+
return !H.extensions || !H.extensions[this.name] ? null : xe;
|
|
421
421
|
}
|
|
422
422
|
extendMaterialParams(a, e) {
|
|
423
423
|
const H = this.parser, i = H.json.materials[a];
|
|
424
424
|
if (!i.extensions || !i.extensions[this.name])
|
|
425
425
|
return Promise.resolve();
|
|
426
|
-
const
|
|
427
|
-
return
|
|
426
|
+
const r = [], b = i.extensions[this.name];
|
|
427
|
+
return b.iridescenceFactor !== void 0 && (e.iridescence = b.iridescenceFactor), b.iridescenceTexture !== void 0 && r.push(H.assignTexture(e, "iridescenceMap", b.iridescenceTexture)), b.iridescenceIor !== void 0 && (e.iridescenceIOR = b.iridescenceIor), e.iridescenceThicknessRange === void 0 && (e.iridescenceThicknessRange = [100, 400]), b.iridescenceThicknessMinimum !== void 0 && (e.iridescenceThicknessRange[0] = b.iridescenceThicknessMinimum), b.iridescenceThicknessMaximum !== void 0 && (e.iridescenceThicknessRange[1] = b.iridescenceThicknessMaximum), b.iridescenceThicknessTexture !== void 0 && r.push(H.assignTexture(e, "iridescenceThicknessMap", b.iridescenceThicknessTexture)), Promise.all(r);
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
class xi {
|
|
@@ -433,20 +433,20 @@ class xi {
|
|
|
433
433
|
}
|
|
434
434
|
getMaterialType(a) {
|
|
435
435
|
const H = this.parser.json.materials[a];
|
|
436
|
-
return !H.extensions || !H.extensions[this.name] ? null :
|
|
436
|
+
return !H.extensions || !H.extensions[this.name] ? null : xe;
|
|
437
437
|
}
|
|
438
438
|
extendMaterialParams(a, e) {
|
|
439
439
|
const H = this.parser, i = H.json.materials[a];
|
|
440
440
|
if (!i.extensions || !i.extensions[this.name])
|
|
441
441
|
return Promise.resolve();
|
|
442
|
-
const
|
|
443
|
-
e.sheenColor = new
|
|
444
|
-
const
|
|
445
|
-
if (
|
|
446
|
-
const f =
|
|
447
|
-
e.sheenColor.setRGB(f[0], f[1], f[2],
|
|
442
|
+
const r = [];
|
|
443
|
+
e.sheenColor = new Ge(0, 0, 0), e.sheenRoughness = 0, e.sheen = 1;
|
|
444
|
+
const b = i.extensions[this.name];
|
|
445
|
+
if (b.sheenColorFactor !== void 0) {
|
|
446
|
+
const f = b.sheenColorFactor;
|
|
447
|
+
e.sheenColor.setRGB(f[0], f[1], f[2], Ue);
|
|
448
448
|
}
|
|
449
|
-
return
|
|
449
|
+
return b.sheenRoughnessFactor !== void 0 && (e.sheenRoughness = b.sheenRoughnessFactor), b.sheenColorTexture !== void 0 && r.push(H.assignTexture(e, "sheenColorMap", b.sheenColorTexture, Ke)), b.sheenRoughnessTexture !== void 0 && r.push(H.assignTexture(e, "sheenRoughnessMap", b.sheenRoughnessTexture)), Promise.all(r);
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
452
|
class Pi {
|
|
@@ -455,14 +455,14 @@ class Pi {
|
|
|
455
455
|
}
|
|
456
456
|
getMaterialType(a) {
|
|
457
457
|
const H = this.parser.json.materials[a];
|
|
458
|
-
return !H.extensions || !H.extensions[this.name] ? null :
|
|
458
|
+
return !H.extensions || !H.extensions[this.name] ? null : xe;
|
|
459
459
|
}
|
|
460
460
|
extendMaterialParams(a, e) {
|
|
461
461
|
const H = this.parser, i = H.json.materials[a];
|
|
462
462
|
if (!i.extensions || !i.extensions[this.name])
|
|
463
463
|
return Promise.resolve();
|
|
464
|
-
const
|
|
465
|
-
return
|
|
464
|
+
const r = [], b = i.extensions[this.name];
|
|
465
|
+
return b.transmissionFactor !== void 0 && (e.transmission = b.transmissionFactor), b.transmissionTexture !== void 0 && r.push(H.assignTexture(e, "transmissionMap", b.transmissionTexture)), Promise.all(r);
|
|
466
466
|
}
|
|
467
467
|
}
|
|
468
468
|
class Bi {
|
|
@@ -471,16 +471,16 @@ class Bi {
|
|
|
471
471
|
}
|
|
472
472
|
getMaterialType(a) {
|
|
473
473
|
const H = this.parser.json.materials[a];
|
|
474
|
-
return !H.extensions || !H.extensions[this.name] ? null :
|
|
474
|
+
return !H.extensions || !H.extensions[this.name] ? null : xe;
|
|
475
475
|
}
|
|
476
476
|
extendMaterialParams(a, e) {
|
|
477
477
|
const H = this.parser, i = H.json.materials[a];
|
|
478
478
|
if (!i.extensions || !i.extensions[this.name])
|
|
479
479
|
return Promise.resolve();
|
|
480
|
-
const
|
|
481
|
-
e.thickness =
|
|
482
|
-
const f =
|
|
483
|
-
return e.attenuationColor = new
|
|
480
|
+
const r = [], b = i.extensions[this.name];
|
|
481
|
+
e.thickness = b.thicknessFactor !== void 0 ? b.thicknessFactor : 0, b.thicknessTexture !== void 0 && r.push(H.assignTexture(e, "thicknessMap", b.thicknessTexture)), e.attenuationDistance = b.attenuationDistance || 1 / 0;
|
|
482
|
+
const f = b.attenuationColor || [1, 1, 1];
|
|
483
|
+
return e.attenuationColor = new Ge().setRGB(f[0], f[1], f[2], Ue), Promise.all(r);
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
486
|
class qi {
|
|
@@ -489,14 +489,14 @@ class qi {
|
|
|
489
489
|
}
|
|
490
490
|
getMaterialType(a) {
|
|
491
491
|
const H = this.parser.json.materials[a];
|
|
492
|
-
return !H.extensions || !H.extensions[this.name] ? null :
|
|
492
|
+
return !H.extensions || !H.extensions[this.name] ? null : xe;
|
|
493
493
|
}
|
|
494
494
|
extendMaterialParams(a, e) {
|
|
495
495
|
const i = this.parser.json.materials[a];
|
|
496
496
|
if (!i.extensions || !i.extensions[this.name])
|
|
497
497
|
return Promise.resolve();
|
|
498
|
-
const
|
|
499
|
-
return e.ior =
|
|
498
|
+
const r = i.extensions[this.name];
|
|
499
|
+
return e.ior = r.ior !== void 0 ? r.ior : 1.5, Promise.resolve();
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
502
|
class Wi {
|
|
@@ -505,16 +505,16 @@ class Wi {
|
|
|
505
505
|
}
|
|
506
506
|
getMaterialType(a) {
|
|
507
507
|
const H = this.parser.json.materials[a];
|
|
508
|
-
return !H.extensions || !H.extensions[this.name] ? null :
|
|
508
|
+
return !H.extensions || !H.extensions[this.name] ? null : xe;
|
|
509
509
|
}
|
|
510
510
|
extendMaterialParams(a, e) {
|
|
511
511
|
const H = this.parser, i = H.json.materials[a];
|
|
512
512
|
if (!i.extensions || !i.extensions[this.name])
|
|
513
513
|
return Promise.resolve();
|
|
514
|
-
const
|
|
515
|
-
e.specularIntensity =
|
|
516
|
-
const f =
|
|
517
|
-
return e.specularColor = new
|
|
514
|
+
const r = [], b = i.extensions[this.name];
|
|
515
|
+
e.specularIntensity = b.specularFactor !== void 0 ? b.specularFactor : 1, b.specularTexture !== void 0 && r.push(H.assignTexture(e, "specularIntensityMap", b.specularTexture));
|
|
516
|
+
const f = b.specularColorFactor || [1, 1, 1];
|
|
517
|
+
return e.specularColor = new Ge().setRGB(f[0], f[1], f[2], Ue), b.specularColorTexture !== void 0 && r.push(H.assignTexture(e, "specularColorMap", b.specularColorTexture, Ke)), Promise.all(r);
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
520
|
class Ci {
|
|
@@ -523,14 +523,14 @@ class Ci {
|
|
|
523
523
|
}
|
|
524
524
|
getMaterialType(a) {
|
|
525
525
|
const H = this.parser.json.materials[a];
|
|
526
|
-
return !H.extensions || !H.extensions[this.name] ? null :
|
|
526
|
+
return !H.extensions || !H.extensions[this.name] ? null : xe;
|
|
527
527
|
}
|
|
528
528
|
extendMaterialParams(a, e) {
|
|
529
529
|
const H = this.parser, i = H.json.materials[a];
|
|
530
530
|
if (!i.extensions || !i.extensions[this.name])
|
|
531
531
|
return Promise.resolve();
|
|
532
|
-
const
|
|
533
|
-
return e.bumpScale =
|
|
532
|
+
const r = [], b = i.extensions[this.name];
|
|
533
|
+
return e.bumpScale = b.bumpFactor !== void 0 ? b.bumpFactor : 1, b.bumpTexture !== void 0 && r.push(H.assignTexture(e, "bumpMap", b.bumpTexture)), Promise.all(r);
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
536
|
class Vi {
|
|
@@ -539,14 +539,14 @@ class Vi {
|
|
|
539
539
|
}
|
|
540
540
|
getMaterialType(a) {
|
|
541
541
|
const H = this.parser.json.materials[a];
|
|
542
|
-
return !H.extensions || !H.extensions[this.name] ? null :
|
|
542
|
+
return !H.extensions || !H.extensions[this.name] ? null : xe;
|
|
543
543
|
}
|
|
544
544
|
extendMaterialParams(a, e) {
|
|
545
545
|
const H = this.parser, i = H.json.materials[a];
|
|
546
546
|
if (!i.extensions || !i.extensions[this.name])
|
|
547
547
|
return Promise.resolve();
|
|
548
|
-
const
|
|
549
|
-
return
|
|
548
|
+
const r = [], b = i.extensions[this.name];
|
|
549
|
+
return b.anisotropyStrength !== void 0 && (e.anisotropy = b.anisotropyStrength), b.anisotropyRotation !== void 0 && (e.anisotropyRotation = b.anisotropyRotation), b.anisotropyTexture !== void 0 && r.push(H.assignTexture(e, "anisotropyMap", b.anisotropyTexture)), Promise.all(r);
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
552
|
class Li {
|
|
@@ -557,13 +557,13 @@ class Li {
|
|
|
557
557
|
const e = this.parser, H = e.json, i = H.textures[a];
|
|
558
558
|
if (!i.extensions || !i.extensions[this.name])
|
|
559
559
|
return null;
|
|
560
|
-
const
|
|
561
|
-
if (!
|
|
560
|
+
const r = i.extensions[this.name], b = e.options.ktx2Loader;
|
|
561
|
+
if (!b) {
|
|
562
562
|
if (H.extensionsRequired && H.extensionsRequired.indexOf(this.name) >= 0)
|
|
563
563
|
throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");
|
|
564
564
|
return null;
|
|
565
565
|
}
|
|
566
|
-
return e.loadTextureImage(a,
|
|
566
|
+
return e.loadTextureImage(a, r.source, b);
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
569
|
class Si {
|
|
@@ -571,16 +571,16 @@ class Si {
|
|
|
571
571
|
this.parser = a, this.name = x.EXT_TEXTURE_WEBP;
|
|
572
572
|
}
|
|
573
573
|
loadTexture(a) {
|
|
574
|
-
const e = this.name, H = this.parser, i = H.json,
|
|
575
|
-
if (!
|
|
574
|
+
const e = this.name, H = this.parser, i = H.json, r = i.textures[a];
|
|
575
|
+
if (!r.extensions || !r.extensions[e])
|
|
576
576
|
return null;
|
|
577
|
-
const
|
|
577
|
+
const b = r.extensions[e], f = i.images[b.source];
|
|
578
578
|
let c = H.textureLoader;
|
|
579
579
|
if (f.uri) {
|
|
580
580
|
const t = H.options.manager.getHandler(f.uri);
|
|
581
581
|
t !== null && (c = t);
|
|
582
582
|
}
|
|
583
|
-
return H.loadTextureImage(a,
|
|
583
|
+
return H.loadTextureImage(a, b.source, c);
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
586
|
class zi {
|
|
@@ -588,16 +588,16 @@ class zi {
|
|
|
588
588
|
this.parser = a, this.name = x.EXT_TEXTURE_AVIF;
|
|
589
589
|
}
|
|
590
590
|
loadTexture(a) {
|
|
591
|
-
const e = this.name, H = this.parser, i = H.json,
|
|
592
|
-
if (!
|
|
591
|
+
const e = this.name, H = this.parser, i = H.json, r = i.textures[a];
|
|
592
|
+
if (!r.extensions || !r.extensions[e])
|
|
593
593
|
return null;
|
|
594
|
-
const
|
|
594
|
+
const b = r.extensions[e], f = i.images[b.source];
|
|
595
595
|
let c = H.textureLoader;
|
|
596
596
|
if (f.uri) {
|
|
597
597
|
const t = H.options.manager.getHandler(f.uri);
|
|
598
598
|
t !== null && (c = t);
|
|
599
599
|
}
|
|
600
|
-
return H.loadTextureImage(a,
|
|
600
|
+
return H.loadTextureImage(a, b.source, c);
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
603
|
class Qi {
|
|
@@ -607,19 +607,19 @@ class Qi {
|
|
|
607
607
|
loadBufferView(a) {
|
|
608
608
|
const e = this.parser.json, H = e.bufferViews[a];
|
|
609
609
|
if (H.extensions && H.extensions[this.name]) {
|
|
610
|
-
const i = H.extensions[this.name],
|
|
611
|
-
if (!
|
|
610
|
+
const i = H.extensions[this.name], r = this.parser.getDependency("buffer", i.buffer), b = this.parser.options.meshoptDecoder;
|
|
611
|
+
if (!b || !b.supported) {
|
|
612
612
|
if (e.extensionsRequired && e.extensionsRequired.indexOf(this.name) >= 0)
|
|
613
613
|
throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");
|
|
614
614
|
return null;
|
|
615
615
|
}
|
|
616
|
-
return
|
|
616
|
+
return r.then(function(f) {
|
|
617
617
|
const c = i.byteOffset || 0, t = i.byteLength || 0, o = i.count, d = i.byteStride, s = new Uint8Array(f, c, t);
|
|
618
|
-
return
|
|
619
|
-
return
|
|
620
|
-
}) :
|
|
621
|
-
const
|
|
622
|
-
return
|
|
618
|
+
return b.decodeGltfBufferAsync ? b.decodeGltfBufferAsync(o, d, s, i.mode, i.filter).then(function(l) {
|
|
619
|
+
return l.buffer;
|
|
620
|
+
}) : b.ready.then(function() {
|
|
621
|
+
const l = new ArrayBuffer(o * d);
|
|
622
|
+
return b.decodeGltfBuffer(new Uint8Array(l), o, d, s, i.mode, i.filter), l;
|
|
623
623
|
});
|
|
624
624
|
});
|
|
625
625
|
} else
|
|
@@ -636,55 +636,55 @@ class Zi {
|
|
|
636
636
|
return null;
|
|
637
637
|
const i = e.meshes[H.mesh];
|
|
638
638
|
for (const t of i.primitives)
|
|
639
|
-
if (t.mode !==
|
|
639
|
+
if (t.mode !== Me.TRIANGLES && t.mode !== Me.TRIANGLE_STRIP && t.mode !== Me.TRIANGLE_FAN && t.mode !== void 0)
|
|
640
640
|
return null;
|
|
641
|
-
const
|
|
642
|
-
for (const t in
|
|
643
|
-
f.push(this.parser.getDependency("accessor",
|
|
641
|
+
const b = H.extensions[this.name].attributes, f = [], c = {};
|
|
642
|
+
for (const t in b)
|
|
643
|
+
f.push(this.parser.getDependency("accessor", b[t]).then((o) => (c[t] = o, c[t])));
|
|
644
644
|
return f.length < 1 ? null : (f.push(this.parser.createNodeMesh(a)), Promise.all(f).then((t) => {
|
|
645
|
-
const o = t.pop(), d = o.isGroup ? o.children : [o], s = t[0].count,
|
|
645
|
+
const o = t.pop(), d = o.isGroup ? o.children : [o], s = t[0].count, l = [];
|
|
646
646
|
for (const h of d) {
|
|
647
|
-
const
|
|
647
|
+
const m = new B0(), _ = new j(), w = new ee(), p = new j(1, 1, 1), A = new T2(h.geometry, h.material, s);
|
|
648
648
|
for (let I = 0; I < s; I++)
|
|
649
|
-
c.TRANSLATION && _.fromBufferAttribute(c.TRANSLATION, I), c.ROTATION && w.fromBufferAttribute(c.ROTATION, I), c.SCALE && p.fromBufferAttribute(c.SCALE, I),
|
|
649
|
+
c.TRANSLATION && _.fromBufferAttribute(c.TRANSLATION, I), c.ROTATION && w.fromBufferAttribute(c.ROTATION, I), c.SCALE && p.fromBufferAttribute(c.SCALE, I), A.setMatrixAt(I, m.compose(_, w, p));
|
|
650
650
|
for (const I in c)
|
|
651
651
|
if (I === "_COLOR_0") {
|
|
652
|
-
const
|
|
653
|
-
|
|
652
|
+
const O = c[I];
|
|
653
|
+
A.instanceColor = new R2(O.array, O.itemSize, O.normalized);
|
|
654
654
|
} else I !== "TRANSLATION" && I !== "ROTATION" && I !== "SCALE" && h.geometry.setAttribute(I, c[I]);
|
|
655
|
-
|
|
655
|
+
a2.prototype.copy.call(A, h), this.parser.assignFinalMaterial(A), l.push(A);
|
|
656
656
|
}
|
|
657
|
-
return o.isGroup ? (o.clear(), o.add(...
|
|
657
|
+
return o.isGroup ? (o.clear(), o.add(...l), o) : l[0];
|
|
658
658
|
}));
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
|
-
const
|
|
661
|
+
const f2 = "glTF", _0 = 12, Ba = { JSON: 1313821514, BIN: 5130562 };
|
|
662
662
|
class Ji {
|
|
663
663
|
constructor(a) {
|
|
664
664
|
this.name = x.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
665
|
-
const e = new DataView(a, 0,
|
|
665
|
+
const e = new DataView(a, 0, _0), H = new TextDecoder();
|
|
666
666
|
if (this.header = {
|
|
667
667
|
magic: H.decode(new Uint8Array(a.slice(0, 4))),
|
|
668
668
|
version: e.getUint32(4, !0),
|
|
669
669
|
length: e.getUint32(8, !0)
|
|
670
|
-
}, this.header.magic !==
|
|
670
|
+
}, this.header.magic !== f2)
|
|
671
671
|
throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
|
|
672
672
|
if (this.header.version < 2)
|
|
673
673
|
throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
|
|
674
|
-
const i = this.header.length -
|
|
675
|
-
let
|
|
676
|
-
for (;
|
|
677
|
-
const f =
|
|
678
|
-
|
|
679
|
-
const c =
|
|
680
|
-
if (
|
|
681
|
-
const t = new Uint8Array(a,
|
|
674
|
+
const i = this.header.length - _0, r = new DataView(a, _0);
|
|
675
|
+
let b = 0;
|
|
676
|
+
for (; b < i; ) {
|
|
677
|
+
const f = r.getUint32(b, !0);
|
|
678
|
+
b += 4;
|
|
679
|
+
const c = r.getUint32(b, !0);
|
|
680
|
+
if (b += 4, c === Ba.JSON) {
|
|
681
|
+
const t = new Uint8Array(a, _0 + b, f);
|
|
682
682
|
this.content = H.decode(t);
|
|
683
|
-
} else if (c ===
|
|
684
|
-
const t =
|
|
683
|
+
} else if (c === Ba.BIN) {
|
|
684
|
+
const t = _0 + b;
|
|
685
685
|
this.body = a.slice(t, t + f);
|
|
686
686
|
}
|
|
687
|
-
|
|
687
|
+
b += f;
|
|
688
688
|
}
|
|
689
689
|
if (this.content === null)
|
|
690
690
|
throw new Error("THREE.GLTFLoader: JSON content not found.");
|
|
@@ -697,27 +697,27 @@ class Yi {
|
|
|
697
697
|
this.name = x.KHR_DRACO_MESH_COMPRESSION, this.json = a, this.dracoLoader = e, this.dracoLoader.preload();
|
|
698
698
|
}
|
|
699
699
|
decodePrimitive(a, e) {
|
|
700
|
-
const H = this.json, i = this.dracoLoader,
|
|
701
|
-
for (const o in
|
|
702
|
-
const d =
|
|
703
|
-
f[d] =
|
|
700
|
+
const H = this.json, i = this.dracoLoader, r = a.extensions[this.name].bufferView, b = a.extensions[this.name].attributes, f = {}, c = {}, t = {};
|
|
701
|
+
for (const o in b) {
|
|
702
|
+
const d = Ha[o] || o.toLowerCase();
|
|
703
|
+
f[d] = b[o];
|
|
704
704
|
}
|
|
705
705
|
for (const o in a.attributes) {
|
|
706
|
-
const d =
|
|
707
|
-
if (
|
|
708
|
-
const s = H.accessors[a.attributes[o]],
|
|
709
|
-
t[d] =
|
|
706
|
+
const d = Ha[o] || o.toLowerCase();
|
|
707
|
+
if (b[o] !== void 0) {
|
|
708
|
+
const s = H.accessors[a.attributes[o]], l = t0[s.componentType];
|
|
709
|
+
t[d] = l.name, c[d] = s.normalized === !0;
|
|
710
710
|
}
|
|
711
711
|
}
|
|
712
|
-
return e.getDependency("bufferView",
|
|
712
|
+
return e.getDependency("bufferView", r).then(function(o) {
|
|
713
713
|
return new Promise(function(d, s) {
|
|
714
|
-
i.decodeDracoFile(o, function(
|
|
715
|
-
for (const h in
|
|
716
|
-
const
|
|
717
|
-
_ !== void 0 && (
|
|
714
|
+
i.decodeDracoFile(o, function(l) {
|
|
715
|
+
for (const h in l.attributes) {
|
|
716
|
+
const m = l.attributes[h], _ = c[h];
|
|
717
|
+
_ !== void 0 && (m.normalized = _);
|
|
718
718
|
}
|
|
719
|
-
d(
|
|
720
|
-
}, f, t,
|
|
719
|
+
d(l);
|
|
720
|
+
}, f, t, Ue, s);
|
|
721
721
|
});
|
|
722
722
|
});
|
|
723
723
|
}
|
|
@@ -735,33 +735,33 @@ class Xi {
|
|
|
735
735
|
this.name = x.KHR_MESH_QUANTIZATION;
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
|
-
class
|
|
738
|
+
class t2 extends bi {
|
|
739
739
|
constructor(a, e, H, i) {
|
|
740
740
|
super(a, e, H, i);
|
|
741
741
|
}
|
|
742
742
|
copySampleValue_(a) {
|
|
743
|
-
const e = this.resultBuffer, H = this.sampleValues, i = this.valueSize,
|
|
744
|
-
for (let
|
|
745
|
-
e[
|
|
743
|
+
const e = this.resultBuffer, H = this.sampleValues, i = this.valueSize, r = a * i * 3 + i;
|
|
744
|
+
for (let b = 0; b !== i; b++)
|
|
745
|
+
e[b] = H[r + b];
|
|
746
746
|
return e;
|
|
747
747
|
}
|
|
748
748
|
interpolate_(a, e, H, i) {
|
|
749
|
-
const
|
|
749
|
+
const r = this.resultBuffer, b = this.sampleValues, f = this.valueSize, c = f * 2, t = f * 3, o = i - e, d = (H - e) / o, s = d * d, l = s * d, h = a * t, m = h - t, _ = -2 * l + 3 * s, w = l - s, p = 1 - _, A = w - s + d;
|
|
750
750
|
for (let I = 0; I !== f; I++) {
|
|
751
|
-
const
|
|
752
|
-
|
|
751
|
+
const O = b[m + I + f], q = b[m + I + c] * o, z = b[h + I + f], ye = b[h + I] * o;
|
|
752
|
+
r[I] = p * O + A * q + _ * z + w * ye;
|
|
753
753
|
}
|
|
754
|
-
return
|
|
754
|
+
return r;
|
|
755
755
|
}
|
|
756
756
|
}
|
|
757
|
-
const $i = new
|
|
758
|
-
class eb extends
|
|
757
|
+
const $i = new ee();
|
|
758
|
+
class eb extends t2 {
|
|
759
759
|
interpolate_(a, e, H, i) {
|
|
760
|
-
const
|
|
761
|
-
return $i.fromArray(
|
|
760
|
+
const r = super.interpolate_(a, e, H, i);
|
|
761
|
+
return $i.fromArray(r).normalize().toArray(r), r;
|
|
762
762
|
}
|
|
763
763
|
}
|
|
764
|
-
const
|
|
764
|
+
const Me = {
|
|
765
765
|
POINTS: 0,
|
|
766
766
|
LINES: 1,
|
|
767
767
|
LINE_LOOP: 2,
|
|
@@ -769,25 +769,25 @@ const De = {
|
|
|
769
769
|
TRIANGLES: 4,
|
|
770
770
|
TRIANGLE_STRIP: 5,
|
|
771
771
|
TRIANGLE_FAN: 6
|
|
772
|
-
},
|
|
772
|
+
}, t0 = {
|
|
773
773
|
5120: Int8Array,
|
|
774
774
|
5121: Uint8Array,
|
|
775
775
|
5122: Int16Array,
|
|
776
776
|
5123: Uint16Array,
|
|
777
777
|
5125: Uint32Array,
|
|
778
778
|
5126: Float32Array
|
|
779
|
-
},
|
|
780
|
-
9728:
|
|
781
|
-
9729:
|
|
779
|
+
}, qa = {
|
|
780
|
+
9728: b2,
|
|
781
|
+
9729: ia,
|
|
782
782
|
9984: U2,
|
|
783
783
|
9985: G2,
|
|
784
784
|
9986: E2,
|
|
785
|
-
9987:
|
|
786
|
-
},
|
|
785
|
+
9987: i2
|
|
786
|
+
}, Wa = {
|
|
787
787
|
33071: P2,
|
|
788
788
|
33648: x2,
|
|
789
|
-
10497:
|
|
790
|
-
},
|
|
789
|
+
10497: ba
|
|
790
|
+
}, Z0 = {
|
|
791
791
|
SCALAR: 1,
|
|
792
792
|
VEC2: 2,
|
|
793
793
|
VEC3: 3,
|
|
@@ -795,7 +795,7 @@ const De = {
|
|
|
795
795
|
MAT2: 4,
|
|
796
796
|
MAT3: 9,
|
|
797
797
|
MAT4: 16
|
|
798
|
-
},
|
|
798
|
+
}, Ha = {
|
|
799
799
|
POSITION: "position",
|
|
800
800
|
NORMAL: "normal",
|
|
801
801
|
TANGENT: "tangent",
|
|
@@ -806,7 +806,7 @@ const De = {
|
|
|
806
806
|
COLOR_0: "color",
|
|
807
807
|
WEIGHTS_0: "skinWeight",
|
|
808
808
|
JOINTS_0: "skinIndex"
|
|
809
|
-
},
|
|
809
|
+
}, Je = {
|
|
810
810
|
scale: "scale",
|
|
811
811
|
translation: "position",
|
|
812
812
|
rotation: "quaternion",
|
|
@@ -815,15 +815,15 @@ const De = {
|
|
|
815
815
|
CUBICSPLINE: void 0,
|
|
816
816
|
// We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
|
|
817
817
|
// keyframe track will be initialized with a default interpolation type, then modified.
|
|
818
|
-
LINEAR:
|
|
818
|
+
LINEAR: c2,
|
|
819
819
|
STEP: ei
|
|
820
|
-
},
|
|
820
|
+
}, J0 = {
|
|
821
821
|
OPAQUE: "OPAQUE",
|
|
822
822
|
MASK: "MASK",
|
|
823
823
|
BLEND: "BLEND"
|
|
824
824
|
};
|
|
825
825
|
function ib(n) {
|
|
826
|
-
return n.DefaultMaterial === void 0 && (n.DefaultMaterial = new
|
|
826
|
+
return n.DefaultMaterial === void 0 && (n.DefaultMaterial = new r2({
|
|
827
827
|
color: 16777215,
|
|
828
828
|
emissive: 0,
|
|
829
829
|
metalness: 1,
|
|
@@ -833,43 +833,43 @@ function ib(n) {
|
|
|
833
833
|
side: ii
|
|
834
834
|
})), n.DefaultMaterial;
|
|
835
835
|
}
|
|
836
|
-
function
|
|
836
|
+
function a0(n, a, e) {
|
|
837
837
|
for (const H in e.extensions)
|
|
838
838
|
n[H] === void 0 && (a.userData.gltfExtensions = a.userData.gltfExtensions || {}, a.userData.gltfExtensions[H] = e.extensions[H]);
|
|
839
839
|
}
|
|
840
|
-
function
|
|
840
|
+
function We(n, a) {
|
|
841
841
|
a.extras !== void 0 && (typeof a.extras == "object" ? Object.assign(n.userData, a.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + a.extras));
|
|
842
842
|
}
|
|
843
843
|
function bb(n, a, e) {
|
|
844
|
-
let H = !1, i = !1,
|
|
844
|
+
let H = !1, i = !1, r = !1;
|
|
845
845
|
for (let t = 0, o = a.length; t < o; t++) {
|
|
846
846
|
const d = a[t];
|
|
847
|
-
if (d.POSITION !== void 0 && (H = !0), d.NORMAL !== void 0 && (i = !0), d.COLOR_0 !== void 0 && (
|
|
847
|
+
if (d.POSITION !== void 0 && (H = !0), d.NORMAL !== void 0 && (i = !0), d.COLOR_0 !== void 0 && (r = !0), H && i && r) break;
|
|
848
848
|
}
|
|
849
|
-
if (!H && !i && !
|
|
850
|
-
const
|
|
849
|
+
if (!H && !i && !r) return Promise.resolve(n);
|
|
850
|
+
const b = [], f = [], c = [];
|
|
851
851
|
for (let t = 0, o = a.length; t < o; t++) {
|
|
852
852
|
const d = a[t];
|
|
853
853
|
if (H) {
|
|
854
854
|
const s = d.POSITION !== void 0 ? e.getDependency("accessor", d.POSITION) : n.attributes.position;
|
|
855
|
-
|
|
855
|
+
b.push(s);
|
|
856
856
|
}
|
|
857
857
|
if (i) {
|
|
858
858
|
const s = d.NORMAL !== void 0 ? e.getDependency("accessor", d.NORMAL) : n.attributes.normal;
|
|
859
859
|
f.push(s);
|
|
860
860
|
}
|
|
861
|
-
if (
|
|
861
|
+
if (r) {
|
|
862
862
|
const s = d.COLOR_0 !== void 0 ? e.getDependency("accessor", d.COLOR_0) : n.attributes.color;
|
|
863
863
|
c.push(s);
|
|
864
864
|
}
|
|
865
865
|
}
|
|
866
866
|
return Promise.all([
|
|
867
|
-
Promise.all(
|
|
867
|
+
Promise.all(b),
|
|
868
868
|
Promise.all(f),
|
|
869
869
|
Promise.all(c)
|
|
870
870
|
]).then(function(t) {
|
|
871
871
|
const o = t[0], d = t[1], s = t[2];
|
|
872
|
-
return H && (n.morphAttributes.position = o), i && (n.morphAttributes.normal = d),
|
|
872
|
+
return H && (n.morphAttributes.position = o), i && (n.morphAttributes.normal = d), r && (n.morphAttributes.color = s), n.morphTargetsRelative = !0, n;
|
|
873
873
|
});
|
|
874
874
|
}
|
|
875
875
|
function rb(n, a) {
|
|
@@ -889,19 +889,19 @@ function rb(n, a) {
|
|
|
889
889
|
function Hb(n) {
|
|
890
890
|
let a;
|
|
891
891
|
const e = n.extensions && n.extensions[x.KHR_DRACO_MESH_COMPRESSION];
|
|
892
|
-
if (e ? a = "draco:" + e.bufferView + ":" + e.indices + ":" +
|
|
892
|
+
if (e ? a = "draco:" + e.bufferView + ":" + e.indices + ":" + Y0(e.attributes) : a = n.indices + ":" + Y0(n.attributes) + ":" + n.mode, n.targets !== void 0)
|
|
893
893
|
for (let H = 0, i = n.targets.length; H < i; H++)
|
|
894
|
-
a += ":" +
|
|
894
|
+
a += ":" + Y0(n.targets[H]);
|
|
895
895
|
return a;
|
|
896
896
|
}
|
|
897
|
-
function
|
|
897
|
+
function Y0(n) {
|
|
898
898
|
let a = "";
|
|
899
899
|
const e = Object.keys(n).sort();
|
|
900
900
|
for (let H = 0, i = e.length; H < i; H++)
|
|
901
901
|
a += e[H] + ":" + n[e[H]] + ";";
|
|
902
902
|
return a;
|
|
903
903
|
}
|
|
904
|
-
function
|
|
904
|
+
function ca(n) {
|
|
905
905
|
switch (n) {
|
|
906
906
|
case Int8Array:
|
|
907
907
|
return 1 / 127;
|
|
@@ -918,18 +918,18 @@ function ra(n) {
|
|
|
918
918
|
function cb(n) {
|
|
919
919
|
return n.search(/\.jpe?g($|\?)/i) > 0 || n.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : n.search(/\.webp($|\?)/i) > 0 || n.search(/^data\:image\/webp/) === 0 ? "image/webp" : n.search(/\.ktx2($|\?)/i) > 0 || n.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
|
|
920
920
|
}
|
|
921
|
-
const fb = new
|
|
921
|
+
const fb = new B0();
|
|
922
922
|
class tb {
|
|
923
923
|
constructor(a = {}, e = {}) {
|
|
924
924
|
this.json = a, this.extensions = {}, this.plugins = {}, this.options = e, this.cache = new Ri(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
|
|
925
|
-
let H = !1, i = -1,
|
|
925
|
+
let H = !1, i = -1, r = !1, b = -1;
|
|
926
926
|
if (typeof navigator < "u") {
|
|
927
927
|
const f = navigator.userAgent;
|
|
928
928
|
H = /^((?!chrome|android).)*safari/i.test(f) === !0;
|
|
929
929
|
const c = f.match(/Version\/(\d+)/);
|
|
930
|
-
i = H && c ? parseInt(c[1], 10) : -1,
|
|
930
|
+
i = H && c ? parseInt(c[1], 10) : -1, r = f.indexOf("Firefox") > -1, b = r ? f.match(/Firefox\/([0-9]+)\./)[1] : -1;
|
|
931
931
|
}
|
|
932
|
-
typeof createImageBitmap > "u" || H && i < 17 ||
|
|
932
|
+
typeof createImageBitmap > "u" || H && i < 17 || r && b < 98 ? this.textureLoader = new M2(this.options.manager) : this.textureLoader = new D2(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new P0(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
|
|
933
933
|
}
|
|
934
934
|
setExtensions(a) {
|
|
935
935
|
this.extensions = a;
|
|
@@ -938,28 +938,28 @@ class tb {
|
|
|
938
938
|
this.plugins = a;
|
|
939
939
|
}
|
|
940
940
|
parse(a, e) {
|
|
941
|
-
const H = this, i = this.json,
|
|
942
|
-
this.cache.removeAll(), this.nodeCache = {}, this._invokeAll(function(
|
|
943
|
-
return
|
|
944
|
-
}), Promise.all(this._invokeAll(function(
|
|
945
|
-
return
|
|
941
|
+
const H = this, i = this.json, r = this.extensions;
|
|
942
|
+
this.cache.removeAll(), this.nodeCache = {}, this._invokeAll(function(b) {
|
|
943
|
+
return b._markDefs && b._markDefs();
|
|
944
|
+
}), Promise.all(this._invokeAll(function(b) {
|
|
945
|
+
return b.beforeRoot && b.beforeRoot();
|
|
946
946
|
})).then(function() {
|
|
947
947
|
return Promise.all([
|
|
948
948
|
H.getDependencies("scene"),
|
|
949
949
|
H.getDependencies("animation"),
|
|
950
950
|
H.getDependencies("camera")
|
|
951
951
|
]);
|
|
952
|
-
}).then(function(
|
|
952
|
+
}).then(function(b) {
|
|
953
953
|
const f = {
|
|
954
|
-
scene:
|
|
955
|
-
scenes:
|
|
956
|
-
animations:
|
|
957
|
-
cameras:
|
|
954
|
+
scene: b[0][i.scene || 0],
|
|
955
|
+
scenes: b[0],
|
|
956
|
+
animations: b[1],
|
|
957
|
+
cameras: b[2],
|
|
958
958
|
asset: i.asset,
|
|
959
959
|
parser: H,
|
|
960
960
|
userData: {}
|
|
961
961
|
};
|
|
962
|
-
return
|
|
962
|
+
return a0(r, f, i), We(f, i), Promise.all(H._invokeAll(function(c) {
|
|
963
963
|
return c.afterRoot && c.afterRoot(f);
|
|
964
964
|
})).then(function() {
|
|
965
965
|
for (const c of f.scenes)
|
|
@@ -975,14 +975,14 @@ class tb {
|
|
|
975
975
|
*/
|
|
976
976
|
_markDefs() {
|
|
977
977
|
const a = this.json.nodes || [], e = this.json.skins || [], H = this.json.meshes || [];
|
|
978
|
-
for (let i = 0,
|
|
979
|
-
const
|
|
980
|
-
for (let f = 0, c =
|
|
981
|
-
a[
|
|
978
|
+
for (let i = 0, r = e.length; i < r; i++) {
|
|
979
|
+
const b = e[i].joints;
|
|
980
|
+
for (let f = 0, c = b.length; f < c; f++)
|
|
981
|
+
a[b[f]].isBone = !0;
|
|
982
982
|
}
|
|
983
|
-
for (let i = 0,
|
|
984
|
-
const
|
|
985
|
-
|
|
983
|
+
for (let i = 0, r = a.length; i < r; i++) {
|
|
984
|
+
const b = a[i];
|
|
985
|
+
b.mesh !== void 0 && (this._addNodeRef(this.meshCache, b.mesh), b.skin !== void 0 && (H[b.mesh].isSkinnedMesh = !0)), b.camera !== void 0 && this._addNodeRef(this.cameraCache, b.camera);
|
|
986
986
|
}
|
|
987
987
|
}
|
|
988
988
|
/**
|
|
@@ -1012,13 +1012,13 @@ class tb {
|
|
|
1012
1012
|
*/
|
|
1013
1013
|
_getNodeRef(a, e, H) {
|
|
1014
1014
|
if (a.refs[e] <= 1) return H;
|
|
1015
|
-
const i = H.clone(),
|
|
1016
|
-
const c = this.associations.get(
|
|
1015
|
+
const i = H.clone(), r = (b, f) => {
|
|
1016
|
+
const c = this.associations.get(b);
|
|
1017
1017
|
c != null && this.associations.set(f, c);
|
|
1018
|
-
for (const [t, o] of
|
|
1019
|
-
|
|
1018
|
+
for (const [t, o] of b.children.entries())
|
|
1019
|
+
r(o, f.children[t]);
|
|
1020
1020
|
};
|
|
1021
|
-
return
|
|
1021
|
+
return r(H, i), i.name += "_instance_" + a.uses[e]++, i;
|
|
1022
1022
|
}
|
|
1023
1023
|
_invokeOne(a) {
|
|
1024
1024
|
const e = Object.values(this.plugins);
|
|
@@ -1034,8 +1034,8 @@ class tb {
|
|
|
1034
1034
|
e.unshift(this);
|
|
1035
1035
|
const H = [];
|
|
1036
1036
|
for (let i = 0; i < e.length; i++) {
|
|
1037
|
-
const
|
|
1038
|
-
|
|
1037
|
+
const r = a(e[i]);
|
|
1038
|
+
r && H.push(r);
|
|
1039
1039
|
}
|
|
1040
1040
|
return H;
|
|
1041
1041
|
}
|
|
@@ -1056,50 +1056,50 @@ class tb {
|
|
|
1056
1056
|
i = this.loadScene(e);
|
|
1057
1057
|
break;
|
|
1058
1058
|
case "node":
|
|
1059
|
-
i = this._invokeOne(function(
|
|
1060
|
-
return
|
|
1059
|
+
i = this._invokeOne(function(r) {
|
|
1060
|
+
return r.loadNode && r.loadNode(e);
|
|
1061
1061
|
});
|
|
1062
1062
|
break;
|
|
1063
1063
|
case "mesh":
|
|
1064
|
-
i = this._invokeOne(function(
|
|
1065
|
-
return
|
|
1064
|
+
i = this._invokeOne(function(r) {
|
|
1065
|
+
return r.loadMesh && r.loadMesh(e);
|
|
1066
1066
|
});
|
|
1067
1067
|
break;
|
|
1068
1068
|
case "accessor":
|
|
1069
1069
|
i = this.loadAccessor(e);
|
|
1070
1070
|
break;
|
|
1071
1071
|
case "bufferView":
|
|
1072
|
-
i = this._invokeOne(function(
|
|
1073
|
-
return
|
|
1072
|
+
i = this._invokeOne(function(r) {
|
|
1073
|
+
return r.loadBufferView && r.loadBufferView(e);
|
|
1074
1074
|
});
|
|
1075
1075
|
break;
|
|
1076
1076
|
case "buffer":
|
|
1077
1077
|
i = this.loadBuffer(e);
|
|
1078
1078
|
break;
|
|
1079
1079
|
case "material":
|
|
1080
|
-
i = this._invokeOne(function(
|
|
1081
|
-
return
|
|
1080
|
+
i = this._invokeOne(function(r) {
|
|
1081
|
+
return r.loadMaterial && r.loadMaterial(e);
|
|
1082
1082
|
});
|
|
1083
1083
|
break;
|
|
1084
1084
|
case "texture":
|
|
1085
|
-
i = this._invokeOne(function(
|
|
1086
|
-
return
|
|
1085
|
+
i = this._invokeOne(function(r) {
|
|
1086
|
+
return r.loadTexture && r.loadTexture(e);
|
|
1087
1087
|
});
|
|
1088
1088
|
break;
|
|
1089
1089
|
case "skin":
|
|
1090
1090
|
i = this.loadSkin(e);
|
|
1091
1091
|
break;
|
|
1092
1092
|
case "animation":
|
|
1093
|
-
i = this._invokeOne(function(
|
|
1094
|
-
return
|
|
1093
|
+
i = this._invokeOne(function(r) {
|
|
1094
|
+
return r.loadAnimation && r.loadAnimation(e);
|
|
1095
1095
|
});
|
|
1096
1096
|
break;
|
|
1097
1097
|
case "camera":
|
|
1098
1098
|
i = this.loadCamera(e);
|
|
1099
1099
|
break;
|
|
1100
1100
|
default:
|
|
1101
|
-
if (i = this._invokeOne(function(
|
|
1102
|
-
return
|
|
1101
|
+
if (i = this._invokeOne(function(r) {
|
|
1102
|
+
return r != this && r.getDependency && r.getDependency(a, e);
|
|
1103
1103
|
}), !i)
|
|
1104
1104
|
throw new Error("Unknown type: " + a);
|
|
1105
1105
|
break;
|
|
@@ -1119,8 +1119,8 @@ class tb {
|
|
|
1119
1119
|
let e = this.cache.get(a);
|
|
1120
1120
|
if (!e) {
|
|
1121
1121
|
const H = this, i = this.json[a + (a === "mesh" ? "es" : "s")] || [];
|
|
1122
|
-
e = Promise.all(i.map(function(
|
|
1123
|
-
return H.getDependency(a,
|
|
1122
|
+
e = Promise.all(i.map(function(r, b) {
|
|
1123
|
+
return H.getDependency(a, b);
|
|
1124
1124
|
})), this.cache.add(a, e);
|
|
1125
1125
|
}
|
|
1126
1126
|
return e;
|
|
@@ -1139,9 +1139,9 @@ class tb {
|
|
|
1139
1139
|
if (e.uri === void 0 && a === 0)
|
|
1140
1140
|
return Promise.resolve(this.extensions[x.KHR_BINARY_GLTF].body);
|
|
1141
1141
|
const i = this.options;
|
|
1142
|
-
return new Promise(function(
|
|
1143
|
-
H.load(
|
|
1144
|
-
|
|
1142
|
+
return new Promise(function(r, b) {
|
|
1143
|
+
H.load(p0.resolveURL(e.uri, i.path), r, void 0, function() {
|
|
1144
|
+
b(new Error('THREE.GLTFLoader: Failed to load buffer "' + e.uri + '".'));
|
|
1145
1145
|
});
|
|
1146
1146
|
});
|
|
1147
1147
|
}
|
|
@@ -1155,8 +1155,8 @@ class tb {
|
|
|
1155
1155
|
loadBufferView(a) {
|
|
1156
1156
|
const e = this.json.bufferViews[a];
|
|
1157
1157
|
return this.getDependency("buffer", e.buffer).then(function(H) {
|
|
1158
|
-
const i = e.byteLength || 0,
|
|
1159
|
-
return H.slice(
|
|
1158
|
+
const i = e.byteLength || 0, r = e.byteOffset || 0;
|
|
1159
|
+
return H.slice(r, r + i);
|
|
1160
1160
|
});
|
|
1161
1161
|
}
|
|
1162
1162
|
/**
|
|
@@ -1169,25 +1169,25 @@ class tb {
|
|
|
1169
1169
|
loadAccessor(a) {
|
|
1170
1170
|
const e = this, H = this.json, i = this.json.accessors[a];
|
|
1171
1171
|
if (i.bufferView === void 0 && i.sparse === void 0) {
|
|
1172
|
-
const
|
|
1173
|
-
return Promise.resolve(new
|
|
1172
|
+
const b = Z0[i.type], f = t0[i.componentType], c = i.normalized === !0, t = new f(i.count * b);
|
|
1173
|
+
return Promise.resolve(new m0(t, b, c));
|
|
1174
1174
|
}
|
|
1175
|
-
const
|
|
1176
|
-
return i.bufferView !== void 0 ?
|
|
1177
|
-
const f =
|
|
1178
|
-
let
|
|
1179
|
-
if (
|
|
1180
|
-
const w = Math.floor(s /
|
|
1181
|
-
let
|
|
1182
|
-
|
|
1175
|
+
const r = [];
|
|
1176
|
+
return i.bufferView !== void 0 ? r.push(this.getDependency("bufferView", i.bufferView)) : r.push(null), i.sparse !== void 0 && (r.push(this.getDependency("bufferView", i.sparse.indices.bufferView)), r.push(this.getDependency("bufferView", i.sparse.values.bufferView))), Promise.all(r).then(function(b) {
|
|
1177
|
+
const f = b[0], c = Z0[i.type], t = t0[i.componentType], o = t.BYTES_PER_ELEMENT, d = o * c, s = i.byteOffset || 0, l = i.bufferView !== void 0 ? H.bufferViews[i.bufferView].byteStride : void 0, h = i.normalized === !0;
|
|
1178
|
+
let m, _;
|
|
1179
|
+
if (l && l !== d) {
|
|
1180
|
+
const w = Math.floor(s / l), p = "InterleavedBuffer:" + i.bufferView + ":" + i.componentType + ":" + w + ":" + i.count;
|
|
1181
|
+
let A = e.cache.get(p);
|
|
1182
|
+
A || (m = new t(f, w * l, i.count * l / o), A = new O2(m, l / o), e.cache.add(p, A)), _ = new ai(A, c, s % l / o, h);
|
|
1183
1183
|
} else
|
|
1184
|
-
f === null ?
|
|
1184
|
+
f === null ? m = new t(i.count * c) : m = new t(f, s, i.count * c), _ = new m0(m, c, h);
|
|
1185
1185
|
if (i.sparse !== void 0) {
|
|
1186
|
-
const w =
|
|
1187
|
-
f !== null && (_ = new
|
|
1188
|
-
for (let
|
|
1189
|
-
const
|
|
1190
|
-
if (_.setX(
|
|
1186
|
+
const w = Z0.SCALAR, p = t0[i.sparse.indices.componentType], A = i.sparse.indices.byteOffset || 0, I = i.sparse.values.byteOffset || 0, O = new p(b[1], A, i.sparse.count * w), q = new t(b[2], I, i.sparse.count * c);
|
|
1187
|
+
f !== null && (_ = new m0(_.array.slice(), _.itemSize, _.normalized)), _.normalized = !1;
|
|
1188
|
+
for (let z = 0, ye = O.length; z < ye; z++) {
|
|
1189
|
+
const ke = O[z];
|
|
1190
|
+
if (_.setX(ke, q[z * c]), c >= 2 && _.setY(ke, q[z * c + 1]), c >= 3 && _.setZ(ke, q[z * c + 2]), c >= 4 && _.setW(ke, q[z * c + 3]), c >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
1191
1191
|
}
|
|
1192
1192
|
_.normalized = h;
|
|
1193
1193
|
}
|
|
@@ -1202,51 +1202,51 @@ class tb {
|
|
|
1202
1202
|
* @return {Promise<THREE.Texture|null>}
|
|
1203
1203
|
*/
|
|
1204
1204
|
loadTexture(a) {
|
|
1205
|
-
const e = this.json, H = this.options,
|
|
1205
|
+
const e = this.json, H = this.options, r = e.textures[a].source, b = e.images[r];
|
|
1206
1206
|
let f = this.textureLoader;
|
|
1207
|
-
if (
|
|
1208
|
-
const c = H.manager.getHandler(
|
|
1207
|
+
if (b.uri) {
|
|
1208
|
+
const c = H.manager.getHandler(b.uri);
|
|
1209
1209
|
c !== null && (f = c);
|
|
1210
1210
|
}
|
|
1211
|
-
return this.loadTextureImage(a,
|
|
1211
|
+
return this.loadTextureImage(a, r, f);
|
|
1212
1212
|
}
|
|
1213
1213
|
loadTextureImage(a, e, H) {
|
|
1214
|
-
const i = this,
|
|
1214
|
+
const i = this, r = this.json, b = r.textures[a], f = r.images[e], c = (f.uri || f.bufferView) + ":" + b.sampler;
|
|
1215
1215
|
if (this.textureCache[c])
|
|
1216
1216
|
return this.textureCache[c];
|
|
1217
1217
|
const t = this.loadImageSource(e, H).then(function(o) {
|
|
1218
|
-
o.flipY = !1, o.name =
|
|
1219
|
-
const s = (
|
|
1220
|
-
return o.magFilter =
|
|
1218
|
+
o.flipY = !1, o.name = b.name || f.name || "", o.name === "" && typeof f.uri == "string" && f.uri.startsWith("data:image/") === !1 && (o.name = f.uri);
|
|
1219
|
+
const s = (r.samplers || {})[b.sampler] || {};
|
|
1220
|
+
return o.magFilter = qa[s.magFilter] || ia, o.minFilter = qa[s.minFilter] || i2, o.wrapS = Wa[s.wrapS] || ba, o.wrapT = Wa[s.wrapT] || ba, o.generateMipmaps = !o.isCompressedTexture && o.minFilter !== b2 && o.minFilter !== ia, i.associations.set(o, { textures: a }), o;
|
|
1221
1221
|
}).catch(function() {
|
|
1222
1222
|
return null;
|
|
1223
1223
|
});
|
|
1224
1224
|
return this.textureCache[c] = t, t;
|
|
1225
1225
|
}
|
|
1226
1226
|
loadImageSource(a, e) {
|
|
1227
|
-
const H = this, i = this.json,
|
|
1227
|
+
const H = this, i = this.json, r = this.options;
|
|
1228
1228
|
if (this.sourceCache[a] !== void 0)
|
|
1229
1229
|
return this.sourceCache[a].then((d) => d.clone());
|
|
1230
|
-
const
|
|
1231
|
-
let c =
|
|
1232
|
-
if (
|
|
1233
|
-
c = H.getDependency("bufferView",
|
|
1230
|
+
const b = i.images[a], f = self.URL || self.webkitURL;
|
|
1231
|
+
let c = b.uri || "", t = !1;
|
|
1232
|
+
if (b.bufferView !== void 0)
|
|
1233
|
+
c = H.getDependency("bufferView", b.bufferView).then(function(d) {
|
|
1234
1234
|
t = !0;
|
|
1235
|
-
const s = new Blob([d], { type:
|
|
1235
|
+
const s = new Blob([d], { type: b.mimeType });
|
|
1236
1236
|
return c = f.createObjectURL(s), c;
|
|
1237
1237
|
});
|
|
1238
|
-
else if (
|
|
1238
|
+
else if (b.uri === void 0)
|
|
1239
1239
|
throw new Error("THREE.GLTFLoader: Image " + a + " is missing URI and bufferView");
|
|
1240
1240
|
const o = Promise.resolve(c).then(function(d) {
|
|
1241
|
-
return new Promise(function(s,
|
|
1241
|
+
return new Promise(function(s, l) {
|
|
1242
1242
|
let h = s;
|
|
1243
|
-
e.isImageBitmapLoader === !0 && (h = function(
|
|
1244
|
-
const _ = new
|
|
1243
|
+
e.isImageBitmapLoader === !0 && (h = function(m) {
|
|
1244
|
+
const _ = new Da(m);
|
|
1245
1245
|
_.needsUpdate = !0, s(_);
|
|
1246
|
-
}), e.load(
|
|
1246
|
+
}), e.load(p0.resolveURL(d, r.path), h, void 0, l);
|
|
1247
1247
|
});
|
|
1248
1248
|
}).then(function(d) {
|
|
1249
|
-
return t === !0 && f.revokeObjectURL(c),
|
|
1249
|
+
return t === !0 && f.revokeObjectURL(c), We(d, b), d.userData.mimeType = b.mimeType || cb(b.uri), d;
|
|
1250
1250
|
}).catch(function(d) {
|
|
1251
1251
|
throw console.error("THREE.GLTFLoader: Couldn't load texture", c), d;
|
|
1252
1252
|
});
|
|
@@ -1263,17 +1263,17 @@ class tb {
|
|
|
1263
1263
|
* @return {Promise<Texture>}
|
|
1264
1264
|
*/
|
|
1265
1265
|
assignTexture(a, e, H, i) {
|
|
1266
|
-
const
|
|
1267
|
-
return this.getDependency("texture", H.index).then(function(
|
|
1268
|
-
if (!
|
|
1269
|
-
if (H.texCoord !== void 0 && H.texCoord > 0 && (
|
|
1266
|
+
const r = this;
|
|
1267
|
+
return this.getDependency("texture", H.index).then(function(b) {
|
|
1268
|
+
if (!b) return null;
|
|
1269
|
+
if (H.texCoord !== void 0 && H.texCoord > 0 && (b = b.clone(), b.channel = H.texCoord), r.extensions[x.KHR_TEXTURE_TRANSFORM]) {
|
|
1270
1270
|
const f = H.extensions !== void 0 ? H.extensions[x.KHR_TEXTURE_TRANSFORM] : void 0;
|
|
1271
1271
|
if (f) {
|
|
1272
|
-
const c =
|
|
1273
|
-
|
|
1272
|
+
const c = r.associations.get(b);
|
|
1273
|
+
b = r.extensions[x.KHR_TEXTURE_TRANSFORM].extendTexture(b, f), r.associations.set(b, c);
|
|
1274
1274
|
}
|
|
1275
1275
|
}
|
|
1276
|
-
return i !== void 0 && (
|
|
1276
|
+
return i !== void 0 && (b.colorSpace = i), a[e] = b, b;
|
|
1277
1277
|
});
|
|
1278
1278
|
}
|
|
1279
1279
|
/**
|
|
@@ -1289,26 +1289,26 @@ class tb {
|
|
|
1289
1289
|
assignFinalMaterial(a) {
|
|
1290
1290
|
const e = a.geometry;
|
|
1291
1291
|
let H = a.material;
|
|
1292
|
-
const i = e.attributes.tangent === void 0,
|
|
1292
|
+
const i = e.attributes.tangent === void 0, r = e.attributes.color !== void 0, b = e.attributes.normal === void 0;
|
|
1293
1293
|
if (a.isPoints) {
|
|
1294
1294
|
const f = "PointsMaterial:" + H.uuid;
|
|
1295
1295
|
let c = this.cache.get(f);
|
|
1296
|
-
c || (c = new B2(),
|
|
1296
|
+
c || (c = new B2(), z0.prototype.copy.call(c, H), c.color.copy(H.color), c.map = H.map, c.sizeAttenuation = !1, this.cache.add(f, c)), H = c;
|
|
1297
1297
|
} else if (a.isLine) {
|
|
1298
1298
|
const f = "LineBasicMaterial:" + H.uuid;
|
|
1299
1299
|
let c = this.cache.get(f);
|
|
1300
|
-
c || (c = new q2(),
|
|
1300
|
+
c || (c = new q2(), z0.prototype.copy.call(c, H), c.color.copy(H.color), c.map = H.map, this.cache.add(f, c)), H = c;
|
|
1301
1301
|
}
|
|
1302
|
-
if (i ||
|
|
1302
|
+
if (i || r || b) {
|
|
1303
1303
|
let f = "ClonedMaterial:" + H.uuid + ":";
|
|
1304
|
-
i && (f += "derivative-tangents:"),
|
|
1304
|
+
i && (f += "derivative-tangents:"), r && (f += "vertex-colors:"), b && (f += "flat-shading:");
|
|
1305
1305
|
let c = this.cache.get(f);
|
|
1306
|
-
c || (c = H.clone(),
|
|
1306
|
+
c || (c = H.clone(), r && (c.vertexColors = !0), b && (c.flatShading = !0), i && (c.normalScale && (c.normalScale.y *= -1), c.clearcoatNormalScale && (c.clearcoatNormalScale.y *= -1)), this.cache.add(f, c), this.associations.set(c, this.associations.get(H))), H = c;
|
|
1307
1307
|
}
|
|
1308
1308
|
a.material = H;
|
|
1309
1309
|
}
|
|
1310
1310
|
getMaterialType() {
|
|
1311
|
-
return
|
|
1311
|
+
return r2;
|
|
1312
1312
|
}
|
|
1313
1313
|
/**
|
|
1314
1314
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
|
|
@@ -1318,37 +1318,37 @@ class tb {
|
|
|
1318
1318
|
* @return {Promise<Material>}
|
|
1319
1319
|
*/
|
|
1320
1320
|
loadMaterial(a) {
|
|
1321
|
-
const e = this, H = this.json, i = this.extensions,
|
|
1322
|
-
let
|
|
1323
|
-
const f = {}, c =
|
|
1321
|
+
const e = this, H = this.json, i = this.extensions, r = H.materials[a];
|
|
1322
|
+
let b;
|
|
1323
|
+
const f = {}, c = r.extensions || {}, t = [];
|
|
1324
1324
|
if (c[x.KHR_MATERIALS_UNLIT]) {
|
|
1325
1325
|
const d = i[x.KHR_MATERIALS_UNLIT];
|
|
1326
|
-
|
|
1326
|
+
b = d.getMaterialType(), t.push(d.extendParams(f, r, e));
|
|
1327
1327
|
} else {
|
|
1328
|
-
const d =
|
|
1329
|
-
if (f.color = new
|
|
1328
|
+
const d = r.pbrMetallicRoughness || {};
|
|
1329
|
+
if (f.color = new Ge(1, 1, 1), f.opacity = 1, Array.isArray(d.baseColorFactor)) {
|
|
1330
1330
|
const s = d.baseColorFactor;
|
|
1331
|
-
f.color.setRGB(s[0], s[1], s[2],
|
|
1331
|
+
f.color.setRGB(s[0], s[1], s[2], Ue), f.opacity = s[3];
|
|
1332
1332
|
}
|
|
1333
|
-
d.baseColorTexture !== void 0 && t.push(e.assignTexture(f, "map", d.baseColorTexture,
|
|
1333
|
+
d.baseColorTexture !== void 0 && t.push(e.assignTexture(f, "map", d.baseColorTexture, Ke)), f.metalness = d.metallicFactor !== void 0 ? d.metallicFactor : 1, f.roughness = d.roughnessFactor !== void 0 ? d.roughnessFactor : 1, d.metallicRoughnessTexture !== void 0 && (t.push(e.assignTexture(f, "metalnessMap", d.metallicRoughnessTexture)), t.push(e.assignTexture(f, "roughnessMap", d.metallicRoughnessTexture))), b = this._invokeOne(function(s) {
|
|
1334
1334
|
return s.getMaterialType && s.getMaterialType(a);
|
|
1335
1335
|
}), t.push(Promise.all(this._invokeAll(function(s) {
|
|
1336
1336
|
return s.extendMaterialParams && s.extendMaterialParams(a, f);
|
|
1337
1337
|
})));
|
|
1338
1338
|
}
|
|
1339
|
-
|
|
1340
|
-
const o =
|
|
1341
|
-
if (o ===
|
|
1342
|
-
const d =
|
|
1339
|
+
r.doubleSided === !0 && (f.side = W2);
|
|
1340
|
+
const o = r.alphaMode || J0.OPAQUE;
|
|
1341
|
+
if (o === J0.BLEND ? (f.transparent = !0, f.depthWrite = !1) : (f.transparent = !1, o === J0.MASK && (f.alphaTest = r.alphaCutoff !== void 0 ? r.alphaCutoff : 0.5)), r.normalTexture !== void 0 && b !== A0 && (t.push(e.assignTexture(f, "normalMap", r.normalTexture)), f.normalScale = new fa(1, 1), r.normalTexture.scale !== void 0)) {
|
|
1342
|
+
const d = r.normalTexture.scale;
|
|
1343
1343
|
f.normalScale.set(d, d);
|
|
1344
1344
|
}
|
|
1345
|
-
if (
|
|
1346
|
-
const d =
|
|
1347
|
-
f.emissive = new
|
|
1345
|
+
if (r.occlusionTexture !== void 0 && b !== A0 && (t.push(e.assignTexture(f, "aoMap", r.occlusionTexture)), r.occlusionTexture.strength !== void 0 && (f.aoMapIntensity = r.occlusionTexture.strength)), r.emissiveFactor !== void 0 && b !== A0) {
|
|
1346
|
+
const d = r.emissiveFactor;
|
|
1347
|
+
f.emissive = new Ge().setRGB(d[0], d[1], d[2], Ue);
|
|
1348
1348
|
}
|
|
1349
|
-
return
|
|
1350
|
-
const d = new
|
|
1351
|
-
return
|
|
1349
|
+
return r.emissiveTexture !== void 0 && b !== A0 && t.push(e.assignTexture(f, "emissiveMap", r.emissiveTexture, Ke)), Promise.all(t).then(function() {
|
|
1350
|
+
const d = new b(f);
|
|
1351
|
+
return r.name && (d.name = r.name), We(d, r), e.associations.set(d, { materials: a }), r.extensions && a0(i, d, r), d;
|
|
1352
1352
|
});
|
|
1353
1353
|
}
|
|
1354
1354
|
/**
|
|
@@ -1373,22 +1373,22 @@ class tb {
|
|
|
1373
1373
|
*/
|
|
1374
1374
|
loadGeometries(a) {
|
|
1375
1375
|
const e = this, H = this.extensions, i = this.primitiveCache;
|
|
1376
|
-
function
|
|
1376
|
+
function r(f) {
|
|
1377
1377
|
return H[x.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(f, e).then(function(c) {
|
|
1378
|
-
return
|
|
1378
|
+
return Ca(c, f, e);
|
|
1379
1379
|
});
|
|
1380
1380
|
}
|
|
1381
|
-
const
|
|
1381
|
+
const b = [];
|
|
1382
1382
|
for (let f = 0, c = a.length; f < c; f++) {
|
|
1383
1383
|
const t = a[f], o = Hb(t), d = i[o];
|
|
1384
1384
|
if (d)
|
|
1385
|
-
|
|
1385
|
+
b.push(d.promise);
|
|
1386
1386
|
else {
|
|
1387
1387
|
let s;
|
|
1388
|
-
t.extensions && t.extensions[x.KHR_DRACO_MESH_COMPRESSION] ? s =
|
|
1388
|
+
t.extensions && t.extensions[x.KHR_DRACO_MESH_COMPRESSION] ? s = r(t) : s = Ca(new H2(), t, e), i[o] = { primitive: t, promise: s }, b.push(s);
|
|
1389
1389
|
}
|
|
1390
1390
|
}
|
|
1391
|
-
return Promise.all(
|
|
1391
|
+
return Promise.all(b);
|
|
1392
1392
|
}
|
|
1393
1393
|
/**
|
|
1394
1394
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#meshes
|
|
@@ -1398,42 +1398,42 @@ class tb {
|
|
|
1398
1398
|
* @return {Promise<Group|Mesh|SkinnedMesh|Line|Points>}
|
|
1399
1399
|
*/
|
|
1400
1400
|
loadMesh(a) {
|
|
1401
|
-
const e = this, H = this.json, i = this.extensions,
|
|
1402
|
-
for (let c = 0, t =
|
|
1403
|
-
const o =
|
|
1401
|
+
const e = this, H = this.json, i = this.extensions, r = H.meshes[a], b = r.primitives, f = [];
|
|
1402
|
+
for (let c = 0, t = b.length; c < t; c++) {
|
|
1403
|
+
const o = b[c].material === void 0 ? ib(this.cache) : this.getDependency("material", b[c].material);
|
|
1404
1404
|
f.push(o);
|
|
1405
1405
|
}
|
|
1406
|
-
return f.push(e.loadGeometries(
|
|
1406
|
+
return f.push(e.loadGeometries(b)), Promise.all(f).then(function(c) {
|
|
1407
1407
|
const t = c.slice(0, c.length - 1), o = c[c.length - 1], d = [];
|
|
1408
|
-
for (let
|
|
1409
|
-
const
|
|
1408
|
+
for (let l = 0, h = o.length; l < h; l++) {
|
|
1409
|
+
const m = o[l], _ = b[l];
|
|
1410
1410
|
let w;
|
|
1411
|
-
const p = t[
|
|
1412
|
-
if (_.mode ===
|
|
1413
|
-
w =
|
|
1414
|
-
else if (_.mode ===
|
|
1415
|
-
w = new L2(
|
|
1416
|
-
else if (_.mode ===
|
|
1417
|
-
w = new S2(
|
|
1418
|
-
else if (_.mode ===
|
|
1419
|
-
w = new z2(
|
|
1420
|
-
else if (_.mode ===
|
|
1421
|
-
w = new Q2(
|
|
1411
|
+
const p = t[l];
|
|
1412
|
+
if (_.mode === Me.TRIANGLES || _.mode === Me.TRIANGLE_STRIP || _.mode === Me.TRIANGLE_FAN || _.mode === void 0)
|
|
1413
|
+
w = r.isSkinnedMesh === !0 ? new V2(m, p) : new ta(m, p), w.isSkinnedMesh === !0 && w.normalizeSkinWeights(), _.mode === Me.TRIANGLE_STRIP ? w.geometry = Pa(w.geometry, $a) : _.mode === Me.TRIANGLE_FAN && (w.geometry = Pa(w.geometry, aa));
|
|
1414
|
+
else if (_.mode === Me.LINES)
|
|
1415
|
+
w = new L2(m, p);
|
|
1416
|
+
else if (_.mode === Me.LINE_STRIP)
|
|
1417
|
+
w = new S2(m, p);
|
|
1418
|
+
else if (_.mode === Me.LINE_LOOP)
|
|
1419
|
+
w = new z2(m, p);
|
|
1420
|
+
else if (_.mode === Me.POINTS)
|
|
1421
|
+
w = new Q2(m, p);
|
|
1422
1422
|
else
|
|
1423
1423
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + _.mode);
|
|
1424
|
-
Object.keys(w.geometry.morphAttributes).length > 0 && rb(w,
|
|
1424
|
+
Object.keys(w.geometry.morphAttributes).length > 0 && rb(w, r), w.name = e.createUniqueName(r.name || "mesh_" + a), We(w, r), _.extensions && a0(i, w, _), e.assignFinalMaterial(w), d.push(w);
|
|
1425
1425
|
}
|
|
1426
|
-
for (let
|
|
1427
|
-
e.associations.set(d[
|
|
1426
|
+
for (let l = 0, h = d.length; l < h; l++)
|
|
1427
|
+
e.associations.set(d[l], {
|
|
1428
1428
|
meshes: a,
|
|
1429
|
-
primitives:
|
|
1429
|
+
primitives: l
|
|
1430
1430
|
});
|
|
1431
1431
|
if (d.length === 1)
|
|
1432
|
-
return
|
|
1433
|
-
const s = new
|
|
1434
|
-
|
|
1435
|
-
for (let
|
|
1436
|
-
s.add(d[
|
|
1432
|
+
return r.extensions && a0(i, d[0], r), d[0];
|
|
1433
|
+
const s = new Q0();
|
|
1434
|
+
r.extensions && a0(i, s, r), e.associations.set(s, { meshes: a });
|
|
1435
|
+
for (let l = 0, h = d.length; l < h; l++)
|
|
1436
|
+
s.add(d[l]);
|
|
1437
1437
|
return s;
|
|
1438
1438
|
});
|
|
1439
1439
|
}
|
|
@@ -1451,7 +1451,7 @@ class tb {
|
|
|
1451
1451
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
1452
1452
|
return;
|
|
1453
1453
|
}
|
|
1454
|
-
return H.type === "perspective" ? e = new Z2(J2.radToDeg(i.yfov), i.aspectRatio || 1, i.znear || 1, i.zfar || 2e6) : H.type === "orthographic" && (e = new Y2(-i.xmag, i.xmag, i.ymag, -i.ymag, i.znear, i.zfar)), H.name && (e.name = this.createUniqueName(H.name)),
|
|
1454
|
+
return H.type === "perspective" ? e = new Z2(J2.radToDeg(i.yfov), i.aspectRatio || 1, i.znear || 1, i.zfar || 2e6) : H.type === "orthographic" && (e = new Y2(-i.xmag, i.xmag, i.ymag, -i.ymag, i.znear, i.zfar)), H.name && (e.name = this.createUniqueName(H.name)), We(e, H), Promise.resolve(e);
|
|
1455
1455
|
}
|
|
1456
1456
|
/**
|
|
1457
1457
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
@@ -1462,16 +1462,16 @@ class tb {
|
|
|
1462
1462
|
*/
|
|
1463
1463
|
loadSkin(a) {
|
|
1464
1464
|
const e = this.json.skins[a], H = [];
|
|
1465
|
-
for (let i = 0,
|
|
1465
|
+
for (let i = 0, r = e.joints.length; i < r; i++)
|
|
1466
1466
|
H.push(this._loadNodeShallow(e.joints[i]));
|
|
1467
1467
|
return e.inverseBindMatrices !== void 0 ? H.push(this.getDependency("accessor", e.inverseBindMatrices)) : H.push(null), Promise.all(H).then(function(i) {
|
|
1468
|
-
const
|
|
1469
|
-
for (let t = 0, o =
|
|
1470
|
-
const d =
|
|
1468
|
+
const r = i.pop(), b = i, f = [], c = [];
|
|
1469
|
+
for (let t = 0, o = b.length; t < o; t++) {
|
|
1470
|
+
const d = b[t];
|
|
1471
1471
|
if (d) {
|
|
1472
1472
|
f.push(d);
|
|
1473
|
-
const s = new
|
|
1474
|
-
|
|
1473
|
+
const s = new B0();
|
|
1474
|
+
r !== null && s.fromArray(r.array, t * 16), c.push(s);
|
|
1475
1475
|
} else
|
|
1476
1476
|
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', e.joints[t]);
|
|
1477
1477
|
}
|
|
@@ -1486,40 +1486,40 @@ class tb {
|
|
|
1486
1486
|
* @return {Promise<AnimationClip>}
|
|
1487
1487
|
*/
|
|
1488
1488
|
loadAnimation(a) {
|
|
1489
|
-
const e = this.json, H = this, i = e.animations[a],
|
|
1489
|
+
const e = this.json, H = this, i = e.animations[a], r = i.name ? i.name : "animation_" + a, b = [], f = [], c = [], t = [], o = [];
|
|
1490
1490
|
for (let d = 0, s = i.channels.length; d < s; d++) {
|
|
1491
|
-
const
|
|
1492
|
-
|
|
1491
|
+
const l = i.channels[d], h = i.samplers[l.sampler], m = l.target, _ = m.node, w = i.parameters !== void 0 ? i.parameters[h.input] : h.input, p = i.parameters !== void 0 ? i.parameters[h.output] : h.output;
|
|
1492
|
+
m.node !== void 0 && (b.push(this.getDependency("node", _)), f.push(this.getDependency("accessor", w)), c.push(this.getDependency("accessor", p)), t.push(h), o.push(m));
|
|
1493
1493
|
}
|
|
1494
1494
|
return Promise.all([
|
|
1495
|
-
Promise.all(
|
|
1495
|
+
Promise.all(b),
|
|
1496
1496
|
Promise.all(f),
|
|
1497
1497
|
Promise.all(c),
|
|
1498
1498
|
Promise.all(t),
|
|
1499
1499
|
Promise.all(o)
|
|
1500
1500
|
]).then(function(d) {
|
|
1501
|
-
const s = d[0],
|
|
1502
|
-
for (let p = 0,
|
|
1503
|
-
const I = s[p],
|
|
1501
|
+
const s = d[0], l = d[1], h = d[2], m = d[3], _ = d[4], w = [];
|
|
1502
|
+
for (let p = 0, A = s.length; p < A; p++) {
|
|
1503
|
+
const I = s[p], O = l[p], q = h[p], z = m[p], ye = _[p];
|
|
1504
1504
|
if (I === void 0) continue;
|
|
1505
1505
|
I.updateMatrix && I.updateMatrix();
|
|
1506
|
-
const
|
|
1507
|
-
if (
|
|
1508
|
-
for (let ge = 0; ge <
|
|
1509
|
-
w.push(
|
|
1506
|
+
const ke = H._createAnimationTracks(I, O, q, z, ye);
|
|
1507
|
+
if (ke)
|
|
1508
|
+
for (let ge = 0; ge < ke.length; ge++)
|
|
1509
|
+
w.push(ke[ge]);
|
|
1510
1510
|
}
|
|
1511
|
-
return new X2(
|
|
1511
|
+
return new X2(r, void 0, w);
|
|
1512
1512
|
});
|
|
1513
1513
|
}
|
|
1514
1514
|
createNodeMesh(a) {
|
|
1515
1515
|
const e = this.json, H = this, i = e.nodes[a];
|
|
1516
|
-
return i.mesh === void 0 ? null : H.getDependency("mesh", i.mesh).then(function(
|
|
1517
|
-
const
|
|
1518
|
-
return i.weights !== void 0 &&
|
|
1516
|
+
return i.mesh === void 0 ? null : H.getDependency("mesh", i.mesh).then(function(r) {
|
|
1517
|
+
const b = H._getNodeRef(H.meshCache, i.mesh, r);
|
|
1518
|
+
return i.weights !== void 0 && b.traverse(function(f) {
|
|
1519
1519
|
if (f.isMesh)
|
|
1520
1520
|
for (let c = 0, t = i.weights.length; c < t; c++)
|
|
1521
1521
|
f.morphTargetInfluences[c] = i.weights[c];
|
|
1522
|
-
}),
|
|
1522
|
+
}), b;
|
|
1523
1523
|
});
|
|
1524
1524
|
}
|
|
1525
1525
|
/**
|
|
@@ -1530,21 +1530,21 @@ class tb {
|
|
|
1530
1530
|
* @return {Promise<Object3D>}
|
|
1531
1531
|
*/
|
|
1532
1532
|
loadNode(a) {
|
|
1533
|
-
const e = this.json, H = this, i = e.nodes[a],
|
|
1533
|
+
const e = this.json, H = this, i = e.nodes[a], r = H._loadNodeShallow(a), b = [], f = i.children || [];
|
|
1534
1534
|
for (let t = 0, o = f.length; t < o; t++)
|
|
1535
|
-
|
|
1535
|
+
b.push(H.getDependency("node", f[t]));
|
|
1536
1536
|
const c = i.skin === void 0 ? Promise.resolve(null) : H.getDependency("skin", i.skin);
|
|
1537
1537
|
return Promise.all([
|
|
1538
|
-
|
|
1539
|
-
Promise.all(
|
|
1538
|
+
r,
|
|
1539
|
+
Promise.all(b),
|
|
1540
1540
|
c
|
|
1541
1541
|
]).then(function(t) {
|
|
1542
1542
|
const o = t[0], d = t[1], s = t[2];
|
|
1543
|
-
s !== null && o.traverse(function(
|
|
1544
|
-
|
|
1543
|
+
s !== null && o.traverse(function(l) {
|
|
1544
|
+
l.isSkinnedMesh && l.bind(s, fb);
|
|
1545
1545
|
});
|
|
1546
|
-
for (let
|
|
1547
|
-
o.add(d[
|
|
1546
|
+
for (let l = 0, h = d.length; l < h; l++)
|
|
1547
|
+
o.add(d[l]);
|
|
1548
1548
|
return o;
|
|
1549
1549
|
});
|
|
1550
1550
|
}
|
|
@@ -1554,28 +1554,28 @@ class tb {
|
|
|
1554
1554
|
const e = this.json, H = this.extensions, i = this;
|
|
1555
1555
|
if (this.nodeCache[a] !== void 0)
|
|
1556
1556
|
return this.nodeCache[a];
|
|
1557
|
-
const
|
|
1557
|
+
const r = e.nodes[a], b = r.name ? i.createUniqueName(r.name) : "", f = [], c = i._invokeOne(function(t) {
|
|
1558
1558
|
return t.createNodeMesh && t.createNodeMesh(a);
|
|
1559
1559
|
});
|
|
1560
|
-
return c && f.push(c),
|
|
1561
|
-
return i._getNodeRef(i.cameraCache,
|
|
1560
|
+
return c && f.push(c), r.camera !== void 0 && f.push(i.getDependency("camera", r.camera).then(function(t) {
|
|
1561
|
+
return i._getNodeRef(i.cameraCache, r.camera, t);
|
|
1562
1562
|
})), i._invokeAll(function(t) {
|
|
1563
1563
|
return t.createNodeAttachment && t.createNodeAttachment(a);
|
|
1564
1564
|
}).forEach(function(t) {
|
|
1565
1565
|
f.push(t);
|
|
1566
1566
|
}), this.nodeCache[a] = Promise.all(f).then(function(t) {
|
|
1567
1567
|
let o;
|
|
1568
|
-
if (
|
|
1568
|
+
if (r.isBone === !0 ? o = new $2() : t.length > 1 ? o = new Q0() : t.length === 1 ? o = t[0] : o = new a2(), o !== t[0])
|
|
1569
1569
|
for (let d = 0, s = t.length; d < s; d++)
|
|
1570
1570
|
o.add(t[d]);
|
|
1571
|
-
if (
|
|
1572
|
-
const d = new
|
|
1573
|
-
d.fromArray(
|
|
1571
|
+
if (r.name && (o.userData.name = r.name, o.name = b), We(o, r), r.extensions && a0(H, o, r), r.matrix !== void 0) {
|
|
1572
|
+
const d = new B0();
|
|
1573
|
+
d.fromArray(r.matrix), o.applyMatrix4(d);
|
|
1574
1574
|
} else
|
|
1575
|
-
|
|
1575
|
+
r.translation !== void 0 && o.position.fromArray(r.translation), r.rotation !== void 0 && o.quaternion.fromArray(r.rotation), r.scale !== void 0 && o.scale.fromArray(r.scale);
|
|
1576
1576
|
if (!i.associations.has(o))
|
|
1577
1577
|
i.associations.set(o, {});
|
|
1578
|
-
else if (
|
|
1578
|
+
else if (r.mesh !== void 0 && i.meshCache.refs[r.mesh] > 1) {
|
|
1579
1579
|
const d = i.associations.get(o);
|
|
1580
1580
|
i.associations.set(o, { ...d });
|
|
1581
1581
|
}
|
|
@@ -1590,87 +1590,87 @@ class tb {
|
|
|
1590
1590
|
* @return {Promise<Group>}
|
|
1591
1591
|
*/
|
|
1592
1592
|
loadScene(a) {
|
|
1593
|
-
const e = this.extensions, H = this.json.scenes[a], i = this,
|
|
1594
|
-
H.name && (
|
|
1595
|
-
const
|
|
1596
|
-
for (let c = 0, t =
|
|
1597
|
-
f.push(i.getDependency("node",
|
|
1593
|
+
const e = this.extensions, H = this.json.scenes[a], i = this, r = new Q0();
|
|
1594
|
+
H.name && (r.name = i.createUniqueName(H.name)), We(r, H), H.extensions && a0(e, r, H);
|
|
1595
|
+
const b = H.nodes || [], f = [];
|
|
1596
|
+
for (let c = 0, t = b.length; c < t; c++)
|
|
1597
|
+
f.push(i.getDependency("node", b[c]));
|
|
1598
1598
|
return Promise.all(f).then(function(c) {
|
|
1599
1599
|
for (let o = 0, d = c.length; o < d; o++)
|
|
1600
|
-
|
|
1600
|
+
r.add(c[o]);
|
|
1601
1601
|
const t = (o) => {
|
|
1602
1602
|
const d = /* @__PURE__ */ new Map();
|
|
1603
|
-
for (const [s,
|
|
1604
|
-
(s instanceof
|
|
1603
|
+
for (const [s, l] of i.associations)
|
|
1604
|
+
(s instanceof z0 || s instanceof Da) && d.set(s, l);
|
|
1605
1605
|
return o.traverse((s) => {
|
|
1606
|
-
const
|
|
1607
|
-
|
|
1606
|
+
const l = i.associations.get(s);
|
|
1607
|
+
l != null && d.set(s, l);
|
|
1608
1608
|
}), d;
|
|
1609
1609
|
};
|
|
1610
|
-
return i.associations = t(
|
|
1610
|
+
return i.associations = t(r), r;
|
|
1611
1611
|
});
|
|
1612
1612
|
}
|
|
1613
|
-
_createAnimationTracks(a, e, H, i,
|
|
1614
|
-
const
|
|
1615
|
-
|
|
1613
|
+
_createAnimationTracks(a, e, H, i, r) {
|
|
1614
|
+
const b = [], f = a.name ? a.name : a.uuid, c = [];
|
|
1615
|
+
Je[r.path] === Je.weights ? a.traverse(function(s) {
|
|
1616
1616
|
s.morphTargetInfluences && c.push(s.name ? s.name : s.uuid);
|
|
1617
1617
|
}) : c.push(f);
|
|
1618
1618
|
let t;
|
|
1619
|
-
switch (
|
|
1620
|
-
case
|
|
1621
|
-
t = Oa;
|
|
1622
|
-
break;
|
|
1623
|
-
case Ye.rotation:
|
|
1619
|
+
switch (Je[r.path]) {
|
|
1620
|
+
case Je.weights:
|
|
1624
1621
|
t = Ea;
|
|
1625
1622
|
break;
|
|
1626
|
-
case
|
|
1627
|
-
|
|
1628
|
-
|
|
1623
|
+
case Je.rotation:
|
|
1624
|
+
t = Ga;
|
|
1625
|
+
break;
|
|
1626
|
+
case Je.translation:
|
|
1627
|
+
case Je.scale:
|
|
1628
|
+
t = Oa;
|
|
1629
1629
|
break;
|
|
1630
1630
|
default:
|
|
1631
1631
|
switch (H.itemSize) {
|
|
1632
1632
|
case 1:
|
|
1633
|
-
t =
|
|
1633
|
+
t = Ea;
|
|
1634
1634
|
break;
|
|
1635
1635
|
case 2:
|
|
1636
1636
|
case 3:
|
|
1637
1637
|
default:
|
|
1638
|
-
t =
|
|
1638
|
+
t = Oa;
|
|
1639
1639
|
break;
|
|
1640
1640
|
}
|
|
1641
1641
|
break;
|
|
1642
1642
|
}
|
|
1643
|
-
const o = i.interpolation !== void 0 ? ab[i.interpolation] :
|
|
1644
|
-
for (let s = 0,
|
|
1643
|
+
const o = i.interpolation !== void 0 ? ab[i.interpolation] : c2, d = this._getArrayFromAccessor(H);
|
|
1644
|
+
for (let s = 0, l = c.length; s < l; s++) {
|
|
1645
1645
|
const h = new t(
|
|
1646
|
-
c[s] + "." +
|
|
1646
|
+
c[s] + "." + Je[r.path],
|
|
1647
1647
|
e.array,
|
|
1648
1648
|
d,
|
|
1649
1649
|
o
|
|
1650
1650
|
);
|
|
1651
|
-
i.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(h),
|
|
1651
|
+
i.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(h), b.push(h);
|
|
1652
1652
|
}
|
|
1653
|
-
return
|
|
1653
|
+
return b;
|
|
1654
1654
|
}
|
|
1655
1655
|
_getArrayFromAccessor(a) {
|
|
1656
1656
|
let e = a.array;
|
|
1657
1657
|
if (a.normalized) {
|
|
1658
|
-
const H =
|
|
1659
|
-
for (let
|
|
1660
|
-
i[
|
|
1658
|
+
const H = ca(e.constructor), i = new Float32Array(e.length);
|
|
1659
|
+
for (let r = 0, b = e.length; r < b; r++)
|
|
1660
|
+
i[r] = e[r] * H;
|
|
1661
1661
|
e = i;
|
|
1662
1662
|
}
|
|
1663
1663
|
return e;
|
|
1664
1664
|
}
|
|
1665
1665
|
_createCubicSplineTrackInterpolant(a) {
|
|
1666
1666
|
a.createInterpolant = function(H) {
|
|
1667
|
-
const i = this instanceof
|
|
1667
|
+
const i = this instanceof Ga ? eb : t2;
|
|
1668
1668
|
return new i(this.times, this.values, this.getValueSize() / 3, H);
|
|
1669
1669
|
}, a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
|
|
1670
1670
|
}
|
|
1671
1671
|
}
|
|
1672
1672
|
function nb(n, a, e) {
|
|
1673
|
-
const H = a.attributes, i = new
|
|
1673
|
+
const H = a.attributes, i = new I0();
|
|
1674
1674
|
if (H.POSITION !== void 0) {
|
|
1675
1675
|
const f = e.json.accessors[H.POSITION], c = f.min, t = f.max;
|
|
1676
1676
|
if (c !== void 0 && t !== void 0) {
|
|
@@ -1678,7 +1678,7 @@ function nb(n, a, e) {
|
|
|
1678
1678
|
new j(c[0], c[1], c[2]),
|
|
1679
1679
|
new j(t[0], t[1], t[2])
|
|
1680
1680
|
), f.normalized) {
|
|
1681
|
-
const o =
|
|
1681
|
+
const o = ca(t0[f.componentType]);
|
|
1682
1682
|
i.min.multiplyScalar(o), i.max.multiplyScalar(o);
|
|
1683
1683
|
}
|
|
1684
1684
|
} else {
|
|
@@ -1687,17 +1687,17 @@ function nb(n, a, e) {
|
|
|
1687
1687
|
}
|
|
1688
1688
|
} else
|
|
1689
1689
|
return;
|
|
1690
|
-
const
|
|
1691
|
-
if (
|
|
1690
|
+
const r = a.targets;
|
|
1691
|
+
if (r !== void 0) {
|
|
1692
1692
|
const f = new j(), c = new j();
|
|
1693
|
-
for (let t = 0, o =
|
|
1694
|
-
const d =
|
|
1693
|
+
for (let t = 0, o = r.length; t < o; t++) {
|
|
1694
|
+
const d = r[t];
|
|
1695
1695
|
if (d.POSITION !== void 0) {
|
|
1696
|
-
const s = e.json.accessors[d.POSITION],
|
|
1697
|
-
if (
|
|
1698
|
-
if (c.setX(Math.max(Math.abs(
|
|
1699
|
-
const
|
|
1700
|
-
c.multiplyScalar(
|
|
1696
|
+
const s = e.json.accessors[d.POSITION], l = s.min, h = s.max;
|
|
1697
|
+
if (l !== void 0 && h !== void 0) {
|
|
1698
|
+
if (c.setX(Math.max(Math.abs(l[0]), Math.abs(h[0]))), c.setY(Math.max(Math.abs(l[1]), Math.abs(h[1]))), c.setZ(Math.max(Math.abs(l[2]), Math.abs(h[2]))), s.normalized) {
|
|
1699
|
+
const m = ca(t0[s.componentType]);
|
|
1700
|
+
c.multiplyScalar(m);
|
|
1701
1701
|
}
|
|
1702
1702
|
f.max(c);
|
|
1703
1703
|
} else
|
|
@@ -1707,32 +1707,32 @@ function nb(n, a, e) {
|
|
|
1707
1707
|
i.expandByVector(f);
|
|
1708
1708
|
}
|
|
1709
1709
|
n.boundingBox = i;
|
|
1710
|
-
const
|
|
1711
|
-
i.getCenter(
|
|
1710
|
+
const b = new ri();
|
|
1711
|
+
i.getCenter(b.center), b.radius = i.min.distanceTo(i.max) / 2, n.boundingSphere = b;
|
|
1712
1712
|
}
|
|
1713
|
-
function
|
|
1713
|
+
function Ca(n, a, e) {
|
|
1714
1714
|
const H = a.attributes, i = [];
|
|
1715
|
-
function b
|
|
1716
|
-
return e.getDependency("accessor",
|
|
1715
|
+
function r(b, f) {
|
|
1716
|
+
return e.getDependency("accessor", b).then(function(c) {
|
|
1717
1717
|
n.setAttribute(f, c);
|
|
1718
1718
|
});
|
|
1719
1719
|
}
|
|
1720
|
-
for (const
|
|
1721
|
-
const f =
|
|
1722
|
-
f in n.attributes || i.push(
|
|
1720
|
+
for (const b in H) {
|
|
1721
|
+
const f = Ha[b] || b.toLowerCase();
|
|
1722
|
+
f in n.attributes || i.push(r(H[b], f));
|
|
1723
1723
|
}
|
|
1724
1724
|
if (a.indices !== void 0 && !n.index) {
|
|
1725
|
-
const
|
|
1725
|
+
const b = e.getDependency("accessor", a.indices).then(function(f) {
|
|
1726
1726
|
n.setIndex(f);
|
|
1727
1727
|
});
|
|
1728
|
-
i.push(
|
|
1728
|
+
i.push(b);
|
|
1729
1729
|
}
|
|
1730
|
-
return
|
|
1730
|
+
return ra.workingColorSpace !== Ue && "COLOR_0" in H && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${ra.workingColorSpace}" not supported.`), We(n, a), nb(n, a, e), Promise.all(i).then(function() {
|
|
1731
1731
|
return a.targets !== void 0 ? bb(n, a.targets, e) : n;
|
|
1732
1732
|
});
|
|
1733
1733
|
}
|
|
1734
|
-
const
|
|
1735
|
-
class db extends
|
|
1734
|
+
const K0 = /* @__PURE__ */ new WeakMap();
|
|
1735
|
+
class db extends e2 {
|
|
1736
1736
|
/**
|
|
1737
1737
|
* Constructs a new Draco loader.
|
|
1738
1738
|
*
|
|
@@ -1789,9 +1789,9 @@ class db extends $a {
|
|
|
1789
1789
|
* @param {onErrorCallback} onError - Executed when errors occur.
|
|
1790
1790
|
*/
|
|
1791
1791
|
load(a, e, H, i) {
|
|
1792
|
-
const
|
|
1793
|
-
|
|
1794
|
-
this.parse(
|
|
1792
|
+
const r = new P0(this.manager);
|
|
1793
|
+
r.setPath(this.path), r.setResponseType("arraybuffer"), r.setRequestHeader(this.requestHeader), r.setWithCredentials(this.withCredentials), r.load(a, (b) => {
|
|
1794
|
+
this.parse(b, e, i);
|
|
1795
1795
|
}, H, i);
|
|
1796
1796
|
}
|
|
1797
1797
|
/**
|
|
@@ -1803,23 +1803,23 @@ class db extends $a {
|
|
|
1803
1803
|
*/
|
|
1804
1804
|
parse(a, e, H = () => {
|
|
1805
1805
|
}) {
|
|
1806
|
-
this.decodeDracoFile(a, e, null, null,
|
|
1806
|
+
this.decodeDracoFile(a, e, null, null, Ke, H).catch(H);
|
|
1807
1807
|
}
|
|
1808
1808
|
//
|
|
1809
|
-
decodeDracoFile(a, e, H, i,
|
|
1809
|
+
decodeDracoFile(a, e, H, i, r = Ue, b = () => {
|
|
1810
1810
|
}) {
|
|
1811
1811
|
const f = {
|
|
1812
1812
|
attributeIDs: H || this.defaultAttributeIDs,
|
|
1813
1813
|
attributeTypes: i || this.defaultAttributeTypes,
|
|
1814
1814
|
useUniqueIDs: !!H,
|
|
1815
|
-
vertexColorSpace:
|
|
1815
|
+
vertexColorSpace: r
|
|
1816
1816
|
};
|
|
1817
|
-
return this.decodeGeometry(a, f).then(e).catch(
|
|
1817
|
+
return this.decodeGeometry(a, f).then(e).catch(b);
|
|
1818
1818
|
}
|
|
1819
1819
|
decodeGeometry(a, e) {
|
|
1820
1820
|
const H = JSON.stringify(e);
|
|
1821
|
-
if (
|
|
1822
|
-
const c =
|
|
1821
|
+
if (K0.has(a)) {
|
|
1822
|
+
const c = K0.get(a);
|
|
1823
1823
|
if (c.key === H)
|
|
1824
1824
|
return c.promise;
|
|
1825
1825
|
if (a.byteLength === 0)
|
|
@@ -1828,35 +1828,35 @@ class db extends $a {
|
|
|
1828
1828
|
);
|
|
1829
1829
|
}
|
|
1830
1830
|
let i;
|
|
1831
|
-
const
|
|
1832
|
-
i._callbacks[
|
|
1831
|
+
const r = this.workerNextTaskID++, b = a.byteLength, f = this._getWorker(r, b).then((c) => (i = c, new Promise((t, o) => {
|
|
1832
|
+
i._callbacks[r] = { resolve: t, reject: o }, i.postMessage({ type: "decode", id: r, taskConfig: e, buffer: a }, [a]);
|
|
1833
1833
|
}))).then((c) => this._createGeometry(c.geometry));
|
|
1834
1834
|
return f.catch(() => !0).then(() => {
|
|
1835
|
-
i &&
|
|
1836
|
-
}),
|
|
1835
|
+
i && r && this._releaseTask(i, r);
|
|
1836
|
+
}), K0.set(a, {
|
|
1837
1837
|
key: H,
|
|
1838
1838
|
promise: f
|
|
1839
1839
|
}), f;
|
|
1840
1840
|
}
|
|
1841
1841
|
_createGeometry(a) {
|
|
1842
|
-
const e = new
|
|
1843
|
-
a.index && e.setIndex(new
|
|
1842
|
+
const e = new H2();
|
|
1843
|
+
a.index && e.setIndex(new m0(a.index.array, 1));
|
|
1844
1844
|
for (let H = 0; H < a.attributes.length; H++) {
|
|
1845
|
-
const i = a.attributes[H],
|
|
1846
|
-
|
|
1845
|
+
const i = a.attributes[H], r = i.name, b = i.array, f = i.itemSize, c = new m0(b, f);
|
|
1846
|
+
r === "color" && (this._assignVertexColorSpace(c, i.vertexColorSpace), c.normalized = !(b instanceof Float32Array)), e.setAttribute(r, c);
|
|
1847
1847
|
}
|
|
1848
1848
|
return e;
|
|
1849
1849
|
}
|
|
1850
1850
|
_assignVertexColorSpace(a, e) {
|
|
1851
|
-
if (e !==
|
|
1852
|
-
const H = new
|
|
1853
|
-
for (let i = 0,
|
|
1854
|
-
H.fromBufferAttribute(a, i),
|
|
1851
|
+
if (e !== Ke) return;
|
|
1852
|
+
const H = new Ge();
|
|
1853
|
+
for (let i = 0, r = a.count; i < r; i++)
|
|
1854
|
+
H.fromBufferAttribute(a, i), ra.colorSpaceToWorking(H, Ke), a.setXYZ(i, H.r, H.g, H.b);
|
|
1855
1855
|
}
|
|
1856
1856
|
_loadLibrary(a, e) {
|
|
1857
|
-
const H = new
|
|
1858
|
-
return H.setPath(this.decoderPath), H.setResponseType(e), H.setWithCredentials(this.withCredentials), new Promise((i,
|
|
1859
|
-
H.load(a, i, void 0,
|
|
1857
|
+
const H = new P0(this.manager);
|
|
1858
|
+
return H.setPath(this.decoderPath), H.setResponseType(e), H.setWithCredentials(this.withCredentials), new Promise((i, r) => {
|
|
1859
|
+
H.load(a, i, void 0, r);
|
|
1860
1860
|
});
|
|
1861
1861
|
}
|
|
1862
1862
|
preload() {
|
|
@@ -1868,37 +1868,37 @@ class db extends $a {
|
|
|
1868
1868
|
return a ? e.push(this._loadLibrary("draco_decoder.js", "text")) : (e.push(this._loadLibrary("draco_wasm_wrapper.js", "text")), e.push(this._loadLibrary("draco_decoder.wasm", "arraybuffer"))), this.decoderPending = Promise.all(e).then((H) => {
|
|
1869
1869
|
const i = H[0];
|
|
1870
1870
|
a || (this.decoderConfig.wasmBinary = H[1]);
|
|
1871
|
-
const
|
|
1871
|
+
const r = ob.toString(), b = [
|
|
1872
1872
|
"/* draco decoder */",
|
|
1873
1873
|
i,
|
|
1874
1874
|
"",
|
|
1875
1875
|
"/* worker */",
|
|
1876
|
-
|
|
1876
|
+
r.substring(r.indexOf("{") + 1, r.lastIndexOf("}"))
|
|
1877
1877
|
].join(`
|
|
1878
1878
|
`);
|
|
1879
|
-
this.workerSourceURL = URL.createObjectURL(new Blob([
|
|
1879
|
+
this.workerSourceURL = URL.createObjectURL(new Blob([b]));
|
|
1880
1880
|
}), this.decoderPending;
|
|
1881
1881
|
}
|
|
1882
1882
|
_getWorker(a, e) {
|
|
1883
1883
|
return this._initDecoder().then(() => {
|
|
1884
1884
|
if (this.workerPool.length < this.workerLimit) {
|
|
1885
1885
|
const i = new Worker(this.workerSourceURL);
|
|
1886
|
-
i._callbacks = {}, i._taskCosts = {}, i._taskLoad = 0, i.postMessage({ type: "init", decoderConfig: this.decoderConfig }), i.onmessage = function(
|
|
1887
|
-
const
|
|
1888
|
-
switch (
|
|
1886
|
+
i._callbacks = {}, i._taskCosts = {}, i._taskLoad = 0, i.postMessage({ type: "init", decoderConfig: this.decoderConfig }), i.onmessage = function(r) {
|
|
1887
|
+
const b = r.data;
|
|
1888
|
+
switch (b.type) {
|
|
1889
1889
|
case "decode":
|
|
1890
|
-
i._callbacks[
|
|
1890
|
+
i._callbacks[b.id].resolve(b);
|
|
1891
1891
|
break;
|
|
1892
1892
|
case "error":
|
|
1893
|
-
i._callbacks[
|
|
1893
|
+
i._callbacks[b.id].reject(b);
|
|
1894
1894
|
break;
|
|
1895
1895
|
default:
|
|
1896
|
-
console.error('THREE.DRACOLoader: Unexpected message, "' +
|
|
1896
|
+
console.error('THREE.DRACOLoader: Unexpected message, "' + b.type + '"');
|
|
1897
1897
|
}
|
|
1898
1898
|
}, this.workerPool.push(i);
|
|
1899
1899
|
} else
|
|
1900
|
-
this.workerPool.sort(function(i,
|
|
1901
|
-
return i._taskLoad >
|
|
1900
|
+
this.workerPool.sort(function(i, r) {
|
|
1901
|
+
return i._taskLoad > r._taskLoad ? -1 : 1;
|
|
1902
1902
|
});
|
|
1903
1903
|
const H = this.workerPool[this.workerPool.length - 1];
|
|
1904
1904
|
return H._taskCosts[a] = e, H._taskLoad += e, H;
|
|
@@ -1918,8 +1918,8 @@ class db extends $a {
|
|
|
1918
1918
|
}
|
|
1919
1919
|
function ob() {
|
|
1920
1920
|
let n, a;
|
|
1921
|
-
onmessage = function(
|
|
1922
|
-
const f =
|
|
1921
|
+
onmessage = function(b) {
|
|
1922
|
+
const f = b.data;
|
|
1923
1923
|
switch (f.type) {
|
|
1924
1924
|
case "init":
|
|
1925
1925
|
n = f.decoderConfig, a = new Promise(function(o) {
|
|
@@ -1933,10 +1933,10 @@ function ob() {
|
|
|
1933
1933
|
a.then((o) => {
|
|
1934
1934
|
const d = o.draco, s = new d.Decoder();
|
|
1935
1935
|
try {
|
|
1936
|
-
const
|
|
1937
|
-
|
|
1938
|
-
} catch (
|
|
1939
|
-
console.error(
|
|
1936
|
+
const l = e(d, s, new Int8Array(c), t), h = l.attributes.map((m) => m.array.buffer);
|
|
1937
|
+
l.index && h.push(l.index.array.buffer), self.postMessage({ type: "decode", id: f.id, geometry: l }, h);
|
|
1938
|
+
} catch (l) {
|
|
1939
|
+
console.error(l), self.postMessage({ type: "error", id: f.id, error: l.message });
|
|
1940
1940
|
} finally {
|
|
1941
1941
|
d.destroy(s);
|
|
1942
1942
|
}
|
|
@@ -1944,65 +1944,65 @@ function ob() {
|
|
|
1944
1944
|
break;
|
|
1945
1945
|
}
|
|
1946
1946
|
};
|
|
1947
|
-
function e(
|
|
1947
|
+
function e(b, f, c, t) {
|
|
1948
1948
|
const o = t.attributeIDs, d = t.attributeTypes;
|
|
1949
|
-
let s,
|
|
1949
|
+
let s, l;
|
|
1950
1950
|
const h = f.GetEncodedGeometryType(c);
|
|
1951
|
-
if (h ===
|
|
1952
|
-
s = new
|
|
1953
|
-
else if (h ===
|
|
1954
|
-
s = new
|
|
1951
|
+
if (h === b.TRIANGULAR_MESH)
|
|
1952
|
+
s = new b.Mesh(), l = f.DecodeArrayToMesh(c, c.byteLength, s);
|
|
1953
|
+
else if (h === b.POINT_CLOUD)
|
|
1954
|
+
s = new b.PointCloud(), l = f.DecodeArrayToPointCloud(c, c.byteLength, s);
|
|
1955
1955
|
else
|
|
1956
1956
|
throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
|
|
1957
|
-
if (!
|
|
1958
|
-
throw new Error("THREE.DRACOLoader: Decoding failed: " +
|
|
1959
|
-
const
|
|
1957
|
+
if (!l.ok() || s.ptr === 0)
|
|
1958
|
+
throw new Error("THREE.DRACOLoader: Decoding failed: " + l.error_msg());
|
|
1959
|
+
const m = { index: null, attributes: [] };
|
|
1960
1960
|
for (const _ in o) {
|
|
1961
1961
|
const w = self[d[_]];
|
|
1962
|
-
let p,
|
|
1962
|
+
let p, A;
|
|
1963
1963
|
if (t.useUniqueIDs)
|
|
1964
|
-
|
|
1964
|
+
A = o[_], p = f.GetAttributeByUniqueId(s, A);
|
|
1965
1965
|
else {
|
|
1966
|
-
if (
|
|
1967
|
-
p = f.GetAttribute(s,
|
|
1966
|
+
if (A = f.GetAttributeId(s, b[o[_]]), A === -1) continue;
|
|
1967
|
+
p = f.GetAttribute(s, A);
|
|
1968
1968
|
}
|
|
1969
|
-
const I = i(
|
|
1970
|
-
_ === "color" && (I.vertexColorSpace = t.vertexColorSpace),
|
|
1969
|
+
const I = i(b, f, s, _, w, p);
|
|
1970
|
+
_ === "color" && (I.vertexColorSpace = t.vertexColorSpace), m.attributes.push(I);
|
|
1971
1971
|
}
|
|
1972
|
-
return h ===
|
|
1972
|
+
return h === b.TRIANGULAR_MESH && (m.index = H(b, f, s)), b.destroy(s), m;
|
|
1973
1973
|
}
|
|
1974
|
-
function H(
|
|
1975
|
-
const o = c.num_faces() * 3, d = o * 4, s =
|
|
1974
|
+
function H(b, f, c) {
|
|
1975
|
+
const o = c.num_faces() * 3, d = o * 4, s = b._malloc(d);
|
|
1976
1976
|
f.GetTrianglesUInt32Array(c, d, s);
|
|
1977
|
-
const
|
|
1978
|
-
return
|
|
1979
|
-
}
|
|
1980
|
-
function i(
|
|
1981
|
-
const s = d.num_components(), h = c.num_points() * s,
|
|
1982
|
-
f.GetAttributeDataArrayForAllPoints(c, d, _,
|
|
1983
|
-
const p = new o(
|
|
1984
|
-
return
|
|
1977
|
+
const l = new Uint32Array(b.HEAPF32.buffer, s, o).slice();
|
|
1978
|
+
return b._free(s), { array: l, itemSize: 1 };
|
|
1979
|
+
}
|
|
1980
|
+
function i(b, f, c, t, o, d) {
|
|
1981
|
+
const s = d.num_components(), h = c.num_points() * s, m = h * o.BYTES_PER_ELEMENT, _ = r(b, o), w = b._malloc(m);
|
|
1982
|
+
f.GetAttributeDataArrayForAllPoints(c, d, _, m, w);
|
|
1983
|
+
const p = new o(b.HEAPF32.buffer, w, h).slice();
|
|
1984
|
+
return b._free(w), {
|
|
1985
1985
|
name: t,
|
|
1986
1986
|
array: p,
|
|
1987
1987
|
itemSize: s
|
|
1988
1988
|
};
|
|
1989
1989
|
}
|
|
1990
|
-
function b
|
|
1990
|
+
function r(b, f) {
|
|
1991
1991
|
switch (f) {
|
|
1992
1992
|
case Float32Array:
|
|
1993
|
-
return
|
|
1993
|
+
return b.DT_FLOAT32;
|
|
1994
1994
|
case Int8Array:
|
|
1995
|
-
return
|
|
1995
|
+
return b.DT_INT8;
|
|
1996
1996
|
case Int16Array:
|
|
1997
|
-
return
|
|
1997
|
+
return b.DT_INT16;
|
|
1998
1998
|
case Int32Array:
|
|
1999
|
-
return
|
|
1999
|
+
return b.DT_INT32;
|
|
2000
2000
|
case Uint8Array:
|
|
2001
|
-
return
|
|
2001
|
+
return b.DT_UINT8;
|
|
2002
2002
|
case Uint16Array:
|
|
2003
|
-
return
|
|
2003
|
+
return b.DT_UINT16;
|
|
2004
2004
|
case Uint32Array:
|
|
2005
|
-
return
|
|
2005
|
+
return b.DT_UINT32;
|
|
2006
2006
|
}
|
|
2007
2007
|
}
|
|
2008
2008
|
}
|
|
@@ -2041,8 +2041,8 @@ else if (typeof define === 'function' && define['amd'])
|
|
|
2041
2041
|
else if (typeof exports === 'object')
|
|
2042
2042
|
exports["DracoDecoderModule"] = DracoDecoderModule;
|
|
2043
2043
|
`;
|
|
2044
|
-
function
|
|
2045
|
-
const n =
|
|
2044
|
+
function lb() {
|
|
2045
|
+
const n = de(!1), a = de(""), e = g2([]), H = de(null), i = new li(), r = new ki(), b = new ui(), f = new Ti();
|
|
2046
2046
|
let c = null;
|
|
2047
2047
|
return {
|
|
2048
2048
|
isLoading: n,
|
|
@@ -2057,61 +2057,61 @@ function kb() {
|
|
|
2057
2057
|
}
|
|
2058
2058
|
n.value = !0, a.value = "准备加载...", e.value = [], H.value = null;
|
|
2059
2059
|
const d = /* @__PURE__ */ new Map();
|
|
2060
|
-
o.forEach((
|
|
2061
|
-
|
|
2060
|
+
o.forEach((m) => {
|
|
2061
|
+
m instanceof File && d.set(m.name.toLowerCase(), m);
|
|
2062
2062
|
});
|
|
2063
|
-
const s = [],
|
|
2063
|
+
const s = [], l = [];
|
|
2064
2064
|
try {
|
|
2065
|
-
for (const
|
|
2066
|
-
const _ =
|
|
2065
|
+
for (const m of o) {
|
|
2066
|
+
const _ = m.name || "unknown_file", w = (h = _.split(".").pop()) == null ? void 0 : h.toLowerCase();
|
|
2067
2067
|
if (w === "mtl") continue;
|
|
2068
|
-
const p = URL.createObjectURL(
|
|
2068
|
+
const p = URL.createObjectURL(m);
|
|
2069
2069
|
s.push(p);
|
|
2070
|
-
let
|
|
2071
|
-
const I = (
|
|
2072
|
-
const
|
|
2073
|
-
a.value = `正在加载 ${_}... ${Math.round(
|
|
2070
|
+
let A = null;
|
|
2071
|
+
const I = (O) => {
|
|
2072
|
+
const q = O.lengthComputable ? O.loaded / O.total * 100 : 0;
|
|
2073
|
+
a.value = `正在加载 ${_}... ${Math.round(q)}%`;
|
|
2074
2074
|
};
|
|
2075
2075
|
switch (a.value = `正在加载 ${_}... 0%`, w) {
|
|
2076
2076
|
case "obj":
|
|
2077
|
-
const
|
|
2078
|
-
if (d.has(
|
|
2079
|
-
const ge = d.get(
|
|
2080
|
-
s.push(
|
|
2081
|
-
const
|
|
2082
|
-
|
|
2077
|
+
const O = _.replace(/\.obj$/i, ".mtl").toLowerCase();
|
|
2078
|
+
if (d.has(O)) {
|
|
2079
|
+
const ge = d.get(O), Ee = URL.createObjectURL(ge);
|
|
2080
|
+
s.push(Ee);
|
|
2081
|
+
const Ve = await i.loadAsync(Ee);
|
|
2082
|
+
Ve.preload(), r.setMaterials(Ve);
|
|
2083
2083
|
} else
|
|
2084
|
-
|
|
2085
|
-
|
|
2084
|
+
r.setMaterials(null);
|
|
2085
|
+
A = await r.loadAsync(p, I);
|
|
2086
2086
|
break;
|
|
2087
2087
|
case "stl":
|
|
2088
|
-
const
|
|
2089
|
-
|
|
2088
|
+
const q = await b.loadAsync(p, I), z = new Hi({ color: 11184810, specular: 1118481, shininess: 200 });
|
|
2089
|
+
A = new ta(q, z);
|
|
2090
2090
|
break;
|
|
2091
2091
|
case "gltf":
|
|
2092
|
-
|
|
2092
|
+
A = (await f.loadAsync(p, I)).scene;
|
|
2093
2093
|
break;
|
|
2094
2094
|
case "glb":
|
|
2095
|
-
c || (c = new db(), c._loadLibrary = function(ge,
|
|
2096
|
-
return ge === "draco_decoder.js" &&
|
|
2097
|
-
}, c.setDecoderConfig({ type: "js" }), c.preload()), f.setDRACOLoader(c),
|
|
2095
|
+
c || (c = new db(), c._loadLibrary = function(ge, Ee) {
|
|
2096
|
+
return ge === "draco_decoder.js" && Ee === "text" ? Promise.resolve(sb) : Promise.reject(new Error(`DRACOLoader: 未预期的库请求 ${ge}`));
|
|
2097
|
+
}, c.setDecoderConfig({ type: "js" }), c.preload()), f.setDRACOLoader(c), A = (await f.loadAsync(p, I)).scene;
|
|
2098
2098
|
break;
|
|
2099
2099
|
default:
|
|
2100
2100
|
console.warn(`不支持的文件类型: .${w}`), a.value = `不支持的文件类型: ${_}`;
|
|
2101
2101
|
continue;
|
|
2102
2102
|
}
|
|
2103
|
-
|
|
2103
|
+
A && (A.userData.boundingBox = new I0().setFromObject(A), l.push(A));
|
|
2104
2104
|
}
|
|
2105
|
-
e.value =
|
|
2106
|
-
} catch (
|
|
2107
|
-
throw console.error("加载模型时出错:",
|
|
2105
|
+
e.value = l, a.value = "加载完成!";
|
|
2106
|
+
} catch (m) {
|
|
2107
|
+
throw console.error("加载模型时出错:", m), H.value = `加载失败: ${m.message || "未知错误"}`, a.value = "加载失败!", e.value = [], m;
|
|
2108
2108
|
} finally {
|
|
2109
|
-
n.value = !1, s.forEach((
|
|
2109
|
+
n.value = !1, s.forEach((m) => URL.revokeObjectURL(m));
|
|
2110
2110
|
}
|
|
2111
2111
|
}
|
|
2112
2112
|
};
|
|
2113
2113
|
}
|
|
2114
|
-
function
|
|
2114
|
+
function kb(n, a = {}) {
|
|
2115
2115
|
const e = {
|
|
2116
2116
|
threeInfo: {},
|
|
2117
2117
|
modelLoader: {},
|
|
@@ -2121,12 +2121,12 @@ function lb(n, a = {}) {
|
|
|
2121
2121
|
millPivotAnimation: {}
|
|
2122
2122
|
}, H = ni(n);
|
|
2123
2123
|
e.threeInfo = H;
|
|
2124
|
-
const { currentModels: i, getThreeJSObjects:
|
|
2125
|
-
if (c && (e.modelLoader =
|
|
2126
|
-
const s = ub(
|
|
2124
|
+
const { currentModels: i, getThreeJSObjects: r, addBeforeRenderCallback: b, removeBeforeRenderCallback: f } = H, { useModelLoaderHook: c, useAnimationHook: t, useClippingHook: o, usePartAnimationHook: d } = a;
|
|
2125
|
+
if (c && (e.modelLoader = lb()), t && (e.animation = di(r, i)), o && (e.clipping = oi(r, i)), d) {
|
|
2126
|
+
const s = ub(r, i, b, f);
|
|
2127
2127
|
e.partAnimation = s, e.millPivotAnimation = Mb(
|
|
2128
2128
|
i,
|
|
2129
|
-
|
|
2129
|
+
r,
|
|
2130
2130
|
s.setPartRotation,
|
|
2131
2131
|
s.setPartRotationPivotByObject
|
|
2132
2132
|
);
|
|
@@ -2134,93 +2134,93 @@ function lb(n, a = {}) {
|
|
|
2134
2134
|
return e;
|
|
2135
2135
|
}
|
|
2136
2136
|
function ub(n, a, e, H) {
|
|
2137
|
-
const i =
|
|
2138
|
-
let
|
|
2137
|
+
const i = de(!1), r = /* @__PURE__ */ new Map();
|
|
2138
|
+
let b = null;
|
|
2139
2139
|
function f(p) {
|
|
2140
|
-
const
|
|
2141
|
-
|
|
2142
|
-
for (const
|
|
2143
|
-
if (
|
|
2144
|
-
for (const
|
|
2145
|
-
const
|
|
2146
|
-
if (
|
|
2140
|
+
const A = /* @__PURE__ */ new Set([p]);
|
|
2141
|
+
A.add(p.replace(/\./g, ""));
|
|
2142
|
+
for (const O of a.value)
|
|
2143
|
+
if (O)
|
|
2144
|
+
for (const q of A) {
|
|
2145
|
+
const z = O.getObjectByName(q);
|
|
2146
|
+
if (z) return z;
|
|
2147
2147
|
}
|
|
2148
2148
|
const { scene: I } = n();
|
|
2149
2149
|
if (I)
|
|
2150
|
-
for (const
|
|
2151
|
-
const
|
|
2152
|
-
if (
|
|
2150
|
+
for (const O of A) {
|
|
2151
|
+
const q = I.getObjectByName(O);
|
|
2152
|
+
if (q) return q;
|
|
2153
2153
|
}
|
|
2154
2154
|
return null;
|
|
2155
2155
|
}
|
|
2156
2156
|
function c(p) {
|
|
2157
|
-
return p.map((
|
|
2158
|
-
const I = f(
|
|
2159
|
-
return { name:
|
|
2157
|
+
return p.map((A) => {
|
|
2158
|
+
const I = f(A);
|
|
2159
|
+
return { name: A, object: I, found: !!I };
|
|
2160
2160
|
});
|
|
2161
2161
|
}
|
|
2162
|
-
function t(p,
|
|
2162
|
+
function t(p, A) {
|
|
2163
2163
|
const I = f(p);
|
|
2164
|
-
return I ? (
|
|
2164
|
+
return I ? (r.set(p, {
|
|
2165
2165
|
object: I,
|
|
2166
|
-
axis:
|
|
2167
|
-
speed:
|
|
2168
|
-
direction:
|
|
2166
|
+
axis: A.axis,
|
|
2167
|
+
speed: A.speed,
|
|
2168
|
+
direction: A.direction ?? 1
|
|
2169
2169
|
}), !0) : (console.warn(`[usePartAnimation] 未找到部件: "${p}"`), !1);
|
|
2170
2170
|
}
|
|
2171
|
-
function o(p,
|
|
2172
|
-
return
|
|
2173
|
-
object:
|
|
2174
|
-
axis:
|
|
2175
|
-
speed:
|
|
2176
|
-
direction:
|
|
2171
|
+
function o(p, A, I, O) {
|
|
2172
|
+
return A ? I ? (r.set(p, {
|
|
2173
|
+
object: A,
|
|
2174
|
+
axis: O.axis,
|
|
2175
|
+
speed: O.speed,
|
|
2176
|
+
direction: O.direction ?? 1,
|
|
2177
2177
|
pivot: I
|
|
2178
2178
|
}), !0) : (console.warn(`[usePartAnimation] pivot 为空: "${p}"`), !1) : (console.warn(`[usePartAnimation] 未找到部件: "${p}"`), !1);
|
|
2179
2179
|
}
|
|
2180
2180
|
function d(p) {
|
|
2181
|
-
let
|
|
2182
|
-
return p.forEach(({ partName: I, axis:
|
|
2183
|
-
t(I, { axis:
|
|
2184
|
-
}),
|
|
2181
|
+
let A = 0;
|
|
2182
|
+
return p.forEach(({ partName: I, axis: O, speed: q, direction: z }) => {
|
|
2183
|
+
t(I, { axis: O, speed: q, direction: z }) && A++;
|
|
2184
|
+
}), A;
|
|
2185
2185
|
}
|
|
2186
2186
|
function s(p) {
|
|
2187
|
-
|
|
2187
|
+
r.delete(p);
|
|
2188
2188
|
}
|
|
2189
|
-
function
|
|
2190
|
-
|
|
2189
|
+
function l() {
|
|
2190
|
+
r.clear();
|
|
2191
2191
|
}
|
|
2192
2192
|
function h() {
|
|
2193
2193
|
const p = [];
|
|
2194
|
-
return
|
|
2194
|
+
return r.forEach((A, I) => {
|
|
2195
2195
|
p.push({
|
|
2196
2196
|
name: I,
|
|
2197
|
-
axis:
|
|
2198
|
-
speed:
|
|
2199
|
-
direction:
|
|
2200
|
-
found: !!
|
|
2197
|
+
axis: A.axis,
|
|
2198
|
+
speed: A.speed,
|
|
2199
|
+
direction: A.direction,
|
|
2200
|
+
found: !!A.object
|
|
2201
2201
|
});
|
|
2202
2202
|
}), p;
|
|
2203
2203
|
}
|
|
2204
|
-
function
|
|
2204
|
+
function m() {
|
|
2205
2205
|
if (!i.value) {
|
|
2206
|
-
if (
|
|
2206
|
+
if (r.size === 0) {
|
|
2207
2207
|
console.warn("[usePartAnimation] 没有配置任何部件旋转");
|
|
2208
2208
|
return;
|
|
2209
2209
|
}
|
|
2210
|
-
i.value = !0,
|
|
2211
|
-
i.value &&
|
|
2212
|
-
if (!
|
|
2213
|
-
const I =
|
|
2214
|
-
I.rotation[
|
|
2210
|
+
i.value = !0, b = (p) => {
|
|
2211
|
+
i.value && r.forEach((A) => {
|
|
2212
|
+
if (!A.object) return;
|
|
2213
|
+
const I = A.pivot ?? A.object, O = A.axis;
|
|
2214
|
+
I.rotation[O] += A.direction * A.speed * p;
|
|
2215
2215
|
});
|
|
2216
|
-
}, e(
|
|
2216
|
+
}, e(b);
|
|
2217
2217
|
}
|
|
2218
2218
|
}
|
|
2219
2219
|
function _() {
|
|
2220
|
-
i.value = !1,
|
|
2220
|
+
i.value = !1, b && (H(b), b = null);
|
|
2221
2221
|
}
|
|
2222
2222
|
function w() {
|
|
2223
|
-
i.value ? _() :
|
|
2223
|
+
i.value ? _() : m();
|
|
2224
2224
|
}
|
|
2225
2225
|
return {
|
|
2226
2226
|
isPartAnimating: i,
|
|
@@ -2230,9 +2230,9 @@ function ub(n, a, e, H) {
|
|
|
2230
2230
|
setPartRotationPivotByObject: o,
|
|
2231
2231
|
setPartRotations: d,
|
|
2232
2232
|
removePartRotation: s,
|
|
2233
|
-
clearAllPartRotations:
|
|
2233
|
+
clearAllPartRotations: l,
|
|
2234
2234
|
getPartAnimationStatus: h,
|
|
2235
|
-
startPartAnimations:
|
|
2235
|
+
startPartAnimations: m,
|
|
2236
2236
|
stopPartAnimations: _,
|
|
2237
2237
|
togglePartAnimations: w
|
|
2238
2238
|
};
|
|
@@ -2246,355 +2246,355 @@ const hb = {
|
|
|
2246
2246
|
"轧辊整体-1": ["轧辊整体-1", "上轧辊000-3"],
|
|
2247
2247
|
"下轧辊-1": ["下轧辊-1", "下轧辊000-3"]
|
|
2248
2248
|
};
|
|
2249
|
-
function
|
|
2250
|
-
const H = hb[n] ?? [n], i = (
|
|
2251
|
-
if (!
|
|
2252
|
-
for (const
|
|
2253
|
-
const f =
|
|
2249
|
+
function qe(n, a, e) {
|
|
2250
|
+
const H = hb[n] ?? [n], i = (r) => {
|
|
2251
|
+
if (!r) return null;
|
|
2252
|
+
for (const b of H) {
|
|
2253
|
+
const f = r.getObjectByName(b);
|
|
2254
2254
|
if (f) return f;
|
|
2255
2255
|
}
|
|
2256
2256
|
return null;
|
|
2257
2257
|
};
|
|
2258
|
-
for (const
|
|
2259
|
-
if (!
|
|
2260
|
-
const
|
|
2261
|
-
if (
|
|
2258
|
+
for (const r of a.value) {
|
|
2259
|
+
if (!r) continue;
|
|
2260
|
+
const b = i(r);
|
|
2261
|
+
if (b) return b;
|
|
2262
2262
|
}
|
|
2263
2263
|
return i(e);
|
|
2264
2264
|
}
|
|
2265
|
-
function gb(n, a, e, H, i = null,
|
|
2266
|
-
const c =
|
|
2265
|
+
function gb(n, a, e, H, i = null, r = null, b = null, f = null) {
|
|
2266
|
+
const c = de(!1), t = [
|
|
2267
2267
|
["夹具5倍-3", "夹具5倍-7"],
|
|
2268
2268
|
["夹具5倍-5", "夹具5倍-8"]
|
|
2269
2269
|
];
|
|
2270
2270
|
let o = !1, d = -1;
|
|
2271
|
-
const s = 0.6,
|
|
2272
|
-
let M = "idle", y = 0,
|
|
2273
|
-
const
|
|
2274
|
-
let
|
|
2275
|
-
const
|
|
2276
|
-
let
|
|
2277
|
-
const me = new j(),
|
|
2278
|
-
function
|
|
2271
|
+
const s = 0.6, l = 5, h = 0.5, m = 2, _ = -0.1, w = 0.8, p = -0.48, A = 30, I = 2, O = 2, q = 1.5, z = 3, ye = 0.6, ke = 0.5, ge = 0.4, Ee = 0.4, Ve = 1, n0 = 2, d0 = 150 * Math.PI / 180, o0 = 100 * Math.PI / 180, J = 0.25, ue = 1, Y = 270 * Math.PI / 180, W = 0.5, L = 150 * Math.PI / 180, K = 100 * Math.PI / 180, oe = 0.25, X = 1, ae = 270 * Math.PI / 180, le = 0.5;
|
|
2272
|
+
let M = "idle", y = 0, G = new j(), P = new j(), u = null, S = null, ie = null, be = null, ce = null, pe = null, we = null, Fe = null, ve = null, s0 = null, l0 = null, i0 = null, Le = null, R = null, U = null, fe = null, C = null, V = null, re = null, b0 = null, k0 = 0, te = null, y0 = null;
|
|
2273
|
+
const oa = new j(), sa = new ee();
|
|
2274
|
+
let r0 = [];
|
|
2275
|
+
const w0 = 10, Se = new Array(w0).fill(1), u0 = [];
|
|
2276
|
+
let h0 = null;
|
|
2277
|
+
const me = new j(), la = new j();
|
|
2278
|
+
function H0(g, k, F) {
|
|
2279
2279
|
if (!g) return;
|
|
2280
|
-
const N = new
|
|
2280
|
+
const N = new ee();
|
|
2281
2281
|
g.getWorldQuaternion(N);
|
|
2282
|
-
const T = new
|
|
2283
|
-
T.getCenter(D),
|
|
2282
|
+
const T = new I0().setFromObject(g), D = new j();
|
|
2283
|
+
T.getCenter(D), la.copy(k).applyQuaternion(N), F.copy(D).add(la);
|
|
2284
2284
|
}
|
|
2285
2285
|
function o2() {
|
|
2286
2286
|
const g = n.value;
|
|
2287
2287
|
if (!g || g.length === 0) return !1;
|
|
2288
|
-
|
|
2288
|
+
te = H().scene;
|
|
2289
2289
|
const F = (v) => v ?? null;
|
|
2290
2290
|
for (const v of g) {
|
|
2291
2291
|
if (!v) continue;
|
|
2292
|
-
const
|
|
2293
|
-
if (
|
|
2292
|
+
const E = v.getObjectByName("机器人-2");
|
|
2293
|
+
if (E && (u = F(E.getObjectByName("坯料-1")), u))
|
|
2294
2294
|
break;
|
|
2295
2295
|
}
|
|
2296
2296
|
if (!u)
|
|
2297
2297
|
return console.warn("[useBilletAnimation] 未找到部件: 坯料-1 (在 机器人-2 下)"), !1;
|
|
2298
|
-
|
|
2298
|
+
S = qe("轧辊整体-1001", n, te), S || console.warn("[useBilletAnimation] 未找到部件: 轧辊整体-1001 / 上轧辊000-1"), ie = qe("下轧辊-1001", n, te), ie || console.warn("[useBilletAnimation] 未找到部件: 下轧辊-1001 / 下轧辊000-1"), pe = qe("联轴器上-1001", n, te), we = qe("联轴器下-2001", n, te), S = qe("轧辊整体-1001", n, te), S || console.warn("[useBilletAnimation] 未找到部件: 轧辊整体-1001 / 上轧辊000-1");
|
|
2299
2299
|
let N = null, T = null;
|
|
2300
2300
|
for (const v of g)
|
|
2301
2301
|
if (v && (N || (N = F(v.getObjectByName("下输送台板-1"))), T || (T = F(v.getObjectByName("下输送台板-2"))), N && T))
|
|
2302
2302
|
break;
|
|
2303
|
-
if ((!N || !T) &&
|
|
2303
|
+
if ((!N || !T) && te && (N || (N = F(te.getObjectByName("下输送台板-1"))), T || (T = F(te.getObjectByName("下输送台板-2")))), N || console.warn("[useBilletAnimation] 未找到部件: 下输送台板-1"), T || console.warn("[useBilletAnimation] 未找到部件: 下输送台板-2"), N && T) {
|
|
2304
2304
|
const v = new j();
|
|
2305
2305
|
N.getWorldPosition(v);
|
|
2306
|
-
const
|
|
2307
|
-
T.getWorldPosition(
|
|
2306
|
+
const E = new j();
|
|
2307
|
+
T.getWorldPosition(E), V = new j().copy(v).add(E).multiplyScalar(0.5), V.y = Math.max(v.y, E.y) + 0.05;
|
|
2308
2308
|
}
|
|
2309
2309
|
let D = null;
|
|
2310
2310
|
for (const v of g)
|
|
2311
2311
|
if (v && (D = F(v.getObjectByName("上输送台-3")), D))
|
|
2312
2312
|
break;
|
|
2313
|
-
if (!D &&
|
|
2313
|
+
if (!D && te && (D = F(te.getObjectByName("上输送台-3"))), D) {
|
|
2314
2314
|
const v = new j();
|
|
2315
|
-
D.getWorldPosition(v),
|
|
2315
|
+
D.getWorldPosition(v), re = new j(v.x, v.y + 0.1, v.z);
|
|
2316
2316
|
} else
|
|
2317
2317
|
console.warn("[useBilletAnimation] 未找到部件: 上输送台-3");
|
|
2318
|
-
if (
|
|
2318
|
+
if (be = qe("轧辊整体-1", n, te), be) {
|
|
2319
2319
|
const v = new j();
|
|
2320
|
-
|
|
2320
|
+
be.getWorldPosition(v), new j(v.x, v.y + 0.5, v.z);
|
|
2321
2321
|
} else
|
|
2322
2322
|
console.warn("[useBilletAnimation] 未找到部件: 轧辊整体-1 / 上轧辊000-3");
|
|
2323
|
-
if (
|
|
2323
|
+
if (ce = qe("下轧辊-1", n, te), ce && be) {
|
|
2324
2324
|
const v = new j();
|
|
2325
|
-
|
|
2326
|
-
const
|
|
2327
|
-
|
|
2328
|
-
} else
|
|
2329
|
-
Fe =
|
|
2330
|
-
let
|
|
2325
|
+
ce.getWorldPosition(v);
|
|
2326
|
+
const E = new j();
|
|
2327
|
+
be.getWorldPosition(E), b0 = new j().copy(v).add(E).multiplyScalar(0.5), b0.y -= 0.313;
|
|
2328
|
+
} else ce || console.warn("[useBilletAnimation] 未找到部件: 下轧辊-1 / 下轧辊000-3");
|
|
2329
|
+
Fe = qe("联轴器上-1", n, te), ve = qe("联轴器下-2", n, te);
|
|
2330
|
+
let B = null;
|
|
2331
2331
|
for (const v of g)
|
|
2332
|
-
if (v && (
|
|
2332
|
+
if (v && (B = F(v.getObjectByName("底板-1")), B))
|
|
2333
2333
|
break;
|
|
2334
|
-
if (!
|
|
2334
|
+
if (!B && te && (B = F(te.getObjectByName("底板-1"))), B) {
|
|
2335
2335
|
const v = new j();
|
|
2336
|
-
|
|
2336
|
+
B.getWorldPosition(v), k0 = v.y;
|
|
2337
2337
|
} else
|
|
2338
2338
|
console.warn("[useBilletAnimation] 未找到部件: 底板-1");
|
|
2339
|
-
const
|
|
2340
|
-
if (
|
|
2339
|
+
const $ = u.parent;
|
|
2340
|
+
if (!$)
|
|
2341
2341
|
return console.warn("[useBilletAnimation] 坯料没有父节点 (机器人-2 应作为父节点)"), !1;
|
|
2342
|
-
|
|
2343
|
-
const
|
|
2342
|
+
u0.length = 0;
|
|
2343
|
+
const Q = [
|
|
2344
2344
|
"Crab_Finger_Right-1",
|
|
2345
2345
|
"Crab_Finger_Right-2",
|
|
2346
2346
|
"Crab_Finger_Right-3",
|
|
2347
2347
|
"Crab_Finger_Right-4"
|
|
2348
|
-
],
|
|
2349
|
-
for (const v of
|
|
2350
|
-
const
|
|
2351
|
-
|
|
2348
|
+
], He = u.position.y;
|
|
2349
|
+
for (const v of Q) {
|
|
2350
|
+
const E = $.getObjectByName(v);
|
|
2351
|
+
E ? u0.push({ obj: E, origQuat: E.quaternion.clone(), direction: E.position.y > He ? 1 : -1 }) : console.warn(`[useBilletAnimation] 未找到手指部件: ${v}`);
|
|
2352
2352
|
}
|
|
2353
|
-
if (
|
|
2353
|
+
if (u0.length === 0)
|
|
2354
2354
|
return console.warn("[useBilletAnimation] 未找到任何 Crab_Finger_Right-* 手指部件"), !1;
|
|
2355
|
-
const
|
|
2356
|
-
return
|
|
2355
|
+
const Z = (v) => v ? { pos: v.position.clone(), quat: v.quaternion.clone() } : null;
|
|
2356
|
+
return s0 = Z(S), l0 = Z(ie), i0 = Z(be), Le = Z(ce), R = Z(pe), U = Z(we), fe = Z(Fe), C = Z(ve), k2(), !0;
|
|
2357
2357
|
}
|
|
2358
2358
|
function s2() {
|
|
2359
|
-
if (!u || !
|
|
2360
|
-
u.getWorldPosition(
|
|
2361
|
-
const g = new
|
|
2359
|
+
if (!u || !te) return;
|
|
2360
|
+
u.getWorldPosition(G);
|
|
2361
|
+
const g = new ee();
|
|
2362
2362
|
u.getWorldQuaternion(g);
|
|
2363
|
-
const
|
|
2364
|
-
u.getWorldScale(
|
|
2363
|
+
const k = new j();
|
|
2364
|
+
u.getWorldScale(k), u.parent && u.removeFromParent(), te.add(u), u.position.copy(G), u.quaternion.copy(g), u.scale.copy(k);
|
|
2365
2365
|
}
|
|
2366
|
-
function
|
|
2367
|
-
for (const
|
|
2368
|
-
|
|
2369
|
-
const F = new
|
|
2370
|
-
|
|
2366
|
+
function g0(g) {
|
|
2367
|
+
for (const k of u0) {
|
|
2368
|
+
k.obj.quaternion.copy(k.origQuat);
|
|
2369
|
+
const F = new ee().setFromAxisAngle(new j(1, 0, 0), ke * g * k.direction);
|
|
2370
|
+
k.obj.quaternion.premultiply(F);
|
|
2371
2371
|
}
|
|
2372
2372
|
}
|
|
2373
2373
|
new j();
|
|
2374
|
-
const
|
|
2374
|
+
const Ne = new ee(), Te = new j();
|
|
2375
2375
|
new j();
|
|
2376
|
-
const _e = new j(),
|
|
2377
|
-
let
|
|
2376
|
+
const _e = new j(), ne = new ee(), Ae = new ee(), F0 = 0.8, v0 = { value: 0 }, c0 = new j(0, 0, 1), N0 = new j(), T0 = new ee(), R0 = new j();
|
|
2377
|
+
let De = !1, Xe = !1;
|
|
2378
2378
|
new j();
|
|
2379
|
-
const
|
|
2380
|
-
let
|
|
2381
|
-
function ka(g,
|
|
2382
|
-
const
|
|
2383
|
-
|
|
2379
|
+
const f0 = new j(), M0 = new ee(), ze = new j(), Qe = new j(), Oe = { value: 0 }, D0 = new j(), O0 = new ee(), E0 = new j();
|
|
2380
|
+
let Pe = !1;
|
|
2381
|
+
function ka(g, k, F, N, T, D, B, $, Q, He) {
|
|
2382
|
+
const Z = N;
|
|
2383
|
+
De || (g.updateMatrixWorld(!0), g.getWorldPosition(N0), g.getWorldQuaternion(T0), R0.copy(N0).sub(Z), D.value = 0, De = !0), D.value += B * Q, Ne.setFromAxisAngle(c0, D.value), _e.copy(R0).applyQuaternion(Ne).add(Z), ne.copy(Ne).multiply(T0);
|
|
2384
2384
|
const v = g.parent;
|
|
2385
|
-
if (v && v.type !== "Scene" && (v.updateMatrixWorld(!0), _e.clone(), v.worldToLocal(_e), v.getWorldQuaternion(Ae),
|
|
2386
|
-
const
|
|
2387
|
-
|
|
2385
|
+
if (v && v.type !== "Scene" && (v.updateMatrixWorld(!0), _e.clone(), v.worldToLocal(_e), v.getWorldQuaternion(Ae), ne.premultiply(Ae.clone().invert())), g.position.copy(_e), g.quaternion.copy(ne), g.updateMatrixWorld(!0), T) {
|
|
2386
|
+
const E = T.parent;
|
|
2387
|
+
E && E.type !== "Scene" ? (E.getWorldQuaternion(Ae), T.quaternion.copy(Ae.clone().invert()).multiply(ne)) : T.quaternion.copy(ne), T.updateMatrixWorld(!0);
|
|
2388
2388
|
}
|
|
2389
|
-
return
|
|
2389
|
+
return H0(g, F, k.position), D.value >= $;
|
|
2390
2390
|
}
|
|
2391
|
-
function
|
|
2392
|
-
const
|
|
2393
|
-
|
|
2391
|
+
function ua(g, k, F, N, T, D, B, $, Q, He) {
|
|
2392
|
+
const Z = N;
|
|
2393
|
+
Pe || (g.updateMatrixWorld(!0), g.getWorldPosition(D0), g.getWorldQuaternion(O0), E0.copy(D0).sub(Z), D.value = 0, Pe = !0), D.value += B * Q, Ne.setFromAxisAngle(c0, -D.value), _e.copy(E0).applyQuaternion(Ne).add(Z), ne.copy(Ne).multiply(O0);
|
|
2394
2394
|
const v = g.parent;
|
|
2395
|
-
if (v && v.type !== "Scene" && (v.updateMatrixWorld(!0), _e.clone(), v.worldToLocal(_e), v.getWorldQuaternion(Ae),
|
|
2396
|
-
const
|
|
2397
|
-
|
|
2395
|
+
if (v && v.type !== "Scene" && (v.updateMatrixWorld(!0), _e.clone(), v.worldToLocal(_e), v.getWorldQuaternion(Ae), ne.premultiply(Ae.clone().invert())), g.position.copy(_e), g.quaternion.copy(ne), g.updateMatrixWorld(!0), T) {
|
|
2396
|
+
const E = T.parent;
|
|
2397
|
+
E && E.type !== "Scene" ? (E.getWorldQuaternion(Ae), T.quaternion.copy(Ae.clone().invert()).multiply(ne)) : T.quaternion.copy(ne), T.updateMatrixWorld(!0);
|
|
2398
2398
|
}
|
|
2399
|
-
return
|
|
2399
|
+
return H0(g, F, k.position), D.value >= $;
|
|
2400
2400
|
}
|
|
2401
|
-
function
|
|
2402
|
-
const
|
|
2403
|
-
|
|
2404
|
-
const
|
|
2405
|
-
if (
|
|
2406
|
-
const
|
|
2407
|
-
|
|
2401
|
+
function ha(g, k, F, N, T, D, B) {
|
|
2402
|
+
const $ = B ?? k;
|
|
2403
|
+
De || (g.updateMatrixWorld(!0), g.getWorldPosition(N0), g.getWorldQuaternion(T0), R0.copy(N0).sub($), N.value = 0, De = !0), N.value += T * D, Ne.setFromAxisAngle(c0, N.value), _e.copy(R0).applyQuaternion(Ne).add($), ne.copy(Ne).multiply(T0);
|
|
2404
|
+
const Q = g.parent;
|
|
2405
|
+
if (Q && Q.type !== "Scene" && (Q.updateMatrixWorld(!0), _e.clone(), Q.worldToLocal(_e), Q.getWorldQuaternion(Ae), ne.premultiply(Ae.clone().invert())), g.position.copy(_e), g.quaternion.copy(ne), g.updateMatrixWorld(!0), F) {
|
|
2406
|
+
const He = F.parent;
|
|
2407
|
+
He && He.type !== "Scene" ? (He.getWorldQuaternion(Ae), F.quaternion.copy(Ae.clone().invert()).multiply(ne)) : F.quaternion.copy(ne), F.updateMatrixWorld(!0);
|
|
2408
2408
|
}
|
|
2409
2409
|
}
|
|
2410
|
-
function
|
|
2411
|
-
const
|
|
2412
|
-
|
|
2413
|
-
const
|
|
2414
|
-
if (
|
|
2415
|
-
const
|
|
2416
|
-
|
|
2410
|
+
function ga(g, k, F, N, T, D, B) {
|
|
2411
|
+
const $ = B ?? k;
|
|
2412
|
+
Pe || (g.updateMatrixWorld(!0), g.getWorldPosition(D0), g.getWorldQuaternion(O0), E0.copy(D0).sub($), Pe = !0), N.value += T * D, Ne.setFromAxisAngle(c0, N.value), _e.copy(E0).applyQuaternion(Ne).add($), ne.copy(Ne).multiply(O0);
|
|
2413
|
+
const Q = g.parent;
|
|
2414
|
+
if (Q && Q.type !== "Scene" && (Q.updateMatrixWorld(!0), _e.clone(), Q.worldToLocal(_e), Q.getWorldQuaternion(Ae), ne.premultiply(Ae.clone().invert())), g.position.copy(_e), g.quaternion.copy(ne), g.updateMatrixWorld(!0), F) {
|
|
2415
|
+
const He = F.parent;
|
|
2416
|
+
He && He.type !== "Scene" ? (He.getWorldQuaternion(Ae), F.quaternion.copy(Ae.clone().invert()).multiply(ne)) : F.quaternion.copy(ne), F.updateMatrixWorld(!0);
|
|
2417
2417
|
}
|
|
2418
2418
|
}
|
|
2419
|
-
const
|
|
2420
|
-
let
|
|
2419
|
+
const l2 = 0.5;
|
|
2420
|
+
let W0 = "idle";
|
|
2421
2421
|
function je(g) {
|
|
2422
|
-
|
|
2422
|
+
W0 = g, M = "pausing", y = 0;
|
|
2423
2423
|
}
|
|
2424
|
-
const
|
|
2424
|
+
const _a = new j(), Aa = new j(), pa = new j(), ma = new j();
|
|
2425
2425
|
new j();
|
|
2426
|
-
const
|
|
2427
|
-
let
|
|
2428
|
-
function
|
|
2429
|
-
|
|
2430
|
-
if (!(g instanceof
|
|
2431
|
-
const
|
|
2432
|
-
if (!
|
|
2433
|
-
|
|
2434
|
-
const N =
|
|
2435
|
-
let
|
|
2436
|
-
T.x >= T.y && T.x >= T.z ? (
|
|
2437
|
-
const
|
|
2438
|
-
|
|
2439
|
-
const
|
|
2440
|
-
g.geometry =
|
|
2441
|
-
const
|
|
2442
|
-
|
|
2426
|
+
const ja = new j(0.63, -0.52, 0.45), Ia = new j(0.55, 0.6, 0.2), ya = new j(0.69, -0.48, 0.45), wa = new j(0.65, 0.58, 0.2);
|
|
2427
|
+
let Fa = !1, va = !1;
|
|
2428
|
+
function k2() {
|
|
2429
|
+
r0 = [], u && (u.updateMatrixWorld(!0), u.traverse((g) => {
|
|
2430
|
+
if (!(g instanceof ta) || !g.geometry) return;
|
|
2431
|
+
const k = g.geometry;
|
|
2432
|
+
if (!k.attributes.position) return;
|
|
2433
|
+
k.computeBoundingBox();
|
|
2434
|
+
const N = k.boundingBox, T = N.getSize(new j()), D = N.getCenter(new j());
|
|
2435
|
+
let B, $, Q, He, Z, v, E, $e, Ze;
|
|
2436
|
+
T.x >= T.y && T.x >= T.z ? (B = 0, $ = 1, Q = 2, He = T.x, Z = Math.max(T.y, T.z) / 2, v = N.min.x, E = N.max.x, $e = D.y, Ze = D.z) : T.y >= T.x && T.y >= T.z ? (B = 1, $ = 0, Q = 2, He = T.y, Z = Math.max(T.x, T.z) / 2, v = N.min.y, E = N.max.y, $e = D.x, Ze = D.z) : (B = 2, $ = 0, Q = 1, He = T.z, Z = Math.max(T.x, T.y) / 2, v = N.min.z, E = N.max.z, $e = D.x, Ze = D.y);
|
|
2437
|
+
const Be = new ci(Z, Z, He, 32, 20);
|
|
2438
|
+
B === 0 ? Be.rotateZ(-Math.PI / 2) : B === 2 && Be.rotateX(Math.PI / 2), Be.translate(D.x, D.y, D.z);
|
|
2439
|
+
const V0 = k;
|
|
2440
|
+
g.geometry = Be;
|
|
2441
|
+
const L0 = new Float32Array(
|
|
2442
|
+
Be.attributes.position.array
|
|
2443
2443
|
);
|
|
2444
|
-
|
|
2444
|
+
r0.push({
|
|
2445
2445
|
mesh: g,
|
|
2446
|
-
originalGeometry:
|
|
2447
|
-
originalPositions:
|
|
2448
|
-
aIdx:
|
|
2449
|
-
uIdx:
|
|
2450
|
-
vIdx:
|
|
2446
|
+
originalGeometry: V0,
|
|
2447
|
+
originalPositions: L0,
|
|
2448
|
+
aIdx: B,
|
|
2449
|
+
uIdx: $,
|
|
2450
|
+
vIdx: Q,
|
|
2451
2451
|
axisMin: v,
|
|
2452
|
-
axisMax:
|
|
2453
|
-
centerU:
|
|
2454
|
-
centerV:
|
|
2452
|
+
axisMax: E,
|
|
2453
|
+
centerU: $e,
|
|
2454
|
+
centerV: Ze
|
|
2455
2455
|
});
|
|
2456
2456
|
}));
|
|
2457
2457
|
}
|
|
2458
|
-
function
|
|
2459
|
-
for (let g = 0; g <
|
|
2460
|
-
for (const g of
|
|
2461
|
-
const
|
|
2462
|
-
|
|
2458
|
+
function C0() {
|
|
2459
|
+
for (let g = 0; g < w0; g++) Se[g] = 1;
|
|
2460
|
+
for (const g of r0) {
|
|
2461
|
+
const k = g.mesh.geometry.attributes.position;
|
|
2462
|
+
k.array.set(g.originalPositions), k.needsUpdate = !0, g.mesh.geometry.computeVertexNormals();
|
|
2463
2463
|
}
|
|
2464
2464
|
}
|
|
2465
|
-
function
|
|
2466
|
-
for (const g of
|
|
2467
|
-
const
|
|
2465
|
+
function G0() {
|
|
2466
|
+
for (const g of r0) {
|
|
2467
|
+
const k = g.mesh.geometry.attributes.position, F = k.array, { originalPositions: N, aIdx: T, uIdx: D, vIdx: B, axisMin: $, axisMax: Q, centerU: He, centerV: Z } = g, v = Q - $;
|
|
2468
2468
|
if (!(v <= 0)) {
|
|
2469
|
-
for (let
|
|
2470
|
-
const
|
|
2471
|
-
let
|
|
2472
|
-
|
|
2473
|
-
const
|
|
2474
|
-
if (
|
|
2475
|
-
const
|
|
2476
|
-
F[
|
|
2469
|
+
for (let E = 0; E < F.length; E += 3) {
|
|
2470
|
+
const $e = N[E + T];
|
|
2471
|
+
let Ze = Math.floor(($e - $) / v * w0);
|
|
2472
|
+
Ze = Math.min(Math.max(Ze, 0), w0 - 1);
|
|
2473
|
+
const Be = Se[Ze];
|
|
2474
|
+
if (Be < 1) {
|
|
2475
|
+
const V0 = N[E + D], L0 = N[E + B];
|
|
2476
|
+
F[E + D] = He + (V0 - He) * Be, F[E + B] = Z + (L0 - Z) * Be, F[E + T] = $e;
|
|
2477
2477
|
} else
|
|
2478
|
-
F[
|
|
2478
|
+
F[E] = N[E], F[E + 1] = N[E + 1], F[E + 2] = N[E + 2];
|
|
2479
2479
|
}
|
|
2480
|
-
|
|
2480
|
+
k.needsUpdate = !0, g.mesh.geometry.computeVertexNormals();
|
|
2481
2481
|
}
|
|
2482
2482
|
}
|
|
2483
2483
|
}
|
|
2484
2484
|
function u2() {
|
|
2485
|
-
c.value || o2() && (
|
|
2485
|
+
c.value || o2() && (C0(), y0 = u.parent, oa.copy(u.position), sa.copy(u.quaternion), c.value = !0, M = "opening", y = 0, Fa = !S || !ie, va = !be || !b0, h0 = (g) => {
|
|
2486
2486
|
if (!(!c.value || !u))
|
|
2487
2487
|
switch (y += g, M) {
|
|
2488
2488
|
// ========== 阶段间统一延时 ==========
|
|
2489
2489
|
case "pausing": {
|
|
2490
|
-
y >=
|
|
2490
|
+
y >= l2 && (M = W0, y = 0, W0 = "idle");
|
|
2491
2491
|
break;
|
|
2492
2492
|
}
|
|
2493
2493
|
// ========== 手指张开 ==========
|
|
2494
2494
|
case "opening": {
|
|
2495
|
-
const
|
|
2496
|
-
|
|
2495
|
+
const k = Math.min(y / s, 1);
|
|
2496
|
+
g0(he(k)), k >= 1 && (C0(), s2(), je(Fa ? "toRollGap" : "toMill1UpperGap"), y = 0);
|
|
2497
2497
|
break;
|
|
2498
2498
|
}
|
|
2499
2499
|
// ========== 第一轧机:空隙姿态驱动流程 ==========
|
|
2500
2500
|
// --- 1. 到第一轧机上辊空隙 ---
|
|
2501
2501
|
case "toMill1UpperGap": {
|
|
2502
|
-
|
|
2503
|
-
const
|
|
2504
|
-
u.position.lerpVectors(
|
|
2502
|
+
H0(S, ja, _a);
|
|
2503
|
+
const k = Math.min(y / Ve, 1);
|
|
2504
|
+
u.position.lerpVectors(G, _a, he(k)), k >= 1 && (je("closing1"), y = 0, De = !1);
|
|
2505
2505
|
break;
|
|
2506
2506
|
}
|
|
2507
2507
|
case "closing1": {
|
|
2508
|
-
const
|
|
2509
|
-
|
|
2508
|
+
const k = Math.min(y / ye, 1);
|
|
2509
|
+
g0(1 - he(k)), k >= 1 && (g0(0), M = "ridingMill1UpperGap", y = 0);
|
|
2510
2510
|
break;
|
|
2511
2511
|
}
|
|
2512
2512
|
// --- 2. 联轴器上辊与胚料一同逆时针转动,等待w达到目标值 ---
|
|
2513
2513
|
case "ridingMill1UpperGap": {
|
|
2514
|
-
|
|
2515
|
-
|
|
2514
|
+
S && u && (pe ? pe.getWorldPosition(Te) : S.getWorldPosition(Te), ka(
|
|
2515
|
+
S,
|
|
2516
2516
|
u,
|
|
2517
|
-
|
|
2518
|
-
|
|
2517
|
+
ja,
|
|
2518
|
+
Te,
|
|
2519
2519
|
pe,
|
|
2520
|
+
v0,
|
|
2520
2521
|
F0,
|
|
2521
|
-
|
|
2522
|
-
o0,
|
|
2522
|
+
d0,
|
|
2523
2523
|
g
|
|
2524
|
-
) && (je("mill1Drop"), y = 0,
|
|
2524
|
+
) && (je("mill1Drop"), y = 0, G.copy(u.position), f0.set(G.x, G.y - J, G.z)));
|
|
2525
2525
|
break;
|
|
2526
2526
|
}
|
|
2527
2527
|
// --- 3a. 胚料垂直下落配置距离 ---
|
|
2528
2528
|
case "mill1Drop": {
|
|
2529
|
-
const
|
|
2530
|
-
u.position.lerpVectors(
|
|
2529
|
+
const k = Math.min(y / ue, 1);
|
|
2530
|
+
u.position.lerpVectors(G, f0, he(k)), k >= 1 && (u.position.copy(f0), u.getWorldQuaternion(M0), je("mill1CoRotate"), y = 0, De = !1, Xe = !1);
|
|
2531
2531
|
break;
|
|
2532
2532
|
}
|
|
2533
2533
|
case "mill1CoRotate": {
|
|
2534
|
-
if (
|
|
2535
|
-
|
|
2536
|
-
const
|
|
2537
|
-
for (let N = 3; N <= 7; N++)
|
|
2538
|
-
if (
|
|
2539
|
-
for (let N = 3; N <= 7; N++)
|
|
2540
|
-
|
|
2534
|
+
if (S && ie && u) {
|
|
2535
|
+
Xe || (pe ? pe.getWorldPosition(ze) : S.getWorldPosition(ze), we ? we.getWorldPosition(Qe) : ie.getWorldPosition(Qe), Xe = !0, De = !1, Pe = !1), ha(S, ze, pe, Oe, W, g, ze), ga(ie, Qe, we, Oe, W, g, Qe), u.quaternion.copy(M0), u.quaternion.premultiply(new ee().setFromAxisAngle(c0, -Oe.value));
|
|
2536
|
+
const k = Math.min(Oe.value / Y, 1), F = 1 - 0.25 * he(k);
|
|
2537
|
+
for (let N = 3; N <= 7; N++) Se[N] = F;
|
|
2538
|
+
if (G0(), Oe.value >= Y) {
|
|
2539
|
+
for (let N = 3; N <= 7; N++) Se[N] = 0.75;
|
|
2540
|
+
G0(), je("fallToMill1LowerGap"), y = 0, G.copy(u.position);
|
|
2541
2541
|
}
|
|
2542
2542
|
}
|
|
2543
2543
|
break;
|
|
2544
2544
|
}
|
|
2545
2545
|
// --- 4. 落入第一轧机下辊空隙 ---
|
|
2546
2546
|
case "fallToMill1LowerGap": {
|
|
2547
|
-
|
|
2548
|
-
const
|
|
2549
|
-
u.position.lerpVectors(
|
|
2547
|
+
H0(ie, Ia, Aa);
|
|
2548
|
+
const k = Math.min(y / ge, 1);
|
|
2549
|
+
u.position.lerpVectors(G, Aa, he(k)), k >= 1 && (je("ridingMill1LowerGap"), y = 0, Pe = !1);
|
|
2550
2550
|
break;
|
|
2551
2551
|
}
|
|
2552
2552
|
// --- 4. 随第一轧机下辊空隙转动(顺时针),等待达到目标角度后送出 ---
|
|
2553
2553
|
case "ridingMill1LowerGap": {
|
|
2554
|
-
ie && u && (we ? we.getWorldPosition(
|
|
2554
|
+
ie && u && (we ? we.getWorldPosition(Te) : ie.getWorldPosition(Te), ua(
|
|
2555
2555
|
ie,
|
|
2556
2556
|
u,
|
|
2557
|
-
|
|
2558
|
-
|
|
2557
|
+
Ia,
|
|
2558
|
+
Te,
|
|
2559
2559
|
we,
|
|
2560
|
+
v0,
|
|
2560
2561
|
F0,
|
|
2561
|
-
|
|
2562
|
-
s0,
|
|
2562
|
+
o0,
|
|
2563
2563
|
g
|
|
2564
|
-
) && (
|
|
2564
|
+
) && (G.copy(u.position), je("exitMill1LowerGap"), y = 0));
|
|
2565
2565
|
break;
|
|
2566
2566
|
}
|
|
2567
2567
|
// --- 5. 随第一轧机下辊送出(移动到下输送台板表面并沿表面移动) ---
|
|
2568
2568
|
case "exitMill1LowerGap": {
|
|
2569
|
-
if (
|
|
2570
|
-
const
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2569
|
+
if (V) {
|
|
2570
|
+
const k = new j(
|
|
2571
|
+
G.x + 0.3,
|
|
2572
|
+
V.y + 0.02,
|
|
2573
|
+
G.z
|
|
2574
2574
|
), F = new j(
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
), N =
|
|
2575
|
+
V.x + 0.38,
|
|
2576
|
+
V.y + 0.05,
|
|
2577
|
+
V.z
|
|
2578
|
+
), N = O * 2, T = Math.min(y / N, 1);
|
|
2579
2579
|
if (T <= 0.5) {
|
|
2580
2580
|
const D = T * 2;
|
|
2581
|
-
u.position.lerpVectors(
|
|
2581
|
+
u.position.lerpVectors(G, k, he(D));
|
|
2582
2582
|
} else {
|
|
2583
2583
|
const D = (T - 0.5) * 2;
|
|
2584
|
-
u.position.lerpVectors(
|
|
2584
|
+
u.position.lerpVectors(k, F, he(D));
|
|
2585
2585
|
}
|
|
2586
2586
|
if (T >= 1) {
|
|
2587
|
-
if (u.position.copy(F), !o &&
|
|
2588
|
-
|
|
2589
|
-
let D = 1 / 0,
|
|
2590
|
-
for (let
|
|
2591
|
-
const [
|
|
2592
|
-
if (
|
|
2593
|
-
const
|
|
2594
|
-
|
|
2587
|
+
if (u.position.copy(F), !o && r) {
|
|
2588
|
+
r(), o = !0;
|
|
2589
|
+
let D = 1 / 0, B = -1;
|
|
2590
|
+
for (let $ = 0; $ < t.length; $++) {
|
|
2591
|
+
const [Q, He] = t[$];
|
|
2592
|
+
if (b && b(Q, He, me)) {
|
|
2593
|
+
const Z = me.distanceTo(F);
|
|
2594
|
+
Z < D && (D = Z, B = $);
|
|
2595
2595
|
}
|
|
2596
2596
|
}
|
|
2597
|
-
|
|
2597
|
+
B >= 0 ? (d = B, G.copy(u.position), M = "liftToClamp") : M = "conveyorWait";
|
|
2598
2598
|
} else
|
|
2599
2599
|
M = "conveyorWait";
|
|
2600
2600
|
y = 0;
|
|
@@ -2606,163 +2606,163 @@ function gb(n, a, e, H, i = null, b = null, r = null, f = null) {
|
|
|
2606
2606
|
// ========== 输送台阶段 ==========
|
|
2607
2607
|
// --- 胚料向输送台移动 ---
|
|
2608
2608
|
case "toConveyor": {
|
|
2609
|
-
const
|
|
2610
|
-
u.position.lerpVectors(
|
|
2609
|
+
const k = Math.min(y / l, 1);
|
|
2610
|
+
u.position.lerpVectors(G, P, he(k)), V && u.position.y <= V.y + 0.1 && (u.position.copy(P), M = "liftToClamp", y = 0), y >= l && (u.position.copy(P), M = "liftToClamp", y = 0);
|
|
2611
2611
|
break;
|
|
2612
2612
|
}
|
|
2613
2613
|
// --- 等待夹具到达下输送台接料点(使用 pair 中点) ---
|
|
2614
2614
|
case "conveyorWait": {
|
|
2615
|
-
if (!
|
|
2615
|
+
if (!V) {
|
|
2616
2616
|
M = "upperWait", y = 0;
|
|
2617
2617
|
break;
|
|
2618
2618
|
}
|
|
2619
|
-
let
|
|
2619
|
+
let k = 1 / 0, F = -1;
|
|
2620
2620
|
for (let N = 0; N < t.length; N++) {
|
|
2621
2621
|
const [T, D] = t[N];
|
|
2622
|
-
if (
|
|
2623
|
-
const
|
|
2624
|
-
|
|
2622
|
+
if (b && b(T, D, me)) {
|
|
2623
|
+
const B = me.distanceTo(V);
|
|
2624
|
+
B < w && B < k && (k = B, F = N);
|
|
2625
2625
|
}
|
|
2626
2626
|
}
|
|
2627
|
-
F >= 0 && (d = F,
|
|
2627
|
+
F >= 0 && (d = F, G.copy(u.position), M = "liftToClamp", y = 0), y >= A && (M = "upperWait", y = 0);
|
|
2628
2628
|
break;
|
|
2629
2629
|
}
|
|
2630
2630
|
// --- 胚料升到夹具上方(使用 pair 中点) ---
|
|
2631
2631
|
case "liftToClamp": {
|
|
2632
|
-
const
|
|
2633
|
-
|
|
2632
|
+
const k = Math.min(y / h, 1), F = t[d];
|
|
2633
|
+
b(F[0], F[1], me), me.y += 0.13, me.x += _, u.position.lerpVectors(G, me, he(k)), k >= 1 && (u.position.copy(me), M = "ridingChain", y = 0);
|
|
2634
2634
|
break;
|
|
2635
2635
|
}
|
|
2636
2636
|
// --- 跟随夹具随链条滚动(使用 pair 中点) ---
|
|
2637
2637
|
case "ridingChain": {
|
|
2638
|
-
const
|
|
2639
|
-
if (!
|
|
2640
|
-
|
|
2638
|
+
const k = t[d];
|
|
2639
|
+
if (!b || !b(k[0], k[1], me)) {
|
|
2640
|
+
re && u.position.copy(re), M = "upperWait", y = 0;
|
|
2641
2641
|
break;
|
|
2642
2642
|
}
|
|
2643
|
-
me.y += 0.13, me.x += _, u.position.copy(me),
|
|
2643
|
+
me.y += 0.13, me.x += _, u.position.copy(me), re && me.y >= re.y - p && (G.copy(u.position), P.copy(re), P.y += 0.05, M = "dropToUpperConveyor", y = 0), y >= 60 && (re && u.position.copy(re), M = "upperWait", y = 0);
|
|
2644
2644
|
break;
|
|
2645
2645
|
}
|
|
2646
2646
|
// --- 从夹具平滑过渡到上输送台(避免瞬移) ---
|
|
2647
2647
|
case "dropToUpperConveyor": {
|
|
2648
|
-
if (!
|
|
2648
|
+
if (!re) {
|
|
2649
2649
|
M = "upperWait", y = 0;
|
|
2650
2650
|
break;
|
|
2651
2651
|
}
|
|
2652
|
-
const
|
|
2653
|
-
u.position.lerpVectors(
|
|
2652
|
+
const k = Math.min(y / m, 1);
|
|
2653
|
+
u.position.lerpVectors(G, P, he(k)), k >= 1 && (u.position.copy(P), M = "upperWait", y = 0);
|
|
2654
2654
|
break;
|
|
2655
2655
|
}
|
|
2656
2656
|
// --- 上输送台等待2s ---
|
|
2657
2657
|
case "upperWait": {
|
|
2658
|
-
y >= I && (M =
|
|
2658
|
+
y >= I && (M = va ? "toMill2RollTop" : "toMill2UpperGap", y = 0);
|
|
2659
2659
|
break;
|
|
2660
2660
|
}
|
|
2661
2661
|
// ========== 第二轧机:空隙姿态驱动流程(与第一轧机对称) ==========
|
|
2662
2662
|
// --- 1. 到第二轧机上辊空隙 ---
|
|
2663
2663
|
case "toMill2UpperGap": {
|
|
2664
|
-
|
|
2665
|
-
const
|
|
2666
|
-
u.position.lerpVectors(
|
|
2664
|
+
H0(be, ya, pa);
|
|
2665
|
+
const k = Math.min(y / n0, 1);
|
|
2666
|
+
u.position.lerpVectors(P, pa, he(k)), k >= 1 && (je("ridingMill2UpperGap"), y = 0, De = !1);
|
|
2667
2667
|
break;
|
|
2668
2668
|
}
|
|
2669
2669
|
// --- 2. 联轴器上辊与胚料一同逆时针转动,等待达到目标角度 ---
|
|
2670
2670
|
case "ridingMill2UpperGap": {
|
|
2671
|
-
|
|
2672
|
-
|
|
2671
|
+
be && u && (Fe ? Fe.getWorldPosition(Te) : be.getWorldPosition(Te), ka(
|
|
2672
|
+
be,
|
|
2673
2673
|
u,
|
|
2674
|
-
|
|
2675
|
-
|
|
2674
|
+
ya,
|
|
2675
|
+
Te,
|
|
2676
2676
|
Fe,
|
|
2677
|
+
v0,
|
|
2677
2678
|
F0,
|
|
2678
|
-
|
|
2679
|
-
V,
|
|
2679
|
+
L,
|
|
2680
2680
|
g
|
|
2681
|
-
) && (je("mill2Drop"), y = 0,
|
|
2681
|
+
) && (je("mill2Drop"), y = 0, G.copy(u.position), f0.set(G.x, G.y - oe, G.z)));
|
|
2682
2682
|
break;
|
|
2683
2683
|
}
|
|
2684
2684
|
// --- 3a. 胚料垂直下落配置距离 ---
|
|
2685
2685
|
case "mill2Drop": {
|
|
2686
|
-
const
|
|
2687
|
-
u.position.lerpVectors(
|
|
2686
|
+
const k = Math.min(y / X, 1);
|
|
2687
|
+
u.position.lerpVectors(G, f0, he(k)), k >= 1 && (u.position.copy(f0), u.getWorldQuaternion(M0), je("mill2CoRotate"), y = 0, De = !1, Xe = !1);
|
|
2688
2688
|
break;
|
|
2689
2689
|
}
|
|
2690
2690
|
// --- 3b. 上下辊同速率逆时针共转 ---
|
|
2691
2691
|
case "mill2CoRotate": {
|
|
2692
|
-
if (
|
|
2693
|
-
|
|
2694
|
-
const
|
|
2695
|
-
|
|
2692
|
+
if (be && ce && u) {
|
|
2693
|
+
Xe || (Fe ? Fe.getWorldPosition(ze) : be.getWorldPosition(ze), ve ? ve.getWorldPosition(Qe) : ce.getWorldPosition(Qe), Xe = !0, De = !1, Pe = !1), ha(be, ze, Fe, Oe, le, g, ze), ga(ce, Qe, ve, Oe, le, g, Qe), u.quaternion.copy(M0), u.quaternion.premultiply(new ee().setFromAxisAngle(c0, -Oe.value));
|
|
2694
|
+
const k = Math.min(Oe.value / ae, 1), F = 1 - 0.25 * he(k);
|
|
2695
|
+
Se[0] = F, Se[9] = F, G0(), Oe.value >= ae && (Se[0] = 0.75, Se[9] = 0.75, G0(), je("fallToMill2LowerGap"), y = 0, G.copy(u.position));
|
|
2696
2696
|
}
|
|
2697
2697
|
break;
|
|
2698
2698
|
}
|
|
2699
2699
|
// --- 4. 落入第二轧机下辊空隙 ---
|
|
2700
2700
|
case "fallToMill2LowerGap": {
|
|
2701
|
-
|
|
2702
|
-
const
|
|
2703
|
-
u.position.lerpVectors(
|
|
2701
|
+
H0(ce, wa, ma);
|
|
2702
|
+
const k = Math.min(y / Ee, 1);
|
|
2703
|
+
u.position.lerpVectors(G, ma, he(k)), k >= 1 && (je("ridingMill2LowerGap"), y = 0, Pe = !1);
|
|
2704
2704
|
break;
|
|
2705
2705
|
}
|
|
2706
2706
|
// --- 5. 随第二轧机下辊空隙转动(顺时针),等待达到目标角度后送出 ---
|
|
2707
2707
|
case "ridingMill2LowerGap": {
|
|
2708
|
-
|
|
2709
|
-
|
|
2708
|
+
ce && u && (ve ? ve.getWorldPosition(Te) : ce.getWorldPosition(Te), ua(
|
|
2709
|
+
ce,
|
|
2710
2710
|
u,
|
|
2711
|
-
|
|
2712
|
-
|
|
2711
|
+
wa,
|
|
2712
|
+
Te,
|
|
2713
2713
|
ve,
|
|
2714
|
+
v0,
|
|
2714
2715
|
F0,
|
|
2715
|
-
|
|
2716
|
-
Y,
|
|
2716
|
+
K,
|
|
2717
2717
|
g
|
|
2718
|
-
) && (
|
|
2718
|
+
) && (G.copy(u.position), je("exitMill2LowerGap"), y = 0));
|
|
2719
2719
|
break;
|
|
2720
2720
|
}
|
|
2721
2721
|
// --- 6. 随第二轧机下辊送出(移动到地面) ---
|
|
2722
2722
|
case "exitMill2LowerGap": {
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2723
|
+
P.set(
|
|
2724
|
+
G.x + 3,
|
|
2725
|
+
k0,
|
|
2726
|
+
G.z
|
|
2727
2727
|
);
|
|
2728
|
-
const
|
|
2729
|
-
u.position.lerpVectors(
|
|
2728
|
+
const k = O * 2, F = Math.min(y / k, 1);
|
|
2729
|
+
u.position.lerpVectors(G, P, he(F)), F >= 1 && (u.position.copy(P), M = "groundWait", y = 0);
|
|
2730
2730
|
break;
|
|
2731
2731
|
}
|
|
2732
2732
|
// --- 掉落地面 ---
|
|
2733
2733
|
case "fallToGround": {
|
|
2734
|
-
const
|
|
2735
|
-
u.position.lerpVectors(
|
|
2734
|
+
const k = Math.min(y / q, 1);
|
|
2735
|
+
u.position.lerpVectors(G, P, he(k)), k >= 1 && (u.position.copy(P), M = "groundWait", y = 0);
|
|
2736
2736
|
break;
|
|
2737
2737
|
}
|
|
2738
2738
|
// --- 地面停留3s后全量初始化并重新开始 ---
|
|
2739
2739
|
case "groundWait": {
|
|
2740
|
-
if (y >=
|
|
2741
|
-
f && f(), o = !1, d = -1, u &&
|
|
2742
|
-
const
|
|
2740
|
+
if (y >= z) {
|
|
2741
|
+
f && f(), o = !1, d = -1, u && y0 && (u.removeFromParent(), y0.add(u), u.position.copy(oa), u.quaternion.copy(sa)), C0(), g0(0);
|
|
2742
|
+
const k = (F, N) => {
|
|
2743
2743
|
F && N && (F.position.copy(N.pos), F.quaternion.copy(N.quat), F.updateMatrixWorld(!0));
|
|
2744
2744
|
};
|
|
2745
|
-
|
|
2745
|
+
k(S, s0), k(ie, l0), k(be, i0), k(ce, Le), k(pe, R), k(we, U), k(Fe, fe), k(ve, C), Oe.value = 0, Xe = !1, De = !1, Pe = !1, M = "opening", y = 0;
|
|
2746
2746
|
}
|
|
2747
2747
|
break;
|
|
2748
2748
|
}
|
|
2749
2749
|
}
|
|
2750
|
-
}, a(
|
|
2750
|
+
}, a(h0));
|
|
2751
2751
|
}
|
|
2752
|
-
function
|
|
2753
|
-
c.value = !1,
|
|
2752
|
+
function Na() {
|
|
2753
|
+
c.value = !1, h0 && (e(h0), h0 = null), M = "idle", o = !1, d = -1, g0(0), u0.length = 0, y0 = null;
|
|
2754
2754
|
}
|
|
2755
2755
|
function h2() {
|
|
2756
|
-
|
|
2757
|
-
for (const g of
|
|
2756
|
+
Na();
|
|
2757
|
+
for (const g of r0)
|
|
2758
2758
|
g.mesh.geometry = g.originalGeometry;
|
|
2759
|
-
|
|
2759
|
+
r0 = [], u = null, S = null, ie = null, be = null, ce = null, pe = null, we = null, Fe = null, ve = null, s0 = null, l0 = null, i0 = null, Le = null, R = null, U = null, fe = null, C = null, te = null;
|
|
2760
2760
|
}
|
|
2761
|
-
return { isBilletAnimating: c, startBilletDelivery: u2, stopBilletDelivery:
|
|
2761
|
+
return { isBilletAnimating: c, startBilletDelivery: u2, stopBilletDelivery: Na, dispose: h2 };
|
|
2762
2762
|
}
|
|
2763
2763
|
function _b(n, a, e, H = null) {
|
|
2764
|
-
const i =
|
|
2765
|
-
let
|
|
2764
|
+
const i = de(!1);
|
|
2765
|
+
let r = [], b = [];
|
|
2766
2766
|
const f = [
|
|
2767
2767
|
["夹具5倍-7", "夹具5倍-8"],
|
|
2768
2768
|
["夹具5倍-3", "夹具5倍-5"]
|
|
@@ -2770,165 +2770,165 @@ function _b(n, a, e, H = null) {
|
|
|
2770
2770
|
let c = null, t = 0;
|
|
2771
2771
|
const o = 6;
|
|
2772
2772
|
let d = null;
|
|
2773
|
-
const s = new
|
|
2773
|
+
const s = new ee(), l = new j(), h = new j(), m = new j(), _ = new j(), w = new ee(), p = new ee(), A = new ee(), I = new ee(), O = new ee(), q = new j(), z = new j();
|
|
2774
2774
|
function ye() {
|
|
2775
|
-
const
|
|
2776
|
-
if (!
|
|
2777
|
-
for (const
|
|
2778
|
-
|
|
2779
|
-
for (const
|
|
2780
|
-
if (
|
|
2775
|
+
const J = n.value;
|
|
2776
|
+
if (!J || J.length === 0) return !1;
|
|
2777
|
+
for (const X of J)
|
|
2778
|
+
X && X.updateMatrixWorld(!0);
|
|
2779
|
+
for (const X of J)
|
|
2780
|
+
if (X && (c = X.getObjectByName("整体1-6"), c))
|
|
2781
2781
|
break;
|
|
2782
2782
|
if (!c) return !1;
|
|
2783
|
-
const ue = c.getObjectByName("链条5倍-1"),
|
|
2784
|
-
if (!ue || !
|
|
2785
|
-
const
|
|
2786
|
-
|
|
2787
|
-
for (const
|
|
2788
|
-
const
|
|
2789
|
-
if (
|
|
2790
|
-
|
|
2791
|
-
}),
|
|
2792
|
-
const
|
|
2793
|
-
if (
|
|
2794
|
-
|
|
2795
|
-
}),
|
|
2796
|
-
const M = new j().addVectors(
|
|
2797
|
-
|
|
2798
|
-
const
|
|
2799
|
-
return (
|
|
2783
|
+
const ue = c.getObjectByName("链条5倍-1"), Y = c.getObjectByName("链条5倍-2");
|
|
2784
|
+
if (!ue || !Y) return !1;
|
|
2785
|
+
const W = [ue, Y];
|
|
2786
|
+
r = [];
|
|
2787
|
+
for (const X of W) {
|
|
2788
|
+
const ae = [];
|
|
2789
|
+
if (X.children.forEach((P) => {
|
|
2790
|
+
P.name.startsWith("链节5倍") && ae.push(P);
|
|
2791
|
+
}), ae.length === 0) return !1;
|
|
2792
|
+
const le = [];
|
|
2793
|
+
if (X.children.forEach((P) => {
|
|
2794
|
+
P.name.includes("主动链轮10倍") && le.push(P.position.clone());
|
|
2795
|
+
}), le.length < 2) return !1;
|
|
2796
|
+
const M = new j().addVectors(le[0], le[1]).multiplyScalar(0.5);
|
|
2797
|
+
ae.sort((P, u) => {
|
|
2798
|
+
const S = Math.atan2(P.position.y - M.y, P.position.x - M.x), ie = Math.atan2(u.position.y - M.y, u.position.x - M.x);
|
|
2799
|
+
return (S < 0 ? S + 2 * Math.PI : S) - (ie < 0 ? ie + 2 * Math.PI : ie);
|
|
2800
2800
|
});
|
|
2801
|
-
const y =
|
|
2802
|
-
|
|
2801
|
+
const y = ae.map((P) => P.position.clone()), G = ae.map((P) => P.quaternion.clone());
|
|
2802
|
+
r.push({ group: X, links: ae, origPositions: y, origQuaternions: G });
|
|
2803
2803
|
}
|
|
2804
|
-
|
|
2805
|
-
const
|
|
2806
|
-
for (const
|
|
2807
|
-
const
|
|
2808
|
-
if (!
|
|
2809
|
-
const
|
|
2810
|
-
|
|
2811
|
-
let M = -1, y = -1,
|
|
2812
|
-
for (let u = 0; u <
|
|
2813
|
-
const
|
|
2814
|
-
|
|
2815
|
-
for (let
|
|
2816
|
-
const
|
|
2817
|
-
pe <
|
|
2804
|
+
b = [];
|
|
2805
|
+
const L = ["夹具5倍-7", "夹具5倍-8", "夹具5倍-3", "夹具5倍-5"], K = new ee(), oe = new ee();
|
|
2806
|
+
for (const X of L) {
|
|
2807
|
+
const ae = c.getObjectByName(X);
|
|
2808
|
+
if (!ae) continue;
|
|
2809
|
+
const le = new j();
|
|
2810
|
+
ae.getWorldPosition(le);
|
|
2811
|
+
let M = -1, y = -1, G = 1 / 0, P = new j();
|
|
2812
|
+
for (let u = 0; u < r.length; u++) {
|
|
2813
|
+
const S = r[u], ie = new j();
|
|
2814
|
+
S.group.worldToLocal(ie.copy(le));
|
|
2815
|
+
for (let be = 0; be < S.links.length; be++) {
|
|
2816
|
+
const ce = S.origPositions[be], pe = ie.distanceTo(ce);
|
|
2817
|
+
pe < G && (G = pe, M = u, y = be, P = new j().subVectors(ie, ce));
|
|
2818
2818
|
}
|
|
2819
2819
|
}
|
|
2820
2820
|
if (M >= 0) {
|
|
2821
|
-
|
|
2822
|
-
const
|
|
2823
|
-
|
|
2824
|
-
object:
|
|
2821
|
+
r[M].links[y].getWorldQuaternion(K), ae.getWorldQuaternion(oe);
|
|
2822
|
+
const S = new ee().copy(K).invert().multiply(oe);
|
|
2823
|
+
b.push({
|
|
2824
|
+
object: ae,
|
|
2825
2825
|
chainIdx: M,
|
|
2826
2826
|
linkIdx: y,
|
|
2827
|
-
localOffset:
|
|
2828
|
-
quatOffset:
|
|
2829
|
-
origPosition:
|
|
2830
|
-
origQuaternion:
|
|
2827
|
+
localOffset: P,
|
|
2828
|
+
quatOffset: S,
|
|
2829
|
+
origPosition: ae.position.clone(),
|
|
2830
|
+
origQuaternion: ae.quaternion.clone()
|
|
2831
2831
|
});
|
|
2832
2832
|
}
|
|
2833
2833
|
}
|
|
2834
2834
|
return !0;
|
|
2835
2835
|
}
|
|
2836
|
-
function
|
|
2837
|
-
i.value || ye() && (i.value = !0, t = 0, d = (
|
|
2838
|
-
var
|
|
2836
|
+
function ke() {
|
|
2837
|
+
i.value || ye() && (i.value = !0, t = 0, d = (J) => {
|
|
2838
|
+
var Y;
|
|
2839
2839
|
if (!i.value) return;
|
|
2840
|
-
t += o *
|
|
2841
|
-
const ue = ((
|
|
2840
|
+
t += o * J;
|
|
2841
|
+
const ue = ((Y = r[0]) == null ? void 0 : Y.links.length) ?? 0;
|
|
2842
2842
|
if (ue > 0 && t >= ue) {
|
|
2843
2843
|
t = ue, ge(), H && H();
|
|
2844
2844
|
return;
|
|
2845
2845
|
}
|
|
2846
|
-
for (const
|
|
2847
|
-
const
|
|
2848
|
-
for (let
|
|
2849
|
-
const
|
|
2846
|
+
for (const W of r) {
|
|
2847
|
+
const L = W.links.length, K = Math.floor(t), oe = t - K;
|
|
2848
|
+
for (let X = 0; X < L; X++) {
|
|
2849
|
+
const ae = ((X + K) % L + L) % L, le = ((X + K + 1) % L + L) % L, M = W.links[X];
|
|
2850
2850
|
M.position.lerpVectors(
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2851
|
+
W.origPositions[ae],
|
|
2852
|
+
W.origPositions[le],
|
|
2853
|
+
oe
|
|
2854
2854
|
), s.slerpQuaternions(
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2855
|
+
W.origQuaternions[ae],
|
|
2856
|
+
W.origQuaternions[le],
|
|
2857
|
+
oe
|
|
2858
2858
|
), M.quaternion.copy(s);
|
|
2859
2859
|
}
|
|
2860
2860
|
}
|
|
2861
|
-
c.getWorldQuaternion(
|
|
2862
|
-
for (const
|
|
2863
|
-
const
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
), h.copy(
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
),
|
|
2861
|
+
c.getWorldQuaternion(A), I.copy(A).invert();
|
|
2862
|
+
for (const W of b) {
|
|
2863
|
+
const L = r[W.chainIdx], K = L.links.length, oe = Math.floor(t), X = t - oe, ae = ((W.linkIdx + oe) % K + K) % K, le = ((W.linkIdx + oe + 1) % K + K) % K;
|
|
2864
|
+
l.lerpVectors(
|
|
2865
|
+
L.origPositions[ae],
|
|
2866
|
+
L.origPositions[le],
|
|
2867
|
+
X
|
|
2868
|
+
), h.copy(l).add(W.localOffset), L.group.localToWorld(m.copy(h)), c.worldToLocal(_.copy(m)), W.object.position.copy(_), L.group.getWorldQuaternion(p), w.slerpQuaternions(
|
|
2869
|
+
L.origQuaternions[ae],
|
|
2870
|
+
L.origQuaternions[le],
|
|
2871
|
+
X
|
|
2872
|
+
), O.copy(p).multiply(w).multiply(W.quatOffset), O.premultiply(I), W.object.quaternion.copy(O);
|
|
2873
2873
|
}
|
|
2874
2874
|
}, a(d));
|
|
2875
2875
|
}
|
|
2876
2876
|
function ge() {
|
|
2877
2877
|
i.value = !1, d && (e(d), d = null);
|
|
2878
|
-
for (const
|
|
2879
|
-
|
|
2880
|
-
ue.position.copy(
|
|
2878
|
+
for (const J of r)
|
|
2879
|
+
J.links.forEach((ue, Y) => {
|
|
2880
|
+
ue.position.copy(J.origPositions[Y]), ue.quaternion.copy(J.origQuaternions[Y]);
|
|
2881
2881
|
});
|
|
2882
|
-
for (const
|
|
2883
|
-
|
|
2882
|
+
for (const J of b)
|
|
2883
|
+
J.object.position.copy(J.origPosition), J.object.quaternion.copy(J.origQuaternion);
|
|
2884
2884
|
}
|
|
2885
|
-
function
|
|
2886
|
-
ge(),
|
|
2885
|
+
function Ee() {
|
|
2886
|
+
ge(), r = [], b = [];
|
|
2887
2887
|
}
|
|
2888
|
-
function
|
|
2889
|
-
const
|
|
2890
|
-
return
|
|
2888
|
+
function Ve(J, ue) {
|
|
2889
|
+
const Y = b.find((W) => W.object.name === J);
|
|
2890
|
+
return Y ? (Y.object.getWorldPosition(ue), !0) : !1;
|
|
2891
2891
|
}
|
|
2892
|
-
function
|
|
2893
|
-
const
|
|
2894
|
-
if (!
|
|
2895
|
-
let
|
|
2896
|
-
return
|
|
2892
|
+
function n0(J, ue, Y) {
|
|
2893
|
+
const W = b.find((oe) => oe.object.name === J), L = b.find((oe) => oe.object.name === ue);
|
|
2894
|
+
if (!W && !L) return !1;
|
|
2895
|
+
let K = !1;
|
|
2896
|
+
return W && (W.object.getWorldPosition(q), K = !0), L && (L.object.getWorldPosition(z), K = !0), W && L ? Y.copy(q).add(z).multiplyScalar(0.5) : W ? Y.copy(q) : Y.copy(z), K;
|
|
2897
2897
|
}
|
|
2898
|
-
function
|
|
2899
|
-
return
|
|
2898
|
+
function d0() {
|
|
2899
|
+
return b.map((J) => J.object.name);
|
|
2900
2900
|
}
|
|
2901
|
-
function
|
|
2901
|
+
function o0() {
|
|
2902
2902
|
return f.slice();
|
|
2903
2903
|
}
|
|
2904
|
-
return { isChainAnimating: i, startChainAnimation:
|
|
2904
|
+
return { isChainAnimating: i, startChainAnimation: ke, stopChainAnimation: ge, dispose: Ee, getClampWorldPosition: Ve, getClampPairWorldPosition: n0, getClampNames: d0, getClampPairs: o0 };
|
|
2905
2905
|
}
|
|
2906
|
-
const Ab = 16776960, pb = 65280,
|
|
2906
|
+
const Ab = 16776960, pb = 65280, Va = "pickHighlightRoot", mb = "partType";
|
|
2907
2907
|
function jb() {
|
|
2908
2908
|
return {
|
|
2909
2909
|
raycaster: new fi(),
|
|
2910
|
-
mouse: new
|
|
2910
|
+
mouse: new fa(),
|
|
2911
2911
|
lastMeshes: /* @__PURE__ */ new Set(),
|
|
2912
2912
|
originalEmissive: /* @__PURE__ */ new Map()
|
|
2913
2913
|
};
|
|
2914
2914
|
}
|
|
2915
|
-
function
|
|
2915
|
+
function n2(n, a) {
|
|
2916
2916
|
const e = [...a];
|
|
2917
2917
|
return n.traverse((H) => {
|
|
2918
2918
|
H.type === "Group" && H.name.endsWith("-pivot") && e.push(H);
|
|
2919
2919
|
}), e;
|
|
2920
2920
|
}
|
|
2921
2921
|
function Ib(n, a) {
|
|
2922
|
-
var i,
|
|
2922
|
+
var i, r;
|
|
2923
2923
|
const e = a.originalEmissive.get(n), H = n.material;
|
|
2924
|
-
e ? (i = H.emissive) == null || i.copy(e) : (
|
|
2924
|
+
e ? (i = H.emissive) == null || i.copy(e) : (r = H.emissive) == null || r.setHex(0);
|
|
2925
2925
|
}
|
|
2926
|
-
function
|
|
2927
|
-
const a = n.userData[
|
|
2926
|
+
function da(n) {
|
|
2927
|
+
const a = n.userData[Va];
|
|
2928
2928
|
if (a && a.isObject3D) return a;
|
|
2929
2929
|
let e = n.parent, H = null;
|
|
2930
2930
|
for (; e; ) {
|
|
2931
|
-
const i = e.userData[
|
|
2931
|
+
const i = e.userData[Va];
|
|
2932
2932
|
if (i && i.isObject3D) return i;
|
|
2933
2933
|
if (e.name && e.name.includes("联轴器")) return e;
|
|
2934
2934
|
!e.isMesh && H === null && (H = e), e = e.parent;
|
|
@@ -2942,31 +2942,31 @@ function yb(n) {
|
|
|
2942
2942
|
}), a;
|
|
2943
2943
|
}
|
|
2944
2944
|
function d2(n) {
|
|
2945
|
-
const a =
|
|
2945
|
+
const a = da(n);
|
|
2946
2946
|
if (a) {
|
|
2947
2947
|
const e = yb(a);
|
|
2948
2948
|
if (e.length > 0) return e;
|
|
2949
2949
|
}
|
|
2950
2950
|
return [n];
|
|
2951
2951
|
}
|
|
2952
|
-
function
|
|
2952
|
+
function La(n) {
|
|
2953
2953
|
n.lastMeshes.forEach((a) => Ib(a, n)), n.lastMeshes.clear();
|
|
2954
2954
|
}
|
|
2955
|
-
function wb(n, a, e, H, i,
|
|
2956
|
-
var s,
|
|
2955
|
+
function wb(n, a, e, H, i, r, b = {}) {
|
|
2956
|
+
var s, l;
|
|
2957
2957
|
const f = a.getBoundingClientRect();
|
|
2958
|
-
|
|
2959
|
-
const c =
|
|
2958
|
+
r.mouse.x = (n.clientX - f.left) / f.width * 2 - 1, r.mouse.y = -((n.clientY - f.top) / f.height) * 2 + 1, r.raycaster.setFromCamera(r.mouse, e);
|
|
2959
|
+
const c = n2(H, i), t = r.raycaster.intersectObjects(c, !0);
|
|
2960
2960
|
if (t.length === 0) {
|
|
2961
|
-
|
|
2961
|
+
r.lastMeshes.size > 0 && La(r), (s = b.onMiss) == null || s.call(b);
|
|
2962
2962
|
return;
|
|
2963
2963
|
}
|
|
2964
2964
|
const o = t[0].object, d = d2(o);
|
|
2965
|
-
|
|
2965
|
+
La(r), d.forEach((h) => {
|
|
2966
2966
|
var _, w;
|
|
2967
|
-
const
|
|
2968
|
-
|
|
2969
|
-
}), (
|
|
2967
|
+
const m = h.material;
|
|
2968
|
+
r.originalEmissive.has(h) || r.originalEmissive.set(h, ((_ = m.emissive) == null ? void 0 : _.clone()) ?? new Ge(0)), h.material = m.clone(), (w = h.material.emissive) == null || w.setHex(Ab), r.lastMeshes.add(h);
|
|
2969
|
+
}), (l = b.onHit) == null || l.call(b, o);
|
|
2970
2970
|
}
|
|
2971
2971
|
function Fb(n) {
|
|
2972
2972
|
var H;
|
|
@@ -2985,18 +2985,18 @@ function vb() {
|
|
|
2985
2985
|
}
|
|
2986
2986
|
function Nb(n) {
|
|
2987
2987
|
var c, t;
|
|
2988
|
-
const a =
|
|
2988
|
+
const a = da(n), e = new I0().setFromObject(a || n), H = new j(), i = new j();
|
|
2989
2989
|
e.getCenter(H), e.getSize(i);
|
|
2990
|
-
const
|
|
2991
|
-
n.getWorldPosition(
|
|
2992
|
-
const
|
|
2990
|
+
const r = new j();
|
|
2991
|
+
n.getWorldPosition(r);
|
|
2992
|
+
const b = n.material, f = (b == null ? void 0 : b.name) || ((c = b == null ? void 0 : b.constructor) == null ? void 0 : c.name) || "Unknown";
|
|
2993
2993
|
return {
|
|
2994
2994
|
name: (a == null ? void 0 : a.name) || n.name,
|
|
2995
2995
|
meshName: n.name,
|
|
2996
2996
|
meshUuid: n.uuid,
|
|
2997
2997
|
parentName: ((t = n.parent) == null ? void 0 : t.name) || null,
|
|
2998
2998
|
partType: n.userData[mb] || null,
|
|
2999
|
-
worldPosition:
|
|
2999
|
+
worldPosition: r,
|
|
3000
3000
|
materialName: f,
|
|
3001
3001
|
boundingBox: {
|
|
3002
3002
|
min: e.min.clone(),
|
|
@@ -3007,33 +3007,39 @@ function Nb(n) {
|
|
|
3007
3007
|
};
|
|
3008
3008
|
}
|
|
3009
3009
|
function Tb(n, a) {
|
|
3010
|
-
var i,
|
|
3010
|
+
var i, r;
|
|
3011
3011
|
const e = a.originalEmissive.get(n), H = n.material;
|
|
3012
|
-
e ? (i = H.emissive) == null || i.copy(e) : (
|
|
3012
|
+
e ? (i = H.emissive) == null || i.copy(e) : (r = H.emissive) == null || r.setHex(0);
|
|
3013
3013
|
}
|
|
3014
|
-
function
|
|
3014
|
+
function U0(n) {
|
|
3015
3015
|
n.selectedMeshes.forEach((a) => Tb(a, n)), n.selectedMeshes.clear();
|
|
3016
3016
|
}
|
|
3017
|
-
function Rb(n, a, e, H, i,
|
|
3018
|
-
var
|
|
3017
|
+
function Rb(n, a, e, H, i, r, b = {}) {
|
|
3018
|
+
var _, w, p;
|
|
3019
3019
|
const f = a.getBoundingClientRect();
|
|
3020
|
-
|
|
3021
|
-
const c =
|
|
3020
|
+
r.mouse.x = (n.clientX - f.left) / f.width * 2 - 1, r.mouse.y = -((n.clientY - f.top) / f.height) * 2 + 1, r.raycaster.setFromCamera(r.mouse, e);
|
|
3021
|
+
const c = n2(H, i), t = r.raycaster.intersectObjects(c, !0);
|
|
3022
3022
|
if (t.length === 0) {
|
|
3023
|
-
|
|
3023
|
+
r.selectedMeshes.size > 0 && (U0(r), r.selectedMesh = null), (_ = b.onMiss) == null || _.call(b);
|
|
3024
3024
|
return;
|
|
3025
3025
|
}
|
|
3026
|
-
const o = t[0].object, d =
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
}
|
|
3032
|
-
const
|
|
3033
|
-
(
|
|
3026
|
+
const o = t[0].object, d = da(o), s = (d == null ? void 0 : d.name) || o.name;
|
|
3027
|
+
let l = !0;
|
|
3028
|
+
if (b.nameFilter ? l = b.nameFilter(s) : b.allowedNames && b.allowedNames.length > 0 && (l = b.allowedNames.includes(s)), !l) {
|
|
3029
|
+
r.selectedMeshes.size > 0 && (U0(r), r.selectedMesh = null), (w = b.onMiss) == null || w.call(b);
|
|
3030
|
+
return;
|
|
3031
|
+
}
|
|
3032
|
+
const h = d2(o);
|
|
3033
|
+
U0(r), h.forEach((A) => {
|
|
3034
|
+
var O, q;
|
|
3035
|
+
const I = A.material;
|
|
3036
|
+
r.originalEmissive.has(A) || r.originalEmissive.set(A, ((O = I.emissive) == null ? void 0 : O.clone()) ?? new Ge(0)), A.material = I.clone(), (q = A.material.emissive) == null || q.setHex(pb), r.selectedMeshes.add(A);
|
|
3037
|
+
}), r.selectedMesh = o;
|
|
3038
|
+
const m = Nb(o);
|
|
3039
|
+
(p = b.onSelect) == null || p.call(b, o, m);
|
|
3034
3040
|
}
|
|
3035
|
-
function
|
|
3036
|
-
n.selectedMeshes.size > 0 &&
|
|
3041
|
+
function Sa(n) {
|
|
3042
|
+
n.selectedMeshes.size > 0 && U0(n), n.originalEmissive.clear(), n.selectedMeshes.clear(), n.selectedMesh = null;
|
|
3037
3043
|
}
|
|
3038
3044
|
function Mb(n, a, e, H) {
|
|
3039
3045
|
function i() {
|
|
@@ -3042,63 +3048,65 @@ function Mb(n, a, e, H) {
|
|
|
3042
3048
|
}
|
|
3043
3049
|
function Db(n) {
|
|
3044
3050
|
let a = null;
|
|
3045
|
-
const e =
|
|
3046
|
-
function
|
|
3051
|
+
const e = de(!1), H = de(null), i = de(null);
|
|
3052
|
+
function r() {
|
|
3047
3053
|
if (!H.value || !n.threejsContainer.value) {
|
|
3048
3054
|
i.value = null;
|
|
3049
3055
|
return;
|
|
3050
3056
|
}
|
|
3051
|
-
const { camera:
|
|
3052
|
-
if (!
|
|
3053
|
-
const
|
|
3054
|
-
|
|
3055
|
-
const _ = n.threejsContainer.value.getBoundingClientRect(), w = _.left + (
|
|
3057
|
+
const { camera: l } = n.getThreeJSObjects();
|
|
3058
|
+
if (!l) return;
|
|
3059
|
+
const m = H.value.worldPosition.clone();
|
|
3060
|
+
m.project(l);
|
|
3061
|
+
const _ = n.threejsContainer.value.getBoundingClientRect(), w = _.left + (m.x * 0.5 + 0.5) * _.width + (n.offsetX ?? 15), p = _.top + (-(m.y * 0.5) + 0.5) * _.height + (n.offsetY ?? 15);
|
|
3056
3062
|
i.value = { x: w, y: p };
|
|
3057
3063
|
}
|
|
3058
|
-
function
|
|
3064
|
+
function b(l) {
|
|
3059
3065
|
if (!a || !n.threejsContainer.value) return;
|
|
3060
|
-
const { camera: h, scene:
|
|
3061
|
-
if (!h || !
|
|
3066
|
+
const { camera: h, scene: m } = n.getThreeJSObjects();
|
|
3067
|
+
if (!h || !m) return;
|
|
3062
3068
|
const _ = n.offsetX ?? 15, w = n.offsetY ?? 15;
|
|
3063
|
-
i.value = { x:
|
|
3064
|
-
|
|
3069
|
+
i.value = { x: l.clientX + _, y: l.clientY + w }, Rb(
|
|
3070
|
+
l,
|
|
3065
3071
|
n.threejsContainer.value,
|
|
3066
3072
|
h,
|
|
3067
|
-
|
|
3073
|
+
m,
|
|
3068
3074
|
n.currentModels.value,
|
|
3069
3075
|
a,
|
|
3070
3076
|
{
|
|
3071
|
-
onSelect: (p,
|
|
3077
|
+
onSelect: (p, A) => {
|
|
3072
3078
|
var I;
|
|
3073
|
-
H.value =
|
|
3079
|
+
H.value = A, r(), (I = n.onSelect) == null || I.call(n, p, A);
|
|
3074
3080
|
},
|
|
3075
3081
|
onMiss: () => {
|
|
3076
3082
|
var p;
|
|
3077
|
-
|
|
3078
|
-
}
|
|
3083
|
+
r(), (p = n.onMiss) == null || p.call(n);
|
|
3084
|
+
},
|
|
3085
|
+
allowedNames: n.allowedNames,
|
|
3086
|
+
nameFilter: n.nameFilter
|
|
3079
3087
|
}
|
|
3080
3088
|
);
|
|
3081
3089
|
}
|
|
3082
3090
|
function f() {
|
|
3083
|
-
var
|
|
3084
|
-
a &&
|
|
3091
|
+
var l;
|
|
3092
|
+
a && Sa(a), a = vb(), (l = n.threejsContainer.value) == null || l.addEventListener("click", b);
|
|
3085
3093
|
}
|
|
3086
3094
|
function c() {
|
|
3087
|
-
d(), n.threejsContainer.value && a && (n.threejsContainer.value.removeEventListener("click",
|
|
3095
|
+
d(), n.threejsContainer.value && a && (n.threejsContainer.value.removeEventListener("click", b), Sa(a), a = null);
|
|
3088
3096
|
}
|
|
3089
3097
|
let t = null;
|
|
3090
3098
|
function o() {
|
|
3091
|
-
const
|
|
3092
|
-
e.value && H.value &&
|
|
3099
|
+
const l = () => {
|
|
3100
|
+
e.value && H.value && r(), t = requestAnimationFrame(l);
|
|
3093
3101
|
};
|
|
3094
|
-
|
|
3102
|
+
l();
|
|
3095
3103
|
}
|
|
3096
3104
|
function d() {
|
|
3097
3105
|
t !== null && (cancelAnimationFrame(t), t = null);
|
|
3098
3106
|
}
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
}),
|
|
3107
|
+
Ye(e, (l) => {
|
|
3108
|
+
l ? o() : d();
|
|
3109
|
+
}), za(() => {
|
|
3102
3110
|
c();
|
|
3103
3111
|
});
|
|
3104
3112
|
function s() {
|
|
@@ -3111,7 +3119,7 @@ function Db(n) {
|
|
|
3111
3119
|
init: f,
|
|
3112
3120
|
dispose: c,
|
|
3113
3121
|
closePanel: s,
|
|
3114
|
-
updatePopupPosition:
|
|
3122
|
+
updatePopupPosition: r
|
|
3115
3123
|
};
|
|
3116
3124
|
}
|
|
3117
3125
|
function Ob(n) {
|
|
@@ -3120,40 +3128,40 @@ function Ob(n) {
|
|
|
3120
3128
|
baseURL: e,
|
|
3121
3129
|
onMessage: H,
|
|
3122
3130
|
onError: i
|
|
3123
|
-
} = n,
|
|
3131
|
+
} = n, r = de(!1), b = de(null);
|
|
3124
3132
|
let f = null;
|
|
3125
3133
|
const c = (s) => `${e}?action=${s}&platId=${a}`, t = () => {
|
|
3126
|
-
if (
|
|
3134
|
+
if (r.value) {
|
|
3127
3135
|
console.log("[SSE] 已经连接,无需重复连接");
|
|
3128
3136
|
return;
|
|
3129
3137
|
}
|
|
3130
3138
|
const s = c("connect");
|
|
3131
3139
|
f = new EventSource(s), f.onopen = () => {
|
|
3132
|
-
|
|
3133
|
-
}, f.onmessage = (
|
|
3140
|
+
r.value = !0;
|
|
3141
|
+
}, f.onmessage = (l) => {
|
|
3134
3142
|
try {
|
|
3135
|
-
const h = JSON.parse(
|
|
3136
|
-
|
|
3143
|
+
const h = JSON.parse(l.data);
|
|
3144
|
+
b.value = h, H == null || H(h);
|
|
3137
3145
|
} catch {
|
|
3138
|
-
|
|
3146
|
+
b.value = l.data, H == null || H(l.data);
|
|
3139
3147
|
}
|
|
3140
|
-
}, f.onerror = (
|
|
3141
|
-
|
|
3148
|
+
}, f.onerror = (l) => {
|
|
3149
|
+
r.value = !1, i == null || i(l);
|
|
3142
3150
|
};
|
|
3143
3151
|
}, o = () => {
|
|
3144
|
-
f && (f.close(), f = null),
|
|
3152
|
+
f && (f.close(), f = null), r.value = !1, fetch(e, {
|
|
3145
3153
|
method: "POST",
|
|
3146
3154
|
headers: { "Content-Type": "application/json" },
|
|
3147
3155
|
body: JSON.stringify({ action: "disconnect", platId: a })
|
|
3148
3156
|
}).catch((s) => console.warn("[SSE] 断开请求失败:", s));
|
|
3149
3157
|
}, d = () => {
|
|
3150
|
-
|
|
3158
|
+
r.value ? o() : t();
|
|
3151
3159
|
};
|
|
3152
|
-
return
|
|
3160
|
+
return Qa(() => {
|
|
3153
3161
|
o();
|
|
3154
3162
|
}), {
|
|
3155
|
-
isConnected:
|
|
3156
|
-
lastData:
|
|
3163
|
+
isConnected: r,
|
|
3164
|
+
lastData: b,
|
|
3157
3165
|
connect: t,
|
|
3158
3166
|
// 手动连接
|
|
3159
3167
|
disconnect: o,
|
|
@@ -3162,7 +3170,7 @@ function Ob(n) {
|
|
|
3162
3170
|
// 切换连接状态
|
|
3163
3171
|
};
|
|
3164
3172
|
}
|
|
3165
|
-
const Eb = { class: "popup-header" }, Gb = { class: "popup-title" }, Ub = { class: "popup-body" }, xb = /* @__PURE__ */
|
|
3173
|
+
const Eb = { class: "popup-header" }, Gb = { class: "popup-title" }, Ub = { class: "popup-body" }, xb = /* @__PURE__ */ q0({
|
|
3166
3174
|
__name: "threeModelInfoPanel",
|
|
3167
3175
|
props: {
|
|
3168
3176
|
modelValue: { type: Boolean },
|
|
@@ -3171,13 +3179,13 @@ const Eb = { class: "popup-header" }, Gb = { class: "popup-title" }, Ub = { clas
|
|
|
3171
3179
|
},
|
|
3172
3180
|
emits: ["update:modelValue", "close"],
|
|
3173
3181
|
setup(n, { emit: a }) {
|
|
3174
|
-
const e = n, H = a, i =
|
|
3175
|
-
|
|
3182
|
+
const e = n, H = a, i = de(e.modelValue);
|
|
3183
|
+
Ye(() => e.modelValue, (t) => {
|
|
3176
3184
|
i.value = t;
|
|
3177
|
-
}),
|
|
3185
|
+
}), Ye(i, (t) => {
|
|
3178
3186
|
H("update:modelValue", t);
|
|
3179
3187
|
});
|
|
3180
|
-
const
|
|
3188
|
+
const r = S0(() => {
|
|
3181
3189
|
const t = e.screenPosition;
|
|
3182
3190
|
return t ? {
|
|
3183
3191
|
left: `${t.x + 15}px`,
|
|
@@ -3187,7 +3195,7 @@ const Eb = { class: "popup-header" }, Gb = { class: "popup-title" }, Ub = { clas
|
|
|
3187
3195
|
top: "50%",
|
|
3188
3196
|
transform: "translate(-50%, -50%)"
|
|
3189
3197
|
};
|
|
3190
|
-
}),
|
|
3198
|
+
}), b = S0(() => {
|
|
3191
3199
|
if (!e.partInfo) return [];
|
|
3192
3200
|
const t = e.partInfo;
|
|
3193
3201
|
return [
|
|
@@ -3218,24 +3226,24 @@ const Eb = { class: "popup-header" }, Gb = { class: "popup-title" }, Ub = { clas
|
|
|
3218
3226
|
value: `W:${t.boundingBox.size.x.toFixed(2)} H:${t.boundingBox.size.y.toFixed(2)} D:${t.boundingBox.size.z.toFixed(2)}`
|
|
3219
3227
|
}
|
|
3220
3228
|
];
|
|
3221
|
-
}), f =
|
|
3229
|
+
}), f = S0(() => {
|
|
3222
3230
|
const t = {};
|
|
3223
|
-
return
|
|
3231
|
+
return b.value.forEach((o) => {
|
|
3224
3232
|
t[o.prop] = o.value;
|
|
3225
3233
|
}), t;
|
|
3226
3234
|
}), c = () => {
|
|
3227
3235
|
H("update:modelValue", !1), H("close");
|
|
3228
3236
|
};
|
|
3229
|
-
return (t, o) => (
|
|
3230
|
-
i.value && t.partInfo ? (
|
|
3237
|
+
return (t, o) => (Ce(), x0(Za, { to: "body" }, [
|
|
3238
|
+
i.value && t.partInfo ? (Ce(), j0("div", {
|
|
3231
3239
|
key: 0,
|
|
3232
3240
|
class: "info-popup",
|
|
3233
|
-
style: A2(
|
|
3241
|
+
style: A2(r.value),
|
|
3234
3242
|
onClick: o[0] || (o[0] = _2(() => {
|
|
3235
3243
|
}, ["stop"]))
|
|
3236
3244
|
}, [
|
|
3237
3245
|
se("div", Eb, [
|
|
3238
|
-
se("span", Gb,
|
|
3246
|
+
se("span", Gb, ea(t.partInfo.name), 1),
|
|
3239
3247
|
se("span", {
|
|
3240
3248
|
class: "popup-close",
|
|
3241
3249
|
onClick: c
|
|
@@ -3243,16 +3251,16 @@ const Eb = { class: "popup-header" }, Gb = { class: "popup-title" }, Ub = { clas
|
|
|
3243
3251
|
]),
|
|
3244
3252
|
se("div", Ub, [
|
|
3245
3253
|
Ie(hi, {
|
|
3246
|
-
"row-contents":
|
|
3254
|
+
"row-contents": b.value,
|
|
3247
3255
|
"row-values": f.value,
|
|
3248
3256
|
"form-disabled": !0,
|
|
3249
3257
|
"is-edit": !1
|
|
3250
3258
|
}, null, 8, ["row-contents", "row-values"])
|
|
3251
3259
|
])
|
|
3252
|
-
], 4)) :
|
|
3260
|
+
], 4)) : $0("", !0)
|
|
3253
3261
|
]));
|
|
3254
3262
|
}
|
|
3255
|
-
}), Pb = /* @__PURE__ */
|
|
3263
|
+
}), Pb = /* @__PURE__ */ na(xb, [["__scopeId", "data-v-1ac66143"]]), Bb = { key: 1 }, X0 = /* @__PURE__ */ q0({
|
|
3256
3264
|
__name: "chartBox",
|
|
3257
3265
|
props: {
|
|
3258
3266
|
chartOption: {
|
|
@@ -3261,29 +3269,29 @@ const Eb = { class: "popup-header" }, Gb = { class: "popup-title" }, Ub = { clas
|
|
|
3261
3269
|
}
|
|
3262
3270
|
},
|
|
3263
3271
|
setup(n) {
|
|
3264
|
-
const a =
|
|
3272
|
+
const a = de(null);
|
|
3265
3273
|
let e = null, H = {};
|
|
3266
|
-
const i = n,
|
|
3267
|
-
if (H =
|
|
3274
|
+
const i = n, r = async (b) => {
|
|
3275
|
+
if (H = b, xa(H)) {
|
|
3268
3276
|
e == null || e.dispose(), e = null;
|
|
3269
3277
|
return;
|
|
3270
3278
|
}
|
|
3271
|
-
await
|
|
3279
|
+
await Ja(), a.value && ((!e || e.isDisposed()) && (e = ti(a.value)), e.clear(), e.setOption(H, { notMerge: !0, lazyUpdate: !1 }), e.resize());
|
|
3272
3280
|
};
|
|
3273
|
-
return
|
|
3281
|
+
return Ye(
|
|
3274
3282
|
() => i.chartOption,
|
|
3275
|
-
(
|
|
3283
|
+
(b) => r(b),
|
|
3276
3284
|
{ deep: !0, immediate: !0 }
|
|
3277
|
-
),
|
|
3285
|
+
), Qa(() => {
|
|
3278
3286
|
e && e.dispose();
|
|
3279
|
-
}), (
|
|
3287
|
+
}), (b, f) => Re(xa)(i.chartOption) ? (Ce(), j0("div", Bb, "暂无数据")) : (Ce(), j0("div", {
|
|
3280
3288
|
key: 0,
|
|
3281
3289
|
ref_key: "chartDom",
|
|
3282
3290
|
ref: a,
|
|
3283
3291
|
style: { width: "100%", height: "100%" }
|
|
3284
3292
|
}, null, 512));
|
|
3285
3293
|
}
|
|
3286
|
-
}), qb = { class: "chart" }, Wb = { class: "chart-box" }, Cb = { class: "chart-box" }, Vb = { class: "chart-box" }, Lb = /* @__PURE__ */
|
|
3294
|
+
}), qb = { class: "chart" }, Wb = { class: "chart-box" }, Cb = { class: "chart-box" }, Vb = { class: "chart-box" }, Lb = /* @__PURE__ */ q0({
|
|
3287
3295
|
__name: "threeChartsInfo",
|
|
3288
3296
|
props: {
|
|
3289
3297
|
meshName: {
|
|
@@ -3292,9 +3300,9 @@ const Eb = { class: "popup-header" }, Gb = { class: "popup-title" }, Ub = { clas
|
|
|
3292
3300
|
}
|
|
3293
3301
|
},
|
|
3294
3302
|
setup(n) {
|
|
3295
|
-
const a = I2(
|
|
3303
|
+
const a = I2(Ka), { systemUrl: e } = Xa(a);
|
|
3296
3304
|
let H = e.value === "" || !e.value ? "http://222.92.178.198:63002" : e.value;
|
|
3297
|
-
const i = n,
|
|
3305
|
+
const i = n, r = de({}), b = de({}), f = de({}), c = {
|
|
3298
3306
|
title: { text: "示例图表", top: "3%", left: "1%" },
|
|
3299
3307
|
xAxis: {
|
|
3300
3308
|
show: !1,
|
|
@@ -3320,91 +3328,90 @@ const Eb = { class: "popup-header" }, Gb = { class: "popup-title" }, Ub = { clas
|
|
|
3320
3328
|
data: []
|
|
3321
3329
|
}
|
|
3322
3330
|
}, t = () => {
|
|
3323
|
-
|
|
3331
|
+
r.value = {}, b.value = {}, f.value = {};
|
|
3324
3332
|
}, { connect: o } = Ob({
|
|
3325
3333
|
platId: "",
|
|
3326
3334
|
baseURL: `${H}/thirdparty/stream`,
|
|
3327
3335
|
onMessage(d) {
|
|
3328
|
-
console.log("收到 SSE 消息:", d);
|
|
3329
3336
|
const s = i.meshName.split("_").length >= 3 ? [i.meshName.split("_")[0], i.meshName.split("_")[1]].join("_") : i.meshName;
|
|
3330
3337
|
if (s === "") return;
|
|
3331
|
-
const
|
|
3332
|
-
if (
|
|
3338
|
+
const l = d.result.filter((h) => h.meshName === s);
|
|
3339
|
+
if (l.length === 0) {
|
|
3333
3340
|
t();
|
|
3334
3341
|
return;
|
|
3335
3342
|
}
|
|
3336
|
-
|
|
3343
|
+
r.value = {
|
|
3337
3344
|
...c,
|
|
3338
|
-
title: { ...c.title, text:
|
|
3339
|
-
series: { ...c.series, data:
|
|
3340
|
-
},
|
|
3345
|
+
title: { ...c.title, text: l[0].Name[0] },
|
|
3346
|
+
series: { ...c.series, data: l[0].data[0] }
|
|
3347
|
+
}, b.value = {
|
|
3341
3348
|
...c,
|
|
3342
|
-
title: { ...c.title, text:
|
|
3343
|
-
series: { ...c.series, data:
|
|
3349
|
+
title: { ...c.title, text: l[0].Name[1] },
|
|
3350
|
+
series: { ...c.series, data: l[0].data[1] }
|
|
3344
3351
|
}, f.value = {
|
|
3345
3352
|
...c,
|
|
3346
|
-
title: { ...c.title, text:
|
|
3347
|
-
series: { ...c.series, data:
|
|
3353
|
+
title: { ...c.title, text: l[0].Name[2] },
|
|
3354
|
+
series: { ...c.series, data: l[0].data[2] }
|
|
3348
3355
|
};
|
|
3349
3356
|
},
|
|
3350
3357
|
onError(d) {
|
|
3351
3358
|
console.error("SSE 连接异常:", d);
|
|
3352
3359
|
}
|
|
3353
3360
|
});
|
|
3354
|
-
return
|
|
3361
|
+
return Ya(() => {
|
|
3355
3362
|
o();
|
|
3356
|
-
}), (d, s) => (
|
|
3363
|
+
}), (d, s) => (Ce(), x0(Za, { to: "body" }, [
|
|
3357
3364
|
se("div", qb, [
|
|
3358
3365
|
se("div", Wb, [
|
|
3359
|
-
Ie(
|
|
3366
|
+
Ie(X0, { chartOption: r.value }, null, 8, ["chartOption"])
|
|
3360
3367
|
]),
|
|
3361
3368
|
se("div", Cb, [
|
|
3362
|
-
Ie(
|
|
3369
|
+
Ie(X0, { chartOption: b.value }, null, 8, ["chartOption"])
|
|
3363
3370
|
]),
|
|
3364
3371
|
se("div", Vb, [
|
|
3365
|
-
Ie(
|
|
3372
|
+
Ie(X0, { chartOption: f.value }, null, 8, ["chartOption"])
|
|
3366
3373
|
])
|
|
3367
3374
|
])
|
|
3368
3375
|
]));
|
|
3369
3376
|
}
|
|
3370
|
-
}), Sb = /* @__PURE__ */
|
|
3377
|
+
}), Sb = /* @__PURE__ */ na(Lb, [["__scopeId", "data-v-2f9a55fe"]]), zb = { class: "obj-viewer-container" }, Qb = { class: "buttonGroup-topLeft" }, Zb = { class: "buttonGroup-left" }, Jb = { class: "buttonGroup-right" }, Yb = { class: "buttonGroup-bottom" }, Kb = { class: "left-panel" }, Xb = { class: "panel-header" }, $b = {
|
|
3371
3378
|
key: 0,
|
|
3372
3379
|
class: "loading-overlay"
|
|
3373
|
-
}, er = !0, ar = /* @__PURE__ */
|
|
3380
|
+
}, er = !0, ar = /* @__PURE__ */ q0({
|
|
3374
3381
|
__name: "threePreview",
|
|
3375
3382
|
props: {
|
|
3376
3383
|
fileBlobs: { default: () => [] }
|
|
3377
3384
|
},
|
|
3378
3385
|
setup(n) {
|
|
3379
|
-
const e = n, H =
|
|
3380
|
-
let
|
|
3386
|
+
const e = n, H = de(null), i = de(!1), r = de("");
|
|
3387
|
+
let b = null;
|
|
3381
3388
|
function f(R) {
|
|
3382
|
-
if (!
|
|
3383
|
-
const { camera: U, scene:
|
|
3384
|
-
!U || !
|
|
3389
|
+
if (!b || !H.value) return;
|
|
3390
|
+
const { camera: U, scene: fe } = K();
|
|
3391
|
+
!U || !fe || wb(
|
|
3385
3392
|
R,
|
|
3386
3393
|
H.value,
|
|
3387
3394
|
U,
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3395
|
+
fe,
|
|
3396
|
+
Y.value,
|
|
3397
|
+
b,
|
|
3391
3398
|
{
|
|
3392
|
-
onHit: (
|
|
3393
|
-
var
|
|
3394
|
-
console.log("[PICK_DEBUG] 点击的 mesh 对象:",
|
|
3399
|
+
onHit: (C) => {
|
|
3400
|
+
var V;
|
|
3401
|
+
console.log("[PICK_DEBUG] 点击的 mesh 对象:", C), console.log("[PICK_DEBUG] mesh.name:", C.name), console.log("[PICK_DEBUG] mesh.uuid:", C.uuid), console.log("[PICK_DEBUG] parent.name:", (V = C.parent) == null ? void 0 : V.name), console.log("[PICK_DEBUG] 完整 mesh:", C);
|
|
3395
3402
|
}
|
|
3396
3403
|
}
|
|
3397
3404
|
);
|
|
3398
3405
|
}
|
|
3399
3406
|
function c(R) {
|
|
3400
|
-
if (!
|
|
3407
|
+
if (!b || R.key !== "h" && R.key !== "H") return;
|
|
3401
3408
|
const U = R.target;
|
|
3402
3409
|
if (U) {
|
|
3403
|
-
const
|
|
3404
|
-
if (
|
|
3410
|
+
const C = U.tagName;
|
|
3411
|
+
if (C === "INPUT" || C === "TEXTAREA" || U.isContentEditable) return;
|
|
3405
3412
|
}
|
|
3406
|
-
const
|
|
3407
|
-
|
|
3413
|
+
const fe = Fb(b);
|
|
3414
|
+
fe === null ? console.log("[PICK_DEBUG] 当前没有选中部件, H 快捷键无效") : (console.log(`[PICK_DEBUG] 已${fe ? "显示" : "隐藏"}当前选中部件 (快捷键 H)`), R.preventDefault());
|
|
3408
3415
|
}
|
|
3409
3416
|
const {
|
|
3410
3417
|
threeInfo: t,
|
|
@@ -3412,44 +3419,44 @@ const Eb = { class: "popup-header" }, Gb = { class: "popup-title" }, Ub = { clas
|
|
|
3412
3419
|
isLoading: o,
|
|
3413
3420
|
loadingProgress: d,
|
|
3414
3421
|
loadedModels: s,
|
|
3415
|
-
error:
|
|
3422
|
+
error: l,
|
|
3416
3423
|
loadModelsFromBlobs: h
|
|
3417
3424
|
},
|
|
3418
|
-
animation: { isAnimating:
|
|
3425
|
+
animation: { isAnimating: m, toggleAnimation: _, stopAnimation: w },
|
|
3419
3426
|
clipping: {
|
|
3420
3427
|
isClipping: p,
|
|
3421
|
-
activeClippingAxis:
|
|
3428
|
+
activeClippingAxis: A,
|
|
3422
3429
|
toggleClipping: I,
|
|
3423
|
-
updateClippingPlanes:
|
|
3430
|
+
updateClippingPlanes: O
|
|
3424
3431
|
},
|
|
3425
3432
|
partAnimation: {
|
|
3426
|
-
isPartAnimating:
|
|
3427
|
-
setPartRotations:
|
|
3433
|
+
isPartAnimating: q,
|
|
3434
|
+
setPartRotations: z,
|
|
3428
3435
|
startPartAnimations: ye,
|
|
3429
|
-
stopPartAnimations:
|
|
3436
|
+
stopPartAnimations: ke
|
|
3430
3437
|
},
|
|
3431
3438
|
millPivotAnimation: {
|
|
3432
3439
|
setupMillAnimations: ge
|
|
3433
3440
|
}
|
|
3434
|
-
} =
|
|
3441
|
+
} = kb(H, {
|
|
3435
3442
|
useModelLoaderHook: !0,
|
|
3436
3443
|
useAnimationHook: !0,
|
|
3437
3444
|
useClippingHook: !0,
|
|
3438
3445
|
usePartAnimationHook: !0
|
|
3439
|
-
}), { resetView:
|
|
3440
|
-
const R = !
|
|
3441
|
-
|
|
3446
|
+
}), { resetView: Ee, initThreeJS: Ve, handleResize: n0, cleanup: d0, setAndFitModels: o0, axesHelperVisible: J, toggleAxesVisibility: ue, currentModels: Y, addBeforeRenderCallback: W, removeBeforeRenderCallback: L, getThreeJSObjects: K, isBeforeRenderPaused: oe, setBeforeRenderPaused: X, timeScale: ae } = t, le = () => {
|
|
3447
|
+
const R = !oe.value;
|
|
3448
|
+
X(R), console.log(`[DEBUG] 动画${R ? "已暂停" : "已恢复"}`);
|
|
3442
3449
|
}, M = _b(
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3450
|
+
Y,
|
|
3451
|
+
W,
|
|
3452
|
+
L,
|
|
3446
3453
|
// 夹具第一次回到初始位置(走完一整圈)时,同步停止链轮自转
|
|
3447
|
-
() =>
|
|
3454
|
+
() => ke()
|
|
3448
3455
|
), y = gb(
|
|
3449
|
-
J,
|
|
3450
|
-
q,
|
|
3451
|
-
V,
|
|
3452
3456
|
Y,
|
|
3457
|
+
W,
|
|
3458
|
+
L,
|
|
3459
|
+
K,
|
|
3453
3460
|
// 传入单个链条夹具位置查询函数
|
|
3454
3461
|
(R, U) => M.getClampWorldPosition(R, U),
|
|
3455
3462
|
// 物料到达 conveyorSurfaceEnd 后同时启动链条流动与链轮自转
|
|
@@ -3457,217 +3464,233 @@ const Eb = { class: "popup-header" }, Gb = { class: "popup-title" }, Ub = { clas
|
|
|
3457
3464
|
M.startChainAnimation(), ye();
|
|
3458
3465
|
},
|
|
3459
3466
|
// 传入一对夹具的中心点查询函数(两夹具共同夹持物料,取中点)
|
|
3460
|
-
(R, U,
|
|
3467
|
+
(R, U, fe) => M.getClampPairWorldPosition(R, U, fe),
|
|
3461
3468
|
// 循环重置时停止链条流动与链轮自转
|
|
3462
3469
|
() => {
|
|
3463
|
-
M.stopChainAnimation(),
|
|
3470
|
+
M.stopChainAnimation(), ke();
|
|
3464
3471
|
}
|
|
3465
|
-
),
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3472
|
+
), G = [
|
|
3473
|
+
"机架F1",
|
|
3474
|
+
"机架F2",
|
|
3475
|
+
"联轴器上-1001",
|
|
3476
|
+
"联轴器下-2001",
|
|
3477
|
+
"联轴器上-1",
|
|
3478
|
+
"联轴器下-2",
|
|
3479
|
+
"轴承座右侧有端盖版上侧-2001",
|
|
3480
|
+
"轴承座右侧有端盖版下侧-2001",
|
|
3481
|
+
"轴承座左侧有端盖版上侧-2001",
|
|
3482
|
+
"轴承座左侧有端盖版下侧-2001",
|
|
3483
|
+
"轴承座右侧有端盖版上侧-2",
|
|
3484
|
+
"轴承座右侧有端盖版下侧-2",
|
|
3485
|
+
"轴承座左侧有端盖版上侧-2",
|
|
3486
|
+
"轴承座左侧有端盖版下侧-2"
|
|
3487
|
+
], {
|
|
3488
|
+
showPanel: P,
|
|
3489
|
+
selectedPartInfo: u,
|
|
3490
|
+
screenPosition: S,
|
|
3491
|
+
init: ie,
|
|
3492
|
+
dispose: be
|
|
3471
3493
|
} = Db({
|
|
3472
3494
|
threejsContainer: H,
|
|
3473
|
-
getThreeJSObjects:
|
|
3474
|
-
currentModels:
|
|
3495
|
+
getThreeJSObjects: K,
|
|
3496
|
+
currentModels: Y,
|
|
3497
|
+
allowedNames: G,
|
|
3475
3498
|
onSelect: (R, U) => {
|
|
3476
|
-
console.log("[SELECT] mesh:", R), console.log("[SELECT] 点击的部件信息:", U),
|
|
3499
|
+
console.log("[SELECT] mesh:", R), console.log("[SELECT] 点击的部件信息:", U), ce.value = U.meshName;
|
|
3477
3500
|
}
|
|
3478
|
-
}),
|
|
3501
|
+
}), ce = de(""), pe = () => {
|
|
3479
3502
|
ue();
|
|
3480
|
-
},
|
|
3481
|
-
|
|
3482
|
-
},
|
|
3503
|
+
}, we = (R) => {
|
|
3504
|
+
A.value = R, O();
|
|
3505
|
+
}, Fe = y2(Ka), { originalData: ve } = Xa(Fe), s0 = () => {
|
|
3483
3506
|
if (localStorage.getItem("rotateSpeed"))
|
|
3484
3507
|
return JSON.parse(localStorage.getItem("rotateSpeed") || "1.0");
|
|
3485
3508
|
};
|
|
3486
|
-
|
|
3487
|
-
const R =
|
|
3488
|
-
|
|
3509
|
+
Ye(ve, () => {
|
|
3510
|
+
const R = s0();
|
|
3511
|
+
ae.value = R, console.log("[DEBUG] 动画速度已更新:", R);
|
|
3489
3512
|
}, { deep: !0, immediate: !0 });
|
|
3490
|
-
const
|
|
3513
|
+
const l0 = [
|
|
3491
3514
|
{ partName: "主动链轮10倍-1001", axis: "y", speed: 1, direction: -1 },
|
|
3492
3515
|
{ partName: "主动链轮10倍-2001", axis: "y", speed: 1, direction: -1 },
|
|
3493
3516
|
{ partName: "主动链轮10倍-1", axis: "y", speed: 1, direction: 1 },
|
|
3494
3517
|
{ partName: "主动链轮10倍-2", axis: "y", speed: 1, direction: 1 }
|
|
3495
3518
|
];
|
|
3496
|
-
|
|
3519
|
+
Ye(() => e.fileBlobs, (R) => {
|
|
3497
3520
|
R && R.length > 0 && h(R).catch((U) => {
|
|
3498
3521
|
console.error("加载错误:", U);
|
|
3499
3522
|
});
|
|
3500
3523
|
}, {
|
|
3501
3524
|
immediate: !0,
|
|
3502
3525
|
deep: !0
|
|
3503
|
-
}),
|
|
3504
|
-
R && R.length > 0 && (
|
|
3505
|
-
}),
|
|
3506
|
-
R &&
|
|
3526
|
+
}), Ye(s, (R) => {
|
|
3527
|
+
R && R.length > 0 && (o0(R), ge(), z(l0), y.startBilletDelivery());
|
|
3528
|
+
}), Ye(l, (R) => {
|
|
3529
|
+
R && Ua.error(`模型加载失败: ${R}`);
|
|
3507
3530
|
});
|
|
3508
|
-
const
|
|
3509
|
-
i.value = !0,
|
|
3531
|
+
const i0 = (R) => {
|
|
3532
|
+
i.value = !0, r.value = R, R === "剖面视图" && !p.value && I();
|
|
3510
3533
|
};
|
|
3511
|
-
let
|
|
3512
|
-
return
|
|
3513
|
-
await
|
|
3534
|
+
let Le = null;
|
|
3535
|
+
return Ya(async () => {
|
|
3536
|
+
await Ja();
|
|
3514
3537
|
try {
|
|
3515
|
-
|
|
3538
|
+
Ve(), H.value && (Le = new ResizeObserver(n0), Le.observe(H.value)), er && (window.__threePreview__ = {
|
|
3516
3539
|
threeInfo: t,
|
|
3517
|
-
currentModels:
|
|
3540
|
+
currentModels: Y,
|
|
3518
3541
|
loadedModels: s,
|
|
3519
|
-
getThreeJSObjects:
|
|
3542
|
+
getThreeJSObjects: K,
|
|
3520
3543
|
billetAnimation: y,
|
|
3521
3544
|
chainAnimation: M,
|
|
3522
|
-
isBeforeRenderPaused:
|
|
3523
|
-
setBeforeRenderPaused:
|
|
3545
|
+
isBeforeRenderPaused: oe,
|
|
3546
|
+
setBeforeRenderPaused: X,
|
|
3524
3547
|
// 调试函数
|
|
3525
3548
|
_logRollDetails: (R, U) => {
|
|
3526
|
-
var
|
|
3549
|
+
var fe;
|
|
3527
3550
|
if (U) {
|
|
3528
|
-
const
|
|
3529
|
-
|
|
3551
|
+
const C = new j(), V = new ee(), re = new j(), b0 = new j(), k0 = new I0().setFromObject(U);
|
|
3552
|
+
k0.getCenter(re), k0.getSize(b0), U.getWorldPosition(C), U.getWorldQuaternion(V), console.log(`[DEBUG] ${R}:`, {
|
|
3530
3553
|
name: U.name,
|
|
3531
|
-
parent: ((
|
|
3532
|
-
worldPos:
|
|
3533
|
-
bboxCenter:
|
|
3534
|
-
bboxSize:
|
|
3535
|
-
worldQuat:
|
|
3536
|
-
posVsBboxCenter: { dx:
|
|
3554
|
+
parent: ((fe = U.parent) == null ? void 0 : fe.name) ?? "null",
|
|
3555
|
+
worldPos: C,
|
|
3556
|
+
bboxCenter: re,
|
|
3557
|
+
bboxSize: b0,
|
|
3558
|
+
worldQuat: V,
|
|
3559
|
+
posVsBboxCenter: { dx: C.x - re.x, dy: C.y - re.y, dz: C.z - re.z }
|
|
3537
3560
|
});
|
|
3538
3561
|
}
|
|
3539
3562
|
},
|
|
3540
3563
|
// 快速打印所有轧辊状态
|
|
3541
3564
|
_printAllRollStates: () => {
|
|
3542
|
-
const { scene: R } =
|
|
3565
|
+
const { scene: R } = K();
|
|
3543
3566
|
if (!R) return;
|
|
3544
3567
|
const U = ["轧辊整体-1001", "下轧辊-1001", "轧辊整体-1", "下轧辊-1"];
|
|
3545
|
-
for (const
|
|
3546
|
-
let
|
|
3547
|
-
for (const
|
|
3548
|
-
if (!
|
|
3549
|
-
const
|
|
3550
|
-
if (
|
|
3551
|
-
|
|
3568
|
+
for (const fe of U) {
|
|
3569
|
+
let C = null;
|
|
3570
|
+
for (const V of Y.value) {
|
|
3571
|
+
if (!V) continue;
|
|
3572
|
+
const re = V.getObjectByName(fe);
|
|
3573
|
+
if (re) {
|
|
3574
|
+
C = re;
|
|
3552
3575
|
break;
|
|
3553
3576
|
}
|
|
3554
3577
|
}
|
|
3555
|
-
if (!
|
|
3556
|
-
const
|
|
3557
|
-
|
|
3578
|
+
if (!C) {
|
|
3579
|
+
const V = R.getObjectByName(fe);
|
|
3580
|
+
V && (C = V);
|
|
3558
3581
|
}
|
|
3559
|
-
if (
|
|
3560
|
-
const
|
|
3561
|
-
|
|
3582
|
+
if (C) {
|
|
3583
|
+
const V = new j(), re = new ee();
|
|
3584
|
+
C.getWorldPosition(V), C.getWorldQuaternion(re), console.log(`[ROLL] ${fe}: pos=${V.x.toFixed(2)}, ${V.y.toFixed(2)}, ${V.z.toFixed(2)} | w=${re.w.toFixed(4)}`);
|
|
3562
3585
|
}
|
|
3563
3586
|
}
|
|
3564
3587
|
}
|
|
3565
|
-
}),
|
|
3588
|
+
}), ie(), console.log("[SELECT] 常驻部件选择已开启,点击模型显示部件信息");
|
|
3566
3589
|
} catch (R) {
|
|
3567
|
-
console.error("Three.js 初始化失败:", R),
|
|
3590
|
+
console.error("Three.js 初始化失败:", R), Ua.error("渲染引擎初始化失败!");
|
|
3568
3591
|
}
|
|
3569
|
-
}),
|
|
3570
|
-
|
|
3592
|
+
}), za(() => {
|
|
3593
|
+
r.value = "", Le && Le.disconnect(), be(), m.value && w(), q.value && ke(), y.dispose(), M.dispose(), d0();
|
|
3571
3594
|
}), (R, U) => {
|
|
3572
|
-
const
|
|
3573
|
-
return
|
|
3595
|
+
const fe = p2("el-scrollbar");
|
|
3596
|
+
return Ce(), j0("div", zb, [
|
|
3574
3597
|
se("div", {
|
|
3575
3598
|
ref_key: "threejsContainer",
|
|
3576
3599
|
ref: H,
|
|
3577
3600
|
class: "threejs-container"
|
|
3578
3601
|
}, null, 512),
|
|
3579
|
-
|
|
3580
|
-
Ie(
|
|
3602
|
+
Ta(se("div", Qb, [
|
|
3603
|
+
Ie(e0, {
|
|
3581
3604
|
name: "viewReset",
|
|
3582
3605
|
size: "24",
|
|
3583
|
-
onClick:
|
|
3606
|
+
onClick: Re(Ee),
|
|
3584
3607
|
title: "重置"
|
|
3585
3608
|
}, null, 8, ["onClick"]),
|
|
3586
|
-
Ie(
|
|
3609
|
+
Ie(e0, {
|
|
3587
3610
|
name: "fangda",
|
|
3588
3611
|
size: "24",
|
|
3589
3612
|
title: "放大"
|
|
3590
3613
|
}),
|
|
3591
|
-
Ie(
|
|
3614
|
+
Ie(e0, {
|
|
3592
3615
|
name: "suoxiao",
|
|
3593
3616
|
size: "24",
|
|
3594
3617
|
title: "缩小"
|
|
3595
3618
|
}),
|
|
3596
|
-
Ie(
|
|
3619
|
+
Ie(e0, {
|
|
3597
3620
|
name: "lookAround",
|
|
3598
3621
|
size: "24",
|
|
3599
|
-
onClick:
|
|
3600
|
-
title:
|
|
3622
|
+
onClick: Re(_),
|
|
3623
|
+
title: Re(m) ? "停止动画" : "动画视图"
|
|
3601
3624
|
}, null, 8, ["onClick", "title"]),
|
|
3602
|
-
Ie(
|
|
3625
|
+
Ie(e0, {
|
|
3603
3626
|
name: "zuobiaoxi",
|
|
3604
3627
|
size: "24",
|
|
3605
|
-
active:
|
|
3606
|
-
onClick:
|
|
3628
|
+
active: Re(J),
|
|
3629
|
+
onClick: pe,
|
|
3607
3630
|
title: "显隐坐标轴"
|
|
3608
3631
|
}, null, 8, ["active"])
|
|
3609
3632
|
], 512), [
|
|
3610
|
-
[
|
|
3633
|
+
[Ra, !1]
|
|
3611
3634
|
]),
|
|
3612
3635
|
se("div", Zb, [
|
|
3613
|
-
|
|
3614
|
-
Ie(
|
|
3636
|
+
Ma(R.$slots, "button-left", { switchRightPanel: i0 }, void 0, !0),
|
|
3637
|
+
Ie(e0, {
|
|
3615
3638
|
name: "clipping",
|
|
3616
3639
|
size: "24",
|
|
3617
|
-
onClick: U[0] || (U[0] = (
|
|
3618
|
-
active: i.value &&
|
|
3640
|
+
onClick: U[0] || (U[0] = (C) => i0("剖面视图")),
|
|
3641
|
+
active: i.value && r.value === "剖面视图",
|
|
3619
3642
|
title: "剖面视图"
|
|
3620
3643
|
}, null, 8, ["active"])
|
|
3621
3644
|
]),
|
|
3622
3645
|
se("div", Jb, [
|
|
3623
|
-
|
|
3646
|
+
Ma(R.$slots, "button-right", {}, void 0, !0)
|
|
3624
3647
|
]),
|
|
3625
3648
|
se("div", Yb, [
|
|
3626
|
-
(
|
|
3649
|
+
(Ce(), x0(e0, {
|
|
3627
3650
|
key: 0,
|
|
3628
3651
|
name: "zanting",
|
|
3629
3652
|
size: "24",
|
|
3630
3653
|
backgroundColor: "#ffffff",
|
|
3631
|
-
title:
|
|
3632
|
-
onClick:
|
|
3654
|
+
title: Re(oe) ? "恢复动画" : "暂停动画",
|
|
3655
|
+
onClick: le
|
|
3633
3656
|
}, null, 8, ["title"]))
|
|
3634
3657
|
]),
|
|
3635
|
-
|
|
3658
|
+
Ta(se("div", Kb, [
|
|
3636
3659
|
se("div", Xb, [
|
|
3637
|
-
se("span", null,
|
|
3660
|
+
se("span", null, ea(r.value), 1),
|
|
3638
3661
|
se("span", {
|
|
3639
3662
|
class: "close",
|
|
3640
|
-
onClick: U[1] || (U[1] = (
|
|
3663
|
+
onClick: U[1] || (U[1] = (C) => i.value = !1)
|
|
3641
3664
|
}, " X ")
|
|
3642
3665
|
]),
|
|
3643
|
-
Ie(
|
|
3666
|
+
Ie(fe, { "max-height": "650px" }, {
|
|
3644
3667
|
default: m2(() => [
|
|
3645
|
-
|
|
3668
|
+
r.value === "剖面视图" ? (Ce(), x0(si, {
|
|
3646
3669
|
key: 0,
|
|
3647
|
-
value:
|
|
3648
|
-
onChange:
|
|
3649
|
-
}, null, 8, ["value"])) :
|
|
3670
|
+
value: Re(A),
|
|
3671
|
+
onChange: we
|
|
3672
|
+
}, null, 8, ["value"])) : $0("", !0)
|
|
3650
3673
|
]),
|
|
3651
3674
|
_: 1
|
|
3652
3675
|
})
|
|
3653
3676
|
], 512), [
|
|
3654
|
-
[
|
|
3677
|
+
[Ra, i.value]
|
|
3655
3678
|
]),
|
|
3656
|
-
|
|
3679
|
+
Re(o) ? (Ce(), j0("div", $b, [
|
|
3657
3680
|
U[3] || (U[3] = se("div", { class: "loading-spinner" }, null, -1)),
|
|
3658
|
-
se("p", null,
|
|
3659
|
-
])) :
|
|
3681
|
+
se("p", null, ea(Re(d)), 1)
|
|
3682
|
+
])) : $0("", !0),
|
|
3660
3683
|
Ie(Pb, {
|
|
3661
|
-
modelValue:
|
|
3662
|
-
"onUpdate:modelValue": U[2] || (U[2] = (
|
|
3663
|
-
"part-info":
|
|
3664
|
-
"screen-position":
|
|
3684
|
+
modelValue: Re(P),
|
|
3685
|
+
"onUpdate:modelValue": U[2] || (U[2] = (C) => j2(P) ? P.value = C : null),
|
|
3686
|
+
"part-info": Re(u),
|
|
3687
|
+
"screen-position": Re(S)
|
|
3665
3688
|
}, null, 8, ["modelValue", "part-info", "screen-position"]),
|
|
3666
|
-
Ie(Sb, { meshName:
|
|
3689
|
+
Ie(Sb, { meshName: ce.value }, null, 8, ["meshName"])
|
|
3667
3690
|
]);
|
|
3668
3691
|
};
|
|
3669
3692
|
}
|
|
3670
|
-
}), ir = /* @__PURE__ */
|
|
3693
|
+
}), ir = /* @__PURE__ */ na(ar, [["__scopeId", "data-v-964c6daa"]]), or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3671
3694
|
__proto__: null,
|
|
3672
3695
|
default: ir
|
|
3673
3696
|
}, Symbol.toStringTag, { value: "Module" }));
|