ss-component-new 1.3.704 → 1.3.706
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{array-jbiWLnR-.js → array-BMCHedyE.js} +2 -2
- package/dist/{iconfont-C9LP7Z-d.js → iconfont-BwY2qVoK.js} +238 -234
- package/dist/{index-d9yiC1Rr.js → index-B2vjWoEB.js} +40 -40
- package/dist/{index-eunh_06c.js → index-BTOqgc1s.js} +2 -2
- package/dist/{index-B0l2_9Pc.js → index-BiD2svYY.js} +1 -1
- package/dist/{index-6kpIJwSG.js → index-BiMfzzPV.js} +1 -1
- package/dist/{index-l3g33MKM.js → index-C1pYY5Kg.js} +3 -3
- package/dist/{index-PV2PkfRE.js → index-CCOqF2de.js} +15417 -15267
- package/dist/{index-Da5qIKd6.js → index-CtE-JbIk.js} +2 -2
- package/dist/{index-YcuQhWbw.js → index-Cwd12dIT.js} +5599 -5579
- package/dist/{index-OGTnqUDW.js → index-DCK25QtA.js} +8 -8
- package/dist/{index-SohCFB2I.js → index-DOpUAJtb.js} +1 -1
- package/dist/{index-BFnTZBOW.js → index-DYhamWY7.js} +2 -2
- package/dist/{index-CSD3bL5o.js → index-GM47WPnp.js} +1 -1
- package/dist/{main-Dqoc5YbP.js → main-BfygOrTN.js} +2 -2
- package/dist/ss-component.css +2 -2
- package/dist/ss-component.js +9 -9
- package/dist/ss-component2.js +8 -8
- package/dist/{threeModel-BI3l0-99.js → threeModel-CoJT33S1.js} +2 -2
- package/dist/{threePreview-BkYkq6k4.js → threePreview-DUfFZQ5q.js} +1123 -950
- package/dist/{threeSceneView-ChFhJWgw.js → threeSceneView-B5sojPk9.js} +5 -5
- package/dist/{threeSceneViewForCPMPIP-DE5Oil86.js → threeSceneViewForCPMPIP-Bgi4Klfy.js} +3 -3
- package/dist/{threeTrackPathView-BxUqwu4s.js → threeTrackPathView-DmE9QE_0.js} +1 -1
- package/dist/{threeViewerHost-Dc7tuhCy.js → threeViewerHost--r-yJNpU.js} +1 -1
- package/dist/{workpieceTreePanel-Bnhv3-BB.js → workpieceTreePanel-DCSz_IDY.js} +1 -1
- package/package.json +1 -1
- package/dist/obj/model.mtl +0 -42
- package/dist/obj/model.obj +0 -26110
- package/public/obj/model.mtl +0 -42
- package/public/obj/model.obj +0 -26110
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { at as
|
|
1
|
+
import { ref as u0, shallowRef as Ye, defineComponent as Ke, watch as Z0, onMounted as Xe, nextTick as $e, onBeforeUnmount as e2, resolveComponent as a2, createElementBlock as he, openBlock as V0, createElementVNode as t0, withDirectives as b2, createCommentVNode as ge, createVNode as j0, unref as g0, renderSlot as _e, createBlock as Ae, toDisplayString as pe, withCtx as i2, vShow as H2 } from "vue";
|
|
2
|
+
import { at as r2, au as $0, av as Ee, R as Ge, aw as G0, U as L0, ax as s0, ay as fe, C as h0, az as k0, c as A0, aA as c2, j as f2, D as t2, n as S0, V as w, aB as n2, aC as n0, aD as d2, aE as Ue, aF as o2, aG as k2, a1 as U0, aH as s2, aI as xe, aJ as l2, aK as u2, aL as h2, aM as ee, aN as Pe, aO as ae, aP as g2, aQ as _2, _ as A2, aR as Q0, a2 as p2, t as Be, l as m2, aS as E0, aT as j2, u as qe, aU as I2, h as Ve, aV as y2, w as w2, aW as F2, $ as N2, s as C0, P as v2, o as T2, aX as R2, aY as M2, aZ as D2, a_ as O2, a$ as E2, b0 as We, b1 as G2, b2 as me, b3 as je, b4 as Ie, b5 as ye, b6 as be, a4 as U2, b7 as x2, B as z0, b8 as P2, k as B2, b9 as q2 } from "./index.vue_vue_type_style_index_0_scoped_05e3a1d8_lang-C2itW9KG.js";
|
|
3
3
|
import "./index-Bw3sTXPI.js";
|
|
4
|
-
import { u as
|
|
5
|
-
import { M as
|
|
6
|
-
import { E as
|
|
7
|
-
import { _ as
|
|
8
|
-
function
|
|
9
|
-
if (e ===
|
|
10
|
-
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),
|
|
11
|
-
if (e ===
|
|
12
|
-
let a =
|
|
4
|
+
import { u as V2, a as W2, b as C2, T as I0, C as L2 } from "./iconfont-BwY2qVoK.js";
|
|
5
|
+
import { M as S2, O as z2, S as Z2 } from "./MTLLoader-CkNZudBE.js";
|
|
6
|
+
import { E as we } from "./request-1RPa2bBn.js";
|
|
7
|
+
import { _ as Q2 } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
|
+
function Fe(n, e) {
|
|
9
|
+
if (e === r2)
|
|
10
|
+
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), n;
|
|
11
|
+
if (e === $0 || e === Ee) {
|
|
12
|
+
let a = n.getIndex();
|
|
13
13
|
if (a === null) {
|
|
14
|
-
const H = [], f =
|
|
14
|
+
const H = [], f = n.getAttribute("position");
|
|
15
15
|
if (f !== void 0) {
|
|
16
16
|
for (let c = 0; c < f.count; c++)
|
|
17
17
|
H.push(c);
|
|
18
|
-
|
|
18
|
+
n.setIndex(H), a = n.getIndex();
|
|
19
19
|
} else
|
|
20
|
-
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),
|
|
20
|
+
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), n;
|
|
21
21
|
}
|
|
22
22
|
const r = a.count - 2, b = [];
|
|
23
|
-
if (e ===
|
|
23
|
+
if (e === $0)
|
|
24
24
|
for (let H = 1; H <= r; H++)
|
|
25
25
|
b.push(a.getX(0)), b.push(a.getX(H)), b.push(a.getX(H + 1));
|
|
26
26
|
else
|
|
27
27
|
for (let H = 0; H < r; H++)
|
|
28
28
|
H % 2 === 0 ? (b.push(a.getX(H)), b.push(a.getX(H + 1)), b.push(a.getX(H + 2))) : (b.push(a.getX(H + 2)), b.push(a.getX(H + 1)), b.push(a.getX(H)));
|
|
29
29
|
b.length / 3 !== r && console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");
|
|
30
|
-
const i =
|
|
30
|
+
const i = n.clone();
|
|
31
31
|
return i.setIndex(b), i.clearGroups(), i;
|
|
32
32
|
} else
|
|
33
|
-
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e),
|
|
33
|
+
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e), n;
|
|
34
34
|
}
|
|
35
|
-
class
|
|
35
|
+
class J2 extends Ge {
|
|
36
36
|
/**
|
|
37
37
|
* Constructs a new glTF loader.
|
|
38
38
|
*
|
|
@@ -40,39 +40,39 @@ class N2 extends ke {
|
|
|
40
40
|
*/
|
|
41
41
|
constructor(e) {
|
|
42
42
|
super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(a) {
|
|
43
|
-
return new
|
|
43
|
+
return new ea(a);
|
|
44
44
|
}), this.register(function(a) {
|
|
45
|
-
return new
|
|
45
|
+
return new aa(a);
|
|
46
46
|
}), this.register(function(a) {
|
|
47
|
-
return new
|
|
47
|
+
return new da(a);
|
|
48
48
|
}), this.register(function(a) {
|
|
49
|
-
return new
|
|
49
|
+
return new oa(a);
|
|
50
50
|
}), this.register(function(a) {
|
|
51
|
-
return new
|
|
51
|
+
return new ka(a);
|
|
52
52
|
}), this.register(function(a) {
|
|
53
|
-
return new
|
|
53
|
+
return new ia(a);
|
|
54
54
|
}), this.register(function(a) {
|
|
55
|
-
return new
|
|
55
|
+
return new Ha(a);
|
|
56
56
|
}), this.register(function(a) {
|
|
57
|
-
return new
|
|
57
|
+
return new ra(a);
|
|
58
58
|
}), this.register(function(a) {
|
|
59
|
-
return new
|
|
59
|
+
return new ca(a);
|
|
60
60
|
}), this.register(function(a) {
|
|
61
|
-
return new
|
|
61
|
+
return new $2(a);
|
|
62
62
|
}), this.register(function(a) {
|
|
63
|
-
return new
|
|
63
|
+
return new fa(a);
|
|
64
64
|
}), this.register(function(a) {
|
|
65
|
-
return new
|
|
65
|
+
return new ba(a);
|
|
66
66
|
}), this.register(function(a) {
|
|
67
|
-
return new
|
|
67
|
+
return new na(a);
|
|
68
68
|
}), this.register(function(a) {
|
|
69
|
-
return new
|
|
69
|
+
return new ta(a);
|
|
70
70
|
}), this.register(function(a) {
|
|
71
|
-
return new
|
|
71
|
+
return new K2(a);
|
|
72
72
|
}), this.register(function(a) {
|
|
73
|
-
return new
|
|
73
|
+
return new sa(a);
|
|
74
74
|
}), this.register(function(a) {
|
|
75
|
-
return new
|
|
75
|
+
return new la(a);
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
@@ -90,21 +90,21 @@ class N2 extends ke {
|
|
|
90
90
|
if (this.resourcePath !== "")
|
|
91
91
|
H = this.resourcePath;
|
|
92
92
|
else if (this.path !== "") {
|
|
93
|
-
const t =
|
|
94
|
-
H =
|
|
93
|
+
const t = G0.extractUrlBase(e);
|
|
94
|
+
H = G0.resolveURL(t, this.path);
|
|
95
95
|
} else
|
|
96
|
-
H =
|
|
96
|
+
H = G0.extractUrlBase(e);
|
|
97
97
|
this.manager.itemStart(e);
|
|
98
98
|
const f = function(t) {
|
|
99
99
|
b ? b(t) : console.error(t), i.manager.itemError(e), i.manager.itemEnd(e);
|
|
100
|
-
}, c = new
|
|
100
|
+
}, c = new L0(this.manager);
|
|
101
101
|
c.setPath(this.path), c.setResponseType("arraybuffer"), c.setRequestHeader(this.requestHeader), c.setWithCredentials(this.withCredentials), c.load(e, function(t) {
|
|
102
102
|
try {
|
|
103
|
-
i.parse(t, H, function(
|
|
104
|
-
a(
|
|
103
|
+
i.parse(t, H, function(d) {
|
|
104
|
+
a(d), i.manager.itemEnd(e);
|
|
105
105
|
}, f);
|
|
106
|
-
} catch (
|
|
107
|
-
f(
|
|
106
|
+
} catch (d) {
|
|
107
|
+
f(d);
|
|
108
108
|
}
|
|
109
109
|
}, r, f);
|
|
110
110
|
}
|
|
@@ -172,14 +172,14 @@ class N2 extends ke {
|
|
|
172
172
|
if (typeof e == "string")
|
|
173
173
|
i = JSON.parse(e);
|
|
174
174
|
else if (e instanceof ArrayBuffer)
|
|
175
|
-
if (c.decode(new Uint8Array(e, 0, 4)) ===
|
|
175
|
+
if (c.decode(new Uint8Array(e, 0, 4)) === Ce) {
|
|
176
176
|
try {
|
|
177
|
-
H[
|
|
178
|
-
} catch (
|
|
179
|
-
b && b(
|
|
177
|
+
H[D.KHR_BINARY_GLTF] = new ua(e);
|
|
178
|
+
} catch (o) {
|
|
179
|
+
b && b(o);
|
|
180
180
|
return;
|
|
181
181
|
}
|
|
182
|
-
i = JSON.parse(H[
|
|
182
|
+
i = JSON.parse(H[D.KHR_BINARY_GLTF].content);
|
|
183
183
|
} else
|
|
184
184
|
i = JSON.parse(c.decode(e));
|
|
185
185
|
else
|
|
@@ -188,7 +188,7 @@ class N2 extends ke {
|
|
|
188
188
|
b && b(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
|
|
189
189
|
return;
|
|
190
190
|
}
|
|
191
|
-
const t = new
|
|
191
|
+
const t = new va(i, {
|
|
192
192
|
path: a || this.resourcePath || "",
|
|
193
193
|
crossOrigin: this.crossOrigin,
|
|
194
194
|
requestHeader: this.requestHeader,
|
|
@@ -197,28 +197,28 @@ class N2 extends ke {
|
|
|
197
197
|
meshoptDecoder: this.meshoptDecoder
|
|
198
198
|
});
|
|
199
199
|
t.fileLoader.setRequestHeader(this.requestHeader);
|
|
200
|
-
for (let
|
|
201
|
-
const
|
|
202
|
-
|
|
200
|
+
for (let d = 0; d < this.pluginCallbacks.length; d++) {
|
|
201
|
+
const o = this.pluginCallbacks[d](t);
|
|
202
|
+
o.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), f[o.name] = o, H[o.name] = !0;
|
|
203
203
|
}
|
|
204
204
|
if (i.extensionsUsed)
|
|
205
|
-
for (let
|
|
206
|
-
const
|
|
207
|
-
switch (
|
|
208
|
-
case
|
|
209
|
-
H[
|
|
205
|
+
for (let d = 0; d < i.extensionsUsed.length; ++d) {
|
|
206
|
+
const o = i.extensionsUsed[d], k = i.extensionsRequired || [];
|
|
207
|
+
switch (o) {
|
|
208
|
+
case D.KHR_MATERIALS_UNLIT:
|
|
209
|
+
H[o] = new X2();
|
|
210
210
|
break;
|
|
211
|
-
case
|
|
212
|
-
H[
|
|
211
|
+
case D.KHR_DRACO_MESH_COMPRESSION:
|
|
212
|
+
H[o] = new ha(i, this.dracoLoader);
|
|
213
213
|
break;
|
|
214
|
-
case
|
|
215
|
-
H[
|
|
214
|
+
case D.KHR_TEXTURE_TRANSFORM:
|
|
215
|
+
H[o] = new ga();
|
|
216
216
|
break;
|
|
217
|
-
case
|
|
218
|
-
H[
|
|
217
|
+
case D.KHR_MESH_QUANTIZATION:
|
|
218
|
+
H[o] = new _a();
|
|
219
219
|
break;
|
|
220
220
|
default:
|
|
221
|
-
k.indexOf(
|
|
221
|
+
k.indexOf(o) >= 0 && f[o] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + o + '".');
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
t.setExtensions(H), t.setPlugins(f), t.parse(r, b);
|
|
@@ -238,24 +238,24 @@ class N2 extends ke {
|
|
|
238
238
|
});
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
function
|
|
242
|
-
let
|
|
241
|
+
function Y2() {
|
|
242
|
+
let n = {};
|
|
243
243
|
return {
|
|
244
244
|
get: function(e) {
|
|
245
|
-
return
|
|
245
|
+
return n[e];
|
|
246
246
|
},
|
|
247
247
|
add: function(e, a) {
|
|
248
|
-
|
|
248
|
+
n[e] = a;
|
|
249
249
|
},
|
|
250
250
|
remove: function(e) {
|
|
251
|
-
delete
|
|
251
|
+
delete n[e];
|
|
252
252
|
},
|
|
253
253
|
removeAll: function() {
|
|
254
|
-
|
|
254
|
+
n = {};
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
|
-
const
|
|
258
|
+
const D = {
|
|
259
259
|
KHR_BINARY_GLTF: "KHR_binary_glTF",
|
|
260
260
|
KHR_DRACO_MESH_COMPRESSION: "KHR_draco_mesh_compression",
|
|
261
261
|
KHR_LIGHTS_PUNCTUAL: "KHR_lights_punctual",
|
|
@@ -279,9 +279,9 @@ const T = {
|
|
|
279
279
|
EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression",
|
|
280
280
|
EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
|
|
281
281
|
};
|
|
282
|
-
class
|
|
282
|
+
class K2 {
|
|
283
283
|
constructor(e) {
|
|
284
|
-
this.parser = e, this.name =
|
|
284
|
+
this.parser = e, this.name = D.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
|
|
285
285
|
}
|
|
286
286
|
_markDefs() {
|
|
287
287
|
const e = this.parser, a = this.parser.json.nodes || [];
|
|
@@ -296,23 +296,23 @@ class T2 {
|
|
|
296
296
|
if (b) return b;
|
|
297
297
|
const i = a.json, c = ((i.extensions && i.extensions[this.name] || {}).lights || [])[e];
|
|
298
298
|
let t;
|
|
299
|
-
const
|
|
300
|
-
c.color !== void 0 &&
|
|
301
|
-
const
|
|
299
|
+
const d = new h0(16777215);
|
|
300
|
+
c.color !== void 0 && d.setRGB(c.color[0], c.color[1], c.color[2], k0);
|
|
301
|
+
const o = c.range !== void 0 ? c.range : 0;
|
|
302
302
|
switch (c.type) {
|
|
303
303
|
case "directional":
|
|
304
|
-
t = new
|
|
304
|
+
t = new t2(d), t.target.position.set(0, 0, -1), t.add(t.target);
|
|
305
305
|
break;
|
|
306
306
|
case "point":
|
|
307
|
-
t = new
|
|
307
|
+
t = new f2(d), t.distance = o;
|
|
308
308
|
break;
|
|
309
309
|
case "spot":
|
|
310
|
-
t = new
|
|
310
|
+
t = new c2(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);
|
|
311
311
|
break;
|
|
312
312
|
default:
|
|
313
313
|
throw new Error("THREE.GLTFLoader: Unexpected light type: " + c.type);
|
|
314
314
|
}
|
|
315
|
-
return t.position.set(0, 0, 0),
|
|
315
|
+
return t.position.set(0, 0, 0), l0(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(r, b), b;
|
|
316
316
|
}
|
|
317
317
|
getDependency(e, a) {
|
|
318
318
|
if (e === "light")
|
|
@@ -325,30 +325,30 @@ class T2 {
|
|
|
325
325
|
});
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
class
|
|
328
|
+
class X2 {
|
|
329
329
|
constructor() {
|
|
330
|
-
this.name =
|
|
330
|
+
this.name = D.KHR_MATERIALS_UNLIT;
|
|
331
331
|
}
|
|
332
332
|
getMaterialType() {
|
|
333
|
-
return
|
|
333
|
+
return E0;
|
|
334
334
|
}
|
|
335
335
|
extendParams(e, a, r) {
|
|
336
336
|
const b = [];
|
|
337
|
-
e.color = new
|
|
337
|
+
e.color = new h0(1, 1, 1), e.opacity = 1;
|
|
338
338
|
const i = a.pbrMetallicRoughness;
|
|
339
339
|
if (i) {
|
|
340
340
|
if (Array.isArray(i.baseColorFactor)) {
|
|
341
341
|
const H = i.baseColorFactor;
|
|
342
|
-
e.color.setRGB(H[0], H[1], H[2],
|
|
342
|
+
e.color.setRGB(H[0], H[1], H[2], k0), e.opacity = H[3];
|
|
343
343
|
}
|
|
344
|
-
i.baseColorTexture !== void 0 && b.push(r.assignTexture(e, "map", i.baseColorTexture,
|
|
344
|
+
i.baseColorTexture !== void 0 && b.push(r.assignTexture(e, "map", i.baseColorTexture, A0));
|
|
345
345
|
}
|
|
346
346
|
return Promise.all(b);
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
class
|
|
349
|
+
class $2 {
|
|
350
350
|
constructor(e) {
|
|
351
|
-
this.parser = e, this.name =
|
|
351
|
+
this.parser = e, this.name = D.KHR_MATERIALS_EMISSIVE_STRENGTH;
|
|
352
352
|
}
|
|
353
353
|
extendMaterialParams(e, a) {
|
|
354
354
|
const b = this.parser.json.materials[e];
|
|
@@ -358,13 +358,13 @@ class M2 {
|
|
|
358
358
|
return i !== void 0 && (a.emissiveIntensity = i), Promise.resolve();
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
|
-
class
|
|
361
|
+
class ea {
|
|
362
362
|
constructor(e) {
|
|
363
|
-
this.parser = e, this.name =
|
|
363
|
+
this.parser = e, this.name = D.KHR_MATERIALS_CLEARCOAT;
|
|
364
364
|
}
|
|
365
365
|
getMaterialType(e) {
|
|
366
366
|
const r = this.parser.json.materials[e];
|
|
367
|
-
return !r.extensions || !r.extensions[this.name] ? null :
|
|
367
|
+
return !r.extensions || !r.extensions[this.name] ? null : s0;
|
|
368
368
|
}
|
|
369
369
|
extendMaterialParams(e, a) {
|
|
370
370
|
const r = this.parser, b = r.json.materials[e];
|
|
@@ -373,18 +373,18 @@ class D2 {
|
|
|
373
373
|
const i = [], H = b.extensions[this.name];
|
|
374
374
|
if (H.clearcoatFactor !== void 0 && (a.clearcoat = H.clearcoatFactor), H.clearcoatTexture !== void 0 && i.push(r.assignTexture(a, "clearcoatMap", H.clearcoatTexture)), H.clearcoatRoughnessFactor !== void 0 && (a.clearcoatRoughness = H.clearcoatRoughnessFactor), H.clearcoatRoughnessTexture !== void 0 && i.push(r.assignTexture(a, "clearcoatRoughnessMap", H.clearcoatRoughnessTexture)), H.clearcoatNormalTexture !== void 0 && (i.push(r.assignTexture(a, "clearcoatNormalMap", H.clearcoatNormalTexture)), H.clearcoatNormalTexture.scale !== void 0)) {
|
|
375
375
|
const f = H.clearcoatNormalTexture.scale;
|
|
376
|
-
a.clearcoatNormalScale = new
|
|
376
|
+
a.clearcoatNormalScale = new fe(f, f);
|
|
377
377
|
}
|
|
378
378
|
return Promise.all(i);
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
|
-
class
|
|
381
|
+
class aa {
|
|
382
382
|
constructor(e) {
|
|
383
|
-
this.parser = e, this.name =
|
|
383
|
+
this.parser = e, this.name = D.KHR_MATERIALS_DISPERSION;
|
|
384
384
|
}
|
|
385
385
|
getMaterialType(e) {
|
|
386
386
|
const r = this.parser.json.materials[e];
|
|
387
|
-
return !r.extensions || !r.extensions[this.name] ? null :
|
|
387
|
+
return !r.extensions || !r.extensions[this.name] ? null : s0;
|
|
388
388
|
}
|
|
389
389
|
extendMaterialParams(e, a) {
|
|
390
390
|
const b = this.parser.json.materials[e];
|
|
@@ -394,13 +394,13 @@ class O2 {
|
|
|
394
394
|
return a.dispersion = i.dispersion !== void 0 ? i.dispersion : 0, Promise.resolve();
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
|
-
class
|
|
397
|
+
class ba {
|
|
398
398
|
constructor(e) {
|
|
399
|
-
this.parser = e, this.name =
|
|
399
|
+
this.parser = e, this.name = D.KHR_MATERIALS_IRIDESCENCE;
|
|
400
400
|
}
|
|
401
401
|
getMaterialType(e) {
|
|
402
402
|
const r = this.parser.json.materials[e];
|
|
403
|
-
return !r.extensions || !r.extensions[this.name] ? null :
|
|
403
|
+
return !r.extensions || !r.extensions[this.name] ? null : s0;
|
|
404
404
|
}
|
|
405
405
|
extendMaterialParams(e, a) {
|
|
406
406
|
const r = this.parser, b = r.json.materials[e];
|
|
@@ -410,35 +410,35 @@ class E2 {
|
|
|
410
410
|
return H.iridescenceFactor !== void 0 && (a.iridescence = H.iridescenceFactor), H.iridescenceTexture !== void 0 && i.push(r.assignTexture(a, "iridescenceMap", H.iridescenceTexture)), H.iridescenceIor !== void 0 && (a.iridescenceIOR = H.iridescenceIor), a.iridescenceThicknessRange === void 0 && (a.iridescenceThicknessRange = [100, 400]), H.iridescenceThicknessMinimum !== void 0 && (a.iridescenceThicknessRange[0] = H.iridescenceThicknessMinimum), H.iridescenceThicknessMaximum !== void 0 && (a.iridescenceThicknessRange[1] = H.iridescenceThicknessMaximum), H.iridescenceThicknessTexture !== void 0 && i.push(r.assignTexture(a, "iridescenceThicknessMap", H.iridescenceThicknessTexture)), Promise.all(i);
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
|
-
class
|
|
413
|
+
class ia {
|
|
414
414
|
constructor(e) {
|
|
415
|
-
this.parser = e, this.name =
|
|
415
|
+
this.parser = e, this.name = D.KHR_MATERIALS_SHEEN;
|
|
416
416
|
}
|
|
417
417
|
getMaterialType(e) {
|
|
418
418
|
const r = this.parser.json.materials[e];
|
|
419
|
-
return !r.extensions || !r.extensions[this.name] ? null :
|
|
419
|
+
return !r.extensions || !r.extensions[this.name] ? null : s0;
|
|
420
420
|
}
|
|
421
421
|
extendMaterialParams(e, a) {
|
|
422
422
|
const r = this.parser, b = r.json.materials[e];
|
|
423
423
|
if (!b.extensions || !b.extensions[this.name])
|
|
424
424
|
return Promise.resolve();
|
|
425
425
|
const i = [];
|
|
426
|
-
a.sheenColor = new
|
|
426
|
+
a.sheenColor = new h0(0, 0, 0), a.sheenRoughness = 0, a.sheen = 1;
|
|
427
427
|
const H = b.extensions[this.name];
|
|
428
428
|
if (H.sheenColorFactor !== void 0) {
|
|
429
429
|
const f = H.sheenColorFactor;
|
|
430
|
-
a.sheenColor.setRGB(f[0], f[1], f[2],
|
|
430
|
+
a.sheenColor.setRGB(f[0], f[1], f[2], k0);
|
|
431
431
|
}
|
|
432
|
-
return H.sheenRoughnessFactor !== void 0 && (a.sheenRoughness = H.sheenRoughnessFactor), H.sheenColorTexture !== void 0 && i.push(r.assignTexture(a, "sheenColorMap", H.sheenColorTexture,
|
|
432
|
+
return H.sheenRoughnessFactor !== void 0 && (a.sheenRoughness = H.sheenRoughnessFactor), H.sheenColorTexture !== void 0 && i.push(r.assignTexture(a, "sheenColorMap", H.sheenColorTexture, A0)), H.sheenRoughnessTexture !== void 0 && i.push(r.assignTexture(a, "sheenRoughnessMap", H.sheenRoughnessTexture)), Promise.all(i);
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
|
-
class
|
|
435
|
+
class Ha {
|
|
436
436
|
constructor(e) {
|
|
437
|
-
this.parser = e, this.name =
|
|
437
|
+
this.parser = e, this.name = D.KHR_MATERIALS_TRANSMISSION;
|
|
438
438
|
}
|
|
439
439
|
getMaterialType(e) {
|
|
440
440
|
const r = this.parser.json.materials[e];
|
|
441
|
-
return !r.extensions || !r.extensions[this.name] ? null :
|
|
441
|
+
return !r.extensions || !r.extensions[this.name] ? null : s0;
|
|
442
442
|
}
|
|
443
443
|
extendMaterialParams(e, a) {
|
|
444
444
|
const r = this.parser, b = r.json.materials[e];
|
|
@@ -448,13 +448,13 @@ class U2 {
|
|
|
448
448
|
return H.transmissionFactor !== void 0 && (a.transmission = H.transmissionFactor), H.transmissionTexture !== void 0 && i.push(r.assignTexture(a, "transmissionMap", H.transmissionTexture)), Promise.all(i);
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
|
-
class
|
|
451
|
+
class ra {
|
|
452
452
|
constructor(e) {
|
|
453
|
-
this.parser = e, this.name =
|
|
453
|
+
this.parser = e, this.name = D.KHR_MATERIALS_VOLUME;
|
|
454
454
|
}
|
|
455
455
|
getMaterialType(e) {
|
|
456
456
|
const r = this.parser.json.materials[e];
|
|
457
|
-
return !r.extensions || !r.extensions[this.name] ? null :
|
|
457
|
+
return !r.extensions || !r.extensions[this.name] ? null : s0;
|
|
458
458
|
}
|
|
459
459
|
extendMaterialParams(e, a) {
|
|
460
460
|
const r = this.parser, b = r.json.materials[e];
|
|
@@ -463,16 +463,16 @@ class x2 {
|
|
|
463
463
|
const i = [], H = b.extensions[this.name];
|
|
464
464
|
a.thickness = H.thicknessFactor !== void 0 ? H.thicknessFactor : 0, H.thicknessTexture !== void 0 && i.push(r.assignTexture(a, "thicknessMap", H.thicknessTexture)), a.attenuationDistance = H.attenuationDistance || 1 / 0;
|
|
465
465
|
const f = H.attenuationColor || [1, 1, 1];
|
|
466
|
-
return a.attenuationColor = new
|
|
466
|
+
return a.attenuationColor = new h0().setRGB(f[0], f[1], f[2], k0), Promise.all(i);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
class
|
|
469
|
+
class ca {
|
|
470
470
|
constructor(e) {
|
|
471
|
-
this.parser = e, this.name =
|
|
471
|
+
this.parser = e, this.name = D.KHR_MATERIALS_IOR;
|
|
472
472
|
}
|
|
473
473
|
getMaterialType(e) {
|
|
474
474
|
const r = this.parser.json.materials[e];
|
|
475
|
-
return !r.extensions || !r.extensions[this.name] ? null :
|
|
475
|
+
return !r.extensions || !r.extensions[this.name] ? null : s0;
|
|
476
476
|
}
|
|
477
477
|
extendMaterialParams(e, a) {
|
|
478
478
|
const b = this.parser.json.materials[e];
|
|
@@ -482,13 +482,13 @@ class q2 {
|
|
|
482
482
|
return a.ior = i.ior !== void 0 ? i.ior : 1.5, Promise.resolve();
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
|
-
class
|
|
485
|
+
class fa {
|
|
486
486
|
constructor(e) {
|
|
487
|
-
this.parser = e, this.name =
|
|
487
|
+
this.parser = e, this.name = D.KHR_MATERIALS_SPECULAR;
|
|
488
488
|
}
|
|
489
489
|
getMaterialType(e) {
|
|
490
490
|
const r = this.parser.json.materials[e];
|
|
491
|
-
return !r.extensions || !r.extensions[this.name] ? null :
|
|
491
|
+
return !r.extensions || !r.extensions[this.name] ? null : s0;
|
|
492
492
|
}
|
|
493
493
|
extendMaterialParams(e, a) {
|
|
494
494
|
const r = this.parser, b = r.json.materials[e];
|
|
@@ -497,16 +497,16 @@ class B2 {
|
|
|
497
497
|
const i = [], H = b.extensions[this.name];
|
|
498
498
|
a.specularIntensity = H.specularFactor !== void 0 ? H.specularFactor : 1, H.specularTexture !== void 0 && i.push(r.assignTexture(a, "specularIntensityMap", H.specularTexture));
|
|
499
499
|
const f = H.specularColorFactor || [1, 1, 1];
|
|
500
|
-
return a.specularColor = new
|
|
500
|
+
return a.specularColor = new h0().setRGB(f[0], f[1], f[2], k0), H.specularColorTexture !== void 0 && i.push(r.assignTexture(a, "specularColorMap", H.specularColorTexture, A0)), Promise.all(i);
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
|
-
class
|
|
503
|
+
class ta {
|
|
504
504
|
constructor(e) {
|
|
505
|
-
this.parser = e, this.name =
|
|
505
|
+
this.parser = e, this.name = D.EXT_MATERIALS_BUMP;
|
|
506
506
|
}
|
|
507
507
|
getMaterialType(e) {
|
|
508
508
|
const r = this.parser.json.materials[e];
|
|
509
|
-
return !r.extensions || !r.extensions[this.name] ? null :
|
|
509
|
+
return !r.extensions || !r.extensions[this.name] ? null : s0;
|
|
510
510
|
}
|
|
511
511
|
extendMaterialParams(e, a) {
|
|
512
512
|
const r = this.parser, b = r.json.materials[e];
|
|
@@ -516,13 +516,13 @@ class P2 {
|
|
|
516
516
|
return a.bumpScale = H.bumpFactor !== void 0 ? H.bumpFactor : 1, H.bumpTexture !== void 0 && i.push(r.assignTexture(a, "bumpMap", H.bumpTexture)), Promise.all(i);
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
|
-
class
|
|
519
|
+
class na {
|
|
520
520
|
constructor(e) {
|
|
521
|
-
this.parser = e, this.name =
|
|
521
|
+
this.parser = e, this.name = D.KHR_MATERIALS_ANISOTROPY;
|
|
522
522
|
}
|
|
523
523
|
getMaterialType(e) {
|
|
524
524
|
const r = this.parser.json.materials[e];
|
|
525
|
-
return !r.extensions || !r.extensions[this.name] ? null :
|
|
525
|
+
return !r.extensions || !r.extensions[this.name] ? null : s0;
|
|
526
526
|
}
|
|
527
527
|
extendMaterialParams(e, a) {
|
|
528
528
|
const r = this.parser, b = r.json.materials[e];
|
|
@@ -532,9 +532,9 @@ class V2 {
|
|
|
532
532
|
return H.anisotropyStrength !== void 0 && (a.anisotropy = H.anisotropyStrength), H.anisotropyRotation !== void 0 && (a.anisotropyRotation = H.anisotropyRotation), H.anisotropyTexture !== void 0 && i.push(r.assignTexture(a, "anisotropyMap", H.anisotropyTexture)), Promise.all(i);
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
|
-
class
|
|
535
|
+
class da {
|
|
536
536
|
constructor(e) {
|
|
537
|
-
this.parser = e, this.name =
|
|
537
|
+
this.parser = e, this.name = D.KHR_TEXTURE_BASISU;
|
|
538
538
|
}
|
|
539
539
|
loadTexture(e) {
|
|
540
540
|
const a = this.parser, r = a.json, b = r.textures[e];
|
|
@@ -549,9 +549,9 @@ class W2 {
|
|
|
549
549
|
return a.loadTextureImage(e, i.source, H);
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
|
-
class
|
|
552
|
+
class oa {
|
|
553
553
|
constructor(e) {
|
|
554
|
-
this.parser = e, this.name =
|
|
554
|
+
this.parser = e, this.name = D.EXT_TEXTURE_WEBP;
|
|
555
555
|
}
|
|
556
556
|
loadTexture(e) {
|
|
557
557
|
const a = this.name, r = this.parser, b = r.json, i = b.textures[e];
|
|
@@ -566,9 +566,9 @@ class C2 {
|
|
|
566
566
|
return r.loadTextureImage(e, H.source, c);
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
|
-
class
|
|
569
|
+
class ka {
|
|
570
570
|
constructor(e) {
|
|
571
|
-
this.parser = e, this.name =
|
|
571
|
+
this.parser = e, this.name = D.EXT_TEXTURE_AVIF;
|
|
572
572
|
}
|
|
573
573
|
loadTexture(e) {
|
|
574
574
|
const a = this.name, r = this.parser, b = r.json, i = b.textures[e];
|
|
@@ -583,9 +583,9 @@ class L2 {
|
|
|
583
583
|
return r.loadTextureImage(e, H.source, c);
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
|
-
class
|
|
586
|
+
class sa {
|
|
587
587
|
constructor(e) {
|
|
588
|
-
this.name =
|
|
588
|
+
this.name = D.EXT_MESHOPT_COMPRESSION, this.parser = e;
|
|
589
589
|
}
|
|
590
590
|
loadBufferView(e) {
|
|
591
591
|
const a = this.parser.json, r = a.bufferViews[e];
|
|
@@ -597,21 +597,21 @@ class S2 {
|
|
|
597
597
|
return null;
|
|
598
598
|
}
|
|
599
599
|
return i.then(function(f) {
|
|
600
|
-
const c = b.byteOffset || 0, t = b.byteLength || 0,
|
|
601
|
-
return H.decodeGltfBufferAsync ? H.decodeGltfBufferAsync(
|
|
600
|
+
const c = b.byteOffset || 0, t = b.byteLength || 0, d = b.count, o = b.byteStride, k = new Uint8Array(f, c, t);
|
|
601
|
+
return H.decodeGltfBufferAsync ? H.decodeGltfBufferAsync(d, o, k, b.mode, b.filter).then(function(s) {
|
|
602
602
|
return s.buffer;
|
|
603
603
|
}) : H.ready.then(function() {
|
|
604
|
-
const s = new ArrayBuffer(
|
|
605
|
-
return H.decodeGltfBuffer(new Uint8Array(s),
|
|
604
|
+
const s = new ArrayBuffer(d * o);
|
|
605
|
+
return H.decodeGltfBuffer(new Uint8Array(s), d, o, k, b.mode, b.filter), s;
|
|
606
606
|
});
|
|
607
607
|
});
|
|
608
608
|
} else
|
|
609
609
|
return null;
|
|
610
610
|
}
|
|
611
611
|
}
|
|
612
|
-
class
|
|
612
|
+
class la {
|
|
613
613
|
constructor(e) {
|
|
614
|
-
this.name =
|
|
614
|
+
this.name = D.EXT_MESH_GPU_INSTANCING, this.parser = e;
|
|
615
615
|
}
|
|
616
616
|
createNodeMesh(e) {
|
|
617
617
|
const a = this.parser.json, r = a.nodes[e];
|
|
@@ -619,52 +619,52 @@ class z2 {
|
|
|
619
619
|
return null;
|
|
620
620
|
const b = a.meshes[r.mesh];
|
|
621
621
|
for (const t of b.primitives)
|
|
622
|
-
if (t.mode !==
|
|
622
|
+
if (t.mode !== f0.TRIANGLES && t.mode !== f0.TRIANGLE_STRIP && t.mode !== f0.TRIANGLE_FAN && t.mode !== void 0)
|
|
623
623
|
return null;
|
|
624
624
|
const H = r.extensions[this.name].attributes, f = [], c = {};
|
|
625
625
|
for (const t in H)
|
|
626
|
-
f.push(this.parser.getDependency("accessor", H[t]).then((
|
|
626
|
+
f.push(this.parser.getDependency("accessor", H[t]).then((d) => (c[t] = d, c[t])));
|
|
627
627
|
return f.length < 1 ? null : (f.push(this.parser.createNodeMesh(e)), Promise.all(f).then((t) => {
|
|
628
|
-
const
|
|
629
|
-
for (const u of
|
|
630
|
-
const _ = new
|
|
628
|
+
const d = t.pop(), o = d.isGroup ? d.children : [d], k = t[0].count, s = [];
|
|
629
|
+
for (const u of o) {
|
|
630
|
+
const _ = new S0(), h = new w(), I = new n0(), A = new w(1, 1, 1), g = new n2(u.geometry, u.material, k);
|
|
631
631
|
for (let p = 0; p < k; p++)
|
|
632
|
-
c.TRANSLATION &&
|
|
632
|
+
c.TRANSLATION && h.fromBufferAttribute(c.TRANSLATION, p), c.ROTATION && I.fromBufferAttribute(c.ROTATION, p), c.SCALE && A.fromBufferAttribute(c.SCALE, p), g.setMatrixAt(p, _.compose(h, I, A));
|
|
633
633
|
for (const p in c)
|
|
634
634
|
if (p === "_COLOR_0") {
|
|
635
|
-
const
|
|
636
|
-
g.instanceColor = new
|
|
635
|
+
const y = c[p];
|
|
636
|
+
g.instanceColor = new d2(y.array, y.itemSize, y.normalized);
|
|
637
637
|
} else p !== "TRANSLATION" && p !== "ROTATION" && p !== "SCALE" && u.geometry.setAttribute(p, c[p]);
|
|
638
|
-
|
|
638
|
+
Ue.prototype.copy.call(g, u), this.parser.assignFinalMaterial(g), s.push(g);
|
|
639
639
|
}
|
|
640
|
-
return
|
|
640
|
+
return d.isGroup ? (d.clear(), d.add(...s), d) : s[0];
|
|
641
641
|
}));
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
|
-
const
|
|
645
|
-
class
|
|
644
|
+
const Ce = "glTF", O0 = 12, Ne = { JSON: 1313821514, BIN: 5130562 };
|
|
645
|
+
class ua {
|
|
646
646
|
constructor(e) {
|
|
647
|
-
this.name =
|
|
648
|
-
const a = new DataView(e, 0,
|
|
647
|
+
this.name = D.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
648
|
+
const a = new DataView(e, 0, O0), r = new TextDecoder();
|
|
649
649
|
if (this.header = {
|
|
650
650
|
magic: r.decode(new Uint8Array(e.slice(0, 4))),
|
|
651
651
|
version: a.getUint32(4, !0),
|
|
652
652
|
length: a.getUint32(8, !0)
|
|
653
|
-
}, this.header.magic !==
|
|
653
|
+
}, this.header.magic !== Ce)
|
|
654
654
|
throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
|
|
655
655
|
if (this.header.version < 2)
|
|
656
656
|
throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
|
|
657
|
-
const b = this.header.length -
|
|
657
|
+
const b = this.header.length - O0, i = new DataView(e, O0);
|
|
658
658
|
let H = 0;
|
|
659
659
|
for (; H < b; ) {
|
|
660
660
|
const f = i.getUint32(H, !0);
|
|
661
661
|
H += 4;
|
|
662
662
|
const c = i.getUint32(H, !0);
|
|
663
|
-
if (H += 4, c ===
|
|
664
|
-
const t = new Uint8Array(e,
|
|
663
|
+
if (H += 4, c === Ne.JSON) {
|
|
664
|
+
const t = new Uint8Array(e, O0 + H, f);
|
|
665
665
|
this.content = r.decode(t);
|
|
666
|
-
} else if (c ===
|
|
667
|
-
const t =
|
|
666
|
+
} else if (c === Ne.BIN) {
|
|
667
|
+
const t = O0 + H;
|
|
668
668
|
this.body = e.slice(t, t + f);
|
|
669
669
|
}
|
|
670
670
|
H += f;
|
|
@@ -673,52 +673,52 @@ class Z2 {
|
|
|
673
673
|
throw new Error("THREE.GLTFLoader: JSON content not found.");
|
|
674
674
|
}
|
|
675
675
|
}
|
|
676
|
-
class
|
|
676
|
+
class ha {
|
|
677
677
|
constructor(e, a) {
|
|
678
678
|
if (!a)
|
|
679
679
|
throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
|
|
680
|
-
this.name =
|
|
680
|
+
this.name = D.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = a, this.dracoLoader.preload();
|
|
681
681
|
}
|
|
682
682
|
decodePrimitive(e, a) {
|
|
683
683
|
const r = this.json, b = this.dracoLoader, i = e.extensions[this.name].bufferView, H = e.extensions[this.name].attributes, f = {}, c = {}, t = {};
|
|
684
|
-
for (const
|
|
685
|
-
const
|
|
686
|
-
f[
|
|
684
|
+
for (const d in H) {
|
|
685
|
+
const o = ie[d] || d.toLowerCase();
|
|
686
|
+
f[o] = H[d];
|
|
687
687
|
}
|
|
688
|
-
for (const
|
|
689
|
-
const
|
|
690
|
-
if (H[
|
|
691
|
-
const k = r.accessors[e.attributes[
|
|
692
|
-
t[
|
|
688
|
+
for (const d in e.attributes) {
|
|
689
|
+
const o = ie[d] || d.toLowerCase();
|
|
690
|
+
if (H[d] !== void 0) {
|
|
691
|
+
const k = r.accessors[e.attributes[d]], s = T0[k.componentType];
|
|
692
|
+
t[o] = s.name, c[o] = k.normalized === !0;
|
|
693
693
|
}
|
|
694
694
|
}
|
|
695
|
-
return a.getDependency("bufferView", i).then(function(
|
|
696
|
-
return new Promise(function(
|
|
697
|
-
b.decodeDracoFile(
|
|
695
|
+
return a.getDependency("bufferView", i).then(function(d) {
|
|
696
|
+
return new Promise(function(o, k) {
|
|
697
|
+
b.decodeDracoFile(d, function(s) {
|
|
698
698
|
for (const u in s.attributes) {
|
|
699
|
-
const _ = s.attributes[u],
|
|
700
|
-
|
|
699
|
+
const _ = s.attributes[u], h = c[u];
|
|
700
|
+
h !== void 0 && (_.normalized = h);
|
|
701
701
|
}
|
|
702
|
-
|
|
703
|
-
}, f, t,
|
|
702
|
+
o(s);
|
|
703
|
+
}, f, t, k0, k);
|
|
704
704
|
});
|
|
705
705
|
});
|
|
706
706
|
}
|
|
707
707
|
}
|
|
708
|
-
class
|
|
708
|
+
class ga {
|
|
709
709
|
constructor() {
|
|
710
|
-
this.name =
|
|
710
|
+
this.name = D.KHR_TEXTURE_TRANSFORM;
|
|
711
711
|
}
|
|
712
712
|
extendTexture(e, a) {
|
|
713
713
|
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;
|
|
714
714
|
}
|
|
715
715
|
}
|
|
716
|
-
class
|
|
716
|
+
class _a {
|
|
717
717
|
constructor() {
|
|
718
|
-
this.name =
|
|
718
|
+
this.name = D.KHR_MESH_QUANTIZATION;
|
|
719
719
|
}
|
|
720
720
|
}
|
|
721
|
-
class
|
|
721
|
+
class Le extends x2 {
|
|
722
722
|
constructor(e, a, r, b) {
|
|
723
723
|
super(e, a, r, b);
|
|
724
724
|
}
|
|
@@ -729,22 +729,22 @@ class Ie extends h2 {
|
|
|
729
729
|
return a;
|
|
730
730
|
}
|
|
731
731
|
interpolate_(e, a, r, b) {
|
|
732
|
-
const i = this.resultBuffer, H = this.sampleValues, f = this.valueSize, c = f * 2, t = f * 3,
|
|
732
|
+
const i = this.resultBuffer, H = this.sampleValues, f = this.valueSize, c = f * 2, t = f * 3, d = b - a, o = (r - a) / d, k = o * o, s = k * o, u = e * t, _ = u - t, h = -2 * s + 3 * k, I = s - k, A = 1 - h, g = I - k + o;
|
|
733
733
|
for (let p = 0; p !== f; p++) {
|
|
734
|
-
const
|
|
735
|
-
i[p] =
|
|
734
|
+
const y = H[_ + p + f], F = H[_ + p + c] * d, N = H[u + p + f], B = H[u + p] * d;
|
|
735
|
+
i[p] = A * y + g * F + h * N + I * B;
|
|
736
736
|
}
|
|
737
737
|
return i;
|
|
738
738
|
}
|
|
739
739
|
}
|
|
740
|
-
const
|
|
741
|
-
class
|
|
740
|
+
const Aa = new n0();
|
|
741
|
+
class pa extends Le {
|
|
742
742
|
interpolate_(e, a, r, b) {
|
|
743
743
|
const i = super.interpolate_(e, a, r, b);
|
|
744
|
-
return
|
|
744
|
+
return Aa.fromArray(i).normalize().toArray(i), i;
|
|
745
745
|
}
|
|
746
746
|
}
|
|
747
|
-
const
|
|
747
|
+
const f0 = {
|
|
748
748
|
POINTS: 0,
|
|
749
749
|
LINES: 1,
|
|
750
750
|
LINE_LOOP: 2,
|
|
@@ -752,25 +752,25 @@ const Q = {
|
|
|
752
752
|
TRIANGLES: 4,
|
|
753
753
|
TRIANGLE_STRIP: 5,
|
|
754
754
|
TRIANGLE_FAN: 6
|
|
755
|
-
},
|
|
755
|
+
}, T0 = {
|
|
756
756
|
5120: Int8Array,
|
|
757
757
|
5121: Uint8Array,
|
|
758
758
|
5122: Int16Array,
|
|
759
759
|
5123: Uint16Array,
|
|
760
760
|
5125: Uint32Array,
|
|
761
761
|
5126: Float32Array
|
|
762
|
-
},
|
|
763
|
-
9728:
|
|
764
|
-
9729:
|
|
765
|
-
9984:
|
|
766
|
-
9985:
|
|
767
|
-
9986:
|
|
768
|
-
9987:
|
|
769
|
-
},
|
|
770
|
-
33071:
|
|
771
|
-
33648:
|
|
772
|
-
10497:
|
|
773
|
-
},
|
|
762
|
+
}, ve = {
|
|
763
|
+
9728: Pe,
|
|
764
|
+
9729: ee,
|
|
765
|
+
9984: h2,
|
|
766
|
+
9985: u2,
|
|
767
|
+
9986: l2,
|
|
768
|
+
9987: xe
|
|
769
|
+
}, Te = {
|
|
770
|
+
33071: _2,
|
|
771
|
+
33648: g2,
|
|
772
|
+
10497: ae
|
|
773
|
+
}, J0 = {
|
|
774
774
|
SCALAR: 1,
|
|
775
775
|
VEC2: 2,
|
|
776
776
|
VEC3: 3,
|
|
@@ -778,7 +778,7 @@ const Q = {
|
|
|
778
778
|
MAT2: 4,
|
|
779
779
|
MAT3: 9,
|
|
780
780
|
MAT4: 16
|
|
781
|
-
},
|
|
781
|
+
}, ie = {
|
|
782
782
|
POSITION: "position",
|
|
783
783
|
NORMAL: "normal",
|
|
784
784
|
TANGENT: "tangent",
|
|
@@ -789,60 +789,60 @@ const Q = {
|
|
|
789
789
|
COLOR_0: "color",
|
|
790
790
|
WEIGHTS_0: "skinWeight",
|
|
791
791
|
JOINTS_0: "skinIndex"
|
|
792
|
-
},
|
|
792
|
+
}, _0 = {
|
|
793
793
|
scale: "scale",
|
|
794
794
|
translation: "position",
|
|
795
795
|
rotation: "quaternion",
|
|
796
796
|
weights: "morphTargetInfluences"
|
|
797
|
-
},
|
|
797
|
+
}, ma = {
|
|
798
798
|
CUBICSPLINE: void 0,
|
|
799
799
|
// We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
|
|
800
800
|
// keyframe track will be initialized with a default interpolation type, then modified.
|
|
801
|
-
LINEAR:
|
|
802
|
-
STEP:
|
|
803
|
-
},
|
|
801
|
+
LINEAR: We,
|
|
802
|
+
STEP: E2
|
|
803
|
+
}, Y0 = {
|
|
804
804
|
OPAQUE: "OPAQUE",
|
|
805
805
|
MASK: "MASK",
|
|
806
806
|
BLEND: "BLEND"
|
|
807
807
|
};
|
|
808
|
-
function
|
|
809
|
-
return
|
|
808
|
+
function ja(n) {
|
|
809
|
+
return n.DefaultMaterial === void 0 && (n.DefaultMaterial = new Be({
|
|
810
810
|
color: 16777215,
|
|
811
811
|
emissive: 0,
|
|
812
812
|
metalness: 1,
|
|
813
813
|
roughness: 1,
|
|
814
814
|
transparent: !1,
|
|
815
815
|
depthTest: !0,
|
|
816
|
-
side:
|
|
817
|
-
})),
|
|
816
|
+
side: U2
|
|
817
|
+
})), n.DefaultMaterial;
|
|
818
818
|
}
|
|
819
|
-
function
|
|
819
|
+
function y0(n, e, a) {
|
|
820
820
|
for (const r in a.extensions)
|
|
821
|
-
|
|
821
|
+
n[r] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[r] = a.extensions[r]);
|
|
822
822
|
}
|
|
823
|
-
function
|
|
824
|
-
e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(
|
|
823
|
+
function l0(n, e) {
|
|
824
|
+
e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(n.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras));
|
|
825
825
|
}
|
|
826
|
-
function
|
|
826
|
+
function Ia(n, e, a) {
|
|
827
827
|
let r = !1, b = !1, i = !1;
|
|
828
|
-
for (let t = 0,
|
|
829
|
-
const
|
|
830
|
-
if (
|
|
828
|
+
for (let t = 0, d = e.length; t < d; t++) {
|
|
829
|
+
const o = e[t];
|
|
830
|
+
if (o.POSITION !== void 0 && (r = !0), o.NORMAL !== void 0 && (b = !0), o.COLOR_0 !== void 0 && (i = !0), r && b && i) break;
|
|
831
831
|
}
|
|
832
|
-
if (!r && !b && !i) return Promise.resolve(
|
|
832
|
+
if (!r && !b && !i) return Promise.resolve(n);
|
|
833
833
|
const H = [], f = [], c = [];
|
|
834
|
-
for (let t = 0,
|
|
835
|
-
const
|
|
834
|
+
for (let t = 0, d = e.length; t < d; t++) {
|
|
835
|
+
const o = e[t];
|
|
836
836
|
if (r) {
|
|
837
|
-
const k =
|
|
837
|
+
const k = o.POSITION !== void 0 ? a.getDependency("accessor", o.POSITION) : n.attributes.position;
|
|
838
838
|
H.push(k);
|
|
839
839
|
}
|
|
840
840
|
if (b) {
|
|
841
|
-
const k =
|
|
841
|
+
const k = o.NORMAL !== void 0 ? a.getDependency("accessor", o.NORMAL) : n.attributes.normal;
|
|
842
842
|
f.push(k);
|
|
843
843
|
}
|
|
844
844
|
if (i) {
|
|
845
|
-
const k =
|
|
845
|
+
const k = o.COLOR_0 !== void 0 ? a.getDependency("accessor", o.COLOR_0) : n.attributes.color;
|
|
846
846
|
c.push(k);
|
|
847
847
|
}
|
|
848
848
|
}
|
|
@@ -851,41 +851,41 @@ function aa(o, e, a) {
|
|
|
851
851
|
Promise.all(f),
|
|
852
852
|
Promise.all(c)
|
|
853
853
|
]).then(function(t) {
|
|
854
|
-
const
|
|
855
|
-
return r && (
|
|
854
|
+
const d = t[0], o = t[1], k = t[2];
|
|
855
|
+
return r && (n.morphAttributes.position = d), b && (n.morphAttributes.normal = o), i && (n.morphAttributes.color = k), n.morphTargetsRelative = !0, n;
|
|
856
856
|
});
|
|
857
857
|
}
|
|
858
|
-
function
|
|
859
|
-
if (
|
|
858
|
+
function ya(n, e) {
|
|
859
|
+
if (n.updateMorphTargets(), e.weights !== void 0)
|
|
860
860
|
for (let a = 0, r = e.weights.length; a < r; a++)
|
|
861
|
-
|
|
861
|
+
n.morphTargetInfluences[a] = e.weights[a];
|
|
862
862
|
if (e.extras && Array.isArray(e.extras.targetNames)) {
|
|
863
863
|
const a = e.extras.targetNames;
|
|
864
|
-
if (
|
|
865
|
-
|
|
864
|
+
if (n.morphTargetInfluences.length === a.length) {
|
|
865
|
+
n.morphTargetDictionary = {};
|
|
866
866
|
for (let r = 0, b = a.length; r < b; r++)
|
|
867
|
-
|
|
867
|
+
n.morphTargetDictionary[a[r]] = r;
|
|
868
868
|
} else
|
|
869
869
|
console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
|
|
870
870
|
}
|
|
871
871
|
}
|
|
872
|
-
function
|
|
872
|
+
function wa(n) {
|
|
873
873
|
let e;
|
|
874
|
-
const a =
|
|
875
|
-
if (a ? e = "draco:" + a.bufferView + ":" + a.indices + ":" +
|
|
876
|
-
for (let r = 0, b =
|
|
877
|
-
e += ":" +
|
|
874
|
+
const a = n.extensions && n.extensions[D.KHR_DRACO_MESH_COMPRESSION];
|
|
875
|
+
if (a ? e = "draco:" + a.bufferView + ":" + a.indices + ":" + K0(a.attributes) : e = n.indices + ":" + K0(n.attributes) + ":" + n.mode, n.targets !== void 0)
|
|
876
|
+
for (let r = 0, b = n.targets.length; r < b; r++)
|
|
877
|
+
e += ":" + K0(n.targets[r]);
|
|
878
878
|
return e;
|
|
879
879
|
}
|
|
880
|
-
function
|
|
880
|
+
function K0(n) {
|
|
881
881
|
let e = "";
|
|
882
|
-
const a = Object.keys(
|
|
882
|
+
const a = Object.keys(n).sort();
|
|
883
883
|
for (let r = 0, b = a.length; r < b; r++)
|
|
884
|
-
e += a[r] + ":" +
|
|
884
|
+
e += a[r] + ":" + n[a[r]] + ";";
|
|
885
885
|
return e;
|
|
886
886
|
}
|
|
887
|
-
function
|
|
888
|
-
switch (
|
|
887
|
+
function He(n) {
|
|
888
|
+
switch (n) {
|
|
889
889
|
case Int8Array:
|
|
890
890
|
return 1 / 127;
|
|
891
891
|
case Uint8Array:
|
|
@@ -898,13 +898,13 @@ function C0(o) {
|
|
|
898
898
|
throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
|
|
899
899
|
}
|
|
900
900
|
}
|
|
901
|
-
function
|
|
902
|
-
return
|
|
901
|
+
function Fa(n) {
|
|
902
|
+
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";
|
|
903
903
|
}
|
|
904
|
-
const
|
|
905
|
-
class
|
|
904
|
+
const Na = new S0();
|
|
905
|
+
class va {
|
|
906
906
|
constructor(e = {}, a = {}) {
|
|
907
|
-
this.json = e, this.extensions = {}, this.plugins = {}, this.options = a, this.cache = new
|
|
907
|
+
this.json = e, this.extensions = {}, this.plugins = {}, this.options = a, this.cache = new Y2(), 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 = {};
|
|
908
908
|
let r = !1, b = -1, i = !1, H = -1;
|
|
909
909
|
if (typeof navigator < "u") {
|
|
910
910
|
const f = navigator.userAgent;
|
|
@@ -912,7 +912,7 @@ class ca {
|
|
|
912
912
|
const c = f.match(/Version\/(\d+)/);
|
|
913
913
|
b = r && c ? parseInt(c[1], 10) : -1, i = f.indexOf("Firefox") > -1, H = i ? f.match(/Firefox\/([0-9]+)\./)[1] : -1;
|
|
914
914
|
}
|
|
915
|
-
typeof createImageBitmap > "u" || r && b < 17 || i && H < 98 ? this.textureLoader = new
|
|
915
|
+
typeof createImageBitmap > "u" || r && b < 17 || i && H < 98 ? this.textureLoader = new o2(this.options.manager) : this.textureLoader = new k2(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new L0(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
|
|
916
916
|
}
|
|
917
917
|
setExtensions(e) {
|
|
918
918
|
this.extensions = e;
|
|
@@ -942,7 +942,7 @@ class ca {
|
|
|
942
942
|
parser: r,
|
|
943
943
|
userData: {}
|
|
944
944
|
};
|
|
945
|
-
return
|
|
945
|
+
return y0(i, f, b), l0(f, b), Promise.all(r._invokeAll(function(c) {
|
|
946
946
|
return c.afterRoot && c.afterRoot(f);
|
|
947
947
|
})).then(function() {
|
|
948
948
|
for (const c of f.scenes)
|
|
@@ -998,8 +998,8 @@ class ca {
|
|
|
998
998
|
const b = r.clone(), i = (H, f) => {
|
|
999
999
|
const c = this.associations.get(H);
|
|
1000
1000
|
c != null && this.associations.set(f, c);
|
|
1001
|
-
for (const [t,
|
|
1002
|
-
i(
|
|
1001
|
+
for (const [t, d] of H.children.entries())
|
|
1002
|
+
i(d, f.children[t]);
|
|
1003
1003
|
};
|
|
1004
1004
|
return i(r, b), b.name += "_instance_" + e.uses[a]++, b;
|
|
1005
1005
|
}
|
|
@@ -1120,10 +1120,10 @@ class ca {
|
|
|
1120
1120
|
if (a.type && a.type !== "arraybuffer")
|
|
1121
1121
|
throw new Error("THREE.GLTFLoader: " + a.type + " buffer type is not supported.");
|
|
1122
1122
|
if (a.uri === void 0 && e === 0)
|
|
1123
|
-
return Promise.resolve(this.extensions[
|
|
1123
|
+
return Promise.resolve(this.extensions[D.KHR_BINARY_GLTF].body);
|
|
1124
1124
|
const b = this.options;
|
|
1125
1125
|
return new Promise(function(i, H) {
|
|
1126
|
-
r.load(
|
|
1126
|
+
r.load(G0.resolveURL(a.uri, b.path), i, void 0, function() {
|
|
1127
1127
|
H(new Error('THREE.GLTFLoader: Failed to load buffer "' + a.uri + '".'));
|
|
1128
1128
|
});
|
|
1129
1129
|
});
|
|
@@ -1152,29 +1152,29 @@ class ca {
|
|
|
1152
1152
|
loadAccessor(e) {
|
|
1153
1153
|
const a = this, r = this.json, b = this.json.accessors[e];
|
|
1154
1154
|
if (b.bufferView === void 0 && b.sparse === void 0) {
|
|
1155
|
-
const H =
|
|
1156
|
-
return Promise.resolve(new
|
|
1155
|
+
const H = J0[b.type], f = T0[b.componentType], c = b.normalized === !0, t = new f(b.count * H);
|
|
1156
|
+
return Promise.resolve(new U0(t, H, c));
|
|
1157
1157
|
}
|
|
1158
1158
|
const i = [];
|
|
1159
1159
|
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(H) {
|
|
1160
|
-
const f = H[0], c =
|
|
1161
|
-
let _,
|
|
1162
|
-
if (s && s !==
|
|
1163
|
-
const
|
|
1164
|
-
let g = a.cache.get(
|
|
1165
|
-
g || (_ = new t(f,
|
|
1160
|
+
const f = H[0], c = J0[b.type], t = T0[b.componentType], d = t.BYTES_PER_ELEMENT, o = d * c, k = b.byteOffset || 0, s = b.bufferView !== void 0 ? r.bufferViews[b.bufferView].byteStride : void 0, u = b.normalized === !0;
|
|
1161
|
+
let _, h;
|
|
1162
|
+
if (s && s !== o) {
|
|
1163
|
+
const I = Math.floor(k / s), A = "InterleavedBuffer:" + b.bufferView + ":" + b.componentType + ":" + I + ":" + b.count;
|
|
1164
|
+
let g = a.cache.get(A);
|
|
1165
|
+
g || (_ = new t(f, I * s, b.count * s / d), g = new s2(_, s / d), a.cache.add(A, g)), h = new G2(g, c, k % s / d, u);
|
|
1166
1166
|
} else
|
|
1167
|
-
f === null ? _ = new t(b.count * c) : _ = new t(f, k, b.count * c),
|
|
1167
|
+
f === null ? _ = new t(b.count * c) : _ = new t(f, k, b.count * c), h = new U0(_, c, u);
|
|
1168
1168
|
if (b.sparse !== void 0) {
|
|
1169
|
-
const
|
|
1170
|
-
f !== null && (
|
|
1171
|
-
for (let
|
|
1172
|
-
const
|
|
1173
|
-
if (
|
|
1169
|
+
const I = J0.SCALAR, A = T0[b.sparse.indices.componentType], g = b.sparse.indices.byteOffset || 0, p = b.sparse.values.byteOffset || 0, y = new A(H[1], g, b.sparse.count * I), F = new t(H[2], p, b.sparse.count * c);
|
|
1170
|
+
f !== null && (h = new U0(h.array.slice(), h.itemSize, h.normalized)), h.normalized = !1;
|
|
1171
|
+
for (let N = 0, B = y.length; N < B; N++) {
|
|
1172
|
+
const V = y[N];
|
|
1173
|
+
if (h.setX(V, F[N * c]), c >= 2 && h.setY(V, F[N * c + 1]), c >= 3 && h.setZ(V, F[N * c + 2]), c >= 4 && h.setW(V, F[N * c + 3]), c >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
1174
1174
|
}
|
|
1175
|
-
|
|
1175
|
+
h.normalized = u;
|
|
1176
1176
|
}
|
|
1177
|
-
return
|
|
1177
|
+
return h;
|
|
1178
1178
|
});
|
|
1179
1179
|
}
|
|
1180
1180
|
/**
|
|
@@ -1197,10 +1197,10 @@ class ca {
|
|
|
1197
1197
|
const b = this, i = this.json, H = i.textures[e], f = i.images[a], c = (f.uri || f.bufferView) + ":" + H.sampler;
|
|
1198
1198
|
if (this.textureCache[c])
|
|
1199
1199
|
return this.textureCache[c];
|
|
1200
|
-
const t = this.loadImageSource(a, r).then(function(
|
|
1201
|
-
|
|
1200
|
+
const t = this.loadImageSource(a, r).then(function(d) {
|
|
1201
|
+
d.flipY = !1, d.name = H.name || f.name || "", d.name === "" && typeof f.uri == "string" && f.uri.startsWith("data:image/") === !1 && (d.name = f.uri);
|
|
1202
1202
|
const k = (i.samplers || {})[H.sampler] || {};
|
|
1203
|
-
return
|
|
1203
|
+
return d.magFilter = ve[k.magFilter] || ee, d.minFilter = ve[k.minFilter] || xe, d.wrapS = Te[k.wrapS] || ae, d.wrapT = Te[k.wrapT] || ae, d.generateMipmaps = !d.isCompressedTexture && d.minFilter !== Pe && d.minFilter !== ee, b.associations.set(d, { textures: e }), d;
|
|
1204
1204
|
}).catch(function() {
|
|
1205
1205
|
return null;
|
|
1206
1206
|
});
|
|
@@ -1209,31 +1209,31 @@ class ca {
|
|
|
1209
1209
|
loadImageSource(e, a) {
|
|
1210
1210
|
const r = this, b = this.json, i = this.options;
|
|
1211
1211
|
if (this.sourceCache[e] !== void 0)
|
|
1212
|
-
return this.sourceCache[e].then((
|
|
1212
|
+
return this.sourceCache[e].then((o) => o.clone());
|
|
1213
1213
|
const H = b.images[e], f = self.URL || self.webkitURL;
|
|
1214
1214
|
let c = H.uri || "", t = !1;
|
|
1215
1215
|
if (H.bufferView !== void 0)
|
|
1216
|
-
c = r.getDependency("bufferView", H.bufferView).then(function(
|
|
1216
|
+
c = r.getDependency("bufferView", H.bufferView).then(function(o) {
|
|
1217
1217
|
t = !0;
|
|
1218
|
-
const k = new Blob([
|
|
1218
|
+
const k = new Blob([o], { type: H.mimeType });
|
|
1219
1219
|
return c = f.createObjectURL(k), c;
|
|
1220
1220
|
});
|
|
1221
1221
|
else if (H.uri === void 0)
|
|
1222
1222
|
throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
|
|
1223
|
-
const
|
|
1223
|
+
const d = Promise.resolve(c).then(function(o) {
|
|
1224
1224
|
return new Promise(function(k, s) {
|
|
1225
1225
|
let u = k;
|
|
1226
1226
|
a.isImageBitmapLoader === !0 && (u = function(_) {
|
|
1227
|
-
const
|
|
1228
|
-
|
|
1229
|
-
}), a.load(
|
|
1227
|
+
const h = new me(_);
|
|
1228
|
+
h.needsUpdate = !0, k(h);
|
|
1229
|
+
}), a.load(G0.resolveURL(o, i.path), u, void 0, s);
|
|
1230
1230
|
});
|
|
1231
|
-
}).then(function(
|
|
1232
|
-
return t === !0 && f.revokeObjectURL(c),
|
|
1233
|
-
}).catch(function(
|
|
1234
|
-
throw console.error("THREE.GLTFLoader: Couldn't load texture", c),
|
|
1231
|
+
}).then(function(o) {
|
|
1232
|
+
return t === !0 && f.revokeObjectURL(c), l0(o, H), o.userData.mimeType = H.mimeType || Fa(H.uri), o;
|
|
1233
|
+
}).catch(function(o) {
|
|
1234
|
+
throw console.error("THREE.GLTFLoader: Couldn't load texture", c), o;
|
|
1235
1235
|
});
|
|
1236
|
-
return this.sourceCache[e] =
|
|
1236
|
+
return this.sourceCache[e] = d, d;
|
|
1237
1237
|
}
|
|
1238
1238
|
/**
|
|
1239
1239
|
* Asynchronously assigns a texture to the given material parameters.
|
|
@@ -1249,11 +1249,11 @@ class ca {
|
|
|
1249
1249
|
const i = this;
|
|
1250
1250
|
return this.getDependency("texture", r.index).then(function(H) {
|
|
1251
1251
|
if (!H) return null;
|
|
1252
|
-
if (r.texCoord !== void 0 && r.texCoord > 0 && (H = H.clone(), H.channel = r.texCoord), i.extensions[
|
|
1253
|
-
const f = r.extensions !== void 0 ? r.extensions[
|
|
1252
|
+
if (r.texCoord !== void 0 && r.texCoord > 0 && (H = H.clone(), H.channel = r.texCoord), i.extensions[D.KHR_TEXTURE_TRANSFORM]) {
|
|
1253
|
+
const f = r.extensions !== void 0 ? r.extensions[D.KHR_TEXTURE_TRANSFORM] : void 0;
|
|
1254
1254
|
if (f) {
|
|
1255
1255
|
const c = i.associations.get(H);
|
|
1256
|
-
H = i.extensions[
|
|
1256
|
+
H = i.extensions[D.KHR_TEXTURE_TRANSFORM].extendTexture(H, f), i.associations.set(H, c);
|
|
1257
1257
|
}
|
|
1258
1258
|
}
|
|
1259
1259
|
return b !== void 0 && (H.colorSpace = b), e[a] = H, H;
|
|
@@ -1276,11 +1276,11 @@ class ca {
|
|
|
1276
1276
|
if (e.isPoints) {
|
|
1277
1277
|
const f = "PointsMaterial:" + r.uuid;
|
|
1278
1278
|
let c = this.cache.get(f);
|
|
1279
|
-
c || (c = new
|
|
1279
|
+
c || (c = new A2(), Q0.prototype.copy.call(c, r), c.color.copy(r.color), c.map = r.map, c.sizeAttenuation = !1, this.cache.add(f, c)), r = c;
|
|
1280
1280
|
} else if (e.isLine) {
|
|
1281
1281
|
const f = "LineBasicMaterial:" + r.uuid;
|
|
1282
1282
|
let c = this.cache.get(f);
|
|
1283
|
-
c || (c = new
|
|
1283
|
+
c || (c = new p2(), Q0.prototype.copy.call(c, r), c.color.copy(r.color), c.map = r.map, this.cache.add(f, c)), r = c;
|
|
1284
1284
|
}
|
|
1285
1285
|
if (b || i || H) {
|
|
1286
1286
|
let f = "ClonedMaterial:" + r.uuid + ":";
|
|
@@ -1291,7 +1291,7 @@ class ca {
|
|
|
1291
1291
|
e.material = r;
|
|
1292
1292
|
}
|
|
1293
1293
|
getMaterialType() {
|
|
1294
|
-
return
|
|
1294
|
+
return Be;
|
|
1295
1295
|
}
|
|
1296
1296
|
/**
|
|
1297
1297
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
|
|
@@ -1304,34 +1304,34 @@ class ca {
|
|
|
1304
1304
|
const a = this, r = this.json, b = this.extensions, i = r.materials[e];
|
|
1305
1305
|
let H;
|
|
1306
1306
|
const f = {}, c = i.extensions || {}, t = [];
|
|
1307
|
-
if (c[
|
|
1308
|
-
const
|
|
1309
|
-
H =
|
|
1307
|
+
if (c[D.KHR_MATERIALS_UNLIT]) {
|
|
1308
|
+
const o = b[D.KHR_MATERIALS_UNLIT];
|
|
1309
|
+
H = o.getMaterialType(), t.push(o.extendParams(f, i, a));
|
|
1310
1310
|
} else {
|
|
1311
|
-
const
|
|
1312
|
-
if (f.color = new
|
|
1313
|
-
const k =
|
|
1314
|
-
f.color.setRGB(k[0], k[1], k[2],
|
|
1311
|
+
const o = i.pbrMetallicRoughness || {};
|
|
1312
|
+
if (f.color = new h0(1, 1, 1), f.opacity = 1, Array.isArray(o.baseColorFactor)) {
|
|
1313
|
+
const k = o.baseColorFactor;
|
|
1314
|
+
f.color.setRGB(k[0], k[1], k[2], k0), f.opacity = k[3];
|
|
1315
1315
|
}
|
|
1316
|
-
|
|
1316
|
+
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))), H = this._invokeOne(function(k) {
|
|
1317
1317
|
return k.getMaterialType && k.getMaterialType(e);
|
|
1318
1318
|
}), t.push(Promise.all(this._invokeAll(function(k) {
|
|
1319
1319
|
return k.extendMaterialParams && k.extendMaterialParams(e, f);
|
|
1320
1320
|
})));
|
|
1321
1321
|
}
|
|
1322
|
-
i.doubleSided === !0 && (f.side =
|
|
1323
|
-
const
|
|
1324
|
-
if (
|
|
1325
|
-
const
|
|
1326
|
-
f.normalScale.set(
|
|
1322
|
+
i.doubleSided === !0 && (f.side = m2);
|
|
1323
|
+
const d = i.alphaMode || Y0.OPAQUE;
|
|
1324
|
+
if (d === Y0.BLEND ? (f.transparent = !0, f.depthWrite = !1) : (f.transparent = !1, d === Y0.MASK && (f.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && H !== E0 && (t.push(a.assignTexture(f, "normalMap", i.normalTexture)), f.normalScale = new fe(1, 1), i.normalTexture.scale !== void 0)) {
|
|
1325
|
+
const o = i.normalTexture.scale;
|
|
1326
|
+
f.normalScale.set(o, o);
|
|
1327
1327
|
}
|
|
1328
|
-
if (i.occlusionTexture !== void 0 && H !==
|
|
1329
|
-
const
|
|
1330
|
-
f.emissive = new
|
|
1328
|
+
if (i.occlusionTexture !== void 0 && H !== E0 && (t.push(a.assignTexture(f, "aoMap", i.occlusionTexture)), i.occlusionTexture.strength !== void 0 && (f.aoMapIntensity = i.occlusionTexture.strength)), i.emissiveFactor !== void 0 && H !== E0) {
|
|
1329
|
+
const o = i.emissiveFactor;
|
|
1330
|
+
f.emissive = new h0().setRGB(o[0], o[1], o[2], k0);
|
|
1331
1331
|
}
|
|
1332
|
-
return i.emissiveTexture !== void 0 && H !==
|
|
1333
|
-
const
|
|
1334
|
-
return i.name && (
|
|
1332
|
+
return i.emissiveTexture !== void 0 && H !== E0 && t.push(a.assignTexture(f, "emissiveMap", i.emissiveTexture, A0)), Promise.all(t).then(function() {
|
|
1333
|
+
const o = new H(f);
|
|
1334
|
+
return i.name && (o.name = i.name), l0(o, i), a.associations.set(o, { materials: e }), i.extensions && y0(b, o, i), o;
|
|
1335
1335
|
});
|
|
1336
1336
|
}
|
|
1337
1337
|
/**
|
|
@@ -1342,7 +1342,7 @@ class ca {
|
|
|
1342
1342
|
* @return {string}
|
|
1343
1343
|
*/
|
|
1344
1344
|
createUniqueName(e) {
|
|
1345
|
-
const a =
|
|
1345
|
+
const a = j2.sanitizeNodeName(e || "");
|
|
1346
1346
|
return a in this.nodeNamesUsed ? a + "_" + ++this.nodeNamesUsed[a] : (this.nodeNamesUsed[a] = 0, a);
|
|
1347
1347
|
}
|
|
1348
1348
|
/**
|
|
@@ -1357,18 +1357,18 @@ class ca {
|
|
|
1357
1357
|
loadGeometries(e) {
|
|
1358
1358
|
const a = this, r = this.extensions, b = this.primitiveCache;
|
|
1359
1359
|
function i(f) {
|
|
1360
|
-
return r[
|
|
1361
|
-
return
|
|
1360
|
+
return r[D.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(f, a).then(function(c) {
|
|
1361
|
+
return Re(c, f, a);
|
|
1362
1362
|
});
|
|
1363
1363
|
}
|
|
1364
1364
|
const H = [];
|
|
1365
1365
|
for (let f = 0, c = e.length; f < c; f++) {
|
|
1366
|
-
const t = e[f],
|
|
1367
|
-
if (
|
|
1368
|
-
H.push(
|
|
1366
|
+
const t = e[f], d = wa(t), o = b[d];
|
|
1367
|
+
if (o)
|
|
1368
|
+
H.push(o.promise);
|
|
1369
1369
|
else {
|
|
1370
1370
|
let k;
|
|
1371
|
-
t.extensions && t.extensions[
|
|
1371
|
+
t.extensions && t.extensions[D.KHR_DRACO_MESH_COMPRESSION] ? k = i(t) : k = Re(new qe(), t, a), b[d] = { primitive: t, promise: k }, H.push(k);
|
|
1372
1372
|
}
|
|
1373
1373
|
}
|
|
1374
1374
|
return Promise.all(H);
|
|
@@ -1383,40 +1383,40 @@ class ca {
|
|
|
1383
1383
|
loadMesh(e) {
|
|
1384
1384
|
const a = this, r = this.json, b = this.extensions, i = r.meshes[e], H = i.primitives, f = [];
|
|
1385
1385
|
for (let c = 0, t = H.length; c < t; c++) {
|
|
1386
|
-
const
|
|
1387
|
-
f.push(
|
|
1386
|
+
const d = H[c].material === void 0 ? ja(this.cache) : this.getDependency("material", H[c].material);
|
|
1387
|
+
f.push(d);
|
|
1388
1388
|
}
|
|
1389
1389
|
return f.push(a.loadGeometries(H)), Promise.all(f).then(function(c) {
|
|
1390
|
-
const t = c.slice(0, c.length - 1),
|
|
1391
|
-
for (let s = 0, u =
|
|
1392
|
-
const _ =
|
|
1393
|
-
let
|
|
1394
|
-
const
|
|
1395
|
-
if (
|
|
1396
|
-
|
|
1397
|
-
else if (
|
|
1398
|
-
|
|
1399
|
-
else if (
|
|
1400
|
-
|
|
1401
|
-
else if (
|
|
1402
|
-
|
|
1403
|
-
else if (
|
|
1404
|
-
|
|
1390
|
+
const t = c.slice(0, c.length - 1), d = c[c.length - 1], o = [];
|
|
1391
|
+
for (let s = 0, u = d.length; s < u; s++) {
|
|
1392
|
+
const _ = d[s], h = H[s];
|
|
1393
|
+
let I;
|
|
1394
|
+
const A = t[s];
|
|
1395
|
+
if (h.mode === f0.TRIANGLES || h.mode === f0.TRIANGLE_STRIP || h.mode === f0.TRIANGLE_FAN || h.mode === void 0)
|
|
1396
|
+
I = i.isSkinnedMesh === !0 ? new I2(_, A) : new Ve(_, A), I.isSkinnedMesh === !0 && I.normalizeSkinWeights(), h.mode === f0.TRIANGLE_STRIP ? I.geometry = Fe(I.geometry, Ee) : h.mode === f0.TRIANGLE_FAN && (I.geometry = Fe(I.geometry, $0));
|
|
1397
|
+
else if (h.mode === f0.LINES)
|
|
1398
|
+
I = new y2(_, A);
|
|
1399
|
+
else if (h.mode === f0.LINE_STRIP)
|
|
1400
|
+
I = new w2(_, A);
|
|
1401
|
+
else if (h.mode === f0.LINE_LOOP)
|
|
1402
|
+
I = new F2(_, A);
|
|
1403
|
+
else if (h.mode === f0.POINTS)
|
|
1404
|
+
I = new N2(_, A);
|
|
1405
1405
|
else
|
|
1406
|
-
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " +
|
|
1407
|
-
Object.keys(
|
|
1406
|
+
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + h.mode);
|
|
1407
|
+
Object.keys(I.geometry.morphAttributes).length > 0 && ya(I, i), I.name = a.createUniqueName(i.name || "mesh_" + e), l0(I, i), h.extensions && y0(b, I, h), a.assignFinalMaterial(I), o.push(I);
|
|
1408
1408
|
}
|
|
1409
|
-
for (let s = 0, u =
|
|
1410
|
-
a.associations.set(
|
|
1409
|
+
for (let s = 0, u = o.length; s < u; s++)
|
|
1410
|
+
a.associations.set(o[s], {
|
|
1411
1411
|
meshes: e,
|
|
1412
1412
|
primitives: s
|
|
1413
1413
|
});
|
|
1414
|
-
if (
|
|
1415
|
-
return i.extensions &&
|
|
1416
|
-
const k = new
|
|
1417
|
-
i.extensions &&
|
|
1418
|
-
for (let s = 0, u =
|
|
1419
|
-
k.add(
|
|
1414
|
+
if (o.length === 1)
|
|
1415
|
+
return i.extensions && y0(b, o[0], i), o[0];
|
|
1416
|
+
const k = new C0();
|
|
1417
|
+
i.extensions && y0(b, k, i), a.associations.set(k, { meshes: e });
|
|
1418
|
+
for (let s = 0, u = o.length; s < u; s++)
|
|
1419
|
+
k.add(o[s]);
|
|
1420
1420
|
return k;
|
|
1421
1421
|
});
|
|
1422
1422
|
}
|
|
@@ -1434,7 +1434,7 @@ class ca {
|
|
|
1434
1434
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
1435
1435
|
return;
|
|
1436
1436
|
}
|
|
1437
|
-
return r.type === "perspective" ? a = new
|
|
1437
|
+
return r.type === "perspective" ? a = new v2(T2.radToDeg(b.yfov), b.aspectRatio || 1, b.znear || 1, b.zfar || 2e6) : r.type === "orthographic" && (a = new R2(-b.xmag, b.xmag, b.ymag, -b.ymag, b.znear, b.zfar)), r.name && (a.name = this.createUniqueName(r.name)), l0(a, r), Promise.resolve(a);
|
|
1438
1438
|
}
|
|
1439
1439
|
/**
|
|
1440
1440
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
@@ -1449,16 +1449,16 @@ class ca {
|
|
|
1449
1449
|
r.push(this._loadNodeShallow(a.joints[b]));
|
|
1450
1450
|
return a.inverseBindMatrices !== void 0 ? r.push(this.getDependency("accessor", a.inverseBindMatrices)) : r.push(null), Promise.all(r).then(function(b) {
|
|
1451
1451
|
const i = b.pop(), H = b, f = [], c = [];
|
|
1452
|
-
for (let t = 0,
|
|
1453
|
-
const
|
|
1454
|
-
if (
|
|
1455
|
-
f.push(
|
|
1456
|
-
const k = new
|
|
1452
|
+
for (let t = 0, d = H.length; t < d; t++) {
|
|
1453
|
+
const o = H[t];
|
|
1454
|
+
if (o) {
|
|
1455
|
+
f.push(o);
|
|
1456
|
+
const k = new S0();
|
|
1457
1457
|
i !== null && k.fromArray(i.array, t * 16), c.push(k);
|
|
1458
1458
|
} else
|
|
1459
1459
|
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', a.joints[t]);
|
|
1460
1460
|
}
|
|
1461
|
-
return new
|
|
1461
|
+
return new M2(f, c);
|
|
1462
1462
|
});
|
|
1463
1463
|
}
|
|
1464
1464
|
/**
|
|
@@ -1469,29 +1469,29 @@ class ca {
|
|
|
1469
1469
|
* @return {Promise<AnimationClip>}
|
|
1470
1470
|
*/
|
|
1471
1471
|
loadAnimation(e) {
|
|
1472
|
-
const a = this.json, r = this, b = a.animations[e], i = b.name ? b.name : "animation_" + e, H = [], f = [], c = [], t = [],
|
|
1473
|
-
for (let
|
|
1474
|
-
const s = b.channels[
|
|
1475
|
-
_.node !== void 0 && (H.push(this.getDependency("node",
|
|
1472
|
+
const a = this.json, r = this, b = a.animations[e], i = b.name ? b.name : "animation_" + e, H = [], f = [], c = [], t = [], d = [];
|
|
1473
|
+
for (let o = 0, k = b.channels.length; o < k; o++) {
|
|
1474
|
+
const s = b.channels[o], u = b.samplers[s.sampler], _ = s.target, h = _.node, I = b.parameters !== void 0 ? b.parameters[u.input] : u.input, A = b.parameters !== void 0 ? b.parameters[u.output] : u.output;
|
|
1475
|
+
_.node !== void 0 && (H.push(this.getDependency("node", h)), f.push(this.getDependency("accessor", I)), c.push(this.getDependency("accessor", A)), t.push(u), d.push(_));
|
|
1476
1476
|
}
|
|
1477
1477
|
return Promise.all([
|
|
1478
1478
|
Promise.all(H),
|
|
1479
1479
|
Promise.all(f),
|
|
1480
1480
|
Promise.all(c),
|
|
1481
1481
|
Promise.all(t),
|
|
1482
|
-
Promise.all(
|
|
1483
|
-
]).then(function(
|
|
1484
|
-
const k =
|
|
1485
|
-
for (let
|
|
1486
|
-
const p = k[
|
|
1482
|
+
Promise.all(d)
|
|
1483
|
+
]).then(function(o) {
|
|
1484
|
+
const k = o[0], s = o[1], u = o[2], _ = o[3], h = o[4], I = [];
|
|
1485
|
+
for (let A = 0, g = k.length; A < g; A++) {
|
|
1486
|
+
const p = k[A], y = s[A], F = u[A], N = _[A], B = h[A];
|
|
1487
1487
|
if (p === void 0) continue;
|
|
1488
1488
|
p.updateMatrix && p.updateMatrix();
|
|
1489
|
-
const
|
|
1490
|
-
if (
|
|
1491
|
-
for (let
|
|
1492
|
-
|
|
1489
|
+
const V = r._createAnimationTracks(p, y, F, N, B);
|
|
1490
|
+
if (V)
|
|
1491
|
+
for (let O = 0; O < V.length; O++)
|
|
1492
|
+
I.push(V[O]);
|
|
1493
1493
|
}
|
|
1494
|
-
return new
|
|
1494
|
+
return new D2(i, void 0, I);
|
|
1495
1495
|
});
|
|
1496
1496
|
}
|
|
1497
1497
|
createNodeMesh(e) {
|
|
@@ -1514,7 +1514,7 @@ class ca {
|
|
|
1514
1514
|
*/
|
|
1515
1515
|
loadNode(e) {
|
|
1516
1516
|
const a = this.json, r = this, b = a.nodes[e], i = r._loadNodeShallow(e), H = [], f = b.children || [];
|
|
1517
|
-
for (let t = 0,
|
|
1517
|
+
for (let t = 0, d = f.length; t < d; t++)
|
|
1518
1518
|
H.push(r.getDependency("node", f[t]));
|
|
1519
1519
|
const c = b.skin === void 0 ? Promise.resolve(null) : r.getDependency("skin", b.skin);
|
|
1520
1520
|
return Promise.all([
|
|
@@ -1522,13 +1522,13 @@ class ca {
|
|
|
1522
1522
|
Promise.all(H),
|
|
1523
1523
|
c
|
|
1524
1524
|
]).then(function(t) {
|
|
1525
|
-
const
|
|
1526
|
-
k !== null &&
|
|
1527
|
-
s.isSkinnedMesh && s.bind(k,
|
|
1525
|
+
const d = t[0], o = t[1], k = t[2];
|
|
1526
|
+
k !== null && d.traverse(function(s) {
|
|
1527
|
+
s.isSkinnedMesh && s.bind(k, Na);
|
|
1528
1528
|
});
|
|
1529
|
-
for (let s = 0, u =
|
|
1530
|
-
|
|
1531
|
-
return
|
|
1529
|
+
for (let s = 0, u = o.length; s < u; s++)
|
|
1530
|
+
d.add(o[s]);
|
|
1531
|
+
return d;
|
|
1532
1532
|
});
|
|
1533
1533
|
}
|
|
1534
1534
|
// ._loadNodeShallow() parses a single node.
|
|
@@ -1547,22 +1547,22 @@ class ca {
|
|
|
1547
1547
|
}).forEach(function(t) {
|
|
1548
1548
|
f.push(t);
|
|
1549
1549
|
}), this.nodeCache[e] = Promise.all(f).then(function(t) {
|
|
1550
|
-
let
|
|
1551
|
-
if (i.isBone === !0 ?
|
|
1552
|
-
for (let
|
|
1553
|
-
|
|
1554
|
-
if (i.name && (
|
|
1555
|
-
const
|
|
1556
|
-
|
|
1550
|
+
let d;
|
|
1551
|
+
if (i.isBone === !0 ? d = new O2() : t.length > 1 ? d = new C0() : t.length === 1 ? d = t[0] : d = new Ue(), d !== t[0])
|
|
1552
|
+
for (let o = 0, k = t.length; o < k; o++)
|
|
1553
|
+
d.add(t[o]);
|
|
1554
|
+
if (i.name && (d.userData.name = i.name, d.name = H), l0(d, i), i.extensions && y0(r, d, i), i.matrix !== void 0) {
|
|
1555
|
+
const o = new S0();
|
|
1556
|
+
o.fromArray(i.matrix), d.applyMatrix4(o);
|
|
1557
1557
|
} else
|
|
1558
|
-
i.translation !== void 0 &&
|
|
1559
|
-
if (!b.associations.has(
|
|
1560
|
-
b.associations.set(
|
|
1558
|
+
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);
|
|
1559
|
+
if (!b.associations.has(d))
|
|
1560
|
+
b.associations.set(d, {});
|
|
1561
1561
|
else if (i.mesh !== void 0 && b.meshCache.refs[i.mesh] > 1) {
|
|
1562
|
-
const
|
|
1563
|
-
b.associations.set(
|
|
1562
|
+
const o = b.associations.get(d);
|
|
1563
|
+
b.associations.set(d, { ...o });
|
|
1564
1564
|
}
|
|
1565
|
-
return b.associations.get(
|
|
1565
|
+
return b.associations.get(d).nodes = e, d;
|
|
1566
1566
|
}), this.nodeCache[e];
|
|
1567
1567
|
}
|
|
1568
1568
|
/**
|
|
@@ -1573,63 +1573,63 @@ class ca {
|
|
|
1573
1573
|
* @return {Promise<Group>}
|
|
1574
1574
|
*/
|
|
1575
1575
|
loadScene(e) {
|
|
1576
|
-
const a = this.extensions, r = this.json.scenes[e], b = this, i = new
|
|
1577
|
-
r.name && (i.name = b.createUniqueName(r.name)),
|
|
1576
|
+
const a = this.extensions, r = this.json.scenes[e], b = this, i = new C0();
|
|
1577
|
+
r.name && (i.name = b.createUniqueName(r.name)), l0(i, r), r.extensions && y0(a, i, r);
|
|
1578
1578
|
const H = r.nodes || [], f = [];
|
|
1579
1579
|
for (let c = 0, t = H.length; c < t; c++)
|
|
1580
1580
|
f.push(b.getDependency("node", H[c]));
|
|
1581
1581
|
return Promise.all(f).then(function(c) {
|
|
1582
|
-
for (let
|
|
1583
|
-
i.add(c[
|
|
1584
|
-
const t = (
|
|
1585
|
-
const
|
|
1582
|
+
for (let d = 0, o = c.length; d < o; d++)
|
|
1583
|
+
i.add(c[d]);
|
|
1584
|
+
const t = (d) => {
|
|
1585
|
+
const o = /* @__PURE__ */ new Map();
|
|
1586
1586
|
for (const [k, s] of b.associations)
|
|
1587
|
-
(k instanceof
|
|
1588
|
-
return
|
|
1587
|
+
(k instanceof Q0 || k instanceof me) && o.set(k, s);
|
|
1588
|
+
return d.traverse((k) => {
|
|
1589
1589
|
const s = b.associations.get(k);
|
|
1590
|
-
s != null &&
|
|
1591
|
-
}),
|
|
1590
|
+
s != null && o.set(k, s);
|
|
1591
|
+
}), o;
|
|
1592
1592
|
};
|
|
1593
1593
|
return b.associations = t(i), i;
|
|
1594
1594
|
});
|
|
1595
1595
|
}
|
|
1596
1596
|
_createAnimationTracks(e, a, r, b, i) {
|
|
1597
1597
|
const H = [], f = e.name ? e.name : e.uuid, c = [];
|
|
1598
|
-
|
|
1598
|
+
_0[i.path] === _0.weights ? e.traverse(function(k) {
|
|
1599
1599
|
k.morphTargetInfluences && c.push(k.name ? k.name : k.uuid);
|
|
1600
1600
|
}) : c.push(f);
|
|
1601
1601
|
let t;
|
|
1602
|
-
switch (
|
|
1603
|
-
case
|
|
1604
|
-
t =
|
|
1602
|
+
switch (_0[i.path]) {
|
|
1603
|
+
case _0.weights:
|
|
1604
|
+
t = Ie;
|
|
1605
1605
|
break;
|
|
1606
|
-
case
|
|
1607
|
-
t =
|
|
1606
|
+
case _0.rotation:
|
|
1607
|
+
t = ye;
|
|
1608
1608
|
break;
|
|
1609
|
-
case
|
|
1610
|
-
case
|
|
1611
|
-
t =
|
|
1609
|
+
case _0.translation:
|
|
1610
|
+
case _0.scale:
|
|
1611
|
+
t = je;
|
|
1612
1612
|
break;
|
|
1613
1613
|
default:
|
|
1614
1614
|
switch (r.itemSize) {
|
|
1615
1615
|
case 1:
|
|
1616
|
-
t =
|
|
1616
|
+
t = Ie;
|
|
1617
1617
|
break;
|
|
1618
1618
|
case 2:
|
|
1619
1619
|
case 3:
|
|
1620
1620
|
default:
|
|
1621
|
-
t =
|
|
1621
|
+
t = je;
|
|
1622
1622
|
break;
|
|
1623
1623
|
}
|
|
1624
1624
|
break;
|
|
1625
1625
|
}
|
|
1626
|
-
const
|
|
1626
|
+
const d = b.interpolation !== void 0 ? ma[b.interpolation] : We, o = this._getArrayFromAccessor(r);
|
|
1627
1627
|
for (let k = 0, s = c.length; k < s; k++) {
|
|
1628
1628
|
const u = new t(
|
|
1629
|
-
c[k] + "." +
|
|
1629
|
+
c[k] + "." + _0[i.path],
|
|
1630
1630
|
a.array,
|
|
1631
|
-
|
|
1632
|
-
|
|
1631
|
+
o,
|
|
1632
|
+
d
|
|
1633
1633
|
);
|
|
1634
1634
|
b.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(u), H.push(u);
|
|
1635
1635
|
}
|
|
@@ -1638,7 +1638,7 @@ class ca {
|
|
|
1638
1638
|
_getArrayFromAccessor(e) {
|
|
1639
1639
|
let a = e.array;
|
|
1640
1640
|
if (e.normalized) {
|
|
1641
|
-
const r =
|
|
1641
|
+
const r = He(a.constructor), b = new Float32Array(a.length);
|
|
1642
1642
|
for (let i = 0, H = a.length; i < H; i++)
|
|
1643
1643
|
b[i] = a[i] * r;
|
|
1644
1644
|
a = b;
|
|
@@ -1647,22 +1647,22 @@ class ca {
|
|
|
1647
1647
|
}
|
|
1648
1648
|
_createCubicSplineTrackInterpolant(e) {
|
|
1649
1649
|
e.createInterpolant = function(r) {
|
|
1650
|
-
const b = this instanceof
|
|
1650
|
+
const b = this instanceof ye ? pa : Le;
|
|
1651
1651
|
return new b(this.times, this.values, this.getValueSize() / 3, r);
|
|
1652
1652
|
}, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
|
|
1653
1653
|
}
|
|
1654
1654
|
}
|
|
1655
|
-
function
|
|
1656
|
-
const r = e.attributes, b = new
|
|
1655
|
+
function Ta(n, e, a) {
|
|
1656
|
+
const r = e.attributes, b = new z0();
|
|
1657
1657
|
if (r.POSITION !== void 0) {
|
|
1658
1658
|
const f = a.json.accessors[r.POSITION], c = f.min, t = f.max;
|
|
1659
1659
|
if (c !== void 0 && t !== void 0) {
|
|
1660
1660
|
if (b.set(
|
|
1661
|
-
new
|
|
1662
|
-
new
|
|
1661
|
+
new w(c[0], c[1], c[2]),
|
|
1662
|
+
new w(t[0], t[1], t[2])
|
|
1663
1663
|
), f.normalized) {
|
|
1664
|
-
const
|
|
1665
|
-
b.min.multiplyScalar(
|
|
1664
|
+
const d = He(T0[f.componentType]);
|
|
1665
|
+
b.min.multiplyScalar(d), b.max.multiplyScalar(d);
|
|
1666
1666
|
}
|
|
1667
1667
|
} else {
|
|
1668
1668
|
console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
|
|
@@ -1672,14 +1672,14 @@ function fa(o, e, a) {
|
|
|
1672
1672
|
return;
|
|
1673
1673
|
const i = e.targets;
|
|
1674
1674
|
if (i !== void 0) {
|
|
1675
|
-
const f = new
|
|
1676
|
-
for (let t = 0,
|
|
1677
|
-
const
|
|
1678
|
-
if (
|
|
1679
|
-
const k = a.json.accessors[
|
|
1675
|
+
const f = new w(), c = new w();
|
|
1676
|
+
for (let t = 0, d = i.length; t < d; t++) {
|
|
1677
|
+
const o = i[t];
|
|
1678
|
+
if (o.POSITION !== void 0) {
|
|
1679
|
+
const k = a.json.accessors[o.POSITION], s = k.min, u = k.max;
|
|
1680
1680
|
if (s !== void 0 && u !== void 0) {
|
|
1681
1681
|
if (c.setX(Math.max(Math.abs(s[0]), Math.abs(u[0]))), c.setY(Math.max(Math.abs(s[1]), Math.abs(u[1]))), c.setZ(Math.max(Math.abs(s[2]), Math.abs(u[2]))), k.normalized) {
|
|
1682
|
-
const _ =
|
|
1682
|
+
const _ = He(T0[k.componentType]);
|
|
1683
1683
|
c.multiplyScalar(_);
|
|
1684
1684
|
}
|
|
1685
1685
|
f.max(c);
|
|
@@ -1689,33 +1689,33 @@ function fa(o, e, a) {
|
|
|
1689
1689
|
}
|
|
1690
1690
|
b.expandByVector(f);
|
|
1691
1691
|
}
|
|
1692
|
-
|
|
1693
|
-
const H = new
|
|
1694
|
-
b.getCenter(H.center), H.radius = b.min.distanceTo(b.max) / 2,
|
|
1692
|
+
n.boundingBox = b;
|
|
1693
|
+
const H = new P2();
|
|
1694
|
+
b.getCenter(H.center), H.radius = b.min.distanceTo(b.max) / 2, n.boundingSphere = H;
|
|
1695
1695
|
}
|
|
1696
|
-
function
|
|
1696
|
+
function Re(n, e, a) {
|
|
1697
1697
|
const r = e.attributes, b = [];
|
|
1698
1698
|
function i(H, f) {
|
|
1699
1699
|
return a.getDependency("accessor", H).then(function(c) {
|
|
1700
|
-
|
|
1700
|
+
n.setAttribute(f, c);
|
|
1701
1701
|
});
|
|
1702
1702
|
}
|
|
1703
1703
|
for (const H in r) {
|
|
1704
|
-
const f =
|
|
1705
|
-
f in
|
|
1704
|
+
const f = ie[H] || H.toLowerCase();
|
|
1705
|
+
f in n.attributes || b.push(i(r[H], f));
|
|
1706
1706
|
}
|
|
1707
|
-
if (e.indices !== void 0 && !
|
|
1707
|
+
if (e.indices !== void 0 && !n.index) {
|
|
1708
1708
|
const H = a.getDependency("accessor", e.indices).then(function(f) {
|
|
1709
|
-
|
|
1709
|
+
n.setIndex(f);
|
|
1710
1710
|
});
|
|
1711
1711
|
b.push(H);
|
|
1712
1712
|
}
|
|
1713
|
-
return
|
|
1714
|
-
return e.targets !== void 0 ?
|
|
1713
|
+
return be.workingColorSpace !== k0 && "COLOR_0" in r && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${be.workingColorSpace}" not supported.`), l0(n, e), Ta(n, e, a), Promise.all(b).then(function() {
|
|
1714
|
+
return e.targets !== void 0 ? Ia(n, e.targets, a) : n;
|
|
1715
1715
|
});
|
|
1716
1716
|
}
|
|
1717
|
-
const
|
|
1718
|
-
class
|
|
1717
|
+
const X0 = /* @__PURE__ */ new WeakMap();
|
|
1718
|
+
class Ra extends Ge {
|
|
1719
1719
|
/**
|
|
1720
1720
|
* Constructs a new Draco loader.
|
|
1721
1721
|
*
|
|
@@ -1772,7 +1772,7 @@ class ta extends ke {
|
|
|
1772
1772
|
* @param {onErrorCallback} onError - Executed when errors occur.
|
|
1773
1773
|
*/
|
|
1774
1774
|
load(e, a, r, b) {
|
|
1775
|
-
const i = new
|
|
1775
|
+
const i = new L0(this.manager);
|
|
1776
1776
|
i.setPath(this.path), i.setResponseType("arraybuffer"), i.setRequestHeader(this.requestHeader), i.setWithCredentials(this.withCredentials), i.load(e, (H) => {
|
|
1777
1777
|
this.parse(H, a, b);
|
|
1778
1778
|
}, r, b);
|
|
@@ -1786,10 +1786,10 @@ class ta extends ke {
|
|
|
1786
1786
|
*/
|
|
1787
1787
|
parse(e, a, r = () => {
|
|
1788
1788
|
}) {
|
|
1789
|
-
this.decodeDracoFile(e, a, null, null,
|
|
1789
|
+
this.decodeDracoFile(e, a, null, null, A0, r).catch(r);
|
|
1790
1790
|
}
|
|
1791
1791
|
//
|
|
1792
|
-
decodeDracoFile(e, a, r, b, i =
|
|
1792
|
+
decodeDracoFile(e, a, r, b, i = k0, H = () => {
|
|
1793
1793
|
}) {
|
|
1794
1794
|
const f = {
|
|
1795
1795
|
attributeIDs: r || this.defaultAttributeIDs,
|
|
@@ -1801,8 +1801,8 @@ class ta extends ke {
|
|
|
1801
1801
|
}
|
|
1802
1802
|
decodeGeometry(e, a) {
|
|
1803
1803
|
const r = JSON.stringify(a);
|
|
1804
|
-
if (
|
|
1805
|
-
const c =
|
|
1804
|
+
if (X0.has(e)) {
|
|
1805
|
+
const c = X0.get(e);
|
|
1806
1806
|
if (c.key === r)
|
|
1807
1807
|
return c.promise;
|
|
1808
1808
|
if (e.byteLength === 0)
|
|
@@ -1811,33 +1811,33 @@ class ta extends ke {
|
|
|
1811
1811
|
);
|
|
1812
1812
|
}
|
|
1813
1813
|
let b;
|
|
1814
|
-
const i = this.workerNextTaskID++, H = e.byteLength, f = this._getWorker(i, H).then((c) => (b = c, new Promise((t,
|
|
1815
|
-
b._callbacks[i] = { resolve: t, reject:
|
|
1814
|
+
const i = this.workerNextTaskID++, H = e.byteLength, f = this._getWorker(i, H).then((c) => (b = c, new Promise((t, d) => {
|
|
1815
|
+
b._callbacks[i] = { resolve: t, reject: d }, b.postMessage({ type: "decode", id: i, taskConfig: a, buffer: e }, [e]);
|
|
1816
1816
|
}))).then((c) => this._createGeometry(c.geometry));
|
|
1817
1817
|
return f.catch(() => !0).then(() => {
|
|
1818
1818
|
b && i && this._releaseTask(b, i);
|
|
1819
|
-
}),
|
|
1819
|
+
}), X0.set(e, {
|
|
1820
1820
|
key: r,
|
|
1821
1821
|
promise: f
|
|
1822
1822
|
}), f;
|
|
1823
1823
|
}
|
|
1824
1824
|
_createGeometry(e) {
|
|
1825
|
-
const a = new
|
|
1826
|
-
e.index && a.setIndex(new
|
|
1825
|
+
const a = new qe();
|
|
1826
|
+
e.index && a.setIndex(new U0(e.index.array, 1));
|
|
1827
1827
|
for (let r = 0; r < e.attributes.length; r++) {
|
|
1828
|
-
const b = e.attributes[r], i = b.name, H = b.array, f = b.itemSize, c = new
|
|
1828
|
+
const b = e.attributes[r], i = b.name, H = b.array, f = b.itemSize, c = new U0(H, f);
|
|
1829
1829
|
i === "color" && (this._assignVertexColorSpace(c, b.vertexColorSpace), c.normalized = !(H instanceof Float32Array)), a.setAttribute(i, c);
|
|
1830
1830
|
}
|
|
1831
1831
|
return a;
|
|
1832
1832
|
}
|
|
1833
1833
|
_assignVertexColorSpace(e, a) {
|
|
1834
|
-
if (a !==
|
|
1835
|
-
const r = new
|
|
1834
|
+
if (a !== A0) return;
|
|
1835
|
+
const r = new h0();
|
|
1836
1836
|
for (let b = 0, i = e.count; b < i; b++)
|
|
1837
|
-
r.fromBufferAttribute(e, b),
|
|
1837
|
+
r.fromBufferAttribute(e, b), be.colorSpaceToWorking(r, A0), e.setXYZ(b, r.r, r.g, r.b);
|
|
1838
1838
|
}
|
|
1839
1839
|
_loadLibrary(e, a) {
|
|
1840
|
-
const r = new
|
|
1840
|
+
const r = new L0(this.manager);
|
|
1841
1841
|
return r.setPath(this.decoderPath), r.setResponseType(a), r.setWithCredentials(this.withCredentials), new Promise((b, i) => {
|
|
1842
1842
|
r.load(e, b, void 0, i);
|
|
1843
1843
|
});
|
|
@@ -1851,7 +1851,7 @@ class ta extends ke {
|
|
|
1851
1851
|
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((r) => {
|
|
1852
1852
|
const b = r[0];
|
|
1853
1853
|
e || (this.decoderConfig.wasmBinary = r[1]);
|
|
1854
|
-
const i =
|
|
1854
|
+
const i = Ma.toString(), H = [
|
|
1855
1855
|
"/* draco decoder */",
|
|
1856
1856
|
b,
|
|
1857
1857
|
"",
|
|
@@ -1899,36 +1899,36 @@ class ta extends ke {
|
|
|
1899
1899
|
return this.workerPool.length = 0, this.workerSourceURL !== "" && URL.revokeObjectURL(this.workerSourceURL), this;
|
|
1900
1900
|
}
|
|
1901
1901
|
}
|
|
1902
|
-
function
|
|
1903
|
-
let
|
|
1902
|
+
function Ma() {
|
|
1903
|
+
let n, e;
|
|
1904
1904
|
onmessage = function(H) {
|
|
1905
1905
|
const f = H.data;
|
|
1906
1906
|
switch (f.type) {
|
|
1907
1907
|
case "init":
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
}, DracoDecoderModule(
|
|
1908
|
+
n = f.decoderConfig, e = new Promise(function(d) {
|
|
1909
|
+
n.onModuleLoaded = function(o) {
|
|
1910
|
+
d({ draco: o });
|
|
1911
|
+
}, DracoDecoderModule(n);
|
|
1912
1912
|
});
|
|
1913
1913
|
break;
|
|
1914
1914
|
case "decode":
|
|
1915
1915
|
const c = f.buffer, t = f.taskConfig;
|
|
1916
|
-
e.then((
|
|
1917
|
-
const
|
|
1916
|
+
e.then((d) => {
|
|
1917
|
+
const o = d.draco, k = new o.Decoder();
|
|
1918
1918
|
try {
|
|
1919
|
-
const s = a(
|
|
1919
|
+
const s = a(o, k, new Int8Array(c), t), u = s.attributes.map((_) => _.array.buffer);
|
|
1920
1920
|
s.index && u.push(s.index.array.buffer), self.postMessage({ type: "decode", id: f.id, geometry: s }, u);
|
|
1921
1921
|
} catch (s) {
|
|
1922
1922
|
console.error(s), self.postMessage({ type: "error", id: f.id, error: s.message });
|
|
1923
1923
|
} finally {
|
|
1924
|
-
|
|
1924
|
+
o.destroy(k);
|
|
1925
1925
|
}
|
|
1926
1926
|
});
|
|
1927
1927
|
break;
|
|
1928
1928
|
}
|
|
1929
1929
|
};
|
|
1930
1930
|
function a(H, f, c, t) {
|
|
1931
|
-
const
|
|
1931
|
+
const d = t.attributeIDs, o = t.attributeTypes;
|
|
1932
1932
|
let k, s;
|
|
1933
1933
|
const u = f.GetEncodedGeometryType(c);
|
|
1934
1934
|
if (u === H.TRIANGULAR_MESH)
|
|
@@ -1940,33 +1940,33 @@ function na() {
|
|
|
1940
1940
|
if (!s.ok() || k.ptr === 0)
|
|
1941
1941
|
throw new Error("THREE.DRACOLoader: Decoding failed: " + s.error_msg());
|
|
1942
1942
|
const _ = { index: null, attributes: [] };
|
|
1943
|
-
for (const
|
|
1944
|
-
const
|
|
1945
|
-
let
|
|
1943
|
+
for (const h in d) {
|
|
1944
|
+
const I = self[o[h]];
|
|
1945
|
+
let A, g;
|
|
1946
1946
|
if (t.useUniqueIDs)
|
|
1947
|
-
g =
|
|
1947
|
+
g = d[h], A = f.GetAttributeByUniqueId(k, g);
|
|
1948
1948
|
else {
|
|
1949
|
-
if (g = f.GetAttributeId(k, H[
|
|
1950
|
-
|
|
1949
|
+
if (g = f.GetAttributeId(k, H[d[h]]), g === -1) continue;
|
|
1950
|
+
A = f.GetAttribute(k, g);
|
|
1951
1951
|
}
|
|
1952
|
-
const p = b(H, f, k,
|
|
1953
|
-
|
|
1952
|
+
const p = b(H, f, k, h, I, A);
|
|
1953
|
+
h === "color" && (p.vertexColorSpace = t.vertexColorSpace), _.attributes.push(p);
|
|
1954
1954
|
}
|
|
1955
1955
|
return u === H.TRIANGULAR_MESH && (_.index = r(H, f, k)), H.destroy(k), _;
|
|
1956
1956
|
}
|
|
1957
1957
|
function r(H, f, c) {
|
|
1958
|
-
const
|
|
1959
|
-
f.GetTrianglesUInt32Array(c,
|
|
1960
|
-
const s = new Uint32Array(H.HEAPF32.buffer, k,
|
|
1958
|
+
const d = c.num_faces() * 3, o = d * 4, k = H._malloc(o);
|
|
1959
|
+
f.GetTrianglesUInt32Array(c, o, k);
|
|
1960
|
+
const s = new Uint32Array(H.HEAPF32.buffer, k, d).slice();
|
|
1961
1961
|
return H._free(k), { array: s, itemSize: 1 };
|
|
1962
1962
|
}
|
|
1963
|
-
function b(H, f, c, t,
|
|
1964
|
-
const k =
|
|
1965
|
-
f.GetAttributeDataArrayForAllPoints(c,
|
|
1966
|
-
const
|
|
1967
|
-
return H._free(
|
|
1963
|
+
function b(H, f, c, t, d, o) {
|
|
1964
|
+
const k = o.num_components(), u = c.num_points() * k, _ = u * d.BYTES_PER_ELEMENT, h = i(H, d), I = H._malloc(_);
|
|
1965
|
+
f.GetAttributeDataArrayForAllPoints(c, o, h, _, I);
|
|
1966
|
+
const A = new d(H.HEAPF32.buffer, I, u).slice();
|
|
1967
|
+
return H._free(I), {
|
|
1968
1968
|
name: t,
|
|
1969
|
-
array:
|
|
1969
|
+
array: A,
|
|
1970
1970
|
itemSize: k
|
|
1971
1971
|
};
|
|
1972
1972
|
}
|
|
@@ -1989,7 +1989,7 @@ function na() {
|
|
|
1989
1989
|
}
|
|
1990
1990
|
}
|
|
1991
1991
|
}
|
|
1992
|
-
const
|
|
1992
|
+
const Da = `
|
|
1993
1993
|
var DracoDecoderModule = (() => {
|
|
1994
1994
|
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
|
1995
1995
|
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
|
@@ -2024,77 +2024,77 @@ else if (typeof define === 'function' && define['amd'])
|
|
|
2024
2024
|
else if (typeof exports === 'object')
|
|
2025
2025
|
exports["DracoDecoderModule"] = DracoDecoderModule;
|
|
2026
2026
|
`;
|
|
2027
|
-
function
|
|
2028
|
-
const
|
|
2027
|
+
function Oa() {
|
|
2028
|
+
const n = u0(!1), e = u0(""), a = Ye([]), r = u0(null), b = new S2(), i = new z2(), H = new Z2(), f = new J2();
|
|
2029
2029
|
let c = null;
|
|
2030
2030
|
return {
|
|
2031
|
-
isLoading:
|
|
2031
|
+
isLoading: n,
|
|
2032
2032
|
loadingProgress: e,
|
|
2033
2033
|
loadedModels: a,
|
|
2034
2034
|
error: r,
|
|
2035
|
-
loadModelsFromBlobs: async (
|
|
2035
|
+
loadModelsFromBlobs: async (d) => {
|
|
2036
2036
|
var u;
|
|
2037
|
-
if (!
|
|
2037
|
+
if (!d || d.length === 0) {
|
|
2038
2038
|
console.warn("loadModelsFromBlobs 加载的文件数组为空!");
|
|
2039
2039
|
return;
|
|
2040
2040
|
}
|
|
2041
|
-
|
|
2042
|
-
const
|
|
2043
|
-
|
|
2044
|
-
_ instanceof File &&
|
|
2041
|
+
n.value = !0, e.value = "准备加载...", a.value = [], r.value = null;
|
|
2042
|
+
const o = /* @__PURE__ */ new Map();
|
|
2043
|
+
d.forEach((_) => {
|
|
2044
|
+
_ instanceof File && o.set(_.name.toLowerCase(), _);
|
|
2045
2045
|
});
|
|
2046
2046
|
const k = [], s = [];
|
|
2047
2047
|
try {
|
|
2048
|
-
for (const _ of
|
|
2049
|
-
const
|
|
2050
|
-
if (
|
|
2051
|
-
const
|
|
2052
|
-
k.push(
|
|
2048
|
+
for (const _ of d) {
|
|
2049
|
+
const h = _.name || "unknown_file", I = (u = h.split(".").pop()) == null ? void 0 : u.toLowerCase();
|
|
2050
|
+
if (I === "mtl") continue;
|
|
2051
|
+
const A = URL.createObjectURL(_);
|
|
2052
|
+
k.push(A);
|
|
2053
2053
|
let g = null;
|
|
2054
|
-
const p = (
|
|
2055
|
-
const F =
|
|
2056
|
-
e.value = `正在加载 ${
|
|
2054
|
+
const p = (y) => {
|
|
2055
|
+
const F = y.lengthComputable ? y.loaded / y.total * 100 : 0;
|
|
2056
|
+
e.value = `正在加载 ${h}... ${Math.round(F)}%`;
|
|
2057
2057
|
};
|
|
2058
|
-
switch (e.value = `正在加载 ${
|
|
2058
|
+
switch (e.value = `正在加载 ${h}... 0%`, I) {
|
|
2059
2059
|
case "obj":
|
|
2060
|
-
const
|
|
2061
|
-
if (
|
|
2062
|
-
const
|
|
2063
|
-
k.push(
|
|
2064
|
-
const
|
|
2065
|
-
|
|
2060
|
+
const y = h.replace(/\.obj$/i, ".mtl").toLowerCase();
|
|
2061
|
+
if (o.has(y)) {
|
|
2062
|
+
const O = o.get(y), x = URL.createObjectURL(O);
|
|
2063
|
+
k.push(x);
|
|
2064
|
+
const S = await b.loadAsync(x);
|
|
2065
|
+
S.preload(), i.setMaterials(S);
|
|
2066
2066
|
} else
|
|
2067
2067
|
i.setMaterials(null);
|
|
2068
|
-
g = await i.loadAsync(
|
|
2068
|
+
g = await i.loadAsync(A, p);
|
|
2069
2069
|
break;
|
|
2070
2070
|
case "stl":
|
|
2071
|
-
const F = await H.loadAsync(
|
|
2072
|
-
g = new
|
|
2071
|
+
const F = await H.loadAsync(A, p), N = new B2({ color: 11184810, specular: 1118481, shininess: 200 });
|
|
2072
|
+
g = new Ve(F, N);
|
|
2073
2073
|
break;
|
|
2074
2074
|
case "gltf":
|
|
2075
|
-
g = (await f.loadAsync(
|
|
2075
|
+
g = (await f.loadAsync(A, p)).scene;
|
|
2076
2076
|
break;
|
|
2077
2077
|
case "glb":
|
|
2078
|
-
c || (c = new
|
|
2079
|
-
return
|
|
2080
|
-
}, c.setDecoderConfig({ type: "js" }), c.preload()), f.setDRACOLoader(c), g = (await f.loadAsync(
|
|
2078
|
+
c || (c = new Ra(), c._loadLibrary = function(O, x) {
|
|
2079
|
+
return O === "draco_decoder.js" && x === "text" ? Promise.resolve(Da) : Promise.reject(new Error(`DRACOLoader: 未预期的库请求 ${O}`));
|
|
2080
|
+
}, c.setDecoderConfig({ type: "js" }), c.preload()), f.setDRACOLoader(c), g = (await f.loadAsync(A, p)).scene;
|
|
2081
2081
|
break;
|
|
2082
2082
|
default:
|
|
2083
|
-
console.warn(`不支持的文件类型: .${
|
|
2083
|
+
console.warn(`不支持的文件类型: .${I}`), e.value = `不支持的文件类型: ${h}`;
|
|
2084
2084
|
continue;
|
|
2085
2085
|
}
|
|
2086
|
-
g && (g.userData.boundingBox = new
|
|
2086
|
+
g && (g.userData.boundingBox = new z0().setFromObject(g), s.push(g));
|
|
2087
2087
|
}
|
|
2088
2088
|
a.value = s, e.value = "加载完成!";
|
|
2089
2089
|
} catch (_) {
|
|
2090
2090
|
throw console.error("加载模型时出错:", _), r.value = `加载失败: ${_.message || "未知错误"}`, e.value = "加载失败!", a.value = [], _;
|
|
2091
2091
|
} finally {
|
|
2092
|
-
|
|
2092
|
+
n.value = !1, k.forEach((_) => URL.revokeObjectURL(_));
|
|
2093
2093
|
}
|
|
2094
2094
|
}
|
|
2095
2095
|
};
|
|
2096
2096
|
}
|
|
2097
|
-
function
|
|
2097
|
+
function Ea(n, e = {}) {
|
|
2098
2098
|
const a = {
|
|
2099
2099
|
threeInfo: {},
|
|
2100
2100
|
modelLoader: {},
|
|
@@ -2102,12 +2102,12 @@ function ka(o, e = {}) {
|
|
|
2102
2102
|
clipping: {},
|
|
2103
2103
|
partAnimation: {},
|
|
2104
2104
|
millPivotAnimation: {}
|
|
2105
|
-
}, r =
|
|
2105
|
+
}, r = V2(n);
|
|
2106
2106
|
a.threeInfo = r;
|
|
2107
|
-
const { currentModels: b, getThreeJSObjects: i, addBeforeRenderCallback: H, removeBeforeRenderCallback: f } = r, { useModelLoaderHook: c, useAnimationHook: t, useClippingHook:
|
|
2108
|
-
if (c && (a.modelLoader =
|
|
2109
|
-
const k =
|
|
2110
|
-
a.partAnimation = k, a.millPivotAnimation =
|
|
2107
|
+
const { currentModels: b, getThreeJSObjects: i, addBeforeRenderCallback: H, removeBeforeRenderCallback: f } = r, { useModelLoaderHook: c, useAnimationHook: t, useClippingHook: d, usePartAnimationHook: o } = e;
|
|
2108
|
+
if (c && (a.modelLoader = Oa()), t && (a.animation = W2(i, b)), d && (a.clipping = C2(i, b)), o) {
|
|
2109
|
+
const k = Ga(i, b, H, f);
|
|
2110
|
+
a.partAnimation = k, a.millPivotAnimation = Xa(
|
|
2111
2111
|
b,
|
|
2112
2112
|
i,
|
|
2113
2113
|
k.setPartRotation,
|
|
@@ -2116,73 +2116,73 @@ function ka(o, e = {}) {
|
|
|
2116
2116
|
}
|
|
2117
2117
|
return a;
|
|
2118
2118
|
}
|
|
2119
|
-
function
|
|
2120
|
-
const b =
|
|
2119
|
+
function Ga(n, e, a, r) {
|
|
2120
|
+
const b = u0(!1), i = /* @__PURE__ */ new Map();
|
|
2121
2121
|
let H = null;
|
|
2122
|
-
function f(
|
|
2123
|
-
const g = /* @__PURE__ */ new Set([
|
|
2124
|
-
g.add(
|
|
2125
|
-
for (const
|
|
2126
|
-
if (
|
|
2122
|
+
function f(A) {
|
|
2123
|
+
const g = /* @__PURE__ */ new Set([A]);
|
|
2124
|
+
g.add(A.replace(/\./g, ""));
|
|
2125
|
+
for (const y of e.value)
|
|
2126
|
+
if (y)
|
|
2127
2127
|
for (const F of g) {
|
|
2128
|
-
const
|
|
2129
|
-
if (
|
|
2128
|
+
const N = y.getObjectByName(F);
|
|
2129
|
+
if (N) return N;
|
|
2130
2130
|
}
|
|
2131
|
-
const { scene: p } =
|
|
2131
|
+
const { scene: p } = n();
|
|
2132
2132
|
if (p)
|
|
2133
|
-
for (const
|
|
2134
|
-
const F = p.getObjectByName(
|
|
2133
|
+
for (const y of g) {
|
|
2134
|
+
const F = p.getObjectByName(y);
|
|
2135
2135
|
if (F) return F;
|
|
2136
2136
|
}
|
|
2137
2137
|
return null;
|
|
2138
2138
|
}
|
|
2139
|
-
function c(
|
|
2140
|
-
return
|
|
2139
|
+
function c(A) {
|
|
2140
|
+
return A.map((g) => {
|
|
2141
2141
|
const p = f(g);
|
|
2142
2142
|
return { name: g, object: p, found: !!p };
|
|
2143
2143
|
});
|
|
2144
2144
|
}
|
|
2145
|
-
function t(
|
|
2146
|
-
const p = f(
|
|
2147
|
-
return p ? (i.set(
|
|
2145
|
+
function t(A, g) {
|
|
2146
|
+
const p = f(A);
|
|
2147
|
+
return p ? (i.set(A, {
|
|
2148
2148
|
object: p,
|
|
2149
2149
|
axis: g.axis,
|
|
2150
2150
|
speed: g.speed,
|
|
2151
2151
|
direction: g.direction ?? 1
|
|
2152
|
-
}), !0) : (console.warn(`[usePartAnimation] 未找到部件: "${
|
|
2152
|
+
}), !0) : (console.warn(`[usePartAnimation] 未找到部件: "${A}"`), !1);
|
|
2153
2153
|
}
|
|
2154
|
-
function
|
|
2155
|
-
return g ? p ? (i.set(
|
|
2154
|
+
function d(A, g, p, y) {
|
|
2155
|
+
return g ? p ? (i.set(A, {
|
|
2156
2156
|
object: g,
|
|
2157
|
-
axis:
|
|
2158
|
-
speed:
|
|
2159
|
-
direction:
|
|
2157
|
+
axis: y.axis,
|
|
2158
|
+
speed: y.speed,
|
|
2159
|
+
direction: y.direction ?? 1,
|
|
2160
2160
|
pivot: p
|
|
2161
|
-
}), !0) : (console.warn(`[usePartAnimation] pivot 为空: "${
|
|
2161
|
+
}), !0) : (console.warn(`[usePartAnimation] pivot 为空: "${A}"`), !1) : (console.warn(`[usePartAnimation] 未找到部件: "${A}"`), !1);
|
|
2162
2162
|
}
|
|
2163
|
-
function
|
|
2163
|
+
function o(A) {
|
|
2164
2164
|
let g = 0;
|
|
2165
|
-
return
|
|
2166
|
-
t(p, { axis:
|
|
2165
|
+
return A.forEach(({ partName: p, axis: y, speed: F, direction: N }) => {
|
|
2166
|
+
t(p, { axis: y, speed: F, direction: N }) && g++;
|
|
2167
2167
|
}), g;
|
|
2168
2168
|
}
|
|
2169
|
-
function k(
|
|
2170
|
-
i.delete(
|
|
2169
|
+
function k(A) {
|
|
2170
|
+
i.delete(A);
|
|
2171
2171
|
}
|
|
2172
2172
|
function s() {
|
|
2173
2173
|
i.clear();
|
|
2174
2174
|
}
|
|
2175
2175
|
function u() {
|
|
2176
|
-
const
|
|
2176
|
+
const A = [];
|
|
2177
2177
|
return i.forEach((g, p) => {
|
|
2178
|
-
|
|
2178
|
+
A.push({
|
|
2179
2179
|
name: p,
|
|
2180
2180
|
axis: g.axis,
|
|
2181
2181
|
speed: g.speed,
|
|
2182
2182
|
direction: g.direction,
|
|
2183
2183
|
found: !!g.object
|
|
2184
2184
|
});
|
|
2185
|
-
}),
|
|
2185
|
+
}), A;
|
|
2186
2186
|
}
|
|
2187
2187
|
function _() {
|
|
2188
2188
|
if (!b.value) {
|
|
@@ -2190,47 +2190,47 @@ function sa(o, e, a, r) {
|
|
|
2190
2190
|
console.warn("[usePartAnimation] 没有配置任何部件旋转");
|
|
2191
2191
|
return;
|
|
2192
2192
|
}
|
|
2193
|
-
b.value = !0, H = (
|
|
2193
|
+
b.value = !0, H = (A) => {
|
|
2194
2194
|
b.value && i.forEach((g) => {
|
|
2195
2195
|
if (!g.object) return;
|
|
2196
|
-
const p = g.pivot ?? g.object,
|
|
2197
|
-
p.rotation[
|
|
2196
|
+
const p = g.pivot ?? g.object, y = g.axis;
|
|
2197
|
+
p.rotation[y] += g.direction * g.speed * A;
|
|
2198
2198
|
});
|
|
2199
2199
|
}, a(H);
|
|
2200
2200
|
}
|
|
2201
2201
|
}
|
|
2202
|
-
function
|
|
2202
|
+
function h() {
|
|
2203
2203
|
b.value = !1, H && (r(H), H = null);
|
|
2204
2204
|
}
|
|
2205
|
-
function
|
|
2206
|
-
b.value ?
|
|
2205
|
+
function I() {
|
|
2206
|
+
b.value ? h() : _();
|
|
2207
2207
|
}
|
|
2208
2208
|
return {
|
|
2209
2209
|
isPartAnimating: b,
|
|
2210
2210
|
findPart: f,
|
|
2211
2211
|
findParts: c,
|
|
2212
2212
|
setPartRotation: t,
|
|
2213
|
-
setPartRotationPivotByObject:
|
|
2214
|
-
setPartRotations:
|
|
2213
|
+
setPartRotationPivotByObject: d,
|
|
2214
|
+
setPartRotations: o,
|
|
2215
2215
|
removePartRotation: k,
|
|
2216
2216
|
clearAllPartRotations: s,
|
|
2217
2217
|
getPartAnimationStatus: u,
|
|
2218
2218
|
startPartAnimations: _,
|
|
2219
|
-
stopPartAnimations:
|
|
2220
|
-
togglePartAnimations:
|
|
2219
|
+
stopPartAnimations: h,
|
|
2220
|
+
togglePartAnimations: I
|
|
2221
2221
|
};
|
|
2222
2222
|
}
|
|
2223
|
-
function
|
|
2224
|
-
return
|
|
2223
|
+
function r0(n) {
|
|
2224
|
+
return n < 0.5 ? 4 * n * n * n : 1 - Math.pow(-2 * n + 2, 3) / 2;
|
|
2225
2225
|
}
|
|
2226
|
-
const
|
|
2226
|
+
const Ua = {
|
|
2227
2227
|
"轧辊整体-1001": ["轧辊整体-1001", "上轧辊000-1"],
|
|
2228
2228
|
"下轧辊-1001": ["下轧辊-1001", "下轧辊000-1"],
|
|
2229
2229
|
"轧辊整体-1": ["轧辊整体-1", "上轧辊000-3"],
|
|
2230
2230
|
"下轧辊-1": ["下轧辊-1", "下轧辊000-3"]
|
|
2231
2231
|
};
|
|
2232
|
-
function
|
|
2233
|
-
const r =
|
|
2232
|
+
function W0(n, e, a) {
|
|
2233
|
+
const r = Ua[n] ?? [n], b = (i) => {
|
|
2234
2234
|
if (!i) return null;
|
|
2235
2235
|
for (const H of r) {
|
|
2236
2236
|
const f = i.getObjectByName(H);
|
|
@@ -2245,392 +2245,499 @@ function F0(o, e, a) {
|
|
|
2245
2245
|
}
|
|
2246
2246
|
return b(a);
|
|
2247
2247
|
}
|
|
2248
|
-
function
|
|
2249
|
-
const i =
|
|
2250
|
-
let
|
|
2251
|
-
const
|
|
2252
|
-
let
|
|
2253
|
-
const G = new
|
|
2254
|
-
function
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2248
|
+
function xa(n, e, a, r, b = null) {
|
|
2249
|
+
const i = u0(!1), H = 0.6, f = 5, c = 0.5, t = -0.3, d = 0.8, o = 0.3, k = 30, s = 2, u = 0.5, _ = 0.6, h = 1.5, I = 3, A = 1, g = 0.6, p = 0.5, y = 0.07, F = 0.97, N = 8e-3, B = 0.97, V = 0.015, O = 0.4, x = 1, S = 1, K = 0.3;
|
|
2250
|
+
let v = "idle", m = 0, R = new w(), q = new w(), l = null, W = null, Q = null, C = null, J = null, $ = null, c0 = null, d0 = null, p0 = null, R0 = 0, Y = null, o0 = null;
|
|
2251
|
+
const w0 = new w(), m0 = new n0(), T = [];
|
|
2252
|
+
let E = null, L = "";
|
|
2253
|
+
const G = new w(), Z = new w();
|
|
2254
|
+
function e0(P) {
|
|
2255
|
+
if (!P) return 0;
|
|
2256
|
+
const j = new n0();
|
|
2257
|
+
return P.getWorldQuaternion(j), j.w;
|
|
2258
|
+
}
|
|
2259
|
+
function X(P, j) {
|
|
2260
|
+
const U = e0(P);
|
|
2261
|
+
return Math.abs(U - j) <= V;
|
|
2262
|
+
}
|
|
2263
|
+
function i0(P, j, U) {
|
|
2264
|
+
if (!P) return;
|
|
2265
|
+
const z = new n0();
|
|
2266
|
+
P.getWorldQuaternion(z);
|
|
2267
|
+
const a0 = new z0().setFromObject(P), H0 = new w();
|
|
2268
|
+
a0.getCenter(H0), Z.copy(j).applyQuaternion(z), U.copy(H0).add(Z);
|
|
2269
|
+
}
|
|
2270
|
+
function M0(P, j) {
|
|
2271
|
+
const U = new w();
|
|
2272
|
+
if (P && P.getWorldPosition(U), j) {
|
|
2273
|
+
const z = new w();
|
|
2274
|
+
j.getWorldPosition(z), U.add(z).multiplyScalar(0.5), U.y -= 0.313;
|
|
2275
|
+
}
|
|
2276
|
+
return U;
|
|
2277
|
+
}
|
|
2278
|
+
function Se() {
|
|
2279
|
+
const P = n.value;
|
|
2280
|
+
if (!P || P.length === 0) return !1;
|
|
2281
|
+
Y = r().scene;
|
|
2282
|
+
const U = (M) => M ?? null;
|
|
2283
|
+
for (const M of P) {
|
|
2284
|
+
if (!M) continue;
|
|
2285
|
+
const b0 = M.getObjectByName("机器人-2");
|
|
2286
|
+
if (b0 && (l = U(b0.getObjectByName("坯料-1")), l))
|
|
2262
2287
|
break;
|
|
2263
2288
|
}
|
|
2264
|
-
if (!
|
|
2289
|
+
if (!l)
|
|
2265
2290
|
return console.warn("[useBilletAnimation] 未找到部件: 坯料-1 (在 机器人-2 下)"), !1;
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
for (const v of V)
|
|
2271
|
-
if (v && (W || (W = v.getObjectByName("下输送台板-1")), Z || (Z = v.getObjectByName("下输送台板-2")), W && Z))
|
|
2291
|
+
W = W0("轧辊整体-1001", n, Y), W || console.warn("[useBilletAnimation] 未找到部件: 轧辊整体-1001 / 上轧辊000-1"), Q = W0("下轧辊-1001", n, Y), Q || console.warn("[useBilletAnimation] 未找到部件: 下轧辊-1001 / 下轧辊000-1");
|
|
2292
|
+
let z = null, a0 = null;
|
|
2293
|
+
for (const M of P)
|
|
2294
|
+
if (M && (z || (z = U(M.getObjectByName("下输送台板-1"))), a0 || (a0 = U(M.getObjectByName("下输送台板-2"))), z && a0))
|
|
2272
2295
|
break;
|
|
2273
|
-
if ((!
|
|
2274
|
-
const
|
|
2275
|
-
|
|
2276
|
-
const
|
|
2277
|
-
|
|
2296
|
+
if ((!z || !a0) && Y && (z || (z = U(Y.getObjectByName("下输送台板-1"))), a0 || (a0 = U(Y.getObjectByName("下输送台板-2")))), z || console.warn("[useBilletAnimation] 未找到部件: 下输送台板-1"), a0 || console.warn("[useBilletAnimation] 未找到部件: 下输送台板-2"), z && a0) {
|
|
2297
|
+
const M = new w();
|
|
2298
|
+
z.getWorldPosition(M);
|
|
2299
|
+
const b0 = new w();
|
|
2300
|
+
a0.getWorldPosition(b0), $ = new w().copy(M).add(b0).multiplyScalar(0.5), $.y = Math.max(M.y, b0.y) + 0.05;
|
|
2278
2301
|
}
|
|
2279
|
-
let
|
|
2280
|
-
for (const
|
|
2281
|
-
if (
|
|
2302
|
+
let H0 = null;
|
|
2303
|
+
for (const M of P)
|
|
2304
|
+
if (M && (H0 = U(M.getObjectByName("上输送台-3")), H0))
|
|
2282
2305
|
break;
|
|
2283
|
-
if (!
|
|
2284
|
-
const
|
|
2285
|
-
|
|
2306
|
+
if (!H0 && Y && (H0 = U(Y.getObjectByName("上输送台-3"))), H0) {
|
|
2307
|
+
const M = new w();
|
|
2308
|
+
H0.getWorldPosition(M), c0 = new w(M.x, M.y + 0.1, M.z);
|
|
2286
2309
|
} else
|
|
2287
2310
|
console.warn("[useBilletAnimation] 未找到部件: 上输送台-3");
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
f0.getWorldPosition(v), P = new N(v.x, v.y + 0.5, v.z);
|
|
2311
|
+
if (C = W0("轧辊整体-1", n, Y), C) {
|
|
2312
|
+
const M = new w();
|
|
2313
|
+
C.getWorldPosition(M), d0 = new w(M.x, M.y + 0.5, M.z);
|
|
2292
2314
|
} else
|
|
2293
2315
|
console.warn("[useBilletAnimation] 未找到部件: 轧辊整体-1 / 上轧辊000-3");
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
if (v && (h0 = v.getObjectByName("底板-1"), h0))
|
|
2316
|
+
if (J = W0("下轧辊-1", n, Y), J && C) {
|
|
2317
|
+
const M = new w();
|
|
2318
|
+
J.getWorldPosition(M);
|
|
2319
|
+
const b0 = new w();
|
|
2320
|
+
C.getWorldPosition(b0), p0 = new w().copy(M).add(b0).multiplyScalar(0.5), p0.y -= 0.313;
|
|
2321
|
+
} else J || console.warn("[useBilletAnimation] 未找到部件: 下轧辊-1 / 下轧辊000-3");
|
|
2322
|
+
let v0 = null;
|
|
2323
|
+
for (const M of P)
|
|
2324
|
+
if (M && (v0 = U(M.getObjectByName("底板-1")), v0))
|
|
2304
2325
|
break;
|
|
2305
|
-
if (!
|
|
2306
|
-
const
|
|
2307
|
-
|
|
2326
|
+
if (!v0 && Y && (v0 = U(Y.getObjectByName("底板-1"))), v0) {
|
|
2327
|
+
const M = new w();
|
|
2328
|
+
v0.getWorldPosition(M), R0 = M.y;
|
|
2308
2329
|
} else
|
|
2309
2330
|
console.warn("[useBilletAnimation] 未找到部件: 底板-1");
|
|
2310
|
-
const
|
|
2311
|
-
if (!
|
|
2331
|
+
const ue = l.parent;
|
|
2332
|
+
if (!ue)
|
|
2312
2333
|
return console.warn("[useBilletAnimation] 坯料没有父节点 (机器人-2 应作为父节点)"), !1;
|
|
2313
|
-
|
|
2314
|
-
const
|
|
2334
|
+
T.length = 0;
|
|
2335
|
+
const Qe = [
|
|
2315
2336
|
"Crab_Finger_Right-1",
|
|
2316
2337
|
"Crab_Finger_Right-2",
|
|
2317
2338
|
"Crab_Finger_Right-3",
|
|
2318
2339
|
"Crab_Finger_Right-4"
|
|
2319
|
-
],
|
|
2320
|
-
for (const
|
|
2321
|
-
const
|
|
2322
|
-
|
|
2340
|
+
], Je = l.position.y;
|
|
2341
|
+
for (const M of Qe) {
|
|
2342
|
+
const b0 = ue.getObjectByName(M);
|
|
2343
|
+
b0 ? T.push({ obj: b0, origQuat: b0.quaternion.clone(), direction: b0.position.y > Je ? 1 : -1 }) : console.warn(`[useBilletAnimation] 未找到手指部件: ${M}`);
|
|
2323
2344
|
}
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
if (
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
}
|
|
2334
|
-
function
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
const M = new N();
|
|
2340
|
-
A.getWorldScale(M), A.parent && A.removeFromParent(), x.add(A), A.position.copy(D), A.quaternion.copy(V), A.scale.copy(M);
|
|
2341
|
-
}
|
|
2342
|
-
function d0(V) {
|
|
2343
|
-
for (const M of c0) {
|
|
2344
|
-
M.obj.quaternion.copy(M.origQuat);
|
|
2345
|
-
const W = new u0().setFromAxisAngle(new N(1, 0, 0), w * V * M.direction);
|
|
2346
|
-
M.obj.quaternion.premultiply(W);
|
|
2345
|
+
return T.length === 0 ? (console.warn("[useBilletAnimation] 未找到任何 Crab_Finger_Right-* 手指部件"), !1) : !0;
|
|
2346
|
+
}
|
|
2347
|
+
function te() {
|
|
2348
|
+
if (!l || !Y) return;
|
|
2349
|
+
l.getWorldPosition(R);
|
|
2350
|
+
const P = new n0();
|
|
2351
|
+
l.getWorldQuaternion(P);
|
|
2352
|
+
const j = new w();
|
|
2353
|
+
l.getWorldScale(j), l.parent && l.removeFromParent(), Y.add(l), l.position.copy(R), l.quaternion.copy(P), l.scale.copy(j);
|
|
2354
|
+
}
|
|
2355
|
+
function x0(P) {
|
|
2356
|
+
for (const j of T) {
|
|
2357
|
+
j.obj.quaternion.copy(j.origQuat);
|
|
2358
|
+
const U = new n0().setFromAxisAngle(new w(1, 0, 0), p * P * j.direction);
|
|
2359
|
+
j.obj.quaternion.premultiply(U);
|
|
2347
2360
|
}
|
|
2348
2361
|
}
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2362
|
+
const P0 = new w(), B0 = new w(), F0 = new w(), N0 = new w(), D0 = new w(), ne = new w(0.43, 0.7, 0.45), de = new w(0.785, -0.325, 0.2), q0 = new w(0.43, 0.7, 0.45), oe = new w(0.785, -0.325, 0.2);
|
|
2363
|
+
let ke = !1, se = !1;
|
|
2364
|
+
function ze() {
|
|
2365
|
+
i.value || Se() && (o0 = l.parent, w0.copy(l.position), m0.copy(l.quaternion), i.value = !0, v = "opening", m = 0, ke = !W || !Q, se = !C || !p0, E = (P) => {
|
|
2366
|
+
if (!(!i.value || !l))
|
|
2367
|
+
switch (m += P, v) {
|
|
2368
|
+
// ========== 手指张开 ==========
|
|
2353
2369
|
case "opening": {
|
|
2354
|
-
const
|
|
2355
|
-
|
|
2370
|
+
const j = Math.min(m / H, 1);
|
|
2371
|
+
x0(r0(j)), j >= 1 && (te(), v = ke ? "toRollGap" : "toMill1UpperGap", m = 0);
|
|
2372
|
+
break;
|
|
2373
|
+
}
|
|
2374
|
+
// ========== 第一轧机:空隙姿态驱动流程 ==========
|
|
2375
|
+
// --- 1. 到第一轧机上辊空隙 ---
|
|
2376
|
+
case "toMill1UpperGap": {
|
|
2377
|
+
i0(W, ne, P0);
|
|
2378
|
+
const j = Math.min(m / x, 1);
|
|
2379
|
+
l.position.lerpVectors(R, P0, r0(j)), j >= 1 && (v = "ridingMill1UpperGap", m = 0);
|
|
2356
2380
|
break;
|
|
2357
2381
|
}
|
|
2382
|
+
// --- 2. 随第一轧机上辊空隙转动,等待w达到0.07 ---
|
|
2383
|
+
case "ridingMill1UpperGap": {
|
|
2384
|
+
i0(W, ne, P0), l.position.copy(P0), X(W, y) && (v = "fallToMill1LowerGap", m = 0, R.copy(l.position));
|
|
2385
|
+
break;
|
|
2386
|
+
}
|
|
2387
|
+
// --- 3. 落入第一轧机下辊空隙 ---
|
|
2388
|
+
case "fallToMill1LowerGap": {
|
|
2389
|
+
i0(Q, de, B0);
|
|
2390
|
+
const j = Math.min(m / O, 1);
|
|
2391
|
+
l.position.lerpVectors(R, B0, r0(j)), j >= 1 && (v = "ridingMill1LowerGap", m = 0);
|
|
2392
|
+
break;
|
|
2393
|
+
}
|
|
2394
|
+
// --- 4. 随第一轧机下辊空隙转动,等待w达到0.97后送出 ---
|
|
2395
|
+
case "ridingMill1LowerGap": {
|
|
2396
|
+
i0(Q, de, B0), l.position.copy(B0), m >= K && X(Q, F) && (R.copy(l.position), v = "exitMill1LowerGap", m = 0);
|
|
2397
|
+
break;
|
|
2398
|
+
}
|
|
2399
|
+
// --- 5. 随第一轧机下辊送出(平滑移向输送台方向) ---
|
|
2400
|
+
case "exitMill1LowerGap": {
|
|
2401
|
+
if ($) {
|
|
2402
|
+
const U = new w().subVectors($, R).normalize();
|
|
2403
|
+
D0.copy(R).addScaledVector(U, 0.6);
|
|
2404
|
+
} else
|
|
2405
|
+
D0.copy(R);
|
|
2406
|
+
const j = Math.min(m / _, 1);
|
|
2407
|
+
l.position.lerpVectors(R, D0, r0(j)), j >= 1 && (R.copy(D0), q.copy($ ?? D0), v = "toConveyor", m = 0);
|
|
2408
|
+
break;
|
|
2409
|
+
}
|
|
2410
|
+
// ========== 第一轧机:Fallback旧流程 ==========
|
|
2411
|
+
// --- fallback: 到两辊中点 ---
|
|
2358
2412
|
case "toRollGap": {
|
|
2359
|
-
const
|
|
2360
|
-
|
|
2413
|
+
const j = M0(W, Q), U = Math.min(m / 1, 1);
|
|
2414
|
+
l.position.lerpVectors(R, j, r0(U)), U >= 1 && (l.position.copy(j), v = "rolling", m = 0);
|
|
2361
2415
|
break;
|
|
2362
2416
|
}
|
|
2417
|
+
// --- fallback: 原地滚动5s ---
|
|
2363
2418
|
case "rolling": {
|
|
2364
|
-
|
|
2419
|
+
if (l.rotation.z += P * 3, m >= 5)
|
|
2420
|
+
if (l.rotation.z = 0, v = "toConveyor", m = 0, $)
|
|
2421
|
+
q.copy($);
|
|
2422
|
+
else {
|
|
2423
|
+
const j = M0(W, Q);
|
|
2424
|
+
q.copy(j);
|
|
2425
|
+
}
|
|
2365
2426
|
break;
|
|
2366
2427
|
}
|
|
2367
|
-
//
|
|
2428
|
+
// ========== 输送台阶段 ==========
|
|
2429
|
+
// --- 胚料向输送台移动 ---
|
|
2368
2430
|
case "toConveyor": {
|
|
2369
|
-
const
|
|
2370
|
-
|
|
2431
|
+
const j = Math.min(m / f, 1);
|
|
2432
|
+
l.position.lerpVectors(R, q, r0(j)), $ && l.position.y <= $.y + 0.1 && (l.position.copy(q), v = "conveyorWait", m = 0), m >= f && (l.position.copy(q), v = "conveyorWait", m = 0);
|
|
2371
2433
|
break;
|
|
2372
2434
|
}
|
|
2373
|
-
// ---
|
|
2435
|
+
// --- 等待夹具到达下输送台接料点 ---
|
|
2374
2436
|
case "conveyorWait": {
|
|
2375
|
-
if (
|
|
2376
|
-
|
|
2437
|
+
if (!$) {
|
|
2438
|
+
v = "upperWait", m = 0;
|
|
2377
2439
|
break;
|
|
2378
2440
|
}
|
|
2379
|
-
const
|
|
2380
|
-
let
|
|
2381
|
-
for (const a0 of
|
|
2441
|
+
const j = ["夹具5倍-1", "夹具5倍-2", "夹具5倍-3", "夹具5倍-5"];
|
|
2442
|
+
let U = "", z = 1 / 0;
|
|
2443
|
+
for (const a0 of j)
|
|
2382
2444
|
if (b && b(a0, G)) {
|
|
2383
|
-
const
|
|
2384
|
-
|
|
2445
|
+
const H0 = G.distanceTo($);
|
|
2446
|
+
H0 < d && H0 < z && (z = H0, U = a0);
|
|
2385
2447
|
}
|
|
2386
|
-
|
|
2448
|
+
U && (L = U, v = "liftToClamp", m = 0), m >= k && (v = "upperWait", m = 0);
|
|
2387
2449
|
break;
|
|
2388
2450
|
}
|
|
2389
|
-
// ---
|
|
2451
|
+
// --- 胚料升到夹具上方 ---
|
|
2390
2452
|
case "liftToClamp": {
|
|
2391
|
-
const
|
|
2392
|
-
b(
|
|
2453
|
+
const j = Math.min(m / c, 1);
|
|
2454
|
+
b(L, G), G.y += 0.2, G.z += t, l.position.lerpVectors($, G, r0(j)), j >= 1 && (l.position.copy(G), v = "ridingChain", m = 0);
|
|
2393
2455
|
break;
|
|
2394
2456
|
}
|
|
2395
|
-
// ---
|
|
2457
|
+
// --- 跟随夹具随链条滚动 ---
|
|
2396
2458
|
case "ridingChain": {
|
|
2397
|
-
if (!b || !b(
|
|
2398
|
-
|
|
2459
|
+
if (!b || !b(L, G)) {
|
|
2460
|
+
c0 && l.position.copy(c0), v = "upperWait", m = 0;
|
|
2399
2461
|
break;
|
|
2400
2462
|
}
|
|
2401
|
-
G.y += 0.2, G.z +=
|
|
2463
|
+
G.y += 0.2, G.z += t, l.position.copy(G), c0 && G.y >= c0.y - o && (l.position.copy(c0), v = "upperWait", m = 0), m >= 60 && (c0 && l.position.copy(c0), v = "upperWait", m = 0);
|
|
2402
2464
|
break;
|
|
2403
2465
|
}
|
|
2404
2466
|
// --- 上输送台等待2s ---
|
|
2405
2467
|
case "upperWait": {
|
|
2406
|
-
m >=
|
|
2468
|
+
m >= s && (v = se ? "toMill2RollTop" : "toMill2UpperGap", m = 0);
|
|
2469
|
+
break;
|
|
2470
|
+
}
|
|
2471
|
+
// ========== 第二轧机:空隙姿态驱动流程 ==========
|
|
2472
|
+
// --- 1. 到第二轧机上辊空隙 ---
|
|
2473
|
+
case "toMill2UpperGap": {
|
|
2474
|
+
i0(C, q0, F0);
|
|
2475
|
+
const j = Math.min(m / S, 1);
|
|
2476
|
+
l.position.lerpVectors(c0, F0, r0(j)), j >= 1 && (v = "ridingMill2UpperGap", m = 0);
|
|
2407
2477
|
break;
|
|
2408
2478
|
}
|
|
2409
|
-
// ---
|
|
2479
|
+
// --- 2. 随第二轧机上辊空隙转动,等待w达到0.008 ---
|
|
2480
|
+
case "ridingMill2UpperGap": {
|
|
2481
|
+
i0(C, q0, F0), l.position.copy(F0), X(C, N) && (R.copy(l.position), v = "fallIntoMill2Gap", m = 0);
|
|
2482
|
+
break;
|
|
2483
|
+
}
|
|
2484
|
+
// ========== 第二轧机:Fallback旧流程 ==========
|
|
2485
|
+
// --- fallback: 到轧辊整体-1上表面 ---
|
|
2410
2486
|
case "toMill2RollTop": {
|
|
2411
|
-
|
|
2412
|
-
|
|
2487
|
+
if (!d0) {
|
|
2488
|
+
v = "fallIntoMill2Gap", m = 0;
|
|
2489
|
+
break;
|
|
2490
|
+
}
|
|
2491
|
+
const j = Math.min(m / 1, 1);
|
|
2492
|
+
l.position.lerpVectors(c0, d0, r0(j)), j >= 1 && (l.position.copy(d0), R.copy(d0), v = "fallIntoMill2Gap", m = 0);
|
|
2413
2493
|
break;
|
|
2414
2494
|
}
|
|
2415
|
-
//
|
|
2495
|
+
// ========== 共同阶段 ==========
|
|
2496
|
+
// --- 从轧辊上表面/空隙平滑滑入下辊空隙 ---
|
|
2416
2497
|
case "fallIntoMill2Gap": {
|
|
2417
|
-
|
|
2418
|
-
|
|
2498
|
+
J ? i0(J, oe, N0) : i0(C, q0, N0), i0(C, q0, F0);
|
|
2499
|
+
const j = Math.min(m / u, 1);
|
|
2500
|
+
l.position.lerpVectors(F0, N0, r0(j)), j >= 1 && (R.copy(N0), v = "ridingMill2LowerGap", m = 0);
|
|
2419
2501
|
break;
|
|
2420
2502
|
}
|
|
2421
|
-
// ---
|
|
2422
|
-
case "
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
))
|
|
2503
|
+
// --- 6. 随第二轧机下辊空隙转动,等待w达到0.97后送出 ---
|
|
2504
|
+
case "ridingMill2LowerGap": {
|
|
2505
|
+
J ? (i0(J, oe, N0), l.position.copy(N0), m >= K && X(J, B) && (R.copy(l.position), q.set(
|
|
2506
|
+
l.position.x + 3,
|
|
2507
|
+
R0,
|
|
2508
|
+
l.position.z
|
|
2509
|
+
), v = "fallToGround", m = 0)) : m >= 2 && (R.copy(l.position), q.set(
|
|
2510
|
+
l.position.x + 3,
|
|
2511
|
+
R0,
|
|
2512
|
+
l.position.z
|
|
2513
|
+
), v = "fallToGround", m = 0);
|
|
2428
2514
|
break;
|
|
2429
2515
|
}
|
|
2430
2516
|
// --- 掉落地面 ---
|
|
2431
2517
|
case "fallToGround": {
|
|
2432
|
-
const
|
|
2433
|
-
|
|
2518
|
+
const j = Math.min(m / h, 1);
|
|
2519
|
+
l.position.lerpVectors(R, q, r0(j)), j >= 1 && (l.position.copy(q), v = "groundWait", m = 0);
|
|
2434
2520
|
break;
|
|
2435
2521
|
}
|
|
2436
2522
|
// --- 地面停留3s ---
|
|
2437
2523
|
case "groundWait": {
|
|
2438
|
-
m >=
|
|
2524
|
+
m >= I && (v = "resetting", m = 0, te(), o0 && (o0.updateMatrixWorld(!0), q.copy(w0), o0.localToWorld(q)));
|
|
2439
2525
|
break;
|
|
2440
2526
|
}
|
|
2527
|
+
// --- 回到手掌 ---
|
|
2441
2528
|
case "resetting": {
|
|
2442
|
-
const
|
|
2443
|
-
|
|
2529
|
+
const j = Math.min(m / A, 1);
|
|
2530
|
+
l.position.lerpVectors(R, q, r0(j)), j >= 1 && (l.removeFromParent(), o0 == null || o0.add(l), l.position.copy(w0), l.quaternion.copy(m0), v = "closing", m = 0);
|
|
2444
2531
|
break;
|
|
2445
2532
|
}
|
|
2533
|
+
// --- 手指闭合 ---
|
|
2446
2534
|
case "closing": {
|
|
2447
|
-
const
|
|
2448
|
-
|
|
2535
|
+
const j = Math.min(m / g, 1);
|
|
2536
|
+
x0(1 - r0(j)), j >= 1 && (x0(0), v = "opening", m = 0);
|
|
2449
2537
|
break;
|
|
2450
2538
|
}
|
|
2451
2539
|
}
|
|
2452
|
-
}, e(
|
|
2540
|
+
}, e(E));
|
|
2453
2541
|
}
|
|
2454
|
-
function
|
|
2455
|
-
i.value = !1,
|
|
2542
|
+
function le() {
|
|
2543
|
+
i.value = !1, E && (a(E), E = null), v = "idle", x0(0), T.length = 0, o0 = null;
|
|
2456
2544
|
}
|
|
2457
|
-
function
|
|
2458
|
-
|
|
2545
|
+
function Ze() {
|
|
2546
|
+
le(), l = null, W = null, Q = null, C = null, J = null, Y = null;
|
|
2459
2547
|
}
|
|
2460
|
-
return { isBilletAnimating: i, startBilletDelivery:
|
|
2548
|
+
return { isBilletAnimating: i, startBilletDelivery: ze, stopBilletDelivery: le, dispose: Ze };
|
|
2461
2549
|
}
|
|
2462
|
-
function
|
|
2463
|
-
const r =
|
|
2550
|
+
function Pa(n, e, a) {
|
|
2551
|
+
const r = u0(!1);
|
|
2464
2552
|
let b = [], i = [], H = null, f = 0;
|
|
2465
2553
|
const c = 6;
|
|
2466
2554
|
let t = null;
|
|
2467
|
-
const
|
|
2555
|
+
const d = new n0(), o = new w(), k = new w(), s = new w(), u = new w();
|
|
2468
2556
|
function _() {
|
|
2469
|
-
const
|
|
2470
|
-
if (!
|
|
2471
|
-
for (const
|
|
2472
|
-
|
|
2473
|
-
for (const
|
|
2474
|
-
if (
|
|
2557
|
+
const y = n.value;
|
|
2558
|
+
if (!y || y.length === 0) return !1;
|
|
2559
|
+
for (const O of y)
|
|
2560
|
+
O && O.updateMatrixWorld(!0);
|
|
2561
|
+
for (const O of y)
|
|
2562
|
+
if (O && (H = O.getObjectByName("整体1-6"), H))
|
|
2475
2563
|
break;
|
|
2476
2564
|
if (!H) return !1;
|
|
2477
|
-
const F = H.getObjectByName("链条5倍-1"),
|
|
2478
|
-
if (!F || !
|
|
2479
|
-
const
|
|
2565
|
+
const F = H.getObjectByName("链条5倍-1"), N = H.getObjectByName("链条5倍-2");
|
|
2566
|
+
if (!F || !N) return !1;
|
|
2567
|
+
const B = [F, N];
|
|
2480
2568
|
b = [];
|
|
2481
|
-
for (const
|
|
2482
|
-
const
|
|
2483
|
-
if (
|
|
2484
|
-
|
|
2485
|
-
}),
|
|
2486
|
-
const
|
|
2487
|
-
if (
|
|
2488
|
-
|
|
2489
|
-
}),
|
|
2490
|
-
const
|
|
2491
|
-
|
|
2492
|
-
const
|
|
2493
|
-
return (
|
|
2569
|
+
for (const O of B) {
|
|
2570
|
+
const x = [];
|
|
2571
|
+
if (O.children.forEach((R) => {
|
|
2572
|
+
R.name.startsWith("链节5倍") && x.push(R);
|
|
2573
|
+
}), x.length === 0) return !1;
|
|
2574
|
+
const S = [];
|
|
2575
|
+
if (O.children.forEach((R) => {
|
|
2576
|
+
R.name.includes("主动链轮10倍") && S.push(R.position.clone());
|
|
2577
|
+
}), S.length < 2) return !1;
|
|
2578
|
+
const K = new w().addVectors(S[0], S[1]).multiplyScalar(0.5);
|
|
2579
|
+
x.sort((R, q) => {
|
|
2580
|
+
const l = Math.atan2(R.position.y - K.y, R.position.x - K.x), W = Math.atan2(q.position.y - K.y, q.position.x - K.x);
|
|
2581
|
+
return (l < 0 ? l + 2 * Math.PI : l) - (W < 0 ? W + 2 * Math.PI : W);
|
|
2494
2582
|
});
|
|
2495
|
-
const
|
|
2496
|
-
b.push({ group:
|
|
2583
|
+
const v = x.map((R) => R.position.clone()), m = x.map((R) => R.quaternion.clone());
|
|
2584
|
+
b.push({ group: O, links: x, origPositions: v, origQuaternions: m });
|
|
2497
2585
|
}
|
|
2498
2586
|
i = [];
|
|
2499
|
-
const
|
|
2500
|
-
for (const
|
|
2501
|
-
const
|
|
2502
|
-
if (!
|
|
2503
|
-
const
|
|
2504
|
-
|
|
2505
|
-
let
|
|
2587
|
+
const V = ["夹具5倍-1", "夹具5倍-2", "夹具5倍-3", "夹具5倍-5"];
|
|
2588
|
+
for (const O of V) {
|
|
2589
|
+
const x = H.getObjectByName(O);
|
|
2590
|
+
if (!x) continue;
|
|
2591
|
+
const S = new w();
|
|
2592
|
+
x.getWorldPosition(S);
|
|
2593
|
+
let K = -1, v = -1, m = 1 / 0, R = new w();
|
|
2506
2594
|
for (let q = 0; q < b.length; q++) {
|
|
2507
|
-
const
|
|
2508
|
-
|
|
2509
|
-
for (let
|
|
2510
|
-
const
|
|
2511
|
-
|
|
2595
|
+
const l = b[q], W = new w();
|
|
2596
|
+
l.group.worldToLocal(W.copy(S));
|
|
2597
|
+
for (let Q = 0; Q < l.links.length; Q++) {
|
|
2598
|
+
const C = l.origPositions[Q], J = W.distanceTo(C);
|
|
2599
|
+
J < m && (m = J, K = q, v = Q, R = new w().subVectors(W, C));
|
|
2512
2600
|
}
|
|
2513
2601
|
}
|
|
2514
|
-
|
|
2515
|
-
object:
|
|
2516
|
-
chainIdx:
|
|
2517
|
-
linkIdx:
|
|
2518
|
-
localOffset:
|
|
2519
|
-
origPosition:
|
|
2520
|
-
origQuaternion:
|
|
2602
|
+
K >= 0 && i.push({
|
|
2603
|
+
object: x,
|
|
2604
|
+
chainIdx: K,
|
|
2605
|
+
linkIdx: v,
|
|
2606
|
+
localOffset: R,
|
|
2607
|
+
origPosition: x.position.clone(),
|
|
2608
|
+
origQuaternion: x.quaternion.clone()
|
|
2521
2609
|
});
|
|
2522
2610
|
}
|
|
2523
2611
|
return !0;
|
|
2524
2612
|
}
|
|
2525
|
-
function
|
|
2526
|
-
r.value || _() && (r.value = !0, f = 0, t = (
|
|
2613
|
+
function h() {
|
|
2614
|
+
r.value || _() && (r.value = !0, f = 0, t = (y) => {
|
|
2527
2615
|
if (r.value) {
|
|
2528
|
-
f += c *
|
|
2616
|
+
f += c * y;
|
|
2529
2617
|
for (const F of b) {
|
|
2530
|
-
const
|
|
2531
|
-
for (let
|
|
2532
|
-
const
|
|
2533
|
-
|
|
2534
|
-
F.origPositions[
|
|
2535
|
-
F.origPositions[
|
|
2536
|
-
|
|
2537
|
-
),
|
|
2538
|
-
F.origQuaternions[
|
|
2539
|
-
F.origQuaternions[
|
|
2540
|
-
|
|
2541
|
-
),
|
|
2618
|
+
const N = F.links.length, B = Math.floor(f), V = f - B;
|
|
2619
|
+
for (let O = 0; O < N; O++) {
|
|
2620
|
+
const x = ((O + B) % N + N) % N, S = ((O + B + 1) % N + N) % N, K = F.links[O];
|
|
2621
|
+
K.position.lerpVectors(
|
|
2622
|
+
F.origPositions[x],
|
|
2623
|
+
F.origPositions[S],
|
|
2624
|
+
V
|
|
2625
|
+
), d.slerpQuaternions(
|
|
2626
|
+
F.origQuaternions[x],
|
|
2627
|
+
F.origQuaternions[S],
|
|
2628
|
+
V
|
|
2629
|
+
), K.quaternion.copy(d);
|
|
2542
2630
|
}
|
|
2543
2631
|
}
|
|
2544
2632
|
for (const F of i) {
|
|
2545
|
-
const
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
), k.copy(
|
|
2633
|
+
const N = b[F.chainIdx], B = N.links.length, V = Math.floor(f), O = f - V, x = ((F.linkIdx + V) % B + B) % B, S = ((F.linkIdx + V + 1) % B + B) % B;
|
|
2634
|
+
o.lerpVectors(
|
|
2635
|
+
N.origPositions[x],
|
|
2636
|
+
N.origPositions[S],
|
|
2637
|
+
O
|
|
2638
|
+
), k.copy(o).add(F.localOffset), N.group.localToWorld(s.copy(k)), H.worldToLocal(u.copy(s)), F.object.position.copy(u);
|
|
2551
2639
|
}
|
|
2552
2640
|
}
|
|
2553
2641
|
}, e(t));
|
|
2554
2642
|
}
|
|
2555
|
-
function
|
|
2643
|
+
function I() {
|
|
2556
2644
|
r.value = !1, t && (a(t), t = null);
|
|
2557
|
-
for (const
|
|
2558
|
-
|
|
2559
|
-
F.position.copy(
|
|
2645
|
+
for (const y of b)
|
|
2646
|
+
y.links.forEach((F, N) => {
|
|
2647
|
+
F.position.copy(y.origPositions[N]), F.quaternion.copy(y.origQuaternions[N]);
|
|
2560
2648
|
});
|
|
2561
|
-
for (const
|
|
2562
|
-
|
|
2649
|
+
for (const y of i)
|
|
2650
|
+
y.object.position.copy(y.origPosition), y.object.quaternion.copy(y.origQuaternion);
|
|
2563
2651
|
}
|
|
2564
|
-
function
|
|
2565
|
-
|
|
2652
|
+
function A() {
|
|
2653
|
+
I(), b = [], i = [];
|
|
2566
2654
|
}
|
|
2567
|
-
function g(
|
|
2568
|
-
const
|
|
2569
|
-
return
|
|
2655
|
+
function g(y, F) {
|
|
2656
|
+
const N = i.find((B) => B.object.name === y);
|
|
2657
|
+
return N ? (N.object.getWorldPosition(F), !0) : !1;
|
|
2570
2658
|
}
|
|
2571
2659
|
function p() {
|
|
2572
|
-
return i.map((
|
|
2660
|
+
return i.map((y) => y.object.name);
|
|
2573
2661
|
}
|
|
2574
|
-
return { isChainAnimating: r, startChainAnimation:
|
|
2662
|
+
return { isChainAnimating: r, startChainAnimation: h, stopChainAnimation: I, dispose: A, getClampWorldPosition: g, getClampNames: p };
|
|
2575
2663
|
}
|
|
2576
|
-
const
|
|
2577
|
-
function
|
|
2664
|
+
const Ba = 16776960, re = "pickHighlightRoot", Me = "partType";
|
|
2665
|
+
function qa() {
|
|
2666
|
+
return {
|
|
2667
|
+
raycaster: new q2(),
|
|
2668
|
+
mouse: new fe(),
|
|
2669
|
+
lastMeshes: /* @__PURE__ */ new Set(),
|
|
2670
|
+
originalEmissive: /* @__PURE__ */ new Map()
|
|
2671
|
+
};
|
|
2672
|
+
}
|
|
2673
|
+
function Va(n, e) {
|
|
2578
2674
|
const a = [...e];
|
|
2579
|
-
return
|
|
2675
|
+
return n.traverse((r) => {
|
|
2580
2676
|
r.type === "Group" && r.name.endsWith("-pivot") && a.push(r);
|
|
2581
2677
|
}), a;
|
|
2582
2678
|
}
|
|
2583
|
-
function
|
|
2679
|
+
function Wa(n, e) {
|
|
2584
2680
|
var b, i;
|
|
2585
|
-
const a = e.originalEmissive.get(
|
|
2681
|
+
const a = e.originalEmissive.get(n), r = n.material;
|
|
2586
2682
|
a ? (b = r.emissive) == null || b.copy(a) : (i = r.emissive) == null || i.setHex(0);
|
|
2587
2683
|
}
|
|
2588
|
-
function
|
|
2589
|
-
const e =
|
|
2684
|
+
function Ca(n) {
|
|
2685
|
+
const e = n.userData[re];
|
|
2590
2686
|
if (e && e.isObject3D) return e;
|
|
2591
|
-
let a =
|
|
2687
|
+
let a = n.parent;
|
|
2592
2688
|
for (; a; ) {
|
|
2593
|
-
const r = a.userData[
|
|
2689
|
+
const r = a.userData[re];
|
|
2594
2690
|
if (r && r.isObject3D) return r;
|
|
2595
2691
|
if (a.name && a.name.includes("联轴器")) return a;
|
|
2596
2692
|
a = a.parent;
|
|
2597
2693
|
}
|
|
2598
2694
|
return null;
|
|
2599
2695
|
}
|
|
2600
|
-
function
|
|
2696
|
+
function La(n) {
|
|
2601
2697
|
const e = [];
|
|
2602
|
-
return
|
|
2698
|
+
return n.traverse((a) => {
|
|
2603
2699
|
a.isMesh && e.push(a);
|
|
2604
2700
|
}), e;
|
|
2605
2701
|
}
|
|
2606
|
-
function
|
|
2607
|
-
const e =
|
|
2702
|
+
function Sa(n) {
|
|
2703
|
+
const e = Ca(n);
|
|
2608
2704
|
if (e) {
|
|
2609
|
-
const a =
|
|
2705
|
+
const a = La(e);
|
|
2610
2706
|
if (a.length > 0) return a;
|
|
2611
2707
|
}
|
|
2612
|
-
return [
|
|
2708
|
+
return [n];
|
|
2613
2709
|
}
|
|
2614
|
-
function
|
|
2615
|
-
|
|
2710
|
+
function ce(n) {
|
|
2711
|
+
n.lastMeshes.forEach((e) => Wa(e, n)), n.lastMeshes.clear();
|
|
2616
2712
|
}
|
|
2617
|
-
function
|
|
2713
|
+
function za(n, e, a, r, b, i, H = {}) {
|
|
2618
2714
|
var k, s;
|
|
2619
2715
|
const f = e.getBoundingClientRect();
|
|
2620
|
-
i.mouse.x = (
|
|
2621
|
-
const c =
|
|
2716
|
+
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);
|
|
2717
|
+
const c = Va(r, b), t = i.raycaster.intersectObjects(c, !0);
|
|
2622
2718
|
if (t.length === 0) {
|
|
2623
|
-
i.lastMeshes.size > 0 &&
|
|
2719
|
+
i.lastMeshes.size > 0 && ce(i), (k = H.onMiss) == null || k.call(H);
|
|
2624
2720
|
return;
|
|
2625
2721
|
}
|
|
2626
|
-
const
|
|
2627
|
-
|
|
2628
|
-
var
|
|
2722
|
+
const d = t[0].object, o = Sa(d);
|
|
2723
|
+
ce(i), o.forEach((u) => {
|
|
2724
|
+
var h, I;
|
|
2629
2725
|
const _ = u.material;
|
|
2630
|
-
i.originalEmissive.has(u) || i.originalEmissive.set(u, ((
|
|
2631
|
-
}), (s = H.onHit) == null || s.call(H,
|
|
2726
|
+
i.originalEmissive.has(u) || i.originalEmissive.set(u, ((h = _.emissive) == null ? void 0 : h.clone()) ?? new h0(0)), u.material = _.clone(), (I = u.material.emissive) == null || I.setHex(Ba), i.lastMeshes.add(u);
|
|
2727
|
+
}), (s = H.onHit) == null || s.call(H, d);
|
|
2728
|
+
}
|
|
2729
|
+
function Za(n) {
|
|
2730
|
+
n.lastMeshes.size > 0 && ce(n), n.originalEmissive.clear();
|
|
2731
|
+
}
|
|
2732
|
+
function Qa(n) {
|
|
2733
|
+
var r;
|
|
2734
|
+
if (n.lastMeshes.size === 0) return null;
|
|
2735
|
+
const a = !(((r = n.lastMeshes.values().next().value) == null ? void 0 : r.visible) ?? !0);
|
|
2736
|
+
return n.lastMeshes.forEach((b) => {
|
|
2737
|
+
b.visible = a;
|
|
2738
|
+
}), a;
|
|
2632
2739
|
}
|
|
2633
|
-
const
|
|
2740
|
+
const Ja = {
|
|
2634
2741
|
"联轴器下-1001": ["联轴器下-1001", "联轴器下-2001"],
|
|
2635
2742
|
"下轧辊-1001": ["下轧辊-1001", "下轧辊000-1"],
|
|
2636
2743
|
"轧辊整体-1001": ["轧辊整体-1001", "上轧辊000-1"],
|
|
@@ -2638,8 +2745,8 @@ const ya = {
|
|
|
2638
2745
|
"轧辊整体-1": ["轧辊整体-1", "上轧辊000-3"],
|
|
2639
2746
|
"联轴器下-1": ["联轴器下-1", "联轴器下-2"]
|
|
2640
2747
|
};
|
|
2641
|
-
function
|
|
2642
|
-
const a =
|
|
2748
|
+
function De(n, e) {
|
|
2749
|
+
const a = Ja[n] ?? [n];
|
|
2643
2750
|
for (const r of e.value)
|
|
2644
2751
|
if (r)
|
|
2645
2752
|
for (const b of a) {
|
|
@@ -2648,39 +2755,39 @@ function ne(o, e) {
|
|
|
2648
2755
|
}
|
|
2649
2756
|
return null;
|
|
2650
2757
|
}
|
|
2651
|
-
function
|
|
2652
|
-
|
|
2653
|
-
a.userData[
|
|
2758
|
+
function Oe(n, e) {
|
|
2759
|
+
n.userData[Me] = e, n.traverse((a) => {
|
|
2760
|
+
a.userData[re] = n, a.userData[Me] = e;
|
|
2654
2761
|
});
|
|
2655
2762
|
}
|
|
2656
|
-
function
|
|
2657
|
-
if (
|
|
2658
|
-
|
|
2659
|
-
const a = new
|
|
2660
|
-
|
|
2661
|
-
const i = new
|
|
2662
|
-
e.getWorldPosition(i),
|
|
2763
|
+
function Ya(n, e) {
|
|
2764
|
+
if (n.parent === e) return;
|
|
2765
|
+
n.updateMatrixWorld(!0), e.updateMatrixWorld(!0);
|
|
2766
|
+
const a = new w(), r = new n0(), b = new w();
|
|
2767
|
+
n.getWorldPosition(a), n.getWorldQuaternion(r), n.getWorldScale(b);
|
|
2768
|
+
const i = new w();
|
|
2769
|
+
e.getWorldPosition(i), n.parent && n.parent.remove(n), e.add(n), n.position.copy(a).sub(i), n.quaternion.copy(r), n.scale.copy(b), n.updateMatrixWorld(!0), e.updateMatrixWorld(!0);
|
|
2663
2770
|
}
|
|
2664
|
-
function
|
|
2665
|
-
const b =
|
|
2771
|
+
function Ka(n, e, a, r) {
|
|
2772
|
+
const b = De(e, r);
|
|
2666
2773
|
if (!b)
|
|
2667
2774
|
return console.warn(`[useMillPivotAnimation] 未找到参考件: ${e}`), null;
|
|
2668
|
-
const i = new
|
|
2775
|
+
const i = new w();
|
|
2669
2776
|
b.getWorldPosition(i);
|
|
2670
|
-
const H = new
|
|
2671
|
-
H.name = `${e}-pivot`, H.position.copy(i),
|
|
2777
|
+
const H = new C0();
|
|
2778
|
+
H.name = `${e}-pivot`, H.position.copy(i), n.add(H), H.updateMatrixWorld(!0), Oe(b, "coupling");
|
|
2672
2779
|
const f = /* @__PURE__ */ new Map();
|
|
2673
2780
|
for (const c of a) {
|
|
2674
|
-
const t =
|
|
2781
|
+
const t = De(c, r);
|
|
2675
2782
|
if (!t) {
|
|
2676
2783
|
console.warn(`[useMillPivotAnimation] 未找到部件: ${c}`);
|
|
2677
2784
|
continue;
|
|
2678
2785
|
}
|
|
2679
|
-
|
|
2786
|
+
Ya(t, H), Oe(t, "roll"), f.set(c, t);
|
|
2680
2787
|
}
|
|
2681
2788
|
return { pivot: H, partMap: f };
|
|
2682
2789
|
}
|
|
2683
|
-
function
|
|
2790
|
+
function Xa(n, e, a, r) {
|
|
2684
2791
|
const i = [
|
|
2685
2792
|
{ ref: "联轴器上-1001", parts: ["轧辊整体-1001", "联轴器上-1001"] },
|
|
2686
2793
|
{ ref: "联轴器下-1001", parts: ["下轧辊-1001", "联轴器下-1001"] },
|
|
@@ -2688,8 +2795,8 @@ function Na(o, e, a, r) {
|
|
|
2688
2795
|
{ ref: "联轴器下-1", parts: ["下轧辊-1", "联轴器下-1"] }
|
|
2689
2796
|
];
|
|
2690
2797
|
function H(c, t) {
|
|
2691
|
-
const
|
|
2692
|
-
|
|
2798
|
+
const d = t.get(c.partName);
|
|
2799
|
+
d ? r(c.partName, d.obj, d.pivot, c) : a(c.partName, c);
|
|
2693
2800
|
}
|
|
2694
2801
|
function f() {
|
|
2695
2802
|
const { scene: c } = e();
|
|
@@ -2699,220 +2806,286 @@ function Na(o, e, a, r) {
|
|
|
2699
2806
|
}
|
|
2700
2807
|
const t = /* @__PURE__ */ new Map();
|
|
2701
2808
|
for (const k of i) {
|
|
2702
|
-
const s =
|
|
2809
|
+
const s = Ka(c, k.ref, k.parts, n);
|
|
2703
2810
|
s && s.partMap.forEach((u, _) => {
|
|
2704
2811
|
t.set(_, { pivot: s.pivot, obj: u });
|
|
2705
2812
|
});
|
|
2706
2813
|
}
|
|
2707
|
-
const
|
|
2814
|
+
const d = [
|
|
2708
2815
|
{ partName: "轧辊整体-1001", axis: "z", speed: 0.8, direction: 1 },
|
|
2709
2816
|
{ partName: "联轴器上-1001", axis: "z", speed: 0.8, direction: 1 },
|
|
2710
2817
|
{ partName: "下轧辊-1001", axis: "z", speed: 0.8, direction: -1 },
|
|
2711
2818
|
{ partName: "联轴器下-1001", axis: "z", speed: 0.8, direction: -1 }
|
|
2712
|
-
],
|
|
2819
|
+
], o = [
|
|
2713
2820
|
{ partName: "轧辊整体-1", axis: "z", speed: 0.8, direction: 1 },
|
|
2714
2821
|
{ partName: "联轴器上-1", axis: "z", speed: 0.8, direction: 1 },
|
|
2715
2822
|
{ partName: "下轧辊-1", axis: "z", speed: 0.8, direction: -1 },
|
|
2716
2823
|
{ partName: "联轴器下-1", axis: "z", speed: 0.8, direction: -1 }
|
|
2717
2824
|
];
|
|
2718
|
-
|
|
2825
|
+
d.forEach((k) => H(k, t)), o.forEach((k) => H(k, t));
|
|
2719
2826
|
}
|
|
2720
2827
|
return { setupMillAnimations: f };
|
|
2721
2828
|
}
|
|
2722
|
-
const
|
|
2829
|
+
const $a = { class: "obj-viewer-container" }, eb = { class: "buttonGroup-topLeft" }, ab = { class: "buttonGroup-left" }, bb = { class: "buttonGroup-right" }, ib = { class: "buttonGroup-bottom" }, Hb = { class: "left-panel" }, rb = { class: "panel-header" }, cb = {
|
|
2723
2830
|
key: 0,
|
|
2724
2831
|
class: "loading-overlay"
|
|
2725
|
-
},
|
|
2832
|
+
}, fb = !0, tb = /* @__PURE__ */ Ke({
|
|
2726
2833
|
__name: "threePreview",
|
|
2727
2834
|
props: {
|
|
2728
2835
|
fileBlobs: { default: () => [] }
|
|
2729
2836
|
},
|
|
2730
|
-
setup(
|
|
2731
|
-
const
|
|
2732
|
-
let
|
|
2733
|
-
function
|
|
2734
|
-
if (!
|
|
2735
|
-
const { camera:
|
|
2736
|
-
!
|
|
2837
|
+
setup(n) {
|
|
2838
|
+
const a = n, r = u0(null), b = u0(!1), i = u0("");
|
|
2839
|
+
let H = null;
|
|
2840
|
+
function f(T) {
|
|
2841
|
+
if (!H || !r.value) return;
|
|
2842
|
+
const { camera: E, scene: L } = C();
|
|
2843
|
+
!E || !L || za(
|
|
2844
|
+
T,
|
|
2845
|
+
r.value,
|
|
2737
2846
|
E,
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
O.value,
|
|
2742
|
-
i,
|
|
2847
|
+
L,
|
|
2848
|
+
l.value,
|
|
2849
|
+
H,
|
|
2743
2850
|
{
|
|
2744
|
-
onHit: (
|
|
2745
|
-
var
|
|
2746
|
-
console.log("[PICK_DEBUG] 点击的 mesh 对象:",
|
|
2851
|
+
onHit: (G) => {
|
|
2852
|
+
var Z;
|
|
2853
|
+
console.log("[PICK_DEBUG] 点击的 mesh 对象:", G), console.log("[PICK_DEBUG] mesh.name:", G.name), console.log("[PICK_DEBUG] mesh.uuid:", G.uuid), console.log("[PICK_DEBUG] parent.name:", (Z = G.parent) == null ? void 0 : Z.name), console.log("[PICK_DEBUG] 完整 mesh:", G);
|
|
2747
2854
|
}
|
|
2748
2855
|
}
|
|
2749
2856
|
);
|
|
2750
2857
|
}
|
|
2858
|
+
function c(T) {
|
|
2859
|
+
if (!H || T.key !== "h" && T.key !== "H") return;
|
|
2860
|
+
const E = T.target;
|
|
2861
|
+
if (E) {
|
|
2862
|
+
const G = E.tagName;
|
|
2863
|
+
if (G === "INPUT" || G === "TEXTAREA" || E.isContentEditable) return;
|
|
2864
|
+
}
|
|
2865
|
+
const L = Qa(H);
|
|
2866
|
+
L === null ? console.log("[PICK_DEBUG] 当前没有选中部件, H 快捷键无效") : (console.log(`[PICK_DEBUG] 已${L ? "显示" : "隐藏"}当前选中部件 (快捷键 H)`), T.preventDefault());
|
|
2867
|
+
}
|
|
2751
2868
|
const {
|
|
2752
|
-
threeInfo:
|
|
2869
|
+
threeInfo: t,
|
|
2753
2870
|
modelLoader: {
|
|
2754
|
-
isLoading:
|
|
2755
|
-
loadingProgress:
|
|
2756
|
-
loadedModels:
|
|
2757
|
-
error:
|
|
2758
|
-
loadModelsFromBlobs:
|
|
2871
|
+
isLoading: d,
|
|
2872
|
+
loadingProgress: o,
|
|
2873
|
+
loadedModels: k,
|
|
2874
|
+
error: s,
|
|
2875
|
+
loadModelsFromBlobs: u
|
|
2759
2876
|
},
|
|
2760
|
-
animation: { isAnimating:
|
|
2877
|
+
animation: { isAnimating: _, toggleAnimation: h, stopAnimation: I },
|
|
2761
2878
|
clipping: {
|
|
2762
|
-
isClipping:
|
|
2763
|
-
activeClippingAxis:
|
|
2764
|
-
toggleClipping:
|
|
2765
|
-
updateClippingPlanes:
|
|
2879
|
+
isClipping: A,
|
|
2880
|
+
activeClippingAxis: g,
|
|
2881
|
+
toggleClipping: p,
|
|
2882
|
+
updateClippingPlanes: y
|
|
2766
2883
|
},
|
|
2767
2884
|
partAnimation: {
|
|
2768
|
-
isPartAnimating:
|
|
2769
|
-
setPartRotations:
|
|
2770
|
-
startPartAnimations:
|
|
2771
|
-
stopPartAnimations:
|
|
2885
|
+
isPartAnimating: F,
|
|
2886
|
+
setPartRotations: N,
|
|
2887
|
+
startPartAnimations: B,
|
|
2888
|
+
stopPartAnimations: V
|
|
2772
2889
|
},
|
|
2773
2890
|
millPivotAnimation: {
|
|
2774
|
-
setupMillAnimations:
|
|
2891
|
+
setupMillAnimations: O
|
|
2775
2892
|
}
|
|
2776
|
-
} =
|
|
2893
|
+
} = Ea(r, {
|
|
2777
2894
|
useModelLoaderHook: !0,
|
|
2778
2895
|
useAnimationHook: !0,
|
|
2779
2896
|
useClippingHook: !0,
|
|
2780
2897
|
usePartAnimationHook: !0
|
|
2781
|
-
}), { resetView:
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2898
|
+
}), { resetView: x, initThreeJS: S, handleResize: K, cleanup: v, setAndFitModels: m, axesHelperVisible: R, toggleAxesVisibility: q, currentModels: l, addBeforeRenderCallback: W, removeBeforeRenderCallback: Q, getThreeJSObjects: C, isBeforeRenderPaused: J, setBeforeRenderPaused: $ } = t, c0 = () => {
|
|
2899
|
+
const T = !J.value;
|
|
2900
|
+
$(T), console.log(`[DEBUG] 动画${T ? "已暂停" : "已恢复"}`);
|
|
2901
|
+
}, d0 = Pa(
|
|
2902
|
+
l,
|
|
2903
|
+
W,
|
|
2904
|
+
Q
|
|
2905
|
+
), p0 = xa(
|
|
2906
|
+
l,
|
|
2907
|
+
W,
|
|
2908
|
+
Q,
|
|
2909
|
+
C,
|
|
2790
2910
|
// 传入链条夹具位置查询函数,使胚料能跟随夹具移动
|
|
2791
|
-
(
|
|
2792
|
-
),
|
|
2793
|
-
|
|
2794
|
-
},
|
|
2795
|
-
|
|
2796
|
-
},
|
|
2911
|
+
(T, E) => d0.getClampWorldPosition(T, E)
|
|
2912
|
+
), R0 = () => {
|
|
2913
|
+
q();
|
|
2914
|
+
}, Y = (T) => {
|
|
2915
|
+
g.value = T, y();
|
|
2916
|
+
}, o0 = [
|
|
2797
2917
|
{ partName: "主动链轮10倍-1001", axis: "y", speed: 1, direction: -1 },
|
|
2798
2918
|
{ partName: "主动链轮10倍-2001", axis: "y", speed: 1, direction: -1 },
|
|
2799
2919
|
{ partName: "主动链轮10倍-1", axis: "y", speed: 1, direction: 1 },
|
|
2800
2920
|
{ partName: "主动链轮10倍-2", axis: "y", speed: 1, direction: 1 }
|
|
2801
2921
|
];
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
console.error("加载错误:",
|
|
2922
|
+
Z0(() => a.fileBlobs, (T) => {
|
|
2923
|
+
T && T.length > 0 && u(T).catch((E) => {
|
|
2924
|
+
console.error("加载错误:", E);
|
|
2805
2925
|
});
|
|
2806
2926
|
}, {
|
|
2807
2927
|
immediate: !0,
|
|
2808
2928
|
deep: !0
|
|
2809
|
-
}),
|
|
2810
|
-
|
|
2811
|
-
}),
|
|
2812
|
-
|
|
2929
|
+
}), Z0(k, (T) => {
|
|
2930
|
+
T && T.length > 0 && (m(T), O(), N(o0), B(), d0.startChainAnimation(), p0.startBilletDelivery());
|
|
2931
|
+
}), Z0(s, (T) => {
|
|
2932
|
+
T && we.error(`模型加载失败: ${T}`);
|
|
2813
2933
|
});
|
|
2814
|
-
const
|
|
2815
|
-
|
|
2934
|
+
const w0 = (T) => {
|
|
2935
|
+
b.value = !0, i.value = T, T === "剖面视图" && !A.value && p();
|
|
2816
2936
|
};
|
|
2817
|
-
let
|
|
2818
|
-
return
|
|
2819
|
-
|
|
2937
|
+
let m0 = null;
|
|
2938
|
+
return Xe(async () => {
|
|
2939
|
+
var T;
|
|
2940
|
+
await $e();
|
|
2820
2941
|
try {
|
|
2821
|
-
|
|
2822
|
-
threeInfo:
|
|
2823
|
-
currentModels:
|
|
2824
|
-
loadedModels:
|
|
2825
|
-
getThreeJSObjects:
|
|
2826
|
-
billetAnimation:
|
|
2827
|
-
chainAnimation:
|
|
2828
|
-
|
|
2942
|
+
S(), r.value && (m0 = new ResizeObserver(K), m0.observe(r.value)), fb && (window.__threePreview__ = {
|
|
2943
|
+
threeInfo: t,
|
|
2944
|
+
currentModels: l,
|
|
2945
|
+
loadedModels: k,
|
|
2946
|
+
getThreeJSObjects: C,
|
|
2947
|
+
billetAnimation: p0,
|
|
2948
|
+
chainAnimation: d0,
|
|
2949
|
+
isBeforeRenderPaused: J,
|
|
2950
|
+
setBeforeRenderPaused: $,
|
|
2951
|
+
// 调试函数
|
|
2952
|
+
_logRollDetails: (E, L) => {
|
|
2953
|
+
var G;
|
|
2954
|
+
if (L) {
|
|
2955
|
+
const Z = new w(), e0 = new n0(), X = new w(), i0 = new w(), M0 = new z0().setFromObject(L);
|
|
2956
|
+
M0.getCenter(X), M0.getSize(i0), L.getWorldPosition(Z), L.getWorldQuaternion(e0), console.log(`[DEBUG] ${E}:`, {
|
|
2957
|
+
name: L.name,
|
|
2958
|
+
parent: ((G = L.parent) == null ? void 0 : G.name) ?? "null",
|
|
2959
|
+
worldPos: Z,
|
|
2960
|
+
bboxCenter: X,
|
|
2961
|
+
bboxSize: i0,
|
|
2962
|
+
worldQuat: e0,
|
|
2963
|
+
posVsBboxCenter: { dx: Z.x - X.x, dy: Z.y - X.y, dz: Z.z - X.z }
|
|
2964
|
+
});
|
|
2965
|
+
}
|
|
2966
|
+
},
|
|
2967
|
+
// 快速打印所有轧辊状态
|
|
2968
|
+
_printAllRollStates: () => {
|
|
2969
|
+
const { scene: E } = C();
|
|
2970
|
+
if (!E) return;
|
|
2971
|
+
const L = ["轧辊整体-1001", "下轧辊-1001", "轧辊整体-1", "下轧辊-1"];
|
|
2972
|
+
for (const G of L) {
|
|
2973
|
+
let Z = null;
|
|
2974
|
+
for (const e0 of l.value) {
|
|
2975
|
+
if (!e0) continue;
|
|
2976
|
+
const X = e0.getObjectByName(G);
|
|
2977
|
+
if (X) {
|
|
2978
|
+
Z = X;
|
|
2979
|
+
break;
|
|
2980
|
+
}
|
|
2981
|
+
}
|
|
2982
|
+
if (!Z) {
|
|
2983
|
+
const e0 = E.getObjectByName(G);
|
|
2984
|
+
e0 && (Z = e0);
|
|
2985
|
+
}
|
|
2986
|
+
if (Z) {
|
|
2987
|
+
const e0 = new w(), X = new n0();
|
|
2988
|
+
Z.getWorldPosition(e0), Z.getWorldQuaternion(X), console.log(`[ROLL] ${G}: pos=${e0.x.toFixed(2)}, ${e0.y.toFixed(2)}, ${e0.z.toFixed(2)} | w=${X.w.toFixed(4)}`);
|
|
2989
|
+
}
|
|
2990
|
+
}
|
|
2991
|
+
}
|
|
2992
|
+
}), H = qa(), (T = r.value) == null || T.addEventListener("click", f), window.addEventListener("keydown", c), console.log("[PICK_DEBUG] 部件拾取调试已开启,点击模型查看信息,按 H 显隐当前选中部件");
|
|
2829
2993
|
} catch (E) {
|
|
2830
|
-
console.error("Three.js 初始化失败:", E),
|
|
2994
|
+
console.error("Three.js 初始化失败:", E), we.error("渲染引擎初始化失败!");
|
|
2831
2995
|
}
|
|
2832
|
-
}),
|
|
2833
|
-
|
|
2834
|
-
}), (
|
|
2835
|
-
const
|
|
2836
|
-
return
|
|
2837
|
-
|
|
2996
|
+
}), e2(() => {
|
|
2997
|
+
i.value = "", m0 && m0.disconnect(), r.value && H && (r.value.removeEventListener("click", f), window.removeEventListener("keydown", c), Za(H), H = null), _.value && I(), F.value && V(), p0.dispose(), d0.dispose(), v();
|
|
2998
|
+
}), (T, E) => {
|
|
2999
|
+
const L = a2("el-scrollbar");
|
|
3000
|
+
return V0(), he("div", $a, [
|
|
3001
|
+
t0("div", {
|
|
2838
3002
|
ref_key: "threejsContainer",
|
|
2839
|
-
ref:
|
|
3003
|
+
ref: r,
|
|
2840
3004
|
class: "threejs-container"
|
|
2841
3005
|
}, null, 512),
|
|
2842
|
-
|
|
2843
|
-
|
|
3006
|
+
t0("div", eb, [
|
|
3007
|
+
j0(I0, {
|
|
2844
3008
|
name: "viewReset",
|
|
2845
3009
|
size: "24",
|
|
2846
|
-
onClick:
|
|
3010
|
+
onClick: g0(x),
|
|
2847
3011
|
title: "重置"
|
|
2848
3012
|
}, null, 8, ["onClick"]),
|
|
2849
|
-
|
|
3013
|
+
j0(I0, {
|
|
2850
3014
|
name: "fangda",
|
|
2851
3015
|
size: "24",
|
|
2852
3016
|
title: "放大"
|
|
2853
3017
|
}),
|
|
2854
|
-
|
|
3018
|
+
j0(I0, {
|
|
2855
3019
|
name: "suoxiao",
|
|
2856
3020
|
size: "24",
|
|
2857
3021
|
title: "缩小"
|
|
2858
3022
|
}),
|
|
2859
|
-
|
|
3023
|
+
j0(I0, {
|
|
2860
3024
|
name: "lookAround",
|
|
2861
3025
|
size: "24",
|
|
2862
|
-
onClick:
|
|
2863
|
-
title:
|
|
3026
|
+
onClick: g0(h),
|
|
3027
|
+
title: g0(_) ? "停止动画" : "动画视图"
|
|
2864
3028
|
}, null, 8, ["onClick", "title"]),
|
|
2865
|
-
|
|
3029
|
+
j0(I0, {
|
|
2866
3030
|
name: "zuobiaoxi",
|
|
2867
3031
|
size: "24",
|
|
2868
|
-
active:
|
|
2869
|
-
onClick:
|
|
3032
|
+
active: g0(R),
|
|
3033
|
+
onClick: R0,
|
|
2870
3034
|
title: "显隐坐标轴"
|
|
2871
3035
|
}, null, 8, ["active"])
|
|
2872
3036
|
]),
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
3037
|
+
t0("div", ab, [
|
|
3038
|
+
_e(T.$slots, "button-left", { switchRightPanel: w0 }, void 0, !0),
|
|
3039
|
+
j0(I0, {
|
|
2876
3040
|
name: "clipping",
|
|
2877
3041
|
size: "24",
|
|
2878
|
-
onClick:
|
|
2879
|
-
active:
|
|
3042
|
+
onClick: E[0] || (E[0] = (G) => w0("剖面视图")),
|
|
3043
|
+
active: b.value && i.value === "剖面视图",
|
|
2880
3044
|
title: "剖面视图"
|
|
2881
3045
|
}, null, 8, ["active"])
|
|
2882
3046
|
]),
|
|
2883
|
-
|
|
2884
|
-
|
|
3047
|
+
t0("div", bb, [
|
|
3048
|
+
_e(T.$slots, "button-right", {}, void 0, !0)
|
|
3049
|
+
]),
|
|
3050
|
+
t0("div", ib, [
|
|
3051
|
+
(V0(), Ae(I0, {
|
|
3052
|
+
key: 0,
|
|
3053
|
+
name: "zanting",
|
|
3054
|
+
size: "24",
|
|
3055
|
+
backgroundColor: "#ffffff",
|
|
3056
|
+
title: g0(J) ? "恢复动画" : "暂停动画",
|
|
3057
|
+
onClick: c0
|
|
3058
|
+
}, null, 8, ["title"]))
|
|
2885
3059
|
]),
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
J("span", {
|
|
3060
|
+
b2(t0("div", Hb, [
|
|
3061
|
+
t0("div", rb, [
|
|
3062
|
+
t0("span", null, pe(i.value), 1),
|
|
3063
|
+
t0("span", {
|
|
2891
3064
|
class: "close",
|
|
2892
|
-
onClick:
|
|
3065
|
+
onClick: E[1] || (E[1] = (G) => b.value = !1)
|
|
2893
3066
|
}, " X ")
|
|
2894
3067
|
]),
|
|
2895
|
-
|
|
2896
|
-
default:
|
|
2897
|
-
|
|
3068
|
+
j0(L, { "max-height": "650px" }, {
|
|
3069
|
+
default: i2(() => [
|
|
3070
|
+
i.value === "剖面视图" ? (V0(), Ae(L2, {
|
|
2898
3071
|
key: 0,
|
|
2899
|
-
value:
|
|
2900
|
-
onChange:
|
|
2901
|
-
}, null, 8, ["value"])) :
|
|
3072
|
+
value: g0(g),
|
|
3073
|
+
onChange: Y
|
|
3074
|
+
}, null, 8, ["value"])) : ge("", !0)
|
|
2902
3075
|
]),
|
|
2903
3076
|
_: 1
|
|
2904
3077
|
})
|
|
2905
3078
|
], 512), [
|
|
2906
|
-
[
|
|
3079
|
+
[H2, b.value]
|
|
2907
3080
|
]),
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
])) :
|
|
3081
|
+
g0(d) ? (V0(), he("div", cb, [
|
|
3082
|
+
E[2] || (E[2] = t0("div", { class: "loading-spinner" }, null, -1)),
|
|
3083
|
+
t0("p", null, pe(g0(o)), 1)
|
|
3084
|
+
])) : ge("", !0)
|
|
2912
3085
|
]);
|
|
2913
3086
|
};
|
|
2914
3087
|
}
|
|
2915
|
-
}),
|
|
3088
|
+
}), hb = /* @__PURE__ */ Q2(tb, [["__scopeId", "data-v-7ef33d10"]]);
|
|
2916
3089
|
export {
|
|
2917
|
-
|
|
3090
|
+
hb as default
|
|
2918
3091
|
};
|