ss-component-new 1.2.91 → 1.2.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{MTLLoader-BFJXexXd.js → MTLLoader-B5xRp-vz.js} +1 -1
- package/dist/{MTLLoader-B7nny5Fq.cjs → MTLLoader-D80GV1WB.cjs} +1 -1
- package/dist/{OrbitControls-xaR75UGu.cjs → OrbitControls-CqIpswqa.cjs} +1 -1
- package/dist/{OrbitControls-C9jawbH9.js → OrbitControls-Dh9PyFO4.js} +1 -1
- package/dist/{animationData-CBP3-eEz.cjs → animationData-BtND2VWy.cjs} +1 -1
- package/dist/{animationData-CgRkXv4t.js → animationData-DZ0i7k1j.js} +1 -1
- package/dist/{iconfont-CP5tSbKZ.cjs → iconfont-0T5xTLj8.cjs} +1 -1
- package/dist/{iconfont-CjxxsF1M.js → iconfont-DN8mra_i.js} +2 -2
- package/dist/{index-DFI9yzK6.js → index-1gXFTnuu.js} +13 -13
- package/dist/{index-DqVT7oIp.cjs → index-BGvxk4QX.cjs} +1 -1
- package/dist/{index-CETcLmm9.js → index-BKaTMDZC.js} +3 -3
- package/dist/{index-vOASo2vq.cjs → index-BUYZ6Pzj.cjs} +1 -1
- package/dist/{index-BtAr_AHh.cjs → index-BYoEVm0h.cjs} +1 -1
- package/dist/{index-Dp0Qfw7S.cjs → index-B_KvjL9P.cjs} +1 -1
- package/dist/{index-BlCQ16SZ.cjs → index-BdwtuRne.cjs} +1 -1
- package/dist/{index-BekTYc0y.cjs → index-BeEVAZ15.cjs} +1 -1
- package/dist/{index-BQ2epFRD.js → index-BjFqn1jw.js} +1 -1
- package/dist/{index-DYPr6Y5L.cjs → index-BooqzjWY.cjs} +1 -1
- package/dist/{index-DUVWJUDm.cjs → index-BprBzYZ5.cjs} +1 -1
- package/dist/{index-Bb1-JDSj.js → index-BtKhX2oM.js} +2 -2
- package/dist/{index-C3T-KdRt.js → index-BvxyAOvM.js} +1 -1
- package/dist/{index-BAhJFVq5.js → index-C07slqLJ.js} +2 -2
- package/dist/{index-1K0-Lril.js → index-C1aAW06_.js} +3 -3
- package/dist/{index-DvGuZe_T.js → index-C7HjGMoA.js} +3 -3
- package/dist/{index-BMP_6QMQ.js → index-CQ7UrLDv.js} +4 -4
- package/dist/{index-C8yBntW8.cjs → index-CRe-_A5B.cjs} +1 -1
- package/dist/{index-BEvmMS0i.js → index-CZLI4UKD.js} +1 -1
- package/dist/{index-Vsjvei0H.js → index-CZsCZbCY.js} +2 -2
- package/dist/{index-BXnPM7aS.cjs → index-C_DIwBxS.cjs} +1 -1
- package/dist/{index-Dp6H2nKE.js → index-CewrcECw.js} +1 -1
- package/dist/{index-B_PGXhqu.js → index-CfHIgB5C.js} +1 -1
- package/dist/{index-D9EZRG95.js → index-CiNYm1fC.js} +1 -1
- package/dist/{index-aQEd-0P6.cjs → index-CpYf3edW.cjs} +1 -1
- package/dist/{index-BuBu-8ML.cjs → index-CtOo2IDL.cjs} +1 -1
- package/dist/{index-DG16Kf33.cjs → index-CuchbMC7.cjs} +1 -1
- package/dist/{index-B2gEqMwz.cjs → index-CylLhQJV.cjs} +1 -1
- package/dist/{index-Ebo1c622.js → index-DJ14vVkb.js} +1 -1
- package/dist/{index-8zvR_tOe.js → index-DQTbLJJt.js} +1 -1
- package/dist/{index-CUEf5Kz5.cjs → index-DSmsp4fK.cjs} +1 -1
- package/dist/{index-7slO1Rxz.cjs → index-DVMvlM3X.cjs} +1 -1
- package/dist/{index-aSIQAW_v.cjs → index-DW_lU8F7.cjs} +1 -1
- package/dist/{index-dDyNP3sZ.js → index-DwsI_FxR.js} +6 -6
- package/dist/{index-5IXozXfb.cjs → index-NMPHjxEr.cjs} +1 -1
- package/dist/{index-q5RVI5cd.js → index-Q33CutvH.js} +3 -3
- package/dist/{index-4C4_axeD.js → index-YxS-TBi2.js} +1 -1
- package/dist/{index-7Birt--o.cjs → index-Z2dyIgOs.cjs} +1 -1
- package/dist/{index-C-L7sbsd.js → index-a_TWt7Sj.js} +6 -6
- package/dist/{index-ihwK0f5N.cjs → index-bz_QKqhV.cjs} +1 -1
- package/dist/{index-B8bmwRCI.js → index-fbsH9PEh.js} +1 -1
- package/dist/{index-CP7aP3gS.cjs → index-m_VPPkQD.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-DecIEtG7.cjs → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-CjVqxeCk.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-CFsZEbkA.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-qrHH3IDA.js} +6 -6
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DKwIZnH1.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DEgtwZwW.js} +1642 -1647
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Cwx8FIbY.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-QzgaFA5S.cjs} +58 -58
- package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-BX54cUHO.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-9r-1e4S8.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-B10uDdFf.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-IuoTm-WE.js} +3 -3
- package/dist/{index.vue_vue_type_style_index_1_lang-B-okL2FZ.js → index.vue_vue_type_style_index_1_lang-CDl_PU-6.js} +3 -3
- package/dist/{index.vue_vue_type_style_index_1_lang-CTa9TwBd.cjs → index.vue_vue_type_style_index_1_lang-DR71_XjN.cjs} +1 -1
- package/dist/{main-Cwa67iI0.cjs → main-BxTLrfxf.cjs} +1 -1
- package/dist/{main-t0azuc9l.js → main-D_3GSDl9.js} +2 -2
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +9 -9
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +10 -10
- package/dist/{threeModel-Byx2BFHA.js → threeModel-BKLggDE-.js} +4 -4
- package/dist/{threeModel-BsTUf7j3.cjs → threeModel-D4-2rEpM.cjs} +1 -1
- package/dist/{threePreview-DGcEWlwZ.cjs → threePreview-QIurmOdU.cjs} +1 -1
- package/dist/{threePreview-B9a62AVY.js → threePreview-oszvdj-G.js} +578 -579
- package/dist/threeSceneView-BR1l9yTW.js +1341 -0
- package/dist/threeSceneView-CaHI2V82.cjs +5 -0
- package/dist/threeSceneViewForCPMPIP-DbvRq5YC.cjs +5 -0
- package/dist/{threeSceneViewForCPMPIP-BslGbi80.js → threeSceneViewForCPMPIP-wZTvUhLm.js} +232 -238
- package/dist/{threeTrackPathView-CNiRDEIa.js → threeTrackPathView-CAK5om32.js} +258 -305
- package/dist/{threeTrackPathView-C5outYjx.cjs → threeTrackPathView-CF9ierHN.cjs} +2 -2
- package/dist/{threeViewerHost-C2iVAVlI.js → threeViewerHost-CeTJmyoE.js} +2 -2
- package/dist/{threeViewerHost-D3ZmD_As.cjs → threeViewerHost-iajMfGA9.cjs} +2 -2
- package/dist/{urdfTree-DEo6cc0y.cjs → urdfTree-CWwnorES.cjs} +1 -1
- package/dist/{urdfTree-D_oX4idQ.js → urdfTree-DIyCunQo.js} +1 -1
- package/dist/{workpieceTreePanel--92uvFwB.js → workpieceTreePanel-DC0GHh3g.js} +5 -5
- package/dist/{workpieceTreePanel-C0Lq3HIU.cjs → workpieceTreePanel-YfDCHyA3.cjs} +1 -1
- package/package.json +1 -1
- package/dist/obj/model.mtl +0 -42
- package/dist/obj/model.obj +0 -26110
- package/dist/threeSceneView-BYc0Z0CJ.cjs +0 -5
- package/dist/threeSceneView-C59wI_1_.js +0 -1369
- package/dist/threeSceneViewForCPMPIP-kGIus7ge.cjs +0 -5
- package/public/obj/model.mtl +0 -42
- package/public/obj/model.obj +0 -26110
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ref as K, shallowRef as Be, defineComponent as Ke, watch as Z, onMounted as Ve, nextTick as ze, onBeforeUnmount as Xe, resolveComponent as qe, createElementBlock as ee, openBlock as
|
|
2
|
-
import { u as $e, a as Je, b as Qe } from "./iconfont-
|
|
3
|
-
import { J as Ze, K as ce, N as Se, O as
|
|
1
|
+
import { ref as K, shallowRef as Be, defineComponent as Ke, watch as Z, onMounted as Ve, nextTick as ze, onBeforeUnmount as Xe, resolveComponent as qe, createElementBlock as ee, openBlock as ne, createElementVNode as L, withDirectives as z, createCommentVNode as pe, createVNode as H, unref as b, renderSlot as me, toDisplayString as ge, withCtx as We, isRef as $, vModelRadio as J, vShow as Ye } from "vue";
|
|
2
|
+
import { u as $e, a as Je, b as Qe } from "./iconfont-DN8mra_i.js";
|
|
3
|
+
import { J as Ze, K as ce, N as Se, O as en, Q as W, R as Ne, U as O, Y as Ie, C as G, Z as P, f as Y, _ as nn, n as tn, D as sn, r as Q, V as B, $ as rn, a0 as Ce, a1 as on, a2 as Oe, a3 as an, a4 as cn, a5 as te, a6 as ln, a7 as ve, a8 as un, a9 as fn, aa as dn, ab as le, ac as ke, ad as ue, ae as hn, af as pn, ag as mn, ah as se, ai as gn, v as Pe, p as Tn, aj as q, ak as xn, w as Rn, al as En, k as Fe, am as An, y as _n, an as Ln, ao as Mn, u as re, P as wn, s as yn, ap as bn, aq as Sn, ar as Nn, as as In, at as Cn, au as De, av as On, aw as Te, ax as xe, ay as Re, az as Ee, aA as Ae, aB as vn, aC as kn, B as He, aD as Pn, o as Fn } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DEgtwZwW.js";
|
|
4
4
|
import { E as _e } from "./index-BUYYl2Pc.js";
|
|
5
|
-
import { M as
|
|
5
|
+
import { M as Dn, O as Hn, S as Un } from "./MTLLoader-B5xRp-vz.js";
|
|
6
6
|
import { T as j } from "./svgIcon-D-_fXUBL.js";
|
|
7
|
-
import { _ as
|
|
8
|
-
function Le(f,
|
|
9
|
-
if (
|
|
7
|
+
import { _ as Gn } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
|
+
function Le(f, n) {
|
|
9
|
+
if (n === Ze)
|
|
10
10
|
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), f;
|
|
11
|
-
if (
|
|
11
|
+
if (n === ce || n === Se) {
|
|
12
12
|
let e = f.getIndex();
|
|
13
13
|
if (e === null) {
|
|
14
14
|
const r = [], a = f.getAttribute("position");
|
|
@@ -19,60 +19,60 @@ function Le(f, t) {
|
|
|
19
19
|
} else
|
|
20
20
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), f;
|
|
21
21
|
}
|
|
22
|
-
const i = e.count - 2,
|
|
23
|
-
if (
|
|
22
|
+
const i = e.count - 2, t = [];
|
|
23
|
+
if (n === ce)
|
|
24
24
|
for (let r = 1; r <= i; r++)
|
|
25
|
-
|
|
25
|
+
t.push(e.getX(0)), t.push(e.getX(r)), t.push(e.getX(r + 1));
|
|
26
26
|
else
|
|
27
27
|
for (let r = 0; r < i; r++)
|
|
28
|
-
r % 2 === 0 ? (
|
|
29
|
-
|
|
28
|
+
r % 2 === 0 ? (t.push(e.getX(r)), t.push(e.getX(r + 1)), t.push(e.getX(r + 2))) : (t.push(e.getX(r + 2)), t.push(e.getX(r + 1)), t.push(e.getX(r)));
|
|
29
|
+
t.length / 3 !== i && console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");
|
|
30
30
|
const s = f.clone();
|
|
31
|
-
return s.setIndex(
|
|
31
|
+
return s.setIndex(t), s.clearGroups(), s;
|
|
32
32
|
} else
|
|
33
|
-
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",
|
|
33
|
+
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", n), f;
|
|
34
34
|
}
|
|
35
|
-
class
|
|
35
|
+
class jn extends en {
|
|
36
36
|
/**
|
|
37
37
|
* Constructs a new glTF loader.
|
|
38
38
|
*
|
|
39
39
|
* @param {LoadingManager} [manager] - The loading manager.
|
|
40
40
|
*/
|
|
41
|
-
constructor(
|
|
42
|
-
super(
|
|
43
|
-
return new
|
|
41
|
+
constructor(n) {
|
|
42
|
+
super(n), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(e) {
|
|
43
|
+
return new Xn(e);
|
|
44
44
|
}), this.register(function(e) {
|
|
45
|
-
return new
|
|
45
|
+
return new qn(e);
|
|
46
46
|
}), this.register(function(e) {
|
|
47
|
-
return new
|
|
47
|
+
return new tt(e);
|
|
48
48
|
}), this.register(function(e) {
|
|
49
|
-
return new
|
|
49
|
+
return new st(e);
|
|
50
50
|
}), this.register(function(e) {
|
|
51
|
-
return new
|
|
51
|
+
return new rt(e);
|
|
52
52
|
}), this.register(function(e) {
|
|
53
|
-
return new
|
|
53
|
+
return new Yn(e);
|
|
54
54
|
}), this.register(function(e) {
|
|
55
|
-
return new
|
|
55
|
+
return new $n(e);
|
|
56
56
|
}), this.register(function(e) {
|
|
57
|
-
return new
|
|
57
|
+
return new Jn(e);
|
|
58
58
|
}), this.register(function(e) {
|
|
59
|
-
return new
|
|
59
|
+
return new Qn(e);
|
|
60
60
|
}), this.register(function(e) {
|
|
61
|
-
return new
|
|
61
|
+
return new zn(e);
|
|
62
62
|
}), this.register(function(e) {
|
|
63
|
-
return new
|
|
63
|
+
return new Zn(e);
|
|
64
64
|
}), this.register(function(e) {
|
|
65
|
-
return new
|
|
65
|
+
return new Wn(e);
|
|
66
66
|
}), this.register(function(e) {
|
|
67
|
-
return new
|
|
67
|
+
return new nt(e);
|
|
68
68
|
}), this.register(function(e) {
|
|
69
|
-
return new
|
|
69
|
+
return new et(e);
|
|
70
70
|
}), this.register(function(e) {
|
|
71
|
-
return new
|
|
71
|
+
return new Kn(e);
|
|
72
72
|
}), this.register(function(e) {
|
|
73
|
-
return new
|
|
73
|
+
return new it(e);
|
|
74
74
|
}), this.register(function(e) {
|
|
75
|
-
return new
|
|
75
|
+
return new ot(e);
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
@@ -84,24 +84,24 @@ class Gt extends et {
|
|
|
84
84
|
* @param {onProgressCallback} onProgress - Executed while the loading is in progress.
|
|
85
85
|
* @param {onErrorCallback} onError - Executed when errors occur.
|
|
86
86
|
*/
|
|
87
|
-
load(
|
|
87
|
+
load(n, e, i, t) {
|
|
88
88
|
const s = this;
|
|
89
89
|
let r;
|
|
90
90
|
if (this.resourcePath !== "")
|
|
91
91
|
r = this.resourcePath;
|
|
92
92
|
else if (this.path !== "") {
|
|
93
|
-
const c = W.extractUrlBase(
|
|
93
|
+
const c = W.extractUrlBase(n);
|
|
94
94
|
r = W.resolveURL(c, this.path);
|
|
95
95
|
} else
|
|
96
|
-
r = W.extractUrlBase(
|
|
97
|
-
this.manager.itemStart(
|
|
96
|
+
r = W.extractUrlBase(n);
|
|
97
|
+
this.manager.itemStart(n);
|
|
98
98
|
const a = function(c) {
|
|
99
|
-
|
|
99
|
+
t ? t(c) : console.error(c), s.manager.itemError(n), s.manager.itemEnd(n);
|
|
100
100
|
}, o = new Ne(this.manager);
|
|
101
|
-
o.setPath(this.path), o.setResponseType("arraybuffer"), o.setRequestHeader(this.requestHeader), o.setWithCredentials(this.withCredentials), o.load(
|
|
101
|
+
o.setPath(this.path), o.setResponseType("arraybuffer"), o.setRequestHeader(this.requestHeader), o.setWithCredentials(this.withCredentials), o.load(n, function(c) {
|
|
102
102
|
try {
|
|
103
103
|
s.parse(c, r, function(u) {
|
|
104
|
-
e(u), s.manager.itemEnd(
|
|
104
|
+
e(u), s.manager.itemEnd(n);
|
|
105
105
|
}, a);
|
|
106
106
|
} catch (u) {
|
|
107
107
|
a(u);
|
|
@@ -115,8 +115,8 @@ class Gt extends et {
|
|
|
115
115
|
* @param {DRACOLoader} dracoLoader - The Draco loader to set.
|
|
116
116
|
* @return {GLTFLoader} A reference to this loader.
|
|
117
117
|
*/
|
|
118
|
-
setDRACOLoader(
|
|
119
|
-
return this.dracoLoader =
|
|
118
|
+
setDRACOLoader(n) {
|
|
119
|
+
return this.dracoLoader = n, this;
|
|
120
120
|
}
|
|
121
121
|
/**
|
|
122
122
|
* Sets the given KTX2 loader to this loader. Required for loading KTX2
|
|
@@ -125,8 +125,8 @@ class Gt extends et {
|
|
|
125
125
|
* @param {KTX2Loader} ktx2Loader - The KTX2 loader to set.
|
|
126
126
|
* @return {GLTFLoader} A reference to this loader.
|
|
127
127
|
*/
|
|
128
|
-
setKTX2Loader(
|
|
129
|
-
return this.ktx2Loader =
|
|
128
|
+
setKTX2Loader(n) {
|
|
129
|
+
return this.ktx2Loader = n, this;
|
|
130
130
|
}
|
|
131
131
|
/**
|
|
132
132
|
* Sets the given meshopt decoder. Required for decoding assets
|
|
@@ -135,8 +135,8 @@ class Gt extends et {
|
|
|
135
135
|
* @param {Object} meshoptDecoder - The meshopt decoder to set.
|
|
136
136
|
* @return {GLTFLoader} A reference to this loader.
|
|
137
137
|
*/
|
|
138
|
-
setMeshoptDecoder(
|
|
139
|
-
return this.meshoptDecoder =
|
|
138
|
+
setMeshoptDecoder(n) {
|
|
139
|
+
return this.meshoptDecoder = n, this;
|
|
140
140
|
}
|
|
141
141
|
/**
|
|
142
142
|
* Registers a plugin callback. This API is internally used to implement the various
|
|
@@ -146,8 +146,8 @@ class Gt extends et {
|
|
|
146
146
|
* @param {function(parser:GLTFParser)} callback - The callback function to register.
|
|
147
147
|
* @return {GLTFLoader} A reference to this loader.
|
|
148
148
|
*/
|
|
149
|
-
register(
|
|
150
|
-
return this.pluginCallbacks.indexOf(
|
|
149
|
+
register(n) {
|
|
150
|
+
return this.pluginCallbacks.indexOf(n) === -1 && this.pluginCallbacks.push(n), this;
|
|
151
151
|
}
|
|
152
152
|
/**
|
|
153
153
|
* Unregisters a plugin callback.
|
|
@@ -155,8 +155,8 @@ class Gt extends et {
|
|
|
155
155
|
* @param {Function} callback - The callback function to unregister.
|
|
156
156
|
* @return {GLTFLoader} A reference to this loader.
|
|
157
157
|
*/
|
|
158
|
-
unregister(
|
|
159
|
-
return this.pluginCallbacks.indexOf(
|
|
158
|
+
unregister(n) {
|
|
159
|
+
return this.pluginCallbacks.indexOf(n) !== -1 && this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(n), 1), this;
|
|
160
160
|
}
|
|
161
161
|
/**
|
|
162
162
|
* Parses the given FBX data and returns the resulting group.
|
|
@@ -166,29 +166,29 @@ class Gt extends et {
|
|
|
166
166
|
* @param {function(GLTFLoader~LoadObject)} onLoad - Executed when the loading process has been finished.
|
|
167
167
|
* @param {onErrorCallback} onError - Executed when errors occur.
|
|
168
168
|
*/
|
|
169
|
-
parse(
|
|
169
|
+
parse(n, e, i, t) {
|
|
170
170
|
let s;
|
|
171
171
|
const r = {}, a = {}, o = new TextDecoder();
|
|
172
|
-
if (typeof
|
|
173
|
-
s = JSON.parse(
|
|
174
|
-
else if (
|
|
175
|
-
if (o.decode(new Uint8Array(
|
|
172
|
+
if (typeof n == "string")
|
|
173
|
+
s = JSON.parse(n);
|
|
174
|
+
else if (n instanceof ArrayBuffer)
|
|
175
|
+
if (o.decode(new Uint8Array(n, 0, 4)) === Ue) {
|
|
176
176
|
try {
|
|
177
|
-
r[R.KHR_BINARY_GLTF] = new
|
|
177
|
+
r[R.KHR_BINARY_GLTF] = new at(n);
|
|
178
178
|
} catch (l) {
|
|
179
|
-
|
|
179
|
+
t && t(l);
|
|
180
180
|
return;
|
|
181
181
|
}
|
|
182
182
|
s = JSON.parse(r[R.KHR_BINARY_GLTF].content);
|
|
183
183
|
} else
|
|
184
|
-
s = JSON.parse(o.decode(
|
|
184
|
+
s = JSON.parse(o.decode(n));
|
|
185
185
|
else
|
|
186
|
-
s =
|
|
186
|
+
s = n;
|
|
187
187
|
if (s.asset === void 0 || s.asset.version[0] < 2) {
|
|
188
|
-
|
|
188
|
+
t && t(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
|
|
189
189
|
return;
|
|
190
190
|
}
|
|
191
|
-
const c = new
|
|
191
|
+
const c = new Et(s, {
|
|
192
192
|
path: e || this.resourcePath || "",
|
|
193
193
|
crossOrigin: this.crossOrigin,
|
|
194
194
|
requestHeader: this.requestHeader,
|
|
@@ -206,22 +206,22 @@ class Gt extends et {
|
|
|
206
206
|
const l = s.extensionsUsed[u], d = s.extensionsRequired || [];
|
|
207
207
|
switch (l) {
|
|
208
208
|
case R.KHR_MATERIALS_UNLIT:
|
|
209
|
-
r[l] = new
|
|
209
|
+
r[l] = new Vn();
|
|
210
210
|
break;
|
|
211
211
|
case R.KHR_DRACO_MESH_COMPRESSION:
|
|
212
|
-
r[l] = new
|
|
212
|
+
r[l] = new ct(s, this.dracoLoader);
|
|
213
213
|
break;
|
|
214
214
|
case R.KHR_TEXTURE_TRANSFORM:
|
|
215
|
-
r[l] = new
|
|
215
|
+
r[l] = new lt();
|
|
216
216
|
break;
|
|
217
217
|
case R.KHR_MESH_QUANTIZATION:
|
|
218
|
-
r[l] = new
|
|
218
|
+
r[l] = new ut();
|
|
219
219
|
break;
|
|
220
220
|
default:
|
|
221
221
|
d.indexOf(l) >= 0 && a[l] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + l + '".');
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
c.setExtensions(r), c.setPlugins(a), c.parse(i,
|
|
224
|
+
c.setExtensions(r), c.setPlugins(a), c.parse(i, t);
|
|
225
225
|
}
|
|
226
226
|
/**
|
|
227
227
|
* Async version of {@link GLTFLoader#parse}.
|
|
@@ -231,24 +231,24 @@ class Gt extends et {
|
|
|
231
231
|
* @param {string} path - The URL base path.
|
|
232
232
|
* @return {Promise<GLTFLoader~LoadObject>} A Promise that resolves with the loaded glTF when the parsing has been finished.
|
|
233
233
|
*/
|
|
234
|
-
parseAsync(
|
|
234
|
+
parseAsync(n, e) {
|
|
235
235
|
const i = this;
|
|
236
|
-
return new Promise(function(
|
|
237
|
-
i.parse(
|
|
236
|
+
return new Promise(function(t, s) {
|
|
237
|
+
i.parse(n, e, t, s);
|
|
238
238
|
});
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function Bn() {
|
|
242
242
|
let f = {};
|
|
243
243
|
return {
|
|
244
|
-
get: function(
|
|
245
|
-
return f[
|
|
244
|
+
get: function(n) {
|
|
245
|
+
return f[n];
|
|
246
246
|
},
|
|
247
|
-
add: function(
|
|
248
|
-
f[
|
|
247
|
+
add: function(n, e) {
|
|
248
|
+
f[n] = e;
|
|
249
249
|
},
|
|
250
|
-
remove: function(
|
|
251
|
-
delete f[
|
|
250
|
+
remove: function(n) {
|
|
251
|
+
delete f[n];
|
|
252
252
|
},
|
|
253
253
|
removeAll: function() {
|
|
254
254
|
f = {};
|
|
@@ -279,98 +279,98 @@ const R = {
|
|
|
279
279
|
EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression",
|
|
280
280
|
EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
|
|
281
281
|
};
|
|
282
|
-
class
|
|
283
|
-
constructor(
|
|
284
|
-
this.parser =
|
|
282
|
+
class Kn {
|
|
283
|
+
constructor(n) {
|
|
284
|
+
this.parser = n, this.name = R.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
|
|
285
285
|
}
|
|
286
286
|
_markDefs() {
|
|
287
|
-
const
|
|
288
|
-
for (let i = 0,
|
|
287
|
+
const n = this.parser, e = this.parser.json.nodes || [];
|
|
288
|
+
for (let i = 0, t = e.length; i < t; i++) {
|
|
289
289
|
const s = e[i];
|
|
290
|
-
s.extensions && s.extensions[this.name] && s.extensions[this.name].light !== void 0 &&
|
|
290
|
+
s.extensions && s.extensions[this.name] && s.extensions[this.name].light !== void 0 && n._addNodeRef(this.cache, s.extensions[this.name].light);
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
_loadLight(
|
|
294
|
-
const e = this.parser, i = "light:" +
|
|
295
|
-
let
|
|
296
|
-
if (
|
|
297
|
-
const s = e.json, o = ((s.extensions && s.extensions[this.name] || {}).lights || [])[
|
|
293
|
+
_loadLight(n) {
|
|
294
|
+
const e = this.parser, i = "light:" + n;
|
|
295
|
+
let t = e.cache.get(i);
|
|
296
|
+
if (t) return t;
|
|
297
|
+
const s = e.json, o = ((s.extensions && s.extensions[this.name] || {}).lights || [])[n];
|
|
298
298
|
let c;
|
|
299
299
|
const u = new G(16777215);
|
|
300
300
|
o.color !== void 0 && u.setRGB(o.color[0], o.color[1], o.color[2], P);
|
|
301
301
|
const l = o.range !== void 0 ? o.range : 0;
|
|
302
302
|
switch (o.type) {
|
|
303
303
|
case "directional":
|
|
304
|
-
c = new
|
|
304
|
+
c = new sn(u), c.target.position.set(0, 0, -1), c.add(c.target);
|
|
305
305
|
break;
|
|
306
306
|
case "point":
|
|
307
|
-
c = new
|
|
307
|
+
c = new tn(u), c.distance = l;
|
|
308
308
|
break;
|
|
309
309
|
case "spot":
|
|
310
|
-
c = new
|
|
310
|
+
c = new nn(u), c.distance = l, o.spot = o.spot || {}, o.spot.innerConeAngle = o.spot.innerConeAngle !== void 0 ? o.spot.innerConeAngle : 0, o.spot.outerConeAngle = o.spot.outerConeAngle !== void 0 ? o.spot.outerConeAngle : Math.PI / 4, c.angle = o.spot.outerConeAngle, c.penumbra = 1 - o.spot.innerConeAngle / o.spot.outerConeAngle, c.target.position.set(0, 0, -1), c.add(c.target);
|
|
311
311
|
break;
|
|
312
312
|
default:
|
|
313
313
|
throw new Error("THREE.GLTFLoader: Unexpected light type: " + o.type);
|
|
314
314
|
}
|
|
315
|
-
return c.position.set(0, 0, 0), k(c, o), o.intensity !== void 0 && (c.intensity = o.intensity), c.name = e.createUniqueName(o.name || "light_" +
|
|
315
|
+
return c.position.set(0, 0, 0), k(c, o), o.intensity !== void 0 && (c.intensity = o.intensity), c.name = e.createUniqueName(o.name || "light_" + n), t = Promise.resolve(c), e.cache.add(i, t), t;
|
|
316
316
|
}
|
|
317
|
-
getDependency(
|
|
318
|
-
if (
|
|
317
|
+
getDependency(n, e) {
|
|
318
|
+
if (n === "light")
|
|
319
319
|
return this._loadLight(e);
|
|
320
320
|
}
|
|
321
|
-
createNodeAttachment(
|
|
322
|
-
const e = this, i = this.parser, s = i.json.nodes[
|
|
321
|
+
createNodeAttachment(n) {
|
|
322
|
+
const e = this, i = this.parser, s = i.json.nodes[n], a = (s.extensions && s.extensions[this.name] || {}).light;
|
|
323
323
|
return a === void 0 ? null : this._loadLight(a).then(function(o) {
|
|
324
324
|
return i._getNodeRef(e.cache, a, o);
|
|
325
325
|
});
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
class
|
|
328
|
+
class Vn {
|
|
329
329
|
constructor() {
|
|
330
330
|
this.name = R.KHR_MATERIALS_UNLIT;
|
|
331
331
|
}
|
|
332
332
|
getMaterialType() {
|
|
333
333
|
return q;
|
|
334
334
|
}
|
|
335
|
-
extendParams(
|
|
336
|
-
const
|
|
337
|
-
|
|
335
|
+
extendParams(n, e, i) {
|
|
336
|
+
const t = [];
|
|
337
|
+
n.color = new G(1, 1, 1), n.opacity = 1;
|
|
338
338
|
const s = e.pbrMetallicRoughness;
|
|
339
339
|
if (s) {
|
|
340
340
|
if (Array.isArray(s.baseColorFactor)) {
|
|
341
341
|
const r = s.baseColorFactor;
|
|
342
|
-
|
|
342
|
+
n.color.setRGB(r[0], r[1], r[2], P), n.opacity = r[3];
|
|
343
343
|
}
|
|
344
|
-
s.baseColorTexture !== void 0 &&
|
|
344
|
+
s.baseColorTexture !== void 0 && t.push(i.assignTexture(n, "map", s.baseColorTexture, Y));
|
|
345
345
|
}
|
|
346
|
-
return Promise.all(
|
|
346
|
+
return Promise.all(t);
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
class
|
|
350
|
-
constructor(
|
|
351
|
-
this.parser =
|
|
349
|
+
class zn {
|
|
350
|
+
constructor(n) {
|
|
351
|
+
this.parser = n, this.name = R.KHR_MATERIALS_EMISSIVE_STRENGTH;
|
|
352
352
|
}
|
|
353
|
-
extendMaterialParams(
|
|
354
|
-
const
|
|
355
|
-
if (!
|
|
353
|
+
extendMaterialParams(n, e) {
|
|
354
|
+
const t = this.parser.json.materials[n];
|
|
355
|
+
if (!t.extensions || !t.extensions[this.name])
|
|
356
356
|
return Promise.resolve();
|
|
357
|
-
const s =
|
|
357
|
+
const s = t.extensions[this.name].emissiveStrength;
|
|
358
358
|
return s !== void 0 && (e.emissiveIntensity = s), Promise.resolve();
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
|
-
class
|
|
362
|
-
constructor(
|
|
363
|
-
this.parser =
|
|
361
|
+
class Xn {
|
|
362
|
+
constructor(n) {
|
|
363
|
+
this.parser = n, this.name = R.KHR_MATERIALS_CLEARCOAT;
|
|
364
364
|
}
|
|
365
|
-
getMaterialType(
|
|
366
|
-
const i = this.parser.json.materials[
|
|
365
|
+
getMaterialType(n) {
|
|
366
|
+
const i = this.parser.json.materials[n];
|
|
367
367
|
return !i.extensions || !i.extensions[this.name] ? null : O;
|
|
368
368
|
}
|
|
369
|
-
extendMaterialParams(
|
|
370
|
-
const i = this.parser,
|
|
371
|
-
if (!
|
|
369
|
+
extendMaterialParams(n, e) {
|
|
370
|
+
const i = this.parser, t = i.json.materials[n];
|
|
371
|
+
if (!t.extensions || !t.extensions[this.name])
|
|
372
372
|
return Promise.resolve();
|
|
373
|
-
const s = [], r =
|
|
373
|
+
const s = [], r = t.extensions[this.name];
|
|
374
374
|
if (r.clearcoatFactor !== void 0 && (e.clearcoat = r.clearcoatFactor), r.clearcoatTexture !== void 0 && s.push(i.assignTexture(e, "clearcoatMap", r.clearcoatTexture)), r.clearcoatRoughnessFactor !== void 0 && (e.clearcoatRoughness = r.clearcoatRoughnessFactor), r.clearcoatRoughnessTexture !== void 0 && s.push(i.assignTexture(e, "clearcoatRoughnessMap", r.clearcoatRoughnessTexture)), r.clearcoatNormalTexture !== void 0 && (s.push(i.assignTexture(e, "clearcoatNormalMap", r.clearcoatNormalTexture)), r.clearcoatNormalTexture.scale !== void 0)) {
|
|
375
375
|
const a = r.clearcoatNormalTexture.scale;
|
|
376
376
|
e.clearcoatNormalScale = new Ie(a, a);
|
|
@@ -378,53 +378,53 @@ class zt {
|
|
|
378
378
|
return Promise.all(s);
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
|
-
class
|
|
382
|
-
constructor(
|
|
383
|
-
this.parser =
|
|
381
|
+
class qn {
|
|
382
|
+
constructor(n) {
|
|
383
|
+
this.parser = n, this.name = R.KHR_MATERIALS_DISPERSION;
|
|
384
384
|
}
|
|
385
|
-
getMaterialType(
|
|
386
|
-
const i = this.parser.json.materials[
|
|
385
|
+
getMaterialType(n) {
|
|
386
|
+
const i = this.parser.json.materials[n];
|
|
387
387
|
return !i.extensions || !i.extensions[this.name] ? null : O;
|
|
388
388
|
}
|
|
389
|
-
extendMaterialParams(
|
|
390
|
-
const
|
|
391
|
-
if (!
|
|
389
|
+
extendMaterialParams(n, e) {
|
|
390
|
+
const t = this.parser.json.materials[n];
|
|
391
|
+
if (!t.extensions || !t.extensions[this.name])
|
|
392
392
|
return Promise.resolve();
|
|
393
|
-
const s =
|
|
393
|
+
const s = t.extensions[this.name];
|
|
394
394
|
return e.dispersion = s.dispersion !== void 0 ? s.dispersion : 0, Promise.resolve();
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
|
-
class
|
|
398
|
-
constructor(
|
|
399
|
-
this.parser =
|
|
397
|
+
class Wn {
|
|
398
|
+
constructor(n) {
|
|
399
|
+
this.parser = n, this.name = R.KHR_MATERIALS_IRIDESCENCE;
|
|
400
400
|
}
|
|
401
|
-
getMaterialType(
|
|
402
|
-
const i = this.parser.json.materials[
|
|
401
|
+
getMaterialType(n) {
|
|
402
|
+
const i = this.parser.json.materials[n];
|
|
403
403
|
return !i.extensions || !i.extensions[this.name] ? null : O;
|
|
404
404
|
}
|
|
405
|
-
extendMaterialParams(
|
|
406
|
-
const i = this.parser,
|
|
407
|
-
if (!
|
|
405
|
+
extendMaterialParams(n, e) {
|
|
406
|
+
const i = this.parser, t = i.json.materials[n];
|
|
407
|
+
if (!t.extensions || !t.extensions[this.name])
|
|
408
408
|
return Promise.resolve();
|
|
409
|
-
const s = [], r =
|
|
409
|
+
const s = [], r = t.extensions[this.name];
|
|
410
410
|
return r.iridescenceFactor !== void 0 && (e.iridescence = r.iridescenceFactor), r.iridescenceTexture !== void 0 && s.push(i.assignTexture(e, "iridescenceMap", r.iridescenceTexture)), r.iridescenceIor !== void 0 && (e.iridescenceIOR = r.iridescenceIor), e.iridescenceThicknessRange === void 0 && (e.iridescenceThicknessRange = [100, 400]), r.iridescenceThicknessMinimum !== void 0 && (e.iridescenceThicknessRange[0] = r.iridescenceThicknessMinimum), r.iridescenceThicknessMaximum !== void 0 && (e.iridescenceThicknessRange[1] = r.iridescenceThicknessMaximum), r.iridescenceThicknessTexture !== void 0 && s.push(i.assignTexture(e, "iridescenceThicknessMap", r.iridescenceThicknessTexture)), Promise.all(s);
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
|
-
class
|
|
414
|
-
constructor(
|
|
415
|
-
this.parser =
|
|
413
|
+
class Yn {
|
|
414
|
+
constructor(n) {
|
|
415
|
+
this.parser = n, this.name = R.KHR_MATERIALS_SHEEN;
|
|
416
416
|
}
|
|
417
|
-
getMaterialType(
|
|
418
|
-
const i = this.parser.json.materials[
|
|
417
|
+
getMaterialType(n) {
|
|
418
|
+
const i = this.parser.json.materials[n];
|
|
419
419
|
return !i.extensions || !i.extensions[this.name] ? null : O;
|
|
420
420
|
}
|
|
421
|
-
extendMaterialParams(
|
|
422
|
-
const i = this.parser,
|
|
423
|
-
if (!
|
|
421
|
+
extendMaterialParams(n, e) {
|
|
422
|
+
const i = this.parser, t = i.json.materials[n];
|
|
423
|
+
if (!t.extensions || !t.extensions[this.name])
|
|
424
424
|
return Promise.resolve();
|
|
425
425
|
const s = [];
|
|
426
426
|
e.sheenColor = new G(0, 0, 0), e.sheenRoughness = 0, e.sheen = 1;
|
|
427
|
-
const r =
|
|
427
|
+
const r = t.extensions[this.name];
|
|
428
428
|
if (r.sheenColorFactor !== void 0) {
|
|
429
429
|
const a = r.sheenColorFactor;
|
|
430
430
|
e.sheenColor.setRGB(a[0], a[1], a[2], P);
|
|
@@ -432,208 +432,208 @@ class Wt {
|
|
|
432
432
|
return r.sheenRoughnessFactor !== void 0 && (e.sheenRoughness = r.sheenRoughnessFactor), r.sheenColorTexture !== void 0 && s.push(i.assignTexture(e, "sheenColorMap", r.sheenColorTexture, Y)), r.sheenRoughnessTexture !== void 0 && s.push(i.assignTexture(e, "sheenRoughnessMap", r.sheenRoughnessTexture)), Promise.all(s);
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
|
-
class
|
|
436
|
-
constructor(
|
|
437
|
-
this.parser =
|
|
435
|
+
class $n {
|
|
436
|
+
constructor(n) {
|
|
437
|
+
this.parser = n, this.name = R.KHR_MATERIALS_TRANSMISSION;
|
|
438
438
|
}
|
|
439
|
-
getMaterialType(
|
|
440
|
-
const i = this.parser.json.materials[
|
|
439
|
+
getMaterialType(n) {
|
|
440
|
+
const i = this.parser.json.materials[n];
|
|
441
441
|
return !i.extensions || !i.extensions[this.name] ? null : O;
|
|
442
442
|
}
|
|
443
|
-
extendMaterialParams(
|
|
444
|
-
const i = this.parser,
|
|
445
|
-
if (!
|
|
443
|
+
extendMaterialParams(n, e) {
|
|
444
|
+
const i = this.parser, t = i.json.materials[n];
|
|
445
|
+
if (!t.extensions || !t.extensions[this.name])
|
|
446
446
|
return Promise.resolve();
|
|
447
|
-
const s = [], r =
|
|
447
|
+
const s = [], r = t.extensions[this.name];
|
|
448
448
|
return r.transmissionFactor !== void 0 && (e.transmission = r.transmissionFactor), r.transmissionTexture !== void 0 && s.push(i.assignTexture(e, "transmissionMap", r.transmissionTexture)), Promise.all(s);
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
|
-
class
|
|
452
|
-
constructor(
|
|
453
|
-
this.parser =
|
|
451
|
+
class Jn {
|
|
452
|
+
constructor(n) {
|
|
453
|
+
this.parser = n, this.name = R.KHR_MATERIALS_VOLUME;
|
|
454
454
|
}
|
|
455
|
-
getMaterialType(
|
|
456
|
-
const i = this.parser.json.materials[
|
|
455
|
+
getMaterialType(n) {
|
|
456
|
+
const i = this.parser.json.materials[n];
|
|
457
457
|
return !i.extensions || !i.extensions[this.name] ? null : O;
|
|
458
458
|
}
|
|
459
|
-
extendMaterialParams(
|
|
460
|
-
const i = this.parser,
|
|
461
|
-
if (!
|
|
459
|
+
extendMaterialParams(n, e) {
|
|
460
|
+
const i = this.parser, t = i.json.materials[n];
|
|
461
|
+
if (!t.extensions || !t.extensions[this.name])
|
|
462
462
|
return Promise.resolve();
|
|
463
|
-
const s = [], r =
|
|
463
|
+
const s = [], r = t.extensions[this.name];
|
|
464
464
|
e.thickness = r.thicknessFactor !== void 0 ? r.thicknessFactor : 0, r.thicknessTexture !== void 0 && s.push(i.assignTexture(e, "thicknessMap", r.thicknessTexture)), e.attenuationDistance = r.attenuationDistance || 1 / 0;
|
|
465
465
|
const a = r.attenuationColor || [1, 1, 1];
|
|
466
466
|
return e.attenuationColor = new G().setRGB(a[0], a[1], a[2], P), Promise.all(s);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
class
|
|
470
|
-
constructor(
|
|
471
|
-
this.parser =
|
|
469
|
+
class Qn {
|
|
470
|
+
constructor(n) {
|
|
471
|
+
this.parser = n, this.name = R.KHR_MATERIALS_IOR;
|
|
472
472
|
}
|
|
473
|
-
getMaterialType(
|
|
474
|
-
const i = this.parser.json.materials[
|
|
473
|
+
getMaterialType(n) {
|
|
474
|
+
const i = this.parser.json.materials[n];
|
|
475
475
|
return !i.extensions || !i.extensions[this.name] ? null : O;
|
|
476
476
|
}
|
|
477
|
-
extendMaterialParams(
|
|
478
|
-
const
|
|
479
|
-
if (!
|
|
477
|
+
extendMaterialParams(n, e) {
|
|
478
|
+
const t = this.parser.json.materials[n];
|
|
479
|
+
if (!t.extensions || !t.extensions[this.name])
|
|
480
480
|
return Promise.resolve();
|
|
481
|
-
const s =
|
|
481
|
+
const s = t.extensions[this.name];
|
|
482
482
|
return e.ior = s.ior !== void 0 ? s.ior : 1.5, Promise.resolve();
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
|
-
class
|
|
486
|
-
constructor(
|
|
487
|
-
this.parser =
|
|
485
|
+
class Zn {
|
|
486
|
+
constructor(n) {
|
|
487
|
+
this.parser = n, this.name = R.KHR_MATERIALS_SPECULAR;
|
|
488
488
|
}
|
|
489
|
-
getMaterialType(
|
|
490
|
-
const i = this.parser.json.materials[
|
|
489
|
+
getMaterialType(n) {
|
|
490
|
+
const i = this.parser.json.materials[n];
|
|
491
491
|
return !i.extensions || !i.extensions[this.name] ? null : O;
|
|
492
492
|
}
|
|
493
|
-
extendMaterialParams(
|
|
494
|
-
const i = this.parser,
|
|
495
|
-
if (!
|
|
493
|
+
extendMaterialParams(n, e) {
|
|
494
|
+
const i = this.parser, t = i.json.materials[n];
|
|
495
|
+
if (!t.extensions || !t.extensions[this.name])
|
|
496
496
|
return Promise.resolve();
|
|
497
|
-
const s = [], r =
|
|
497
|
+
const s = [], r = t.extensions[this.name];
|
|
498
498
|
e.specularIntensity = r.specularFactor !== void 0 ? r.specularFactor : 1, r.specularTexture !== void 0 && s.push(i.assignTexture(e, "specularIntensityMap", r.specularTexture));
|
|
499
499
|
const a = r.specularColorFactor || [1, 1, 1];
|
|
500
500
|
return e.specularColor = new G().setRGB(a[0], a[1], a[2], P), r.specularColorTexture !== void 0 && s.push(i.assignTexture(e, "specularColorMap", r.specularColorTexture, Y)), Promise.all(s);
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
|
-
class
|
|
504
|
-
constructor(
|
|
505
|
-
this.parser =
|
|
503
|
+
class et {
|
|
504
|
+
constructor(n) {
|
|
505
|
+
this.parser = n, this.name = R.EXT_MATERIALS_BUMP;
|
|
506
506
|
}
|
|
507
|
-
getMaterialType(
|
|
508
|
-
const i = this.parser.json.materials[
|
|
507
|
+
getMaterialType(n) {
|
|
508
|
+
const i = this.parser.json.materials[n];
|
|
509
509
|
return !i.extensions || !i.extensions[this.name] ? null : O;
|
|
510
510
|
}
|
|
511
|
-
extendMaterialParams(
|
|
512
|
-
const i = this.parser,
|
|
513
|
-
if (!
|
|
511
|
+
extendMaterialParams(n, e) {
|
|
512
|
+
const i = this.parser, t = i.json.materials[n];
|
|
513
|
+
if (!t.extensions || !t.extensions[this.name])
|
|
514
514
|
return Promise.resolve();
|
|
515
|
-
const s = [], r =
|
|
515
|
+
const s = [], r = t.extensions[this.name];
|
|
516
516
|
return e.bumpScale = r.bumpFactor !== void 0 ? r.bumpFactor : 1, r.bumpTexture !== void 0 && s.push(i.assignTexture(e, "bumpMap", r.bumpTexture)), Promise.all(s);
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
|
-
class
|
|
520
|
-
constructor(
|
|
521
|
-
this.parser =
|
|
519
|
+
class nt {
|
|
520
|
+
constructor(n) {
|
|
521
|
+
this.parser = n, this.name = R.KHR_MATERIALS_ANISOTROPY;
|
|
522
522
|
}
|
|
523
|
-
getMaterialType(
|
|
524
|
-
const i = this.parser.json.materials[
|
|
523
|
+
getMaterialType(n) {
|
|
524
|
+
const i = this.parser.json.materials[n];
|
|
525
525
|
return !i.extensions || !i.extensions[this.name] ? null : O;
|
|
526
526
|
}
|
|
527
|
-
extendMaterialParams(
|
|
528
|
-
const i = this.parser,
|
|
529
|
-
if (!
|
|
527
|
+
extendMaterialParams(n, e) {
|
|
528
|
+
const i = this.parser, t = i.json.materials[n];
|
|
529
|
+
if (!t.extensions || !t.extensions[this.name])
|
|
530
530
|
return Promise.resolve();
|
|
531
|
-
const s = [], r =
|
|
531
|
+
const s = [], r = t.extensions[this.name];
|
|
532
532
|
return r.anisotropyStrength !== void 0 && (e.anisotropy = r.anisotropyStrength), r.anisotropyRotation !== void 0 && (e.anisotropyRotation = r.anisotropyRotation), r.anisotropyTexture !== void 0 && s.push(i.assignTexture(e, "anisotropyMap", r.anisotropyTexture)), Promise.all(s);
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
|
-
class
|
|
536
|
-
constructor(
|
|
537
|
-
this.parser =
|
|
535
|
+
class tt {
|
|
536
|
+
constructor(n) {
|
|
537
|
+
this.parser = n, this.name = R.KHR_TEXTURE_BASISU;
|
|
538
538
|
}
|
|
539
|
-
loadTexture(
|
|
540
|
-
const e = this.parser, i = e.json,
|
|
541
|
-
if (!
|
|
539
|
+
loadTexture(n) {
|
|
540
|
+
const e = this.parser, i = e.json, t = i.textures[n];
|
|
541
|
+
if (!t.extensions || !t.extensions[this.name])
|
|
542
542
|
return null;
|
|
543
|
-
const s =
|
|
543
|
+
const s = t.extensions[this.name], r = e.options.ktx2Loader;
|
|
544
544
|
if (!r) {
|
|
545
545
|
if (i.extensionsRequired && i.extensionsRequired.indexOf(this.name) >= 0)
|
|
546
546
|
throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");
|
|
547
547
|
return null;
|
|
548
548
|
}
|
|
549
|
-
return e.loadTextureImage(
|
|
549
|
+
return e.loadTextureImage(n, s.source, r);
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
|
-
class
|
|
553
|
-
constructor(
|
|
554
|
-
this.parser =
|
|
552
|
+
class st {
|
|
553
|
+
constructor(n) {
|
|
554
|
+
this.parser = n, this.name = R.EXT_TEXTURE_WEBP;
|
|
555
555
|
}
|
|
556
|
-
loadTexture(
|
|
557
|
-
const e = this.name, i = this.parser,
|
|
556
|
+
loadTexture(n) {
|
|
557
|
+
const e = this.name, i = this.parser, t = i.json, s = t.textures[n];
|
|
558
558
|
if (!s.extensions || !s.extensions[e])
|
|
559
559
|
return null;
|
|
560
|
-
const r = s.extensions[e], a =
|
|
560
|
+
const r = s.extensions[e], a = t.images[r.source];
|
|
561
561
|
let o = i.textureLoader;
|
|
562
562
|
if (a.uri) {
|
|
563
563
|
const c = i.options.manager.getHandler(a.uri);
|
|
564
564
|
c !== null && (o = c);
|
|
565
565
|
}
|
|
566
|
-
return i.loadTextureImage(
|
|
566
|
+
return i.loadTextureImage(n, r.source, o);
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
|
-
class
|
|
570
|
-
constructor(
|
|
571
|
-
this.parser =
|
|
569
|
+
class rt {
|
|
570
|
+
constructor(n) {
|
|
571
|
+
this.parser = n, this.name = R.EXT_TEXTURE_AVIF;
|
|
572
572
|
}
|
|
573
|
-
loadTexture(
|
|
574
|
-
const e = this.name, i = this.parser,
|
|
573
|
+
loadTexture(n) {
|
|
574
|
+
const e = this.name, i = this.parser, t = i.json, s = t.textures[n];
|
|
575
575
|
if (!s.extensions || !s.extensions[e])
|
|
576
576
|
return null;
|
|
577
|
-
const r = s.extensions[e], a =
|
|
577
|
+
const r = s.extensions[e], a = t.images[r.source];
|
|
578
578
|
let o = i.textureLoader;
|
|
579
579
|
if (a.uri) {
|
|
580
580
|
const c = i.options.manager.getHandler(a.uri);
|
|
581
581
|
c !== null && (o = c);
|
|
582
582
|
}
|
|
583
|
-
return i.loadTextureImage(
|
|
583
|
+
return i.loadTextureImage(n, r.source, o);
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
|
-
class
|
|
587
|
-
constructor(
|
|
588
|
-
this.name = R.EXT_MESHOPT_COMPRESSION, this.parser =
|
|
586
|
+
class it {
|
|
587
|
+
constructor(n) {
|
|
588
|
+
this.name = R.EXT_MESHOPT_COMPRESSION, this.parser = n;
|
|
589
589
|
}
|
|
590
|
-
loadBufferView(
|
|
591
|
-
const e = this.parser.json, i = e.bufferViews[
|
|
590
|
+
loadBufferView(n) {
|
|
591
|
+
const e = this.parser.json, i = e.bufferViews[n];
|
|
592
592
|
if (i.extensions && i.extensions[this.name]) {
|
|
593
|
-
const
|
|
593
|
+
const t = i.extensions[this.name], s = this.parser.getDependency("buffer", t.buffer), r = this.parser.options.meshoptDecoder;
|
|
594
594
|
if (!r || !r.supported) {
|
|
595
595
|
if (e.extensionsRequired && e.extensionsRequired.indexOf(this.name) >= 0)
|
|
596
596
|
throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");
|
|
597
597
|
return null;
|
|
598
598
|
}
|
|
599
599
|
return s.then(function(a) {
|
|
600
|
-
const o =
|
|
601
|
-
return r.decodeGltfBufferAsync ? r.decodeGltfBufferAsync(u, l, d,
|
|
600
|
+
const o = t.byteOffset || 0, c = t.byteLength || 0, u = t.count, l = t.byteStride, d = new Uint8Array(a, o, c);
|
|
601
|
+
return r.decodeGltfBufferAsync ? r.decodeGltfBufferAsync(u, l, d, t.mode, t.filter).then(function(h) {
|
|
602
602
|
return h.buffer;
|
|
603
603
|
}) : r.ready.then(function() {
|
|
604
604
|
const h = new ArrayBuffer(u * l);
|
|
605
|
-
return r.decodeGltfBuffer(new Uint8Array(h), u, l, d,
|
|
605
|
+
return r.decodeGltfBuffer(new Uint8Array(h), u, l, d, t.mode, t.filter), h;
|
|
606
606
|
});
|
|
607
607
|
});
|
|
608
608
|
} else
|
|
609
609
|
return null;
|
|
610
610
|
}
|
|
611
611
|
}
|
|
612
|
-
class
|
|
613
|
-
constructor(
|
|
614
|
-
this.name = R.EXT_MESH_GPU_INSTANCING, this.parser =
|
|
612
|
+
class ot {
|
|
613
|
+
constructor(n) {
|
|
614
|
+
this.name = R.EXT_MESH_GPU_INSTANCING, this.parser = n;
|
|
615
615
|
}
|
|
616
|
-
createNodeMesh(
|
|
617
|
-
const e = this.parser.json, i = e.nodes[
|
|
616
|
+
createNodeMesh(n) {
|
|
617
|
+
const e = this.parser.json, i = e.nodes[n];
|
|
618
618
|
if (!i.extensions || !i.extensions[this.name] || i.mesh === void 0)
|
|
619
619
|
return null;
|
|
620
|
-
const
|
|
621
|
-
for (const c of
|
|
620
|
+
const t = e.meshes[i.mesh];
|
|
621
|
+
for (const c of t.primitives)
|
|
622
622
|
if (c.mode !== C.TRIANGLES && c.mode !== C.TRIANGLE_STRIP && c.mode !== C.TRIANGLE_FAN && c.mode !== void 0)
|
|
623
623
|
return null;
|
|
624
624
|
const r = i.extensions[this.name].attributes, a = [], o = {};
|
|
625
625
|
for (const c in r)
|
|
626
626
|
a.push(this.parser.getDependency("accessor", r[c]).then((u) => (o[c] = u, o[c])));
|
|
627
|
-
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(
|
|
627
|
+
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(n)), Promise.all(a).then((c) => {
|
|
628
628
|
const u = c.pop(), l = u.isGroup ? u.children : [u], d = c[0].count, h = [];
|
|
629
629
|
for (const p of l) {
|
|
630
|
-
const x = new Q(), m = new B(), g = new Ce(), E = new B(1, 1, 1), M = new
|
|
630
|
+
const x = new Q(), m = new B(), g = new Ce(), E = new B(1, 1, 1), M = new rn(p.geometry, p.material, d);
|
|
631
631
|
for (let T = 0; T < d; T++)
|
|
632
632
|
o.TRANSLATION && m.fromBufferAttribute(o.TRANSLATION, T), o.ROTATION && g.fromBufferAttribute(o.ROTATION, T), o.SCALE && E.fromBufferAttribute(o.SCALE, T), M.setMatrixAt(T, x.compose(m, g, E));
|
|
633
633
|
for (const T in o)
|
|
634
634
|
if (T === "_COLOR_0") {
|
|
635
635
|
const N = o[T];
|
|
636
|
-
M.instanceColor = new
|
|
636
|
+
M.instanceColor = new on(N.array, N.itemSize, N.normalized);
|
|
637
637
|
} else T !== "TRANSLATION" && T !== "ROTATION" && T !== "SCALE" && p.geometry.setAttribute(T, o[T]);
|
|
638
638
|
Oe.prototype.copy.call(M, p), this.parser.assignFinalMaterial(M), h.push(M);
|
|
639
639
|
}
|
|
@@ -642,30 +642,30 @@ class on {
|
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
644
|
const Ue = "glTF", X = 12, Me = { JSON: 1313821514, BIN: 5130562 };
|
|
645
|
-
class
|
|
646
|
-
constructor(
|
|
645
|
+
class at {
|
|
646
|
+
constructor(n) {
|
|
647
647
|
this.name = R.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
648
|
-
const e = new DataView(
|
|
648
|
+
const e = new DataView(n, 0, X), i = new TextDecoder();
|
|
649
649
|
if (this.header = {
|
|
650
|
-
magic: i.decode(new Uint8Array(
|
|
650
|
+
magic: i.decode(new Uint8Array(n.slice(0, 4))),
|
|
651
651
|
version: e.getUint32(4, !0),
|
|
652
652
|
length: e.getUint32(8, !0)
|
|
653
653
|
}, this.header.magic !== Ue)
|
|
654
654
|
throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
|
|
655
655
|
if (this.header.version < 2)
|
|
656
656
|
throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
|
|
657
|
-
const
|
|
657
|
+
const t = this.header.length - X, s = new DataView(n, X);
|
|
658
658
|
let r = 0;
|
|
659
|
-
for (; r <
|
|
659
|
+
for (; r < t; ) {
|
|
660
660
|
const a = s.getUint32(r, !0);
|
|
661
661
|
r += 4;
|
|
662
662
|
const o = s.getUint32(r, !0);
|
|
663
663
|
if (r += 4, o === Me.JSON) {
|
|
664
|
-
const c = new Uint8Array(
|
|
664
|
+
const c = new Uint8Array(n, X + r, a);
|
|
665
665
|
this.content = i.decode(c);
|
|
666
666
|
} else if (o === Me.BIN) {
|
|
667
667
|
const c = X + r;
|
|
668
|
-
this.body =
|
|
668
|
+
this.body = n.slice(c, c + a);
|
|
669
669
|
}
|
|
670
670
|
r += a;
|
|
671
671
|
}
|
|
@@ -673,28 +673,28 @@ class an {
|
|
|
673
673
|
throw new Error("THREE.GLTFLoader: JSON content not found.");
|
|
674
674
|
}
|
|
675
675
|
}
|
|
676
|
-
class
|
|
677
|
-
constructor(
|
|
676
|
+
class ct {
|
|
677
|
+
constructor(n, e) {
|
|
678
678
|
if (!e)
|
|
679
679
|
throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
|
|
680
|
-
this.name = R.KHR_DRACO_MESH_COMPRESSION, this.json =
|
|
680
|
+
this.name = R.KHR_DRACO_MESH_COMPRESSION, this.json = n, this.dracoLoader = e, this.dracoLoader.preload();
|
|
681
681
|
}
|
|
682
|
-
decodePrimitive(
|
|
683
|
-
const i = this.json,
|
|
682
|
+
decodePrimitive(n, e) {
|
|
683
|
+
const i = this.json, t = this.dracoLoader, s = n.extensions[this.name].bufferView, r = n.extensions[this.name].attributes, a = {}, o = {}, c = {};
|
|
684
684
|
for (const u in r) {
|
|
685
685
|
const l = fe[u] || u.toLowerCase();
|
|
686
686
|
a[l] = r[u];
|
|
687
687
|
}
|
|
688
|
-
for (const u in
|
|
688
|
+
for (const u in n.attributes) {
|
|
689
689
|
const l = fe[u] || u.toLowerCase();
|
|
690
690
|
if (r[u] !== void 0) {
|
|
691
|
-
const d = i.accessors[
|
|
691
|
+
const d = i.accessors[n.attributes[u]], h = V[d.componentType];
|
|
692
692
|
c[l] = h.name, o[l] = d.normalized === !0;
|
|
693
693
|
}
|
|
694
694
|
}
|
|
695
695
|
return e.getDependency("bufferView", s).then(function(u) {
|
|
696
696
|
return new Promise(function(l, d) {
|
|
697
|
-
|
|
697
|
+
t.decodeDracoFile(u, function(h) {
|
|
698
698
|
for (const p in h.attributes) {
|
|
699
699
|
const x = h.attributes[p], m = o[p];
|
|
700
700
|
m !== void 0 && (x.normalized = m);
|
|
@@ -705,31 +705,31 @@ class cn {
|
|
|
705
705
|
});
|
|
706
706
|
}
|
|
707
707
|
}
|
|
708
|
-
class
|
|
708
|
+
class lt {
|
|
709
709
|
constructor() {
|
|
710
710
|
this.name = R.KHR_TEXTURE_TRANSFORM;
|
|
711
711
|
}
|
|
712
|
-
extendTexture(
|
|
713
|
-
return (e.texCoord === void 0 || e.texCoord ===
|
|
712
|
+
extendTexture(n, e) {
|
|
713
|
+
return (e.texCoord === void 0 || e.texCoord === n.channel) && e.offset === void 0 && e.rotation === void 0 && e.scale === void 0 || (n = n.clone(), e.texCoord !== void 0 && (n.channel = e.texCoord), e.offset !== void 0 && n.offset.fromArray(e.offset), e.rotation !== void 0 && (n.rotation = e.rotation), e.scale !== void 0 && n.repeat.fromArray(e.scale), n.needsUpdate = !0), n;
|
|
714
714
|
}
|
|
715
715
|
}
|
|
716
|
-
class
|
|
716
|
+
class ut {
|
|
717
717
|
constructor() {
|
|
718
718
|
this.name = R.KHR_MESH_QUANTIZATION;
|
|
719
719
|
}
|
|
720
720
|
}
|
|
721
|
-
class Ge extends
|
|
722
|
-
constructor(
|
|
723
|
-
super(
|
|
721
|
+
class Ge extends kn {
|
|
722
|
+
constructor(n, e, i, t) {
|
|
723
|
+
super(n, e, i, t);
|
|
724
724
|
}
|
|
725
|
-
copySampleValue_(
|
|
726
|
-
const e = this.resultBuffer, i = this.sampleValues,
|
|
727
|
-
for (let r = 0; r !==
|
|
725
|
+
copySampleValue_(n) {
|
|
726
|
+
const e = this.resultBuffer, i = this.sampleValues, t = this.valueSize, s = n * t * 3 + t;
|
|
727
|
+
for (let r = 0; r !== t; r++)
|
|
728
728
|
e[r] = i[s + r];
|
|
729
729
|
return e;
|
|
730
730
|
}
|
|
731
|
-
interpolate_(
|
|
732
|
-
const s = this.resultBuffer, r = this.sampleValues, a = this.valueSize, o = a * 2, c = a * 3, u =
|
|
731
|
+
interpolate_(n, e, i, t) {
|
|
732
|
+
const s = this.resultBuffer, r = this.sampleValues, a = this.valueSize, o = a * 2, c = a * 3, u = t - e, l = (i - e) / u, d = l * l, h = d * l, p = n * c, x = p - c, m = -2 * h + 3 * d, g = h - d, E = 1 - m, M = g - d + l;
|
|
733
733
|
for (let T = 0; T !== a; T++) {
|
|
734
734
|
const N = r[x + T + a], I = r[x + T + o] * u, _ = r[p + T + a], v = r[p + T] * u;
|
|
735
735
|
s[T] = E * N + M * I + m * _ + g * v;
|
|
@@ -737,11 +737,11 @@ class Ge extends vt {
|
|
|
737
737
|
return s;
|
|
738
738
|
}
|
|
739
739
|
}
|
|
740
|
-
const
|
|
741
|
-
class
|
|
742
|
-
interpolate_(
|
|
743
|
-
const s = super.interpolate_(
|
|
744
|
-
return
|
|
740
|
+
const ft = new Ce();
|
|
741
|
+
class dt extends Ge {
|
|
742
|
+
interpolate_(n, e, i, t) {
|
|
743
|
+
const s = super.interpolate_(n, e, i, t);
|
|
744
|
+
return ft.fromArray(s).normalize().toArray(s), s;
|
|
745
745
|
}
|
|
746
746
|
}
|
|
747
747
|
const C = {
|
|
@@ -762,13 +762,13 @@ const C = {
|
|
|
762
762
|
}, we = {
|
|
763
763
|
9728: ke,
|
|
764
764
|
9729: le,
|
|
765
|
-
9984:
|
|
766
|
-
9985:
|
|
767
|
-
9986:
|
|
765
|
+
9984: dn,
|
|
766
|
+
9985: fn,
|
|
767
|
+
9986: un,
|
|
768
768
|
9987: ve
|
|
769
769
|
}, ye = {
|
|
770
|
-
33071:
|
|
771
|
-
33648:
|
|
770
|
+
33071: pn,
|
|
771
|
+
33648: hn,
|
|
772
772
|
10497: ue
|
|
773
773
|
}, ie = {
|
|
774
774
|
SCALAR: 1,
|
|
@@ -794,18 +794,18 @@ const C = {
|
|
|
794
794
|
translation: "position",
|
|
795
795
|
rotation: "quaternion",
|
|
796
796
|
weights: "morphTargetInfluences"
|
|
797
|
-
},
|
|
797
|
+
}, ht = {
|
|
798
798
|
CUBICSPLINE: void 0,
|
|
799
799
|
// We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
|
|
800
800
|
// keyframe track will be initialized with a default interpolation type, then modified.
|
|
801
801
|
LINEAR: De,
|
|
802
|
-
STEP:
|
|
802
|
+
STEP: Cn
|
|
803
803
|
}, oe = {
|
|
804
804
|
OPAQUE: "OPAQUE",
|
|
805
805
|
MASK: "MASK",
|
|
806
806
|
BLEND: "BLEND"
|
|
807
807
|
};
|
|
808
|
-
function
|
|
808
|
+
function pt(f) {
|
|
809
809
|
return f.DefaultMaterial === void 0 && (f.DefaultMaterial = new Pe({
|
|
810
810
|
color: 16777215,
|
|
811
811
|
emissive: 0,
|
|
@@ -813,31 +813,31 @@ function pn(f) {
|
|
|
813
813
|
roughness: 1,
|
|
814
814
|
transparent: !1,
|
|
815
815
|
depthTest: !0,
|
|
816
|
-
side:
|
|
816
|
+
side: vn
|
|
817
817
|
})), f.DefaultMaterial;
|
|
818
818
|
}
|
|
819
|
-
function U(f,
|
|
819
|
+
function U(f, n, e) {
|
|
820
820
|
for (const i in e.extensions)
|
|
821
|
-
f[i] === void 0 && (
|
|
821
|
+
f[i] === void 0 && (n.userData.gltfExtensions = n.userData.gltfExtensions || {}, n.userData.gltfExtensions[i] = e.extensions[i]);
|
|
822
822
|
}
|
|
823
|
-
function k(f,
|
|
824
|
-
|
|
823
|
+
function k(f, n) {
|
|
824
|
+
n.extras !== void 0 && (typeof n.extras == "object" ? Object.assign(f.userData, n.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + n.extras));
|
|
825
825
|
}
|
|
826
|
-
function
|
|
827
|
-
let i = !1,
|
|
828
|
-
for (let c = 0, u =
|
|
829
|
-
const l =
|
|
830
|
-
if (l.POSITION !== void 0 && (i = !0), l.NORMAL !== void 0 && (
|
|
826
|
+
function mt(f, n, e) {
|
|
827
|
+
let i = !1, t = !1, s = !1;
|
|
828
|
+
for (let c = 0, u = n.length; c < u; c++) {
|
|
829
|
+
const l = n[c];
|
|
830
|
+
if (l.POSITION !== void 0 && (i = !0), l.NORMAL !== void 0 && (t = !0), l.COLOR_0 !== void 0 && (s = !0), i && t && s) break;
|
|
831
831
|
}
|
|
832
|
-
if (!i && !
|
|
832
|
+
if (!i && !t && !s) return Promise.resolve(f);
|
|
833
833
|
const r = [], a = [], o = [];
|
|
834
|
-
for (let c = 0, u =
|
|
835
|
-
const l =
|
|
834
|
+
for (let c = 0, u = n.length; c < u; c++) {
|
|
835
|
+
const l = n[c];
|
|
836
836
|
if (i) {
|
|
837
837
|
const d = l.POSITION !== void 0 ? e.getDependency("accessor", l.POSITION) : f.attributes.position;
|
|
838
838
|
r.push(d);
|
|
839
839
|
}
|
|
840
|
-
if (
|
|
840
|
+
if (t) {
|
|
841
841
|
const d = l.NORMAL !== void 0 ? e.getDependency("accessor", l.NORMAL) : f.attributes.normal;
|
|
842
842
|
a.push(d);
|
|
843
843
|
}
|
|
@@ -852,37 +852,37 @@ function mn(f, t, e) {
|
|
|
852
852
|
Promise.all(o)
|
|
853
853
|
]).then(function(c) {
|
|
854
854
|
const u = c[0], l = c[1], d = c[2];
|
|
855
|
-
return i && (f.morphAttributes.position = u),
|
|
855
|
+
return i && (f.morphAttributes.position = u), t && (f.morphAttributes.normal = l), s && (f.morphAttributes.color = d), f.morphTargetsRelative = !0, f;
|
|
856
856
|
});
|
|
857
857
|
}
|
|
858
|
-
function
|
|
859
|
-
if (f.updateMorphTargets(),
|
|
860
|
-
for (let e = 0, i =
|
|
861
|
-
f.morphTargetInfluences[e] =
|
|
862
|
-
if (
|
|
863
|
-
const e =
|
|
858
|
+
function gt(f, n) {
|
|
859
|
+
if (f.updateMorphTargets(), n.weights !== void 0)
|
|
860
|
+
for (let e = 0, i = n.weights.length; e < i; e++)
|
|
861
|
+
f.morphTargetInfluences[e] = n.weights[e];
|
|
862
|
+
if (n.extras && Array.isArray(n.extras.targetNames)) {
|
|
863
|
+
const e = n.extras.targetNames;
|
|
864
864
|
if (f.morphTargetInfluences.length === e.length) {
|
|
865
865
|
f.morphTargetDictionary = {};
|
|
866
|
-
for (let i = 0,
|
|
866
|
+
for (let i = 0, t = e.length; i < t; i++)
|
|
867
867
|
f.morphTargetDictionary[e[i]] = i;
|
|
868
868
|
} else
|
|
869
869
|
console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
|
|
870
870
|
}
|
|
871
871
|
}
|
|
872
|
-
function
|
|
873
|
-
let
|
|
872
|
+
function Tt(f) {
|
|
873
|
+
let n;
|
|
874
874
|
const e = f.extensions && f.extensions[R.KHR_DRACO_MESH_COMPRESSION];
|
|
875
|
-
if (e ?
|
|
876
|
-
for (let i = 0,
|
|
877
|
-
|
|
878
|
-
return
|
|
875
|
+
if (e ? n = "draco:" + e.bufferView + ":" + e.indices + ":" + ae(e.attributes) : n = f.indices + ":" + ae(f.attributes) + ":" + f.mode, f.targets !== void 0)
|
|
876
|
+
for (let i = 0, t = f.targets.length; i < t; i++)
|
|
877
|
+
n += ":" + ae(f.targets[i]);
|
|
878
|
+
return n;
|
|
879
879
|
}
|
|
880
880
|
function ae(f) {
|
|
881
|
-
let
|
|
881
|
+
let n = "";
|
|
882
882
|
const e = Object.keys(f).sort();
|
|
883
|
-
for (let i = 0,
|
|
884
|
-
|
|
885
|
-
return
|
|
883
|
+
for (let i = 0, t = e.length; i < t; i++)
|
|
884
|
+
n += e[i] + ":" + f[e[i]] + ";";
|
|
885
|
+
return n;
|
|
886
886
|
}
|
|
887
887
|
function de(f) {
|
|
888
888
|
switch (f) {
|
|
@@ -898,30 +898,30 @@ function de(f) {
|
|
|
898
898
|
throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
|
|
899
899
|
}
|
|
900
900
|
}
|
|
901
|
-
function
|
|
901
|
+
function xt(f) {
|
|
902
902
|
return f.search(/\.jpe?g($|\?)/i) > 0 || f.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : f.search(/\.webp($|\?)/i) > 0 || f.search(/^data\:image\/webp/) === 0 ? "image/webp" : f.search(/\.ktx2($|\?)/i) > 0 || f.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
|
|
903
903
|
}
|
|
904
|
-
const
|
|
905
|
-
class
|
|
906
|
-
constructor(
|
|
907
|
-
this.json =
|
|
908
|
-
let i = !1,
|
|
904
|
+
const Rt = new Q();
|
|
905
|
+
class Et {
|
|
906
|
+
constructor(n = {}, e = {}) {
|
|
907
|
+
this.json = n, this.extensions = {}, this.plugins = {}, this.options = e, this.cache = new Bn(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
|
|
908
|
+
let i = !1, t = -1, s = !1, r = -1;
|
|
909
909
|
if (typeof navigator < "u") {
|
|
910
910
|
const a = navigator.userAgent;
|
|
911
911
|
i = /^((?!chrome|android).)*safari/i.test(a) === !0;
|
|
912
912
|
const o = a.match(/Version\/(\d+)/);
|
|
913
|
-
|
|
913
|
+
t = i && o ? parseInt(o[1], 10) : -1, s = a.indexOf("Firefox") > -1, r = s ? a.match(/Firefox\/([0-9]+)\./)[1] : -1;
|
|
914
914
|
}
|
|
915
|
-
typeof createImageBitmap > "u" || i &&
|
|
915
|
+
typeof createImageBitmap > "u" || i && t < 17 || s && r < 98 ? this.textureLoader = new an(this.options.manager) : this.textureLoader = new cn(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new Ne(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
|
|
916
916
|
}
|
|
917
|
-
setExtensions(
|
|
918
|
-
this.extensions =
|
|
917
|
+
setExtensions(n) {
|
|
918
|
+
this.extensions = n;
|
|
919
919
|
}
|
|
920
|
-
setPlugins(
|
|
921
|
-
this.plugins =
|
|
920
|
+
setPlugins(n) {
|
|
921
|
+
this.plugins = n;
|
|
922
922
|
}
|
|
923
|
-
parse(
|
|
924
|
-
const i = this,
|
|
923
|
+
parse(n, e) {
|
|
924
|
+
const i = this, t = this.json, s = this.extensions;
|
|
925
925
|
this.cache.removeAll(), this.nodeCache = {}, this._invokeAll(function(r) {
|
|
926
926
|
return r._markDefs && r._markDefs();
|
|
927
927
|
}), Promise.all(this._invokeAll(function(r) {
|
|
@@ -934,20 +934,20 @@ class En {
|
|
|
934
934
|
]);
|
|
935
935
|
}).then(function(r) {
|
|
936
936
|
const a = {
|
|
937
|
-
scene: r[0][
|
|
937
|
+
scene: r[0][t.scene || 0],
|
|
938
938
|
scenes: r[0],
|
|
939
939
|
animations: r[1],
|
|
940
940
|
cameras: r[2],
|
|
941
|
-
asset:
|
|
941
|
+
asset: t.asset,
|
|
942
942
|
parser: i,
|
|
943
943
|
userData: {}
|
|
944
944
|
};
|
|
945
|
-
return U(s, a,
|
|
945
|
+
return U(s, a, t), k(a, t), Promise.all(i._invokeAll(function(o) {
|
|
946
946
|
return o.afterRoot && o.afterRoot(a);
|
|
947
947
|
})).then(function() {
|
|
948
948
|
for (const o of a.scenes)
|
|
949
949
|
o.updateMatrixWorld();
|
|
950
|
-
|
|
950
|
+
n(a);
|
|
951
951
|
});
|
|
952
952
|
}).catch(e);
|
|
953
953
|
}
|
|
@@ -957,14 +957,14 @@ class En {
|
|
|
957
957
|
* @private
|
|
958
958
|
*/
|
|
959
959
|
_markDefs() {
|
|
960
|
-
const
|
|
961
|
-
for (let
|
|
962
|
-
const r = e[
|
|
960
|
+
const n = this.json.nodes || [], e = this.json.skins || [], i = this.json.meshes || [];
|
|
961
|
+
for (let t = 0, s = e.length; t < s; t++) {
|
|
962
|
+
const r = e[t].joints;
|
|
963
963
|
for (let a = 0, o = r.length; a < o; a++)
|
|
964
|
-
|
|
964
|
+
n[r[a]].isBone = !0;
|
|
965
965
|
}
|
|
966
|
-
for (let
|
|
967
|
-
const r = t
|
|
966
|
+
for (let t = 0, s = n.length; t < s; t++) {
|
|
967
|
+
const r = n[t];
|
|
968
968
|
r.mesh !== void 0 && (this._addNodeRef(this.meshCache, r.mesh), r.skin !== void 0 && (i[r.mesh].isSkinnedMesh = !0)), r.camera !== void 0 && this._addNodeRef(this.cameraCache, r.camera);
|
|
969
969
|
}
|
|
970
970
|
}
|
|
@@ -981,8 +981,8 @@ class En {
|
|
|
981
981
|
* @param {Object} cache
|
|
982
982
|
* @param {Object3D} index
|
|
983
983
|
*/
|
|
984
|
-
_addNodeRef(
|
|
985
|
-
e !== void 0 && (
|
|
984
|
+
_addNodeRef(n, e) {
|
|
985
|
+
e !== void 0 && (n.refs[e] === void 0 && (n.refs[e] = n.uses[e] = 0), n.refs[e]++);
|
|
986
986
|
}
|
|
987
987
|
/**
|
|
988
988
|
* Returns a reference to a shared resource, cloning it if necessary.
|
|
@@ -993,31 +993,31 @@ class En {
|
|
|
993
993
|
* @param {Object} object
|
|
994
994
|
* @return {Object}
|
|
995
995
|
*/
|
|
996
|
-
_getNodeRef(
|
|
997
|
-
if (
|
|
998
|
-
const
|
|
996
|
+
_getNodeRef(n, e, i) {
|
|
997
|
+
if (n.refs[e] <= 1) return i;
|
|
998
|
+
const t = i.clone(), s = (r, a) => {
|
|
999
999
|
const o = this.associations.get(r);
|
|
1000
1000
|
o != null && this.associations.set(a, o);
|
|
1001
1001
|
for (const [c, u] of r.children.entries())
|
|
1002
1002
|
s(u, a.children[c]);
|
|
1003
1003
|
};
|
|
1004
|
-
return s(i,
|
|
1004
|
+
return s(i, t), t.name += "_instance_" + n.uses[e]++, t;
|
|
1005
1005
|
}
|
|
1006
|
-
_invokeOne(
|
|
1006
|
+
_invokeOne(n) {
|
|
1007
1007
|
const e = Object.values(this.plugins);
|
|
1008
1008
|
e.push(this);
|
|
1009
1009
|
for (let i = 0; i < e.length; i++) {
|
|
1010
|
-
const
|
|
1011
|
-
if (
|
|
1010
|
+
const t = n(e[i]);
|
|
1011
|
+
if (t) return t;
|
|
1012
1012
|
}
|
|
1013
1013
|
return null;
|
|
1014
1014
|
}
|
|
1015
|
-
_invokeAll(
|
|
1015
|
+
_invokeAll(n) {
|
|
1016
1016
|
const e = Object.values(this.plugins);
|
|
1017
1017
|
e.unshift(this);
|
|
1018
1018
|
const i = [];
|
|
1019
|
-
for (let
|
|
1020
|
-
const s =
|
|
1019
|
+
for (let t = 0; t < e.length; t++) {
|
|
1020
|
+
const s = n(e[t]);
|
|
1021
1021
|
s && i.push(s);
|
|
1022
1022
|
}
|
|
1023
1023
|
return i;
|
|
@@ -1030,66 +1030,66 @@ class En {
|
|
|
1030
1030
|
* @param {number} index
|
|
1031
1031
|
* @return {Promise<Object3D|Material|THREE.Texture|AnimationClip|ArrayBuffer|Object>}
|
|
1032
1032
|
*/
|
|
1033
|
-
getDependency(
|
|
1034
|
-
const i =
|
|
1035
|
-
let
|
|
1036
|
-
if (!
|
|
1037
|
-
switch (
|
|
1033
|
+
getDependency(n, e) {
|
|
1034
|
+
const i = n + ":" + e;
|
|
1035
|
+
let t = this.cache.get(i);
|
|
1036
|
+
if (!t) {
|
|
1037
|
+
switch (n) {
|
|
1038
1038
|
case "scene":
|
|
1039
|
-
|
|
1039
|
+
t = this.loadScene(e);
|
|
1040
1040
|
break;
|
|
1041
1041
|
case "node":
|
|
1042
|
-
|
|
1042
|
+
t = this._invokeOne(function(s) {
|
|
1043
1043
|
return s.loadNode && s.loadNode(e);
|
|
1044
1044
|
});
|
|
1045
1045
|
break;
|
|
1046
1046
|
case "mesh":
|
|
1047
|
-
|
|
1047
|
+
t = this._invokeOne(function(s) {
|
|
1048
1048
|
return s.loadMesh && s.loadMesh(e);
|
|
1049
1049
|
});
|
|
1050
1050
|
break;
|
|
1051
1051
|
case "accessor":
|
|
1052
|
-
|
|
1052
|
+
t = this.loadAccessor(e);
|
|
1053
1053
|
break;
|
|
1054
1054
|
case "bufferView":
|
|
1055
|
-
|
|
1055
|
+
t = this._invokeOne(function(s) {
|
|
1056
1056
|
return s.loadBufferView && s.loadBufferView(e);
|
|
1057
1057
|
});
|
|
1058
1058
|
break;
|
|
1059
1059
|
case "buffer":
|
|
1060
|
-
|
|
1060
|
+
t = this.loadBuffer(e);
|
|
1061
1061
|
break;
|
|
1062
1062
|
case "material":
|
|
1063
|
-
|
|
1063
|
+
t = this._invokeOne(function(s) {
|
|
1064
1064
|
return s.loadMaterial && s.loadMaterial(e);
|
|
1065
1065
|
});
|
|
1066
1066
|
break;
|
|
1067
1067
|
case "texture":
|
|
1068
|
-
|
|
1068
|
+
t = this._invokeOne(function(s) {
|
|
1069
1069
|
return s.loadTexture && s.loadTexture(e);
|
|
1070
1070
|
});
|
|
1071
1071
|
break;
|
|
1072
1072
|
case "skin":
|
|
1073
|
-
|
|
1073
|
+
t = this.loadSkin(e);
|
|
1074
1074
|
break;
|
|
1075
1075
|
case "animation":
|
|
1076
|
-
|
|
1076
|
+
t = this._invokeOne(function(s) {
|
|
1077
1077
|
return s.loadAnimation && s.loadAnimation(e);
|
|
1078
1078
|
});
|
|
1079
1079
|
break;
|
|
1080
1080
|
case "camera":
|
|
1081
|
-
|
|
1081
|
+
t = this.loadCamera(e);
|
|
1082
1082
|
break;
|
|
1083
1083
|
default:
|
|
1084
|
-
if (
|
|
1085
|
-
return s != this && s.getDependency && s.getDependency(
|
|
1086
|
-
}), !
|
|
1087
|
-
throw new Error("Unknown type: " +
|
|
1084
|
+
if (t = this._invokeOne(function(s) {
|
|
1085
|
+
return s != this && s.getDependency && s.getDependency(n, e);
|
|
1086
|
+
}), !t)
|
|
1087
|
+
throw new Error("Unknown type: " + n);
|
|
1088
1088
|
break;
|
|
1089
1089
|
}
|
|
1090
|
-
this.cache.add(i,
|
|
1090
|
+
this.cache.add(i, t);
|
|
1091
1091
|
}
|
|
1092
|
-
return
|
|
1092
|
+
return t;
|
|
1093
1093
|
}
|
|
1094
1094
|
/**
|
|
1095
1095
|
* Requests all dependencies of the specified type asynchronously, with caching.
|
|
@@ -1098,13 +1098,13 @@ class En {
|
|
|
1098
1098
|
* @param {string} type
|
|
1099
1099
|
* @return {Promise<Array<Object>>}
|
|
1100
1100
|
*/
|
|
1101
|
-
getDependencies(
|
|
1102
|
-
let e = this.cache.get(
|
|
1101
|
+
getDependencies(n) {
|
|
1102
|
+
let e = this.cache.get(n);
|
|
1103
1103
|
if (!e) {
|
|
1104
|
-
const i = this,
|
|
1105
|
-
e = Promise.all(
|
|
1106
|
-
return i.getDependency(
|
|
1107
|
-
})), this.cache.add(
|
|
1104
|
+
const i = this, t = this.json[n + (n === "mesh" ? "es" : "s")] || [];
|
|
1105
|
+
e = Promise.all(t.map(function(s, r) {
|
|
1106
|
+
return i.getDependency(n, r);
|
|
1107
|
+
})), this.cache.add(n, e);
|
|
1108
1108
|
}
|
|
1109
1109
|
return e;
|
|
1110
1110
|
}
|
|
@@ -1115,15 +1115,15 @@ class En {
|
|
|
1115
1115
|
* @param {number} bufferIndex
|
|
1116
1116
|
* @return {Promise<ArrayBuffer>}
|
|
1117
1117
|
*/
|
|
1118
|
-
loadBuffer(
|
|
1119
|
-
const e = this.json.buffers[
|
|
1118
|
+
loadBuffer(n) {
|
|
1119
|
+
const e = this.json.buffers[n], i = this.fileLoader;
|
|
1120
1120
|
if (e.type && e.type !== "arraybuffer")
|
|
1121
1121
|
throw new Error("THREE.GLTFLoader: " + e.type + " buffer type is not supported.");
|
|
1122
|
-
if (e.uri === void 0 &&
|
|
1122
|
+
if (e.uri === void 0 && n === 0)
|
|
1123
1123
|
return Promise.resolve(this.extensions[R.KHR_BINARY_GLTF].body);
|
|
1124
|
-
const
|
|
1124
|
+
const t = this.options;
|
|
1125
1125
|
return new Promise(function(s, r) {
|
|
1126
|
-
i.load(W.resolveURL(e.uri,
|
|
1126
|
+
i.load(W.resolveURL(e.uri, t.path), s, void 0, function() {
|
|
1127
1127
|
r(new Error('THREE.GLTFLoader: Failed to load buffer "' + e.uri + '".'));
|
|
1128
1128
|
});
|
|
1129
1129
|
});
|
|
@@ -1135,11 +1135,11 @@ class En {
|
|
|
1135
1135
|
* @param {number} bufferViewIndex
|
|
1136
1136
|
* @return {Promise<ArrayBuffer>}
|
|
1137
1137
|
*/
|
|
1138
|
-
loadBufferView(
|
|
1139
|
-
const e = this.json.bufferViews[
|
|
1138
|
+
loadBufferView(n) {
|
|
1139
|
+
const e = this.json.bufferViews[n];
|
|
1140
1140
|
return this.getDependency("buffer", e.buffer).then(function(i) {
|
|
1141
|
-
const
|
|
1142
|
-
return i.slice(s, s +
|
|
1141
|
+
const t = e.byteLength || 0, s = e.byteOffset || 0;
|
|
1142
|
+
return i.slice(s, s + t);
|
|
1143
1143
|
});
|
|
1144
1144
|
}
|
|
1145
1145
|
/**
|
|
@@ -1149,25 +1149,25 @@ class En {
|
|
|
1149
1149
|
* @param {number} accessorIndex
|
|
1150
1150
|
* @return {Promise<BufferAttribute|InterleavedBufferAttribute>}
|
|
1151
1151
|
*/
|
|
1152
|
-
loadAccessor(
|
|
1153
|
-
const e = this, i = this.json,
|
|
1154
|
-
if (
|
|
1155
|
-
const r = ie[
|
|
1156
|
-
return Promise.resolve(new
|
|
1152
|
+
loadAccessor(n) {
|
|
1153
|
+
const e = this, i = this.json, t = this.json.accessors[n];
|
|
1154
|
+
if (t.bufferView === void 0 && t.sparse === void 0) {
|
|
1155
|
+
const r = ie[t.type], a = V[t.componentType], o = t.normalized === !0, c = new a(t.count * r);
|
|
1156
|
+
return Promise.resolve(new te(c, r, o));
|
|
1157
1157
|
}
|
|
1158
1158
|
const s = [];
|
|
1159
|
-
return
|
|
1160
|
-
const a = r[0], o = ie[
|
|
1159
|
+
return t.bufferView !== void 0 ? s.push(this.getDependency("bufferView", t.bufferView)) : s.push(null), t.sparse !== void 0 && (s.push(this.getDependency("bufferView", t.sparse.indices.bufferView)), s.push(this.getDependency("bufferView", t.sparse.values.bufferView))), Promise.all(s).then(function(r) {
|
|
1160
|
+
const a = r[0], o = ie[t.type], c = V[t.componentType], u = c.BYTES_PER_ELEMENT, l = u * o, d = t.byteOffset || 0, h = t.bufferView !== void 0 ? i.bufferViews[t.bufferView].byteStride : void 0, p = t.normalized === !0;
|
|
1161
1161
|
let x, m;
|
|
1162
1162
|
if (h && h !== l) {
|
|
1163
|
-
const g = Math.floor(d / h), E = "InterleavedBuffer:" +
|
|
1163
|
+
const g = Math.floor(d / h), E = "InterleavedBuffer:" + t.bufferView + ":" + t.componentType + ":" + g + ":" + t.count;
|
|
1164
1164
|
let M = e.cache.get(E);
|
|
1165
|
-
M || (x = new c(a, g * h,
|
|
1165
|
+
M || (x = new c(a, g * h, t.count * h / u), M = new ln(x, h / u), e.cache.add(E, M)), m = new On(M, o, d % h / u, p);
|
|
1166
1166
|
} else
|
|
1167
|
-
a === null ? x = new c(
|
|
1168
|
-
if (
|
|
1169
|
-
const g = ie.SCALAR, E = V[
|
|
1170
|
-
a !== null && (m = new
|
|
1167
|
+
a === null ? x = new c(t.count * o) : x = new c(a, d, t.count * o), m = new te(x, o, p);
|
|
1168
|
+
if (t.sparse !== void 0) {
|
|
1169
|
+
const g = ie.SCALAR, E = V[t.sparse.indices.componentType], M = t.sparse.indices.byteOffset || 0, T = t.sparse.values.byteOffset || 0, N = new E(r[1], M, t.sparse.count * g), I = new c(r[2], T, t.sparse.count * o);
|
|
1170
|
+
a !== null && (m = new te(m.array.slice(), m.itemSize, m.normalized)), m.normalized = !1;
|
|
1171
1171
|
for (let _ = 0, v = N.length; _ < v; _++) {
|
|
1172
1172
|
const w = N[_];
|
|
1173
1173
|
if (m.setX(w, I[_ * o]), o >= 2 && m.setY(w, I[_ * o + 1]), o >= 3 && m.setZ(w, I[_ * o + 2]), o >= 4 && m.setW(w, I[_ * o + 3]), o >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
@@ -1184,33 +1184,33 @@ class En {
|
|
|
1184
1184
|
* @param {number} textureIndex
|
|
1185
1185
|
* @return {Promise<THREE.Texture|null>}
|
|
1186
1186
|
*/
|
|
1187
|
-
loadTexture(
|
|
1188
|
-
const e = this.json, i = this.options, s = e.textures[
|
|
1187
|
+
loadTexture(n) {
|
|
1188
|
+
const e = this.json, i = this.options, s = e.textures[n].source, r = e.images[s];
|
|
1189
1189
|
let a = this.textureLoader;
|
|
1190
1190
|
if (r.uri) {
|
|
1191
1191
|
const o = i.manager.getHandler(r.uri);
|
|
1192
1192
|
o !== null && (a = o);
|
|
1193
1193
|
}
|
|
1194
|
-
return this.loadTextureImage(
|
|
1194
|
+
return this.loadTextureImage(n, s, a);
|
|
1195
1195
|
}
|
|
1196
|
-
loadTextureImage(
|
|
1197
|
-
const
|
|
1196
|
+
loadTextureImage(n, e, i) {
|
|
1197
|
+
const t = this, s = this.json, r = s.textures[n], a = s.images[e], o = (a.uri || a.bufferView) + ":" + r.sampler;
|
|
1198
1198
|
if (this.textureCache[o])
|
|
1199
1199
|
return this.textureCache[o];
|
|
1200
1200
|
const c = this.loadImageSource(e, i).then(function(u) {
|
|
1201
1201
|
u.flipY = !1, u.name = r.name || a.name || "", u.name === "" && typeof a.uri == "string" && a.uri.startsWith("data:image/") === !1 && (u.name = a.uri);
|
|
1202
1202
|
const d = (s.samplers || {})[r.sampler] || {};
|
|
1203
|
-
return u.magFilter = we[d.magFilter] || le, u.minFilter = we[d.minFilter] || ve, u.wrapS = ye[d.wrapS] || ue, u.wrapT = ye[d.wrapT] || ue, u.generateMipmaps = !u.isCompressedTexture && u.minFilter !== ke && u.minFilter !== le,
|
|
1203
|
+
return u.magFilter = we[d.magFilter] || le, u.minFilter = we[d.minFilter] || ve, u.wrapS = ye[d.wrapS] || ue, u.wrapT = ye[d.wrapT] || ue, u.generateMipmaps = !u.isCompressedTexture && u.minFilter !== ke && u.minFilter !== le, t.associations.set(u, { textures: n }), u;
|
|
1204
1204
|
}).catch(function() {
|
|
1205
1205
|
return null;
|
|
1206
1206
|
});
|
|
1207
1207
|
return this.textureCache[o] = c, c;
|
|
1208
1208
|
}
|
|
1209
|
-
loadImageSource(
|
|
1210
|
-
const i = this,
|
|
1211
|
-
if (this.sourceCache[
|
|
1212
|
-
return this.sourceCache[
|
|
1213
|
-
const r =
|
|
1209
|
+
loadImageSource(n, e) {
|
|
1210
|
+
const i = this, t = this.json, s = this.options;
|
|
1211
|
+
if (this.sourceCache[n] !== void 0)
|
|
1212
|
+
return this.sourceCache[n].then((l) => l.clone());
|
|
1213
|
+
const r = t.images[n], a = self.URL || self.webkitURL;
|
|
1214
1214
|
let o = r.uri || "", c = !1;
|
|
1215
1215
|
if (r.bufferView !== void 0)
|
|
1216
1216
|
o = i.getDependency("bufferView", r.bufferView).then(function(l) {
|
|
@@ -1219,7 +1219,7 @@ class En {
|
|
|
1219
1219
|
return o = a.createObjectURL(d), o;
|
|
1220
1220
|
});
|
|
1221
1221
|
else if (r.uri === void 0)
|
|
1222
|
-
throw new Error("THREE.GLTFLoader: Image " +
|
|
1222
|
+
throw new Error("THREE.GLTFLoader: Image " + n + " is missing URI and bufferView");
|
|
1223
1223
|
const u = Promise.resolve(o).then(function(l) {
|
|
1224
1224
|
return new Promise(function(d, h) {
|
|
1225
1225
|
let p = d;
|
|
@@ -1229,11 +1229,11 @@ class En {
|
|
|
1229
1229
|
}), e.load(W.resolveURL(l, s.path), p, void 0, h);
|
|
1230
1230
|
});
|
|
1231
1231
|
}).then(function(l) {
|
|
1232
|
-
return c === !0 && a.revokeObjectURL(o), k(l, r), l.userData.mimeType = r.mimeType ||
|
|
1232
|
+
return c === !0 && a.revokeObjectURL(o), k(l, r), l.userData.mimeType = r.mimeType || xt(r.uri), l;
|
|
1233
1233
|
}).catch(function(l) {
|
|
1234
1234
|
throw console.error("THREE.GLTFLoader: Couldn't load texture", o), l;
|
|
1235
1235
|
});
|
|
1236
|
-
return this.sourceCache[
|
|
1236
|
+
return this.sourceCache[n] = u, u;
|
|
1237
1237
|
}
|
|
1238
1238
|
/**
|
|
1239
1239
|
* Asynchronously assigns a texture to the given material parameters.
|
|
@@ -1245,7 +1245,7 @@ class En {
|
|
|
1245
1245
|
* @param {string} [colorSpace]
|
|
1246
1246
|
* @return {Promise<Texture>}
|
|
1247
1247
|
*/
|
|
1248
|
-
assignTexture(
|
|
1248
|
+
assignTexture(n, e, i, t) {
|
|
1249
1249
|
const s = this;
|
|
1250
1250
|
return this.getDependency("texture", i.index).then(function(r) {
|
|
1251
1251
|
if (!r) return null;
|
|
@@ -1256,7 +1256,7 @@ class En {
|
|
|
1256
1256
|
r = s.extensions[R.KHR_TEXTURE_TRANSFORM].extendTexture(r, a), s.associations.set(r, o);
|
|
1257
1257
|
}
|
|
1258
1258
|
}
|
|
1259
|
-
return
|
|
1259
|
+
return t !== void 0 && (r.colorSpace = t), n[e] = r, r;
|
|
1260
1260
|
});
|
|
1261
1261
|
}
|
|
1262
1262
|
/**
|
|
@@ -1269,26 +1269,26 @@ class En {
|
|
|
1269
1269
|
* @private
|
|
1270
1270
|
* @param {Object3D} mesh Mesh, Line, or Points instance.
|
|
1271
1271
|
*/
|
|
1272
|
-
assignFinalMaterial(
|
|
1273
|
-
const e =
|
|
1274
|
-
let i =
|
|
1275
|
-
const
|
|
1276
|
-
if (
|
|
1272
|
+
assignFinalMaterial(n) {
|
|
1273
|
+
const e = n.geometry;
|
|
1274
|
+
let i = n.material;
|
|
1275
|
+
const t = e.attributes.tangent === void 0, s = e.attributes.color !== void 0, r = e.attributes.normal === void 0;
|
|
1276
|
+
if (n.isPoints) {
|
|
1277
1277
|
const a = "PointsMaterial:" + i.uuid;
|
|
1278
1278
|
let o = this.cache.get(a);
|
|
1279
|
-
o || (o = new
|
|
1280
|
-
} else if (
|
|
1279
|
+
o || (o = new mn(), se.prototype.copy.call(o, i), o.color.copy(i.color), o.map = i.map, o.sizeAttenuation = !1, this.cache.add(a, o)), i = o;
|
|
1280
|
+
} else if (n.isLine) {
|
|
1281
1281
|
const a = "LineBasicMaterial:" + i.uuid;
|
|
1282
1282
|
let o = this.cache.get(a);
|
|
1283
|
-
o || (o = new
|
|
1283
|
+
o || (o = new gn(), se.prototype.copy.call(o, i), o.color.copy(i.color), o.map = i.map, this.cache.add(a, o)), i = o;
|
|
1284
1284
|
}
|
|
1285
|
-
if (
|
|
1285
|
+
if (t || s || r) {
|
|
1286
1286
|
let a = "ClonedMaterial:" + i.uuid + ":";
|
|
1287
|
-
|
|
1287
|
+
t && (a += "derivative-tangents:"), s && (a += "vertex-colors:"), r && (a += "flat-shading:");
|
|
1288
1288
|
let o = this.cache.get(a);
|
|
1289
|
-
o || (o = i.clone(), s && (o.vertexColors = !0), r && (o.flatShading = !0),
|
|
1289
|
+
o || (o = i.clone(), s && (o.vertexColors = !0), r && (o.flatShading = !0), t && (o.normalScale && (o.normalScale.y *= -1), o.clearcoatNormalScale && (o.clearcoatNormalScale.y *= -1)), this.cache.add(a, o), this.associations.set(o, this.associations.get(i))), i = o;
|
|
1290
1290
|
}
|
|
1291
|
-
|
|
1291
|
+
n.material = i;
|
|
1292
1292
|
}
|
|
1293
1293
|
getMaterialType() {
|
|
1294
1294
|
return Pe;
|
|
@@ -1300,12 +1300,12 @@ class En {
|
|
|
1300
1300
|
* @param {number} materialIndex
|
|
1301
1301
|
* @return {Promise<Material>}
|
|
1302
1302
|
*/
|
|
1303
|
-
loadMaterial(
|
|
1304
|
-
const e = this, i = this.json,
|
|
1303
|
+
loadMaterial(n) {
|
|
1304
|
+
const e = this, i = this.json, t = this.extensions, s = i.materials[n];
|
|
1305
1305
|
let r;
|
|
1306
1306
|
const a = {}, o = s.extensions || {}, c = [];
|
|
1307
1307
|
if (o[R.KHR_MATERIALS_UNLIT]) {
|
|
1308
|
-
const l =
|
|
1308
|
+
const l = t[R.KHR_MATERIALS_UNLIT];
|
|
1309
1309
|
r = l.getMaterialType(), c.push(l.extendParams(a, s, e));
|
|
1310
1310
|
} else {
|
|
1311
1311
|
const l = s.pbrMetallicRoughness || {};
|
|
@@ -1314,12 +1314,12 @@ class En {
|
|
|
1314
1314
|
a.color.setRGB(d[0], d[1], d[2], P), a.opacity = d[3];
|
|
1315
1315
|
}
|
|
1316
1316
|
l.baseColorTexture !== void 0 && c.push(e.assignTexture(a, "map", l.baseColorTexture, Y)), a.metalness = l.metallicFactor !== void 0 ? l.metallicFactor : 1, a.roughness = l.roughnessFactor !== void 0 ? l.roughnessFactor : 1, l.metallicRoughnessTexture !== void 0 && (c.push(e.assignTexture(a, "metalnessMap", l.metallicRoughnessTexture)), c.push(e.assignTexture(a, "roughnessMap", l.metallicRoughnessTexture))), r = this._invokeOne(function(d) {
|
|
1317
|
-
return d.getMaterialType && d.getMaterialType(
|
|
1317
|
+
return d.getMaterialType && d.getMaterialType(n);
|
|
1318
1318
|
}), c.push(Promise.all(this._invokeAll(function(d) {
|
|
1319
|
-
return d.extendMaterialParams && d.extendMaterialParams(
|
|
1319
|
+
return d.extendMaterialParams && d.extendMaterialParams(n, a);
|
|
1320
1320
|
})));
|
|
1321
1321
|
}
|
|
1322
|
-
s.doubleSided === !0 && (a.side =
|
|
1322
|
+
s.doubleSided === !0 && (a.side = Tn);
|
|
1323
1323
|
const u = s.alphaMode || oe.OPAQUE;
|
|
1324
1324
|
if (u === oe.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, u === oe.MASK && (a.alphaTest = s.alphaCutoff !== void 0 ? s.alphaCutoff : 0.5)), s.normalTexture !== void 0 && r !== q && (c.push(e.assignTexture(a, "normalMap", s.normalTexture)), a.normalScale = new Ie(1, 1), s.normalTexture.scale !== void 0)) {
|
|
1325
1325
|
const l = s.normalTexture.scale;
|
|
@@ -1331,7 +1331,7 @@ class En {
|
|
|
1331
1331
|
}
|
|
1332
1332
|
return s.emissiveTexture !== void 0 && r !== q && c.push(e.assignTexture(a, "emissiveMap", s.emissiveTexture, Y)), Promise.all(c).then(function() {
|
|
1333
1333
|
const l = new r(a);
|
|
1334
|
-
return s.name && (l.name = s.name), k(l, s), e.associations.set(l, { materials:
|
|
1334
|
+
return s.name && (l.name = s.name), k(l, s), e.associations.set(l, { materials: n }), s.extensions && U(t, l, s), l;
|
|
1335
1335
|
});
|
|
1336
1336
|
}
|
|
1337
1337
|
/**
|
|
@@ -1341,8 +1341,8 @@ class En {
|
|
|
1341
1341
|
* @param {string} originalName
|
|
1342
1342
|
* @return {string}
|
|
1343
1343
|
*/
|
|
1344
|
-
createUniqueName(
|
|
1345
|
-
const e =
|
|
1344
|
+
createUniqueName(n) {
|
|
1345
|
+
const e = xn.sanitizeNodeName(n || "");
|
|
1346
1346
|
return e in this.nodeNamesUsed ? e + "_" + ++this.nodeNamesUsed[e] : (this.nodeNamesUsed[e] = 0, e);
|
|
1347
1347
|
}
|
|
1348
1348
|
/**
|
|
@@ -1354,21 +1354,21 @@ class En {
|
|
|
1354
1354
|
* @param {Array<GLTF.Primitive>} primitives
|
|
1355
1355
|
* @return {Promise<Array<BufferGeometry>>}
|
|
1356
1356
|
*/
|
|
1357
|
-
loadGeometries(
|
|
1358
|
-
const e = this, i = this.extensions,
|
|
1357
|
+
loadGeometries(n) {
|
|
1358
|
+
const e = this, i = this.extensions, t = this.primitiveCache;
|
|
1359
1359
|
function s(a) {
|
|
1360
1360
|
return i[R.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a, e).then(function(o) {
|
|
1361
1361
|
return be(o, a, e);
|
|
1362
1362
|
});
|
|
1363
1363
|
}
|
|
1364
1364
|
const r = [];
|
|
1365
|
-
for (let a = 0, o =
|
|
1366
|
-
const c =
|
|
1365
|
+
for (let a = 0, o = n.length; a < o; a++) {
|
|
1366
|
+
const c = n[a], u = Tt(c), l = t[u];
|
|
1367
1367
|
if (l)
|
|
1368
1368
|
r.push(l.promise);
|
|
1369
1369
|
else {
|
|
1370
1370
|
let d;
|
|
1371
|
-
c.extensions && c.extensions[R.KHR_DRACO_MESH_COMPRESSION] ? d = s(c) : d = be(new
|
|
1371
|
+
c.extensions && c.extensions[R.KHR_DRACO_MESH_COMPRESSION] ? d = s(c) : d = be(new Rn(), c, e), t[u] = { primitive: c, promise: d }, r.push(d);
|
|
1372
1372
|
}
|
|
1373
1373
|
}
|
|
1374
1374
|
return Promise.all(r);
|
|
@@ -1380,10 +1380,10 @@ class En {
|
|
|
1380
1380
|
* @param {number} meshIndex
|
|
1381
1381
|
* @return {Promise<Group|Mesh|SkinnedMesh|Line|Points>}
|
|
1382
1382
|
*/
|
|
1383
|
-
loadMesh(
|
|
1384
|
-
const e = this, i = this.json,
|
|
1383
|
+
loadMesh(n) {
|
|
1384
|
+
const e = this, i = this.json, t = this.extensions, s = i.meshes[n], r = s.primitives, a = [];
|
|
1385
1385
|
for (let o = 0, c = r.length; o < c; o++) {
|
|
1386
|
-
const u = r[o].material === void 0 ?
|
|
1386
|
+
const u = r[o].material === void 0 ? pt(this.cache) : this.getDependency("material", r[o].material);
|
|
1387
1387
|
a.push(u);
|
|
1388
1388
|
}
|
|
1389
1389
|
return a.push(e.loadGeometries(r)), Promise.all(a).then(function(o) {
|
|
@@ -1393,28 +1393,28 @@ class En {
|
|
|
1393
1393
|
let g;
|
|
1394
1394
|
const E = c[h];
|
|
1395
1395
|
if (m.mode === C.TRIANGLES || m.mode === C.TRIANGLE_STRIP || m.mode === C.TRIANGLE_FAN || m.mode === void 0)
|
|
1396
|
-
g = s.isSkinnedMesh === !0 ? new
|
|
1396
|
+
g = s.isSkinnedMesh === !0 ? new En(x, E) : new Fe(x, E), g.isSkinnedMesh === !0 && g.normalizeSkinWeights(), m.mode === C.TRIANGLE_STRIP ? g.geometry = Le(g.geometry, Se) : m.mode === C.TRIANGLE_FAN && (g.geometry = Le(g.geometry, ce));
|
|
1397
1397
|
else if (m.mode === C.LINES)
|
|
1398
|
-
g = new
|
|
1398
|
+
g = new An(x, E);
|
|
1399
1399
|
else if (m.mode === C.LINE_STRIP)
|
|
1400
|
-
g = new
|
|
1400
|
+
g = new _n(x, E);
|
|
1401
1401
|
else if (m.mode === C.LINE_LOOP)
|
|
1402
|
-
g = new
|
|
1402
|
+
g = new Ln(x, E);
|
|
1403
1403
|
else if (m.mode === C.POINTS)
|
|
1404
|
-
g = new
|
|
1404
|
+
g = new Mn(x, E);
|
|
1405
1405
|
else
|
|
1406
1406
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + m.mode);
|
|
1407
|
-
Object.keys(g.geometry.morphAttributes).length > 0 &&
|
|
1407
|
+
Object.keys(g.geometry.morphAttributes).length > 0 && gt(g, s), g.name = e.createUniqueName(s.name || "mesh_" + n), k(g, s), m.extensions && U(t, g, m), e.assignFinalMaterial(g), l.push(g);
|
|
1408
1408
|
}
|
|
1409
1409
|
for (let h = 0, p = l.length; h < p; h++)
|
|
1410
1410
|
e.associations.set(l[h], {
|
|
1411
|
-
meshes:
|
|
1411
|
+
meshes: n,
|
|
1412
1412
|
primitives: h
|
|
1413
1413
|
});
|
|
1414
1414
|
if (l.length === 1)
|
|
1415
|
-
return s.extensions && U(
|
|
1415
|
+
return s.extensions && U(t, l[0], s), l[0];
|
|
1416
1416
|
const d = new re();
|
|
1417
|
-
s.extensions && U(
|
|
1417
|
+
s.extensions && U(t, d, s), e.associations.set(d, { meshes: n });
|
|
1418
1418
|
for (let h = 0, p = l.length; h < p; h++)
|
|
1419
1419
|
d.add(l[h]);
|
|
1420
1420
|
return d;
|
|
@@ -1427,14 +1427,14 @@ class En {
|
|
|
1427
1427
|
* @param {number} cameraIndex
|
|
1428
1428
|
* @return {Promise<THREE.Camera>}
|
|
1429
1429
|
*/
|
|
1430
|
-
loadCamera(
|
|
1430
|
+
loadCamera(n) {
|
|
1431
1431
|
let e;
|
|
1432
|
-
const i = this.json.cameras[
|
|
1433
|
-
if (!
|
|
1432
|
+
const i = this.json.cameras[n], t = i[i.type];
|
|
1433
|
+
if (!t) {
|
|
1434
1434
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
1435
1435
|
return;
|
|
1436
1436
|
}
|
|
1437
|
-
return i.type === "perspective" ? e = new
|
|
1437
|
+
return i.type === "perspective" ? e = new wn(yn.radToDeg(t.yfov), t.aspectRatio || 1, t.znear || 1, t.zfar || 2e6) : i.type === "orthographic" && (e = new bn(-t.xmag, t.xmag, t.ymag, -t.ymag, t.znear, t.zfar)), i.name && (e.name = this.createUniqueName(i.name)), k(e, i), Promise.resolve(e);
|
|
1438
1438
|
}
|
|
1439
1439
|
/**
|
|
1440
1440
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
@@ -1443,12 +1443,12 @@ class En {
|
|
|
1443
1443
|
* @param {number} skinIndex
|
|
1444
1444
|
* @return {Promise<Skeleton>}
|
|
1445
1445
|
*/
|
|
1446
|
-
loadSkin(
|
|
1447
|
-
const e = this.json.skins[
|
|
1448
|
-
for (let
|
|
1449
|
-
i.push(this._loadNodeShallow(e.joints[
|
|
1450
|
-
return e.inverseBindMatrices !== void 0 ? i.push(this.getDependency("accessor", e.inverseBindMatrices)) : i.push(null), Promise.all(i).then(function(
|
|
1451
|
-
const s =
|
|
1446
|
+
loadSkin(n) {
|
|
1447
|
+
const e = this.json.skins[n], i = [];
|
|
1448
|
+
for (let t = 0, s = e.joints.length; t < s; t++)
|
|
1449
|
+
i.push(this._loadNodeShallow(e.joints[t]));
|
|
1450
|
+
return e.inverseBindMatrices !== void 0 ? i.push(this.getDependency("accessor", e.inverseBindMatrices)) : i.push(null), Promise.all(i).then(function(t) {
|
|
1451
|
+
const s = t.pop(), r = t, a = [], o = [];
|
|
1452
1452
|
for (let c = 0, u = r.length; c < u; c++) {
|
|
1453
1453
|
const l = r[c];
|
|
1454
1454
|
if (l) {
|
|
@@ -1458,7 +1458,7 @@ class En {
|
|
|
1458
1458
|
} else
|
|
1459
1459
|
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', e.joints[c]);
|
|
1460
1460
|
}
|
|
1461
|
-
return new
|
|
1461
|
+
return new Sn(a, o);
|
|
1462
1462
|
});
|
|
1463
1463
|
}
|
|
1464
1464
|
/**
|
|
@@ -1468,10 +1468,10 @@ class En {
|
|
|
1468
1468
|
* @param {number} animationIndex
|
|
1469
1469
|
* @return {Promise<AnimationClip>}
|
|
1470
1470
|
*/
|
|
1471
|
-
loadAnimation(
|
|
1472
|
-
const e = this.json, i = this,
|
|
1473
|
-
for (let l = 0, d =
|
|
1474
|
-
const h =
|
|
1471
|
+
loadAnimation(n) {
|
|
1472
|
+
const e = this.json, i = this, t = e.animations[n], s = t.name ? t.name : "animation_" + n, r = [], a = [], o = [], c = [], u = [];
|
|
1473
|
+
for (let l = 0, d = t.channels.length; l < d; l++) {
|
|
1474
|
+
const h = t.channels[l], p = t.samplers[h.sampler], x = h.target, m = x.node, g = t.parameters !== void 0 ? t.parameters[p.input] : p.input, E = t.parameters !== void 0 ? t.parameters[p.output] : p.output;
|
|
1475
1475
|
x.node !== void 0 && (r.push(this.getDependency("node", m)), a.push(this.getDependency("accessor", g)), o.push(this.getDependency("accessor", E)), c.push(p), u.push(x));
|
|
1476
1476
|
}
|
|
1477
1477
|
return Promise.all([
|
|
@@ -1491,17 +1491,17 @@ class En {
|
|
|
1491
1491
|
for (let F = 0; F < w.length; F++)
|
|
1492
1492
|
g.push(w[F]);
|
|
1493
1493
|
}
|
|
1494
|
-
return new
|
|
1494
|
+
return new Nn(s, void 0, g);
|
|
1495
1495
|
});
|
|
1496
1496
|
}
|
|
1497
|
-
createNodeMesh(
|
|
1498
|
-
const e = this.json, i = this,
|
|
1499
|
-
return
|
|
1500
|
-
const r = i._getNodeRef(i.meshCache,
|
|
1501
|
-
return
|
|
1497
|
+
createNodeMesh(n) {
|
|
1498
|
+
const e = this.json, i = this, t = e.nodes[n];
|
|
1499
|
+
return t.mesh === void 0 ? null : i.getDependency("mesh", t.mesh).then(function(s) {
|
|
1500
|
+
const r = i._getNodeRef(i.meshCache, t.mesh, s);
|
|
1501
|
+
return t.weights !== void 0 && r.traverse(function(a) {
|
|
1502
1502
|
if (a.isMesh)
|
|
1503
|
-
for (let o = 0, c =
|
|
1504
|
-
a.morphTargetInfluences[o] =
|
|
1503
|
+
for (let o = 0, c = t.weights.length; o < c; o++)
|
|
1504
|
+
a.morphTargetInfluences[o] = t.weights[o];
|
|
1505
1505
|
}), r;
|
|
1506
1506
|
});
|
|
1507
1507
|
}
|
|
@@ -1512,11 +1512,11 @@ class En {
|
|
|
1512
1512
|
* @param {number} nodeIndex
|
|
1513
1513
|
* @return {Promise<Object3D>}
|
|
1514
1514
|
*/
|
|
1515
|
-
loadNode(
|
|
1516
|
-
const e = this.json, i = this,
|
|
1515
|
+
loadNode(n) {
|
|
1516
|
+
const e = this.json, i = this, t = e.nodes[n], s = i._loadNodeShallow(n), r = [], a = t.children || [];
|
|
1517
1517
|
for (let c = 0, u = a.length; c < u; c++)
|
|
1518
1518
|
r.push(i.getDependency("node", a[c]));
|
|
1519
|
-
const o =
|
|
1519
|
+
const o = t.skin === void 0 ? Promise.resolve(null) : i.getDependency("skin", t.skin);
|
|
1520
1520
|
return Promise.all([
|
|
1521
1521
|
s,
|
|
1522
1522
|
Promise.all(r),
|
|
@@ -1524,7 +1524,7 @@ class En {
|
|
|
1524
1524
|
]).then(function(c) {
|
|
1525
1525
|
const u = c[0], l = c[1], d = c[2];
|
|
1526
1526
|
d !== null && u.traverse(function(h) {
|
|
1527
|
-
h.isSkinnedMesh && h.bind(d,
|
|
1527
|
+
h.isSkinnedMesh && h.bind(d, Rt);
|
|
1528
1528
|
});
|
|
1529
1529
|
for (let h = 0, p = l.length; h < p; h++)
|
|
1530
1530
|
u.add(l[h]);
|
|
@@ -1533,22 +1533,22 @@ class En {
|
|
|
1533
1533
|
}
|
|
1534
1534
|
// ._loadNodeShallow() parses a single node.
|
|
1535
1535
|
// skin and child nodes are created and added in .loadNode() (no '_' prefix).
|
|
1536
|
-
_loadNodeShallow(
|
|
1537
|
-
const e = this.json, i = this.extensions,
|
|
1538
|
-
if (this.nodeCache[
|
|
1539
|
-
return this.nodeCache[
|
|
1540
|
-
const s = e.nodes[
|
|
1541
|
-
return c.createNodeMesh && c.createNodeMesh(
|
|
1536
|
+
_loadNodeShallow(n) {
|
|
1537
|
+
const e = this.json, i = this.extensions, t = this;
|
|
1538
|
+
if (this.nodeCache[n] !== void 0)
|
|
1539
|
+
return this.nodeCache[n];
|
|
1540
|
+
const s = e.nodes[n], r = s.name ? t.createUniqueName(s.name) : "", a = [], o = t._invokeOne(function(c) {
|
|
1541
|
+
return c.createNodeMesh && c.createNodeMesh(n);
|
|
1542
1542
|
});
|
|
1543
|
-
return o && a.push(o), s.camera !== void 0 && a.push(
|
|
1544
|
-
return
|
|
1545
|
-
})),
|
|
1546
|
-
return c.createNodeAttachment && c.createNodeAttachment(
|
|
1543
|
+
return o && a.push(o), s.camera !== void 0 && a.push(t.getDependency("camera", s.camera).then(function(c) {
|
|
1544
|
+
return t._getNodeRef(t.cameraCache, s.camera, c);
|
|
1545
|
+
})), t._invokeAll(function(c) {
|
|
1546
|
+
return c.createNodeAttachment && c.createNodeAttachment(n);
|
|
1547
1547
|
}).forEach(function(c) {
|
|
1548
1548
|
a.push(c);
|
|
1549
|
-
}), this.nodeCache[
|
|
1549
|
+
}), this.nodeCache[n] = Promise.all(a).then(function(c) {
|
|
1550
1550
|
let u;
|
|
1551
|
-
if (s.isBone === !0 ? u = new
|
|
1551
|
+
if (s.isBone === !0 ? u = new In() : c.length > 1 ? u = new re() : c.length === 1 ? u = c[0] : u = new Oe(), u !== c[0])
|
|
1552
1552
|
for (let l = 0, d = c.length; l < d; l++)
|
|
1553
1553
|
u.add(c[l]);
|
|
1554
1554
|
if (s.name && (u.userData.name = s.name, u.name = r), k(u, s), s.extensions && U(i, u, s), s.matrix !== void 0) {
|
|
@@ -1556,14 +1556,14 @@ class En {
|
|
|
1556
1556
|
l.fromArray(s.matrix), u.applyMatrix4(l);
|
|
1557
1557
|
} else
|
|
1558
1558
|
s.translation !== void 0 && u.position.fromArray(s.translation), s.rotation !== void 0 && u.quaternion.fromArray(s.rotation), s.scale !== void 0 && u.scale.fromArray(s.scale);
|
|
1559
|
-
if (!
|
|
1560
|
-
|
|
1561
|
-
else if (s.mesh !== void 0 &&
|
|
1562
|
-
const l =
|
|
1563
|
-
|
|
1559
|
+
if (!t.associations.has(u))
|
|
1560
|
+
t.associations.set(u, {});
|
|
1561
|
+
else if (s.mesh !== void 0 && t.meshCache.refs[s.mesh] > 1) {
|
|
1562
|
+
const l = t.associations.get(u);
|
|
1563
|
+
t.associations.set(u, { ...l });
|
|
1564
1564
|
}
|
|
1565
|
-
return
|
|
1566
|
-
}), this.nodeCache[
|
|
1565
|
+
return t.associations.get(u).nodes = n, u;
|
|
1566
|
+
}), this.nodeCache[n];
|
|
1567
1567
|
}
|
|
1568
1568
|
/**
|
|
1569
1569
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#scenes
|
|
@@ -1572,30 +1572,30 @@ class En {
|
|
|
1572
1572
|
* @param {number} sceneIndex
|
|
1573
1573
|
* @return {Promise<Group>}
|
|
1574
1574
|
*/
|
|
1575
|
-
loadScene(
|
|
1576
|
-
const e = this.extensions, i = this.json.scenes[
|
|
1577
|
-
i.name && (s.name =
|
|
1575
|
+
loadScene(n) {
|
|
1576
|
+
const e = this.extensions, i = this.json.scenes[n], t = this, s = new re();
|
|
1577
|
+
i.name && (s.name = t.createUniqueName(i.name)), k(s, i), i.extensions && U(e, s, i);
|
|
1578
1578
|
const r = i.nodes || [], a = [];
|
|
1579
1579
|
for (let o = 0, c = r.length; o < c; o++)
|
|
1580
|
-
a.push(
|
|
1580
|
+
a.push(t.getDependency("node", r[o]));
|
|
1581
1581
|
return Promise.all(a).then(function(o) {
|
|
1582
1582
|
for (let u = 0, l = o.length; u < l; u++)
|
|
1583
1583
|
s.add(o[u]);
|
|
1584
1584
|
const c = (u) => {
|
|
1585
1585
|
const l = /* @__PURE__ */ new Map();
|
|
1586
|
-
for (const [d, h] of
|
|
1586
|
+
for (const [d, h] of t.associations)
|
|
1587
1587
|
(d instanceof se || d instanceof Te) && l.set(d, h);
|
|
1588
1588
|
return u.traverse((d) => {
|
|
1589
|
-
const h =
|
|
1589
|
+
const h = t.associations.get(d);
|
|
1590
1590
|
h != null && l.set(d, h);
|
|
1591
1591
|
}), l;
|
|
1592
1592
|
};
|
|
1593
|
-
return
|
|
1593
|
+
return t.associations = c(s), s;
|
|
1594
1594
|
});
|
|
1595
1595
|
}
|
|
1596
|
-
_createAnimationTracks(
|
|
1597
|
-
const r = [], a =
|
|
1598
|
-
D[s.path] === D.weights ?
|
|
1596
|
+
_createAnimationTracks(n, e, i, t, s) {
|
|
1597
|
+
const r = [], a = n.name ? n.name : n.uuid, o = [];
|
|
1598
|
+
D[s.path] === D.weights ? n.traverse(function(d) {
|
|
1599
1599
|
d.morphTargetInfluences && o.push(d.name ? d.name : d.uuid);
|
|
1600
1600
|
}) : o.push(a);
|
|
1601
1601
|
let c;
|
|
@@ -1623,7 +1623,7 @@ class En {
|
|
|
1623
1623
|
}
|
|
1624
1624
|
break;
|
|
1625
1625
|
}
|
|
1626
|
-
const u =
|
|
1626
|
+
const u = t.interpolation !== void 0 ? ht[t.interpolation] : De, l = this._getArrayFromAccessor(i);
|
|
1627
1627
|
for (let d = 0, h = o.length; d < h; d++) {
|
|
1628
1628
|
const p = new c(
|
|
1629
1629
|
o[d] + "." + D[s.path],
|
|
@@ -1631,38 +1631,38 @@ class En {
|
|
|
1631
1631
|
l,
|
|
1632
1632
|
u
|
|
1633
1633
|
);
|
|
1634
|
-
|
|
1634
|
+
t.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(p), r.push(p);
|
|
1635
1635
|
}
|
|
1636
1636
|
return r;
|
|
1637
1637
|
}
|
|
1638
|
-
_getArrayFromAccessor(
|
|
1639
|
-
let e =
|
|
1640
|
-
if (
|
|
1641
|
-
const i = de(e.constructor),
|
|
1638
|
+
_getArrayFromAccessor(n) {
|
|
1639
|
+
let e = n.array;
|
|
1640
|
+
if (n.normalized) {
|
|
1641
|
+
const i = de(e.constructor), t = new Float32Array(e.length);
|
|
1642
1642
|
for (let s = 0, r = e.length; s < r; s++)
|
|
1643
|
-
|
|
1644
|
-
e =
|
|
1643
|
+
t[s] = e[s] * i;
|
|
1644
|
+
e = t;
|
|
1645
1645
|
}
|
|
1646
1646
|
return e;
|
|
1647
1647
|
}
|
|
1648
|
-
_createCubicSplineTrackInterpolant(
|
|
1649
|
-
|
|
1650
|
-
const
|
|
1651
|
-
return new
|
|
1652
|
-
},
|
|
1648
|
+
_createCubicSplineTrackInterpolant(n) {
|
|
1649
|
+
n.createInterpolant = function(i) {
|
|
1650
|
+
const t = this instanceof Ee ? dt : Ge;
|
|
1651
|
+
return new t(this.times, this.values, this.getValueSize() / 3, i);
|
|
1652
|
+
}, n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
|
|
1653
1653
|
}
|
|
1654
1654
|
}
|
|
1655
|
-
function
|
|
1656
|
-
const i =
|
|
1655
|
+
function At(f, n, e) {
|
|
1656
|
+
const i = n.attributes, t = new He();
|
|
1657
1657
|
if (i.POSITION !== void 0) {
|
|
1658
1658
|
const a = e.json.accessors[i.POSITION], o = a.min, c = a.max;
|
|
1659
1659
|
if (o !== void 0 && c !== void 0) {
|
|
1660
|
-
if (
|
|
1660
|
+
if (t.set(
|
|
1661
1661
|
new B(o[0], o[1], o[2]),
|
|
1662
1662
|
new B(c[0], c[1], c[2])
|
|
1663
1663
|
), a.normalized) {
|
|
1664
1664
|
const u = de(V[a.componentType]);
|
|
1665
|
-
|
|
1665
|
+
t.min.multiplyScalar(u), t.max.multiplyScalar(u);
|
|
1666
1666
|
}
|
|
1667
1667
|
} else {
|
|
1668
1668
|
console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
|
|
@@ -1670,7 +1670,7 @@ function An(f, t, e) {
|
|
|
1670
1670
|
}
|
|
1671
1671
|
} else
|
|
1672
1672
|
return;
|
|
1673
|
-
const s =
|
|
1673
|
+
const s = n.targets;
|
|
1674
1674
|
if (s !== void 0) {
|
|
1675
1675
|
const a = new B(), o = new B();
|
|
1676
1676
|
for (let c = 0, u = s.length; c < u; c++) {
|
|
@@ -1687,14 +1687,14 @@ function An(f, t, e) {
|
|
|
1687
1687
|
console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
|
|
1688
1688
|
}
|
|
1689
1689
|
}
|
|
1690
|
-
|
|
1690
|
+
t.expandByVector(a);
|
|
1691
1691
|
}
|
|
1692
|
-
f.boundingBox =
|
|
1693
|
-
const r = new
|
|
1694
|
-
|
|
1692
|
+
f.boundingBox = t;
|
|
1693
|
+
const r = new Pn();
|
|
1694
|
+
t.getCenter(r.center), r.radius = t.min.distanceTo(t.max) / 2, f.boundingSphere = r;
|
|
1695
1695
|
}
|
|
1696
|
-
function be(f,
|
|
1697
|
-
const i =
|
|
1696
|
+
function be(f, n, e) {
|
|
1697
|
+
const i = n.attributes, t = [];
|
|
1698
1698
|
function s(r, a) {
|
|
1699
1699
|
return e.getDependency("accessor", r).then(function(o) {
|
|
1700
1700
|
f.setAttribute(a, o);
|
|
@@ -1702,23 +1702,23 @@ function be(f, t, e) {
|
|
|
1702
1702
|
}
|
|
1703
1703
|
for (const r in i) {
|
|
1704
1704
|
const a = fe[r] || r.toLowerCase();
|
|
1705
|
-
a in f.attributes ||
|
|
1705
|
+
a in f.attributes || t.push(s(i[r], a));
|
|
1706
1706
|
}
|
|
1707
|
-
if (
|
|
1708
|
-
const r = e.getDependency("accessor",
|
|
1707
|
+
if (n.indices !== void 0 && !f.index) {
|
|
1708
|
+
const r = e.getDependency("accessor", n.indices).then(function(a) {
|
|
1709
1709
|
f.setIndex(a);
|
|
1710
1710
|
});
|
|
1711
|
-
|
|
1711
|
+
t.push(r);
|
|
1712
1712
|
}
|
|
1713
|
-
return Ae.workingColorSpace !== P && "COLOR_0" in i && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Ae.workingColorSpace}" not supported.`), k(f,
|
|
1714
|
-
return
|
|
1713
|
+
return Ae.workingColorSpace !== P && "COLOR_0" in i && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Ae.workingColorSpace}" not supported.`), k(f, n), At(f, n, e), Promise.all(t).then(function() {
|
|
1714
|
+
return n.targets !== void 0 ? mt(f, n.targets, e) : f;
|
|
1715
1715
|
});
|
|
1716
1716
|
}
|
|
1717
|
-
function
|
|
1718
|
-
const f = K(!1),
|
|
1717
|
+
function _t() {
|
|
1718
|
+
const f = K(!1), n = K(""), e = Be([]), i = K(null), t = new Dn(), s = new Hn(), r = new Un(), a = new jn();
|
|
1719
1719
|
return {
|
|
1720
1720
|
isLoading: f,
|
|
1721
|
-
loadingProgress:
|
|
1721
|
+
loadingProgress: n,
|
|
1722
1722
|
loadedModels: e,
|
|
1723
1723
|
error: i,
|
|
1724
1724
|
loadModelsFromBlobs: async (c) => {
|
|
@@ -1727,7 +1727,7 @@ function _n() {
|
|
|
1727
1727
|
console.warn("loadModelsFromBlobs 加载的文件数组为空!");
|
|
1728
1728
|
return;
|
|
1729
1729
|
}
|
|
1730
|
-
f.value = !0,
|
|
1730
|
+
f.value = !0, n.value = "准备加载...", e.value = [], i.value = null;
|
|
1731
1731
|
const u = /* @__PURE__ */ new Map();
|
|
1732
1732
|
c.forEach((p) => {
|
|
1733
1733
|
p instanceof File && u.set(p.name.toLowerCase(), p);
|
|
@@ -1742,22 +1742,22 @@ function _n() {
|
|
|
1742
1742
|
let E = null;
|
|
1743
1743
|
const M = (T) => {
|
|
1744
1744
|
const N = T.lengthComputable ? T.loaded / T.total * 100 : 0;
|
|
1745
|
-
|
|
1745
|
+
n.value = `正在加载 ${x}... ${Math.round(N)}%`;
|
|
1746
1746
|
};
|
|
1747
|
-
switch (
|
|
1747
|
+
switch (n.value = `正在加载 ${x}... 0%`, m) {
|
|
1748
1748
|
case "obj":
|
|
1749
1749
|
const T = x.replace(/\.obj$/i, ".mtl").toLowerCase();
|
|
1750
1750
|
if (u.has(T)) {
|
|
1751
1751
|
const v = u.get(T), w = URL.createObjectURL(v);
|
|
1752
1752
|
l.push(w);
|
|
1753
|
-
const F = await
|
|
1753
|
+
const F = await t.loadAsync(w);
|
|
1754
1754
|
F.preload(), s.setMaterials(F);
|
|
1755
1755
|
} else
|
|
1756
1756
|
s.setMaterials(null);
|
|
1757
1757
|
E = await s.loadAsync(g, M);
|
|
1758
1758
|
break;
|
|
1759
1759
|
case "stl":
|
|
1760
|
-
const N = await r.loadAsync(g, M), I = new
|
|
1760
|
+
const N = await r.loadAsync(g, M), I = new Fn({ color: 11184810, specular: 1118481, shininess: 200 });
|
|
1761
1761
|
E = new Fe(N, I);
|
|
1762
1762
|
break;
|
|
1763
1763
|
case "gltf":
|
|
@@ -1765,33 +1765,33 @@ function _n() {
|
|
|
1765
1765
|
E = (await a.loadAsync(g, M)).scene;
|
|
1766
1766
|
break;
|
|
1767
1767
|
default:
|
|
1768
|
-
console.warn(`不支持的文件类型: .${m}`),
|
|
1768
|
+
console.warn(`不支持的文件类型: .${m}`), n.value = `不支持的文件类型: ${x}`;
|
|
1769
1769
|
continue;
|
|
1770
1770
|
}
|
|
1771
1771
|
E && (E.userData.boundingBox = new He().setFromObject(E), d.push(E));
|
|
1772
1772
|
}
|
|
1773
|
-
e.value = d,
|
|
1773
|
+
e.value = d, n.value = "加载完成!";
|
|
1774
1774
|
} catch (p) {
|
|
1775
|
-
throw console.error("加载模型时出错:", p), i.value = `加载失败: ${p.message || "未知错误"}`,
|
|
1775
|
+
throw console.error("加载模型时出错:", p), i.value = `加载失败: ${p.message || "未知错误"}`, n.value = "加载失败!", e.value = [], p;
|
|
1776
1776
|
} finally {
|
|
1777
1777
|
f.value = !1, l.forEach((p) => URL.revokeObjectURL(p));
|
|
1778
1778
|
}
|
|
1779
1779
|
}
|
|
1780
1780
|
};
|
|
1781
1781
|
}
|
|
1782
|
-
const
|
|
1782
|
+
const Lt = { class: "obj-viewer-container" }, Mt = { class: "buttonGroup-topLeft" }, wt = { class: "buttonGroup-left" }, yt = { class: "buttonGroup-right" }, bt = { class: "left-panel" }, St = { class: "panel-header" }, Nt = {
|
|
1783
1783
|
key: 0,
|
|
1784
1784
|
class: "clipping-content"
|
|
1785
|
-
},
|
|
1785
|
+
}, It = { class: "radio-group" }, Ct = { class: "radio-label" }, Ot = { class: "radio-label" }, vt = { class: "radio-label" }, kt = { class: "radio-label" }, Pt = {
|
|
1786
1786
|
key: 0,
|
|
1787
1787
|
class: "loading-overlay"
|
|
1788
|
-
},
|
|
1788
|
+
}, Ft = /* @__PURE__ */ Ke({
|
|
1789
1789
|
__name: "threePreview",
|
|
1790
1790
|
props: {
|
|
1791
1791
|
fileBlobs: { default: () => [] }
|
|
1792
1792
|
},
|
|
1793
1793
|
setup(f) {
|
|
1794
|
-
const
|
|
1794
|
+
const n = f, e = K(null), i = K(!1), t = K(""), {
|
|
1795
1795
|
currentModels: s,
|
|
1796
1796
|
resetView: r,
|
|
1797
1797
|
initThreeJS: a,
|
|
@@ -1807,13 +1807,13 @@ const Ln = { class: "obj-viewer-container" }, Mn = { class: "buttonGroup-topLeft
|
|
|
1807
1807
|
loadedModels: m,
|
|
1808
1808
|
error: g,
|
|
1809
1809
|
loadModelsFromBlobs: E
|
|
1810
|
-
} =
|
|
1810
|
+
} = _t(), { isAnimating: M, toggleAnimation: T, stopAnimation: N } = Je(c, s), { isClipping: I, activeClippingAxis: _, toggleClipping: v, updateClippingPlanes: w } = Qe(
|
|
1811
1811
|
c,
|
|
1812
1812
|
s
|
|
1813
1813
|
), F = () => {
|
|
1814
1814
|
h();
|
|
1815
1815
|
};
|
|
1816
|
-
Z(() =>
|
|
1816
|
+
Z(() => n.fileBlobs, (y) => {
|
|
1817
1817
|
y && y.length > 0 && E(y).catch((A) => {
|
|
1818
1818
|
console.error("加载错误:", A);
|
|
1819
1819
|
});
|
|
@@ -1826,7 +1826,7 @@ const Ln = { class: "obj-viewer-container" }, Mn = { class: "buttonGroup-topLeft
|
|
|
1826
1826
|
y && _e.error(`模型加载失败: ${y}`);
|
|
1827
1827
|
});
|
|
1828
1828
|
const he = (y) => {
|
|
1829
|
-
i.value = !0,
|
|
1829
|
+
i.value = !0, t.value = y, y === "剖面视图" && !I.value && v();
|
|
1830
1830
|
};
|
|
1831
1831
|
return Ve(async () => {
|
|
1832
1832
|
await ze();
|
|
@@ -1836,17 +1836,16 @@ const Ln = { class: "obj-viewer-container" }, Mn = { class: "buttonGroup-topLeft
|
|
|
1836
1836
|
console.error("Three.js 初始化失败:", y), _e.error("渲染引擎初始化失败!");
|
|
1837
1837
|
}
|
|
1838
1838
|
}), Xe(() => {
|
|
1839
|
-
|
|
1839
|
+
t.value = "", window.removeEventListener("resize", o), M.value && N(), u();
|
|
1840
1840
|
}), (y, A) => {
|
|
1841
1841
|
const je = qe("el-scrollbar");
|
|
1842
|
-
return
|
|
1842
|
+
return ne(), ee("div", Lt, [
|
|
1843
1843
|
L("div", {
|
|
1844
1844
|
ref_key: "threejsContainer",
|
|
1845
1845
|
ref: e,
|
|
1846
1846
|
class: "threejs-container"
|
|
1847
1847
|
}, null, 512),
|
|
1848
|
-
|
|
1849
|
-
L("div", Mn, [
|
|
1848
|
+
L("div", Mt, [
|
|
1850
1849
|
H(j, {
|
|
1851
1850
|
name: "viewReset",
|
|
1852
1851
|
size: "24",
|
|
@@ -1877,23 +1876,23 @@ const Ln = { class: "obj-viewer-container" }, Mn = { class: "buttonGroup-topLeft
|
|
|
1877
1876
|
title: "显隐坐标轴"
|
|
1878
1877
|
}, null, 8, ["active"])
|
|
1879
1878
|
]),
|
|
1880
|
-
L("div",
|
|
1879
|
+
L("div", wt, [
|
|
1881
1880
|
me(y.$slots, "button-left", { switchRightPanel: he }, void 0, !0),
|
|
1882
1881
|
H(j, {
|
|
1883
1882
|
name: "clipping",
|
|
1884
1883
|
size: "24",
|
|
1885
1884
|
onClick: A[0] || (A[0] = (S) => he("剖面视图")),
|
|
1886
|
-
active: i.value &&
|
|
1885
|
+
active: i.value && t.value === "剖面视图",
|
|
1887
1886
|
title: "剖面视图"
|
|
1888
1887
|
}, null, 8, ["active"])
|
|
1889
1888
|
]),
|
|
1890
|
-
L("div",
|
|
1889
|
+
L("div", yt, [
|
|
1891
1890
|
me(y.$slots, "button-right", {}, void 0, !0)
|
|
1892
1891
|
]),
|
|
1893
|
-
A[
|
|
1894
|
-
z(L("div",
|
|
1895
|
-
L("div",
|
|
1896
|
-
L("span", null, ge(
|
|
1892
|
+
A[15] || (A[15] = L("div", { class: "buttonGroup-bottom" }, null, -1)),
|
|
1893
|
+
z(L("div", bt, [
|
|
1894
|
+
L("div", St, [
|
|
1895
|
+
L("span", null, ge(t.value), 1),
|
|
1897
1896
|
L("span", {
|
|
1898
1897
|
class: "close",
|
|
1899
1898
|
onClick: A[1] || (A[1] = (S) => i.value = !1)
|
|
@@ -1901,9 +1900,9 @@ const Ln = { class: "obj-viewer-container" }, Mn = { class: "buttonGroup-topLeft
|
|
|
1901
1900
|
]),
|
|
1902
1901
|
H(je, { "max-height": "650px" }, {
|
|
1903
1902
|
default: We(() => [
|
|
1904
|
-
|
|
1905
|
-
L("div",
|
|
1906
|
-
L("label",
|
|
1903
|
+
t.value === "剖面视图" ? (ne(), ee("div", Nt, [
|
|
1904
|
+
L("div", It, [
|
|
1905
|
+
L("label", Ct, [
|
|
1907
1906
|
z(L("input", {
|
|
1908
1907
|
type: "radio",
|
|
1909
1908
|
name: "clipping-axis",
|
|
@@ -1916,7 +1915,7 @@ const Ln = { class: "obj-viewer-container" }, Mn = { class: "buttonGroup-topLeft
|
|
|
1916
1915
|
]),
|
|
1917
1916
|
A[10] || (A[10] = L("span", { class: "radio-text" }, "无切割", -1))
|
|
1918
1917
|
]),
|
|
1919
|
-
L("label",
|
|
1918
|
+
L("label", Ot, [
|
|
1920
1919
|
z(L("input", {
|
|
1921
1920
|
type: "radio",
|
|
1922
1921
|
name: "clipping-axis",
|
|
@@ -1929,7 +1928,7 @@ const Ln = { class: "obj-viewer-container" }, Mn = { class: "buttonGroup-topLeft
|
|
|
1929
1928
|
]),
|
|
1930
1929
|
A[11] || (A[11] = L("span", { class: "radio-text" }, "X轴切割", -1))
|
|
1931
1930
|
]),
|
|
1932
|
-
L("label",
|
|
1931
|
+
L("label", vt, [
|
|
1933
1932
|
z(L("input", {
|
|
1934
1933
|
type: "radio",
|
|
1935
1934
|
name: "clipping-axis",
|
|
@@ -1942,7 +1941,7 @@ const Ln = { class: "obj-viewer-container" }, Mn = { class: "buttonGroup-topLeft
|
|
|
1942
1941
|
]),
|
|
1943
1942
|
A[12] || (A[12] = L("span", { class: "radio-text" }, "Y轴切割", -1))
|
|
1944
1943
|
]),
|
|
1945
|
-
L("label",
|
|
1944
|
+
L("label", kt, [
|
|
1946
1945
|
z(L("input", {
|
|
1947
1946
|
type: "radio",
|
|
1948
1947
|
name: "clipping-axis",
|
|
@@ -1963,14 +1962,14 @@ const Ln = { class: "obj-viewer-container" }, Mn = { class: "buttonGroup-topLeft
|
|
|
1963
1962
|
], 512), [
|
|
1964
1963
|
[Ye, i.value]
|
|
1965
1964
|
]),
|
|
1966
|
-
b(p) ? (
|
|
1965
|
+
b(p) ? (ne(), ee("div", Pt, [
|
|
1967
1966
|
A[14] || (A[14] = L("div", { class: "loading-spinner" }, null, -1)),
|
|
1968
1967
|
L("p", null, ge(b(x)), 1)
|
|
1969
1968
|
])) : pe("", !0)
|
|
1970
1969
|
]);
|
|
1971
1970
|
};
|
|
1972
1971
|
}
|
|
1973
|
-
}),
|
|
1972
|
+
}), Vt = /* @__PURE__ */ Gn(Ft, [["__scopeId", "data-v-e13f8e74"]]);
|
|
1974
1973
|
export {
|
|
1975
|
-
|
|
1974
|
+
Vt as default
|
|
1976
1975
|
};
|