ss-component-new 1.3.813 → 1.3.815
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-Cw11TWAL.js → MTLLoader-DeqHL-AI.js} +39 -39
- package/dist/{URDFLoader-DUzCZjnV.js → URDFLoader-CiSgFgWK.js} +156 -156
- package/dist/{animationData-DwQetFQD.js → animationData-CVVm5rD_.js} +11 -11
- package/dist/{array-COidmpRY.js → array-8BOBukwZ.js} +178 -178
- package/dist/{iconfont-Ij2RVNFj.js → iconfont-CuxO25jz.js} +1 -1
- package/dist/{index-dh1Gi7jC.js → index-BGAhYPQI.js} +1 -1
- package/dist/{index-CcBUPD0v.js → index-BjbnnFmN.js} +3 -3
- package/dist/{index-CXY_sgN_.js → index-BrVAczXU.js} +4 -4
- package/dist/{index-Cv6rlCAH.js → index-Bz7cdL2l.js} +19463 -19316
- package/dist/{index-Cd11-eam.js → index-C4x5BF6v.js} +7191 -7184
- package/dist/{index-Dsce3BX1.js → index-CHKlT3mb.js} +3 -3
- package/dist/{index-CCZspl83.js → index-CKWkVjdr.js} +1 -1
- package/dist/{index-DQryAYzQ.js → index-DCFvBMG1.js} +1 -1
- package/dist/{index-DqizREJ2.js → index-DZe4W71_.js} +1 -1
- package/dist/{index-KEw10uzh.js → index-DmiiVNgM.js} +1 -1
- package/dist/{index-B7P0-Odj.js → index-DzNKmhm_.js} +2 -2
- package/dist/{index-B4kaaRbF.js → index-djF386bV.js} +1567 -1563
- package/dist/{index-D8-0gsl7.js → index-fLaMmGT7.js} +4 -4
- package/dist/{index-ZhT8hVC2.js → index-sDRXkpeY.js} +10 -10
- package/dist/{index-CaLfl7ix.js → index-vMStskjM.js} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_05e3a1d8_lang-DFJL-r6K.js → index.vue_vue_type_style_index_0_scoped_05e3a1d8_lang-CZUHaA2-.js} +4419 -4411
- package/dist/{main-fNwMqnvv.js → main-CK-3ac4L.js} +2 -2
- package/dist/ss-component.css +2 -2
- package/dist/ss-component.js +8 -8
- package/dist/ss-component2.js +8 -8
- package/dist/{threeModel-BeCT-wuA.js → threeModel-5jLpnZxT.js} +49 -49
- package/dist/{threePreview-BnPPysvl.js → threePreview-E6bBnyEu.js} +1258 -1103
- package/dist/{threeSceneView-C_KAY9V1.js → threeSceneView-CIBq_Yjm.js} +71 -69
- package/dist/{threeSceneViewForCPMPIP-uac2fzAK.js → threeSceneViewForCPMPIP-BwD010zk.js} +7 -7
- package/dist/{threeTrackPathView-Ugj5_KnE.js → threeTrackPathView-B1FFx8pz.js} +31 -31
- package/dist/{threeViewerHost-Dv0JTTnu.js → threeViewerHost-RF4w3At4.js} +2 -2
- package/dist/{urdfTree-CLtWTrD6.js → urdfTree-B8y6pXfi.js} +1 -1
- package/dist/{workpieceTreePanel-Ch75Cqlr.js → workpieceTreePanel-v_yqJYFX.js} +35 -35
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { S as Ln } from "./MTLLoader-
|
|
2
|
-
import {
|
|
1
|
+
import { S as Ln } from "./MTLLoader-DeqHL-AI.js";
|
|
2
|
+
import { bi as vn, ax as Rn, U as lt, al as At, Y as In, V as pe, n as he, aH as dt, S as Mn, au as Tt, C as ut, o as Le, aO as ft, bj as Sn, k as ve, aX as Se, c as me, an as On, l as Gn, a5 as Pn, P as ht, aM as qn, i as jn, ap as Un, j as Fn, D as Hn, s as pt, ar as Et, aU as mt, aW as Bn, u as Dn, Z as ye, aP as zn, a3 as bt, aJ as Vn, h as Ce, w as Jn, aK as Kn, aN as Wn, aD as Oe, aF as gt, bk as Yn, bl as Xn, bm as yt, bn as $n, bo as Zn, bp as Qn, bq as ei, a1 as ti, br as ni, a_ as ii, E as si } from "./index.vue_vue_type_style_index_0_scoped_05e3a1d8_lang-CZUHaA2-.js";
|
|
3
3
|
class wt extends vn {
|
|
4
4
|
/**
|
|
5
5
|
* Constructs a new TGA loader.
|
|
6
6
|
*
|
|
7
7
|
* @param {LoadingManager} [manager] - The loading manager.
|
|
8
8
|
*/
|
|
9
|
-
constructor(
|
|
10
|
-
super(
|
|
9
|
+
constructor(O) {
|
|
10
|
+
super(O);
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Parses the given TGA texture data.
|
|
@@ -15,7 +15,7 @@ class wt extends vn {
|
|
|
15
15
|
* @param {ArrayBuffer} buffer - The raw texture data.
|
|
16
16
|
* @return {DataTextureLoader~TexData} An object representing the parsed texture data.
|
|
17
17
|
*/
|
|
18
|
-
parse(
|
|
18
|
+
parse(O) {
|
|
19
19
|
function Q(u) {
|
|
20
20
|
switch (u.image_type) {
|
|
21
21
|
// check indexed type
|
|
@@ -44,10 +44,10 @@ class wt extends vn {
|
|
|
44
44
|
if (u.pixel_size !== 8 && u.pixel_size !== 16 && u.pixel_size !== 24 && u.pixel_size !== 32)
|
|
45
45
|
throw new Error("THREE.TGALoader: Invalid pixel size " + u.pixel_size);
|
|
46
46
|
}
|
|
47
|
-
function R(u,
|
|
47
|
+
function R(u, W, z, B, X) {
|
|
48
48
|
let U, D;
|
|
49
49
|
const _ = z.pixel_size >> 3, x = z.width * z.height * _;
|
|
50
|
-
if (
|
|
50
|
+
if (W && (D = X.subarray(B, B += z.colormap_length * (z.colormap_size >> 3))), u) {
|
|
51
51
|
U = new Uint8Array(x);
|
|
52
52
|
let N, f, A, V = 0;
|
|
53
53
|
const le = new Uint8Array(_);
|
|
@@ -66,77 +66,77 @@ class wt extends vn {
|
|
|
66
66
|
} else
|
|
67
67
|
U = X.subarray(
|
|
68
68
|
B,
|
|
69
|
-
B +=
|
|
69
|
+
B += W ? z.width * z.height : x
|
|
70
70
|
);
|
|
71
71
|
return {
|
|
72
72
|
pixel_data: U,
|
|
73
73
|
palettes: D
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
-
function se(u,
|
|
76
|
+
function se(u, W, z, B, X, U, D, _, x) {
|
|
77
77
|
const N = x;
|
|
78
78
|
let f, A = 0, V, le;
|
|
79
79
|
const Ae = C.width;
|
|
80
|
-
for (le =
|
|
80
|
+
for (le = W; le !== B; le += z)
|
|
81
81
|
for (V = X; V !== D; V += U, A++)
|
|
82
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
83
|
return u;
|
|
84
84
|
}
|
|
85
|
-
function v(u,
|
|
85
|
+
function v(u, W, z, B, X, U, D, _) {
|
|
86
86
|
let x, N = 0, f, A;
|
|
87
87
|
const V = C.width;
|
|
88
|
-
for (A =
|
|
88
|
+
for (A = W; A !== B; A += z)
|
|
89
89
|
for (f = X; f !== D; f += U, N += 2)
|
|
90
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
91
|
return u;
|
|
92
92
|
}
|
|
93
|
-
function oe(u,
|
|
93
|
+
function oe(u, W, z, B, X, U, D, _) {
|
|
94
94
|
let x = 0, N, f;
|
|
95
95
|
const A = C.width;
|
|
96
|
-
for (f =
|
|
96
|
+
for (f = W; f !== B; f += z)
|
|
97
97
|
for (N = X; N !== D; N += U, x += 3)
|
|
98
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
99
|
return u;
|
|
100
100
|
}
|
|
101
|
-
function I(u,
|
|
101
|
+
function I(u, W, z, B, X, U, D, _) {
|
|
102
102
|
let x = 0, N, f;
|
|
103
103
|
const A = C.width;
|
|
104
|
-
for (f =
|
|
104
|
+
for (f = W; f !== B; f += z)
|
|
105
105
|
for (N = X; N !== D; N += U, x += 4)
|
|
106
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
107
|
return u;
|
|
108
108
|
}
|
|
109
|
-
function Y(u,
|
|
109
|
+
function Y(u, W, z, B, X, U, D, _) {
|
|
110
110
|
let x, N = 0, f, A;
|
|
111
111
|
const V = C.width;
|
|
112
|
-
for (A =
|
|
112
|
+
for (A = W; A !== B; A += z)
|
|
113
113
|
for (f = X; f !== D; f += U, N++)
|
|
114
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
115
|
return u;
|
|
116
116
|
}
|
|
117
|
-
function ne(u,
|
|
117
|
+
function ne(u, W, z, B, X, U, D, _) {
|
|
118
118
|
let x = 0, N, f;
|
|
119
119
|
const A = C.width;
|
|
120
|
-
for (f =
|
|
120
|
+
for (f = W; f !== B; f += z)
|
|
121
121
|
for (N = X; N !== D; N += U, x += 2)
|
|
122
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
123
|
return u;
|
|
124
124
|
}
|
|
125
|
-
function we(u,
|
|
125
|
+
function we(u, W, z, B, X) {
|
|
126
126
|
let U, D, _, x, N, f;
|
|
127
|
-
switch ((C.flags & M) >>
|
|
127
|
+
switch ((C.flags & M) >> q) {
|
|
128
128
|
default:
|
|
129
129
|
case J:
|
|
130
|
-
U = 0, _ = 1, N =
|
|
130
|
+
U = 0, _ = 1, N = W, D = 0, x = 1, f = z;
|
|
131
131
|
break;
|
|
132
132
|
case F:
|
|
133
|
-
U = 0, _ = 1, N =
|
|
133
|
+
U = 0, _ = 1, N = W, D = z - 1, x = -1, f = -1;
|
|
134
134
|
break;
|
|
135
135
|
case S:
|
|
136
|
-
U =
|
|
136
|
+
U = W - 1, _ = -1, N = -1, D = 0, x = 1, f = z;
|
|
137
137
|
break;
|
|
138
138
|
case E:
|
|
139
|
-
U =
|
|
139
|
+
U = W - 1, _ = -1, N = -1, D = z - 1, x = -1, f = -1;
|
|
140
140
|
break;
|
|
141
141
|
}
|
|
142
142
|
if (j)
|
|
@@ -169,10 +169,10 @@ class wt extends vn {
|
|
|
169
169
|
}
|
|
170
170
|
return u;
|
|
171
171
|
}
|
|
172
|
-
const ke = 0, Ne = 1, $ = 2, ie = 3, ee = 9, be = 10, ge = 11, M = 48,
|
|
173
|
-
if (
|
|
172
|
+
const ke = 0, Ne = 1, $ = 2, ie = 3, ee = 9, be = 10, ge = 11, M = 48, q = 4, F = 0, E = 1, J = 2, S = 3;
|
|
173
|
+
if (O.length < 19) throw new Error("THREE.TGALoader: Not enough data to contain header.");
|
|
174
174
|
let m = 0;
|
|
175
|
-
const h = new Uint8Array(
|
|
175
|
+
const h = new Uint8Array(O), C = {
|
|
176
176
|
id_length: h[m++],
|
|
177
177
|
colormap_type: h[m++],
|
|
178
178
|
image_type: h[m++],
|
|
@@ -188,7 +188,7 @@ class wt extends vn {
|
|
|
188
188
|
pixel_size: h[m++],
|
|
189
189
|
flags: h[m++]
|
|
190
190
|
};
|
|
191
|
-
if (Q(C), C.id_length + m >
|
|
191
|
+
if (Q(C), C.id_length + m > O.length)
|
|
192
192
|
throw new Error("THREE.TGALoader: No data.");
|
|
193
193
|
m += C.id_length;
|
|
194
194
|
let L = !1, k = !1, j = !1;
|
|
@@ -232,13 +232,13 @@ class oi extends lt {
|
|
|
232
232
|
* @param {onProgressCallback} onProgress - Executed while the loading is in progress.
|
|
233
233
|
* @param {onErrorCallback} onError - Executed when errors occur.
|
|
234
234
|
*/
|
|
235
|
-
load(
|
|
236
|
-
const v = this, oe = v.path === "" ? At.extractUrlBase(
|
|
237
|
-
I.setPath(v.path), I.setRequestHeader(v.requestHeader), I.setWithCredentials(v.withCredentials), I.load(
|
|
235
|
+
load(O, Q, R, se) {
|
|
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
239
|
Q(v.parse(Y, oe));
|
|
240
240
|
} catch (ne) {
|
|
241
|
-
se ? se(ne) : console.error(ne), v.manager.itemError(
|
|
241
|
+
se ? se(ne) : console.error(ne), v.manager.itemError(O);
|
|
242
242
|
}
|
|
243
243
|
}, R, se);
|
|
244
244
|
}
|
|
@@ -250,7 +250,7 @@ class oi extends lt {
|
|
|
250
250
|
* @param {string} path - The asset path.
|
|
251
251
|
* @return {{scene:Group,animations:Array<AnimationClip>,kinematics:Object}} An object representing the parsed asset.
|
|
252
252
|
*/
|
|
253
|
-
parse(
|
|
253
|
+
parse(O, Q) {
|
|
254
254
|
function R(t, e) {
|
|
255
255
|
const i = [], n = t.childNodes;
|
|
256
256
|
for (let s = 0, o = n.length; s < o; s++) {
|
|
@@ -331,7 +331,7 @@ class oi extends lt {
|
|
|
331
331
|
let r;
|
|
332
332
|
switch (o.nodeName) {
|
|
333
333
|
case "source":
|
|
334
|
-
r = o.getAttribute("id"), e.sources[r] =
|
|
334
|
+
r = o.getAttribute("id"), e.sources[r] = Ge(o);
|
|
335
335
|
break;
|
|
336
336
|
case "sampler":
|
|
337
337
|
r = o.getAttribute("id"), e.samplers[r] = ge(o);
|
|
@@ -381,7 +381,7 @@ class oi extends lt {
|
|
|
381
381
|
}
|
|
382
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)) {
|
|
@@ -391,7 +391,7 @@ class oi extends lt {
|
|
|
391
391
|
return e;
|
|
392
392
|
}
|
|
393
393
|
function F(t) {
|
|
394
|
-
return ee(T.animations[t],
|
|
394
|
+
return ee(T.animations[t], q);
|
|
395
395
|
}
|
|
396
396
|
function E(t, e, i) {
|
|
397
397
|
const n = T.nodes[t.id], s = Ee(n.id), o = n.transforms[t.sid], r = n.matrix.clone().transpose();
|
|
@@ -401,8 +401,8 @@ class oi extends lt {
|
|
|
401
401
|
case "matrix":
|
|
402
402
|
for (l = 0, g = e.array.length; l < g; l++)
|
|
403
403
|
if (d = e.array[l], c = l * i.stride, p[d] === void 0 && (p[d] = {}), t.arraySyntax === !0) {
|
|
404
|
-
const
|
|
405
|
-
p[d][H] =
|
|
404
|
+
const K = i.array[c], H = t.indices[0] + 4 * t.indices[1];
|
|
405
|
+
p[d][H] = K;
|
|
406
406
|
} else
|
|
407
407
|
for (a = 0, b = i.stride; a < b; a++)
|
|
408
408
|
p[d][a] = i.array[c + a];
|
|
@@ -512,7 +512,7 @@ class oi extends lt {
|
|
|
512
512
|
}
|
|
513
513
|
T.clips[t.getAttribute("id")] = e;
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function W(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
518
|
const d = F(s[o]);
|
|
@@ -522,7 +522,7 @@ class oi extends lt {
|
|
|
522
522
|
return new ft(i, n, e);
|
|
523
523
|
}
|
|
524
524
|
function z(t) {
|
|
525
|
-
return ee(T.clips[t],
|
|
525
|
+
return ee(T.clips[t], W);
|
|
526
526
|
}
|
|
527
527
|
function B(t) {
|
|
528
528
|
const e = {};
|
|
@@ -553,7 +553,7 @@ class oi extends lt {
|
|
|
553
553
|
break;
|
|
554
554
|
case "source":
|
|
555
555
|
const o = s.getAttribute("id");
|
|
556
|
-
e.sources[o] =
|
|
556
|
+
e.sources[o] = Ge(s);
|
|
557
557
|
break;
|
|
558
558
|
case "joints":
|
|
559
559
|
e.joints = U(s);
|
|
@@ -624,23 +624,23 @@ class oi extends lt {
|
|
|
624
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
625
|
let b = 0, p, w, y;
|
|
626
626
|
for (p = 0, y = o.length; p < y; p++) {
|
|
627
|
-
const H = o[p],
|
|
627
|
+
const H = o[p], G = [];
|
|
628
628
|
for (w = 0; w < H; w++) {
|
|
629
|
-
const
|
|
630
|
-
|
|
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 (
|
|
633
|
-
const
|
|
634
|
-
|
|
632
|
+
for (G.sort(K), 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
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],
|
|
639
|
-
i.joints.push({ name: H, boneInverse:
|
|
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
|
|
643
|
-
return
|
|
642
|
+
function K(H, G) {
|
|
643
|
+
return G.weight - H.weight;
|
|
644
644
|
}
|
|
645
645
|
}
|
|
646
646
|
function N(t) {
|
|
@@ -893,7 +893,7 @@ class oi extends lt {
|
|
|
893
893
|
function St(t) {
|
|
894
894
|
return ee(T.effects[t], ze);
|
|
895
895
|
}
|
|
896
|
-
function
|
|
896
|
+
function Ot(t) {
|
|
897
897
|
const e = {
|
|
898
898
|
name: t.getAttribute("name")
|
|
899
899
|
};
|
|
@@ -908,7 +908,7 @@ class oi extends lt {
|
|
|
908
908
|
}
|
|
909
909
|
T.materials[t.getAttribute("id")] = e;
|
|
910
910
|
}
|
|
911
|
-
function
|
|
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":
|
|
@@ -944,14 +944,14 @@ class oi extends lt {
|
|
|
944
944
|
} else
|
|
945
945
|
console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."), a = V(c.id);
|
|
946
946
|
if (a !== null) {
|
|
947
|
-
const b =
|
|
947
|
+
const b = Gt(a);
|
|
948
948
|
if (b !== void 0) {
|
|
949
949
|
const p = b.load(a), w = c.extra;
|
|
950
950
|
if (w !== void 0 && w.technique !== void 0 && ne(w.technique) === !1) {
|
|
951
951
|
const y = w.technique;
|
|
952
|
-
p.wrapS = y.wrapU ?
|
|
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
|
-
p.wrapS =
|
|
954
|
+
p.wrapS = Oe, p.wrapT = Oe;
|
|
955
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;
|
|
@@ -1020,20 +1020,20 @@ class oi extends lt {
|
|
|
1020
1020
|
const g = c[l];
|
|
1021
1021
|
switch (l) {
|
|
1022
1022
|
case "double_sided":
|
|
1023
|
-
n.side = g === 1 ?
|
|
1023
|
+
n.side = g === 1 ? Gn : Pn;
|
|
1024
1024
|
break;
|
|
1025
1025
|
case "bump":
|
|
1026
|
-
n.normalMap = s(g.texture), n.normalScale = new
|
|
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
|
|
1033
|
+
function Pt(t) {
|
|
1034
1034
|
return ee(T.materials[t], Ve);
|
|
1035
1035
|
}
|
|
1036
|
-
function
|
|
1036
|
+
function qt(t) {
|
|
1037
1037
|
const e = {
|
|
1038
1038
|
name: t.getAttribute("name")
|
|
1039
1039
|
};
|
|
@@ -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,
|
|
@@ -1172,7 +1172,7 @@ class oi extends lt {
|
|
|
1172
1172
|
}
|
|
1173
1173
|
return e;
|
|
1174
1174
|
}
|
|
1175
|
-
function
|
|
1175
|
+
function Ke(t) {
|
|
1176
1176
|
let e;
|
|
1177
1177
|
switch (t.technique) {
|
|
1178
1178
|
case "directional":
|
|
@@ -1192,7 +1192,7 @@ class oi extends lt {
|
|
|
1192
1192
|
}
|
|
1193
1193
|
function Vt(t) {
|
|
1194
1194
|
const e = T.lights[t];
|
|
1195
|
-
return e !== void 0 ? ee(e,
|
|
1195
|
+
return e !== void 0 ? ee(e, Ke) : (console.warn("THREE.ColladaLoader: Couldn't find light with ID:", t), null);
|
|
1196
1196
|
}
|
|
1197
1197
|
function Jt(t) {
|
|
1198
1198
|
const e = {
|
|
@@ -1208,10 +1208,10 @@ class oi extends lt {
|
|
|
1208
1208
|
const o = s.getAttribute("id");
|
|
1209
1209
|
switch (s.nodeName) {
|
|
1210
1210
|
case "source":
|
|
1211
|
-
e.sources[o] =
|
|
1211
|
+
e.sources[o] = Ge(s);
|
|
1212
1212
|
break;
|
|
1213
1213
|
case "vertices":
|
|
1214
|
-
e.vertices =
|
|
1214
|
+
e.vertices = Kt(s);
|
|
1215
1215
|
break;
|
|
1216
1216
|
case "polygons":
|
|
1217
1217
|
console.warn("THREE.ColladaLoader: Unsupported primitive type: ", s.nodeName);
|
|
@@ -1220,7 +1220,7 @@ class oi extends lt {
|
|
|
1220
1220
|
case "linestrips":
|
|
1221
1221
|
case "polylist":
|
|
1222
1222
|
case "triangles":
|
|
1223
|
-
e.primitives.push(
|
|
1223
|
+
e.primitives.push(Wt(s));
|
|
1224
1224
|
break;
|
|
1225
1225
|
default:
|
|
1226
1226
|
console.log(s);
|
|
@@ -1229,7 +1229,7 @@ class oi extends lt {
|
|
|
1229
1229
|
T.geometries[t.getAttribute("id")] = e;
|
|
1230
1230
|
}
|
|
1231
1231
|
}
|
|
1232
|
-
function
|
|
1232
|
+
function Ge(t) {
|
|
1233
1233
|
const e = {
|
|
1234
1234
|
array: [],
|
|
1235
1235
|
stride: 3
|
|
@@ -1252,7 +1252,7 @@ class oi extends lt {
|
|
|
1252
1252
|
}
|
|
1253
1253
|
return e;
|
|
1254
1254
|
}
|
|
1255
|
-
function
|
|
1255
|
+
function Kt(t) {
|
|
1256
1256
|
const e = {};
|
|
1257
1257
|
for (let i = 0; i < t.childNodes.length; i++) {
|
|
1258
1258
|
const n = t.childNodes[i];
|
|
@@ -1260,7 +1260,7 @@ class oi extends lt {
|
|
|
1260
1260
|
}
|
|
1261
1261
|
return e;
|
|
1262
1262
|
}
|
|
1263
|
-
function
|
|
1263
|
+
function Wt(t) {
|
|
1264
1264
|
const e = {
|
|
1265
1265
|
type: t.nodeName,
|
|
1266
1266
|
material: t.getAttribute("material"),
|
|
@@ -1301,7 +1301,7 @@ class oi extends lt {
|
|
|
1301
1301
|
t[i].hasUV === !0 && e++;
|
|
1302
1302
|
e > 0 && e < t.length && (t.uvsNeedsFix = !0);
|
|
1303
1303
|
}
|
|
1304
|
-
function
|
|
1304
|
+
function We(t) {
|
|
1305
1305
|
const e = {}, i = t.sources, n = t.vertices, s = t.primitives;
|
|
1306
1306
|
if (s.length === 0) return {};
|
|
1307
1307
|
const o = Yt(s);
|
|
@@ -1315,7 +1315,7 @@ class oi extends lt {
|
|
|
1315
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 Dn(), b = [];
|
|
1316
1316
|
let p = 0;
|
|
1317
1317
|
for (let w = 0; w < t.length; w++) {
|
|
1318
|
-
const y = t[w],
|
|
1318
|
+
const y = t[w], K = y.inputs;
|
|
1319
1319
|
let H = 0;
|
|
1320
1320
|
switch (y.type) {
|
|
1321
1321
|
case "lines":
|
|
@@ -1326,9 +1326,9 @@ class oi extends lt {
|
|
|
1326
1326
|
H = y.count * 3;
|
|
1327
1327
|
break;
|
|
1328
1328
|
case "polylist":
|
|
1329
|
-
for (let
|
|
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;
|
|
@@ -1336,7 +1336,7 @@ class oi extends lt {
|
|
|
1336
1336
|
H += 6;
|
|
1337
1337
|
break;
|
|
1338
1338
|
default:
|
|
1339
|
-
H += (
|
|
1339
|
+
H += (P - 2) * 3;
|
|
1340
1340
|
break;
|
|
1341
1341
|
}
|
|
1342
1342
|
}
|
|
@@ -1345,32 +1345,32 @@ class oi extends lt {
|
|
|
1345
1345
|
console.warn("THREE.ColladaLoader: Unknown primitive type:", y.type);
|
|
1346
1346
|
}
|
|
1347
1347
|
a.addGroup(p, H, w), p += H, y.material && b.push(y.material);
|
|
1348
|
-
for (const
|
|
1349
|
-
const
|
|
1350
|
-
switch (
|
|
1348
|
+
for (const G in K) {
|
|
1349
|
+
const P = K[G];
|
|
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
1356
|
const xe = s.array.length;
|
|
1357
|
-
if (de(y, e[re],
|
|
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
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(y, e[re],
|
|
1364
|
+
de(y, e[re], P.offset, o.array), o.stride = e[re].stride;
|
|
1365
1365
|
break;
|
|
1366
1366
|
case "COLOR":
|
|
1367
|
-
de(y, e[re],
|
|
1367
|
+
de(y, e[re], P.offset, c.array), c.stride = e[re].stride;
|
|
1368
1368
|
break;
|
|
1369
1369
|
case "TEXCOORD":
|
|
1370
|
-
de(y, e[re],
|
|
1370
|
+
de(y, e[re], P.offset, r.array), r.stride = e[re].stride;
|
|
1371
1371
|
break;
|
|
1372
1372
|
case "TEXCOORD1":
|
|
1373
|
-
de(y, e[re],
|
|
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,16 +1378,16 @@ class oi extends lt {
|
|
|
1378
1378
|
}
|
|
1379
1379
|
break;
|
|
1380
1380
|
case "NORMAL":
|
|
1381
|
-
de(y, e[
|
|
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(y, e[
|
|
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(y, e[
|
|
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(y, e[
|
|
1390
|
+
de(y, e[P.id], P.offset, d.array), d.stride = e[P.id].stride;
|
|
1391
1391
|
break;
|
|
1392
1392
|
}
|
|
1393
1393
|
}
|
|
@@ -1417,15 +1417,15 @@ class oi extends lt {
|
|
|
1417
1417
|
for (let b = 0, p = d.length; b < p; b++) {
|
|
1418
1418
|
const w = d[b];
|
|
1419
1419
|
if (w === 4) {
|
|
1420
|
-
const y = a + r * 0,
|
|
1421
|
-
c(y), c(
|
|
1420
|
+
const y = a + r * 0, K = a + r * 1, H = a + r * 2, G = a + r * 3;
|
|
1421
|
+
c(y), c(K), c(G), c(K), c(H), c(G);
|
|
1422
1422
|
} else if (w === 3) {
|
|
1423
|
-
const y = a + r * 0,
|
|
1424
|
-
c(y), c(
|
|
1423
|
+
const y = a + r * 0, K = a + r * 1, H = a + r * 2;
|
|
1424
|
+
c(y), c(K), c(H);
|
|
1425
1425
|
} else if (w > 4)
|
|
1426
|
-
for (let y = 1,
|
|
1427
|
-
const H = a + r * 0,
|
|
1428
|
-
c(H), c(
|
|
1426
|
+
for (let y = 1, K = w - 2; y <= K; 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
1430
|
a += r * w;
|
|
1431
1431
|
}
|
|
@@ -1434,7 +1434,7 @@ class oi extends lt {
|
|
|
1434
1434
|
c(a);
|
|
1435
1435
|
}
|
|
1436
1436
|
function Ye(t) {
|
|
1437
|
-
return ee(T.geometries[t],
|
|
1437
|
+
return ee(T.geometries[t], We);
|
|
1438
1438
|
}
|
|
1439
1439
|
function Zt(t) {
|
|
1440
1440
|
const e = {
|
|
@@ -1699,11 +1699,11 @@ class oi extends lt {
|
|
|
1699
1699
|
else if (p.static)
|
|
1700
1700
|
console.warn("THREE.ColladaLoader: Joint " + g + " is static.");
|
|
1701
1701
|
else {
|
|
1702
|
-
const w = b.object, y = p.axis,
|
|
1702
|
+
const w = b.object, y = p.axis, K = b.transforms;
|
|
1703
1703
|
ce.identity();
|
|
1704
|
-
for (let H = 0; H <
|
|
1705
|
-
const
|
|
1706
|
-
if (
|
|
1704
|
+
for (let H = 0; H < K.length; H++) {
|
|
1705
|
+
const G = K[H];
|
|
1706
|
+
if (G.sid && G.sid.indexOf(g) !== -1)
|
|
1707
1707
|
switch (p.type) {
|
|
1708
1708
|
case "revolute":
|
|
1709
1709
|
ce.multiply(l.makeRotationAxis(y, Le.degToRad(a)));
|
|
@@ -1716,18 +1716,18 @@ class oi extends lt {
|
|
|
1716
1716
|
break;
|
|
1717
1717
|
}
|
|
1718
1718
|
else
|
|
1719
|
-
switch (
|
|
1719
|
+
switch (G.type) {
|
|
1720
1720
|
case "matrix":
|
|
1721
|
-
ce.multiply(
|
|
1721
|
+
ce.multiply(G.obj);
|
|
1722
1722
|
break;
|
|
1723
1723
|
case "translate":
|
|
1724
|
-
ce.multiply(l.makeTranslation(
|
|
1724
|
+
ce.multiply(l.makeTranslation(G.obj.x, G.obj.y, G.obj.z));
|
|
1725
1725
|
break;
|
|
1726
1726
|
case "scale":
|
|
1727
|
-
ce.scale(
|
|
1727
|
+
ce.scale(G.obj);
|
|
1728
1728
|
break;
|
|
1729
1729
|
case "rotate":
|
|
1730
|
-
ce.multiply(l.makeRotationAxis(
|
|
1730
|
+
ce.multiply(l.makeRotationAxis(G.obj, G.angle));
|
|
1731
1731
|
break;
|
|
1732
1732
|
}
|
|
1733
1733
|
}
|
|
@@ -1784,7 +1784,7 @@ class oi extends lt {
|
|
|
1784
1784
|
}
|
|
1785
1785
|
}
|
|
1786
1786
|
const ce = new he(), Te = new pe();
|
|
1787
|
-
function
|
|
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")));
|
|
@@ -1898,7 +1898,7 @@ class oi extends lt {
|
|
|
1898
1898
|
const d = [], c = [];
|
|
1899
1899
|
for (s = 0; s < n.length; s++)
|
|
1900
1900
|
r = n[s], d.push(r.bone), c.push(r.boneInverse);
|
|
1901
|
-
return new
|
|
1901
|
+
return new Wn(d, c);
|
|
1902
1902
|
}
|
|
1903
1903
|
function Qe(t, e, i) {
|
|
1904
1904
|
t.traverse(function(n) {
|
|
@@ -1924,10 +1924,10 @@ class oi extends lt {
|
|
|
1924
1924
|
p !== null && e.push(p.clone());
|
|
1925
1925
|
}
|
|
1926
1926
|
for (let a = 0, b = r.length; a < b; a++) {
|
|
1927
|
-
const p = r[a], w = N(p.id), y = Ye(w.id),
|
|
1928
|
-
for (let fe = 0, re =
|
|
1929
|
-
const xe =
|
|
1930
|
-
xe.isSkinnedMesh && (xe.bind(
|
|
1927
|
+
const p = r[a], w = N(p.id), y = Ye(w.id), K = et(y, p.materials), H = p.skeletons, G = w.skin.joints, P = bn(H, G);
|
|
1928
|
+
for (let fe = 0, re = K.length; fe < re; fe++) {
|
|
1929
|
+
const xe = K[fe];
|
|
1930
|
+
xe.isSkinnedMesh && (xe.bind(P, w.skin.bindMatrix), xe.normalizeSkinWeights()), e.push(xe);
|
|
1931
1931
|
}
|
|
1932
1932
|
}
|
|
1933
1933
|
for (let a = 0, b = d.length; a < b; a++) {
|
|
@@ -1936,8 +1936,8 @@ class oi extends lt {
|
|
|
1936
1936
|
}
|
|
1937
1937
|
for (let a = 0, b = c.length; a < b; a++) {
|
|
1938
1938
|
const p = c[a], w = Ye(p.id), y = et(w, p.materials);
|
|
1939
|
-
for (let
|
|
1940
|
-
e.push(y[
|
|
1939
|
+
for (let K = 0, H = y.length; K < H; K++)
|
|
1940
|
+
e.push(y[K]);
|
|
1941
1941
|
}
|
|
1942
1942
|
for (let a = 0, b = l.length; a < b; a++)
|
|
1943
1943
|
e.push(Ee(l[a]).clone());
|
|
@@ -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
|
}
|
|
@@ -1979,7 +1979,7 @@ class oi extends lt {
|
|
|
1979
1979
|
let c;
|
|
1980
1980
|
switch (n) {
|
|
1981
1981
|
case "lines":
|
|
1982
|
-
c = new
|
|
1982
|
+
c = new Kn(s.data, d);
|
|
1983
1983
|
break;
|
|
1984
1984
|
case "linestrips":
|
|
1985
1985
|
c = new Jn(s.data, d);
|
|
@@ -2007,7 +2007,7 @@ 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(
|
|
2010
|
+
e.children.push(Pe(i[n]));
|
|
2011
2011
|
T.visualScenes[t.getAttribute("id")] = e;
|
|
2012
2012
|
}
|
|
2013
2013
|
function nt(t) {
|
|
@@ -2056,13 +2056,13 @@ class oi extends lt {
|
|
|
2056
2056
|
}
|
|
2057
2057
|
return e.trim();
|
|
2058
2058
|
}
|
|
2059
|
-
if (
|
|
2059
|
+
if (O.length === 0)
|
|
2060
2060
|
return { scene: new Mn() };
|
|
2061
|
-
const st = new DOMParser().parseFromString(
|
|
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");
|
|
@@ -2089,7 +2089,7 @@ class oi extends lt {
|
|
|
2089
2089
|
physicsModels: {},
|
|
2090
2090
|
kinematicsScenes: {}
|
|
2091
2091
|
};
|
|
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",
|
|
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, W), ie(T.controllers, _), ie(T.images, A), ie(T.effects, ze), ie(T.materials, Ve), ie(T.cameras, Je), ie(T.lights, Ke), ie(T.geometries, We), 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() {
|
|
@@ -2103,25 +2103,25 @@ class oi extends lt {
|
|
|
2103
2103
|
}
|
|
2104
2104
|
const Ue = new Et(), kt = new si();
|
|
2105
2105
|
function _e(ue) {
|
|
2106
|
-
return ue ? ue.trim().split(/\s+/g).map((
|
|
2106
|
+
return ue ? ue.trim().split(/\s+/g).map((O) => parseFloat(O)) : [0, 0, 0];
|
|
2107
2107
|
}
|
|
2108
|
-
function Nt(ue,
|
|
2109
|
-
Q || ue.rotation.set(0, 0, 0), kt.set(
|
|
2108
|
+
function Nt(ue, O, Q = !1) {
|
|
2109
|
+
Q || ue.rotation.set(0, 0, 0), kt.set(O[0], O[1], O[2], "ZYX"), Ue.setFromEuler(kt), Ue.multiply(ue.quaternion), ue.quaternion.copy(Ue);
|
|
2110
2110
|
}
|
|
2111
2111
|
class ci {
|
|
2112
|
-
constructor(
|
|
2113
|
-
this.manager =
|
|
2112
|
+
constructor(O) {
|
|
2113
|
+
this.manager = O || Yn, this.loadMeshCb = this.defaultMeshLoader.bind(this), this.parseVisual = !0, this.parseCollision = !1, this.packages = "", this.workingPath = "", this.fetchOptions = {};
|
|
2114
2114
|
}
|
|
2115
2115
|
/* Public API */
|
|
2116
|
-
loadAsync(
|
|
2116
|
+
loadAsync(O) {
|
|
2117
2117
|
return new Promise((Q, R) => {
|
|
2118
|
-
this.load(
|
|
2118
|
+
this.load(O, Q, null, R);
|
|
2119
2119
|
});
|
|
2120
2120
|
}
|
|
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
|
-
load(
|
|
2124
|
-
const v = this.manager, oe = At.extractUrlBase(
|
|
2123
|
+
load(O, Q, R, se) {
|
|
2124
|
+
const v = this.manager, oe = At.extractUrlBase(O), I = this.manager.resolveURL(O);
|
|
2125
2125
|
v.itemStart(I), fetch(I, this.fetchOptions).then((Y) => {
|
|
2126
2126
|
if (Y.ok)
|
|
2127
2127
|
return R && R(null), Y.text();
|
|
@@ -2133,27 +2133,27 @@ class ci {
|
|
|
2133
2133
|
se ? se(Y) : console.error("URDFLoader: Error loading file.", Y), v.itemError(I), v.itemEnd(I);
|
|
2134
2134
|
});
|
|
2135
2135
|
}
|
|
2136
|
-
parse(
|
|
2136
|
+
parse(O, Q = this.workingPath) {
|
|
2137
2137
|
const R = this.packages, se = this.loadMeshCb, v = this.parseVisual, oe = this.parseCollision, I = this.manager, Y = {}, ne = {}, we = {};
|
|
2138
2138
|
function ke(M) {
|
|
2139
2139
|
if (!/^package:\/\//.test(M))
|
|
2140
2140
|
return Q ? Q + M : M;
|
|
2141
|
-
const [
|
|
2141
|
+
const [q, F] = M.replace(/^package:\/\//, "").split(/\/(.+)/);
|
|
2142
2142
|
if (typeof R == "string")
|
|
2143
|
-
return R.endsWith(
|
|
2143
|
+
return R.endsWith(q) ? R + "/" + F : R + "/" + q + "/" + F;
|
|
2144
2144
|
if (R instanceof Function)
|
|
2145
|
-
return R(
|
|
2145
|
+
return R(q) + "/" + F;
|
|
2146
2146
|
if (typeof R == "object")
|
|
2147
|
-
return
|
|
2147
|
+
return q in R ? R[q] + "/" + F : (console.error(`URDFLoader : ${q} not found in provided package list.`), null);
|
|
2148
2148
|
}
|
|
2149
2149
|
function Ne(M) {
|
|
2150
|
-
let
|
|
2151
|
-
M instanceof Document ?
|
|
2152
|
-
const F =
|
|
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 F = q.filter((E) => E.nodeName === "robot").pop();
|
|
2153
2153
|
return $(F);
|
|
2154
2154
|
}
|
|
2155
2155
|
function $(M) {
|
|
2156
|
-
const
|
|
2156
|
+
const q = [...M.children], F = 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
2157
|
S.robotName = M.getAttribute("name"), S.urdfRobotNode = M, J.forEach((L) => {
|
|
2158
2158
|
const k = L.getAttribute("name");
|
|
2159
2159
|
we[k] = be(L);
|
|
@@ -2186,30 +2186,30 @@ class ci {
|
|
|
2186
2186
|
}, S;
|
|
2187
2187
|
}
|
|
2188
2188
|
function ie(M) {
|
|
2189
|
-
const
|
|
2189
|
+
const q = [...M.children], F = M.getAttribute("type");
|
|
2190
2190
|
let E;
|
|
2191
|
-
const J =
|
|
2191
|
+
const J = q.find((k) => k.nodeName.toLowerCase() === "mimic");
|
|
2192
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 = F;
|
|
2193
2193
|
let S = null, m = null, h = [0, 0, 0], C = [0, 0, 0];
|
|
2194
|
-
|
|
2194
|
+
q.forEach((k) => {
|
|
2195
2195
|
const j = k.nodeName.toLowerCase();
|
|
2196
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
2197
|
}), S.add(E), E.add(m), Nt(E, C), E.position.set(h[0], h[1], h[2]);
|
|
2198
|
-
const L =
|
|
2198
|
+
const L = q.filter((k) => k.nodeName.toLowerCase() === "axis")[0];
|
|
2199
2199
|
if (L) {
|
|
2200
2200
|
const k = L.getAttribute("xyz").split(/\s+/g).map((j) => parseFloat(j));
|
|
2201
2201
|
E.axis = new pe(k[0], k[1], k[2]), E.axis.normalize();
|
|
2202
2202
|
}
|
|
2203
2203
|
return E;
|
|
2204
2204
|
}
|
|
2205
|
-
function ee(M,
|
|
2205
|
+
function ee(M, q, F, E = null) {
|
|
2206
2206
|
E === null && (E = new Zn());
|
|
2207
2207
|
const J = [...M.children];
|
|
2208
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
2209
|
const h = ge(m, we);
|
|
2210
2210
|
if (E.add(h), m.hasAttribute("name")) {
|
|
2211
2211
|
const C = m.getAttribute("name");
|
|
2212
|
-
h.name = C, h.urdfName = C,
|
|
2212
|
+
h.name = C, h.urdfName = C, q[C] = h;
|
|
2213
2213
|
}
|
|
2214
2214
|
}), oe && J.filter((m) => m.nodeName.toLowerCase() === "collision").forEach((m) => {
|
|
2215
2215
|
const h = ge(m);
|
|
@@ -2220,8 +2220,8 @@ class ci {
|
|
|
2220
2220
|
}), E;
|
|
2221
2221
|
}
|
|
2222
2222
|
function be(M) {
|
|
2223
|
-
const
|
|
2224
|
-
return F.name = M.getAttribute("name") || "",
|
|
2223
|
+
const q = [...M.children], F = new ve();
|
|
2224
|
+
return F.name = M.getAttribute("name") || "", q.forEach((E) => {
|
|
2225
2225
|
const J = E.nodeName.toLowerCase();
|
|
2226
2226
|
if (J === "color") {
|
|
2227
2227
|
const S = E.getAttribute("rgba").split(/\s/g).map((m) => parseFloat(m));
|
|
@@ -2235,13 +2235,13 @@ class ci {
|
|
|
2235
2235
|
}
|
|
2236
2236
|
}), F;
|
|
2237
2237
|
}
|
|
2238
|
-
function ge(M,
|
|
2238
|
+
function ge(M, q = {}) {
|
|
2239
2239
|
const F = M.nodeName.toLowerCase() === "collision", E = [...M.children];
|
|
2240
2240
|
let J = null;
|
|
2241
2241
|
const S = E.filter((h) => h.nodeName.toLowerCase() === "material")[0];
|
|
2242
2242
|
if (S) {
|
|
2243
2243
|
const h = S.getAttribute("name");
|
|
2244
|
-
h && h in
|
|
2244
|
+
h && h in q ? J = q[h] : J = be(S);
|
|
2245
2245
|
} else
|
|
2246
2246
|
J = new ve();
|
|
2247
2247
|
const m = F ? new Qn() : new ei();
|
|
@@ -2283,14 +2283,14 @@ class ci {
|
|
|
2283
2283
|
}
|
|
2284
2284
|
}), m;
|
|
2285
2285
|
}
|
|
2286
|
-
return Ne(
|
|
2286
|
+
return Ne(O);
|
|
2287
2287
|
}
|
|
2288
2288
|
// Default mesh loading function
|
|
2289
|
-
defaultMeshLoader(
|
|
2290
|
-
/\.stl$/i.test(
|
|
2289
|
+
defaultMeshLoader(O, Q, R) {
|
|
2290
|
+
/\.stl$/i.test(O) ? new Ln(Q).load(O, (v) => {
|
|
2291
2291
|
const oe = new Ce(v, new ve());
|
|
2292
2292
|
R(oe);
|
|
2293
|
-
}) : /\.dae$/i.test(
|
|
2293
|
+
}) : /\.dae$/i.test(O) ? new oi(Q).load(O, (v) => R(v.scene)) : console.warn(`URDFLoader: Could not load model at ${O}.
|
|
2294
2294
|
No loader available`);
|
|
2295
2295
|
}
|
|
2296
2296
|
}
|