ss-component-new 1.3.614 → 1.3.615
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/JSEncrypt-B36c1iN5.js +1983 -0
- package/dist/{MTLLoader-B6ottYFV.js → MTLLoader-BL2uYkTJ.js} +2 -2
- package/dist/{OrbitControls-BFVKU7s-.js → OrbitControls-Zyj23qrC.js} +1 -1
- package/dist/{URDFLoader-CH-7Pzmq.js → URDFLoader-CRx5L75v.js} +584 -589
- package/dist/{animationData-F0z3GN7j.js → animationData-CJQE6_nu.js} +3 -3
- package/dist/{array-DZZ1aQEC.js → array-CKTk7Sq_.js} +14 -13
- package/dist/{clone-MyfSNInd.js → clone-ESeDvnJv.js} +1 -1
- package/dist/{eleIcon-BoKZ_PzU.js → eleIcon-C7Pz9jha.js} +2 -2
- package/dist/{iconfont-BJYdStg5.js → iconfont-DZGSkx-_.js} +247 -396
- package/dist/{index-CbFYfzNE.js → index--FPbFJB2.js} +6 -6
- package/dist/{index-DJrzqi4-.js → index-11kpzK0A.js} +17 -17
- package/dist/{index-BvtOLltL.js → index-B0M1YCUY.js} +7 -7
- package/dist/{index-aTEfnfYn.js → index-BA1kJZth.js} +40 -36
- package/dist/{index-CT1LWsrT.js → index-BBBCr4Oo.js} +2 -2
- package/dist/{index-dD-mKgue.js → index-BHtNKL1L.js} +2 -2
- package/dist/{index-CznUP1Ek.js → index-BJFXtH-X.js} +3 -3
- package/dist/{index-DcPtyCDm.js → index-BUqviBFi.js} +35 -29
- package/dist/{index-B2LYEScO.js → index-BXh02EAd.js} +4 -4
- package/dist/{index-CkO7j_i1.js → index-B_fRppeJ.js} +8 -8
- package/dist/index-BmaW6Me9.js +572 -0
- package/dist/{index-6qXeMn6b.js → index-BvkIoiVW.js} +3 -3
- package/dist/{index-DIVct0z6.js → index-C3pboX9W.js} +5 -5
- package/dist/{index-BkkvdZXm.js → index-CPW7tdrA.js} +20 -17
- package/dist/{index-CXqqIuf-.js → index-CTicGWoS.js} +3 -3
- package/dist/{index-BybrpYzx.js → index-CX8Apbo7.js} +1 -1
- package/dist/{index-DI44qg1B.js → index-Cn33Gz2z.js} +616 -587
- package/dist/{index-DmILGKv9.js → index-D1E8EPxn.js} +61 -57
- package/dist/{index-B8NQAdR4.js → index-D8UY4uNQ.js} +967 -966
- package/dist/{index-CYjsE5Gs.js → index-D9xMYIes.js} +3 -3
- package/dist/{index-C6H6VzYm.js → index-DAs4L0hx.js} +6436 -6878
- package/dist/{index-IT-HvgkV.js → index-Dd-8nw2f.js} +20 -18
- package/dist/{index-pMtaHLbt.js → index-DjSJhlad.js} +62 -60
- package/dist/{index-hg0CdgKe.js → index-DkumSU1-.js} +4 -4
- package/dist/{index-CvZcm-Tt.js → index-DlQXFCw8.js} +8 -7
- package/dist/{index-BvyM6d06.js → index-DsdWSuDi.js} +483 -482
- package/dist/{index-DCY5J8nu.js → index-XvX6TMzr.js} +1 -1
- package/dist/{index-B4NcYIuS.js → index-YvUJL9Us.js} +1 -1
- package/dist/{index-BskHs38T.js → index-cYgzND1g.js} +8594 -8615
- package/dist/{index-BFS4iFyT.js → index-gXFBfuoD.js} +8 -8
- package/dist/{index-TgVsU-aK.js → index-obXIOkF7.js} +4 -4
- package/dist/{index-BFqUz4pN.js → index-rlStojTL.js} +1 -1
- package/dist/{index-DEbrqw2f.js → index-t9LvhXac.js} +5 -5
- package/dist/{index-CM6aWexA.js → index-tMqKF2l6.js} +2 -2
- package/dist/{index-BCb4e7gH.js → index-tniD_xHN.js} +157 -148
- package/dist/{index.vue_vue_type_script_setup_true_lang-DwbHXtUp.js → index.vue_vue_type_script_setup_true_lang-DRzriV-s.js} +2 -2
- package/dist/{index.vue_vue_type_style_index_0_scoped_39e1db95_lang-Dp7tIi0S.js → index.vue_vue_type_style_index_0_scoped_39e1db95_lang-X_k372gl.js} +27735 -27760
- package/dist/isString-BlNsHiyU.js +8 -0
- package/dist/{localIcon-CoJHw5ss.js → localIcon-D5UoFBU5.js} +1 -1
- package/dist/{main-DMRXk1rO.js → main-DgwLoFSd.js} +9 -9
- package/dist/{menuIndex-BiUB7t5q.js → menuIndex-DAW9B-9g.js} +1 -1
- package/dist/obj/model.mtl +42 -0
- package/dist/obj/model.obj +26110 -0
- package/dist/{request-BfrhYBTM.js → request-B1c8BUkR.js} +3075 -3493
- package/dist/ss-component.css +3 -3
- package/dist/ss-component.js +14 -14
- package/dist/ss-component2.js +13 -13
- package/dist/ss-component3.js +1 -1
- package/dist/svgIcon-4u4PW7Is.js +42 -0
- package/dist/{threeModel-gP4XEBBx.js → threeModel-Df46gQvy.js} +174 -174
- package/dist/{threePreview-CpcrqmFS.js → threePreview-C4Ra7sjU.js} +554 -554
- package/dist/threeSceneView-tLPMhgrS.js +1291 -0
- package/dist/{threeSceneViewForCPMPIP-DuORHSj3.js → threeSceneViewForCPMPIP-DZ5wkTWo.js} +208 -207
- package/dist/{threeTrackPathView-Bw6e-quT.js → threeTrackPathView-DT80eKxv.js} +25 -25
- package/dist/{threeViewerHost-BPdmCSow.js → threeViewerHost-t6BRTmw8.js} +4 -4
- package/dist/urdfTree-Bu7OVUsr.js +404 -0
- package/dist/{workpieceTreePanel-XH9mYAT2.js → workpieceTreePanel-CuXFoEjJ.js} +60 -56
- package/package.json +1 -1
- package/public/obj/model.mtl +42 -0
- package/public/obj/model.obj +26110 -0
- package/dist/index-BmHnPjUq.js +0 -2623
- package/dist/isString-Dxm3W5iX.js +0 -8
- package/dist/svgIcon-4m2zaZkj.js +0 -42
- package/dist/threeSceneView-CWlU0pao.js +0 -1290
- package/dist/urdfTree-DU02c_91.js +0 -254
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ref as S, shallowRef as
|
|
2
|
-
import { ak as
|
|
3
|
-
import "./index-
|
|
4
|
-
import { u as
|
|
5
|
-
import { M as
|
|
6
|
-
import { T as W } from "./svgIcon-
|
|
7
|
-
import { E as
|
|
8
|
-
import { _ as
|
|
9
|
-
function
|
|
10
|
-
if (e ===
|
|
1
|
+
import { ref as S, shallowRef as S0, defineComponent as L0, watch as e0, onMounted as Z0, nextTick as z0, onBeforeUnmount as Q0, resolveComponent as J0, createElementBlock as u0, openBlock as a0, createElementVNode as v, withDirectives as Y0, createCommentVNode as l0, createVNode as q, unref as B, renderSlot as h0, toDisplayString as g0, withCtx as K0, createBlock as X0, vShow as $0 } from "vue";
|
|
2
|
+
import { ak as ee, al as t0, am as v0, R as T0, an as J, U as X, ao as D, ap as R0, C as x, aq as M, c as U, ar as ae, j as be, D as ie, n as $, V as C, as as He, at as M0, au as re, av as D0, aw as fe, ax as ce, a1 as Y, ay as te, az as O0, aA as de, aB as ne, aC as oe, aD as d0, aE as E0, aF as n0, aG as ke, aH as se, _ as ue, aI as b0, a2 as le, t as G0, l as he, aJ as Q, aK as ge, u as U0, aL as _e, h as x0, aM as Ae, w as pe, aN as me, $ as je, s as i0, P as Ie, o as ye, aO as Fe, aP as we, aQ as Ne, aR as ve, aS as Te, aT as q0, aU as Re, aV as _0, aW as A0, aX as p0, aY as m0, aZ as o0, a4 as Me, a_ as De, B as B0, a$ as Oe, k as Ee } from "./index.vue_vue_type_style_index_0_scoped_39e1db95_lang-X_k372gl.js";
|
|
3
|
+
import "./index-D8UY4uNQ.js";
|
|
4
|
+
import { u as Ge, C as Ue } from "./iconfont-DZGSkx-_.js";
|
|
5
|
+
import { M as xe, O as qe, S as Be } from "./MTLLoader-BL2uYkTJ.js";
|
|
6
|
+
import { T as W } from "./svgIcon-4u4PW7Is.js";
|
|
7
|
+
import { E as j0 } from "./request-B1c8BUkR.js";
|
|
8
|
+
import { _ as Ve } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
|
+
function I0(k, e) {
|
|
10
|
+
if (e === ee)
|
|
11
11
|
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), k;
|
|
12
|
-
if (e === t0 || e ===
|
|
12
|
+
if (e === t0 || e === v0) {
|
|
13
13
|
let a = k.getIndex();
|
|
14
14
|
if (a === null) {
|
|
15
15
|
const i = [], c = k.getAttribute("position");
|
|
@@ -20,20 +20,20 @@ function y0(k, e) {
|
|
|
20
20
|
} else
|
|
21
21
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), k;
|
|
22
22
|
}
|
|
23
|
-
const
|
|
23
|
+
const H = a.count - 2, b = [];
|
|
24
24
|
if (e === t0)
|
|
25
|
-
for (let i = 1; i <=
|
|
25
|
+
for (let i = 1; i <= H; i++)
|
|
26
26
|
b.push(a.getX(0)), b.push(a.getX(i)), b.push(a.getX(i + 1));
|
|
27
27
|
else
|
|
28
|
-
for (let i = 0; i <
|
|
28
|
+
for (let i = 0; i < H; i++)
|
|
29
29
|
i % 2 === 0 ? (b.push(a.getX(i)), b.push(a.getX(i + 1)), b.push(a.getX(i + 2))) : (b.push(a.getX(i + 2)), b.push(a.getX(i + 1)), b.push(a.getX(i)));
|
|
30
|
-
b.length / 3 !==
|
|
31
|
-
const
|
|
32
|
-
return
|
|
30
|
+
b.length / 3 !== H && console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");
|
|
31
|
+
const r = k.clone();
|
|
32
|
+
return r.setIndex(b), r.clearGroups(), r;
|
|
33
33
|
} else
|
|
34
34
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e), k;
|
|
35
35
|
}
|
|
36
|
-
class
|
|
36
|
+
class Pe extends T0 {
|
|
37
37
|
/**
|
|
38
38
|
* Constructs a new glTF loader.
|
|
39
39
|
*
|
|
@@ -41,39 +41,39 @@ class Se extends R0 {
|
|
|
41
41
|
*/
|
|
42
42
|
constructor(e) {
|
|
43
43
|
super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(a) {
|
|
44
|
-
return new
|
|
44
|
+
return new Ze(a);
|
|
45
45
|
}), this.register(function(a) {
|
|
46
|
-
return new
|
|
46
|
+
return new ze(a);
|
|
47
47
|
}), this.register(function(a) {
|
|
48
|
-
return new
|
|
48
|
+
return new b2(a);
|
|
49
49
|
}), this.register(function(a) {
|
|
50
|
-
return new
|
|
50
|
+
return new i2(a);
|
|
51
51
|
}), this.register(function(a) {
|
|
52
|
-
return new
|
|
52
|
+
return new H2(a);
|
|
53
53
|
}), this.register(function(a) {
|
|
54
|
-
return new
|
|
54
|
+
return new Je(a);
|
|
55
55
|
}), this.register(function(a) {
|
|
56
|
-
return new
|
|
56
|
+
return new Ye(a);
|
|
57
57
|
}), this.register(function(a) {
|
|
58
|
-
return new
|
|
58
|
+
return new Ke(a);
|
|
59
59
|
}), this.register(function(a) {
|
|
60
|
-
return new
|
|
60
|
+
return new Xe(a);
|
|
61
61
|
}), this.register(function(a) {
|
|
62
|
-
return new
|
|
62
|
+
return new Le(a);
|
|
63
63
|
}), this.register(function(a) {
|
|
64
|
-
return new
|
|
64
|
+
return new $e(a);
|
|
65
65
|
}), this.register(function(a) {
|
|
66
|
-
return new
|
|
66
|
+
return new Qe(a);
|
|
67
67
|
}), this.register(function(a) {
|
|
68
|
-
return new
|
|
68
|
+
return new a2(a);
|
|
69
69
|
}), this.register(function(a) {
|
|
70
|
-
return new
|
|
70
|
+
return new e2(a);
|
|
71
71
|
}), this.register(function(a) {
|
|
72
|
-
return new
|
|
72
|
+
return new Ce(a);
|
|
73
73
|
}), this.register(function(a) {
|
|
74
|
-
return new
|
|
74
|
+
return new r2(a);
|
|
75
75
|
}), this.register(function(a) {
|
|
76
|
-
return new
|
|
76
|
+
return new f2(a);
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
@@ -85,29 +85,29 @@ class Se extends R0 {
|
|
|
85
85
|
* @param {onProgressCallback} onProgress - Executed while the loading is in progress.
|
|
86
86
|
* @param {onErrorCallback} onError - Executed when errors occur.
|
|
87
87
|
*/
|
|
88
|
-
load(e, a,
|
|
89
|
-
const
|
|
88
|
+
load(e, a, H, b) {
|
|
89
|
+
const r = this;
|
|
90
90
|
let i;
|
|
91
91
|
if (this.resourcePath !== "")
|
|
92
92
|
i = this.resourcePath;
|
|
93
93
|
else if (this.path !== "") {
|
|
94
|
-
const t =
|
|
95
|
-
i =
|
|
94
|
+
const t = J.extractUrlBase(e);
|
|
95
|
+
i = J.resolveURL(t, this.path);
|
|
96
96
|
} else
|
|
97
|
-
i =
|
|
97
|
+
i = J.extractUrlBase(e);
|
|
98
98
|
this.manager.itemStart(e);
|
|
99
99
|
const c = function(t) {
|
|
100
|
-
b ? b(t) : console.error(t),
|
|
100
|
+
b ? b(t) : console.error(t), r.manager.itemError(e), r.manager.itemEnd(e);
|
|
101
101
|
}, f = new X(this.manager);
|
|
102
102
|
f.setPath(this.path), f.setResponseType("arraybuffer"), f.setRequestHeader(this.requestHeader), f.setWithCredentials(this.withCredentials), f.load(e, function(t) {
|
|
103
103
|
try {
|
|
104
|
-
|
|
105
|
-
a(n),
|
|
104
|
+
r.parse(t, i, function(n) {
|
|
105
|
+
a(n), r.manager.itemEnd(e);
|
|
106
106
|
}, c);
|
|
107
107
|
} catch (n) {
|
|
108
108
|
c(n);
|
|
109
109
|
}
|
|
110
|
-
},
|
|
110
|
+
}, H, c);
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
113
|
* Sets the given Draco loader to this loader. Required for decoding assets
|
|
@@ -167,29 +167,29 @@ class Se extends R0 {
|
|
|
167
167
|
* @param {function(GLTFLoader~LoadObject)} onLoad - Executed when the loading process has been finished.
|
|
168
168
|
* @param {onErrorCallback} onError - Executed when errors occur.
|
|
169
169
|
*/
|
|
170
|
-
parse(e, a,
|
|
171
|
-
let
|
|
170
|
+
parse(e, a, H, b) {
|
|
171
|
+
let r;
|
|
172
172
|
const i = {}, c = {}, f = new TextDecoder();
|
|
173
173
|
if (typeof e == "string")
|
|
174
|
-
|
|
174
|
+
r = JSON.parse(e);
|
|
175
175
|
else if (e instanceof ArrayBuffer)
|
|
176
|
-
if (f.decode(new Uint8Array(e, 0, 4)) ===
|
|
176
|
+
if (f.decode(new Uint8Array(e, 0, 4)) === V0) {
|
|
177
177
|
try {
|
|
178
|
-
i[p.KHR_BINARY_GLTF] = new
|
|
178
|
+
i[p.KHR_BINARY_GLTF] = new c2(e);
|
|
179
179
|
} catch (d) {
|
|
180
180
|
b && b(d);
|
|
181
181
|
return;
|
|
182
182
|
}
|
|
183
|
-
|
|
183
|
+
r = JSON.parse(i[p.KHR_BINARY_GLTF].content);
|
|
184
184
|
} else
|
|
185
|
-
|
|
185
|
+
r = JSON.parse(f.decode(e));
|
|
186
186
|
else
|
|
187
|
-
|
|
188
|
-
if (
|
|
187
|
+
r = e;
|
|
188
|
+
if (r.asset === void 0 || r.asset.version[0] < 2) {
|
|
189
189
|
b && b(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
|
-
const t = new
|
|
192
|
+
const t = new p2(r, {
|
|
193
193
|
path: a || this.resourcePath || "",
|
|
194
194
|
crossOrigin: this.crossOrigin,
|
|
195
195
|
requestHeader: this.requestHeader,
|
|
@@ -202,27 +202,27 @@ class Se extends R0 {
|
|
|
202
202
|
const d = this.pluginCallbacks[n](t);
|
|
203
203
|
d.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), c[d.name] = d, i[d.name] = !0;
|
|
204
204
|
}
|
|
205
|
-
if (
|
|
206
|
-
for (let n = 0; n <
|
|
207
|
-
const d =
|
|
205
|
+
if (r.extensionsUsed)
|
|
206
|
+
for (let n = 0; n < r.extensionsUsed.length; ++n) {
|
|
207
|
+
const d = r.extensionsUsed[n], o = r.extensionsRequired || [];
|
|
208
208
|
switch (d) {
|
|
209
209
|
case p.KHR_MATERIALS_UNLIT:
|
|
210
|
-
i[d] = new
|
|
210
|
+
i[d] = new Se();
|
|
211
211
|
break;
|
|
212
212
|
case p.KHR_DRACO_MESH_COMPRESSION:
|
|
213
|
-
i[d] = new
|
|
213
|
+
i[d] = new t2(r, this.dracoLoader);
|
|
214
214
|
break;
|
|
215
215
|
case p.KHR_TEXTURE_TRANSFORM:
|
|
216
|
-
i[d] = new
|
|
216
|
+
i[d] = new d2();
|
|
217
217
|
break;
|
|
218
218
|
case p.KHR_MESH_QUANTIZATION:
|
|
219
|
-
i[d] = new
|
|
219
|
+
i[d] = new n2();
|
|
220
220
|
break;
|
|
221
221
|
default:
|
|
222
222
|
o.indexOf(d) >= 0 && c[d] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + d + '".');
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
t.setExtensions(i), t.setPlugins(c), t.parse(
|
|
225
|
+
t.setExtensions(i), t.setPlugins(c), t.parse(H, b);
|
|
226
226
|
}
|
|
227
227
|
/**
|
|
228
228
|
* Async version of {@link GLTFLoader#parse}.
|
|
@@ -233,13 +233,13 @@ class Se extends R0 {
|
|
|
233
233
|
* @return {Promise<GLTFLoader~LoadObject>} A Promise that resolves with the loaded glTF when the parsing has been finished.
|
|
234
234
|
*/
|
|
235
235
|
parseAsync(e, a) {
|
|
236
|
-
const
|
|
237
|
-
return new Promise(function(b,
|
|
238
|
-
|
|
236
|
+
const H = this;
|
|
237
|
+
return new Promise(function(b, r) {
|
|
238
|
+
H.parse(e, a, b, r);
|
|
239
239
|
});
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function We() {
|
|
243
243
|
let k = {};
|
|
244
244
|
return {
|
|
245
245
|
get: function(e) {
|
|
@@ -280,74 +280,74 @@ const p = {
|
|
|
280
280
|
EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression",
|
|
281
281
|
EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
|
|
282
282
|
};
|
|
283
|
-
class
|
|
283
|
+
class Ce {
|
|
284
284
|
constructor(e) {
|
|
285
285
|
this.parser = e, this.name = p.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
|
|
286
286
|
}
|
|
287
287
|
_markDefs() {
|
|
288
288
|
const e = this.parser, a = this.parser.json.nodes || [];
|
|
289
|
-
for (let
|
|
290
|
-
const
|
|
291
|
-
|
|
289
|
+
for (let H = 0, b = a.length; H < b; H++) {
|
|
290
|
+
const r = a[H];
|
|
291
|
+
r.extensions && r.extensions[this.name] && r.extensions[this.name].light !== void 0 && e._addNodeRef(this.cache, r.extensions[this.name].light);
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
_loadLight(e) {
|
|
295
|
-
const a = this.parser,
|
|
296
|
-
let b = a.cache.get(
|
|
295
|
+
const a = this.parser, H = "light:" + e;
|
|
296
|
+
let b = a.cache.get(H);
|
|
297
297
|
if (b) return b;
|
|
298
|
-
const
|
|
298
|
+
const r = a.json, f = ((r.extensions && r.extensions[this.name] || {}).lights || [])[e];
|
|
299
299
|
let t;
|
|
300
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) {
|
|
304
304
|
case "directional":
|
|
305
|
-
t = new
|
|
305
|
+
t = new ie(n), t.target.position.set(0, 0, -1), t.add(t.target);
|
|
306
306
|
break;
|
|
307
307
|
case "point":
|
|
308
|
-
t = new
|
|
308
|
+
t = new be(n), t.distance = d;
|
|
309
309
|
break;
|
|
310
310
|
case "spot":
|
|
311
|
-
t = new
|
|
311
|
+
t = new ae(n), t.distance = d, f.spot = f.spot || {}, f.spot.innerConeAngle = f.spot.innerConeAngle !== void 0 ? f.spot.innerConeAngle : 0, f.spot.outerConeAngle = f.spot.outerConeAngle !== void 0 ? f.spot.outerConeAngle : Math.PI / 4, t.angle = f.spot.outerConeAngle, t.penumbra = 1 - f.spot.innerConeAngle / f.spot.outerConeAngle, t.target.position.set(0, 0, -1), t.add(t.target);
|
|
312
312
|
break;
|
|
313
313
|
default:
|
|
314
314
|
throw new Error("THREE.GLTFLoader: Unexpected light type: " + f.type);
|
|
315
315
|
}
|
|
316
|
-
return t.position.set(0, 0, 0),
|
|
316
|
+
return t.position.set(0, 0, 0), O(t, f), f.intensity !== void 0 && (t.intensity = f.intensity), t.name = a.createUniqueName(f.name || "light_" + e), b = Promise.resolve(t), a.cache.add(H, b), b;
|
|
317
317
|
}
|
|
318
318
|
getDependency(e, a) {
|
|
319
319
|
if (e === "light")
|
|
320
320
|
return this._loadLight(a);
|
|
321
321
|
}
|
|
322
322
|
createNodeAttachment(e) {
|
|
323
|
-
const a = this,
|
|
323
|
+
const a = this, H = this.parser, r = H.json.nodes[e], c = (r.extensions && r.extensions[this.name] || {}).light;
|
|
324
324
|
return c === void 0 ? null : this._loadLight(c).then(function(f) {
|
|
325
|
-
return
|
|
325
|
+
return H._getNodeRef(a.cache, c, f);
|
|
326
326
|
});
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
|
-
class
|
|
329
|
+
class Se {
|
|
330
330
|
constructor() {
|
|
331
331
|
this.name = p.KHR_MATERIALS_UNLIT;
|
|
332
332
|
}
|
|
333
333
|
getMaterialType() {
|
|
334
|
-
return
|
|
334
|
+
return Q;
|
|
335
335
|
}
|
|
336
|
-
extendParams(e, a,
|
|
336
|
+
extendParams(e, a, H) {
|
|
337
337
|
const b = [];
|
|
338
338
|
e.color = new x(1, 1, 1), e.opacity = 1;
|
|
339
|
-
const
|
|
340
|
-
if (
|
|
341
|
-
if (Array.isArray(
|
|
342
|
-
const i =
|
|
339
|
+
const r = a.pbrMetallicRoughness;
|
|
340
|
+
if (r) {
|
|
341
|
+
if (Array.isArray(r.baseColorFactor)) {
|
|
342
|
+
const i = r.baseColorFactor;
|
|
343
343
|
e.color.setRGB(i[0], i[1], i[2], M), e.opacity = i[3];
|
|
344
344
|
}
|
|
345
|
-
|
|
345
|
+
r.baseColorTexture !== void 0 && b.push(H.assignTexture(e, "map", r.baseColorTexture, U));
|
|
346
346
|
}
|
|
347
347
|
return Promise.all(b);
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
-
class
|
|
350
|
+
class Le {
|
|
351
351
|
constructor(e) {
|
|
352
352
|
this.parser = e, this.name = p.KHR_MATERIALS_EMISSIVE_STRENGTH;
|
|
353
353
|
}
|
|
@@ -355,249 +355,249 @@ class Qe {
|
|
|
355
355
|
const b = this.parser.json.materials[e];
|
|
356
356
|
if (!b.extensions || !b.extensions[this.name])
|
|
357
357
|
return Promise.resolve();
|
|
358
|
-
const
|
|
359
|
-
return
|
|
358
|
+
const r = b.extensions[this.name].emissiveStrength;
|
|
359
|
+
return r !== void 0 && (a.emissiveIntensity = r), Promise.resolve();
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
class
|
|
362
|
+
class Ze {
|
|
363
363
|
constructor(e) {
|
|
364
364
|
this.parser = e, this.name = p.KHR_MATERIALS_CLEARCOAT;
|
|
365
365
|
}
|
|
366
366
|
getMaterialType(e) {
|
|
367
|
-
const
|
|
368
|
-
return !
|
|
367
|
+
const H = this.parser.json.materials[e];
|
|
368
|
+
return !H.extensions || !H.extensions[this.name] ? null : D;
|
|
369
369
|
}
|
|
370
370
|
extendMaterialParams(e, a) {
|
|
371
|
-
const
|
|
371
|
+
const H = this.parser, b = H.json.materials[e];
|
|
372
372
|
if (!b.extensions || !b.extensions[this.name])
|
|
373
373
|
return Promise.resolve();
|
|
374
|
-
const
|
|
375
|
-
if (i.clearcoatFactor !== void 0 && (a.clearcoat = i.clearcoatFactor), i.clearcoatTexture !== void 0 &&
|
|
374
|
+
const r = [], i = b.extensions[this.name];
|
|
375
|
+
if (i.clearcoatFactor !== void 0 && (a.clearcoat = i.clearcoatFactor), i.clearcoatTexture !== void 0 && r.push(H.assignTexture(a, "clearcoatMap", i.clearcoatTexture)), i.clearcoatRoughnessFactor !== void 0 && (a.clearcoatRoughness = i.clearcoatRoughnessFactor), i.clearcoatRoughnessTexture !== void 0 && r.push(H.assignTexture(a, "clearcoatRoughnessMap", i.clearcoatRoughnessTexture)), i.clearcoatNormalTexture !== void 0 && (r.push(H.assignTexture(a, "clearcoatNormalMap", i.clearcoatNormalTexture)), i.clearcoatNormalTexture.scale !== void 0)) {
|
|
376
376
|
const c = i.clearcoatNormalTexture.scale;
|
|
377
|
-
a.clearcoatNormalScale = new
|
|
377
|
+
a.clearcoatNormalScale = new R0(c, c);
|
|
378
378
|
}
|
|
379
|
-
return Promise.all(
|
|
379
|
+
return Promise.all(r);
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
|
-
class
|
|
382
|
+
class ze {
|
|
383
383
|
constructor(e) {
|
|
384
384
|
this.parser = e, this.name = p.KHR_MATERIALS_DISPERSION;
|
|
385
385
|
}
|
|
386
386
|
getMaterialType(e) {
|
|
387
|
-
const
|
|
388
|
-
return !
|
|
387
|
+
const H = this.parser.json.materials[e];
|
|
388
|
+
return !H.extensions || !H.extensions[this.name] ? null : D;
|
|
389
389
|
}
|
|
390
390
|
extendMaterialParams(e, a) {
|
|
391
391
|
const b = this.parser.json.materials[e];
|
|
392
392
|
if (!b.extensions || !b.extensions[this.name])
|
|
393
393
|
return Promise.resolve();
|
|
394
|
-
const
|
|
395
|
-
return a.dispersion =
|
|
394
|
+
const r = b.extensions[this.name];
|
|
395
|
+
return a.dispersion = r.dispersion !== void 0 ? r.dispersion : 0, Promise.resolve();
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
|
-
class
|
|
398
|
+
class Qe {
|
|
399
399
|
constructor(e) {
|
|
400
400
|
this.parser = e, this.name = p.KHR_MATERIALS_IRIDESCENCE;
|
|
401
401
|
}
|
|
402
402
|
getMaterialType(e) {
|
|
403
|
-
const
|
|
404
|
-
return !
|
|
403
|
+
const H = this.parser.json.materials[e];
|
|
404
|
+
return !H.extensions || !H.extensions[this.name] ? null : D;
|
|
405
405
|
}
|
|
406
406
|
extendMaterialParams(e, a) {
|
|
407
|
-
const
|
|
407
|
+
const H = this.parser, b = H.json.materials[e];
|
|
408
408
|
if (!b.extensions || !b.extensions[this.name])
|
|
409
409
|
return Promise.resolve();
|
|
410
|
-
const
|
|
411
|
-
return i.iridescenceFactor !== void 0 && (a.iridescence = i.iridescenceFactor), i.iridescenceTexture !== void 0 &&
|
|
410
|
+
const r = [], i = b.extensions[this.name];
|
|
411
|
+
return i.iridescenceFactor !== void 0 && (a.iridescence = i.iridescenceFactor), i.iridescenceTexture !== void 0 && r.push(H.assignTexture(a, "iridescenceMap", i.iridescenceTexture)), i.iridescenceIor !== void 0 && (a.iridescenceIOR = i.iridescenceIor), a.iridescenceThicknessRange === void 0 && (a.iridescenceThicknessRange = [100, 400]), i.iridescenceThicknessMinimum !== void 0 && (a.iridescenceThicknessRange[0] = i.iridescenceThicknessMinimum), i.iridescenceThicknessMaximum !== void 0 && (a.iridescenceThicknessRange[1] = i.iridescenceThicknessMaximum), i.iridescenceThicknessTexture !== void 0 && r.push(H.assignTexture(a, "iridescenceThicknessMap", i.iridescenceThicknessTexture)), Promise.all(r);
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
class
|
|
414
|
+
class Je {
|
|
415
415
|
constructor(e) {
|
|
416
416
|
this.parser = e, this.name = p.KHR_MATERIALS_SHEEN;
|
|
417
417
|
}
|
|
418
418
|
getMaterialType(e) {
|
|
419
|
-
const
|
|
420
|
-
return !
|
|
419
|
+
const H = this.parser.json.materials[e];
|
|
420
|
+
return !H.extensions || !H.extensions[this.name] ? null : D;
|
|
421
421
|
}
|
|
422
422
|
extendMaterialParams(e, a) {
|
|
423
|
-
const
|
|
423
|
+
const H = this.parser, b = H.json.materials[e];
|
|
424
424
|
if (!b.extensions || !b.extensions[this.name])
|
|
425
425
|
return Promise.resolve();
|
|
426
|
-
const
|
|
426
|
+
const r = [];
|
|
427
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 &&
|
|
433
|
+
return i.sheenRoughnessFactor !== void 0 && (a.sheenRoughness = i.sheenRoughnessFactor), i.sheenColorTexture !== void 0 && r.push(H.assignTexture(a, "sheenColorMap", i.sheenColorTexture, U)), i.sheenRoughnessTexture !== void 0 && r.push(H.assignTexture(a, "sheenRoughnessMap", i.sheenRoughnessTexture)), Promise.all(r);
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
class
|
|
436
|
+
class Ye {
|
|
437
437
|
constructor(e) {
|
|
438
438
|
this.parser = e, this.name = p.KHR_MATERIALS_TRANSMISSION;
|
|
439
439
|
}
|
|
440
440
|
getMaterialType(e) {
|
|
441
|
-
const
|
|
442
|
-
return !
|
|
441
|
+
const H = this.parser.json.materials[e];
|
|
442
|
+
return !H.extensions || !H.extensions[this.name] ? null : D;
|
|
443
443
|
}
|
|
444
444
|
extendMaterialParams(e, a) {
|
|
445
|
-
const
|
|
445
|
+
const H = this.parser, b = H.json.materials[e];
|
|
446
446
|
if (!b.extensions || !b.extensions[this.name])
|
|
447
447
|
return Promise.resolve();
|
|
448
|
-
const
|
|
449
|
-
return i.transmissionFactor !== void 0 && (a.transmission = i.transmissionFactor), i.transmissionTexture !== void 0 &&
|
|
448
|
+
const r = [], i = b.extensions[this.name];
|
|
449
|
+
return i.transmissionFactor !== void 0 && (a.transmission = i.transmissionFactor), i.transmissionTexture !== void 0 && r.push(H.assignTexture(a, "transmissionMap", i.transmissionTexture)), Promise.all(r);
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
|
-
class
|
|
452
|
+
class Ke {
|
|
453
453
|
constructor(e) {
|
|
454
454
|
this.parser = e, this.name = p.KHR_MATERIALS_VOLUME;
|
|
455
455
|
}
|
|
456
456
|
getMaterialType(e) {
|
|
457
|
-
const
|
|
458
|
-
return !
|
|
457
|
+
const H = this.parser.json.materials[e];
|
|
458
|
+
return !H.extensions || !H.extensions[this.name] ? null : D;
|
|
459
459
|
}
|
|
460
460
|
extendMaterialParams(e, a) {
|
|
461
|
-
const
|
|
461
|
+
const H = this.parser, b = H.json.materials[e];
|
|
462
462
|
if (!b.extensions || !b.extensions[this.name])
|
|
463
463
|
return Promise.resolve();
|
|
464
|
-
const
|
|
465
|
-
a.thickness = i.thicknessFactor !== void 0 ? i.thicknessFactor : 0, i.thicknessTexture !== void 0 &&
|
|
464
|
+
const r = [], i = b.extensions[this.name];
|
|
465
|
+
a.thickness = i.thicknessFactor !== void 0 ? i.thicknessFactor : 0, i.thicknessTexture !== void 0 && r.push(H.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 x().setRGB(c[0], c[1], c[2], M), Promise.all(
|
|
467
|
+
return a.attenuationColor = new x().setRGB(c[0], c[1], c[2], M), Promise.all(r);
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
|
-
class
|
|
470
|
+
class Xe {
|
|
471
471
|
constructor(e) {
|
|
472
472
|
this.parser = e, this.name = p.KHR_MATERIALS_IOR;
|
|
473
473
|
}
|
|
474
474
|
getMaterialType(e) {
|
|
475
|
-
const
|
|
476
|
-
return !
|
|
475
|
+
const H = this.parser.json.materials[e];
|
|
476
|
+
return !H.extensions || !H.extensions[this.name] ? null : D;
|
|
477
477
|
}
|
|
478
478
|
extendMaterialParams(e, a) {
|
|
479
479
|
const b = this.parser.json.materials[e];
|
|
480
480
|
if (!b.extensions || !b.extensions[this.name])
|
|
481
481
|
return Promise.resolve();
|
|
482
|
-
const
|
|
483
|
-
return a.ior =
|
|
482
|
+
const r = b.extensions[this.name];
|
|
483
|
+
return a.ior = r.ior !== void 0 ? r.ior : 1.5, Promise.resolve();
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
|
-
class
|
|
486
|
+
class $e {
|
|
487
487
|
constructor(e) {
|
|
488
488
|
this.parser = e, this.name = p.KHR_MATERIALS_SPECULAR;
|
|
489
489
|
}
|
|
490
490
|
getMaterialType(e) {
|
|
491
|
-
const
|
|
492
|
-
return !
|
|
491
|
+
const H = this.parser.json.materials[e];
|
|
492
|
+
return !H.extensions || !H.extensions[this.name] ? null : D;
|
|
493
493
|
}
|
|
494
494
|
extendMaterialParams(e, a) {
|
|
495
|
-
const
|
|
495
|
+
const H = this.parser, b = H.json.materials[e];
|
|
496
496
|
if (!b.extensions || !b.extensions[this.name])
|
|
497
497
|
return Promise.resolve();
|
|
498
|
-
const
|
|
499
|
-
a.specularIntensity = i.specularFactor !== void 0 ? i.specularFactor : 1, i.specularTexture !== void 0 &&
|
|
498
|
+
const r = [], i = b.extensions[this.name];
|
|
499
|
+
a.specularIntensity = i.specularFactor !== void 0 ? i.specularFactor : 1, i.specularTexture !== void 0 && r.push(H.assignTexture(a, "specularIntensityMap", i.specularTexture));
|
|
500
500
|
const c = i.specularColorFactor || [1, 1, 1];
|
|
501
|
-
return a.specularColor = new x().setRGB(c[0], c[1], c[2], M), i.specularColorTexture !== void 0 &&
|
|
501
|
+
return a.specularColor = new x().setRGB(c[0], c[1], c[2], M), i.specularColorTexture !== void 0 && r.push(H.assignTexture(a, "specularColorMap", i.specularColorTexture, U)), Promise.all(r);
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
|
-
class
|
|
504
|
+
class e2 {
|
|
505
505
|
constructor(e) {
|
|
506
506
|
this.parser = e, this.name = p.EXT_MATERIALS_BUMP;
|
|
507
507
|
}
|
|
508
508
|
getMaterialType(e) {
|
|
509
|
-
const
|
|
510
|
-
return !
|
|
509
|
+
const H = this.parser.json.materials[e];
|
|
510
|
+
return !H.extensions || !H.extensions[this.name] ? null : D;
|
|
511
511
|
}
|
|
512
512
|
extendMaterialParams(e, a) {
|
|
513
|
-
const
|
|
513
|
+
const H = this.parser, b = H.json.materials[e];
|
|
514
514
|
if (!b.extensions || !b.extensions[this.name])
|
|
515
515
|
return Promise.resolve();
|
|
516
|
-
const
|
|
517
|
-
return a.bumpScale = i.bumpFactor !== void 0 ? i.bumpFactor : 1, i.bumpTexture !== void 0 &&
|
|
516
|
+
const r = [], i = b.extensions[this.name];
|
|
517
|
+
return a.bumpScale = i.bumpFactor !== void 0 ? i.bumpFactor : 1, i.bumpTexture !== void 0 && r.push(H.assignTexture(a, "bumpMap", i.bumpTexture)), Promise.all(r);
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
|
-
class
|
|
520
|
+
class a2 {
|
|
521
521
|
constructor(e) {
|
|
522
522
|
this.parser = e, this.name = p.KHR_MATERIALS_ANISOTROPY;
|
|
523
523
|
}
|
|
524
524
|
getMaterialType(e) {
|
|
525
|
-
const
|
|
526
|
-
return !
|
|
525
|
+
const H = this.parser.json.materials[e];
|
|
526
|
+
return !H.extensions || !H.extensions[this.name] ? null : D;
|
|
527
527
|
}
|
|
528
528
|
extendMaterialParams(e, a) {
|
|
529
|
-
const
|
|
529
|
+
const H = this.parser, b = H.json.materials[e];
|
|
530
530
|
if (!b.extensions || !b.extensions[this.name])
|
|
531
531
|
return Promise.resolve();
|
|
532
|
-
const
|
|
533
|
-
return i.anisotropyStrength !== void 0 && (a.anisotropy = i.anisotropyStrength), i.anisotropyRotation !== void 0 && (a.anisotropyRotation = i.anisotropyRotation), i.anisotropyTexture !== void 0 &&
|
|
532
|
+
const r = [], i = b.extensions[this.name];
|
|
533
|
+
return i.anisotropyStrength !== void 0 && (a.anisotropy = i.anisotropyStrength), i.anisotropyRotation !== void 0 && (a.anisotropyRotation = i.anisotropyRotation), i.anisotropyTexture !== void 0 && r.push(H.assignTexture(a, "anisotropyMap", i.anisotropyTexture)), Promise.all(r);
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
|
-
class
|
|
536
|
+
class b2 {
|
|
537
537
|
constructor(e) {
|
|
538
538
|
this.parser = e, this.name = p.KHR_TEXTURE_BASISU;
|
|
539
539
|
}
|
|
540
540
|
loadTexture(e) {
|
|
541
|
-
const a = this.parser,
|
|
541
|
+
const a = this.parser, H = a.json, b = H.textures[e];
|
|
542
542
|
if (!b.extensions || !b.extensions[this.name])
|
|
543
543
|
return null;
|
|
544
|
-
const
|
|
544
|
+
const r = b.extensions[this.name], i = a.options.ktx2Loader;
|
|
545
545
|
if (!i) {
|
|
546
|
-
if (
|
|
546
|
+
if (H.extensionsRequired && H.extensionsRequired.indexOf(this.name) >= 0)
|
|
547
547
|
throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");
|
|
548
548
|
return null;
|
|
549
549
|
}
|
|
550
|
-
return a.loadTextureImage(e,
|
|
550
|
+
return a.loadTextureImage(e, r.source, i);
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
|
-
class
|
|
553
|
+
class i2 {
|
|
554
554
|
constructor(e) {
|
|
555
555
|
this.parser = e, this.name = p.EXT_TEXTURE_WEBP;
|
|
556
556
|
}
|
|
557
557
|
loadTexture(e) {
|
|
558
|
-
const a = this.name,
|
|
559
|
-
if (!
|
|
558
|
+
const a = this.name, H = this.parser, b = H.json, r = b.textures[e];
|
|
559
|
+
if (!r.extensions || !r.extensions[a])
|
|
560
560
|
return null;
|
|
561
|
-
const i =
|
|
562
|
-
let f =
|
|
561
|
+
const i = r.extensions[a], c = b.images[i.source];
|
|
562
|
+
let f = H.textureLoader;
|
|
563
563
|
if (c.uri) {
|
|
564
|
-
const t =
|
|
564
|
+
const t = H.options.manager.getHandler(c.uri);
|
|
565
565
|
t !== null && (f = t);
|
|
566
566
|
}
|
|
567
|
-
return
|
|
567
|
+
return H.loadTextureImage(e, i.source, f);
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
|
-
class
|
|
570
|
+
class H2 {
|
|
571
571
|
constructor(e) {
|
|
572
572
|
this.parser = e, this.name = p.EXT_TEXTURE_AVIF;
|
|
573
573
|
}
|
|
574
574
|
loadTexture(e) {
|
|
575
|
-
const a = this.name,
|
|
576
|
-
if (!
|
|
575
|
+
const a = this.name, H = this.parser, b = H.json, r = b.textures[e];
|
|
576
|
+
if (!r.extensions || !r.extensions[a])
|
|
577
577
|
return null;
|
|
578
|
-
const i =
|
|
579
|
-
let f =
|
|
578
|
+
const i = r.extensions[a], c = b.images[i.source];
|
|
579
|
+
let f = H.textureLoader;
|
|
580
580
|
if (c.uri) {
|
|
581
|
-
const t =
|
|
581
|
+
const t = H.options.manager.getHandler(c.uri);
|
|
582
582
|
t !== null && (f = t);
|
|
583
583
|
}
|
|
584
|
-
return
|
|
584
|
+
return H.loadTextureImage(e, i.source, f);
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
|
-
class
|
|
587
|
+
class r2 {
|
|
588
588
|
constructor(e) {
|
|
589
589
|
this.name = p.EXT_MESHOPT_COMPRESSION, this.parser = e;
|
|
590
590
|
}
|
|
591
591
|
loadBufferView(e) {
|
|
592
|
-
const a = this.parser.json,
|
|
593
|
-
if (
|
|
594
|
-
const b =
|
|
592
|
+
const a = this.parser.json, H = a.bufferViews[e];
|
|
593
|
+
if (H.extensions && H.extensions[this.name]) {
|
|
594
|
+
const b = H.extensions[this.name], r = this.parser.getDependency("buffer", b.buffer), i = this.parser.options.meshoptDecoder;
|
|
595
595
|
if (!i || !i.supported) {
|
|
596
596
|
if (a.extensionsRequired && a.extensionsRequired.indexOf(this.name) >= 0)
|
|
597
597
|
throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");
|
|
598
598
|
return null;
|
|
599
599
|
}
|
|
600
|
-
return
|
|
600
|
+
return r.then(function(c) {
|
|
601
601
|
const f = b.byteOffset || 0, t = b.byteLength || 0, n = b.count, d = b.byteStride, o = new Uint8Array(c, f, t);
|
|
602
602
|
return i.decodeGltfBufferAsync ? i.decodeGltfBufferAsync(n, d, o, b.mode, b.filter).then(function(s) {
|
|
603
603
|
return s.buffer;
|
|
@@ -610,62 +610,62 @@ class t2 {
|
|
|
610
610
|
return null;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
class
|
|
613
|
+
class f2 {
|
|
614
614
|
constructor(e) {
|
|
615
615
|
this.name = p.EXT_MESH_GPU_INSTANCING, this.parser = e;
|
|
616
616
|
}
|
|
617
617
|
createNodeMesh(e) {
|
|
618
|
-
const a = this.parser.json,
|
|
619
|
-
if (!
|
|
618
|
+
const a = this.parser.json, H = a.nodes[e];
|
|
619
|
+
if (!H.extensions || !H.extensions[this.name] || H.mesh === void 0)
|
|
620
620
|
return null;
|
|
621
|
-
const b = a.meshes[
|
|
621
|
+
const b = a.meshes[H.mesh];
|
|
622
622
|
for (const t of b.primitives)
|
|
623
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
|
-
const i =
|
|
625
|
+
const i = H.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
630
|
for (const l of d) {
|
|
631
|
-
const h = new $(), u = new C(), g = new
|
|
631
|
+
const h = new $(), u = new C(), g = new M0(), _ = new C(1, 1, 1), m = new He(l.geometry, l.material, o);
|
|
632
632
|
for (let A = 0; A < o; A++)
|
|
633
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
636
|
const I = f[A];
|
|
637
|
-
m.instanceColor = new
|
|
637
|
+
m.instanceColor = new re(I.array, I.itemSize, I.normalized);
|
|
638
638
|
} else A !== "TRANSLATION" && A !== "ROTATION" && A !== "SCALE" && l.geometry.setAttribute(A, f[A]);
|
|
639
|
-
|
|
639
|
+
D0.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
|
|
646
|
-
class
|
|
645
|
+
const V0 = "glTF", z = 12, y0 = { JSON: 1313821514, BIN: 5130562 };
|
|
646
|
+
class c2 {
|
|
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), H = new TextDecoder();
|
|
650
650
|
if (this.header = {
|
|
651
|
-
magic:
|
|
651
|
+
magic: H.decode(new Uint8Array(e.slice(0, 4))),
|
|
652
652
|
version: a.getUint32(4, !0),
|
|
653
653
|
length: a.getUint32(8, !0)
|
|
654
|
-
}, this.header.magic !==
|
|
654
|
+
}, this.header.magic !== V0)
|
|
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, r = new DataView(e, z);
|
|
659
659
|
let i = 0;
|
|
660
660
|
for (; i < b; ) {
|
|
661
|
-
const c =
|
|
661
|
+
const c = r.getUint32(i, !0);
|
|
662
662
|
i += 4;
|
|
663
|
-
const f =
|
|
664
|
-
if (i += 4, f ===
|
|
665
|
-
const t = new Uint8Array(e,
|
|
666
|
-
this.content =
|
|
667
|
-
} else if (f ===
|
|
668
|
-
const t =
|
|
663
|
+
const f = r.getUint32(i, !0);
|
|
664
|
+
if (i += 4, f === y0.JSON) {
|
|
665
|
+
const t = new Uint8Array(e, z + i, c);
|
|
666
|
+
this.content = H.decode(t);
|
|
667
|
+
} else if (f === y0.BIN) {
|
|
668
|
+
const t = z + i;
|
|
669
669
|
this.body = e.slice(t, t + c);
|
|
670
670
|
}
|
|
671
671
|
i += c;
|
|
@@ -674,14 +674,14 @@ class n2 {
|
|
|
674
674
|
throw new Error("THREE.GLTFLoader: JSON content not found.");
|
|
675
675
|
}
|
|
676
676
|
}
|
|
677
|
-
class
|
|
677
|
+
class t2 {
|
|
678
678
|
constructor(e, a) {
|
|
679
679
|
if (!a)
|
|
680
680
|
throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
|
|
681
681
|
this.name = p.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = a, this.dracoLoader.preload();
|
|
682
682
|
}
|
|
683
683
|
decodePrimitive(e, a) {
|
|
684
|
-
const
|
|
684
|
+
const H = this.json, b = this.dracoLoader, r = e.extensions[this.name].bufferView, i = e.extensions[this.name].attributes, c = {}, f = {}, t = {};
|
|
685
685
|
for (const n in i) {
|
|
686
686
|
const d = k0[n] || n.toLowerCase();
|
|
687
687
|
c[d] = i[n];
|
|
@@ -689,11 +689,11 @@ 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 =
|
|
692
|
+
const o = H.accessors[e.attributes[n]], s = L[o.componentType];
|
|
693
693
|
t[d] = s.name, f[d] = o.normalized === !0;
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
|
-
return a.getDependency("bufferView",
|
|
696
|
+
return a.getDependency("bufferView", r).then(function(n) {
|
|
697
697
|
return new Promise(function(d, o) {
|
|
698
698
|
b.decodeDracoFile(n, function(s) {
|
|
699
699
|
for (const l in s.attributes) {
|
|
@@ -706,7 +706,7 @@ class o2 {
|
|
|
706
706
|
});
|
|
707
707
|
}
|
|
708
708
|
}
|
|
709
|
-
class
|
|
709
|
+
class d2 {
|
|
710
710
|
constructor() {
|
|
711
711
|
this.name = p.KHR_TEXTURE_TRANSFORM;
|
|
712
712
|
}
|
|
@@ -714,35 +714,35 @@ class k2 {
|
|
|
714
714
|
return (a.texCoord === void 0 || a.texCoord === e.channel) && a.offset === void 0 && a.rotation === void 0 && a.scale === void 0 || (e = e.clone(), a.texCoord !== void 0 && (e.channel = a.texCoord), a.offset !== void 0 && e.offset.fromArray(a.offset), a.rotation !== void 0 && (e.rotation = a.rotation), a.scale !== void 0 && e.repeat.fromArray(a.scale), e.needsUpdate = !0), e;
|
|
715
715
|
}
|
|
716
716
|
}
|
|
717
|
-
class
|
|
717
|
+
class n2 {
|
|
718
718
|
constructor() {
|
|
719
719
|
this.name = p.KHR_MESH_QUANTIZATION;
|
|
720
720
|
}
|
|
721
721
|
}
|
|
722
|
-
class
|
|
723
|
-
constructor(e, a,
|
|
724
|
-
super(e, a,
|
|
722
|
+
class P0 extends De {
|
|
723
|
+
constructor(e, a, H, b) {
|
|
724
|
+
super(e, a, H, b);
|
|
725
725
|
}
|
|
726
726
|
copySampleValue_(e) {
|
|
727
|
-
const a = this.resultBuffer,
|
|
727
|
+
const a = this.resultBuffer, H = this.sampleValues, b = this.valueSize, r = e * b * 3 + b;
|
|
728
728
|
for (let i = 0; i !== b; i++)
|
|
729
|
-
a[i] = r
|
|
729
|
+
a[i] = H[r + i];
|
|
730
730
|
return a;
|
|
731
731
|
}
|
|
732
|
-
interpolate_(e, a,
|
|
733
|
-
const
|
|
732
|
+
interpolate_(e, a, H, b) {
|
|
733
|
+
const r = this.resultBuffer, i = this.sampleValues, c = this.valueSize, f = c * 2, t = c * 3, n = b - a, d = (H - 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 I = i[h + A + c], F = i[h + A + f] * n, y = i[l + A + c],
|
|
736
|
-
|
|
735
|
+
const I = i[h + A + c], F = i[h + A + f] * n, y = i[l + A + c], E = i[l + A] * n;
|
|
736
|
+
r[A] = _ * I + m * F + u * y + g * E;
|
|
737
737
|
}
|
|
738
|
-
return
|
|
738
|
+
return r;
|
|
739
739
|
}
|
|
740
740
|
}
|
|
741
|
-
const
|
|
742
|
-
class
|
|
743
|
-
interpolate_(e, a,
|
|
744
|
-
const
|
|
745
|
-
return
|
|
741
|
+
const o2 = new M0();
|
|
742
|
+
class k2 extends P0 {
|
|
743
|
+
interpolate_(e, a, H, b) {
|
|
744
|
+
const r = super.interpolate_(e, a, H, b);
|
|
745
|
+
return o2.fromArray(r).normalize().toArray(r), r;
|
|
746
746
|
}
|
|
747
747
|
}
|
|
748
748
|
const w = {
|
|
@@ -760,16 +760,16 @@ const w = {
|
|
|
760
760
|
5123: Uint16Array,
|
|
761
761
|
5125: Uint32Array,
|
|
762
762
|
5126: Float32Array
|
|
763
|
-
},
|
|
764
|
-
9728:
|
|
763
|
+
}, F0 = {
|
|
764
|
+
9728: E0,
|
|
765
765
|
9729: d0,
|
|
766
|
-
9984:
|
|
767
|
-
9985:
|
|
768
|
-
9986:
|
|
769
|
-
9987:
|
|
770
|
-
},
|
|
771
|
-
33071:
|
|
772
|
-
33648:
|
|
766
|
+
9984: oe,
|
|
767
|
+
9985: ne,
|
|
768
|
+
9986: de,
|
|
769
|
+
9987: O0
|
|
770
|
+
}, w0 = {
|
|
771
|
+
33071: se,
|
|
772
|
+
33648: ke,
|
|
773
773
|
10497: n0
|
|
774
774
|
}, H0 = {
|
|
775
775
|
SCALAR: 1,
|
|
@@ -795,46 +795,46 @@ const w = {
|
|
|
795
795
|
translation: "position",
|
|
796
796
|
rotation: "quaternion",
|
|
797
797
|
weights: "morphTargetInfluences"
|
|
798
|
-
},
|
|
798
|
+
}, s2 = {
|
|
799
799
|
CUBICSPLINE: void 0,
|
|
800
800
|
// We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
|
|
801
801
|
// keyframe track will be initialized with a default interpolation type, then modified.
|
|
802
|
-
LINEAR:
|
|
803
|
-
STEP:
|
|
802
|
+
LINEAR: q0,
|
|
803
|
+
STEP: Te
|
|
804
804
|
}, r0 = {
|
|
805
805
|
OPAQUE: "OPAQUE",
|
|
806
806
|
MASK: "MASK",
|
|
807
807
|
BLEND: "BLEND"
|
|
808
808
|
};
|
|
809
|
-
function
|
|
810
|
-
return k.DefaultMaterial === void 0 && (k.DefaultMaterial = new
|
|
809
|
+
function u2(k) {
|
|
810
|
+
return k.DefaultMaterial === void 0 && (k.DefaultMaterial = new G0({
|
|
811
811
|
color: 16777215,
|
|
812
812
|
emissive: 0,
|
|
813
813
|
metalness: 1,
|
|
814
814
|
roughness: 1,
|
|
815
815
|
transparent: !1,
|
|
816
816
|
depthTest: !0,
|
|
817
|
-
side:
|
|
817
|
+
side: Me
|
|
818
818
|
})), k.DefaultMaterial;
|
|
819
819
|
}
|
|
820
820
|
function V(k, e, a) {
|
|
821
|
-
for (const
|
|
822
|
-
k[
|
|
821
|
+
for (const H in a.extensions)
|
|
822
|
+
k[H] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[H] = a.extensions[H]);
|
|
823
823
|
}
|
|
824
|
-
function
|
|
824
|
+
function O(k, e) {
|
|
825
825
|
e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(k.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras));
|
|
826
826
|
}
|
|
827
|
-
function
|
|
828
|
-
let
|
|
827
|
+
function l2(k, e, a) {
|
|
828
|
+
let H = !1, b = !1, r = !1;
|
|
829
829
|
for (let t = 0, n = e.length; t < n; t++) {
|
|
830
830
|
const d = e[t];
|
|
831
|
-
if (d.POSITION !== void 0 && (
|
|
831
|
+
if (d.POSITION !== void 0 && (H = !0), d.NORMAL !== void 0 && (b = !0), d.COLOR_0 !== void 0 && (r = !0), H && b && r) break;
|
|
832
832
|
}
|
|
833
|
-
if (!
|
|
833
|
+
if (!H && !b && !r) return Promise.resolve(k);
|
|
834
834
|
const i = [], c = [], f = [];
|
|
835
835
|
for (let t = 0, n = e.length; t < n; t++) {
|
|
836
836
|
const d = e[t];
|
|
837
|
-
if (
|
|
837
|
+
if (H) {
|
|
838
838
|
const o = d.POSITION !== void 0 ? a.getDependency("accessor", d.POSITION) : k.attributes.position;
|
|
839
839
|
i.push(o);
|
|
840
840
|
}
|
|
@@ -842,7 +842,7 @@ function _2(k, e, a) {
|
|
|
842
842
|
const o = d.NORMAL !== void 0 ? a.getDependency("accessor", d.NORMAL) : k.attributes.normal;
|
|
843
843
|
c.push(o);
|
|
844
844
|
}
|
|
845
|
-
if (
|
|
845
|
+
if (r) {
|
|
846
846
|
const o = d.COLOR_0 !== void 0 ? a.getDependency("accessor", d.COLOR_0) : k.attributes.color;
|
|
847
847
|
f.push(o);
|
|
848
848
|
}
|
|
@@ -853,36 +853,36 @@ function _2(k, e, a) {
|
|
|
853
853
|
Promise.all(f)
|
|
854
854
|
]).then(function(t) {
|
|
855
855
|
const n = t[0], d = t[1], o = t[2];
|
|
856
|
-
return
|
|
856
|
+
return H && (k.morphAttributes.position = n), b && (k.morphAttributes.normal = d), r && (k.morphAttributes.color = o), k.morphTargetsRelative = !0, k;
|
|
857
857
|
});
|
|
858
858
|
}
|
|
859
|
-
function
|
|
859
|
+
function h2(k, e) {
|
|
860
860
|
if (k.updateMorphTargets(), e.weights !== void 0)
|
|
861
|
-
for (let a = 0,
|
|
861
|
+
for (let a = 0, H = e.weights.length; a < H; a++)
|
|
862
862
|
k.morphTargetInfluences[a] = e.weights[a];
|
|
863
863
|
if (e.extras && Array.isArray(e.extras.targetNames)) {
|
|
864
864
|
const a = e.extras.targetNames;
|
|
865
865
|
if (k.morphTargetInfluences.length === a.length) {
|
|
866
866
|
k.morphTargetDictionary = {};
|
|
867
|
-
for (let
|
|
868
|
-
k.morphTargetDictionary[a[
|
|
867
|
+
for (let H = 0, b = a.length; H < b; H++)
|
|
868
|
+
k.morphTargetDictionary[a[H]] = H;
|
|
869
869
|
} else
|
|
870
870
|
console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
|
|
871
871
|
}
|
|
872
872
|
}
|
|
873
|
-
function
|
|
873
|
+
function g2(k) {
|
|
874
874
|
let e;
|
|
875
875
|
const a = k.extensions && k.extensions[p.KHR_DRACO_MESH_COMPRESSION];
|
|
876
876
|
if (a ? e = "draco:" + a.bufferView + ":" + a.indices + ":" + f0(a.attributes) : e = k.indices + ":" + f0(k.attributes) + ":" + k.mode, k.targets !== void 0)
|
|
877
|
-
for (let
|
|
878
|
-
e += ":" + f0(k.targets[
|
|
877
|
+
for (let H = 0, b = k.targets.length; H < b; H++)
|
|
878
|
+
e += ":" + f0(k.targets[H]);
|
|
879
879
|
return e;
|
|
880
880
|
}
|
|
881
881
|
function f0(k) {
|
|
882
882
|
let e = "";
|
|
883
883
|
const a = Object.keys(k).sort();
|
|
884
|
-
for (let
|
|
885
|
-
e += a[
|
|
884
|
+
for (let H = 0, b = a.length; H < b; H++)
|
|
885
|
+
e += a[H] + ":" + k[a[H]] + ";";
|
|
886
886
|
return e;
|
|
887
887
|
}
|
|
888
888
|
function s0(k) {
|
|
@@ -899,21 +899,21 @@ function s0(k) {
|
|
|
899
899
|
throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
|
|
900
900
|
}
|
|
901
901
|
}
|
|
902
|
-
function
|
|
902
|
+
function _2(k) {
|
|
903
903
|
return k.search(/\.jpe?g($|\?)/i) > 0 || k.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : k.search(/\.webp($|\?)/i) > 0 || k.search(/^data\:image\/webp/) === 0 ? "image/webp" : k.search(/\.ktx2($|\?)/i) > 0 || k.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
|
|
904
904
|
}
|
|
905
|
-
const
|
|
906
|
-
class
|
|
905
|
+
const A2 = new $();
|
|
906
|
+
class p2 {
|
|
907
907
|
constructor(e = {}, a = {}) {
|
|
908
|
-
this.json = e, this.extensions = {}, this.plugins = {}, this.options = a, this.cache = new
|
|
909
|
-
let
|
|
908
|
+
this.json = e, this.extensions = {}, this.plugins = {}, this.options = a, this.cache = new We(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
|
|
909
|
+
let H = !1, b = -1, r = !1, i = -1;
|
|
910
910
|
if (typeof navigator < "u") {
|
|
911
911
|
const c = navigator.userAgent;
|
|
912
|
-
|
|
912
|
+
H = /^((?!chrome|android).)*safari/i.test(c) === !0;
|
|
913
913
|
const f = c.match(/Version\/(\d+)/);
|
|
914
|
-
b =
|
|
914
|
+
b = H && f ? parseInt(f[1], 10) : -1, r = c.indexOf("Firefox") > -1, i = r ? c.match(/Firefox\/([0-9]+)\./)[1] : -1;
|
|
915
915
|
}
|
|
916
|
-
typeof createImageBitmap > "u" ||
|
|
916
|
+
typeof createImageBitmap > "u" || H && b < 17 || r && i < 98 ? this.textureLoader = new fe(this.options.manager) : this.textureLoader = new ce(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new X(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
|
|
917
917
|
}
|
|
918
918
|
setExtensions(e) {
|
|
919
919
|
this.extensions = e;
|
|
@@ -922,16 +922,16 @@ class I2 {
|
|
|
922
922
|
this.plugins = e;
|
|
923
923
|
}
|
|
924
924
|
parse(e, a) {
|
|
925
|
-
const
|
|
925
|
+
const H = this, b = this.json, r = this.extensions;
|
|
926
926
|
this.cache.removeAll(), this.nodeCache = {}, this._invokeAll(function(i) {
|
|
927
927
|
return i._markDefs && i._markDefs();
|
|
928
928
|
}), Promise.all(this._invokeAll(function(i) {
|
|
929
929
|
return i.beforeRoot && i.beforeRoot();
|
|
930
930
|
})).then(function() {
|
|
931
931
|
return Promise.all([
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
932
|
+
H.getDependencies("scene"),
|
|
933
|
+
H.getDependencies("animation"),
|
|
934
|
+
H.getDependencies("camera")
|
|
935
935
|
]);
|
|
936
936
|
}).then(function(i) {
|
|
937
937
|
const c = {
|
|
@@ -940,10 +940,10 @@ class I2 {
|
|
|
940
940
|
animations: i[1],
|
|
941
941
|
cameras: i[2],
|
|
942
942
|
asset: b.asset,
|
|
943
|
-
parser:
|
|
943
|
+
parser: H,
|
|
944
944
|
userData: {}
|
|
945
945
|
};
|
|
946
|
-
return V(
|
|
946
|
+
return V(r, c, b), O(c, b), Promise.all(H._invokeAll(function(f) {
|
|
947
947
|
return f.afterRoot && f.afterRoot(c);
|
|
948
948
|
})).then(function() {
|
|
949
949
|
for (const f of c.scenes)
|
|
@@ -958,15 +958,15 @@ class I2 {
|
|
|
958
958
|
* @private
|
|
959
959
|
*/
|
|
960
960
|
_markDefs() {
|
|
961
|
-
const e = this.json.nodes || [], a = this.json.skins || [],
|
|
962
|
-
for (let b = 0,
|
|
961
|
+
const e = this.json.nodes || [], a = this.json.skins || [], H = this.json.meshes || [];
|
|
962
|
+
for (let b = 0, r = a.length; b < r; b++) {
|
|
963
963
|
const i = a[b].joints;
|
|
964
964
|
for (let c = 0, f = i.length; c < f; c++)
|
|
965
965
|
e[i[c]].isBone = !0;
|
|
966
966
|
}
|
|
967
|
-
for (let b = 0,
|
|
967
|
+
for (let b = 0, r = e.length; b < r; b++) {
|
|
968
968
|
const i = e[b];
|
|
969
|
-
i.mesh !== void 0 && (this._addNodeRef(this.meshCache, i.mesh), i.skin !== void 0 && (
|
|
969
|
+
i.mesh !== void 0 && (this._addNodeRef(this.meshCache, i.mesh), i.skin !== void 0 && (H[i.mesh].isSkinnedMesh = !0)), i.camera !== void 0 && this._addNodeRef(this.cameraCache, i.camera);
|
|
970
970
|
}
|
|
971
971
|
}
|
|
972
972
|
/**
|
|
@@ -994,21 +994,21 @@ class I2 {
|
|
|
994
994
|
* @param {Object} object
|
|
995
995
|
* @return {Object}
|
|
996
996
|
*/
|
|
997
|
-
_getNodeRef(e, a,
|
|
998
|
-
if (e.refs[a] <= 1) return
|
|
999
|
-
const b =
|
|
997
|
+
_getNodeRef(e, a, H) {
|
|
998
|
+
if (e.refs[a] <= 1) return H;
|
|
999
|
+
const b = H.clone(), r = (i, c) => {
|
|
1000
1000
|
const f = this.associations.get(i);
|
|
1001
1001
|
f != null && this.associations.set(c, f);
|
|
1002
1002
|
for (const [t, n] of i.children.entries())
|
|
1003
|
-
|
|
1003
|
+
r(n, c.children[t]);
|
|
1004
1004
|
};
|
|
1005
|
-
return H
|
|
1005
|
+
return r(H, b), b.name += "_instance_" + e.uses[a]++, b;
|
|
1006
1006
|
}
|
|
1007
1007
|
_invokeOne(e) {
|
|
1008
1008
|
const a = Object.values(this.plugins);
|
|
1009
1009
|
a.push(this);
|
|
1010
|
-
for (let
|
|
1011
|
-
const b = e(a[
|
|
1010
|
+
for (let H = 0; H < a.length; H++) {
|
|
1011
|
+
const b = e(a[H]);
|
|
1012
1012
|
if (b) return b;
|
|
1013
1013
|
}
|
|
1014
1014
|
return null;
|
|
@@ -1016,12 +1016,12 @@ class I2 {
|
|
|
1016
1016
|
_invokeAll(e) {
|
|
1017
1017
|
const a = Object.values(this.plugins);
|
|
1018
1018
|
a.unshift(this);
|
|
1019
|
-
const
|
|
1019
|
+
const H = [];
|
|
1020
1020
|
for (let b = 0; b < a.length; b++) {
|
|
1021
|
-
const
|
|
1022
|
-
|
|
1021
|
+
const r = e(a[b]);
|
|
1022
|
+
r && H.push(r);
|
|
1023
1023
|
}
|
|
1024
|
-
return
|
|
1024
|
+
return H;
|
|
1025
1025
|
}
|
|
1026
1026
|
/**
|
|
1027
1027
|
* Requests the specified dependency asynchronously, with caching.
|
|
@@ -1032,63 +1032,63 @@ class I2 {
|
|
|
1032
1032
|
* @return {Promise<Object3D|Material|THREE.Texture|AnimationClip|ArrayBuffer|Object>}
|
|
1033
1033
|
*/
|
|
1034
1034
|
getDependency(e, a) {
|
|
1035
|
-
const
|
|
1036
|
-
let b = this.cache.get(
|
|
1035
|
+
const H = e + ":" + a;
|
|
1036
|
+
let b = this.cache.get(H);
|
|
1037
1037
|
if (!b) {
|
|
1038
1038
|
switch (e) {
|
|
1039
1039
|
case "scene":
|
|
1040
1040
|
b = this.loadScene(a);
|
|
1041
1041
|
break;
|
|
1042
1042
|
case "node":
|
|
1043
|
-
b = this._invokeOne(function(
|
|
1044
|
-
return
|
|
1043
|
+
b = this._invokeOne(function(r) {
|
|
1044
|
+
return r.loadNode && r.loadNode(a);
|
|
1045
1045
|
});
|
|
1046
1046
|
break;
|
|
1047
1047
|
case "mesh":
|
|
1048
|
-
b = this._invokeOne(function(
|
|
1049
|
-
return
|
|
1048
|
+
b = this._invokeOne(function(r) {
|
|
1049
|
+
return r.loadMesh && r.loadMesh(a);
|
|
1050
1050
|
});
|
|
1051
1051
|
break;
|
|
1052
1052
|
case "accessor":
|
|
1053
1053
|
b = this.loadAccessor(a);
|
|
1054
1054
|
break;
|
|
1055
1055
|
case "bufferView":
|
|
1056
|
-
b = this._invokeOne(function(
|
|
1057
|
-
return
|
|
1056
|
+
b = this._invokeOne(function(r) {
|
|
1057
|
+
return r.loadBufferView && r.loadBufferView(a);
|
|
1058
1058
|
});
|
|
1059
1059
|
break;
|
|
1060
1060
|
case "buffer":
|
|
1061
1061
|
b = this.loadBuffer(a);
|
|
1062
1062
|
break;
|
|
1063
1063
|
case "material":
|
|
1064
|
-
b = this._invokeOne(function(
|
|
1065
|
-
return
|
|
1064
|
+
b = this._invokeOne(function(r) {
|
|
1065
|
+
return r.loadMaterial && r.loadMaterial(a);
|
|
1066
1066
|
});
|
|
1067
1067
|
break;
|
|
1068
1068
|
case "texture":
|
|
1069
|
-
b = this._invokeOne(function(
|
|
1070
|
-
return
|
|
1069
|
+
b = this._invokeOne(function(r) {
|
|
1070
|
+
return r.loadTexture && r.loadTexture(a);
|
|
1071
1071
|
});
|
|
1072
1072
|
break;
|
|
1073
1073
|
case "skin":
|
|
1074
1074
|
b = this.loadSkin(a);
|
|
1075
1075
|
break;
|
|
1076
1076
|
case "animation":
|
|
1077
|
-
b = this._invokeOne(function(
|
|
1078
|
-
return
|
|
1077
|
+
b = this._invokeOne(function(r) {
|
|
1078
|
+
return r.loadAnimation && r.loadAnimation(a);
|
|
1079
1079
|
});
|
|
1080
1080
|
break;
|
|
1081
1081
|
case "camera":
|
|
1082
1082
|
b = this.loadCamera(a);
|
|
1083
1083
|
break;
|
|
1084
1084
|
default:
|
|
1085
|
-
if (b = this._invokeOne(function(
|
|
1086
|
-
return
|
|
1085
|
+
if (b = this._invokeOne(function(r) {
|
|
1086
|
+
return r != this && r.getDependency && r.getDependency(e, a);
|
|
1087
1087
|
}), !b)
|
|
1088
1088
|
throw new Error("Unknown type: " + e);
|
|
1089
1089
|
break;
|
|
1090
1090
|
}
|
|
1091
|
-
this.cache.add(
|
|
1091
|
+
this.cache.add(H, b);
|
|
1092
1092
|
}
|
|
1093
1093
|
return b;
|
|
1094
1094
|
}
|
|
@@ -1102,9 +1102,9 @@ class I2 {
|
|
|
1102
1102
|
getDependencies(e) {
|
|
1103
1103
|
let a = this.cache.get(e);
|
|
1104
1104
|
if (!a) {
|
|
1105
|
-
const
|
|
1106
|
-
a = Promise.all(b.map(function(
|
|
1107
|
-
return
|
|
1105
|
+
const H = this, b = this.json[e + (e === "mesh" ? "es" : "s")] || [];
|
|
1106
|
+
a = Promise.all(b.map(function(r, i) {
|
|
1107
|
+
return H.getDependency(e, i);
|
|
1108
1108
|
})), this.cache.add(e, a);
|
|
1109
1109
|
}
|
|
1110
1110
|
return a;
|
|
@@ -1117,14 +1117,14 @@ class I2 {
|
|
|
1117
1117
|
* @return {Promise<ArrayBuffer>}
|
|
1118
1118
|
*/
|
|
1119
1119
|
loadBuffer(e) {
|
|
1120
|
-
const a = this.json.buffers[e],
|
|
1120
|
+
const a = this.json.buffers[e], H = this.fileLoader;
|
|
1121
1121
|
if (a.type && a.type !== "arraybuffer")
|
|
1122
1122
|
throw new Error("THREE.GLTFLoader: " + a.type + " buffer type is not supported.");
|
|
1123
1123
|
if (a.uri === void 0 && e === 0)
|
|
1124
1124
|
return Promise.resolve(this.extensions[p.KHR_BINARY_GLTF].body);
|
|
1125
1125
|
const b = this.options;
|
|
1126
|
-
return new Promise(function(
|
|
1127
|
-
|
|
1126
|
+
return new Promise(function(r, i) {
|
|
1127
|
+
H.load(J.resolveURL(a.uri, b.path), r, void 0, function() {
|
|
1128
1128
|
i(new Error('THREE.GLTFLoader: Failed to load buffer "' + a.uri + '".'));
|
|
1129
1129
|
});
|
|
1130
1130
|
});
|
|
@@ -1138,9 +1138,9 @@ class I2 {
|
|
|
1138
1138
|
*/
|
|
1139
1139
|
loadBufferView(e) {
|
|
1140
1140
|
const a = this.json.bufferViews[e];
|
|
1141
|
-
return this.getDependency("buffer", a.buffer).then(function(
|
|
1142
|
-
const b = a.byteLength || 0,
|
|
1143
|
-
return
|
|
1141
|
+
return this.getDependency("buffer", a.buffer).then(function(H) {
|
|
1142
|
+
const b = a.byteLength || 0, r = a.byteOffset || 0;
|
|
1143
|
+
return H.slice(r, r + b);
|
|
1144
1144
|
});
|
|
1145
1145
|
}
|
|
1146
1146
|
/**
|
|
@@ -1151,25 +1151,25 @@ class I2 {
|
|
|
1151
1151
|
* @return {Promise<BufferAttribute|InterleavedBufferAttribute>}
|
|
1152
1152
|
*/
|
|
1153
1153
|
loadAccessor(e) {
|
|
1154
|
-
const a = this,
|
|
1154
|
+
const a = this, H = this.json, b = this.json.accessors[e];
|
|
1155
1155
|
if (b.bufferView === void 0 && b.sparse === void 0) {
|
|
1156
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
|
|
1157
|
+
return Promise.resolve(new Y(t, i, f));
|
|
1158
1158
|
}
|
|
1159
|
-
const
|
|
1160
|
-
return b.bufferView !== void 0 ?
|
|
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 ?
|
|
1159
|
+
const r = [];
|
|
1160
|
+
return b.bufferView !== void 0 ? r.push(this.getDependency("bufferView", b.bufferView)) : r.push(null), b.sparse !== void 0 && (r.push(this.getDependency("bufferView", b.sparse.indices.bufferView)), r.push(this.getDependency("bufferView", b.sparse.values.bufferView))), Promise.all(r).then(function(i) {
|
|
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 ? H.bufferViews[b.bufferView].byteStride : void 0, l = b.normalized === !0;
|
|
1162
1162
|
let h, u;
|
|
1163
1163
|
if (s && s !== d) {
|
|
1164
1164
|
const g = Math.floor(o / s), _ = "InterleavedBuffer:" + b.bufferView + ":" + b.componentType + ":" + g + ":" + b.count;
|
|
1165
1165
|
let m = a.cache.get(_);
|
|
1166
|
-
m || (h = new t(c, g * s, b.count * s / n), m = new
|
|
1166
|
+
m || (h = new t(c, g * s, b.count * s / n), m = new te(h, s / n), a.cache.add(_, m)), u = new Re(m, f, o % s / n, l);
|
|
1167
1167
|
} else
|
|
1168
|
-
c === null ? h = new t(b.count * f) : h = new t(c, o, b.count * f), u = new
|
|
1168
|
+
c === null ? h = new t(b.count * f) : h = new t(c, o, b.count * f), u = new Y(h, f, l);
|
|
1169
1169
|
if (b.sparse !== void 0) {
|
|
1170
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
|
|
1172
|
-
for (let y = 0,
|
|
1171
|
+
c !== null && (u = new Y(u.array.slice(), u.itemSize, u.normalized)), u.normalized = !1;
|
|
1172
|
+
for (let y = 0, E = I.length; y < E; y++) {
|
|
1173
1173
|
const N = I[y];
|
|
1174
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
|
}
|
|
@@ -1186,35 +1186,35 @@ class I2 {
|
|
|
1186
1186
|
* @return {Promise<THREE.Texture|null>}
|
|
1187
1187
|
*/
|
|
1188
1188
|
loadTexture(e) {
|
|
1189
|
-
const a = this.json,
|
|
1189
|
+
const a = this.json, H = this.options, r = a.textures[e].source, i = a.images[r];
|
|
1190
1190
|
let c = this.textureLoader;
|
|
1191
1191
|
if (i.uri) {
|
|
1192
|
-
const f =
|
|
1192
|
+
const f = H.manager.getHandler(i.uri);
|
|
1193
1193
|
f !== null && (c = f);
|
|
1194
1194
|
}
|
|
1195
|
-
return this.loadTextureImage(e,
|
|
1195
|
+
return this.loadTextureImage(e, r, c);
|
|
1196
1196
|
}
|
|
1197
|
-
loadTextureImage(e, a,
|
|
1198
|
-
const b = this,
|
|
1197
|
+
loadTextureImage(e, a, H) {
|
|
1198
|
+
const b = this, r = this.json, i = r.textures[e], c = r.images[a], f = (c.uri || c.bufferView) + ":" + i.sampler;
|
|
1199
1199
|
if (this.textureCache[f])
|
|
1200
1200
|
return this.textureCache[f];
|
|
1201
|
-
const t = this.loadImageSource(a,
|
|
1201
|
+
const t = this.loadImageSource(a, H).then(function(n) {
|
|
1202
1202
|
n.flipY = !1, n.name = i.name || c.name || "", n.name === "" && typeof c.uri == "string" && c.uri.startsWith("data:image/") === !1 && (n.name = c.uri);
|
|
1203
|
-
const o = (
|
|
1204
|
-
return n.magFilter =
|
|
1203
|
+
const o = (r.samplers || {})[i.sampler] || {};
|
|
1204
|
+
return n.magFilter = F0[o.magFilter] || d0, n.minFilter = F0[o.minFilter] || O0, n.wrapS = w0[o.wrapS] || n0, n.wrapT = w0[o.wrapT] || n0, n.generateMipmaps = !n.isCompressedTexture && n.minFilter !== E0 && n.minFilter !== d0, b.associations.set(n, { textures: e }), n;
|
|
1205
1205
|
}).catch(function() {
|
|
1206
1206
|
return null;
|
|
1207
1207
|
});
|
|
1208
1208
|
return this.textureCache[f] = t, t;
|
|
1209
1209
|
}
|
|
1210
1210
|
loadImageSource(e, a) {
|
|
1211
|
-
const
|
|
1211
|
+
const H = this, b = this.json, r = this.options;
|
|
1212
1212
|
if (this.sourceCache[e] !== void 0)
|
|
1213
1213
|
return this.sourceCache[e].then((d) => d.clone());
|
|
1214
1214
|
const i = b.images[e], c = self.URL || self.webkitURL;
|
|
1215
1215
|
let f = i.uri || "", t = !1;
|
|
1216
1216
|
if (i.bufferView !== void 0)
|
|
1217
|
-
f =
|
|
1217
|
+
f = H.getDependency("bufferView", i.bufferView).then(function(d) {
|
|
1218
1218
|
t = !0;
|
|
1219
1219
|
const o = new Blob([d], { type: i.mimeType });
|
|
1220
1220
|
return f = c.createObjectURL(o), f;
|
|
@@ -1225,12 +1225,12 @@ class I2 {
|
|
|
1225
1225
|
return new Promise(function(o, s) {
|
|
1226
1226
|
let l = o;
|
|
1227
1227
|
a.isImageBitmapLoader === !0 && (l = function(h) {
|
|
1228
|
-
const u = new
|
|
1228
|
+
const u = new _0(h);
|
|
1229
1229
|
u.needsUpdate = !0, o(u);
|
|
1230
|
-
}), a.load(
|
|
1230
|
+
}), a.load(J.resolveURL(d, r.path), l, void 0, s);
|
|
1231
1231
|
});
|
|
1232
1232
|
}).then(function(d) {
|
|
1233
|
-
return t === !0 && c.revokeObjectURL(f),
|
|
1233
|
+
return t === !0 && c.revokeObjectURL(f), O(d, i), d.userData.mimeType = i.mimeType || _2(i.uri), d;
|
|
1234
1234
|
}).catch(function(d) {
|
|
1235
1235
|
throw console.error("THREE.GLTFLoader: Couldn't load texture", f), d;
|
|
1236
1236
|
});
|
|
@@ -1246,15 +1246,15 @@ class I2 {
|
|
|
1246
1246
|
* @param {string} [colorSpace]
|
|
1247
1247
|
* @return {Promise<Texture>}
|
|
1248
1248
|
*/
|
|
1249
|
-
assignTexture(e, a,
|
|
1250
|
-
const
|
|
1251
|
-
return this.getDependency("texture",
|
|
1249
|
+
assignTexture(e, a, H, b) {
|
|
1250
|
+
const r = this;
|
|
1251
|
+
return this.getDependency("texture", H.index).then(function(i) {
|
|
1252
1252
|
if (!i) return null;
|
|
1253
|
-
if (
|
|
1254
|
-
const c =
|
|
1253
|
+
if (H.texCoord !== void 0 && H.texCoord > 0 && (i = i.clone(), i.channel = H.texCoord), r.extensions[p.KHR_TEXTURE_TRANSFORM]) {
|
|
1254
|
+
const c = H.extensions !== void 0 ? H.extensions[p.KHR_TEXTURE_TRANSFORM] : void 0;
|
|
1255
1255
|
if (c) {
|
|
1256
|
-
const f =
|
|
1257
|
-
i =
|
|
1256
|
+
const f = r.associations.get(i);
|
|
1257
|
+
i = r.extensions[p.KHR_TEXTURE_TRANSFORM].extendTexture(i, c), r.associations.set(i, f);
|
|
1258
1258
|
}
|
|
1259
1259
|
}
|
|
1260
1260
|
return b !== void 0 && (i.colorSpace = b), e[a] = i, i;
|
|
@@ -1272,27 +1272,27 @@ class I2 {
|
|
|
1272
1272
|
*/
|
|
1273
1273
|
assignFinalMaterial(e) {
|
|
1274
1274
|
const a = e.geometry;
|
|
1275
|
-
let
|
|
1276
|
-
const b = a.attributes.tangent === void 0,
|
|
1275
|
+
let H = e.material;
|
|
1276
|
+
const b = a.attributes.tangent === void 0, r = a.attributes.color !== void 0, i = a.attributes.normal === void 0;
|
|
1277
1277
|
if (e.isPoints) {
|
|
1278
|
-
const c = "PointsMaterial:" +
|
|
1278
|
+
const c = "PointsMaterial:" + H.uuid;
|
|
1279
1279
|
let f = this.cache.get(c);
|
|
1280
|
-
f || (f = new
|
|
1280
|
+
f || (f = new ue(), b0.prototype.copy.call(f, H), f.color.copy(H.color), f.map = H.map, f.sizeAttenuation = !1, this.cache.add(c, f)), H = f;
|
|
1281
1281
|
} else if (e.isLine) {
|
|
1282
|
-
const c = "LineBasicMaterial:" +
|
|
1282
|
+
const c = "LineBasicMaterial:" + H.uuid;
|
|
1283
1283
|
let f = this.cache.get(c);
|
|
1284
|
-
f || (f = new
|
|
1284
|
+
f || (f = new le(), b0.prototype.copy.call(f, H), f.color.copy(H.color), f.map = H.map, this.cache.add(c, f)), H = f;
|
|
1285
1285
|
}
|
|
1286
|
-
if (b ||
|
|
1287
|
-
let c = "ClonedMaterial:" +
|
|
1288
|
-
b && (c += "derivative-tangents:"),
|
|
1286
|
+
if (b || r || i) {
|
|
1287
|
+
let c = "ClonedMaterial:" + H.uuid + ":";
|
|
1288
|
+
b && (c += "derivative-tangents:"), r && (c += "vertex-colors:"), i && (c += "flat-shading:");
|
|
1289
1289
|
let f = this.cache.get(c);
|
|
1290
|
-
f || (f =
|
|
1290
|
+
f || (f = H.clone(), r && (f.vertexColors = !0), i && (f.flatShading = !0), b && (f.normalScale && (f.normalScale.y *= -1), f.clearcoatNormalScale && (f.clearcoatNormalScale.y *= -1)), this.cache.add(c, f), this.associations.set(f, this.associations.get(H))), H = f;
|
|
1291
1291
|
}
|
|
1292
|
-
e.material =
|
|
1292
|
+
e.material = H;
|
|
1293
1293
|
}
|
|
1294
1294
|
getMaterialType() {
|
|
1295
|
-
return
|
|
1295
|
+
return G0;
|
|
1296
1296
|
}
|
|
1297
1297
|
/**
|
|
1298
1298
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
|
|
@@ -1302,14 +1302,14 @@ class I2 {
|
|
|
1302
1302
|
* @return {Promise<Material>}
|
|
1303
1303
|
*/
|
|
1304
1304
|
loadMaterial(e) {
|
|
1305
|
-
const a = this,
|
|
1305
|
+
const a = this, H = this.json, b = this.extensions, r = H.materials[e];
|
|
1306
1306
|
let i;
|
|
1307
|
-
const c = {}, f =
|
|
1307
|
+
const c = {}, f = r.extensions || {}, t = [];
|
|
1308
1308
|
if (f[p.KHR_MATERIALS_UNLIT]) {
|
|
1309
1309
|
const d = b[p.KHR_MATERIALS_UNLIT];
|
|
1310
|
-
i = d.getMaterialType(), t.push(d.extendParams(c,
|
|
1310
|
+
i = d.getMaterialType(), t.push(d.extendParams(c, r, a));
|
|
1311
1311
|
} else {
|
|
1312
|
-
const d =
|
|
1312
|
+
const d = r.pbrMetallicRoughness || {};
|
|
1313
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];
|
|
@@ -1320,19 +1320,19 @@ class I2 {
|
|
|
1320
1320
|
return o.extendMaterialParams && o.extendMaterialParams(e, c);
|
|
1321
1321
|
})));
|
|
1322
1322
|
}
|
|
1323
|
-
|
|
1324
|
-
const n =
|
|
1325
|
-
if (n === r0.BLEND ? (c.transparent = !0, c.depthWrite = !1) : (c.transparent = !1, n === r0.MASK && (c.alphaTest =
|
|
1326
|
-
const d =
|
|
1323
|
+
r.doubleSided === !0 && (c.side = he);
|
|
1324
|
+
const n = r.alphaMode || r0.OPAQUE;
|
|
1325
|
+
if (n === r0.BLEND ? (c.transparent = !0, c.depthWrite = !1) : (c.transparent = !1, n === r0.MASK && (c.alphaTest = r.alphaCutoff !== void 0 ? r.alphaCutoff : 0.5)), r.normalTexture !== void 0 && i !== Q && (t.push(a.assignTexture(c, "normalMap", r.normalTexture)), c.normalScale = new R0(1, 1), r.normalTexture.scale !== void 0)) {
|
|
1326
|
+
const d = r.normalTexture.scale;
|
|
1327
1327
|
c.normalScale.set(d, d);
|
|
1328
1328
|
}
|
|
1329
|
-
if (
|
|
1330
|
-
const d =
|
|
1329
|
+
if (r.occlusionTexture !== void 0 && i !== Q && (t.push(a.assignTexture(c, "aoMap", r.occlusionTexture)), r.occlusionTexture.strength !== void 0 && (c.aoMapIntensity = r.occlusionTexture.strength)), r.emissiveFactor !== void 0 && i !== Q) {
|
|
1330
|
+
const d = r.emissiveFactor;
|
|
1331
1331
|
c.emissive = new x().setRGB(d[0], d[1], d[2], M);
|
|
1332
1332
|
}
|
|
1333
|
-
return
|
|
1333
|
+
return r.emissiveTexture !== void 0 && i !== Q && t.push(a.assignTexture(c, "emissiveMap", r.emissiveTexture, U)), Promise.all(t).then(function() {
|
|
1334
1334
|
const d = new i(c);
|
|
1335
|
-
return
|
|
1335
|
+
return r.name && (d.name = r.name), O(d, r), a.associations.set(d, { materials: e }), r.extensions && V(b, d, r), d;
|
|
1336
1336
|
});
|
|
1337
1337
|
}
|
|
1338
1338
|
/**
|
|
@@ -1343,7 +1343,7 @@ class I2 {
|
|
|
1343
1343
|
* @return {string}
|
|
1344
1344
|
*/
|
|
1345
1345
|
createUniqueName(e) {
|
|
1346
|
-
const a =
|
|
1346
|
+
const a = ge.sanitizeNodeName(e || "");
|
|
1347
1347
|
return a in this.nodeNamesUsed ? a + "_" + ++this.nodeNamesUsed[a] : (this.nodeNamesUsed[a] = 0, a);
|
|
1348
1348
|
}
|
|
1349
1349
|
/**
|
|
@@ -1356,20 +1356,20 @@ class I2 {
|
|
|
1356
1356
|
* @return {Promise<Array<BufferGeometry>>}
|
|
1357
1357
|
*/
|
|
1358
1358
|
loadGeometries(e) {
|
|
1359
|
-
const a = this,
|
|
1360
|
-
function
|
|
1361
|
-
return
|
|
1362
|
-
return
|
|
1359
|
+
const a = this, H = this.extensions, b = this.primitiveCache;
|
|
1360
|
+
function r(c) {
|
|
1361
|
+
return H[p.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(c, a).then(function(f) {
|
|
1362
|
+
return N0(f, c, a);
|
|
1363
1363
|
});
|
|
1364
1364
|
}
|
|
1365
1365
|
const i = [];
|
|
1366
1366
|
for (let c = 0, f = e.length; c < f; c++) {
|
|
1367
|
-
const t = e[c], n =
|
|
1367
|
+
const t = e[c], n = g2(t), d = b[n];
|
|
1368
1368
|
if (d)
|
|
1369
1369
|
i.push(d.promise);
|
|
1370
1370
|
else {
|
|
1371
1371
|
let o;
|
|
1372
|
-
t.extensions && t.extensions[p.KHR_DRACO_MESH_COMPRESSION] ? o =
|
|
1372
|
+
t.extensions && t.extensions[p.KHR_DRACO_MESH_COMPRESSION] ? o = r(t) : o = N0(new U0(), t, a), b[n] = { primitive: t, promise: o }, i.push(o);
|
|
1373
1373
|
}
|
|
1374
1374
|
}
|
|
1375
1375
|
return Promise.all(i);
|
|
@@ -1382,9 +1382,9 @@ class I2 {
|
|
|
1382
1382
|
* @return {Promise<Group|Mesh|SkinnedMesh|Line|Points>}
|
|
1383
1383
|
*/
|
|
1384
1384
|
loadMesh(e) {
|
|
1385
|
-
const a = this,
|
|
1385
|
+
const a = this, H = this.json, b = this.extensions, r = H.meshes[e], i = r.primitives, c = [];
|
|
1386
1386
|
for (let f = 0, t = i.length; f < t; f++) {
|
|
1387
|
-
const n = i[f].material === void 0 ?
|
|
1387
|
+
const n = i[f].material === void 0 ? u2(this.cache) : this.getDependency("material", i[f].material);
|
|
1388
1388
|
c.push(n);
|
|
1389
1389
|
}
|
|
1390
1390
|
return c.push(a.loadGeometries(i)), Promise.all(c).then(function(f) {
|
|
@@ -1394,18 +1394,18 @@ class I2 {
|
|
|
1394
1394
|
let g;
|
|
1395
1395
|
const _ = t[s];
|
|
1396
1396
|
if (u.mode === w.TRIANGLES || u.mode === w.TRIANGLE_STRIP || u.mode === w.TRIANGLE_FAN || u.mode === void 0)
|
|
1397
|
-
g =
|
|
1397
|
+
g = r.isSkinnedMesh === !0 ? new _e(h, _) : new x0(h, _), g.isSkinnedMesh === !0 && g.normalizeSkinWeights(), u.mode === w.TRIANGLE_STRIP ? g.geometry = I0(g.geometry, v0) : u.mode === w.TRIANGLE_FAN && (g.geometry = I0(g.geometry, t0));
|
|
1398
1398
|
else if (u.mode === w.LINES)
|
|
1399
|
-
g = new
|
|
1399
|
+
g = new Ae(h, _);
|
|
1400
1400
|
else if (u.mode === w.LINE_STRIP)
|
|
1401
|
-
g = new
|
|
1401
|
+
g = new pe(h, _);
|
|
1402
1402
|
else if (u.mode === w.LINE_LOOP)
|
|
1403
|
-
g = new
|
|
1403
|
+
g = new me(h, _);
|
|
1404
1404
|
else if (u.mode === w.POINTS)
|
|
1405
|
-
g = new
|
|
1405
|
+
g = new je(h, _);
|
|
1406
1406
|
else
|
|
1407
1407
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + u.mode);
|
|
1408
|
-
Object.keys(g.geometry.morphAttributes).length > 0 &&
|
|
1408
|
+
Object.keys(g.geometry.morphAttributes).length > 0 && h2(g, r), g.name = a.createUniqueName(r.name || "mesh_" + e), O(g, r), u.extensions && V(b, g, u), a.assignFinalMaterial(g), d.push(g);
|
|
1409
1409
|
}
|
|
1410
1410
|
for (let s = 0, l = d.length; s < l; s++)
|
|
1411
1411
|
a.associations.set(d[s], {
|
|
@@ -1413,9 +1413,9 @@ class I2 {
|
|
|
1413
1413
|
primitives: s
|
|
1414
1414
|
});
|
|
1415
1415
|
if (d.length === 1)
|
|
1416
|
-
return
|
|
1416
|
+
return r.extensions && V(b, d[0], r), d[0];
|
|
1417
1417
|
const o = new i0();
|
|
1418
|
-
|
|
1418
|
+
r.extensions && V(b, o, r), a.associations.set(o, { meshes: e });
|
|
1419
1419
|
for (let s = 0, l = d.length; s < l; s++)
|
|
1420
1420
|
o.add(d[s]);
|
|
1421
1421
|
return o;
|
|
@@ -1430,12 +1430,12 @@ class I2 {
|
|
|
1430
1430
|
*/
|
|
1431
1431
|
loadCamera(e) {
|
|
1432
1432
|
let a;
|
|
1433
|
-
const
|
|
1433
|
+
const H = this.json.cameras[e], b = H[H.type];
|
|
1434
1434
|
if (!b) {
|
|
1435
1435
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
1436
1436
|
return;
|
|
1437
1437
|
}
|
|
1438
|
-
return
|
|
1438
|
+
return H.type === "perspective" ? a = new Ie(ye.radToDeg(b.yfov), b.aspectRatio || 1, b.znear || 1, b.zfar || 2e6) : H.type === "orthographic" && (a = new Fe(-b.xmag, b.xmag, b.ymag, -b.ymag, b.znear, b.zfar)), H.name && (a.name = this.createUniqueName(H.name)), O(a, H), Promise.resolve(a);
|
|
1439
1439
|
}
|
|
1440
1440
|
/**
|
|
1441
1441
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
@@ -1445,21 +1445,21 @@ class I2 {
|
|
|
1445
1445
|
* @return {Promise<Skeleton>}
|
|
1446
1446
|
*/
|
|
1447
1447
|
loadSkin(e) {
|
|
1448
|
-
const a = this.json.skins[e],
|
|
1449
|
-
for (let b = 0,
|
|
1450
|
-
|
|
1451
|
-
return a.inverseBindMatrices !== void 0 ?
|
|
1452
|
-
const
|
|
1448
|
+
const a = this.json.skins[e], H = [];
|
|
1449
|
+
for (let b = 0, r = a.joints.length; b < r; b++)
|
|
1450
|
+
H.push(this._loadNodeShallow(a.joints[b]));
|
|
1451
|
+
return a.inverseBindMatrices !== void 0 ? H.push(this.getDependency("accessor", a.inverseBindMatrices)) : H.push(null), Promise.all(H).then(function(b) {
|
|
1452
|
+
const r = b.pop(), i = b, c = [], f = [];
|
|
1453
1453
|
for (let t = 0, n = i.length; t < n; t++) {
|
|
1454
1454
|
const d = i[t];
|
|
1455
1455
|
if (d) {
|
|
1456
1456
|
c.push(d);
|
|
1457
1457
|
const o = new $();
|
|
1458
|
-
|
|
1458
|
+
r !== null && o.fromArray(r.array, t * 16), f.push(o);
|
|
1459
1459
|
} else
|
|
1460
1460
|
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', a.joints[t]);
|
|
1461
1461
|
}
|
|
1462
|
-
return new
|
|
1462
|
+
return new we(c, f);
|
|
1463
1463
|
});
|
|
1464
1464
|
}
|
|
1465
1465
|
/**
|
|
@@ -1470,7 +1470,7 @@ class I2 {
|
|
|
1470
1470
|
* @return {Promise<AnimationClip>}
|
|
1471
1471
|
*/
|
|
1472
1472
|
loadAnimation(e) {
|
|
1473
|
-
const a = this.json,
|
|
1473
|
+
const a = this.json, H = this, b = a.animations[e], r = 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
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
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));
|
|
@@ -1484,21 +1484,21 @@ class I2 {
|
|
|
1484
1484
|
]).then(function(d) {
|
|
1485
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[_], I = s[_], F = l[_], y = h[_],
|
|
1487
|
+
const A = o[_], I = s[_], F = l[_], y = h[_], E = u[_];
|
|
1488
1488
|
if (A === void 0) continue;
|
|
1489
1489
|
A.updateMatrix && A.updateMatrix();
|
|
1490
|
-
const N =
|
|
1490
|
+
const N = H._createAnimationTracks(A, I, F, y, E);
|
|
1491
1491
|
if (N)
|
|
1492
1492
|
for (let T = 0; T < N.length; T++)
|
|
1493
1493
|
g.push(N[T]);
|
|
1494
1494
|
}
|
|
1495
|
-
return new
|
|
1495
|
+
return new Ne(r, void 0, g);
|
|
1496
1496
|
});
|
|
1497
1497
|
}
|
|
1498
1498
|
createNodeMesh(e) {
|
|
1499
|
-
const a = this.json,
|
|
1500
|
-
return b.mesh === void 0 ? null :
|
|
1501
|
-
const i =
|
|
1499
|
+
const a = this.json, H = this, b = a.nodes[e];
|
|
1500
|
+
return b.mesh === void 0 ? null : H.getDependency("mesh", b.mesh).then(function(r) {
|
|
1501
|
+
const i = H._getNodeRef(H.meshCache, b.mesh, r);
|
|
1502
1502
|
return b.weights !== void 0 && i.traverse(function(c) {
|
|
1503
1503
|
if (c.isMesh)
|
|
1504
1504
|
for (let f = 0, t = b.weights.length; f < t; f++)
|
|
@@ -1514,18 +1514,18 @@ class I2 {
|
|
|
1514
1514
|
* @return {Promise<Object3D>}
|
|
1515
1515
|
*/
|
|
1516
1516
|
loadNode(e) {
|
|
1517
|
-
const a = this.json,
|
|
1517
|
+
const a = this.json, H = this, b = a.nodes[e], r = H._loadNodeShallow(e), i = [], c = b.children || [];
|
|
1518
1518
|
for (let t = 0, n = c.length; t < n; t++)
|
|
1519
|
-
i.push(
|
|
1520
|
-
const f = b.skin === void 0 ? Promise.resolve(null) :
|
|
1519
|
+
i.push(H.getDependency("node", c[t]));
|
|
1520
|
+
const f = b.skin === void 0 ? Promise.resolve(null) : H.getDependency("skin", b.skin);
|
|
1521
1521
|
return Promise.all([
|
|
1522
|
-
|
|
1522
|
+
r,
|
|
1523
1523
|
Promise.all(i),
|
|
1524
1524
|
f
|
|
1525
1525
|
]).then(function(t) {
|
|
1526
1526
|
const n = t[0], d = t[1], o = t[2];
|
|
1527
1527
|
o !== null && n.traverse(function(s) {
|
|
1528
|
-
s.isSkinnedMesh && s.bind(o,
|
|
1528
|
+
s.isSkinnedMesh && s.bind(o, A2);
|
|
1529
1529
|
});
|
|
1530
1530
|
for (let s = 0, l = d.length; s < l; s++)
|
|
1531
1531
|
n.add(d[s]);
|
|
@@ -1535,31 +1535,31 @@ class I2 {
|
|
|
1535
1535
|
// ._loadNodeShallow() parses a single node.
|
|
1536
1536
|
// skin and child nodes are created and added in .loadNode() (no '_' prefix).
|
|
1537
1537
|
_loadNodeShallow(e) {
|
|
1538
|
-
const a = this.json,
|
|
1538
|
+
const a = this.json, H = this.extensions, b = this;
|
|
1539
1539
|
if (this.nodeCache[e] !== void 0)
|
|
1540
1540
|
return this.nodeCache[e];
|
|
1541
|
-
const
|
|
1541
|
+
const r = a.nodes[e], i = r.name ? b.createUniqueName(r.name) : "", c = [], f = b._invokeOne(function(t) {
|
|
1542
1542
|
return t.createNodeMesh && t.createNodeMesh(e);
|
|
1543
1543
|
});
|
|
1544
|
-
return f && c.push(f),
|
|
1545
|
-
return b._getNodeRef(b.cameraCache,
|
|
1544
|
+
return f && c.push(f), r.camera !== void 0 && c.push(b.getDependency("camera", r.camera).then(function(t) {
|
|
1545
|
+
return b._getNodeRef(b.cameraCache, r.camera, t);
|
|
1546
1546
|
})), b._invokeAll(function(t) {
|
|
1547
1547
|
return t.createNodeAttachment && t.createNodeAttachment(e);
|
|
1548
1548
|
}).forEach(function(t) {
|
|
1549
1549
|
c.push(t);
|
|
1550
1550
|
}), this.nodeCache[e] = Promise.all(c).then(function(t) {
|
|
1551
1551
|
let n;
|
|
1552
|
-
if (
|
|
1552
|
+
if (r.isBone === !0 ? n = new ve() : t.length > 1 ? n = new i0() : t.length === 1 ? n = t[0] : n = new D0(), n !== t[0])
|
|
1553
1553
|
for (let d = 0, o = t.length; d < o; d++)
|
|
1554
1554
|
n.add(t[d]);
|
|
1555
|
-
if (
|
|
1555
|
+
if (r.name && (n.userData.name = r.name, n.name = i), O(n, r), r.extensions && V(H, n, r), r.matrix !== void 0) {
|
|
1556
1556
|
const d = new $();
|
|
1557
|
-
d.fromArray(
|
|
1557
|
+
d.fromArray(r.matrix), n.applyMatrix4(d);
|
|
1558
1558
|
} else
|
|
1559
|
-
|
|
1559
|
+
r.translation !== void 0 && n.position.fromArray(r.translation), r.rotation !== void 0 && n.quaternion.fromArray(r.rotation), r.scale !== void 0 && n.scale.fromArray(r.scale);
|
|
1560
1560
|
if (!b.associations.has(n))
|
|
1561
1561
|
b.associations.set(n, {});
|
|
1562
|
-
else if (
|
|
1562
|
+
else if (r.mesh !== void 0 && b.meshCache.refs[r.mesh] > 1) {
|
|
1563
1563
|
const d = b.associations.get(n);
|
|
1564
1564
|
b.associations.set(n, { ...d });
|
|
1565
1565
|
}
|
|
@@ -1574,60 +1574,60 @@ class I2 {
|
|
|
1574
1574
|
* @return {Promise<Group>}
|
|
1575
1575
|
*/
|
|
1576
1576
|
loadScene(e) {
|
|
1577
|
-
const a = this.extensions,
|
|
1578
|
-
|
|
1579
|
-
const i =
|
|
1577
|
+
const a = this.extensions, H = this.json.scenes[e], b = this, r = new i0();
|
|
1578
|
+
H.name && (r.name = b.createUniqueName(H.name)), O(r, H), H.extensions && V(a, r, H);
|
|
1579
|
+
const i = H.nodes || [], c = [];
|
|
1580
1580
|
for (let f = 0, t = i.length; f < t; f++)
|
|
1581
1581
|
c.push(b.getDependency("node", i[f]));
|
|
1582
1582
|
return Promise.all(c).then(function(f) {
|
|
1583
1583
|
for (let n = 0, d = f.length; n < d; n++)
|
|
1584
|
-
|
|
1584
|
+
r.add(f[n]);
|
|
1585
1585
|
const t = (n) => {
|
|
1586
1586
|
const d = /* @__PURE__ */ new Map();
|
|
1587
1587
|
for (const [o, s] of b.associations)
|
|
1588
|
-
(o instanceof b0 || o instanceof
|
|
1588
|
+
(o instanceof b0 || o instanceof _0) && d.set(o, s);
|
|
1589
1589
|
return n.traverse((o) => {
|
|
1590
1590
|
const s = b.associations.get(o);
|
|
1591
1591
|
s != null && d.set(o, s);
|
|
1592
1592
|
}), d;
|
|
1593
1593
|
};
|
|
1594
|
-
return b.associations = t(
|
|
1594
|
+
return b.associations = t(r), r;
|
|
1595
1595
|
});
|
|
1596
1596
|
}
|
|
1597
|
-
_createAnimationTracks(e, a,
|
|
1597
|
+
_createAnimationTracks(e, a, H, b, r) {
|
|
1598
1598
|
const i = [], c = e.name ? e.name : e.uuid, f = [];
|
|
1599
|
-
G[
|
|
1599
|
+
G[r.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 (G[
|
|
1603
|
+
switch (G[r.path]) {
|
|
1604
1604
|
case G.weights:
|
|
1605
|
-
t =
|
|
1605
|
+
t = p0;
|
|
1606
1606
|
break;
|
|
1607
1607
|
case G.rotation:
|
|
1608
|
-
t =
|
|
1608
|
+
t = m0;
|
|
1609
1609
|
break;
|
|
1610
1610
|
case G.translation:
|
|
1611
1611
|
case G.scale:
|
|
1612
|
-
t =
|
|
1612
|
+
t = A0;
|
|
1613
1613
|
break;
|
|
1614
1614
|
default:
|
|
1615
|
-
switch (
|
|
1615
|
+
switch (H.itemSize) {
|
|
1616
1616
|
case 1:
|
|
1617
|
-
t =
|
|
1617
|
+
t = p0;
|
|
1618
1618
|
break;
|
|
1619
1619
|
case 2:
|
|
1620
1620
|
case 3:
|
|
1621
1621
|
default:
|
|
1622
|
-
t =
|
|
1622
|
+
t = A0;
|
|
1623
1623
|
break;
|
|
1624
1624
|
}
|
|
1625
1625
|
break;
|
|
1626
1626
|
}
|
|
1627
|
-
const n = b.interpolation !== void 0 ?
|
|
1627
|
+
const n = b.interpolation !== void 0 ? s2[b.interpolation] : q0, d = this._getArrayFromAccessor(H);
|
|
1628
1628
|
for (let o = 0, s = f.length; o < s; o++) {
|
|
1629
1629
|
const l = new t(
|
|
1630
|
-
f[o] + "." + G[
|
|
1630
|
+
f[o] + "." + G[r.path],
|
|
1631
1631
|
a.array,
|
|
1632
1632
|
d,
|
|
1633
1633
|
n
|
|
@@ -1639,24 +1639,24 @@ class I2 {
|
|
|
1639
1639
|
_getArrayFromAccessor(e) {
|
|
1640
1640
|
let a = e.array;
|
|
1641
1641
|
if (e.normalized) {
|
|
1642
|
-
const
|
|
1643
|
-
for (let
|
|
1644
|
-
b[
|
|
1642
|
+
const H = s0(a.constructor), b = new Float32Array(a.length);
|
|
1643
|
+
for (let r = 0, i = a.length; r < i; r++)
|
|
1644
|
+
b[r] = a[r] * H;
|
|
1645
1645
|
a = b;
|
|
1646
1646
|
}
|
|
1647
1647
|
return a;
|
|
1648
1648
|
}
|
|
1649
1649
|
_createCubicSplineTrackInterpolant(e) {
|
|
1650
|
-
e.createInterpolant = function(
|
|
1651
|
-
const b = this instanceof
|
|
1652
|
-
return new b(this.times, this.values, this.getValueSize() / 3,
|
|
1650
|
+
e.createInterpolant = function(H) {
|
|
1651
|
+
const b = this instanceof m0 ? k2 : P0;
|
|
1652
|
+
return new b(this.times, this.values, this.getValueSize() / 3, H);
|
|
1653
1653
|
}, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
|
|
1654
1654
|
}
|
|
1655
1655
|
}
|
|
1656
|
-
function
|
|
1657
|
-
const
|
|
1658
|
-
if (
|
|
1659
|
-
const c = a.json.accessors[
|
|
1656
|
+
function m2(k, e, a) {
|
|
1657
|
+
const H = e.attributes, b = new B0();
|
|
1658
|
+
if (H.POSITION !== void 0) {
|
|
1659
|
+
const c = a.json.accessors[H.POSITION], f = c.min, t = c.max;
|
|
1660
1660
|
if (f !== void 0 && t !== void 0) {
|
|
1661
1661
|
if (b.set(
|
|
1662
1662
|
new C(f[0], f[1], f[2]),
|
|
@@ -1671,11 +1671,11 @@ function y2(k, e, a) {
|
|
|
1671
1671
|
}
|
|
1672
1672
|
} else
|
|
1673
1673
|
return;
|
|
1674
|
-
const
|
|
1675
|
-
if (
|
|
1674
|
+
const r = e.targets;
|
|
1675
|
+
if (r !== void 0) {
|
|
1676
1676
|
const c = new C(), f = new C();
|
|
1677
|
-
for (let t = 0, n =
|
|
1678
|
-
const d =
|
|
1677
|
+
for (let t = 0, n = r.length; t < n; t++) {
|
|
1678
|
+
const d = r[t];
|
|
1679
1679
|
if (d.POSITION !== void 0) {
|
|
1680
1680
|
const o = a.json.accessors[d.POSITION], s = o.min, l = o.max;
|
|
1681
1681
|
if (s !== void 0 && l !== void 0) {
|
|
@@ -1691,19 +1691,19 @@ function y2(k, e, a) {
|
|
|
1691
1691
|
b.expandByVector(c);
|
|
1692
1692
|
}
|
|
1693
1693
|
k.boundingBox = b;
|
|
1694
|
-
const i = new
|
|
1694
|
+
const i = new Oe();
|
|
1695
1695
|
b.getCenter(i.center), i.radius = b.min.distanceTo(b.max) / 2, k.boundingSphere = i;
|
|
1696
1696
|
}
|
|
1697
|
-
function
|
|
1698
|
-
const
|
|
1699
|
-
function
|
|
1697
|
+
function N0(k, e, a) {
|
|
1698
|
+
const H = e.attributes, b = [];
|
|
1699
|
+
function r(i, c) {
|
|
1700
1700
|
return a.getDependency("accessor", i).then(function(f) {
|
|
1701
1701
|
k.setAttribute(c, f);
|
|
1702
1702
|
});
|
|
1703
1703
|
}
|
|
1704
|
-
for (const i in
|
|
1704
|
+
for (const i in H) {
|
|
1705
1705
|
const c = k0[i] || i.toLowerCase();
|
|
1706
|
-
c in k.attributes || b.push(H
|
|
1706
|
+
c in k.attributes || b.push(r(H[i], c));
|
|
1707
1707
|
}
|
|
1708
1708
|
if (e.indices !== void 0 && !k.index) {
|
|
1709
1709
|
const i = a.getDependency("accessor", e.indices).then(function(c) {
|
|
@@ -1711,12 +1711,12 @@ function v0(k, e, a) {
|
|
|
1711
1711
|
});
|
|
1712
1712
|
b.push(i);
|
|
1713
1713
|
}
|
|
1714
|
-
return o0.workingColorSpace !== M && "COLOR_0" in
|
|
1715
|
-
return e.targets !== void 0 ?
|
|
1714
|
+
return o0.workingColorSpace !== M && "COLOR_0" in H && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${o0.workingColorSpace}" not supported.`), O(k, e), m2(k, e, a), Promise.all(b).then(function() {
|
|
1715
|
+
return e.targets !== void 0 ? l2(k, e.targets, a) : k;
|
|
1716
1716
|
});
|
|
1717
1717
|
}
|
|
1718
1718
|
const c0 = /* @__PURE__ */ new WeakMap();
|
|
1719
|
-
class
|
|
1719
|
+
class j2 extends T0 {
|
|
1720
1720
|
/**
|
|
1721
1721
|
* Constructs a new Draco loader.
|
|
1722
1722
|
*
|
|
@@ -1772,11 +1772,11 @@ class F2 extends R0 {
|
|
|
1772
1772
|
* @param {onProgressCallback} onProgress - Executed while the loading is in progress.
|
|
1773
1773
|
* @param {onErrorCallback} onError - Executed when errors occur.
|
|
1774
1774
|
*/
|
|
1775
|
-
load(e, a,
|
|
1776
|
-
const
|
|
1777
|
-
|
|
1775
|
+
load(e, a, H, b) {
|
|
1776
|
+
const r = new X(this.manager);
|
|
1777
|
+
r.setPath(this.path), r.setResponseType("arraybuffer"), r.setRequestHeader(this.requestHeader), r.setWithCredentials(this.withCredentials), r.load(e, (i) => {
|
|
1778
1778
|
this.parse(i, a, b);
|
|
1779
|
-
},
|
|
1779
|
+
}, H, b);
|
|
1780
1780
|
}
|
|
1781
1781
|
/**
|
|
1782
1782
|
* Parses the given Draco data.
|
|
@@ -1785,26 +1785,26 @@ class F2 extends R0 {
|
|
|
1785
1785
|
* @param {function(BufferGeometry)} onLoad - Executed when the loading/parsing process has been finished.
|
|
1786
1786
|
* @param {onErrorCallback} onError - Executed when errors occur.
|
|
1787
1787
|
*/
|
|
1788
|
-
parse(e, a,
|
|
1788
|
+
parse(e, a, H = () => {
|
|
1789
1789
|
}) {
|
|
1790
|
-
this.decodeDracoFile(e, a, null, null, U,
|
|
1790
|
+
this.decodeDracoFile(e, a, null, null, U, H).catch(H);
|
|
1791
1791
|
}
|
|
1792
1792
|
//
|
|
1793
|
-
decodeDracoFile(e, a,
|
|
1793
|
+
decodeDracoFile(e, a, H, b, r = M, i = () => {
|
|
1794
1794
|
}) {
|
|
1795
1795
|
const c = {
|
|
1796
|
-
attributeIDs:
|
|
1796
|
+
attributeIDs: H || this.defaultAttributeIDs,
|
|
1797
1797
|
attributeTypes: b || this.defaultAttributeTypes,
|
|
1798
|
-
useUniqueIDs: !!
|
|
1799
|
-
vertexColorSpace:
|
|
1798
|
+
useUniqueIDs: !!H,
|
|
1799
|
+
vertexColorSpace: r
|
|
1800
1800
|
};
|
|
1801
1801
|
return this.decodeGeometry(e, c).then(a).catch(i);
|
|
1802
1802
|
}
|
|
1803
1803
|
decodeGeometry(e, a) {
|
|
1804
|
-
const
|
|
1804
|
+
const H = JSON.stringify(a);
|
|
1805
1805
|
if (c0.has(e)) {
|
|
1806
1806
|
const f = c0.get(e);
|
|
1807
|
-
if (f.key ===
|
|
1807
|
+
if (f.key === H)
|
|
1808
1808
|
return f.promise;
|
|
1809
1809
|
if (e.byteLength === 0)
|
|
1810
1810
|
throw new Error(
|
|
@@ -1812,35 +1812,35 @@ class F2 extends R0 {
|
|
|
1812
1812
|
);
|
|
1813
1813
|
}
|
|
1814
1814
|
let b;
|
|
1815
|
-
const
|
|
1816
|
-
b._callbacks[
|
|
1815
|
+
const r = this.workerNextTaskID++, i = e.byteLength, c = this._getWorker(r, i).then((f) => (b = f, new Promise((t, n) => {
|
|
1816
|
+
b._callbacks[r] = { resolve: t, reject: n }, b.postMessage({ type: "decode", id: r, taskConfig: a, buffer: e }, [e]);
|
|
1817
1817
|
}))).then((f) => this._createGeometry(f.geometry));
|
|
1818
1818
|
return c.catch(() => !0).then(() => {
|
|
1819
|
-
b &&
|
|
1819
|
+
b && r && this._releaseTask(b, r);
|
|
1820
1820
|
}), c0.set(e, {
|
|
1821
|
-
key:
|
|
1821
|
+
key: H,
|
|
1822
1822
|
promise: c
|
|
1823
1823
|
}), c;
|
|
1824
1824
|
}
|
|
1825
1825
|
_createGeometry(e) {
|
|
1826
|
-
const a = new
|
|
1827
|
-
e.index && a.setIndex(new
|
|
1828
|
-
for (let
|
|
1829
|
-
const b = e.attributes[
|
|
1830
|
-
|
|
1826
|
+
const a = new U0();
|
|
1827
|
+
e.index && a.setIndex(new Y(e.index.array, 1));
|
|
1828
|
+
for (let H = 0; H < e.attributes.length; H++) {
|
|
1829
|
+
const b = e.attributes[H], r = b.name, i = b.array, c = b.itemSize, f = new Y(i, c);
|
|
1830
|
+
r === "color" && (this._assignVertexColorSpace(f, b.vertexColorSpace), f.normalized = !(i instanceof Float32Array)), a.setAttribute(r, f);
|
|
1831
1831
|
}
|
|
1832
1832
|
return a;
|
|
1833
1833
|
}
|
|
1834
1834
|
_assignVertexColorSpace(e, a) {
|
|
1835
1835
|
if (a !== U) return;
|
|
1836
|
-
const
|
|
1837
|
-
for (let b = 0,
|
|
1838
|
-
|
|
1836
|
+
const H = new x();
|
|
1837
|
+
for (let b = 0, r = e.count; b < r; b++)
|
|
1838
|
+
H.fromBufferAttribute(e, b), o0.colorSpaceToWorking(H, U), e.setXYZ(b, H.r, H.g, H.b);
|
|
1839
1839
|
}
|
|
1840
1840
|
_loadLibrary(e, a) {
|
|
1841
|
-
const
|
|
1842
|
-
return
|
|
1843
|
-
|
|
1841
|
+
const H = new X(this.manager);
|
|
1842
|
+
return H.setPath(this.decoderPath), H.setResponseType(a), H.setWithCredentials(this.withCredentials), new Promise((b, r) => {
|
|
1843
|
+
H.load(e, b, void 0, r);
|
|
1844
1844
|
});
|
|
1845
1845
|
}
|
|
1846
1846
|
preload() {
|
|
@@ -1849,15 +1849,15 @@ class F2 extends R0 {
|
|
|
1849
1849
|
_initDecoder() {
|
|
1850
1850
|
if (this.decoderPending) return this.decoderPending;
|
|
1851
1851
|
const e = typeof WebAssembly != "object" || this.decoderConfig.type === "js", a = [];
|
|
1852
|
-
return e ? a.push(this._loadLibrary("draco_decoder.js", "text")) : (a.push(this._loadLibrary("draco_wasm_wrapper.js", "text")), a.push(this._loadLibrary("draco_decoder.wasm", "arraybuffer"))), this.decoderPending = Promise.all(a).then((
|
|
1853
|
-
const b =
|
|
1854
|
-
e || (this.decoderConfig.wasmBinary =
|
|
1855
|
-
const
|
|
1852
|
+
return e ? a.push(this._loadLibrary("draco_decoder.js", "text")) : (a.push(this._loadLibrary("draco_wasm_wrapper.js", "text")), a.push(this._loadLibrary("draco_decoder.wasm", "arraybuffer"))), this.decoderPending = Promise.all(a).then((H) => {
|
|
1853
|
+
const b = H[0];
|
|
1854
|
+
e || (this.decoderConfig.wasmBinary = H[1]);
|
|
1855
|
+
const r = I2.toString(), i = [
|
|
1856
1856
|
"/* draco decoder */",
|
|
1857
1857
|
b,
|
|
1858
1858
|
"",
|
|
1859
1859
|
"/* worker */",
|
|
1860
|
-
|
|
1860
|
+
r.substring(r.indexOf("{") + 1, r.lastIndexOf("}"))
|
|
1861
1861
|
].join(`
|
|
1862
1862
|
`);
|
|
1863
1863
|
this.workerSourceURL = URL.createObjectURL(new Blob([i]));
|
|
@@ -1867,8 +1867,8 @@ class F2 extends R0 {
|
|
|
1867
1867
|
return this._initDecoder().then(() => {
|
|
1868
1868
|
if (this.workerPool.length < this.workerLimit) {
|
|
1869
1869
|
const b = new Worker(this.workerSourceURL);
|
|
1870
|
-
b._callbacks = {}, b._taskCosts = {}, b._taskLoad = 0, b.postMessage({ type: "init", decoderConfig: this.decoderConfig }), b.onmessage = function(
|
|
1871
|
-
const i =
|
|
1870
|
+
b._callbacks = {}, b._taskCosts = {}, b._taskLoad = 0, b.postMessage({ type: "init", decoderConfig: this.decoderConfig }), b.onmessage = function(r) {
|
|
1871
|
+
const i = r.data;
|
|
1872
1872
|
switch (i.type) {
|
|
1873
1873
|
case "decode":
|
|
1874
1874
|
b._callbacks[i.id].resolve(i);
|
|
@@ -1881,11 +1881,11 @@ class F2 extends R0 {
|
|
|
1881
1881
|
}
|
|
1882
1882
|
}, this.workerPool.push(b);
|
|
1883
1883
|
} else
|
|
1884
|
-
this.workerPool.sort(function(b,
|
|
1885
|
-
return b._taskLoad >
|
|
1884
|
+
this.workerPool.sort(function(b, r) {
|
|
1885
|
+
return b._taskLoad > r._taskLoad ? -1 : 1;
|
|
1886
1886
|
});
|
|
1887
|
-
const
|
|
1888
|
-
return
|
|
1887
|
+
const H = this.workerPool[this.workerPool.length - 1];
|
|
1888
|
+
return H._taskCosts[e] = a, H._taskLoad += a, H;
|
|
1889
1889
|
});
|
|
1890
1890
|
}
|
|
1891
1891
|
_releaseTask(e, a) {
|
|
@@ -1900,7 +1900,7 @@ class F2 extends R0 {
|
|
|
1900
1900
|
return this.workerPool.length = 0, this.workerSourceURL !== "" && URL.revokeObjectURL(this.workerSourceURL), this;
|
|
1901
1901
|
}
|
|
1902
1902
|
}
|
|
1903
|
-
function
|
|
1903
|
+
function I2() {
|
|
1904
1904
|
let k, e;
|
|
1905
1905
|
onmessage = function(i) {
|
|
1906
1906
|
const c = i.data;
|
|
@@ -1953,16 +1953,16 @@ function w2() {
|
|
|
1953
1953
|
const A = b(i, c, o, u, g, _);
|
|
1954
1954
|
u === "color" && (A.vertexColorSpace = t.vertexColorSpace), h.attributes.push(A);
|
|
1955
1955
|
}
|
|
1956
|
-
return l === i.TRIANGULAR_MESH && (h.index =
|
|
1956
|
+
return l === i.TRIANGULAR_MESH && (h.index = H(i, c, o)), i.destroy(o), h;
|
|
1957
1957
|
}
|
|
1958
|
-
function
|
|
1958
|
+
function H(i, c, f) {
|
|
1959
1959
|
const n = f.num_faces() * 3, d = n * 4, o = i._malloc(d);
|
|
1960
1960
|
c.GetTrianglesUInt32Array(f, d, o);
|
|
1961
1961
|
const s = new Uint32Array(i.HEAPF32.buffer, o, n).slice();
|
|
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(), l = f.num_points() * o, h = l * n.BYTES_PER_ELEMENT, u =
|
|
1965
|
+
const o = d.num_components(), l = f.num_points() * o, h = l * n.BYTES_PER_ELEMENT, u = r(i, n), g = i._malloc(h);
|
|
1966
1966
|
c.GetAttributeDataArrayForAllPoints(f, d, u, h, g);
|
|
1967
1967
|
const _ = new n(i.HEAPF32.buffer, g, l).slice();
|
|
1968
1968
|
return i._free(g), {
|
|
@@ -1971,7 +1971,7 @@ function w2() {
|
|
|
1971
1971
|
itemSize: o
|
|
1972
1972
|
};
|
|
1973
1973
|
}
|
|
1974
|
-
function
|
|
1974
|
+
function r(i, c) {
|
|
1975
1975
|
switch (c) {
|
|
1976
1976
|
case Float32Array:
|
|
1977
1977
|
return i.DT_FLOAT32;
|
|
@@ -1990,7 +1990,7 @@ function w2() {
|
|
|
1990
1990
|
}
|
|
1991
1991
|
}
|
|
1992
1992
|
}
|
|
1993
|
-
const
|
|
1993
|
+
const y2 = `
|
|
1994
1994
|
var DracoDecoderModule = (() => {
|
|
1995
1995
|
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
|
1996
1996
|
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
|
@@ -2025,21 +2025,21 @@ else if (typeof define === 'function' && define['amd'])
|
|
|
2025
2025
|
else if (typeof exports === 'object')
|
|
2026
2026
|
exports["DracoDecoderModule"] = DracoDecoderModule;
|
|
2027
2027
|
`;
|
|
2028
|
-
function
|
|
2029
|
-
const k = S(!1), e = S(""), a =
|
|
2028
|
+
function F2() {
|
|
2029
|
+
const k = S(!1), e = S(""), a = S0([]), H = S(null), b = new xe(), r = new qe(), i = new Be(), c = new Pe();
|
|
2030
2030
|
let f = null;
|
|
2031
2031
|
return {
|
|
2032
2032
|
isLoading: k,
|
|
2033
2033
|
loadingProgress: e,
|
|
2034
2034
|
loadedModels: a,
|
|
2035
|
-
error:
|
|
2035
|
+
error: H,
|
|
2036
2036
|
loadModelsFromBlobs: async (n) => {
|
|
2037
2037
|
var l;
|
|
2038
2038
|
if (!n || n.length === 0) {
|
|
2039
2039
|
console.warn("loadModelsFromBlobs 加载的文件数组为空!");
|
|
2040
2040
|
return;
|
|
2041
2041
|
}
|
|
2042
|
-
k.value = !0, e.value = "准备加载...", a.value = [],
|
|
2042
|
+
k.value = !0, e.value = "准备加载...", a.value = [], H.value = null;
|
|
2043
2043
|
const d = /* @__PURE__ */ new Map();
|
|
2044
2044
|
n.forEach((h) => {
|
|
2045
2045
|
h instanceof File && d.set(h.name.toLowerCase(), h);
|
|
@@ -2062,62 +2062,62 @@ function v2() {
|
|
|
2062
2062
|
if (d.has(I)) {
|
|
2063
2063
|
const T = d.get(I), P = URL.createObjectURL(T);
|
|
2064
2064
|
o.push(P);
|
|
2065
|
-
const
|
|
2066
|
-
|
|
2065
|
+
const Z = await b.loadAsync(P);
|
|
2066
|
+
Z.preload(), r.setMaterials(Z);
|
|
2067
2067
|
} else
|
|
2068
|
-
|
|
2069
|
-
m = await
|
|
2068
|
+
r.setMaterials(null);
|
|
2069
|
+
m = await r.loadAsync(_, A);
|
|
2070
2070
|
break;
|
|
2071
2071
|
case "stl":
|
|
2072
|
-
const F = await i.loadAsync(_, A), y = new
|
|
2073
|
-
m = new
|
|
2072
|
+
const F = await i.loadAsync(_, A), y = new Ee({ color: 11184810, specular: 1118481, shininess: 200 });
|
|
2073
|
+
m = new x0(F, y);
|
|
2074
2074
|
break;
|
|
2075
2075
|
case "gltf":
|
|
2076
2076
|
m = (await c.loadAsync(_, A)).scene;
|
|
2077
2077
|
break;
|
|
2078
2078
|
case "glb":
|
|
2079
|
-
f || (f = new
|
|
2080
|
-
return T === "draco_decoder.js" && P === "text" ? Promise.resolve(
|
|
2079
|
+
f || (f = new j2(), f._loadLibrary = function(T, P) {
|
|
2080
|
+
return T === "draco_decoder.js" && P === "text" ? Promise.resolve(y2) : Promise.reject(new Error(`DRACOLoader: 未预期的库请求 ${T}`));
|
|
2081
2081
|
}, f.setDecoderConfig({ type: "js" }), f.preload()), c.setDRACOLoader(f), m = (await c.loadAsync(_, A)).scene;
|
|
2082
2082
|
break;
|
|
2083
2083
|
default:
|
|
2084
2084
|
console.warn(`不支持的文件类型: .${g}`), e.value = `不支持的文件类型: ${u}`;
|
|
2085
2085
|
continue;
|
|
2086
2086
|
}
|
|
2087
|
-
m && (m.userData.boundingBox = new
|
|
2087
|
+
m && (m.userData.boundingBox = new B0().setFromObject(m), s.push(m));
|
|
2088
2088
|
}
|
|
2089
2089
|
a.value = s, e.value = "加载完成!";
|
|
2090
2090
|
} catch (h) {
|
|
2091
|
-
throw console.error("加载模型时出错:", h),
|
|
2091
|
+
throw console.error("加载模型时出错:", h), H.value = `加载失败: ${h.message || "未知错误"}`, e.value = "加载失败!", a.value = [], h;
|
|
2092
2092
|
} finally {
|
|
2093
2093
|
k.value = !1, o.forEach((h) => URL.revokeObjectURL(h));
|
|
2094
2094
|
}
|
|
2095
2095
|
}
|
|
2096
2096
|
};
|
|
2097
2097
|
}
|
|
2098
|
-
function
|
|
2098
|
+
function w2(k, e = {}) {
|
|
2099
2099
|
const a = {
|
|
2100
2100
|
threeInfo: {},
|
|
2101
2101
|
modelLoader: {},
|
|
2102
2102
|
animation: {},
|
|
2103
2103
|
clipping: {}
|
|
2104
|
-
},
|
|
2105
|
-
a.threeInfo =
|
|
2106
|
-
const { currentModels: b, getThreeJSObjects:
|
|
2107
|
-
return i && (a.modelLoader =
|
|
2104
|
+
}, H = Ge(k);
|
|
2105
|
+
a.threeInfo = H;
|
|
2106
|
+
const { currentModels: b, getThreeJSObjects: r } = H, { useModelLoaderHook: i, useAnimationHook: c, useClippingHook: f } = e;
|
|
2107
|
+
return i && (a.modelLoader = F2()), a;
|
|
2108
2108
|
}
|
|
2109
|
-
const
|
|
2109
|
+
const N2 = { class: "obj-viewer-container" }, v2 = { class: "buttonGroup-topLeft" }, T2 = { class: "buttonGroup-left" }, R2 = { class: "buttonGroup-right" }, M2 = { class: "left-panel" }, D2 = { class: "panel-header" }, O2 = {
|
|
2110
2110
|
key: 0,
|
|
2111
2111
|
class: "loading-overlay"
|
|
2112
|
-
},
|
|
2112
|
+
}, E2 = /* @__PURE__ */ L0({
|
|
2113
2113
|
__name: "threePreview",
|
|
2114
2114
|
props: {
|
|
2115
2115
|
fileBlobs: { default: () => [] }
|
|
2116
2116
|
},
|
|
2117
2117
|
setup(k) {
|
|
2118
|
-
const e = k, a = S(null),
|
|
2118
|
+
const e = k, a = S(null), H = S(!1), b = S(""), {
|
|
2119
2119
|
threeInfo: {
|
|
2120
|
-
currentModels:
|
|
2120
|
+
currentModels: r,
|
|
2121
2121
|
resetView: i,
|
|
2122
2122
|
initThreeJS: c,
|
|
2123
2123
|
handleResize: f,
|
|
@@ -2134,21 +2134,21 @@ const R2 = { class: "obj-viewer-container" }, M2 = { class: "buttonGroup-topLeft
|
|
|
2134
2134
|
error: g,
|
|
2135
2135
|
loadModelsFromBlobs: _
|
|
2136
2136
|
},
|
|
2137
|
-
animation: { isAnimating: m, toggleAnimation: A,
|
|
2137
|
+
animation: { isAnimating: m, toggleAnimation: A, stopAnimation: I },
|
|
2138
2138
|
clipping: {
|
|
2139
|
-
isClipping:
|
|
2140
|
-
activeClippingAxis:
|
|
2141
|
-
toggleClipping:
|
|
2142
|
-
updateClippingPlanes:
|
|
2139
|
+
isClipping: F,
|
|
2140
|
+
activeClippingAxis: y,
|
|
2141
|
+
toggleClipping: E,
|
|
2142
|
+
updateClippingPlanes: N
|
|
2143
2143
|
}
|
|
2144
|
-
} =
|
|
2144
|
+
} = w2(a, {
|
|
2145
2145
|
useModelLoaderHook: !0,
|
|
2146
2146
|
useAnimationHook: !0,
|
|
2147
2147
|
useClippingHook: !0
|
|
2148
|
-
}),
|
|
2148
|
+
}), T = () => {
|
|
2149
2149
|
s();
|
|
2150
|
-
},
|
|
2151
|
-
|
|
2150
|
+
}, P = (j) => {
|
|
2151
|
+
y.value = j, N();
|
|
2152
2152
|
};
|
|
2153
2153
|
e0(() => e.fileBlobs, (j) => {
|
|
2154
2154
|
j && j.length > 0 && _(j).catch((R) => {
|
|
@@ -2160,30 +2160,30 @@ const R2 = { class: "obj-viewer-container" }, M2 = { class: "buttonGroup-topLeft
|
|
|
2160
2160
|
}), e0(u, (j) => {
|
|
2161
2161
|
j && j.length > 0 && d(j);
|
|
2162
2162
|
}), e0(g, (j) => {
|
|
2163
|
-
j &&
|
|
2163
|
+
j && j0.error(`模型加载失败: ${j}`);
|
|
2164
2164
|
});
|
|
2165
|
-
const
|
|
2166
|
-
|
|
2165
|
+
const Z = (j) => {
|
|
2166
|
+
H.value = !0, b.value = j, j === "剖面视图" && !F.value && E();
|
|
2167
2167
|
};
|
|
2168
2168
|
let K = null;
|
|
2169
|
-
return
|
|
2170
|
-
await
|
|
2169
|
+
return Z0(async () => {
|
|
2170
|
+
await z0();
|
|
2171
2171
|
try {
|
|
2172
2172
|
c(), a.value && (K = new ResizeObserver(f), K.observe(a.value));
|
|
2173
2173
|
} catch (j) {
|
|
2174
|
-
console.error("Three.js 初始化失败:", j),
|
|
2174
|
+
console.error("Three.js 初始化失败:", j), j0.error("渲染引擎初始化失败!");
|
|
2175
2175
|
}
|
|
2176
|
-
}),
|
|
2177
|
-
b.value = "", K && K.disconnect(), m.value &&
|
|
2176
|
+
}), Q0(() => {
|
|
2177
|
+
b.value = "", K && K.disconnect(), m.value && I(), n();
|
|
2178
2178
|
}), (j, R) => {
|
|
2179
|
-
const
|
|
2180
|
-
return a0(),
|
|
2179
|
+
const W0 = J0("el-scrollbar");
|
|
2180
|
+
return a0(), u0("div", N2, [
|
|
2181
2181
|
v("div", {
|
|
2182
2182
|
ref_key: "threejsContainer",
|
|
2183
2183
|
ref: a,
|
|
2184
2184
|
class: "threejs-container"
|
|
2185
2185
|
}, null, 512),
|
|
2186
|
-
v("div",
|
|
2186
|
+
v("div", v2, [
|
|
2187
2187
|
q(W, {
|
|
2188
2188
|
name: "viewReset",
|
|
2189
2189
|
size: "24",
|
|
@@ -2210,53 +2210,53 @@ const R2 = { class: "obj-viewer-container" }, M2 = { class: "buttonGroup-topLeft
|
|
|
2210
2210
|
name: "zuobiaoxi",
|
|
2211
2211
|
size: "24",
|
|
2212
2212
|
active: B(o),
|
|
2213
|
-
onClick:
|
|
2213
|
+
onClick: T,
|
|
2214
2214
|
title: "显隐坐标轴"
|
|
2215
2215
|
}, null, 8, ["active"])
|
|
2216
2216
|
]),
|
|
2217
|
-
v("div",
|
|
2218
|
-
h0(j.$slots, "button-left", { switchRightPanel:
|
|
2217
|
+
v("div", T2, [
|
|
2218
|
+
h0(j.$slots, "button-left", { switchRightPanel: Z }, void 0, !0),
|
|
2219
2219
|
q(W, {
|
|
2220
2220
|
name: "clipping",
|
|
2221
2221
|
size: "24",
|
|
2222
|
-
onClick: R[0] || (R[0] = (
|
|
2223
|
-
active:
|
|
2222
|
+
onClick: R[0] || (R[0] = (C0) => Z("剖面视图")),
|
|
2223
|
+
active: H.value && b.value === "剖面视图",
|
|
2224
2224
|
title: "剖面视图"
|
|
2225
2225
|
}, null, 8, ["active"])
|
|
2226
2226
|
]),
|
|
2227
|
-
v("div",
|
|
2227
|
+
v("div", R2, [
|
|
2228
2228
|
h0(j.$slots, "button-right", {}, void 0, !0)
|
|
2229
2229
|
]),
|
|
2230
2230
|
R[3] || (R[3] = v("div", { class: "buttonGroup-bottom" }, null, -1)),
|
|
2231
|
-
|
|
2232
|
-
v("div",
|
|
2231
|
+
Y0(v("div", M2, [
|
|
2232
|
+
v("div", D2, [
|
|
2233
2233
|
v("span", null, g0(b.value), 1),
|
|
2234
2234
|
v("span", {
|
|
2235
2235
|
class: "close",
|
|
2236
|
-
onClick: R[1] || (R[1] = (
|
|
2236
|
+
onClick: R[1] || (R[1] = (C0) => H.value = !1)
|
|
2237
2237
|
}, " X ")
|
|
2238
2238
|
]),
|
|
2239
|
-
q(
|
|
2240
|
-
default:
|
|
2241
|
-
b.value === "剖面视图" ? (a0(),
|
|
2239
|
+
q(W0, { "max-height": "650px" }, {
|
|
2240
|
+
default: K0(() => [
|
|
2241
|
+
b.value === "剖面视图" ? (a0(), X0(Ue, {
|
|
2242
2242
|
key: 0,
|
|
2243
|
-
value: B(
|
|
2244
|
-
onChange:
|
|
2245
|
-
}, null, 8, ["value"])) :
|
|
2243
|
+
value: B(y),
|
|
2244
|
+
onChange: P
|
|
2245
|
+
}, null, 8, ["value"])) : l0("", !0)
|
|
2246
2246
|
]),
|
|
2247
2247
|
_: 1
|
|
2248
2248
|
})
|
|
2249
2249
|
], 512), [
|
|
2250
|
-
[
|
|
2250
|
+
[$0, H.value]
|
|
2251
2251
|
]),
|
|
2252
|
-
B(l) ? (a0(),
|
|
2252
|
+
B(l) ? (a0(), u0("div", O2, [
|
|
2253
2253
|
R[2] || (R[2] = v("div", { class: "loading-spinner" }, null, -1)),
|
|
2254
2254
|
v("p", null, g0(B(h)), 1)
|
|
2255
|
-
])) :
|
|
2255
|
+
])) : l0("", !0)
|
|
2256
2256
|
]);
|
|
2257
2257
|
};
|
|
2258
2258
|
}
|
|
2259
|
-
}),
|
|
2259
|
+
}), C2 = /* @__PURE__ */ Ve(E2, [["__scopeId", "data-v-2268e4d4"]]);
|
|
2260
2260
|
export {
|
|
2261
|
-
|
|
2261
|
+
C2 as default
|
|
2262
2262
|
};
|