@quick-threejs/reactive 0.1.33 → 0.1.35
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/{app.module-WohiJuEI.mjs → app.module-C2zKO1QN.mjs} +1164 -1176
- package/dist/app.module-x3kmydmS.js +35 -0
- package/dist/common/blueprints/props.blueprint.d.ts +0 -9
- package/dist/core/app/app.util.d.ts +2 -2
- package/dist/core/app/debug/debug.module.d.ts +0 -1
- package/dist/core/app/debug/debug.service.d.ts +1 -3
- package/dist/core/register/loader/loader.module.d.ts +3 -6
- package/dist/core/register/loader/loader.service.d.ts +1 -1
- package/dist/core/register/register.controller.d.ts +1 -67
- package/dist/core/register/register.module.d.ts +6 -5
- package/dist/core/register/register.service.d.ts +65 -0
- package/dist/core/register/register.util.d.ts +1 -2
- package/dist/main.js +3 -3
- package/dist/main.mjs +496 -492
- package/dist/worker.js +1 -1
- package/dist/worker.mjs +13 -18
- package/package.json +1 -1
- package/dist/app.module-BmmoQ8ZO.js +0 -35
package/dist/main.mjs
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var _ = (o, e, t) =>
|
|
4
|
-
import {
|
|
5
|
-
import { k as
|
|
6
|
-
import { TrianglesDrawMode as at, TriangleFanDrawMode as
|
|
7
|
-
|
|
1
|
+
var qe = Object.defineProperty;
|
|
2
|
+
var Ye = (o, e, t) => e in o ? qe(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var _ = (o, e, t) => Ye(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { i as Qe, a as Ie, s as z, L as X, C as Je, J as j, K as Ze, P as et, b as Oe, f as tt, m as q, c as Ne, d as b, F as st, S as nt, e as se, W as Re, U as Pe, R as rt, g as it, h as De, A as W, D as $, j as Ee, Q as ot } from "./app.module-C2zKO1QN.mjs";
|
|
5
|
+
import { k as tn, o as sn, n as nn, l as rn } from "./app.module-C2zKO1QN.mjs";
|
|
6
|
+
import { TrianglesDrawMode as at, TriangleFanDrawMode as le, TriangleStripDrawMode as ke, Loader as Fe, FileLoader as Y, SRGBColorSpace as N, LinearSRGBColorSpace as v, BufferGeometry as He, BufferAttribute as K, Color as P, ColorManagement as he, LoaderUtils as V, SpotLight as ct, PointLight as ut, DirectionalLight as lt, MeshBasicMaterial as B, MeshPhysicalMaterial as S, Vector2 as Ue, Matrix4 as Q, Vector3 as F, Quaternion as Ge, InstancedMesh as ht, InstancedBufferAttribute as dt, Object3D as Be, TextureLoader as ft, ImageBitmapLoader as je, InterleavedBuffer as pt, InterleavedBufferAttribute as mt, LinearFilter as de, LinearMipmapLinearFilter as Ke, RepeatWrapping as fe, NearestFilter as Ve, PointsMaterial as gt, Material as ne, LineBasicMaterial as At, MeshStandardMaterial as ze, DoubleSide as Tt, PropertyBinding as _t, SkinnedMesh as Rt, Mesh as Et, LineSegments as wt, Line as xt, LineLoop as yt, Points as bt, Group as re, PerspectiveCamera as Lt, MathUtils as vt, OrthographicCamera as St, Skeleton as Ct, AnimationClip as Mt, Bone as It, InterpolateLinear as Xe, NearestMipmapNearestFilter as Ot, LinearMipmapNearestFilter as Nt, NearestMipmapLinearFilter as Pt, ClampToEdgeWrapping as Dt, MirroredRepeatWrapping as kt, InterpolateDiscrete as Ft, FrontSide as Ht, Texture as we, VectorKeyframeTrack as xe, NumberKeyframeTrack as ye, QuaternionKeyframeTrack as be, Box3 as Ut, Sphere as Gt, Interpolant as Bt, LoadingManager as jt, AudioLoader as Kt } from "three";
|
|
7
|
+
function Vt() {
|
|
8
|
+
return function(o) {
|
|
9
|
+
Qe()(o), Ie.registerSingleton(o);
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
class _e {
|
|
8
13
|
constructor() {
|
|
9
14
|
/**
|
|
10
15
|
* @description The app worker logic location.
|
|
@@ -102,15 +107,6 @@ class Te {
|
|
|
102
107
|
* @default undefined
|
|
103
108
|
*/
|
|
104
109
|
_(this, "withMiniCamera");
|
|
105
|
-
/**
|
|
106
|
-
* Display the camera helper.
|
|
107
|
-
*
|
|
108
|
-
* @remark __Deactivated if the value is `false` or `undefined`__
|
|
109
|
-
* @remark __This property depends on {@link RegisterPropsBlueprint.enableDebug enableDebug}__
|
|
110
|
-
*
|
|
111
|
-
* @default undefined
|
|
112
|
-
*/
|
|
113
|
-
_(this, "withCameraHelper");
|
|
114
110
|
/**
|
|
115
111
|
* @description Handler called when the app is ready.
|
|
116
112
|
*
|
|
@@ -119,7 +115,7 @@ class Te {
|
|
|
119
115
|
_(this, "onReady");
|
|
120
116
|
}
|
|
121
117
|
}
|
|
122
|
-
class
|
|
118
|
+
class Qs {
|
|
123
119
|
constructor() {
|
|
124
120
|
/** @description Handler triggered when the app is ready. */
|
|
125
121
|
_(this, "onReady");
|
|
@@ -128,7 +124,7 @@ class Ys {
|
|
|
128
124
|
function Le(o, e) {
|
|
129
125
|
if (e === at)
|
|
130
126
|
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), o;
|
|
131
|
-
if (e ===
|
|
127
|
+
if (e === le || e === ke) {
|
|
132
128
|
let t = o.getIndex();
|
|
133
129
|
if (t === null) {
|
|
134
130
|
const r = [], a = o.getAttribute("position");
|
|
@@ -140,7 +136,7 @@ function Le(o, e) {
|
|
|
140
136
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), o;
|
|
141
137
|
}
|
|
142
138
|
const n = t.count - 2, s = [];
|
|
143
|
-
if (e ===
|
|
139
|
+
if (e === le)
|
|
144
140
|
for (let r = 1; r <= n; r++)
|
|
145
141
|
s.push(t.getX(0)), s.push(t.getX(r)), s.push(t.getX(r + 1));
|
|
146
142
|
else
|
|
@@ -153,7 +149,7 @@ function Le(o, e) {
|
|
|
153
149
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e), o;
|
|
154
150
|
}
|
|
155
151
|
const ie = /* @__PURE__ */ new WeakMap();
|
|
156
|
-
class
|
|
152
|
+
class zt extends Fe {
|
|
157
153
|
constructor(e) {
|
|
158
154
|
super(e), this.decoderPath = "", this.decoderConfig = {}, this.decoderBinary = null, this.decoderPending = null, this.workerLimit = 4, this.workerPool = [], this.workerNextTaskID = 1, this.workerSourceURL = "", this.defaultAttributeIDs = {
|
|
159
155
|
position: "POSITION",
|
|
@@ -177,7 +173,7 @@ class Vt extends ke {
|
|
|
177
173
|
return this.workerLimit = e, this;
|
|
178
174
|
}
|
|
179
175
|
load(e, t, n, s) {
|
|
180
|
-
const i = new
|
|
176
|
+
const i = new Y(this.manager);
|
|
181
177
|
i.setPath(this.path), i.setResponseType("arraybuffer"), i.setRequestHeader(this.requestHeader), i.setWithCredentials(this.withCredentials), i.load(e, (r) => {
|
|
182
178
|
this.parse(r, t, s);
|
|
183
179
|
}, n, s);
|
|
@@ -186,7 +182,7 @@ class Vt extends ke {
|
|
|
186
182
|
}) {
|
|
187
183
|
this.decodeDracoFile(e, t, null, null, N, n).catch(n);
|
|
188
184
|
}
|
|
189
|
-
decodeDracoFile(e, t, n, s, i =
|
|
185
|
+
decodeDracoFile(e, t, n, s, i = v, r = () => {
|
|
190
186
|
}) {
|
|
191
187
|
const a = {
|
|
192
188
|
attributeIDs: n || this.defaultAttributeIDs,
|
|
@@ -208,8 +204,8 @@ class Vt extends ke {
|
|
|
208
204
|
);
|
|
209
205
|
}
|
|
210
206
|
let s;
|
|
211
|
-
const i = this.workerNextTaskID++, r = e.byteLength, a = this._getWorker(i, r).then((c) => (s = c, new Promise((
|
|
212
|
-
s._callbacks[i] = { resolve:
|
|
207
|
+
const i = this.workerNextTaskID++, r = e.byteLength, a = this._getWorker(i, r).then((c) => (s = c, new Promise((u, h) => {
|
|
208
|
+
s._callbacks[i] = { resolve: u, reject: h }, s.postMessage({ type: "decode", id: i, taskConfig: t, buffer: e }, [e]);
|
|
213
209
|
}))).then((c) => this._createGeometry(c.geometry));
|
|
214
210
|
return a.catch(() => !0).then(() => {
|
|
215
211
|
s && i && this._releaseTask(s, i);
|
|
@@ -219,7 +215,7 @@ class Vt extends ke {
|
|
|
219
215
|
}), a;
|
|
220
216
|
}
|
|
221
217
|
_createGeometry(e) {
|
|
222
|
-
const t = new
|
|
218
|
+
const t = new He();
|
|
223
219
|
e.index && t.setIndex(new K(e.index.array, 1));
|
|
224
220
|
for (let n = 0; n < e.attributes.length; n++) {
|
|
225
221
|
const s = e.attributes[n], i = s.name, r = s.array, a = s.itemSize, c = new K(r, a);
|
|
@@ -234,7 +230,7 @@ class Vt extends ke {
|
|
|
234
230
|
n.fromBufferAttribute(e, s), he.toWorkingColorSpace(n, N), e.setXYZ(s, n.r, n.g, n.b);
|
|
235
231
|
}
|
|
236
232
|
_loadLibrary(e, t) {
|
|
237
|
-
const n = new
|
|
233
|
+
const n = new Y(this.manager);
|
|
238
234
|
return n.setPath(this.decoderPath), n.setResponseType(t), n.setWithCredentials(this.withCredentials), new Promise((s, i) => {
|
|
239
235
|
n.load(e, s, void 0, i);
|
|
240
236
|
});
|
|
@@ -248,7 +244,7 @@ class Vt extends ke {
|
|
|
248
244
|
return e ? t.push(this._loadLibrary("draco_decoder.js", "text")) : (t.push(this._loadLibrary("draco_wasm_wrapper.js", "text")), t.push(this._loadLibrary("draco_decoder.wasm", "arraybuffer"))), this.decoderPending = Promise.all(t).then((n) => {
|
|
249
245
|
const s = n[0];
|
|
250
246
|
e || (this.decoderConfig.wasmBinary = n[1]);
|
|
251
|
-
const i =
|
|
247
|
+
const i = Xt.toString(), r = [
|
|
252
248
|
"/* draco decoder */",
|
|
253
249
|
s,
|
|
254
250
|
"",
|
|
@@ -296,36 +292,36 @@ class Vt extends ke {
|
|
|
296
292
|
return this.workerPool.length = 0, this.workerSourceURL !== "" && URL.revokeObjectURL(this.workerSourceURL), this;
|
|
297
293
|
}
|
|
298
294
|
}
|
|
299
|
-
function
|
|
295
|
+
function Xt() {
|
|
300
296
|
let o, e;
|
|
301
297
|
onmessage = function(r) {
|
|
302
298
|
const a = r.data;
|
|
303
299
|
switch (a.type) {
|
|
304
300
|
case "init":
|
|
305
301
|
o = a.decoderConfig, e = new Promise(function(h) {
|
|
306
|
-
o.onModuleLoaded = function(
|
|
307
|
-
h({ draco:
|
|
302
|
+
o.onModuleLoaded = function(l) {
|
|
303
|
+
h({ draco: l });
|
|
308
304
|
}, DracoDecoderModule(o);
|
|
309
305
|
});
|
|
310
306
|
break;
|
|
311
307
|
case "decode":
|
|
312
|
-
const c = a.buffer,
|
|
308
|
+
const c = a.buffer, u = a.taskConfig;
|
|
313
309
|
e.then((h) => {
|
|
314
|
-
const
|
|
310
|
+
const l = h.draco, d = new l.Decoder();
|
|
315
311
|
try {
|
|
316
|
-
const f = t(
|
|
312
|
+
const f = t(l, d, new Int8Array(c), u), p = f.attributes.map((A) => A.array.buffer);
|
|
317
313
|
f.index && p.push(f.index.array.buffer), self.postMessage({ type: "decode", id: a.id, geometry: f }, p);
|
|
318
314
|
} catch (f) {
|
|
319
315
|
console.error(f), self.postMessage({ type: "error", id: a.id, error: f.message });
|
|
320
316
|
} finally {
|
|
321
|
-
|
|
317
|
+
l.destroy(d);
|
|
322
318
|
}
|
|
323
319
|
});
|
|
324
320
|
break;
|
|
325
321
|
}
|
|
326
322
|
};
|
|
327
|
-
function t(r, a, c,
|
|
328
|
-
const h =
|
|
323
|
+
function t(r, a, c, u) {
|
|
324
|
+
const h = u.attributeIDs, l = u.attributeTypes;
|
|
329
325
|
let d, f;
|
|
330
326
|
const p = a.GetEncodedGeometryType(c);
|
|
331
327
|
if (p === r.TRIANGULAR_MESH)
|
|
@@ -338,31 +334,31 @@ function zt() {
|
|
|
338
334
|
throw new Error("THREE.DRACOLoader: Decoding failed: " + f.error_msg());
|
|
339
335
|
const A = { index: null, attributes: [] };
|
|
340
336
|
for (const m in h) {
|
|
341
|
-
const g = self[
|
|
337
|
+
const g = self[l[m]];
|
|
342
338
|
let R, w;
|
|
343
|
-
if (
|
|
339
|
+
if (u.useUniqueIDs)
|
|
344
340
|
w = h[m], R = a.GetAttributeByUniqueId(d, w);
|
|
345
341
|
else {
|
|
346
342
|
if (w = a.GetAttributeId(d, r[h[m]]), w === -1) continue;
|
|
347
343
|
R = a.GetAttribute(d, w);
|
|
348
344
|
}
|
|
349
345
|
const E = s(r, a, d, m, g, R);
|
|
350
|
-
m === "color" && (E.vertexColorSpace =
|
|
346
|
+
m === "color" && (E.vertexColorSpace = u.vertexColorSpace), A.attributes.push(E);
|
|
351
347
|
}
|
|
352
348
|
return p === r.TRIANGULAR_MESH && (A.index = n(r, a, d)), r.destroy(d), A;
|
|
353
349
|
}
|
|
354
350
|
function n(r, a, c) {
|
|
355
|
-
const h = c.num_faces() * 3,
|
|
356
|
-
a.GetTrianglesUInt32Array(c,
|
|
351
|
+
const h = c.num_faces() * 3, l = h * 4, d = r._malloc(l);
|
|
352
|
+
a.GetTrianglesUInt32Array(c, l, d);
|
|
357
353
|
const f = new Uint32Array(r.HEAPF32.buffer, d, h).slice();
|
|
358
354
|
return r._free(d), { array: f, itemSize: 1 };
|
|
359
355
|
}
|
|
360
|
-
function s(r, a, c,
|
|
361
|
-
const d =
|
|
362
|
-
a.GetAttributeDataArrayForAllPoints(c,
|
|
356
|
+
function s(r, a, c, u, h, l) {
|
|
357
|
+
const d = l.num_components(), p = c.num_points() * d, A = p * h.BYTES_PER_ELEMENT, m = i(r, h), g = r._malloc(A);
|
|
358
|
+
a.GetAttributeDataArrayForAllPoints(c, l, m, A, g);
|
|
363
359
|
const R = new h(r.HEAPF32.buffer, g, p).slice();
|
|
364
360
|
return r._free(g), {
|
|
365
|
-
name:
|
|
361
|
+
name: u,
|
|
366
362
|
array: R,
|
|
367
363
|
itemSize: d
|
|
368
364
|
};
|
|
@@ -386,42 +382,42 @@ function zt() {
|
|
|
386
382
|
}
|
|
387
383
|
}
|
|
388
384
|
}
|
|
389
|
-
class
|
|
385
|
+
class Wt extends Fe {
|
|
390
386
|
constructor(e) {
|
|
391
387
|
super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(t) {
|
|
392
|
-
return new Qt(t);
|
|
393
|
-
}), this.register(function(t) {
|
|
394
388
|
return new Jt(t);
|
|
395
389
|
}), this.register(function(t) {
|
|
396
|
-
return new
|
|
390
|
+
return new Zt(t);
|
|
397
391
|
}), this.register(function(t) {
|
|
398
392
|
return new cs(t);
|
|
399
393
|
}), this.register(function(t) {
|
|
400
|
-
return new
|
|
394
|
+
return new us(t);
|
|
401
395
|
}), this.register(function(t) {
|
|
402
|
-
return new
|
|
396
|
+
return new ls(t);
|
|
403
397
|
}), this.register(function(t) {
|
|
404
398
|
return new ts(t);
|
|
405
399
|
}), this.register(function(t) {
|
|
406
400
|
return new ss(t);
|
|
407
401
|
}), this.register(function(t) {
|
|
408
402
|
return new ns(t);
|
|
409
|
-
}), this.register(function(t) {
|
|
410
|
-
return new Yt(t);
|
|
411
403
|
}), this.register(function(t) {
|
|
412
404
|
return new rs(t);
|
|
413
405
|
}), this.register(function(t) {
|
|
414
|
-
return new
|
|
415
|
-
}), this.register(function(t) {
|
|
416
|
-
return new os(t);
|
|
406
|
+
return new Qt(t);
|
|
417
407
|
}), this.register(function(t) {
|
|
418
408
|
return new is(t);
|
|
419
409
|
}), this.register(function(t) {
|
|
420
|
-
return new
|
|
410
|
+
return new es(t);
|
|
421
411
|
}), this.register(function(t) {
|
|
422
|
-
return new
|
|
412
|
+
return new as(t);
|
|
413
|
+
}), this.register(function(t) {
|
|
414
|
+
return new os(t);
|
|
415
|
+
}), this.register(function(t) {
|
|
416
|
+
return new qt(t);
|
|
423
417
|
}), this.register(function(t) {
|
|
424
418
|
return new hs(t);
|
|
419
|
+
}), this.register(function(t) {
|
|
420
|
+
return new ds(t);
|
|
425
421
|
});
|
|
426
422
|
}
|
|
427
423
|
load(e, t, n, s) {
|
|
@@ -430,17 +426,17 @@ class Xt extends ke {
|
|
|
430
426
|
if (this.resourcePath !== "")
|
|
431
427
|
r = this.resourcePath;
|
|
432
428
|
else if (this.path !== "") {
|
|
433
|
-
const
|
|
434
|
-
r = V.resolveURL(
|
|
429
|
+
const u = V.extractUrlBase(e);
|
|
430
|
+
r = V.resolveURL(u, this.path);
|
|
435
431
|
} else
|
|
436
432
|
r = V.extractUrlBase(e);
|
|
437
433
|
this.manager.itemStart(e);
|
|
438
|
-
const a = function(
|
|
439
|
-
s ? s(
|
|
440
|
-
}, c = new
|
|
441
|
-
c.setPath(this.path), c.setResponseType("arraybuffer"), c.setRequestHeader(this.requestHeader), c.setWithCredentials(this.withCredentials), c.load(e, function(
|
|
434
|
+
const a = function(u) {
|
|
435
|
+
s ? s(u) : console.error(u), i.manager.itemError(e), i.manager.itemEnd(e);
|
|
436
|
+
}, c = new Y(this.manager);
|
|
437
|
+
c.setPath(this.path), c.setResponseType("arraybuffer"), c.setRequestHeader(this.requestHeader), c.setWithCredentials(this.withCredentials), c.load(e, function(u) {
|
|
442
438
|
try {
|
|
443
|
-
i.parse(
|
|
439
|
+
i.parse(u, r, function(h) {
|
|
444
440
|
t(h), i.manager.itemEnd(e);
|
|
445
441
|
}, a);
|
|
446
442
|
} catch (h) {
|
|
@@ -469,11 +465,11 @@ class Xt extends ke {
|
|
|
469
465
|
if (typeof e == "string")
|
|
470
466
|
i = JSON.parse(e);
|
|
471
467
|
else if (e instanceof ArrayBuffer)
|
|
472
|
-
if (c.decode(new Uint8Array(e, 0, 4)) ===
|
|
468
|
+
if (c.decode(new Uint8Array(e, 0, 4)) === We) {
|
|
473
469
|
try {
|
|
474
|
-
r[T.KHR_BINARY_GLTF] = new
|
|
475
|
-
} catch (
|
|
476
|
-
s && s(
|
|
470
|
+
r[T.KHR_BINARY_GLTF] = new fs(e);
|
|
471
|
+
} catch (l) {
|
|
472
|
+
s && s(l);
|
|
477
473
|
return;
|
|
478
474
|
}
|
|
479
475
|
i = JSON.parse(r[T.KHR_BINARY_GLTF].content);
|
|
@@ -485,7 +481,7 @@ class Xt extends ke {
|
|
|
485
481
|
s && s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
|
|
486
482
|
return;
|
|
487
483
|
}
|
|
488
|
-
const
|
|
484
|
+
const u = new Ls(i, {
|
|
489
485
|
path: t || this.resourcePath || "",
|
|
490
486
|
crossOrigin: this.crossOrigin,
|
|
491
487
|
requestHeader: this.requestHeader,
|
|
@@ -493,32 +489,32 @@ class Xt extends ke {
|
|
|
493
489
|
ktx2Loader: this.ktx2Loader,
|
|
494
490
|
meshoptDecoder: this.meshoptDecoder
|
|
495
491
|
});
|
|
496
|
-
|
|
492
|
+
u.fileLoader.setRequestHeader(this.requestHeader);
|
|
497
493
|
for (let h = 0; h < this.pluginCallbacks.length; h++) {
|
|
498
|
-
const
|
|
499
|
-
|
|
494
|
+
const l = this.pluginCallbacks[h](u);
|
|
495
|
+
l.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), a[l.name] = l, r[l.name] = !0;
|
|
500
496
|
}
|
|
501
497
|
if (i.extensionsUsed)
|
|
502
498
|
for (let h = 0; h < i.extensionsUsed.length; ++h) {
|
|
503
|
-
const
|
|
504
|
-
switch (
|
|
499
|
+
const l = i.extensionsUsed[h], d = i.extensionsRequired || [];
|
|
500
|
+
switch (l) {
|
|
505
501
|
case T.KHR_MATERIALS_UNLIT:
|
|
506
|
-
r[
|
|
502
|
+
r[l] = new Yt();
|
|
507
503
|
break;
|
|
508
504
|
case T.KHR_DRACO_MESH_COMPRESSION:
|
|
509
|
-
r[
|
|
505
|
+
r[l] = new ps(i, this.dracoLoader);
|
|
510
506
|
break;
|
|
511
507
|
case T.KHR_TEXTURE_TRANSFORM:
|
|
512
|
-
r[
|
|
508
|
+
r[l] = new ms();
|
|
513
509
|
break;
|
|
514
510
|
case T.KHR_MESH_QUANTIZATION:
|
|
515
|
-
r[
|
|
511
|
+
r[l] = new gs();
|
|
516
512
|
break;
|
|
517
513
|
default:
|
|
518
|
-
d.indexOf(
|
|
514
|
+
d.indexOf(l) >= 0 && a[l] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + l + '".');
|
|
519
515
|
}
|
|
520
516
|
}
|
|
521
|
-
|
|
517
|
+
u.setExtensions(r), u.setPlugins(a), u.parse(n, s);
|
|
522
518
|
}
|
|
523
519
|
parseAsync(e, t) {
|
|
524
520
|
const n = this;
|
|
@@ -527,7 +523,7 @@ class Xt extends ke {
|
|
|
527
523
|
});
|
|
528
524
|
}
|
|
529
525
|
}
|
|
530
|
-
function
|
|
526
|
+
function $t() {
|
|
531
527
|
let o = {};
|
|
532
528
|
return {
|
|
533
529
|
get: function(e) {
|
|
@@ -568,7 +564,7 @@ const T = {
|
|
|
568
564
|
EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression",
|
|
569
565
|
EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
|
|
570
566
|
};
|
|
571
|
-
class
|
|
567
|
+
class qt {
|
|
572
568
|
constructor(e) {
|
|
573
569
|
this.parser = e, this.name = T.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
|
|
574
570
|
}
|
|
@@ -584,24 +580,24 @@ class $t {
|
|
|
584
580
|
let s = t.cache.get(n);
|
|
585
581
|
if (s) return s;
|
|
586
582
|
const i = t.json, c = ((i.extensions && i.extensions[this.name] || {}).lights || [])[e];
|
|
587
|
-
let
|
|
583
|
+
let u;
|
|
588
584
|
const h = new P(16777215);
|
|
589
|
-
c.color !== void 0 && h.setRGB(c.color[0], c.color[1], c.color[2],
|
|
590
|
-
const
|
|
585
|
+
c.color !== void 0 && h.setRGB(c.color[0], c.color[1], c.color[2], v);
|
|
586
|
+
const l = c.range !== void 0 ? c.range : 0;
|
|
591
587
|
switch (c.type) {
|
|
592
588
|
case "directional":
|
|
593
|
-
|
|
589
|
+
u = new lt(h), u.target.position.set(0, 0, -1), u.add(u.target);
|
|
594
590
|
break;
|
|
595
591
|
case "point":
|
|
596
|
-
|
|
592
|
+
u = new ut(h), u.distance = l;
|
|
597
593
|
break;
|
|
598
594
|
case "spot":
|
|
599
|
-
|
|
595
|
+
u = new ct(h), u.distance = l, c.spot = c.spot || {}, c.spot.innerConeAngle = c.spot.innerConeAngle !== void 0 ? c.spot.innerConeAngle : 0, c.spot.outerConeAngle = c.spot.outerConeAngle !== void 0 ? c.spot.outerConeAngle : Math.PI / 4, u.angle = c.spot.outerConeAngle, u.penumbra = 1 - c.spot.innerConeAngle / c.spot.outerConeAngle, u.target.position.set(0, 0, -1), u.add(u.target);
|
|
600
596
|
break;
|
|
601
597
|
default:
|
|
602
598
|
throw new Error("THREE.GLTFLoader: Unexpected light type: " + c.type);
|
|
603
599
|
}
|
|
604
|
-
return
|
|
600
|
+
return u.position.set(0, 0, 0), u.decay = 2, C(u, c), c.intensity !== void 0 && (u.intensity = c.intensity), u.name = t.createUniqueName(c.name || "light_" + e), s = Promise.resolve(u), t.cache.add(n, s), s;
|
|
605
601
|
}
|
|
606
602
|
getDependency(e, t) {
|
|
607
603
|
if (e === "light")
|
|
@@ -614,7 +610,7 @@ class $t {
|
|
|
614
610
|
});
|
|
615
611
|
}
|
|
616
612
|
}
|
|
617
|
-
class
|
|
613
|
+
class Yt {
|
|
618
614
|
constructor() {
|
|
619
615
|
this.name = T.KHR_MATERIALS_UNLIT;
|
|
620
616
|
}
|
|
@@ -628,14 +624,14 @@ class qt {
|
|
|
628
624
|
if (i) {
|
|
629
625
|
if (Array.isArray(i.baseColorFactor)) {
|
|
630
626
|
const r = i.baseColorFactor;
|
|
631
|
-
e.color.setRGB(r[0], r[1], r[2],
|
|
627
|
+
e.color.setRGB(r[0], r[1], r[2], v), e.opacity = r[3];
|
|
632
628
|
}
|
|
633
629
|
i.baseColorTexture !== void 0 && s.push(n.assignTexture(e, "map", i.baseColorTexture, N));
|
|
634
630
|
}
|
|
635
631
|
return Promise.all(s);
|
|
636
632
|
}
|
|
637
633
|
}
|
|
638
|
-
class
|
|
634
|
+
class Qt {
|
|
639
635
|
constructor(e) {
|
|
640
636
|
this.parser = e, this.name = T.KHR_MATERIALS_EMISSIVE_STRENGTH;
|
|
641
637
|
}
|
|
@@ -647,13 +643,13 @@ class Yt {
|
|
|
647
643
|
return i !== void 0 && (t.emissiveIntensity = i), Promise.resolve();
|
|
648
644
|
}
|
|
649
645
|
}
|
|
650
|
-
class
|
|
646
|
+
class Jt {
|
|
651
647
|
constructor(e) {
|
|
652
648
|
this.parser = e, this.name = T.KHR_MATERIALS_CLEARCOAT;
|
|
653
649
|
}
|
|
654
650
|
getMaterialType(e) {
|
|
655
651
|
const n = this.parser.json.materials[e];
|
|
656
|
-
return !n.extensions || !n.extensions[this.name] ? null :
|
|
652
|
+
return !n.extensions || !n.extensions[this.name] ? null : S;
|
|
657
653
|
}
|
|
658
654
|
extendMaterialParams(e, t) {
|
|
659
655
|
const n = this.parser, s = n.json.materials[e];
|
|
@@ -662,18 +658,18 @@ class Qt {
|
|
|
662
658
|
const i = [], r = s.extensions[this.name];
|
|
663
659
|
if (r.clearcoatFactor !== void 0 && (t.clearcoat = r.clearcoatFactor), r.clearcoatTexture !== void 0 && i.push(n.assignTexture(t, "clearcoatMap", r.clearcoatTexture)), r.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = r.clearcoatRoughnessFactor), r.clearcoatRoughnessTexture !== void 0 && i.push(n.assignTexture(t, "clearcoatRoughnessMap", r.clearcoatRoughnessTexture)), r.clearcoatNormalTexture !== void 0 && (i.push(n.assignTexture(t, "clearcoatNormalMap", r.clearcoatNormalTexture)), r.clearcoatNormalTexture.scale !== void 0)) {
|
|
664
660
|
const a = r.clearcoatNormalTexture.scale;
|
|
665
|
-
t.clearcoatNormalScale = new
|
|
661
|
+
t.clearcoatNormalScale = new Ue(a, a);
|
|
666
662
|
}
|
|
667
663
|
return Promise.all(i);
|
|
668
664
|
}
|
|
669
665
|
}
|
|
670
|
-
class
|
|
666
|
+
class Zt {
|
|
671
667
|
constructor(e) {
|
|
672
668
|
this.parser = e, this.name = T.KHR_MATERIALS_DISPERSION;
|
|
673
669
|
}
|
|
674
670
|
getMaterialType(e) {
|
|
675
671
|
const n = this.parser.json.materials[e];
|
|
676
|
-
return !n.extensions || !n.extensions[this.name] ? null :
|
|
672
|
+
return !n.extensions || !n.extensions[this.name] ? null : S;
|
|
677
673
|
}
|
|
678
674
|
extendMaterialParams(e, t) {
|
|
679
675
|
const s = this.parser.json.materials[e];
|
|
@@ -683,13 +679,13 @@ class Jt {
|
|
|
683
679
|
return t.dispersion = i.dispersion !== void 0 ? i.dispersion : 0, Promise.resolve();
|
|
684
680
|
}
|
|
685
681
|
}
|
|
686
|
-
class
|
|
682
|
+
class es {
|
|
687
683
|
constructor(e) {
|
|
688
684
|
this.parser = e, this.name = T.KHR_MATERIALS_IRIDESCENCE;
|
|
689
685
|
}
|
|
690
686
|
getMaterialType(e) {
|
|
691
687
|
const n = this.parser.json.materials[e];
|
|
692
|
-
return !n.extensions || !n.extensions[this.name] ? null :
|
|
688
|
+
return !n.extensions || !n.extensions[this.name] ? null : S;
|
|
693
689
|
}
|
|
694
690
|
extendMaterialParams(e, t) {
|
|
695
691
|
const n = this.parser, s = n.json.materials[e];
|
|
@@ -699,13 +695,13 @@ class Zt {
|
|
|
699
695
|
return r.iridescenceFactor !== void 0 && (t.iridescence = r.iridescenceFactor), r.iridescenceTexture !== void 0 && i.push(n.assignTexture(t, "iridescenceMap", r.iridescenceTexture)), r.iridescenceIor !== void 0 && (t.iridescenceIOR = r.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), r.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = r.iridescenceThicknessMinimum), r.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = r.iridescenceThicknessMaximum), r.iridescenceThicknessTexture !== void 0 && i.push(n.assignTexture(t, "iridescenceThicknessMap", r.iridescenceThicknessTexture)), Promise.all(i);
|
|
700
696
|
}
|
|
701
697
|
}
|
|
702
|
-
class
|
|
698
|
+
class ts {
|
|
703
699
|
constructor(e) {
|
|
704
700
|
this.parser = e, this.name = T.KHR_MATERIALS_SHEEN;
|
|
705
701
|
}
|
|
706
702
|
getMaterialType(e) {
|
|
707
703
|
const n = this.parser.json.materials[e];
|
|
708
|
-
return !n.extensions || !n.extensions[this.name] ? null :
|
|
704
|
+
return !n.extensions || !n.extensions[this.name] ? null : S;
|
|
709
705
|
}
|
|
710
706
|
extendMaterialParams(e, t) {
|
|
711
707
|
const n = this.parser, s = n.json.materials[e];
|
|
@@ -716,18 +712,18 @@ class es {
|
|
|
716
712
|
const r = s.extensions[this.name];
|
|
717
713
|
if (r.sheenColorFactor !== void 0) {
|
|
718
714
|
const a = r.sheenColorFactor;
|
|
719
|
-
t.sheenColor.setRGB(a[0], a[1], a[2],
|
|
715
|
+
t.sheenColor.setRGB(a[0], a[1], a[2], v);
|
|
720
716
|
}
|
|
721
717
|
return r.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = r.sheenRoughnessFactor), r.sheenColorTexture !== void 0 && i.push(n.assignTexture(t, "sheenColorMap", r.sheenColorTexture, N)), r.sheenRoughnessTexture !== void 0 && i.push(n.assignTexture(t, "sheenRoughnessMap", r.sheenRoughnessTexture)), Promise.all(i);
|
|
722
718
|
}
|
|
723
719
|
}
|
|
724
|
-
class
|
|
720
|
+
class ss {
|
|
725
721
|
constructor(e) {
|
|
726
722
|
this.parser = e, this.name = T.KHR_MATERIALS_TRANSMISSION;
|
|
727
723
|
}
|
|
728
724
|
getMaterialType(e) {
|
|
729
725
|
const n = this.parser.json.materials[e];
|
|
730
|
-
return !n.extensions || !n.extensions[this.name] ? null :
|
|
726
|
+
return !n.extensions || !n.extensions[this.name] ? null : S;
|
|
731
727
|
}
|
|
732
728
|
extendMaterialParams(e, t) {
|
|
733
729
|
const n = this.parser, s = n.json.materials[e];
|
|
@@ -737,13 +733,13 @@ class ts {
|
|
|
737
733
|
return r.transmissionFactor !== void 0 && (t.transmission = r.transmissionFactor), r.transmissionTexture !== void 0 && i.push(n.assignTexture(t, "transmissionMap", r.transmissionTexture)), Promise.all(i);
|
|
738
734
|
}
|
|
739
735
|
}
|
|
740
|
-
class
|
|
736
|
+
class ns {
|
|
741
737
|
constructor(e) {
|
|
742
738
|
this.parser = e, this.name = T.KHR_MATERIALS_VOLUME;
|
|
743
739
|
}
|
|
744
740
|
getMaterialType(e) {
|
|
745
741
|
const n = this.parser.json.materials[e];
|
|
746
|
-
return !n.extensions || !n.extensions[this.name] ? null :
|
|
742
|
+
return !n.extensions || !n.extensions[this.name] ? null : S;
|
|
747
743
|
}
|
|
748
744
|
extendMaterialParams(e, t) {
|
|
749
745
|
const n = this.parser, s = n.json.materials[e];
|
|
@@ -752,16 +748,16 @@ class ss {
|
|
|
752
748
|
const i = [], r = s.extensions[this.name];
|
|
753
749
|
t.thickness = r.thicknessFactor !== void 0 ? r.thicknessFactor : 0, r.thicknessTexture !== void 0 && i.push(n.assignTexture(t, "thicknessMap", r.thicknessTexture)), t.attenuationDistance = r.attenuationDistance || 1 / 0;
|
|
754
750
|
const a = r.attenuationColor || [1, 1, 1];
|
|
755
|
-
return t.attenuationColor = new P().setRGB(a[0], a[1], a[2],
|
|
751
|
+
return t.attenuationColor = new P().setRGB(a[0], a[1], a[2], v), Promise.all(i);
|
|
756
752
|
}
|
|
757
753
|
}
|
|
758
|
-
class
|
|
754
|
+
class rs {
|
|
759
755
|
constructor(e) {
|
|
760
756
|
this.parser = e, this.name = T.KHR_MATERIALS_IOR;
|
|
761
757
|
}
|
|
762
758
|
getMaterialType(e) {
|
|
763
759
|
const n = this.parser.json.materials[e];
|
|
764
|
-
return !n.extensions || !n.extensions[this.name] ? null :
|
|
760
|
+
return !n.extensions || !n.extensions[this.name] ? null : S;
|
|
765
761
|
}
|
|
766
762
|
extendMaterialParams(e, t) {
|
|
767
763
|
const s = this.parser.json.materials[e];
|
|
@@ -771,13 +767,13 @@ class ns {
|
|
|
771
767
|
return t.ior = i.ior !== void 0 ? i.ior : 1.5, Promise.resolve();
|
|
772
768
|
}
|
|
773
769
|
}
|
|
774
|
-
class
|
|
770
|
+
class is {
|
|
775
771
|
constructor(e) {
|
|
776
772
|
this.parser = e, this.name = T.KHR_MATERIALS_SPECULAR;
|
|
777
773
|
}
|
|
778
774
|
getMaterialType(e) {
|
|
779
775
|
const n = this.parser.json.materials[e];
|
|
780
|
-
return !n.extensions || !n.extensions[this.name] ? null :
|
|
776
|
+
return !n.extensions || !n.extensions[this.name] ? null : S;
|
|
781
777
|
}
|
|
782
778
|
extendMaterialParams(e, t) {
|
|
783
779
|
const n = this.parser, s = n.json.materials[e];
|
|
@@ -786,16 +782,16 @@ class rs {
|
|
|
786
782
|
const i = [], r = s.extensions[this.name];
|
|
787
783
|
t.specularIntensity = r.specularFactor !== void 0 ? r.specularFactor : 1, r.specularTexture !== void 0 && i.push(n.assignTexture(t, "specularIntensityMap", r.specularTexture));
|
|
788
784
|
const a = r.specularColorFactor || [1, 1, 1];
|
|
789
|
-
return t.specularColor = new P().setRGB(a[0], a[1], a[2],
|
|
785
|
+
return t.specularColor = new P().setRGB(a[0], a[1], a[2], v), r.specularColorTexture !== void 0 && i.push(n.assignTexture(t, "specularColorMap", r.specularColorTexture, N)), Promise.all(i);
|
|
790
786
|
}
|
|
791
787
|
}
|
|
792
|
-
class
|
|
788
|
+
class os {
|
|
793
789
|
constructor(e) {
|
|
794
790
|
this.parser = e, this.name = T.EXT_MATERIALS_BUMP;
|
|
795
791
|
}
|
|
796
792
|
getMaterialType(e) {
|
|
797
793
|
const n = this.parser.json.materials[e];
|
|
798
|
-
return !n.extensions || !n.extensions[this.name] ? null :
|
|
794
|
+
return !n.extensions || !n.extensions[this.name] ? null : S;
|
|
799
795
|
}
|
|
800
796
|
extendMaterialParams(e, t) {
|
|
801
797
|
const n = this.parser, s = n.json.materials[e];
|
|
@@ -805,13 +801,13 @@ class is {
|
|
|
805
801
|
return t.bumpScale = r.bumpFactor !== void 0 ? r.bumpFactor : 1, r.bumpTexture !== void 0 && i.push(n.assignTexture(t, "bumpMap", r.bumpTexture)), Promise.all(i);
|
|
806
802
|
}
|
|
807
803
|
}
|
|
808
|
-
class
|
|
804
|
+
class as {
|
|
809
805
|
constructor(e) {
|
|
810
806
|
this.parser = e, this.name = T.KHR_MATERIALS_ANISOTROPY;
|
|
811
807
|
}
|
|
812
808
|
getMaterialType(e) {
|
|
813
809
|
const n = this.parser.json.materials[e];
|
|
814
|
-
return !n.extensions || !n.extensions[this.name] ? null :
|
|
810
|
+
return !n.extensions || !n.extensions[this.name] ? null : S;
|
|
815
811
|
}
|
|
816
812
|
extendMaterialParams(e, t) {
|
|
817
813
|
const n = this.parser, s = n.json.materials[e];
|
|
@@ -821,7 +817,7 @@ class os {
|
|
|
821
817
|
return r.anisotropyStrength !== void 0 && (t.anisotropy = r.anisotropyStrength), r.anisotropyRotation !== void 0 && (t.anisotropyRotation = r.anisotropyRotation), r.anisotropyTexture !== void 0 && i.push(n.assignTexture(t, "anisotropyMap", r.anisotropyTexture)), Promise.all(i);
|
|
822
818
|
}
|
|
823
819
|
}
|
|
824
|
-
class
|
|
820
|
+
class cs {
|
|
825
821
|
constructor(e) {
|
|
826
822
|
this.parser = e, this.name = T.KHR_TEXTURE_BASISU;
|
|
827
823
|
}
|
|
@@ -838,7 +834,7 @@ class as {
|
|
|
838
834
|
return t.loadTextureImage(e, i.source, r);
|
|
839
835
|
}
|
|
840
836
|
}
|
|
841
|
-
class
|
|
837
|
+
class us {
|
|
842
838
|
constructor(e) {
|
|
843
839
|
this.parser = e, this.name = T.EXT_TEXTURE_WEBP, this.isSupported = null;
|
|
844
840
|
}
|
|
@@ -849,11 +845,11 @@ class cs {
|
|
|
849
845
|
const r = i.extensions[t], a = s.images[r.source];
|
|
850
846
|
let c = n.textureLoader;
|
|
851
847
|
if (a.uri) {
|
|
852
|
-
const
|
|
853
|
-
|
|
848
|
+
const u = n.options.manager.getHandler(a.uri);
|
|
849
|
+
u !== null && (c = u);
|
|
854
850
|
}
|
|
855
|
-
return this.detectSupport().then(function(
|
|
856
|
-
if (
|
|
851
|
+
return this.detectSupport().then(function(u) {
|
|
852
|
+
if (u) return n.loadTextureImage(e, r.source, c);
|
|
857
853
|
if (s.extensionsRequired && s.extensionsRequired.indexOf(t) >= 0)
|
|
858
854
|
throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");
|
|
859
855
|
return n.loadTexture(e);
|
|
@@ -879,11 +875,11 @@ class ls {
|
|
|
879
875
|
const r = i.extensions[t], a = s.images[r.source];
|
|
880
876
|
let c = n.textureLoader;
|
|
881
877
|
if (a.uri) {
|
|
882
|
-
const
|
|
883
|
-
|
|
878
|
+
const u = n.options.manager.getHandler(a.uri);
|
|
879
|
+
u !== null && (c = u);
|
|
884
880
|
}
|
|
885
|
-
return this.detectSupport().then(function(
|
|
886
|
-
if (
|
|
881
|
+
return this.detectSupport().then(function(u) {
|
|
882
|
+
if (u) return n.loadTextureImage(e, r.source, c);
|
|
887
883
|
if (s.extensionsRequired && s.extensionsRequired.indexOf(t) >= 0)
|
|
888
884
|
throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");
|
|
889
885
|
return n.loadTexture(e);
|
|
@@ -898,7 +894,7 @@ class ls {
|
|
|
898
894
|
})), this.isSupported;
|
|
899
895
|
}
|
|
900
896
|
}
|
|
901
|
-
class
|
|
897
|
+
class hs {
|
|
902
898
|
constructor(e) {
|
|
903
899
|
this.name = T.EXT_MESHOPT_COMPRESSION, this.parser = e;
|
|
904
900
|
}
|
|
@@ -912,19 +908,19 @@ class us {
|
|
|
912
908
|
return null;
|
|
913
909
|
}
|
|
914
910
|
return i.then(function(a) {
|
|
915
|
-
const c = s.byteOffset || 0,
|
|
916
|
-
return r.decodeGltfBufferAsync ? r.decodeGltfBufferAsync(h,
|
|
911
|
+
const c = s.byteOffset || 0, u = s.byteLength || 0, h = s.count, l = s.byteStride, d = new Uint8Array(a, c, u);
|
|
912
|
+
return r.decodeGltfBufferAsync ? r.decodeGltfBufferAsync(h, l, d, s.mode, s.filter).then(function(f) {
|
|
917
913
|
return f.buffer;
|
|
918
914
|
}) : r.ready.then(function() {
|
|
919
|
-
const f = new ArrayBuffer(h *
|
|
920
|
-
return r.decodeGltfBuffer(new Uint8Array(f), h,
|
|
915
|
+
const f = new ArrayBuffer(h * l);
|
|
916
|
+
return r.decodeGltfBuffer(new Uint8Array(f), h, l, d, s.mode, s.filter), f;
|
|
921
917
|
});
|
|
922
918
|
});
|
|
923
919
|
} else
|
|
924
920
|
return null;
|
|
925
921
|
}
|
|
926
922
|
}
|
|
927
|
-
class
|
|
923
|
+
class ds {
|
|
928
924
|
constructor(e) {
|
|
929
925
|
this.name = T.EXT_MESH_GPU_INSTANCING, this.parser = e;
|
|
930
926
|
}
|
|
@@ -933,31 +929,31 @@ class hs {
|
|
|
933
929
|
if (!n.extensions || !n.extensions[this.name] || n.mesh === void 0)
|
|
934
930
|
return null;
|
|
935
931
|
const s = t.meshes[n.mesh];
|
|
936
|
-
for (const
|
|
937
|
-
if (
|
|
932
|
+
for (const u of s.primitives)
|
|
933
|
+
if (u.mode !== x.TRIANGLES && u.mode !== x.TRIANGLE_STRIP && u.mode !== x.TRIANGLE_FAN && u.mode !== void 0)
|
|
938
934
|
return null;
|
|
939
935
|
const r = n.extensions[this.name].attributes, a = [], c = {};
|
|
940
|
-
for (const
|
|
941
|
-
a.push(this.parser.getDependency("accessor", r[
|
|
942
|
-
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((
|
|
943
|
-
const h =
|
|
944
|
-
for (const p of
|
|
945
|
-
const A = new
|
|
936
|
+
for (const u in r)
|
|
937
|
+
a.push(this.parser.getDependency("accessor", r[u]).then((h) => (c[u] = h, c[u])));
|
|
938
|
+
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((u) => {
|
|
939
|
+
const h = u.pop(), l = h.isGroup ? h.children : [h], d = u[0].count, f = [];
|
|
940
|
+
for (const p of l) {
|
|
941
|
+
const A = new Q(), m = new F(), g = new Ge(), R = new F(1, 1, 1), w = new ht(p.geometry, p.material, d);
|
|
946
942
|
for (let E = 0; E < d; E++)
|
|
947
943
|
c.TRANSLATION && m.fromBufferAttribute(c.TRANSLATION, E), c.ROTATION && g.fromBufferAttribute(c.ROTATION, E), c.SCALE && R.fromBufferAttribute(c.SCALE, E), w.setMatrixAt(E, A.compose(m, g, R));
|
|
948
944
|
for (const E in c)
|
|
949
945
|
if (E === "_COLOR_0") {
|
|
950
|
-
const
|
|
951
|
-
w.instanceColor = new dt(
|
|
946
|
+
const L = c[E];
|
|
947
|
+
w.instanceColor = new dt(L.array, L.itemSize, L.normalized);
|
|
952
948
|
} else E !== "TRANSLATION" && E !== "ROTATION" && E !== "SCALE" && p.geometry.setAttribute(E, c[E]);
|
|
953
|
-
|
|
949
|
+
Be.prototype.copy.call(w, p), this.parser.assignFinalMaterial(w), f.push(w);
|
|
954
950
|
}
|
|
955
951
|
return h.isGroup ? (h.clear(), h.add(...f), h) : f[0];
|
|
956
952
|
}));
|
|
957
953
|
}
|
|
958
954
|
}
|
|
959
|
-
const
|
|
960
|
-
class
|
|
955
|
+
const We = "glTF", G = 12, ve = { JSON: 1313821514, BIN: 5130562 };
|
|
956
|
+
class fs {
|
|
961
957
|
constructor(e) {
|
|
962
958
|
this.name = T.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
963
959
|
const t = new DataView(e, 0, G), n = new TextDecoder();
|
|
@@ -965,7 +961,7 @@ class ds {
|
|
|
965
961
|
magic: n.decode(new Uint8Array(e.slice(0, 4))),
|
|
966
962
|
version: t.getUint32(4, !0),
|
|
967
963
|
length: t.getUint32(8, !0)
|
|
968
|
-
}, this.header.magic !==
|
|
964
|
+
}, this.header.magic !== We)
|
|
969
965
|
throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
|
|
970
966
|
if (this.header.version < 2)
|
|
971
967
|
throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
|
|
@@ -975,12 +971,12 @@ class ds {
|
|
|
975
971
|
const a = i.getUint32(r, !0);
|
|
976
972
|
r += 4;
|
|
977
973
|
const c = i.getUint32(r, !0);
|
|
978
|
-
if (r += 4, c ===
|
|
979
|
-
const
|
|
980
|
-
this.content = n.decode(
|
|
981
|
-
} else if (c ===
|
|
982
|
-
const
|
|
983
|
-
this.body = e.slice(
|
|
974
|
+
if (r += 4, c === ve.JSON) {
|
|
975
|
+
const u = new Uint8Array(e, G + r, a);
|
|
976
|
+
this.content = n.decode(u);
|
|
977
|
+
} else if (c === ve.BIN) {
|
|
978
|
+
const u = G + r;
|
|
979
|
+
this.body = e.slice(u, u + a);
|
|
984
980
|
}
|
|
985
981
|
r += a;
|
|
986
982
|
}
|
|
@@ -988,39 +984,39 @@ class ds {
|
|
|
988
984
|
throw new Error("THREE.GLTFLoader: JSON content not found.");
|
|
989
985
|
}
|
|
990
986
|
}
|
|
991
|
-
class
|
|
987
|
+
class ps {
|
|
992
988
|
constructor(e, t) {
|
|
993
989
|
if (!t)
|
|
994
990
|
throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
|
|
995
991
|
this.name = T.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t, this.dracoLoader.preload();
|
|
996
992
|
}
|
|
997
993
|
decodePrimitive(e, t) {
|
|
998
|
-
const n = this.json, s = this.dracoLoader, i = e.extensions[this.name].bufferView, r = e.extensions[this.name].attributes, a = {}, c = {},
|
|
994
|
+
const n = this.json, s = this.dracoLoader, i = e.extensions[this.name].bufferView, r = e.extensions[this.name].attributes, a = {}, c = {}, u = {};
|
|
999
995
|
for (const h in r) {
|
|
1000
|
-
const
|
|
1001
|
-
a[
|
|
996
|
+
const l = pe[h] || h.toLowerCase();
|
|
997
|
+
a[l] = r[h];
|
|
1002
998
|
}
|
|
1003
999
|
for (const h in e.attributes) {
|
|
1004
|
-
const
|
|
1000
|
+
const l = pe[h] || h.toLowerCase();
|
|
1005
1001
|
if (r[h] !== void 0) {
|
|
1006
1002
|
const d = n.accessors[e.attributes[h]], f = H[d.componentType];
|
|
1007
|
-
l
|
|
1003
|
+
u[l] = f.name, c[l] = d.normalized === !0;
|
|
1008
1004
|
}
|
|
1009
1005
|
}
|
|
1010
1006
|
return t.getDependency("bufferView", i).then(function(h) {
|
|
1011
|
-
return new Promise(function(
|
|
1007
|
+
return new Promise(function(l, d) {
|
|
1012
1008
|
s.decodeDracoFile(h, function(f) {
|
|
1013
1009
|
for (const p in f.attributes) {
|
|
1014
1010
|
const A = f.attributes[p], m = c[p];
|
|
1015
1011
|
m !== void 0 && (A.normalized = m);
|
|
1016
1012
|
}
|
|
1017
|
-
|
|
1018
|
-
}, a,
|
|
1013
|
+
l(f);
|
|
1014
|
+
}, a, u, v, d);
|
|
1019
1015
|
});
|
|
1020
1016
|
});
|
|
1021
1017
|
}
|
|
1022
1018
|
}
|
|
1023
|
-
class
|
|
1019
|
+
class ms {
|
|
1024
1020
|
constructor() {
|
|
1025
1021
|
this.name = T.KHR_TEXTURE_TRANSFORM;
|
|
1026
1022
|
}
|
|
@@ -1028,12 +1024,12 @@ class ps {
|
|
|
1028
1024
|
return (t.texCoord === void 0 || t.texCoord === e.channel) && t.offset === void 0 && t.rotation === void 0 && t.scale === void 0 || (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), e.needsUpdate = !0), e;
|
|
1029
1025
|
}
|
|
1030
1026
|
}
|
|
1031
|
-
class
|
|
1027
|
+
class gs {
|
|
1032
1028
|
constructor() {
|
|
1033
1029
|
this.name = T.KHR_MESH_QUANTIZATION;
|
|
1034
1030
|
}
|
|
1035
1031
|
}
|
|
1036
|
-
class
|
|
1032
|
+
class $e extends Bt {
|
|
1037
1033
|
constructor(e, t, n, s) {
|
|
1038
1034
|
super(e, t, n, s);
|
|
1039
1035
|
}
|
|
@@ -1044,19 +1040,19 @@ class We extends Bt {
|
|
|
1044
1040
|
return t;
|
|
1045
1041
|
}
|
|
1046
1042
|
interpolate_(e, t, n, s) {
|
|
1047
|
-
const i = this.resultBuffer, r = this.sampleValues, a = this.valueSize, c = a * 2,
|
|
1043
|
+
const i = this.resultBuffer, r = this.sampleValues, a = this.valueSize, c = a * 2, u = a * 3, h = s - t, l = (n - t) / h, d = l * l, f = d * l, p = e * u, A = p - u, m = -2 * f + 3 * d, g = f - d, R = 1 - m, w = g - d + l;
|
|
1048
1044
|
for (let E = 0; E !== a; E++) {
|
|
1049
|
-
const
|
|
1050
|
-
i[E] = R *
|
|
1045
|
+
const L = r[A + E + a], M = r[A + E + c] * h, y = r[p + E + a], U = r[p + E] * h;
|
|
1046
|
+
i[E] = R * L + w * M + m * y + g * U;
|
|
1051
1047
|
}
|
|
1052
1048
|
return i;
|
|
1053
1049
|
}
|
|
1054
1050
|
}
|
|
1055
|
-
const
|
|
1056
|
-
class
|
|
1051
|
+
const As = new Ge();
|
|
1052
|
+
class Ts extends $e {
|
|
1057
1053
|
interpolate_(e, t, n, s) {
|
|
1058
1054
|
const i = super.interpolate_(e, t, n, s);
|
|
1059
|
-
return
|
|
1055
|
+
return As.fromArray(i).normalize().toArray(i), i;
|
|
1060
1056
|
}
|
|
1061
1057
|
}
|
|
1062
1058
|
const x = {
|
|
@@ -1087,13 +1083,13 @@ const x = {
|
|
|
1087
1083
|
5125: Uint32Array,
|
|
1088
1084
|
5126: Float32Array
|
|
1089
1085
|
}, Se = {
|
|
1090
|
-
9728:
|
|
1086
|
+
9728: Ve,
|
|
1091
1087
|
9729: de,
|
|
1092
1088
|
9984: Ot,
|
|
1093
1089
|
9985: Nt,
|
|
1094
1090
|
9986: Pt,
|
|
1095
|
-
9987:
|
|
1096
|
-
},
|
|
1091
|
+
9987: Ke
|
|
1092
|
+
}, Ce = {
|
|
1097
1093
|
33071: Dt,
|
|
1098
1094
|
33648: kt,
|
|
1099
1095
|
10497: fe
|
|
@@ -1121,19 +1117,19 @@ const x = {
|
|
|
1121
1117
|
translation: "position",
|
|
1122
1118
|
rotation: "quaternion",
|
|
1123
1119
|
weights: "morphTargetInfluences"
|
|
1124
|
-
},
|
|
1120
|
+
}, _s = {
|
|
1125
1121
|
CUBICSPLINE: void 0,
|
|
1126
1122
|
// We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
|
|
1127
1123
|
// keyframe track will be initialized with a default interpolation type, then modified.
|
|
1128
|
-
LINEAR:
|
|
1124
|
+
LINEAR: Xe,
|
|
1129
1125
|
STEP: Ft
|
|
1130
1126
|
}, ae = {
|
|
1131
1127
|
OPAQUE: "OPAQUE",
|
|
1132
1128
|
MASK: "MASK",
|
|
1133
1129
|
BLEND: "BLEND"
|
|
1134
1130
|
};
|
|
1135
|
-
function
|
|
1136
|
-
return o.DefaultMaterial === void 0 && (o.DefaultMaterial = new
|
|
1131
|
+
function Rs(o) {
|
|
1132
|
+
return o.DefaultMaterial === void 0 && (o.DefaultMaterial = new ze({
|
|
1137
1133
|
color: 16777215,
|
|
1138
1134
|
emissive: 0,
|
|
1139
1135
|
metalness: 1,
|
|
@@ -1150,26 +1146,26 @@ function D(o, e, t) {
|
|
|
1150
1146
|
function C(o, e) {
|
|
1151
1147
|
e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(o.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras));
|
|
1152
1148
|
}
|
|
1153
|
-
function
|
|
1149
|
+
function Es(o, e, t) {
|
|
1154
1150
|
let n = !1, s = !1, i = !1;
|
|
1155
|
-
for (let
|
|
1156
|
-
const
|
|
1157
|
-
if (
|
|
1151
|
+
for (let u = 0, h = e.length; u < h; u++) {
|
|
1152
|
+
const l = e[u];
|
|
1153
|
+
if (l.POSITION !== void 0 && (n = !0), l.NORMAL !== void 0 && (s = !0), l.COLOR_0 !== void 0 && (i = !0), n && s && i) break;
|
|
1158
1154
|
}
|
|
1159
1155
|
if (!n && !s && !i) return Promise.resolve(o);
|
|
1160
1156
|
const r = [], a = [], c = [];
|
|
1161
|
-
for (let
|
|
1162
|
-
const
|
|
1157
|
+
for (let u = 0, h = e.length; u < h; u++) {
|
|
1158
|
+
const l = e[u];
|
|
1163
1159
|
if (n) {
|
|
1164
|
-
const d =
|
|
1160
|
+
const d = l.POSITION !== void 0 ? t.getDependency("accessor", l.POSITION) : o.attributes.position;
|
|
1165
1161
|
r.push(d);
|
|
1166
1162
|
}
|
|
1167
1163
|
if (s) {
|
|
1168
|
-
const d =
|
|
1164
|
+
const d = l.NORMAL !== void 0 ? t.getDependency("accessor", l.NORMAL) : o.attributes.normal;
|
|
1169
1165
|
a.push(d);
|
|
1170
1166
|
}
|
|
1171
1167
|
if (i) {
|
|
1172
|
-
const d =
|
|
1168
|
+
const d = l.COLOR_0 !== void 0 ? t.getDependency("accessor", l.COLOR_0) : o.attributes.color;
|
|
1173
1169
|
c.push(d);
|
|
1174
1170
|
}
|
|
1175
1171
|
}
|
|
@@ -1177,12 +1173,12 @@ function Rs(o, e, t) {
|
|
|
1177
1173
|
Promise.all(r),
|
|
1178
1174
|
Promise.all(a),
|
|
1179
1175
|
Promise.all(c)
|
|
1180
|
-
]).then(function(
|
|
1181
|
-
const h =
|
|
1182
|
-
return n && (o.morphAttributes.position = h), s && (o.morphAttributes.normal =
|
|
1176
|
+
]).then(function(u) {
|
|
1177
|
+
const h = u[0], l = u[1], d = u[2];
|
|
1178
|
+
return n && (o.morphAttributes.position = h), s && (o.morphAttributes.normal = l), i && (o.morphAttributes.color = d), o.morphTargetsRelative = !0, o;
|
|
1183
1179
|
});
|
|
1184
1180
|
}
|
|
1185
|
-
function
|
|
1181
|
+
function ws(o, e) {
|
|
1186
1182
|
if (o.updateMorphTargets(), e.weights !== void 0)
|
|
1187
1183
|
for (let t = 0, n = e.weights.length; t < n; t++)
|
|
1188
1184
|
o.morphTargetInfluences[t] = e.weights[t];
|
|
@@ -1196,7 +1192,7 @@ function Es(o, e) {
|
|
|
1196
1192
|
console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
|
|
1197
1193
|
}
|
|
1198
1194
|
}
|
|
1199
|
-
function
|
|
1195
|
+
function xs(o) {
|
|
1200
1196
|
let e;
|
|
1201
1197
|
const t = o.extensions && o.extensions[T.KHR_DRACO_MESH_COMPRESSION];
|
|
1202
1198
|
if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + ce(t.attributes) : e = o.indices + ":" + ce(o.attributes) + ":" + o.mode, o.targets !== void 0)
|
|
@@ -1225,13 +1221,13 @@ function me(o) {
|
|
|
1225
1221
|
throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
|
|
1226
1222
|
}
|
|
1227
1223
|
}
|
|
1228
|
-
function
|
|
1224
|
+
function ys(o) {
|
|
1229
1225
|
return o.search(/\.jpe?g($|\?)/i) > 0 || o.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : o.search(/\.webp($|\?)/i) > 0 || o.search(/^data\:image\/webp/) === 0 ? "image/webp" : o.search(/\.ktx2($|\?)/i) > 0 || o.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
|
|
1230
1226
|
}
|
|
1231
|
-
const
|
|
1227
|
+
const bs = new Q();
|
|
1232
1228
|
class Ls {
|
|
1233
1229
|
constructor(e = {}, t = {}) {
|
|
1234
|
-
this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new
|
|
1230
|
+
this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new $t(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
|
|
1235
1231
|
let n = !1, s = -1, i = !1, r = -1;
|
|
1236
1232
|
if (typeof navigator < "u") {
|
|
1237
1233
|
const a = navigator.userAgent;
|
|
@@ -1239,7 +1235,7 @@ class Ls {
|
|
|
1239
1235
|
const c = a.match(/Version\/(\d+)/);
|
|
1240
1236
|
s = n && c ? parseInt(c[1], 10) : -1, i = a.indexOf("Firefox") > -1, r = i ? a.match(/Firefox\/([0-9]+)\./)[1] : -1;
|
|
1241
1237
|
}
|
|
1242
|
-
typeof createImageBitmap > "u" || n && s < 17 || i && r < 98 ? this.textureLoader = new ft(this.options.manager) : this.textureLoader = new
|
|
1238
|
+
typeof createImageBitmap > "u" || n && s < 17 || i && r < 98 ? this.textureLoader = new ft(this.options.manager) : this.textureLoader = new je(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new Y(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
|
|
1243
1239
|
}
|
|
1244
1240
|
setExtensions(e) {
|
|
1245
1241
|
this.extensions = e;
|
|
@@ -1321,8 +1317,8 @@ class Ls {
|
|
|
1321
1317
|
const s = n.clone(), i = (r, a) => {
|
|
1322
1318
|
const c = this.associations.get(r);
|
|
1323
1319
|
c != null && this.associations.set(a, c);
|
|
1324
|
-
for (const [
|
|
1325
|
-
i(h, a.children[
|
|
1320
|
+
for (const [u, h] of r.children.entries())
|
|
1321
|
+
i(h, a.children[u]);
|
|
1326
1322
|
};
|
|
1327
1323
|
return i(n, s), s.name += "_instance_" + e.uses[t]++, s;
|
|
1328
1324
|
}
|
|
@@ -1465,24 +1461,24 @@ class Ls {
|
|
|
1465
1461
|
loadAccessor(e) {
|
|
1466
1462
|
const t = this, n = this.json, s = this.json.accessors[e];
|
|
1467
1463
|
if (s.bufferView === void 0 && s.sparse === void 0) {
|
|
1468
|
-
const r = oe[s.type], a = H[s.componentType], c = s.normalized === !0,
|
|
1469
|
-
return Promise.resolve(new K(
|
|
1464
|
+
const r = oe[s.type], a = H[s.componentType], c = s.normalized === !0, u = new a(s.count * r);
|
|
1465
|
+
return Promise.resolve(new K(u, r, c));
|
|
1470
1466
|
}
|
|
1471
1467
|
const i = [];
|
|
1472
1468
|
return s.bufferView !== void 0 ? i.push(this.getDependency("bufferView", s.bufferView)) : i.push(null), s.sparse !== void 0 && (i.push(this.getDependency("bufferView", s.sparse.indices.bufferView)), i.push(this.getDependency("bufferView", s.sparse.values.bufferView))), Promise.all(i).then(function(r) {
|
|
1473
|
-
const a = r[0], c = oe[s.type],
|
|
1469
|
+
const a = r[0], c = oe[s.type], u = H[s.componentType], h = u.BYTES_PER_ELEMENT, l = h * c, d = s.byteOffset || 0, f = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0, p = s.normalized === !0;
|
|
1474
1470
|
let A, m;
|
|
1475
|
-
if (f && f !==
|
|
1471
|
+
if (f && f !== l) {
|
|
1476
1472
|
const g = Math.floor(d / f), R = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + g + ":" + s.count;
|
|
1477
1473
|
let w = t.cache.get(R);
|
|
1478
|
-
w || (A = new
|
|
1474
|
+
w || (A = new u(a, g * f, s.count * f / h), w = new pt(A, f / h), t.cache.add(R, w)), m = new mt(w, c, d % f / h, p);
|
|
1479
1475
|
} else
|
|
1480
|
-
a === null ? A = new
|
|
1476
|
+
a === null ? A = new u(s.count * c) : A = new u(a, d, s.count * c), m = new K(A, c, p);
|
|
1481
1477
|
if (s.sparse !== void 0) {
|
|
1482
|
-
const g = oe.SCALAR, R = H[s.sparse.indices.componentType], w = s.sparse.indices.byteOffset || 0, E = s.sparse.values.byteOffset || 0,
|
|
1478
|
+
const g = oe.SCALAR, R = H[s.sparse.indices.componentType], w = s.sparse.indices.byteOffset || 0, E = s.sparse.values.byteOffset || 0, L = new R(r[1], w, s.sparse.count * g), M = new u(r[2], E, s.sparse.count * c);
|
|
1483
1479
|
a !== null && (m = new K(m.array.slice(), m.itemSize, m.normalized)), m.normalized = !1;
|
|
1484
|
-
for (let y = 0, U =
|
|
1485
|
-
const I =
|
|
1480
|
+
for (let y = 0, U = L.length; y < U; y++) {
|
|
1481
|
+
const I = L[y];
|
|
1486
1482
|
if (m.setX(I, M[y * c]), c >= 2 && m.setY(I, M[y * c + 1]), c >= 3 && m.setZ(I, M[y * c + 2]), c >= 4 && m.setW(I, M[y * c + 3]), c >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
1487
1483
|
}
|
|
1488
1484
|
m.normalized = p;
|
|
@@ -1508,41 +1504,41 @@ class Ls {
|
|
|
1508
1504
|
const s = this, i = this.json, r = i.textures[e], a = i.images[t], c = (a.uri || a.bufferView) + ":" + r.sampler;
|
|
1509
1505
|
if (this.textureCache[c])
|
|
1510
1506
|
return this.textureCache[c];
|
|
1511
|
-
const
|
|
1507
|
+
const u = this.loadImageSource(t, n).then(function(h) {
|
|
1512
1508
|
h.flipY = !1, h.name = r.name || a.name || "", h.name === "" && typeof a.uri == "string" && a.uri.startsWith("data:image/") === !1 && (h.name = a.uri);
|
|
1513
1509
|
const d = (i.samplers || {})[r.sampler] || {};
|
|
1514
|
-
return h.magFilter = Se[d.magFilter] || de, h.minFilter = Se[d.minFilter] ||
|
|
1510
|
+
return h.magFilter = Se[d.magFilter] || de, h.minFilter = Se[d.minFilter] || Ke, h.wrapS = Ce[d.wrapS] || fe, h.wrapT = Ce[d.wrapT] || fe, h.generateMipmaps = !h.isCompressedTexture && h.minFilter !== Ve && h.minFilter !== de, s.associations.set(h, { textures: e }), h;
|
|
1515
1511
|
}).catch(function() {
|
|
1516
1512
|
return null;
|
|
1517
1513
|
});
|
|
1518
|
-
return this.textureCache[c] =
|
|
1514
|
+
return this.textureCache[c] = u, u;
|
|
1519
1515
|
}
|
|
1520
1516
|
loadImageSource(e, t) {
|
|
1521
1517
|
const n = this, s = this.json, i = this.options;
|
|
1522
1518
|
if (this.sourceCache[e] !== void 0)
|
|
1523
|
-
return this.sourceCache[e].then((
|
|
1519
|
+
return this.sourceCache[e].then((l) => l.clone());
|
|
1524
1520
|
const r = s.images[e], a = self.URL || self.webkitURL;
|
|
1525
|
-
let c = r.uri || "",
|
|
1521
|
+
let c = r.uri || "", u = !1;
|
|
1526
1522
|
if (r.bufferView !== void 0)
|
|
1527
|
-
c = n.getDependency("bufferView", r.bufferView).then(function(
|
|
1528
|
-
|
|
1529
|
-
const d = new Blob([
|
|
1523
|
+
c = n.getDependency("bufferView", r.bufferView).then(function(l) {
|
|
1524
|
+
u = !0;
|
|
1525
|
+
const d = new Blob([l], { type: r.mimeType });
|
|
1530
1526
|
return c = a.createObjectURL(d), c;
|
|
1531
1527
|
});
|
|
1532
1528
|
else if (r.uri === void 0)
|
|
1533
1529
|
throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
|
|
1534
|
-
const h = Promise.resolve(c).then(function(
|
|
1530
|
+
const h = Promise.resolve(c).then(function(l) {
|
|
1535
1531
|
return new Promise(function(d, f) {
|
|
1536
1532
|
let p = d;
|
|
1537
1533
|
t.isImageBitmapLoader === !0 && (p = function(A) {
|
|
1538
|
-
const m = new
|
|
1534
|
+
const m = new we(A);
|
|
1539
1535
|
m.needsUpdate = !0, d(m);
|
|
1540
|
-
}), t.load(V.resolveURL(
|
|
1536
|
+
}), t.load(V.resolveURL(l, i.path), p, void 0, f);
|
|
1541
1537
|
});
|
|
1542
|
-
}).then(function(
|
|
1543
|
-
return
|
|
1544
|
-
}).catch(function(
|
|
1545
|
-
throw console.error("THREE.GLTFLoader: Couldn't load texture", c),
|
|
1538
|
+
}).then(function(l) {
|
|
1539
|
+
return u === !0 && a.revokeObjectURL(c), C(l, r), l.userData.mimeType = r.mimeType || ys(r.uri), l;
|
|
1540
|
+
}).catch(function(l) {
|
|
1541
|
+
throw console.error("THREE.GLTFLoader: Couldn't load texture", c), l;
|
|
1546
1542
|
});
|
|
1547
1543
|
return this.sourceCache[e] = h, h;
|
|
1548
1544
|
}
|
|
@@ -1599,7 +1595,7 @@ class Ls {
|
|
|
1599
1595
|
e.material = n;
|
|
1600
1596
|
}
|
|
1601
1597
|
getMaterialType() {
|
|
1602
|
-
return
|
|
1598
|
+
return ze;
|
|
1603
1599
|
}
|
|
1604
1600
|
/**
|
|
1605
1601
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
|
|
@@ -1609,35 +1605,35 @@ class Ls {
|
|
|
1609
1605
|
loadMaterial(e) {
|
|
1610
1606
|
const t = this, n = this.json, s = this.extensions, i = n.materials[e];
|
|
1611
1607
|
let r;
|
|
1612
|
-
const a = {}, c = i.extensions || {},
|
|
1608
|
+
const a = {}, c = i.extensions || {}, u = [];
|
|
1613
1609
|
if (c[T.KHR_MATERIALS_UNLIT]) {
|
|
1614
|
-
const
|
|
1615
|
-
r =
|
|
1610
|
+
const l = s[T.KHR_MATERIALS_UNLIT];
|
|
1611
|
+
r = l.getMaterialType(), u.push(l.extendParams(a, i, t));
|
|
1616
1612
|
} else {
|
|
1617
|
-
const
|
|
1618
|
-
if (a.color = new P(1, 1, 1), a.opacity = 1, Array.isArray(
|
|
1619
|
-
const d =
|
|
1620
|
-
a.color.setRGB(d[0], d[1], d[2],
|
|
1613
|
+
const l = i.pbrMetallicRoughness || {};
|
|
1614
|
+
if (a.color = new P(1, 1, 1), a.opacity = 1, Array.isArray(l.baseColorFactor)) {
|
|
1615
|
+
const d = l.baseColorFactor;
|
|
1616
|
+
a.color.setRGB(d[0], d[1], d[2], v), a.opacity = d[3];
|
|
1621
1617
|
}
|
|
1622
|
-
|
|
1618
|
+
l.baseColorTexture !== void 0 && u.push(t.assignTexture(a, "map", l.baseColorTexture, N)), a.metalness = l.metallicFactor !== void 0 ? l.metallicFactor : 1, a.roughness = l.roughnessFactor !== void 0 ? l.roughnessFactor : 1, l.metallicRoughnessTexture !== void 0 && (u.push(t.assignTexture(a, "metalnessMap", l.metallicRoughnessTexture)), u.push(t.assignTexture(a, "roughnessMap", l.metallicRoughnessTexture))), r = this._invokeOne(function(d) {
|
|
1623
1619
|
return d.getMaterialType && d.getMaterialType(e);
|
|
1624
|
-
}),
|
|
1620
|
+
}), u.push(Promise.all(this._invokeAll(function(d) {
|
|
1625
1621
|
return d.extendMaterialParams && d.extendMaterialParams(e, a);
|
|
1626
1622
|
})));
|
|
1627
1623
|
}
|
|
1628
1624
|
i.doubleSided === !0 && (a.side = Tt);
|
|
1629
1625
|
const h = i.alphaMode || ae.OPAQUE;
|
|
1630
|
-
if (h === ae.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, h === ae.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && r !== B && (
|
|
1631
|
-
const
|
|
1632
|
-
a.normalScale.set(
|
|
1626
|
+
if (h === ae.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, h === ae.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && r !== B && (u.push(t.assignTexture(a, "normalMap", i.normalTexture)), a.normalScale = new Ue(1, 1), i.normalTexture.scale !== void 0)) {
|
|
1627
|
+
const l = i.normalTexture.scale;
|
|
1628
|
+
a.normalScale.set(l, l);
|
|
1633
1629
|
}
|
|
1634
|
-
if (i.occlusionTexture !== void 0 && r !== B && (
|
|
1635
|
-
const
|
|
1636
|
-
a.emissive = new P().setRGB(
|
|
1630
|
+
if (i.occlusionTexture !== void 0 && r !== B && (u.push(t.assignTexture(a, "aoMap", i.occlusionTexture)), i.occlusionTexture.strength !== void 0 && (a.aoMapIntensity = i.occlusionTexture.strength)), i.emissiveFactor !== void 0 && r !== B) {
|
|
1631
|
+
const l = i.emissiveFactor;
|
|
1632
|
+
a.emissive = new P().setRGB(l[0], l[1], l[2], v);
|
|
1637
1633
|
}
|
|
1638
|
-
return i.emissiveTexture !== void 0 && r !== B &&
|
|
1639
|
-
const
|
|
1640
|
-
return i.name && (
|
|
1634
|
+
return i.emissiveTexture !== void 0 && r !== B && u.push(t.assignTexture(a, "emissiveMap", i.emissiveTexture, N)), Promise.all(u).then(function() {
|
|
1635
|
+
const l = new r(a);
|
|
1636
|
+
return i.name && (l.name = i.name), C(l, i), t.associations.set(l, { materials: e }), i.extensions && D(s, l, i), l;
|
|
1641
1637
|
});
|
|
1642
1638
|
}
|
|
1643
1639
|
/**
|
|
@@ -1662,17 +1658,17 @@ class Ls {
|
|
|
1662
1658
|
const t = this, n = this.extensions, s = this.primitiveCache;
|
|
1663
1659
|
function i(a) {
|
|
1664
1660
|
return n[T.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a, t).then(function(c) {
|
|
1665
|
-
return
|
|
1661
|
+
return Me(c, a, t);
|
|
1666
1662
|
});
|
|
1667
1663
|
}
|
|
1668
1664
|
const r = [];
|
|
1669
1665
|
for (let a = 0, c = e.length; a < c; a++) {
|
|
1670
|
-
const
|
|
1671
|
-
if (
|
|
1672
|
-
r.push(
|
|
1666
|
+
const u = e[a], h = xs(u), l = s[h];
|
|
1667
|
+
if (l)
|
|
1668
|
+
r.push(l.promise);
|
|
1673
1669
|
else {
|
|
1674
1670
|
let d;
|
|
1675
|
-
|
|
1671
|
+
u.extensions && u.extensions[T.KHR_DRACO_MESH_COMPRESSION] ? d = i(u) : d = Me(new He(), u, t), s[h] = { primitive: u, promise: d }, r.push(d);
|
|
1676
1672
|
}
|
|
1677
1673
|
}
|
|
1678
1674
|
return Promise.all(r);
|
|
@@ -1684,18 +1680,18 @@ class Ls {
|
|
|
1684
1680
|
*/
|
|
1685
1681
|
loadMesh(e) {
|
|
1686
1682
|
const t = this, n = this.json, s = this.extensions, i = n.meshes[e], r = i.primitives, a = [];
|
|
1687
|
-
for (let c = 0,
|
|
1688
|
-
const h = r[c].material === void 0 ?
|
|
1683
|
+
for (let c = 0, u = r.length; c < u; c++) {
|
|
1684
|
+
const h = r[c].material === void 0 ? Rs(this.cache) : this.getDependency("material", r[c].material);
|
|
1689
1685
|
a.push(h);
|
|
1690
1686
|
}
|
|
1691
1687
|
return a.push(t.loadGeometries(r)), Promise.all(a).then(function(c) {
|
|
1692
|
-
const
|
|
1688
|
+
const u = c.slice(0, c.length - 1), h = c[c.length - 1], l = [];
|
|
1693
1689
|
for (let f = 0, p = h.length; f < p; f++) {
|
|
1694
1690
|
const A = h[f], m = r[f];
|
|
1695
1691
|
let g;
|
|
1696
|
-
const R =
|
|
1692
|
+
const R = u[f];
|
|
1697
1693
|
if (m.mode === x.TRIANGLES || m.mode === x.TRIANGLE_STRIP || m.mode === x.TRIANGLE_FAN || m.mode === void 0)
|
|
1698
|
-
g = i.isSkinnedMesh === !0 ? new Rt(A, R) : new Et(A, R), g.isSkinnedMesh === !0 && g.normalizeSkinWeights(), m.mode === x.TRIANGLE_STRIP ? g.geometry = Le(g.geometry,
|
|
1694
|
+
g = i.isSkinnedMesh === !0 ? new Rt(A, R) : new Et(A, R), g.isSkinnedMesh === !0 && g.normalizeSkinWeights(), m.mode === x.TRIANGLE_STRIP ? g.geometry = Le(g.geometry, ke) : m.mode === x.TRIANGLE_FAN && (g.geometry = Le(g.geometry, le));
|
|
1699
1695
|
else if (m.mode === x.LINES)
|
|
1700
1696
|
g = new wt(A, R);
|
|
1701
1697
|
else if (m.mode === x.LINE_STRIP)
|
|
@@ -1703,22 +1699,22 @@ class Ls {
|
|
|
1703
1699
|
else if (m.mode === x.LINE_LOOP)
|
|
1704
1700
|
g = new yt(A, R);
|
|
1705
1701
|
else if (m.mode === x.POINTS)
|
|
1706
|
-
g = new
|
|
1702
|
+
g = new bt(A, R);
|
|
1707
1703
|
else
|
|
1708
1704
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + m.mode);
|
|
1709
|
-
Object.keys(g.geometry.morphAttributes).length > 0 &&
|
|
1705
|
+
Object.keys(g.geometry.morphAttributes).length > 0 && ws(g, i), g.name = t.createUniqueName(i.name || "mesh_" + e), C(g, i), m.extensions && D(s, g, m), t.assignFinalMaterial(g), l.push(g);
|
|
1710
1706
|
}
|
|
1711
|
-
for (let f = 0, p =
|
|
1712
|
-
t.associations.set(
|
|
1707
|
+
for (let f = 0, p = l.length; f < p; f++)
|
|
1708
|
+
t.associations.set(l[f], {
|
|
1713
1709
|
meshes: e,
|
|
1714
1710
|
primitives: f
|
|
1715
1711
|
});
|
|
1716
|
-
if (
|
|
1717
|
-
return i.extensions && D(s,
|
|
1712
|
+
if (l.length === 1)
|
|
1713
|
+
return i.extensions && D(s, l[0], i), l[0];
|
|
1718
1714
|
const d = new re();
|
|
1719
1715
|
i.extensions && D(s, d, i), t.associations.set(d, { meshes: e });
|
|
1720
|
-
for (let f = 0, p =
|
|
1721
|
-
d.add(
|
|
1716
|
+
for (let f = 0, p = l.length; f < p; f++)
|
|
1717
|
+
d.add(l[f]);
|
|
1722
1718
|
return d;
|
|
1723
1719
|
});
|
|
1724
1720
|
}
|
|
@@ -1734,7 +1730,7 @@ class Ls {
|
|
|
1734
1730
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
1735
1731
|
return;
|
|
1736
1732
|
}
|
|
1737
|
-
return n.type === "perspective" ? t = new
|
|
1733
|
+
return n.type === "perspective" ? t = new Lt(vt.radToDeg(s.yfov), s.aspectRatio || 1, s.znear || 1, s.zfar || 2e6) : n.type === "orthographic" && (t = new St(-s.xmag, s.xmag, s.ymag, -s.ymag, s.znear, s.zfar)), n.name && (t.name = this.createUniqueName(n.name)), C(t, n), Promise.resolve(t);
|
|
1738
1734
|
}
|
|
1739
1735
|
/**
|
|
1740
1736
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
@@ -1747,14 +1743,14 @@ class Ls {
|
|
|
1747
1743
|
n.push(this._loadNodeShallow(t.joints[s]));
|
|
1748
1744
|
return t.inverseBindMatrices !== void 0 ? n.push(this.getDependency("accessor", t.inverseBindMatrices)) : n.push(null), Promise.all(n).then(function(s) {
|
|
1749
1745
|
const i = s.pop(), r = s, a = [], c = [];
|
|
1750
|
-
for (let
|
|
1751
|
-
const
|
|
1752
|
-
if (
|
|
1753
|
-
a.push(
|
|
1754
|
-
const d = new
|
|
1755
|
-
i !== null && d.fromArray(i.array,
|
|
1746
|
+
for (let u = 0, h = r.length; u < h; u++) {
|
|
1747
|
+
const l = r[u];
|
|
1748
|
+
if (l) {
|
|
1749
|
+
a.push(l);
|
|
1750
|
+
const d = new Q();
|
|
1751
|
+
i !== null && d.fromArray(i.array, u * 16), c.push(d);
|
|
1756
1752
|
} else
|
|
1757
|
-
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[
|
|
1753
|
+
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[u]);
|
|
1758
1754
|
}
|
|
1759
1755
|
return new Ct(a, c);
|
|
1760
1756
|
});
|
|
@@ -1765,24 +1761,24 @@ class Ls {
|
|
|
1765
1761
|
* @return {Promise<AnimationClip>}
|
|
1766
1762
|
*/
|
|
1767
1763
|
loadAnimation(e) {
|
|
1768
|
-
const t = this.json, n = this, s = t.animations[e], i = s.name ? s.name : "animation_" + e, r = [], a = [], c = [],
|
|
1769
|
-
for (let
|
|
1770
|
-
const f = s.channels[
|
|
1771
|
-
A.node !== void 0 && (r.push(this.getDependency("node", m)), a.push(this.getDependency("accessor", g)), c.push(this.getDependency("accessor", R)),
|
|
1764
|
+
const t = this.json, n = this, s = t.animations[e], i = s.name ? s.name : "animation_" + e, r = [], a = [], c = [], u = [], h = [];
|
|
1765
|
+
for (let l = 0, d = s.channels.length; l < d; l++) {
|
|
1766
|
+
const f = s.channels[l], p = s.samplers[f.sampler], A = f.target, m = A.node, g = s.parameters !== void 0 ? s.parameters[p.input] : p.input, R = s.parameters !== void 0 ? s.parameters[p.output] : p.output;
|
|
1767
|
+
A.node !== void 0 && (r.push(this.getDependency("node", m)), a.push(this.getDependency("accessor", g)), c.push(this.getDependency("accessor", R)), u.push(p), h.push(A));
|
|
1772
1768
|
}
|
|
1773
1769
|
return Promise.all([
|
|
1774
1770
|
Promise.all(r),
|
|
1775
1771
|
Promise.all(a),
|
|
1776
1772
|
Promise.all(c),
|
|
1777
|
-
Promise.all(
|
|
1773
|
+
Promise.all(u),
|
|
1778
1774
|
Promise.all(h)
|
|
1779
|
-
]).then(function(
|
|
1780
|
-
const d =
|
|
1775
|
+
]).then(function(l) {
|
|
1776
|
+
const d = l[0], f = l[1], p = l[2], A = l[3], m = l[4], g = [];
|
|
1781
1777
|
for (let R = 0, w = d.length; R < w; R++) {
|
|
1782
|
-
const E = d[R],
|
|
1778
|
+
const E = d[R], L = f[R], M = p[R], y = A[R], U = m[R];
|
|
1783
1779
|
if (E === void 0) continue;
|
|
1784
1780
|
E.updateMatrix && E.updateMatrix();
|
|
1785
|
-
const I = n._createAnimationTracks(E,
|
|
1781
|
+
const I = n._createAnimationTracks(E, L, M, y, U);
|
|
1786
1782
|
if (I)
|
|
1787
1783
|
for (let te = 0; te < I.length; te++)
|
|
1788
1784
|
g.push(I[te]);
|
|
@@ -1796,7 +1792,7 @@ class Ls {
|
|
|
1796
1792
|
const r = n._getNodeRef(n.meshCache, s.mesh, i);
|
|
1797
1793
|
return s.weights !== void 0 && r.traverse(function(a) {
|
|
1798
1794
|
if (a.isMesh)
|
|
1799
|
-
for (let c = 0,
|
|
1795
|
+
for (let c = 0, u = s.weights.length; c < u; c++)
|
|
1800
1796
|
a.morphTargetInfluences[c] = s.weights[c];
|
|
1801
1797
|
}), r;
|
|
1802
1798
|
});
|
|
@@ -1808,20 +1804,20 @@ class Ls {
|
|
|
1808
1804
|
*/
|
|
1809
1805
|
loadNode(e) {
|
|
1810
1806
|
const t = this.json, n = this, s = t.nodes[e], i = n._loadNodeShallow(e), r = [], a = s.children || [];
|
|
1811
|
-
for (let
|
|
1812
|
-
r.push(n.getDependency("node", a[
|
|
1807
|
+
for (let u = 0, h = a.length; u < h; u++)
|
|
1808
|
+
r.push(n.getDependency("node", a[u]));
|
|
1813
1809
|
const c = s.skin === void 0 ? Promise.resolve(null) : n.getDependency("skin", s.skin);
|
|
1814
1810
|
return Promise.all([
|
|
1815
1811
|
i,
|
|
1816
1812
|
Promise.all(r),
|
|
1817
1813
|
c
|
|
1818
|
-
]).then(function(
|
|
1819
|
-
const h =
|
|
1814
|
+
]).then(function(u) {
|
|
1815
|
+
const h = u[0], l = u[1], d = u[2];
|
|
1820
1816
|
d !== null && h.traverse(function(f) {
|
|
1821
|
-
f.isSkinnedMesh && f.bind(d,
|
|
1817
|
+
f.isSkinnedMesh && f.bind(d, bs);
|
|
1822
1818
|
});
|
|
1823
|
-
for (let f = 0, p =
|
|
1824
|
-
h.add(
|
|
1819
|
+
for (let f = 0, p = l.length; f < p; f++)
|
|
1820
|
+
h.add(l[f]);
|
|
1825
1821
|
return h;
|
|
1826
1822
|
});
|
|
1827
1823
|
}
|
|
@@ -1831,23 +1827,23 @@ class Ls {
|
|
|
1831
1827
|
const t = this.json, n = this.extensions, s = this;
|
|
1832
1828
|
if (this.nodeCache[e] !== void 0)
|
|
1833
1829
|
return this.nodeCache[e];
|
|
1834
|
-
const i = t.nodes[e], r = i.name ? s.createUniqueName(i.name) : "", a = [], c = s._invokeOne(function(
|
|
1835
|
-
return
|
|
1830
|
+
const i = t.nodes[e], r = i.name ? s.createUniqueName(i.name) : "", a = [], c = s._invokeOne(function(u) {
|
|
1831
|
+
return u.createNodeMesh && u.createNodeMesh(e);
|
|
1836
1832
|
});
|
|
1837
|
-
return c && a.push(c), i.camera !== void 0 && a.push(s.getDependency("camera", i.camera).then(function(
|
|
1838
|
-
return s._getNodeRef(s.cameraCache, i.camera,
|
|
1839
|
-
})), s._invokeAll(function(
|
|
1840
|
-
return
|
|
1841
|
-
}).forEach(function(
|
|
1842
|
-
a.push(
|
|
1843
|
-
}), this.nodeCache[e] = Promise.all(a).then(function(
|
|
1833
|
+
return c && a.push(c), i.camera !== void 0 && a.push(s.getDependency("camera", i.camera).then(function(u) {
|
|
1834
|
+
return s._getNodeRef(s.cameraCache, i.camera, u);
|
|
1835
|
+
})), s._invokeAll(function(u) {
|
|
1836
|
+
return u.createNodeAttachment && u.createNodeAttachment(e);
|
|
1837
|
+
}).forEach(function(u) {
|
|
1838
|
+
a.push(u);
|
|
1839
|
+
}), this.nodeCache[e] = Promise.all(a).then(function(u) {
|
|
1844
1840
|
let h;
|
|
1845
|
-
if (i.isBone === !0 ? h = new It() :
|
|
1846
|
-
for (let
|
|
1847
|
-
h.add(l
|
|
1841
|
+
if (i.isBone === !0 ? h = new It() : u.length > 1 ? h = new re() : u.length === 1 ? h = u[0] : h = new Be(), h !== u[0])
|
|
1842
|
+
for (let l = 0, d = u.length; l < d; l++)
|
|
1843
|
+
h.add(u[l]);
|
|
1848
1844
|
if (i.name && (h.userData.name = i.name, h.name = r), C(h, i), i.extensions && D(n, h, i), i.matrix !== void 0) {
|
|
1849
|
-
const
|
|
1850
|
-
|
|
1845
|
+
const l = new Q();
|
|
1846
|
+
l.fromArray(i.matrix), h.applyMatrix4(l);
|
|
1851
1847
|
} else
|
|
1852
1848
|
i.translation !== void 0 && h.position.fromArray(i.translation), i.rotation !== void 0 && h.quaternion.fromArray(i.rotation), i.scale !== void 0 && h.scale.fromArray(i.scale);
|
|
1853
1849
|
return s.associations.has(h) || s.associations.set(h, {}), s.associations.get(h).nodes = e, h;
|
|
@@ -1862,21 +1858,21 @@ class Ls {
|
|
|
1862
1858
|
const t = this.extensions, n = this.json.scenes[e], s = this, i = new re();
|
|
1863
1859
|
n.name && (i.name = s.createUniqueName(n.name)), C(i, n), n.extensions && D(t, i, n);
|
|
1864
1860
|
const r = n.nodes || [], a = [];
|
|
1865
|
-
for (let c = 0,
|
|
1861
|
+
for (let c = 0, u = r.length; c < u; c++)
|
|
1866
1862
|
a.push(s.getDependency("node", r[c]));
|
|
1867
1863
|
return Promise.all(a).then(function(c) {
|
|
1868
|
-
for (let h = 0,
|
|
1864
|
+
for (let h = 0, l = c.length; h < l; h++)
|
|
1869
1865
|
i.add(c[h]);
|
|
1870
|
-
const
|
|
1871
|
-
const
|
|
1866
|
+
const u = (h) => {
|
|
1867
|
+
const l = /* @__PURE__ */ new Map();
|
|
1872
1868
|
for (const [d, f] of s.associations)
|
|
1873
|
-
(d instanceof ne || d instanceof
|
|
1869
|
+
(d instanceof ne || d instanceof we) && l.set(d, f);
|
|
1874
1870
|
return h.traverse((d) => {
|
|
1875
1871
|
const f = s.associations.get(d);
|
|
1876
|
-
f != null &&
|
|
1877
|
-
}),
|
|
1872
|
+
f != null && l.set(d, f);
|
|
1873
|
+
}), l;
|
|
1878
1874
|
};
|
|
1879
|
-
return s.associations =
|
|
1875
|
+
return s.associations = u(i), i;
|
|
1880
1876
|
});
|
|
1881
1877
|
}
|
|
1882
1878
|
_createAnimationTracks(e, t, n, s, i) {
|
|
@@ -1884,37 +1880,37 @@ class Ls {
|
|
|
1884
1880
|
O[i.path] === O.weights ? e.traverse(function(d) {
|
|
1885
1881
|
d.morphTargetInfluences && c.push(d.name ? d.name : d.uuid);
|
|
1886
1882
|
}) : c.push(a);
|
|
1887
|
-
let
|
|
1883
|
+
let u;
|
|
1888
1884
|
switch (O[i.path]) {
|
|
1889
1885
|
case O.weights:
|
|
1890
|
-
|
|
1886
|
+
u = ye;
|
|
1891
1887
|
break;
|
|
1892
1888
|
case O.rotation:
|
|
1893
|
-
|
|
1889
|
+
u = be;
|
|
1894
1890
|
break;
|
|
1895
1891
|
case O.position:
|
|
1896
1892
|
case O.scale:
|
|
1897
|
-
|
|
1893
|
+
u = xe;
|
|
1898
1894
|
break;
|
|
1899
1895
|
default:
|
|
1900
1896
|
switch (n.itemSize) {
|
|
1901
1897
|
case 1:
|
|
1902
|
-
|
|
1898
|
+
u = ye;
|
|
1903
1899
|
break;
|
|
1904
1900
|
case 2:
|
|
1905
1901
|
case 3:
|
|
1906
1902
|
default:
|
|
1907
|
-
|
|
1903
|
+
u = xe;
|
|
1908
1904
|
break;
|
|
1909
1905
|
}
|
|
1910
1906
|
break;
|
|
1911
1907
|
}
|
|
1912
|
-
const h = s.interpolation !== void 0 ?
|
|
1908
|
+
const h = s.interpolation !== void 0 ? _s[s.interpolation] : Xe, l = this._getArrayFromAccessor(n);
|
|
1913
1909
|
for (let d = 0, f = c.length; d < f; d++) {
|
|
1914
|
-
const p = new
|
|
1910
|
+
const p = new u(
|
|
1915
1911
|
c[d] + "." + O[i.path],
|
|
1916
1912
|
t.array,
|
|
1917
|
-
|
|
1913
|
+
l,
|
|
1918
1914
|
h
|
|
1919
1915
|
);
|
|
1920
1916
|
s.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(p), r.push(p);
|
|
@@ -1933,19 +1929,19 @@ class Ls {
|
|
|
1933
1929
|
}
|
|
1934
1930
|
_createCubicSplineTrackInterpolant(e) {
|
|
1935
1931
|
e.createInterpolant = function(n) {
|
|
1936
|
-
const s = this instanceof
|
|
1932
|
+
const s = this instanceof be ? Ts : $e;
|
|
1937
1933
|
return new s(this.times, this.values, this.getValueSize() / 3, n);
|
|
1938
1934
|
}, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
|
|
1939
1935
|
}
|
|
1940
1936
|
}
|
|
1941
|
-
function
|
|
1937
|
+
function vs(o, e, t) {
|
|
1942
1938
|
const n = e.attributes, s = new Ut();
|
|
1943
1939
|
if (n.POSITION !== void 0) {
|
|
1944
|
-
const a = t.json.accessors[n.POSITION], c = a.min,
|
|
1945
|
-
if (c !== void 0 &&
|
|
1940
|
+
const a = t.json.accessors[n.POSITION], c = a.min, u = a.max;
|
|
1941
|
+
if (c !== void 0 && u !== void 0) {
|
|
1946
1942
|
if (s.set(
|
|
1947
1943
|
new F(c[0], c[1], c[2]),
|
|
1948
|
-
new F(
|
|
1944
|
+
new F(u[0], u[1], u[2])
|
|
1949
1945
|
), a.normalized) {
|
|
1950
1946
|
const h = me(H[a.componentType]);
|
|
1951
1947
|
s.min.multiplyScalar(h), s.max.multiplyScalar(h);
|
|
@@ -1959,10 +1955,10 @@ function bs(o, e, t) {
|
|
|
1959
1955
|
const i = e.targets;
|
|
1960
1956
|
if (i !== void 0) {
|
|
1961
1957
|
const a = new F(), c = new F();
|
|
1962
|
-
for (let
|
|
1963
|
-
const
|
|
1964
|
-
if (
|
|
1965
|
-
const d = t.json.accessors[
|
|
1958
|
+
for (let u = 0, h = i.length; u < h; u++) {
|
|
1959
|
+
const l = i[u];
|
|
1960
|
+
if (l.POSITION !== void 0) {
|
|
1961
|
+
const d = t.json.accessors[l.POSITION], f = d.min, p = d.max;
|
|
1966
1962
|
if (f !== void 0 && p !== void 0) {
|
|
1967
1963
|
if (c.setX(Math.max(Math.abs(f[0]), Math.abs(p[0]))), c.setY(Math.max(Math.abs(f[1]), Math.abs(p[1]))), c.setZ(Math.max(Math.abs(f[2]), Math.abs(p[2]))), d.normalized) {
|
|
1968
1964
|
const A = me(H[d.componentType]);
|
|
@@ -1979,7 +1975,7 @@ function bs(o, e, t) {
|
|
|
1979
1975
|
const r = new Gt();
|
|
1980
1976
|
s.getCenter(r.center), r.radius = s.min.distanceTo(s.max) / 2, o.boundingSphere = r;
|
|
1981
1977
|
}
|
|
1982
|
-
function
|
|
1978
|
+
function Me(o, e, t) {
|
|
1983
1979
|
const n = e.attributes, s = [];
|
|
1984
1980
|
function i(r, a) {
|
|
1985
1981
|
return t.getDependency("accessor", r).then(function(c) {
|
|
@@ -1996,18 +1992,18 @@ function Ce(o, e, t) {
|
|
|
1996
1992
|
});
|
|
1997
1993
|
s.push(r);
|
|
1998
1994
|
}
|
|
1999
|
-
return he.workingColorSpace !==
|
|
2000
|
-
return e.targets !== void 0 ?
|
|
1995
|
+
return he.workingColorSpace !== v && "COLOR_0" in n && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${he.workingColorSpace}" not supported.`), C(o, e), vs(o, e, t), Promise.all(s).then(function() {
|
|
1996
|
+
return e.targets !== void 0 ? Es(o, e.targets, t) : o;
|
|
2001
1997
|
});
|
|
2002
1998
|
}
|
|
2003
|
-
var Ss = Object.defineProperty,
|
|
2004
|
-
for (var s = n > 1 ? void 0 : n ?
|
|
1999
|
+
var Ss = Object.defineProperty, Cs = Object.getOwnPropertyDescriptor, Ms = (o, e, t, n) => {
|
|
2000
|
+
for (var s = n > 1 ? void 0 : n ? Cs(e, t) : e, i = o.length - 1, r; i >= 0; i--)
|
|
2005
2001
|
(r = o[i]) && (s = (n ? r(e, t, s) : r(s)) || s);
|
|
2006
2002
|
return n && s && Ss(e, t, s), s;
|
|
2007
2003
|
};
|
|
2008
|
-
let
|
|
2004
|
+
let J = class {
|
|
2009
2005
|
constructor() {
|
|
2010
|
-
_(this, "workerPool",
|
|
2006
|
+
_(this, "workerPool", Je(void 0, !0));
|
|
2011
2007
|
_(this, "canvas");
|
|
2012
2008
|
_(this, "offscreenCanvas");
|
|
2013
2009
|
_(this, "worker");
|
|
@@ -2016,64 +2012,40 @@ let Q = class {
|
|
|
2016
2012
|
init(o) {
|
|
2017
2013
|
this.worker = o.worker, this.thread = o.thread;
|
|
2018
2014
|
}
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
], Q);
|
|
2023
|
-
var Ms = Object.defineProperty, Is = Object.getOwnPropertyDescriptor, Os = (o, e, t, n) => {
|
|
2024
|
-
for (var s = n > 1 ? void 0 : n ? Is(e, t) : e, i = o.length - 1, r; i >= 0; i--)
|
|
2025
|
-
(r = o[i]) && (s = (n ? r(e, t, s) : r(s)) || s);
|
|
2026
|
-
return n && s && Ms(e, t, s), s;
|
|
2027
|
-
}, Ns = (o, e) => (t, n) => e(t, n, o);
|
|
2028
|
-
let ge = class extends Qe {
|
|
2029
|
-
constructor(e) {
|
|
2030
|
-
super();
|
|
2031
|
-
_(this, "canvas");
|
|
2032
|
-
this._service = e;
|
|
2033
|
-
}
|
|
2034
|
-
init(e) {
|
|
2035
|
-
this.canvas = e;
|
|
2036
|
-
for (const t of Me) {
|
|
2037
|
-
const n = t.startsWith("mouse") || t.startsWith("pointer") || t.startsWith("touch") ? this.mouseEventHandler : t.startsWith("key") ? this.keyEventHandler : t === "resize" ? this.uiEventHandler : t === "wheel" ? this.wheelEventHandler : this.preventDefaultHandler;
|
|
2038
|
-
this[`${t}$`] = Je(
|
|
2039
|
-
t === "resize" ? window : e,
|
|
2040
|
-
t
|
|
2041
|
-
).pipe(
|
|
2042
|
-
// @ts-ignore
|
|
2043
|
-
$(n.bind(this)),
|
|
2044
|
-
Ie((s) => !(t === "keydown" && !s))
|
|
2045
|
-
), this[`${t}$`].subscribe((s) => {
|
|
2046
|
-
var i, r;
|
|
2047
|
-
(r = (i = this._service.thread) == null ? void 0 : i[t]) == null || r.call(i, s);
|
|
2048
|
-
});
|
|
2049
|
-
}
|
|
2050
|
-
}
|
|
2051
|
-
preventDefaultHandler(e) {
|
|
2052
|
-
return e.preventDefault(), {
|
|
2053
|
-
type: e.type
|
|
2015
|
+
preventDefaultHandler(o) {
|
|
2016
|
+
return o.preventDefault(), {
|
|
2017
|
+
type: o.type
|
|
2054
2018
|
};
|
|
2055
2019
|
}
|
|
2056
2020
|
getScreenSizes() {
|
|
2021
|
+
var o, e;
|
|
2057
2022
|
return {
|
|
2058
|
-
width: this.canvas.width,
|
|
2059
|
-
height: this.canvas.height,
|
|
2023
|
+
width: (o = this.canvas) == null ? void 0 : o.width,
|
|
2024
|
+
height: (e = this.canvas) == null ? void 0 : e.height,
|
|
2060
2025
|
windowWidth: (window == null ? void 0 : window.innerWidth) ?? 0,
|
|
2061
2026
|
windowHeight: (window == null ? void 0 : window.innerHeight) ?? 0
|
|
2062
2027
|
};
|
|
2063
2028
|
}
|
|
2064
|
-
uiEventHandler(
|
|
2065
|
-
|
|
2066
|
-
|
|
2029
|
+
uiEventHandler(o) {
|
|
2030
|
+
var t;
|
|
2031
|
+
const e = (t = this.canvas) == null ? void 0 : t.getBoundingClientRect();
|
|
2032
|
+
return console.log(
|
|
2033
|
+
"uiEventHandler",
|
|
2034
|
+
this.getScreenSizes(),
|
|
2035
|
+
o.type,
|
|
2036
|
+
e == null ? void 0 : e.top,
|
|
2037
|
+
e == null ? void 0 : e.left
|
|
2038
|
+
), {
|
|
2067
2039
|
...this.getScreenSizes(),
|
|
2068
|
-
type:
|
|
2069
|
-
top:
|
|
2070
|
-
left:
|
|
2040
|
+
type: o.type,
|
|
2041
|
+
top: e == null ? void 0 : e.top,
|
|
2042
|
+
left: e == null ? void 0 : e.left
|
|
2071
2043
|
};
|
|
2072
2044
|
}
|
|
2073
|
-
mouseEventHandler(
|
|
2045
|
+
mouseEventHandler(o) {
|
|
2074
2046
|
return {
|
|
2075
2047
|
...this.getScreenSizes(),
|
|
2076
|
-
...j(
|
|
2048
|
+
...j(o, [
|
|
2077
2049
|
"ctrlKey",
|
|
2078
2050
|
"metaKey",
|
|
2079
2051
|
"shiftKey",
|
|
@@ -2086,41 +2058,70 @@ let ge = class extends Qe {
|
|
|
2086
2058
|
])
|
|
2087
2059
|
};
|
|
2088
2060
|
}
|
|
2089
|
-
touchEventHandler(
|
|
2090
|
-
const
|
|
2091
|
-
for (let
|
|
2092
|
-
const
|
|
2093
|
-
|
|
2094
|
-
pageX: (
|
|
2095
|
-
pageY: (
|
|
2061
|
+
touchEventHandler(o) {
|
|
2062
|
+
const e = [], t = { type: o.type, touches: e };
|
|
2063
|
+
for (let n = 0; n < o.touches.length; ++n) {
|
|
2064
|
+
const s = o.touches[n];
|
|
2065
|
+
e.push({
|
|
2066
|
+
pageX: (s == null ? void 0 : s.pageX) ?? 0,
|
|
2067
|
+
pageY: (s == null ? void 0 : s.pageY) ?? 0
|
|
2096
2068
|
});
|
|
2097
2069
|
}
|
|
2098
|
-
return { ...this.getScreenSizes(), ...
|
|
2070
|
+
return { ...this.getScreenSizes(), ...t };
|
|
2099
2071
|
}
|
|
2100
|
-
wheelEventHandler(
|
|
2101
|
-
return
|
|
2072
|
+
wheelEventHandler(o) {
|
|
2073
|
+
return o.preventDefault(), {
|
|
2102
2074
|
...this.getScreenSizes(),
|
|
2103
|
-
...j(
|
|
2075
|
+
...j(o, ["deltaX", "deltaY"])
|
|
2104
2076
|
};
|
|
2105
2077
|
}
|
|
2106
|
-
keyEventHandler(
|
|
2107
|
-
if (Ze.includes(
|
|
2108
|
-
return
|
|
2078
|
+
keyEventHandler(o) {
|
|
2079
|
+
if (Ze.includes(o.code))
|
|
2080
|
+
return o.preventDefault(), {
|
|
2109
2081
|
...this.getScreenSizes(),
|
|
2110
|
-
...j(
|
|
2082
|
+
...j(o, ["ctrlKey", "metaKey", "shiftKey", "keyCode"])
|
|
2111
2083
|
};
|
|
2112
2084
|
}
|
|
2113
2085
|
};
|
|
2114
|
-
|
|
2115
|
-
z()
|
|
2116
|
-
|
|
2086
|
+
J = Ms([
|
|
2087
|
+
z(X.ContainerScoped)
|
|
2088
|
+
], J);
|
|
2089
|
+
var Is = Object.defineProperty, Os = Object.getOwnPropertyDescriptor, Ns = (o, e, t, n) => {
|
|
2090
|
+
for (var s = n > 1 ? void 0 : n ? Os(e, t) : e, i = o.length - 1, r; i >= 0; i--)
|
|
2091
|
+
(r = o[i]) && (s = (n ? r(e, t, s) : r(s)) || s);
|
|
2092
|
+
return n && s && Is(e, t, s), s;
|
|
2093
|
+
}, Ps = (o, e) => (t, n) => e(t, n, o);
|
|
2094
|
+
let ge = class extends et {
|
|
2095
|
+
constructor(o) {
|
|
2096
|
+
super(), this._service = o;
|
|
2097
|
+
}
|
|
2098
|
+
init() {
|
|
2099
|
+
for (const o of Oe) {
|
|
2100
|
+
const e = o.startsWith("mouse") || o.startsWith("pointer") || o.startsWith("touch") ? this._service.mouseEventHandler.bind(this._service) : o.startsWith("key") ? this._service.keyEventHandler.bind(this._service) : o === "resize" ? this._service.uiEventHandler.bind(this._service) : o === "wheel" ? this._service.wheelEventHandler.bind(this._service) : this._service.preventDefaultHandler.bind(this._service);
|
|
2101
|
+
this[`${o}$`] = tt(
|
|
2102
|
+
o === "resize" ? window : this._service.canvas,
|
|
2103
|
+
o
|
|
2104
|
+
).pipe(
|
|
2105
|
+
// @ts-ignore
|
|
2106
|
+
q(e.bind(this)),
|
|
2107
|
+
Ne((t) => !(o === "keydown" && !t))
|
|
2108
|
+
), this[`${o}$`].subscribe((t) => {
|
|
2109
|
+
var n, s;
|
|
2110
|
+
(s = (n = this._service.thread) == null ? void 0 : n[o]) == null || s.call(n, t);
|
|
2111
|
+
});
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
2114
|
+
};
|
|
2115
|
+
ge = Ns([
|
|
2116
|
+
Vt(),
|
|
2117
|
+
Ps(0, b(J))
|
|
2117
2118
|
], ge);
|
|
2118
|
-
var
|
|
2119
|
-
for (var s = n > 1 ? void 0 : n ?
|
|
2119
|
+
var Ds = Object.defineProperty, ks = Object.getOwnPropertyDescriptor, Fs = (o, e, t, n) => {
|
|
2120
|
+
for (var s = n > 1 ? void 0 : n ? ks(e, t) : e, i = o.length - 1, r; i >= 0; i--)
|
|
2120
2121
|
(r = o[i]) && (s = (n ? r(e, t, s) : r(s)) || s);
|
|
2121
|
-
return n && s &&
|
|
2122
|
+
return n && s && Ds(e, t, s), s;
|
|
2122
2123
|
};
|
|
2123
|
-
let
|
|
2124
|
+
let Z = class {
|
|
2124
2125
|
constructor() {
|
|
2125
2126
|
_(this, "loadingManager", new jt());
|
|
2126
2127
|
_(this, "loaders", {});
|
|
@@ -2143,7 +2144,7 @@ let J = class {
|
|
|
2143
2144
|
};
|
|
2144
2145
|
}
|
|
2145
2146
|
_initLoaders() {
|
|
2146
|
-
this.loaders.dracoLoader = new
|
|
2147
|
+
this.loaders.dracoLoader = new zt(this.loadingManager), this.loaders.audioLoader = new Kt(this.loadingManager), this.loaders.fontLoader = new st(this.loadingManager), this.loaders.gltfLoader = new Wt(this.loadingManager), this.loaders.imageLoader = new je(this.loadingManager), this.loaders.videoLoader = this.videoLoader;
|
|
2147
2148
|
}
|
|
2148
2149
|
_initSources(o) {
|
|
2149
2150
|
this.sources = o, this.toLoadCount = this.sources.length, this.loadedCount = 0;
|
|
@@ -2165,7 +2166,7 @@ let J = class {
|
|
|
2165
2166
|
}) {
|
|
2166
2167
|
e && (this.loadedResources[o.name] = e, this.loadedCount = n, this.toLoadCount = t);
|
|
2167
2168
|
}
|
|
2168
|
-
|
|
2169
|
+
launchLoad(o) {
|
|
2169
2170
|
var t, n, s, i, r;
|
|
2170
2171
|
const e = this.sources[0];
|
|
2171
2172
|
if (e) {
|
|
@@ -2193,19 +2194,19 @@ let J = class {
|
|
|
2193
2194
|
}
|
|
2194
2195
|
}
|
|
2195
2196
|
};
|
|
2196
|
-
|
|
2197
|
-
z()
|
|
2198
|
-
],
|
|
2199
|
-
var
|
|
2200
|
-
for (var s = n > 1 ? void 0 : n ?
|
|
2197
|
+
Z = Fs([
|
|
2198
|
+
z(X.ContainerScoped)
|
|
2199
|
+
], Z);
|
|
2200
|
+
var Hs = Object.defineProperty, Us = Object.getOwnPropertyDescriptor, Gs = (o, e, t, n) => {
|
|
2201
|
+
for (var s = n > 1 ? void 0 : n ? Us(e, t) : e, i = o.length - 1, r; i >= 0; i--)
|
|
2201
2202
|
(r = o[i]) && (s = (n ? r(e, t, s) : r(s)) || s);
|
|
2202
|
-
return n && s &&
|
|
2203
|
-
},
|
|
2204
|
-
let
|
|
2203
|
+
return n && s && Hs(e, t, s), s;
|
|
2204
|
+
}, Bs = (o, e) => (t, n) => e(t, n, o);
|
|
2205
|
+
let ee = class {
|
|
2205
2206
|
constructor(o) {
|
|
2206
|
-
_(this, "load$$", new
|
|
2207
|
+
_(this, "load$$", new nt());
|
|
2207
2208
|
_(this, "load$", this.load$$.pipe(
|
|
2208
|
-
|
|
2209
|
+
q((o) => ({
|
|
2209
2210
|
...o,
|
|
2210
2211
|
loadedCount: o.resource ? this._service.loadedCount + 1 : this._service.loadedCount,
|
|
2211
2212
|
toLoadCount: this._service.toLoadCount
|
|
@@ -2213,12 +2214,12 @@ let Z = class {
|
|
|
2213
2214
|
se()
|
|
2214
2215
|
));
|
|
2215
2216
|
_(this, "serializedLoad$", this.load$.pipe(
|
|
2216
|
-
|
|
2217
|
+
q((o) => {
|
|
2217
2218
|
var t, n, s;
|
|
2218
2219
|
let e = o.resource;
|
|
2219
2220
|
if ((t = o == null ? void 0 : o.resource) != null && t.parser) {
|
|
2220
2221
|
const i = o.resource, r = i.scenes.map(
|
|
2221
|
-
(a) =>
|
|
2222
|
+
(a) => Re(a)
|
|
2222
2223
|
);
|
|
2223
2224
|
e = {
|
|
2224
2225
|
animations: (o == null ? void 0 : o.resource).animations.map(
|
|
@@ -2226,7 +2227,7 @@ let Z = class {
|
|
|
2226
2227
|
(a) => a.toJSON()
|
|
2227
2228
|
),
|
|
2228
2229
|
cameras: i.cameras.map(
|
|
2229
|
-
(a) =>
|
|
2230
|
+
(a) => Re(a)
|
|
2230
2231
|
),
|
|
2231
2232
|
parser: { json: i.parser.json },
|
|
2232
2233
|
scene: r == null ? void 0 : r[0],
|
|
@@ -2274,7 +2275,7 @@ let Z = class {
|
|
|
2274
2275
|
"width"
|
|
2275
2276
|
]),
|
|
2276
2277
|
buffered: o.resource.buffered.length,
|
|
2277
|
-
error: o.resource.error ?
|
|
2278
|
+
error: o.resource.error ? Pe(o.resource.error, []) : {},
|
|
2278
2279
|
played: o.resource.played.length,
|
|
2279
2280
|
seekable: o.resource.seekable.length,
|
|
2280
2281
|
textTracks: o.resource.textTracks.length
|
|
@@ -2286,8 +2287,8 @@ let Z = class {
|
|
|
2286
2287
|
se()
|
|
2287
2288
|
));
|
|
2288
2289
|
_(this, "loadCompleted$", this.load$.pipe(
|
|
2289
|
-
|
|
2290
|
-
|
|
2290
|
+
Ne((o) => o.toLoadCount === o.loadedCount),
|
|
2291
|
+
q(
|
|
2291
2292
|
() => j(this._service, [
|
|
2292
2293
|
"loadedCount",
|
|
2293
2294
|
"loadedResources",
|
|
@@ -2299,16 +2300,16 @@ let Z = class {
|
|
|
2299
2300
|
this._service = o;
|
|
2300
2301
|
}
|
|
2301
2302
|
};
|
|
2302
|
-
|
|
2303
|
-
z(),
|
|
2304
|
-
|
|
2305
|
-
],
|
|
2306
|
-
var
|
|
2307
|
-
for (var s = n > 1 ? void 0 : n ?
|
|
2303
|
+
ee = Gs([
|
|
2304
|
+
z(X.ContainerScoped),
|
|
2305
|
+
Bs(0, b(Z))
|
|
2306
|
+
], ee);
|
|
2307
|
+
var js = Object.defineProperty, Ks = Object.getOwnPropertyDescriptor, Vs = (o, e, t, n) => {
|
|
2308
|
+
for (var s = n > 1 ? void 0 : n ? Ks(e, t) : e, i = o.length - 1, r; i >= 0; i--)
|
|
2308
2309
|
(r = o[i]) && (s = (n ? r(e, t, s) : r(s)) || s);
|
|
2309
|
-
return n && s &&
|
|
2310
|
-
},
|
|
2311
|
-
let
|
|
2310
|
+
return n && s && js(e, t, s), s;
|
|
2311
|
+
}, ue = (o, e) => (t, n) => e(t, n, o);
|
|
2312
|
+
let Ae = class {
|
|
2312
2313
|
constructor(o, e, t) {
|
|
2313
2314
|
_(this, "_subscriptions", []);
|
|
2314
2315
|
this._controller = o, this._service = e, this._props = t, this._subscriptions.push(
|
|
@@ -2317,17 +2318,16 @@ let ee = class {
|
|
|
2317
2318
|
)
|
|
2318
2319
|
);
|
|
2319
2320
|
}
|
|
2320
|
-
_listenToLoad(o, e) {
|
|
2321
|
-
this._controller.load$$.next({
|
|
2322
|
-
source: o,
|
|
2323
|
-
resource: e
|
|
2324
|
-
});
|
|
2325
|
-
}
|
|
2326
2321
|
init(o = []) {
|
|
2327
2322
|
this._service.init(o), this._service.setDracoDecoder(), [void 0, !0].includes(this._props.loadResourcesOnInit) && this.load();
|
|
2328
2323
|
}
|
|
2329
2324
|
load() {
|
|
2330
|
-
this._service.
|
|
2325
|
+
this._service.launchLoad(
|
|
2326
|
+
(o, e) => this._controller.load$$.next({
|
|
2327
|
+
source: o,
|
|
2328
|
+
resource: e
|
|
2329
|
+
})
|
|
2330
|
+
);
|
|
2331
2331
|
}
|
|
2332
2332
|
getLoadedResources() {
|
|
2333
2333
|
return this._service.loadedResources;
|
|
@@ -2354,26 +2354,26 @@ let ee = class {
|
|
|
2354
2354
|
this._service.setDracoDecoder(o);
|
|
2355
2355
|
}
|
|
2356
2356
|
dispose() {
|
|
2357
|
-
this._controller.load$$.complete();
|
|
2357
|
+
this._subscriptions.forEach((o) => o.unsubscribe()), this._controller.load$$.complete();
|
|
2358
2358
|
}
|
|
2359
2359
|
};
|
|
2360
|
-
|
|
2361
|
-
z(),
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
],
|
|
2366
|
-
|
|
2367
|
-
var
|
|
2368
|
-
for (var s = n > 1 ? void 0 : n ? zs(e, t) : e, i = o.length - 1, r; i >= 0; i--)
|
|
2360
|
+
Ae = Vs([
|
|
2361
|
+
z(X.ContainerScoped),
|
|
2362
|
+
ue(0, b(ee)),
|
|
2363
|
+
ue(1, b(Z)),
|
|
2364
|
+
ue(2, b(_e))
|
|
2365
|
+
], Ae);
|
|
2366
|
+
var zs = Object.defineProperty, Xs = Object.getOwnPropertyDescriptor, Ws = (o, e, t, n) => {
|
|
2367
|
+
for (var s = n > 1 ? void 0 : n ? Xs(e, t) : e, i = o.length - 1, r; i >= 0; i--)
|
|
2369
2368
|
(r = o[i]) && (s = (n ? r(e, t, s) : r(s)) || s);
|
|
2370
|
-
return n && s &&
|
|
2369
|
+
return n && s && zs(e, t, s), s;
|
|
2371
2370
|
}, k = (o, e) => (t, n) => e(t, n, o);
|
|
2372
|
-
let
|
|
2371
|
+
let Te = class extends rt {
|
|
2373
2372
|
constructor(e, t, n, s, i, r) {
|
|
2374
2373
|
super();
|
|
2375
|
-
_(this, "
|
|
2376
|
-
this
|
|
2374
|
+
_(this, "_subscriptions", []);
|
|
2375
|
+
_(this, "_initialized", !1);
|
|
2376
|
+
this._service = e, this._controller = t, this._loaderController = n, this.container = s, this.props = i, this.loader = r, this.props.initOnConstruct && this.init();
|
|
2377
2377
|
}
|
|
2378
2378
|
async _initCanvas() {
|
|
2379
2379
|
try {
|
|
@@ -2395,12 +2395,14 @@ ${e instanceof Error ? e.message : "Something went wrong"}`
|
|
|
2395
2395
|
thread: this._service.thread
|
|
2396
2396
|
});
|
|
2397
2397
|
}
|
|
2398
|
-
async
|
|
2398
|
+
async _initEvents() {
|
|
2399
2399
|
var e, t;
|
|
2400
2400
|
if (!this._service.canvas)
|
|
2401
2401
|
throw new Error("Canvas element is not initialized.");
|
|
2402
|
-
|
|
2403
|
-
|
|
2402
|
+
if (!this._service.thread || !this._service.worker)
|
|
2403
|
+
throw new Error("Worker-thread is not initialized.");
|
|
2404
|
+
this._controller.init(), this.props.fullScreen && ((t = (e = this._service.thread) == null ? void 0 : e.resize) == null || t.call(e, {
|
|
2405
|
+
...this._service.uiEventHandler({
|
|
2404
2406
|
type: "resize"
|
|
2405
2407
|
})
|
|
2406
2408
|
}));
|
|
@@ -2413,7 +2415,7 @@ ${e instanceof Error ? e.message : "Something went wrong"}`
|
|
|
2413
2415
|
payload: {
|
|
2414
2416
|
path: this.props.location,
|
|
2415
2417
|
subject: {
|
|
2416
|
-
...
|
|
2418
|
+
...Pe(this.props, [
|
|
2417
2419
|
"canvas",
|
|
2418
2420
|
"location",
|
|
2419
2421
|
"onReady",
|
|
@@ -2429,7 +2431,7 @@ ${e instanceof Error ? e.message : "Something went wrong"}`
|
|
|
2429
2431
|
this._service.worker = e.worker, this._service.thread = e.thread;
|
|
2430
2432
|
}
|
|
2431
2433
|
async _initObservableProxyEvents() {
|
|
2432
|
-
|
|
2434
|
+
Oe.forEach(
|
|
2433
2435
|
(e) => this[`${e}$`] = () => {
|
|
2434
2436
|
var t;
|
|
2435
2437
|
return (t = this._controller) == null ? void 0 : t[`${e}$`];
|
|
@@ -2437,21 +2439,23 @@ ${e instanceof Error ? e.message : "Something went wrong"}`
|
|
|
2437
2439
|
);
|
|
2438
2440
|
}
|
|
2439
2441
|
async _initLoader() {
|
|
2440
|
-
this.loader.init(this.props.loaderDataSources), this.
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
e.resource
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2442
|
+
this.loader.init(this.props.loaderDataSources), this._subscriptions.push(
|
|
2443
|
+
this._loaderController.serializedLoad$.subscribe((e) => {
|
|
2444
|
+
var t, n;
|
|
2445
|
+
if (e.resource instanceof ArrayBuffer)
|
|
2446
|
+
return (t = this._service.worker) == null ? void 0 : t.postMessage(e.resource, [
|
|
2447
|
+
e.resource
|
|
2448
|
+
]);
|
|
2449
|
+
(n = this._service.worker) == null || n.postMessage({
|
|
2450
|
+
token: it,
|
|
2451
|
+
payload: e
|
|
2452
|
+
});
|
|
2453
|
+
})
|
|
2454
|
+
);
|
|
2451
2455
|
}
|
|
2452
2456
|
async init() {
|
|
2453
2457
|
var e, t;
|
|
2454
|
-
this.
|
|
2458
|
+
this._initialized || (this._initialized = !0, await this._initCanvas(), await this._initWorkerThread(), await this._initService(), await this._initObservableProxyEvents(), await this._initLoader(), await this._initEvents(), (t = (e = this.props).onReady) == null || t.call(e, { module: this, container: this.container }));
|
|
2455
2459
|
}
|
|
2456
2460
|
getCanvas() {
|
|
2457
2461
|
return this._service.canvas;
|
|
@@ -2469,49 +2473,49 @@ ${e instanceof Error ? e.message : "Something went wrong"}`
|
|
|
2469
2473
|
return this._service.workerPool;
|
|
2470
2474
|
}
|
|
2471
2475
|
isInitialized() {
|
|
2472
|
-
return this.
|
|
2476
|
+
return this._initialized;
|
|
2473
2477
|
}
|
|
2474
2478
|
async dispose() {
|
|
2475
|
-
var e
|
|
2476
|
-
|
|
2479
|
+
var e;
|
|
2480
|
+
this._subscriptions.map((t) => t.unsubscribe()), await this._service.workerPool.terminateAll(), ((e = this._service.canvas) == null ? void 0 : e.dataset.reactive) === "true" && (document.body.removeChild(this._service.canvas), this._service.canvas.remove(), this._service.canvas = void 0), this._initialized = !1;
|
|
2477
2481
|
}
|
|
2478
2482
|
};
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
k(0,
|
|
2482
|
-
k(1,
|
|
2483
|
-
k(2,
|
|
2484
|
-
k(3,
|
|
2485
|
-
k(4,
|
|
2486
|
-
k(5,
|
|
2487
|
-
],
|
|
2488
|
-
const
|
|
2483
|
+
Te = Ws([
|
|
2484
|
+
z(X.ResolutionScoped),
|
|
2485
|
+
k(0, b(J)),
|
|
2486
|
+
k(1, b(ge)),
|
|
2487
|
+
k(2, b(ee)),
|
|
2488
|
+
k(3, b(De)),
|
|
2489
|
+
k(4, b(_e)),
|
|
2490
|
+
k(5, b(Ae))
|
|
2491
|
+
], Te);
|
|
2492
|
+
const Js = (o) => {
|
|
2489
2493
|
if (typeof (o == null ? void 0 : o.location) != "string" && !((o == null ? void 0 : o.location) instanceof URL))
|
|
2490
2494
|
throw new Error(
|
|
2491
2495
|
"Invalid register props detected. location path is required"
|
|
2492
2496
|
);
|
|
2493
|
-
const e =
|
|
2494
|
-
o.initOnConstruct =
|
|
2495
|
-
const t = e.resolve(
|
|
2496
|
-
return
|
|
2497
|
+
const e = Ie.createChildContainer();
|
|
2498
|
+
o.initOnConstruct = W(o.initOnConstruct) || !$(o.initOnConstruct) ? !0 : o.initOnConstruct, o.defaultCamera = o != null && o.defaultCamera && o.defaultCamera in Ee ? o.defaultCamera : Ee.PERSPECTIVE, o.withMiniCamera = W(o.withMiniCamera) || !$(o.withMiniCamera) ? !1 : o.withMiniCamera, o.startTimer = W(o.startTimer) || !$(o.startTimer) ? !0 : o.startTimer, o.fullScreen = W(o.fullScreen) || !$(o.fullScreen) ? !0 : o.fullScreen, o.onReady = ot(o.onReady) ? o.onReady : void 0, e.register(De, { useValue: e }), e.register(_e, { useValue: o });
|
|
2499
|
+
const t = e.resolve(Te);
|
|
2500
|
+
return {
|
|
2497
2501
|
container: e,
|
|
2498
2502
|
module: t
|
|
2499
2503
|
};
|
|
2500
2504
|
};
|
|
2501
2505
|
export {
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
+
tn as AppModule,
|
|
2507
|
+
sn as AppProxyEventHandlersBlueprint,
|
|
2508
|
+
De as CONTAINER_TOKEN,
|
|
2509
|
+
Ee as DefaultCameraType,
|
|
2506
2510
|
Ze as KEYBOARD_EVENT_CODES,
|
|
2507
2511
|
it as LOADER_SERIALIZED_LOAD_TOKEN,
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2512
|
+
Qs as LaunchAppProps,
|
|
2513
|
+
Oe as PROXY_EVENT_LISTENERS,
|
|
2514
|
+
et as ProxyEventHandlersBlueprint,
|
|
2515
|
+
nn as ProxyEventObservablesBlueprint,
|
|
2516
|
+
rn as ProxyEventSubjectsBlueprint,
|
|
2517
|
+
Te as RegisterModule,
|
|
2518
|
+
_e as RegisterPropsBlueprint,
|
|
2515
2519
|
rt as RegisterProxyEventHandlersBlueprint,
|
|
2516
|
-
|
|
2520
|
+
Js as register
|
|
2517
2521
|
};
|