ss-component-new 1.3.641 → 1.3.643
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/JSEncrypt-B36c1iN5.js +1983 -0
- package/dist/{MTLLoader-CZqN7Zrs.js → MTLLoader-CzUQTGKY.js} +2 -2
- package/dist/{URDFLoader-5yxKptss.js → URDFLoader-Cpc_aT68.js} +584 -589
- package/dist/{animationData-_pwKquvD.js → animationData-BgDqzRLe.js} +3 -3
- package/dist/{array-CHe-DoyQ.js → array-x70XTJSv.js} +14 -13
- package/dist/{clone-BjJ_R9XN.js → clone-DqQwDoSV.js} +1 -1
- package/dist/{eleIcon-BWVKfp5t.js → eleIcon-Dtsx377t.js} +2 -2
- package/dist/{iconfont-DGtoabuW.js → iconfont-B4WPRBLy.js} +91 -91
- package/dist/{index-DJrzqi4-.js → index-11kpzK0A.js} +17 -17
- package/dist/{index-BEuZVqx1.js → index-B0w8-AEa.js} +9164 -9616
- package/dist/{index-BibSA99e.js → index-B2i-wZ7I.js} +20 -17
- package/dist/{index-BSIx33n6.js → index-B9g43cVc.js} +62 -60
- package/dist/index-BDfs7pV0.js +11397 -0
- package/dist/{index-dD-mKgue.js → index-BHtNKL1L.js} +2 -2
- package/dist/{index-Bvvz41NY.js → index-BI3gwdBk.js} +1 -1
- package/dist/{index-DwmZbmjQ.js → index-BjSS0ovo.js} +80 -74
- package/dist/{index-qv_1lhhv.js → index-BkAYMm70.js} +2 -2
- package/dist/{index-FPf0BzIG.js → index-C4OLi6tq.js} +551 -554
- package/dist/{index-CmGpt__g.js → index-CB2B4YM9.js} +3 -3
- package/dist/{index-D_kI6aHR.js → index-CDpLX430.js} +8 -7
- package/dist/{index-CmrtXrCW.js → index-CMXhAlkY.js} +8 -8
- package/dist/{index-DV-y9RNF.js → index-C_c-5ZAh.js} +61 -57
- package/dist/index-Cb5fCewf.js +572 -0
- package/dist/{index-CcdSuqPt.js → index-Cnet9-km.js} +8 -8
- package/dist/{index-BYTAx6bL.js → index-Czz3dB6u.js} +5 -5
- package/dist/{index-CUB0YIQp.js → index-D8cOzz3g.js} +5 -5
- package/dist/{index-DW6CZC2b.js → index-DGmjWChr.js} +1051 -1053
- package/dist/{index-CwKQTNJ6.js → index-DLZVUgaP.js} +2 -2
- package/dist/{index-DW2-bo7z.js → index-DNl2K8-4.js} +176 -167
- package/dist/{index-CIFdtwKG.js → index-DaOXFFsu.js} +20 -18
- package/dist/{index-CT3n6jZB.js → index-DllVa0Ze.js} +6 -6
- package/dist/{index-DlH7-Quf.js → index-DpcGBPYo.js} +3 -3
- package/dist/{index-Dae7KcRH.js → index-DzZWEErj.js} +3 -3
- package/dist/{index-C6ZyziE9.js → index-FCnO8UeA.js} +4 -4
- package/dist/{index-BcWf6LmN.js → index-IXxKIj3h.js} +4 -4
- package/dist/{index-B6zWduiC.js → index-LED1qeo2.js} +3 -3
- package/dist/{index-BwEO2Ckl.js → index-NwTP3AQl.js} +7 -7
- package/dist/{index-rVTDSJ7d.js → index-_fheIMoz.js} +22950 -23035
- package/dist/{index-CUUkM-MP.js → index-awI81WIz.js} +47 -43
- package/dist/{index-JxFaaWxD.js → index-fxJSVddL.js} +1 -1
- package/dist/{index-BFqUz4pN.js → index-rlStojTL.js} +1 -1
- package/dist/{index-YVR3acYT.js → index-tLd2cEHX.js} +1 -1
- package/dist/{index-DIimK4we.js → index-yJckrmsT.js} +4 -4
- package/dist/{index.vue_vue_type_script_setup_true_lang-DwbHXtUp.js → index.vue_vue_type_script_setup_true_lang-DRzriV-s.js} +2 -2
- package/dist/{index.vue_vue_type_style_index_0_scoped_39e1db95_lang-DdTK-nti.js → index.vue_vue_type_style_index_0_scoped_39e1db95_lang-BEPFL4uU.js} +27735 -27760
- package/dist/isString-CXX7MUiv.js +8 -0
- package/dist/{localIcon-CoJHw5ss.js → localIcon-D5UoFBU5.js} +1 -1
- package/dist/{main-B7yRqx5R.js → main-nJu2K4N-.js} +9 -9
- package/dist/{menuIndex-CY5XD7Ny.js → menuIndex-2JX7SuB8.js} +1 -1
- package/dist/obj/model.mtl +42 -0
- package/dist/obj/model.obj +26110 -0
- package/dist/{request-DiogHwkN.js → request-D-LN5bvn.js} +3075 -3494
- package/dist/ss-component.css +3 -3
- package/dist/ss-component.js +14 -14
- package/dist/ss-component2.js +13 -13
- package/dist/ss-component3.js +1 -1
- package/dist/{threeModel-D2NPH9rB.js → threeModel-BbNw-rXE.js} +174 -174
- package/dist/{threePreview-BC0mxp0t.js → threePreview-Cjupz9HK.js} +12 -12
- package/dist/{threeSceneView-CYA_dl9b.js → threeSceneView-4bCcg3w6.js} +111 -110
- package/dist/{threeSceneViewForCPMPIP-BeAfVkav.js → threeSceneViewForCPMPIP-D6nwYUWT.js} +17 -16
- package/dist/{threeTrackPathView-C8RcSYdk.js → threeTrackPathView-DuiNPnon.js} +7 -7
- package/dist/{threeViewerHost-EI6zUnYp.js → threeViewerHost-CsGXf4BF.js} +4 -4
- package/dist/{urdfTree-BGPikD3W.js → urdfTree-CymLIkE8.js} +9 -9
- package/dist/{workpieceTreePanel-DO6BojnM.js → workpieceTreePanel-DaTdJC9q.js} +60 -56
- package/package.json +1 -1
- package/public/obj/model.mtl +42 -0
- package/public/obj/model.obj +26110 -0
- package/dist/index-D23qc_Ne.js +0 -2623
- package/dist/index-DT8oA7Bc.js +0 -11550
- package/dist/isString-CoCw_sp3.js +0 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as Ln } from "./MTLLoader-
|
|
2
|
-
import { b7 as vn, az as Rn, R as lt, an as At, U as In, V as pe, n as he, aJ as dt, S as Mn, aw as Tt, C as ut,
|
|
1
|
+
import { S as Ln } from "./MTLLoader-CzUQTGKY.js";
|
|
2
|
+
import { b7 as vn, az as Rn, R as lt, an as At, U as In, V as pe, n as he, aJ as dt, S as Mn, aw as Tt, C as ut, o as Le, aQ as ft, b8 as Sn, k as ve, aZ as Se, c as me, ap as On, l as Gn, a4 as Pn, P as ht, aO as qn, i as jn, ar as Fn, j as Un, D as Hn, s as pt, at as Et, aW as mt, aY as Bn, u as zn, Y as ye, aR as Dn, a2 as bt, aL as Vn, h as Ce, w as Jn, aM as Wn, aP as Kn, aF as Oe, aH as gt, b9 as Yn, ba as Xn, bb as yt, bc as $n, bd as Zn, be as Qn, bf as ei, a0 as ti, bg as ni, bh as ii, E as si } from "./index.vue_vue_type_style_index_0_scoped_39e1db95_lang-BEPFL4uU.js";
|
|
3
3
|
class wt extends vn {
|
|
4
4
|
/**
|
|
5
5
|
* Constructs a new TGA loader.
|
|
@@ -16,206 +16,206 @@ class wt extends vn {
|
|
|
16
16
|
* @return {DataTextureLoader~TexData} An object representing the parsed texture data.
|
|
17
17
|
*/
|
|
18
18
|
parse(O) {
|
|
19
|
-
function Q(
|
|
20
|
-
switch (
|
|
19
|
+
function Q(u) {
|
|
20
|
+
switch (u.image_type) {
|
|
21
21
|
// check indexed type
|
|
22
|
-
case
|
|
22
|
+
case Ne:
|
|
23
23
|
case ee:
|
|
24
|
-
if (
|
|
24
|
+
if (u.colormap_length > 256 || u.colormap_size !== 24 || u.colormap_type !== 1)
|
|
25
25
|
throw new Error("THREE.TGALoader: Invalid type colormap data for indexed type.");
|
|
26
26
|
break;
|
|
27
27
|
// check colormap type
|
|
28
28
|
case $:
|
|
29
29
|
case ie:
|
|
30
30
|
case be:
|
|
31
|
-
case
|
|
32
|
-
if (
|
|
31
|
+
case ge:
|
|
32
|
+
if (u.colormap_type)
|
|
33
33
|
throw new Error("THREE.TGALoader: Invalid type colormap data for colormap type.");
|
|
34
34
|
break;
|
|
35
35
|
// What the need of a file without data ?
|
|
36
|
-
case
|
|
36
|
+
case ke:
|
|
37
37
|
throw new Error("THREE.TGALoader: No data.");
|
|
38
38
|
// Invalid type ?
|
|
39
39
|
default:
|
|
40
|
-
throw new Error("THREE.TGALoader: Invalid type " +
|
|
40
|
+
throw new Error("THREE.TGALoader: Invalid type " + u.image_type);
|
|
41
41
|
}
|
|
42
|
-
if (
|
|
42
|
+
if (u.width <= 0 || u.height <= 0)
|
|
43
43
|
throw new Error("THREE.TGALoader: Invalid image size.");
|
|
44
|
-
if (
|
|
45
|
-
throw new Error("THREE.TGALoader: Invalid pixel size " +
|
|
46
|
-
}
|
|
47
|
-
function R(
|
|
48
|
-
let
|
|
49
|
-
const
|
|
50
|
-
if (K && (
|
|
51
|
-
|
|
52
|
-
let
|
|
53
|
-
const le = new Uint8Array(
|
|
54
|
-
for (;
|
|
55
|
-
if (
|
|
56
|
-
for (
|
|
57
|
-
le[
|
|
58
|
-
for (
|
|
59
|
-
|
|
60
|
-
|
|
44
|
+
if (u.pixel_size !== 8 && u.pixel_size !== 16 && u.pixel_size !== 24 && u.pixel_size !== 32)
|
|
45
|
+
throw new Error("THREE.TGALoader: Invalid pixel size " + u.pixel_size);
|
|
46
|
+
}
|
|
47
|
+
function R(u, K, D, B, X) {
|
|
48
|
+
let F, z;
|
|
49
|
+
const _ = D.pixel_size >> 3, x = D.width * D.height * _;
|
|
50
|
+
if (K && (z = X.subarray(B, B += D.colormap_length * (D.colormap_size >> 3))), u) {
|
|
51
|
+
F = new Uint8Array(x);
|
|
52
|
+
let N, f, A, V = 0;
|
|
53
|
+
const le = new Uint8Array(_);
|
|
54
|
+
for (; V < x; )
|
|
55
|
+
if (N = X[B++], f = (N & 127) + 1, N & 128) {
|
|
56
|
+
for (A = 0; A < _; ++A)
|
|
57
|
+
le[A] = X[B++];
|
|
58
|
+
for (A = 0; A < f; ++A)
|
|
59
|
+
F.set(le, V + A * _);
|
|
60
|
+
V += _ * f;
|
|
61
61
|
} else {
|
|
62
|
-
for (
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
for (f *= _, A = 0; A < f; ++A)
|
|
63
|
+
F[V + A] = X[B++];
|
|
64
|
+
V += f;
|
|
65
65
|
}
|
|
66
66
|
} else
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
F = X.subarray(
|
|
68
|
+
B,
|
|
69
|
+
B += K ? D.width * D.height : x
|
|
70
70
|
);
|
|
71
71
|
return {
|
|
72
|
-
pixel_data:
|
|
73
|
-
palettes:
|
|
72
|
+
pixel_data: F,
|
|
73
|
+
palettes: z
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
-
function se(
|
|
77
|
-
const
|
|
78
|
-
let
|
|
79
|
-
const
|
|
80
|
-
for (le = K; le !==
|
|
81
|
-
for (
|
|
82
|
-
|
|
83
|
-
return
|
|
84
|
-
}
|
|
85
|
-
function
|
|
86
|
-
let
|
|
87
|
-
const
|
|
88
|
-
for (
|
|
89
|
-
for (
|
|
90
|
-
|
|
91
|
-
return
|
|
92
|
-
}
|
|
93
|
-
function oe(
|
|
94
|
-
let
|
|
95
|
-
const
|
|
96
|
-
for (
|
|
97
|
-
for (
|
|
98
|
-
|
|
99
|
-
return
|
|
100
|
-
}
|
|
101
|
-
function I(
|
|
102
|
-
let
|
|
103
|
-
const
|
|
104
|
-
for (
|
|
105
|
-
for (
|
|
106
|
-
|
|
107
|
-
return
|
|
108
|
-
}
|
|
109
|
-
function Y(
|
|
110
|
-
let
|
|
111
|
-
const
|
|
112
|
-
for (
|
|
113
|
-
for (
|
|
114
|
-
|
|
115
|
-
return
|
|
116
|
-
}
|
|
117
|
-
function ne(
|
|
118
|
-
let
|
|
119
|
-
const
|
|
120
|
-
for (
|
|
121
|
-
for (
|
|
122
|
-
|
|
123
|
-
return
|
|
124
|
-
}
|
|
125
|
-
function
|
|
126
|
-
let
|
|
127
|
-
switch ((
|
|
76
|
+
function se(u, K, D, B, X, F, z, _, x) {
|
|
77
|
+
const N = x;
|
|
78
|
+
let f, A = 0, V, le;
|
|
79
|
+
const Ae = C.width;
|
|
80
|
+
for (le = K; le !== B; le += D)
|
|
81
|
+
for (V = X; V !== z; V += F, A++)
|
|
82
|
+
f = _[A], u[(V + Ae * le) * 4 + 3] = 255, u[(V + Ae * le) * 4 + 2] = N[f * 3 + 0], u[(V + Ae * le) * 4 + 1] = N[f * 3 + 1], u[(V + Ae * le) * 4 + 0] = N[f * 3 + 2];
|
|
83
|
+
return u;
|
|
84
|
+
}
|
|
85
|
+
function v(u, K, D, B, X, F, z, _) {
|
|
86
|
+
let x, N = 0, f, A;
|
|
87
|
+
const V = C.width;
|
|
88
|
+
for (A = K; A !== B; A += D)
|
|
89
|
+
for (f = X; f !== z; f += F, N += 2)
|
|
90
|
+
x = _[N + 0] + (_[N + 1] << 8), u[(f + V * A) * 4 + 0] = (x & 31744) >> 7, u[(f + V * A) * 4 + 1] = (x & 992) >> 2, u[(f + V * A) * 4 + 2] = (x & 31) << 3, u[(f + V * A) * 4 + 3] = x & 32768 ? 0 : 255;
|
|
91
|
+
return u;
|
|
92
|
+
}
|
|
93
|
+
function oe(u, K, D, B, X, F, z, _) {
|
|
94
|
+
let x = 0, N, f;
|
|
95
|
+
const A = C.width;
|
|
96
|
+
for (f = K; f !== B; f += D)
|
|
97
|
+
for (N = X; N !== z; N += F, x += 3)
|
|
98
|
+
u[(N + A * f) * 4 + 3] = 255, u[(N + A * f) * 4 + 2] = _[x + 0], u[(N + A * f) * 4 + 1] = _[x + 1], u[(N + A * f) * 4 + 0] = _[x + 2];
|
|
99
|
+
return u;
|
|
100
|
+
}
|
|
101
|
+
function I(u, K, D, B, X, F, z, _) {
|
|
102
|
+
let x = 0, N, f;
|
|
103
|
+
const A = C.width;
|
|
104
|
+
for (f = K; f !== B; f += D)
|
|
105
|
+
for (N = X; N !== z; N += F, x += 4)
|
|
106
|
+
u[(N + A * f) * 4 + 2] = _[x + 0], u[(N + A * f) * 4 + 1] = _[x + 1], u[(N + A * f) * 4 + 0] = _[x + 2], u[(N + A * f) * 4 + 3] = _[x + 3];
|
|
107
|
+
return u;
|
|
108
|
+
}
|
|
109
|
+
function Y(u, K, D, B, X, F, z, _) {
|
|
110
|
+
let x, N = 0, f, A;
|
|
111
|
+
const V = C.width;
|
|
112
|
+
for (A = K; A !== B; A += D)
|
|
113
|
+
for (f = X; f !== z; f += F, N++)
|
|
114
|
+
x = _[N], u[(f + V * A) * 4 + 0] = x, u[(f + V * A) * 4 + 1] = x, u[(f + V * A) * 4 + 2] = x, u[(f + V * A) * 4 + 3] = 255;
|
|
115
|
+
return u;
|
|
116
|
+
}
|
|
117
|
+
function ne(u, K, D, B, X, F, z, _) {
|
|
118
|
+
let x = 0, N, f;
|
|
119
|
+
const A = C.width;
|
|
120
|
+
for (f = K; f !== B; f += D)
|
|
121
|
+
for (N = X; N !== z; N += F, x += 2)
|
|
122
|
+
u[(N + A * f) * 4 + 0] = _[x + 0], u[(N + A * f) * 4 + 1] = _[x + 0], u[(N + A * f) * 4 + 2] = _[x + 0], u[(N + A * f) * 4 + 3] = _[x + 1];
|
|
123
|
+
return u;
|
|
124
|
+
}
|
|
125
|
+
function we(u, K, D, B, X) {
|
|
126
|
+
let F, z, _, x, N, f;
|
|
127
|
+
switch ((C.flags & M) >> q) {
|
|
128
128
|
default:
|
|
129
|
-
case
|
|
130
|
-
|
|
129
|
+
case J:
|
|
130
|
+
F = 0, _ = 1, N = K, z = 0, x = 1, f = D;
|
|
131
131
|
break;
|
|
132
132
|
case U:
|
|
133
|
-
|
|
133
|
+
F = 0, _ = 1, N = K, z = D - 1, x = -1, f = -1;
|
|
134
134
|
break;
|
|
135
135
|
case S:
|
|
136
|
-
|
|
136
|
+
F = K - 1, _ = -1, N = -1, z = 0, x = 1, f = D;
|
|
137
137
|
break;
|
|
138
|
-
case
|
|
139
|
-
|
|
138
|
+
case E:
|
|
139
|
+
F = K - 1, _ = -1, N = -1, z = D - 1, x = -1, f = -1;
|
|
140
140
|
break;
|
|
141
141
|
}
|
|
142
|
-
if (
|
|
143
|
-
switch (
|
|
142
|
+
if (j)
|
|
143
|
+
switch (C.pixel_size) {
|
|
144
144
|
case 8:
|
|
145
|
-
Y(
|
|
145
|
+
Y(u, z, x, f, F, _, N, B);
|
|
146
146
|
break;
|
|
147
147
|
case 16:
|
|
148
|
-
ne(
|
|
148
|
+
ne(u, z, x, f, F, _, N, B);
|
|
149
149
|
break;
|
|
150
150
|
default:
|
|
151
151
|
throw new Error("THREE.TGALoader: Format not supported.");
|
|
152
152
|
}
|
|
153
153
|
else
|
|
154
|
-
switch (
|
|
154
|
+
switch (C.pixel_size) {
|
|
155
155
|
case 8:
|
|
156
|
-
se(
|
|
156
|
+
se(u, z, x, f, F, _, N, B, X);
|
|
157
157
|
break;
|
|
158
158
|
case 16:
|
|
159
|
-
|
|
159
|
+
v(u, z, x, f, F, _, N, B);
|
|
160
160
|
break;
|
|
161
161
|
case 24:
|
|
162
|
-
oe(
|
|
162
|
+
oe(u, z, x, f, F, _, N, B);
|
|
163
163
|
break;
|
|
164
164
|
case 32:
|
|
165
|
-
I(
|
|
165
|
+
I(u, z, x, f, F, _, N, B);
|
|
166
166
|
break;
|
|
167
167
|
default:
|
|
168
168
|
throw new Error("THREE.TGALoader: Format not supported.");
|
|
169
169
|
}
|
|
170
|
-
return
|
|
170
|
+
return u;
|
|
171
171
|
}
|
|
172
|
-
const
|
|
172
|
+
const ke = 0, Ne = 1, $ = 2, ie = 3, ee = 9, be = 10, ge = 11, M = 48, q = 4, U = 0, E = 1, J = 2, S = 3;
|
|
173
173
|
if (O.length < 19) throw new Error("THREE.TGALoader: Not enough data to contain header.");
|
|
174
|
-
let
|
|
175
|
-
const
|
|
176
|
-
id_length:
|
|
177
|
-
colormap_type:
|
|
178
|
-
image_type:
|
|
179
|
-
colormap_index:
|
|
180
|
-
colormap_length:
|
|
181
|
-
colormap_size:
|
|
174
|
+
let m = 0;
|
|
175
|
+
const h = new Uint8Array(O), C = {
|
|
176
|
+
id_length: h[m++],
|
|
177
|
+
colormap_type: h[m++],
|
|
178
|
+
image_type: h[m++],
|
|
179
|
+
colormap_index: h[m++] | h[m++] << 8,
|
|
180
|
+
colormap_length: h[m++] | h[m++] << 8,
|
|
181
|
+
colormap_size: h[m++],
|
|
182
182
|
origin: [
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
h[m++] | h[m++] << 8,
|
|
184
|
+
h[m++] | h[m++] << 8
|
|
185
185
|
],
|
|
186
|
-
width:
|
|
187
|
-
height:
|
|
188
|
-
pixel_size:
|
|
189
|
-
flags:
|
|
186
|
+
width: h[m++] | h[m++] << 8,
|
|
187
|
+
height: h[m++] | h[m++] << 8,
|
|
188
|
+
pixel_size: h[m++],
|
|
189
|
+
flags: h[m++]
|
|
190
190
|
};
|
|
191
|
-
if (Q(
|
|
191
|
+
if (Q(C), C.id_length + m > O.length)
|
|
192
192
|
throw new Error("THREE.TGALoader: No data.");
|
|
193
|
-
|
|
194
|
-
let
|
|
195
|
-
switch (
|
|
193
|
+
m += C.id_length;
|
|
194
|
+
let L = !1, k = !1, j = !1;
|
|
195
|
+
switch (C.image_type) {
|
|
196
196
|
case ee:
|
|
197
|
-
|
|
197
|
+
L = !0, k = !0;
|
|
198
198
|
break;
|
|
199
|
-
case
|
|
199
|
+
case Ne:
|
|
200
200
|
k = !0;
|
|
201
201
|
break;
|
|
202
202
|
case be:
|
|
203
|
-
|
|
203
|
+
L = !0;
|
|
204
204
|
break;
|
|
205
205
|
case $:
|
|
206
206
|
break;
|
|
207
|
-
case
|
|
208
|
-
|
|
207
|
+
case ge:
|
|
208
|
+
L = !0, j = !0;
|
|
209
209
|
break;
|
|
210
210
|
case ie:
|
|
211
|
-
|
|
211
|
+
j = !0;
|
|
212
212
|
break;
|
|
213
213
|
}
|
|
214
|
-
const ae = new Uint8Array(
|
|
215
|
-
return
|
|
214
|
+
const ae = new Uint8Array(C.width * C.height * 4), te = R(L, k, C, m, h);
|
|
215
|
+
return we(ae, C.width, C.height, te.pixel_data, te.palettes), {
|
|
216
216
|
data: ae,
|
|
217
|
-
width:
|
|
218
|
-
height:
|
|
217
|
+
width: C.width,
|
|
218
|
+
height: C.height,
|
|
219
219
|
flipY: !0,
|
|
220
220
|
generateMipmaps: !0,
|
|
221
221
|
minFilter: Rn
|
|
@@ -233,12 +233,12 @@ class oi extends lt {
|
|
|
233
233
|
* @param {onErrorCallback} onError - Executed when errors occur.
|
|
234
234
|
*/
|
|
235
235
|
load(O, Q, R, se) {
|
|
236
|
-
const
|
|
237
|
-
I.setPath(
|
|
236
|
+
const v = this, oe = v.path === "" ? At.extractUrlBase(O) : v.path, I = new In(v.manager);
|
|
237
|
+
I.setPath(v.path), I.setRequestHeader(v.requestHeader), I.setWithCredentials(v.withCredentials), I.load(O, function(Y) {
|
|
238
238
|
try {
|
|
239
|
-
Q(
|
|
239
|
+
Q(v.parse(Y, oe));
|
|
240
240
|
} catch (ne) {
|
|
241
|
-
se ? se(ne) : console.error(ne),
|
|
241
|
+
se ? se(ne) : console.error(ne), v.manager.itemError(O);
|
|
242
242
|
}
|
|
243
243
|
}, R, se);
|
|
244
244
|
}
|
|
@@ -266,7 +266,7 @@ class oi extends lt {
|
|
|
266
266
|
i[n] = e[n];
|
|
267
267
|
return i;
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function v(t) {
|
|
270
270
|
if (t.length === 0) return [];
|
|
271
271
|
const e = t.trim().split(/\s+/), i = new Array(e.length);
|
|
272
272
|
for (let n = 0, s = e.length; n < s; n++)
|
|
@@ -289,16 +289,16 @@ class oi extends lt {
|
|
|
289
289
|
function ne(t) {
|
|
290
290
|
return Object.keys(t).length === 0;
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function we(t) {
|
|
293
293
|
return {
|
|
294
|
-
unit:
|
|
295
|
-
upAxis:
|
|
294
|
+
unit: ke(R(t, "unit")[0]),
|
|
295
|
+
upAxis: Ne(R(t, "up_axis")[0])
|
|
296
296
|
};
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function ke(t) {
|
|
299
299
|
return t !== void 0 && t.hasAttribute("meter") === !0 ? parseFloat(t.getAttribute("meter")) : 1;
|
|
300
300
|
}
|
|
301
|
-
function
|
|
301
|
+
function Ne(t) {
|
|
302
302
|
return t !== void 0 ? t.textContent : "Y_UP";
|
|
303
303
|
}
|
|
304
304
|
function $(t, e, i, n) {
|
|
@@ -334,7 +334,7 @@ class oi extends lt {
|
|
|
334
334
|
r = o.getAttribute("id"), e.sources[r] = Ge(o);
|
|
335
335
|
break;
|
|
336
336
|
case "sampler":
|
|
337
|
-
r = o.getAttribute("id"), e.samplers[r] =
|
|
337
|
+
r = o.getAttribute("id"), e.samplers[r] = ge(o);
|
|
338
338
|
break;
|
|
339
339
|
case "channel":
|
|
340
340
|
r = o.getAttribute("target"), e.channels[r] = M(o);
|
|
@@ -346,9 +346,9 @@ class oi extends lt {
|
|
|
346
346
|
console.log(o);
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
i === !1 && (
|
|
349
|
+
i === !1 && (T.animations[t.getAttribute("id") || Le.generateUUID()] = e);
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function ge(t) {
|
|
352
352
|
const e = {
|
|
353
353
|
inputs: {}
|
|
354
354
|
};
|
|
@@ -369,8 +369,8 @@ class oi extends lt {
|
|
|
369
369
|
let n = t.getAttribute("target").split("/");
|
|
370
370
|
const s = n.shift();
|
|
371
371
|
let o = n.shift();
|
|
372
|
-
const r = o.indexOf("(") !== -1,
|
|
373
|
-
if (
|
|
372
|
+
const r = o.indexOf("(") !== -1, d = o.indexOf(".") !== -1;
|
|
373
|
+
if (d)
|
|
374
374
|
n = o.split("."), o = n.shift(), e.member = n.shift();
|
|
375
375
|
else if (r) {
|
|
376
376
|
const c = o.split("(");
|
|
@@ -379,33 +379,33 @@ class oi extends lt {
|
|
|
379
379
|
c[l] = parseInt(c[l].replace(/\)/, ""));
|
|
380
380
|
e.indices = c;
|
|
381
381
|
}
|
|
382
|
-
return e.id = s, e.sid = o, e.arraySyntax = r, e.memberSyntax =
|
|
382
|
+
return e.id = s, e.sid = o, e.arraySyntax = r, e.memberSyntax = d, e.sampler = I(t.getAttribute("source")), e;
|
|
383
383
|
}
|
|
384
|
-
function
|
|
384
|
+
function q(t) {
|
|
385
385
|
const e = [], i = t.channels, n = t.samplers, s = t.sources;
|
|
386
386
|
for (const o in i)
|
|
387
387
|
if (i.hasOwnProperty(o)) {
|
|
388
|
-
const r = i[o],
|
|
389
|
-
|
|
388
|
+
const r = i[o], d = n[r.sampler], c = d.inputs.INPUT, l = d.inputs.OUTPUT, g = s[c], a = s[l], b = E(r, g, a);
|
|
389
|
+
C(b, e);
|
|
390
390
|
}
|
|
391
391
|
return e;
|
|
392
392
|
}
|
|
393
393
|
function U(t) {
|
|
394
|
-
return ee(
|
|
394
|
+
return ee(T.animations[t], q);
|
|
395
395
|
}
|
|
396
|
-
function
|
|
397
|
-
const n =
|
|
398
|
-
let
|
|
399
|
-
const
|
|
396
|
+
function E(t, e, i) {
|
|
397
|
+
const n = T.nodes[t.id], s = Ee(n.id), o = n.transforms[t.sid], r = n.matrix.clone().transpose();
|
|
398
|
+
let d, c, l, g, a, b;
|
|
399
|
+
const p = {};
|
|
400
400
|
switch (o) {
|
|
401
401
|
case "matrix":
|
|
402
|
-
for (l = 0,
|
|
403
|
-
if (
|
|
404
|
-
const W = i.array[c],
|
|
405
|
-
|
|
402
|
+
for (l = 0, g = e.array.length; l < g; l++)
|
|
403
|
+
if (d = e.array[l], c = l * i.stride, p[d] === void 0 && (p[d] = {}), t.arraySyntax === !0) {
|
|
404
|
+
const W = i.array[c], H = t.indices[0] + 4 * t.indices[1];
|
|
405
|
+
p[d][H] = W;
|
|
406
406
|
} else
|
|
407
|
-
for (a = 0,
|
|
408
|
-
|
|
407
|
+
for (a = 0, b = i.stride; a < b; a++)
|
|
408
|
+
p[d][a] = i.array[c + a];
|
|
409
409
|
break;
|
|
410
410
|
case "translate":
|
|
411
411
|
console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.', o);
|
|
@@ -417,34 +417,34 @@ class oi extends lt {
|
|
|
417
417
|
console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.', o);
|
|
418
418
|
break;
|
|
419
419
|
}
|
|
420
|
-
const
|
|
420
|
+
const w = J(p, r);
|
|
421
421
|
return {
|
|
422
422
|
name: s.uuid,
|
|
423
|
-
keyframes:
|
|
423
|
+
keyframes: w
|
|
424
424
|
};
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function J(t, e) {
|
|
427
427
|
const i = [];
|
|
428
428
|
for (const s in t)
|
|
429
429
|
i.push({ time: parseFloat(s), value: t[s] });
|
|
430
430
|
i.sort(n);
|
|
431
431
|
for (let s = 0; s < 16; s++)
|
|
432
|
-
|
|
432
|
+
L(i, s, e.elements[s]);
|
|
433
433
|
return i;
|
|
434
434
|
function n(s, o) {
|
|
435
435
|
return s.time - o.time;
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
|
-
const S = new pe(),
|
|
439
|
-
function
|
|
440
|
-
const i = t.keyframes, n = t.name, s = [], o = [], r = [],
|
|
438
|
+
const S = new pe(), m = new pe(), h = new Et();
|
|
439
|
+
function C(t, e) {
|
|
440
|
+
const i = t.keyframes, n = t.name, s = [], o = [], r = [], d = [];
|
|
441
441
|
for (let c = 0, l = i.length; c < l; c++) {
|
|
442
|
-
const
|
|
443
|
-
ce.fromArray(
|
|
442
|
+
const g = i[c], a = g.time, b = g.value;
|
|
443
|
+
ce.fromArray(b).transpose(), ce.decompose(S, h, m), s.push(a), o.push(S.x, S.y, S.z), r.push(h.x, h.y, h.z, h.w), d.push(m.x, m.y, m.z);
|
|
444
444
|
}
|
|
445
|
-
return o.length > 0 && e.push(new mt(n + ".position", s, o)), r.length > 0 && e.push(new
|
|
445
|
+
return o.length > 0 && e.push(new mt(n + ".position", s, o)), r.length > 0 && e.push(new Bn(n + ".quaternion", s, r)), d.length > 0 && e.push(new mt(n + ".scale", s, d)), e;
|
|
446
446
|
}
|
|
447
|
-
function
|
|
447
|
+
function L(t, e, i) {
|
|
448
448
|
let n, s = !0, o, r;
|
|
449
449
|
for (o = 0, r = t.length; o < r; o++)
|
|
450
450
|
n = t[o], n.value[e] === void 0 ? n.value[e] = null : s = !1;
|
|
@@ -459,7 +459,7 @@ class oi extends lt {
|
|
|
459
459
|
for (let s = 0, o = t.length; s < o; s++) {
|
|
460
460
|
const r = t[s];
|
|
461
461
|
if (r.value[e] === null) {
|
|
462
|
-
if (i =
|
|
462
|
+
if (i = j(t, s, e), n = ae(t, s, e), i === null) {
|
|
463
463
|
r.value[e] = n.value[e];
|
|
464
464
|
continue;
|
|
465
465
|
}
|
|
@@ -471,7 +471,7 @@ class oi extends lt {
|
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
|
-
function
|
|
474
|
+
function j(t, e, i) {
|
|
475
475
|
for (; e >= 0; ) {
|
|
476
476
|
const n = t[e];
|
|
477
477
|
if (n.value[i] !== null) return n;
|
|
@@ -494,7 +494,7 @@ class oi extends lt {
|
|
|
494
494
|
}
|
|
495
495
|
t.value[n] = (t.time - e.time) * (i.value[n] - e.value[n]) / (i.time - e.time) + e.value[n];
|
|
496
496
|
}
|
|
497
|
-
function
|
|
497
|
+
function u(t) {
|
|
498
498
|
const e = {
|
|
499
499
|
name: t.getAttribute("id") || "default",
|
|
500
500
|
start: parseFloat(t.getAttribute("start") || 0),
|
|
@@ -510,21 +510,21 @@ class oi extends lt {
|
|
|
510
510
|
break;
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
|
-
|
|
513
|
+
T.clips[t.getAttribute("id")] = e;
|
|
514
514
|
}
|
|
515
515
|
function K(t) {
|
|
516
516
|
const e = [], i = t.name, n = t.end - t.start || -1, s = t.animations;
|
|
517
517
|
for (let o = 0, r = s.length; o < r; o++) {
|
|
518
|
-
const
|
|
519
|
-
for (let c = 0, l =
|
|
520
|
-
e.push(
|
|
518
|
+
const d = U(s[o]);
|
|
519
|
+
for (let c = 0, l = d.length; c < l; c++)
|
|
520
|
+
e.push(d[c]);
|
|
521
521
|
}
|
|
522
522
|
return new ft(i, n, e);
|
|
523
523
|
}
|
|
524
|
-
function
|
|
525
|
-
return ee(
|
|
524
|
+
function D(t) {
|
|
525
|
+
return ee(T.clips[t], K);
|
|
526
526
|
}
|
|
527
|
-
function
|
|
527
|
+
function B(t) {
|
|
528
528
|
const e = {};
|
|
529
529
|
for (let i = 0, n = t.childNodes.length; i < n; i++) {
|
|
530
530
|
const s = t.childNodes[i];
|
|
@@ -538,7 +538,7 @@ class oi extends lt {
|
|
|
538
538
|
break;
|
|
539
539
|
}
|
|
540
540
|
}
|
|
541
|
-
|
|
541
|
+
T.controllers[t.getAttribute("id")] = e;
|
|
542
542
|
}
|
|
543
543
|
function X(t) {
|
|
544
544
|
const e = {
|
|
@@ -549,23 +549,23 @@ class oi extends lt {
|
|
|
549
549
|
if (s.nodeType === 1)
|
|
550
550
|
switch (s.nodeName) {
|
|
551
551
|
case "bind_shape_matrix":
|
|
552
|
-
e.bindShapeMatrix =
|
|
552
|
+
e.bindShapeMatrix = v(s.textContent);
|
|
553
553
|
break;
|
|
554
554
|
case "source":
|
|
555
555
|
const o = s.getAttribute("id");
|
|
556
556
|
e.sources[o] = Ge(s);
|
|
557
557
|
break;
|
|
558
558
|
case "joints":
|
|
559
|
-
e.joints =
|
|
559
|
+
e.joints = F(s);
|
|
560
560
|
break;
|
|
561
561
|
case "vertex_weights":
|
|
562
|
-
e.vertexWeights =
|
|
562
|
+
e.vertexWeights = z(s);
|
|
563
563
|
break;
|
|
564
564
|
}
|
|
565
565
|
}
|
|
566
566
|
return e;
|
|
567
567
|
}
|
|
568
|
-
function
|
|
568
|
+
function F(t) {
|
|
569
569
|
const e = {
|
|
570
570
|
inputs: {}
|
|
571
571
|
};
|
|
@@ -581,7 +581,7 @@ class oi extends lt {
|
|
|
581
581
|
}
|
|
582
582
|
return e;
|
|
583
583
|
}
|
|
584
|
-
function
|
|
584
|
+
function z(t) {
|
|
585
585
|
const e = {
|
|
586
586
|
inputs: {}
|
|
587
587
|
};
|
|
@@ -590,8 +590,8 @@ class oi extends lt {
|
|
|
590
590
|
if (s.nodeType === 1)
|
|
591
591
|
switch (s.nodeName) {
|
|
592
592
|
case "input":
|
|
593
|
-
const o = s.getAttribute("semantic"), r = I(s.getAttribute("source")),
|
|
594
|
-
e.inputs[o] = { id: r, offset:
|
|
593
|
+
const o = s.getAttribute("semantic"), r = I(s.getAttribute("source")), d = parseInt(s.getAttribute("offset"));
|
|
594
|
+
e.inputs[o] = { id: r, offset: d };
|
|
595
595
|
break;
|
|
596
596
|
case "vcount":
|
|
597
597
|
e.vcount = oe(s.textContent);
|
|
@@ -603,13 +603,13 @@ class oi extends lt {
|
|
|
603
603
|
}
|
|
604
604
|
return e;
|
|
605
605
|
}
|
|
606
|
-
function
|
|
606
|
+
function _(t) {
|
|
607
607
|
const e = {
|
|
608
608
|
id: t.id
|
|
609
|
-
}, i =
|
|
610
|
-
return t.skin !== void 0 && (e.skin =
|
|
609
|
+
}, i = T.geometries[e.id];
|
|
610
|
+
return t.skin !== void 0 && (e.skin = x(t.skin), i.sources.skinIndices = e.skin.indices, i.sources.skinWeights = e.skin.weights), e;
|
|
611
611
|
}
|
|
612
|
-
function
|
|
612
|
+
function x(t) {
|
|
613
613
|
const i = {
|
|
614
614
|
joints: [],
|
|
615
615
|
// this must be an array to preserve the joint order
|
|
@@ -621,43 +621,43 @@ class oi extends lt {
|
|
|
621
621
|
array: [],
|
|
622
622
|
stride: 4
|
|
623
623
|
}
|
|
624
|
-
}, n = t.sources, s = t.vertexWeights, o = s.vcount, r = s.v,
|
|
625
|
-
let
|
|
626
|
-
for (
|
|
627
|
-
const
|
|
628
|
-
for (
|
|
629
|
-
const
|
|
630
|
-
G.push({ index:
|
|
624
|
+
}, n = t.sources, s = t.vertexWeights, o = s.vcount, r = s.v, d = s.inputs.JOINT.offset, c = s.inputs.WEIGHT.offset, l = t.sources[t.joints.inputs.JOINT], g = t.sources[t.joints.inputs.INV_BIND_MATRIX], a = n[s.inputs.WEIGHT.id].array;
|
|
625
|
+
let b = 0, p, w, y;
|
|
626
|
+
for (p = 0, y = o.length; p < y; p++) {
|
|
627
|
+
const H = o[p], G = [];
|
|
628
|
+
for (w = 0; w < H; w++) {
|
|
629
|
+
const P = r[b + d], fe = r[b + c], re = a[fe];
|
|
630
|
+
G.push({ index: P, weight: re }), b += 2;
|
|
631
631
|
}
|
|
632
|
-
for (G.sort(W),
|
|
633
|
-
const
|
|
634
|
-
|
|
632
|
+
for (G.sort(W), w = 0; w < 4; w++) {
|
|
633
|
+
const P = G[w];
|
|
634
|
+
P !== void 0 ? (i.indices.array.push(P.index), i.weights.array.push(P.weight)) : (i.indices.array.push(0), i.weights.array.push(0));
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
|
-
for (t.bindShapeMatrix ? i.bindMatrix = new he().fromArray(t.bindShapeMatrix).transpose() : i.bindMatrix = new he().identity(),
|
|
638
|
-
const
|
|
639
|
-
i.joints.push({ name:
|
|
637
|
+
for (t.bindShapeMatrix ? i.bindMatrix = new he().fromArray(t.bindShapeMatrix).transpose() : i.bindMatrix = new he().identity(), p = 0, y = l.array.length; p < y; p++) {
|
|
638
|
+
const H = l.array[p], G = new he().fromArray(g.array, p * g.stride).transpose();
|
|
639
|
+
i.joints.push({ name: H, boneInverse: G });
|
|
640
640
|
}
|
|
641
641
|
return i;
|
|
642
|
-
function W(
|
|
643
|
-
return G.weight -
|
|
642
|
+
function W(H, G) {
|
|
643
|
+
return G.weight - H.weight;
|
|
644
644
|
}
|
|
645
645
|
}
|
|
646
|
-
function
|
|
647
|
-
return ee(
|
|
646
|
+
function N(t) {
|
|
647
|
+
return ee(T.controllers[t], _);
|
|
648
648
|
}
|
|
649
|
-
function
|
|
649
|
+
function f(t) {
|
|
650
650
|
const e = {
|
|
651
651
|
init_from: R(t, "init_from")[0].textContent
|
|
652
652
|
};
|
|
653
|
-
|
|
653
|
+
T.images[t.getAttribute("id")] = e;
|
|
654
654
|
}
|
|
655
|
-
function
|
|
655
|
+
function A(t) {
|
|
656
656
|
return t.build !== void 0 ? t.build : t.init_from;
|
|
657
657
|
}
|
|
658
|
-
function
|
|
659
|
-
const e =
|
|
660
|
-
return e !== void 0 ? ee(e,
|
|
658
|
+
function V(t) {
|
|
659
|
+
const e = T.images[t];
|
|
660
|
+
return e !== void 0 ? ee(e, A) : (console.warn("THREE.ColladaLoader: Couldn't find image with ID:", t), null);
|
|
661
661
|
}
|
|
662
662
|
function le(t) {
|
|
663
663
|
const e = {};
|
|
@@ -666,13 +666,13 @@ class oi extends lt {
|
|
|
666
666
|
if (s.nodeType === 1)
|
|
667
667
|
switch (s.nodeName) {
|
|
668
668
|
case "profile_COMMON":
|
|
669
|
-
e.profile =
|
|
669
|
+
e.profile = Ae(s);
|
|
670
670
|
break;
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
|
-
|
|
673
|
+
T.effects[t.getAttribute("id")] = e;
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function Ae(t) {
|
|
676
676
|
const e = {
|
|
677
677
|
surfaces: {},
|
|
678
678
|
samplers: {}
|
|
@@ -688,7 +688,7 @@ class oi extends lt {
|
|
|
688
688
|
e.technique = Lt(s);
|
|
689
689
|
break;
|
|
690
690
|
case "extra":
|
|
691
|
-
e.extra =
|
|
691
|
+
e.extra = Be(s);
|
|
692
692
|
break;
|
|
693
693
|
}
|
|
694
694
|
}
|
|
@@ -748,7 +748,7 @@ class oi extends lt {
|
|
|
748
748
|
e.type = s.nodeName, e.parameters = vt(s);
|
|
749
749
|
break;
|
|
750
750
|
case "extra":
|
|
751
|
-
e.extra =
|
|
751
|
+
e.extra = Be(s);
|
|
752
752
|
break;
|
|
753
753
|
}
|
|
754
754
|
}
|
|
@@ -786,19 +786,19 @@ class oi extends lt {
|
|
|
786
786
|
if (s.nodeType === 1)
|
|
787
787
|
switch (s.nodeName) {
|
|
788
788
|
case "color":
|
|
789
|
-
e[s.nodeName] =
|
|
789
|
+
e[s.nodeName] = v(s.textContent);
|
|
790
790
|
break;
|
|
791
791
|
case "float":
|
|
792
792
|
e[s.nodeName] = parseFloat(s.textContent);
|
|
793
793
|
break;
|
|
794
794
|
case "texture":
|
|
795
|
-
e[s.nodeName] = { id: s.getAttribute("texture"), extra:
|
|
795
|
+
e[s.nodeName] = { id: s.getAttribute("texture"), extra: He(s) };
|
|
796
796
|
break;
|
|
797
797
|
}
|
|
798
798
|
}
|
|
799
799
|
return e;
|
|
800
800
|
}
|
|
801
|
-
function
|
|
801
|
+
function He(t) {
|
|
802
802
|
const e = {
|
|
803
803
|
technique: {}
|
|
804
804
|
};
|
|
@@ -840,12 +840,12 @@ class oi extends lt {
|
|
|
840
840
|
s.textContent.toUpperCase() === "TRUE" ? e.technique[s.nodeName] = 1 : s.textContent.toUpperCase() === "FALSE" ? e.technique[s.nodeName] = 0 : e.technique[s.nodeName] = parseInt(s.textContent);
|
|
841
841
|
break;
|
|
842
842
|
case "bump":
|
|
843
|
-
e[s.nodeName] =
|
|
843
|
+
e[s.nodeName] = ze(s);
|
|
844
844
|
break;
|
|
845
845
|
}
|
|
846
846
|
}
|
|
847
847
|
}
|
|
848
|
-
function
|
|
848
|
+
function Be(t) {
|
|
849
849
|
const e = {};
|
|
850
850
|
for (let i = 0, n = t.childNodes.length; i < n; i++) {
|
|
851
851
|
const s = t.childNodes[i];
|
|
@@ -868,20 +868,20 @@ class oi extends lt {
|
|
|
868
868
|
e[s.nodeName] = parseInt(s.textContent);
|
|
869
869
|
break;
|
|
870
870
|
case "bump":
|
|
871
|
-
e[s.nodeName] =
|
|
871
|
+
e[s.nodeName] = ze(s);
|
|
872
872
|
break;
|
|
873
873
|
}
|
|
874
874
|
}
|
|
875
875
|
return e;
|
|
876
876
|
}
|
|
877
|
-
function
|
|
877
|
+
function ze(t) {
|
|
878
878
|
const e = {};
|
|
879
879
|
for (let i = 0, n = t.childNodes.length; i < n; i++) {
|
|
880
880
|
const s = t.childNodes[i];
|
|
881
881
|
if (s.nodeType === 1)
|
|
882
882
|
switch (s.nodeName) {
|
|
883
883
|
case "texture":
|
|
884
|
-
e[s.nodeName] = { id: s.getAttribute("texture"), texcoord: s.getAttribute("texcoord"), extra:
|
|
884
|
+
e[s.nodeName] = { id: s.getAttribute("texture"), texcoord: s.getAttribute("texcoord"), extra: He(s) };
|
|
885
885
|
break;
|
|
886
886
|
}
|
|
887
887
|
}
|
|
@@ -891,7 +891,7 @@ class oi extends lt {
|
|
|
891
891
|
return t;
|
|
892
892
|
}
|
|
893
893
|
function St(t) {
|
|
894
|
-
return ee(
|
|
894
|
+
return ee(T.effects[t], De);
|
|
895
895
|
}
|
|
896
896
|
function Ot(t) {
|
|
897
897
|
const e = {
|
|
@@ -906,13 +906,13 @@ class oi extends lt {
|
|
|
906
906
|
break;
|
|
907
907
|
}
|
|
908
908
|
}
|
|
909
|
-
|
|
909
|
+
T.materials[t.getAttribute("id")] = e;
|
|
910
910
|
}
|
|
911
911
|
function Gt(t) {
|
|
912
912
|
let e, i = t.slice((t.lastIndexOf(".") - 1 >>> 0) + 2);
|
|
913
913
|
switch (i = i.toLowerCase(), i) {
|
|
914
914
|
case "tga":
|
|
915
|
-
e =
|
|
915
|
+
e = je;
|
|
916
916
|
break;
|
|
917
917
|
default:
|
|
918
918
|
e = rt;
|
|
@@ -936,23 +936,23 @@ class oi extends lt {
|
|
|
936
936
|
}
|
|
937
937
|
n.name = t.name || "";
|
|
938
938
|
function s(c, l = null) {
|
|
939
|
-
const
|
|
939
|
+
const g = e.profile.samplers[c.id];
|
|
940
940
|
let a = null;
|
|
941
|
-
if (
|
|
942
|
-
const
|
|
943
|
-
a =
|
|
941
|
+
if (g !== void 0) {
|
|
942
|
+
const b = e.profile.surfaces[g.source];
|
|
943
|
+
a = V(b.init_from);
|
|
944
944
|
} else
|
|
945
|
-
console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."), a =
|
|
945
|
+
console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."), a = V(c.id);
|
|
946
946
|
if (a !== null) {
|
|
947
|
-
const
|
|
948
|
-
if (
|
|
949
|
-
const
|
|
950
|
-
if (
|
|
951
|
-
const
|
|
952
|
-
|
|
947
|
+
const b = Gt(a);
|
|
948
|
+
if (b !== void 0) {
|
|
949
|
+
const p = b.load(a), w = c.extra;
|
|
950
|
+
if (w !== void 0 && w.technique !== void 0 && ne(w.technique) === !1) {
|
|
951
|
+
const y = w.technique;
|
|
952
|
+
p.wrapS = y.wrapU ? Oe : gt, p.wrapT = y.wrapV ? Oe : gt, p.offset.set(y.offsetU || 0, y.offsetV || 0), p.repeat.set(y.repeatU || 1, y.repeatV || 1);
|
|
953
953
|
} else
|
|
954
|
-
|
|
955
|
-
return l !== null && (
|
|
954
|
+
p.wrapS = Oe, p.wrapT = Oe;
|
|
955
|
+
return l !== null && (p.colorSpace = l), p;
|
|
956
956
|
} else
|
|
957
957
|
return console.warn("THREE.ColladaLoader: Loader for texture %s not found.", a), null;
|
|
958
958
|
} else
|
|
@@ -983,31 +983,31 @@ class oi extends lt {
|
|
|
983
983
|
}
|
|
984
984
|
}
|
|
985
985
|
Se.colorSpaceToWorking(n.color, me), n.specular && Se.colorSpaceToWorking(n.specular, me), n.emissive && Se.colorSpaceToWorking(n.emissive, me);
|
|
986
|
-
let r = o.transparent,
|
|
987
|
-
if (
|
|
986
|
+
let r = o.transparent, d = o.transparency;
|
|
987
|
+
if (d === void 0 && r && (d = {
|
|
988
988
|
float: 1
|
|
989
|
-
}), r === void 0 &&
|
|
989
|
+
}), r === void 0 && d && (r = {
|
|
990
990
|
opaque: "A_ONE",
|
|
991
991
|
data: {
|
|
992
992
|
color: [1, 1, 1, 1]
|
|
993
993
|
}
|
|
994
|
-
}), r &&
|
|
994
|
+
}), r && d)
|
|
995
995
|
if (r.data.texture)
|
|
996
996
|
n.transparent = !0;
|
|
997
997
|
else {
|
|
998
998
|
const c = r.data.color;
|
|
999
999
|
switch (r.opaque) {
|
|
1000
1000
|
case "A_ONE":
|
|
1001
|
-
n.opacity = c[3] *
|
|
1001
|
+
n.opacity = c[3] * d.float;
|
|
1002
1002
|
break;
|
|
1003
1003
|
case "RGB_ZERO":
|
|
1004
|
-
n.opacity = 1 - c[0] *
|
|
1004
|
+
n.opacity = 1 - c[0] * d.float;
|
|
1005
1005
|
break;
|
|
1006
1006
|
case "A_ZERO":
|
|
1007
|
-
n.opacity = 1 - c[3] *
|
|
1007
|
+
n.opacity = 1 - c[3] * d.float;
|
|
1008
1008
|
break;
|
|
1009
1009
|
case "RGB_ONE":
|
|
1010
|
-
n.opacity = c[0] *
|
|
1010
|
+
n.opacity = c[0] * d.float;
|
|
1011
1011
|
break;
|
|
1012
1012
|
default:
|
|
1013
1013
|
console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.', r.opaque);
|
|
@@ -1017,23 +1017,23 @@ class oi extends lt {
|
|
|
1017
1017
|
if (i.extra !== void 0 && i.extra.technique !== void 0) {
|
|
1018
1018
|
const c = i.extra.technique;
|
|
1019
1019
|
for (const l in c) {
|
|
1020
|
-
const
|
|
1020
|
+
const g = c[l];
|
|
1021
1021
|
switch (l) {
|
|
1022
1022
|
case "double_sided":
|
|
1023
|
-
n.side =
|
|
1023
|
+
n.side = g === 1 ? Gn : Pn;
|
|
1024
1024
|
break;
|
|
1025
1025
|
case "bump":
|
|
1026
|
-
n.normalMap = s(
|
|
1026
|
+
n.normalMap = s(g.texture), n.normalScale = new On(1, 1);
|
|
1027
1027
|
break;
|
|
1028
1028
|
}
|
|
1029
1029
|
}
|
|
1030
1030
|
}
|
|
1031
1031
|
return n;
|
|
1032
1032
|
}
|
|
1033
|
-
function Ft(t) {
|
|
1034
|
-
return ee(E.materials[t], Ve);
|
|
1035
|
-
}
|
|
1036
1033
|
function Pt(t) {
|
|
1034
|
+
return ee(T.materials[t], Ve);
|
|
1035
|
+
}
|
|
1036
|
+
function qt(t) {
|
|
1037
1037
|
const e = {
|
|
1038
1038
|
name: t.getAttribute("name")
|
|
1039
1039
|
};
|
|
@@ -1042,23 +1042,23 @@ class oi extends lt {
|
|
|
1042
1042
|
if (s.nodeType === 1)
|
|
1043
1043
|
switch (s.nodeName) {
|
|
1044
1044
|
case "optics":
|
|
1045
|
-
e.optics =
|
|
1045
|
+
e.optics = jt(s);
|
|
1046
1046
|
break;
|
|
1047
1047
|
}
|
|
1048
1048
|
}
|
|
1049
|
-
|
|
1049
|
+
T.cameras[t.getAttribute("id")] = e;
|
|
1050
1050
|
}
|
|
1051
|
-
function
|
|
1051
|
+
function jt(t) {
|
|
1052
1052
|
for (let e = 0; e < t.childNodes.length; e++) {
|
|
1053
1053
|
const i = t.childNodes[e];
|
|
1054
1054
|
switch (i.nodeName) {
|
|
1055
1055
|
case "technique_common":
|
|
1056
|
-
return
|
|
1056
|
+
return Ft(i);
|
|
1057
1057
|
}
|
|
1058
1058
|
}
|
|
1059
1059
|
return {};
|
|
1060
1060
|
}
|
|
1061
|
-
function
|
|
1061
|
+
function Ft(t) {
|
|
1062
1062
|
const e = {};
|
|
1063
1063
|
for (let i = 0; i < t.childNodes.length; i++) {
|
|
1064
1064
|
const n = t.childNodes[i];
|
|
@@ -1103,7 +1103,7 @@ class oi extends lt {
|
|
|
1103
1103
|
case "orthographic":
|
|
1104
1104
|
let i = t.optics.parameters.ymag, n = t.optics.parameters.xmag;
|
|
1105
1105
|
const s = t.optics.parameters.aspect_ratio;
|
|
1106
|
-
n = n === void 0 ? i * s : n, i = i === void 0 ? n / s : i, n *= 0.5, i *= 0.5, e = new
|
|
1106
|
+
n = n === void 0 ? i * s : n, i = i === void 0 ? n / s : i, n *= 0.5, i *= 0.5, e = new qn(
|
|
1107
1107
|
-n,
|
|
1108
1108
|
n,
|
|
1109
1109
|
i,
|
|
@@ -1119,24 +1119,24 @@ class oi extends lt {
|
|
|
1119
1119
|
}
|
|
1120
1120
|
return e.name = t.name || "", e;
|
|
1121
1121
|
}
|
|
1122
|
-
function
|
|
1123
|
-
const e =
|
|
1122
|
+
function Ht(t) {
|
|
1123
|
+
const e = T.cameras[t];
|
|
1124
1124
|
return e !== void 0 ? ee(e, Je) : (console.warn("THREE.ColladaLoader: Couldn't find camera with ID:", t), null);
|
|
1125
1125
|
}
|
|
1126
|
-
function
|
|
1126
|
+
function Bt(t) {
|
|
1127
1127
|
let e = {};
|
|
1128
1128
|
for (let i = 0, n = t.childNodes.length; i < n; i++) {
|
|
1129
1129
|
const s = t.childNodes[i];
|
|
1130
1130
|
if (s.nodeType === 1)
|
|
1131
1131
|
switch (s.nodeName) {
|
|
1132
1132
|
case "technique_common":
|
|
1133
|
-
e =
|
|
1133
|
+
e = zt(s);
|
|
1134
1134
|
break;
|
|
1135
1135
|
}
|
|
1136
1136
|
}
|
|
1137
|
-
|
|
1137
|
+
T.lights[t.getAttribute("id")] = e;
|
|
1138
1138
|
}
|
|
1139
|
-
function
|
|
1139
|
+
function zt(t) {
|
|
1140
1140
|
const e = {};
|
|
1141
1141
|
for (let i = 0, n = t.childNodes.length; i < n; i++) {
|
|
1142
1142
|
const s = t.childNodes[i];
|
|
@@ -1158,7 +1158,7 @@ class oi extends lt {
|
|
|
1158
1158
|
if (s.nodeType === 1)
|
|
1159
1159
|
switch (s.nodeName) {
|
|
1160
1160
|
case "color":
|
|
1161
|
-
const o =
|
|
1161
|
+
const o = v(s.textContent);
|
|
1162
1162
|
e.color = new ut().fromArray(o), Se.colorSpaceToWorking(e.color, me);
|
|
1163
1163
|
break;
|
|
1164
1164
|
case "falloff_angle":
|
|
@@ -1176,22 +1176,22 @@ class oi extends lt {
|
|
|
1176
1176
|
let e;
|
|
1177
1177
|
switch (t.technique) {
|
|
1178
1178
|
case "directional":
|
|
1179
|
-
e = new
|
|
1179
|
+
e = new Hn();
|
|
1180
1180
|
break;
|
|
1181
1181
|
case "point":
|
|
1182
1182
|
e = new Un();
|
|
1183
1183
|
break;
|
|
1184
1184
|
case "spot":
|
|
1185
|
-
e = new
|
|
1185
|
+
e = new Fn();
|
|
1186
1186
|
break;
|
|
1187
1187
|
case "ambient":
|
|
1188
|
-
e = new
|
|
1188
|
+
e = new jn();
|
|
1189
1189
|
break;
|
|
1190
1190
|
}
|
|
1191
1191
|
return t.parameters.color && e.color.copy(t.parameters.color), t.parameters.distance && (e.distance = t.parameters.distance), e;
|
|
1192
1192
|
}
|
|
1193
1193
|
function Vt(t) {
|
|
1194
|
-
const e =
|
|
1194
|
+
const e = T.lights[t];
|
|
1195
1195
|
return e !== void 0 ? ee(e, We) : (console.warn("THREE.ColladaLoader: Couldn't find light with ID:", t), null);
|
|
1196
1196
|
}
|
|
1197
1197
|
function Jt(t) {
|
|
@@ -1226,7 +1226,7 @@ class oi extends lt {
|
|
|
1226
1226
|
console.log(s);
|
|
1227
1227
|
}
|
|
1228
1228
|
}
|
|
1229
|
-
|
|
1229
|
+
T.geometries[t.getAttribute("id")] = e;
|
|
1230
1230
|
}
|
|
1231
1231
|
}
|
|
1232
1232
|
function Ge(t) {
|
|
@@ -1239,7 +1239,7 @@ class oi extends lt {
|
|
|
1239
1239
|
if (n.nodeType === 1)
|
|
1240
1240
|
switch (n.nodeName) {
|
|
1241
1241
|
case "float_array":
|
|
1242
|
-
e.array =
|
|
1242
|
+
e.array = v(n.textContent);
|
|
1243
1243
|
break;
|
|
1244
1244
|
case "Name_array":
|
|
1245
1245
|
e.array = se(n.textContent);
|
|
@@ -1274,8 +1274,8 @@ class oi extends lt {
|
|
|
1274
1274
|
if (s.nodeType === 1)
|
|
1275
1275
|
switch (s.nodeName) {
|
|
1276
1276
|
case "input":
|
|
1277
|
-
const o = I(s.getAttribute("source")), r = s.getAttribute("semantic"),
|
|
1278
|
-
e.inputs[l] = { id: o, offset:
|
|
1277
|
+
const o = I(s.getAttribute("source")), r = s.getAttribute("semantic"), d = parseInt(s.getAttribute("offset")), c = parseInt(s.getAttribute("set")), l = c > 0 ? r + c : r;
|
|
1278
|
+
e.inputs[l] = { id: o, offset: d }, e.stride = Math.max(e.stride, d + 1), r === "TEXCOORD" && (e.hasUV = !0);
|
|
1279
1279
|
break;
|
|
1280
1280
|
case "vcount":
|
|
1281
1281
|
e.vcount = oe(s.textContent);
|
|
@@ -1306,71 +1306,71 @@ class oi extends lt {
|
|
|
1306
1306
|
if (s.length === 0) return {};
|
|
1307
1307
|
const o = Yt(s);
|
|
1308
1308
|
for (const r in o) {
|
|
1309
|
-
const
|
|
1310
|
-
Xt(
|
|
1309
|
+
const d = o[r];
|
|
1310
|
+
Xt(d), e[r] = $t(d, i, n);
|
|
1311
1311
|
}
|
|
1312
1312
|
return e;
|
|
1313
1313
|
}
|
|
1314
1314
|
function $t(t, e, i) {
|
|
1315
|
-
const n = {}, s = { array: [], stride: 0 }, o = { array: [], stride: 0 }, r = { array: [], stride: 0 },
|
|
1316
|
-
let
|
|
1317
|
-
for (let
|
|
1318
|
-
const
|
|
1319
|
-
let
|
|
1320
|
-
switch (
|
|
1315
|
+
const n = {}, s = { array: [], stride: 0 }, o = { array: [], stride: 0 }, r = { array: [], stride: 0 }, d = { array: [], stride: 0 }, c = { array: [], stride: 0 }, l = { array: [], stride: 4 }, g = { array: [], stride: 4 }, a = new zn(), b = [];
|
|
1316
|
+
let p = 0;
|
|
1317
|
+
for (let w = 0; w < t.length; w++) {
|
|
1318
|
+
const y = t[w], W = y.inputs;
|
|
1319
|
+
let H = 0;
|
|
1320
|
+
switch (y.type) {
|
|
1321
1321
|
case "lines":
|
|
1322
1322
|
case "linestrips":
|
|
1323
|
-
|
|
1323
|
+
H = y.count * 2;
|
|
1324
1324
|
break;
|
|
1325
1325
|
case "triangles":
|
|
1326
|
-
|
|
1326
|
+
H = y.count * 3;
|
|
1327
1327
|
break;
|
|
1328
1328
|
case "polylist":
|
|
1329
|
-
for (let G = 0; G <
|
|
1330
|
-
const
|
|
1331
|
-
switch (
|
|
1329
|
+
for (let G = 0; G < y.count; G++) {
|
|
1330
|
+
const P = y.vcount[G];
|
|
1331
|
+
switch (P) {
|
|
1332
1332
|
case 3:
|
|
1333
|
-
|
|
1333
|
+
H += 3;
|
|
1334
1334
|
break;
|
|
1335
1335
|
case 4:
|
|
1336
|
-
|
|
1336
|
+
H += 6;
|
|
1337
1337
|
break;
|
|
1338
1338
|
default:
|
|
1339
|
-
|
|
1339
|
+
H += (P - 2) * 3;
|
|
1340
1340
|
break;
|
|
1341
1341
|
}
|
|
1342
1342
|
}
|
|
1343
1343
|
break;
|
|
1344
1344
|
default:
|
|
1345
|
-
console.warn("THREE.ColladaLoader: Unknown primitive type:",
|
|
1345
|
+
console.warn("THREE.ColladaLoader: Unknown primitive type:", y.type);
|
|
1346
1346
|
}
|
|
1347
|
-
a.addGroup(
|
|
1347
|
+
a.addGroup(p, H, w), p += H, y.material && b.push(y.material);
|
|
1348
1348
|
for (const G in W) {
|
|
1349
|
-
const
|
|
1349
|
+
const P = W[G];
|
|
1350
1350
|
switch (G) {
|
|
1351
1351
|
case "VERTEX":
|
|
1352
1352
|
for (const fe in i) {
|
|
1353
1353
|
const re = i[fe];
|
|
1354
1354
|
switch (fe) {
|
|
1355
1355
|
case "POSITION":
|
|
1356
|
-
const
|
|
1357
|
-
if (de(
|
|
1358
|
-
const Cn = (s.array.length -
|
|
1356
|
+
const xe = s.array.length;
|
|
1357
|
+
if (de(y, e[re], P.offset, s.array), s.stride = e[re].stride, e.skinWeights && e.skinIndices && (de(y, e.skinIndices, P.offset, l.array), de(y, e.skinWeights, P.offset, g.array)), y.hasUV === !1 && t.uvsNeedsFix === !0) {
|
|
1358
|
+
const Cn = (s.array.length - xe) / s.stride;
|
|
1359
1359
|
for (let ct = 0; ct < Cn; ct++)
|
|
1360
1360
|
r.array.push(0, 0);
|
|
1361
1361
|
}
|
|
1362
1362
|
break;
|
|
1363
1363
|
case "NORMAL":
|
|
1364
|
-
de(
|
|
1364
|
+
de(y, e[re], P.offset, o.array), o.stride = e[re].stride;
|
|
1365
1365
|
break;
|
|
1366
1366
|
case "COLOR":
|
|
1367
|
-
de(
|
|
1367
|
+
de(y, e[re], P.offset, c.array), c.stride = e[re].stride;
|
|
1368
1368
|
break;
|
|
1369
1369
|
case "TEXCOORD":
|
|
1370
|
-
de(
|
|
1370
|
+
de(y, e[re], P.offset, r.array), r.stride = e[re].stride;
|
|
1371
1371
|
break;
|
|
1372
1372
|
case "TEXCOORD1":
|
|
1373
|
-
de(
|
|
1373
|
+
de(y, e[re], P.offset, d.array), r.stride = e[re].stride;
|
|
1374
1374
|
break;
|
|
1375
1375
|
default:
|
|
1376
1376
|
console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.', fe);
|
|
@@ -1378,63 +1378,63 @@ class oi extends lt {
|
|
|
1378
1378
|
}
|
|
1379
1379
|
break;
|
|
1380
1380
|
case "NORMAL":
|
|
1381
|
-
de(
|
|
1381
|
+
de(y, e[P.id], P.offset, o.array), o.stride = e[P.id].stride;
|
|
1382
1382
|
break;
|
|
1383
1383
|
case "COLOR":
|
|
1384
|
-
de(
|
|
1384
|
+
de(y, e[P.id], P.offset, c.array, !0), c.stride = e[P.id].stride;
|
|
1385
1385
|
break;
|
|
1386
1386
|
case "TEXCOORD":
|
|
1387
|
-
de(
|
|
1387
|
+
de(y, e[P.id], P.offset, r.array), r.stride = e[P.id].stride;
|
|
1388
1388
|
break;
|
|
1389
1389
|
case "TEXCOORD1":
|
|
1390
|
-
de(
|
|
1390
|
+
de(y, e[P.id], P.offset, d.array), d.stride = e[P.id].stride;
|
|
1391
1391
|
break;
|
|
1392
1392
|
}
|
|
1393
1393
|
}
|
|
1394
1394
|
}
|
|
1395
|
-
return s.array.length > 0 && a.setAttribute("position", new
|
|
1395
|
+
return s.array.length > 0 && a.setAttribute("position", new ye(s.array, s.stride)), o.array.length > 0 && a.setAttribute("normal", new ye(o.array, o.stride)), c.array.length > 0 && a.setAttribute("color", new ye(c.array, c.stride)), r.array.length > 0 && a.setAttribute("uv", new ye(r.array, r.stride)), d.array.length > 0 && a.setAttribute("uv1", new ye(d.array, d.stride)), l.array.length > 0 && a.setAttribute("skinIndex", new ye(l.array, l.stride)), g.array.length > 0 && a.setAttribute("skinWeight", new ye(g.array, g.stride)), n.data = a, n.type = t[0].type, n.materialKeys = b, n;
|
|
1396
1396
|
}
|
|
1397
1397
|
function de(t, e, i, n, s = !1) {
|
|
1398
|
-
const o = t.p, r = t.stride,
|
|
1398
|
+
const o = t.p, r = t.stride, d = t.vcount;
|
|
1399
1399
|
function c(a) {
|
|
1400
|
-
let
|
|
1401
|
-
const
|
|
1402
|
-
for (;
|
|
1403
|
-
n.push(l[
|
|
1400
|
+
let b = o[a + i] * g;
|
|
1401
|
+
const p = b + g;
|
|
1402
|
+
for (; b < p; b++)
|
|
1403
|
+
n.push(l[b]);
|
|
1404
1404
|
if (s) {
|
|
1405
|
-
const
|
|
1405
|
+
const w = n.length - g - 1;
|
|
1406
1406
|
Re.setRGB(
|
|
1407
|
-
n[
|
|
1408
|
-
n[
|
|
1409
|
-
n[
|
|
1407
|
+
n[w + 0],
|
|
1408
|
+
n[w + 1],
|
|
1409
|
+
n[w + 2],
|
|
1410
1410
|
me
|
|
1411
|
-
), n[
|
|
1411
|
+
), n[w + 0] = Re.r, n[w + 1] = Re.g, n[w + 2] = Re.b;
|
|
1412
1412
|
}
|
|
1413
1413
|
}
|
|
1414
|
-
const l = e.array,
|
|
1414
|
+
const l = e.array, g = e.stride;
|
|
1415
1415
|
if (t.vcount !== void 0) {
|
|
1416
1416
|
let a = 0;
|
|
1417
|
-
for (let
|
|
1418
|
-
const
|
|
1419
|
-
if (
|
|
1420
|
-
const
|
|
1421
|
-
c(
|
|
1422
|
-
} else if (
|
|
1423
|
-
const
|
|
1424
|
-
c(
|
|
1425
|
-
} else if (
|
|
1426
|
-
for (let
|
|
1427
|
-
const
|
|
1428
|
-
c(
|
|
1417
|
+
for (let b = 0, p = d.length; b < p; b++) {
|
|
1418
|
+
const w = d[b];
|
|
1419
|
+
if (w === 4) {
|
|
1420
|
+
const y = a + r * 0, W = a + r * 1, H = a + r * 2, G = a + r * 3;
|
|
1421
|
+
c(y), c(W), c(G), c(W), c(H), c(G);
|
|
1422
|
+
} else if (w === 3) {
|
|
1423
|
+
const y = a + r * 0, W = a + r * 1, H = a + r * 2;
|
|
1424
|
+
c(y), c(W), c(H);
|
|
1425
|
+
} else if (w > 4)
|
|
1426
|
+
for (let y = 1, W = w - 2; y <= W; y++) {
|
|
1427
|
+
const H = a + r * 0, G = a + r * y, P = a + r * (y + 1);
|
|
1428
|
+
c(H), c(G), c(P);
|
|
1429
1429
|
}
|
|
1430
|
-
a += r *
|
|
1430
|
+
a += r * w;
|
|
1431
1431
|
}
|
|
1432
1432
|
} else
|
|
1433
|
-
for (let a = 0,
|
|
1433
|
+
for (let a = 0, b = o.length; a < b; a += r)
|
|
1434
1434
|
c(a);
|
|
1435
1435
|
}
|
|
1436
1436
|
function Ye(t) {
|
|
1437
|
-
return ee(
|
|
1437
|
+
return ee(T.geometries[t], Ke);
|
|
1438
1438
|
}
|
|
1439
1439
|
function Zt(t) {
|
|
1440
1440
|
const e = {
|
|
@@ -1451,13 +1451,13 @@ class oi extends lt {
|
|
|
1451
1451
|
break;
|
|
1452
1452
|
}
|
|
1453
1453
|
}
|
|
1454
|
-
|
|
1454
|
+
T.kinematicsModels[t.getAttribute("id")] = e;
|
|
1455
1455
|
}
|
|
1456
1456
|
function Qt(t) {
|
|
1457
1457
|
return t.build !== void 0 ? t.build : t;
|
|
1458
1458
|
}
|
|
1459
1459
|
function en(t) {
|
|
1460
|
-
return ee(
|
|
1460
|
+
return ee(T.kinematicsModels[t], Qt);
|
|
1461
1461
|
}
|
|
1462
1462
|
function tn(t, e) {
|
|
1463
1463
|
for (let i = 0; i < t.childNodes.length; i++) {
|
|
@@ -1506,7 +1506,7 @@ class oi extends lt {
|
|
|
1506
1506
|
if (n.nodeType === 1)
|
|
1507
1507
|
switch (n.nodeName) {
|
|
1508
1508
|
case "axis":
|
|
1509
|
-
const s =
|
|
1509
|
+
const s = v(n.textContent);
|
|
1510
1510
|
e.axis.fromArray(s);
|
|
1511
1511
|
break;
|
|
1512
1512
|
case "limits":
|
|
@@ -1565,7 +1565,7 @@ class oi extends lt {
|
|
|
1565
1565
|
function $e(t) {
|
|
1566
1566
|
const e = {
|
|
1567
1567
|
type: t.nodeName
|
|
1568
|
-
}, i =
|
|
1568
|
+
}, i = v(t.textContent);
|
|
1569
1569
|
switch (e.type) {
|
|
1570
1570
|
case "matrix":
|
|
1571
1571
|
e.obj = new he(), e.obj.fromArray(i).transpose();
|
|
@@ -1593,7 +1593,7 @@ class oi extends lt {
|
|
|
1593
1593
|
break;
|
|
1594
1594
|
}
|
|
1595
1595
|
}
|
|
1596
|
-
|
|
1596
|
+
T.physicsModels[t.getAttribute("id")] = e;
|
|
1597
1597
|
}
|
|
1598
1598
|
function an(t, e) {
|
|
1599
1599
|
for (let i = 0; i < t.childNodes.length; i++) {
|
|
@@ -1612,10 +1612,10 @@ class oi extends lt {
|
|
|
1612
1612
|
if (n.nodeType === 1)
|
|
1613
1613
|
switch (n.nodeName) {
|
|
1614
1614
|
case "inertia":
|
|
1615
|
-
e.inertia =
|
|
1615
|
+
e.inertia = v(n.textContent);
|
|
1616
1616
|
break;
|
|
1617
1617
|
case "mass":
|
|
1618
|
-
e.mass =
|
|
1618
|
+
e.mass = v(n.textContent)[0];
|
|
1619
1619
|
break;
|
|
1620
1620
|
}
|
|
1621
1621
|
}
|
|
@@ -1633,7 +1633,7 @@ class oi extends lt {
|
|
|
1633
1633
|
break;
|
|
1634
1634
|
}
|
|
1635
1635
|
}
|
|
1636
|
-
|
|
1636
|
+
T.kinematicsScenes[I(t.getAttribute("url"))] = e;
|
|
1637
1637
|
}
|
|
1638
1638
|
function dn(t) {
|
|
1639
1639
|
const e = {
|
|
@@ -1657,62 +1657,62 @@ class oi extends lt {
|
|
|
1657
1657
|
return t.build !== void 0 ? t.build : t;
|
|
1658
1658
|
}
|
|
1659
1659
|
function fn(t) {
|
|
1660
|
-
return ee(
|
|
1660
|
+
return ee(T.kinematicsScenes[t], un);
|
|
1661
1661
|
}
|
|
1662
1662
|
function hn() {
|
|
1663
|
-
const t = Object.keys(
|
|
1663
|
+
const t = Object.keys(T.kinematicsModels)[0], e = Object.keys(T.kinematicsScenes)[0], i = Object.keys(T.visualScenes)[0];
|
|
1664
1664
|
if (t === void 0 || e === void 0) return;
|
|
1665
|
-
const n = en(t), s = fn(e), o = it(i), r = s.bindJointAxis,
|
|
1666
|
-
for (let
|
|
1667
|
-
const
|
|
1668
|
-
if (
|
|
1669
|
-
const
|
|
1670
|
-
c(
|
|
1665
|
+
const n = en(t), s = fn(e), o = it(i), r = s.bindJointAxis, d = {};
|
|
1666
|
+
for (let g = 0, a = r.length; g < a; g++) {
|
|
1667
|
+
const b = r[g], p = Z.querySelector('[sid="' + b.target + '"]');
|
|
1668
|
+
if (p) {
|
|
1669
|
+
const w = p.parentElement;
|
|
1670
|
+
c(b.jointIndex, w);
|
|
1671
1671
|
}
|
|
1672
1672
|
}
|
|
1673
|
-
function c(
|
|
1674
|
-
const
|
|
1675
|
-
o.traverse(function(
|
|
1676
|
-
|
|
1677
|
-
object:
|
|
1673
|
+
function c(g, a) {
|
|
1674
|
+
const b = a.getAttribute("name"), p = n.joints[g];
|
|
1675
|
+
o.traverse(function(w) {
|
|
1676
|
+
w.name === b && (d[g] = {
|
|
1677
|
+
object: w,
|
|
1678
1678
|
transforms: pn(a),
|
|
1679
|
-
joint:
|
|
1680
|
-
position:
|
|
1679
|
+
joint: p,
|
|
1680
|
+
position: p.zeroPosition
|
|
1681
1681
|
});
|
|
1682
1682
|
});
|
|
1683
1683
|
}
|
|
1684
1684
|
const l = new he();
|
|
1685
1685
|
at = {
|
|
1686
1686
|
joints: n && n.joints,
|
|
1687
|
-
getJointValue: function(
|
|
1688
|
-
const a =
|
|
1687
|
+
getJointValue: function(g) {
|
|
1688
|
+
const a = d[g];
|
|
1689
1689
|
if (a)
|
|
1690
1690
|
return a.position;
|
|
1691
|
-
console.warn("THREE.ColladaLoader: Joint " +
|
|
1691
|
+
console.warn("THREE.ColladaLoader: Joint " + g + " doesn't exist.");
|
|
1692
1692
|
},
|
|
1693
|
-
setJointValue: function(
|
|
1694
|
-
const
|
|
1695
|
-
if (
|
|
1696
|
-
const
|
|
1697
|
-
if (a >
|
|
1698
|
-
console.warn("THREE.ColladaLoader: Joint " +
|
|
1699
|
-
else if (
|
|
1700
|
-
console.warn("THREE.ColladaLoader: Joint " +
|
|
1693
|
+
setJointValue: function(g, a) {
|
|
1694
|
+
const b = d[g];
|
|
1695
|
+
if (b) {
|
|
1696
|
+
const p = b.joint;
|
|
1697
|
+
if (a > p.limits.max || a < p.limits.min)
|
|
1698
|
+
console.warn("THREE.ColladaLoader: Joint " + g + " value " + a + " outside of limits (min: " + p.limits.min + ", max: " + p.limits.max + ").");
|
|
1699
|
+
else if (p.static)
|
|
1700
|
+
console.warn("THREE.ColladaLoader: Joint " + g + " is static.");
|
|
1701
1701
|
else {
|
|
1702
|
-
const
|
|
1702
|
+
const w = b.object, y = p.axis, W = b.transforms;
|
|
1703
1703
|
ce.identity();
|
|
1704
|
-
for (let
|
|
1705
|
-
const G = W[
|
|
1706
|
-
if (G.sid && G.sid.indexOf(
|
|
1707
|
-
switch (
|
|
1704
|
+
for (let H = 0; H < W.length; H++) {
|
|
1705
|
+
const G = W[H];
|
|
1706
|
+
if (G.sid && G.sid.indexOf(g) !== -1)
|
|
1707
|
+
switch (p.type) {
|
|
1708
1708
|
case "revolute":
|
|
1709
|
-
ce.multiply(l.makeRotationAxis(
|
|
1709
|
+
ce.multiply(l.makeRotationAxis(y, Le.degToRad(a)));
|
|
1710
1710
|
break;
|
|
1711
1711
|
case "prismatic":
|
|
1712
|
-
ce.multiply(l.makeTranslation(
|
|
1712
|
+
ce.multiply(l.makeTranslation(y.x * a, y.y * a, y.z * a));
|
|
1713
1713
|
break;
|
|
1714
1714
|
default:
|
|
1715
|
-
console.warn("THREE.ColladaLoader: Unknown joint type: " +
|
|
1715
|
+
console.warn("THREE.ColladaLoader: Unknown joint type: " + p.type);
|
|
1716
1716
|
break;
|
|
1717
1717
|
}
|
|
1718
1718
|
else
|
|
@@ -1731,10 +1731,10 @@ class oi extends lt {
|
|
|
1731
1731
|
break;
|
|
1732
1732
|
}
|
|
1733
1733
|
}
|
|
1734
|
-
|
|
1734
|
+
w.matrix.copy(ce), w.matrix.decompose(w.position, w.quaternion, w.scale), d[g].position = a;
|
|
1735
1735
|
}
|
|
1736
1736
|
} else
|
|
1737
|
-
console.log("THREE.ColladaLoader: " +
|
|
1737
|
+
console.log("THREE.ColladaLoader: " + g + " does not exist.");
|
|
1738
1738
|
}
|
|
1739
1739
|
};
|
|
1740
1740
|
}
|
|
@@ -1746,24 +1746,24 @@ class oi extends lt {
|
|
|
1746
1746
|
let o, r;
|
|
1747
1747
|
switch (s.nodeName) {
|
|
1748
1748
|
case "matrix":
|
|
1749
|
-
o =
|
|
1750
|
-
const
|
|
1749
|
+
o = v(s.textContent);
|
|
1750
|
+
const d = new he().fromArray(o).transpose();
|
|
1751
1751
|
e.push({
|
|
1752
1752
|
sid: s.getAttribute("sid"),
|
|
1753
1753
|
type: s.nodeName,
|
|
1754
|
-
obj:
|
|
1754
|
+
obj: d
|
|
1755
1755
|
});
|
|
1756
1756
|
break;
|
|
1757
1757
|
case "translate":
|
|
1758
1758
|
case "scale":
|
|
1759
|
-
o =
|
|
1759
|
+
o = v(s.textContent), r = new pe().fromArray(o), e.push({
|
|
1760
1760
|
sid: s.getAttribute("sid"),
|
|
1761
1761
|
type: s.nodeName,
|
|
1762
1762
|
obj: r
|
|
1763
1763
|
});
|
|
1764
1764
|
break;
|
|
1765
1765
|
case "rotate":
|
|
1766
|
-
o =
|
|
1766
|
+
o = v(s.textContent), r = new pe().fromArray(o);
|
|
1767
1767
|
const c = Le.degToRad(o[3]);
|
|
1768
1768
|
e.push({
|
|
1769
1769
|
sid: s.getAttribute("sid"),
|
|
@@ -1783,8 +1783,8 @@ class oi extends lt {
|
|
|
1783
1783
|
n.hasAttribute("id") === !1 && n.setAttribute("id", Y());
|
|
1784
1784
|
}
|
|
1785
1785
|
}
|
|
1786
|
-
const ce = new he(),
|
|
1787
|
-
function
|
|
1786
|
+
const ce = new he(), Te = new pe();
|
|
1787
|
+
function Pe(t) {
|
|
1788
1788
|
const e = {
|
|
1789
1789
|
name: t.getAttribute("name") || "",
|
|
1790
1790
|
type: t.getAttribute("type"),
|
|
@@ -1805,7 +1805,7 @@ class oi extends lt {
|
|
|
1805
1805
|
let s;
|
|
1806
1806
|
switch (n.nodeName) {
|
|
1807
1807
|
case "node":
|
|
1808
|
-
e.nodes.push(n.getAttribute("id")),
|
|
1808
|
+
e.nodes.push(n.getAttribute("id")), Pe(n);
|
|
1809
1809
|
break;
|
|
1810
1810
|
case "instance_camera":
|
|
1811
1811
|
e.instanceCameras.push(I(n.getAttribute("url")));
|
|
@@ -1823,18 +1823,18 @@ class oi extends lt {
|
|
|
1823
1823
|
e.instanceNodes.push(I(n.getAttribute("url")));
|
|
1824
1824
|
break;
|
|
1825
1825
|
case "matrix":
|
|
1826
|
-
s =
|
|
1826
|
+
s = v(n.textContent), e.matrix.multiply(ce.fromArray(s).transpose()), e.transforms[n.getAttribute("sid")] = n.nodeName;
|
|
1827
1827
|
break;
|
|
1828
1828
|
case "translate":
|
|
1829
|
-
s =
|
|
1829
|
+
s = v(n.textContent), Te.fromArray(s), e.matrix.multiply(ce.makeTranslation(Te.x, Te.y, Te.z)), e.transforms[n.getAttribute("sid")] = n.nodeName;
|
|
1830
1830
|
break;
|
|
1831
1831
|
case "rotate":
|
|
1832
|
-
s =
|
|
1832
|
+
s = v(n.textContent);
|
|
1833
1833
|
const o = Le.degToRad(s[3]);
|
|
1834
|
-
e.matrix.multiply(ce.makeRotationAxis(
|
|
1834
|
+
e.matrix.multiply(ce.makeRotationAxis(Te.fromArray(s), o)), e.transforms[n.getAttribute("sid")] = n.nodeName;
|
|
1835
1835
|
break;
|
|
1836
1836
|
case "scale":
|
|
1837
|
-
s =
|
|
1837
|
+
s = v(n.textContent), e.matrix.scale(Te.fromArray(s)), e.transforms[n.getAttribute("sid")] = n.nodeName;
|
|
1838
1838
|
break;
|
|
1839
1839
|
case "extra":
|
|
1840
1840
|
break;
|
|
@@ -1842,7 +1842,7 @@ class oi extends lt {
|
|
|
1842
1842
|
console.log(n);
|
|
1843
1843
|
}
|
|
1844
1844
|
}
|
|
1845
|
-
return tt(e.id) ? console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.", e.id) :
|
|
1845
|
+
return tt(e.id) ? console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.", e.id) : T.nodes[e.id] = e, e;
|
|
1846
1846
|
}
|
|
1847
1847
|
function Ze(t) {
|
|
1848
1848
|
const e = {
|
|
@@ -1856,8 +1856,8 @@ class oi extends lt {
|
|
|
1856
1856
|
case "bind_material":
|
|
1857
1857
|
const s = n.getElementsByTagName("instance_material");
|
|
1858
1858
|
for (let o = 0; o < s.length; o++) {
|
|
1859
|
-
const r = s[o],
|
|
1860
|
-
e.materials[
|
|
1859
|
+
const r = s[o], d = r.getAttribute("symbol"), c = r.getAttribute("target");
|
|
1860
|
+
e.materials[d] = I(c);
|
|
1861
1861
|
}
|
|
1862
1862
|
break;
|
|
1863
1863
|
case "skeleton":
|
|
@@ -1872,16 +1872,16 @@ class oi extends lt {
|
|
|
1872
1872
|
let s, o, r;
|
|
1873
1873
|
for (s = 0; s < t.length; s++) {
|
|
1874
1874
|
const l = t[s];
|
|
1875
|
-
let
|
|
1875
|
+
let g;
|
|
1876
1876
|
if (tt(l))
|
|
1877
|
-
|
|
1877
|
+
g = Ee(l), Qe(g, e, i);
|
|
1878
1878
|
else if (Nn(l)) {
|
|
1879
|
-
const
|
|
1880
|
-
for (let
|
|
1881
|
-
const
|
|
1882
|
-
if (
|
|
1883
|
-
const
|
|
1884
|
-
Qe(
|
|
1879
|
+
const b = T.visualScenes[l].children;
|
|
1880
|
+
for (let p = 0; p < b.length; p++) {
|
|
1881
|
+
const w = b[p];
|
|
1882
|
+
if (w.type === "JOINT") {
|
|
1883
|
+
const y = Ee(w.id);
|
|
1884
|
+
Qe(y, e, i);
|
|
1885
1885
|
}
|
|
1886
1886
|
}
|
|
1887
1887
|
} else
|
|
@@ -1895,10 +1895,10 @@ class oi extends lt {
|
|
|
1895
1895
|
}
|
|
1896
1896
|
for (s = 0; s < i.length; s++)
|
|
1897
1897
|
r = i[s], r.processed === !1 && (n.push(r), r.processed = !0);
|
|
1898
|
-
const
|
|
1898
|
+
const d = [], c = [];
|
|
1899
1899
|
for (s = 0; s < n.length; s++)
|
|
1900
|
-
r = n[s],
|
|
1901
|
-
return new Kn(
|
|
1900
|
+
r = n[s], d.push(r.bone), c.push(r.boneInverse);
|
|
1901
|
+
return new Kn(d, c);
|
|
1902
1902
|
}
|
|
1903
1903
|
function Qe(t, e, i) {
|
|
1904
1904
|
t.traverse(function(n) {
|
|
@@ -1916,40 +1916,40 @@ class oi extends lt {
|
|
|
1916
1916
|
});
|
|
1917
1917
|
}
|
|
1918
1918
|
function gn(t) {
|
|
1919
|
-
const e = [], i = t.matrix, n = t.nodes, s = t.type, o = t.instanceCameras, r = t.instanceControllers,
|
|
1920
|
-
for (let a = 0,
|
|
1921
|
-
e.push(
|
|
1922
|
-
for (let a = 0,
|
|
1923
|
-
const
|
|
1924
|
-
|
|
1925
|
-
}
|
|
1926
|
-
for (let a = 0,
|
|
1927
|
-
const
|
|
1919
|
+
const e = [], i = t.matrix, n = t.nodes, s = t.type, o = t.instanceCameras, r = t.instanceControllers, d = t.instanceLights, c = t.instanceGeometries, l = t.instanceNodes;
|
|
1920
|
+
for (let a = 0, b = n.length; a < b; a++)
|
|
1921
|
+
e.push(Ee(n[a]));
|
|
1922
|
+
for (let a = 0, b = o.length; a < b; a++) {
|
|
1923
|
+
const p = Ht(o[a]);
|
|
1924
|
+
p !== null && e.push(p.clone());
|
|
1925
|
+
}
|
|
1926
|
+
for (let a = 0, b = r.length; a < b; a++) {
|
|
1927
|
+
const p = r[a], w = N(p.id), y = Ye(w.id), W = et(y, p.materials), H = p.skeletons, G = w.skin.joints, P = bn(H, G);
|
|
1928
1928
|
for (let fe = 0, re = W.length; fe < re; fe++) {
|
|
1929
|
-
const
|
|
1930
|
-
|
|
1929
|
+
const xe = W[fe];
|
|
1930
|
+
xe.isSkinnedMesh && (xe.bind(P, w.skin.bindMatrix), xe.normalizeSkinWeights()), e.push(xe);
|
|
1931
1931
|
}
|
|
1932
1932
|
}
|
|
1933
|
-
for (let a = 0,
|
|
1934
|
-
const
|
|
1935
|
-
|
|
1933
|
+
for (let a = 0, b = d.length; a < b; a++) {
|
|
1934
|
+
const p = Vt(d[a]);
|
|
1935
|
+
p !== null && e.push(p.clone());
|
|
1936
1936
|
}
|
|
1937
|
-
for (let a = 0,
|
|
1938
|
-
const
|
|
1939
|
-
for (let W = 0,
|
|
1940
|
-
e.push(
|
|
1937
|
+
for (let a = 0, b = c.length; a < b; a++) {
|
|
1938
|
+
const p = c[a], w = Ye(p.id), y = et(w, p.materials);
|
|
1939
|
+
for (let W = 0, H = y.length; W < H; W++)
|
|
1940
|
+
e.push(y[W]);
|
|
1941
1941
|
}
|
|
1942
|
-
for (let a = 0,
|
|
1943
|
-
e.push(
|
|
1944
|
-
let
|
|
1942
|
+
for (let a = 0, b = l.length; a < b; a++)
|
|
1943
|
+
e.push(Ee(l[a]).clone());
|
|
1944
|
+
let g;
|
|
1945
1945
|
if (n.length === 0 && e.length === 1)
|
|
1946
|
-
|
|
1946
|
+
g = e[0];
|
|
1947
1947
|
else {
|
|
1948
|
-
|
|
1948
|
+
g = s === "JOINT" ? new Dn() : new pt();
|
|
1949
1949
|
for (let a = 0; a < e.length; a++)
|
|
1950
|
-
|
|
1950
|
+
g.add(e[a]);
|
|
1951
1951
|
}
|
|
1952
|
-
return
|
|
1952
|
+
return g.name = s === "JOINT" ? t.sid : t.name, g.matrix.copy(i), g.matrix.decompose(g.position, g.quaternion, g.scale), g;
|
|
1953
1953
|
}
|
|
1954
1954
|
const yn = new dt({
|
|
1955
1955
|
name: lt.DEFAULT_MATERIAL_NAME,
|
|
@@ -1959,7 +1959,7 @@ class oi extends lt {
|
|
|
1959
1959
|
const i = [];
|
|
1960
1960
|
for (let n = 0, s = t.length; n < s; n++) {
|
|
1961
1961
|
const o = e[t[n]];
|
|
1962
|
-
o === void 0 ? (console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.", t[n]), i.push(yn)) : i.push(
|
|
1962
|
+
o === void 0 ? (console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.", t[n]), i.push(yn)) : i.push(Pt(o));
|
|
1963
1963
|
}
|
|
1964
1964
|
return i;
|
|
1965
1965
|
}
|
|
@@ -1968,25 +1968,25 @@ class oi extends lt {
|
|
|
1968
1968
|
for (const n in t) {
|
|
1969
1969
|
const s = t[n], o = wn(s.materialKeys, e);
|
|
1970
1970
|
if (o.length === 0 && (n === "lines" || n === "linestrips" ? o.push(new bt()) : o.push(new ve())), n === "lines" || n === "linestrips")
|
|
1971
|
-
for (let l = 0,
|
|
1971
|
+
for (let l = 0, g = o.length; l < g; l++) {
|
|
1972
1972
|
const a = o[l];
|
|
1973
1973
|
if (a.isMeshPhongMaterial === !0 || a.isMeshLambertMaterial === !0) {
|
|
1974
|
-
const
|
|
1975
|
-
|
|
1974
|
+
const b = new bt();
|
|
1975
|
+
b.color.copy(a.color), b.opacity = a.opacity, b.transparent = a.transparent, o[l] = b;
|
|
1976
1976
|
}
|
|
1977
1977
|
}
|
|
1978
|
-
const r = s.data.attributes.skinIndex !== void 0,
|
|
1978
|
+
const r = s.data.attributes.skinIndex !== void 0, d = o.length === 1 ? o[0] : o;
|
|
1979
1979
|
let c;
|
|
1980
1980
|
switch (n) {
|
|
1981
1981
|
case "lines":
|
|
1982
|
-
c = new Wn(s.data,
|
|
1982
|
+
c = new Wn(s.data, d);
|
|
1983
1983
|
break;
|
|
1984
1984
|
case "linestrips":
|
|
1985
|
-
c = new Jn(s.data,
|
|
1985
|
+
c = new Jn(s.data, d);
|
|
1986
1986
|
break;
|
|
1987
1987
|
case "triangles":
|
|
1988
1988
|
case "polylist":
|
|
1989
|
-
r ? c = new Vn(s.data,
|
|
1989
|
+
r ? c = new Vn(s.data, d) : c = new Ce(s.data, d);
|
|
1990
1990
|
break;
|
|
1991
1991
|
}
|
|
1992
1992
|
i.push(c);
|
|
@@ -1994,10 +1994,10 @@ class oi extends lt {
|
|
|
1994
1994
|
return i;
|
|
1995
1995
|
}
|
|
1996
1996
|
function tt(t) {
|
|
1997
|
-
return
|
|
1997
|
+
return T.nodes[t] !== void 0;
|
|
1998
1998
|
}
|
|
1999
|
-
function
|
|
2000
|
-
return ee(
|
|
1999
|
+
function Ee(t) {
|
|
2000
|
+
return ee(T.nodes[t], gn);
|
|
2001
2001
|
}
|
|
2002
2002
|
function kn(t) {
|
|
2003
2003
|
const e = {
|
|
@@ -2007,8 +2007,8 @@ class oi extends lt {
|
|
|
2007
2007
|
mn(t);
|
|
2008
2008
|
const i = R(t, "node");
|
|
2009
2009
|
for (let n = 0; n < i.length; n++)
|
|
2010
|
-
e.children.push(
|
|
2011
|
-
|
|
2010
|
+
e.children.push(Pe(i[n]));
|
|
2011
|
+
T.visualScenes[t.getAttribute("id")] = e;
|
|
2012
2012
|
}
|
|
2013
2013
|
function nt(t) {
|
|
2014
2014
|
const e = new pt();
|
|
@@ -2016,26 +2016,26 @@ class oi extends lt {
|
|
|
2016
2016
|
const i = t.children;
|
|
2017
2017
|
for (let n = 0; n < i.length; n++) {
|
|
2018
2018
|
const s = i[n];
|
|
2019
|
-
e.add(
|
|
2019
|
+
e.add(Ee(s.id));
|
|
2020
2020
|
}
|
|
2021
2021
|
return e;
|
|
2022
2022
|
}
|
|
2023
2023
|
function Nn(t) {
|
|
2024
|
-
return
|
|
2024
|
+
return T.visualScenes[t] !== void 0;
|
|
2025
2025
|
}
|
|
2026
2026
|
function it(t) {
|
|
2027
|
-
return ee(
|
|
2027
|
+
return ee(T.visualScenes[t], nt);
|
|
2028
2028
|
}
|
|
2029
2029
|
function An(t) {
|
|
2030
2030
|
const e = R(t, "instance_visual_scene")[0];
|
|
2031
2031
|
return it(I(e.getAttribute("url")));
|
|
2032
2032
|
}
|
|
2033
2033
|
function Tn() {
|
|
2034
|
-
const t =
|
|
2034
|
+
const t = T.clips;
|
|
2035
2035
|
if (ne(t) === !0) {
|
|
2036
|
-
if (ne(
|
|
2036
|
+
if (ne(T.animations) === !1) {
|
|
2037
2037
|
const e = [];
|
|
2038
|
-
for (const i in
|
|
2038
|
+
for (const i in T.animations) {
|
|
2039
2039
|
const n = U(i);
|
|
2040
2040
|
for (let s = 0, o = n.length; s < o; s++)
|
|
2041
2041
|
e.push(n[s]);
|
|
@@ -2044,7 +2044,7 @@ class oi extends lt {
|
|
|
2044
2044
|
}
|
|
2045
2045
|
} else
|
|
2046
2046
|
for (const e in t)
|
|
2047
|
-
Ie.push(
|
|
2047
|
+
Ie.push(D(e));
|
|
2048
2048
|
}
|
|
2049
2049
|
function En(t) {
|
|
2050
2050
|
let e = "";
|
|
@@ -2058,22 +2058,22 @@ class oi extends lt {
|
|
|
2058
2058
|
}
|
|
2059
2059
|
if (O.length === 0)
|
|
2060
2060
|
return { scene: new Mn() };
|
|
2061
|
-
const st = new DOMParser().parseFromString(O, "application/xml"), Z = R(st, "COLLADA")[0],
|
|
2062
|
-
if (
|
|
2063
|
-
const t = R(
|
|
2061
|
+
const st = new DOMParser().parseFromString(O, "application/xml"), Z = R(st, "COLLADA")[0], qe = st.getElementsByTagName("parsererror")[0];
|
|
2062
|
+
if (qe !== void 0) {
|
|
2063
|
+
const t = R(qe, "div")[0];
|
|
2064
2064
|
let e;
|
|
2065
|
-
return t ? e = t.textContent : e = En(
|
|
2065
|
+
return t ? e = t.textContent : e = En(qe), console.error(`THREE.ColladaLoader: Failed to parse collada file.
|
|
2066
2066
|
`, e), null;
|
|
2067
2067
|
}
|
|
2068
2068
|
const xn = Z.getAttribute("version");
|
|
2069
2069
|
console.debug("THREE.ColladaLoader: File version", xn);
|
|
2070
|
-
const ot =
|
|
2070
|
+
const ot = we(R(Z, "asset")[0]), rt = new Tt(this.manager);
|
|
2071
2071
|
rt.setPath(this.resourcePath || Q).setCrossOrigin(this.crossOrigin);
|
|
2072
|
-
let
|
|
2073
|
-
wt && (
|
|
2072
|
+
let je;
|
|
2073
|
+
wt && (je = new wt(this.manager), je.setPath(this.resourcePath || Q));
|
|
2074
2074
|
const Re = new ut(), Ie = [];
|
|
2075
2075
|
let at = {}, _n = 0;
|
|
2076
|
-
const
|
|
2076
|
+
const T = {
|
|
2077
2077
|
animations: {},
|
|
2078
2078
|
clips: {},
|
|
2079
2079
|
controllers: {},
|
|
@@ -2089,24 +2089,24 @@ class oi extends lt {
|
|
|
2089
2089
|
physicsModels: {},
|
|
2090
2090
|
kinematicsScenes: {}
|
|
2091
2091
|
};
|
|
2092
|
-
$(Z, "library_animations", "animation", be), $(Z, "library_animation_clips", "animation_clip",
|
|
2092
|
+
$(Z, "library_animations", "animation", be), $(Z, "library_animation_clips", "animation_clip", u), $(Z, "library_controllers", "controller", B), $(Z, "library_images", "image", f), $(Z, "library_effects", "effect", le), $(Z, "library_materials", "material", Ot), $(Z, "library_cameras", "camera", qt), $(Z, "library_lights", "light", Bt), $(Z, "library_geometries", "geometry", Jt), $(Z, "library_nodes", "node", Pe), $(Z, "library_visual_scenes", "visual_scene", kn), $(Z, "library_kinematics_models", "kinematics_model", Zt), $(Z, "library_physics_models", "physics_model", rn), $(Z, "scene", "instance_kinematics_scene", ln), ie(T.animations, q), ie(T.clips, K), ie(T.controllers, _), ie(T.images, A), ie(T.effects, De), ie(T.materials, Ve), ie(T.cameras, Je), ie(T.lights, We), ie(T.geometries, Ke), ie(T.visualScenes, nt), Tn(), hn();
|
|
2093
2093
|
const Me = An(R(Z, "scene")[0]);
|
|
2094
2094
|
return Me.animations = Ie, ot.upAxis === "Z_UP" && (console.warn("THREE.ColladaLoader: You are loading an asset with a Z-UP coordinate system. The loader just rotates the asset to transform it into Y-UP. The vertex data are not converted, see #24289."), Me.rotation.set(-Math.PI / 2, 0, 0)), Me.scale.multiplyScalar(ot.unit), {
|
|
2095
2095
|
get animations() {
|
|
2096
2096
|
return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."), Ie;
|
|
2097
2097
|
},
|
|
2098
2098
|
kinematics: at,
|
|
2099
|
-
library:
|
|
2099
|
+
library: T,
|
|
2100
2100
|
scene: Me
|
|
2101
2101
|
};
|
|
2102
2102
|
}
|
|
2103
2103
|
}
|
|
2104
|
-
const
|
|
2105
|
-
function
|
|
2104
|
+
const Fe = new Et(), kt = new si();
|
|
2105
|
+
function _e(ue) {
|
|
2106
2106
|
return ue ? ue.trim().split(/\s+/g).map((O) => parseFloat(O)) : [0, 0, 0];
|
|
2107
2107
|
}
|
|
2108
2108
|
function Nt(ue, O, Q = !1) {
|
|
2109
|
-
Q || ue.rotation.set(0, 0, 0), kt.set(O[0], O[1], O[2], "ZYX"),
|
|
2109
|
+
Q || ue.rotation.set(0, 0, 0), kt.set(O[0], O[1], O[2], "ZYX"), Fe.setFromEuler(kt), Fe.multiply(ue.quaternion), ue.quaternion.copy(Fe);
|
|
2110
2110
|
}
|
|
2111
2111
|
class ci {
|
|
2112
2112
|
constructor(O) {
|
|
@@ -2121,181 +2121,176 @@ class ci {
|
|
|
2121
2121
|
// urdf: The path to the URDF within the package OR absolute
|
|
2122
2122
|
// onComplete: Callback that is passed the model once loaded
|
|
2123
2123
|
load(O, Q, R, se) {
|
|
2124
|
-
const
|
|
2125
|
-
|
|
2124
|
+
const v = this.manager, oe = At.extractUrlBase(O), I = this.manager.resolveURL(O);
|
|
2125
|
+
v.itemStart(I), fetch(I, this.fetchOptions).then((Y) => {
|
|
2126
2126
|
if (Y.ok)
|
|
2127
2127
|
return R && R(null), Y.text();
|
|
2128
2128
|
throw new Error(`URDFLoader: Failed to load url '${I}' with error code ${Y.status} : ${Y.statusText}.`);
|
|
2129
2129
|
}).then((Y) => {
|
|
2130
2130
|
const ne = this.parse(Y, this.workingPath || oe);
|
|
2131
|
-
Q(ne),
|
|
2131
|
+
Q(ne), v.itemEnd(I);
|
|
2132
2132
|
}).catch((Y) => {
|
|
2133
|
-
se ? se(Y) : console.error("URDFLoader: Error loading file.", Y),
|
|
2133
|
+
se ? se(Y) : console.error("URDFLoader: Error loading file.", Y), v.itemError(I), v.itemEnd(I);
|
|
2134
2134
|
});
|
|
2135
2135
|
}
|
|
2136
2136
|
parse(O, Q = this.workingPath) {
|
|
2137
|
-
const R = this.packages, se = this.loadMeshCb,
|
|
2138
|
-
function
|
|
2137
|
+
const R = this.packages, se = this.loadMeshCb, v = this.parseVisual, oe = this.parseCollision, I = this.manager, Y = {}, ne = {}, we = {};
|
|
2138
|
+
function ke(M) {
|
|
2139
2139
|
if (!/^package:\/\//.test(M))
|
|
2140
2140
|
return Q ? Q + M : M;
|
|
2141
|
-
const [
|
|
2141
|
+
const [q, U] = M.replace(/^package:\/\//, "").split(/\/(.+)/);
|
|
2142
2142
|
if (typeof R == "string")
|
|
2143
|
-
return R.endsWith(
|
|
2144
|
-
if (
|
|
2145
|
-
return R(
|
|
2143
|
+
return R.endsWith(q) ? R + "/" + U : R + "/" + q + "/" + U;
|
|
2144
|
+
if (R instanceof Function)
|
|
2145
|
+
return R(q) + "/" + U;
|
|
2146
2146
|
if (typeof R == "object")
|
|
2147
|
-
return
|
|
2147
|
+
return q in R ? R[q] + "/" + U : (console.error(`URDFLoader : ${q} not found in provided package list.`), null);
|
|
2148
2148
|
}
|
|
2149
|
-
function
|
|
2150
|
-
let
|
|
2151
|
-
M instanceof Document ?
|
|
2152
|
-
const U =
|
|
2149
|
+
function Ne(M) {
|
|
2150
|
+
let q;
|
|
2151
|
+
M instanceof Document ? q = [...M.children] : M instanceof Element ? q = [M] : q = [...new DOMParser().parseFromString(M, "text/xml").children];
|
|
2152
|
+
const U = q.filter((E) => E.nodeName === "robot").pop();
|
|
2153
2153
|
return $(U);
|
|
2154
2154
|
}
|
|
2155
2155
|
function $(M) {
|
|
2156
|
-
const
|
|
2157
|
-
S.robotName = M.getAttribute("name"), S.urdfRobotNode = M,
|
|
2158
|
-
const k =
|
|
2159
|
-
|
|
2156
|
+
const q = [...M.children], U = q.filter((L) => L.nodeName.toLowerCase() === "link"), E = q.filter((L) => L.nodeName.toLowerCase() === "joint"), J = q.filter((L) => L.nodeName.toLowerCase() === "material"), S = new Xn();
|
|
2157
|
+
S.robotName = M.getAttribute("name"), S.urdfRobotNode = M, J.forEach((L) => {
|
|
2158
|
+
const k = L.getAttribute("name");
|
|
2159
|
+
we[k] = be(L);
|
|
2160
2160
|
});
|
|
2161
|
-
const
|
|
2162
|
-
U.forEach((
|
|
2163
|
-
const k =
|
|
2164
|
-
Y[k] = ee(
|
|
2165
|
-
}),
|
|
2166
|
-
const k =
|
|
2167
|
-
ne[k] = ie(
|
|
2168
|
-
}), S.joints = ne, S.links = Y, S.colliders =
|
|
2169
|
-
const
|
|
2170
|
-
return
|
|
2171
|
-
|
|
2172
|
-
}),
|
|
2173
|
-
const k = /* @__PURE__ */ new Set(),
|
|
2161
|
+
const m = {}, h = {};
|
|
2162
|
+
U.forEach((L) => {
|
|
2163
|
+
const k = L.getAttribute("name"), j = M.querySelector(`child[link="${k}"]`) === null;
|
|
2164
|
+
Y[k] = ee(L, m, h, j ? S : null);
|
|
2165
|
+
}), E.forEach((L) => {
|
|
2166
|
+
const k = L.getAttribute("name");
|
|
2167
|
+
ne[k] = ie(L);
|
|
2168
|
+
}), S.joints = ne, S.links = Y, S.colliders = h, S.visual = m;
|
|
2169
|
+
const C = Object.values(ne);
|
|
2170
|
+
return C.forEach((L) => {
|
|
2171
|
+
L instanceof yt && ne[L.mimicJoint].mimicJoints.push(L);
|
|
2172
|
+
}), C.forEach((L) => {
|
|
2173
|
+
const k = /* @__PURE__ */ new Set(), j = (ae) => {
|
|
2174
2174
|
if (k.has(ae))
|
|
2175
2175
|
throw new Error("URDFLoader: Detected an infinite loop of mimic joints.");
|
|
2176
2176
|
k.add(ae), ae.mimicJoints.forEach((te) => {
|
|
2177
|
-
|
|
2177
|
+
j(te);
|
|
2178
2178
|
});
|
|
2179
2179
|
};
|
|
2180
|
-
|
|
2180
|
+
j(L);
|
|
2181
2181
|
}), S.frames = {
|
|
2182
|
-
...
|
|
2183
|
-
...
|
|
2182
|
+
...h,
|
|
2183
|
+
...m,
|
|
2184
2184
|
...Y,
|
|
2185
2185
|
...ne
|
|
2186
2186
|
}, S;
|
|
2187
2187
|
}
|
|
2188
2188
|
function ie(M) {
|
|
2189
|
-
const
|
|
2190
|
-
let
|
|
2191
|
-
const
|
|
2192
|
-
|
|
2193
|
-
let S = null,
|
|
2194
|
-
|
|
2195
|
-
const
|
|
2196
|
-
|
|
2197
|
-
}), S.add(
|
|
2198
|
-
const
|
|
2199
|
-
if (
|
|
2200
|
-
const k =
|
|
2201
|
-
|
|
2202
|
-
}
|
|
2203
|
-
return
|
|
2204
|
-
}
|
|
2205
|
-
function ee(M,
|
|
2206
|
-
|
|
2207
|
-
const
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
}), C && D.filter((d) => d.nodeName.toLowerCase() === "visual").forEach((d) => {
|
|
2214
|
-
const L = ye(d, ke);
|
|
2215
|
-
if (b.add(L), d.hasAttribute("name")) {
|
|
2216
|
-
const x = d.getAttribute("name");
|
|
2217
|
-
L.name = x, L.urdfName = x, P[x] = L;
|
|
2189
|
+
const q = [...M.children], U = M.getAttribute("type");
|
|
2190
|
+
let E;
|
|
2191
|
+
const J = q.find((k) => k.nodeName.toLowerCase() === "mimic");
|
|
2192
|
+
J ? (E = new yt(), E.mimicJoint = J.getAttribute("joint"), E.multiplier = parseFloat(J.getAttribute("multiplier") || 1), E.offset = parseFloat(J.getAttribute("offset") || 0)) : E = new $n(), E.urdfNode = M, E.name = M.getAttribute("name"), E.urdfName = E.name, E.jointType = U;
|
|
2193
|
+
let S = null, m = null, h = [0, 0, 0], C = [0, 0, 0];
|
|
2194
|
+
q.forEach((k) => {
|
|
2195
|
+
const j = k.nodeName.toLowerCase();
|
|
2196
|
+
j === "origin" ? (h = _e(k.getAttribute("xyz")), C = _e(k.getAttribute("rpy"))) : j === "child" ? m = Y[k.getAttribute("link")] : j === "parent" ? S = Y[k.getAttribute("link")] : j === "limit" && (E.limit.lower = parseFloat(k.getAttribute("lower") || E.limit.lower), E.limit.upper = parseFloat(k.getAttribute("upper") || E.limit.upper));
|
|
2197
|
+
}), S.add(E), E.add(m), Nt(E, C), E.position.set(h[0], h[1], h[2]);
|
|
2198
|
+
const L = q.filter((k) => k.nodeName.toLowerCase() === "axis")[0];
|
|
2199
|
+
if (L) {
|
|
2200
|
+
const k = L.getAttribute("xyz").split(/\s+/g).map((j) => parseFloat(j));
|
|
2201
|
+
E.axis = new pe(k[0], k[1], k[2]), E.axis.normalize();
|
|
2202
|
+
}
|
|
2203
|
+
return E;
|
|
2204
|
+
}
|
|
2205
|
+
function ee(M, q, U, E = null) {
|
|
2206
|
+
E === null && (E = new Zn());
|
|
2207
|
+
const J = [...M.children];
|
|
2208
|
+
return E.name = M.getAttribute("name"), E.urdfName = E.name, E.urdfNode = M, v && J.filter((m) => m.nodeName.toLowerCase() === "visual").forEach((m) => {
|
|
2209
|
+
const h = ge(m, we);
|
|
2210
|
+
if (E.add(h), m.hasAttribute("name")) {
|
|
2211
|
+
const C = m.getAttribute("name");
|
|
2212
|
+
h.name = C, h.urdfName = C, q[C] = h;
|
|
2218
2213
|
}
|
|
2219
|
-
}), oe &&
|
|
2220
|
-
const
|
|
2221
|
-
if (
|
|
2222
|
-
const
|
|
2223
|
-
|
|
2214
|
+
}), oe && J.filter((m) => m.nodeName.toLowerCase() === "collision").forEach((m) => {
|
|
2215
|
+
const h = ge(m);
|
|
2216
|
+
if (E.add(h), m.hasAttribute("name")) {
|
|
2217
|
+
const C = m.getAttribute("name");
|
|
2218
|
+
h.name = C, h.urdfName = C, U[C] = h;
|
|
2224
2219
|
}
|
|
2225
|
-
}),
|
|
2220
|
+
}), E;
|
|
2226
2221
|
}
|
|
2227
2222
|
function be(M) {
|
|
2228
|
-
const
|
|
2229
|
-
return U.name = M.getAttribute("name") || "",
|
|
2230
|
-
const
|
|
2231
|
-
if (
|
|
2232
|
-
const S =
|
|
2223
|
+
const q = [...M.children], U = new ve();
|
|
2224
|
+
return U.name = M.getAttribute("name") || "", q.forEach((E) => {
|
|
2225
|
+
const J = E.nodeName.toLowerCase();
|
|
2226
|
+
if (J === "color") {
|
|
2227
|
+
const S = E.getAttribute("rgba").split(/\s/g).map((m) => parseFloat(m));
|
|
2233
2228
|
U.color.setRGB(S[0], S[1], S[2]), U.opacity = S[3], U.transparent = S[3] < 1, U.depthWrite = !U.transparent;
|
|
2234
|
-
} else if (
|
|
2235
|
-
const S =
|
|
2229
|
+
} else if (J === "texture") {
|
|
2230
|
+
const S = E.getAttribute("filename");
|
|
2236
2231
|
if (S) {
|
|
2237
|
-
const
|
|
2238
|
-
U.map =
|
|
2232
|
+
const m = new Tt(I), h = ke(S);
|
|
2233
|
+
U.map = m.load(h), U.map.colorSpace = me;
|
|
2239
2234
|
}
|
|
2240
2235
|
}
|
|
2241
2236
|
}), U;
|
|
2242
2237
|
}
|
|
2243
|
-
function
|
|
2244
|
-
const U = M.nodeName.toLowerCase() === "collision",
|
|
2245
|
-
let
|
|
2246
|
-
const S =
|
|
2238
|
+
function ge(M, q = {}) {
|
|
2239
|
+
const U = M.nodeName.toLowerCase() === "collision", E = [...M.children];
|
|
2240
|
+
let J = null;
|
|
2241
|
+
const S = E.filter((h) => h.nodeName.toLowerCase() === "material")[0];
|
|
2247
2242
|
if (S) {
|
|
2248
|
-
const
|
|
2249
|
-
|
|
2243
|
+
const h = S.getAttribute("name");
|
|
2244
|
+
h && h in q ? J = q[h] : J = be(S);
|
|
2250
2245
|
} else
|
|
2251
|
-
|
|
2252
|
-
const
|
|
2253
|
-
return
|
|
2254
|
-
const
|
|
2255
|
-
if (
|
|
2256
|
-
const
|
|
2257
|
-
if (
|
|
2258
|
-
const k =
|
|
2259
|
-
if (
|
|
2260
|
-
const ae =
|
|
2246
|
+
J = new ve();
|
|
2247
|
+
const m = U ? new Qn() : new ei();
|
|
2248
|
+
return m.urdfNode = M, E.forEach((h) => {
|
|
2249
|
+
const C = h.nodeName.toLowerCase();
|
|
2250
|
+
if (C === "geometry") {
|
|
2251
|
+
const L = h.children[0].nodeName.toLowerCase();
|
|
2252
|
+
if (L === "mesh") {
|
|
2253
|
+
const k = h.children[0].getAttribute("filename"), j = ke(k);
|
|
2254
|
+
if (j !== null) {
|
|
2255
|
+
const ae = h.children[0].getAttribute("scale");
|
|
2261
2256
|
if (ae) {
|
|
2262
|
-
const te =
|
|
2263
|
-
|
|
2257
|
+
const te = _e(ae);
|
|
2258
|
+
m.scale.set(te[0], te[1], te[2]);
|
|
2264
2259
|
}
|
|
2265
|
-
se(
|
|
2266
|
-
|
|
2260
|
+
se(j, I, (te, u) => {
|
|
2261
|
+
u ? console.error("URDFLoader: Error loading mesh.", u) : te && (te instanceof Ce && (te.material = J), te.position.set(0, 0, 0), te.quaternion.identity(), m.add(te));
|
|
2267
2262
|
});
|
|
2268
2263
|
}
|
|
2269
|
-
} else if (
|
|
2264
|
+
} else if (L === "box") {
|
|
2270
2265
|
const k = new Ce();
|
|
2271
|
-
k.geometry = new ti(1, 1, 1), k.material =
|
|
2272
|
-
const
|
|
2273
|
-
k.scale.set(
|
|
2274
|
-
} else if (
|
|
2266
|
+
k.geometry = new ti(1, 1, 1), k.material = J;
|
|
2267
|
+
const j = _e(h.children[0].getAttribute("size"));
|
|
2268
|
+
k.scale.set(j[0], j[1], j[2]), m.add(k);
|
|
2269
|
+
} else if (L === "sphere") {
|
|
2275
2270
|
const k = new Ce();
|
|
2276
|
-
k.geometry = new ni(1, 30, 30), k.material =
|
|
2277
|
-
const
|
|
2278
|
-
k.scale.set(
|
|
2279
|
-
} else if (
|
|
2271
|
+
k.geometry = new ni(1, 30, 30), k.material = J;
|
|
2272
|
+
const j = parseFloat(h.children[0].getAttribute("radius")) || 0;
|
|
2273
|
+
k.scale.set(j, j, j), m.add(k);
|
|
2274
|
+
} else if (L === "cylinder") {
|
|
2280
2275
|
const k = new Ce();
|
|
2281
|
-
k.geometry = new ii(1, 1, 1, 30), k.material =
|
|
2282
|
-
const
|
|
2283
|
-
k.scale.set(
|
|
2276
|
+
k.geometry = new ii(1, 1, 1, 30), k.material = J;
|
|
2277
|
+
const j = parseFloat(h.children[0].getAttribute("radius")) || 0, ae = parseFloat(h.children[0].getAttribute("length")) || 0;
|
|
2278
|
+
k.scale.set(j, ae, j), k.rotation.set(Math.PI / 2, 0, 0), m.add(k);
|
|
2284
2279
|
}
|
|
2285
|
-
} else if (
|
|
2286
|
-
const
|
|
2287
|
-
|
|
2280
|
+
} else if (C === "origin") {
|
|
2281
|
+
const L = _e(h.getAttribute("xyz")), k = _e(h.getAttribute("rpy"));
|
|
2282
|
+
m.position.set(L[0], L[1], L[2]), m.rotation.set(0, 0, 0), Nt(m, k);
|
|
2288
2283
|
}
|
|
2289
|
-
}),
|
|
2284
|
+
}), m;
|
|
2290
2285
|
}
|
|
2291
|
-
return
|
|
2286
|
+
return Ne(O);
|
|
2292
2287
|
}
|
|
2293
2288
|
// Default mesh loading function
|
|
2294
2289
|
defaultMeshLoader(O, Q, R) {
|
|
2295
|
-
/\.stl$/i.test(O) ? new Ln(Q).load(O, (
|
|
2296
|
-
const oe = new Ce(
|
|
2290
|
+
/\.stl$/i.test(O) ? new Ln(Q).load(O, (v) => {
|
|
2291
|
+
const oe = new Ce(v, new ve());
|
|
2297
2292
|
R(oe);
|
|
2298
|
-
}
|
|
2293
|
+
}) : /\.dae$/i.test(O) ? new oi(Q).load(O, (v) => R(v.scene)) : console.warn(`URDFLoader: Could not load model at ${O}.
|
|
2299
2294
|
No loader available`);
|
|
2300
2295
|
}
|
|
2301
2296
|
}
|