pptx-svelte-viewer 3.18.0 → 3.19.0
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/CHANGELOG.md +38 -0
- package/README.md +32 -27
- package/dist/{AiChatPanel-BpbQoAYF.js → AiChatPanel-B3wS82GP.js} +1 -1
- package/dist/{GLTFLoader-D2645ZAi.js → GLTFLoader-cXVvZ-Qt.js} +216 -199
- package/dist/{OrbitControls-Cm0ChW-y.js → OrbitControls-Dj3MmTu8.js} +9 -7
- package/dist/{export-BUF4iVeY.js → export-jE_PACKp.js} +32805 -32100
- package/dist/i18n.js +1 -1
- package/dist/index.js +2 -2
- package/dist/pptx-svelte-viewer.css +1 -1
- package/dist/{smartart-3d-DjfDf-du.js → smartart-3d-Btipz914.js} +2 -2
- package/dist/{three.module-CS4jrTOJ.js → three.module-BP1MPwgf.js} +4861 -4594
- package/dist/{translator-DTR0k69d.js → translator-wOMMyMjv.js} +5 -0
- package/dist/viewer/editor/editor-arrange-controller.d.ts +1 -1
- package/dist/viewer/editor/editor-arrange-controller.d.ts.map +1 -1
- package/dist/viewer/editor/editor-arrange-ops.d.ts +7 -3
- package/dist/viewer/editor/editor-arrange-ops.d.ts.map +1 -1
- package/dist/viewer/editor/editor-element-controller.d.ts.map +1 -1
- package/dist/viewer/editor/editor-freeform.d.ts +16 -0
- package/dist/viewer/editor/editor-freeform.d.ts.map +1 -1
- package/dist/viewer/editor/editor-ink-controller.svelte.d.ts +5 -4
- package/dist/viewer/editor/editor-ink-controller.svelte.d.ts.map +1 -1
- package/dist/viewer/editor/editor-state.svelte.d.ts +14 -0
- package/dist/viewer/editor/editor-state.svelte.d.ts.map +1 -1
- package/dist/viewer/editor/editor-template-controller.d.ts +8 -0
- package/dist/viewer/editor/editor-template-controller.d.ts.map +1 -1
- package/dist/viewer/index.d.ts +28 -5
- package/dist/viewer/index.js +1 -1
- package/dist/viewer/state/create-viewer-state.svelte.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -1,30 +1,28 @@
|
|
|
1
|
-
import { AnimationClip as
|
|
2
|
-
function
|
|
1
|
+
import { AnimationClip as Ee, Bone as Ae, Box3 as ve, BufferAttribute as j, BufferGeometry as le, ClampToEdgeWrapping as _e, Color as O, ColorManagement as J, DirectionalLight as Le, FileLoader as ue, Group as V, ImageBitmapLoader as Me, InstancedBufferAttribute as Z, InstancedMesh as xe, InterleavedBuffer as Se, InterleavedBufferAttribute as ye, Interpolant as we, InterpolateDiscrete as be, InterpolateLinear as he, Line as Ne, LineBasicMaterial as Ie, LineLoop as Oe, LineSegments as Ce, LinearFilter as Fe, LinearMipmapLinearFilter as ke, LinearMipmapNearestFilter as Pe, LinearSRGBColorSpace as b, Loader as He, LoaderUtils as D, Material as X, MathUtils as De, Matrix4 as U, Mesh as Ge, MeshBasicMaterial as H, MeshPhysicalMaterial as y, MeshStandardMaterial as fe, MirroredRepeatWrapping as Ue, NearestFilter as Be, NearestMipmapLinearFilter as Ke, NearestMipmapNearestFilter as je, NumberKeyframeTrack as $, Object3D as de, OrthographicCamera as Ve, PerspectiveCamera as Xe, PointLight as ze, Points as qe, PointsMaterial as We, PropertyBinding as Ye, Quaternion as pe, QuaternionKeyframeTrack as ee, RepeatWrapping as Qe, SRGBColorSpace as G, Skeleton as Je, SkinnedMesh as Ze, Sphere as $e, SpotLight as et, Texture as te, TextureLoader as tt, Vector2 as me, Vector3 as I, VectorKeyframeTrack as se } from "./three.module-BP1MPwgf.js";
|
|
2
|
+
function ne(e, t) {
|
|
3
3
|
if (t === 0)
|
|
4
4
|
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), e;
|
|
5
5
|
if (t === 2 || t === 1) {
|
|
6
6
|
let n = e.getIndex();
|
|
7
7
|
if (n === null) {
|
|
8
|
-
const
|
|
9
|
-
if (
|
|
10
|
-
for (let
|
|
11
|
-
e.setIndex(
|
|
8
|
+
const i = [], o = e.getAttribute("position");
|
|
9
|
+
if (o !== void 0) {
|
|
10
|
+
for (let a = 0; a < o.count; a++) i.push(a);
|
|
11
|
+
e.setIndex(i), n = e.getIndex();
|
|
12
12
|
} else
|
|
13
13
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), e;
|
|
14
14
|
}
|
|
15
15
|
const s = n.count - 2, r = [];
|
|
16
|
-
if (t === 2) for (let
|
|
17
|
-
r.push(n.getX(0)), r.push(n.getX(
|
|
18
|
-
else for (let
|
|
19
|
-
r.length / 3 !== s && console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");
|
|
20
|
-
const i = e.clone();
|
|
21
|
-
return i.setIndex(r), i.clearGroups(), i;
|
|
16
|
+
if (t === 2) for (let i = 1; i <= s; i++)
|
|
17
|
+
r.push(n.getX(0)), r.push(n.getX(i)), r.push(n.getX(i + 1));
|
|
18
|
+
else for (let i = 0; i < s; i++) i % 2 === 0 ? (r.push(n.getX(i)), r.push(n.getX(i + 1)), r.push(n.getX(i + 2))) : (r.push(n.getX(i + 2)), r.push(n.getX(i + 1)), r.push(n.getX(i)));
|
|
19
|
+
return r.length / 3 !== s && console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles."), e.setIndex(r), e.clearGroups(), e;
|
|
22
20
|
} else
|
|
23
21
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", t), e;
|
|
24
22
|
}
|
|
25
23
|
function st(e) {
|
|
26
24
|
const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), s = e.clone();
|
|
27
|
-
return
|
|
25
|
+
return ge(e, s, function(r, i) {
|
|
28
26
|
t.set(i, r), n.set(r, i);
|
|
29
27
|
}), s.traverse(function(r) {
|
|
30
28
|
if (!r.isSkinnedMesh) return;
|
|
@@ -34,11 +32,11 @@ function st(e) {
|
|
|
34
32
|
}), i.bind(i.skeleton, i.bindMatrix);
|
|
35
33
|
}), s;
|
|
36
34
|
}
|
|
37
|
-
function
|
|
35
|
+
function ge(e, t, n) {
|
|
38
36
|
n(e, t);
|
|
39
|
-
for (let s = 0; s < e.children.length; s++)
|
|
37
|
+
for (let s = 0; s < e.children.length; s++) ge(e.children[s], t.children[s], n);
|
|
40
38
|
}
|
|
41
|
-
var Kt = class extends
|
|
39
|
+
var Kt = class extends He {
|
|
42
40
|
constructor(e) {
|
|
43
41
|
super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(t) {
|
|
44
42
|
return new at(t);
|
|
@@ -71,9 +69,9 @@ var Kt = class extends ke {
|
|
|
71
69
|
}), this.register(function(t) {
|
|
72
70
|
return new rt(t);
|
|
73
71
|
}), this.register(function(t) {
|
|
74
|
-
return new
|
|
72
|
+
return new re(t, g.EXT_MESHOPT_COMPRESSION);
|
|
75
73
|
}), this.register(function(t) {
|
|
76
|
-
return new
|
|
74
|
+
return new re(t, g.KHR_MESHOPT_COMPRESSION);
|
|
77
75
|
}), this.register(function(t) {
|
|
78
76
|
return new At(t);
|
|
79
77
|
});
|
|
@@ -89,7 +87,7 @@ var Kt = class extends ke {
|
|
|
89
87
|
this.manager.itemStart(e);
|
|
90
88
|
const o = function(c) {
|
|
91
89
|
s ? s(c) : console.error(c), r.manager.itemError(e), r.manager.itemEnd(e);
|
|
92
|
-
}, a = new
|
|
90
|
+
}, a = new ue(this.manager);
|
|
93
91
|
a.setPath(this.path), a.setResponseType("arraybuffer"), a.setRequestHeader(this.requestHeader), a.setWithCredentials(this.withCredentials), a.load(e, function(c) {
|
|
94
92
|
try {
|
|
95
93
|
r.parse(c, i, function(l) {
|
|
@@ -120,14 +118,14 @@ var Kt = class extends ke {
|
|
|
120
118
|
const i = {}, o = {}, a = new TextDecoder();
|
|
121
119
|
if (typeof e == "string") r = JSON.parse(e);
|
|
122
120
|
else if (e instanceof ArrayBuffer)
|
|
123
|
-
if (a.decode(new Uint8Array(e, 0, 4)) ===
|
|
121
|
+
if (a.decode(new Uint8Array(e, 0, 4)) === Te) {
|
|
124
122
|
try {
|
|
125
|
-
i[
|
|
123
|
+
i[g.KHR_BINARY_GLTF] = new vt(e);
|
|
126
124
|
} catch (l) {
|
|
127
125
|
s && s(l);
|
|
128
126
|
return;
|
|
129
127
|
}
|
|
130
|
-
r = JSON.parse(i[
|
|
128
|
+
r = JSON.parse(i[g.KHR_BINARY_GLTF].content);
|
|
131
129
|
} else r = JSON.parse(a.decode(e));
|
|
132
130
|
else r = e;
|
|
133
131
|
if (r.asset === void 0 || r.asset.version[0] < 2) {
|
|
@@ -150,16 +148,16 @@ var Kt = class extends ke {
|
|
|
150
148
|
if (r.extensionsUsed) for (let l = 0; l < r.extensionsUsed.length; ++l) {
|
|
151
149
|
const u = r.extensionsUsed[l], h = r.extensionsRequired || [];
|
|
152
150
|
switch (u) {
|
|
153
|
-
case
|
|
151
|
+
case g.KHR_MATERIALS_UNLIT:
|
|
154
152
|
i[u] = new it();
|
|
155
153
|
break;
|
|
156
|
-
case
|
|
157
|
-
i[u] = new
|
|
154
|
+
case g.KHR_DRACO_MESH_COMPRESSION:
|
|
155
|
+
i[u] = new _t(r, this.dracoLoader);
|
|
158
156
|
break;
|
|
159
|
-
case
|
|
157
|
+
case g.KHR_TEXTURE_TRANSFORM:
|
|
160
158
|
i[u] = new Lt();
|
|
161
159
|
break;
|
|
162
|
-
case
|
|
160
|
+
case g.KHR_MESH_QUANTIZATION:
|
|
163
161
|
i[u] = new Mt();
|
|
164
162
|
break;
|
|
165
163
|
default:
|
|
@@ -192,11 +190,11 @@ function nt() {
|
|
|
192
190
|
}
|
|
193
191
|
};
|
|
194
192
|
}
|
|
195
|
-
function
|
|
193
|
+
function L(e, t, n) {
|
|
196
194
|
const s = e.json.materials[t];
|
|
197
195
|
return s.extensions && s.extensions[n] ? s.extensions[n] : null;
|
|
198
196
|
}
|
|
199
|
-
var
|
|
197
|
+
var g = {
|
|
200
198
|
KHR_BINARY_GLTF: "KHR_binary_glTF",
|
|
201
199
|
KHR_DRACO_MESH_COMPRESSION: "KHR_draco_mesh_compression",
|
|
202
200
|
KHR_LIGHTS_PUNCTUAL: "KHR_lights_punctual",
|
|
@@ -222,7 +220,7 @@ var m = {
|
|
|
222
220
|
EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
|
|
223
221
|
}, rt = class {
|
|
224
222
|
constructor(e) {
|
|
225
|
-
this.parser = e, this.name =
|
|
223
|
+
this.parser = e, this.name = g.KHR_LIGHTS_PUNCTUAL, this.cache = {
|
|
226
224
|
refs: {},
|
|
227
225
|
uses: {}
|
|
228
226
|
};
|
|
@@ -241,11 +239,11 @@ var m = {
|
|
|
241
239
|
const r = t.json, i = ((r.extensions && r.extensions[this.name] || {}).lights || [])[e];
|
|
242
240
|
let o;
|
|
243
241
|
const a = new O(16777215);
|
|
244
|
-
i.color !== void 0 && a.setRGB(i.color[0], i.color[1], i.color[2],
|
|
242
|
+
i.color !== void 0 && a.setRGB(i.color[0], i.color[1], i.color[2], b);
|
|
245
243
|
const c = i.range !== void 0 ? i.range : 0;
|
|
246
244
|
switch (i.type) {
|
|
247
245
|
case "directional":
|
|
248
|
-
o = new
|
|
246
|
+
o = new Le(a), o.target.position.set(0, 0, -1), o.add(o.target);
|
|
249
247
|
break;
|
|
250
248
|
case "point":
|
|
251
249
|
o = new ze(a), o.distance = c;
|
|
@@ -256,7 +254,7 @@ var m = {
|
|
|
256
254
|
default:
|
|
257
255
|
throw new Error("THREE.GLTFLoader: Unexpected light type: " + i.type);
|
|
258
256
|
}
|
|
259
|
-
return o.position.set(0, 0, 0),
|
|
257
|
+
return o.position.set(0, 0, 0), S(o, i), i.intensity !== void 0 && (o.intensity = i.intensity), o.name = t.createUniqueName(i.name || "light_" + e), s = Promise.resolve(o), t.cache.add(n, s), s;
|
|
260
258
|
}
|
|
261
259
|
getDependency(e, t) {
|
|
262
260
|
if (e === "light")
|
|
@@ -270,10 +268,10 @@ var m = {
|
|
|
270
268
|
}
|
|
271
269
|
}, it = class {
|
|
272
270
|
constructor() {
|
|
273
|
-
this.name =
|
|
271
|
+
this.name = g.KHR_MATERIALS_UNLIT;
|
|
274
272
|
}
|
|
275
273
|
getMaterialType() {
|
|
276
|
-
return
|
|
274
|
+
return H;
|
|
277
275
|
}
|
|
278
276
|
extendParams(e, t, n) {
|
|
279
277
|
const s = [];
|
|
@@ -282,7 +280,7 @@ var m = {
|
|
|
282
280
|
if (r) {
|
|
283
281
|
if (Array.isArray(r.baseColorFactor)) {
|
|
284
282
|
const i = r.baseColorFactor;
|
|
285
|
-
e.color.setRGB(i[0], i[1], i[2],
|
|
283
|
+
e.color.setRGB(i[0], i[1], i[2], b), e.opacity = i[3];
|
|
286
284
|
}
|
|
287
285
|
r.baseColorTexture !== void 0 && s.push(n.assignTexture(e, "map", r.baseColorTexture, G));
|
|
288
286
|
}
|
|
@@ -290,92 +288,92 @@ var m = {
|
|
|
290
288
|
}
|
|
291
289
|
}, ot = class {
|
|
292
290
|
constructor(e) {
|
|
293
|
-
this.parser = e, this.name =
|
|
291
|
+
this.parser = e, this.name = g.KHR_MATERIALS_EMISSIVE_STRENGTH;
|
|
294
292
|
}
|
|
295
293
|
extendMaterialParams(e, t) {
|
|
296
|
-
const n =
|
|
294
|
+
const n = L(this.parser, e, this.name);
|
|
297
295
|
return n === null || n.emissiveStrength !== void 0 && (t.emissiveIntensity = n.emissiveStrength), Promise.resolve();
|
|
298
296
|
}
|
|
299
297
|
}, at = class {
|
|
300
298
|
constructor(e) {
|
|
301
|
-
this.parser = e, this.name =
|
|
299
|
+
this.parser = e, this.name = g.KHR_MATERIALS_CLEARCOAT;
|
|
302
300
|
}
|
|
303
301
|
getMaterialType(e) {
|
|
304
|
-
return
|
|
302
|
+
return L(this.parser, e, this.name) !== null ? y : null;
|
|
305
303
|
}
|
|
306
304
|
extendMaterialParams(e, t) {
|
|
307
|
-
const n =
|
|
305
|
+
const n = L(this.parser, e, this.name);
|
|
308
306
|
if (n === null) return Promise.resolve();
|
|
309
307
|
const s = [];
|
|
310
308
|
if (n.clearcoatFactor !== void 0 && (t.clearcoat = n.clearcoatFactor), n.clearcoatTexture !== void 0 && s.push(this.parser.assignTexture(t, "clearcoatMap", n.clearcoatTexture)), n.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = n.clearcoatRoughnessFactor), n.clearcoatRoughnessTexture !== void 0 && s.push(this.parser.assignTexture(t, "clearcoatRoughnessMap", n.clearcoatRoughnessTexture)), n.clearcoatNormalTexture !== void 0 && (s.push(this.parser.assignTexture(t, "clearcoatNormalMap", n.clearcoatNormalTexture)), n.clearcoatNormalTexture.scale !== void 0)) {
|
|
311
309
|
const r = n.clearcoatNormalTexture.scale;
|
|
312
|
-
t.clearcoatNormalScale = new
|
|
310
|
+
t.clearcoatNormalScale = new me(r, r);
|
|
313
311
|
}
|
|
314
312
|
return Promise.all(s);
|
|
315
313
|
}
|
|
316
314
|
}, ct = class {
|
|
317
315
|
constructor(e) {
|
|
318
|
-
this.parser = e, this.name =
|
|
316
|
+
this.parser = e, this.name = g.KHR_MATERIALS_DISPERSION;
|
|
319
317
|
}
|
|
320
318
|
getMaterialType(e) {
|
|
321
|
-
return
|
|
319
|
+
return L(this.parser, e, this.name) !== null ? y : null;
|
|
322
320
|
}
|
|
323
321
|
extendMaterialParams(e, t) {
|
|
324
|
-
const n =
|
|
322
|
+
const n = L(this.parser, e, this.name);
|
|
325
323
|
return n === null || (t.dispersion = n.dispersion !== void 0 ? n.dispersion : 0), Promise.resolve();
|
|
326
324
|
}
|
|
327
325
|
}, lt = class {
|
|
328
326
|
constructor(e) {
|
|
329
|
-
this.parser = e, this.name =
|
|
327
|
+
this.parser = e, this.name = g.KHR_MATERIALS_IRIDESCENCE;
|
|
330
328
|
}
|
|
331
329
|
getMaterialType(e) {
|
|
332
|
-
return
|
|
330
|
+
return L(this.parser, e, this.name) !== null ? y : null;
|
|
333
331
|
}
|
|
334
332
|
extendMaterialParams(e, t) {
|
|
335
|
-
const n =
|
|
333
|
+
const n = L(this.parser, e, this.name);
|
|
336
334
|
if (n === null) return Promise.resolve();
|
|
337
335
|
const s = [];
|
|
338
336
|
return n.iridescenceFactor !== void 0 && (t.iridescence = n.iridescenceFactor), n.iridescenceTexture !== void 0 && s.push(this.parser.assignTexture(t, "iridescenceMap", n.iridescenceTexture)), n.iridescenceIor !== void 0 && (t.iridescenceIOR = n.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), n.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = n.iridescenceThicknessMinimum), n.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = n.iridescenceThicknessMaximum), n.iridescenceThicknessTexture !== void 0 && s.push(this.parser.assignTexture(t, "iridescenceThicknessMap", n.iridescenceThicknessTexture)), Promise.all(s);
|
|
339
337
|
}
|
|
340
338
|
}, ut = class {
|
|
341
339
|
constructor(e) {
|
|
342
|
-
this.parser = e, this.name =
|
|
340
|
+
this.parser = e, this.name = g.KHR_MATERIALS_SHEEN;
|
|
343
341
|
}
|
|
344
342
|
getMaterialType(e) {
|
|
345
|
-
return
|
|
343
|
+
return L(this.parser, e, this.name) !== null ? y : null;
|
|
346
344
|
}
|
|
347
345
|
extendMaterialParams(e, t) {
|
|
348
|
-
const n =
|
|
346
|
+
const n = L(this.parser, e, this.name);
|
|
349
347
|
if (n === null) return Promise.resolve();
|
|
350
348
|
const s = [];
|
|
351
349
|
if (t.sheenColor = new O(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1, n.sheenColorFactor !== void 0) {
|
|
352
350
|
const r = n.sheenColorFactor;
|
|
353
|
-
t.sheenColor.setRGB(r[0], r[1], r[2],
|
|
351
|
+
t.sheenColor.setRGB(r[0], r[1], r[2], b);
|
|
354
352
|
}
|
|
355
353
|
return n.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = n.sheenRoughnessFactor), n.sheenColorTexture !== void 0 && s.push(this.parser.assignTexture(t, "sheenColorMap", n.sheenColorTexture, G)), n.sheenRoughnessTexture !== void 0 && s.push(this.parser.assignTexture(t, "sheenRoughnessMap", n.sheenRoughnessTexture)), Promise.all(s);
|
|
356
354
|
}
|
|
357
355
|
}, ht = class {
|
|
358
356
|
constructor(e) {
|
|
359
|
-
this.parser = e, this.name =
|
|
357
|
+
this.parser = e, this.name = g.KHR_MATERIALS_TRANSMISSION;
|
|
360
358
|
}
|
|
361
359
|
getMaterialType(e) {
|
|
362
|
-
return
|
|
360
|
+
return L(this.parser, e, this.name) !== null ? y : null;
|
|
363
361
|
}
|
|
364
362
|
extendMaterialParams(e, t) {
|
|
365
|
-
const n =
|
|
363
|
+
const n = L(this.parser, e, this.name);
|
|
366
364
|
if (n === null) return Promise.resolve();
|
|
367
365
|
const s = [];
|
|
368
366
|
return n.transmissionFactor !== void 0 && (t.transmission = n.transmissionFactor), n.transmissionTexture !== void 0 && s.push(this.parser.assignTexture(t, "transmissionMap", n.transmissionTexture)), Promise.all(s);
|
|
369
367
|
}
|
|
370
368
|
}, ft = class {
|
|
371
369
|
constructor(e) {
|
|
372
|
-
this.parser = e, this.name =
|
|
370
|
+
this.parser = e, this.name = g.KHR_MATERIALS_VOLUME;
|
|
373
371
|
}
|
|
374
372
|
getMaterialType(e) {
|
|
375
|
-
return
|
|
373
|
+
return L(this.parser, e, this.name) !== null ? y : null;
|
|
376
374
|
}
|
|
377
375
|
extendMaterialParams(e, t) {
|
|
378
|
-
const n =
|
|
376
|
+
const n = L(this.parser, e, this.name);
|
|
379
377
|
if (n === null) return Promise.resolve();
|
|
380
378
|
const s = [];
|
|
381
379
|
t.thickness = n.thicknessFactor !== void 0 ? n.thicknessFactor : 0, n.thicknessTexture !== void 0 && s.push(this.parser.assignTexture(t, "thicknessMap", n.thicknessTexture)), t.attenuationDistance = n.attenuationDistance || 1 / 0;
|
|
@@ -384,28 +382,28 @@ var m = {
|
|
|
384
382
|
1,
|
|
385
383
|
1
|
|
386
384
|
];
|
|
387
|
-
return t.attenuationColor = new O().setRGB(r[0], r[1], r[2],
|
|
385
|
+
return t.attenuationColor = new O().setRGB(r[0], r[1], r[2], b), Promise.all(s);
|
|
388
386
|
}
|
|
389
387
|
}, dt = class {
|
|
390
388
|
constructor(e) {
|
|
391
|
-
this.parser = e, this.name =
|
|
389
|
+
this.parser = e, this.name = g.KHR_MATERIALS_IOR;
|
|
392
390
|
}
|
|
393
391
|
getMaterialType(e) {
|
|
394
|
-
return
|
|
392
|
+
return L(this.parser, e, this.name) !== null ? y : null;
|
|
395
393
|
}
|
|
396
394
|
extendMaterialParams(e, t) {
|
|
397
|
-
const n =
|
|
395
|
+
const n = L(this.parser, e, this.name);
|
|
398
396
|
return n === null || (t.ior = n.ior !== void 0 ? n.ior : 1.5, t.ior === 0 && (t.ior = 1e3)), Promise.resolve();
|
|
399
397
|
}
|
|
400
398
|
}, pt = class {
|
|
401
399
|
constructor(e) {
|
|
402
|
-
this.parser = e, this.name =
|
|
400
|
+
this.parser = e, this.name = g.KHR_MATERIALS_SPECULAR;
|
|
403
401
|
}
|
|
404
402
|
getMaterialType(e) {
|
|
405
|
-
return
|
|
403
|
+
return L(this.parser, e, this.name) !== null ? y : null;
|
|
406
404
|
}
|
|
407
405
|
extendMaterialParams(e, t) {
|
|
408
|
-
const n =
|
|
406
|
+
const n = L(this.parser, e, this.name);
|
|
409
407
|
if (n === null) return Promise.resolve();
|
|
410
408
|
const s = [];
|
|
411
409
|
t.specularIntensity = n.specularFactor !== void 0 ? n.specularFactor : 1, n.specularTexture !== void 0 && s.push(this.parser.assignTexture(t, "specularIntensityMap", n.specularTexture));
|
|
@@ -414,37 +412,37 @@ var m = {
|
|
|
414
412
|
1,
|
|
415
413
|
1
|
|
416
414
|
];
|
|
417
|
-
return t.specularColor = new O().setRGB(r[0], r[1], r[2],
|
|
415
|
+
return t.specularColor = new O().setRGB(r[0], r[1], r[2], b), n.specularColorTexture !== void 0 && s.push(this.parser.assignTexture(t, "specularColorMap", n.specularColorTexture, G)), Promise.all(s);
|
|
418
416
|
}
|
|
419
417
|
}, mt = class {
|
|
420
418
|
constructor(e) {
|
|
421
|
-
this.parser = e, this.name =
|
|
419
|
+
this.parser = e, this.name = g.EXT_MATERIALS_BUMP;
|
|
422
420
|
}
|
|
423
421
|
getMaterialType(e) {
|
|
424
|
-
return
|
|
422
|
+
return L(this.parser, e, this.name) !== null ? y : null;
|
|
425
423
|
}
|
|
426
424
|
extendMaterialParams(e, t) {
|
|
427
|
-
const n =
|
|
425
|
+
const n = L(this.parser, e, this.name);
|
|
428
426
|
if (n === null) return Promise.resolve();
|
|
429
427
|
const s = [];
|
|
430
428
|
return t.bumpScale = n.bumpFactor !== void 0 ? n.bumpFactor : 1, n.bumpTexture !== void 0 && s.push(this.parser.assignTexture(t, "bumpMap", n.bumpTexture)), Promise.all(s);
|
|
431
429
|
}
|
|
432
430
|
}, gt = class {
|
|
433
431
|
constructor(e) {
|
|
434
|
-
this.parser = e, this.name =
|
|
432
|
+
this.parser = e, this.name = g.KHR_MATERIALS_ANISOTROPY;
|
|
435
433
|
}
|
|
436
434
|
getMaterialType(e) {
|
|
437
|
-
return
|
|
435
|
+
return L(this.parser, e, this.name) !== null ? y : null;
|
|
438
436
|
}
|
|
439
437
|
extendMaterialParams(e, t) {
|
|
440
|
-
const n =
|
|
438
|
+
const n = L(this.parser, e, this.name);
|
|
441
439
|
if (n === null) return Promise.resolve();
|
|
442
440
|
const s = [];
|
|
443
441
|
return n.anisotropyStrength !== void 0 && (t.anisotropy = n.anisotropyStrength), n.anisotropyRotation !== void 0 && (t.anisotropyRotation = n.anisotropyRotation), n.anisotropyTexture !== void 0 && s.push(this.parser.assignTexture(t, "anisotropyMap", n.anisotropyTexture)), Promise.all(s);
|
|
444
442
|
}
|
|
445
443
|
}, Tt = class {
|
|
446
444
|
constructor(e) {
|
|
447
|
-
this.parser = e, this.name =
|
|
445
|
+
this.parser = e, this.name = g.KHR_TEXTURE_BASISU;
|
|
448
446
|
}
|
|
449
447
|
loadTexture(e) {
|
|
450
448
|
const t = this.parser, n = t.json, s = n.textures[e];
|
|
@@ -458,7 +456,7 @@ var m = {
|
|
|
458
456
|
}
|
|
459
457
|
}, Rt = class {
|
|
460
458
|
constructor(e) {
|
|
461
|
-
this.parser = e, this.name =
|
|
459
|
+
this.parser = e, this.name = g.EXT_TEXTURE_WEBP;
|
|
462
460
|
}
|
|
463
461
|
loadTexture(e) {
|
|
464
462
|
const t = this.name, n = this.parser, s = n.json, r = s.textures[e];
|
|
@@ -473,7 +471,7 @@ var m = {
|
|
|
473
471
|
}
|
|
474
472
|
}, Et = class {
|
|
475
473
|
constructor(e) {
|
|
476
|
-
this.parser = e, this.name =
|
|
474
|
+
this.parser = e, this.name = g.EXT_TEXTURE_AVIF;
|
|
477
475
|
}
|
|
478
476
|
loadTexture(e) {
|
|
479
477
|
const t = this.name, n = this.parser, s = n.json, r = s.textures[e];
|
|
@@ -486,7 +484,7 @@ var m = {
|
|
|
486
484
|
}
|
|
487
485
|
return n.loadTextureImage(e, i.source, a);
|
|
488
486
|
}
|
|
489
|
-
},
|
|
487
|
+
}, re = class {
|
|
490
488
|
constructor(e, t) {
|
|
491
489
|
this.name = t, this.parser = e;
|
|
492
490
|
}
|
|
@@ -511,64 +509,77 @@ var m = {
|
|
|
511
509
|
}
|
|
512
510
|
}, At = class {
|
|
513
511
|
constructor(e) {
|
|
514
|
-
this.name =
|
|
512
|
+
this.name = g.EXT_MESH_GPU_INSTANCING, this.parser = e;
|
|
515
513
|
}
|
|
516
514
|
createNodeMesh(e) {
|
|
517
515
|
const t = this.parser.json, n = t.nodes[e];
|
|
518
516
|
if (!n.extensions || !n.extensions[this.name] || n.mesh === void 0) return null;
|
|
519
517
|
const s = t.meshes[n.mesh];
|
|
520
|
-
for (const a of s.primitives) if (a.mode !==
|
|
518
|
+
for (const a of s.primitives) if (a.mode !== x.TRIANGLES && a.mode !== x.TRIANGLE_STRIP && a.mode !== x.TRIANGLE_FAN && a.mode !== void 0) return null;
|
|
521
519
|
const r = n.extensions[this.name].attributes, i = [], o = {};
|
|
522
520
|
for (const a in r) i.push(this.parser.getDependency("accessor", r[a]).then((c) => (o[a] = c, o[a])));
|
|
523
521
|
return i.length < 1 ? null : (i.push(this.parser.createNodeMesh(e)), Promise.all(i).then((a) => {
|
|
524
522
|
const c = a.pop(), l = c.isGroup ? c.children : [c], u = a[0].count, h = [];
|
|
525
523
|
for (const f of l) {
|
|
526
|
-
const p = new U(),
|
|
527
|
-
for (let
|
|
528
|
-
o.TRANSLATION &&
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
524
|
+
const p = new U(), m = new I(), d = new pe(), R = new I(1, 1, 1), A = new xe(f.geometry, f.material, u);
|
|
525
|
+
for (let E = 0; E < u; E++)
|
|
526
|
+
o.TRANSLATION && m.fromBufferAttribute(o.TRANSLATION, E), o.ROTATION && d.fromBufferAttribute(o.ROTATION, E), o.SCALE && R.fromBufferAttribute(o.SCALE, E), A.setMatrixAt(E, p.compose(m, d, R));
|
|
527
|
+
let T = null;
|
|
528
|
+
for (const E in o) if (E === "_COLOR_0") {
|
|
529
|
+
const M = o[E];
|
|
530
|
+
A.instanceColor = new Z(M.array, M.itemSize, M.normalized);
|
|
531
|
+
} else if (E !== "TRANSLATION" && E !== "ROTATION" && E !== "SCALE") {
|
|
532
|
+
if (T === null) {
|
|
533
|
+
const v = A.geometry;
|
|
534
|
+
T = new le(), T.name = v.name;
|
|
535
|
+
for (const _ in v.attributes) T.setAttribute(_, v.attributes[_]);
|
|
536
|
+
for (const _ in v.morphAttributes) T.morphAttributes[_] = v.morphAttributes[_];
|
|
537
|
+
v.index !== null && T.setIndex(v.index), T.morphTargetsRelative = v.morphTargetsRelative;
|
|
538
|
+
for (const _ of v.groups) T.addGroup(_.start, _.count, _.materialIndex);
|
|
539
|
+
v.boundingBox !== null && (T.boundingBox = v.boundingBox.clone()), v.boundingSphere !== null && (T.boundingSphere = v.boundingSphere.clone()), T.drawRange.start = v.drawRange.start, T.drawRange.count = v.drawRange.count, T.userData = Object.assign({}, v.userData), A.geometry = T;
|
|
540
|
+
}
|
|
541
|
+
const M = o[E];
|
|
542
|
+
T.setAttribute(E, new Z(M.array, M.itemSize, M.normalized));
|
|
543
|
+
}
|
|
544
|
+
de.prototype.copy.call(A, f), this.parser.assignFinalMaterial(A), h.push(A);
|
|
534
545
|
}
|
|
535
546
|
return c.isGroup ? (c.clear(), c.add(...h), c) : h[0];
|
|
536
547
|
}));
|
|
537
548
|
}
|
|
538
|
-
},
|
|
549
|
+
}, Te = "glTF", P = 12, ie = {
|
|
539
550
|
JSON: 1313821514,
|
|
540
551
|
BIN: 5130562
|
|
541
|
-
},
|
|
552
|
+
}, vt = class {
|
|
542
553
|
constructor(e) {
|
|
543
|
-
this.name =
|
|
544
|
-
const t = new DataView(e, 0,
|
|
554
|
+
this.name = g.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
555
|
+
const t = new DataView(e, 0, P), n = new TextDecoder();
|
|
545
556
|
if (this.header = {
|
|
546
557
|
magic: n.decode(new Uint8Array(e.slice(0, 4))),
|
|
547
558
|
version: t.getUint32(4, !0),
|
|
548
559
|
length: t.getUint32(8, !0)
|
|
549
|
-
}, this.header.magic !==
|
|
560
|
+
}, this.header.magic !== Te) throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
|
|
550
561
|
if (this.header.version < 2) throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
|
|
551
|
-
const s = this.header.length -
|
|
562
|
+
const s = this.header.length - P, r = new DataView(e, P);
|
|
552
563
|
let i = 0;
|
|
553
564
|
for (; i < s; ) {
|
|
554
565
|
const o = r.getUint32(i, !0);
|
|
555
566
|
i += 4;
|
|
556
567
|
const a = r.getUint32(i, !0);
|
|
557
|
-
if (i += 4, a ===
|
|
558
|
-
const c = new Uint8Array(e,
|
|
568
|
+
if (i += 4, a === ie.JSON) {
|
|
569
|
+
const c = new Uint8Array(e, P + i, o);
|
|
559
570
|
this.content = n.decode(c);
|
|
560
|
-
} else if (a ===
|
|
561
|
-
const c =
|
|
571
|
+
} else if (a === ie.BIN) {
|
|
572
|
+
const c = P + i;
|
|
562
573
|
this.body = e.slice(c, c + o);
|
|
563
574
|
}
|
|
564
575
|
i += o;
|
|
565
576
|
}
|
|
566
577
|
if (this.content === null) throw new Error("THREE.GLTFLoader: JSON content not found.");
|
|
567
578
|
}
|
|
568
|
-
},
|
|
579
|
+
}, _t = class {
|
|
569
580
|
constructor(e, t) {
|
|
570
581
|
if (!t) throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
|
|
571
|
-
this.name =
|
|
582
|
+
this.name = g.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t, this.dracoLoader.preload();
|
|
572
583
|
}
|
|
573
584
|
decodePrimitive(e, t) {
|
|
574
585
|
const n = this.json, s = this.dracoLoader, r = e.extensions[this.name].bufferView, i = e.extensions[this.name].attributes, o = {}, a = {}, c = {};
|
|
@@ -587,26 +598,31 @@ var m = {
|
|
|
587
598
|
return new Promise(function(u, h) {
|
|
588
599
|
s.decodeDracoFile(l, function(f) {
|
|
589
600
|
for (const p in f.attributes) {
|
|
590
|
-
const
|
|
591
|
-
d !== void 0 && (
|
|
601
|
+
const m = f.attributes[p], d = a[p];
|
|
602
|
+
d !== void 0 && (m.normalized = d);
|
|
592
603
|
}
|
|
593
604
|
u(f);
|
|
594
|
-
}, o, c,
|
|
605
|
+
}, o, c, b, h);
|
|
595
606
|
});
|
|
596
607
|
});
|
|
597
608
|
}
|
|
598
609
|
}, Lt = class {
|
|
599
610
|
constructor() {
|
|
600
|
-
this.name =
|
|
611
|
+
this.name = g.KHR_TEXTURE_TRANSFORM;
|
|
601
612
|
}
|
|
602
613
|
extendTexture(e, t) {
|
|
603
|
-
|
|
614
|
+
if ((t.texCoord === void 0 || t.texCoord === e.channel) && t.offset === void 0 && t.rotation === void 0 && t.scale === void 0) return e;
|
|
615
|
+
if (e = e.clone(), t.texCoord !== void 0 && (e.channel = t.texCoord), t.offset !== void 0 && e.offset.fromArray(t.offset), t.rotation !== void 0 && (e.rotation = t.rotation), t.scale !== void 0 && e.repeat.fromArray(t.scale), t.rotation !== void 0) {
|
|
616
|
+
const n = Math.cos(e.rotation), s = Math.sin(e.rotation);
|
|
617
|
+
e.matrix.set(e.repeat.x * n, e.repeat.y * s, e.offset.x, -e.repeat.x * s, e.repeat.y * n, e.offset.y, 0, 0, 1), e.matrixAutoUpdate = !1;
|
|
618
|
+
}
|
|
619
|
+
return e.needsUpdate = !0, e;
|
|
604
620
|
}
|
|
605
621
|
}, Mt = class {
|
|
606
622
|
constructor() {
|
|
607
|
-
this.name =
|
|
623
|
+
this.name = g.KHR_MESH_QUANTIZATION;
|
|
608
624
|
}
|
|
609
|
-
},
|
|
625
|
+
}, Re = class extends we {
|
|
610
626
|
constructor(e, t, n, s) {
|
|
611
627
|
super(e, t, n, s);
|
|
612
628
|
}
|
|
@@ -616,19 +632,19 @@ var m = {
|
|
|
616
632
|
return t;
|
|
617
633
|
}
|
|
618
634
|
interpolate_(e, t, n, s) {
|
|
619
|
-
const r = this.resultBuffer, i = this.sampleValues, o = this.valueSize, a = o * 2, c = o * 3, l = s - t, u = (n - t) / l, h = u * u, f = h * u, p = e * c,
|
|
620
|
-
for (let
|
|
621
|
-
const
|
|
622
|
-
r[
|
|
635
|
+
const r = this.resultBuffer, i = this.sampleValues, o = this.valueSize, a = o * 2, c = o * 3, l = s - t, u = (n - t) / l, h = u * u, f = h * u, p = e * c, m = p - c, d = -2 * f + 3 * h, R = f - h, A = 1 - d, T = R - h + u;
|
|
636
|
+
for (let E = 0; E !== o; E++) {
|
|
637
|
+
const M = i[m + E + o], v = i[m + E + a] * l, _ = i[p + E + o], k = i[p + E] * l;
|
|
638
|
+
r[E] = A * M + T * v + d * _ + R * k;
|
|
623
639
|
}
|
|
624
640
|
return r;
|
|
625
641
|
}
|
|
626
|
-
}, xt = new
|
|
642
|
+
}, xt = new pe(), St = class extends Re {
|
|
627
643
|
interpolate_(e, t, n, s) {
|
|
628
644
|
const r = super.interpolate_(e, t, n, s);
|
|
629
645
|
return xt.fromArray(r).normalize().toArray(r), r;
|
|
630
646
|
}
|
|
631
|
-
},
|
|
647
|
+
}, x = {
|
|
632
648
|
FLOAT: 5126,
|
|
633
649
|
FLOAT_MAT3: 35675,
|
|
634
650
|
FLOAT_MAT4: 35676,
|
|
@@ -654,14 +670,14 @@ var m = {
|
|
|
654
670
|
5123: Uint16Array,
|
|
655
671
|
5125: Uint32Array,
|
|
656
672
|
5126: Float32Array
|
|
657
|
-
},
|
|
673
|
+
}, oe = {
|
|
658
674
|
9728: Be,
|
|
659
675
|
9729: Fe,
|
|
660
676
|
9984: je,
|
|
661
|
-
9985:
|
|
677
|
+
9985: Pe,
|
|
662
678
|
9986: Ke,
|
|
663
|
-
9987:
|
|
664
|
-
},
|
|
679
|
+
9987: ke
|
|
680
|
+
}, ae = {
|
|
665
681
|
33071: _e,
|
|
666
682
|
33648: Ue,
|
|
667
683
|
10497: Qe
|
|
@@ -691,15 +707,15 @@ var m = {
|
|
|
691
707
|
weights: "morphTargetInfluences"
|
|
692
708
|
}, yt = {
|
|
693
709
|
CUBICSPLINE: void 0,
|
|
694
|
-
LINEAR:
|
|
695
|
-
STEP:
|
|
710
|
+
LINEAR: he,
|
|
711
|
+
STEP: be
|
|
696
712
|
}, q = {
|
|
697
713
|
OPAQUE: "OPAQUE",
|
|
698
714
|
MASK: "MASK",
|
|
699
715
|
BLEND: "BLEND"
|
|
700
716
|
};
|
|
701
717
|
function wt(e) {
|
|
702
|
-
return e.DefaultMaterial === void 0 && (e.DefaultMaterial = new
|
|
718
|
+
return e.DefaultMaterial === void 0 && (e.DefaultMaterial = new fe({
|
|
703
719
|
color: 16777215,
|
|
704
720
|
emissive: 0,
|
|
705
721
|
metalness: 1,
|
|
@@ -709,13 +725,13 @@ function wt(e) {
|
|
|
709
725
|
side: 0
|
|
710
726
|
})), e.DefaultMaterial;
|
|
711
727
|
}
|
|
712
|
-
function
|
|
728
|
+
function N(e, t, n) {
|
|
713
729
|
for (const s in n.extensions) e[s] === void 0 && (t.userData.gltfExtensions = t.userData.gltfExtensions || {}, t.userData.gltfExtensions[s] = n.extensions[s]);
|
|
714
730
|
}
|
|
715
|
-
function
|
|
731
|
+
function S(e, t) {
|
|
716
732
|
t.extras !== void 0 && (typeof t.extras == "object" ? Object.assign(e.userData, t.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + t.extras));
|
|
717
733
|
}
|
|
718
|
-
function
|
|
734
|
+
function bt(e, t, n) {
|
|
719
735
|
let s = !1, r = !1, i = !1;
|
|
720
736
|
for (let l = 0, u = t.length; l < u; l++) {
|
|
721
737
|
const h = t[l];
|
|
@@ -747,7 +763,7 @@ function Nt(e, t, n) {
|
|
|
747
763
|
return s && (e.morphAttributes.position = u), r && (e.morphAttributes.normal = h), i && (e.morphAttributes.color = f), e.morphTargetsRelative = !0, e;
|
|
748
764
|
});
|
|
749
765
|
}
|
|
750
|
-
function
|
|
766
|
+
function Nt(e, t) {
|
|
751
767
|
if (e.updateMorphTargets(), t.weights !== void 0) for (let n = 0, s = t.weights.length; n < s; n++) e.morphTargetInfluences[n] = t.weights[n];
|
|
752
768
|
if (t.extras && Array.isArray(t.extras.targetNames)) {
|
|
753
769
|
const n = t.extras.targetNames;
|
|
@@ -759,7 +775,7 @@ function bt(e, t) {
|
|
|
759
775
|
}
|
|
760
776
|
function It(e) {
|
|
761
777
|
let t;
|
|
762
|
-
const n = e.extensions && e.extensions[
|
|
778
|
+
const n = e.extensions && e.extensions[g.KHR_DRACO_MESH_COMPRESSION];
|
|
763
779
|
if (n ? t = "draco:" + n.bufferView + ":" + n.indices + ":" + W(n.attributes) : t = e.indices + ":" + W(e.attributes) + ":" + e.mode, e.targets !== void 0) for (let s = 0, r = e.targets.length; s < r; s++) t += ":" + W(e.targets[s]);
|
|
764
780
|
return t;
|
|
765
781
|
}
|
|
@@ -805,7 +821,7 @@ var Ct = new U(), Ft = class {
|
|
|
805
821
|
const a = o.match(/Version\/(\d+)/);
|
|
806
822
|
s = n && a ? parseInt(a[1], 10) : -1, r = o.indexOf("Firefox") > -1, i = r ? o.match(/Firefox\/([0-9]+)\./)[1] : -1;
|
|
807
823
|
}
|
|
808
|
-
typeof createImageBitmap > "u" || n && s < 17 || r && i < 98 ? this.textureLoader = new tt(this.options.manager) : this.textureLoader = new
|
|
824
|
+
typeof createImageBitmap > "u" || n && s < 17 || r && i < 98 ? this.textureLoader = new tt(this.options.manager) : this.textureLoader = new Me(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new ue(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
|
|
809
825
|
}
|
|
810
826
|
setExtensions(e) {
|
|
811
827
|
this.extensions = e;
|
|
@@ -835,7 +851,7 @@ var Ct = new U(), Ft = class {
|
|
|
835
851
|
parser: n,
|
|
836
852
|
userData: {}
|
|
837
853
|
};
|
|
838
|
-
return
|
|
854
|
+
return N(r, o, s), S(o, s), Promise.all(n._invokeAll(function(a) {
|
|
839
855
|
return a.afterRoot && a.afterRoot(o);
|
|
840
856
|
})).then(function() {
|
|
841
857
|
for (const a of o.scenes) a.updateMatrixWorld();
|
|
@@ -957,7 +973,7 @@ var Ct = new U(), Ft = class {
|
|
|
957
973
|
loadBuffer(e) {
|
|
958
974
|
const t = this.json.buffers[e], n = this.fileLoader;
|
|
959
975
|
if (t.type && t.type !== "arraybuffer") throw new Error("THREE.GLTFLoader: " + t.type + " buffer type is not supported.");
|
|
960
|
-
if (t.uri === void 0 && e === 0) return Promise.resolve(this.extensions[
|
|
976
|
+
if (t.uri === void 0 && e === 0) return Promise.resolve(this.extensions[g.KHR_BINARY_GLTF].body);
|
|
961
977
|
const s = this.options;
|
|
962
978
|
return new Promise(function(r, i) {
|
|
963
979
|
n.load(D.resolveURL(t.uri, s.path), r, void 0, function() {
|
|
@@ -981,19 +997,19 @@ var Ct = new U(), Ft = class {
|
|
|
981
997
|
const r = [];
|
|
982
998
|
return s.bufferView !== void 0 ? r.push(this.getDependency("bufferView", s.bufferView)) : r.push(null), s.sparse !== void 0 && (r.push(this.getDependency("bufferView", s.sparse.indices.bufferView)), r.push(this.getDependency("bufferView", s.sparse.values.bufferView))), Promise.all(r).then(function(i) {
|
|
983
999
|
const o = i[0], a = z[s.type], c = F[s.componentType], l = c.BYTES_PER_ELEMENT, u = l * a, h = s.byteOffset || 0, f = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0, p = s.normalized === !0;
|
|
984
|
-
let
|
|
1000
|
+
let m, d;
|
|
985
1001
|
if (f && f !== u) {
|
|
986
|
-
const
|
|
987
|
-
let
|
|
988
|
-
|
|
1002
|
+
const R = Math.floor(h / f), A = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + R + ":" + s.count;
|
|
1003
|
+
let T = t.cache.get(A);
|
|
1004
|
+
T || (m = new c(o, R * f, s.count * f / l), T = new Se(m, f / l), t.cache.add(A, T)), d = new ye(T, a, h % f / l, p);
|
|
989
1005
|
} else
|
|
990
|
-
o === null ?
|
|
1006
|
+
o === null ? m = new c(s.count * a) : m = new c(o, h, s.count * a), d = new j(m, a, p);
|
|
991
1007
|
if (s.sparse !== void 0) {
|
|
992
|
-
const
|
|
1008
|
+
const R = z.SCALAR, A = F[s.sparse.indices.componentType], T = s.sparse.indices.byteOffset || 0, E = s.sparse.values.byteOffset || 0, M = new A(i[1], T, s.sparse.count * R), v = new c(i[2], E, s.sparse.count * a);
|
|
993
1009
|
o !== null && (d = new j(d.array.slice(), d.itemSize, d.normalized)), d.normalized = !1;
|
|
994
|
-
for (let
|
|
995
|
-
const C =
|
|
996
|
-
if (d.setX(C,
|
|
1010
|
+
for (let _ = 0, k = M.length; _ < k; _++) {
|
|
1011
|
+
const C = M[_];
|
|
1012
|
+
if (d.setX(C, v[_ * a]), a >= 2 && d.setY(C, v[_ * a + 1]), a >= 3 && d.setZ(C, v[_ * a + 2]), a >= 4 && d.setW(C, v[_ * a + 3]), a >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
997
1013
|
}
|
|
998
1014
|
d.normalized = p;
|
|
999
1015
|
}
|
|
@@ -1015,7 +1031,7 @@ var Ct = new U(), Ft = class {
|
|
|
1015
1031
|
const c = this.loadImageSource(t, n).then(function(l) {
|
|
1016
1032
|
l.flipY = !1, l.name = i.name || o.name || "", l.name === "" && typeof o.uri == "string" && o.uri.startsWith("data:image/") === !1 && (l.name = o.uri);
|
|
1017
1033
|
const u = (r.samplers || {})[i.sampler] || {};
|
|
1018
|
-
return l.magFilter =
|
|
1034
|
+
return l.magFilter = oe[u.magFilter] || 1006, l.minFilter = oe[u.minFilter] || 1008, l.wrapS = ae[u.wrapS] || 1e3, l.wrapT = ae[u.wrapT] || 1e3, l.generateMipmaps = !l.isCompressedTexture && l.minFilter !== 1003 && l.minFilter !== 1006, s.associations.set(l, { textures: e }), l;
|
|
1019
1035
|
}).catch(function() {
|
|
1020
1036
|
return null;
|
|
1021
1037
|
});
|
|
@@ -1035,13 +1051,13 @@ var Ct = new U(), Ft = class {
|
|
|
1035
1051
|
const l = Promise.resolve(a).then(function(u) {
|
|
1036
1052
|
return new Promise(function(h, f) {
|
|
1037
1053
|
let p = h;
|
|
1038
|
-
t.isImageBitmapLoader === !0 && (p = function(
|
|
1039
|
-
const d = new
|
|
1054
|
+
t.isImageBitmapLoader === !0 && (p = function(m) {
|
|
1055
|
+
const d = new te(m);
|
|
1040
1056
|
d.needsUpdate = !0, h(d);
|
|
1041
1057
|
}), t.load(D.resolveURL(u, r.path), p, void 0, f);
|
|
1042
1058
|
});
|
|
1043
1059
|
}).then(function(u) {
|
|
1044
|
-
return c === !0 && o.revokeObjectURL(a),
|
|
1060
|
+
return c === !0 && o.revokeObjectURL(a), S(u, i), u.userData.mimeType = i.mimeType || Ot(i.uri), u;
|
|
1045
1061
|
}).catch(function(u) {
|
|
1046
1062
|
throw console.error("THREE.GLTFLoader: Couldn't load texture", a), u;
|
|
1047
1063
|
});
|
|
@@ -1051,11 +1067,11 @@ var Ct = new U(), Ft = class {
|
|
|
1051
1067
|
const r = this;
|
|
1052
1068
|
return this.getDependency("texture", n.index).then(function(i) {
|
|
1053
1069
|
if (!i) return null;
|
|
1054
|
-
if (n.texCoord !== void 0 && n.texCoord > 0 && (i = i.clone(), i.channel = n.texCoord), r.extensions[
|
|
1055
|
-
const o = n.extensions !== void 0 ? n.extensions[
|
|
1070
|
+
if (n.texCoord !== void 0 && n.texCoord > 0 && (i = i.clone(), i.channel = n.texCoord), r.extensions[g.KHR_TEXTURE_TRANSFORM]) {
|
|
1071
|
+
const o = n.extensions !== void 0 ? n.extensions[g.KHR_TEXTURE_TRANSFORM] : void 0;
|
|
1056
1072
|
if (o) {
|
|
1057
1073
|
const a = r.associations.get(i);
|
|
1058
|
-
i = r.extensions[
|
|
1074
|
+
i = r.extensions[g.KHR_TEXTURE_TRANSFORM].extendTexture(i, o), r.associations.set(i, a);
|
|
1059
1075
|
}
|
|
1060
1076
|
}
|
|
1061
1077
|
return s !== void 0 && (i.colorSpace = s), e[t] = i, i;
|
|
@@ -1083,20 +1099,20 @@ var Ct = new U(), Ft = class {
|
|
|
1083
1099
|
e.material = n;
|
|
1084
1100
|
}
|
|
1085
1101
|
getMaterialType() {
|
|
1086
|
-
return
|
|
1102
|
+
return fe;
|
|
1087
1103
|
}
|
|
1088
1104
|
loadMaterial(e) {
|
|
1089
1105
|
const t = this, n = this.json, s = this.extensions, r = n.materials[e];
|
|
1090
1106
|
let i;
|
|
1091
1107
|
const o = {}, a = r.extensions || {}, c = [];
|
|
1092
|
-
if (a[
|
|
1093
|
-
const u = s[
|
|
1108
|
+
if (a[g.KHR_MATERIALS_UNLIT]) {
|
|
1109
|
+
const u = s[g.KHR_MATERIALS_UNLIT];
|
|
1094
1110
|
i = u.getMaterialType(), c.push(u.extendParams(o, r, t));
|
|
1095
1111
|
} else {
|
|
1096
1112
|
const u = r.pbrMetallicRoughness || {};
|
|
1097
1113
|
if (o.color = new O(1, 1, 1), o.opacity = 1, Array.isArray(u.baseColorFactor)) {
|
|
1098
1114
|
const h = u.baseColorFactor;
|
|
1099
|
-
o.color.setRGB(h[0], h[1], h[2],
|
|
1115
|
+
o.color.setRGB(h[0], h[1], h[2], b), o.opacity = h[3];
|
|
1100
1116
|
}
|
|
1101
1117
|
u.baseColorTexture !== void 0 && c.push(t.assignTexture(o, "map", u.baseColorTexture, G)), o.metalness = u.metallicFactor !== void 0 ? u.metallicFactor : 1, o.roughness = u.roughnessFactor !== void 0 ? u.roughnessFactor : 1, u.metallicRoughnessTexture !== void 0 && (c.push(t.assignTexture(o, "metalnessMap", u.metallicRoughnessTexture)), c.push(t.assignTexture(o, "roughnessMap", u.metallicRoughnessTexture))), i = this._invokeOne(function(h) {
|
|
1102
1118
|
return h.getMaterialType && h.getMaterialType(e);
|
|
@@ -1106,17 +1122,17 @@ var Ct = new U(), Ft = class {
|
|
|
1106
1122
|
}
|
|
1107
1123
|
r.doubleSided === !0 && (o.side = 2);
|
|
1108
1124
|
const l = r.alphaMode || q.OPAQUE;
|
|
1109
|
-
if (l === q.BLEND ? (o.transparent = !0, o.depthWrite = !1) : (o.transparent = !1, l === q.MASK && (o.alphaTest = r.alphaCutoff !== void 0 ? r.alphaCutoff : 0.5)), r.normalTexture !== void 0 && i !==
|
|
1125
|
+
if (l === q.BLEND ? (o.transparent = !0, o.depthWrite = !1) : (o.transparent = !1, l === q.MASK && (o.alphaTest = r.alphaCutoff !== void 0 ? r.alphaCutoff : 0.5)), r.normalTexture !== void 0 && i !== H && (c.push(t.assignTexture(o, "normalMap", r.normalTexture)), o.normalScale = new me(1, 1), r.normalTexture.scale !== void 0)) {
|
|
1110
1126
|
const u = r.normalTexture.scale;
|
|
1111
1127
|
o.normalScale.set(u, u);
|
|
1112
1128
|
}
|
|
1113
|
-
if (r.occlusionTexture !== void 0 && i !==
|
|
1129
|
+
if (r.occlusionTexture !== void 0 && i !== H && (c.push(t.assignTexture(o, "aoMap", r.occlusionTexture)), r.occlusionTexture.strength !== void 0 && (o.aoMapIntensity = r.occlusionTexture.strength)), r.emissiveFactor !== void 0 && i !== H) {
|
|
1114
1130
|
const u = r.emissiveFactor;
|
|
1115
|
-
o.emissive = new O().setRGB(u[0], u[1], u[2],
|
|
1131
|
+
o.emissive = new O().setRGB(u[0], u[1], u[2], b);
|
|
1116
1132
|
}
|
|
1117
|
-
return r.emissiveTexture !== void 0 && i !==
|
|
1133
|
+
return r.emissiveTexture !== void 0 && i !== H && c.push(t.assignTexture(o, "emissiveMap", r.emissiveTexture, G)), Promise.all(c).then(function() {
|
|
1118
1134
|
const u = new i(o);
|
|
1119
|
-
return r.name && (u.name = r.name),
|
|
1135
|
+
return r.name && (u.name = r.name), S(u, r), t.associations.set(u, { materials: e }), r.extensions && N(s, u, r), u;
|
|
1120
1136
|
});
|
|
1121
1137
|
}
|
|
1122
1138
|
createUniqueName(e) {
|
|
@@ -1126,8 +1142,8 @@ var Ct = new U(), Ft = class {
|
|
|
1126
1142
|
loadGeometries(e) {
|
|
1127
1143
|
const t = this, n = this.extensions, s = this.primitiveCache;
|
|
1128
1144
|
function r(o) {
|
|
1129
|
-
return n[
|
|
1130
|
-
return
|
|
1145
|
+
return n[g.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(o, t).then(function(a) {
|
|
1146
|
+
return ce(a, o, t);
|
|
1131
1147
|
});
|
|
1132
1148
|
}
|
|
1133
1149
|
const i = [];
|
|
@@ -1136,7 +1152,7 @@ var Ct = new U(), Ft = class {
|
|
|
1136
1152
|
if (u) i.push(u.promise);
|
|
1137
1153
|
else {
|
|
1138
1154
|
let h;
|
|
1139
|
-
c.extensions && c.extensions[
|
|
1155
|
+
c.extensions && c.extensions[g.KHR_DRACO_MESH_COMPRESSION] ? h = r(c) : h = ce(new le(), c, t), c.mode === x.TRIANGLE_STRIP ? h = h.then((f) => ne(f, 1)) : c.mode === x.TRIANGLE_FAN && (h = h.then((f) => ne(f, 2))), s[l] = {
|
|
1140
1156
|
primitive: c,
|
|
1141
1157
|
promise: h
|
|
1142
1158
|
}, i.push(h);
|
|
@@ -1150,29 +1166,30 @@ var Ct = new U(), Ft = class {
|
|
|
1150
1166
|
const l = i[a].material === void 0 ? wt(this.cache) : this.getDependency("material", i[a].material);
|
|
1151
1167
|
o.push(l);
|
|
1152
1168
|
}
|
|
1153
|
-
return o.push(t.loadGeometries(i)), Promise.all(o).then(function(a) {
|
|
1169
|
+
return o.push(t.loadGeometries(i)), Promise.all(o).then(async function(a) {
|
|
1154
1170
|
const c = a.slice(0, a.length - 1), l = a[a.length - 1], u = [];
|
|
1155
1171
|
for (let f = 0, p = l.length; f < p; f++) {
|
|
1156
|
-
const
|
|
1157
|
-
let
|
|
1158
|
-
const
|
|
1159
|
-
if (d.mode ===
|
|
1160
|
-
T = r.isSkinnedMesh === !0
|
|
1161
|
-
|
|
1162
|
-
else if (d.mode ===
|
|
1163
|
-
else if (d.mode ===
|
|
1164
|
-
else if (d.mode ===
|
|
1172
|
+
const m = l[f], d = i[f];
|
|
1173
|
+
let R;
|
|
1174
|
+
const A = c[f];
|
|
1175
|
+
if (d.mode === x.TRIANGLES || d.mode === x.TRIANGLE_STRIP || d.mode === x.TRIANGLE_FAN || d.mode === void 0) {
|
|
1176
|
+
const T = r.isSkinnedMesh === !0, E = m.hasAttribute("skinIndex") && m.hasAttribute("skinWeight");
|
|
1177
|
+
T && E === !1 && console.warn("THREE.GLTFLoader: Missing skinIndex or skinWeight attributes. Skinning disabled."), R = T && E ? new Ze(m, A) : new Ge(m, A), R.isSkinnedMesh === !0 && R.normalizeSkinWeights();
|
|
1178
|
+
} else if (d.mode === x.LINES) R = new Ce(m, A);
|
|
1179
|
+
else if (d.mode === x.LINE_STRIP) R = new Ne(m, A);
|
|
1180
|
+
else if (d.mode === x.LINE_LOOP) R = new Oe(m, A);
|
|
1181
|
+
else if (d.mode === x.POINTS) R = new qe(m, A);
|
|
1165
1182
|
else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + d.mode);
|
|
1166
|
-
Object.keys(
|
|
1183
|
+
Object.keys(R.geometry.morphAttributes).length > 0 && Nt(R, r), R.name = t.createUniqueName(r.name || "mesh_" + e), S(R, r), d.extensions && N(s, R, d), t.assignFinalMaterial(R), u.push(R);
|
|
1167
1184
|
}
|
|
1168
1185
|
for (let f = 0, p = u.length; f < p; f++) t.associations.set(u[f], {
|
|
1169
1186
|
meshes: e,
|
|
1170
1187
|
primitives: f
|
|
1171
1188
|
});
|
|
1172
1189
|
if (u.length === 1)
|
|
1173
|
-
return r.extensions &&
|
|
1190
|
+
return r.extensions && N(s, u[0], r), u[0];
|
|
1174
1191
|
const h = new V();
|
|
1175
|
-
r.extensions &&
|
|
1192
|
+
r.extensions && N(s, h, r), t.associations.set(h, { meshes: e });
|
|
1176
1193
|
for (let f = 0, p = u.length; f < p; f++) h.add(u[f]);
|
|
1177
1194
|
return h;
|
|
1178
1195
|
});
|
|
@@ -1184,7 +1201,7 @@ var Ct = new U(), Ft = class {
|
|
|
1184
1201
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
1185
1202
|
return;
|
|
1186
1203
|
}
|
|
1187
|
-
return n.type === "perspective" ? t = new Xe(De.radToDeg(s.yfov), s.aspectRatio || 1, s.znear || 1, s.zfar || 2e6) : n.type === "orthographic" && (t = new Ve(-s.xmag, s.xmag, s.ymag, -s.ymag, s.znear, s.zfar)), n.name && (t.name = this.createUniqueName(n.name)),
|
|
1204
|
+
return n.type === "perspective" ? t = new Xe(De.radToDeg(s.yfov), s.aspectRatio || 1, s.znear || 1, s.zfar || 2e6) : n.type === "orthographic" && (t = new Ve(-s.xmag, s.xmag, s.ymag, -s.ymag, s.znear, s.zfar)), n.name && (t.name = this.createUniqueName(n.name)), S(t, n), Promise.resolve(t);
|
|
1188
1205
|
}
|
|
1189
1206
|
loadSkin(e) {
|
|
1190
1207
|
const t = this.json.skins[e], n = [];
|
|
@@ -1205,8 +1222,8 @@ var Ct = new U(), Ft = class {
|
|
|
1205
1222
|
loadAnimation(e) {
|
|
1206
1223
|
const t = this.json, n = this, s = t.animations[e], r = s.name ? s.name : "animation_" + e, i = [], o = [], a = [], c = [], l = [];
|
|
1207
1224
|
for (let u = 0, h = s.channels.length; u < h; u++) {
|
|
1208
|
-
const f = s.channels[u], p = s.samplers[f.sampler],
|
|
1209
|
-
|
|
1225
|
+
const f = s.channels[u], p = s.samplers[f.sampler], m = f.target, d = m.node, R = s.parameters !== void 0 ? s.parameters[p.input] : p.input, A = s.parameters !== void 0 ? s.parameters[p.output] : p.output;
|
|
1226
|
+
m.node !== void 0 && (i.push(this.getDependency("node", d)), o.push(this.getDependency("accessor", R)), a.push(this.getDependency("accessor", A)), c.push(p), l.push(m));
|
|
1210
1227
|
}
|
|
1211
1228
|
return Promise.all([
|
|
1212
1229
|
Promise.all(i),
|
|
@@ -1215,16 +1232,16 @@ var Ct = new U(), Ft = class {
|
|
|
1215
1232
|
Promise.all(c),
|
|
1216
1233
|
Promise.all(l)
|
|
1217
1234
|
]).then(function(u) {
|
|
1218
|
-
const h = u[0], f = u[1], p = u[2],
|
|
1219
|
-
for (let
|
|
1220
|
-
const
|
|
1221
|
-
if (
|
|
1222
|
-
|
|
1223
|
-
const B = n._createAnimationTracks(
|
|
1224
|
-
if (B) for (let K = 0; K < B.length; K++)
|
|
1235
|
+
const h = u[0], f = u[1], p = u[2], m = u[3], d = u[4], R = [];
|
|
1236
|
+
for (let T = 0, E = h.length; T < E; T++) {
|
|
1237
|
+
const M = h[T], v = f[T], _ = p[T], k = m[T], C = d[T];
|
|
1238
|
+
if (M === void 0) continue;
|
|
1239
|
+
M.updateMatrix && M.updateMatrix();
|
|
1240
|
+
const B = n._createAnimationTracks(M, v, _, k, C);
|
|
1241
|
+
if (B) for (let K = 0; K < B.length; K++) R.push(B[K]);
|
|
1225
1242
|
}
|
|
1226
|
-
const
|
|
1227
|
-
return
|
|
1243
|
+
const A = new Ee(r, void 0, R);
|
|
1244
|
+
return S(A, s), A;
|
|
1228
1245
|
});
|
|
1229
1246
|
}
|
|
1230
1247
|
createNodeMesh(e) {
|
|
@@ -1272,8 +1289,8 @@ var Ct = new U(), Ft = class {
|
|
|
1272
1289
|
o.push(c);
|
|
1273
1290
|
}), this.nodeCache[e] = Promise.all(o).then(function(c) {
|
|
1274
1291
|
let l;
|
|
1275
|
-
if (r.isBone === !0 ? l = new
|
|
1276
|
-
if (r.name && (l.userData.name = r.name, l.name = i),
|
|
1292
|
+
if (r.isBone === !0 ? l = new Ae() : c.length > 1 ? l = new V() : c.length === 1 ? l = c[0] : l = new de(), l !== c[0]) for (let u = 0, h = c.length; u < h; u++) l.add(c[u]);
|
|
1293
|
+
if (r.name && (l.userData.name = r.name, l.name = i), S(l, r), r.extensions && N(n, l, r), r.matrix !== void 0) {
|
|
1277
1294
|
const u = new U();
|
|
1278
1295
|
u.fromArray(r.matrix), l.applyMatrix4(u);
|
|
1279
1296
|
} else
|
|
@@ -1288,7 +1305,7 @@ var Ct = new U(), Ft = class {
|
|
|
1288
1305
|
}
|
|
1289
1306
|
loadScene(e) {
|
|
1290
1307
|
const t = this.extensions, n = this.json.scenes[e], s = this, r = new V();
|
|
1291
|
-
n.name && (r.name = s.createUniqueName(n.name)),
|
|
1308
|
+
n.name && (r.name = s.createUniqueName(n.name)), S(r, n), n.extensions && N(t, r, n);
|
|
1292
1309
|
const i = n.nodes || [], o = [];
|
|
1293
1310
|
for (let a = 0, c = i.length; a < c; a++) o.push(s.getDependency("node", i[a]));
|
|
1294
1311
|
return Promise.all(o).then(function(a) {
|
|
@@ -1298,7 +1315,7 @@ var Ct = new U(), Ft = class {
|
|
|
1298
1315
|
}
|
|
1299
1316
|
const c = (l) => {
|
|
1300
1317
|
const u = /* @__PURE__ */ new Map();
|
|
1301
|
-
for (const [h, f] of s.associations) (h instanceof X || h instanceof
|
|
1318
|
+
for (const [h, f] of s.associations) (h instanceof X || h instanceof te) && u.set(h, f);
|
|
1302
1319
|
return l.traverse((h) => {
|
|
1303
1320
|
const f = s.associations.get(h);
|
|
1304
1321
|
f != null && u.set(h, f);
|
|
@@ -1316,22 +1333,22 @@ var Ct = new U(), Ft = class {
|
|
|
1316
1333
|
let l;
|
|
1317
1334
|
switch (w[r.path]) {
|
|
1318
1335
|
case w.weights:
|
|
1319
|
-
l =
|
|
1336
|
+
l = $;
|
|
1320
1337
|
break;
|
|
1321
1338
|
case w.rotation:
|
|
1322
|
-
l =
|
|
1339
|
+
l = ee;
|
|
1323
1340
|
break;
|
|
1324
1341
|
case w.translation:
|
|
1325
1342
|
case w.scale:
|
|
1326
|
-
l =
|
|
1343
|
+
l = se;
|
|
1327
1344
|
break;
|
|
1328
1345
|
default:
|
|
1329
|
-
n.itemSize === 1 ? l =
|
|
1346
|
+
n.itemSize === 1 ? l = $ : l = se;
|
|
1330
1347
|
}
|
|
1331
|
-
const u = s.interpolation !== void 0 ? yt[s.interpolation] :
|
|
1348
|
+
const u = s.interpolation !== void 0 ? yt[s.interpolation] : he, h = this._getArrayFromAccessor(n);
|
|
1332
1349
|
for (let f = 0, p = a.length; f < p; f++) {
|
|
1333
|
-
const
|
|
1334
|
-
s.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(
|
|
1350
|
+
const m = new l(a[f] + "." + w[r.path], t.array, h, u);
|
|
1351
|
+
s.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(m), i.push(m);
|
|
1335
1352
|
}
|
|
1336
1353
|
return i;
|
|
1337
1354
|
}
|
|
@@ -1346,12 +1363,12 @@ var Ct = new U(), Ft = class {
|
|
|
1346
1363
|
}
|
|
1347
1364
|
_createCubicSplineTrackInterpolant(e) {
|
|
1348
1365
|
e.createInterpolant = function(n) {
|
|
1349
|
-
return new (this instanceof
|
|
1366
|
+
return new (this instanceof ee ? St : Re)(this.times, this.values, this.getValueSize() / 3, n);
|
|
1350
1367
|
}, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
|
|
1351
1368
|
}
|
|
1352
1369
|
};
|
|
1353
|
-
function
|
|
1354
|
-
const s = t.attributes, r = new
|
|
1370
|
+
function kt(e, t, n) {
|
|
1371
|
+
const s = t.attributes, r = new ve();
|
|
1355
1372
|
if (s.POSITION !== void 0) {
|
|
1356
1373
|
const a = n.json.accessors[s.POSITION], c = a.min, l = a.max;
|
|
1357
1374
|
if (c !== void 0 && l !== void 0) {
|
|
@@ -1370,9 +1387,9 @@ function Pt(e, t, n) {
|
|
|
1370
1387
|
for (let l = 0, u = i.length; l < u; l++) {
|
|
1371
1388
|
const h = i[l];
|
|
1372
1389
|
if (h.POSITION !== void 0) {
|
|
1373
|
-
const f = n.json.accessors[h.POSITION], p = f.min,
|
|
1374
|
-
if (p !== void 0 &&
|
|
1375
|
-
if (c.setX(Math.max(Math.abs(p[0]), Math.abs(
|
|
1390
|
+
const f = n.json.accessors[h.POSITION], p = f.min, m = f.max;
|
|
1391
|
+
if (p !== void 0 && m !== void 0) {
|
|
1392
|
+
if (c.setX(Math.max(Math.abs(p[0]), Math.abs(m[0]))), c.setY(Math.max(Math.abs(p[1]), Math.abs(m[1]))), c.setZ(Math.max(Math.abs(p[2]), Math.abs(m[2]))), f.normalized) {
|
|
1376
1393
|
const d = Q(F[f.componentType]);
|
|
1377
1394
|
c.multiplyScalar(d);
|
|
1378
1395
|
}
|
|
@@ -1386,7 +1403,7 @@ function Pt(e, t, n) {
|
|
|
1386
1403
|
const o = new $e();
|
|
1387
1404
|
r.getCenter(o.center), o.radius = r.min.distanceTo(r.max) / 2, e.boundingSphere = o;
|
|
1388
1405
|
}
|
|
1389
|
-
function
|
|
1406
|
+
function ce(e, t, n) {
|
|
1390
1407
|
const s = t.attributes, r = [];
|
|
1391
1408
|
function i(o, a) {
|
|
1392
1409
|
return n.getDependency("accessor", o).then(function(c) {
|
|
@@ -1403,8 +1420,8 @@ function ae(e, t, n) {
|
|
|
1403
1420
|
});
|
|
1404
1421
|
r.push(o);
|
|
1405
1422
|
}
|
|
1406
|
-
return J.workingColorSpace !== "srgb-linear" && "COLOR_0" in s && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${J.workingColorSpace}" not supported.`),
|
|
1407
|
-
return t.targets !== void 0 ?
|
|
1423
|
+
return J.workingColorSpace !== "srgb-linear" && "COLOR_0" in s && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${J.workingColorSpace}" not supported.`), S(e, t), kt(e, t, n), Promise.all(r).then(function() {
|
|
1424
|
+
return t.targets !== void 0 ? bt(e, t.targets, n) : e;
|
|
1408
1425
|
});
|
|
1409
1426
|
}
|
|
1410
1427
|
export {
|