ss-component-new 1.3.811 → 1.3.813
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/{MTLLoader-Cr05Jq1r.js → MTLLoader-Cw11TWAL.js} +1 -1
- package/dist/{URDFLoader-BPUcMfaA.js → URDFLoader-DUzCZjnV.js} +2 -2
- package/dist/{animationData-BtDIT0yo.js → animationData-DwQetFQD.js} +11 -11
- package/dist/{array-CZ2eqPog.js → array-COidmpRY.js} +178 -178
- package/dist/{iconfont-CHWuGARa.js → iconfont-Ij2RVNFj.js} +1 -1
- package/dist/{index-BcHJqN_9.js → index-B4kaaRbF.js} +676 -676
- package/dist/{index-zu35Umcp.js → index-B7P0-Odj.js} +2 -2
- package/dist/{index-CfXO0Pxj.js → index-CCZspl83.js} +1 -1
- package/dist/{index-CdJWKd-e.js → index-CXY_sgN_.js} +4 -4
- package/dist/{index-CegJQbrk.js → index-CaLfl7ix.js} +1 -1
- package/dist/{index-0tYJ8yEe.js → index-CcBUPD0v.js} +3 -3
- package/dist/{index-CoZLxa8y.js → index-Cd11-eam.js} +7184 -7191
- package/dist/{index-qX9L_pmZ.js → index-Cv6rlCAH.js} +25178 -25153
- package/dist/{index-CH3rwMYW.js → index-D8-0gsl7.js} +4 -4
- package/dist/{index-Uu1cC9bk.js → index-DQryAYzQ.js} +1 -1
- package/dist/{index-BqMPhGJ9.js → index-DqizREJ2.js} +1 -1
- package/dist/{index-CjUeCJj8.js → index-Dsce3BX1.js} +3 -3
- package/dist/{index-B1Cs8tWO.js → index-KEw10uzh.js} +1 -1
- package/dist/{index-eCFjxwNX.js → index-ZhT8hVC2.js} +1 -1
- package/dist/{index-DVGwSP8U.js → index-dh1Gi7jC.js} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_05e3a1d8_lang-D8tI8Ecr.js → index.vue_vue_type_style_index_0_scoped_05e3a1d8_lang-DFJL-r6K.js} +30 -30
- package/dist/{main-BEjDbBqE.js → main-fNwMqnvv.js} +2 -2
- package/dist/obj/model.mtl +42 -0
- package/dist/obj/model.obj +26110 -0
- package/dist/ss-component.css +2 -2
- package/dist/ss-component.js +8 -8
- package/dist/ss-component2.js +8 -8
- package/dist/{threeModel-B0w9UbIY.js → threeModel-BeCT-wuA.js} +49 -49
- package/dist/{threePreview-SOk-xO1D.js → threePreview-BnPPysvl.js} +1103 -1258
- package/dist/{threeSceneView-BJFsvwVj.js → threeSceneView-C_KAY9V1.js} +69 -71
- package/dist/{threeSceneViewForCPMPIP-FVUwqe08.js → threeSceneViewForCPMPIP-uac2fzAK.js} +7 -7
- package/dist/{threeTrackPathView-Bj3hHKs6.js → threeTrackPathView-Ugj5_KnE.js} +84 -84
- package/dist/{threeViewerHost-f9uhJUs0.js → threeViewerHost-Dv0JTTnu.js} +2 -2
- package/dist/{urdfTree-DvLm61lR.js → urdfTree-CLtWTrD6.js} +1 -1
- package/dist/{workpieceTreePanel-cpqQoDnb.js → workpieceTreePanel-Ch75Cqlr.js} +12 -12
- package/package.json +1 -1
- package/public/obj/model.mtl +42 -0
- package/public/obj/model.obj +26110 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { ah as
|
|
1
|
+
import { ref as c0, shallowRef as H2, watch as O0, onBeforeUnmount as Pe, defineComponent as Be, computed as Y0, createBlock as be, openBlock as D0, Teleport as c2, createElementBlock as ie, createCommentVNode as re, withModifiers as f2, normalizeStyle as t2, createElementVNode as e0, toDisplayString as He, createVNode as h0, onMounted as n2, nextTick as d2, resolveComponent as o2, withDirectives as s2, unref as n0, renderSlot as Ie, withCtx as k2, vShow as l2, isRef as u2 } from "vue";
|
|
2
|
+
import { ah as h2, ai as ce, aj as qe, R as Ve, ak as q0, U as Q0, al as u0, am as ue, C as k0, an as l0, c as A0, ao as g2, j as _2, D as A2, n as J0, V as y, ap as p2, aq as d0, ar as m2, as as We, at as j2, au as I2, a1 as V0, av as y2, aw as Ce, ax as w2, ay as F2, az as v2, aA as fe, aB as Le, aC as te, aD as N2, aE as T2, _ as R2, aF as K0, a2 as M2, t as Se, l as D2, aG as B0, aH as O2, u as ze, aI as E2, h as Ze, aJ as G2, w as U2, aK as x2, $ as P2, s as Z0, P as B2, o as q2, aL as V2, aM as W2, aN as C2, aO as L2, aP as S2, aQ as Qe, aR as z2, aS as ye, aT as we, aU as Fe, aV as ve, aW as ne, a4 as Z2, aX as Q2, B as W0, aY as J2, k as Y2, aZ as K2 } from "./index.vue_vue_type_style_index_0_scoped_05e3a1d8_lang-DFJL-r6K.js";
|
|
3
3
|
import "./index-DkDX7FWy.js";
|
|
4
|
-
import { u as
|
|
5
|
-
import { M as
|
|
6
|
-
import { a as
|
|
7
|
-
import { _ as
|
|
8
|
-
import { E as
|
|
9
|
-
function
|
|
10
|
-
if (e ===
|
|
4
|
+
import { u as X2, a as $2, b as ea, T as v0, C as aa } from "./iconfont-Ij2RVNFj.js";
|
|
5
|
+
import { M as ba, O as ia, S as ra } from "./MTLLoader-Cw11TWAL.js";
|
|
6
|
+
import { a as Ha } from "./index-B4kaaRbF.js";
|
|
7
|
+
import { _ as Je } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
|
+
import { E as Ne } from "./request-DzUsnuWu.js";
|
|
9
|
+
function Te(n, e) {
|
|
10
|
+
if (e === h2)
|
|
11
11
|
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), n;
|
|
12
|
-
if (e ===
|
|
12
|
+
if (e === ce || e === qe) {
|
|
13
13
|
let a = n.getIndex();
|
|
14
14
|
if (a === null) {
|
|
15
15
|
const r = [], f = n.getAttribute("position");
|
|
@@ -21,7 +21,7 @@ function O2(n, e) {
|
|
|
21
21
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), n;
|
|
22
22
|
}
|
|
23
23
|
const H = a.count - 2, b = [];
|
|
24
|
-
if (e ===
|
|
24
|
+
if (e === ce)
|
|
25
25
|
for (let r = 1; r <= H; r++)
|
|
26
26
|
b.push(a.getX(0)), b.push(a.getX(r)), b.push(a.getX(r + 1));
|
|
27
27
|
else
|
|
@@ -33,7 +33,7 @@ function O2(n, e) {
|
|
|
33
33
|
} else
|
|
34
34
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e), n;
|
|
35
35
|
}
|
|
36
|
-
class
|
|
36
|
+
class ca extends Ve {
|
|
37
37
|
/**
|
|
38
38
|
* Constructs a new glTF loader.
|
|
39
39
|
*
|
|
@@ -41,39 +41,39 @@ class nb extends L2 {
|
|
|
41
41
|
*/
|
|
42
42
|
constructor(e) {
|
|
43
43
|
super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(a) {
|
|
44
|
-
return new
|
|
44
|
+
return new oa(a);
|
|
45
45
|
}), this.register(function(a) {
|
|
46
|
-
return new
|
|
46
|
+
return new sa(a);
|
|
47
47
|
}), this.register(function(a) {
|
|
48
|
-
return new
|
|
48
|
+
return new ma(a);
|
|
49
49
|
}), this.register(function(a) {
|
|
50
|
-
return new
|
|
50
|
+
return new ja(a);
|
|
51
51
|
}), this.register(function(a) {
|
|
52
|
-
return new
|
|
52
|
+
return new Ia(a);
|
|
53
53
|
}), this.register(function(a) {
|
|
54
|
-
return new
|
|
54
|
+
return new la(a);
|
|
55
55
|
}), this.register(function(a) {
|
|
56
|
-
return new
|
|
56
|
+
return new ua(a);
|
|
57
57
|
}), this.register(function(a) {
|
|
58
|
-
return new
|
|
58
|
+
return new ha(a);
|
|
59
59
|
}), this.register(function(a) {
|
|
60
|
-
return new
|
|
60
|
+
return new ga(a);
|
|
61
61
|
}), this.register(function(a) {
|
|
62
|
-
return new
|
|
62
|
+
return new da(a);
|
|
63
63
|
}), this.register(function(a) {
|
|
64
|
-
return new
|
|
64
|
+
return new _a(a);
|
|
65
65
|
}), this.register(function(a) {
|
|
66
|
-
return new
|
|
66
|
+
return new ka(a);
|
|
67
67
|
}), this.register(function(a) {
|
|
68
|
-
return new
|
|
68
|
+
return new pa(a);
|
|
69
69
|
}), this.register(function(a) {
|
|
70
|
-
return new
|
|
70
|
+
return new Aa(a);
|
|
71
71
|
}), this.register(function(a) {
|
|
72
|
-
return new
|
|
72
|
+
return new ta(a);
|
|
73
73
|
}), this.register(function(a) {
|
|
74
|
-
return new
|
|
74
|
+
return new ya(a);
|
|
75
75
|
}), this.register(function(a) {
|
|
76
|
-
return new
|
|
76
|
+
return new wa(a);
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
@@ -91,14 +91,14 @@ class nb extends L2 {
|
|
|
91
91
|
if (this.resourcePath !== "")
|
|
92
92
|
r = this.resourcePath;
|
|
93
93
|
else if (this.path !== "") {
|
|
94
|
-
const t =
|
|
95
|
-
r =
|
|
94
|
+
const t = q0.extractUrlBase(e);
|
|
95
|
+
r = q0.resolveURL(t, this.path);
|
|
96
96
|
} else
|
|
97
|
-
r =
|
|
97
|
+
r = q0.extractUrlBase(e);
|
|
98
98
|
this.manager.itemStart(e);
|
|
99
99
|
const f = function(t) {
|
|
100
100
|
b ? b(t) : console.error(t), i.manager.itemError(e), i.manager.itemEnd(e);
|
|
101
|
-
}, c = new
|
|
101
|
+
}, c = new Q0(this.manager);
|
|
102
102
|
c.setPath(this.path), c.setResponseType("arraybuffer"), c.setRequestHeader(this.requestHeader), c.setWithCredentials(this.withCredentials), c.load(e, function(t) {
|
|
103
103
|
try {
|
|
104
104
|
i.parse(t, r, function(d) {
|
|
@@ -173,14 +173,14 @@ class nb extends L2 {
|
|
|
173
173
|
if (typeof e == "string")
|
|
174
174
|
i = JSON.parse(e);
|
|
175
175
|
else if (e instanceof ArrayBuffer)
|
|
176
|
-
if (c.decode(new Uint8Array(e, 0, 4)) ===
|
|
176
|
+
if (c.decode(new Uint8Array(e, 0, 4)) === Ye) {
|
|
177
177
|
try {
|
|
178
|
-
r[
|
|
178
|
+
r[D.KHR_BINARY_GLTF] = new Fa(e);
|
|
179
179
|
} catch (o) {
|
|
180
180
|
b && b(o);
|
|
181
181
|
return;
|
|
182
182
|
}
|
|
183
|
-
i = JSON.parse(r[
|
|
183
|
+
i = JSON.parse(r[D.KHR_BINARY_GLTF].content);
|
|
184
184
|
} else
|
|
185
185
|
i = JSON.parse(c.decode(e));
|
|
186
186
|
else
|
|
@@ -189,7 +189,7 @@ class nb extends L2 {
|
|
|
189
189
|
b && b(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
|
-
const t = new
|
|
192
|
+
const t = new Ba(i, {
|
|
193
193
|
path: a || this.resourcePath || "",
|
|
194
194
|
crossOrigin: this.crossOrigin,
|
|
195
195
|
requestHeader: this.requestHeader,
|
|
@@ -206,17 +206,17 @@ class nb extends L2 {
|
|
|
206
206
|
for (let d = 0; d < i.extensionsUsed.length; ++d) {
|
|
207
207
|
const o = i.extensionsUsed[d], s = i.extensionsRequired || [];
|
|
208
208
|
switch (o) {
|
|
209
|
-
case
|
|
210
|
-
r[o] = new
|
|
209
|
+
case D.KHR_MATERIALS_UNLIT:
|
|
210
|
+
r[o] = new na();
|
|
211
211
|
break;
|
|
212
|
-
case
|
|
213
|
-
r[o] = new
|
|
212
|
+
case D.KHR_DRACO_MESH_COMPRESSION:
|
|
213
|
+
r[o] = new va(i, this.dracoLoader);
|
|
214
214
|
break;
|
|
215
|
-
case
|
|
216
|
-
r[o] = new
|
|
215
|
+
case D.KHR_TEXTURE_TRANSFORM:
|
|
216
|
+
r[o] = new Na();
|
|
217
217
|
break;
|
|
218
|
-
case
|
|
219
|
-
r[o] = new
|
|
218
|
+
case D.KHR_MESH_QUANTIZATION:
|
|
219
|
+
r[o] = new Ta();
|
|
220
220
|
break;
|
|
221
221
|
default:
|
|
222
222
|
s.indexOf(o) >= 0 && f[o] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + o + '".');
|
|
@@ -239,7 +239,7 @@ class nb extends L2 {
|
|
|
239
239
|
});
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function fa() {
|
|
243
243
|
let n = {};
|
|
244
244
|
return {
|
|
245
245
|
get: function(e) {
|
|
@@ -256,7 +256,7 @@ function db() {
|
|
|
256
256
|
}
|
|
257
257
|
};
|
|
258
258
|
}
|
|
259
|
-
const
|
|
259
|
+
const D = {
|
|
260
260
|
KHR_BINARY_GLTF: "KHR_binary_glTF",
|
|
261
261
|
KHR_DRACO_MESH_COMPRESSION: "KHR_draco_mesh_compression",
|
|
262
262
|
KHR_LIGHTS_PUNCTUAL: "KHR_lights_punctual",
|
|
@@ -280,9 +280,9 @@ const x = {
|
|
|
280
280
|
EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression",
|
|
281
281
|
EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
|
|
282
282
|
};
|
|
283
|
-
class
|
|
283
|
+
class ta {
|
|
284
284
|
constructor(e) {
|
|
285
|
-
this.parser = e, this.name =
|
|
285
|
+
this.parser = e, this.name = D.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
|
|
286
286
|
}
|
|
287
287
|
_markDefs() {
|
|
288
288
|
const e = this.parser, a = this.parser.json.nodes || [];
|
|
@@ -297,23 +297,23 @@ class ob {
|
|
|
297
297
|
if (b) return b;
|
|
298
298
|
const i = a.json, c = ((i.extensions && i.extensions[this.name] || {}).lights || [])[e];
|
|
299
299
|
let t;
|
|
300
|
-
const d = new
|
|
301
|
-
c.color !== void 0 && d.setRGB(c.color[0], c.color[1], c.color[2],
|
|
300
|
+
const d = new k0(16777215);
|
|
301
|
+
c.color !== void 0 && d.setRGB(c.color[0], c.color[1], c.color[2], l0);
|
|
302
302
|
const o = c.range !== void 0 ? c.range : 0;
|
|
303
303
|
switch (c.type) {
|
|
304
304
|
case "directional":
|
|
305
|
-
t = new
|
|
305
|
+
t = new A2(d), t.target.position.set(0, 0, -1), t.add(t.target);
|
|
306
306
|
break;
|
|
307
307
|
case "point":
|
|
308
|
-
t = new
|
|
308
|
+
t = new _2(d), t.distance = o;
|
|
309
309
|
break;
|
|
310
310
|
case "spot":
|
|
311
|
-
t = new
|
|
311
|
+
t = new g2(d), t.distance = o, c.spot = c.spot || {}, c.spot.innerConeAngle = c.spot.innerConeAngle !== void 0 ? c.spot.innerConeAngle : 0, c.spot.outerConeAngle = c.spot.outerConeAngle !== void 0 ? c.spot.outerConeAngle : Math.PI / 4, t.angle = c.spot.outerConeAngle, t.penumbra = 1 - c.spot.innerConeAngle / c.spot.outerConeAngle, t.target.position.set(0, 0, -1), t.add(t.target);
|
|
312
312
|
break;
|
|
313
313
|
default:
|
|
314
314
|
throw new Error("THREE.GLTFLoader: Unexpected light type: " + c.type);
|
|
315
315
|
}
|
|
316
|
-
return t.position.set(0, 0, 0),
|
|
316
|
+
return t.position.set(0, 0, 0), g0(t, c), c.intensity !== void 0 && (t.intensity = c.intensity), t.name = a.createUniqueName(c.name || "light_" + e), b = Promise.resolve(t), a.cache.add(H, b), b;
|
|
317
317
|
}
|
|
318
318
|
getDependency(e, a) {
|
|
319
319
|
if (e === "light")
|
|
@@ -326,30 +326,30 @@ class ob {
|
|
|
326
326
|
});
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
|
-
class
|
|
329
|
+
class na {
|
|
330
330
|
constructor() {
|
|
331
|
-
this.name =
|
|
331
|
+
this.name = D.KHR_MATERIALS_UNLIT;
|
|
332
332
|
}
|
|
333
333
|
getMaterialType() {
|
|
334
|
-
return
|
|
334
|
+
return B0;
|
|
335
335
|
}
|
|
336
336
|
extendParams(e, a, H) {
|
|
337
337
|
const b = [];
|
|
338
|
-
e.color = new
|
|
338
|
+
e.color = new k0(1, 1, 1), e.opacity = 1;
|
|
339
339
|
const i = a.pbrMetallicRoughness;
|
|
340
340
|
if (i) {
|
|
341
341
|
if (Array.isArray(i.baseColorFactor)) {
|
|
342
342
|
const r = i.baseColorFactor;
|
|
343
|
-
e.color.setRGB(r[0], r[1], r[2],
|
|
343
|
+
e.color.setRGB(r[0], r[1], r[2], l0), e.opacity = r[3];
|
|
344
344
|
}
|
|
345
|
-
i.baseColorTexture !== void 0 && b.push(H.assignTexture(e, "map", i.baseColorTexture,
|
|
345
|
+
i.baseColorTexture !== void 0 && b.push(H.assignTexture(e, "map", i.baseColorTexture, A0));
|
|
346
346
|
}
|
|
347
347
|
return Promise.all(b);
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
-
class
|
|
350
|
+
class da {
|
|
351
351
|
constructor(e) {
|
|
352
|
-
this.parser = e, this.name =
|
|
352
|
+
this.parser = e, this.name = D.KHR_MATERIALS_EMISSIVE_STRENGTH;
|
|
353
353
|
}
|
|
354
354
|
extendMaterialParams(e, a) {
|
|
355
355
|
const b = this.parser.json.materials[e];
|
|
@@ -359,13 +359,13 @@ class kb {
|
|
|
359
359
|
return i !== void 0 && (a.emissiveIntensity = i), Promise.resolve();
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
class
|
|
362
|
+
class oa {
|
|
363
363
|
constructor(e) {
|
|
364
|
-
this.parser = e, this.name =
|
|
364
|
+
this.parser = e, this.name = D.KHR_MATERIALS_CLEARCOAT;
|
|
365
365
|
}
|
|
366
366
|
getMaterialType(e) {
|
|
367
367
|
const H = this.parser.json.materials[e];
|
|
368
|
-
return !H.extensions || !H.extensions[this.name] ? null :
|
|
368
|
+
return !H.extensions || !H.extensions[this.name] ? null : u0;
|
|
369
369
|
}
|
|
370
370
|
extendMaterialParams(e, a) {
|
|
371
371
|
const H = this.parser, b = H.json.materials[e];
|
|
@@ -374,18 +374,18 @@ class lb {
|
|
|
374
374
|
const i = [], r = b.extensions[this.name];
|
|
375
375
|
if (r.clearcoatFactor !== void 0 && (a.clearcoat = r.clearcoatFactor), r.clearcoatTexture !== void 0 && i.push(H.assignTexture(a, "clearcoatMap", r.clearcoatTexture)), r.clearcoatRoughnessFactor !== void 0 && (a.clearcoatRoughness = r.clearcoatRoughnessFactor), r.clearcoatRoughnessTexture !== void 0 && i.push(H.assignTexture(a, "clearcoatRoughnessMap", r.clearcoatRoughnessTexture)), r.clearcoatNormalTexture !== void 0 && (i.push(H.assignTexture(a, "clearcoatNormalMap", r.clearcoatNormalTexture)), r.clearcoatNormalTexture.scale !== void 0)) {
|
|
376
376
|
const f = r.clearcoatNormalTexture.scale;
|
|
377
|
-
a.clearcoatNormalScale = new
|
|
377
|
+
a.clearcoatNormalScale = new ue(f, f);
|
|
378
378
|
}
|
|
379
379
|
return Promise.all(i);
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
|
-
class
|
|
382
|
+
class sa {
|
|
383
383
|
constructor(e) {
|
|
384
|
-
this.parser = e, this.name =
|
|
384
|
+
this.parser = e, this.name = D.KHR_MATERIALS_DISPERSION;
|
|
385
385
|
}
|
|
386
386
|
getMaterialType(e) {
|
|
387
387
|
const H = this.parser.json.materials[e];
|
|
388
|
-
return !H.extensions || !H.extensions[this.name] ? null :
|
|
388
|
+
return !H.extensions || !H.extensions[this.name] ? null : u0;
|
|
389
389
|
}
|
|
390
390
|
extendMaterialParams(e, a) {
|
|
391
391
|
const b = this.parser.json.materials[e];
|
|
@@ -395,13 +395,13 @@ class ub {
|
|
|
395
395
|
return a.dispersion = i.dispersion !== void 0 ? i.dispersion : 0, Promise.resolve();
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
|
-
class
|
|
398
|
+
class ka {
|
|
399
399
|
constructor(e) {
|
|
400
|
-
this.parser = e, this.name =
|
|
400
|
+
this.parser = e, this.name = D.KHR_MATERIALS_IRIDESCENCE;
|
|
401
401
|
}
|
|
402
402
|
getMaterialType(e) {
|
|
403
403
|
const H = this.parser.json.materials[e];
|
|
404
|
-
return !H.extensions || !H.extensions[this.name] ? null :
|
|
404
|
+
return !H.extensions || !H.extensions[this.name] ? null : u0;
|
|
405
405
|
}
|
|
406
406
|
extendMaterialParams(e, a) {
|
|
407
407
|
const H = this.parser, b = H.json.materials[e];
|
|
@@ -411,35 +411,35 @@ class hb {
|
|
|
411
411
|
return r.iridescenceFactor !== void 0 && (a.iridescence = r.iridescenceFactor), r.iridescenceTexture !== void 0 && i.push(H.assignTexture(a, "iridescenceMap", r.iridescenceTexture)), r.iridescenceIor !== void 0 && (a.iridescenceIOR = r.iridescenceIor), a.iridescenceThicknessRange === void 0 && (a.iridescenceThicknessRange = [100, 400]), r.iridescenceThicknessMinimum !== void 0 && (a.iridescenceThicknessRange[0] = r.iridescenceThicknessMinimum), r.iridescenceThicknessMaximum !== void 0 && (a.iridescenceThicknessRange[1] = r.iridescenceThicknessMaximum), r.iridescenceThicknessTexture !== void 0 && i.push(H.assignTexture(a, "iridescenceThicknessMap", r.iridescenceThicknessTexture)), Promise.all(i);
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
class
|
|
414
|
+
class la {
|
|
415
415
|
constructor(e) {
|
|
416
|
-
this.parser = e, this.name =
|
|
416
|
+
this.parser = e, this.name = D.KHR_MATERIALS_SHEEN;
|
|
417
417
|
}
|
|
418
418
|
getMaterialType(e) {
|
|
419
419
|
const H = this.parser.json.materials[e];
|
|
420
|
-
return !H.extensions || !H.extensions[this.name] ? null :
|
|
420
|
+
return !H.extensions || !H.extensions[this.name] ? null : u0;
|
|
421
421
|
}
|
|
422
422
|
extendMaterialParams(e, a) {
|
|
423
423
|
const H = this.parser, b = H.json.materials[e];
|
|
424
424
|
if (!b.extensions || !b.extensions[this.name])
|
|
425
425
|
return Promise.resolve();
|
|
426
426
|
const i = [];
|
|
427
|
-
a.sheenColor = new
|
|
427
|
+
a.sheenColor = new k0(0, 0, 0), a.sheenRoughness = 0, a.sheen = 1;
|
|
428
428
|
const r = b.extensions[this.name];
|
|
429
429
|
if (r.sheenColorFactor !== void 0) {
|
|
430
430
|
const f = r.sheenColorFactor;
|
|
431
|
-
a.sheenColor.setRGB(f[0], f[1], f[2],
|
|
431
|
+
a.sheenColor.setRGB(f[0], f[1], f[2], l0);
|
|
432
432
|
}
|
|
433
|
-
return r.sheenRoughnessFactor !== void 0 && (a.sheenRoughness = r.sheenRoughnessFactor), r.sheenColorTexture !== void 0 && i.push(H.assignTexture(a, "sheenColorMap", r.sheenColorTexture,
|
|
433
|
+
return r.sheenRoughnessFactor !== void 0 && (a.sheenRoughness = r.sheenRoughnessFactor), r.sheenColorTexture !== void 0 && i.push(H.assignTexture(a, "sheenColorMap", r.sheenColorTexture, A0)), r.sheenRoughnessTexture !== void 0 && i.push(H.assignTexture(a, "sheenRoughnessMap", r.sheenRoughnessTexture)), Promise.all(i);
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
class
|
|
436
|
+
class ua {
|
|
437
437
|
constructor(e) {
|
|
438
|
-
this.parser = e, this.name =
|
|
438
|
+
this.parser = e, this.name = D.KHR_MATERIALS_TRANSMISSION;
|
|
439
439
|
}
|
|
440
440
|
getMaterialType(e) {
|
|
441
441
|
const H = this.parser.json.materials[e];
|
|
442
|
-
return !H.extensions || !H.extensions[this.name] ? null :
|
|
442
|
+
return !H.extensions || !H.extensions[this.name] ? null : u0;
|
|
443
443
|
}
|
|
444
444
|
extendMaterialParams(e, a) {
|
|
445
445
|
const H = this.parser, b = H.json.materials[e];
|
|
@@ -449,13 +449,13 @@ class _b {
|
|
|
449
449
|
return r.transmissionFactor !== void 0 && (a.transmission = r.transmissionFactor), r.transmissionTexture !== void 0 && i.push(H.assignTexture(a, "transmissionMap", r.transmissionTexture)), Promise.all(i);
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
|
-
class
|
|
452
|
+
class ha {
|
|
453
453
|
constructor(e) {
|
|
454
|
-
this.parser = e, this.name =
|
|
454
|
+
this.parser = e, this.name = D.KHR_MATERIALS_VOLUME;
|
|
455
455
|
}
|
|
456
456
|
getMaterialType(e) {
|
|
457
457
|
const H = this.parser.json.materials[e];
|
|
458
|
-
return !H.extensions || !H.extensions[this.name] ? null :
|
|
458
|
+
return !H.extensions || !H.extensions[this.name] ? null : u0;
|
|
459
459
|
}
|
|
460
460
|
extendMaterialParams(e, a) {
|
|
461
461
|
const H = this.parser, b = H.json.materials[e];
|
|
@@ -464,16 +464,16 @@ class Ab {
|
|
|
464
464
|
const i = [], r = b.extensions[this.name];
|
|
465
465
|
a.thickness = r.thicknessFactor !== void 0 ? r.thicknessFactor : 0, r.thicknessTexture !== void 0 && i.push(H.assignTexture(a, "thicknessMap", r.thicknessTexture)), a.attenuationDistance = r.attenuationDistance || 1 / 0;
|
|
466
466
|
const f = r.attenuationColor || [1, 1, 1];
|
|
467
|
-
return a.attenuationColor = new
|
|
467
|
+
return a.attenuationColor = new k0().setRGB(f[0], f[1], f[2], l0), Promise.all(i);
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
|
-
class
|
|
470
|
+
class ga {
|
|
471
471
|
constructor(e) {
|
|
472
|
-
this.parser = e, this.name =
|
|
472
|
+
this.parser = e, this.name = D.KHR_MATERIALS_IOR;
|
|
473
473
|
}
|
|
474
474
|
getMaterialType(e) {
|
|
475
475
|
const H = this.parser.json.materials[e];
|
|
476
|
-
return !H.extensions || !H.extensions[this.name] ? null :
|
|
476
|
+
return !H.extensions || !H.extensions[this.name] ? null : u0;
|
|
477
477
|
}
|
|
478
478
|
extendMaterialParams(e, a) {
|
|
479
479
|
const b = this.parser.json.materials[e];
|
|
@@ -483,13 +483,13 @@ class pb {
|
|
|
483
483
|
return a.ior = i.ior !== void 0 ? i.ior : 1.5, Promise.resolve();
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
|
-
class
|
|
486
|
+
class _a {
|
|
487
487
|
constructor(e) {
|
|
488
|
-
this.parser = e, this.name =
|
|
488
|
+
this.parser = e, this.name = D.KHR_MATERIALS_SPECULAR;
|
|
489
489
|
}
|
|
490
490
|
getMaterialType(e) {
|
|
491
491
|
const H = this.parser.json.materials[e];
|
|
492
|
-
return !H.extensions || !H.extensions[this.name] ? null :
|
|
492
|
+
return !H.extensions || !H.extensions[this.name] ? null : u0;
|
|
493
493
|
}
|
|
494
494
|
extendMaterialParams(e, a) {
|
|
495
495
|
const H = this.parser, b = H.json.materials[e];
|
|
@@ -498,16 +498,16 @@ class mb {
|
|
|
498
498
|
const i = [], r = b.extensions[this.name];
|
|
499
499
|
a.specularIntensity = r.specularFactor !== void 0 ? r.specularFactor : 1, r.specularTexture !== void 0 && i.push(H.assignTexture(a, "specularIntensityMap", r.specularTexture));
|
|
500
500
|
const f = r.specularColorFactor || [1, 1, 1];
|
|
501
|
-
return a.specularColor = new
|
|
501
|
+
return a.specularColor = new k0().setRGB(f[0], f[1], f[2], l0), r.specularColorTexture !== void 0 && i.push(H.assignTexture(a, "specularColorMap", r.specularColorTexture, A0)), Promise.all(i);
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
|
-
class
|
|
504
|
+
class Aa {
|
|
505
505
|
constructor(e) {
|
|
506
|
-
this.parser = e, this.name =
|
|
506
|
+
this.parser = e, this.name = D.EXT_MATERIALS_BUMP;
|
|
507
507
|
}
|
|
508
508
|
getMaterialType(e) {
|
|
509
509
|
const H = this.parser.json.materials[e];
|
|
510
|
-
return !H.extensions || !H.extensions[this.name] ? null :
|
|
510
|
+
return !H.extensions || !H.extensions[this.name] ? null : u0;
|
|
511
511
|
}
|
|
512
512
|
extendMaterialParams(e, a) {
|
|
513
513
|
const H = this.parser, b = H.json.materials[e];
|
|
@@ -517,13 +517,13 @@ class jb {
|
|
|
517
517
|
return a.bumpScale = r.bumpFactor !== void 0 ? r.bumpFactor : 1, r.bumpTexture !== void 0 && i.push(H.assignTexture(a, "bumpMap", r.bumpTexture)), Promise.all(i);
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
|
-
class
|
|
520
|
+
class pa {
|
|
521
521
|
constructor(e) {
|
|
522
|
-
this.parser = e, this.name =
|
|
522
|
+
this.parser = e, this.name = D.KHR_MATERIALS_ANISOTROPY;
|
|
523
523
|
}
|
|
524
524
|
getMaterialType(e) {
|
|
525
525
|
const H = this.parser.json.materials[e];
|
|
526
|
-
return !H.extensions || !H.extensions[this.name] ? null :
|
|
526
|
+
return !H.extensions || !H.extensions[this.name] ? null : u0;
|
|
527
527
|
}
|
|
528
528
|
extendMaterialParams(e, a) {
|
|
529
529
|
const H = this.parser, b = H.json.materials[e];
|
|
@@ -533,9 +533,9 @@ class Ib {
|
|
|
533
533
|
return r.anisotropyStrength !== void 0 && (a.anisotropy = r.anisotropyStrength), r.anisotropyRotation !== void 0 && (a.anisotropyRotation = r.anisotropyRotation), r.anisotropyTexture !== void 0 && i.push(H.assignTexture(a, "anisotropyMap", r.anisotropyTexture)), Promise.all(i);
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
|
-
class
|
|
536
|
+
class ma {
|
|
537
537
|
constructor(e) {
|
|
538
|
-
this.parser = e, this.name =
|
|
538
|
+
this.parser = e, this.name = D.KHR_TEXTURE_BASISU;
|
|
539
539
|
}
|
|
540
540
|
loadTexture(e) {
|
|
541
541
|
const a = this.parser, H = a.json, b = H.textures[e];
|
|
@@ -550,9 +550,9 @@ class yb {
|
|
|
550
550
|
return a.loadTextureImage(e, i.source, r);
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
|
-
class
|
|
553
|
+
class ja {
|
|
554
554
|
constructor(e) {
|
|
555
|
-
this.parser = e, this.name =
|
|
555
|
+
this.parser = e, this.name = D.EXT_TEXTURE_WEBP;
|
|
556
556
|
}
|
|
557
557
|
loadTexture(e) {
|
|
558
558
|
const a = this.name, H = this.parser, b = H.json, i = b.textures[e];
|
|
@@ -567,9 +567,9 @@ class wb {
|
|
|
567
567
|
return H.loadTextureImage(e, r.source, c);
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
|
-
class
|
|
570
|
+
class Ia {
|
|
571
571
|
constructor(e) {
|
|
572
|
-
this.parser = e, this.name =
|
|
572
|
+
this.parser = e, this.name = D.EXT_TEXTURE_AVIF;
|
|
573
573
|
}
|
|
574
574
|
loadTexture(e) {
|
|
575
575
|
const a = this.name, H = this.parser, b = H.json, i = b.textures[e];
|
|
@@ -584,9 +584,9 @@ class Fb {
|
|
|
584
584
|
return H.loadTextureImage(e, r.source, c);
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
|
-
class
|
|
587
|
+
class ya {
|
|
588
588
|
constructor(e) {
|
|
589
|
-
this.name =
|
|
589
|
+
this.name = D.EXT_MESHOPT_COMPRESSION, this.parser = e;
|
|
590
590
|
}
|
|
591
591
|
loadBufferView(e) {
|
|
592
592
|
const a = this.parser.json, H = a.bufferViews[e];
|
|
@@ -610,9 +610,9 @@ class vb {
|
|
|
610
610
|
return null;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
class
|
|
613
|
+
class wa {
|
|
614
614
|
constructor(e) {
|
|
615
|
-
this.name =
|
|
615
|
+
this.name = D.EXT_MESH_GPU_INSTANCING, this.parser = e;
|
|
616
616
|
}
|
|
617
617
|
createNodeMesh(e) {
|
|
618
618
|
const a = this.parser.json, H = a.nodes[e];
|
|
@@ -620,52 +620,52 @@ class Nb {
|
|
|
620
620
|
return null;
|
|
621
621
|
const b = a.meshes[H.mesh];
|
|
622
622
|
for (const t of b.primitives)
|
|
623
|
-
if (t.mode !==
|
|
623
|
+
if (t.mode !== t0.TRIANGLES && t.mode !== t0.TRIANGLE_STRIP && t.mode !== t0.TRIANGLE_FAN && t.mode !== void 0)
|
|
624
624
|
return null;
|
|
625
625
|
const r = H.extensions[this.name].attributes, f = [], c = {};
|
|
626
626
|
for (const t in r)
|
|
627
627
|
f.push(this.parser.getDependency("accessor", r[t]).then((d) => (c[t] = d, c[t])));
|
|
628
628
|
return f.length < 1 ? null : (f.push(this.parser.createNodeMesh(e)), Promise.all(f).then((t) => {
|
|
629
629
|
const d = t.pop(), o = d.isGroup ? d.children : [d], s = t[0].count, k = [];
|
|
630
|
-
for (const
|
|
631
|
-
const
|
|
632
|
-
for (let
|
|
633
|
-
c.TRANSLATION &&
|
|
634
|
-
for (const
|
|
635
|
-
if (
|
|
636
|
-
const
|
|
637
|
-
|
|
638
|
-
} else
|
|
639
|
-
|
|
630
|
+
for (const l of o) {
|
|
631
|
+
const u = new J0(), h = new y(), m = new d0(), g = new y(1, 1, 1), A = new p2(l.geometry, l.material, s);
|
|
632
|
+
for (let p = 0; p < s; p++)
|
|
633
|
+
c.TRANSLATION && h.fromBufferAttribute(c.TRANSLATION, p), c.ROTATION && m.fromBufferAttribute(c.ROTATION, p), c.SCALE && g.fromBufferAttribute(c.SCALE, p), A.setMatrixAt(p, u.compose(h, m, g));
|
|
634
|
+
for (const p in c)
|
|
635
|
+
if (p === "_COLOR_0") {
|
|
636
|
+
const w = c[p];
|
|
637
|
+
A.instanceColor = new m2(w.array, w.itemSize, w.normalized);
|
|
638
|
+
} else p !== "TRANSLATION" && p !== "ROTATION" && p !== "SCALE" && l.geometry.setAttribute(p, c[p]);
|
|
639
|
+
We.prototype.copy.call(A, l), this.parser.assignFinalMaterial(A), k.push(A);
|
|
640
640
|
}
|
|
641
641
|
return d.isGroup ? (d.clear(), d.add(...k), d) : k[0];
|
|
642
642
|
}));
|
|
643
643
|
}
|
|
644
644
|
}
|
|
645
|
-
const
|
|
646
|
-
class
|
|
645
|
+
const Ye = "glTF", P0 = 12, Re = { JSON: 1313821514, BIN: 5130562 };
|
|
646
|
+
class Fa {
|
|
647
647
|
constructor(e) {
|
|
648
|
-
this.name =
|
|
649
|
-
const a = new DataView(e, 0,
|
|
648
|
+
this.name = D.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
649
|
+
const a = new DataView(e, 0, P0), H = new TextDecoder();
|
|
650
650
|
if (this.header = {
|
|
651
651
|
magic: H.decode(new Uint8Array(e.slice(0, 4))),
|
|
652
652
|
version: a.getUint32(4, !0),
|
|
653
653
|
length: a.getUint32(8, !0)
|
|
654
|
-
}, this.header.magic !==
|
|
654
|
+
}, this.header.magic !== Ye)
|
|
655
655
|
throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
|
|
656
656
|
if (this.header.version < 2)
|
|
657
657
|
throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
|
|
658
|
-
const b = this.header.length -
|
|
658
|
+
const b = this.header.length - P0, i = new DataView(e, P0);
|
|
659
659
|
let r = 0;
|
|
660
660
|
for (; r < b; ) {
|
|
661
661
|
const f = i.getUint32(r, !0);
|
|
662
662
|
r += 4;
|
|
663
663
|
const c = i.getUint32(r, !0);
|
|
664
|
-
if (r += 4, c ===
|
|
665
|
-
const t = new Uint8Array(e,
|
|
664
|
+
if (r += 4, c === Re.JSON) {
|
|
665
|
+
const t = new Uint8Array(e, P0 + r, f);
|
|
666
666
|
this.content = H.decode(t);
|
|
667
|
-
} else if (c ===
|
|
668
|
-
const t =
|
|
667
|
+
} else if (c === Re.BIN) {
|
|
668
|
+
const t = P0 + r;
|
|
669
669
|
this.body = e.slice(t, t + f);
|
|
670
670
|
}
|
|
671
671
|
r += f;
|
|
@@ -674,52 +674,52 @@ class Tb {
|
|
|
674
674
|
throw new Error("THREE.GLTFLoader: JSON content not found.");
|
|
675
675
|
}
|
|
676
676
|
}
|
|
677
|
-
class
|
|
677
|
+
class va {
|
|
678
678
|
constructor(e, a) {
|
|
679
679
|
if (!a)
|
|
680
680
|
throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
|
|
681
|
-
this.name =
|
|
681
|
+
this.name = D.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = a, this.dracoLoader.preload();
|
|
682
682
|
}
|
|
683
683
|
decodePrimitive(e, a) {
|
|
684
684
|
const H = this.json, b = this.dracoLoader, i = e.extensions[this.name].bufferView, r = e.extensions[this.name].attributes, f = {}, c = {}, t = {};
|
|
685
685
|
for (const d in r) {
|
|
686
|
-
const o =
|
|
686
|
+
const o = de[d] || d.toLowerCase();
|
|
687
687
|
f[o] = r[d];
|
|
688
688
|
}
|
|
689
689
|
for (const d in e.attributes) {
|
|
690
|
-
const o =
|
|
690
|
+
const o = de[d] || d.toLowerCase();
|
|
691
691
|
if (r[d] !== void 0) {
|
|
692
|
-
const s = H.accessors[e.attributes[d]], k =
|
|
692
|
+
const s = H.accessors[e.attributes[d]], k = E0[s.componentType];
|
|
693
693
|
t[o] = k.name, c[o] = s.normalized === !0;
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
696
|
return a.getDependency("bufferView", i).then(function(d) {
|
|
697
697
|
return new Promise(function(o, s) {
|
|
698
698
|
b.decodeDracoFile(d, function(k) {
|
|
699
|
-
for (const
|
|
700
|
-
const
|
|
701
|
-
|
|
699
|
+
for (const l in k.attributes) {
|
|
700
|
+
const u = k.attributes[l], h = c[l];
|
|
701
|
+
h !== void 0 && (u.normalized = h);
|
|
702
702
|
}
|
|
703
703
|
o(k);
|
|
704
|
-
}, f, t,
|
|
704
|
+
}, f, t, l0, s);
|
|
705
705
|
});
|
|
706
706
|
});
|
|
707
707
|
}
|
|
708
708
|
}
|
|
709
|
-
class
|
|
709
|
+
class Na {
|
|
710
710
|
constructor() {
|
|
711
|
-
this.name =
|
|
711
|
+
this.name = D.KHR_TEXTURE_TRANSFORM;
|
|
712
712
|
}
|
|
713
713
|
extendTexture(e, a) {
|
|
714
714
|
return (a.texCoord === void 0 || a.texCoord === e.channel) && a.offset === void 0 && a.rotation === void 0 && a.scale === void 0 || (e = e.clone(), a.texCoord !== void 0 && (e.channel = a.texCoord), a.offset !== void 0 && e.offset.fromArray(a.offset), a.rotation !== void 0 && (e.rotation = a.rotation), a.scale !== void 0 && e.repeat.fromArray(a.scale), e.needsUpdate = !0), e;
|
|
715
715
|
}
|
|
716
716
|
}
|
|
717
|
-
class
|
|
717
|
+
class Ta {
|
|
718
718
|
constructor() {
|
|
719
|
-
this.name =
|
|
719
|
+
this.name = D.KHR_MESH_QUANTIZATION;
|
|
720
720
|
}
|
|
721
721
|
}
|
|
722
|
-
class
|
|
722
|
+
class Ke extends Q2 {
|
|
723
723
|
constructor(e, a, H, b) {
|
|
724
724
|
super(e, a, H, b);
|
|
725
725
|
}
|
|
@@ -730,22 +730,22 @@ class $2 extends Ya {
|
|
|
730
730
|
return a;
|
|
731
731
|
}
|
|
732
732
|
interpolate_(e, a, H, b) {
|
|
733
|
-
const i = this.resultBuffer, r = this.sampleValues, f = this.valueSize, c = f * 2, t = f * 3, d = b - a, o = (H - a) / d, s = o * o, k = s * o,
|
|
734
|
-
for (let
|
|
735
|
-
const
|
|
736
|
-
i[
|
|
733
|
+
const i = this.resultBuffer, r = this.sampleValues, f = this.valueSize, c = f * 2, t = f * 3, d = b - a, o = (H - a) / d, s = o * o, k = s * o, l = e * t, u = l - t, h = -2 * k + 3 * s, m = k - s, g = 1 - h, A = m - s + o;
|
|
734
|
+
for (let p = 0; p !== f; p++) {
|
|
735
|
+
const w = r[u + p + f], F = r[u + p + c] * d, v = r[l + p + f], B = r[l + p] * d;
|
|
736
|
+
i[p] = g * w + A * F + h * v + m * B;
|
|
737
737
|
}
|
|
738
738
|
return i;
|
|
739
739
|
}
|
|
740
740
|
}
|
|
741
|
-
const
|
|
742
|
-
class
|
|
741
|
+
const Ra = new d0();
|
|
742
|
+
class Ma extends Ke {
|
|
743
743
|
interpolate_(e, a, H, b) {
|
|
744
744
|
const i = super.interpolate_(e, a, H, b);
|
|
745
|
-
return
|
|
745
|
+
return Ra.fromArray(i).normalize().toArray(i), i;
|
|
746
746
|
}
|
|
747
747
|
}
|
|
748
|
-
const
|
|
748
|
+
const t0 = {
|
|
749
749
|
POINTS: 0,
|
|
750
750
|
LINES: 1,
|
|
751
751
|
LINE_LOOP: 2,
|
|
@@ -753,25 +753,25 @@ const v0 = {
|
|
|
753
753
|
TRIANGLES: 4,
|
|
754
754
|
TRIANGLE_STRIP: 5,
|
|
755
755
|
TRIANGLE_FAN: 6
|
|
756
|
-
},
|
|
756
|
+
}, E0 = {
|
|
757
757
|
5120: Int8Array,
|
|
758
758
|
5121: Uint8Array,
|
|
759
759
|
5122: Int16Array,
|
|
760
760
|
5123: Uint16Array,
|
|
761
761
|
5125: Uint32Array,
|
|
762
762
|
5126: Float32Array
|
|
763
|
-
},
|
|
764
|
-
9728:
|
|
765
|
-
9729:
|
|
766
|
-
9984:
|
|
767
|
-
9985:
|
|
768
|
-
9986:
|
|
769
|
-
9987:
|
|
770
|
-
},
|
|
771
|
-
33071:
|
|
772
|
-
33648:
|
|
773
|
-
10497:
|
|
774
|
-
},
|
|
763
|
+
}, Me = {
|
|
764
|
+
9728: Le,
|
|
765
|
+
9729: fe,
|
|
766
|
+
9984: v2,
|
|
767
|
+
9985: F2,
|
|
768
|
+
9986: w2,
|
|
769
|
+
9987: Ce
|
|
770
|
+
}, De = {
|
|
771
|
+
33071: T2,
|
|
772
|
+
33648: N2,
|
|
773
|
+
10497: te
|
|
774
|
+
}, X0 = {
|
|
775
775
|
SCALAR: 1,
|
|
776
776
|
VEC2: 2,
|
|
777
777
|
VEC3: 3,
|
|
@@ -779,7 +779,7 @@ const v0 = {
|
|
|
779
779
|
MAT2: 4,
|
|
780
780
|
MAT3: 9,
|
|
781
781
|
MAT4: 16
|
|
782
|
-
},
|
|
782
|
+
}, de = {
|
|
783
783
|
POSITION: "position",
|
|
784
784
|
NORMAL: "normal",
|
|
785
785
|
TANGENT: "tangent",
|
|
@@ -790,41 +790,41 @@ const v0 = {
|
|
|
790
790
|
COLOR_0: "color",
|
|
791
791
|
WEIGHTS_0: "skinWeight",
|
|
792
792
|
JOINTS_0: "skinIndex"
|
|
793
|
-
},
|
|
793
|
+
}, _0 = {
|
|
794
794
|
scale: "scale",
|
|
795
795
|
translation: "position",
|
|
796
796
|
rotation: "quaternion",
|
|
797
797
|
weights: "morphTargetInfluences"
|
|
798
|
-
},
|
|
798
|
+
}, Da = {
|
|
799
799
|
CUBICSPLINE: void 0,
|
|
800
800
|
// We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
|
|
801
801
|
// keyframe track will be initialized with a default interpolation type, then modified.
|
|
802
|
-
LINEAR:
|
|
803
|
-
STEP:
|
|
804
|
-
},
|
|
802
|
+
LINEAR: Qe,
|
|
803
|
+
STEP: S2
|
|
804
|
+
}, $0 = {
|
|
805
805
|
OPAQUE: "OPAQUE",
|
|
806
806
|
MASK: "MASK",
|
|
807
807
|
BLEND: "BLEND"
|
|
808
808
|
};
|
|
809
|
-
function
|
|
810
|
-
return n.DefaultMaterial === void 0 && (n.DefaultMaterial = new
|
|
809
|
+
function Oa(n) {
|
|
810
|
+
return n.DefaultMaterial === void 0 && (n.DefaultMaterial = new Se({
|
|
811
811
|
color: 16777215,
|
|
812
812
|
emissive: 0,
|
|
813
813
|
metalness: 1,
|
|
814
814
|
roughness: 1,
|
|
815
815
|
transparent: !1,
|
|
816
816
|
depthTest: !0,
|
|
817
|
-
side:
|
|
817
|
+
side: Z2
|
|
818
818
|
})), n.DefaultMaterial;
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function N0(n, e, a) {
|
|
821
821
|
for (const H in a.extensions)
|
|
822
822
|
n[H] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[H] = a.extensions[H]);
|
|
823
823
|
}
|
|
824
|
-
function
|
|
824
|
+
function g0(n, e) {
|
|
825
825
|
e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(n.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras));
|
|
826
826
|
}
|
|
827
|
-
function
|
|
827
|
+
function Ea(n, e, a) {
|
|
828
828
|
let H = !1, b = !1, i = !1;
|
|
829
829
|
for (let t = 0, d = e.length; t < d; t++) {
|
|
830
830
|
const o = e[t];
|
|
@@ -856,7 +856,7 @@ function xb(n, e, a) {
|
|
|
856
856
|
return H && (n.morphAttributes.position = d), b && (n.morphAttributes.normal = o), i && (n.morphAttributes.color = s), n.morphTargetsRelative = !0, n;
|
|
857
857
|
});
|
|
858
858
|
}
|
|
859
|
-
function
|
|
859
|
+
function Ga(n, e) {
|
|
860
860
|
if (n.updateMorphTargets(), e.weights !== void 0)
|
|
861
861
|
for (let a = 0, H = e.weights.length; a < H; a++)
|
|
862
862
|
n.morphTargetInfluences[a] = e.weights[a];
|
|
@@ -870,22 +870,22 @@ function Pb(n, e) {
|
|
|
870
870
|
console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
|
|
871
871
|
}
|
|
872
872
|
}
|
|
873
|
-
function
|
|
873
|
+
function Ua(n) {
|
|
874
874
|
let e;
|
|
875
|
-
const a = n.extensions && n.extensions[
|
|
876
|
-
if (a ? e = "draco:" + a.bufferView + ":" + a.indices + ":" +
|
|
875
|
+
const a = n.extensions && n.extensions[D.KHR_DRACO_MESH_COMPRESSION];
|
|
876
|
+
if (a ? e = "draco:" + a.bufferView + ":" + a.indices + ":" + ee(a.attributes) : e = n.indices + ":" + ee(n.attributes) + ":" + n.mode, n.targets !== void 0)
|
|
877
877
|
for (let H = 0, b = n.targets.length; H < b; H++)
|
|
878
|
-
e += ":" +
|
|
878
|
+
e += ":" + ee(n.targets[H]);
|
|
879
879
|
return e;
|
|
880
880
|
}
|
|
881
|
-
function
|
|
881
|
+
function ee(n) {
|
|
882
882
|
let e = "";
|
|
883
883
|
const a = Object.keys(n).sort();
|
|
884
884
|
for (let H = 0, b = a.length; H < b; H++)
|
|
885
885
|
e += a[H] + ":" + n[a[H]] + ";";
|
|
886
886
|
return e;
|
|
887
887
|
}
|
|
888
|
-
function
|
|
888
|
+
function oe(n) {
|
|
889
889
|
switch (n) {
|
|
890
890
|
case Int8Array:
|
|
891
891
|
return 1 / 127;
|
|
@@ -899,13 +899,13 @@ function b2(n) {
|
|
|
899
899
|
throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
|
|
900
900
|
}
|
|
901
901
|
}
|
|
902
|
-
function
|
|
902
|
+
function xa(n) {
|
|
903
903
|
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";
|
|
904
904
|
}
|
|
905
|
-
const
|
|
906
|
-
class
|
|
905
|
+
const Pa = new J0();
|
|
906
|
+
class Ba {
|
|
907
907
|
constructor(e = {}, a = {}) {
|
|
908
|
-
this.json = e, this.extensions = {}, this.plugins = {}, this.options = a, this.cache = new
|
|
908
|
+
this.json = e, this.extensions = {}, this.plugins = {}, this.options = a, this.cache = new fa(), 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 = {};
|
|
909
909
|
let H = !1, b = -1, i = !1, r = -1;
|
|
910
910
|
if (typeof navigator < "u") {
|
|
911
911
|
const f = navigator.userAgent;
|
|
@@ -913,7 +913,7 @@ class Vb {
|
|
|
913
913
|
const c = f.match(/Version\/(\d+)/);
|
|
914
914
|
b = H && c ? parseInt(c[1], 10) : -1, i = f.indexOf("Firefox") > -1, r = i ? f.match(/Firefox\/([0-9]+)\./)[1] : -1;
|
|
915
915
|
}
|
|
916
|
-
typeof createImageBitmap > "u" || H && b < 17 || i && r < 98 ? this.textureLoader = new
|
|
916
|
+
typeof createImageBitmap > "u" || H && b < 17 || i && r < 98 ? this.textureLoader = new j2(this.options.manager) : this.textureLoader = new I2(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new Q0(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
|
|
917
917
|
}
|
|
918
918
|
setExtensions(e) {
|
|
919
919
|
this.extensions = e;
|
|
@@ -943,7 +943,7 @@ class Vb {
|
|
|
943
943
|
parser: H,
|
|
944
944
|
userData: {}
|
|
945
945
|
};
|
|
946
|
-
return
|
|
946
|
+
return N0(i, f, b), g0(f, b), Promise.all(H._invokeAll(function(c) {
|
|
947
947
|
return c.afterRoot && c.afterRoot(f);
|
|
948
948
|
})).then(function() {
|
|
949
949
|
for (const c of f.scenes)
|
|
@@ -1121,10 +1121,10 @@ class Vb {
|
|
|
1121
1121
|
if (a.type && a.type !== "arraybuffer")
|
|
1122
1122
|
throw new Error("THREE.GLTFLoader: " + a.type + " buffer type is not supported.");
|
|
1123
1123
|
if (a.uri === void 0 && e === 0)
|
|
1124
|
-
return Promise.resolve(this.extensions[
|
|
1124
|
+
return Promise.resolve(this.extensions[D.KHR_BINARY_GLTF].body);
|
|
1125
1125
|
const b = this.options;
|
|
1126
1126
|
return new Promise(function(i, r) {
|
|
1127
|
-
H.load(
|
|
1127
|
+
H.load(q0.resolveURL(a.uri, b.path), i, void 0, function() {
|
|
1128
1128
|
r(new Error('THREE.GLTFLoader: Failed to load buffer "' + a.uri + '".'));
|
|
1129
1129
|
});
|
|
1130
1130
|
});
|
|
@@ -1153,29 +1153,29 @@ class Vb {
|
|
|
1153
1153
|
loadAccessor(e) {
|
|
1154
1154
|
const a = this, H = this.json, b = this.json.accessors[e];
|
|
1155
1155
|
if (b.bufferView === void 0 && b.sparse === void 0) {
|
|
1156
|
-
const r =
|
|
1157
|
-
return Promise.resolve(new
|
|
1156
|
+
const r = X0[b.type], f = E0[b.componentType], c = b.normalized === !0, t = new f(b.count * r);
|
|
1157
|
+
return Promise.resolve(new V0(t, r, c));
|
|
1158
1158
|
}
|
|
1159
1159
|
const i = [];
|
|
1160
1160
|
return b.bufferView !== void 0 ? i.push(this.getDependency("bufferView", b.bufferView)) : i.push(null), b.sparse !== void 0 && (i.push(this.getDependency("bufferView", b.sparse.indices.bufferView)), i.push(this.getDependency("bufferView", b.sparse.values.bufferView))), Promise.all(i).then(function(r) {
|
|
1161
|
-
const f = r[0], c =
|
|
1162
|
-
let
|
|
1161
|
+
const f = r[0], c = X0[b.type], t = E0[b.componentType], d = t.BYTES_PER_ELEMENT, o = d * c, s = b.byteOffset || 0, k = b.bufferView !== void 0 ? H.bufferViews[b.bufferView].byteStride : void 0, l = b.normalized === !0;
|
|
1162
|
+
let u, h;
|
|
1163
1163
|
if (k && k !== o) {
|
|
1164
|
-
const
|
|
1165
|
-
let
|
|
1166
|
-
|
|
1164
|
+
const m = Math.floor(s / k), g = "InterleavedBuffer:" + b.bufferView + ":" + b.componentType + ":" + m + ":" + b.count;
|
|
1165
|
+
let A = a.cache.get(g);
|
|
1166
|
+
A || (u = new t(f, m * k, b.count * k / d), A = new y2(u, k / d), a.cache.add(g, A)), h = new z2(A, c, s % k / d, l);
|
|
1167
1167
|
} else
|
|
1168
|
-
f === null ?
|
|
1168
|
+
f === null ? u = new t(b.count * c) : u = new t(f, s, b.count * c), h = new V0(u, c, l);
|
|
1169
1169
|
if (b.sparse !== void 0) {
|
|
1170
|
-
const
|
|
1171
|
-
f !== null && (
|
|
1172
|
-
for (let
|
|
1173
|
-
const
|
|
1174
|
-
if (
|
|
1170
|
+
const m = X0.SCALAR, g = E0[b.sparse.indices.componentType], A = b.sparse.indices.byteOffset || 0, p = b.sparse.values.byteOffset || 0, w = new g(r[1], A, b.sparse.count * m), F = new t(r[2], p, b.sparse.count * c);
|
|
1171
|
+
f !== null && (h = new V0(h.array.slice(), h.itemSize, h.normalized)), h.normalized = !1;
|
|
1172
|
+
for (let v = 0, B = w.length; v < B; v++) {
|
|
1173
|
+
const W = w[v];
|
|
1174
|
+
if (h.setX(W, F[v * c]), c >= 2 && h.setY(W, F[v * c + 1]), c >= 3 && h.setZ(W, F[v * c + 2]), c >= 4 && h.setW(W, F[v * c + 3]), c >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
1175
1175
|
}
|
|
1176
|
-
|
|
1176
|
+
h.normalized = l;
|
|
1177
1177
|
}
|
|
1178
|
-
return
|
|
1178
|
+
return h;
|
|
1179
1179
|
});
|
|
1180
1180
|
}
|
|
1181
1181
|
/**
|
|
@@ -1201,7 +1201,7 @@ class Vb {
|
|
|
1201
1201
|
const t = this.loadImageSource(a, H).then(function(d) {
|
|
1202
1202
|
d.flipY = !1, d.name = r.name || f.name || "", d.name === "" && typeof f.uri == "string" && f.uri.startsWith("data:image/") === !1 && (d.name = f.uri);
|
|
1203
1203
|
const s = (i.samplers || {})[r.sampler] || {};
|
|
1204
|
-
return d.magFilter =
|
|
1204
|
+
return d.magFilter = Me[s.magFilter] || fe, d.minFilter = Me[s.minFilter] || Ce, d.wrapS = De[s.wrapS] || te, d.wrapT = De[s.wrapT] || te, d.generateMipmaps = !d.isCompressedTexture && d.minFilter !== Le && d.minFilter !== fe, b.associations.set(d, { textures: e }), d;
|
|
1205
1205
|
}).catch(function() {
|
|
1206
1206
|
return null;
|
|
1207
1207
|
});
|
|
@@ -1223,14 +1223,14 @@ class Vb {
|
|
|
1223
1223
|
throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
|
|
1224
1224
|
const d = Promise.resolve(c).then(function(o) {
|
|
1225
1225
|
return new Promise(function(s, k) {
|
|
1226
|
-
let
|
|
1227
|
-
a.isImageBitmapLoader === !0 && (
|
|
1228
|
-
const
|
|
1229
|
-
|
|
1230
|
-
}), a.load(
|
|
1226
|
+
let l = s;
|
|
1227
|
+
a.isImageBitmapLoader === !0 && (l = function(u) {
|
|
1228
|
+
const h = new ye(u);
|
|
1229
|
+
h.needsUpdate = !0, s(h);
|
|
1230
|
+
}), a.load(q0.resolveURL(o, i.path), l, void 0, k);
|
|
1231
1231
|
});
|
|
1232
1232
|
}).then(function(o) {
|
|
1233
|
-
return t === !0 && f.revokeObjectURL(c),
|
|
1233
|
+
return t === !0 && f.revokeObjectURL(c), g0(o, r), o.userData.mimeType = r.mimeType || xa(r.uri), o;
|
|
1234
1234
|
}).catch(function(o) {
|
|
1235
1235
|
throw console.error("THREE.GLTFLoader: Couldn't load texture", c), o;
|
|
1236
1236
|
});
|
|
@@ -1250,11 +1250,11 @@ class Vb {
|
|
|
1250
1250
|
const i = this;
|
|
1251
1251
|
return this.getDependency("texture", H.index).then(function(r) {
|
|
1252
1252
|
if (!r) return null;
|
|
1253
|
-
if (H.texCoord !== void 0 && H.texCoord > 0 && (r = r.clone(), r.channel = H.texCoord), i.extensions[
|
|
1254
|
-
const f = H.extensions !== void 0 ? H.extensions[
|
|
1253
|
+
if (H.texCoord !== void 0 && H.texCoord > 0 && (r = r.clone(), r.channel = H.texCoord), i.extensions[D.KHR_TEXTURE_TRANSFORM]) {
|
|
1254
|
+
const f = H.extensions !== void 0 ? H.extensions[D.KHR_TEXTURE_TRANSFORM] : void 0;
|
|
1255
1255
|
if (f) {
|
|
1256
1256
|
const c = i.associations.get(r);
|
|
1257
|
-
r = i.extensions[
|
|
1257
|
+
r = i.extensions[D.KHR_TEXTURE_TRANSFORM].extendTexture(r, f), i.associations.set(r, c);
|
|
1258
1258
|
}
|
|
1259
1259
|
}
|
|
1260
1260
|
return b !== void 0 && (r.colorSpace = b), e[a] = r, r;
|
|
@@ -1277,11 +1277,11 @@ class Vb {
|
|
|
1277
1277
|
if (e.isPoints) {
|
|
1278
1278
|
const f = "PointsMaterial:" + H.uuid;
|
|
1279
1279
|
let c = this.cache.get(f);
|
|
1280
|
-
c || (c = new
|
|
1280
|
+
c || (c = new R2(), K0.prototype.copy.call(c, H), c.color.copy(H.color), c.map = H.map, c.sizeAttenuation = !1, this.cache.add(f, c)), H = c;
|
|
1281
1281
|
} else if (e.isLine) {
|
|
1282
1282
|
const f = "LineBasicMaterial:" + H.uuid;
|
|
1283
1283
|
let c = this.cache.get(f);
|
|
1284
|
-
c || (c = new
|
|
1284
|
+
c || (c = new M2(), K0.prototype.copy.call(c, H), c.color.copy(H.color), c.map = H.map, this.cache.add(f, c)), H = c;
|
|
1285
1285
|
}
|
|
1286
1286
|
if (b || i || r) {
|
|
1287
1287
|
let f = "ClonedMaterial:" + H.uuid + ":";
|
|
@@ -1292,7 +1292,7 @@ class Vb {
|
|
|
1292
1292
|
e.material = H;
|
|
1293
1293
|
}
|
|
1294
1294
|
getMaterialType() {
|
|
1295
|
-
return
|
|
1295
|
+
return Se;
|
|
1296
1296
|
}
|
|
1297
1297
|
/**
|
|
1298
1298
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
|
|
@@ -1305,34 +1305,34 @@ class Vb {
|
|
|
1305
1305
|
const a = this, H = this.json, b = this.extensions, i = H.materials[e];
|
|
1306
1306
|
let r;
|
|
1307
1307
|
const f = {}, c = i.extensions || {}, t = [];
|
|
1308
|
-
if (c[
|
|
1309
|
-
const o = b[
|
|
1308
|
+
if (c[D.KHR_MATERIALS_UNLIT]) {
|
|
1309
|
+
const o = b[D.KHR_MATERIALS_UNLIT];
|
|
1310
1310
|
r = o.getMaterialType(), t.push(o.extendParams(f, i, a));
|
|
1311
1311
|
} else {
|
|
1312
1312
|
const o = i.pbrMetallicRoughness || {};
|
|
1313
|
-
if (f.color = new
|
|
1313
|
+
if (f.color = new k0(1, 1, 1), f.opacity = 1, Array.isArray(o.baseColorFactor)) {
|
|
1314
1314
|
const s = o.baseColorFactor;
|
|
1315
|
-
f.color.setRGB(s[0], s[1], s[2],
|
|
1315
|
+
f.color.setRGB(s[0], s[1], s[2], l0), f.opacity = s[3];
|
|
1316
1316
|
}
|
|
1317
|
-
o.baseColorTexture !== void 0 && t.push(a.assignTexture(f, "map", o.baseColorTexture,
|
|
1317
|
+
o.baseColorTexture !== void 0 && t.push(a.assignTexture(f, "map", o.baseColorTexture, A0)), f.metalness = o.metallicFactor !== void 0 ? o.metallicFactor : 1, f.roughness = o.roughnessFactor !== void 0 ? o.roughnessFactor : 1, o.metallicRoughnessTexture !== void 0 && (t.push(a.assignTexture(f, "metalnessMap", o.metallicRoughnessTexture)), t.push(a.assignTexture(f, "roughnessMap", o.metallicRoughnessTexture))), r = this._invokeOne(function(s) {
|
|
1318
1318
|
return s.getMaterialType && s.getMaterialType(e);
|
|
1319
1319
|
}), t.push(Promise.all(this._invokeAll(function(s) {
|
|
1320
1320
|
return s.extendMaterialParams && s.extendMaterialParams(e, f);
|
|
1321
1321
|
})));
|
|
1322
1322
|
}
|
|
1323
|
-
i.doubleSided === !0 && (f.side =
|
|
1324
|
-
const d = i.alphaMode ||
|
|
1325
|
-
if (d ===
|
|
1323
|
+
i.doubleSided === !0 && (f.side = D2);
|
|
1324
|
+
const d = i.alphaMode || $0.OPAQUE;
|
|
1325
|
+
if (d === $0.BLEND ? (f.transparent = !0, f.depthWrite = !1) : (f.transparent = !1, d === $0.MASK && (f.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && r !== B0 && (t.push(a.assignTexture(f, "normalMap", i.normalTexture)), f.normalScale = new ue(1, 1), i.normalTexture.scale !== void 0)) {
|
|
1326
1326
|
const o = i.normalTexture.scale;
|
|
1327
1327
|
f.normalScale.set(o, o);
|
|
1328
1328
|
}
|
|
1329
|
-
if (i.occlusionTexture !== void 0 && r !==
|
|
1329
|
+
if (i.occlusionTexture !== void 0 && r !== B0 && (t.push(a.assignTexture(f, "aoMap", i.occlusionTexture)), i.occlusionTexture.strength !== void 0 && (f.aoMapIntensity = i.occlusionTexture.strength)), i.emissiveFactor !== void 0 && r !== B0) {
|
|
1330
1330
|
const o = i.emissiveFactor;
|
|
1331
|
-
f.emissive = new
|
|
1331
|
+
f.emissive = new k0().setRGB(o[0], o[1], o[2], l0);
|
|
1332
1332
|
}
|
|
1333
|
-
return i.emissiveTexture !== void 0 && r !==
|
|
1333
|
+
return i.emissiveTexture !== void 0 && r !== B0 && t.push(a.assignTexture(f, "emissiveMap", i.emissiveTexture, A0)), Promise.all(t).then(function() {
|
|
1334
1334
|
const o = new r(f);
|
|
1335
|
-
return i.name && (o.name = i.name),
|
|
1335
|
+
return i.name && (o.name = i.name), g0(o, i), a.associations.set(o, { materials: e }), i.extensions && N0(b, o, i), o;
|
|
1336
1336
|
});
|
|
1337
1337
|
}
|
|
1338
1338
|
/**
|
|
@@ -1343,7 +1343,7 @@ class Vb {
|
|
|
1343
1343
|
* @return {string}
|
|
1344
1344
|
*/
|
|
1345
1345
|
createUniqueName(e) {
|
|
1346
|
-
const a =
|
|
1346
|
+
const a = O2.sanitizeNodeName(e || "");
|
|
1347
1347
|
return a in this.nodeNamesUsed ? a + "_" + ++this.nodeNamesUsed[a] : (this.nodeNamesUsed[a] = 0, a);
|
|
1348
1348
|
}
|
|
1349
1349
|
/**
|
|
@@ -1358,18 +1358,18 @@ class Vb {
|
|
|
1358
1358
|
loadGeometries(e) {
|
|
1359
1359
|
const a = this, H = this.extensions, b = this.primitiveCache;
|
|
1360
1360
|
function i(f) {
|
|
1361
|
-
return H[
|
|
1362
|
-
return
|
|
1361
|
+
return H[D.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(f, a).then(function(c) {
|
|
1362
|
+
return Oe(c, f, a);
|
|
1363
1363
|
});
|
|
1364
1364
|
}
|
|
1365
1365
|
const r = [];
|
|
1366
1366
|
for (let f = 0, c = e.length; f < c; f++) {
|
|
1367
|
-
const t = e[f], d =
|
|
1367
|
+
const t = e[f], d = Ua(t), o = b[d];
|
|
1368
1368
|
if (o)
|
|
1369
1369
|
r.push(o.promise);
|
|
1370
1370
|
else {
|
|
1371
1371
|
let s;
|
|
1372
|
-
t.extensions && t.extensions[
|
|
1372
|
+
t.extensions && t.extensions[D.KHR_DRACO_MESH_COMPRESSION] ? s = i(t) : s = Oe(new ze(), t, a), b[d] = { primitive: t, promise: s }, r.push(s);
|
|
1373
1373
|
}
|
|
1374
1374
|
}
|
|
1375
1375
|
return Promise.all(r);
|
|
@@ -1384,39 +1384,39 @@ class Vb {
|
|
|
1384
1384
|
loadMesh(e) {
|
|
1385
1385
|
const a = this, H = this.json, b = this.extensions, i = H.meshes[e], r = i.primitives, f = [];
|
|
1386
1386
|
for (let c = 0, t = r.length; c < t; c++) {
|
|
1387
|
-
const d = r[c].material === void 0 ?
|
|
1387
|
+
const d = r[c].material === void 0 ? Oa(this.cache) : this.getDependency("material", r[c].material);
|
|
1388
1388
|
f.push(d);
|
|
1389
1389
|
}
|
|
1390
1390
|
return f.push(a.loadGeometries(r)), Promise.all(f).then(function(c) {
|
|
1391
1391
|
const t = c.slice(0, c.length - 1), d = c[c.length - 1], o = [];
|
|
1392
|
-
for (let k = 0,
|
|
1393
|
-
const
|
|
1394
|
-
let
|
|
1395
|
-
const
|
|
1396
|
-
if (
|
|
1397
|
-
|
|
1398
|
-
else if (
|
|
1399
|
-
|
|
1400
|
-
else if (
|
|
1401
|
-
|
|
1402
|
-
else if (
|
|
1403
|
-
|
|
1404
|
-
else if (
|
|
1405
|
-
|
|
1392
|
+
for (let k = 0, l = d.length; k < l; k++) {
|
|
1393
|
+
const u = d[k], h = r[k];
|
|
1394
|
+
let m;
|
|
1395
|
+
const g = t[k];
|
|
1396
|
+
if (h.mode === t0.TRIANGLES || h.mode === t0.TRIANGLE_STRIP || h.mode === t0.TRIANGLE_FAN || h.mode === void 0)
|
|
1397
|
+
m = i.isSkinnedMesh === !0 ? new E2(u, g) : new Ze(u, g), m.isSkinnedMesh === !0 && m.normalizeSkinWeights(), h.mode === t0.TRIANGLE_STRIP ? m.geometry = Te(m.geometry, qe) : h.mode === t0.TRIANGLE_FAN && (m.geometry = Te(m.geometry, ce));
|
|
1398
|
+
else if (h.mode === t0.LINES)
|
|
1399
|
+
m = new G2(u, g);
|
|
1400
|
+
else if (h.mode === t0.LINE_STRIP)
|
|
1401
|
+
m = new U2(u, g);
|
|
1402
|
+
else if (h.mode === t0.LINE_LOOP)
|
|
1403
|
+
m = new x2(u, g);
|
|
1404
|
+
else if (h.mode === t0.POINTS)
|
|
1405
|
+
m = new P2(u, g);
|
|
1406
1406
|
else
|
|
1407
|
-
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " +
|
|
1408
|
-
Object.keys(
|
|
1407
|
+
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + h.mode);
|
|
1408
|
+
Object.keys(m.geometry.morphAttributes).length > 0 && Ga(m, i), m.name = a.createUniqueName(i.name || "mesh_" + e), g0(m, i), h.extensions && N0(b, m, h), a.assignFinalMaterial(m), o.push(m);
|
|
1409
1409
|
}
|
|
1410
|
-
for (let k = 0,
|
|
1410
|
+
for (let k = 0, l = o.length; k < l; k++)
|
|
1411
1411
|
a.associations.set(o[k], {
|
|
1412
1412
|
meshes: e,
|
|
1413
1413
|
primitives: k
|
|
1414
1414
|
});
|
|
1415
1415
|
if (o.length === 1)
|
|
1416
|
-
return i.extensions &&
|
|
1417
|
-
const s = new
|
|
1418
|
-
i.extensions &&
|
|
1419
|
-
for (let k = 0,
|
|
1416
|
+
return i.extensions && N0(b, o[0], i), o[0];
|
|
1417
|
+
const s = new Z0();
|
|
1418
|
+
i.extensions && N0(b, s, i), a.associations.set(s, { meshes: e });
|
|
1419
|
+
for (let k = 0, l = o.length; k < l; k++)
|
|
1420
1420
|
s.add(o[k]);
|
|
1421
1421
|
return s;
|
|
1422
1422
|
});
|
|
@@ -1435,7 +1435,7 @@ class Vb {
|
|
|
1435
1435
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
1436
1436
|
return;
|
|
1437
1437
|
}
|
|
1438
|
-
return H.type === "perspective" ? a = new
|
|
1438
|
+
return H.type === "perspective" ? a = new B2(q2.radToDeg(b.yfov), b.aspectRatio || 1, b.znear || 1, b.zfar || 2e6) : H.type === "orthographic" && (a = new V2(-b.xmag, b.xmag, b.ymag, -b.ymag, b.znear, b.zfar)), H.name && (a.name = this.createUniqueName(H.name)), g0(a, H), Promise.resolve(a);
|
|
1439
1439
|
}
|
|
1440
1440
|
/**
|
|
1441
1441
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
@@ -1454,12 +1454,12 @@ class Vb {
|
|
|
1454
1454
|
const o = r[t];
|
|
1455
1455
|
if (o) {
|
|
1456
1456
|
f.push(o);
|
|
1457
|
-
const s = new
|
|
1457
|
+
const s = new J0();
|
|
1458
1458
|
i !== null && s.fromArray(i.array, t * 16), c.push(s);
|
|
1459
1459
|
} else
|
|
1460
1460
|
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', a.joints[t]);
|
|
1461
1461
|
}
|
|
1462
|
-
return new
|
|
1462
|
+
return new W2(f, c);
|
|
1463
1463
|
});
|
|
1464
1464
|
}
|
|
1465
1465
|
/**
|
|
@@ -1472,8 +1472,8 @@ class Vb {
|
|
|
1472
1472
|
loadAnimation(e) {
|
|
1473
1473
|
const a = this.json, H = this, b = a.animations[e], i = b.name ? b.name : "animation_" + e, r = [], f = [], c = [], t = [], d = [];
|
|
1474
1474
|
for (let o = 0, s = b.channels.length; o < s; o++) {
|
|
1475
|
-
const k = b.channels[o],
|
|
1476
|
-
|
|
1475
|
+
const k = b.channels[o], l = b.samplers[k.sampler], u = k.target, h = u.node, m = b.parameters !== void 0 ? b.parameters[l.input] : l.input, g = b.parameters !== void 0 ? b.parameters[l.output] : l.output;
|
|
1476
|
+
u.node !== void 0 && (r.push(this.getDependency("node", h)), f.push(this.getDependency("accessor", m)), c.push(this.getDependency("accessor", g)), t.push(l), d.push(u));
|
|
1477
1477
|
}
|
|
1478
1478
|
return Promise.all([
|
|
1479
1479
|
Promise.all(r),
|
|
@@ -1482,17 +1482,17 @@ class Vb {
|
|
|
1482
1482
|
Promise.all(t),
|
|
1483
1483
|
Promise.all(d)
|
|
1484
1484
|
]).then(function(o) {
|
|
1485
|
-
const s = o[0], k = o[1],
|
|
1486
|
-
for (let
|
|
1487
|
-
const
|
|
1488
|
-
if (
|
|
1489
|
-
|
|
1490
|
-
const
|
|
1491
|
-
if (
|
|
1492
|
-
for (let
|
|
1493
|
-
|
|
1485
|
+
const s = o[0], k = o[1], l = o[2], u = o[3], h = o[4], m = [];
|
|
1486
|
+
for (let g = 0, A = s.length; g < A; g++) {
|
|
1487
|
+
const p = s[g], w = k[g], F = l[g], v = u[g], B = h[g];
|
|
1488
|
+
if (p === void 0) continue;
|
|
1489
|
+
p.updateMatrix && p.updateMatrix();
|
|
1490
|
+
const W = H._createAnimationTracks(p, w, F, v, B);
|
|
1491
|
+
if (W)
|
|
1492
|
+
for (let E = 0; E < W.length; E++)
|
|
1493
|
+
m.push(W[E]);
|
|
1494
1494
|
}
|
|
1495
|
-
return new
|
|
1495
|
+
return new C2(i, void 0, m);
|
|
1496
1496
|
});
|
|
1497
1497
|
}
|
|
1498
1498
|
createNodeMesh(e) {
|
|
@@ -1525,9 +1525,9 @@ class Vb {
|
|
|
1525
1525
|
]).then(function(t) {
|
|
1526
1526
|
const d = t[0], o = t[1], s = t[2];
|
|
1527
1527
|
s !== null && d.traverse(function(k) {
|
|
1528
|
-
k.isSkinnedMesh && k.bind(s,
|
|
1528
|
+
k.isSkinnedMesh && k.bind(s, Pa);
|
|
1529
1529
|
});
|
|
1530
|
-
for (let k = 0,
|
|
1530
|
+
for (let k = 0, l = o.length; k < l; k++)
|
|
1531
1531
|
d.add(o[k]);
|
|
1532
1532
|
return d;
|
|
1533
1533
|
});
|
|
@@ -1549,11 +1549,11 @@ class Vb {
|
|
|
1549
1549
|
f.push(t);
|
|
1550
1550
|
}), this.nodeCache[e] = Promise.all(f).then(function(t) {
|
|
1551
1551
|
let d;
|
|
1552
|
-
if (i.isBone === !0 ? d = new
|
|
1552
|
+
if (i.isBone === !0 ? d = new L2() : t.length > 1 ? d = new Z0() : t.length === 1 ? d = t[0] : d = new We(), d !== t[0])
|
|
1553
1553
|
for (let o = 0, s = t.length; o < s; o++)
|
|
1554
1554
|
d.add(t[o]);
|
|
1555
|
-
if (i.name && (d.userData.name = i.name, d.name = r),
|
|
1556
|
-
const o = new
|
|
1555
|
+
if (i.name && (d.userData.name = i.name, d.name = r), g0(d, i), i.extensions && N0(H, d, i), i.matrix !== void 0) {
|
|
1556
|
+
const o = new J0();
|
|
1557
1557
|
o.fromArray(i.matrix), d.applyMatrix4(o);
|
|
1558
1558
|
} else
|
|
1559
1559
|
i.translation !== void 0 && d.position.fromArray(i.translation), i.rotation !== void 0 && d.quaternion.fromArray(i.rotation), i.scale !== void 0 && d.scale.fromArray(i.scale);
|
|
@@ -1574,8 +1574,8 @@ class Vb {
|
|
|
1574
1574
|
* @return {Promise<Group>}
|
|
1575
1575
|
*/
|
|
1576
1576
|
loadScene(e) {
|
|
1577
|
-
const a = this.extensions, H = this.json.scenes[e], b = this, i = new
|
|
1578
|
-
H.name && (i.name = b.createUniqueName(H.name)),
|
|
1577
|
+
const a = this.extensions, H = this.json.scenes[e], b = this, i = new Z0();
|
|
1578
|
+
H.name && (i.name = b.createUniqueName(H.name)), g0(i, H), H.extensions && N0(a, i, H);
|
|
1579
1579
|
const r = H.nodes || [], f = [];
|
|
1580
1580
|
for (let c = 0, t = r.length; c < t; c++)
|
|
1581
1581
|
f.push(b.getDependency("node", r[c]));
|
|
@@ -1585,7 +1585,7 @@ class Vb {
|
|
|
1585
1585
|
const t = (d) => {
|
|
1586
1586
|
const o = /* @__PURE__ */ new Map();
|
|
1587
1587
|
for (const [s, k] of b.associations)
|
|
1588
|
-
(s instanceof
|
|
1588
|
+
(s instanceof K0 || s instanceof ye) && o.set(s, k);
|
|
1589
1589
|
return d.traverse((s) => {
|
|
1590
1590
|
const k = b.associations.get(s);
|
|
1591
1591
|
k != null && o.set(s, k);
|
|
@@ -1596,50 +1596,50 @@ class Vb {
|
|
|
1596
1596
|
}
|
|
1597
1597
|
_createAnimationTracks(e, a, H, b, i) {
|
|
1598
1598
|
const r = [], f = e.name ? e.name : e.uuid, c = [];
|
|
1599
|
-
|
|
1599
|
+
_0[i.path] === _0.weights ? e.traverse(function(s) {
|
|
1600
1600
|
s.morphTargetInfluences && c.push(s.name ? s.name : s.uuid);
|
|
1601
1601
|
}) : c.push(f);
|
|
1602
1602
|
let t;
|
|
1603
|
-
switch (
|
|
1604
|
-
case
|
|
1605
|
-
t =
|
|
1603
|
+
switch (_0[i.path]) {
|
|
1604
|
+
case _0.weights:
|
|
1605
|
+
t = Fe;
|
|
1606
1606
|
break;
|
|
1607
|
-
case
|
|
1608
|
-
t =
|
|
1607
|
+
case _0.rotation:
|
|
1608
|
+
t = ve;
|
|
1609
1609
|
break;
|
|
1610
|
-
case
|
|
1611
|
-
case
|
|
1612
|
-
t =
|
|
1610
|
+
case _0.translation:
|
|
1611
|
+
case _0.scale:
|
|
1612
|
+
t = we;
|
|
1613
1613
|
break;
|
|
1614
1614
|
default:
|
|
1615
1615
|
switch (H.itemSize) {
|
|
1616
1616
|
case 1:
|
|
1617
|
-
t =
|
|
1617
|
+
t = Fe;
|
|
1618
1618
|
break;
|
|
1619
1619
|
case 2:
|
|
1620
1620
|
case 3:
|
|
1621
1621
|
default:
|
|
1622
|
-
t =
|
|
1622
|
+
t = we;
|
|
1623
1623
|
break;
|
|
1624
1624
|
}
|
|
1625
1625
|
break;
|
|
1626
1626
|
}
|
|
1627
|
-
const d = b.interpolation !== void 0 ?
|
|
1627
|
+
const d = b.interpolation !== void 0 ? Da[b.interpolation] : Qe, o = this._getArrayFromAccessor(H);
|
|
1628
1628
|
for (let s = 0, k = c.length; s < k; s++) {
|
|
1629
|
-
const
|
|
1630
|
-
c[s] + "." +
|
|
1629
|
+
const l = new t(
|
|
1630
|
+
c[s] + "." + _0[i.path],
|
|
1631
1631
|
a.array,
|
|
1632
1632
|
o,
|
|
1633
1633
|
d
|
|
1634
1634
|
);
|
|
1635
|
-
b.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(
|
|
1635
|
+
b.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(l), r.push(l);
|
|
1636
1636
|
}
|
|
1637
1637
|
return r;
|
|
1638
1638
|
}
|
|
1639
1639
|
_getArrayFromAccessor(e) {
|
|
1640
1640
|
let a = e.array;
|
|
1641
1641
|
if (e.normalized) {
|
|
1642
|
-
const H =
|
|
1642
|
+
const H = oe(a.constructor), b = new Float32Array(a.length);
|
|
1643
1643
|
for (let i = 0, r = a.length; i < r; i++)
|
|
1644
1644
|
b[i] = a[i] * H;
|
|
1645
1645
|
a = b;
|
|
@@ -1648,21 +1648,21 @@ class Vb {
|
|
|
1648
1648
|
}
|
|
1649
1649
|
_createCubicSplineTrackInterpolant(e) {
|
|
1650
1650
|
e.createInterpolant = function(H) {
|
|
1651
|
-
const b = this instanceof
|
|
1651
|
+
const b = this instanceof ve ? Ma : Ke;
|
|
1652
1652
|
return new b(this.times, this.values, this.getValueSize() / 3, H);
|
|
1653
1653
|
}, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
|
|
1654
1654
|
}
|
|
1655
1655
|
}
|
|
1656
|
-
function
|
|
1657
|
-
const H = e.attributes, b = new
|
|
1656
|
+
function qa(n, e, a) {
|
|
1657
|
+
const H = e.attributes, b = new W0();
|
|
1658
1658
|
if (H.POSITION !== void 0) {
|
|
1659
1659
|
const f = a.json.accessors[H.POSITION], c = f.min, t = f.max;
|
|
1660
1660
|
if (c !== void 0 && t !== void 0) {
|
|
1661
1661
|
if (b.set(
|
|
1662
|
-
new
|
|
1663
|
-
new
|
|
1662
|
+
new y(c[0], c[1], c[2]),
|
|
1663
|
+
new y(t[0], t[1], t[2])
|
|
1664
1664
|
), f.normalized) {
|
|
1665
|
-
const d =
|
|
1665
|
+
const d = oe(E0[f.componentType]);
|
|
1666
1666
|
b.min.multiplyScalar(d), b.max.multiplyScalar(d);
|
|
1667
1667
|
}
|
|
1668
1668
|
} else {
|
|
@@ -1673,15 +1673,15 @@ function Cb(n, e, a) {
|
|
|
1673
1673
|
return;
|
|
1674
1674
|
const i = e.targets;
|
|
1675
1675
|
if (i !== void 0) {
|
|
1676
|
-
const f = new
|
|
1676
|
+
const f = new y(), c = new y();
|
|
1677
1677
|
for (let t = 0, d = i.length; t < d; t++) {
|
|
1678
1678
|
const o = i[t];
|
|
1679
1679
|
if (o.POSITION !== void 0) {
|
|
1680
|
-
const s = a.json.accessors[o.POSITION], k = s.min,
|
|
1681
|
-
if (k !== void 0 &&
|
|
1682
|
-
if (c.setX(Math.max(Math.abs(k[0]), Math.abs(
|
|
1683
|
-
const
|
|
1684
|
-
c.multiplyScalar(
|
|
1680
|
+
const s = a.json.accessors[o.POSITION], k = s.min, l = s.max;
|
|
1681
|
+
if (k !== void 0 && l !== void 0) {
|
|
1682
|
+
if (c.setX(Math.max(Math.abs(k[0]), Math.abs(l[0]))), c.setY(Math.max(Math.abs(k[1]), Math.abs(l[1]))), c.setZ(Math.max(Math.abs(k[2]), Math.abs(l[2]))), s.normalized) {
|
|
1683
|
+
const u = oe(E0[s.componentType]);
|
|
1684
|
+
c.multiplyScalar(u);
|
|
1685
1685
|
}
|
|
1686
1686
|
f.max(c);
|
|
1687
1687
|
} else
|
|
@@ -1691,10 +1691,10 @@ function Cb(n, e, a) {
|
|
|
1691
1691
|
b.expandByVector(f);
|
|
1692
1692
|
}
|
|
1693
1693
|
n.boundingBox = b;
|
|
1694
|
-
const r = new
|
|
1694
|
+
const r = new J2();
|
|
1695
1695
|
b.getCenter(r.center), r.radius = b.min.distanceTo(b.max) / 2, n.boundingSphere = r;
|
|
1696
1696
|
}
|
|
1697
|
-
function
|
|
1697
|
+
function Oe(n, e, a) {
|
|
1698
1698
|
const H = e.attributes, b = [];
|
|
1699
1699
|
function i(r, f) {
|
|
1700
1700
|
return a.getDependency("accessor", r).then(function(c) {
|
|
@@ -1702,7 +1702,7 @@ function x2(n, e, a) {
|
|
|
1702
1702
|
});
|
|
1703
1703
|
}
|
|
1704
1704
|
for (const r in H) {
|
|
1705
|
-
const f =
|
|
1705
|
+
const f = de[r] || r.toLowerCase();
|
|
1706
1706
|
f in n.attributes || b.push(i(H[r], f));
|
|
1707
1707
|
}
|
|
1708
1708
|
if (e.indices !== void 0 && !n.index) {
|
|
@@ -1711,12 +1711,12 @@ function x2(n, e, a) {
|
|
|
1711
1711
|
});
|
|
1712
1712
|
b.push(r);
|
|
1713
1713
|
}
|
|
1714
|
-
return
|
|
1715
|
-
return e.targets !== void 0 ?
|
|
1714
|
+
return ne.workingColorSpace !== l0 && "COLOR_0" in H && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${ne.workingColorSpace}" not supported.`), g0(n, e), qa(n, e, a), Promise.all(b).then(function() {
|
|
1715
|
+
return e.targets !== void 0 ? Ea(n, e.targets, a) : n;
|
|
1716
1716
|
});
|
|
1717
1717
|
}
|
|
1718
|
-
const
|
|
1719
|
-
class
|
|
1718
|
+
const ae = /* @__PURE__ */ new WeakMap();
|
|
1719
|
+
class Va extends Ve {
|
|
1720
1720
|
/**
|
|
1721
1721
|
* Constructs a new Draco loader.
|
|
1722
1722
|
*
|
|
@@ -1773,7 +1773,7 @@ class Lb extends L2 {
|
|
|
1773
1773
|
* @param {onErrorCallback} onError - Executed when errors occur.
|
|
1774
1774
|
*/
|
|
1775
1775
|
load(e, a, H, b) {
|
|
1776
|
-
const i = new
|
|
1776
|
+
const i = new Q0(this.manager);
|
|
1777
1777
|
i.setPath(this.path), i.setResponseType("arraybuffer"), i.setRequestHeader(this.requestHeader), i.setWithCredentials(this.withCredentials), i.load(e, (r) => {
|
|
1778
1778
|
this.parse(r, a, b);
|
|
1779
1779
|
}, H, b);
|
|
@@ -1787,10 +1787,10 @@ class Lb extends L2 {
|
|
|
1787
1787
|
*/
|
|
1788
1788
|
parse(e, a, H = () => {
|
|
1789
1789
|
}) {
|
|
1790
|
-
this.decodeDracoFile(e, a, null, null,
|
|
1790
|
+
this.decodeDracoFile(e, a, null, null, A0, H).catch(H);
|
|
1791
1791
|
}
|
|
1792
1792
|
//
|
|
1793
|
-
decodeDracoFile(e, a, H, b, i =
|
|
1793
|
+
decodeDracoFile(e, a, H, b, i = l0, r = () => {
|
|
1794
1794
|
}) {
|
|
1795
1795
|
const f = {
|
|
1796
1796
|
attributeIDs: H || this.defaultAttributeIDs,
|
|
@@ -1802,8 +1802,8 @@ class Lb extends L2 {
|
|
|
1802
1802
|
}
|
|
1803
1803
|
decodeGeometry(e, a) {
|
|
1804
1804
|
const H = JSON.stringify(a);
|
|
1805
|
-
if (
|
|
1806
|
-
const c =
|
|
1805
|
+
if (ae.has(e)) {
|
|
1806
|
+
const c = ae.get(e);
|
|
1807
1807
|
if (c.key === H)
|
|
1808
1808
|
return c.promise;
|
|
1809
1809
|
if (e.byteLength === 0)
|
|
@@ -1817,28 +1817,28 @@ class Lb extends L2 {
|
|
|
1817
1817
|
}))).then((c) => this._createGeometry(c.geometry));
|
|
1818
1818
|
return f.catch(() => !0).then(() => {
|
|
1819
1819
|
b && i && this._releaseTask(b, i);
|
|
1820
|
-
}),
|
|
1820
|
+
}), ae.set(e, {
|
|
1821
1821
|
key: H,
|
|
1822
1822
|
promise: f
|
|
1823
1823
|
}), f;
|
|
1824
1824
|
}
|
|
1825
1825
|
_createGeometry(e) {
|
|
1826
|
-
const a = new
|
|
1827
|
-
e.index && a.setIndex(new
|
|
1826
|
+
const a = new ze();
|
|
1827
|
+
e.index && a.setIndex(new V0(e.index.array, 1));
|
|
1828
1828
|
for (let H = 0; H < e.attributes.length; H++) {
|
|
1829
|
-
const b = e.attributes[H], i = b.name, r = b.array, f = b.itemSize, c = new
|
|
1829
|
+
const b = e.attributes[H], i = b.name, r = b.array, f = b.itemSize, c = new V0(r, f);
|
|
1830
1830
|
i === "color" && (this._assignVertexColorSpace(c, b.vertexColorSpace), c.normalized = !(r instanceof Float32Array)), a.setAttribute(i, c);
|
|
1831
1831
|
}
|
|
1832
1832
|
return a;
|
|
1833
1833
|
}
|
|
1834
1834
|
_assignVertexColorSpace(e, a) {
|
|
1835
|
-
if (a !==
|
|
1836
|
-
const H = new
|
|
1835
|
+
if (a !== A0) return;
|
|
1836
|
+
const H = new k0();
|
|
1837
1837
|
for (let b = 0, i = e.count; b < i; b++)
|
|
1838
|
-
H.fromBufferAttribute(e, b),
|
|
1838
|
+
H.fromBufferAttribute(e, b), ne.colorSpaceToWorking(H, A0), e.setXYZ(b, H.r, H.g, H.b);
|
|
1839
1839
|
}
|
|
1840
1840
|
_loadLibrary(e, a) {
|
|
1841
|
-
const H = new
|
|
1841
|
+
const H = new Q0(this.manager);
|
|
1842
1842
|
return H.setPath(this.decoderPath), H.setResponseType(a), H.setWithCredentials(this.withCredentials), new Promise((b, i) => {
|
|
1843
1843
|
H.load(e, b, void 0, i);
|
|
1844
1844
|
});
|
|
@@ -1852,7 +1852,7 @@ class Lb extends L2 {
|
|
|
1852
1852
|
return e ? a.push(this._loadLibrary("draco_decoder.js", "text")) : (a.push(this._loadLibrary("draco_wasm_wrapper.js", "text")), a.push(this._loadLibrary("draco_decoder.wasm", "arraybuffer"))), this.decoderPending = Promise.all(a).then((H) => {
|
|
1853
1853
|
const b = H[0];
|
|
1854
1854
|
e || (this.decoderConfig.wasmBinary = H[1]);
|
|
1855
|
-
const i =
|
|
1855
|
+
const i = Wa.toString(), r = [
|
|
1856
1856
|
"/* draco decoder */",
|
|
1857
1857
|
b,
|
|
1858
1858
|
"",
|
|
@@ -1900,7 +1900,7 @@ class Lb extends L2 {
|
|
|
1900
1900
|
return this.workerPool.length = 0, this.workerSourceURL !== "" && URL.revokeObjectURL(this.workerSourceURL), this;
|
|
1901
1901
|
}
|
|
1902
1902
|
}
|
|
1903
|
-
function
|
|
1903
|
+
function Wa() {
|
|
1904
1904
|
let n, e;
|
|
1905
1905
|
onmessage = function(r) {
|
|
1906
1906
|
const f = r.data;
|
|
@@ -1917,8 +1917,8 @@ function Sb() {
|
|
|
1917
1917
|
e.then((d) => {
|
|
1918
1918
|
const o = d.draco, s = new o.Decoder();
|
|
1919
1919
|
try {
|
|
1920
|
-
const k = a(o, s, new Int8Array(c), t),
|
|
1921
|
-
k.index &&
|
|
1920
|
+
const k = a(o, s, new Int8Array(c), t), l = k.attributes.map((u) => u.array.buffer);
|
|
1921
|
+
k.index && l.push(k.index.array.buffer), self.postMessage({ type: "decode", id: f.id, geometry: k }, l);
|
|
1922
1922
|
} catch (k) {
|
|
1923
1923
|
console.error(k), self.postMessage({ type: "error", id: f.id, error: k.message });
|
|
1924
1924
|
} finally {
|
|
@@ -1931,29 +1931,29 @@ function Sb() {
|
|
|
1931
1931
|
function a(r, f, c, t) {
|
|
1932
1932
|
const d = t.attributeIDs, o = t.attributeTypes;
|
|
1933
1933
|
let s, k;
|
|
1934
|
-
const
|
|
1935
|
-
if (
|
|
1934
|
+
const l = f.GetEncodedGeometryType(c);
|
|
1935
|
+
if (l === r.TRIANGULAR_MESH)
|
|
1936
1936
|
s = new r.Mesh(), k = f.DecodeArrayToMesh(c, c.byteLength, s);
|
|
1937
|
-
else if (
|
|
1937
|
+
else if (l === r.POINT_CLOUD)
|
|
1938
1938
|
s = new r.PointCloud(), k = f.DecodeArrayToPointCloud(c, c.byteLength, s);
|
|
1939
1939
|
else
|
|
1940
1940
|
throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
|
|
1941
1941
|
if (!k.ok() || s.ptr === 0)
|
|
1942
1942
|
throw new Error("THREE.DRACOLoader: Decoding failed: " + k.error_msg());
|
|
1943
|
-
const
|
|
1944
|
-
for (const
|
|
1945
|
-
const
|
|
1946
|
-
let
|
|
1943
|
+
const u = { index: null, attributes: [] };
|
|
1944
|
+
for (const h in d) {
|
|
1945
|
+
const m = self[o[h]];
|
|
1946
|
+
let g, A;
|
|
1947
1947
|
if (t.useUniqueIDs)
|
|
1948
|
-
|
|
1948
|
+
A = d[h], g = f.GetAttributeByUniqueId(s, A);
|
|
1949
1949
|
else {
|
|
1950
|
-
if (
|
|
1951
|
-
|
|
1950
|
+
if (A = f.GetAttributeId(s, r[d[h]]), A === -1) continue;
|
|
1951
|
+
g = f.GetAttribute(s, A);
|
|
1952
1952
|
}
|
|
1953
|
-
const
|
|
1954
|
-
|
|
1953
|
+
const p = b(r, f, s, h, m, g);
|
|
1954
|
+
h === "color" && (p.vertexColorSpace = t.vertexColorSpace), u.attributes.push(p);
|
|
1955
1955
|
}
|
|
1956
|
-
return
|
|
1956
|
+
return l === r.TRIANGULAR_MESH && (u.index = H(r, f, s)), r.destroy(s), u;
|
|
1957
1957
|
}
|
|
1958
1958
|
function H(r, f, c) {
|
|
1959
1959
|
const d = c.num_faces() * 3, o = d * 4, s = r._malloc(o);
|
|
@@ -1962,12 +1962,12 @@ function Sb() {
|
|
|
1962
1962
|
return r._free(s), { array: k, itemSize: 1 };
|
|
1963
1963
|
}
|
|
1964
1964
|
function b(r, f, c, t, d, o) {
|
|
1965
|
-
const s = o.num_components(),
|
|
1966
|
-
f.GetAttributeDataArrayForAllPoints(c, o,
|
|
1967
|
-
const
|
|
1968
|
-
return r._free(
|
|
1965
|
+
const s = o.num_components(), l = c.num_points() * s, u = l * d.BYTES_PER_ELEMENT, h = i(r, d), m = r._malloc(u);
|
|
1966
|
+
f.GetAttributeDataArrayForAllPoints(c, o, h, u, m);
|
|
1967
|
+
const g = new d(r.HEAPF32.buffer, m, l).slice();
|
|
1968
|
+
return r._free(m), {
|
|
1969
1969
|
name: t,
|
|
1970
|
-
array:
|
|
1970
|
+
array: g,
|
|
1971
1971
|
itemSize: s
|
|
1972
1972
|
};
|
|
1973
1973
|
}
|
|
@@ -1990,7 +1990,7 @@ function Sb() {
|
|
|
1990
1990
|
}
|
|
1991
1991
|
}
|
|
1992
1992
|
}
|
|
1993
|
-
const
|
|
1993
|
+
const Ca = `
|
|
1994
1994
|
var DracoDecoderModule = (() => {
|
|
1995
1995
|
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
|
1996
1996
|
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
|
@@ -2025,8 +2025,8 @@ else if (typeof define === 'function' && define['amd'])
|
|
|
2025
2025
|
else if (typeof exports === 'object')
|
|
2026
2026
|
exports["DracoDecoderModule"] = DracoDecoderModule;
|
|
2027
2027
|
`;
|
|
2028
|
-
function
|
|
2029
|
-
const n =
|
|
2028
|
+
function La() {
|
|
2029
|
+
const n = c0(!1), e = c0(""), a = H2([]), H = c0(null), b = new ba(), i = new ia(), r = new ra(), f = new ca();
|
|
2030
2030
|
let c = null;
|
|
2031
2031
|
return {
|
|
2032
2032
|
isLoading: n,
|
|
@@ -2034,68 +2034,68 @@ function Qb() {
|
|
|
2034
2034
|
loadedModels: a,
|
|
2035
2035
|
error: H,
|
|
2036
2036
|
loadModelsFromBlobs: async (d) => {
|
|
2037
|
-
var
|
|
2037
|
+
var l;
|
|
2038
2038
|
if (!d || d.length === 0) {
|
|
2039
2039
|
console.warn("loadModelsFromBlobs 加载的文件数组为空!");
|
|
2040
2040
|
return;
|
|
2041
2041
|
}
|
|
2042
2042
|
n.value = !0, e.value = "准备加载...", a.value = [], H.value = null;
|
|
2043
2043
|
const o = /* @__PURE__ */ new Map();
|
|
2044
|
-
d.forEach((
|
|
2045
|
-
|
|
2044
|
+
d.forEach((u) => {
|
|
2045
|
+
u instanceof File && o.set(u.name.toLowerCase(), u);
|
|
2046
2046
|
});
|
|
2047
2047
|
const s = [], k = [];
|
|
2048
2048
|
try {
|
|
2049
|
-
for (const
|
|
2050
|
-
const
|
|
2051
|
-
if (
|
|
2052
|
-
const
|
|
2053
|
-
s.push(
|
|
2054
|
-
let
|
|
2055
|
-
const
|
|
2056
|
-
const
|
|
2057
|
-
e.value = `正在加载 ${
|
|
2049
|
+
for (const u of d) {
|
|
2050
|
+
const h = u.name || "unknown_file", m = (l = h.split(".").pop()) == null ? void 0 : l.toLowerCase();
|
|
2051
|
+
if (m === "mtl") continue;
|
|
2052
|
+
const g = URL.createObjectURL(u);
|
|
2053
|
+
s.push(g);
|
|
2054
|
+
let A = null;
|
|
2055
|
+
const p = (w) => {
|
|
2056
|
+
const F = w.lengthComputable ? w.loaded / w.total * 100 : 0;
|
|
2057
|
+
e.value = `正在加载 ${h}... ${Math.round(F)}%`;
|
|
2058
2058
|
};
|
|
2059
|
-
switch (e.value = `正在加载 ${
|
|
2059
|
+
switch (e.value = `正在加载 ${h}... 0%`, m) {
|
|
2060
2060
|
case "obj":
|
|
2061
|
-
const
|
|
2062
|
-
if (o.has(
|
|
2063
|
-
const
|
|
2064
|
-
s.push(
|
|
2065
|
-
const
|
|
2066
|
-
|
|
2061
|
+
const w = h.replace(/\.obj$/i, ".mtl").toLowerCase();
|
|
2062
|
+
if (o.has(w)) {
|
|
2063
|
+
const E = o.get(w), x = URL.createObjectURL(E);
|
|
2064
|
+
s.push(x);
|
|
2065
|
+
const S = await b.loadAsync(x);
|
|
2066
|
+
S.preload(), i.setMaterials(S);
|
|
2067
2067
|
} else
|
|
2068
2068
|
i.setMaterials(null);
|
|
2069
|
-
|
|
2069
|
+
A = await i.loadAsync(g, p);
|
|
2070
2070
|
break;
|
|
2071
2071
|
case "stl":
|
|
2072
|
-
const
|
|
2073
|
-
|
|
2072
|
+
const F = await r.loadAsync(g, p), v = new Y2({ color: 11184810, specular: 1118481, shininess: 200 });
|
|
2073
|
+
A = new Ze(F, v);
|
|
2074
2074
|
break;
|
|
2075
2075
|
case "gltf":
|
|
2076
|
-
|
|
2076
|
+
A = (await f.loadAsync(g, p)).scene;
|
|
2077
2077
|
break;
|
|
2078
2078
|
case "glb":
|
|
2079
|
-
c || (c = new
|
|
2080
|
-
return
|
|
2081
|
-
}, c.setDecoderConfig({ type: "js" }), c.preload()), f.setDRACOLoader(c),
|
|
2079
|
+
c || (c = new Va(), c._loadLibrary = function(E, x) {
|
|
2080
|
+
return E === "draco_decoder.js" && x === "text" ? Promise.resolve(Ca) : Promise.reject(new Error(`DRACOLoader: 未预期的库请求 ${E}`));
|
|
2081
|
+
}, c.setDecoderConfig({ type: "js" }), c.preload()), f.setDRACOLoader(c), A = (await f.loadAsync(g, p)).scene;
|
|
2082
2082
|
break;
|
|
2083
2083
|
default:
|
|
2084
|
-
console.warn(`不支持的文件类型: .${
|
|
2084
|
+
console.warn(`不支持的文件类型: .${m}`), e.value = `不支持的文件类型: ${h}`;
|
|
2085
2085
|
continue;
|
|
2086
2086
|
}
|
|
2087
|
-
|
|
2087
|
+
A && (A.userData.boundingBox = new W0().setFromObject(A), k.push(A));
|
|
2088
2088
|
}
|
|
2089
2089
|
a.value = k, e.value = "加载完成!";
|
|
2090
|
-
} catch (
|
|
2091
|
-
throw console.error("加载模型时出错:",
|
|
2090
|
+
} catch (u) {
|
|
2091
|
+
throw console.error("加载模型时出错:", u), H.value = `加载失败: ${u.message || "未知错误"}`, e.value = "加载失败!", a.value = [], u;
|
|
2092
2092
|
} finally {
|
|
2093
|
-
n.value = !1, s.forEach((
|
|
2093
|
+
n.value = !1, s.forEach((u) => URL.revokeObjectURL(u));
|
|
2094
2094
|
}
|
|
2095
2095
|
}
|
|
2096
2096
|
};
|
|
2097
2097
|
}
|
|
2098
|
-
function
|
|
2098
|
+
function Sa(n, e = {}) {
|
|
2099
2099
|
const a = {
|
|
2100
2100
|
threeInfo: {},
|
|
2101
2101
|
modelLoader: {},
|
|
@@ -2103,12 +2103,12 @@ function Zb(n, e = {}) {
|
|
|
2103
2103
|
clipping: {},
|
|
2104
2104
|
partAnimation: {},
|
|
2105
2105
|
millPivotAnimation: {}
|
|
2106
|
-
}, H =
|
|
2106
|
+
}, H = X2(n);
|
|
2107
2107
|
a.threeInfo = H;
|
|
2108
2108
|
const { currentModels: b, getThreeJSObjects: i, addBeforeRenderCallback: r, removeBeforeRenderCallback: f } = H, { useModelLoaderHook: c, useAnimationHook: t, useClippingHook: d, usePartAnimationHook: o } = e;
|
|
2109
|
-
if (c && (a.modelLoader =
|
|
2110
|
-
const s =
|
|
2111
|
-
a.partAnimation = s, a.millPivotAnimation =
|
|
2109
|
+
if (c && (a.modelLoader = La()), t && (a.animation = $2(i, b)), d && (a.clipping = ea(i, b)), o) {
|
|
2110
|
+
const s = za(i, b, r, f);
|
|
2111
|
+
a.partAnimation = s, a.millPivotAnimation = db(
|
|
2112
2112
|
b,
|
|
2113
2113
|
i,
|
|
2114
2114
|
s.setPartRotation,
|
|
@@ -2117,94 +2117,94 @@ function Zb(n, e = {}) {
|
|
|
2117
2117
|
}
|
|
2118
2118
|
return a;
|
|
2119
2119
|
}
|
|
2120
|
-
function
|
|
2121
|
-
const b =
|
|
2120
|
+
function za(n, e, a, H) {
|
|
2121
|
+
const b = c0(!1), i = /* @__PURE__ */ new Map();
|
|
2122
2122
|
let r = null;
|
|
2123
|
-
function f(
|
|
2124
|
-
const
|
|
2125
|
-
|
|
2126
|
-
for (const
|
|
2127
|
-
if (
|
|
2128
|
-
for (const
|
|
2129
|
-
const
|
|
2130
|
-
if (
|
|
2123
|
+
function f(g) {
|
|
2124
|
+
const A = /* @__PURE__ */ new Set([g]);
|
|
2125
|
+
A.add(g.replace(/\./g, ""));
|
|
2126
|
+
for (const w of e.value)
|
|
2127
|
+
if (w)
|
|
2128
|
+
for (const F of A) {
|
|
2129
|
+
const v = w.getObjectByName(F);
|
|
2130
|
+
if (v) return v;
|
|
2131
2131
|
}
|
|
2132
|
-
const { scene:
|
|
2133
|
-
if (
|
|
2134
|
-
for (const
|
|
2135
|
-
const
|
|
2136
|
-
if (
|
|
2132
|
+
const { scene: p } = n();
|
|
2133
|
+
if (p)
|
|
2134
|
+
for (const w of A) {
|
|
2135
|
+
const F = p.getObjectByName(w);
|
|
2136
|
+
if (F) return F;
|
|
2137
2137
|
}
|
|
2138
2138
|
return null;
|
|
2139
2139
|
}
|
|
2140
|
-
function c(
|
|
2141
|
-
return
|
|
2142
|
-
const
|
|
2143
|
-
return { name:
|
|
2140
|
+
function c(g) {
|
|
2141
|
+
return g.map((A) => {
|
|
2142
|
+
const p = f(A);
|
|
2143
|
+
return { name: A, object: p, found: !!p };
|
|
2144
2144
|
});
|
|
2145
2145
|
}
|
|
2146
|
-
function t(
|
|
2147
|
-
const
|
|
2148
|
-
return
|
|
2149
|
-
object:
|
|
2150
|
-
axis:
|
|
2151
|
-
speed:
|
|
2152
|
-
direction:
|
|
2153
|
-
}), !0) : (console.warn(`[usePartAnimation] 未找到部件: "${
|
|
2154
|
-
}
|
|
2155
|
-
function d(
|
|
2156
|
-
return
|
|
2157
|
-
object:
|
|
2158
|
-
axis:
|
|
2159
|
-
speed:
|
|
2160
|
-
direction:
|
|
2161
|
-
pivot:
|
|
2162
|
-
}), !0) : (console.warn(`[usePartAnimation] pivot 为空: "${
|
|
2163
|
-
}
|
|
2164
|
-
function o(
|
|
2165
|
-
let
|
|
2166
|
-
return
|
|
2167
|
-
t(
|
|
2168
|
-
}),
|
|
2169
|
-
}
|
|
2170
|
-
function s(
|
|
2171
|
-
i.delete(
|
|
2146
|
+
function t(g, A) {
|
|
2147
|
+
const p = f(g);
|
|
2148
|
+
return p ? (i.set(g, {
|
|
2149
|
+
object: p,
|
|
2150
|
+
axis: A.axis,
|
|
2151
|
+
speed: A.speed,
|
|
2152
|
+
direction: A.direction ?? 1
|
|
2153
|
+
}), !0) : (console.warn(`[usePartAnimation] 未找到部件: "${g}"`), !1);
|
|
2154
|
+
}
|
|
2155
|
+
function d(g, A, p, w) {
|
|
2156
|
+
return A ? p ? (i.set(g, {
|
|
2157
|
+
object: A,
|
|
2158
|
+
axis: w.axis,
|
|
2159
|
+
speed: w.speed,
|
|
2160
|
+
direction: w.direction ?? 1,
|
|
2161
|
+
pivot: p
|
|
2162
|
+
}), !0) : (console.warn(`[usePartAnimation] pivot 为空: "${g}"`), !1) : (console.warn(`[usePartAnimation] 未找到部件: "${g}"`), !1);
|
|
2163
|
+
}
|
|
2164
|
+
function o(g) {
|
|
2165
|
+
let A = 0;
|
|
2166
|
+
return g.forEach(({ partName: p, axis: w, speed: F, direction: v }) => {
|
|
2167
|
+
t(p, { axis: w, speed: F, direction: v }) && A++;
|
|
2168
|
+
}), A;
|
|
2169
|
+
}
|
|
2170
|
+
function s(g) {
|
|
2171
|
+
i.delete(g);
|
|
2172
2172
|
}
|
|
2173
2173
|
function k() {
|
|
2174
2174
|
i.clear();
|
|
2175
2175
|
}
|
|
2176
|
-
function
|
|
2177
|
-
const
|
|
2178
|
-
return i.forEach((
|
|
2179
|
-
|
|
2180
|
-
name:
|
|
2181
|
-
axis:
|
|
2182
|
-
speed:
|
|
2183
|
-
direction:
|
|
2184
|
-
found: !!
|
|
2176
|
+
function l() {
|
|
2177
|
+
const g = [];
|
|
2178
|
+
return i.forEach((A, p) => {
|
|
2179
|
+
g.push({
|
|
2180
|
+
name: p,
|
|
2181
|
+
axis: A.axis,
|
|
2182
|
+
speed: A.speed,
|
|
2183
|
+
direction: A.direction,
|
|
2184
|
+
found: !!A.object
|
|
2185
2185
|
});
|
|
2186
|
-
}),
|
|
2186
|
+
}), g;
|
|
2187
2187
|
}
|
|
2188
|
-
function
|
|
2188
|
+
function u() {
|
|
2189
2189
|
if (!b.value) {
|
|
2190
2190
|
if (i.size === 0) {
|
|
2191
2191
|
console.warn("[usePartAnimation] 没有配置任何部件旋转");
|
|
2192
2192
|
return;
|
|
2193
2193
|
}
|
|
2194
|
-
b.value = !0, r = (
|
|
2195
|
-
b.value && i.forEach((
|
|
2196
|
-
if (!
|
|
2197
|
-
const
|
|
2198
|
-
|
|
2194
|
+
b.value = !0, r = (g) => {
|
|
2195
|
+
b.value && i.forEach((A) => {
|
|
2196
|
+
if (!A.object) return;
|
|
2197
|
+
const p = A.pivot ?? A.object, w = A.axis;
|
|
2198
|
+
p.rotation[w] += A.direction * A.speed * g;
|
|
2199
2199
|
});
|
|
2200
2200
|
}, a(r);
|
|
2201
2201
|
}
|
|
2202
2202
|
}
|
|
2203
|
-
function
|
|
2203
|
+
function h() {
|
|
2204
2204
|
b.value = !1, r && (H(r), r = null);
|
|
2205
2205
|
}
|
|
2206
|
-
function
|
|
2207
|
-
b.value ?
|
|
2206
|
+
function m() {
|
|
2207
|
+
b.value ? h() : u();
|
|
2208
2208
|
}
|
|
2209
2209
|
return {
|
|
2210
2210
|
isPartAnimating: b,
|
|
@@ -2215,23 +2215,23 @@ function Jb(n, e, a, H) {
|
|
|
2215
2215
|
setPartRotations: o,
|
|
2216
2216
|
removePartRotation: s,
|
|
2217
2217
|
clearAllPartRotations: k,
|
|
2218
|
-
getPartAnimationStatus:
|
|
2219
|
-
startPartAnimations:
|
|
2220
|
-
stopPartAnimations:
|
|
2221
|
-
togglePartAnimations:
|
|
2218
|
+
getPartAnimationStatus: l,
|
|
2219
|
+
startPartAnimations: u,
|
|
2220
|
+
stopPartAnimations: h,
|
|
2221
|
+
togglePartAnimations: m
|
|
2222
2222
|
};
|
|
2223
2223
|
}
|
|
2224
|
-
function
|
|
2224
|
+
function H0(n) {
|
|
2225
2225
|
return n < 0.5 ? 4 * n * n * n : 1 - Math.pow(-2 * n + 2, 3) / 2;
|
|
2226
2226
|
}
|
|
2227
|
-
const
|
|
2227
|
+
const Za = {
|
|
2228
2228
|
"轧辊整体-1001": ["轧辊整体-1001", "上轧辊000-1"],
|
|
2229
2229
|
"下轧辊-1001": ["下轧辊-1001", "下轧辊000-1"],
|
|
2230
2230
|
"轧辊整体-1": ["轧辊整体-1", "上轧辊000-3"],
|
|
2231
2231
|
"下轧辊-1": ["下轧辊-1", "下轧辊000-3"]
|
|
2232
2232
|
};
|
|
2233
|
-
function
|
|
2234
|
-
const H =
|
|
2233
|
+
function z0(n, e, a) {
|
|
2234
|
+
const H = Za[n] ?? [n], b = (i) => {
|
|
2235
2235
|
if (!i) return null;
|
|
2236
2236
|
for (const r of H) {
|
|
2237
2237
|
const f = i.getObjectByName(r);
|
|
@@ -2246,713 +2246,488 @@ function B0(n, e, a) {
|
|
|
2246
2246
|
}
|
|
2247
2247
|
return b(a);
|
|
2248
2248
|
}
|
|
2249
|
-
function
|
|
2250
|
-
const
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
const
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2249
|
+
function Qa(n, e, a, H, b = null) {
|
|
2250
|
+
const i = c0(!1), r = 0.6, f = 5, c = 0.5, t = -0.3, d = 0.8, o = 0.3, s = 30, k = 2, l = 0.5, u = 0.6, h = 1.5, m = 3, g = 1, A = 0.6, p = 0.5, w = 0.07, F = 0.97, v = 8e-3, B = 0.97, W = 0.015, E = 0.4, x = 1, S = 1, K = 0.3;
|
|
2251
|
+
let N = "idle", j = 0, R = new y(), V = new y(), _ = null, L = null, Q = null, C = null, J = null, X = null, f0 = null, o0 = null, p0 = null, m0 = 0, Y = null, s0 = null;
|
|
2252
|
+
const G0 = new y(), C0 = new d0(), j0 = [];
|
|
2253
|
+
let I0 = null, U0 = "";
|
|
2254
|
+
const $ = new y(), y0 = new y();
|
|
2255
|
+
function T(P) {
|
|
2256
|
+
if (!P) return 0;
|
|
2257
|
+
const I = new d0();
|
|
2258
|
+
return P.getWorldQuaternion(I), I.w;
|
|
2259
|
+
}
|
|
2260
|
+
function O(P, I) {
|
|
2261
|
+
const G = T(P);
|
|
2262
|
+
return Math.abs(G - I) <= W;
|
|
2263
|
+
}
|
|
2264
|
+
function q(P, I, G) {
|
|
2265
|
+
if (!P) return;
|
|
2266
|
+
const z = new d0();
|
|
2267
|
+
P.getWorldQuaternion(z);
|
|
2268
|
+
const b0 = new W0().setFromObject(P), r0 = new y();
|
|
2269
|
+
b0.getCenter(r0), y0.copy(I).applyQuaternion(z), G.copy(r0).add(y0);
|
|
2270
|
+
}
|
|
2271
|
+
function U(P, I) {
|
|
2272
|
+
const G = new y();
|
|
2273
|
+
if (P && P.getWorldPosition(G), I) {
|
|
2274
|
+
const z = new y();
|
|
2275
|
+
I.getWorldPosition(z), G.add(z).multiplyScalar(0.5), G.y -= 0.313;
|
|
2276
|
+
}
|
|
2277
|
+
return G;
|
|
2278
|
+
}
|
|
2279
|
+
function Z() {
|
|
2280
|
+
const P = n.value;
|
|
2281
|
+
if (!P || P.length === 0) return !1;
|
|
2282
|
+
Y = H().scene;
|
|
2283
|
+
const G = (M) => M ?? null;
|
|
2284
|
+
for (const M of P) {
|
|
2285
|
+
if (!M) continue;
|
|
2286
|
+
const i0 = M.getObjectByName("机器人-2");
|
|
2287
|
+
if (i0 && (_ = G(i0.getObjectByName("坯料-1")), _))
|
|
2278
2288
|
break;
|
|
2279
2289
|
}
|
|
2280
|
-
if (!
|
|
2290
|
+
if (!_)
|
|
2281
2291
|
return console.warn("[useBilletAnimation] 未找到部件: 坯料-1 (在 机器人-2 下)"), !1;
|
|
2282
|
-
L =
|
|
2283
|
-
let
|
|
2284
|
-
for (const
|
|
2285
|
-
if (
|
|
2292
|
+
L = z0("轧辊整体-1001", n, Y), L || console.warn("[useBilletAnimation] 未找到部件: 轧辊整体-1001 / 上轧辊000-1"), Q = z0("下轧辊-1001", n, Y), Q || console.warn("[useBilletAnimation] 未找到部件: 下轧辊-1001 / 下轧辊000-1");
|
|
2293
|
+
let z = null, b0 = null;
|
|
2294
|
+
for (const M of P)
|
|
2295
|
+
if (M && (z || (z = G(M.getObjectByName("下输送台板-1"))), b0 || (b0 = G(M.getObjectByName("下输送台板-2"))), z && b0))
|
|
2286
2296
|
break;
|
|
2287
|
-
if ((!
|
|
2288
|
-
const
|
|
2289
|
-
|
|
2290
|
-
const
|
|
2291
|
-
|
|
2292
|
-
}
|
|
2293
|
-
let
|
|
2294
|
-
for (const
|
|
2295
|
-
if (
|
|
2297
|
+
if ((!z || !b0) && Y && (z || (z = G(Y.getObjectByName("下输送台板-1"))), b0 || (b0 = G(Y.getObjectByName("下输送台板-2")))), z || console.warn("[useBilletAnimation] 未找到部件: 下输送台板-1"), b0 || console.warn("[useBilletAnimation] 未找到部件: 下输送台板-2"), z && b0) {
|
|
2298
|
+
const M = new y();
|
|
2299
|
+
z.getWorldPosition(M);
|
|
2300
|
+
const i0 = new y();
|
|
2301
|
+
b0.getWorldPosition(i0), X = new y().copy(M).add(i0).multiplyScalar(0.5), X.y = Math.max(M.y, i0.y) + 0.05;
|
|
2302
|
+
}
|
|
2303
|
+
let r0 = null;
|
|
2304
|
+
for (const M of P)
|
|
2305
|
+
if (M && (r0 = G(M.getObjectByName("上输送台-3")), r0))
|
|
2296
2306
|
break;
|
|
2297
|
-
if (!
|
|
2298
|
-
const
|
|
2299
|
-
|
|
2307
|
+
if (!r0 && Y && (r0 = G(Y.getObjectByName("上输送台-3"))), r0) {
|
|
2308
|
+
const M = new y();
|
|
2309
|
+
r0.getWorldPosition(M), f0 = new y(M.x, M.y + 0.1, M.z);
|
|
2300
2310
|
} else
|
|
2301
2311
|
console.warn("[useBilletAnimation] 未找到部件: 上输送台-3");
|
|
2302
|
-
if (
|
|
2303
|
-
const
|
|
2304
|
-
|
|
2312
|
+
if (C = z0("轧辊整体-1", n, Y), C) {
|
|
2313
|
+
const M = new y();
|
|
2314
|
+
C.getWorldPosition(M), o0 = new y(M.x, M.y + 0.5, M.z);
|
|
2305
2315
|
} else
|
|
2306
2316
|
console.warn("[useBilletAnimation] 未找到部件: 轧辊整体-1 / 上轧辊000-3");
|
|
2307
|
-
if (
|
|
2308
|
-
const
|
|
2309
|
-
|
|
2310
|
-
const
|
|
2311
|
-
|
|
2312
|
-
} else
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
if (v && (P = F(v.getObjectByName("底板-1")), P))
|
|
2317
|
+
if (J = z0("下轧辊-1", n, Y), J && C) {
|
|
2318
|
+
const M = new y();
|
|
2319
|
+
J.getWorldPosition(M);
|
|
2320
|
+
const i0 = new y();
|
|
2321
|
+
C.getWorldPosition(i0), p0 = new y().copy(M).add(i0).multiplyScalar(0.5), p0.y -= 0.313;
|
|
2322
|
+
} else J || console.warn("[useBilletAnimation] 未找到部件: 下轧辊-1 / 下轧辊000-3");
|
|
2323
|
+
let M0 = null;
|
|
2324
|
+
for (const M of P)
|
|
2325
|
+
if (M && (M0 = G(M.getObjectByName("底板-1")), M0))
|
|
2317
2326
|
break;
|
|
2318
|
-
if (!
|
|
2319
|
-
const
|
|
2320
|
-
|
|
2327
|
+
if (!M0 && Y && (M0 = G(Y.getObjectByName("底板-1"))), M0) {
|
|
2328
|
+
const M = new y();
|
|
2329
|
+
M0.getWorldPosition(M), m0 = M.y;
|
|
2321
2330
|
} else
|
|
2322
2331
|
console.warn("[useBilletAnimation] 未找到部件: 底板-1");
|
|
2323
|
-
const
|
|
2324
|
-
if (!
|
|
2332
|
+
const je = _.parent;
|
|
2333
|
+
if (!je)
|
|
2325
2334
|
return console.warn("[useBilletAnimation] 坯料没有父节点 (机器人-2 应作为父节点)"), !1;
|
|
2326
|
-
|
|
2327
|
-
const
|
|
2335
|
+
j0.length = 0;
|
|
2336
|
+
const i2 = [
|
|
2328
2337
|
"Crab_Finger_Right-1",
|
|
2329
2338
|
"Crab_Finger_Right-2",
|
|
2330
2339
|
"Crab_Finger_Right-3",
|
|
2331
2340
|
"Crab_Finger_Right-4"
|
|
2332
|
-
],
|
|
2333
|
-
for (const
|
|
2334
|
-
const
|
|
2335
|
-
|
|
2336
|
-
}
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
const h0 = new j(), t0 = new $(), g0 = new $(), me = 0.8, je = { value: 0 }, ie = new j(0, 0, 1), Ie = new j(), ye = new $(), we = new j();
|
|
2361
|
-
let T0 = !1, J0 = !1;
|
|
2362
|
-
new j();
|
|
2363
|
-
const re = new j(), Fe = new $(), L0 = new j(), S0 = new j(), R0 = { value: 0 }, ve = new j(), Ne = new $(), Te = new j();
|
|
2364
|
-
let x0 = !1;
|
|
2365
|
-
function d2(h, l, F, N, T, M, P, X, z, r0) {
|
|
2366
|
-
const Q = N;
|
|
2367
|
-
T0 || (h.updateMatrixWorld(!0), h.getWorldPosition(Ie), h.getWorldQuaternion(ye), we.copy(Ie).sub(Q), M.value = 0, T0 = !0), M.value += P * z, w0.setFromAxisAngle(ie, M.value), h0.copy(we).applyQuaternion(w0).add(Q), t0.copy(w0).multiply(ye);
|
|
2368
|
-
const v = h.parent;
|
|
2369
|
-
if (v && v.type !== "Scene" && (v.updateMatrixWorld(!0), h0.clone(), v.worldToLocal(h0), v.getWorldQuaternion(g0), t0.premultiply(g0.clone().invert())), h.position.copy(h0), h.quaternion.copy(t0), h.updateMatrixWorld(!0), T) {
|
|
2370
|
-
const O = T.parent;
|
|
2371
|
-
O && O.type !== "Scene" ? (O.getWorldQuaternion(g0), T.quaternion.copy(g0.clone().invert()).multiply(t0)) : T.quaternion.copy(t0), T.updateMatrixWorld(!0);
|
|
2372
|
-
}
|
|
2373
|
-
return be(h, F, l.position), M.value >= X;
|
|
2374
|
-
}
|
|
2375
|
-
function o2(h, l, F, N, T, M, P, X, z, r0) {
|
|
2376
|
-
const Q = N;
|
|
2377
|
-
x0 || (h.updateMatrixWorld(!0), h.getWorldPosition(ve), h.getWorldQuaternion(Ne), Te.copy(ve).sub(Q), M.value = 0, x0 = !0), M.value += P * z, w0.setFromAxisAngle(ie, -M.value), h0.copy(Te).applyQuaternion(w0).add(Q), t0.copy(w0).multiply(Ne);
|
|
2378
|
-
const v = h.parent;
|
|
2379
|
-
if (v && v.type !== "Scene" && (v.updateMatrixWorld(!0), h0.clone(), v.worldToLocal(h0), v.getWorldQuaternion(g0), t0.premultiply(g0.clone().invert())), h.position.copy(h0), h.quaternion.copy(t0), h.updateMatrixWorld(!0), T) {
|
|
2380
|
-
const O = T.parent;
|
|
2381
|
-
O && O.type !== "Scene" ? (O.getWorldQuaternion(g0), T.quaternion.copy(g0.clone().invert()).multiply(t0)) : T.quaternion.copy(t0), T.updateMatrixWorld(!0);
|
|
2382
|
-
}
|
|
2383
|
-
return be(h, F, l.position), M.value >= X;
|
|
2384
|
-
}
|
|
2385
|
-
function s2(h, l, F, N, T, M, P) {
|
|
2386
|
-
const X = P ?? l;
|
|
2387
|
-
T0 || (h.updateMatrixWorld(!0), h.getWorldPosition(Ie), h.getWorldQuaternion(ye), we.copy(Ie).sub(X), N.value = 0, T0 = !0), N.value += T * M, w0.setFromAxisAngle(ie, N.value), h0.copy(we).applyQuaternion(w0).add(X), t0.copy(w0).multiply(ye);
|
|
2388
|
-
const z = h.parent;
|
|
2389
|
-
if (z && z.type !== "Scene" && (z.updateMatrixWorld(!0), h0.clone(), z.worldToLocal(h0), z.getWorldQuaternion(g0), t0.premultiply(g0.clone().invert())), h.position.copy(h0), h.quaternion.copy(t0), h.updateMatrixWorld(!0), F) {
|
|
2390
|
-
const r0 = F.parent;
|
|
2391
|
-
r0 && r0.type !== "Scene" ? (r0.getWorldQuaternion(g0), F.quaternion.copy(g0.clone().invert()).multiply(t0)) : F.quaternion.copy(t0), F.updateMatrixWorld(!0);
|
|
2392
|
-
}
|
|
2393
|
-
}
|
|
2394
|
-
function k2(h, l, F, N, T, M, P) {
|
|
2395
|
-
const X = P ?? l;
|
|
2396
|
-
x0 || (h.updateMatrixWorld(!0), h.getWorldPosition(ve), h.getWorldQuaternion(Ne), Te.copy(ve).sub(X), x0 = !0), N.value += T * M, w0.setFromAxisAngle(ie, N.value), h0.copy(Te).applyQuaternion(w0).add(X), t0.copy(w0).multiply(Ne);
|
|
2397
|
-
const z = h.parent;
|
|
2398
|
-
if (z && z.type !== "Scene" && (z.updateMatrixWorld(!0), h0.clone(), z.worldToLocal(h0), z.getWorldQuaternion(g0), t0.premultiply(g0.clone().invert())), h.position.copy(h0), h.quaternion.copy(t0), h.updateMatrixWorld(!0), F) {
|
|
2399
|
-
const r0 = F.parent;
|
|
2400
|
-
r0 && r0.type !== "Scene" ? (r0.getWorldQuaternion(g0), F.quaternion.copy(g0.clone().invert()).multiply(t0)) : F.quaternion.copy(t0), F.updateMatrixWorld(!0);
|
|
2401
|
-
}
|
|
2402
|
-
}
|
|
2403
|
-
const Ha = 0.5;
|
|
2404
|
-
let Ue = "idle";
|
|
2405
|
-
function j0(h) {
|
|
2406
|
-
Ue = h, D = "pausing", y = 0;
|
|
2407
|
-
}
|
|
2408
|
-
const l2 = new j(), u2 = new j(), h2 = new j(), g2 = new j();
|
|
2409
|
-
new j();
|
|
2410
|
-
const _2 = new j(0.63, -0.52, 0.45), A2 = new j(0.55, 0.6, 0.2), p2 = new j(0.69, -0.48, 0.45), m2 = new j(0.65, 0.58, 0.2);
|
|
2411
|
-
let j2 = !1, I2 = !1;
|
|
2412
|
-
function ca() {
|
|
2413
|
-
ae = [], u && (u.updateMatrixWorld(!0), u.traverse((h) => {
|
|
2414
|
-
if (!(h instanceof H2) || !h.geometry) return;
|
|
2415
|
-
const l = h.geometry;
|
|
2416
|
-
if (!l.attributes.position) return;
|
|
2417
|
-
l.computeBoundingBox();
|
|
2418
|
-
const N = l.boundingBox, T = N.getSize(new j()), M = N.getCenter(new j());
|
|
2419
|
-
let P, X, z, r0, Q, v, O, Y0, z0;
|
|
2420
|
-
T.x >= T.y && T.x >= T.z ? (P = 0, X = 1, z = 2, r0 = T.x, Q = Math.max(T.y, T.z) / 2, v = N.min.x, O = N.max.x, Y0 = M.y, z0 = M.z) : T.y >= T.x && T.y >= T.z ? (P = 1, X = 0, z = 2, r0 = T.y, Q = Math.max(T.x, T.z) / 2, v = N.min.y, O = N.max.y, Y0 = M.x, z0 = M.z) : (P = 2, X = 0, z = 1, r0 = T.z, Q = Math.max(T.x, T.y) / 2, v = N.min.z, O = N.max.z, Y0 = M.x, z0 = M.y);
|
|
2421
|
-
const P0 = new $a(Q, Q, r0, 32, 20);
|
|
2422
|
-
P === 0 ? P0.rotateZ(-Math.PI / 2) : P === 2 && P0.rotateX(Math.PI / 2), P0.translate(M.x, M.y, M.z);
|
|
2423
|
-
const Pe = l;
|
|
2424
|
-
h.geometry = P0;
|
|
2425
|
-
const Be = new Float32Array(
|
|
2426
|
-
P0.attributes.position.array
|
|
2427
|
-
);
|
|
2428
|
-
ae.push({
|
|
2429
|
-
mesh: h,
|
|
2430
|
-
originalGeometry: Pe,
|
|
2431
|
-
originalPositions: Be,
|
|
2432
|
-
aIdx: P,
|
|
2433
|
-
uIdx: X,
|
|
2434
|
-
vIdx: z,
|
|
2435
|
-
axisMin: v,
|
|
2436
|
-
axisMax: O,
|
|
2437
|
-
centerU: Y0,
|
|
2438
|
-
centerV: z0
|
|
2439
|
-
});
|
|
2440
|
-
}));
|
|
2441
|
-
}
|
|
2442
|
-
function xe() {
|
|
2443
|
-
for (let h = 0; h < pe; h++) C0[h] = 1;
|
|
2444
|
-
for (const h of ae) {
|
|
2445
|
-
const l = h.mesh.geometry.attributes.position;
|
|
2446
|
-
l.array.set(h.originalPositions), l.needsUpdate = !0, h.mesh.geometry.computeVertexNormals();
|
|
2447
|
-
}
|
|
2448
|
-
}
|
|
2449
|
-
function Re() {
|
|
2450
|
-
for (const h of ae) {
|
|
2451
|
-
const l = h.mesh.geometry.attributes.position, F = l.array, { originalPositions: N, aIdx: T, uIdx: M, vIdx: P, axisMin: X, axisMax: z, centerU: r0, centerV: Q } = h, v = z - X;
|
|
2452
|
-
if (!(v <= 0)) {
|
|
2453
|
-
for (let O = 0; O < F.length; O += 3) {
|
|
2454
|
-
const Y0 = N[O + T];
|
|
2455
|
-
let z0 = Math.floor((Y0 - X) / v * pe);
|
|
2456
|
-
z0 = Math.min(Math.max(z0, 0), pe - 1);
|
|
2457
|
-
const P0 = C0[z0];
|
|
2458
|
-
if (P0 < 1) {
|
|
2459
|
-
const Pe = N[O + M], Be = N[O + P];
|
|
2460
|
-
F[O + M] = r0 + (Pe - r0) * P0, F[O + P] = Q + (Be - Q) * P0, F[O + T] = Y0;
|
|
2461
|
-
} else
|
|
2462
|
-
F[O] = N[O], F[O + 1] = N[O + 1], F[O + 2] = N[O + 2];
|
|
2463
|
-
}
|
|
2464
|
-
l.needsUpdate = !0, h.mesh.geometry.computeVertexNormals();
|
|
2465
|
-
}
|
|
2466
|
-
}
|
|
2467
|
-
}
|
|
2468
|
-
function fa() {
|
|
2469
|
-
c.value || ia() && (xe(), Ae = u.parent, f2.copy(u.position), t2.copy(u.quaternion), c.value = !0, D = "opening", y = 0, j2 = !L || !b0, I2 = !i0 || !Ge, se = (h) => {
|
|
2470
|
-
if (!(!c.value || !u))
|
|
2471
|
-
switch (y += h, D) {
|
|
2472
|
-
// ========== 阶段间统一延时 ==========
|
|
2473
|
-
case "pausing": {
|
|
2474
|
-
y >= Ha && (D = Ue, y = 0, Ue = "idle");
|
|
2475
|
-
break;
|
|
2476
|
-
}
|
|
2341
|
+
], r2 = _.position.y;
|
|
2342
|
+
for (const M of i2) {
|
|
2343
|
+
const i0 = je.getObjectByName(M);
|
|
2344
|
+
i0 ? j0.push({ obj: i0, origQuat: i0.quaternion.clone(), direction: i0.position.y > r2 ? 1 : -1 }) : console.warn(`[useBilletAnimation] 未找到手指部件: ${M}`);
|
|
2345
|
+
}
|
|
2346
|
+
return j0.length === 0 ? (console.warn("[useBilletAnimation] 未找到任何 Crab_Finger_Right-* 手指部件"), !1) : !0;
|
|
2347
|
+
}
|
|
2348
|
+
function a0() {
|
|
2349
|
+
if (!_ || !Y) return;
|
|
2350
|
+
_.getWorldPosition(R);
|
|
2351
|
+
const P = new d0();
|
|
2352
|
+
_.getWorldQuaternion(P);
|
|
2353
|
+
const I = new y();
|
|
2354
|
+
_.getWorldScale(I), _.parent && _.removeFromParent(), Y.add(_), _.position.copy(R), _.quaternion.copy(P), _.scale.copy(I);
|
|
2355
|
+
}
|
|
2356
|
+
function w0(P) {
|
|
2357
|
+
for (const I of j0) {
|
|
2358
|
+
I.obj.quaternion.copy(I.origQuat);
|
|
2359
|
+
const G = new d0().setFromAxisAngle(new y(1, 0, 0), p * P * I.direction);
|
|
2360
|
+
I.obj.quaternion.premultiply(G);
|
|
2361
|
+
}
|
|
2362
|
+
}
|
|
2363
|
+
const F0 = new y(), L0 = new y(), T0 = new y(), R0 = new y(), x0 = new y(), he = new y(0.43, 0.7, 0.45), ge = new y(0.785, -0.325, 0.2), S0 = new y(0.43, 0.7, 0.45), _e = new y(0.785, -0.325, 0.2);
|
|
2364
|
+
let Ae = !1, pe = !1;
|
|
2365
|
+
function a2() {
|
|
2366
|
+
i.value || Z() && (s0 = _.parent, G0.copy(_.position), C0.copy(_.quaternion), i.value = !0, N = "opening", j = 0, Ae = !L || !Q, pe = !C || !p0, I0 = (P) => {
|
|
2367
|
+
if (!(!i.value || !_))
|
|
2368
|
+
switch (j += P, N) {
|
|
2477
2369
|
// ========== 手指张开 ==========
|
|
2478
2370
|
case "opening": {
|
|
2479
|
-
const
|
|
2480
|
-
|
|
2371
|
+
const I = Math.min(j / r, 1);
|
|
2372
|
+
w0(H0(I)), I >= 1 && (a0(), N = Ae ? "toRollGap" : "toMill1UpperGap", j = 0);
|
|
2481
2373
|
break;
|
|
2482
2374
|
}
|
|
2483
2375
|
// ========== 第一轧机:空隙姿态驱动流程 ==========
|
|
2484
2376
|
// --- 1. 到第一轧机上辊空隙 ---
|
|
2485
2377
|
case "toMill1UpperGap": {
|
|
2486
|
-
|
|
2487
|
-
const
|
|
2488
|
-
|
|
2489
|
-
break;
|
|
2490
|
-
}
|
|
2491
|
-
case "closing1": {
|
|
2492
|
-
const l = Math.min(y / y0, 1);
|
|
2493
|
-
ke(1 - k0(l)), l >= 1 && (ke(0), D = "ridingMill1UpperGap", y = 0);
|
|
2378
|
+
q(L, he, F0);
|
|
2379
|
+
const I = Math.min(j / x, 1);
|
|
2380
|
+
_.position.lerpVectors(R, F0, H0(I)), I >= 1 && (N = "ridingMill1UpperGap", j = 0);
|
|
2494
2381
|
break;
|
|
2495
2382
|
}
|
|
2496
|
-
// --- 2.
|
|
2383
|
+
// --- 2. 随第一轧机上辊空隙转动,等待w达到0.07 ---
|
|
2497
2384
|
case "ridingMill1UpperGap": {
|
|
2498
|
-
L
|
|
2499
|
-
L,
|
|
2500
|
-
u,
|
|
2501
|
-
_2,
|
|
2502
|
-
F0,
|
|
2503
|
-
u0,
|
|
2504
|
-
je,
|
|
2505
|
-
me,
|
|
2506
|
-
ne,
|
|
2507
|
-
h
|
|
2508
|
-
) && (j0("mill1Drop"), y = 0, U.copy(u.position), re.set(U.x, U.y - Z, U.z)));
|
|
2385
|
+
q(L, he, F0), _.position.copy(F0), O(L, w) && (N = "fallToMill1LowerGap", j = 0, R.copy(_.position));
|
|
2509
2386
|
break;
|
|
2510
2387
|
}
|
|
2511
|
-
// ---
|
|
2512
|
-
case "
|
|
2513
|
-
|
|
2514
|
-
|
|
2388
|
+
// --- 3. 落入第一轧机下辊空隙 ---
|
|
2389
|
+
case "fallToMill1LowerGap": {
|
|
2390
|
+
q(Q, ge, L0);
|
|
2391
|
+
const I = Math.min(j / E, 1);
|
|
2392
|
+
_.position.lerpVectors(R, L0, H0(I)), I >= 1 && (N = "ridingMill1LowerGap", j = 0);
|
|
2515
2393
|
break;
|
|
2516
2394
|
}
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
const l = Math.min(R0.value / J, 1), F = 1 - 0.25 * k0(l);
|
|
2521
|
-
for (let N = 3; N <= 7; N++) C0[N] = F;
|
|
2522
|
-
if (Re(), R0.value >= J) {
|
|
2523
|
-
for (let N = 3; N <= 7; N++) C0[N] = 0.75;
|
|
2524
|
-
Re(), j0("fallToMill1LowerGap"), y = 0, U.copy(u.position);
|
|
2525
|
-
}
|
|
2526
|
-
}
|
|
2395
|
+
// --- 4. 随第一轧机下辊空隙转动,等待w达到0.97后送出 ---
|
|
2396
|
+
case "ridingMill1LowerGap": {
|
|
2397
|
+
q(Q, ge, L0), _.position.copy(L0), j >= K && O(Q, F) && (R.copy(_.position), N = "exitMill1LowerGap", j = 0);
|
|
2527
2398
|
break;
|
|
2528
2399
|
}
|
|
2529
|
-
// ---
|
|
2530
|
-
case "
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2400
|
+
// --- 5. 随第一轧机下辊送出(平滑移向输送台方向) ---
|
|
2401
|
+
case "exitMill1LowerGap": {
|
|
2402
|
+
if (X) {
|
|
2403
|
+
const G = new y().subVectors(X, R).normalize();
|
|
2404
|
+
x0.copy(R).addScaledVector(G, 0.6);
|
|
2405
|
+
} else
|
|
2406
|
+
x0.copy(R);
|
|
2407
|
+
const I = Math.min(j / u, 1);
|
|
2408
|
+
_.position.lerpVectors(R, x0, H0(I)), I >= 1 && (R.copy(x0), V.copy(X ?? x0), N = "toConveyor", j = 0);
|
|
2534
2409
|
break;
|
|
2535
2410
|
}
|
|
2536
|
-
//
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
A2,
|
|
2542
|
-
F0,
|
|
2543
|
-
_0,
|
|
2544
|
-
je,
|
|
2545
|
-
me,
|
|
2546
|
-
de,
|
|
2547
|
-
h
|
|
2548
|
-
) && (U.copy(u.position), j0("exitMill1LowerGap"), y = 0));
|
|
2411
|
+
// ========== 第一轧机:Fallback旧流程 ==========
|
|
2412
|
+
// --- fallback: 到两辊中点 ---
|
|
2413
|
+
case "toRollGap": {
|
|
2414
|
+
const I = U(L, Q), G = Math.min(j / 1, 1);
|
|
2415
|
+
_.position.lerpVectors(R, I, H0(G)), G >= 1 && (_.position.copy(I), N = "rolling", j = 0);
|
|
2549
2416
|
break;
|
|
2550
2417
|
}
|
|
2551
|
-
// ---
|
|
2552
|
-
case "
|
|
2553
|
-
if (
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
U
|
|
2558
|
-
|
|
2559
|
-
N0.x + 0.38,
|
|
2560
|
-
N0.y + 0.05,
|
|
2561
|
-
N0.z
|
|
2562
|
-
), N = G * 2, T = Math.min(y / N, 1);
|
|
2563
|
-
if (T <= 0.5) {
|
|
2564
|
-
const M = T * 2;
|
|
2565
|
-
u.position.lerpVectors(U, l, k0(M));
|
|
2566
|
-
} else {
|
|
2567
|
-
const M = (T - 0.5) * 2;
|
|
2568
|
-
u.position.lerpVectors(l, F, k0(M));
|
|
2569
|
-
}
|
|
2570
|
-
if (T >= 1) {
|
|
2571
|
-
if (u.position.copy(F), !d && i) {
|
|
2572
|
-
i(), d = !0;
|
|
2573
|
-
let M = 1 / 0, P = -1;
|
|
2574
|
-
for (let X = 0; X < t.length; X++) {
|
|
2575
|
-
const [z, r0] = t[X];
|
|
2576
|
-
if (r && r(z, r0, m0)) {
|
|
2577
|
-
const Q = m0.distanceTo(F);
|
|
2578
|
-
Q < M && (M = Q, P = X);
|
|
2579
|
-
}
|
|
2580
|
-
}
|
|
2581
|
-
P >= 0 ? (o = P, U.copy(u.position), D = "liftToClamp") : D = "conveyorWait";
|
|
2582
|
-
} else
|
|
2583
|
-
D = "conveyorWait";
|
|
2584
|
-
y = 0;
|
|
2418
|
+
// --- fallback: 原地滚动5s ---
|
|
2419
|
+
case "rolling": {
|
|
2420
|
+
if (_.rotation.z += P * 3, j >= 5)
|
|
2421
|
+
if (_.rotation.z = 0, N = "toConveyor", j = 0, X)
|
|
2422
|
+
V.copy(X);
|
|
2423
|
+
else {
|
|
2424
|
+
const I = U(L, Q);
|
|
2425
|
+
V.copy(I);
|
|
2585
2426
|
}
|
|
2586
|
-
} else
|
|
2587
|
-
D = "conveyorWait", y = 0;
|
|
2588
2427
|
break;
|
|
2589
2428
|
}
|
|
2590
2429
|
// ========== 输送台阶段 ==========
|
|
2591
2430
|
// --- 胚料向输送台移动 ---
|
|
2592
2431
|
case "toConveyor": {
|
|
2593
|
-
const
|
|
2594
|
-
|
|
2432
|
+
const I = Math.min(j / f, 1);
|
|
2433
|
+
_.position.lerpVectors(R, V, H0(I)), X && _.position.y <= X.y + 0.1 && (_.position.copy(V), N = "conveyorWait", j = 0), j >= f && (_.position.copy(V), N = "conveyorWait", j = 0);
|
|
2595
2434
|
break;
|
|
2596
2435
|
}
|
|
2597
|
-
// ---
|
|
2436
|
+
// --- 等待夹具到达下输送台接料点 ---
|
|
2598
2437
|
case "conveyorWait": {
|
|
2599
|
-
if (!
|
|
2600
|
-
|
|
2438
|
+
if (!X) {
|
|
2439
|
+
N = "upperWait", j = 0;
|
|
2601
2440
|
break;
|
|
2602
2441
|
}
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
if (
|
|
2607
|
-
const
|
|
2608
|
-
|
|
2442
|
+
const I = ["夹具5倍-1", "夹具5倍-2", "夹具5倍-3", "夹具5倍-5"];
|
|
2443
|
+
let G = "", z = 1 / 0;
|
|
2444
|
+
for (const b0 of I)
|
|
2445
|
+
if (b && b(b0, $)) {
|
|
2446
|
+
const r0 = $.distanceTo(X);
|
|
2447
|
+
r0 < d && r0 < z && (z = r0, G = b0);
|
|
2609
2448
|
}
|
|
2610
|
-
|
|
2611
|
-
F >= 0 && (o = F, U.copy(u.position), D = "liftToClamp", y = 0), y >= m && (D = "upperWait", y = 0);
|
|
2449
|
+
G && (U0 = G, N = "liftToClamp", j = 0), j >= s && (N = "upperWait", j = 0);
|
|
2612
2450
|
break;
|
|
2613
2451
|
}
|
|
2614
|
-
// ---
|
|
2452
|
+
// --- 胚料升到夹具上方 ---
|
|
2615
2453
|
case "liftToClamp": {
|
|
2616
|
-
const
|
|
2617
|
-
|
|
2454
|
+
const I = Math.min(j / c, 1);
|
|
2455
|
+
b(U0, $), $.y += 0.2, $.z += t, _.position.lerpVectors(X, $, H0(I)), I >= 1 && (_.position.copy($), N = "ridingChain", j = 0);
|
|
2618
2456
|
break;
|
|
2619
2457
|
}
|
|
2620
|
-
// ---
|
|
2458
|
+
// --- 跟随夹具随链条滚动 ---
|
|
2621
2459
|
case "ridingChain": {
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
U0 && u.position.copy(U0), D = "upperWait", y = 0;
|
|
2460
|
+
if (!b || !b(U0, $)) {
|
|
2461
|
+
f0 && _.position.copy(f0), N = "upperWait", j = 0;
|
|
2625
2462
|
break;
|
|
2626
2463
|
}
|
|
2627
|
-
|
|
2628
|
-
break;
|
|
2629
|
-
}
|
|
2630
|
-
// --- 从夹具平滑过渡到上输送台(避免瞬移) ---
|
|
2631
|
-
case "dropToUpperConveyor": {
|
|
2632
|
-
if (!U0) {
|
|
2633
|
-
D = "upperWait", y = 0;
|
|
2634
|
-
break;
|
|
2635
|
-
}
|
|
2636
|
-
const l = Math.min(y / _, 1);
|
|
2637
|
-
u.position.lerpVectors(U, B, k0(l)), l >= 1 && (u.position.copy(B), D = "upperWait", y = 0);
|
|
2464
|
+
$.y += 0.2, $.z += t, _.position.copy($), f0 && $.y >= f0.y - o && (_.position.copy(f0), N = "upperWait", j = 0), j >= 60 && (f0 && _.position.copy(f0), N = "upperWait", j = 0);
|
|
2638
2465
|
break;
|
|
2639
2466
|
}
|
|
2640
2467
|
// --- 上输送台等待2s ---
|
|
2641
2468
|
case "upperWait": {
|
|
2642
|
-
|
|
2469
|
+
j >= k && (N = pe ? "toMill2RollTop" : "toMill2UpperGap", j = 0);
|
|
2643
2470
|
break;
|
|
2644
2471
|
}
|
|
2645
|
-
// ==========
|
|
2472
|
+
// ========== 第二轧机:空隙姿态驱动流程 ==========
|
|
2646
2473
|
// --- 1. 到第二轧机上辊空隙 ---
|
|
2647
2474
|
case "toMill2UpperGap": {
|
|
2648
|
-
|
|
2649
|
-
const
|
|
2650
|
-
|
|
2475
|
+
q(C, S0, T0);
|
|
2476
|
+
const I = Math.min(j / S, 1);
|
|
2477
|
+
_.position.lerpVectors(f0, T0, H0(I)), I >= 1 && (N = "ridingMill2UpperGap", j = 0);
|
|
2651
2478
|
break;
|
|
2652
2479
|
}
|
|
2653
|
-
// --- 2.
|
|
2480
|
+
// --- 2. 随第二轧机上辊空隙转动,等待w达到0.008 ---
|
|
2654
2481
|
case "ridingMill2UpperGap": {
|
|
2655
|
-
|
|
2656
|
-
i0,
|
|
2657
|
-
u,
|
|
2658
|
-
p2,
|
|
2659
|
-
F0,
|
|
2660
|
-
R,
|
|
2661
|
-
je,
|
|
2662
|
-
me,
|
|
2663
|
-
C,
|
|
2664
|
-
h
|
|
2665
|
-
) && (j0("mill2Drop"), y = 0, U.copy(u.position), re.set(U.x, U.y - n0, U.z)));
|
|
2666
|
-
break;
|
|
2667
|
-
}
|
|
2668
|
-
// --- 3a. 胚料垂直下落配置距离 ---
|
|
2669
|
-
case "mill2Drop": {
|
|
2670
|
-
const l = Math.min(y / K, 1);
|
|
2671
|
-
u.position.lerpVectors(U, re, k0(l)), l >= 1 && (u.position.copy(re), u.getWorldQuaternion(Fe), j0("mill2CoRotate"), y = 0, T0 = !1, J0 = !1);
|
|
2482
|
+
q(C, S0, T0), _.position.copy(T0), O(C, v) && (R.copy(_.position), N = "fallIntoMill2Gap", j = 0);
|
|
2672
2483
|
break;
|
|
2673
2484
|
}
|
|
2674
|
-
//
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2485
|
+
// ========== 第二轧机:Fallback旧流程 ==========
|
|
2486
|
+
// --- fallback: 到轧辊整体-1上表面 ---
|
|
2487
|
+
case "toMill2RollTop": {
|
|
2488
|
+
if (!o0) {
|
|
2489
|
+
N = "fallIntoMill2Gap", j = 0;
|
|
2490
|
+
break;
|
|
2680
2491
|
}
|
|
2492
|
+
const I = Math.min(j / 1, 1);
|
|
2493
|
+
_.position.lerpVectors(f0, o0, H0(I)), I >= 1 && (_.position.copy(o0), R.copy(o0), N = "fallIntoMill2Gap", j = 0);
|
|
2681
2494
|
break;
|
|
2682
2495
|
}
|
|
2683
|
-
//
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2496
|
+
// ========== 共同阶段 ==========
|
|
2497
|
+
// --- 从轧辊上表面/空隙平滑滑入下辊空隙 ---
|
|
2498
|
+
case "fallIntoMill2Gap": {
|
|
2499
|
+
J ? q(J, _e, R0) : q(C, S0, R0), q(C, S0, T0);
|
|
2500
|
+
const I = Math.min(j / l, 1);
|
|
2501
|
+
_.position.lerpVectors(T0, R0, H0(I)), I >= 1 && (R.copy(R0), N = "ridingMill2LowerGap", j = 0);
|
|
2688
2502
|
break;
|
|
2689
2503
|
}
|
|
2690
|
-
// ---
|
|
2504
|
+
// --- 6. 随第二轧机下辊空隙转动,等待w达到0.97后送出 ---
|
|
2691
2505
|
case "ridingMill2LowerGap": {
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
h
|
|
2702
|
-
) && (U.copy(u.position), j0("exitMill2LowerGap"), y = 0));
|
|
2703
|
-
break;
|
|
2704
|
-
}
|
|
2705
|
-
// --- 6. 随第二轧机下辊送出(移动到地面) ---
|
|
2706
|
-
case "exitMill2LowerGap": {
|
|
2707
|
-
B.set(
|
|
2708
|
-
U.x + 3,
|
|
2709
|
-
c2,
|
|
2710
|
-
U.z
|
|
2711
|
-
);
|
|
2712
|
-
const l = G * 2, F = Math.min(y / l, 1);
|
|
2713
|
-
u.position.lerpVectors(U, B, k0(F)), F >= 1 && (u.position.copy(B), D = "groundWait", y = 0);
|
|
2506
|
+
J ? (q(J, _e, R0), _.position.copy(R0), j >= K && O(J, B) && (R.copy(_.position), V.set(
|
|
2507
|
+
_.position.x + 3,
|
|
2508
|
+
m0,
|
|
2509
|
+
_.position.z
|
|
2510
|
+
), N = "fallToGround", j = 0)) : j >= 2 && (R.copy(_.position), V.set(
|
|
2511
|
+
_.position.x + 3,
|
|
2512
|
+
m0,
|
|
2513
|
+
_.position.z
|
|
2514
|
+
), N = "fallToGround", j = 0);
|
|
2714
2515
|
break;
|
|
2715
2516
|
}
|
|
2716
2517
|
// --- 掉落地面 ---
|
|
2717
2518
|
case "fallToGround": {
|
|
2718
|
-
const
|
|
2719
|
-
|
|
2519
|
+
const I = Math.min(j / h, 1);
|
|
2520
|
+
_.position.lerpVectors(R, V, H0(I)), I >= 1 && (_.position.copy(V), N = "groundWait", j = 0);
|
|
2720
2521
|
break;
|
|
2721
2522
|
}
|
|
2722
|
-
// --- 地面停留3s
|
|
2523
|
+
// --- 地面停留3s ---
|
|
2723
2524
|
case "groundWait": {
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2525
|
+
j >= m && (N = "resetting", j = 0, a0(), s0 && (s0.updateMatrixWorld(!0), V.copy(G0), s0.localToWorld(V)));
|
|
2526
|
+
break;
|
|
2527
|
+
}
|
|
2528
|
+
// --- 回到手掌 ---
|
|
2529
|
+
case "resetting": {
|
|
2530
|
+
const I = Math.min(j / g, 1);
|
|
2531
|
+
_.position.lerpVectors(R, V, H0(I)), I >= 1 && (_.removeFromParent(), s0 == null || s0.add(_), _.position.copy(G0), _.quaternion.copy(C0), N = "closing", j = 0);
|
|
2532
|
+
break;
|
|
2533
|
+
}
|
|
2534
|
+
// --- 手指闭合 ---
|
|
2535
|
+
case "closing": {
|
|
2536
|
+
const I = Math.min(j / A, 1);
|
|
2537
|
+
w0(1 - H0(I)), I >= 1 && (w0(0), N = "opening", j = 0);
|
|
2731
2538
|
break;
|
|
2732
2539
|
}
|
|
2733
2540
|
}
|
|
2734
|
-
}, e(
|
|
2541
|
+
}, e(I0));
|
|
2735
2542
|
}
|
|
2736
|
-
function
|
|
2737
|
-
|
|
2543
|
+
function me() {
|
|
2544
|
+
i.value = !1, I0 && (a(I0), I0 = null), N = "idle", w0(0), j0.length = 0, s0 = null;
|
|
2738
2545
|
}
|
|
2739
|
-
function
|
|
2740
|
-
|
|
2741
|
-
for (const h of ae)
|
|
2742
|
-
h.mesh.geometry = h.originalGeometry;
|
|
2743
|
-
ae = [], u = null, L = null, b0 = null, i0 = null, d0 = null, u0 = null, _0 = null, R = null, E = null, H0 = null, W = null, c0 = null, A0 = null, $0 = null, ee = null, Oe = null, Ee = null, f0 = null;
|
|
2546
|
+
function b2() {
|
|
2547
|
+
me(), _ = null, L = null, Q = null, C = null, J = null, Y = null;
|
|
2744
2548
|
}
|
|
2745
|
-
return { isBilletAnimating:
|
|
2549
|
+
return { isBilletAnimating: i, startBilletDelivery: a2, stopBilletDelivery: me, dispose: b2 };
|
|
2746
2550
|
}
|
|
2747
|
-
function
|
|
2748
|
-
const
|
|
2749
|
-
let i = [], r =
|
|
2750
|
-
const
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
if (!Z || Z.length === 0) return !1;
|
|
2761
|
-
for (const K of Z)
|
|
2762
|
-
K && K.updateMatrixWorld(!0);
|
|
2763
|
-
for (const K of Z)
|
|
2764
|
-
if (K && (c = K.getObjectByName("整体1-6"), c))
|
|
2551
|
+
function Ja(n, e, a) {
|
|
2552
|
+
const H = c0(!1);
|
|
2553
|
+
let b = [], i = [], r = null, f = 0;
|
|
2554
|
+
const c = 6;
|
|
2555
|
+
let t = null;
|
|
2556
|
+
const d = new d0(), o = new y(), s = new y(), k = new y(), l = new y();
|
|
2557
|
+
function u() {
|
|
2558
|
+
const w = n.value;
|
|
2559
|
+
if (!w || w.length === 0) return !1;
|
|
2560
|
+
for (const E of w)
|
|
2561
|
+
E && E.updateMatrixWorld(!0);
|
|
2562
|
+
for (const E of w)
|
|
2563
|
+
if (E && (r = E.getObjectByName("整体1-6"), r))
|
|
2765
2564
|
break;
|
|
2766
|
-
if (!
|
|
2767
|
-
const
|
|
2768
|
-
if (!
|
|
2769
|
-
const
|
|
2770
|
-
|
|
2771
|
-
for (const
|
|
2772
|
-
const
|
|
2773
|
-
if (
|
|
2774
|
-
|
|
2775
|
-
}),
|
|
2776
|
-
const
|
|
2777
|
-
if (
|
|
2778
|
-
|
|
2779
|
-
}),
|
|
2780
|
-
const
|
|
2781
|
-
|
|
2782
|
-
const
|
|
2783
|
-
return (
|
|
2565
|
+
if (!r) return !1;
|
|
2566
|
+
const F = r.getObjectByName("链条5倍-1"), v = r.getObjectByName("链条5倍-2");
|
|
2567
|
+
if (!F || !v) return !1;
|
|
2568
|
+
const B = [F, v];
|
|
2569
|
+
b = [];
|
|
2570
|
+
for (const E of B) {
|
|
2571
|
+
const x = [];
|
|
2572
|
+
if (E.children.forEach((R) => {
|
|
2573
|
+
R.name.startsWith("链节5倍") && x.push(R);
|
|
2574
|
+
}), x.length === 0) return !1;
|
|
2575
|
+
const S = [];
|
|
2576
|
+
if (E.children.forEach((R) => {
|
|
2577
|
+
R.name.includes("主动链轮10倍") && S.push(R.position.clone());
|
|
2578
|
+
}), S.length < 2) return !1;
|
|
2579
|
+
const K = new y().addVectors(S[0], S[1]).multiplyScalar(0.5);
|
|
2580
|
+
x.sort((R, V) => {
|
|
2581
|
+
const _ = Math.atan2(R.position.y - K.y, R.position.x - K.x), L = Math.atan2(V.position.y - K.y, V.position.x - K.x);
|
|
2582
|
+
return (_ < 0 ? _ + 2 * Math.PI : _) - (L < 0 ? L + 2 * Math.PI : L);
|
|
2784
2583
|
});
|
|
2785
|
-
const
|
|
2786
|
-
|
|
2787
|
-
}
|
|
2788
|
-
|
|
2789
|
-
const
|
|
2790
|
-
for (const
|
|
2791
|
-
const
|
|
2792
|
-
if (!
|
|
2793
|
-
const
|
|
2794
|
-
|
|
2795
|
-
let
|
|
2796
|
-
for (let
|
|
2797
|
-
const
|
|
2798
|
-
|
|
2799
|
-
for (let
|
|
2800
|
-
const
|
|
2801
|
-
|
|
2584
|
+
const N = x.map((R) => R.position.clone()), j = x.map((R) => R.quaternion.clone());
|
|
2585
|
+
b.push({ group: E, links: x, origPositions: N, origQuaternions: j });
|
|
2586
|
+
}
|
|
2587
|
+
i = [];
|
|
2588
|
+
const W = ["夹具5倍-1", "夹具5倍-2", "夹具5倍-3", "夹具5倍-5"];
|
|
2589
|
+
for (const E of W) {
|
|
2590
|
+
const x = r.getObjectByName(E);
|
|
2591
|
+
if (!x) continue;
|
|
2592
|
+
const S = new y();
|
|
2593
|
+
x.getWorldPosition(S);
|
|
2594
|
+
let K = -1, N = -1, j = 1 / 0, R = new y();
|
|
2595
|
+
for (let V = 0; V < b.length; V++) {
|
|
2596
|
+
const _ = b[V], L = new y();
|
|
2597
|
+
_.group.worldToLocal(L.copy(S));
|
|
2598
|
+
for (let Q = 0; Q < _.links.length; Q++) {
|
|
2599
|
+
const C = _.origPositions[Q], J = L.distanceTo(C);
|
|
2600
|
+
J < j && (j = J, K = V, N = Q, R = new y().subVectors(L, C));
|
|
2802
2601
|
}
|
|
2803
2602
|
}
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
quatOffset: L,
|
|
2813
|
-
origPosition: e0.position.clone(),
|
|
2814
|
-
origQuaternion: e0.quaternion.clone()
|
|
2815
|
-
});
|
|
2816
|
-
}
|
|
2603
|
+
K >= 0 && i.push({
|
|
2604
|
+
object: x,
|
|
2605
|
+
chainIdx: K,
|
|
2606
|
+
linkIdx: N,
|
|
2607
|
+
localOffset: R,
|
|
2608
|
+
origPosition: x.position.clone(),
|
|
2609
|
+
origQuaternion: x.quaternion.clone()
|
|
2610
|
+
});
|
|
2817
2611
|
}
|
|
2818
2612
|
return !0;
|
|
2819
2613
|
}
|
|
2820
|
-
function
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2614
|
+
function h() {
|
|
2615
|
+
H.value || u() && (H.value = !0, f = 0, t = (w) => {
|
|
2616
|
+
if (H.value) {
|
|
2617
|
+
f += c * w;
|
|
2618
|
+
for (const F of b) {
|
|
2619
|
+
const v = F.links.length, B = Math.floor(f), W = f - B;
|
|
2620
|
+
for (let E = 0; E < v; E++) {
|
|
2621
|
+
const x = ((E + B) % v + v) % v, S = ((E + B + 1) % v + v) % v, K = F.links[E];
|
|
2622
|
+
K.position.lerpVectors(
|
|
2623
|
+
F.origPositions[x],
|
|
2624
|
+
F.origPositions[S],
|
|
2625
|
+
W
|
|
2626
|
+
), d.slerpQuaternions(
|
|
2627
|
+
F.origQuaternions[x],
|
|
2628
|
+
F.origQuaternions[S],
|
|
2629
|
+
W
|
|
2630
|
+
), K.quaternion.copy(d);
|
|
2631
|
+
}
|
|
2632
|
+
}
|
|
2633
|
+
for (const F of i) {
|
|
2634
|
+
const v = b[F.chainIdx], B = v.links.length, W = Math.floor(f), E = f - W, x = ((F.linkIdx + W) % B + B) % B, S = ((F.linkIdx + W + 1) % B + B) % B;
|
|
2635
|
+
o.lerpVectors(
|
|
2636
|
+
v.origPositions[x],
|
|
2637
|
+
v.origPositions[S],
|
|
2638
|
+
E
|
|
2639
|
+
), s.copy(o).add(F.localOffset), v.group.localToWorld(k.copy(s)), r.worldToLocal(l.copy(k)), F.object.position.copy(l);
|
|
2843
2640
|
}
|
|
2844
2641
|
}
|
|
2845
|
-
|
|
2846
|
-
for (const q of r) {
|
|
2847
|
-
const C = i[q.chainIdx], Y = C.links.length, n0 = Math.floor(t), K = t - n0, e0 = ((q.linkIdx + n0) % Y + Y) % Y, a0 = ((q.linkIdx + n0 + 1) % Y + Y) % Y;
|
|
2848
|
-
k.lerpVectors(
|
|
2849
|
-
C.origPositions[e0],
|
|
2850
|
-
C.origPositions[a0],
|
|
2851
|
-
K
|
|
2852
|
-
), A.copy(k).add(q.localOffset), C.group.localToWorld(_.copy(A)), c.worldToLocal(g.copy(_)), q.object.position.copy(g), C.group.getWorldQuaternion(p), w.slerpQuaternions(
|
|
2853
|
-
C.origQuaternions[e0],
|
|
2854
|
-
C.origQuaternions[a0],
|
|
2855
|
-
K
|
|
2856
|
-
), G.copy(p).multiply(w).multiply(q.quatOffset), G.premultiply(I), q.object.quaternion.copy(G);
|
|
2857
|
-
}
|
|
2858
|
-
}, e(o));
|
|
2642
|
+
}, e(t));
|
|
2859
2643
|
}
|
|
2860
|
-
function
|
|
2861
|
-
|
|
2862
|
-
for (const
|
|
2863
|
-
|
|
2864
|
-
|
|
2644
|
+
function m() {
|
|
2645
|
+
H.value = !1, t && (a(t), t = null);
|
|
2646
|
+
for (const w of b)
|
|
2647
|
+
w.links.forEach((F, v) => {
|
|
2648
|
+
F.position.copy(w.origPositions[v]), F.quaternion.copy(w.origQuaternions[v]);
|
|
2865
2649
|
});
|
|
2866
|
-
for (const
|
|
2867
|
-
|
|
2868
|
-
}
|
|
2869
|
-
function D0() {
|
|
2870
|
-
l0(), i = [], r = [];
|
|
2871
|
-
}
|
|
2872
|
-
function V0(Z, s0) {
|
|
2873
|
-
const J = r.find((q) => q.object.name === Z);
|
|
2874
|
-
return J ? (J.object.getWorldPosition(s0), !0) : !1;
|
|
2650
|
+
for (const w of i)
|
|
2651
|
+
w.object.position.copy(w.origPosition), w.object.quaternion.copy(w.origQuaternion);
|
|
2875
2652
|
}
|
|
2876
|
-
function
|
|
2877
|
-
|
|
2878
|
-
if (!q && !C) return !1;
|
|
2879
|
-
let Y = !1;
|
|
2880
|
-
return q && (q.object.getWorldPosition(V), Y = !0), C && (C.object.getWorldPosition(S), Y = !0), q && C ? J.copy(V).add(S).multiplyScalar(0.5) : q ? J.copy(V) : J.copy(S), Y;
|
|
2653
|
+
function g() {
|
|
2654
|
+
m(), b = [], i = [];
|
|
2881
2655
|
}
|
|
2882
|
-
function
|
|
2883
|
-
|
|
2656
|
+
function A(w, F) {
|
|
2657
|
+
const v = i.find((B) => B.object.name === w);
|
|
2658
|
+
return v ? (v.object.getWorldPosition(F), !0) : !1;
|
|
2884
2659
|
}
|
|
2885
|
-
function
|
|
2886
|
-
return
|
|
2660
|
+
function p() {
|
|
2661
|
+
return i.map((w) => w.object.name);
|
|
2887
2662
|
}
|
|
2888
|
-
return { isChainAnimating:
|
|
2663
|
+
return { isChainAnimating: H, startChainAnimation: h, stopChainAnimation: m, dispose: g, getClampWorldPosition: A, getClampNames: p };
|
|
2889
2664
|
}
|
|
2890
|
-
const
|
|
2891
|
-
function
|
|
2665
|
+
const Ya = 16776960, Ka = 65280, se = "pickHighlightRoot", ke = "partType";
|
|
2666
|
+
function Xa() {
|
|
2892
2667
|
return {
|
|
2893
|
-
raycaster: new
|
|
2894
|
-
mouse: new
|
|
2668
|
+
raycaster: new K2(),
|
|
2669
|
+
mouse: new ue(),
|
|
2895
2670
|
lastMeshes: /* @__PURE__ */ new Set(),
|
|
2896
2671
|
originalEmissive: /* @__PURE__ */ new Map()
|
|
2897
2672
|
};
|
|
2898
2673
|
}
|
|
2899
|
-
function
|
|
2674
|
+
function Xe(n, e) {
|
|
2900
2675
|
const a = [...e];
|
|
2901
2676
|
return n.traverse((H) => {
|
|
2902
2677
|
H.type === "Group" && H.name.endsWith("-pivot") && a.push(H);
|
|
2903
2678
|
}), a;
|
|
2904
2679
|
}
|
|
2905
|
-
function
|
|
2680
|
+
function $a(n, e) {
|
|
2906
2681
|
var b, i;
|
|
2907
2682
|
const a = e.originalEmissive.get(n), H = n.material;
|
|
2908
2683
|
a ? (b = H.emissive) == null || b.copy(a) : (i = H.emissive) == null || i.setHex(0);
|
|
2909
2684
|
}
|
|
2910
|
-
function
|
|
2911
|
-
const e = n.userData[
|
|
2685
|
+
function $e(n) {
|
|
2686
|
+
const e = n.userData[se];
|
|
2912
2687
|
if (e && e.isObject3D) return e;
|
|
2913
2688
|
let a = n.parent;
|
|
2914
2689
|
for (; a; ) {
|
|
2915
|
-
const H = a.userData[
|
|
2690
|
+
const H = a.userData[se];
|
|
2916
2691
|
if (H && H.isObject3D) return H;
|
|
2917
2692
|
if (a.name && a.name.includes("联轴器")) return a;
|
|
2918
2693
|
a = a.parent;
|
|
2919
2694
|
}
|
|
2920
2695
|
return null;
|
|
2921
2696
|
}
|
|
2922
|
-
function
|
|
2697
|
+
function eb(n) {
|
|
2923
2698
|
const e = [];
|
|
2924
2699
|
return n.traverse((a) => {
|
|
2925
2700
|
a.isMesh && e.push(a);
|
|
2926
2701
|
}), e;
|
|
2927
2702
|
}
|
|
2928
|
-
function
|
|
2929
|
-
const e =
|
|
2703
|
+
function e2(n) {
|
|
2704
|
+
const e = $e(n);
|
|
2930
2705
|
if (e) {
|
|
2931
|
-
const a =
|
|
2706
|
+
const a = eb(e);
|
|
2932
2707
|
if (a.length > 0) return a;
|
|
2933
2708
|
}
|
|
2934
2709
|
return [n];
|
|
2935
2710
|
}
|
|
2936
|
-
function
|
|
2937
|
-
n.lastMeshes.forEach((e) =>
|
|
2711
|
+
function Ee(n) {
|
|
2712
|
+
n.lastMeshes.forEach((e) => $a(e, n)), n.lastMeshes.clear();
|
|
2938
2713
|
}
|
|
2939
|
-
function
|
|
2714
|
+
function ab(n, e, a, H, b, i, r = {}) {
|
|
2940
2715
|
var s, k;
|
|
2941
2716
|
const f = e.getBoundingClientRect();
|
|
2942
2717
|
i.mouse.x = (n.clientX - f.left) / f.width * 2 - 1, i.mouse.y = -((n.clientY - f.top) / f.height) * 2 + 1, i.raycaster.setFromCamera(i.mouse, a);
|
|
2943
|
-
const c =
|
|
2718
|
+
const c = Xe(H, b), t = i.raycaster.intersectObjects(c, !0);
|
|
2944
2719
|
if (t.length === 0) {
|
|
2945
|
-
i.lastMeshes.size > 0 &&
|
|
2720
|
+
i.lastMeshes.size > 0 && Ee(i), (s = r.onMiss) == null || s.call(r);
|
|
2946
2721
|
return;
|
|
2947
2722
|
}
|
|
2948
|
-
const d = t[0].object, o =
|
|
2949
|
-
|
|
2950
|
-
var
|
|
2951
|
-
const
|
|
2952
|
-
i.originalEmissive.has(
|
|
2723
|
+
const d = t[0].object, o = e2(d);
|
|
2724
|
+
Ee(i), o.forEach((l) => {
|
|
2725
|
+
var h, m;
|
|
2726
|
+
const u = l.material;
|
|
2727
|
+
i.originalEmissive.has(l) || i.originalEmissive.set(l, ((h = u.emissive) == null ? void 0 : h.clone()) ?? new k0(0)), l.material = u.clone(), (m = l.material.emissive) == null || m.setHex(Ya), i.lastMeshes.add(l);
|
|
2953
2728
|
}), (k = r.onHit) == null || k.call(r, d);
|
|
2954
2729
|
}
|
|
2955
|
-
function
|
|
2730
|
+
function bb(n) {
|
|
2956
2731
|
var H;
|
|
2957
2732
|
if (n.lastMeshes.size === 0) return null;
|
|
2958
2733
|
const a = !(((H = n.lastMeshes.values().next().value) == null ? void 0 : H.visible) ?? !0);
|
|
@@ -2960,18 +2735,18 @@ function ci(n) {
|
|
|
2960
2735
|
b.visible = a;
|
|
2961
2736
|
}), a;
|
|
2962
2737
|
}
|
|
2963
|
-
function
|
|
2738
|
+
function ib() {
|
|
2964
2739
|
return {
|
|
2965
|
-
...
|
|
2740
|
+
...Xa(),
|
|
2966
2741
|
selectedMeshes: /* @__PURE__ */ new Set(),
|
|
2967
2742
|
selectedMesh: null
|
|
2968
2743
|
};
|
|
2969
2744
|
}
|
|
2970
|
-
function
|
|
2745
|
+
function rb(n) {
|
|
2971
2746
|
var c, t;
|
|
2972
|
-
const e =
|
|
2747
|
+
const e = $e(n), a = new W0().setFromObject(e || n), H = new y(), b = new y();
|
|
2973
2748
|
a.getCenter(H), a.getSize(b);
|
|
2974
|
-
const i = new
|
|
2749
|
+
const i = new y();
|
|
2975
2750
|
n.getWorldPosition(i);
|
|
2976
2751
|
const r = n.material, f = (r == null ? void 0 : r.name) || ((c = r == null ? void 0 : r.constructor) == null ? void 0 : c.name) || "Unknown";
|
|
2977
2752
|
return {
|
|
@@ -2979,7 +2754,7 @@ function ti(n) {
|
|
|
2979
2754
|
meshName: n.name,
|
|
2980
2755
|
meshUuid: n.uuid,
|
|
2981
2756
|
parentName: ((t = n.parent) == null ? void 0 : t.name) || null,
|
|
2982
|
-
partType: n.userData[
|
|
2757
|
+
partType: n.userData[ke] || null,
|
|
2983
2758
|
worldPosition: i,
|
|
2984
2759
|
materialName: f,
|
|
2985
2760
|
boundingBox: {
|
|
@@ -2990,43 +2765,127 @@ function ti(n) {
|
|
|
2990
2765
|
}
|
|
2991
2766
|
};
|
|
2992
2767
|
}
|
|
2993
|
-
function
|
|
2768
|
+
function Hb(n, e) {
|
|
2994
2769
|
var b, i;
|
|
2995
2770
|
const a = e.originalEmissive.get(n), H = n.material;
|
|
2996
2771
|
a ? (b = H.emissive) == null || b.copy(a) : (i = H.emissive) == null || i.setHex(0);
|
|
2997
2772
|
}
|
|
2998
|
-
function
|
|
2999
|
-
n.selectedMeshes.forEach((e) =>
|
|
2773
|
+
function le(n) {
|
|
2774
|
+
n.selectedMeshes.forEach((e) => Hb(e, n)), n.selectedMeshes.clear();
|
|
3000
2775
|
}
|
|
3001
|
-
function
|
|
3002
|
-
var k,
|
|
2776
|
+
function cb(n, e, a, H, b, i, r = {}) {
|
|
2777
|
+
var k, l;
|
|
3003
2778
|
const f = e.getBoundingClientRect();
|
|
3004
2779
|
i.mouse.x = (n.clientX - f.left) / f.width * 2 - 1, i.mouse.y = -((n.clientY - f.top) / f.height) * 2 + 1, i.raycaster.setFromCamera(i.mouse, a);
|
|
3005
|
-
const c =
|
|
2780
|
+
const c = Xe(H, b), t = i.raycaster.intersectObjects(c, !0);
|
|
3006
2781
|
if (t.length === 0) {
|
|
3007
|
-
i.selectedMeshes.size > 0 && (
|
|
2782
|
+
i.selectedMeshes.size > 0 && (le(i), i.selectedMesh = null), (k = r.onMiss) == null || k.call(r);
|
|
3008
2783
|
return;
|
|
3009
2784
|
}
|
|
3010
|
-
const d = t[0].object, o =
|
|
3011
|
-
|
|
3012
|
-
var
|
|
3013
|
-
const
|
|
3014
|
-
i.originalEmissive.has(
|
|
2785
|
+
const d = t[0].object, o = e2(d);
|
|
2786
|
+
le(i), o.forEach((u) => {
|
|
2787
|
+
var m, g;
|
|
2788
|
+
const h = u.material;
|
|
2789
|
+
i.originalEmissive.has(u) || i.originalEmissive.set(u, ((m = h.emissive) == null ? void 0 : m.clone()) ?? new k0(0)), u.material = h.clone(), (g = u.material.emissive) == null || g.setHex(Ka), i.selectedMeshes.add(u);
|
|
3015
2790
|
}), i.selectedMesh = d;
|
|
3016
|
-
const s =
|
|
3017
|
-
(
|
|
2791
|
+
const s = rb(d);
|
|
2792
|
+
(l = r.onSelect) == null || l.call(r, d, s);
|
|
3018
2793
|
}
|
|
3019
|
-
function
|
|
3020
|
-
n.selectedMeshes.size > 0 &&
|
|
2794
|
+
function Ge(n) {
|
|
2795
|
+
n.selectedMeshes.size > 0 && le(n), n.originalEmissive.clear(), n.selectedMeshes.clear(), n.selectedMesh = null;
|
|
3021
2796
|
}
|
|
3022
|
-
|
|
3023
|
-
|
|
2797
|
+
const fb = {
|
|
2798
|
+
"联轴器下-1001": ["联轴器下-1001", "联轴器下-2001"],
|
|
2799
|
+
"下轧辊-1001": ["下轧辊-1001", "下轧辊000-1"],
|
|
2800
|
+
"轧辊整体-1001": ["轧辊整体-1001", "上轧辊000-1"],
|
|
2801
|
+
"下轧辊-1": ["下轧辊-1", "下轧辊000-3"],
|
|
2802
|
+
"轧辊整体-1": ["轧辊整体-1", "上轧辊000-3"],
|
|
2803
|
+
"联轴器下-1": ["联轴器下-1", "联轴器下-2"]
|
|
2804
|
+
};
|
|
2805
|
+
function Ue(n, e) {
|
|
2806
|
+
const a = fb[n] ?? [n];
|
|
2807
|
+
for (const H of e.value)
|
|
2808
|
+
if (H)
|
|
2809
|
+
for (const b of a) {
|
|
2810
|
+
const i = H.getObjectByName(b);
|
|
2811
|
+
if (i) return i;
|
|
2812
|
+
}
|
|
2813
|
+
return null;
|
|
2814
|
+
}
|
|
2815
|
+
function xe(n, e) {
|
|
2816
|
+
n.userData[ke] = e, n.traverse((a) => {
|
|
2817
|
+
a.userData[se] = n, a.userData[ke] = e;
|
|
2818
|
+
});
|
|
2819
|
+
}
|
|
2820
|
+
function tb(n, e) {
|
|
2821
|
+
if (n.parent === e) return;
|
|
2822
|
+
n.updateMatrixWorld(!0), e.updateMatrixWorld(!0);
|
|
2823
|
+
const a = new y(), H = new d0(), b = new y();
|
|
2824
|
+
n.getWorldPosition(a), n.getWorldQuaternion(H), n.getWorldScale(b);
|
|
2825
|
+
const i = new y();
|
|
2826
|
+
e.getWorldPosition(i), n.parent && n.parent.remove(n), e.add(n), n.position.copy(a).sub(i), n.quaternion.copy(H), n.scale.copy(b), n.updateMatrixWorld(!0), e.updateMatrixWorld(!0);
|
|
2827
|
+
}
|
|
2828
|
+
function nb(n, e, a, H) {
|
|
2829
|
+
const b = Ue(e, H);
|
|
2830
|
+
if (!b)
|
|
2831
|
+
return console.warn(`[useMillPivotAnimation] 未找到参考件: ${e}`), null;
|
|
2832
|
+
const i = new y();
|
|
2833
|
+
b.getWorldPosition(i);
|
|
2834
|
+
const r = new Z0();
|
|
2835
|
+
r.name = `${e}-pivot`, r.position.copy(i), n.add(r), r.updateMatrixWorld(!0), xe(b, "coupling");
|
|
2836
|
+
const f = /* @__PURE__ */ new Map();
|
|
2837
|
+
for (const c of a) {
|
|
2838
|
+
const t = Ue(c, H);
|
|
2839
|
+
if (!t) {
|
|
2840
|
+
console.warn(`[useMillPivotAnimation] 未找到部件: ${c}`);
|
|
2841
|
+
continue;
|
|
2842
|
+
}
|
|
2843
|
+
tb(t, r), xe(t, "roll"), f.set(c, t);
|
|
2844
|
+
}
|
|
2845
|
+
return { pivot: r, partMap: f };
|
|
2846
|
+
}
|
|
2847
|
+
function db(n, e, a, H) {
|
|
2848
|
+
const i = [
|
|
2849
|
+
{ ref: "联轴器上-1001", parts: ["轧辊整体-1001", "联轴器上-1001"] },
|
|
2850
|
+
{ ref: "联轴器下-1001", parts: ["下轧辊-1001", "联轴器下-1001"] },
|
|
2851
|
+
{ ref: "联轴器上-1", parts: ["轧辊整体-1", "联轴器上-1"] },
|
|
2852
|
+
{ ref: "联轴器下-1", parts: ["下轧辊-1", "联轴器下-1"] }
|
|
2853
|
+
];
|
|
2854
|
+
function r(c, t) {
|
|
2855
|
+
const d = t.get(c.partName);
|
|
2856
|
+
d ? H(c.partName, d.obj, d.pivot, c) : a(c.partName, c);
|
|
2857
|
+
}
|
|
2858
|
+
function f() {
|
|
2859
|
+
const { scene: c } = e();
|
|
2860
|
+
if (!c) {
|
|
2861
|
+
console.warn("[useMillPivotAnimation] scene 不可用,跳过轧机 pivot 设置");
|
|
2862
|
+
return;
|
|
2863
|
+
}
|
|
2864
|
+
const t = /* @__PURE__ */ new Map();
|
|
2865
|
+
for (const s of i) {
|
|
2866
|
+
const k = nb(c, s.ref, s.parts, n);
|
|
2867
|
+
k && k.partMap.forEach((l, u) => {
|
|
2868
|
+
t.set(u, { pivot: k.pivot, obj: l });
|
|
2869
|
+
});
|
|
2870
|
+
}
|
|
2871
|
+
const d = [
|
|
2872
|
+
{ partName: "轧辊整体-1001", axis: "z", speed: 0.8, direction: 1 },
|
|
2873
|
+
{ partName: "联轴器上-1001", axis: "z", speed: 0.8, direction: 1 },
|
|
2874
|
+
{ partName: "下轧辊-1001", axis: "z", speed: 0.8, direction: -1 },
|
|
2875
|
+
{ partName: "联轴器下-1001", axis: "z", speed: 0.8, direction: -1 }
|
|
2876
|
+
], o = [
|
|
2877
|
+
{ partName: "轧辊整体-1", axis: "z", speed: 0.8, direction: 1 },
|
|
2878
|
+
{ partName: "联轴器上-1", axis: "z", speed: 0.8, direction: 1 },
|
|
2879
|
+
{ partName: "下轧辊-1", axis: "z", speed: 0.8, direction: -1 },
|
|
2880
|
+
{ partName: "联轴器下-1", axis: "z", speed: 0.8, direction: -1 }
|
|
2881
|
+
];
|
|
2882
|
+
d.forEach((s) => r(s, t)), o.forEach((s) => r(s, t));
|
|
3024
2883
|
}
|
|
3025
|
-
return { setupMillAnimations:
|
|
2884
|
+
return { setupMillAnimations: f };
|
|
3026
2885
|
}
|
|
3027
|
-
function
|
|
2886
|
+
function ob(n) {
|
|
3028
2887
|
let e = null;
|
|
3029
|
-
const a =
|
|
2888
|
+
const a = c0(!1), H = c0(null), b = c0(null);
|
|
3030
2889
|
function i() {
|
|
3031
2890
|
if (!H.value || !n.threejsContainer.value) {
|
|
3032
2891
|
b.value = null;
|
|
@@ -3034,41 +2893,41 @@ function si(n) {
|
|
|
3034
2893
|
}
|
|
3035
2894
|
const { camera: k } = n.getThreeJSObjects();
|
|
3036
2895
|
if (!k) return;
|
|
3037
|
-
const
|
|
3038
|
-
|
|
3039
|
-
const
|
|
3040
|
-
b.value = { x:
|
|
2896
|
+
const u = H.value.worldPosition.clone();
|
|
2897
|
+
u.project(k);
|
|
2898
|
+
const h = n.threejsContainer.value.getBoundingClientRect(), m = h.left + (u.x * 0.5 + 0.5) * h.width + (n.offsetX ?? 15), g = h.top + (-(u.y * 0.5) + 0.5) * h.height + (n.offsetY ?? 15);
|
|
2899
|
+
b.value = { x: m, y: g };
|
|
3041
2900
|
}
|
|
3042
2901
|
function r(k) {
|
|
3043
2902
|
if (!e || !n.threejsContainer.value) return;
|
|
3044
|
-
const { camera:
|
|
3045
|
-
if (!
|
|
3046
|
-
const
|
|
3047
|
-
b.value = { x: k.clientX +
|
|
2903
|
+
const { camera: l, scene: u } = n.getThreeJSObjects();
|
|
2904
|
+
if (!l || !u) return;
|
|
2905
|
+
const h = n.offsetX ?? 15, m = n.offsetY ?? 15;
|
|
2906
|
+
b.value = { x: k.clientX + h, y: k.clientY + m }, cb(
|
|
3048
2907
|
k,
|
|
3049
2908
|
n.threejsContainer.value,
|
|
3050
|
-
|
|
3051
|
-
|
|
2909
|
+
l,
|
|
2910
|
+
u,
|
|
3052
2911
|
n.currentModels.value,
|
|
3053
2912
|
e,
|
|
3054
2913
|
{
|
|
3055
|
-
onSelect: (
|
|
3056
|
-
var
|
|
3057
|
-
H.value =
|
|
2914
|
+
onSelect: (g, A) => {
|
|
2915
|
+
var p;
|
|
2916
|
+
H.value = A, a.value = !0, i(), (p = n.onSelect) == null || p.call(n, g, A);
|
|
3058
2917
|
},
|
|
3059
2918
|
onMiss: () => {
|
|
3060
|
-
var
|
|
3061
|
-
i(), (
|
|
2919
|
+
var g;
|
|
2920
|
+
i(), (g = n.onMiss) == null || g.call(n);
|
|
3062
2921
|
}
|
|
3063
2922
|
}
|
|
3064
2923
|
);
|
|
3065
2924
|
}
|
|
3066
2925
|
function f() {
|
|
3067
2926
|
var k;
|
|
3068
|
-
e &&
|
|
2927
|
+
e && Ge(e), e = ib(), (k = n.threejsContainer.value) == null || k.addEventListener("click", r);
|
|
3069
2928
|
}
|
|
3070
2929
|
function c() {
|
|
3071
|
-
o(), n.threejsContainer.value && e && (n.threejsContainer.value.removeEventListener("click", r),
|
|
2930
|
+
o(), n.threejsContainer.value && e && (n.threejsContainer.value.removeEventListener("click", r), Ge(e), e = null);
|
|
3072
2931
|
}
|
|
3073
2932
|
let t = null;
|
|
3074
2933
|
function d() {
|
|
@@ -3080,9 +2939,9 @@ function si(n) {
|
|
|
3080
2939
|
function o() {
|
|
3081
2940
|
t !== null && (cancelAnimationFrame(t), t = null);
|
|
3082
2941
|
}
|
|
3083
|
-
|
|
2942
|
+
O0(a, (k) => {
|
|
3084
2943
|
k ? d() : o();
|
|
3085
|
-
}),
|
|
2944
|
+
}), Pe(() => {
|
|
3086
2945
|
c();
|
|
3087
2946
|
});
|
|
3088
2947
|
function s() {
|
|
@@ -3098,7 +2957,7 @@ function si(n) {
|
|
|
3098
2957
|
updatePopupPosition: i
|
|
3099
2958
|
};
|
|
3100
2959
|
}
|
|
3101
|
-
const
|
|
2960
|
+
const sb = { class: "popup-header" }, kb = { class: "popup-title" }, lb = { class: "popup-body" }, ub = /* @__PURE__ */ Be({
|
|
3102
2961
|
__name: "threeModelInfoPanel",
|
|
3103
2962
|
props: {
|
|
3104
2963
|
modelValue: { type: Boolean },
|
|
@@ -3107,13 +2966,13 @@ const ki = { class: "popup-header" }, li = { class: "popup-title" }, ui = { clas
|
|
|
3107
2966
|
},
|
|
3108
2967
|
emits: ["update:modelValue", "close"],
|
|
3109
2968
|
setup(n, { emit: e }) {
|
|
3110
|
-
const a = n, H = e, b =
|
|
3111
|
-
|
|
2969
|
+
const a = n, H = e, b = c0(a.modelValue);
|
|
2970
|
+
O0(() => a.modelValue, (t) => {
|
|
3112
2971
|
b.value = t;
|
|
3113
|
-
}),
|
|
2972
|
+
}), O0(b, (t) => {
|
|
3114
2973
|
H("update:modelValue", t);
|
|
3115
2974
|
});
|
|
3116
|
-
const i =
|
|
2975
|
+
const i = Y0(() => {
|
|
3117
2976
|
const t = a.screenPosition;
|
|
3118
2977
|
return t ? {
|
|
3119
2978
|
left: `${t.x + 15}px`,
|
|
@@ -3123,7 +2982,7 @@ const ki = { class: "popup-header" }, li = { class: "popup-title" }, ui = { clas
|
|
|
3123
2982
|
top: "50%",
|
|
3124
2983
|
transform: "translate(-50%, -50%)"
|
|
3125
2984
|
};
|
|
3126
|
-
}), r =
|
|
2985
|
+
}), r = Y0(() => {
|
|
3127
2986
|
if (!a.partInfo) return [];
|
|
3128
2987
|
const t = a.partInfo;
|
|
3129
2988
|
return [
|
|
@@ -3154,7 +3013,7 @@ const ki = { class: "popup-header" }, li = { class: "popup-title" }, ui = { clas
|
|
|
3154
3013
|
value: `W:${t.boundingBox.size.x.toFixed(2)} H:${t.boundingBox.size.y.toFixed(2)} D:${t.boundingBox.size.z.toFixed(2)}`
|
|
3155
3014
|
}
|
|
3156
3015
|
];
|
|
3157
|
-
}), f =
|
|
3016
|
+
}), f = Y0(() => {
|
|
3158
3017
|
const t = {};
|
|
3159
3018
|
return r.value.forEach((d) => {
|
|
3160
3019
|
t[d.prop] = d.value;
|
|
@@ -3162,70 +3021,70 @@ const ki = { class: "popup-header" }, li = { class: "popup-title" }, ui = { clas
|
|
|
3162
3021
|
}), c = () => {
|
|
3163
3022
|
H("update:modelValue", !1), H("close");
|
|
3164
3023
|
};
|
|
3165
|
-
return (t, d) => (
|
|
3166
|
-
b.value && t.partInfo ? (
|
|
3024
|
+
return (t, d) => (D0(), be(c2, { to: "body" }, [
|
|
3025
|
+
b.value && t.partInfo ? (D0(), ie("div", {
|
|
3167
3026
|
key: 0,
|
|
3168
3027
|
class: "info-popup",
|
|
3169
|
-
style:
|
|
3170
|
-
onClick: d[0] || (d[0] =
|
|
3028
|
+
style: t2(i.value),
|
|
3029
|
+
onClick: d[0] || (d[0] = f2(() => {
|
|
3171
3030
|
}, ["stop"]))
|
|
3172
3031
|
}, [
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3032
|
+
e0("div", sb, [
|
|
3033
|
+
e0("span", kb, He(t.partInfo.name), 1),
|
|
3034
|
+
e0("span", {
|
|
3176
3035
|
class: "popup-close",
|
|
3177
3036
|
onClick: c
|
|
3178
3037
|
}, "×")
|
|
3179
3038
|
]),
|
|
3180
|
-
|
|
3181
|
-
|
|
3039
|
+
e0("div", lb, [
|
|
3040
|
+
h0(Ha, {
|
|
3182
3041
|
"row-contents": r.value,
|
|
3183
3042
|
"row-values": f.value,
|
|
3184
3043
|
"form-disabled": !0,
|
|
3185
3044
|
"is-edit": !1
|
|
3186
3045
|
}, null, 8, ["row-contents", "row-values"])
|
|
3187
3046
|
])
|
|
3188
|
-
], 4)) :
|
|
3047
|
+
], 4)) : re("", !0)
|
|
3189
3048
|
]));
|
|
3190
3049
|
}
|
|
3191
|
-
}),
|
|
3050
|
+
}), hb = /* @__PURE__ */ Je(ub, [["__scopeId", "data-v-1ac66143"]]), gb = { class: "obj-viewer-container" }, _b = { class: "buttonGroup-topLeft" }, Ab = { class: "buttonGroup-left" }, pb = { class: "buttonGroup-right" }, mb = { class: "buttonGroup-bottom" }, jb = { class: "left-panel" }, Ib = { class: "panel-header" }, yb = {
|
|
3192
3051
|
key: 0,
|
|
3193
3052
|
class: "loading-overlay"
|
|
3194
|
-
},
|
|
3053
|
+
}, wb = !0, Fb = /* @__PURE__ */ Be({
|
|
3195
3054
|
__name: "threePreview",
|
|
3196
3055
|
props: {
|
|
3197
3056
|
fileBlobs: { default: () => [] }
|
|
3198
3057
|
},
|
|
3199
3058
|
setup(n) {
|
|
3200
|
-
const a = n, H =
|
|
3059
|
+
const a = n, H = c0(null), b = c0(!1), i = c0("");
|
|
3201
3060
|
let r = null;
|
|
3202
|
-
function f(
|
|
3061
|
+
function f(T) {
|
|
3203
3062
|
if (!r || !H.value) return;
|
|
3204
|
-
const { camera:
|
|
3205
|
-
!
|
|
3206
|
-
|
|
3063
|
+
const { camera: O, scene: q } = C();
|
|
3064
|
+
!O || !q || ab(
|
|
3065
|
+
T,
|
|
3207
3066
|
H.value,
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3067
|
+
O,
|
|
3068
|
+
q,
|
|
3069
|
+
_.value,
|
|
3211
3070
|
r,
|
|
3212
3071
|
{
|
|
3213
|
-
onHit: (
|
|
3214
|
-
var
|
|
3215
|
-
console.log("[PICK_DEBUG] 点击的 mesh 对象:",
|
|
3072
|
+
onHit: (U) => {
|
|
3073
|
+
var Z;
|
|
3074
|
+
console.log("[PICK_DEBUG] 点击的 mesh 对象:", U), console.log("[PICK_DEBUG] mesh.name:", U.name), console.log("[PICK_DEBUG] mesh.uuid:", U.uuid), console.log("[PICK_DEBUG] parent.name:", (Z = U.parent) == null ? void 0 : Z.name), console.log("[PICK_DEBUG] 完整 mesh:", U);
|
|
3216
3075
|
}
|
|
3217
3076
|
}
|
|
3218
3077
|
);
|
|
3219
3078
|
}
|
|
3220
|
-
function c(
|
|
3221
|
-
if (!r ||
|
|
3222
|
-
const
|
|
3223
|
-
if (
|
|
3224
|
-
const
|
|
3225
|
-
if (
|
|
3079
|
+
function c(T) {
|
|
3080
|
+
if (!r || T.key !== "h" && T.key !== "H") return;
|
|
3081
|
+
const O = T.target;
|
|
3082
|
+
if (O) {
|
|
3083
|
+
const U = O.tagName;
|
|
3084
|
+
if (U === "INPUT" || U === "TEXTAREA" || O.isContentEditable) return;
|
|
3226
3085
|
}
|
|
3227
|
-
const
|
|
3228
|
-
|
|
3086
|
+
const q = bb(r);
|
|
3087
|
+
q === null ? console.log("[PICK_DEBUG] 当前没有选中部件, H 快捷键无效") : (console.log(`[PICK_DEBUG] 已${q ? "显示" : "隐藏"}当前选中部件 (快捷键 H)`), T.preventDefault());
|
|
3229
3088
|
}
|
|
3230
3089
|
const {
|
|
3231
3090
|
threeInfo: t,
|
|
@@ -3234,249 +3093,235 @@ const ki = { class: "popup-header" }, li = { class: "popup-title" }, ui = { clas
|
|
|
3234
3093
|
loadingProgress: o,
|
|
3235
3094
|
loadedModels: s,
|
|
3236
3095
|
error: k,
|
|
3237
|
-
loadModelsFromBlobs:
|
|
3096
|
+
loadModelsFromBlobs: l
|
|
3238
3097
|
},
|
|
3239
|
-
animation: { isAnimating:
|
|
3098
|
+
animation: { isAnimating: u, toggleAnimation: h, stopAnimation: m },
|
|
3240
3099
|
clipping: {
|
|
3241
|
-
isClipping:
|
|
3242
|
-
activeClippingAxis:
|
|
3243
|
-
toggleClipping:
|
|
3244
|
-
updateClippingPlanes:
|
|
3100
|
+
isClipping: g,
|
|
3101
|
+
activeClippingAxis: A,
|
|
3102
|
+
toggleClipping: p,
|
|
3103
|
+
updateClippingPlanes: w
|
|
3245
3104
|
},
|
|
3246
3105
|
partAnimation: {
|
|
3247
|
-
isPartAnimating:
|
|
3248
|
-
setPartRotations:
|
|
3249
|
-
startPartAnimations:
|
|
3250
|
-
stopPartAnimations:
|
|
3106
|
+
isPartAnimating: F,
|
|
3107
|
+
setPartRotations: v,
|
|
3108
|
+
startPartAnimations: B,
|
|
3109
|
+
stopPartAnimations: W
|
|
3251
3110
|
},
|
|
3252
3111
|
millPivotAnimation: {
|
|
3253
|
-
setupMillAnimations:
|
|
3112
|
+
setupMillAnimations: E
|
|
3254
3113
|
}
|
|
3255
|
-
} =
|
|
3114
|
+
} = Sa(H, {
|
|
3256
3115
|
useModelLoaderHook: !0,
|
|
3257
3116
|
useAnimationHook: !0,
|
|
3258
3117
|
useClippingHook: !0,
|
|
3259
3118
|
usePartAnimationHook: !0
|
|
3260
|
-
}), { resetView:
|
|
3261
|
-
const
|
|
3262
|
-
|
|
3263
|
-
},
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
q,
|
|
3119
|
+
}), { resetView: x, initThreeJS: S, handleResize: K, cleanup: N, setAndFitModels: j, axesHelperVisible: R, toggleAxesVisibility: V, currentModels: _, addBeforeRenderCallback: L, removeBeforeRenderCallback: Q, getThreeJSObjects: C, isBeforeRenderPaused: J, setBeforeRenderPaused: X } = t, f0 = () => {
|
|
3120
|
+
const T = !J.value;
|
|
3121
|
+
X(T), console.log(`[DEBUG] 动画${T ? "已暂停" : "已恢复"}`);
|
|
3122
|
+
}, o0 = Ja(
|
|
3123
|
+
_,
|
|
3124
|
+
L,
|
|
3125
|
+
Q
|
|
3126
|
+
), p0 = Qa(
|
|
3127
|
+
_,
|
|
3128
|
+
L,
|
|
3129
|
+
Q,
|
|
3272
3130
|
C,
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
(R, E) => a0.getClampWorldPosition(R, E),
|
|
3276
|
-
// 物料到达 conveyorSurfaceEnd 后同时启动链条流动与链轮自转
|
|
3277
|
-
() => {
|
|
3278
|
-
a0.startChainAnimation(), y0();
|
|
3279
|
-
},
|
|
3280
|
-
// 传入一对夹具的中心点查询函数(两夹具共同夹持物料,取中点)
|
|
3281
|
-
(R, E, H0) => a0.getClampPairWorldPosition(R, E, H0),
|
|
3282
|
-
// 循环重置时停止链条流动与链轮自转
|
|
3283
|
-
() => {
|
|
3284
|
-
a0.stopChainAnimation(), o0();
|
|
3285
|
-
}
|
|
3131
|
+
// 传入链条夹具位置查询函数,使胚料能跟随夹具移动
|
|
3132
|
+
(T, O) => o0.getClampWorldPosition(T, O)
|
|
3286
3133
|
), {
|
|
3287
|
-
showPanel:
|
|
3288
|
-
selectedPartInfo:
|
|
3289
|
-
screenPosition:
|
|
3290
|
-
init:
|
|
3291
|
-
dispose:
|
|
3292
|
-
} =
|
|
3134
|
+
showPanel: m0,
|
|
3135
|
+
selectedPartInfo: Y,
|
|
3136
|
+
screenPosition: s0,
|
|
3137
|
+
init: G0,
|
|
3138
|
+
dispose: C0
|
|
3139
|
+
} = ob({
|
|
3293
3140
|
threejsContainer: H,
|
|
3294
|
-
getThreeJSObjects:
|
|
3295
|
-
currentModels:
|
|
3296
|
-
}),
|
|
3297
|
-
|
|
3298
|
-
},
|
|
3299
|
-
|
|
3300
|
-
},
|
|
3141
|
+
getThreeJSObjects: C,
|
|
3142
|
+
currentModels: _
|
|
3143
|
+
}), j0 = () => {
|
|
3144
|
+
V();
|
|
3145
|
+
}, I0 = (T) => {
|
|
3146
|
+
A.value = T, w();
|
|
3147
|
+
}, U0 = [
|
|
3301
3148
|
{ partName: "主动链轮10倍-1001", axis: "y", speed: 1, direction: -1 },
|
|
3302
3149
|
{ partName: "主动链轮10倍-2001", axis: "y", speed: 1, direction: -1 },
|
|
3303
3150
|
{ partName: "主动链轮10倍-1", axis: "y", speed: 1, direction: 1 },
|
|
3304
3151
|
{ partName: "主动链轮10倍-2", axis: "y", speed: 1, direction: 1 }
|
|
3305
3152
|
];
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
console.error("加载错误:",
|
|
3153
|
+
O0(() => a.fileBlobs, (T) => {
|
|
3154
|
+
T && T.length > 0 && l(T).catch((O) => {
|
|
3155
|
+
console.error("加载错误:", O);
|
|
3309
3156
|
});
|
|
3310
3157
|
}, {
|
|
3311
3158
|
immediate: !0,
|
|
3312
3159
|
deep: !0
|
|
3313
|
-
}),
|
|
3314
|
-
|
|
3315
|
-
}),
|
|
3316
|
-
|
|
3160
|
+
}), O0(s, (T) => {
|
|
3161
|
+
T && T.length > 0 && (j(T), E(), v(U0), B(), o0.startChainAnimation(), p0.startBilletDelivery());
|
|
3162
|
+
}), O0(k, (T) => {
|
|
3163
|
+
T && Ne.error(`模型加载失败: ${T}`);
|
|
3317
3164
|
});
|
|
3318
|
-
const
|
|
3319
|
-
b.value = !0, i.value =
|
|
3165
|
+
const $ = (T) => {
|
|
3166
|
+
b.value = !0, i.value = T, T === "剖面视图" && !g.value && p();
|
|
3320
3167
|
};
|
|
3321
|
-
let
|
|
3322
|
-
return
|
|
3323
|
-
await
|
|
3168
|
+
let y0 = null;
|
|
3169
|
+
return n2(async () => {
|
|
3170
|
+
await d2();
|
|
3324
3171
|
try {
|
|
3325
|
-
|
|
3172
|
+
S(), H.value && (y0 = new ResizeObserver(K), y0.observe(H.value)), wb && (window.__threePreview__ = {
|
|
3326
3173
|
threeInfo: t,
|
|
3327
|
-
currentModels:
|
|
3174
|
+
currentModels: _,
|
|
3328
3175
|
loadedModels: s,
|
|
3329
|
-
getThreeJSObjects:
|
|
3330
|
-
billetAnimation:
|
|
3331
|
-
chainAnimation:
|
|
3332
|
-
isBeforeRenderPaused:
|
|
3333
|
-
setBeforeRenderPaused:
|
|
3176
|
+
getThreeJSObjects: C,
|
|
3177
|
+
billetAnimation: p0,
|
|
3178
|
+
chainAnimation: o0,
|
|
3179
|
+
isBeforeRenderPaused: J,
|
|
3180
|
+
setBeforeRenderPaused: X,
|
|
3334
3181
|
// 调试函数
|
|
3335
|
-
_logRollDetails: (
|
|
3336
|
-
var
|
|
3337
|
-
if (
|
|
3338
|
-
const
|
|
3339
|
-
|
|
3340
|
-
name:
|
|
3341
|
-
parent: ((
|
|
3342
|
-
worldPos:
|
|
3343
|
-
bboxCenter:
|
|
3344
|
-
bboxSize:
|
|
3345
|
-
worldQuat:
|
|
3346
|
-
posVsBboxCenter: { dx:
|
|
3182
|
+
_logRollDetails: (T, O) => {
|
|
3183
|
+
var q;
|
|
3184
|
+
if (O) {
|
|
3185
|
+
const U = new y(), Z = new d0(), a0 = new y(), w0 = new y(), F0 = new W0().setFromObject(O);
|
|
3186
|
+
F0.getCenter(a0), F0.getSize(w0), O.getWorldPosition(U), O.getWorldQuaternion(Z), console.log(`[DEBUG] ${T}:`, {
|
|
3187
|
+
name: O.name,
|
|
3188
|
+
parent: ((q = O.parent) == null ? void 0 : q.name) ?? "null",
|
|
3189
|
+
worldPos: U,
|
|
3190
|
+
bboxCenter: a0,
|
|
3191
|
+
bboxSize: w0,
|
|
3192
|
+
worldQuat: Z,
|
|
3193
|
+
posVsBboxCenter: { dx: U.x - a0.x, dy: U.y - a0.y, dz: U.z - a0.z }
|
|
3347
3194
|
});
|
|
3348
3195
|
}
|
|
3349
3196
|
},
|
|
3350
3197
|
// 快速打印所有轧辊状态
|
|
3351
3198
|
_printAllRollStates: () => {
|
|
3352
|
-
const { scene:
|
|
3353
|
-
if (!
|
|
3354
|
-
const
|
|
3355
|
-
for (const
|
|
3356
|
-
let
|
|
3357
|
-
for (const
|
|
3358
|
-
if (!
|
|
3359
|
-
const
|
|
3360
|
-
if (
|
|
3361
|
-
|
|
3199
|
+
const { scene: T } = C();
|
|
3200
|
+
if (!T) return;
|
|
3201
|
+
const O = ["轧辊整体-1001", "下轧辊-1001", "轧辊整体-1", "下轧辊-1"];
|
|
3202
|
+
for (const q of O) {
|
|
3203
|
+
let U = null;
|
|
3204
|
+
for (const Z of _.value) {
|
|
3205
|
+
if (!Z) continue;
|
|
3206
|
+
const a0 = Z.getObjectByName(q);
|
|
3207
|
+
if (a0) {
|
|
3208
|
+
U = a0;
|
|
3362
3209
|
break;
|
|
3363
3210
|
}
|
|
3364
3211
|
}
|
|
3365
|
-
if (!
|
|
3366
|
-
const
|
|
3367
|
-
|
|
3212
|
+
if (!U) {
|
|
3213
|
+
const Z = T.getObjectByName(q);
|
|
3214
|
+
Z && (U = Z);
|
|
3368
3215
|
}
|
|
3369
|
-
if (
|
|
3370
|
-
const
|
|
3371
|
-
|
|
3216
|
+
if (U) {
|
|
3217
|
+
const Z = new y(), a0 = new d0();
|
|
3218
|
+
U.getWorldPosition(Z), U.getWorldQuaternion(a0), console.log(`[ROLL] ${q}: pos=${Z.x.toFixed(2)}, ${Z.y.toFixed(2)}, ${Z.z.toFixed(2)} | w=${a0.w.toFixed(4)}`);
|
|
3372
3219
|
}
|
|
3373
3220
|
}
|
|
3374
3221
|
}
|
|
3375
|
-
}),
|
|
3376
|
-
} catch (
|
|
3377
|
-
console.error("Three.js 初始化失败:",
|
|
3222
|
+
}), G0(), console.log("[SELECT] 常驻部件选择已开启,点击模型显示部件信息");
|
|
3223
|
+
} catch (T) {
|
|
3224
|
+
console.error("Three.js 初始化失败:", T), Ne.error("渲染引擎初始化失败!");
|
|
3378
3225
|
}
|
|
3379
|
-
}),
|
|
3380
|
-
i.value = "",
|
|
3381
|
-
}), (
|
|
3382
|
-
const
|
|
3383
|
-
return
|
|
3384
|
-
|
|
3226
|
+
}), Pe(() => {
|
|
3227
|
+
i.value = "", y0 && y0.disconnect(), C0(), u.value && m(), F.value && W(), p0.dispose(), o0.dispose(), N();
|
|
3228
|
+
}), (T, O) => {
|
|
3229
|
+
const q = o2("el-scrollbar");
|
|
3230
|
+
return D0(), ie("div", gb, [
|
|
3231
|
+
e0("div", {
|
|
3385
3232
|
ref_key: "threejsContainer",
|
|
3386
3233
|
ref: H,
|
|
3387
3234
|
class: "threejs-container"
|
|
3388
3235
|
}, null, 512),
|
|
3389
|
-
|
|
3390
|
-
|
|
3236
|
+
e0("div", _b, [
|
|
3237
|
+
h0(v0, {
|
|
3391
3238
|
name: "viewReset",
|
|
3392
3239
|
size: "24",
|
|
3393
|
-
onClick:
|
|
3240
|
+
onClick: n0(x),
|
|
3394
3241
|
title: "重置"
|
|
3395
3242
|
}, null, 8, ["onClick"]),
|
|
3396
|
-
|
|
3243
|
+
h0(v0, {
|
|
3397
3244
|
name: "fangda",
|
|
3398
3245
|
size: "24",
|
|
3399
3246
|
title: "放大"
|
|
3400
3247
|
}),
|
|
3401
|
-
|
|
3248
|
+
h0(v0, {
|
|
3402
3249
|
name: "suoxiao",
|
|
3403
3250
|
size: "24",
|
|
3404
3251
|
title: "缩小"
|
|
3405
3252
|
}),
|
|
3406
|
-
|
|
3253
|
+
h0(v0, {
|
|
3407
3254
|
name: "lookAround",
|
|
3408
3255
|
size: "24",
|
|
3409
|
-
onClick:
|
|
3410
|
-
title:
|
|
3256
|
+
onClick: n0(h),
|
|
3257
|
+
title: n0(u) ? "停止动画" : "动画视图"
|
|
3411
3258
|
}, null, 8, ["onClick", "title"]),
|
|
3412
|
-
|
|
3259
|
+
h0(v0, {
|
|
3413
3260
|
name: "zuobiaoxi",
|
|
3414
3261
|
size: "24",
|
|
3415
|
-
active:
|
|
3416
|
-
onClick:
|
|
3262
|
+
active: n0(R),
|
|
3263
|
+
onClick: j0,
|
|
3417
3264
|
title: "显隐坐标轴"
|
|
3418
3265
|
}, null, 8, ["active"])
|
|
3419
|
-
], 512), [
|
|
3420
|
-
[F2, !1]
|
|
3421
3266
|
]),
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3267
|
+
e0("div", Ab, [
|
|
3268
|
+
Ie(T.$slots, "button-left", { switchRightPanel: $ }, void 0, !0),
|
|
3269
|
+
h0(v0, {
|
|
3425
3270
|
name: "clipping",
|
|
3426
3271
|
size: "24",
|
|
3427
|
-
onClick:
|
|
3272
|
+
onClick: O[0] || (O[0] = (U) => $("剖面视图")),
|
|
3428
3273
|
active: b.value && i.value === "剖面视图",
|
|
3429
3274
|
title: "剖面视图"
|
|
3430
3275
|
}, null, 8, ["active"])
|
|
3431
3276
|
]),
|
|
3432
|
-
|
|
3433
|
-
|
|
3277
|
+
e0("div", pb, [
|
|
3278
|
+
Ie(T.$slots, "button-right", {}, void 0, !0)
|
|
3434
3279
|
]),
|
|
3435
|
-
|
|
3436
|
-
(
|
|
3280
|
+
e0("div", mb, [
|
|
3281
|
+
(D0(), be(v0, {
|
|
3437
3282
|
key: 0,
|
|
3438
3283
|
name: "zanting",
|
|
3439
3284
|
size: "24",
|
|
3440
3285
|
backgroundColor: "#ffffff",
|
|
3441
|
-
title:
|
|
3442
|
-
onClick:
|
|
3286
|
+
title: n0(J) ? "恢复动画" : "暂停动画",
|
|
3287
|
+
onClick: f0
|
|
3443
3288
|
}, null, 8, ["title"]))
|
|
3444
3289
|
]),
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3290
|
+
s2(e0("div", jb, [
|
|
3291
|
+
e0("div", Ib, [
|
|
3292
|
+
e0("span", null, He(i.value), 1),
|
|
3293
|
+
e0("span", {
|
|
3449
3294
|
class: "close",
|
|
3450
|
-
onClick:
|
|
3295
|
+
onClick: O[1] || (O[1] = (U) => b.value = !1)
|
|
3451
3296
|
}, " X ")
|
|
3452
3297
|
]),
|
|
3453
|
-
|
|
3454
|
-
default:
|
|
3455
|
-
i.value === "剖面视图" ? (
|
|
3298
|
+
h0(q, { "max-height": "650px" }, {
|
|
3299
|
+
default: k2(() => [
|
|
3300
|
+
i.value === "剖面视图" ? (D0(), be(aa, {
|
|
3456
3301
|
key: 0,
|
|
3457
|
-
value:
|
|
3458
|
-
onChange:
|
|
3459
|
-
}, null, 8, ["value"])) :
|
|
3302
|
+
value: n0(A),
|
|
3303
|
+
onChange: I0
|
|
3304
|
+
}, null, 8, ["value"])) : re("", !0)
|
|
3460
3305
|
]),
|
|
3461
3306
|
_: 1
|
|
3462
3307
|
})
|
|
3463
3308
|
], 512), [
|
|
3464
|
-
[
|
|
3309
|
+
[l2, b.value]
|
|
3465
3310
|
]),
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
])) :
|
|
3470
|
-
|
|
3471
|
-
modelValue:
|
|
3472
|
-
"onUpdate:modelValue":
|
|
3473
|
-
"part-info":
|
|
3474
|
-
"screen-position":
|
|
3311
|
+
n0(d) ? (D0(), ie("div", yb, [
|
|
3312
|
+
O[3] || (O[3] = e0("div", { class: "loading-spinner" }, null, -1)),
|
|
3313
|
+
e0("p", null, He(n0(o)), 1)
|
|
3314
|
+
])) : re("", !0),
|
|
3315
|
+
h0(hb, {
|
|
3316
|
+
modelValue: n0(m0),
|
|
3317
|
+
"onUpdate:modelValue": O[2] || (O[2] = (U) => u2(m0) ? m0.value = U : null),
|
|
3318
|
+
"part-info": n0(Y),
|
|
3319
|
+
"screen-position": n0(s0)
|
|
3475
3320
|
}, null, 8, ["modelValue", "part-info", "screen-position"])
|
|
3476
3321
|
]);
|
|
3477
3322
|
};
|
|
3478
3323
|
}
|
|
3479
|
-
}),
|
|
3324
|
+
}), Gb = /* @__PURE__ */ Je(Fb, [["__scopeId", "data-v-81a9f7d0"]]);
|
|
3480
3325
|
export {
|
|
3481
|
-
|
|
3326
|
+
Gb as default
|
|
3482
3327
|
};
|