ss-component-new 1.3.547 → 1.3.549
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-DuzWWA0d.js → array-DwbG6foz.js} +2 -2
- package/dist/{index-CSKqy2HW.js → index-BBIvt-31.js} +2 -2
- package/dist/{index-D6PW0EF5.js → index-C77vuhw7.js} +1 -1
- package/dist/{index-ut0hL5gT.js → index-CKQBj4er.js} +3 -3
- package/dist/{index-OYLQXwNr.js → index-CQ3llf98.js} +2 -2
- package/dist/{index-BSTWoM3O.js → index-CjgBa2RP.js} +1 -1
- package/dist/{index-C13LcskP.js → index-CrjAYRAh.js} +7 -7
- package/dist/{index-DUFKYAAn.js → index-DHZk_3uu.js} +2 -2
- package/dist/{index-4oZ7MUBg.js → index-DKG6B1_s.js} +1 -1
- package/dist/{index-jZ1F1PbM.js → index-DPQDPmVc.js} +3 -3
- package/dist/{index-BgojgX-0.js → index-Dxq8ABVA.js} +1 -1
- package/dist/{index-B0zyiVaw.js → index-USrWawmF.js} +1 -1
- package/dist/{index-DZ9DVeNk.js → index-lYizONac.js} +1 -1
- package/dist/{main-fvtQ-7dp.js → main-R47ETSx0.js} +2 -2
- package/dist/ss-component.js +5 -5
- package/dist/ss-component2.js +8 -8
- package/dist/{threeModel-CLwYfWDv.js → threeModel-bC1uWV9g.js} +1 -1
- package/dist/{threePreview-CfbMb7fC.js → threePreview-Bs_eaaPD.js} +227 -235
- package/dist/{threeSceneView-DYv17dtF.js → threeSceneView-C9K-t0q6.js} +3 -3
- package/dist/{threeSceneViewForCPMPIP-fNmbQa1M.js → threeSceneViewForCPMPIP-wf8KfOD6.js} +1 -1
- package/dist/{threeViewerHost-RYBGseNc.js → threeViewerHost-Dw2G7Hfj.js} +1 -1
- package/package.json +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { ak as ae, al as t0, am as T0, R as R0, an as
|
|
1
|
+
import { ref as S, shallowRef as L0, defineComponent as Z0, watch as e0, onMounted as z0, nextTick as Q0, onBeforeUnmount as J0, resolveComponent as Y0, createElementBlock as l0, openBlock as a0, createElementVNode as v, withDirectives as K0, createCommentVNode as h0, createVNode as q, unref as B, renderSlot as g0, toDisplayString as _0, withCtx as X0, createBlock as $0, vShow as ee } from "vue";
|
|
2
|
+
import { ak as ae, al as t0, am as T0, R as R0, an as Q, U as X, ao as D, ap as M0, C as x, aq as M, c as U, ar as be, j as ie, D as He, n as $, V as C, as as re, at as D0, au as fe, av as O0, aw as ce, ax as te, a1 as J, ay as de, az as E0, aA as ne, aB as oe, aC as ke, aD as d0, aE as G0, aF as n0, aG as se, aH as ue, _ as le, aI as b0, a2 as he, t as U0, l as ge, aJ as z, aK as _e, u as x0, aL as Ae, h as q0, aM as pe, w as me, aN as je, $ as Ie, s as i0, P as ye, o as Fe, aO as we, aP as Ne, aQ as ve, aR as Te, aS as Re, aT as B0, aU as Me, aV as A0, aW as p0, aX as m0, aY as j0, aZ as o0, a4 as De, a_ as Oe, B as V0, a$ as Ee, k as Ge } from "./index.vue_vue_type_style_index_0_scoped_07c75c98_lang-DGUr6qBw.js";
|
|
3
3
|
import "./index-DqXvOyIs.js";
|
|
4
4
|
import { u as Ue, a as xe, b as qe, C as Be } from "./iconfont-CdO3WbzY.js";
|
|
5
5
|
import { M as Ve, O as Pe, S as We } from "./MTLLoader-Cej1eu5u.js";
|
|
6
|
-
import { T as
|
|
6
|
+
import { T as W } from "./svgIcon-4u4PW7Is.js";
|
|
7
7
|
import { E as I0 } from "./request-B1c8BUkR.js";
|
|
8
8
|
import { _ as Ce } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
function y0(k, e) {
|
|
@@ -91,10 +91,10 @@ class Se extends R0 {
|
|
|
91
91
|
if (this.resourcePath !== "")
|
|
92
92
|
i = this.resourcePath;
|
|
93
93
|
else if (this.path !== "") {
|
|
94
|
-
const t =
|
|
95
|
-
i =
|
|
94
|
+
const t = Q.extractUrlBase(e);
|
|
95
|
+
i = Q.resolveURL(t, this.path);
|
|
96
96
|
} else
|
|
97
|
-
i =
|
|
97
|
+
i = Q.extractUrlBase(e);
|
|
98
98
|
this.manager.itemStart(e);
|
|
99
99
|
const c = function(t) {
|
|
100
100
|
b ? b(t) : console.error(t), H.manager.itemError(e), H.manager.itemEnd(e);
|
|
@@ -297,7 +297,7 @@ class Ze {
|
|
|
297
297
|
if (b) return b;
|
|
298
298
|
const H = a.json, f = ((H.extensions && H.extensions[this.name] || {}).lights || [])[e];
|
|
299
299
|
let t;
|
|
300
|
-
const n = new
|
|
300
|
+
const n = new x(16777215);
|
|
301
301
|
f.color !== void 0 && n.setRGB(f.color[0], f.color[1], f.color[2], M);
|
|
302
302
|
const d = f.range !== void 0 ? f.range : 0;
|
|
303
303
|
switch (f.type) {
|
|
@@ -331,18 +331,18 @@ class ze {
|
|
|
331
331
|
this.name = p.KHR_MATERIALS_UNLIT;
|
|
332
332
|
}
|
|
333
333
|
getMaterialType() {
|
|
334
|
-
return
|
|
334
|
+
return z;
|
|
335
335
|
}
|
|
336
336
|
extendParams(e, a, r) {
|
|
337
337
|
const b = [];
|
|
338
|
-
e.color = new
|
|
338
|
+
e.color = new x(1, 1, 1), e.opacity = 1;
|
|
339
339
|
const H = a.pbrMetallicRoughness;
|
|
340
340
|
if (H) {
|
|
341
341
|
if (Array.isArray(H.baseColorFactor)) {
|
|
342
342
|
const i = H.baseColorFactor;
|
|
343
343
|
e.color.setRGB(i[0], i[1], i[2], M), e.opacity = i[3];
|
|
344
344
|
}
|
|
345
|
-
H.baseColorTexture !== void 0 && b.push(r.assignTexture(e, "map", H.baseColorTexture,
|
|
345
|
+
H.baseColorTexture !== void 0 && b.push(r.assignTexture(e, "map", H.baseColorTexture, U));
|
|
346
346
|
}
|
|
347
347
|
return Promise.all(b);
|
|
348
348
|
}
|
|
@@ -424,13 +424,13 @@ class Xe {
|
|
|
424
424
|
if (!b.extensions || !b.extensions[this.name])
|
|
425
425
|
return Promise.resolve();
|
|
426
426
|
const H = [];
|
|
427
|
-
a.sheenColor = new
|
|
427
|
+
a.sheenColor = new x(0, 0, 0), a.sheenRoughness = 0, a.sheen = 1;
|
|
428
428
|
const i = b.extensions[this.name];
|
|
429
429
|
if (i.sheenColorFactor !== void 0) {
|
|
430
430
|
const c = i.sheenColorFactor;
|
|
431
431
|
a.sheenColor.setRGB(c[0], c[1], c[2], M);
|
|
432
432
|
}
|
|
433
|
-
return i.sheenRoughnessFactor !== void 0 && (a.sheenRoughness = i.sheenRoughnessFactor), i.sheenColorTexture !== void 0 && H.push(r.assignTexture(a, "sheenColorMap", i.sheenColorTexture,
|
|
433
|
+
return i.sheenRoughnessFactor !== void 0 && (a.sheenRoughness = i.sheenRoughnessFactor), i.sheenColorTexture !== void 0 && H.push(r.assignTexture(a, "sheenColorMap", i.sheenColorTexture, U)), i.sheenRoughnessTexture !== void 0 && H.push(r.assignTexture(a, "sheenRoughnessMap", i.sheenRoughnessTexture)), Promise.all(H);
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
class $e {
|
|
@@ -464,7 +464,7 @@ class e2 {
|
|
|
464
464
|
const H = [], i = b.extensions[this.name];
|
|
465
465
|
a.thickness = i.thicknessFactor !== void 0 ? i.thicknessFactor : 0, i.thicknessTexture !== void 0 && H.push(r.assignTexture(a, "thicknessMap", i.thicknessTexture)), a.attenuationDistance = i.attenuationDistance || 1 / 0;
|
|
466
466
|
const c = i.attenuationColor || [1, 1, 1];
|
|
467
|
-
return a.attenuationColor = new
|
|
467
|
+
return a.attenuationColor = new x().setRGB(c[0], c[1], c[2], M), Promise.all(H);
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
470
|
class a2 {
|
|
@@ -498,7 +498,7 @@ class b2 {
|
|
|
498
498
|
const H = [], i = b.extensions[this.name];
|
|
499
499
|
a.specularIntensity = i.specularFactor !== void 0 ? i.specularFactor : 1, i.specularTexture !== void 0 && H.push(r.assignTexture(a, "specularIntensityMap", i.specularTexture));
|
|
500
500
|
const c = i.specularColorFactor || [1, 1, 1];
|
|
501
|
-
return a.specularColor = new
|
|
501
|
+
return a.specularColor = new x().setRGB(c[0], c[1], c[2], M), i.specularColorTexture !== void 0 && H.push(r.assignTexture(a, "specularColorMap", i.specularColorTexture, U)), Promise.all(H);
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
504
|
class i2 {
|
|
@@ -620,33 +620,33 @@ class d2 {
|
|
|
620
620
|
return null;
|
|
621
621
|
const b = a.meshes[r.mesh];
|
|
622
622
|
for (const t of b.primitives)
|
|
623
|
-
if (t.mode !==
|
|
623
|
+
if (t.mode !== w.TRIANGLES && t.mode !== w.TRIANGLE_STRIP && t.mode !== w.TRIANGLE_FAN && t.mode !== void 0)
|
|
624
624
|
return null;
|
|
625
625
|
const i = r.extensions[this.name].attributes, c = [], f = {};
|
|
626
626
|
for (const t in i)
|
|
627
627
|
c.push(this.parser.getDependency("accessor", i[t]).then((n) => (f[t] = n, f[t])));
|
|
628
628
|
return c.length < 1 ? null : (c.push(this.parser.createNodeMesh(e)), Promise.all(c).then((t) => {
|
|
629
629
|
const n = t.pop(), d = n.isGroup ? n.children : [n], o = t[0].count, s = [];
|
|
630
|
-
for (const
|
|
631
|
-
const
|
|
630
|
+
for (const l of d) {
|
|
631
|
+
const h = new $(), u = new C(), g = new D0(), _ = new C(1, 1, 1), m = new re(l.geometry, l.material, o);
|
|
632
632
|
for (let A = 0; A < o; A++)
|
|
633
|
-
f.TRANSLATION &&
|
|
633
|
+
f.TRANSLATION && u.fromBufferAttribute(f.TRANSLATION, A), f.ROTATION && g.fromBufferAttribute(f.ROTATION, A), f.SCALE && _.fromBufferAttribute(f.SCALE, A), m.setMatrixAt(A, h.compose(u, g, _));
|
|
634
634
|
for (const A in f)
|
|
635
635
|
if (A === "_COLOR_0") {
|
|
636
|
-
const
|
|
637
|
-
m.instanceColor = new fe(
|
|
638
|
-
} else A !== "TRANSLATION" && A !== "ROTATION" && A !== "SCALE" &&
|
|
639
|
-
O0.prototype.copy.call(m,
|
|
636
|
+
const I = f[A];
|
|
637
|
+
m.instanceColor = new fe(I.array, I.itemSize, I.normalized);
|
|
638
|
+
} else A !== "TRANSLATION" && A !== "ROTATION" && A !== "SCALE" && l.geometry.setAttribute(A, f[A]);
|
|
639
|
+
O0.prototype.copy.call(m, l), this.parser.assignFinalMaterial(m), s.push(m);
|
|
640
640
|
}
|
|
641
641
|
return n.isGroup ? (n.clear(), n.add(...s), n) : s[0];
|
|
642
642
|
}));
|
|
643
643
|
}
|
|
644
644
|
}
|
|
645
|
-
const P0 = "glTF",
|
|
645
|
+
const P0 = "glTF", Z = 12, F0 = { JSON: 1313821514, BIN: 5130562 };
|
|
646
646
|
class n2 {
|
|
647
647
|
constructor(e) {
|
|
648
648
|
this.name = p.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
649
|
-
const a = new DataView(e, 0,
|
|
649
|
+
const a = new DataView(e, 0, Z), r = new TextDecoder();
|
|
650
650
|
if (this.header = {
|
|
651
651
|
magic: r.decode(new Uint8Array(e.slice(0, 4))),
|
|
652
652
|
version: a.getUint32(4, !0),
|
|
@@ -655,17 +655,17 @@ class n2 {
|
|
|
655
655
|
throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
|
|
656
656
|
if (this.header.version < 2)
|
|
657
657
|
throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
|
|
658
|
-
const b = this.header.length -
|
|
658
|
+
const b = this.header.length - Z, H = new DataView(e, Z);
|
|
659
659
|
let i = 0;
|
|
660
660
|
for (; i < b; ) {
|
|
661
661
|
const c = H.getUint32(i, !0);
|
|
662
662
|
i += 4;
|
|
663
663
|
const f = H.getUint32(i, !0);
|
|
664
664
|
if (i += 4, f === F0.JSON) {
|
|
665
|
-
const t = new Uint8Array(e,
|
|
665
|
+
const t = new Uint8Array(e, Z + i, c);
|
|
666
666
|
this.content = r.decode(t);
|
|
667
667
|
} else if (f === F0.BIN) {
|
|
668
|
-
const t =
|
|
668
|
+
const t = Z + i;
|
|
669
669
|
this.body = e.slice(t, t + c);
|
|
670
670
|
}
|
|
671
671
|
i += c;
|
|
@@ -689,16 +689,16 @@ class o2 {
|
|
|
689
689
|
for (const n in e.attributes) {
|
|
690
690
|
const d = k0[n] || n.toLowerCase();
|
|
691
691
|
if (i[n] !== void 0) {
|
|
692
|
-
const o = r.accessors[e.attributes[n]], s =
|
|
692
|
+
const o = r.accessors[e.attributes[n]], s = L[o.componentType];
|
|
693
693
|
t[d] = s.name, f[d] = o.normalized === !0;
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
696
|
return a.getDependency("bufferView", H).then(function(n) {
|
|
697
697
|
return new Promise(function(d, o) {
|
|
698
698
|
b.decodeDracoFile(n, function(s) {
|
|
699
|
-
for (const
|
|
700
|
-
const
|
|
701
|
-
|
|
699
|
+
for (const l in s.attributes) {
|
|
700
|
+
const h = s.attributes[l], u = f[l];
|
|
701
|
+
u !== void 0 && (h.normalized = u);
|
|
702
702
|
}
|
|
703
703
|
d(s);
|
|
704
704
|
}, c, t, M, o);
|
|
@@ -730,10 +730,10 @@ class W0 extends Oe {
|
|
|
730
730
|
return a;
|
|
731
731
|
}
|
|
732
732
|
interpolate_(e, a, r, b) {
|
|
733
|
-
const H = this.resultBuffer, i = this.sampleValues, c = this.valueSize, f = c * 2, t = c * 3, n = b - a, d = (r - a) / n, o = d * d, s = o * d,
|
|
733
|
+
const H = this.resultBuffer, i = this.sampleValues, c = this.valueSize, f = c * 2, t = c * 3, n = b - a, d = (r - a) / n, o = d * d, s = o * d, l = e * t, h = l - t, u = -2 * s + 3 * o, g = s - o, _ = 1 - u, m = g - o + d;
|
|
734
734
|
for (let A = 0; A !== c; A++) {
|
|
735
|
-
const
|
|
736
|
-
H[A] = _ *
|
|
735
|
+
const I = i[h + A + c], F = i[h + A + f] * n, y = i[l + A + c], O = i[l + A] * n;
|
|
736
|
+
H[A] = _ * I + m * F + u * y + g * O;
|
|
737
737
|
}
|
|
738
738
|
return H;
|
|
739
739
|
}
|
|
@@ -745,7 +745,7 @@ class l2 extends W0 {
|
|
|
745
745
|
return u2.fromArray(H).normalize().toArray(H), H;
|
|
746
746
|
}
|
|
747
747
|
}
|
|
748
|
-
const
|
|
748
|
+
const w = {
|
|
749
749
|
POINTS: 0,
|
|
750
750
|
LINES: 1,
|
|
751
751
|
LINE_LOOP: 2,
|
|
@@ -753,7 +753,7 @@ const v = {
|
|
|
753
753
|
TRIANGLES: 4,
|
|
754
754
|
TRIANGLE_STRIP: 5,
|
|
755
755
|
TRIANGLE_FAN: 6
|
|
756
|
-
},
|
|
756
|
+
}, L = {
|
|
757
757
|
5120: Int8Array,
|
|
758
758
|
5121: Uint8Array,
|
|
759
759
|
5122: Int16Array,
|
|
@@ -790,7 +790,7 @@ const v = {
|
|
|
790
790
|
COLOR_0: "color",
|
|
791
791
|
WEIGHTS_0: "skinWeight",
|
|
792
792
|
JOINTS_0: "skinIndex"
|
|
793
|
-
},
|
|
793
|
+
}, G = {
|
|
794
794
|
scale: "scale",
|
|
795
795
|
translation: "position",
|
|
796
796
|
rotation: "quaternion",
|
|
@@ -817,7 +817,7 @@ function g2(k) {
|
|
|
817
817
|
side: De
|
|
818
818
|
})), k.DefaultMaterial;
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function V(k, e, a) {
|
|
821
821
|
for (const r in a.extensions)
|
|
822
822
|
k[r] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[r] = a.extensions[r]);
|
|
823
823
|
}
|
|
@@ -943,7 +943,7 @@ class I2 {
|
|
|
943
943
|
parser: r,
|
|
944
944
|
userData: {}
|
|
945
945
|
};
|
|
946
|
-
return
|
|
946
|
+
return V(H, c, b), E(c, b), Promise.all(r._invokeAll(function(f) {
|
|
947
947
|
return f.afterRoot && f.afterRoot(c);
|
|
948
948
|
})).then(function() {
|
|
949
949
|
for (const f of c.scenes)
|
|
@@ -1124,7 +1124,7 @@ class I2 {
|
|
|
1124
1124
|
return Promise.resolve(this.extensions[p.KHR_BINARY_GLTF].body);
|
|
1125
1125
|
const b = this.options;
|
|
1126
1126
|
return new Promise(function(H, i) {
|
|
1127
|
-
r.load(
|
|
1127
|
+
r.load(Q.resolveURL(a.uri, b.path), H, void 0, function() {
|
|
1128
1128
|
i(new Error('THREE.GLTFLoader: Failed to load buffer "' + a.uri + '".'));
|
|
1129
1129
|
});
|
|
1130
1130
|
});
|
|
@@ -1153,29 +1153,29 @@ class I2 {
|
|
|
1153
1153
|
loadAccessor(e) {
|
|
1154
1154
|
const a = this, r = this.json, b = this.json.accessors[e];
|
|
1155
1155
|
if (b.bufferView === void 0 && b.sparse === void 0) {
|
|
1156
|
-
const i = H0[b.type], c =
|
|
1157
|
-
return Promise.resolve(new
|
|
1156
|
+
const i = H0[b.type], c = L[b.componentType], f = b.normalized === !0, t = new c(b.count * i);
|
|
1157
|
+
return Promise.resolve(new J(t, i, f));
|
|
1158
1158
|
}
|
|
1159
1159
|
const H = [];
|
|
1160
1160
|
return b.bufferView !== void 0 ? H.push(this.getDependency("bufferView", b.bufferView)) : H.push(null), b.sparse !== void 0 && (H.push(this.getDependency("bufferView", b.sparse.indices.bufferView)), H.push(this.getDependency("bufferView", b.sparse.values.bufferView))), Promise.all(H).then(function(i) {
|
|
1161
|
-
const c = i[0], f = H0[b.type], t =
|
|
1162
|
-
let
|
|
1161
|
+
const c = i[0], f = H0[b.type], t = L[b.componentType], n = t.BYTES_PER_ELEMENT, d = n * f, o = b.byteOffset || 0, s = b.bufferView !== void 0 ? r.bufferViews[b.bufferView].byteStride : void 0, l = b.normalized === !0;
|
|
1162
|
+
let h, u;
|
|
1163
1163
|
if (s && s !== d) {
|
|
1164
|
-
const
|
|
1164
|
+
const g = Math.floor(o / s), _ = "InterleavedBuffer:" + b.bufferView + ":" + b.componentType + ":" + g + ":" + b.count;
|
|
1165
1165
|
let m = a.cache.get(_);
|
|
1166
|
-
m || (
|
|
1166
|
+
m || (h = new t(c, g * s, b.count * s / n), m = new de(h, s / n), a.cache.add(_, m)), u = new Me(m, f, o % s / n, l);
|
|
1167
1167
|
} else
|
|
1168
|
-
c === null ?
|
|
1168
|
+
c === null ? h = new t(b.count * f) : h = new t(c, o, b.count * f), u = new J(h, f, l);
|
|
1169
1169
|
if (b.sparse !== void 0) {
|
|
1170
|
-
const
|
|
1171
|
-
c !== null && (
|
|
1172
|
-
for (let
|
|
1173
|
-
const N =
|
|
1174
|
-
if (
|
|
1170
|
+
const g = H0.SCALAR, _ = L[b.sparse.indices.componentType], m = b.sparse.indices.byteOffset || 0, A = b.sparse.values.byteOffset || 0, I = new _(i[1], m, b.sparse.count * g), F = new t(i[2], A, b.sparse.count * f);
|
|
1171
|
+
c !== null && (u = new J(u.array.slice(), u.itemSize, u.normalized)), u.normalized = !1;
|
|
1172
|
+
for (let y = 0, O = I.length; y < O; y++) {
|
|
1173
|
+
const N = I[y];
|
|
1174
|
+
if (u.setX(N, F[y * f]), f >= 2 && u.setY(N, F[y * f + 1]), f >= 3 && u.setZ(N, F[y * f + 2]), f >= 4 && u.setW(N, F[y * f + 3]), f >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
1175
1175
|
}
|
|
1176
|
-
|
|
1176
|
+
u.normalized = l;
|
|
1177
1177
|
}
|
|
1178
|
-
return
|
|
1178
|
+
return u;
|
|
1179
1179
|
});
|
|
1180
1180
|
}
|
|
1181
1181
|
/**
|
|
@@ -1223,11 +1223,11 @@ class I2 {
|
|
|
1223
1223
|
throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
|
|
1224
1224
|
const n = Promise.resolve(f).then(function(d) {
|
|
1225
1225
|
return new Promise(function(o, s) {
|
|
1226
|
-
let
|
|
1227
|
-
a.isImageBitmapLoader === !0 && (
|
|
1228
|
-
const
|
|
1229
|
-
|
|
1230
|
-
}), a.load(
|
|
1226
|
+
let l = o;
|
|
1227
|
+
a.isImageBitmapLoader === !0 && (l = function(h) {
|
|
1228
|
+
const u = new A0(h);
|
|
1229
|
+
u.needsUpdate = !0, o(u);
|
|
1230
|
+
}), a.load(Q.resolveURL(d, H.path), l, void 0, s);
|
|
1231
1231
|
});
|
|
1232
1232
|
}).then(function(d) {
|
|
1233
1233
|
return t === !0 && c.revokeObjectURL(f), E(d, i), d.userData.mimeType = i.mimeType || m2(i.uri), d;
|
|
@@ -1310,11 +1310,11 @@ class I2 {
|
|
|
1310
1310
|
i = d.getMaterialType(), t.push(d.extendParams(c, H, a));
|
|
1311
1311
|
} else {
|
|
1312
1312
|
const d = H.pbrMetallicRoughness || {};
|
|
1313
|
-
if (c.color = new
|
|
1313
|
+
if (c.color = new x(1, 1, 1), c.opacity = 1, Array.isArray(d.baseColorFactor)) {
|
|
1314
1314
|
const o = d.baseColorFactor;
|
|
1315
1315
|
c.color.setRGB(o[0], o[1], o[2], M), c.opacity = o[3];
|
|
1316
1316
|
}
|
|
1317
|
-
d.baseColorTexture !== void 0 && t.push(a.assignTexture(c, "map", d.baseColorTexture,
|
|
1317
|
+
d.baseColorTexture !== void 0 && t.push(a.assignTexture(c, "map", d.baseColorTexture, U)), c.metalness = d.metallicFactor !== void 0 ? d.metallicFactor : 1, c.roughness = d.roughnessFactor !== void 0 ? d.roughnessFactor : 1, d.metallicRoughnessTexture !== void 0 && (t.push(a.assignTexture(c, "metalnessMap", d.metallicRoughnessTexture)), t.push(a.assignTexture(c, "roughnessMap", d.metallicRoughnessTexture))), i = this._invokeOne(function(o) {
|
|
1318
1318
|
return o.getMaterialType && o.getMaterialType(e);
|
|
1319
1319
|
}), t.push(Promise.all(this._invokeAll(function(o) {
|
|
1320
1320
|
return o.extendMaterialParams && o.extendMaterialParams(e, c);
|
|
@@ -1322,17 +1322,17 @@ class I2 {
|
|
|
1322
1322
|
}
|
|
1323
1323
|
H.doubleSided === !0 && (c.side = ge);
|
|
1324
1324
|
const n = H.alphaMode || r0.OPAQUE;
|
|
1325
|
-
if (n === r0.BLEND ? (c.transparent = !0, c.depthWrite = !1) : (c.transparent = !1, n === r0.MASK && (c.alphaTest = H.alphaCutoff !== void 0 ? H.alphaCutoff : 0.5)), H.normalTexture !== void 0 && i !==
|
|
1325
|
+
if (n === r0.BLEND ? (c.transparent = !0, c.depthWrite = !1) : (c.transparent = !1, n === r0.MASK && (c.alphaTest = H.alphaCutoff !== void 0 ? H.alphaCutoff : 0.5)), H.normalTexture !== void 0 && i !== z && (t.push(a.assignTexture(c, "normalMap", H.normalTexture)), c.normalScale = new M0(1, 1), H.normalTexture.scale !== void 0)) {
|
|
1326
1326
|
const d = H.normalTexture.scale;
|
|
1327
1327
|
c.normalScale.set(d, d);
|
|
1328
1328
|
}
|
|
1329
|
-
if (H.occlusionTexture !== void 0 && i !==
|
|
1329
|
+
if (H.occlusionTexture !== void 0 && i !== z && (t.push(a.assignTexture(c, "aoMap", H.occlusionTexture)), H.occlusionTexture.strength !== void 0 && (c.aoMapIntensity = H.occlusionTexture.strength)), H.emissiveFactor !== void 0 && i !== z) {
|
|
1330
1330
|
const d = H.emissiveFactor;
|
|
1331
|
-
c.emissive = new
|
|
1331
|
+
c.emissive = new x().setRGB(d[0], d[1], d[2], M);
|
|
1332
1332
|
}
|
|
1333
|
-
return H.emissiveTexture !== void 0 && i !==
|
|
1333
|
+
return H.emissiveTexture !== void 0 && i !== z && t.push(a.assignTexture(c, "emissiveMap", H.emissiveTexture, U)), Promise.all(t).then(function() {
|
|
1334
1334
|
const d = new i(c);
|
|
1335
|
-
return H.name && (d.name = H.name), E(d, H), a.associations.set(d, { materials: e }), H.extensions &&
|
|
1335
|
+
return H.name && (d.name = H.name), E(d, H), a.associations.set(d, { materials: e }), H.extensions && V(b, d, H), d;
|
|
1336
1336
|
});
|
|
1337
1337
|
}
|
|
1338
1338
|
/**
|
|
@@ -1389,34 +1389,34 @@ class I2 {
|
|
|
1389
1389
|
}
|
|
1390
1390
|
return c.push(a.loadGeometries(i)), Promise.all(c).then(function(f) {
|
|
1391
1391
|
const t = f.slice(0, f.length - 1), n = f[f.length - 1], d = [];
|
|
1392
|
-
for (let s = 0,
|
|
1393
|
-
const
|
|
1394
|
-
let
|
|
1392
|
+
for (let s = 0, l = n.length; s < l; s++) {
|
|
1393
|
+
const h = n[s], u = i[s];
|
|
1394
|
+
let g;
|
|
1395
1395
|
const _ = t[s];
|
|
1396
|
-
if (
|
|
1397
|
-
|
|
1398
|
-
else if (
|
|
1399
|
-
|
|
1400
|
-
else if (
|
|
1401
|
-
|
|
1402
|
-
else if (
|
|
1403
|
-
|
|
1404
|
-
else if (
|
|
1405
|
-
|
|
1396
|
+
if (u.mode === w.TRIANGLES || u.mode === w.TRIANGLE_STRIP || u.mode === w.TRIANGLE_FAN || u.mode === void 0)
|
|
1397
|
+
g = H.isSkinnedMesh === !0 ? new Ae(h, _) : new q0(h, _), g.isSkinnedMesh === !0 && g.normalizeSkinWeights(), u.mode === w.TRIANGLE_STRIP ? g.geometry = y0(g.geometry, T0) : u.mode === w.TRIANGLE_FAN && (g.geometry = y0(g.geometry, t0));
|
|
1398
|
+
else if (u.mode === w.LINES)
|
|
1399
|
+
g = new pe(h, _);
|
|
1400
|
+
else if (u.mode === w.LINE_STRIP)
|
|
1401
|
+
g = new me(h, _);
|
|
1402
|
+
else if (u.mode === w.LINE_LOOP)
|
|
1403
|
+
g = new je(h, _);
|
|
1404
|
+
else if (u.mode === w.POINTS)
|
|
1405
|
+
g = new Ie(h, _);
|
|
1406
1406
|
else
|
|
1407
|
-
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " +
|
|
1408
|
-
Object.keys(
|
|
1407
|
+
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + u.mode);
|
|
1408
|
+
Object.keys(g.geometry.morphAttributes).length > 0 && A2(g, H), g.name = a.createUniqueName(H.name || "mesh_" + e), E(g, H), u.extensions && V(b, g, u), a.assignFinalMaterial(g), d.push(g);
|
|
1409
1409
|
}
|
|
1410
|
-
for (let s = 0,
|
|
1410
|
+
for (let s = 0, l = d.length; s < l; s++)
|
|
1411
1411
|
a.associations.set(d[s], {
|
|
1412
1412
|
meshes: e,
|
|
1413
1413
|
primitives: s
|
|
1414
1414
|
});
|
|
1415
1415
|
if (d.length === 1)
|
|
1416
|
-
return H.extensions &&
|
|
1416
|
+
return H.extensions && V(b, d[0], H), d[0];
|
|
1417
1417
|
const o = new i0();
|
|
1418
|
-
H.extensions &&
|
|
1419
|
-
for (let s = 0,
|
|
1418
|
+
H.extensions && V(b, o, H), a.associations.set(o, { meshes: e });
|
|
1419
|
+
for (let s = 0, l = d.length; s < l; s++)
|
|
1420
1420
|
o.add(d[s]);
|
|
1421
1421
|
return o;
|
|
1422
1422
|
});
|
|
@@ -1472,8 +1472,8 @@ class I2 {
|
|
|
1472
1472
|
loadAnimation(e) {
|
|
1473
1473
|
const a = this.json, r = this, b = a.animations[e], H = b.name ? b.name : "animation_" + e, i = [], c = [], f = [], t = [], n = [];
|
|
1474
1474
|
for (let d = 0, o = b.channels.length; d < o; d++) {
|
|
1475
|
-
const s = b.channels[d],
|
|
1476
|
-
|
|
1475
|
+
const s = b.channels[d], l = b.samplers[s.sampler], h = s.target, u = h.node, g = b.parameters !== void 0 ? b.parameters[l.input] : l.input, _ = b.parameters !== void 0 ? b.parameters[l.output] : l.output;
|
|
1476
|
+
h.node !== void 0 && (i.push(this.getDependency("node", u)), c.push(this.getDependency("accessor", g)), f.push(this.getDependency("accessor", _)), t.push(l), n.push(h));
|
|
1477
1477
|
}
|
|
1478
1478
|
return Promise.all([
|
|
1479
1479
|
Promise.all(i),
|
|
@@ -1482,17 +1482,17 @@ class I2 {
|
|
|
1482
1482
|
Promise.all(t),
|
|
1483
1483
|
Promise.all(n)
|
|
1484
1484
|
]).then(function(d) {
|
|
1485
|
-
const o = d[0], s = d[1],
|
|
1485
|
+
const o = d[0], s = d[1], l = d[2], h = d[3], u = d[4], g = [];
|
|
1486
1486
|
for (let _ = 0, m = o.length; _ < m; _++) {
|
|
1487
|
-
const A = o[_],
|
|
1487
|
+
const A = o[_], I = s[_], F = l[_], y = h[_], O = u[_];
|
|
1488
1488
|
if (A === void 0) continue;
|
|
1489
1489
|
A.updateMatrix && A.updateMatrix();
|
|
1490
|
-
const N = r._createAnimationTracks(A,
|
|
1490
|
+
const N = r._createAnimationTracks(A, I, F, y, O);
|
|
1491
1491
|
if (N)
|
|
1492
|
-
for (let
|
|
1493
|
-
|
|
1492
|
+
for (let T = 0; T < N.length; T++)
|
|
1493
|
+
g.push(N[T]);
|
|
1494
1494
|
}
|
|
1495
|
-
return new ve(H, void 0,
|
|
1495
|
+
return new ve(H, void 0, g);
|
|
1496
1496
|
});
|
|
1497
1497
|
}
|
|
1498
1498
|
createNodeMesh(e) {
|
|
@@ -1527,7 +1527,7 @@ class I2 {
|
|
|
1527
1527
|
o !== null && n.traverse(function(s) {
|
|
1528
1528
|
s.isSkinnedMesh && s.bind(o, j2);
|
|
1529
1529
|
});
|
|
1530
|
-
for (let s = 0,
|
|
1530
|
+
for (let s = 0, l = d.length; s < l; s++)
|
|
1531
1531
|
n.add(d[s]);
|
|
1532
1532
|
return n;
|
|
1533
1533
|
});
|
|
@@ -1552,7 +1552,7 @@ class I2 {
|
|
|
1552
1552
|
if (H.isBone === !0 ? n = new Te() : t.length > 1 ? n = new i0() : t.length === 1 ? n = t[0] : n = new O0(), n !== t[0])
|
|
1553
1553
|
for (let d = 0, o = t.length; d < o; d++)
|
|
1554
1554
|
n.add(t[d]);
|
|
1555
|
-
if (H.name && (n.userData.name = H.name, n.name = i), E(n, H), H.extensions &&
|
|
1555
|
+
if (H.name && (n.userData.name = H.name, n.name = i), E(n, H), H.extensions && V(r, n, H), H.matrix !== void 0) {
|
|
1556
1556
|
const d = new $();
|
|
1557
1557
|
d.fromArray(H.matrix), n.applyMatrix4(d);
|
|
1558
1558
|
} else
|
|
@@ -1575,7 +1575,7 @@ class I2 {
|
|
|
1575
1575
|
*/
|
|
1576
1576
|
loadScene(e) {
|
|
1577
1577
|
const a = this.extensions, r = this.json.scenes[e], b = this, H = new i0();
|
|
1578
|
-
r.name && (H.name = b.createUniqueName(r.name)), E(H, r), r.extensions &&
|
|
1578
|
+
r.name && (H.name = b.createUniqueName(r.name)), E(H, r), r.extensions && V(a, H, r);
|
|
1579
1579
|
const i = r.nodes || [], c = [];
|
|
1580
1580
|
for (let f = 0, t = i.length; f < t; f++)
|
|
1581
1581
|
c.push(b.getDependency("node", i[f]));
|
|
@@ -1596,19 +1596,19 @@ class I2 {
|
|
|
1596
1596
|
}
|
|
1597
1597
|
_createAnimationTracks(e, a, r, b, H) {
|
|
1598
1598
|
const i = [], c = e.name ? e.name : e.uuid, f = [];
|
|
1599
|
-
|
|
1599
|
+
G[H.path] === G.weights ? e.traverse(function(o) {
|
|
1600
1600
|
o.morphTargetInfluences && f.push(o.name ? o.name : o.uuid);
|
|
1601
1601
|
}) : f.push(c);
|
|
1602
1602
|
let t;
|
|
1603
|
-
switch (
|
|
1604
|
-
case
|
|
1603
|
+
switch (G[H.path]) {
|
|
1604
|
+
case G.weights:
|
|
1605
1605
|
t = m0;
|
|
1606
1606
|
break;
|
|
1607
|
-
case
|
|
1607
|
+
case G.rotation:
|
|
1608
1608
|
t = j0;
|
|
1609
1609
|
break;
|
|
1610
|
-
case
|
|
1611
|
-
case
|
|
1610
|
+
case G.translation:
|
|
1611
|
+
case G.scale:
|
|
1612
1612
|
t = p0;
|
|
1613
1613
|
break;
|
|
1614
1614
|
default:
|
|
@@ -1626,13 +1626,13 @@ class I2 {
|
|
|
1626
1626
|
}
|
|
1627
1627
|
const n = b.interpolation !== void 0 ? h2[b.interpolation] : B0, d = this._getArrayFromAccessor(r);
|
|
1628
1628
|
for (let o = 0, s = f.length; o < s; o++) {
|
|
1629
|
-
const
|
|
1630
|
-
f[o] + "." +
|
|
1629
|
+
const l = new t(
|
|
1630
|
+
f[o] + "." + G[H.path],
|
|
1631
1631
|
a.array,
|
|
1632
1632
|
d,
|
|
1633
1633
|
n
|
|
1634
1634
|
);
|
|
1635
|
-
b.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(
|
|
1635
|
+
b.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(l), i.push(l);
|
|
1636
1636
|
}
|
|
1637
1637
|
return i;
|
|
1638
1638
|
}
|
|
@@ -1659,10 +1659,10 @@ function y2(k, e, a) {
|
|
|
1659
1659
|
const c = a.json.accessors[r.POSITION], f = c.min, t = c.max;
|
|
1660
1660
|
if (f !== void 0 && t !== void 0) {
|
|
1661
1661
|
if (b.set(
|
|
1662
|
-
new
|
|
1663
|
-
new
|
|
1662
|
+
new C(f[0], f[1], f[2]),
|
|
1663
|
+
new C(t[0], t[1], t[2])
|
|
1664
1664
|
), c.normalized) {
|
|
1665
|
-
const n = s0(
|
|
1665
|
+
const n = s0(L[c.componentType]);
|
|
1666
1666
|
b.min.multiplyScalar(n), b.max.multiplyScalar(n);
|
|
1667
1667
|
}
|
|
1668
1668
|
} else {
|
|
@@ -1673,15 +1673,15 @@ function y2(k, e, a) {
|
|
|
1673
1673
|
return;
|
|
1674
1674
|
const H = e.targets;
|
|
1675
1675
|
if (H !== void 0) {
|
|
1676
|
-
const c = new
|
|
1676
|
+
const c = new C(), f = new C();
|
|
1677
1677
|
for (let t = 0, n = H.length; t < n; t++) {
|
|
1678
1678
|
const d = H[t];
|
|
1679
1679
|
if (d.POSITION !== void 0) {
|
|
1680
|
-
const o = a.json.accessors[d.POSITION], s = o.min,
|
|
1681
|
-
if (s !== void 0 &&
|
|
1682
|
-
if (f.setX(Math.max(Math.abs(s[0]), Math.abs(
|
|
1683
|
-
const
|
|
1684
|
-
f.multiplyScalar(
|
|
1680
|
+
const o = a.json.accessors[d.POSITION], s = o.min, l = o.max;
|
|
1681
|
+
if (s !== void 0 && l !== void 0) {
|
|
1682
|
+
if (f.setX(Math.max(Math.abs(s[0]), Math.abs(l[0]))), f.setY(Math.max(Math.abs(s[1]), Math.abs(l[1]))), f.setZ(Math.max(Math.abs(s[2]), Math.abs(l[2]))), o.normalized) {
|
|
1683
|
+
const h = s0(L[o.componentType]);
|
|
1684
|
+
f.multiplyScalar(h);
|
|
1685
1685
|
}
|
|
1686
1686
|
c.max(f);
|
|
1687
1687
|
} else
|
|
@@ -1787,7 +1787,7 @@ class F2 extends R0 {
|
|
|
1787
1787
|
*/
|
|
1788
1788
|
parse(e, a, r = () => {
|
|
1789
1789
|
}) {
|
|
1790
|
-
this.decodeDracoFile(e, a, null, null,
|
|
1790
|
+
this.decodeDracoFile(e, a, null, null, U, r).catch(r);
|
|
1791
1791
|
}
|
|
1792
1792
|
//
|
|
1793
1793
|
decodeDracoFile(e, a, r, b, H = M, i = () => {
|
|
@@ -1824,18 +1824,18 @@ class F2 extends R0 {
|
|
|
1824
1824
|
}
|
|
1825
1825
|
_createGeometry(e) {
|
|
1826
1826
|
const a = new x0();
|
|
1827
|
-
e.index && a.setIndex(new
|
|
1827
|
+
e.index && a.setIndex(new J(e.index.array, 1));
|
|
1828
1828
|
for (let r = 0; r < e.attributes.length; r++) {
|
|
1829
|
-
const b = e.attributes[r], H = b.name, i = b.array, c = b.itemSize, f = new
|
|
1829
|
+
const b = e.attributes[r], H = b.name, i = b.array, c = b.itemSize, f = new J(i, c);
|
|
1830
1830
|
H === "color" && (this._assignVertexColorSpace(f, b.vertexColorSpace), f.normalized = !(i instanceof Float32Array)), a.setAttribute(H, f);
|
|
1831
1831
|
}
|
|
1832
1832
|
return a;
|
|
1833
1833
|
}
|
|
1834
1834
|
_assignVertexColorSpace(e, a) {
|
|
1835
|
-
if (a !==
|
|
1836
|
-
const r = new
|
|
1835
|
+
if (a !== U) return;
|
|
1836
|
+
const r = new x();
|
|
1837
1837
|
for (let b = 0, H = e.count; b < H; b++)
|
|
1838
|
-
r.fromBufferAttribute(e, b), o0.colorSpaceToWorking(r,
|
|
1838
|
+
r.fromBufferAttribute(e, b), o0.colorSpaceToWorking(r, U), e.setXYZ(b, r.r, r.g, r.b);
|
|
1839
1839
|
}
|
|
1840
1840
|
_loadLibrary(e, a) {
|
|
1841
1841
|
const r = new X(this.manager);
|
|
@@ -1917,8 +1917,8 @@ function w2() {
|
|
|
1917
1917
|
e.then((n) => {
|
|
1918
1918
|
const d = n.draco, o = new d.Decoder();
|
|
1919
1919
|
try {
|
|
1920
|
-
const s = a(d, o, new Int8Array(f), t),
|
|
1921
|
-
s.index &&
|
|
1920
|
+
const s = a(d, o, new Int8Array(f), t), l = s.attributes.map((h) => h.array.buffer);
|
|
1921
|
+
s.index && l.push(s.index.array.buffer), self.postMessage({ type: "decode", id: c.id, geometry: s }, l);
|
|
1922
1922
|
} catch (s) {
|
|
1923
1923
|
console.error(s), self.postMessage({ type: "error", id: c.id, error: s.message });
|
|
1924
1924
|
} finally {
|
|
@@ -1931,29 +1931,29 @@ function w2() {
|
|
|
1931
1931
|
function a(i, c, f, t) {
|
|
1932
1932
|
const n = t.attributeIDs, d = t.attributeTypes;
|
|
1933
1933
|
let o, s;
|
|
1934
|
-
const
|
|
1935
|
-
if (
|
|
1934
|
+
const l = c.GetEncodedGeometryType(f);
|
|
1935
|
+
if (l === i.TRIANGULAR_MESH)
|
|
1936
1936
|
o = new i.Mesh(), s = c.DecodeArrayToMesh(f, f.byteLength, o);
|
|
1937
|
-
else if (
|
|
1937
|
+
else if (l === i.POINT_CLOUD)
|
|
1938
1938
|
o = new i.PointCloud(), s = c.DecodeArrayToPointCloud(f, f.byteLength, o);
|
|
1939
1939
|
else
|
|
1940
1940
|
throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
|
|
1941
1941
|
if (!s.ok() || o.ptr === 0)
|
|
1942
1942
|
throw new Error("THREE.DRACOLoader: Decoding failed: " + s.error_msg());
|
|
1943
|
-
const
|
|
1944
|
-
for (const
|
|
1945
|
-
const
|
|
1943
|
+
const h = { index: null, attributes: [] };
|
|
1944
|
+
for (const u in n) {
|
|
1945
|
+
const g = self[d[u]];
|
|
1946
1946
|
let _, m;
|
|
1947
1947
|
if (t.useUniqueIDs)
|
|
1948
|
-
m = n[
|
|
1948
|
+
m = n[u], _ = c.GetAttributeByUniqueId(o, m);
|
|
1949
1949
|
else {
|
|
1950
|
-
if (m = c.GetAttributeId(o, i[n[
|
|
1950
|
+
if (m = c.GetAttributeId(o, i[n[u]]), m === -1) continue;
|
|
1951
1951
|
_ = c.GetAttribute(o, m);
|
|
1952
1952
|
}
|
|
1953
|
-
const A = b(i, c, o,
|
|
1954
|
-
|
|
1953
|
+
const A = b(i, c, o, u, g, _);
|
|
1954
|
+
u === "color" && (A.vertexColorSpace = t.vertexColorSpace), h.attributes.push(A);
|
|
1955
1955
|
}
|
|
1956
|
-
return
|
|
1956
|
+
return l === i.TRIANGULAR_MESH && (h.index = r(i, c, o)), i.destroy(o), h;
|
|
1957
1957
|
}
|
|
1958
1958
|
function r(i, c, f) {
|
|
1959
1959
|
const n = f.num_faces() * 3, d = n * 4, o = i._malloc(d);
|
|
@@ -1962,10 +1962,10 @@ function w2() {
|
|
|
1962
1962
|
return i._free(o), { array: s, itemSize: 1 };
|
|
1963
1963
|
}
|
|
1964
1964
|
function b(i, c, f, t, n, d) {
|
|
1965
|
-
const o = d.num_components(),
|
|
1966
|
-
c.GetAttributeDataArrayForAllPoints(f, d,
|
|
1967
|
-
const _ = new n(i.HEAPF32.buffer,
|
|
1968
|
-
return i._free(
|
|
1965
|
+
const o = d.num_components(), l = f.num_points() * o, h = l * n.BYTES_PER_ELEMENT, u = H(i, n), g = i._malloc(h);
|
|
1966
|
+
c.GetAttributeDataArrayForAllPoints(f, d, u, h, g);
|
|
1967
|
+
const _ = new n(i.HEAPF32.buffer, g, l).slice();
|
|
1968
|
+
return i._free(g), {
|
|
1969
1969
|
name: t,
|
|
1970
1970
|
array: _,
|
|
1971
1971
|
itemSize: o
|
|
@@ -2026,79 +2026,71 @@ else if (typeof exports === 'object')
|
|
|
2026
2026
|
exports["DracoDecoderModule"] = DracoDecoderModule;
|
|
2027
2027
|
`;
|
|
2028
2028
|
function v2() {
|
|
2029
|
-
const k =
|
|
2030
|
-
let f = null
|
|
2031
|
-
function n() {
|
|
2032
|
-
if (t) return t;
|
|
2033
|
-
const o = new Blob([N2], { type: "application/javascript" });
|
|
2034
|
-
return t = URL.createObjectURL(o), t;
|
|
2035
|
-
}
|
|
2029
|
+
const k = S(!1), e = S(""), a = L0([]), r = S(null), b = new Ve(), H = new Pe(), i = new We(), c = new Se();
|
|
2030
|
+
let f = null;
|
|
2036
2031
|
return {
|
|
2037
2032
|
isLoading: k,
|
|
2038
2033
|
loadingProgress: e,
|
|
2039
2034
|
loadedModels: a,
|
|
2040
2035
|
error: r,
|
|
2041
|
-
loadModelsFromBlobs: async (
|
|
2036
|
+
loadModelsFromBlobs: async (n) => {
|
|
2042
2037
|
var l;
|
|
2043
|
-
if (!
|
|
2038
|
+
if (!n || n.length === 0) {
|
|
2044
2039
|
console.warn("loadModelsFromBlobs 加载的文件数组为空!");
|
|
2045
2040
|
return;
|
|
2046
2041
|
}
|
|
2047
2042
|
k.value = !0, e.value = "准备加载...", a.value = [], r.value = null;
|
|
2048
|
-
const
|
|
2049
|
-
|
|
2050
|
-
h instanceof File &&
|
|
2043
|
+
const d = /* @__PURE__ */ new Map();
|
|
2044
|
+
n.forEach((h) => {
|
|
2045
|
+
h instanceof File && d.set(h.name.toLowerCase(), h);
|
|
2051
2046
|
});
|
|
2052
|
-
const
|
|
2047
|
+
const o = [], s = [];
|
|
2053
2048
|
try {
|
|
2054
|
-
for (const h of
|
|
2055
|
-
const
|
|
2056
|
-
if (
|
|
2057
|
-
const
|
|
2058
|
-
|
|
2059
|
-
let
|
|
2060
|
-
const
|
|
2061
|
-
const
|
|
2062
|
-
e.value = `正在加载 ${
|
|
2049
|
+
for (const h of n) {
|
|
2050
|
+
const u = h.name || "unknown_file", g = (l = u.split(".").pop()) == null ? void 0 : l.toLowerCase();
|
|
2051
|
+
if (g === "mtl") continue;
|
|
2052
|
+
const _ = URL.createObjectURL(h);
|
|
2053
|
+
o.push(_);
|
|
2054
|
+
let m = null;
|
|
2055
|
+
const A = (I) => {
|
|
2056
|
+
const F = I.lengthComputable ? I.loaded / I.total * 100 : 0;
|
|
2057
|
+
e.value = `正在加载 ${u}... ${Math.round(F)}%`;
|
|
2063
2058
|
};
|
|
2064
|
-
switch (e.value = `正在加载 ${
|
|
2059
|
+
switch (e.value = `正在加载 ${u}... 0%`, g) {
|
|
2065
2060
|
case "obj":
|
|
2066
|
-
const I =
|
|
2067
|
-
if (
|
|
2068
|
-
const
|
|
2069
|
-
|
|
2070
|
-
const
|
|
2071
|
-
|
|
2061
|
+
const I = u.replace(/\.obj$/i, ".mtl").toLowerCase();
|
|
2062
|
+
if (d.has(I)) {
|
|
2063
|
+
const T = d.get(I), P = URL.createObjectURL(T);
|
|
2064
|
+
o.push(P);
|
|
2065
|
+
const Y = await b.loadAsync(P);
|
|
2066
|
+
Y.preload(), H.setMaterials(Y);
|
|
2072
2067
|
} else
|
|
2073
2068
|
H.setMaterials(null);
|
|
2074
|
-
|
|
2069
|
+
m = await H.loadAsync(_, A);
|
|
2075
2070
|
break;
|
|
2076
2071
|
case "stl":
|
|
2077
|
-
const
|
|
2078
|
-
|
|
2072
|
+
const F = await i.loadAsync(_, A), y = new Ge({ color: 11184810, specular: 1118481, shininess: 200 });
|
|
2073
|
+
m = new q0(F, y);
|
|
2079
2074
|
break;
|
|
2080
2075
|
case "gltf":
|
|
2081
|
-
|
|
2076
|
+
m = (await c.loadAsync(_, A)).scene;
|
|
2082
2077
|
break;
|
|
2083
2078
|
case "glb":
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
f.setDecoderPath(O), f.preload();
|
|
2088
|
-
}
|
|
2089
|
-
c.setDRACOLoader(f), j = (await c.loadAsync(A, F)).scene;
|
|
2079
|
+
f || (f = new F2(), f._loadLibrary = function(T, P) {
|
|
2080
|
+
return T === "draco_decoder.js" && P === "text" ? Promise.resolve(N2) : Promise.reject(new Error(`DRACOLoader: 未预期的库请求 ${T}`));
|
|
2081
|
+
}, f.setDecoderConfig({ type: "js" }), f.preload()), c.setDRACOLoader(f), m = (await c.loadAsync(_, A)).scene;
|
|
2090
2082
|
break;
|
|
2091
2083
|
default:
|
|
2092
|
-
console.warn(`不支持的文件类型: .${
|
|
2084
|
+
console.warn(`不支持的文件类型: .${g}`), e.value = `不支持的文件类型: ${u}`;
|
|
2093
2085
|
continue;
|
|
2094
2086
|
}
|
|
2095
|
-
|
|
2087
|
+
m && (m.userData.boundingBox = new V0().setFromObject(m), s.push(m));
|
|
2096
2088
|
}
|
|
2097
|
-
a.value =
|
|
2089
|
+
a.value = s, e.value = "加载完成!";
|
|
2098
2090
|
} catch (h) {
|
|
2099
2091
|
throw console.error("加载模型时出错:", h), r.value = `加载失败: ${h.message || "未知错误"}`, e.value = "加载失败!", a.value = [], h;
|
|
2100
2092
|
} finally {
|
|
2101
|
-
k.value = !1,
|
|
2093
|
+
k.value = !1, o.forEach((h) => URL.revokeObjectURL(h));
|
|
2102
2094
|
}
|
|
2103
2095
|
}
|
|
2104
2096
|
};
|
|
@@ -2123,7 +2115,7 @@ const R2 = { class: "obj-viewer-container" }, M2 = { class: "buttonGroup-topLeft
|
|
|
2123
2115
|
fileBlobs: { default: () => [] }
|
|
2124
2116
|
},
|
|
2125
2117
|
setup(k) {
|
|
2126
|
-
const e = k, a =
|
|
2118
|
+
const e = k, a = S(null), r = S(!1), b = S(""), {
|
|
2127
2119
|
threeInfo: {
|
|
2128
2120
|
currentModels: H,
|
|
2129
2121
|
resetView: i,
|
|
@@ -2136,120 +2128,120 @@ const R2 = { class: "obj-viewer-container" }, M2 = { class: "buttonGroup-topLeft
|
|
|
2136
2128
|
toggleAxesVisibility: s
|
|
2137
2129
|
},
|
|
2138
2130
|
modelLoader: {
|
|
2139
|
-
isLoading:
|
|
2140
|
-
loadingProgress:
|
|
2141
|
-
loadedModels:
|
|
2142
|
-
error:
|
|
2131
|
+
isLoading: l,
|
|
2132
|
+
loadingProgress: h,
|
|
2133
|
+
loadedModels: u,
|
|
2134
|
+
error: g,
|
|
2143
2135
|
loadModelsFromBlobs: _
|
|
2144
2136
|
},
|
|
2145
|
-
animation: { isAnimating: m, toggleAnimation: A, startAnimation:
|
|
2137
|
+
animation: { isAnimating: m, toggleAnimation: A, startAnimation: I, stopAnimation: F },
|
|
2146
2138
|
clipping: {
|
|
2147
|
-
isClipping:
|
|
2148
|
-
activeClippingAxis:
|
|
2139
|
+
isClipping: y,
|
|
2140
|
+
activeClippingAxis: O,
|
|
2149
2141
|
toggleClipping: N,
|
|
2150
|
-
updateClippingPlanes:
|
|
2142
|
+
updateClippingPlanes: T
|
|
2151
2143
|
}
|
|
2152
2144
|
} = T2(a, {
|
|
2153
2145
|
useModelLoaderHook: !0,
|
|
2154
2146
|
useAnimationHook: !0,
|
|
2155
2147
|
useClippingHook: !0
|
|
2156
|
-
}),
|
|
2148
|
+
}), P = () => {
|
|
2157
2149
|
s();
|
|
2158
|
-
},
|
|
2159
|
-
|
|
2150
|
+
}, Y = (j) => {
|
|
2151
|
+
O.value = j, T();
|
|
2160
2152
|
};
|
|
2161
|
-
e0(() => e.fileBlobs, (
|
|
2162
|
-
|
|
2153
|
+
e0(() => e.fileBlobs, (j) => {
|
|
2154
|
+
j && j.length > 0 && _(j).catch((R) => {
|
|
2163
2155
|
console.error("加载错误:", R);
|
|
2164
2156
|
});
|
|
2165
2157
|
}, {
|
|
2166
2158
|
immediate: !0,
|
|
2167
2159
|
deep: !0
|
|
2168
|
-
}), e0(
|
|
2169
|
-
|
|
2170
|
-
}), e0(
|
|
2171
|
-
|
|
2160
|
+
}), e0(u, (j) => {
|
|
2161
|
+
j && j.length > 0 && d(j);
|
|
2162
|
+
}), e0(g, (j) => {
|
|
2163
|
+
j && I0.error(`模型加载失败: ${j}`);
|
|
2172
2164
|
});
|
|
2173
|
-
const
|
|
2174
|
-
r.value = !0, b.value =
|
|
2165
|
+
const u0 = (j) => {
|
|
2166
|
+
r.value = !0, b.value = j, j === "剖面视图" && !y.value && N();
|
|
2175
2167
|
};
|
|
2176
|
-
let
|
|
2168
|
+
let K = null;
|
|
2177
2169
|
return z0(async () => {
|
|
2178
2170
|
await Q0();
|
|
2179
2171
|
try {
|
|
2180
|
-
c(), a.value && (
|
|
2181
|
-
} catch (
|
|
2182
|
-
console.error("Three.js 初始化失败:",
|
|
2172
|
+
c(), a.value && (K = new ResizeObserver(f), K.observe(a.value));
|
|
2173
|
+
} catch (j) {
|
|
2174
|
+
console.error("Three.js 初始化失败:", j), I0.error("渲染引擎初始化失败!");
|
|
2183
2175
|
}
|
|
2184
2176
|
}), J0(() => {
|
|
2185
|
-
b.value = "",
|
|
2186
|
-
}), (
|
|
2177
|
+
b.value = "", K && K.disconnect(), m.value && F(), n();
|
|
2178
|
+
}), (j, R) => {
|
|
2187
2179
|
const C0 = Y0("el-scrollbar");
|
|
2188
2180
|
return a0(), l0("div", R2, [
|
|
2189
|
-
|
|
2181
|
+
v("div", {
|
|
2190
2182
|
ref_key: "threejsContainer",
|
|
2191
2183
|
ref: a,
|
|
2192
2184
|
class: "threejs-container"
|
|
2193
2185
|
}, null, 512),
|
|
2194
|
-
|
|
2195
|
-
|
|
2186
|
+
v("div", M2, [
|
|
2187
|
+
q(W, {
|
|
2196
2188
|
name: "viewReset",
|
|
2197
2189
|
size: "24",
|
|
2198
|
-
onClick:
|
|
2190
|
+
onClick: B(i),
|
|
2199
2191
|
title: "重置"
|
|
2200
2192
|
}, null, 8, ["onClick"]),
|
|
2201
|
-
|
|
2193
|
+
q(W, {
|
|
2202
2194
|
name: "fangda",
|
|
2203
2195
|
size: "24",
|
|
2204
2196
|
title: "放大"
|
|
2205
2197
|
}),
|
|
2206
|
-
|
|
2198
|
+
q(W, {
|
|
2207
2199
|
name: "suoxiao",
|
|
2208
2200
|
size: "24",
|
|
2209
2201
|
title: "缩小"
|
|
2210
2202
|
}),
|
|
2211
|
-
|
|
2203
|
+
q(W, {
|
|
2212
2204
|
name: "lookAround",
|
|
2213
2205
|
size: "24",
|
|
2214
|
-
onClick:
|
|
2215
|
-
title:
|
|
2206
|
+
onClick: B(A),
|
|
2207
|
+
title: B(m) ? "停止动画" : "动画视图"
|
|
2216
2208
|
}, null, 8, ["onClick", "title"]),
|
|
2217
|
-
|
|
2209
|
+
q(W, {
|
|
2218
2210
|
name: "zuobiaoxi",
|
|
2219
2211
|
size: "24",
|
|
2220
|
-
active:
|
|
2221
|
-
onClick:
|
|
2212
|
+
active: B(o),
|
|
2213
|
+
onClick: P,
|
|
2222
2214
|
title: "显隐坐标轴"
|
|
2223
2215
|
}, null, 8, ["active"])
|
|
2224
2216
|
]),
|
|
2225
|
-
|
|
2226
|
-
g0(
|
|
2227
|
-
|
|
2217
|
+
v("div", D2, [
|
|
2218
|
+
g0(j.$slots, "button-left", { switchRightPanel: u0 }, void 0, !0),
|
|
2219
|
+
q(W, {
|
|
2228
2220
|
name: "clipping",
|
|
2229
2221
|
size: "24",
|
|
2230
|
-
onClick: R[0] || (R[0] = (S0) =>
|
|
2222
|
+
onClick: R[0] || (R[0] = (S0) => u0("剖面视图")),
|
|
2231
2223
|
active: r.value && b.value === "剖面视图",
|
|
2232
2224
|
title: "剖面视图"
|
|
2233
2225
|
}, null, 8, ["active"])
|
|
2234
2226
|
]),
|
|
2235
|
-
|
|
2236
|
-
g0(
|
|
2227
|
+
v("div", O2, [
|
|
2228
|
+
g0(j.$slots, "button-right", {}, void 0, !0)
|
|
2237
2229
|
]),
|
|
2238
|
-
R[3] || (R[3] =
|
|
2239
|
-
K0(
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2230
|
+
R[3] || (R[3] = v("div", { class: "buttonGroup-bottom" }, null, -1)),
|
|
2231
|
+
K0(v("div", E2, [
|
|
2232
|
+
v("div", G2, [
|
|
2233
|
+
v("span", null, _0(b.value), 1),
|
|
2234
|
+
v("span", {
|
|
2243
2235
|
class: "close",
|
|
2244
2236
|
onClick: R[1] || (R[1] = (S0) => r.value = !1)
|
|
2245
2237
|
}, " X ")
|
|
2246
2238
|
]),
|
|
2247
|
-
|
|
2239
|
+
q(C0, { "max-height": "650px" }, {
|
|
2248
2240
|
default: X0(() => [
|
|
2249
2241
|
b.value === "剖面视图" ? (a0(), $0(Be, {
|
|
2250
2242
|
key: 0,
|
|
2251
|
-
value:
|
|
2252
|
-
onChange:
|
|
2243
|
+
value: B(O),
|
|
2244
|
+
onChange: Y
|
|
2253
2245
|
}, null, 8, ["value"])) : h0("", !0)
|
|
2254
2246
|
]),
|
|
2255
2247
|
_: 1
|
|
@@ -2257,9 +2249,9 @@ const R2 = { class: "obj-viewer-container" }, M2 = { class: "buttonGroup-topLeft
|
|
|
2257
2249
|
], 512), [
|
|
2258
2250
|
[ee, r.value]
|
|
2259
2251
|
]),
|
|
2260
|
-
|
|
2261
|
-
R[2] || (R[2] =
|
|
2262
|
-
|
|
2252
|
+
B(l) ? (a0(), l0("div", U2, [
|
|
2253
|
+
R[2] || (R[2] = v("div", { class: "loading-spinner" }, null, -1)),
|
|
2254
|
+
v("p", null, _0(B(h)), 1)
|
|
2263
2255
|
])) : h0("", !0)
|
|
2264
2256
|
]);
|
|
2265
2257
|
};
|