@quick-threejs/reactive 0.1.28 → 0.1.30
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-n-JVGlLg.mjs → app.module-BHCAJZLN.mjs} +1521 -1508
- package/dist/app.module-DRE0SP1g.js +34 -0
- package/dist/common/blueprints/props.blueprint.d.ts +22 -1
- package/dist/common/interfaces/loader.interface.d.ts +2 -3
- package/dist/core/app/camera/camera.module.d.ts +5 -5
- package/dist/core/app/camera/camera.service.d.ts +3 -6
- package/dist/core/app/debug/debug.module.d.ts +12 -9
- package/dist/core/app/debug/debug.service.d.ts +17 -13
- package/dist/core/app/renderer/renderer.service.d.ts +1 -3
- package/dist/core/register/loader/loader.module.d.ts +4 -5
- package/dist/core/register/loader/loader.service.d.ts +4 -4
- package/dist/main.js +3 -3
- package/dist/main.mjs +1158 -1099
- package/dist/worker.js +1 -1
- package/dist/worker.mjs +1 -1
- package/package.json +4 -4
- package/dist/app.module-BQotCgts.js +0 -34
package/dist/main.mjs
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
var
|
|
2
|
-
var We = (
|
|
3
|
-
var
|
|
4
|
-
import { s as V, C as
|
|
5
|
-
import { k as
|
|
6
|
-
import { TrianglesDrawMode as
|
|
7
|
-
class
|
|
1
|
+
var Xe = Object.defineProperty;
|
|
2
|
+
var We = (o, e, t) => e in o ? Xe(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var _ = (o, e, t) => We(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { s as V, C as $e, P as qe, a as Ce, f as Ye, m as ce, b as Me, J as ee, K as Qe, i as L, S as Je, c as Ze, W as Te, d as Ie, e as et, L as tt, R as st, U as nt, g as rt, h as Oe, A as z, D as X, j as _e, Q as it } from "./app.module-BHCAJZLN.mjs";
|
|
5
|
+
import { k as Zs, o as en, n as tn, l as sn } from "./app.module-BHCAJZLN.mjs";
|
|
6
|
+
import { TrianglesDrawMode as ot, TriangleFanDrawMode as le, TriangleStripDrawMode as Ne, Loader as Pe, FileLoader as W, SRGBColorSpace as N, LinearSRGBColorSpace as S, BufferGeometry as De, BufferAttribute as j, Color as P, ColorManagement as ue, LoaderUtils as K, SpotLight as at, PointLight as ct, DirectionalLight as lt, MeshBasicMaterial as B, MeshPhysicalMaterial as v, Vector2 as ke, Matrix4 as $, Vector3 as F, Quaternion as Fe, InstancedMesh as ut, InstancedBufferAttribute as dt, Object3D as He, TextureLoader as ht, ImageBitmapLoader as Ue, InterleavedBuffer as ft, InterleavedBufferAttribute as pt, LinearFilter as de, LinearMipmapLinearFilter as Ge, RepeatWrapping as he, NearestFilter as Be, PointsMaterial as mt, Material as te, LineBasicMaterial as gt, MeshStandardMaterial as je, DoubleSide as At, PropertyBinding as Tt, SkinnedMesh as _t, Mesh as Rt, LineSegments as Et, Line as wt, LineLoop as xt, Points as yt, Group as se, PerspectiveCamera as Lt, MathUtils as bt, OrthographicCamera as St, Skeleton as vt, AnimationClip as Ct, Bone as Mt, InterpolateLinear as Ke, NearestMipmapNearestFilter as It, LinearMipmapNearestFilter as Ot, NearestMipmapLinearFilter as Nt, ClampToEdgeWrapping as Pt, MirroredRepeatWrapping as Dt, InterpolateDiscrete as kt, FrontSide as Ft, Texture as Re, VectorKeyframeTrack as Ee, NumberKeyframeTrack as we, QuaternionKeyframeTrack as xe, Box3 as Ht, Sphere as Ut, Interpolant as Gt, LoadingManager as Bt, AudioLoader as jt } from "three";
|
|
7
|
+
class Ae {
|
|
8
8
|
constructor() {
|
|
9
9
|
/**
|
|
10
10
|
* @description The app worker logic location.
|
|
11
11
|
*
|
|
12
12
|
* @required
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
_(this, "location");
|
|
15
15
|
/**
|
|
16
16
|
* @description Initialize the app on construct.
|
|
17
17
|
*
|
|
18
18
|
* @default true
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
_(this, "initOnConstruct");
|
|
21
21
|
/**
|
|
22
22
|
* @description App `canvas` element reference.
|
|
23
23
|
*
|
|
24
24
|
* @default undefined
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
_(this, "canvas");
|
|
27
27
|
/**
|
|
28
28
|
* @description Set the `canvas` view in fullscreen and auto-resize it.
|
|
29
29
|
*
|
|
30
30
|
* @default true
|
|
31
31
|
*/
|
|
32
|
-
|
|
32
|
+
_(this, "fullScreen");
|
|
33
33
|
/**
|
|
34
34
|
* Default used camera.
|
|
35
35
|
*
|
|
@@ -37,19 +37,19 @@ class Te {
|
|
|
37
37
|
*
|
|
38
38
|
* @default DefaultCameraType.PERSPECTIVE
|
|
39
39
|
*/
|
|
40
|
-
|
|
40
|
+
_(this, "defaultCamera");
|
|
41
41
|
/**
|
|
42
42
|
* @description Start timer update on launch.
|
|
43
43
|
*
|
|
44
44
|
* @default true
|
|
45
45
|
*/
|
|
46
|
-
|
|
46
|
+
_(this, "startTimer");
|
|
47
47
|
/**
|
|
48
48
|
* @description Resources to load.
|
|
49
49
|
*
|
|
50
50
|
* @default []
|
|
51
51
|
*/
|
|
52
|
-
|
|
52
|
+
_(this, "loaderDataSources", []);
|
|
53
53
|
/**
|
|
54
54
|
* @description Will directly load the resources on initialization.
|
|
55
55
|
*
|
|
@@ -57,13 +57,24 @@ class Te {
|
|
|
57
57
|
*
|
|
58
58
|
* @default true
|
|
59
59
|
*/
|
|
60
|
-
|
|
60
|
+
_(this, "loadResourcesOnInit");
|
|
61
61
|
/**
|
|
62
62
|
* @description Enable the debug mode
|
|
63
63
|
*
|
|
64
|
+
* @remark __Deactivated if the value is `false` or `undefined`__
|
|
65
|
+
*
|
|
64
66
|
* @default undefined
|
|
65
67
|
*/
|
|
66
|
-
|
|
68
|
+
_(this, "enableDebug");
|
|
69
|
+
/**
|
|
70
|
+
* Will enable orbit controls for the cameras.
|
|
71
|
+
*
|
|
72
|
+
* @remark __Deactivated if the value is `false` or `undefined`__
|
|
73
|
+
* @remark __This property depends on {@link RegisterPropsBlueprint.enableDebug enableDebug}__
|
|
74
|
+
*
|
|
75
|
+
* @default undefined
|
|
76
|
+
*/
|
|
77
|
+
_(this, "enableControls");
|
|
67
78
|
/**
|
|
68
79
|
* Define the {@link THREE.AxesHelper} sizes.
|
|
69
80
|
*
|
|
@@ -72,7 +83,7 @@ class Te {
|
|
|
72
83
|
*
|
|
73
84
|
* @default undefined
|
|
74
85
|
*/
|
|
75
|
-
|
|
86
|
+
_(this, "axesSizes");
|
|
76
87
|
/**
|
|
77
88
|
* Define the {@link THREE.GridHelper} sizes.
|
|
78
89
|
*
|
|
@@ -81,231 +92,361 @@ class Te {
|
|
|
81
92
|
*
|
|
82
93
|
* @default undefined
|
|
83
94
|
*/
|
|
84
|
-
|
|
95
|
+
_(this, "gridSizes");
|
|
85
96
|
/**
|
|
86
97
|
* Display a mini perfective camera at the top right corner of the screen.
|
|
87
98
|
*
|
|
99
|
+
* @remark __Deactivated if the value is `false` or `undefined`__
|
|
100
|
+
* @remark __This property depends on {@link RegisterPropsBlueprint.enableDebug enableDebug}__
|
|
101
|
+
*
|
|
102
|
+
* @default undefined
|
|
103
|
+
*/
|
|
104
|
+
_(this, "withMiniCamera");
|
|
105
|
+
/**
|
|
106
|
+
* Display the camera helper.
|
|
107
|
+
*
|
|
108
|
+
* @remark __Deactivated if the value is `false` or `undefined`__
|
|
88
109
|
* @remark __This property depends on {@link RegisterPropsBlueprint.enableDebug enableDebug}__
|
|
89
110
|
*
|
|
90
|
-
* @default
|
|
111
|
+
* @default undefined
|
|
91
112
|
*/
|
|
92
|
-
|
|
113
|
+
_(this, "withCameraHelper");
|
|
93
114
|
/**
|
|
94
115
|
* @description Handler called when the app is ready.
|
|
95
116
|
*
|
|
96
117
|
* @default undefined
|
|
97
118
|
*/
|
|
98
|
-
|
|
119
|
+
_(this, "onReady");
|
|
99
120
|
}
|
|
100
121
|
}
|
|
101
|
-
class
|
|
122
|
+
class qs {
|
|
102
123
|
constructor() {
|
|
103
124
|
/** @description Handler triggered when the app is ready. */
|
|
104
|
-
|
|
125
|
+
_(this, "onReady");
|
|
105
126
|
}
|
|
106
127
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
128
|
+
function ye(o, e) {
|
|
129
|
+
if (e === ot)
|
|
130
|
+
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), o;
|
|
131
|
+
if (e === le || e === Ne) {
|
|
132
|
+
let t = o.getIndex();
|
|
133
|
+
if (t === null) {
|
|
134
|
+
const n = [], c = o.getAttribute("position");
|
|
135
|
+
if (c !== void 0) {
|
|
136
|
+
for (let a = 0; a < c.count; a++)
|
|
137
|
+
n.push(a);
|
|
138
|
+
o.setIndex(n), t = o.getIndex();
|
|
139
|
+
} else
|
|
140
|
+
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), o;
|
|
141
|
+
}
|
|
142
|
+
const i = t.count - 2, s = [];
|
|
143
|
+
if (e === le)
|
|
144
|
+
for (let n = 1; n <= i; n++)
|
|
145
|
+
s.push(t.getX(0)), s.push(t.getX(n)), s.push(t.getX(n + 1));
|
|
146
|
+
else
|
|
147
|
+
for (let n = 0; n < i; n++)
|
|
148
|
+
n % 2 === 0 ? (s.push(t.getX(n)), s.push(t.getX(n + 1)), s.push(t.getX(n + 2))) : (s.push(t.getX(n + 2)), s.push(t.getX(n + 1)), s.push(t.getX(n)));
|
|
149
|
+
s.length / 3 !== i && console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");
|
|
150
|
+
const r = o.clone();
|
|
151
|
+
return r.setIndex(s), r.clearGroups(), r;
|
|
152
|
+
} else
|
|
153
|
+
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e), o;
|
|
154
|
+
}
|
|
155
|
+
const ne = /* @__PURE__ */ new WeakMap();
|
|
156
|
+
class Kt extends Pe {
|
|
157
|
+
constructor(e) {
|
|
158
|
+
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
|
+
position: "POSITION",
|
|
160
|
+
normal: "NORMAL",
|
|
161
|
+
color: "COLOR",
|
|
162
|
+
uv: "TEX_COORD"
|
|
163
|
+
}, this.defaultAttributeTypes = {
|
|
164
|
+
position: "Float32Array",
|
|
165
|
+
normal: "Float32Array",
|
|
166
|
+
color: "Float32Array",
|
|
167
|
+
uv: "Float32Array"
|
|
168
|
+
};
|
|
118
169
|
}
|
|
119
|
-
|
|
120
|
-
this.
|
|
170
|
+
setDecoderPath(e) {
|
|
171
|
+
return this.decoderPath = e, this;
|
|
121
172
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
V()
|
|
125
|
-
], q);
|
|
126
|
-
var qt = Object.defineProperty, Yt = Object.getOwnPropertyDescriptor, Qt = (c, e, t, r) => {
|
|
127
|
-
for (var s = r > 1 ? void 0 : r ? Yt(e, t) : e, i = c.length - 1, n; i >= 0; i--)
|
|
128
|
-
(n = c[i]) && (s = (r ? n(e, t, s) : n(s)) || s);
|
|
129
|
-
return r && s && qt(e, t, s), s;
|
|
130
|
-
}, Jt = (c, e) => (t, r) => e(t, r, c);
|
|
131
|
-
let pe = class extends Ye {
|
|
132
|
-
constructor(e) {
|
|
133
|
-
super();
|
|
134
|
-
E(this, "canvas");
|
|
135
|
-
this._service = e;
|
|
173
|
+
setDecoderConfig(e) {
|
|
174
|
+
return this.decoderConfig = e, this;
|
|
136
175
|
}
|
|
137
|
-
|
|
138
|
-
this.
|
|
139
|
-
for (const t of Ce) {
|
|
140
|
-
const r = 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;
|
|
141
|
-
this[`${t}$`] = Qe(
|
|
142
|
-
t === "resize" ? window : e,
|
|
143
|
-
t
|
|
144
|
-
).pipe(
|
|
145
|
-
// @ts-ignore
|
|
146
|
-
le(r.bind(this)),
|
|
147
|
-
Me((s) => !(t === "keydown" && !s))
|
|
148
|
-
), this[`${t}$`].subscribe((s) => {
|
|
149
|
-
var i, n;
|
|
150
|
-
(n = (i = this._service.thread) == null ? void 0 : i[t]) == null || n.call(i, s);
|
|
151
|
-
});
|
|
152
|
-
}
|
|
176
|
+
setWorkerLimit(e) {
|
|
177
|
+
return this.workerLimit = e, this;
|
|
153
178
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
179
|
+
load(e, t, i, s) {
|
|
180
|
+
const r = new W(this.manager);
|
|
181
|
+
r.setPath(this.path), r.setResponseType("arraybuffer"), r.setRequestHeader(this.requestHeader), r.setWithCredentials(this.withCredentials), r.load(e, (n) => {
|
|
182
|
+
this.parse(n, t, s);
|
|
183
|
+
}, i, s);
|
|
158
184
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
height: this.canvas.height,
|
|
163
|
-
windowWidth: (window == null ? void 0 : window.innerWidth) ?? 0,
|
|
164
|
-
windowHeight: (window == null ? void 0 : window.innerHeight) ?? 0
|
|
165
|
-
};
|
|
185
|
+
parse(e, t, i = () => {
|
|
186
|
+
}) {
|
|
187
|
+
this.decodeDracoFile(e, t, null, null, N, i).catch(i);
|
|
166
188
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
189
|
+
decodeDracoFile(e, t, i, s, r = S, n = () => {
|
|
190
|
+
}) {
|
|
191
|
+
const c = {
|
|
192
|
+
attributeIDs: i || this.defaultAttributeIDs,
|
|
193
|
+
attributeTypes: s || this.defaultAttributeTypes,
|
|
194
|
+
useUniqueIDs: !!i,
|
|
195
|
+
vertexColorSpace: r
|
|
174
196
|
};
|
|
197
|
+
return this.decodeGeometry(e, c).then(t).catch(n);
|
|
175
198
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
])
|
|
190
|
-
};
|
|
199
|
+
decodeGeometry(e, t) {
|
|
200
|
+
const i = JSON.stringify(t);
|
|
201
|
+
if (ne.has(e)) {
|
|
202
|
+
const a = ne.get(e);
|
|
203
|
+
if (a.key === i)
|
|
204
|
+
return a.promise;
|
|
205
|
+
if (e.byteLength === 0)
|
|
206
|
+
throw new Error(
|
|
207
|
+
"THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred."
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
let s;
|
|
211
|
+
const r = this.workerNextTaskID++, n = e.byteLength, c = this._getWorker(r, n).then((a) => (s = a, new Promise((l, d) => {
|
|
212
|
+
s._callbacks[r] = { resolve: l, reject: d }, s.postMessage({ type: "decode", id: r, taskConfig: t, buffer: e }, [e]);
|
|
213
|
+
}))).then((a) => this._createGeometry(a.geometry));
|
|
214
|
+
return c.catch(() => !0).then(() => {
|
|
215
|
+
s && r && this._releaseTask(s, r);
|
|
216
|
+
}), ne.set(e, {
|
|
217
|
+
key: i,
|
|
218
|
+
promise: c
|
|
219
|
+
}), c;
|
|
191
220
|
}
|
|
192
|
-
|
|
193
|
-
const t =
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
pageY: (i == null ? void 0 : i.pageY) ?? 0
|
|
199
|
-
});
|
|
221
|
+
_createGeometry(e) {
|
|
222
|
+
const t = new De();
|
|
223
|
+
e.index && t.setIndex(new j(e.index.array, 1));
|
|
224
|
+
for (let i = 0; i < e.attributes.length; i++) {
|
|
225
|
+
const s = e.attributes[i], r = s.name, n = s.array, c = s.itemSize, a = new j(n, c);
|
|
226
|
+
r === "color" && (this._assignVertexColorSpace(a, s.vertexColorSpace), a.normalized = !(n instanceof Float32Array)), t.setAttribute(r, a);
|
|
200
227
|
}
|
|
201
|
-
return
|
|
228
|
+
return t;
|
|
202
229
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
230
|
+
_assignVertexColorSpace(e, t) {
|
|
231
|
+
if (t !== N) return;
|
|
232
|
+
const i = new P();
|
|
233
|
+
for (let s = 0, r = e.count; s < r; s++)
|
|
234
|
+
i.fromBufferAttribute(e, s), ue.toWorkingColorSpace(i, N), e.setXYZ(s, i.r, i.g, i.b);
|
|
208
235
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
};
|
|
236
|
+
_loadLibrary(e, t) {
|
|
237
|
+
const i = new W(this.manager);
|
|
238
|
+
return i.setPath(this.decoderPath), i.setResponseType(t), i.setWithCredentials(this.withCredentials), new Promise((s, r) => {
|
|
239
|
+
i.load(e, s, void 0, r);
|
|
240
|
+
});
|
|
215
241
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
242
|
+
preload() {
|
|
243
|
+
return this._initDecoder(), this;
|
|
244
|
+
}
|
|
245
|
+
_initDecoder() {
|
|
246
|
+
if (this.decoderPending) return this.decoderPending;
|
|
247
|
+
const e = typeof WebAssembly != "object" || this.decoderConfig.type === "js", t = [];
|
|
248
|
+
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((i) => {
|
|
249
|
+
const s = i[0];
|
|
250
|
+
e || (this.decoderConfig.wasmBinary = i[1]);
|
|
251
|
+
const r = Vt.toString(), n = [
|
|
252
|
+
"/* draco decoder */",
|
|
253
|
+
s,
|
|
254
|
+
"",
|
|
255
|
+
"/* worker */",
|
|
256
|
+
r.substring(r.indexOf("{") + 1, r.lastIndexOf("}"))
|
|
257
|
+
].join(`
|
|
258
|
+
`);
|
|
259
|
+
this.workerSourceURL = URL.createObjectURL(new Blob([n]));
|
|
260
|
+
}), this.decoderPending;
|
|
261
|
+
}
|
|
262
|
+
_getWorker(e, t) {
|
|
263
|
+
return this._initDecoder().then(() => {
|
|
264
|
+
if (this.workerPool.length < this.workerLimit) {
|
|
265
|
+
const s = new Worker(this.workerSourceURL);
|
|
266
|
+
s._callbacks = {}, s._taskCosts = {}, s._taskLoad = 0, s.postMessage({ type: "init", decoderConfig: this.decoderConfig }), s.onmessage = function(r) {
|
|
267
|
+
const n = r.data;
|
|
268
|
+
switch (n.type) {
|
|
269
|
+
case "decode":
|
|
270
|
+
s._callbacks[n.id].resolve(n);
|
|
271
|
+
break;
|
|
272
|
+
case "error":
|
|
273
|
+
s._callbacks[n.id].reject(n);
|
|
274
|
+
break;
|
|
275
|
+
default:
|
|
276
|
+
console.error('THREE.DRACOLoader: Unexpected message, "' + n.type + '"');
|
|
277
|
+
}
|
|
278
|
+
}, this.workerPool.push(s);
|
|
232
279
|
} else
|
|
233
|
-
|
|
280
|
+
this.workerPool.sort(function(s, r) {
|
|
281
|
+
return s._taskLoad > r._taskLoad ? -1 : 1;
|
|
282
|
+
});
|
|
283
|
+
const i = this.workerPool[this.workerPool.length - 1];
|
|
284
|
+
return i._taskCosts[e] = t, i._taskLoad += t, i;
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
_releaseTask(e, t) {
|
|
288
|
+
e._taskLoad -= e._taskCosts[t], delete e._callbacks[t], delete e._taskCosts[t];
|
|
289
|
+
}
|
|
290
|
+
debug() {
|
|
291
|
+
console.log("Task load: ", this.workerPool.map((e) => e._taskLoad));
|
|
292
|
+
}
|
|
293
|
+
dispose() {
|
|
294
|
+
for (let e = 0; e < this.workerPool.length; ++e)
|
|
295
|
+
this.workerPool[e].terminate();
|
|
296
|
+
return this.workerPool.length = 0, this.workerSourceURL !== "" && URL.revokeObjectURL(this.workerSourceURL), this;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
function Vt() {
|
|
300
|
+
let o, e;
|
|
301
|
+
onmessage = function(n) {
|
|
302
|
+
const c = n.data;
|
|
303
|
+
switch (c.type) {
|
|
304
|
+
case "init":
|
|
305
|
+
o = c.decoderConfig, e = new Promise(function(d) {
|
|
306
|
+
o.onModuleLoaded = function(u) {
|
|
307
|
+
d({ draco: u });
|
|
308
|
+
}, DracoDecoderModule(o);
|
|
309
|
+
});
|
|
310
|
+
break;
|
|
311
|
+
case "decode":
|
|
312
|
+
const a = c.buffer, l = c.taskConfig;
|
|
313
|
+
e.then((d) => {
|
|
314
|
+
const u = d.draco, h = new u.Decoder();
|
|
315
|
+
try {
|
|
316
|
+
const f = t(u, h, new Int8Array(a), l), p = f.attributes.map((A) => A.array.buffer);
|
|
317
|
+
f.index && p.push(f.index.array.buffer), self.postMessage({ type: "decode", id: c.id, geometry: f }, p);
|
|
318
|
+
} catch (f) {
|
|
319
|
+
console.error(f), self.postMessage({ type: "error", id: c.id, error: f.message });
|
|
320
|
+
} finally {
|
|
321
|
+
u.destroy(h);
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
break;
|
|
234
325
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
326
|
+
};
|
|
327
|
+
function t(n, c, a, l) {
|
|
328
|
+
const d = l.attributeIDs, u = l.attributeTypes;
|
|
329
|
+
let h, f;
|
|
330
|
+
const p = c.GetEncodedGeometryType(a);
|
|
331
|
+
if (p === n.TRIANGULAR_MESH)
|
|
332
|
+
h = new n.Mesh(), f = c.DecodeArrayToMesh(a, a.byteLength, h);
|
|
333
|
+
else if (p === n.POINT_CLOUD)
|
|
334
|
+
h = new n.PointCloud(), f = c.DecodeArrayToPointCloud(a, a.byteLength, h);
|
|
239
335
|
else
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
const
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
336
|
+
throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
|
|
337
|
+
if (!f.ok() || h.ptr === 0)
|
|
338
|
+
throw new Error("THREE.DRACOLoader: Decoding failed: " + f.error_msg());
|
|
339
|
+
const A = { index: null, attributes: [] };
|
|
340
|
+
for (const m in d) {
|
|
341
|
+
const g = self[u[m]];
|
|
342
|
+
let R, w;
|
|
343
|
+
if (l.useUniqueIDs)
|
|
344
|
+
w = d[m], R = c.GetAttributeByUniqueId(h, w);
|
|
345
|
+
else {
|
|
346
|
+
if (w = c.GetAttributeId(h, n[d[m]]), w === -1) continue;
|
|
347
|
+
R = c.GetAttribute(h, w);
|
|
348
|
+
}
|
|
349
|
+
const E = s(n, c, h, m, g, R);
|
|
350
|
+
m === "color" && (E.vertexColorSpace = l.vertexColorSpace), A.attributes.push(E);
|
|
351
|
+
}
|
|
352
|
+
return p === n.TRIANGULAR_MESH && (A.index = i(n, c, h)), n.destroy(h), A;
|
|
353
|
+
}
|
|
354
|
+
function i(n, c, a) {
|
|
355
|
+
const d = a.num_faces() * 3, u = d * 4, h = n._malloc(u);
|
|
356
|
+
c.GetTrianglesUInt32Array(a, u, h);
|
|
357
|
+
const f = new Uint32Array(n.HEAPF32.buffer, h, d).slice();
|
|
358
|
+
return n._free(h), { array: f, itemSize: 1 };
|
|
359
|
+
}
|
|
360
|
+
function s(n, c, a, l, d, u) {
|
|
361
|
+
const h = u.num_components(), p = a.num_points() * h, A = p * d.BYTES_PER_ELEMENT, m = r(n, d), g = n._malloc(A);
|
|
362
|
+
c.GetAttributeDataArrayForAllPoints(a, u, m, A, g);
|
|
363
|
+
const R = new d(n.HEAPF32.buffer, g, p).slice();
|
|
364
|
+
return n._free(g), {
|
|
365
|
+
name: l,
|
|
366
|
+
array: R,
|
|
367
|
+
itemSize: h
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
function r(n, c) {
|
|
371
|
+
switch (c) {
|
|
372
|
+
case Float32Array:
|
|
373
|
+
return n.DT_FLOAT32;
|
|
374
|
+
case Int8Array:
|
|
375
|
+
return n.DT_INT8;
|
|
376
|
+
case Int16Array:
|
|
377
|
+
return n.DT_INT16;
|
|
378
|
+
case Int32Array:
|
|
379
|
+
return n.DT_INT32;
|
|
380
|
+
case Uint8Array:
|
|
381
|
+
return n.DT_UINT8;
|
|
382
|
+
case Uint16Array:
|
|
383
|
+
return n.DT_UINT16;
|
|
384
|
+
case Uint32Array:
|
|
385
|
+
return n.DT_UINT32;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
247
388
|
}
|
|
248
|
-
class
|
|
389
|
+
class zt extends Pe {
|
|
249
390
|
constructor(e) {
|
|
250
391
|
super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(t) {
|
|
251
|
-
return new
|
|
392
|
+
return new Yt(t);
|
|
252
393
|
}), this.register(function(t) {
|
|
253
|
-
return new
|
|
254
|
-
}), this.register(function(t) {
|
|
255
|
-
return new ps(t);
|
|
394
|
+
return new Qt(t);
|
|
256
395
|
}), this.register(function(t) {
|
|
257
|
-
return new
|
|
258
|
-
}), this.register(function(t) {
|
|
259
|
-
return new gs(t);
|
|
396
|
+
return new os(t);
|
|
260
397
|
}), this.register(function(t) {
|
|
261
398
|
return new as(t);
|
|
262
399
|
}), this.register(function(t) {
|
|
263
400
|
return new cs(t);
|
|
264
401
|
}), this.register(function(t) {
|
|
265
|
-
return new
|
|
402
|
+
return new Zt(t);
|
|
266
403
|
}), this.register(function(t) {
|
|
267
|
-
return new
|
|
404
|
+
return new es(t);
|
|
268
405
|
}), this.register(function(t) {
|
|
269
|
-
return new
|
|
406
|
+
return new ts(t);
|
|
270
407
|
}), this.register(function(t) {
|
|
271
|
-
return new
|
|
408
|
+
return new ss(t);
|
|
272
409
|
}), this.register(function(t) {
|
|
273
|
-
return new
|
|
410
|
+
return new qt(t);
|
|
274
411
|
}), this.register(function(t) {
|
|
275
|
-
return new
|
|
412
|
+
return new ns(t);
|
|
276
413
|
}), this.register(function(t) {
|
|
277
|
-
return new
|
|
414
|
+
return new Jt(t);
|
|
278
415
|
}), this.register(function(t) {
|
|
279
|
-
return new
|
|
416
|
+
return new is(t);
|
|
280
417
|
}), this.register(function(t) {
|
|
281
|
-
return new
|
|
418
|
+
return new rs(t);
|
|
282
419
|
}), this.register(function(t) {
|
|
283
|
-
return new
|
|
420
|
+
return new Wt(t);
|
|
421
|
+
}), this.register(function(t) {
|
|
422
|
+
return new ls(t);
|
|
423
|
+
}), this.register(function(t) {
|
|
424
|
+
return new us(t);
|
|
284
425
|
});
|
|
285
426
|
}
|
|
286
|
-
load(e, t,
|
|
287
|
-
const
|
|
427
|
+
load(e, t, i, s) {
|
|
428
|
+
const r = this;
|
|
288
429
|
let n;
|
|
289
430
|
if (this.resourcePath !== "")
|
|
290
431
|
n = this.resourcePath;
|
|
291
432
|
else if (this.path !== "") {
|
|
292
|
-
const l =
|
|
293
|
-
n =
|
|
433
|
+
const l = K.extractUrlBase(e);
|
|
434
|
+
n = K.resolveURL(l, this.path);
|
|
294
435
|
} else
|
|
295
|
-
n =
|
|
436
|
+
n = K.extractUrlBase(e);
|
|
296
437
|
this.manager.itemStart(e);
|
|
297
|
-
const
|
|
298
|
-
s ? s(l) : console.error(l),
|
|
299
|
-
},
|
|
300
|
-
|
|
438
|
+
const c = function(l) {
|
|
439
|
+
s ? s(l) : console.error(l), r.manager.itemError(e), r.manager.itemEnd(e);
|
|
440
|
+
}, a = new W(this.manager);
|
|
441
|
+
a.setPath(this.path), a.setResponseType("arraybuffer"), a.setRequestHeader(this.requestHeader), a.setWithCredentials(this.withCredentials), a.load(e, function(l) {
|
|
301
442
|
try {
|
|
302
|
-
|
|
303
|
-
t(d),
|
|
304
|
-
},
|
|
443
|
+
r.parse(l, n, function(d) {
|
|
444
|
+
t(d), r.manager.itemEnd(e);
|
|
445
|
+
}, c);
|
|
305
446
|
} catch (d) {
|
|
306
|
-
|
|
447
|
+
c(d);
|
|
307
448
|
}
|
|
308
|
-
},
|
|
449
|
+
}, i, c);
|
|
309
450
|
}
|
|
310
451
|
setDRACOLoader(e) {
|
|
311
452
|
return this.dracoLoader = e, this;
|
|
@@ -322,29 +463,29 @@ class Zt extends De {
|
|
|
322
463
|
unregister(e) {
|
|
323
464
|
return this.pluginCallbacks.indexOf(e) !== -1 && this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e), 1), this;
|
|
324
465
|
}
|
|
325
|
-
parse(e, t,
|
|
326
|
-
let
|
|
327
|
-
const n = {},
|
|
466
|
+
parse(e, t, i, s) {
|
|
467
|
+
let r;
|
|
468
|
+
const n = {}, c = {}, a = new TextDecoder();
|
|
328
469
|
if (typeof e == "string")
|
|
329
|
-
|
|
470
|
+
r = JSON.parse(e);
|
|
330
471
|
else if (e instanceof ArrayBuffer)
|
|
331
|
-
if (
|
|
472
|
+
if (a.decode(new Uint8Array(e, 0, 4)) === Ve) {
|
|
332
473
|
try {
|
|
333
|
-
n[T.KHR_BINARY_GLTF] = new
|
|
474
|
+
n[T.KHR_BINARY_GLTF] = new ds(e);
|
|
334
475
|
} catch (u) {
|
|
335
476
|
s && s(u);
|
|
336
477
|
return;
|
|
337
478
|
}
|
|
338
|
-
|
|
479
|
+
r = JSON.parse(n[T.KHR_BINARY_GLTF].content);
|
|
339
480
|
} else
|
|
340
|
-
|
|
481
|
+
r = JSON.parse(a.decode(e));
|
|
341
482
|
else
|
|
342
|
-
|
|
343
|
-
if (
|
|
483
|
+
r = e;
|
|
484
|
+
if (r.asset === void 0 || r.asset.version[0] < 2) {
|
|
344
485
|
s && s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
|
|
345
486
|
return;
|
|
346
487
|
}
|
|
347
|
-
const l = new
|
|
488
|
+
const l = new ys(r, {
|
|
348
489
|
path: t || this.resourcePath || "",
|
|
349
490
|
crossOrigin: this.crossOrigin,
|
|
350
491
|
requestHeader: this.requestHeader,
|
|
@@ -355,51 +496,51 @@ class Zt extends De {
|
|
|
355
496
|
l.fileLoader.setRequestHeader(this.requestHeader);
|
|
356
497
|
for (let d = 0; d < this.pluginCallbacks.length; d++) {
|
|
357
498
|
const u = this.pluginCallbacks[d](l);
|
|
358
|
-
u.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),
|
|
499
|
+
u.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), c[u.name] = u, n[u.name] = !0;
|
|
359
500
|
}
|
|
360
|
-
if (
|
|
361
|
-
for (let d = 0; d <
|
|
362
|
-
const u =
|
|
501
|
+
if (r.extensionsUsed)
|
|
502
|
+
for (let d = 0; d < r.extensionsUsed.length; ++d) {
|
|
503
|
+
const u = r.extensionsUsed[d], h = r.extensionsRequired || [];
|
|
363
504
|
switch (u) {
|
|
364
505
|
case T.KHR_MATERIALS_UNLIT:
|
|
365
|
-
n[u] = new
|
|
506
|
+
n[u] = new $t();
|
|
366
507
|
break;
|
|
367
508
|
case T.KHR_DRACO_MESH_COMPRESSION:
|
|
368
|
-
n[u] = new
|
|
509
|
+
n[u] = new hs(r, this.dracoLoader);
|
|
369
510
|
break;
|
|
370
511
|
case T.KHR_TEXTURE_TRANSFORM:
|
|
371
|
-
n[u] = new
|
|
512
|
+
n[u] = new fs();
|
|
372
513
|
break;
|
|
373
514
|
case T.KHR_MESH_QUANTIZATION:
|
|
374
|
-
n[u] = new
|
|
515
|
+
n[u] = new ps();
|
|
375
516
|
break;
|
|
376
517
|
default:
|
|
377
|
-
h.indexOf(u) >= 0 &&
|
|
518
|
+
h.indexOf(u) >= 0 && c[u] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + u + '".');
|
|
378
519
|
}
|
|
379
520
|
}
|
|
380
|
-
l.setExtensions(n), l.setPlugins(
|
|
521
|
+
l.setExtensions(n), l.setPlugins(c), l.parse(i, s);
|
|
381
522
|
}
|
|
382
523
|
parseAsync(e, t) {
|
|
383
|
-
const
|
|
384
|
-
return new Promise(function(s,
|
|
385
|
-
|
|
524
|
+
const i = this;
|
|
525
|
+
return new Promise(function(s, r) {
|
|
526
|
+
i.parse(e, t, s, r);
|
|
386
527
|
});
|
|
387
528
|
}
|
|
388
529
|
}
|
|
389
|
-
function
|
|
390
|
-
let
|
|
530
|
+
function Xt() {
|
|
531
|
+
let o = {};
|
|
391
532
|
return {
|
|
392
533
|
get: function(e) {
|
|
393
|
-
return
|
|
534
|
+
return o[e];
|
|
394
535
|
},
|
|
395
536
|
add: function(e, t) {
|
|
396
|
-
|
|
537
|
+
o[e] = t;
|
|
397
538
|
},
|
|
398
539
|
remove: function(e) {
|
|
399
|
-
delete
|
|
540
|
+
delete o[e];
|
|
400
541
|
},
|
|
401
542
|
removeAll: function() {
|
|
402
|
-
|
|
543
|
+
o = {};
|
|
403
544
|
}
|
|
404
545
|
};
|
|
405
546
|
}
|
|
@@ -427,74 +568,74 @@ const T = {
|
|
|
427
568
|
EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression",
|
|
428
569
|
EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
|
|
429
570
|
};
|
|
430
|
-
class
|
|
571
|
+
class Wt {
|
|
431
572
|
constructor(e) {
|
|
432
573
|
this.parser = e, this.name = T.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
|
|
433
574
|
}
|
|
434
575
|
_markDefs() {
|
|
435
576
|
const e = this.parser, t = this.parser.json.nodes || [];
|
|
436
|
-
for (let
|
|
437
|
-
const
|
|
438
|
-
|
|
577
|
+
for (let i = 0, s = t.length; i < s; i++) {
|
|
578
|
+
const r = t[i];
|
|
579
|
+
r.extensions && r.extensions[this.name] && r.extensions[this.name].light !== void 0 && e._addNodeRef(this.cache, r.extensions[this.name].light);
|
|
439
580
|
}
|
|
440
581
|
}
|
|
441
582
|
_loadLight(e) {
|
|
442
|
-
const t = this.parser,
|
|
443
|
-
let s = t.cache.get(
|
|
583
|
+
const t = this.parser, i = "light:" + e;
|
|
584
|
+
let s = t.cache.get(i);
|
|
444
585
|
if (s) return s;
|
|
445
|
-
const
|
|
586
|
+
const r = t.json, a = ((r.extensions && r.extensions[this.name] || {}).lights || [])[e];
|
|
446
587
|
let l;
|
|
447
|
-
const d = new
|
|
448
|
-
|
|
449
|
-
const u =
|
|
450
|
-
switch (
|
|
588
|
+
const d = new P(16777215);
|
|
589
|
+
a.color !== void 0 && d.setRGB(a.color[0], a.color[1], a.color[2], S);
|
|
590
|
+
const u = a.range !== void 0 ? a.range : 0;
|
|
591
|
+
switch (a.type) {
|
|
451
592
|
case "directional":
|
|
452
|
-
l = new
|
|
593
|
+
l = new lt(d), l.target.position.set(0, 0, -1), l.add(l.target);
|
|
453
594
|
break;
|
|
454
595
|
case "point":
|
|
455
|
-
l = new
|
|
596
|
+
l = new ct(d), l.distance = u;
|
|
456
597
|
break;
|
|
457
598
|
case "spot":
|
|
458
|
-
l = new
|
|
599
|
+
l = new at(d), l.distance = u, a.spot = a.spot || {}, a.spot.innerConeAngle = a.spot.innerConeAngle !== void 0 ? a.spot.innerConeAngle : 0, a.spot.outerConeAngle = a.spot.outerConeAngle !== void 0 ? a.spot.outerConeAngle : Math.PI / 4, l.angle = a.spot.outerConeAngle, l.penumbra = 1 - a.spot.innerConeAngle / a.spot.outerConeAngle, l.target.position.set(0, 0, -1), l.add(l.target);
|
|
459
600
|
break;
|
|
460
601
|
default:
|
|
461
|
-
throw new Error("THREE.GLTFLoader: Unexpected light type: " +
|
|
602
|
+
throw new Error("THREE.GLTFLoader: Unexpected light type: " + a.type);
|
|
462
603
|
}
|
|
463
|
-
return l.position.set(0, 0, 0), l.decay = 2, C(l,
|
|
604
|
+
return l.position.set(0, 0, 0), l.decay = 2, C(l, a), a.intensity !== void 0 && (l.intensity = a.intensity), l.name = t.createUniqueName(a.name || "light_" + e), s = Promise.resolve(l), t.cache.add(i, s), s;
|
|
464
605
|
}
|
|
465
606
|
getDependency(e, t) {
|
|
466
607
|
if (e === "light")
|
|
467
608
|
return this._loadLight(t);
|
|
468
609
|
}
|
|
469
610
|
createNodeAttachment(e) {
|
|
470
|
-
const t = this,
|
|
471
|
-
return
|
|
472
|
-
return
|
|
611
|
+
const t = this, i = this.parser, r = i.json.nodes[e], c = (r.extensions && r.extensions[this.name] || {}).light;
|
|
612
|
+
return c === void 0 ? null : this._loadLight(c).then(function(a) {
|
|
613
|
+
return i._getNodeRef(t.cache, c, a);
|
|
473
614
|
});
|
|
474
615
|
}
|
|
475
616
|
}
|
|
476
|
-
class
|
|
617
|
+
class $t {
|
|
477
618
|
constructor() {
|
|
478
619
|
this.name = T.KHR_MATERIALS_UNLIT;
|
|
479
620
|
}
|
|
480
621
|
getMaterialType() {
|
|
481
622
|
return B;
|
|
482
623
|
}
|
|
483
|
-
extendParams(e, t,
|
|
624
|
+
extendParams(e, t, i) {
|
|
484
625
|
const s = [];
|
|
485
|
-
e.color = new
|
|
486
|
-
const
|
|
487
|
-
if (
|
|
488
|
-
if (Array.isArray(
|
|
489
|
-
const n =
|
|
626
|
+
e.color = new P(1, 1, 1), e.opacity = 1;
|
|
627
|
+
const r = t.pbrMetallicRoughness;
|
|
628
|
+
if (r) {
|
|
629
|
+
if (Array.isArray(r.baseColorFactor)) {
|
|
630
|
+
const n = r.baseColorFactor;
|
|
490
631
|
e.color.setRGB(n[0], n[1], n[2], S), e.opacity = n[3];
|
|
491
632
|
}
|
|
492
|
-
|
|
633
|
+
r.baseColorTexture !== void 0 && s.push(i.assignTexture(e, "map", r.baseColorTexture, N));
|
|
493
634
|
}
|
|
494
635
|
return Promise.all(s);
|
|
495
636
|
}
|
|
496
637
|
}
|
|
497
|
-
class
|
|
638
|
+
class qt {
|
|
498
639
|
constructor(e) {
|
|
499
640
|
this.parser = e, this.name = T.KHR_MATERIALS_EMISSIVE_STRENGTH;
|
|
500
641
|
}
|
|
@@ -502,220 +643,220 @@ class ns {
|
|
|
502
643
|
const s = this.parser.json.materials[e];
|
|
503
644
|
if (!s.extensions || !s.extensions[this.name])
|
|
504
645
|
return Promise.resolve();
|
|
505
|
-
const
|
|
506
|
-
return
|
|
646
|
+
const r = s.extensions[this.name].emissiveStrength;
|
|
647
|
+
return r !== void 0 && (t.emissiveIntensity = r), Promise.resolve();
|
|
507
648
|
}
|
|
508
649
|
}
|
|
509
|
-
class
|
|
650
|
+
class Yt {
|
|
510
651
|
constructor(e) {
|
|
511
652
|
this.parser = e, this.name = T.KHR_MATERIALS_CLEARCOAT;
|
|
512
653
|
}
|
|
513
654
|
getMaterialType(e) {
|
|
514
|
-
const
|
|
515
|
-
return !
|
|
655
|
+
const i = this.parser.json.materials[e];
|
|
656
|
+
return !i.extensions || !i.extensions[this.name] ? null : v;
|
|
516
657
|
}
|
|
517
658
|
extendMaterialParams(e, t) {
|
|
518
|
-
const
|
|
659
|
+
const i = this.parser, s = i.json.materials[e];
|
|
519
660
|
if (!s.extensions || !s.extensions[this.name])
|
|
520
661
|
return Promise.resolve();
|
|
521
|
-
const
|
|
522
|
-
if (n.clearcoatFactor !== void 0 && (t.clearcoat = n.clearcoatFactor), n.clearcoatTexture !== void 0 &&
|
|
523
|
-
const
|
|
524
|
-
t.clearcoatNormalScale = new
|
|
662
|
+
const r = [], n = s.extensions[this.name];
|
|
663
|
+
if (n.clearcoatFactor !== void 0 && (t.clearcoat = n.clearcoatFactor), n.clearcoatTexture !== void 0 && r.push(i.assignTexture(t, "clearcoatMap", n.clearcoatTexture)), n.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = n.clearcoatRoughnessFactor), n.clearcoatRoughnessTexture !== void 0 && r.push(i.assignTexture(t, "clearcoatRoughnessMap", n.clearcoatRoughnessTexture)), n.clearcoatNormalTexture !== void 0 && (r.push(i.assignTexture(t, "clearcoatNormalMap", n.clearcoatNormalTexture)), n.clearcoatNormalTexture.scale !== void 0)) {
|
|
664
|
+
const c = n.clearcoatNormalTexture.scale;
|
|
665
|
+
t.clearcoatNormalScale = new ke(c, c);
|
|
525
666
|
}
|
|
526
|
-
return Promise.all(
|
|
667
|
+
return Promise.all(r);
|
|
527
668
|
}
|
|
528
669
|
}
|
|
529
|
-
class
|
|
670
|
+
class Qt {
|
|
530
671
|
constructor(e) {
|
|
531
672
|
this.parser = e, this.name = T.KHR_MATERIALS_DISPERSION;
|
|
532
673
|
}
|
|
533
674
|
getMaterialType(e) {
|
|
534
|
-
const
|
|
535
|
-
return !
|
|
675
|
+
const i = this.parser.json.materials[e];
|
|
676
|
+
return !i.extensions || !i.extensions[this.name] ? null : v;
|
|
536
677
|
}
|
|
537
678
|
extendMaterialParams(e, t) {
|
|
538
679
|
const s = this.parser.json.materials[e];
|
|
539
680
|
if (!s.extensions || !s.extensions[this.name])
|
|
540
681
|
return Promise.resolve();
|
|
541
|
-
const
|
|
542
|
-
return t.dispersion =
|
|
682
|
+
const r = s.extensions[this.name];
|
|
683
|
+
return t.dispersion = r.dispersion !== void 0 ? r.dispersion : 0, Promise.resolve();
|
|
543
684
|
}
|
|
544
685
|
}
|
|
545
|
-
class
|
|
686
|
+
class Jt {
|
|
546
687
|
constructor(e) {
|
|
547
688
|
this.parser = e, this.name = T.KHR_MATERIALS_IRIDESCENCE;
|
|
548
689
|
}
|
|
549
690
|
getMaterialType(e) {
|
|
550
|
-
const
|
|
551
|
-
return !
|
|
691
|
+
const i = this.parser.json.materials[e];
|
|
692
|
+
return !i.extensions || !i.extensions[this.name] ? null : v;
|
|
552
693
|
}
|
|
553
694
|
extendMaterialParams(e, t) {
|
|
554
|
-
const
|
|
695
|
+
const i = this.parser, s = i.json.materials[e];
|
|
555
696
|
if (!s.extensions || !s.extensions[this.name])
|
|
556
697
|
return Promise.resolve();
|
|
557
|
-
const
|
|
558
|
-
return n.iridescenceFactor !== void 0 && (t.iridescence = n.iridescenceFactor), n.iridescenceTexture !== void 0 &&
|
|
698
|
+
const r = [], n = s.extensions[this.name];
|
|
699
|
+
return n.iridescenceFactor !== void 0 && (t.iridescence = n.iridescenceFactor), n.iridescenceTexture !== void 0 && r.push(i.assignTexture(t, "iridescenceMap", n.iridescenceTexture)), n.iridescenceIor !== void 0 && (t.iridescenceIOR = n.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), n.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = n.iridescenceThicknessMinimum), n.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = n.iridescenceThicknessMaximum), n.iridescenceThicknessTexture !== void 0 && r.push(i.assignTexture(t, "iridescenceThicknessMap", n.iridescenceThicknessTexture)), Promise.all(r);
|
|
559
700
|
}
|
|
560
701
|
}
|
|
561
|
-
class
|
|
702
|
+
class Zt {
|
|
562
703
|
constructor(e) {
|
|
563
704
|
this.parser = e, this.name = T.KHR_MATERIALS_SHEEN;
|
|
564
705
|
}
|
|
565
706
|
getMaterialType(e) {
|
|
566
|
-
const
|
|
567
|
-
return !
|
|
707
|
+
const i = this.parser.json.materials[e];
|
|
708
|
+
return !i.extensions || !i.extensions[this.name] ? null : v;
|
|
568
709
|
}
|
|
569
710
|
extendMaterialParams(e, t) {
|
|
570
|
-
const
|
|
711
|
+
const i = this.parser, s = i.json.materials[e];
|
|
571
712
|
if (!s.extensions || !s.extensions[this.name])
|
|
572
713
|
return Promise.resolve();
|
|
573
|
-
const
|
|
574
|
-
t.sheenColor = new
|
|
714
|
+
const r = [];
|
|
715
|
+
t.sheenColor = new P(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1;
|
|
575
716
|
const n = s.extensions[this.name];
|
|
576
717
|
if (n.sheenColorFactor !== void 0) {
|
|
577
|
-
const
|
|
578
|
-
t.sheenColor.setRGB(
|
|
718
|
+
const c = n.sheenColorFactor;
|
|
719
|
+
t.sheenColor.setRGB(c[0], c[1], c[2], S);
|
|
579
720
|
}
|
|
580
|
-
return n.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = n.sheenRoughnessFactor), n.sheenColorTexture !== void 0 &&
|
|
721
|
+
return n.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = n.sheenRoughnessFactor), n.sheenColorTexture !== void 0 && r.push(i.assignTexture(t, "sheenColorMap", n.sheenColorTexture, N)), n.sheenRoughnessTexture !== void 0 && r.push(i.assignTexture(t, "sheenRoughnessMap", n.sheenRoughnessTexture)), Promise.all(r);
|
|
581
722
|
}
|
|
582
723
|
}
|
|
583
|
-
class
|
|
724
|
+
class es {
|
|
584
725
|
constructor(e) {
|
|
585
726
|
this.parser = e, this.name = T.KHR_MATERIALS_TRANSMISSION;
|
|
586
727
|
}
|
|
587
728
|
getMaterialType(e) {
|
|
588
|
-
const
|
|
589
|
-
return !
|
|
729
|
+
const i = this.parser.json.materials[e];
|
|
730
|
+
return !i.extensions || !i.extensions[this.name] ? null : v;
|
|
590
731
|
}
|
|
591
732
|
extendMaterialParams(e, t) {
|
|
592
|
-
const
|
|
733
|
+
const i = this.parser, s = i.json.materials[e];
|
|
593
734
|
if (!s.extensions || !s.extensions[this.name])
|
|
594
735
|
return Promise.resolve();
|
|
595
|
-
const
|
|
596
|
-
return n.transmissionFactor !== void 0 && (t.transmission = n.transmissionFactor), n.transmissionTexture !== void 0 &&
|
|
736
|
+
const r = [], n = s.extensions[this.name];
|
|
737
|
+
return n.transmissionFactor !== void 0 && (t.transmission = n.transmissionFactor), n.transmissionTexture !== void 0 && r.push(i.assignTexture(t, "transmissionMap", n.transmissionTexture)), Promise.all(r);
|
|
597
738
|
}
|
|
598
739
|
}
|
|
599
|
-
class
|
|
740
|
+
class ts {
|
|
600
741
|
constructor(e) {
|
|
601
742
|
this.parser = e, this.name = T.KHR_MATERIALS_VOLUME;
|
|
602
743
|
}
|
|
603
744
|
getMaterialType(e) {
|
|
604
|
-
const
|
|
605
|
-
return !
|
|
745
|
+
const i = this.parser.json.materials[e];
|
|
746
|
+
return !i.extensions || !i.extensions[this.name] ? null : v;
|
|
606
747
|
}
|
|
607
748
|
extendMaterialParams(e, t) {
|
|
608
|
-
const
|
|
749
|
+
const i = this.parser, s = i.json.materials[e];
|
|
609
750
|
if (!s.extensions || !s.extensions[this.name])
|
|
610
751
|
return Promise.resolve();
|
|
611
|
-
const
|
|
612
|
-
t.thickness = n.thicknessFactor !== void 0 ? n.thicknessFactor : 0, n.thicknessTexture !== void 0 &&
|
|
613
|
-
const
|
|
614
|
-
return t.attenuationColor = new
|
|
752
|
+
const r = [], n = s.extensions[this.name];
|
|
753
|
+
t.thickness = n.thicknessFactor !== void 0 ? n.thicknessFactor : 0, n.thicknessTexture !== void 0 && r.push(i.assignTexture(t, "thicknessMap", n.thicknessTexture)), t.attenuationDistance = n.attenuationDistance || 1 / 0;
|
|
754
|
+
const c = n.attenuationColor || [1, 1, 1];
|
|
755
|
+
return t.attenuationColor = new P().setRGB(c[0], c[1], c[2], S), Promise.all(r);
|
|
615
756
|
}
|
|
616
757
|
}
|
|
617
|
-
class
|
|
758
|
+
class ss {
|
|
618
759
|
constructor(e) {
|
|
619
760
|
this.parser = e, this.name = T.KHR_MATERIALS_IOR;
|
|
620
761
|
}
|
|
621
762
|
getMaterialType(e) {
|
|
622
|
-
const
|
|
623
|
-
return !
|
|
763
|
+
const i = this.parser.json.materials[e];
|
|
764
|
+
return !i.extensions || !i.extensions[this.name] ? null : v;
|
|
624
765
|
}
|
|
625
766
|
extendMaterialParams(e, t) {
|
|
626
767
|
const s = this.parser.json.materials[e];
|
|
627
768
|
if (!s.extensions || !s.extensions[this.name])
|
|
628
769
|
return Promise.resolve();
|
|
629
|
-
const
|
|
630
|
-
return t.ior =
|
|
770
|
+
const r = s.extensions[this.name];
|
|
771
|
+
return t.ior = r.ior !== void 0 ? r.ior : 1.5, Promise.resolve();
|
|
631
772
|
}
|
|
632
773
|
}
|
|
633
|
-
class
|
|
774
|
+
class ns {
|
|
634
775
|
constructor(e) {
|
|
635
776
|
this.parser = e, this.name = T.KHR_MATERIALS_SPECULAR;
|
|
636
777
|
}
|
|
637
778
|
getMaterialType(e) {
|
|
638
|
-
const
|
|
639
|
-
return !
|
|
779
|
+
const i = this.parser.json.materials[e];
|
|
780
|
+
return !i.extensions || !i.extensions[this.name] ? null : v;
|
|
640
781
|
}
|
|
641
782
|
extendMaterialParams(e, t) {
|
|
642
|
-
const
|
|
783
|
+
const i = this.parser, s = i.json.materials[e];
|
|
643
784
|
if (!s.extensions || !s.extensions[this.name])
|
|
644
785
|
return Promise.resolve();
|
|
645
|
-
const
|
|
646
|
-
t.specularIntensity = n.specularFactor !== void 0 ? n.specularFactor : 1, n.specularTexture !== void 0 &&
|
|
647
|
-
const
|
|
648
|
-
return t.specularColor = new
|
|
786
|
+
const r = [], n = s.extensions[this.name];
|
|
787
|
+
t.specularIntensity = n.specularFactor !== void 0 ? n.specularFactor : 1, n.specularTexture !== void 0 && r.push(i.assignTexture(t, "specularIntensityMap", n.specularTexture));
|
|
788
|
+
const c = n.specularColorFactor || [1, 1, 1];
|
|
789
|
+
return t.specularColor = new P().setRGB(c[0], c[1], c[2], S), n.specularColorTexture !== void 0 && r.push(i.assignTexture(t, "specularColorMap", n.specularColorTexture, N)), Promise.all(r);
|
|
649
790
|
}
|
|
650
791
|
}
|
|
651
|
-
class
|
|
792
|
+
class rs {
|
|
652
793
|
constructor(e) {
|
|
653
794
|
this.parser = e, this.name = T.EXT_MATERIALS_BUMP;
|
|
654
795
|
}
|
|
655
796
|
getMaterialType(e) {
|
|
656
|
-
const
|
|
657
|
-
return !
|
|
797
|
+
const i = this.parser.json.materials[e];
|
|
798
|
+
return !i.extensions || !i.extensions[this.name] ? null : v;
|
|
658
799
|
}
|
|
659
800
|
extendMaterialParams(e, t) {
|
|
660
|
-
const
|
|
801
|
+
const i = this.parser, s = i.json.materials[e];
|
|
661
802
|
if (!s.extensions || !s.extensions[this.name])
|
|
662
803
|
return Promise.resolve();
|
|
663
|
-
const
|
|
664
|
-
return t.bumpScale = n.bumpFactor !== void 0 ? n.bumpFactor : 1, n.bumpTexture !== void 0 &&
|
|
804
|
+
const r = [], n = s.extensions[this.name];
|
|
805
|
+
return t.bumpScale = n.bumpFactor !== void 0 ? n.bumpFactor : 1, n.bumpTexture !== void 0 && r.push(i.assignTexture(t, "bumpMap", n.bumpTexture)), Promise.all(r);
|
|
665
806
|
}
|
|
666
807
|
}
|
|
667
|
-
class
|
|
808
|
+
class is {
|
|
668
809
|
constructor(e) {
|
|
669
810
|
this.parser = e, this.name = T.KHR_MATERIALS_ANISOTROPY;
|
|
670
811
|
}
|
|
671
812
|
getMaterialType(e) {
|
|
672
|
-
const
|
|
673
|
-
return !
|
|
813
|
+
const i = this.parser.json.materials[e];
|
|
814
|
+
return !i.extensions || !i.extensions[this.name] ? null : v;
|
|
674
815
|
}
|
|
675
816
|
extendMaterialParams(e, t) {
|
|
676
|
-
const
|
|
817
|
+
const i = this.parser, s = i.json.materials[e];
|
|
677
818
|
if (!s.extensions || !s.extensions[this.name])
|
|
678
819
|
return Promise.resolve();
|
|
679
|
-
const
|
|
680
|
-
return n.anisotropyStrength !== void 0 && (t.anisotropy = n.anisotropyStrength), n.anisotropyRotation !== void 0 && (t.anisotropyRotation = n.anisotropyRotation), n.anisotropyTexture !== void 0 &&
|
|
820
|
+
const r = [], n = s.extensions[this.name];
|
|
821
|
+
return n.anisotropyStrength !== void 0 && (t.anisotropy = n.anisotropyStrength), n.anisotropyRotation !== void 0 && (t.anisotropyRotation = n.anisotropyRotation), n.anisotropyTexture !== void 0 && r.push(i.assignTexture(t, "anisotropyMap", n.anisotropyTexture)), Promise.all(r);
|
|
681
822
|
}
|
|
682
823
|
}
|
|
683
|
-
class
|
|
824
|
+
class os {
|
|
684
825
|
constructor(e) {
|
|
685
826
|
this.parser = e, this.name = T.KHR_TEXTURE_BASISU;
|
|
686
827
|
}
|
|
687
828
|
loadTexture(e) {
|
|
688
|
-
const t = this.parser,
|
|
829
|
+
const t = this.parser, i = t.json, s = i.textures[e];
|
|
689
830
|
if (!s.extensions || !s.extensions[this.name])
|
|
690
831
|
return null;
|
|
691
|
-
const
|
|
832
|
+
const r = s.extensions[this.name], n = t.options.ktx2Loader;
|
|
692
833
|
if (!n) {
|
|
693
|
-
if (
|
|
834
|
+
if (i.extensionsRequired && i.extensionsRequired.indexOf(this.name) >= 0)
|
|
694
835
|
throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");
|
|
695
836
|
return null;
|
|
696
837
|
}
|
|
697
|
-
return t.loadTextureImage(e,
|
|
838
|
+
return t.loadTextureImage(e, r.source, n);
|
|
698
839
|
}
|
|
699
840
|
}
|
|
700
|
-
class
|
|
841
|
+
class as {
|
|
701
842
|
constructor(e) {
|
|
702
843
|
this.parser = e, this.name = T.EXT_TEXTURE_WEBP, this.isSupported = null;
|
|
703
844
|
}
|
|
704
845
|
loadTexture(e) {
|
|
705
|
-
const t = this.name,
|
|
706
|
-
if (!
|
|
846
|
+
const t = this.name, i = this.parser, s = i.json, r = s.textures[e];
|
|
847
|
+
if (!r.extensions || !r.extensions[t])
|
|
707
848
|
return null;
|
|
708
|
-
const n =
|
|
709
|
-
let
|
|
710
|
-
if (
|
|
711
|
-
const l =
|
|
712
|
-
l !== null && (
|
|
849
|
+
const n = r.extensions[t], c = s.images[n.source];
|
|
850
|
+
let a = i.textureLoader;
|
|
851
|
+
if (c.uri) {
|
|
852
|
+
const l = i.options.manager.getHandler(c.uri);
|
|
853
|
+
l !== null && (a = l);
|
|
713
854
|
}
|
|
714
855
|
return this.detectSupport().then(function(l) {
|
|
715
|
-
if (l) return
|
|
856
|
+
if (l) return i.loadTextureImage(e, n.source, a);
|
|
716
857
|
if (s.extensionsRequired && s.extensionsRequired.indexOf(t) >= 0)
|
|
717
858
|
throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");
|
|
718
|
-
return
|
|
859
|
+
return i.loadTexture(e);
|
|
719
860
|
});
|
|
720
861
|
}
|
|
721
862
|
detectSupport() {
|
|
@@ -727,25 +868,25 @@ class ms {
|
|
|
727
868
|
})), this.isSupported;
|
|
728
869
|
}
|
|
729
870
|
}
|
|
730
|
-
class
|
|
871
|
+
class cs {
|
|
731
872
|
constructor(e) {
|
|
732
873
|
this.parser = e, this.name = T.EXT_TEXTURE_AVIF, this.isSupported = null;
|
|
733
874
|
}
|
|
734
875
|
loadTexture(e) {
|
|
735
|
-
const t = this.name,
|
|
736
|
-
if (!
|
|
876
|
+
const t = this.name, i = this.parser, s = i.json, r = s.textures[e];
|
|
877
|
+
if (!r.extensions || !r.extensions[t])
|
|
737
878
|
return null;
|
|
738
|
-
const n =
|
|
739
|
-
let
|
|
740
|
-
if (
|
|
741
|
-
const l =
|
|
742
|
-
l !== null && (
|
|
879
|
+
const n = r.extensions[t], c = s.images[n.source];
|
|
880
|
+
let a = i.textureLoader;
|
|
881
|
+
if (c.uri) {
|
|
882
|
+
const l = i.options.manager.getHandler(c.uri);
|
|
883
|
+
l !== null && (a = l);
|
|
743
884
|
}
|
|
744
885
|
return this.detectSupport().then(function(l) {
|
|
745
|
-
if (l) return
|
|
886
|
+
if (l) return i.loadTextureImage(e, n.source, a);
|
|
746
887
|
if (s.extensionsRequired && s.extensionsRequired.indexOf(t) >= 0)
|
|
747
888
|
throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");
|
|
748
|
-
return
|
|
889
|
+
return i.loadTexture(e);
|
|
749
890
|
});
|
|
750
891
|
}
|
|
751
892
|
detectSupport() {
|
|
@@ -757,21 +898,21 @@ class gs {
|
|
|
757
898
|
})), this.isSupported;
|
|
758
899
|
}
|
|
759
900
|
}
|
|
760
|
-
class
|
|
901
|
+
class ls {
|
|
761
902
|
constructor(e) {
|
|
762
903
|
this.name = T.EXT_MESHOPT_COMPRESSION, this.parser = e;
|
|
763
904
|
}
|
|
764
905
|
loadBufferView(e) {
|
|
765
|
-
const t = this.parser.json,
|
|
766
|
-
if (
|
|
767
|
-
const s =
|
|
906
|
+
const t = this.parser.json, i = t.bufferViews[e];
|
|
907
|
+
if (i.extensions && i.extensions[this.name]) {
|
|
908
|
+
const s = i.extensions[this.name], r = this.parser.getDependency("buffer", s.buffer), n = this.parser.options.meshoptDecoder;
|
|
768
909
|
if (!n || !n.supported) {
|
|
769
910
|
if (t.extensionsRequired && t.extensionsRequired.indexOf(this.name) >= 0)
|
|
770
911
|
throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");
|
|
771
912
|
return null;
|
|
772
913
|
}
|
|
773
|
-
return
|
|
774
|
-
const
|
|
914
|
+
return r.then(function(c) {
|
|
915
|
+
const a = s.byteOffset || 0, l = s.byteLength || 0, d = s.count, u = s.byteStride, h = new Uint8Array(c, a, l);
|
|
775
916
|
return n.decodeGltfBufferAsync ? n.decodeGltfBufferAsync(d, u, h, s.mode, s.filter).then(function(f) {
|
|
776
917
|
return f.buffer;
|
|
777
918
|
}) : n.ready.then(function() {
|
|
@@ -783,103 +924,103 @@ class As {
|
|
|
783
924
|
return null;
|
|
784
925
|
}
|
|
785
926
|
}
|
|
786
|
-
class
|
|
927
|
+
class us {
|
|
787
928
|
constructor(e) {
|
|
788
929
|
this.name = T.EXT_MESH_GPU_INSTANCING, this.parser = e;
|
|
789
930
|
}
|
|
790
931
|
createNodeMesh(e) {
|
|
791
|
-
const t = this.parser.json,
|
|
792
|
-
if (!
|
|
932
|
+
const t = this.parser.json, i = t.nodes[e];
|
|
933
|
+
if (!i.extensions || !i.extensions[this.name] || i.mesh === void 0)
|
|
793
934
|
return null;
|
|
794
|
-
const s = t.meshes[
|
|
935
|
+
const s = t.meshes[i.mesh];
|
|
795
936
|
for (const l of s.primitives)
|
|
796
|
-
if (l.mode !==
|
|
937
|
+
if (l.mode !== x.TRIANGLES && l.mode !== x.TRIANGLE_STRIP && l.mode !== x.TRIANGLE_FAN && l.mode !== void 0)
|
|
797
938
|
return null;
|
|
798
|
-
const n =
|
|
939
|
+
const n = i.extensions[this.name].attributes, c = [], a = {};
|
|
799
940
|
for (const l in n)
|
|
800
|
-
|
|
801
|
-
return
|
|
941
|
+
c.push(this.parser.getDependency("accessor", n[l]).then((d) => (a[l] = d, a[l])));
|
|
942
|
+
return c.length < 1 ? null : (c.push(this.parser.createNodeMesh(e)), Promise.all(c).then((l) => {
|
|
802
943
|
const d = l.pop(), u = d.isGroup ? d.children : [d], h = l[0].count, f = [];
|
|
803
944
|
for (const p of u) {
|
|
804
|
-
const A = new
|
|
805
|
-
for (let
|
|
806
|
-
|
|
807
|
-
for (const
|
|
808
|
-
if (
|
|
809
|
-
const b =
|
|
810
|
-
w.instanceColor = new
|
|
811
|
-
} else
|
|
812
|
-
|
|
945
|
+
const A = new $(), m = new F(), g = new Fe(), R = new F(1, 1, 1), w = new ut(p.geometry, p.material, h);
|
|
946
|
+
for (let E = 0; E < h; E++)
|
|
947
|
+
a.TRANSLATION && m.fromBufferAttribute(a.TRANSLATION, E), a.ROTATION && g.fromBufferAttribute(a.ROTATION, E), a.SCALE && R.fromBufferAttribute(a.SCALE, E), w.setMatrixAt(E, A.compose(m, g, R));
|
|
948
|
+
for (const E in a)
|
|
949
|
+
if (E === "_COLOR_0") {
|
|
950
|
+
const b = a[E];
|
|
951
|
+
w.instanceColor = new dt(b.array, b.itemSize, b.normalized);
|
|
952
|
+
} else E !== "TRANSLATION" && E !== "ROTATION" && E !== "SCALE" && p.geometry.setAttribute(E, a[E]);
|
|
953
|
+
He.prototype.copy.call(w, p), this.parser.assignFinalMaterial(w), f.push(w);
|
|
813
954
|
}
|
|
814
955
|
return d.isGroup ? (d.clear(), d.add(...f), d) : f[0];
|
|
815
956
|
}));
|
|
816
957
|
}
|
|
817
958
|
}
|
|
818
|
-
const
|
|
819
|
-
class
|
|
959
|
+
const Ve = "glTF", G = 12, Le = { JSON: 1313821514, BIN: 5130562 };
|
|
960
|
+
class ds {
|
|
820
961
|
constructor(e) {
|
|
821
962
|
this.name = T.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
822
|
-
const t = new DataView(e, 0, G),
|
|
963
|
+
const t = new DataView(e, 0, G), i = new TextDecoder();
|
|
823
964
|
if (this.header = {
|
|
824
|
-
magic:
|
|
965
|
+
magic: i.decode(new Uint8Array(e.slice(0, 4))),
|
|
825
966
|
version: t.getUint32(4, !0),
|
|
826
967
|
length: t.getUint32(8, !0)
|
|
827
|
-
}, this.header.magic !==
|
|
968
|
+
}, this.header.magic !== Ve)
|
|
828
969
|
throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
|
|
829
970
|
if (this.header.version < 2)
|
|
830
971
|
throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
|
|
831
|
-
const s = this.header.length - G,
|
|
972
|
+
const s = this.header.length - G, r = new DataView(e, G);
|
|
832
973
|
let n = 0;
|
|
833
974
|
for (; n < s; ) {
|
|
834
|
-
const
|
|
975
|
+
const c = r.getUint32(n, !0);
|
|
835
976
|
n += 4;
|
|
836
|
-
const
|
|
837
|
-
if (n += 4,
|
|
838
|
-
const l = new Uint8Array(e, G + n,
|
|
839
|
-
this.content =
|
|
840
|
-
} else if (
|
|
977
|
+
const a = r.getUint32(n, !0);
|
|
978
|
+
if (n += 4, a === Le.JSON) {
|
|
979
|
+
const l = new Uint8Array(e, G + n, c);
|
|
980
|
+
this.content = i.decode(l);
|
|
981
|
+
} else if (a === Le.BIN) {
|
|
841
982
|
const l = G + n;
|
|
842
|
-
this.body = e.slice(l, l +
|
|
983
|
+
this.body = e.slice(l, l + c);
|
|
843
984
|
}
|
|
844
|
-
n +=
|
|
985
|
+
n += c;
|
|
845
986
|
}
|
|
846
987
|
if (this.content === null)
|
|
847
988
|
throw new Error("THREE.GLTFLoader: JSON content not found.");
|
|
848
989
|
}
|
|
849
990
|
}
|
|
850
|
-
class
|
|
991
|
+
class hs {
|
|
851
992
|
constructor(e, t) {
|
|
852
993
|
if (!t)
|
|
853
994
|
throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
|
|
854
995
|
this.name = T.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t, this.dracoLoader.preload();
|
|
855
996
|
}
|
|
856
997
|
decodePrimitive(e, t) {
|
|
857
|
-
const
|
|
998
|
+
const i = this.json, s = this.dracoLoader, r = e.extensions[this.name].bufferView, n = e.extensions[this.name].attributes, c = {}, a = {}, l = {};
|
|
858
999
|
for (const d in n) {
|
|
859
|
-
const u =
|
|
860
|
-
|
|
1000
|
+
const u = fe[d] || d.toLowerCase();
|
|
1001
|
+
c[u] = n[d];
|
|
861
1002
|
}
|
|
862
1003
|
for (const d in e.attributes) {
|
|
863
|
-
const u =
|
|
1004
|
+
const u = fe[d] || d.toLowerCase();
|
|
864
1005
|
if (n[d] !== void 0) {
|
|
865
|
-
const h =
|
|
866
|
-
l[u] = f.name,
|
|
1006
|
+
const h = i.accessors[e.attributes[d]], f = H[h.componentType];
|
|
1007
|
+
l[u] = f.name, a[u] = h.normalized === !0;
|
|
867
1008
|
}
|
|
868
1009
|
}
|
|
869
|
-
return t.getDependency("bufferView",
|
|
1010
|
+
return t.getDependency("bufferView", r).then(function(d) {
|
|
870
1011
|
return new Promise(function(u, h) {
|
|
871
1012
|
s.decodeDracoFile(d, function(f) {
|
|
872
1013
|
for (const p in f.attributes) {
|
|
873
|
-
const A = f.attributes[p], m =
|
|
1014
|
+
const A = f.attributes[p], m = a[p];
|
|
874
1015
|
m !== void 0 && (A.normalized = m);
|
|
875
1016
|
}
|
|
876
1017
|
u(f);
|
|
877
|
-
},
|
|
1018
|
+
}, c, l, S, h);
|
|
878
1019
|
});
|
|
879
1020
|
});
|
|
880
1021
|
}
|
|
881
1022
|
}
|
|
882
|
-
class
|
|
1023
|
+
class fs {
|
|
883
1024
|
constructor() {
|
|
884
1025
|
this.name = T.KHR_TEXTURE_TRANSFORM;
|
|
885
1026
|
}
|
|
@@ -887,38 +1028,38 @@ class Es {
|
|
|
887
1028
|
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;
|
|
888
1029
|
}
|
|
889
1030
|
}
|
|
890
|
-
class
|
|
1031
|
+
class ps {
|
|
891
1032
|
constructor() {
|
|
892
1033
|
this.name = T.KHR_MESH_QUANTIZATION;
|
|
893
1034
|
}
|
|
894
1035
|
}
|
|
895
|
-
class
|
|
896
|
-
constructor(e, t,
|
|
897
|
-
super(e, t,
|
|
1036
|
+
class ze extends Gt {
|
|
1037
|
+
constructor(e, t, i, s) {
|
|
1038
|
+
super(e, t, i, s);
|
|
898
1039
|
}
|
|
899
1040
|
copySampleValue_(e) {
|
|
900
|
-
const t = this.resultBuffer,
|
|
1041
|
+
const t = this.resultBuffer, i = this.sampleValues, s = this.valueSize, r = e * s * 3 + s;
|
|
901
1042
|
for (let n = 0; n !== s; n++)
|
|
902
|
-
t[n] = r
|
|
1043
|
+
t[n] = i[r + n];
|
|
903
1044
|
return t;
|
|
904
1045
|
}
|
|
905
|
-
interpolate_(e, t,
|
|
906
|
-
const
|
|
907
|
-
for (let
|
|
908
|
-
const b = n[A +
|
|
909
|
-
|
|
1046
|
+
interpolate_(e, t, i, s) {
|
|
1047
|
+
const r = this.resultBuffer, n = this.sampleValues, c = this.valueSize, a = c * 2, l = c * 3, d = s - t, u = (i - t) / d, h = u * u, f = h * u, p = e * l, A = p - l, m = -2 * f + 3 * h, g = f - h, R = 1 - m, w = g - h + u;
|
|
1048
|
+
for (let E = 0; E !== c; E++) {
|
|
1049
|
+
const b = n[A + E + c], M = n[A + E + a] * d, y = n[p + E + c], U = n[p + E] * d;
|
|
1050
|
+
r[E] = R * b + w * M + m * y + g * U;
|
|
910
1051
|
}
|
|
911
|
-
return
|
|
1052
|
+
return r;
|
|
912
1053
|
}
|
|
913
1054
|
}
|
|
914
|
-
const
|
|
915
|
-
class
|
|
916
|
-
interpolate_(e, t,
|
|
917
|
-
const
|
|
918
|
-
return
|
|
1055
|
+
const ms = new Fe();
|
|
1056
|
+
class gs extends ze {
|
|
1057
|
+
interpolate_(e, t, i, s) {
|
|
1058
|
+
const r = super.interpolate_(e, t, i, s);
|
|
1059
|
+
return ms.fromArray(r).normalize().toArray(r), r;
|
|
919
1060
|
}
|
|
920
1061
|
}
|
|
921
|
-
const
|
|
1062
|
+
const x = {
|
|
922
1063
|
FLOAT: 5126,
|
|
923
1064
|
//FLOAT_MAT2: 35674,
|
|
924
1065
|
FLOAT_MAT3: 35675,
|
|
@@ -946,15 +1087,15 @@ const L = {
|
|
|
946
1087
|
5125: Uint32Array,
|
|
947
1088
|
5126: Float32Array
|
|
948
1089
|
}, be = {
|
|
949
|
-
9728:
|
|
1090
|
+
9728: Be,
|
|
950
1091
|
9729: de,
|
|
951
|
-
9984:
|
|
952
|
-
9985:
|
|
953
|
-
9986:
|
|
954
|
-
9987:
|
|
1092
|
+
9984: It,
|
|
1093
|
+
9985: Ot,
|
|
1094
|
+
9986: Nt,
|
|
1095
|
+
9987: Ge
|
|
955
1096
|
}, Se = {
|
|
956
1097
|
33071: Pt,
|
|
957
|
-
33648:
|
|
1098
|
+
33648: Dt,
|
|
958
1099
|
10497: he
|
|
959
1100
|
}, re = {
|
|
960
1101
|
SCALAR: 1,
|
|
@@ -964,7 +1105,7 @@ const L = {
|
|
|
964
1105
|
MAT2: 4,
|
|
965
1106
|
MAT3: 9,
|
|
966
1107
|
MAT4: 16
|
|
967
|
-
},
|
|
1108
|
+
}, fe = {
|
|
968
1109
|
POSITION: "position",
|
|
969
1110
|
NORMAL: "normal",
|
|
970
1111
|
TANGENT: "tangent",
|
|
@@ -980,98 +1121,98 @@ const L = {
|
|
|
980
1121
|
translation: "position",
|
|
981
1122
|
rotation: "quaternion",
|
|
982
1123
|
weights: "morphTargetInfluences"
|
|
983
|
-
},
|
|
1124
|
+
}, As = {
|
|
984
1125
|
CUBICSPLINE: void 0,
|
|
985
1126
|
// We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
|
|
986
1127
|
// keyframe track will be initialized with a default interpolation type, then modified.
|
|
987
1128
|
LINEAR: Ke,
|
|
988
|
-
STEP:
|
|
1129
|
+
STEP: kt
|
|
989
1130
|
}, ie = {
|
|
990
1131
|
OPAQUE: "OPAQUE",
|
|
991
1132
|
MASK: "MASK",
|
|
992
1133
|
BLEND: "BLEND"
|
|
993
1134
|
};
|
|
994
|
-
function
|
|
995
|
-
return
|
|
1135
|
+
function Ts(o) {
|
|
1136
|
+
return o.DefaultMaterial === void 0 && (o.DefaultMaterial = new je({
|
|
996
1137
|
color: 16777215,
|
|
997
1138
|
emissive: 0,
|
|
998
1139
|
metalness: 1,
|
|
999
1140
|
roughness: 1,
|
|
1000
1141
|
transparent: !1,
|
|
1001
1142
|
depthTest: !0,
|
|
1002
|
-
side:
|
|
1003
|
-
})),
|
|
1143
|
+
side: Ft
|
|
1144
|
+
})), o.DefaultMaterial;
|
|
1004
1145
|
}
|
|
1005
|
-
function
|
|
1006
|
-
for (const
|
|
1007
|
-
|
|
1146
|
+
function D(o, e, t) {
|
|
1147
|
+
for (const i in t.extensions)
|
|
1148
|
+
o[i] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[i] = t.extensions[i]);
|
|
1008
1149
|
}
|
|
1009
|
-
function C(
|
|
1010
|
-
e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(
|
|
1150
|
+
function C(o, e) {
|
|
1151
|
+
e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(o.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras));
|
|
1011
1152
|
}
|
|
1012
|
-
function
|
|
1013
|
-
let
|
|
1153
|
+
function _s(o, e, t) {
|
|
1154
|
+
let i = !1, s = !1, r = !1;
|
|
1014
1155
|
for (let l = 0, d = e.length; l < d; l++) {
|
|
1015
1156
|
const u = e[l];
|
|
1016
|
-
if (u.POSITION !== void 0 && (
|
|
1157
|
+
if (u.POSITION !== void 0 && (i = !0), u.NORMAL !== void 0 && (s = !0), u.COLOR_0 !== void 0 && (r = !0), i && s && r) break;
|
|
1017
1158
|
}
|
|
1018
|
-
if (!
|
|
1019
|
-
const n = [],
|
|
1159
|
+
if (!i && !s && !r) return Promise.resolve(o);
|
|
1160
|
+
const n = [], c = [], a = [];
|
|
1020
1161
|
for (let l = 0, d = e.length; l < d; l++) {
|
|
1021
1162
|
const u = e[l];
|
|
1022
|
-
if (
|
|
1023
|
-
const h = u.POSITION !== void 0 ? t.getDependency("accessor", u.POSITION) :
|
|
1163
|
+
if (i) {
|
|
1164
|
+
const h = u.POSITION !== void 0 ? t.getDependency("accessor", u.POSITION) : o.attributes.position;
|
|
1024
1165
|
n.push(h);
|
|
1025
1166
|
}
|
|
1026
1167
|
if (s) {
|
|
1027
|
-
const h = u.NORMAL !== void 0 ? t.getDependency("accessor", u.NORMAL) :
|
|
1028
|
-
|
|
1168
|
+
const h = u.NORMAL !== void 0 ? t.getDependency("accessor", u.NORMAL) : o.attributes.normal;
|
|
1169
|
+
c.push(h);
|
|
1029
1170
|
}
|
|
1030
|
-
if (
|
|
1031
|
-
const h = u.COLOR_0 !== void 0 ? t.getDependency("accessor", u.COLOR_0) :
|
|
1032
|
-
|
|
1171
|
+
if (r) {
|
|
1172
|
+
const h = u.COLOR_0 !== void 0 ? t.getDependency("accessor", u.COLOR_0) : o.attributes.color;
|
|
1173
|
+
a.push(h);
|
|
1033
1174
|
}
|
|
1034
1175
|
}
|
|
1035
1176
|
return Promise.all([
|
|
1036
1177
|
Promise.all(n),
|
|
1037
|
-
Promise.all(
|
|
1038
|
-
Promise.all(
|
|
1178
|
+
Promise.all(c),
|
|
1179
|
+
Promise.all(a)
|
|
1039
1180
|
]).then(function(l) {
|
|
1040
1181
|
const d = l[0], u = l[1], h = l[2];
|
|
1041
|
-
return
|
|
1182
|
+
return i && (o.morphAttributes.position = d), s && (o.morphAttributes.normal = u), r && (o.morphAttributes.color = h), o.morphTargetsRelative = !0, o;
|
|
1042
1183
|
});
|
|
1043
1184
|
}
|
|
1044
|
-
function
|
|
1045
|
-
if (
|
|
1046
|
-
for (let t = 0,
|
|
1047
|
-
|
|
1185
|
+
function Rs(o, e) {
|
|
1186
|
+
if (o.updateMorphTargets(), e.weights !== void 0)
|
|
1187
|
+
for (let t = 0, i = e.weights.length; t < i; t++)
|
|
1188
|
+
o.morphTargetInfluences[t] = e.weights[t];
|
|
1048
1189
|
if (e.extras && Array.isArray(e.extras.targetNames)) {
|
|
1049
1190
|
const t = e.extras.targetNames;
|
|
1050
|
-
if (
|
|
1051
|
-
|
|
1052
|
-
for (let
|
|
1053
|
-
|
|
1191
|
+
if (o.morphTargetInfluences.length === t.length) {
|
|
1192
|
+
o.morphTargetDictionary = {};
|
|
1193
|
+
for (let i = 0, s = t.length; i < s; i++)
|
|
1194
|
+
o.morphTargetDictionary[t[i]] = i;
|
|
1054
1195
|
} else
|
|
1055
1196
|
console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
|
|
1056
1197
|
}
|
|
1057
1198
|
}
|
|
1058
|
-
function
|
|
1199
|
+
function Es(o) {
|
|
1059
1200
|
let e;
|
|
1060
|
-
const t =
|
|
1061
|
-
if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + oe(t.attributes) : e =
|
|
1062
|
-
for (let
|
|
1063
|
-
e += ":" + oe(
|
|
1201
|
+
const t = o.extensions && o.extensions[T.KHR_DRACO_MESH_COMPRESSION];
|
|
1202
|
+
if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + oe(t.attributes) : e = o.indices + ":" + oe(o.attributes) + ":" + o.mode, o.targets !== void 0)
|
|
1203
|
+
for (let i = 0, s = o.targets.length; i < s; i++)
|
|
1204
|
+
e += ":" + oe(o.targets[i]);
|
|
1064
1205
|
return e;
|
|
1065
1206
|
}
|
|
1066
|
-
function oe(
|
|
1207
|
+
function oe(o) {
|
|
1067
1208
|
let e = "";
|
|
1068
|
-
const t = Object.keys(
|
|
1069
|
-
for (let
|
|
1070
|
-
e += t[
|
|
1209
|
+
const t = Object.keys(o).sort();
|
|
1210
|
+
for (let i = 0, s = t.length; i < s; i++)
|
|
1211
|
+
e += t[i] + ":" + o[t[i]] + ";";
|
|
1071
1212
|
return e;
|
|
1072
1213
|
}
|
|
1073
|
-
function
|
|
1074
|
-
switch (
|
|
1214
|
+
function pe(o) {
|
|
1215
|
+
switch (o) {
|
|
1075
1216
|
case Int8Array:
|
|
1076
1217
|
return 1 / 127;
|
|
1077
1218
|
case Uint8Array:
|
|
@@ -1084,21 +1225,21 @@ function ge(c) {
|
|
|
1084
1225
|
throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
|
|
1085
1226
|
}
|
|
1086
1227
|
}
|
|
1087
|
-
function
|
|
1088
|
-
return
|
|
1228
|
+
function ws(o) {
|
|
1229
|
+
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";
|
|
1089
1230
|
}
|
|
1090
|
-
const
|
|
1091
|
-
class
|
|
1231
|
+
const xs = new $();
|
|
1232
|
+
class ys {
|
|
1092
1233
|
constructor(e = {}, t = {}) {
|
|
1093
|
-
this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new
|
|
1094
|
-
let
|
|
1234
|
+
this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new Xt(), 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
|
+
let i = !1, s = -1, r = !1, n = -1;
|
|
1095
1236
|
if (typeof navigator < "u") {
|
|
1096
|
-
const
|
|
1097
|
-
|
|
1098
|
-
const
|
|
1099
|
-
s =
|
|
1237
|
+
const c = navigator.userAgent;
|
|
1238
|
+
i = /^((?!chrome|android).)*safari/i.test(c) === !0;
|
|
1239
|
+
const a = c.match(/Version\/(\d+)/);
|
|
1240
|
+
s = i && a ? parseInt(a[1], 10) : -1, r = c.indexOf("Firefox") > -1, n = r ? c.match(/Firefox\/([0-9]+)\./)[1] : -1;
|
|
1100
1241
|
}
|
|
1101
|
-
typeof createImageBitmap > "u" ||
|
|
1242
|
+
typeof createImageBitmap > "u" || i && s < 17 || r && n < 98 ? this.textureLoader = new ht(this.options.manager) : this.textureLoader = new Ue(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new W(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
|
|
1102
1243
|
}
|
|
1103
1244
|
setExtensions(e) {
|
|
1104
1245
|
this.extensions = e;
|
|
@@ -1107,33 +1248,33 @@ class Os {
|
|
|
1107
1248
|
this.plugins = e;
|
|
1108
1249
|
}
|
|
1109
1250
|
parse(e, t) {
|
|
1110
|
-
const
|
|
1251
|
+
const i = this, s = this.json, r = this.extensions;
|
|
1111
1252
|
this.cache.removeAll(), this.nodeCache = {}, this._invokeAll(function(n) {
|
|
1112
1253
|
return n._markDefs && n._markDefs();
|
|
1113
1254
|
}), Promise.all(this._invokeAll(function(n) {
|
|
1114
1255
|
return n.beforeRoot && n.beforeRoot();
|
|
1115
1256
|
})).then(function() {
|
|
1116
1257
|
return Promise.all([
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1258
|
+
i.getDependencies("scene"),
|
|
1259
|
+
i.getDependencies("animation"),
|
|
1260
|
+
i.getDependencies("camera")
|
|
1120
1261
|
]);
|
|
1121
1262
|
}).then(function(n) {
|
|
1122
|
-
const
|
|
1263
|
+
const c = {
|
|
1123
1264
|
scene: n[0][s.scene || 0],
|
|
1124
1265
|
scenes: n[0],
|
|
1125
1266
|
animations: n[1],
|
|
1126
1267
|
cameras: n[2],
|
|
1127
1268
|
asset: s.asset,
|
|
1128
|
-
parser:
|
|
1269
|
+
parser: i,
|
|
1129
1270
|
userData: {}
|
|
1130
1271
|
};
|
|
1131
|
-
return
|
|
1132
|
-
return
|
|
1272
|
+
return D(r, c, s), C(c, s), Promise.all(i._invokeAll(function(a) {
|
|
1273
|
+
return a.afterRoot && a.afterRoot(c);
|
|
1133
1274
|
})).then(function() {
|
|
1134
|
-
for (const
|
|
1135
|
-
|
|
1136
|
-
e(
|
|
1275
|
+
for (const a of c.scenes)
|
|
1276
|
+
a.updateMatrixWorld();
|
|
1277
|
+
e(c);
|
|
1137
1278
|
});
|
|
1138
1279
|
}).catch(t);
|
|
1139
1280
|
}
|
|
@@ -1141,15 +1282,15 @@ class Os {
|
|
|
1141
1282
|
* Marks the special nodes/meshes in json for efficient parse.
|
|
1142
1283
|
*/
|
|
1143
1284
|
_markDefs() {
|
|
1144
|
-
const e = this.json.nodes || [], t = this.json.skins || [],
|
|
1145
|
-
for (let s = 0,
|
|
1285
|
+
const e = this.json.nodes || [], t = this.json.skins || [], i = this.json.meshes || [];
|
|
1286
|
+
for (let s = 0, r = t.length; s < r; s++) {
|
|
1146
1287
|
const n = t[s].joints;
|
|
1147
|
-
for (let
|
|
1148
|
-
e[n[
|
|
1288
|
+
for (let c = 0, a = n.length; c < a; c++)
|
|
1289
|
+
e[n[c]].isBone = !0;
|
|
1149
1290
|
}
|
|
1150
|
-
for (let s = 0,
|
|
1291
|
+
for (let s = 0, r = e.length; s < r; s++) {
|
|
1151
1292
|
const n = e[s];
|
|
1152
|
-
n.mesh !== void 0 && (this._addNodeRef(this.meshCache, n.mesh), n.skin !== void 0 && (
|
|
1293
|
+
n.mesh !== void 0 && (this._addNodeRef(this.meshCache, n.mesh), n.skin !== void 0 && (i[n.mesh].isSkinnedMesh = !0)), n.camera !== void 0 && this._addNodeRef(this.cameraCache, n.camera);
|
|
1153
1294
|
}
|
|
1154
1295
|
}
|
|
1155
1296
|
/**
|
|
@@ -1160,26 +1301,36 @@ class Os {
|
|
|
1160
1301
|
* Textures) can be reused directly and are not marked here.
|
|
1161
1302
|
*
|
|
1162
1303
|
* Example: CesiumMilkTruck sample model reuses "Wheel" meshes.
|
|
1304
|
+
*
|
|
1305
|
+
* @param {Object} cache
|
|
1306
|
+
* @param {Object3D} index
|
|
1163
1307
|
*/
|
|
1164
1308
|
_addNodeRef(e, t) {
|
|
1165
1309
|
t !== void 0 && (e.refs[t] === void 0 && (e.refs[t] = e.uses[t] = 0), e.refs[t]++);
|
|
1166
1310
|
}
|
|
1167
|
-
/**
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1311
|
+
/**
|
|
1312
|
+
* Returns a reference to a shared resource, cloning it if necessary.
|
|
1313
|
+
*
|
|
1314
|
+
* @param {Object} cache
|
|
1315
|
+
* @param {Number} index
|
|
1316
|
+
* @param {Object} object
|
|
1317
|
+
* @return {Object}
|
|
1318
|
+
*/
|
|
1319
|
+
_getNodeRef(e, t, i) {
|
|
1320
|
+
if (e.refs[t] <= 1) return i;
|
|
1321
|
+
const s = i.clone(), r = (n, c) => {
|
|
1322
|
+
const a = this.associations.get(n);
|
|
1323
|
+
a != null && this.associations.set(c, a);
|
|
1173
1324
|
for (const [l, d] of n.children.entries())
|
|
1174
|
-
|
|
1325
|
+
r(d, c.children[l]);
|
|
1175
1326
|
};
|
|
1176
|
-
return i
|
|
1327
|
+
return r(i, s), s.name += "_instance_" + e.uses[t]++, s;
|
|
1177
1328
|
}
|
|
1178
1329
|
_invokeOne(e) {
|
|
1179
1330
|
const t = Object.values(this.plugins);
|
|
1180
1331
|
t.push(this);
|
|
1181
|
-
for (let
|
|
1182
|
-
const s = e(t[
|
|
1332
|
+
for (let i = 0; i < t.length; i++) {
|
|
1333
|
+
const s = e(t[i]);
|
|
1183
1334
|
if (s) return s;
|
|
1184
1335
|
}
|
|
1185
1336
|
return null;
|
|
@@ -1187,12 +1338,12 @@ class Os {
|
|
|
1187
1338
|
_invokeAll(e) {
|
|
1188
1339
|
const t = Object.values(this.plugins);
|
|
1189
1340
|
t.unshift(this);
|
|
1190
|
-
const
|
|
1341
|
+
const i = [];
|
|
1191
1342
|
for (let s = 0; s < t.length; s++) {
|
|
1192
|
-
const
|
|
1193
|
-
|
|
1343
|
+
const r = e(t[s]);
|
|
1344
|
+
r && i.push(r);
|
|
1194
1345
|
}
|
|
1195
|
-
return
|
|
1346
|
+
return i;
|
|
1196
1347
|
}
|
|
1197
1348
|
/**
|
|
1198
1349
|
* Requests the specified dependency asynchronously, with caching.
|
|
@@ -1201,63 +1352,63 @@ class Os {
|
|
|
1201
1352
|
* @return {Promise<Object3D|Material|THREE.Texture|AnimationClip|ArrayBuffer|Object>}
|
|
1202
1353
|
*/
|
|
1203
1354
|
getDependency(e, t) {
|
|
1204
|
-
const
|
|
1205
|
-
let s = this.cache.get(
|
|
1355
|
+
const i = e + ":" + t;
|
|
1356
|
+
let s = this.cache.get(i);
|
|
1206
1357
|
if (!s) {
|
|
1207
1358
|
switch (e) {
|
|
1208
1359
|
case "scene":
|
|
1209
1360
|
s = this.loadScene(t);
|
|
1210
1361
|
break;
|
|
1211
1362
|
case "node":
|
|
1212
|
-
s = this._invokeOne(function(
|
|
1213
|
-
return
|
|
1363
|
+
s = this._invokeOne(function(r) {
|
|
1364
|
+
return r.loadNode && r.loadNode(t);
|
|
1214
1365
|
});
|
|
1215
1366
|
break;
|
|
1216
1367
|
case "mesh":
|
|
1217
|
-
s = this._invokeOne(function(
|
|
1218
|
-
return
|
|
1368
|
+
s = this._invokeOne(function(r) {
|
|
1369
|
+
return r.loadMesh && r.loadMesh(t);
|
|
1219
1370
|
});
|
|
1220
1371
|
break;
|
|
1221
1372
|
case "accessor":
|
|
1222
1373
|
s = this.loadAccessor(t);
|
|
1223
1374
|
break;
|
|
1224
1375
|
case "bufferView":
|
|
1225
|
-
s = this._invokeOne(function(
|
|
1226
|
-
return
|
|
1376
|
+
s = this._invokeOne(function(r) {
|
|
1377
|
+
return r.loadBufferView && r.loadBufferView(t);
|
|
1227
1378
|
});
|
|
1228
1379
|
break;
|
|
1229
1380
|
case "buffer":
|
|
1230
1381
|
s = this.loadBuffer(t);
|
|
1231
1382
|
break;
|
|
1232
1383
|
case "material":
|
|
1233
|
-
s = this._invokeOne(function(
|
|
1234
|
-
return
|
|
1384
|
+
s = this._invokeOne(function(r) {
|
|
1385
|
+
return r.loadMaterial && r.loadMaterial(t);
|
|
1235
1386
|
});
|
|
1236
1387
|
break;
|
|
1237
1388
|
case "texture":
|
|
1238
|
-
s = this._invokeOne(function(
|
|
1239
|
-
return
|
|
1389
|
+
s = this._invokeOne(function(r) {
|
|
1390
|
+
return r.loadTexture && r.loadTexture(t);
|
|
1240
1391
|
});
|
|
1241
1392
|
break;
|
|
1242
1393
|
case "skin":
|
|
1243
1394
|
s = this.loadSkin(t);
|
|
1244
1395
|
break;
|
|
1245
1396
|
case "animation":
|
|
1246
|
-
s = this._invokeOne(function(
|
|
1247
|
-
return
|
|
1397
|
+
s = this._invokeOne(function(r) {
|
|
1398
|
+
return r.loadAnimation && r.loadAnimation(t);
|
|
1248
1399
|
});
|
|
1249
1400
|
break;
|
|
1250
1401
|
case "camera":
|
|
1251
1402
|
s = this.loadCamera(t);
|
|
1252
1403
|
break;
|
|
1253
1404
|
default:
|
|
1254
|
-
if (s = this._invokeOne(function(
|
|
1255
|
-
return
|
|
1405
|
+
if (s = this._invokeOne(function(r) {
|
|
1406
|
+
return r != this && r.getDependency && r.getDependency(e, t);
|
|
1256
1407
|
}), !s)
|
|
1257
1408
|
throw new Error("Unknown type: " + e);
|
|
1258
1409
|
break;
|
|
1259
1410
|
}
|
|
1260
|
-
this.cache.add(
|
|
1411
|
+
this.cache.add(i, s);
|
|
1261
1412
|
}
|
|
1262
1413
|
return s;
|
|
1263
1414
|
}
|
|
@@ -1269,9 +1420,9 @@ class Os {
|
|
|
1269
1420
|
getDependencies(e) {
|
|
1270
1421
|
let t = this.cache.get(e);
|
|
1271
1422
|
if (!t) {
|
|
1272
|
-
const
|
|
1273
|
-
t = Promise.all(s.map(function(
|
|
1274
|
-
return
|
|
1423
|
+
const i = this, s = this.json[e + (e === "mesh" ? "es" : "s")] || [];
|
|
1424
|
+
t = Promise.all(s.map(function(r, n) {
|
|
1425
|
+
return i.getDependency(e, n);
|
|
1275
1426
|
})), this.cache.add(e, t);
|
|
1276
1427
|
}
|
|
1277
1428
|
return t;
|
|
@@ -1282,14 +1433,14 @@ class Os {
|
|
|
1282
1433
|
* @return {Promise<ArrayBuffer>}
|
|
1283
1434
|
*/
|
|
1284
1435
|
loadBuffer(e) {
|
|
1285
|
-
const t = this.json.buffers[e],
|
|
1436
|
+
const t = this.json.buffers[e], i = this.fileLoader;
|
|
1286
1437
|
if (t.type && t.type !== "arraybuffer")
|
|
1287
1438
|
throw new Error("THREE.GLTFLoader: " + t.type + " buffer type is not supported.");
|
|
1288
1439
|
if (t.uri === void 0 && e === 0)
|
|
1289
1440
|
return Promise.resolve(this.extensions[T.KHR_BINARY_GLTF].body);
|
|
1290
1441
|
const s = this.options;
|
|
1291
|
-
return new Promise(function(
|
|
1292
|
-
|
|
1442
|
+
return new Promise(function(r, n) {
|
|
1443
|
+
i.load(K.resolveURL(t.uri, s.path), r, void 0, function() {
|
|
1293
1444
|
n(new Error('THREE.GLTFLoader: Failed to load buffer "' + t.uri + '".'));
|
|
1294
1445
|
});
|
|
1295
1446
|
});
|
|
@@ -1301,9 +1452,9 @@ class Os {
|
|
|
1301
1452
|
*/
|
|
1302
1453
|
loadBufferView(e) {
|
|
1303
1454
|
const t = this.json.bufferViews[e];
|
|
1304
|
-
return this.getDependency("buffer", t.buffer).then(function(
|
|
1305
|
-
const s = t.byteLength || 0,
|
|
1306
|
-
return
|
|
1455
|
+
return this.getDependency("buffer", t.buffer).then(function(i) {
|
|
1456
|
+
const s = t.byteLength || 0, r = t.byteOffset || 0;
|
|
1457
|
+
return i.slice(r, r + s);
|
|
1307
1458
|
});
|
|
1308
1459
|
}
|
|
1309
1460
|
/**
|
|
@@ -1312,27 +1463,27 @@ class Os {
|
|
|
1312
1463
|
* @return {Promise<BufferAttribute|InterleavedBufferAttribute>}
|
|
1313
1464
|
*/
|
|
1314
1465
|
loadAccessor(e) {
|
|
1315
|
-
const t = this,
|
|
1466
|
+
const t = this, i = this.json, s = this.json.accessors[e];
|
|
1316
1467
|
if (s.bufferView === void 0 && s.sparse === void 0) {
|
|
1317
|
-
const n = re[s.type],
|
|
1318
|
-
return Promise.resolve(new
|
|
1468
|
+
const n = re[s.type], c = H[s.componentType], a = s.normalized === !0, l = new c(s.count * n);
|
|
1469
|
+
return Promise.resolve(new j(l, n, a));
|
|
1319
1470
|
}
|
|
1320
|
-
const
|
|
1321
|
-
return s.bufferView !== void 0 ?
|
|
1322
|
-
const
|
|
1471
|
+
const r = [];
|
|
1472
|
+
return s.bufferView !== void 0 ? r.push(this.getDependency("bufferView", s.bufferView)) : r.push(null), s.sparse !== void 0 && (r.push(this.getDependency("bufferView", s.sparse.indices.bufferView)), r.push(this.getDependency("bufferView", s.sparse.values.bufferView))), Promise.all(r).then(function(n) {
|
|
1473
|
+
const c = n[0], a = re[s.type], l = H[s.componentType], d = l.BYTES_PER_ELEMENT, u = d * a, h = s.byteOffset || 0, f = s.bufferView !== void 0 ? i.bufferViews[s.bufferView].byteStride : void 0, p = s.normalized === !0;
|
|
1323
1474
|
let A, m;
|
|
1324
1475
|
if (f && f !== u) {
|
|
1325
|
-
const g = Math.floor(h / f),
|
|
1326
|
-
let w = t.cache.get(
|
|
1327
|
-
w || (A = new l(
|
|
1476
|
+
const g = Math.floor(h / f), R = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + g + ":" + s.count;
|
|
1477
|
+
let w = t.cache.get(R);
|
|
1478
|
+
w || (A = new l(c, g * f, s.count * f / d), w = new ft(A, f / d), t.cache.add(R, w)), m = new pt(w, a, h % f / d, p);
|
|
1328
1479
|
} else
|
|
1329
|
-
|
|
1480
|
+
c === null ? A = new l(s.count * a) : A = new l(c, h, s.count * a), m = new j(A, a, p);
|
|
1330
1481
|
if (s.sparse !== void 0) {
|
|
1331
|
-
const g = re.SCALAR,
|
|
1332
|
-
|
|
1333
|
-
for (let
|
|
1334
|
-
const I = b[
|
|
1335
|
-
if (m.setX(I, M[
|
|
1482
|
+
const g = re.SCALAR, R = H[s.sparse.indices.componentType], w = s.sparse.indices.byteOffset || 0, E = s.sparse.values.byteOffset || 0, b = new R(n[1], w, s.sparse.count * g), M = new l(n[2], E, s.sparse.count * a);
|
|
1483
|
+
c !== null && (m = new j(m.array.slice(), m.itemSize, m.normalized)), m.normalized = !1;
|
|
1484
|
+
for (let y = 0, U = b.length; y < U; y++) {
|
|
1485
|
+
const I = b[y];
|
|
1486
|
+
if (m.setX(I, M[y * a]), a >= 2 && m.setY(I, M[y * a + 1]), a >= 3 && m.setZ(I, M[y * a + 2]), a >= 4 && m.setW(I, M[y * a + 3]), a >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
1336
1487
|
}
|
|
1337
1488
|
m.normalized = p;
|
|
1338
1489
|
}
|
|
@@ -1345,72 +1496,74 @@ class Os {
|
|
|
1345
1496
|
* @return {Promise<THREE.Texture|null>}
|
|
1346
1497
|
*/
|
|
1347
1498
|
loadTexture(e) {
|
|
1348
|
-
const t = this.json,
|
|
1349
|
-
let
|
|
1499
|
+
const t = this.json, i = this.options, r = t.textures[e].source, n = t.images[r];
|
|
1500
|
+
let c = this.textureLoader;
|
|
1350
1501
|
if (n.uri) {
|
|
1351
|
-
const
|
|
1352
|
-
|
|
1502
|
+
const a = i.manager.getHandler(n.uri);
|
|
1503
|
+
a !== null && (c = a);
|
|
1353
1504
|
}
|
|
1354
|
-
return this.loadTextureImage(e,
|
|
1355
|
-
}
|
|
1356
|
-
loadTextureImage(e, t,
|
|
1357
|
-
const s = this,
|
|
1358
|
-
if (this.textureCache[
|
|
1359
|
-
return this.textureCache[
|
|
1360
|
-
const l = this.loadImageSource(t,
|
|
1361
|
-
d.flipY = !1, d.name = n.name ||
|
|
1362
|
-
const h = (
|
|
1363
|
-
return d.magFilter = be[h.magFilter] || de, d.minFilter = be[h.minFilter] ||
|
|
1505
|
+
return this.loadTextureImage(e, r, c);
|
|
1506
|
+
}
|
|
1507
|
+
loadTextureImage(e, t, i) {
|
|
1508
|
+
const s = this, r = this.json, n = r.textures[e], c = r.images[t], a = (c.uri || c.bufferView) + ":" + n.sampler;
|
|
1509
|
+
if (this.textureCache[a])
|
|
1510
|
+
return this.textureCache[a];
|
|
1511
|
+
const l = this.loadImageSource(t, i).then(function(d) {
|
|
1512
|
+
d.flipY = !1, d.name = n.name || c.name || "", d.name === "" && typeof c.uri == "string" && c.uri.startsWith("data:image/") === !1 && (d.name = c.uri);
|
|
1513
|
+
const h = (r.samplers || {})[n.sampler] || {};
|
|
1514
|
+
return d.magFilter = be[h.magFilter] || de, d.minFilter = be[h.minFilter] || Ge, d.wrapS = Se[h.wrapS] || he, d.wrapT = Se[h.wrapT] || he, d.generateMipmaps = !d.isCompressedTexture && d.minFilter !== Be && d.minFilter !== de, s.associations.set(d, { textures: e }), d;
|
|
1364
1515
|
}).catch(function() {
|
|
1365
1516
|
return null;
|
|
1366
1517
|
});
|
|
1367
|
-
return this.textureCache[
|
|
1518
|
+
return this.textureCache[a] = l, l;
|
|
1368
1519
|
}
|
|
1369
1520
|
loadImageSource(e, t) {
|
|
1370
|
-
const
|
|
1521
|
+
const i = this, s = this.json, r = this.options;
|
|
1371
1522
|
if (this.sourceCache[e] !== void 0)
|
|
1372
1523
|
return this.sourceCache[e].then((u) => u.clone());
|
|
1373
|
-
const n = s.images[e],
|
|
1374
|
-
let
|
|
1524
|
+
const n = s.images[e], c = self.URL || self.webkitURL;
|
|
1525
|
+
let a = n.uri || "", l = !1;
|
|
1375
1526
|
if (n.bufferView !== void 0)
|
|
1376
|
-
|
|
1527
|
+
a = i.getDependency("bufferView", n.bufferView).then(function(u) {
|
|
1377
1528
|
l = !0;
|
|
1378
1529
|
const h = new Blob([u], { type: n.mimeType });
|
|
1379
|
-
return
|
|
1530
|
+
return a = c.createObjectURL(h), a;
|
|
1380
1531
|
});
|
|
1381
1532
|
else if (n.uri === void 0)
|
|
1382
1533
|
throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
|
|
1383
|
-
const d = Promise.resolve(
|
|
1534
|
+
const d = Promise.resolve(a).then(function(u) {
|
|
1384
1535
|
return new Promise(function(h, f) {
|
|
1385
1536
|
let p = h;
|
|
1386
1537
|
t.isImageBitmapLoader === !0 && (p = function(A) {
|
|
1387
1538
|
const m = new Re(A);
|
|
1388
1539
|
m.needsUpdate = !0, h(m);
|
|
1389
|
-
}), t.load(
|
|
1540
|
+
}), t.load(K.resolveURL(u, r.path), p, void 0, f);
|
|
1390
1541
|
});
|
|
1391
1542
|
}).then(function(u) {
|
|
1392
|
-
return l === !0 &&
|
|
1543
|
+
return l === !0 && c.revokeObjectURL(a), C(u, n), u.userData.mimeType = n.mimeType || ws(n.uri), u;
|
|
1393
1544
|
}).catch(function(u) {
|
|
1394
|
-
throw console.error("THREE.GLTFLoader: Couldn't load texture",
|
|
1545
|
+
throw console.error("THREE.GLTFLoader: Couldn't load texture", a), u;
|
|
1395
1546
|
});
|
|
1396
1547
|
return this.sourceCache[e] = d, d;
|
|
1397
1548
|
}
|
|
1398
1549
|
/**
|
|
1399
1550
|
* Asynchronously assigns a texture to the given material parameters.
|
|
1551
|
+
*
|
|
1400
1552
|
* @param {Object} materialParams
|
|
1401
1553
|
* @param {string} mapName
|
|
1402
1554
|
* @param {Object} mapDef
|
|
1555
|
+
* @param {string} colorSpace
|
|
1403
1556
|
* @return {Promise<Texture>}
|
|
1404
1557
|
*/
|
|
1405
|
-
assignTexture(e, t,
|
|
1406
|
-
const
|
|
1407
|
-
return this.getDependency("texture",
|
|
1558
|
+
assignTexture(e, t, i, s) {
|
|
1559
|
+
const r = this;
|
|
1560
|
+
return this.getDependency("texture", i.index).then(function(n) {
|
|
1408
1561
|
if (!n) return null;
|
|
1409
|
-
if (
|
|
1410
|
-
const
|
|
1411
|
-
if (
|
|
1412
|
-
const
|
|
1413
|
-
n =
|
|
1562
|
+
if (i.texCoord !== void 0 && i.texCoord > 0 && (n = n.clone(), n.channel = i.texCoord), r.extensions[T.KHR_TEXTURE_TRANSFORM]) {
|
|
1563
|
+
const c = i.extensions !== void 0 ? i.extensions[T.KHR_TEXTURE_TRANSFORM] : void 0;
|
|
1564
|
+
if (c) {
|
|
1565
|
+
const a = r.associations.get(n);
|
|
1566
|
+
n = r.extensions[T.KHR_TEXTURE_TRANSFORM].extendTexture(n, c), r.associations.set(n, a);
|
|
1414
1567
|
}
|
|
1415
1568
|
}
|
|
1416
1569
|
return s !== void 0 && (n.colorSpace = s), e[t] = n, n;
|
|
@@ -1426,27 +1579,27 @@ class Os {
|
|
|
1426
1579
|
*/
|
|
1427
1580
|
assignFinalMaterial(e) {
|
|
1428
1581
|
const t = e.geometry;
|
|
1429
|
-
let
|
|
1430
|
-
const s = t.attributes.tangent === void 0,
|
|
1582
|
+
let i = e.material;
|
|
1583
|
+
const s = t.attributes.tangent === void 0, r = t.attributes.color !== void 0, n = t.attributes.normal === void 0;
|
|
1431
1584
|
if (e.isPoints) {
|
|
1432
|
-
const
|
|
1433
|
-
let
|
|
1434
|
-
|
|
1585
|
+
const c = "PointsMaterial:" + i.uuid;
|
|
1586
|
+
let a = this.cache.get(c);
|
|
1587
|
+
a || (a = new mt(), te.prototype.copy.call(a, i), a.color.copy(i.color), a.map = i.map, a.sizeAttenuation = !1, this.cache.add(c, a)), i = a;
|
|
1435
1588
|
} else if (e.isLine) {
|
|
1436
|
-
const
|
|
1437
|
-
let
|
|
1438
|
-
|
|
1589
|
+
const c = "LineBasicMaterial:" + i.uuid;
|
|
1590
|
+
let a = this.cache.get(c);
|
|
1591
|
+
a || (a = new gt(), te.prototype.copy.call(a, i), a.color.copy(i.color), a.map = i.map, this.cache.add(c, a)), i = a;
|
|
1439
1592
|
}
|
|
1440
|
-
if (s ||
|
|
1441
|
-
let
|
|
1442
|
-
s && (
|
|
1443
|
-
let
|
|
1444
|
-
|
|
1593
|
+
if (s || r || n) {
|
|
1594
|
+
let c = "ClonedMaterial:" + i.uuid + ":";
|
|
1595
|
+
s && (c += "derivative-tangents:"), r && (c += "vertex-colors:"), n && (c += "flat-shading:");
|
|
1596
|
+
let a = this.cache.get(c);
|
|
1597
|
+
a || (a = i.clone(), r && (a.vertexColors = !0), n && (a.flatShading = !0), s && (a.normalScale && (a.normalScale.y *= -1), a.clearcoatNormalScale && (a.clearcoatNormalScale.y *= -1)), this.cache.add(c, a), this.associations.set(a, this.associations.get(i))), i = a;
|
|
1445
1598
|
}
|
|
1446
|
-
e.material =
|
|
1599
|
+
e.material = i;
|
|
1447
1600
|
}
|
|
1448
1601
|
getMaterialType() {
|
|
1449
|
-
return
|
|
1602
|
+
return je;
|
|
1450
1603
|
}
|
|
1451
1604
|
/**
|
|
1452
1605
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
|
|
@@ -1454,42 +1607,47 @@ class Os {
|
|
|
1454
1607
|
* @return {Promise<Material>}
|
|
1455
1608
|
*/
|
|
1456
1609
|
loadMaterial(e) {
|
|
1457
|
-
const t = this,
|
|
1610
|
+
const t = this, i = this.json, s = this.extensions, r = i.materials[e];
|
|
1458
1611
|
let n;
|
|
1459
|
-
const
|
|
1460
|
-
if (
|
|
1612
|
+
const c = {}, a = r.extensions || {}, l = [];
|
|
1613
|
+
if (a[T.KHR_MATERIALS_UNLIT]) {
|
|
1461
1614
|
const u = s[T.KHR_MATERIALS_UNLIT];
|
|
1462
|
-
n = u.getMaterialType(), l.push(u.extendParams(
|
|
1615
|
+
n = u.getMaterialType(), l.push(u.extendParams(c, r, t));
|
|
1463
1616
|
} else {
|
|
1464
|
-
const u =
|
|
1465
|
-
if (
|
|
1617
|
+
const u = r.pbrMetallicRoughness || {};
|
|
1618
|
+
if (c.color = new P(1, 1, 1), c.opacity = 1, Array.isArray(u.baseColorFactor)) {
|
|
1466
1619
|
const h = u.baseColorFactor;
|
|
1467
|
-
|
|
1620
|
+
c.color.setRGB(h[0], h[1], h[2], S), c.opacity = h[3];
|
|
1468
1621
|
}
|
|
1469
|
-
u.baseColorTexture !== void 0 && l.push(t.assignTexture(
|
|
1622
|
+
u.baseColorTexture !== void 0 && l.push(t.assignTexture(c, "map", u.baseColorTexture, N)), c.metalness = u.metallicFactor !== void 0 ? u.metallicFactor : 1, c.roughness = u.roughnessFactor !== void 0 ? u.roughnessFactor : 1, u.metallicRoughnessTexture !== void 0 && (l.push(t.assignTexture(c, "metalnessMap", u.metallicRoughnessTexture)), l.push(t.assignTexture(c, "roughnessMap", u.metallicRoughnessTexture))), n = this._invokeOne(function(h) {
|
|
1470
1623
|
return h.getMaterialType && h.getMaterialType(e);
|
|
1471
1624
|
}), l.push(Promise.all(this._invokeAll(function(h) {
|
|
1472
|
-
return h.extendMaterialParams && h.extendMaterialParams(e,
|
|
1625
|
+
return h.extendMaterialParams && h.extendMaterialParams(e, c);
|
|
1473
1626
|
})));
|
|
1474
1627
|
}
|
|
1475
|
-
|
|
1476
|
-
const d =
|
|
1477
|
-
if (d === ie.BLEND ? (
|
|
1478
|
-
const u =
|
|
1479
|
-
|
|
1628
|
+
r.doubleSided === !0 && (c.side = At);
|
|
1629
|
+
const d = r.alphaMode || ie.OPAQUE;
|
|
1630
|
+
if (d === ie.BLEND ? (c.transparent = !0, c.depthWrite = !1) : (c.transparent = !1, d === ie.MASK && (c.alphaTest = r.alphaCutoff !== void 0 ? r.alphaCutoff : 0.5)), r.normalTexture !== void 0 && n !== B && (l.push(t.assignTexture(c, "normalMap", r.normalTexture)), c.normalScale = new ke(1, 1), r.normalTexture.scale !== void 0)) {
|
|
1631
|
+
const u = r.normalTexture.scale;
|
|
1632
|
+
c.normalScale.set(u, u);
|
|
1480
1633
|
}
|
|
1481
|
-
if (
|
|
1482
|
-
const u =
|
|
1483
|
-
|
|
1634
|
+
if (r.occlusionTexture !== void 0 && n !== B && (l.push(t.assignTexture(c, "aoMap", r.occlusionTexture)), r.occlusionTexture.strength !== void 0 && (c.aoMapIntensity = r.occlusionTexture.strength)), r.emissiveFactor !== void 0 && n !== B) {
|
|
1635
|
+
const u = r.emissiveFactor;
|
|
1636
|
+
c.emissive = new P().setRGB(u[0], u[1], u[2], S);
|
|
1484
1637
|
}
|
|
1485
|
-
return
|
|
1486
|
-
const u = new n(
|
|
1487
|
-
return
|
|
1638
|
+
return r.emissiveTexture !== void 0 && n !== B && l.push(t.assignTexture(c, "emissiveMap", r.emissiveTexture, N)), Promise.all(l).then(function() {
|
|
1639
|
+
const u = new n(c);
|
|
1640
|
+
return r.name && (u.name = r.name), C(u, r), t.associations.set(u, { materials: e }), r.extensions && D(s, u, r), u;
|
|
1488
1641
|
});
|
|
1489
1642
|
}
|
|
1490
|
-
/**
|
|
1643
|
+
/**
|
|
1644
|
+
* When Object3D instances are targeted by animation, they need unique names.
|
|
1645
|
+
*
|
|
1646
|
+
* @param {String} originalName
|
|
1647
|
+
* @return {String}
|
|
1648
|
+
*/
|
|
1491
1649
|
createUniqueName(e) {
|
|
1492
|
-
const t =
|
|
1650
|
+
const t = Tt.sanitizeNodeName(e || "");
|
|
1493
1651
|
return t in this.nodeNamesUsed ? t + "_" + ++this.nodeNamesUsed[t] : (this.nodeNamesUsed[t] = 0, t);
|
|
1494
1652
|
}
|
|
1495
1653
|
/**
|
|
@@ -1501,20 +1659,20 @@ class Os {
|
|
|
1501
1659
|
* @return {Promise<Array<BufferGeometry>>}
|
|
1502
1660
|
*/
|
|
1503
1661
|
loadGeometries(e) {
|
|
1504
|
-
const t = this,
|
|
1505
|
-
function
|
|
1506
|
-
return
|
|
1507
|
-
return ve(
|
|
1662
|
+
const t = this, i = this.extensions, s = this.primitiveCache;
|
|
1663
|
+
function r(c) {
|
|
1664
|
+
return i[T.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(c, t).then(function(a) {
|
|
1665
|
+
return ve(a, c, t);
|
|
1508
1666
|
});
|
|
1509
1667
|
}
|
|
1510
1668
|
const n = [];
|
|
1511
|
-
for (let
|
|
1512
|
-
const l = e[
|
|
1669
|
+
for (let c = 0, a = e.length; c < a; c++) {
|
|
1670
|
+
const l = e[c], d = Es(l), u = s[d];
|
|
1513
1671
|
if (u)
|
|
1514
1672
|
n.push(u.promise);
|
|
1515
1673
|
else {
|
|
1516
1674
|
let h;
|
|
1517
|
-
l.extensions && l.extensions[T.KHR_DRACO_MESH_COMPRESSION] ? h =
|
|
1675
|
+
l.extensions && l.extensions[T.KHR_DRACO_MESH_COMPRESSION] ? h = r(l) : h = ve(new De(), l, t), s[d] = { primitive: l, promise: h }, n.push(h);
|
|
1518
1676
|
}
|
|
1519
1677
|
}
|
|
1520
1678
|
return Promise.all(n);
|
|
@@ -1525,30 +1683,30 @@ class Os {
|
|
|
1525
1683
|
* @return {Promise<Group|Mesh|SkinnedMesh>}
|
|
1526
1684
|
*/
|
|
1527
1685
|
loadMesh(e) {
|
|
1528
|
-
const t = this,
|
|
1529
|
-
for (let
|
|
1530
|
-
const d = n[
|
|
1531
|
-
|
|
1686
|
+
const t = this, i = this.json, s = this.extensions, r = i.meshes[e], n = r.primitives, c = [];
|
|
1687
|
+
for (let a = 0, l = n.length; a < l; a++) {
|
|
1688
|
+
const d = n[a].material === void 0 ? Ts(this.cache) : this.getDependency("material", n[a].material);
|
|
1689
|
+
c.push(d);
|
|
1532
1690
|
}
|
|
1533
|
-
return
|
|
1534
|
-
const l =
|
|
1691
|
+
return c.push(t.loadGeometries(n)), Promise.all(c).then(function(a) {
|
|
1692
|
+
const l = a.slice(0, a.length - 1), d = a[a.length - 1], u = [];
|
|
1535
1693
|
for (let f = 0, p = d.length; f < p; f++) {
|
|
1536
1694
|
const A = d[f], m = n[f];
|
|
1537
1695
|
let g;
|
|
1538
|
-
const
|
|
1539
|
-
if (m.mode ===
|
|
1540
|
-
g =
|
|
1541
|
-
else if (m.mode ===
|
|
1542
|
-
g = new
|
|
1543
|
-
else if (m.mode ===
|
|
1544
|
-
g = new
|
|
1545
|
-
else if (m.mode ===
|
|
1546
|
-
g = new xt(A,
|
|
1547
|
-
else if (m.mode ===
|
|
1548
|
-
g = new yt(A,
|
|
1696
|
+
const R = l[f];
|
|
1697
|
+
if (m.mode === x.TRIANGLES || m.mode === x.TRIANGLE_STRIP || m.mode === x.TRIANGLE_FAN || m.mode === void 0)
|
|
1698
|
+
g = r.isSkinnedMesh === !0 ? new _t(A, R) : new Rt(A, R), g.isSkinnedMesh === !0 && g.normalizeSkinWeights(), m.mode === x.TRIANGLE_STRIP ? g.geometry = ye(g.geometry, Ne) : m.mode === x.TRIANGLE_FAN && (g.geometry = ye(g.geometry, le));
|
|
1699
|
+
else if (m.mode === x.LINES)
|
|
1700
|
+
g = new Et(A, R);
|
|
1701
|
+
else if (m.mode === x.LINE_STRIP)
|
|
1702
|
+
g = new wt(A, R);
|
|
1703
|
+
else if (m.mode === x.LINE_LOOP)
|
|
1704
|
+
g = new xt(A, R);
|
|
1705
|
+
else if (m.mode === x.POINTS)
|
|
1706
|
+
g = new yt(A, R);
|
|
1549
1707
|
else
|
|
1550
1708
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + m.mode);
|
|
1551
|
-
Object.keys(g.geometry.morphAttributes).length > 0 &&
|
|
1709
|
+
Object.keys(g.geometry.morphAttributes).length > 0 && Rs(g, r), g.name = t.createUniqueName(r.name || "mesh_" + e), C(g, r), m.extensions && D(s, g, m), t.assignFinalMaterial(g), u.push(g);
|
|
1552
1710
|
}
|
|
1553
1711
|
for (let f = 0, p = u.length; f < p; f++)
|
|
1554
1712
|
t.associations.set(u[f], {
|
|
@@ -1556,9 +1714,9 @@ class Os {
|
|
|
1556
1714
|
primitives: f
|
|
1557
1715
|
});
|
|
1558
1716
|
if (u.length === 1)
|
|
1559
|
-
return
|
|
1560
|
-
const h = new
|
|
1561
|
-
|
|
1717
|
+
return r.extensions && D(s, u[0], r), u[0];
|
|
1718
|
+
const h = new se();
|
|
1719
|
+
r.extensions && D(s, h, r), t.associations.set(h, { meshes: e });
|
|
1562
1720
|
for (let f = 0, p = u.length; f < p; f++)
|
|
1563
1721
|
h.add(u[f]);
|
|
1564
1722
|
return h;
|
|
@@ -1571,12 +1729,12 @@ class Os {
|
|
|
1571
1729
|
*/
|
|
1572
1730
|
loadCamera(e) {
|
|
1573
1731
|
let t;
|
|
1574
|
-
const
|
|
1732
|
+
const i = this.json.cameras[e], s = i[i.type];
|
|
1575
1733
|
if (!s) {
|
|
1576
1734
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
1577
1735
|
return;
|
|
1578
1736
|
}
|
|
1579
|
-
return
|
|
1737
|
+
return i.type === "perspective" ? t = new Lt(bt.radToDeg(s.yfov), s.aspectRatio || 1, s.znear || 1, s.zfar || 2e6) : i.type === "orthographic" && (t = new St(-s.xmag, s.xmag, s.ymag, -s.ymag, s.znear, s.zfar)), i.name && (t.name = this.createUniqueName(i.name)), C(t, i), Promise.resolve(t);
|
|
1580
1738
|
}
|
|
1581
1739
|
/**
|
|
1582
1740
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
@@ -1584,21 +1742,21 @@ class Os {
|
|
|
1584
1742
|
* @return {Promise<Skeleton>}
|
|
1585
1743
|
*/
|
|
1586
1744
|
loadSkin(e) {
|
|
1587
|
-
const t = this.json.skins[e],
|
|
1588
|
-
for (let s = 0,
|
|
1589
|
-
|
|
1590
|
-
return t.inverseBindMatrices !== void 0 ?
|
|
1591
|
-
const
|
|
1745
|
+
const t = this.json.skins[e], i = [];
|
|
1746
|
+
for (let s = 0, r = t.joints.length; s < r; s++)
|
|
1747
|
+
i.push(this._loadNodeShallow(t.joints[s]));
|
|
1748
|
+
return t.inverseBindMatrices !== void 0 ? i.push(this.getDependency("accessor", t.inverseBindMatrices)) : i.push(null), Promise.all(i).then(function(s) {
|
|
1749
|
+
const r = s.pop(), n = s, c = [], a = [];
|
|
1592
1750
|
for (let l = 0, d = n.length; l < d; l++) {
|
|
1593
1751
|
const u = n[l];
|
|
1594
1752
|
if (u) {
|
|
1595
|
-
|
|
1596
|
-
const h = new
|
|
1597
|
-
|
|
1753
|
+
c.push(u);
|
|
1754
|
+
const h = new $();
|
|
1755
|
+
r !== null && h.fromArray(r.array, l * 16), a.push(h);
|
|
1598
1756
|
} else
|
|
1599
1757
|
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[l]);
|
|
1600
1758
|
}
|
|
1601
|
-
return new
|
|
1759
|
+
return new vt(c, a);
|
|
1602
1760
|
});
|
|
1603
1761
|
}
|
|
1604
1762
|
/**
|
|
@@ -1607,39 +1765,39 @@ class Os {
|
|
|
1607
1765
|
* @return {Promise<AnimationClip>}
|
|
1608
1766
|
*/
|
|
1609
1767
|
loadAnimation(e) {
|
|
1610
|
-
const t = this.json,
|
|
1768
|
+
const t = this.json, i = this, s = t.animations[e], r = s.name ? s.name : "animation_" + e, n = [], c = [], a = [], l = [], d = [];
|
|
1611
1769
|
for (let u = 0, h = s.channels.length; u < h; u++) {
|
|
1612
|
-
const f = s.channels[u], p = s.samplers[f.sampler], A = f.target, m = A.node, g = s.parameters !== void 0 ? s.parameters[p.input] : p.input,
|
|
1613
|
-
A.node !== void 0 && (n.push(this.getDependency("node", m)),
|
|
1770
|
+
const f = s.channels[u], 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;
|
|
1771
|
+
A.node !== void 0 && (n.push(this.getDependency("node", m)), c.push(this.getDependency("accessor", g)), a.push(this.getDependency("accessor", R)), l.push(p), d.push(A));
|
|
1614
1772
|
}
|
|
1615
1773
|
return Promise.all([
|
|
1616
1774
|
Promise.all(n),
|
|
1775
|
+
Promise.all(c),
|
|
1617
1776
|
Promise.all(a),
|
|
1618
|
-
Promise.all(o),
|
|
1619
1777
|
Promise.all(l),
|
|
1620
1778
|
Promise.all(d)
|
|
1621
1779
|
]).then(function(u) {
|
|
1622
1780
|
const h = u[0], f = u[1], p = u[2], A = u[3], m = u[4], g = [];
|
|
1623
|
-
for (let
|
|
1624
|
-
const
|
|
1625
|
-
if (
|
|
1626
|
-
|
|
1627
|
-
const I =
|
|
1781
|
+
for (let R = 0, w = h.length; R < w; R++) {
|
|
1782
|
+
const E = h[R], b = f[R], M = p[R], y = A[R], U = m[R];
|
|
1783
|
+
if (E === void 0) continue;
|
|
1784
|
+
E.updateMatrix && E.updateMatrix();
|
|
1785
|
+
const I = i._createAnimationTracks(E, b, M, y, U);
|
|
1628
1786
|
if (I)
|
|
1629
1787
|
for (let Z = 0; Z < I.length; Z++)
|
|
1630
1788
|
g.push(I[Z]);
|
|
1631
1789
|
}
|
|
1632
|
-
return new
|
|
1790
|
+
return new Ct(r, void 0, g);
|
|
1633
1791
|
});
|
|
1634
1792
|
}
|
|
1635
1793
|
createNodeMesh(e) {
|
|
1636
|
-
const t = this.json,
|
|
1637
|
-
return s.mesh === void 0 ? null :
|
|
1638
|
-
const n =
|
|
1639
|
-
return s.weights !== void 0 && n.traverse(function(
|
|
1640
|
-
if (
|
|
1641
|
-
for (let
|
|
1642
|
-
|
|
1794
|
+
const t = this.json, i = this, s = t.nodes[e];
|
|
1795
|
+
return s.mesh === void 0 ? null : i.getDependency("mesh", s.mesh).then(function(r) {
|
|
1796
|
+
const n = i._getNodeRef(i.meshCache, s.mesh, r);
|
|
1797
|
+
return s.weights !== void 0 && n.traverse(function(c) {
|
|
1798
|
+
if (c.isMesh)
|
|
1799
|
+
for (let a = 0, l = s.weights.length; a < l; a++)
|
|
1800
|
+
c.morphTargetInfluences[a] = s.weights[a];
|
|
1643
1801
|
}), n;
|
|
1644
1802
|
});
|
|
1645
1803
|
}
|
|
@@ -1649,18 +1807,18 @@ class Os {
|
|
|
1649
1807
|
* @return {Promise<Object3D>}
|
|
1650
1808
|
*/
|
|
1651
1809
|
loadNode(e) {
|
|
1652
|
-
const t = this.json,
|
|
1653
|
-
for (let l = 0, d =
|
|
1654
|
-
n.push(
|
|
1655
|
-
const
|
|
1810
|
+
const t = this.json, i = this, s = t.nodes[e], r = i._loadNodeShallow(e), n = [], c = s.children || [];
|
|
1811
|
+
for (let l = 0, d = c.length; l < d; l++)
|
|
1812
|
+
n.push(i.getDependency("node", c[l]));
|
|
1813
|
+
const a = s.skin === void 0 ? Promise.resolve(null) : i.getDependency("skin", s.skin);
|
|
1656
1814
|
return Promise.all([
|
|
1657
|
-
|
|
1815
|
+
r,
|
|
1658
1816
|
Promise.all(n),
|
|
1659
|
-
|
|
1817
|
+
a
|
|
1660
1818
|
]).then(function(l) {
|
|
1661
1819
|
const d = l[0], u = l[1], h = l[2];
|
|
1662
1820
|
h !== null && d.traverse(function(f) {
|
|
1663
|
-
f.isSkinnedMesh && f.bind(h,
|
|
1821
|
+
f.isSkinnedMesh && f.bind(h, xs);
|
|
1664
1822
|
});
|
|
1665
1823
|
for (let f = 0, p = u.length; f < p; f++)
|
|
1666
1824
|
d.add(u[f]);
|
|
@@ -1670,28 +1828,28 @@ class Os {
|
|
|
1670
1828
|
// ._loadNodeShallow() parses a single node.
|
|
1671
1829
|
// skin and child nodes are created and added in .loadNode() (no '_' prefix).
|
|
1672
1830
|
_loadNodeShallow(e) {
|
|
1673
|
-
const t = this.json,
|
|
1831
|
+
const t = this.json, i = this.extensions, s = this;
|
|
1674
1832
|
if (this.nodeCache[e] !== void 0)
|
|
1675
1833
|
return this.nodeCache[e];
|
|
1676
|
-
const
|
|
1834
|
+
const r = t.nodes[e], n = r.name ? s.createUniqueName(r.name) : "", c = [], a = s._invokeOne(function(l) {
|
|
1677
1835
|
return l.createNodeMesh && l.createNodeMesh(e);
|
|
1678
1836
|
});
|
|
1679
|
-
return
|
|
1680
|
-
return s._getNodeRef(s.cameraCache,
|
|
1837
|
+
return a && c.push(a), r.camera !== void 0 && c.push(s.getDependency("camera", r.camera).then(function(l) {
|
|
1838
|
+
return s._getNodeRef(s.cameraCache, r.camera, l);
|
|
1681
1839
|
})), s._invokeAll(function(l) {
|
|
1682
1840
|
return l.createNodeAttachment && l.createNodeAttachment(e);
|
|
1683
1841
|
}).forEach(function(l) {
|
|
1684
|
-
|
|
1685
|
-
}), this.nodeCache[e] = Promise.all(
|
|
1842
|
+
c.push(l);
|
|
1843
|
+
}), this.nodeCache[e] = Promise.all(c).then(function(l) {
|
|
1686
1844
|
let d;
|
|
1687
|
-
if (
|
|
1845
|
+
if (r.isBone === !0 ? d = new Mt() : l.length > 1 ? d = new se() : l.length === 1 ? d = l[0] : d = new He(), d !== l[0])
|
|
1688
1846
|
for (let u = 0, h = l.length; u < h; u++)
|
|
1689
1847
|
d.add(l[u]);
|
|
1690
|
-
if (
|
|
1691
|
-
const u = new
|
|
1692
|
-
u.fromArray(
|
|
1848
|
+
if (r.name && (d.userData.name = r.name, d.name = n), C(d, r), r.extensions && D(i, d, r), r.matrix !== void 0) {
|
|
1849
|
+
const u = new $();
|
|
1850
|
+
u.fromArray(r.matrix), d.applyMatrix4(u);
|
|
1693
1851
|
} else
|
|
1694
|
-
|
|
1852
|
+
r.translation !== void 0 && d.position.fromArray(r.translation), r.rotation !== void 0 && d.quaternion.fromArray(r.rotation), r.scale !== void 0 && d.scale.fromArray(r.scale);
|
|
1695
1853
|
return s.associations.has(d) || s.associations.set(d, {}), s.associations.get(d).nodes = e, d;
|
|
1696
1854
|
}), this.nodeCache[e];
|
|
1697
1855
|
}
|
|
@@ -1701,45 +1859,45 @@ class Os {
|
|
|
1701
1859
|
* @return {Promise<Group>}
|
|
1702
1860
|
*/
|
|
1703
1861
|
loadScene(e) {
|
|
1704
|
-
const t = this.extensions,
|
|
1705
|
-
|
|
1706
|
-
const n =
|
|
1707
|
-
for (let
|
|
1708
|
-
|
|
1709
|
-
return Promise.all(
|
|
1710
|
-
for (let d = 0, u =
|
|
1711
|
-
|
|
1862
|
+
const t = this.extensions, i = this.json.scenes[e], s = this, r = new se();
|
|
1863
|
+
i.name && (r.name = s.createUniqueName(i.name)), C(r, i), i.extensions && D(t, r, i);
|
|
1864
|
+
const n = i.nodes || [], c = [];
|
|
1865
|
+
for (let a = 0, l = n.length; a < l; a++)
|
|
1866
|
+
c.push(s.getDependency("node", n[a]));
|
|
1867
|
+
return Promise.all(c).then(function(a) {
|
|
1868
|
+
for (let d = 0, u = a.length; d < u; d++)
|
|
1869
|
+
r.add(a[d]);
|
|
1712
1870
|
const l = (d) => {
|
|
1713
1871
|
const u = /* @__PURE__ */ new Map();
|
|
1714
1872
|
for (const [h, f] of s.associations)
|
|
1715
|
-
(h instanceof
|
|
1873
|
+
(h instanceof te || h instanceof Re) && u.set(h, f);
|
|
1716
1874
|
return d.traverse((h) => {
|
|
1717
1875
|
const f = s.associations.get(h);
|
|
1718
1876
|
f != null && u.set(h, f);
|
|
1719
1877
|
}), u;
|
|
1720
1878
|
};
|
|
1721
|
-
return s.associations = l(
|
|
1879
|
+
return s.associations = l(r), r;
|
|
1722
1880
|
});
|
|
1723
1881
|
}
|
|
1724
|
-
_createAnimationTracks(e, t,
|
|
1725
|
-
const n = [],
|
|
1726
|
-
O[
|
|
1727
|
-
h.morphTargetInfluences &&
|
|
1728
|
-
}) :
|
|
1882
|
+
_createAnimationTracks(e, t, i, s, r) {
|
|
1883
|
+
const n = [], c = e.name ? e.name : e.uuid, a = [];
|
|
1884
|
+
O[r.path] === O.weights ? e.traverse(function(h) {
|
|
1885
|
+
h.morphTargetInfluences && a.push(h.name ? h.name : h.uuid);
|
|
1886
|
+
}) : a.push(c);
|
|
1729
1887
|
let l;
|
|
1730
|
-
switch (O[
|
|
1888
|
+
switch (O[r.path]) {
|
|
1731
1889
|
case O.weights:
|
|
1732
1890
|
l = we;
|
|
1733
1891
|
break;
|
|
1734
1892
|
case O.rotation:
|
|
1735
|
-
l =
|
|
1893
|
+
l = xe;
|
|
1736
1894
|
break;
|
|
1737
1895
|
case O.position:
|
|
1738
1896
|
case O.scale:
|
|
1739
1897
|
l = Ee;
|
|
1740
1898
|
break;
|
|
1741
1899
|
default:
|
|
1742
|
-
switch (
|
|
1900
|
+
switch (i.itemSize) {
|
|
1743
1901
|
case 1:
|
|
1744
1902
|
l = we;
|
|
1745
1903
|
break;
|
|
@@ -1751,10 +1909,10 @@ class Os {
|
|
|
1751
1909
|
}
|
|
1752
1910
|
break;
|
|
1753
1911
|
}
|
|
1754
|
-
const d = s.interpolation !== void 0 ?
|
|
1755
|
-
for (let h = 0, f =
|
|
1912
|
+
const d = s.interpolation !== void 0 ? As[s.interpolation] : Ke, u = this._getArrayFromAccessor(i);
|
|
1913
|
+
for (let h = 0, f = a.length; h < f; h++) {
|
|
1756
1914
|
const p = new l(
|
|
1757
|
-
|
|
1915
|
+
a[h] + "." + O[r.path],
|
|
1758
1916
|
t.array,
|
|
1759
1917
|
u,
|
|
1760
1918
|
d
|
|
@@ -1766,30 +1924,30 @@ class Os {
|
|
|
1766
1924
|
_getArrayFromAccessor(e) {
|
|
1767
1925
|
let t = e.array;
|
|
1768
1926
|
if (e.normalized) {
|
|
1769
|
-
const
|
|
1770
|
-
for (let
|
|
1771
|
-
s[
|
|
1927
|
+
const i = pe(t.constructor), s = new Float32Array(t.length);
|
|
1928
|
+
for (let r = 0, n = t.length; r < n; r++)
|
|
1929
|
+
s[r] = t[r] * i;
|
|
1772
1930
|
t = s;
|
|
1773
1931
|
}
|
|
1774
1932
|
return t;
|
|
1775
1933
|
}
|
|
1776
1934
|
_createCubicSplineTrackInterpolant(e) {
|
|
1777
|
-
e.createInterpolant = function(
|
|
1778
|
-
const s = this instanceof
|
|
1779
|
-
return new s(this.times, this.values, this.getValueSize() / 3,
|
|
1935
|
+
e.createInterpolant = function(i) {
|
|
1936
|
+
const s = this instanceof xe ? gs : ze;
|
|
1937
|
+
return new s(this.times, this.values, this.getValueSize() / 3, i);
|
|
1780
1938
|
}, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
|
|
1781
1939
|
}
|
|
1782
1940
|
}
|
|
1783
|
-
function
|
|
1784
|
-
const
|
|
1785
|
-
if (
|
|
1786
|
-
const
|
|
1787
|
-
if (
|
|
1941
|
+
function Ls(o, e, t) {
|
|
1942
|
+
const i = e.attributes, s = new Ht();
|
|
1943
|
+
if (i.POSITION !== void 0) {
|
|
1944
|
+
const c = t.json.accessors[i.POSITION], a = c.min, l = c.max;
|
|
1945
|
+
if (a !== void 0 && l !== void 0) {
|
|
1788
1946
|
if (s.set(
|
|
1789
|
-
new F(
|
|
1947
|
+
new F(a[0], a[1], a[2]),
|
|
1790
1948
|
new F(l[0], l[1], l[2])
|
|
1791
|
-
),
|
|
1792
|
-
const d =
|
|
1949
|
+
), c.normalized) {
|
|
1950
|
+
const d = pe(H[c.componentType]);
|
|
1793
1951
|
s.min.multiplyScalar(d), s.max.multiplyScalar(d);
|
|
1794
1952
|
}
|
|
1795
1953
|
} else {
|
|
@@ -1798,442 +1956,343 @@ function Ns(c, e, t) {
|
|
|
1798
1956
|
}
|
|
1799
1957
|
} else
|
|
1800
1958
|
return;
|
|
1801
|
-
const
|
|
1802
|
-
if (
|
|
1803
|
-
const
|
|
1804
|
-
for (let l = 0, d =
|
|
1805
|
-
const u =
|
|
1959
|
+
const r = e.targets;
|
|
1960
|
+
if (r !== void 0) {
|
|
1961
|
+
const c = new F(), a = new F();
|
|
1962
|
+
for (let l = 0, d = r.length; l < d; l++) {
|
|
1963
|
+
const u = r[l];
|
|
1806
1964
|
if (u.POSITION !== void 0) {
|
|
1807
1965
|
const h = t.json.accessors[u.POSITION], f = h.min, p = h.max;
|
|
1808
1966
|
if (f !== void 0 && p !== void 0) {
|
|
1809
|
-
if (
|
|
1810
|
-
const A =
|
|
1811
|
-
|
|
1967
|
+
if (a.setX(Math.max(Math.abs(f[0]), Math.abs(p[0]))), a.setY(Math.max(Math.abs(f[1]), Math.abs(p[1]))), a.setZ(Math.max(Math.abs(f[2]), Math.abs(p[2]))), h.normalized) {
|
|
1968
|
+
const A = pe(H[h.componentType]);
|
|
1969
|
+
a.multiplyScalar(A);
|
|
1812
1970
|
}
|
|
1813
|
-
|
|
1971
|
+
c.max(a);
|
|
1814
1972
|
} else
|
|
1815
1973
|
console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
|
|
1816
1974
|
}
|
|
1817
1975
|
}
|
|
1818
|
-
s.expandByVector(
|
|
1976
|
+
s.expandByVector(c);
|
|
1819
1977
|
}
|
|
1820
|
-
|
|
1821
|
-
const n = new
|
|
1822
|
-
s.getCenter(n.center), n.radius = s.min.distanceTo(s.max) / 2,
|
|
1978
|
+
o.boundingBox = s;
|
|
1979
|
+
const n = new Ut();
|
|
1980
|
+
s.getCenter(n.center), n.radius = s.min.distanceTo(s.max) / 2, o.boundingSphere = n;
|
|
1823
1981
|
}
|
|
1824
|
-
function ve(
|
|
1825
|
-
const
|
|
1826
|
-
function
|
|
1827
|
-
return t.getDependency("accessor", n).then(function(
|
|
1828
|
-
|
|
1982
|
+
function ve(o, e, t) {
|
|
1983
|
+
const i = e.attributes, s = [];
|
|
1984
|
+
function r(n, c) {
|
|
1985
|
+
return t.getDependency("accessor", n).then(function(a) {
|
|
1986
|
+
o.setAttribute(c, a);
|
|
1829
1987
|
});
|
|
1830
1988
|
}
|
|
1831
|
-
for (const n in
|
|
1832
|
-
const
|
|
1833
|
-
|
|
1989
|
+
for (const n in i) {
|
|
1990
|
+
const c = fe[n] || n.toLowerCase();
|
|
1991
|
+
c in o.attributes || s.push(r(i[n], c));
|
|
1834
1992
|
}
|
|
1835
|
-
if (e.indices !== void 0 && !
|
|
1836
|
-
const n = t.getDependency("accessor", e.indices).then(function(
|
|
1837
|
-
|
|
1993
|
+
if (e.indices !== void 0 && !o.index) {
|
|
1994
|
+
const n = t.getDependency("accessor", e.indices).then(function(c) {
|
|
1995
|
+
o.setIndex(c);
|
|
1838
1996
|
});
|
|
1839
1997
|
s.push(n);
|
|
1840
1998
|
}
|
|
1841
|
-
return
|
|
1842
|
-
return e.targets !== void 0 ?
|
|
1999
|
+
return ue.workingColorSpace !== S && "COLOR_0" in i && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${ue.workingColorSpace}" not supported.`), C(o, e), Ls(o, e, t), Promise.all(s).then(function() {
|
|
2000
|
+
return e.targets !== void 0 ? _s(o, e.targets, t) : o;
|
|
1843
2001
|
});
|
|
1844
2002
|
}
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
color: "Float32Array",
|
|
1857
|
-
uv: "Float32Array"
|
|
1858
|
-
};
|
|
1859
|
-
}
|
|
1860
|
-
setDecoderPath(e) {
|
|
1861
|
-
return this.decoderPath = e, this;
|
|
1862
|
-
}
|
|
1863
|
-
setDecoderConfig(e) {
|
|
1864
|
-
return this.decoderConfig = e, this;
|
|
1865
|
-
}
|
|
1866
|
-
setWorkerLimit(e) {
|
|
1867
|
-
return this.workerLimit = e, this;
|
|
1868
|
-
}
|
|
1869
|
-
load(e, t, r, s) {
|
|
1870
|
-
const i = new $(this.manager);
|
|
1871
|
-
i.setPath(this.path), i.setResponseType("arraybuffer"), i.setRequestHeader(this.requestHeader), i.setWithCredentials(this.withCredentials), i.load(e, (n) => {
|
|
1872
|
-
this.parse(n, t, s);
|
|
1873
|
-
}, r, s);
|
|
1874
|
-
}
|
|
1875
|
-
parse(e, t, r = () => {
|
|
1876
|
-
}) {
|
|
1877
|
-
this.decodeDracoFile(e, t, null, null, N, r).catch(r);
|
|
2003
|
+
var bs = Object.defineProperty, Ss = Object.getOwnPropertyDescriptor, vs = (o, e, t, i) => {
|
|
2004
|
+
for (var s = i > 1 ? void 0 : i ? Ss(e, t) : e, r = o.length - 1, n; r >= 0; r--)
|
|
2005
|
+
(n = o[r]) && (s = (i ? n(e, t, s) : n(s)) || s);
|
|
2006
|
+
return i && s && bs(e, t, s), s;
|
|
2007
|
+
};
|
|
2008
|
+
let q = class {
|
|
2009
|
+
constructor() {
|
|
2010
|
+
_(this, "workerPool", $e(void 0, !0));
|
|
2011
|
+
_(this, "canvas");
|
|
2012
|
+
_(this, "worker");
|
|
2013
|
+
_(this, "thread");
|
|
1878
2014
|
}
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
const a = {
|
|
1882
|
-
attributeIDs: r || this.defaultAttributeIDs,
|
|
1883
|
-
attributeTypes: s || this.defaultAttributeTypes,
|
|
1884
|
-
useUniqueIDs: !!r,
|
|
1885
|
-
vertexColorSpace: i
|
|
1886
|
-
};
|
|
1887
|
-
return this.decodeGeometry(e, a).then(t).catch(n);
|
|
2015
|
+
init(o) {
|
|
2016
|
+
this.worker = o.worker, this.thread = o.thread;
|
|
1888
2017
|
}
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
}))).then((o) => this._createGeometry(o.geometry));
|
|
1904
|
-
return a.catch(() => !0).then(() => {
|
|
1905
|
-
s && i && this._releaseTask(s, i);
|
|
1906
|
-
}), ae.set(e, {
|
|
1907
|
-
key: r,
|
|
1908
|
-
promise: a
|
|
1909
|
-
}), a;
|
|
2018
|
+
};
|
|
2019
|
+
q = vs([
|
|
2020
|
+
V()
|
|
2021
|
+
], q);
|
|
2022
|
+
var Cs = Object.defineProperty, Ms = Object.getOwnPropertyDescriptor, Is = (o, e, t, i) => {
|
|
2023
|
+
for (var s = i > 1 ? void 0 : i ? Ms(e, t) : e, r = o.length - 1, n; r >= 0; r--)
|
|
2024
|
+
(n = o[r]) && (s = (i ? n(e, t, s) : n(s)) || s);
|
|
2025
|
+
return i && s && Cs(e, t, s), s;
|
|
2026
|
+
}, Os = (o, e) => (t, i) => e(t, i, o);
|
|
2027
|
+
let me = class extends qe {
|
|
2028
|
+
constructor(e) {
|
|
2029
|
+
super();
|
|
2030
|
+
_(this, "canvas");
|
|
2031
|
+
this._service = e;
|
|
1910
2032
|
}
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
2033
|
+
init(e) {
|
|
2034
|
+
this.canvas = e;
|
|
2035
|
+
for (const t of Ce) {
|
|
2036
|
+
const i = 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;
|
|
2037
|
+
this[`${t}$`] = Ye(
|
|
2038
|
+
t === "resize" ? window : e,
|
|
2039
|
+
t
|
|
2040
|
+
).pipe(
|
|
2041
|
+
// @ts-ignore
|
|
2042
|
+
ce(i.bind(this)),
|
|
2043
|
+
Me((s) => !(t === "keydown" && !s))
|
|
2044
|
+
), this[`${t}$`].subscribe((s) => {
|
|
2045
|
+
var r, n;
|
|
2046
|
+
(n = (r = this._service.thread) == null ? void 0 : r[t]) == null || n.call(r, s);
|
|
2047
|
+
});
|
|
1917
2048
|
}
|
|
1918
|
-
return t;
|
|
1919
|
-
}
|
|
1920
|
-
_assignVertexColorSpace(e, t) {
|
|
1921
|
-
if (t !== N) return;
|
|
1922
|
-
const r = new D();
|
|
1923
|
-
for (let s = 0, i = e.count; s < i; s++)
|
|
1924
|
-
r.fromBufferAttribute(e, s), fe.toWorkingColorSpace(r, N), e.setXYZ(s, r.r, r.g, r.b);
|
|
1925
|
-
}
|
|
1926
|
-
_loadLibrary(e, t) {
|
|
1927
|
-
const r = new $(this.manager);
|
|
1928
|
-
return r.setPath(this.decoderPath), r.setResponseType(t), r.setWithCredentials(this.withCredentials), new Promise((s, i) => {
|
|
1929
|
-
r.load(e, s, void 0, i);
|
|
1930
|
-
});
|
|
1931
|
-
}
|
|
1932
|
-
preload() {
|
|
1933
|
-
return this._initDecoder(), this;
|
|
1934
|
-
}
|
|
1935
|
-
_initDecoder() {
|
|
1936
|
-
if (this.decoderPending) return this.decoderPending;
|
|
1937
|
-
const e = typeof WebAssembly != "object" || this.decoderConfig.type === "js", t = [];
|
|
1938
|
-
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((r) => {
|
|
1939
|
-
const s = r[0];
|
|
1940
|
-
e || (this.decoderConfig.wasmBinary = r[1]);
|
|
1941
|
-
const i = Ps.toString(), n = [
|
|
1942
|
-
"/* draco decoder */",
|
|
1943
|
-
s,
|
|
1944
|
-
"",
|
|
1945
|
-
"/* worker */",
|
|
1946
|
-
i.substring(i.indexOf("{") + 1, i.lastIndexOf("}"))
|
|
1947
|
-
].join(`
|
|
1948
|
-
`);
|
|
1949
|
-
this.workerSourceURL = URL.createObjectURL(new Blob([n]));
|
|
1950
|
-
}), this.decoderPending;
|
|
1951
2049
|
}
|
|
1952
|
-
|
|
1953
|
-
return
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
s._callbacks = {}, s._taskCosts = {}, s._taskLoad = 0, s.postMessage({ type: "init", decoderConfig: this.decoderConfig }), s.onmessage = function(i) {
|
|
1957
|
-
const n = i.data;
|
|
1958
|
-
switch (n.type) {
|
|
1959
|
-
case "decode":
|
|
1960
|
-
s._callbacks[n.id].resolve(n);
|
|
1961
|
-
break;
|
|
1962
|
-
case "error":
|
|
1963
|
-
s._callbacks[n.id].reject(n);
|
|
1964
|
-
break;
|
|
1965
|
-
default:
|
|
1966
|
-
console.error('THREE.DRACOLoader: Unexpected message, "' + n.type + '"');
|
|
1967
|
-
}
|
|
1968
|
-
}, this.workerPool.push(s);
|
|
1969
|
-
} else
|
|
1970
|
-
this.workerPool.sort(function(s, i) {
|
|
1971
|
-
return s._taskLoad > i._taskLoad ? -1 : 1;
|
|
1972
|
-
});
|
|
1973
|
-
const r = this.workerPool[this.workerPool.length - 1];
|
|
1974
|
-
return r._taskCosts[e] = t, r._taskLoad += t, r;
|
|
1975
|
-
});
|
|
2050
|
+
preventDefaultHandler(e) {
|
|
2051
|
+
return e.preventDefault(), {
|
|
2052
|
+
type: e.type
|
|
2053
|
+
};
|
|
1976
2054
|
}
|
|
1977
|
-
|
|
1978
|
-
|
|
2055
|
+
getScreenSizes() {
|
|
2056
|
+
return {
|
|
2057
|
+
width: this.canvas.width,
|
|
2058
|
+
height: this.canvas.height,
|
|
2059
|
+
windowWidth: (window == null ? void 0 : window.innerWidth) ?? 0,
|
|
2060
|
+
windowHeight: (window == null ? void 0 : window.innerHeight) ?? 0
|
|
2061
|
+
};
|
|
1979
2062
|
}
|
|
1980
|
-
|
|
1981
|
-
|
|
2063
|
+
uiEventHandler(e) {
|
|
2064
|
+
const t = this.canvas.getBoundingClientRect();
|
|
2065
|
+
return {
|
|
2066
|
+
...this.getScreenSizes(),
|
|
2067
|
+
type: e.type,
|
|
2068
|
+
top: t.top,
|
|
2069
|
+
left: t.left
|
|
2070
|
+
};
|
|
1982
2071
|
}
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
this.
|
|
1986
|
-
|
|
2072
|
+
mouseEventHandler(e) {
|
|
2073
|
+
return {
|
|
2074
|
+
...this.getScreenSizes(),
|
|
2075
|
+
...ee(e, [
|
|
2076
|
+
"ctrlKey",
|
|
2077
|
+
"metaKey",
|
|
2078
|
+
"shiftKey",
|
|
2079
|
+
"button",
|
|
2080
|
+
"pointerType",
|
|
2081
|
+
"clientX",
|
|
2082
|
+
"clientY",
|
|
2083
|
+
"pageX",
|
|
2084
|
+
"pageY"
|
|
2085
|
+
])
|
|
2086
|
+
};
|
|
1987
2087
|
}
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
c.onModuleLoaded = function(u) {
|
|
1997
|
-
d({ draco: u });
|
|
1998
|
-
}, DracoDecoderModule(c);
|
|
1999
|
-
});
|
|
2000
|
-
break;
|
|
2001
|
-
case "decode":
|
|
2002
|
-
const o = a.buffer, l = a.taskConfig;
|
|
2003
|
-
e.then((d) => {
|
|
2004
|
-
const u = d.draco, h = new u.Decoder();
|
|
2005
|
-
try {
|
|
2006
|
-
const f = t(u, h, new Int8Array(o), l), p = f.attributes.map((A) => A.array.buffer);
|
|
2007
|
-
f.index && p.push(f.index.array.buffer), self.postMessage({ type: "decode", id: a.id, geometry: f }, p);
|
|
2008
|
-
} catch (f) {
|
|
2009
|
-
console.error(f), self.postMessage({ type: "error", id: a.id, error: f.message });
|
|
2010
|
-
} finally {
|
|
2011
|
-
u.destroy(h);
|
|
2012
|
-
}
|
|
2013
|
-
});
|
|
2014
|
-
break;
|
|
2015
|
-
}
|
|
2016
|
-
};
|
|
2017
|
-
function t(n, a, o, l) {
|
|
2018
|
-
const d = l.attributeIDs, u = l.attributeTypes;
|
|
2019
|
-
let h, f;
|
|
2020
|
-
const p = a.GetEncodedGeometryType(o);
|
|
2021
|
-
if (p === n.TRIANGULAR_MESH)
|
|
2022
|
-
h = new n.Mesh(), f = a.DecodeArrayToMesh(o, o.byteLength, h);
|
|
2023
|
-
else if (p === n.POINT_CLOUD)
|
|
2024
|
-
h = new n.PointCloud(), f = a.DecodeArrayToPointCloud(o, o.byteLength, h);
|
|
2025
|
-
else
|
|
2026
|
-
throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
|
|
2027
|
-
if (!f.ok() || h.ptr === 0)
|
|
2028
|
-
throw new Error("THREE.DRACOLoader: Decoding failed: " + f.error_msg());
|
|
2029
|
-
const A = { index: null, attributes: [] };
|
|
2030
|
-
for (const m in d) {
|
|
2031
|
-
const g = self[u[m]];
|
|
2032
|
-
let _, w;
|
|
2033
|
-
if (l.useUniqueIDs)
|
|
2034
|
-
w = d[m], _ = a.GetAttributeByUniqueId(h, w);
|
|
2035
|
-
else {
|
|
2036
|
-
if (w = a.GetAttributeId(h, n[d[m]]), w === -1) continue;
|
|
2037
|
-
_ = a.GetAttribute(h, w);
|
|
2038
|
-
}
|
|
2039
|
-
const R = s(n, a, h, m, g, _);
|
|
2040
|
-
m === "color" && (R.vertexColorSpace = l.vertexColorSpace), A.attributes.push(R);
|
|
2088
|
+
touchEventHandler(e) {
|
|
2089
|
+
const t = [], i = { type: e.type, touches: t };
|
|
2090
|
+
for (let s = 0; s < e.touches.length; ++s) {
|
|
2091
|
+
const r = e.touches[s];
|
|
2092
|
+
t.push({
|
|
2093
|
+
pageX: (r == null ? void 0 : r.pageX) ?? 0,
|
|
2094
|
+
pageY: (r == null ? void 0 : r.pageY) ?? 0
|
|
2095
|
+
});
|
|
2041
2096
|
}
|
|
2042
|
-
return
|
|
2043
|
-
}
|
|
2044
|
-
function r(n, a, o) {
|
|
2045
|
-
const d = o.num_faces() * 3, u = d * 4, h = n._malloc(u);
|
|
2046
|
-
a.GetTrianglesUInt32Array(o, u, h);
|
|
2047
|
-
const f = new Uint32Array(n.HEAPF32.buffer, h, d).slice();
|
|
2048
|
-
return n._free(h), { array: f, itemSize: 1 };
|
|
2097
|
+
return { ...this.getScreenSizes(), ...i };
|
|
2049
2098
|
}
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
return n._free(g), {
|
|
2055
|
-
name: l,
|
|
2056
|
-
array: _,
|
|
2057
|
-
itemSize: h
|
|
2099
|
+
wheelEventHandler(e) {
|
|
2100
|
+
return e.preventDefault(), {
|
|
2101
|
+
...this.getScreenSizes(),
|
|
2102
|
+
...ee(e, ["deltaX", "deltaY"])
|
|
2058
2103
|
};
|
|
2059
2104
|
}
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
case Int16Array:
|
|
2067
|
-
return n.DT_INT16;
|
|
2068
|
-
case Int32Array:
|
|
2069
|
-
return n.DT_INT32;
|
|
2070
|
-
case Uint8Array:
|
|
2071
|
-
return n.DT_UINT8;
|
|
2072
|
-
case Uint16Array:
|
|
2073
|
-
return n.DT_UINT16;
|
|
2074
|
-
case Uint32Array:
|
|
2075
|
-
return n.DT_UINT32;
|
|
2076
|
-
}
|
|
2105
|
+
keyEventHandler(e) {
|
|
2106
|
+
if (Qe.includes(e.code))
|
|
2107
|
+
return e.preventDefault(), {
|
|
2108
|
+
...this.getScreenSizes(),
|
|
2109
|
+
...ee(e, ["ctrlKey", "metaKey", "shiftKey", "keyCode"])
|
|
2110
|
+
};
|
|
2077
2111
|
}
|
|
2078
|
-
}
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2112
|
+
};
|
|
2113
|
+
me = Is([
|
|
2114
|
+
V(),
|
|
2115
|
+
Os(0, L(q))
|
|
2116
|
+
], me);
|
|
2117
|
+
var Ns = Object.defineProperty, Ps = Object.getOwnPropertyDescriptor, Ds = (o, e, t, i) => {
|
|
2118
|
+
for (var s = i > 1 ? void 0 : i ? Ps(e, t) : e, r = o.length - 1, n; r >= 0; r--)
|
|
2119
|
+
(n = o[r]) && (s = (i ? n(e, t, s) : n(s)) || s);
|
|
2120
|
+
return i && s && Ns(e, t, s), s;
|
|
2083
2121
|
};
|
|
2084
2122
|
let Y = class {
|
|
2085
2123
|
constructor() {
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2124
|
+
_(this, "loadingManager", new Bt());
|
|
2125
|
+
_(this, "loaders", {});
|
|
2126
|
+
_(this, "sources", []);
|
|
2127
|
+
_(this, "loadedResources", {});
|
|
2128
|
+
_(this, "toLoadCount", 0);
|
|
2129
|
+
_(this, "loadedCount", 0);
|
|
2092
2130
|
}
|
|
2093
2131
|
/** @description The video loader. based on {@link HTMLVideoElement}. */
|
|
2094
2132
|
get videoLoader() {
|
|
2095
2133
|
return {
|
|
2096
|
-
load: (
|
|
2134
|
+
load: (o, e) => {
|
|
2097
2135
|
const t = document.createElement("video");
|
|
2098
|
-
t.muted = !0, t.loop = !0, t.controls = !1, t.playsInline = !0, t.src =
|
|
2099
|
-
|
|
2136
|
+
t.muted = !0, t.loop = !0, t.crossOrigin = "anonymous", t.controls = !1, t.playsInline = !0, t.src = o, t.autoplay = !0;
|
|
2137
|
+
async function i(r) {
|
|
2138
|
+
const n = new OffscreenCanvas(
|
|
2139
|
+
r.videoWidth,
|
|
2140
|
+
r.videoHeight
|
|
2141
|
+
), c = n.getContext("2d"), a = 30, l = [];
|
|
2142
|
+
return console.log("Extracting frames from video"), new Promise((d) => {
|
|
2143
|
+
for (r.currentTime = 0; r.currentTime < r.duration; ) {
|
|
2144
|
+
c == null || c.drawImage(
|
|
2145
|
+
r,
|
|
2146
|
+
0,
|
|
2147
|
+
0,
|
|
2148
|
+
n.width,
|
|
2149
|
+
n.height
|
|
2150
|
+
);
|
|
2151
|
+
const u = n.transferToImageBitmap();
|
|
2152
|
+
l.push(u), r.currentTime < r.duration && (r.currentTime += 1 / a);
|
|
2153
|
+
}
|
|
2154
|
+
d(l), r.onerror = (u) => {
|
|
2155
|
+
console.error("Error while extracting frames:", u);
|
|
2156
|
+
}, r.currentTime = 0;
|
|
2157
|
+
});
|
|
2158
|
+
}
|
|
2159
|
+
const s = async () => {
|
|
2100
2160
|
if (!t) return;
|
|
2101
|
-
t
|
|
2102
|
-
|
|
2103
|
-
s.dispose = () => {
|
|
2104
|
-
var n;
|
|
2105
|
-
(n = s.image) == null || n.remove(), i();
|
|
2106
|
-
}, e(s), t.removeEventListener("canplaythrough", r);
|
|
2161
|
+
const r = await i(t);
|
|
2162
|
+
console.log("Video loaded", r), e(r), t.removeEventListener("loadeddata", s);
|
|
2107
2163
|
};
|
|
2108
|
-
t.addEventListener("
|
|
2164
|
+
t.addEventListener("loadeddata", s);
|
|
2109
2165
|
}
|
|
2110
2166
|
};
|
|
2111
2167
|
}
|
|
2112
2168
|
_initLoaders() {
|
|
2113
|
-
this.loaders.
|
|
2169
|
+
this.loaders.dracoLoader = new Kt(this.loadingManager), this.loaders.audioLoader = new jt(this.loadingManager), this.loaders.gltfLoader = new zt(this.loadingManager), this.loaders.imageLoader = new Ue(this.loadingManager), this.loaders.videoLoader = this.videoLoader;
|
|
2114
2170
|
}
|
|
2115
|
-
_initSources(
|
|
2116
|
-
this.sources =
|
|
2171
|
+
_initSources(o) {
|
|
2172
|
+
this.sources = o, this.toLoadCount = this.sources.length, this.loadedCount = 0;
|
|
2117
2173
|
}
|
|
2118
|
-
init(
|
|
2119
|
-
this._initLoaders(), this._initSources(
|
|
2174
|
+
init(o = []) {
|
|
2175
|
+
this._initLoaders(), this._initSources(o);
|
|
2120
2176
|
}
|
|
2121
|
-
setDracoDecoder(
|
|
2177
|
+
setDracoDecoder(o) {
|
|
2122
2178
|
var e;
|
|
2123
2179
|
this.loaders.dracoLoader && (this.loaders.dracoLoader.setDecoderPath(
|
|
2124
|
-
|
|
2180
|
+
o ?? "https://www.gstatic.com/draco/versioned/decoders/1.4.3/"
|
|
2125
2181
|
), (e = this.loaders.gltfLoader) == null || e.setDRACOLoader(this.loaders.dracoLoader));
|
|
2126
2182
|
}
|
|
2127
2183
|
handleLoad({
|
|
2128
|
-
source:
|
|
2184
|
+
source: o,
|
|
2129
2185
|
resource: e,
|
|
2130
2186
|
toLoadCount: t,
|
|
2131
|
-
loadedCount:
|
|
2187
|
+
loadedCount: i
|
|
2132
2188
|
}) {
|
|
2133
|
-
e && (this.loadedResources[
|
|
2189
|
+
e && (this.loadedResources[o.name] = e, this.loadedCount = i, this.toLoadCount = t);
|
|
2190
|
+
}
|
|
2191
|
+
load(o) {
|
|
2192
|
+
var t, i, s, r;
|
|
2193
|
+
const e = this.sources[0];
|
|
2194
|
+
if (e) {
|
|
2195
|
+
o == null || o(e);
|
|
2196
|
+
for (const n of this.sources) {
|
|
2197
|
+
if (this.loadedResources[n.name] || typeof n.path != "string")
|
|
2198
|
+
return;
|
|
2199
|
+
n.type === "gltf" && ((t = this.loaders.gltfLoader) == null || t.load(
|
|
2200
|
+
n.path,
|
|
2201
|
+
(c) => o == null ? void 0 : o(n, c)
|
|
2202
|
+
)), n.type === "audio" && ((i = this.loaders.audioLoader) == null || i.load(n.path, (c) => {
|
|
2203
|
+
o == null || o(n, c);
|
|
2204
|
+
})), n.type === "image" && ((s = this.loaders.imageLoader) == null || s.load(n.path, (c) => {
|
|
2205
|
+
o == null || o(n, c);
|
|
2206
|
+
})), n.type === "video" && ((r = this.loaders.videoLoader) == null || r.load(
|
|
2207
|
+
n.path,
|
|
2208
|
+
(c) => o == null ? void 0 : o(n, c)
|
|
2209
|
+
));
|
|
2210
|
+
}
|
|
2211
|
+
}
|
|
2134
2212
|
}
|
|
2135
2213
|
};
|
|
2136
|
-
Y =
|
|
2214
|
+
Y = Ds([
|
|
2137
2215
|
V()
|
|
2138
2216
|
], Y);
|
|
2139
|
-
var
|
|
2140
|
-
for (var s =
|
|
2141
|
-
(n =
|
|
2142
|
-
return
|
|
2143
|
-
},
|
|
2217
|
+
var ks = Object.defineProperty, Fs = Object.getOwnPropertyDescriptor, Hs = (o, e, t, i) => {
|
|
2218
|
+
for (var s = i > 1 ? void 0 : i ? Fs(e, t) : e, r = o.length - 1, n; r >= 0; r--)
|
|
2219
|
+
(n = o[r]) && (s = (i ? n(e, t, s) : n(s)) || s);
|
|
2220
|
+
return i && s && ks(e, t, s), s;
|
|
2221
|
+
}, Us = (o, e) => (t, i) => e(t, i, o);
|
|
2144
2222
|
let Q = class {
|
|
2145
|
-
constructor(
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
...
|
|
2150
|
-
loadedCount:
|
|
2223
|
+
constructor(o) {
|
|
2224
|
+
_(this, "load$$", new Je());
|
|
2225
|
+
_(this, "load$", this.load$$.pipe(
|
|
2226
|
+
ce((o) => ({
|
|
2227
|
+
...o,
|
|
2228
|
+
loadedCount: o.resource ? this._service.loadedCount + 1 : this._service.loadedCount,
|
|
2151
2229
|
toLoadCount: this._service.toLoadCount
|
|
2152
2230
|
})),
|
|
2153
|
-
|
|
2231
|
+
Ze()
|
|
2154
2232
|
));
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
var t;
|
|
2158
|
-
let e =
|
|
2159
|
-
if ((t =
|
|
2160
|
-
const r =
|
|
2233
|
+
_(this, "serializedLoad$", this.load$.pipe(
|
|
2234
|
+
ce((o) => {
|
|
2235
|
+
var t, i;
|
|
2236
|
+
let e = o.resource;
|
|
2237
|
+
if ((t = o == null ? void 0 : o.resource) != null && t.parser) {
|
|
2238
|
+
const s = o.resource, r = s.scenes.map(
|
|
2239
|
+
(n) => Te(n)
|
|
2240
|
+
);
|
|
2161
2241
|
e = {
|
|
2162
|
-
animations: (
|
|
2242
|
+
animations: (o == null ? void 0 : o.resource).animations.map(
|
|
2163
2243
|
// @ts-ignore <<toJSON methods doesn't require a parameter>>
|
|
2164
|
-
(
|
|
2244
|
+
(n) => n.toJSON()
|
|
2165
2245
|
),
|
|
2166
|
-
cameras:
|
|
2167
|
-
(
|
|
2246
|
+
cameras: s.cameras.map(
|
|
2247
|
+
(n) => Te(n)
|
|
2168
2248
|
),
|
|
2169
|
-
parser: { json:
|
|
2170
|
-
scene:
|
|
2171
|
-
scenes: r
|
|
2172
|
-
userData:
|
|
2249
|
+
parser: { json: s.parser.json },
|
|
2250
|
+
scene: r == null ? void 0 : r[0],
|
|
2251
|
+
scenes: r,
|
|
2252
|
+
userData: s.userData
|
|
2173
2253
|
};
|
|
2174
2254
|
}
|
|
2175
|
-
return (
|
|
2176
|
-
...
|
|
2255
|
+
return ((i = o == null ? void 0 : o.source) == null ? void 0 : i.type) === "video" && Array.isArray(o.resource) && console.log("Serialized Texture ===>", o.resource), {
|
|
2256
|
+
...o,
|
|
2177
2257
|
resource: e
|
|
2178
2258
|
};
|
|
2179
2259
|
})
|
|
2180
2260
|
));
|
|
2181
|
-
|
|
2182
|
-
Me((
|
|
2261
|
+
_(this, "loadCompleted$", this.load$.pipe(
|
|
2262
|
+
Me((o) => o.toLoadCount === o.loadedCount)
|
|
2183
2263
|
));
|
|
2184
|
-
this._service =
|
|
2264
|
+
this._service = o;
|
|
2185
2265
|
}
|
|
2186
2266
|
};
|
|
2187
|
-
Q =
|
|
2267
|
+
Q = Hs([
|
|
2188
2268
|
V(),
|
|
2189
|
-
|
|
2269
|
+
Us(0, L(Y))
|
|
2190
2270
|
], Q);
|
|
2191
|
-
var
|
|
2192
|
-
for (var s =
|
|
2193
|
-
(n =
|
|
2194
|
-
return
|
|
2195
|
-
},
|
|
2271
|
+
var Gs = Object.defineProperty, Bs = Object.getOwnPropertyDescriptor, js = (o, e, t, i) => {
|
|
2272
|
+
for (var s = i > 1 ? void 0 : i ? Bs(e, t) : e, r = o.length - 1, n; r >= 0; r--)
|
|
2273
|
+
(n = o[r]) && (s = (i ? n(e, t, s) : n(s)) || s);
|
|
2274
|
+
return i && s && Gs(e, t, s), s;
|
|
2275
|
+
}, ae = (o, e) => (t, i) => e(t, i, o);
|
|
2196
2276
|
let J = class {
|
|
2197
|
-
constructor(
|
|
2198
|
-
|
|
2199
|
-
this._controller =
|
|
2277
|
+
constructor(o, e, t) {
|
|
2278
|
+
_(this, "_subscriptions", []);
|
|
2279
|
+
this._controller = o, this._service = e, this._props = t, this._subscriptions.push(
|
|
2200
2280
|
this._controller.load$.subscribe(
|
|
2201
2281
|
this._service.handleLoad.bind(this._service)
|
|
2202
2282
|
)
|
|
2203
2283
|
);
|
|
2204
2284
|
}
|
|
2205
|
-
|
|
2285
|
+
_listenToLoad(o, e) {
|
|
2206
2286
|
this._controller.load$$.next({
|
|
2207
|
-
source:
|
|
2287
|
+
source: o,
|
|
2208
2288
|
resource: e
|
|
2209
2289
|
});
|
|
2210
2290
|
}
|
|
2211
|
-
init(
|
|
2212
|
-
this._service.init(
|
|
2291
|
+
init(o = []) {
|
|
2292
|
+
this._service.init(o), this._service.setDracoDecoder(), [void 0, !0].includes(this._props.loadResourcesOnInit) && this.load();
|
|
2213
2293
|
}
|
|
2214
2294
|
load() {
|
|
2215
|
-
|
|
2216
|
-
const c = this._service.sources[0];
|
|
2217
|
-
if (c) {
|
|
2218
|
-
this._performLoad(c);
|
|
2219
|
-
for (const n of this._service.sources) {
|
|
2220
|
-
if (this._service.loadedResources[n.name]) return;
|
|
2221
|
-
n.type === "gltfModel" && typeof n.path == "string" && ((e = this._service.loaders.gltfLoader) == null || e.load(
|
|
2222
|
-
n.path,
|
|
2223
|
-
(a) => this._performLoad(n, a)
|
|
2224
|
-
)), n.type === "texture" && typeof n.path == "string" && ((t = this._service.loaders.textureLoader) == null || t.load(n.path, (a) => {
|
|
2225
|
-
this._performLoad(n, new zt(a));
|
|
2226
|
-
})), n.type === "cubeTexture" && typeof n.path == "object" && ((r = this._service.loaders.cubeTextureLoader) == null || r.load(
|
|
2227
|
-
n.path,
|
|
2228
|
-
(a) => this._performLoad(n, a)
|
|
2229
|
-
)), n.type === "video" && typeof n.path == "string" && ((s = this._service.loaders.videoLoader) == null || s.load(
|
|
2230
|
-
n.path,
|
|
2231
|
-
(a) => this._performLoad(n, a)
|
|
2232
|
-
)), n.type === "audio" && typeof n.path == "string" && ((i = this._service.loaders.audioLoader) == null || i.load(n.path, (a) => {
|
|
2233
|
-
this._performLoad(n, a);
|
|
2234
|
-
}));
|
|
2235
|
-
}
|
|
2236
|
-
}
|
|
2295
|
+
this._service.load(this._listenToLoad.bind(this));
|
|
2237
2296
|
}
|
|
2238
2297
|
getLoadedResources() {
|
|
2239
2298
|
return this._service.loadedResources;
|
|
@@ -2256,30 +2315,30 @@ let J = class {
|
|
|
2256
2315
|
getLoadCompleted$() {
|
|
2257
2316
|
return this._controller.loadCompleted$;
|
|
2258
2317
|
}
|
|
2259
|
-
setDracoDecoder(
|
|
2260
|
-
this._service.setDracoDecoder(
|
|
2318
|
+
setDracoDecoder(o) {
|
|
2319
|
+
this._service.setDracoDecoder(o);
|
|
2261
2320
|
}
|
|
2262
2321
|
dispose() {
|
|
2263
2322
|
this._controller.load$$.complete();
|
|
2264
2323
|
}
|
|
2265
2324
|
};
|
|
2266
|
-
J =
|
|
2325
|
+
J = js([
|
|
2267
2326
|
V(),
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2327
|
+
ae(0, L(Q)),
|
|
2328
|
+
ae(1, L(Y)),
|
|
2329
|
+
ae(2, L(Ae))
|
|
2271
2330
|
], J);
|
|
2272
2331
|
Ie.resolve(J);
|
|
2273
|
-
var
|
|
2274
|
-
for (var s =
|
|
2275
|
-
(n =
|
|
2276
|
-
return
|
|
2277
|
-
}, k = (
|
|
2278
|
-
let
|
|
2279
|
-
constructor(e, t,
|
|
2332
|
+
var Ks = Object.defineProperty, Vs = Object.getOwnPropertyDescriptor, zs = (o, e, t, i) => {
|
|
2333
|
+
for (var s = i > 1 ? void 0 : i ? Vs(e, t) : e, r = o.length - 1, n; r >= 0; r--)
|
|
2334
|
+
(n = o[r]) && (s = (i ? n(e, t, s) : n(s)) || s);
|
|
2335
|
+
return i && s && Ks(e, t, s), s;
|
|
2336
|
+
}, k = (o, e) => (t, i) => e(t, i, o);
|
|
2337
|
+
let ge = class extends st {
|
|
2338
|
+
constructor(e, t, i, s, r, n) {
|
|
2280
2339
|
super();
|
|
2281
|
-
|
|
2282
|
-
this._service = e, this._controller = t, this._loaderController =
|
|
2340
|
+
_(this, "initialized", !1);
|
|
2341
|
+
this._service = e, this._controller = t, this._loaderController = i, this.props = s, this.loader = r, this.container = n, this.props.initOnConstruct && this.init();
|
|
2283
2342
|
}
|
|
2284
2343
|
async _initCanvas() {
|
|
2285
2344
|
try {
|
|
@@ -2314,11 +2373,11 @@ ${e instanceof Error ? e.message : "Something went wrong"}`
|
|
|
2314
2373
|
throw new Error("Canvas element is not initialized.");
|
|
2315
2374
|
const e = this._service.canvas.transferControlToOffscreen();
|
|
2316
2375
|
e.width = this._service.canvas.clientWidth, e.height = this._service.canvas.clientHeight;
|
|
2317
|
-
const [t,
|
|
2376
|
+
const [t, i] = await this._service.workerPool.run({
|
|
2318
2377
|
payload: {
|
|
2319
2378
|
path: this.props.location,
|
|
2320
2379
|
subject: {
|
|
2321
|
-
...
|
|
2380
|
+
...nt(this.props, [
|
|
2322
2381
|
"canvas",
|
|
2323
2382
|
"location",
|
|
2324
2383
|
"onReady",
|
|
@@ -2329,7 +2388,7 @@ ${e instanceof Error ? e.message : "Something went wrong"}`
|
|
|
2329
2388
|
transferSubject: [e]
|
|
2330
2389
|
}
|
|
2331
2390
|
});
|
|
2332
|
-
if (!t ||
|
|
2391
|
+
if (!t || i)
|
|
2333
2392
|
throw new Error("Unable to retrieve the worker-thread info.");
|
|
2334
2393
|
this._service.worker = t.worker, this._service.thread = t.thread;
|
|
2335
2394
|
}
|
|
@@ -2346,7 +2405,7 @@ ${e instanceof Error ? e.message : "Something went wrong"}`
|
|
|
2346
2405
|
(e) => {
|
|
2347
2406
|
var t;
|
|
2348
2407
|
return (t = this._service.worker) == null ? void 0 : t.postMessage({
|
|
2349
|
-
token:
|
|
2408
|
+
token: rt,
|
|
2350
2409
|
payload: e
|
|
2351
2410
|
});
|
|
2352
2411
|
}
|
|
@@ -2376,42 +2435,42 @@ ${e instanceof Error ? e.message : "Something went wrong"}`
|
|
|
2376
2435
|
await this._service.workerPool.terminateAll(), ((e = this._service.canvas) == null ? void 0 : e.dataset.reactive) === "true" && (this._service.canvas.remove(), this._service.canvas = void 0), this.initialized = !1;
|
|
2377
2436
|
}
|
|
2378
2437
|
};
|
|
2379
|
-
|
|
2380
|
-
tt
|
|
2381
|
-
k(0,
|
|
2382
|
-
k(1,
|
|
2383
|
-
k(2,
|
|
2384
|
-
k(3,
|
|
2385
|
-
k(4,
|
|
2386
|
-
k(5,
|
|
2387
|
-
],
|
|
2388
|
-
const
|
|
2389
|
-
if (typeof (
|
|
2438
|
+
ge = zs([
|
|
2439
|
+
et(tt.ContainerScoped),
|
|
2440
|
+
k(0, L(q)),
|
|
2441
|
+
k(1, L(me)),
|
|
2442
|
+
k(2, L(Q)),
|
|
2443
|
+
k(3, L(Ae)),
|
|
2444
|
+
k(4, L(J)),
|
|
2445
|
+
k(5, L(Oe))
|
|
2446
|
+
], ge);
|
|
2447
|
+
const Ys = (o) => {
|
|
2448
|
+
if (typeof (o == null ? void 0 : o.location) != "string" && !((o == null ? void 0 : o.location) instanceof URL))
|
|
2390
2449
|
throw new Error(
|
|
2391
2450
|
"Invalid register props detected. location path is required"
|
|
2392
2451
|
);
|
|
2393
2452
|
const e = Ie.createChildContainer();
|
|
2394
|
-
|
|
2395
|
-
const t = e.resolve(
|
|
2453
|
+
o.initOnConstruct = z(o.initOnConstruct) || !X(o.initOnConstruct) ? !0 : o.initOnConstruct, o.defaultCamera = o != null && o.defaultCamera && o.defaultCamera in _e ? o.defaultCamera : _e.PERSPECTIVE, o.withMiniCamera = z(o.withMiniCamera) || !X(o.withMiniCamera) ? !1 : o.withMiniCamera, o.startTimer = z(o.startTimer) || !X(o.startTimer) ? !0 : o.startTimer, o.fullScreen = z(o.fullScreen) || !X(o.fullScreen) ? !0 : o.fullScreen, o.onReady = it(o.onReady) ? o.onReady : void 0, e.register(Oe, { useValue: e }), e.register(Ae, { useValue: o });
|
|
2454
|
+
const t = e.resolve(ge);
|
|
2396
2455
|
return t.initialized = !0, {
|
|
2397
2456
|
container: e,
|
|
2398
2457
|
module: t
|
|
2399
2458
|
};
|
|
2400
2459
|
};
|
|
2401
2460
|
export {
|
|
2402
|
-
|
|
2403
|
-
|
|
2461
|
+
Zs as AppModule,
|
|
2462
|
+
en as AppProxyEventHandlersBlueprint,
|
|
2404
2463
|
Oe as CONTAINER_TOKEN,
|
|
2405
2464
|
_e as DefaultCameraType,
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2465
|
+
Qe as KEYBOARD_EVENT_CODES,
|
|
2466
|
+
rt as LOADER_SERIALIZED_LOAD_TOKEN,
|
|
2467
|
+
qs as LaunchAppProps,
|
|
2409
2468
|
Ce as PROXY_EVENT_LISTENERS,
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2469
|
+
qe as ProxyEventHandlersBlueprint,
|
|
2470
|
+
tn as ProxyEventObservablesBlueprint,
|
|
2471
|
+
sn as ProxyEventSubjectsBlueprint,
|
|
2472
|
+
ge as RegisterModule,
|
|
2473
|
+
Ae as RegisterPropsBlueprint,
|
|
2474
|
+
st as RegisterProxyEventHandlersBlueprint,
|
|
2475
|
+
Ys as register
|
|
2417
2476
|
};
|