aptechka 0.5.11 → 0.5.12
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/lib/en3/index.js
CHANGED
|
@@ -20,7 +20,7 @@ var g = (C, A, e) => (Le(C, A, "read from private field"), e ? e.call(C) : A.get
|
|
|
20
20
|
A instanceof WeakSet ? A.add(C) : A.set(C, e);
|
|
21
21
|
}, G = (C, A, e, s) => (Le(C, A, "write to private field"), s ? s.call(C, e) : A.set(C, e), e);
|
|
22
22
|
var fe = (C, A, e) => (Le(C, A, "access private method"), e);
|
|
23
|
-
var
|
|
23
|
+
var pA = (C, A, e) => new Promise((s, t) => {
|
|
24
24
|
var n = (o) => {
|
|
25
25
|
try {
|
|
26
26
|
B(e.next(o));
|
|
@@ -41,7 +41,7 @@ import { windowResizer as NA } from "../window-resizer/index.js";
|
|
|
41
41
|
import { ticker as kA } from "../ticker/index.js";
|
|
42
42
|
import { g as St } from "../dom-0S_WDL4g.js";
|
|
43
43
|
import "../path-data-polyfill-DgeDWYeI.js";
|
|
44
|
-
import { Mesh as Qe, OrthographicCamera as me, PerspectiveCamera as Xe, Scene as as, REVISION as Is, WebGLRenderer as gs, TextureLoader as Lt, TrianglesDrawMode as Es, TriangleFanDrawMode as ve, TriangleStripDrawMode as Jt, Loader as et, LoaderUtils as WA, FileLoader as
|
|
44
|
+
import { Mesh as Qe, OrthographicCamera as me, PerspectiveCamera as Xe, Scene as as, REVISION as Is, WebGLRenderer as gs, TextureLoader as Lt, TrianglesDrawMode as Es, TriangleFanDrawMode as ve, TriangleStripDrawMode as Jt, Loader as et, LoaderUtils as WA, FileLoader as FA, Color as EA, LinearSRGBColorSpace as P, SpotLight as cs, PointLight as Qs, DirectionalLight as hs, MeshBasicMaterial as qA, SRGBColorSpace as eA, MeshPhysicalMaterial as tA, Vector2 as Ht, Matrix4 as bA, Vector3 as y, Quaternion as tt, InstancedMesh as ls, InstancedBufferAttribute as ds, Object3D as st, ImageBitmapLoader as us, BufferAttribute as VA, InterleavedBuffer as fs, InterleavedBufferAttribute as Ds, LinearFilter as Me, LinearMipmapLinearFilter as nt, RepeatWrapping as We, PointsMaterial as Fs, Material as Je, LineBasicMaterial as Gs, MeshStandardMaterial as Tt, DoubleSide as Rs, PropertyBinding as ps, BufferGeometry as Ut, SkinnedMesh as ms, LineSegments as Ms, Line as ws, LineLoop as ys, Points as Ss, Group as jA, MathUtils as Ls, Skeleton as Js, AnimationClip as Hs, Bone as Ts, InterpolateLinear as xt, ColorManagement as rt, NearestFilter as Us, NearestMipmapNearestFilter as xs, LinearMipmapNearestFilter as Ns, NearestMipmapLinearFilter as ks, ClampToEdgeWrapping as bs, MirroredRepeatWrapping as Ks, InterpolateDiscrete as Os, FrontSide as _s, Texture as Ct, VectorKeyframeTrack as at, NumberKeyframeTrack as It, QuaternionKeyframeTrack as gt, Box3 as Ps, Sphere as Ys, Interpolant as qs, CompressedCubeTexture as Xs, UnsignedByteType as O, CompressedArrayTexture as vs, CompressedTexture as Nt, RGBAFormat as mA, RGBA_ASTC_4x4_Format as Ws, RGBA_BPTC_Format as Vs, RGBA_ETC2_EAC_Format as js, RGBA_PVRTC_4BPPV1_Format as Zs, RGBA_S3TC_DXT5_Format as zs, RGB_ETC1_Format as $s, RGB_ETC2_Format as An, RGB_PVRTC_4BPPV1_Format as en, RGB_S3TC_DXT1_Format as tn, FloatType as Re, HalfFloatType as pe, DataTexture as sn, Data3DTexture as nn, DisplayP3ColorSpace as on, LinearDisplayP3ColorSpace as Bn, NoColorSpace as Et, RGFormat as XA, RedFormat as vA, RGBA_ASTC_6x6_Format as ct, Plane as De, PlaneHelper as Fe, BoxGeometry as rn, VideoTexture as Cn } from "three";
|
|
45
45
|
import { LayoutBox as Ve } from "../layout-box/index.js";
|
|
46
46
|
import { loading as He } from "../loading/index.js";
|
|
47
47
|
import { S as an } from "../SourceManager-D_8MZ3bR.js";
|
|
@@ -64,18 +64,18 @@ function we(C) {
|
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
var ZA, J, lA,
|
|
67
|
+
var ZA, J, lA, oA, BA, wA, rA, CA;
|
|
68
68
|
class ht {
|
|
69
69
|
constructor(A, e) {
|
|
70
70
|
F(this, ZA, void 0);
|
|
71
71
|
F(this, J, void 0);
|
|
72
72
|
F(this, lA, void 0);
|
|
73
|
-
F(this, iA, void 0);
|
|
74
73
|
F(this, oA, void 0);
|
|
75
|
-
F(this, MA, void 0);
|
|
76
74
|
F(this, BA, void 0);
|
|
75
|
+
F(this, wA, void 0);
|
|
77
76
|
F(this, rA, void 0);
|
|
78
|
-
|
|
77
|
+
F(this, CA, void 0);
|
|
78
|
+
G(this, ZA, A), G(this, J, (e == null ? void 0 : e.cameraType) === "orthographic" ? new me() : new Xe()), G(this, lA, new as()), G(this, oA, []), G(this, BA, (e == null ? void 0 : e.cameraDistance) || 1e3), g(this, J).near = (e == null ? void 0 : e.cameraNear) || 1, g(this, J).far = (e == null ? void 0 : e.cameraFar) || 11e3, G(this, wA, (e == null ? void 0 : e.cameraFov) || "auto"), G(this, rA, St(e == null ? void 0 : e.sizeElement) || document.documentElement), this.beforeRenderCallback = e == null ? void 0 : e.beforeRender, G(this, CA, new Ve(g(this, rA))), g(this, CA).onScale(() => {
|
|
79
79
|
this.resize();
|
|
80
80
|
});
|
|
81
81
|
}
|
|
@@ -89,39 +89,39 @@ class ht {
|
|
|
89
89
|
return g(this, lA);
|
|
90
90
|
}
|
|
91
91
|
get box() {
|
|
92
|
-
return g(this,
|
|
92
|
+
return g(this, CA);
|
|
93
93
|
}
|
|
94
94
|
get cameraDistance() {
|
|
95
|
-
return g(this,
|
|
95
|
+
return g(this, BA);
|
|
96
96
|
}
|
|
97
97
|
set cameraDistance(A) {
|
|
98
|
-
G(this,
|
|
98
|
+
G(this, BA, A), this.resize();
|
|
99
99
|
}
|
|
100
100
|
get sizeElement() {
|
|
101
|
-
return g(this,
|
|
101
|
+
return g(this, rA);
|
|
102
102
|
}
|
|
103
103
|
get isClipped() {
|
|
104
|
-
return g(this,
|
|
104
|
+
return g(this, rA) !== w.containerElement;
|
|
105
105
|
}
|
|
106
106
|
resize() {
|
|
107
|
-
const { width: A, height: e } = g(this,
|
|
108
|
-
g(this, J).position.z = g(this,
|
|
107
|
+
const { width: A, height: e } = g(this, CA);
|
|
108
|
+
g(this, J).position.z = g(this, BA), g(this, J) instanceof Xe ? (g(this, J).aspect = A / e, g(this, J).fov = g(this, wA) === "auto" ? 2 * Math.atan(e / 2 / g(this, BA)) * (180 / Math.PI) : g(this, wA)) : g(this, J) instanceof me && (g(this, J).left = A / -2, g(this, J).right = A / 2, g(this, J).top = e / 2, g(this, J).bottom = e / -2), g(this, J).updateProjectionMatrix();
|
|
109
109
|
}
|
|
110
110
|
destroy() {
|
|
111
|
-
g(this,
|
|
111
|
+
g(this, oA).forEach((A) => {
|
|
112
112
|
A.userData.box.destroy();
|
|
113
|
-
}), g(this, lA).clear(), we(g(this, lA)), w.destroyView(this.name), g(this,
|
|
113
|
+
}), g(this, lA).clear(), we(g(this, lA)), w.destroyView(this.name), g(this, CA).destroy();
|
|
114
114
|
}
|
|
115
115
|
attachToHTMLElement(A, e, s) {
|
|
116
116
|
const t = new Ve(A, ue(QA({}, s), {
|
|
117
|
-
containerElement: g(this,
|
|
117
|
+
containerElement: g(this, rA),
|
|
118
118
|
cartesian: !0,
|
|
119
119
|
scrollStep: !this.isClipped
|
|
120
120
|
}));
|
|
121
|
-
return t.bindObject(e), e.userData.box = t, g(this,
|
|
121
|
+
return t.bindObject(e), e.userData.box = t, g(this, oA).push(e), e;
|
|
122
122
|
}
|
|
123
123
|
detachFromHTMLElement(A) {
|
|
124
|
-
G(this,
|
|
124
|
+
G(this, oA, g(this, oA).filter((e) => e === A ? (A.userData.box.destroy(), !1) : !0));
|
|
125
125
|
}
|
|
126
126
|
add(...A) {
|
|
127
127
|
const e = A[0], s = A[1], t = A[2];
|
|
@@ -131,24 +131,24 @@ class ht {
|
|
|
131
131
|
this.scene.remove(A), e && this.detachFromHTMLElement(A);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
ZA = new WeakMap(), J = new WeakMap(), lA = new WeakMap(),
|
|
134
|
+
ZA = new WeakMap(), J = new WeakMap(), lA = new WeakMap(), oA = new WeakMap(), BA = new WeakMap(), wA = new WeakMap(), rA = new WeakMap(), CA = new WeakMap();
|
|
135
135
|
const _ = /* @__PURE__ */ new Map();
|
|
136
|
-
var ye, Z, S, x,
|
|
136
|
+
var ye, Z, S, x, yA, SA, LA, zA, dA, $A, Ae, ee;
|
|
137
137
|
class In {
|
|
138
138
|
constructor() {
|
|
139
139
|
F(this, ye, `https://unpkg.com/three@0.${Is}.x`);
|
|
140
140
|
F(this, Z, null);
|
|
141
141
|
F(this, S, null);
|
|
142
142
|
F(this, x, /* @__PURE__ */ new Map());
|
|
143
|
-
F(this, wA, 0);
|
|
144
143
|
F(this, yA, 0);
|
|
145
144
|
F(this, SA, 0);
|
|
145
|
+
F(this, LA, 0);
|
|
146
146
|
F(this, zA, 2);
|
|
147
147
|
F(this, dA, !1);
|
|
148
148
|
F(this, $A, !1);
|
|
149
149
|
F(this, Ae, () => {
|
|
150
150
|
var A;
|
|
151
|
-
G(this,
|
|
151
|
+
G(this, yA, g(this, Z).clientWidth), G(this, SA, g(this, Z).clientHeight), G(this, LA, Math.min(g(this, zA), devicePixelRatio || 1)), g(this, S).setPixelRatio(g(this, LA)), g(this, S).setSize(g(this, yA), g(this, SA)), (A = this.onResize) == null || A.call(this);
|
|
152
152
|
});
|
|
153
153
|
F(this, ee, () => {
|
|
154
154
|
g(this, S).setRenderTarget(null), g(this, x).forEach((A) => {
|
|
@@ -172,13 +172,13 @@ class In {
|
|
|
172
172
|
return this.getView("default");
|
|
173
173
|
}
|
|
174
174
|
get width() {
|
|
175
|
-
return g(this,
|
|
175
|
+
return g(this, yA);
|
|
176
176
|
}
|
|
177
177
|
get height() {
|
|
178
|
-
return g(this,
|
|
178
|
+
return g(this, SA);
|
|
179
179
|
}
|
|
180
180
|
get pixelRatio() {
|
|
181
|
-
return g(this,
|
|
181
|
+
return g(this, LA);
|
|
182
182
|
}
|
|
183
183
|
get cacheAssets() {
|
|
184
184
|
return g(this, $A);
|
|
@@ -240,9 +240,9 @@ class In {
|
|
|
240
240
|
(e = A.beforeRenderCallback) == null || e.call(A), g(this, S).render(A.scene, A.camera);
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
-
ye = new WeakMap(), Z = new WeakMap(), S = new WeakMap(), x = new WeakMap(),
|
|
244
|
-
const w = new In(),
|
|
245
|
-
|
|
243
|
+
ye = new WeakMap(), Z = new WeakMap(), S = new WeakMap(), x = new WeakMap(), yA = new WeakMap(), SA = new WeakMap(), LA = new WeakMap(), zA = new WeakMap(), dA = new WeakMap(), $A = new WeakMap(), Ae = new WeakMap(), ee = new WeakMap();
|
|
244
|
+
const w = new In(), GA = new Lt(), gn = GA.load.bind(GA), En = GA.loadAsync.bind(GA);
|
|
245
|
+
GA.load = (C, A, ...e) => {
|
|
246
246
|
if (w.cacheAssets && _.has(C)) {
|
|
247
247
|
const s = _.get(C);
|
|
248
248
|
return A == null || A(s.data), s.data;
|
|
@@ -258,7 +258,7 @@ FA.load = (C, A, ...e) => {
|
|
|
258
258
|
...e
|
|
259
259
|
);
|
|
260
260
|
};
|
|
261
|
-
|
|
261
|
+
GA.loadAsync = (C, ...A) => pA(void 0, null, function* () {
|
|
262
262
|
if (w.cacheAssets && _.has(C))
|
|
263
263
|
return _.get(C).data;
|
|
264
264
|
const e = yield En(C, ...A);
|
|
@@ -343,7 +343,7 @@ class cn extends et {
|
|
|
343
343
|
this.manager.itemStart(A);
|
|
344
344
|
const B = function(r) {
|
|
345
345
|
t ? t(r) : console.error(r), n.manager.itemError(A), n.manager.itemEnd(A);
|
|
346
|
-
}, o = new
|
|
346
|
+
}, o = new FA(this.manager);
|
|
347
347
|
o.setPath(this.path), o.setResponseType("arraybuffer"), o.setRequestHeader(this.requestHeader), o.setWithCredentials(this.withCredentials), o.load(A, function(r) {
|
|
348
348
|
try {
|
|
349
349
|
n.parse(r, i, function(I) {
|
|
@@ -512,7 +512,7 @@ class hn {
|
|
|
512
512
|
default:
|
|
513
513
|
throw new Error("THREE.GLTFLoader: Unexpected light type: " + o.type);
|
|
514
514
|
}
|
|
515
|
-
return r.position.set(0, 0, 0), r.decay = 2,
|
|
515
|
+
return r.position.set(0, 0, 0), r.decay = 2, iA(r, o), o.intensity !== void 0 && (r.intensity = o.intensity), r.name = e.createUniqueName(o.name || "light_" + A), t = Promise.resolve(r), e.cache.add(s, t), t;
|
|
516
516
|
}
|
|
517
517
|
getDependency(A, e) {
|
|
518
518
|
if (A === "light")
|
|
@@ -541,7 +541,7 @@ class ln {
|
|
|
541
541
|
const i = n.baseColorFactor;
|
|
542
542
|
A.color.setRGB(i[0], i[1], i[2], P), A.opacity = i[3];
|
|
543
543
|
}
|
|
544
|
-
n.baseColorTexture !== void 0 && t.push(s.assignTexture(A, "map", n.baseColorTexture,
|
|
544
|
+
n.baseColorTexture !== void 0 && t.push(s.assignTexture(A, "map", n.baseColorTexture, eA));
|
|
545
545
|
}
|
|
546
546
|
return Promise.all(t);
|
|
547
547
|
}
|
|
@@ -564,7 +564,7 @@ class un {
|
|
|
564
564
|
}
|
|
565
565
|
getMaterialType(A) {
|
|
566
566
|
const s = this.parser.json.materials[A];
|
|
567
|
-
return !s.extensions || !s.extensions[this.name] ? null :
|
|
567
|
+
return !s.extensions || !s.extensions[this.name] ? null : tA;
|
|
568
568
|
}
|
|
569
569
|
extendMaterialParams(A, e) {
|
|
570
570
|
const s = this.parser, t = s.json.materials[A];
|
|
@@ -584,7 +584,7 @@ class fn {
|
|
|
584
584
|
}
|
|
585
585
|
getMaterialType(A) {
|
|
586
586
|
const s = this.parser.json.materials[A];
|
|
587
|
-
return !s.extensions || !s.extensions[this.name] ? null :
|
|
587
|
+
return !s.extensions || !s.extensions[this.name] ? null : tA;
|
|
588
588
|
}
|
|
589
589
|
extendMaterialParams(A, e) {
|
|
590
590
|
const s = this.parser, t = s.json.materials[A];
|
|
@@ -600,7 +600,7 @@ class Dn {
|
|
|
600
600
|
}
|
|
601
601
|
getMaterialType(A) {
|
|
602
602
|
const s = this.parser.json.materials[A];
|
|
603
|
-
return !s.extensions || !s.extensions[this.name] ? null :
|
|
603
|
+
return !s.extensions || !s.extensions[this.name] ? null : tA;
|
|
604
604
|
}
|
|
605
605
|
extendMaterialParams(A, e) {
|
|
606
606
|
const s = this.parser, t = s.json.materials[A];
|
|
@@ -613,7 +613,7 @@ class Dn {
|
|
|
613
613
|
const B = i.sheenColorFactor;
|
|
614
614
|
e.sheenColor.setRGB(B[0], B[1], B[2], P);
|
|
615
615
|
}
|
|
616
|
-
return i.sheenRoughnessFactor !== void 0 && (e.sheenRoughness = i.sheenRoughnessFactor), i.sheenColorTexture !== void 0 && n.push(s.assignTexture(e, "sheenColorMap", i.sheenColorTexture,
|
|
616
|
+
return i.sheenRoughnessFactor !== void 0 && (e.sheenRoughness = i.sheenRoughnessFactor), i.sheenColorTexture !== void 0 && n.push(s.assignTexture(e, "sheenColorMap", i.sheenColorTexture, eA)), i.sheenRoughnessTexture !== void 0 && n.push(s.assignTexture(e, "sheenRoughnessMap", i.sheenRoughnessTexture)), Promise.all(n);
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
619
|
class Fn {
|
|
@@ -622,7 +622,7 @@ class Fn {
|
|
|
622
622
|
}
|
|
623
623
|
getMaterialType(A) {
|
|
624
624
|
const s = this.parser.json.materials[A];
|
|
625
|
-
return !s.extensions || !s.extensions[this.name] ? null :
|
|
625
|
+
return !s.extensions || !s.extensions[this.name] ? null : tA;
|
|
626
626
|
}
|
|
627
627
|
extendMaterialParams(A, e) {
|
|
628
628
|
const s = this.parser, t = s.json.materials[A];
|
|
@@ -638,7 +638,7 @@ class Gn {
|
|
|
638
638
|
}
|
|
639
639
|
getMaterialType(A) {
|
|
640
640
|
const s = this.parser.json.materials[A];
|
|
641
|
-
return !s.extensions || !s.extensions[this.name] ? null :
|
|
641
|
+
return !s.extensions || !s.extensions[this.name] ? null : tA;
|
|
642
642
|
}
|
|
643
643
|
extendMaterialParams(A, e) {
|
|
644
644
|
const s = this.parser, t = s.json.materials[A];
|
|
@@ -656,7 +656,7 @@ class Rn {
|
|
|
656
656
|
}
|
|
657
657
|
getMaterialType(A) {
|
|
658
658
|
const s = this.parser.json.materials[A];
|
|
659
|
-
return !s.extensions || !s.extensions[this.name] ? null :
|
|
659
|
+
return !s.extensions || !s.extensions[this.name] ? null : tA;
|
|
660
660
|
}
|
|
661
661
|
extendMaterialParams(A, e) {
|
|
662
662
|
const t = this.parser.json.materials[A];
|
|
@@ -672,7 +672,7 @@ class pn {
|
|
|
672
672
|
}
|
|
673
673
|
getMaterialType(A) {
|
|
674
674
|
const s = this.parser.json.materials[A];
|
|
675
|
-
return !s.extensions || !s.extensions[this.name] ? null :
|
|
675
|
+
return !s.extensions || !s.extensions[this.name] ? null : tA;
|
|
676
676
|
}
|
|
677
677
|
extendMaterialParams(A, e) {
|
|
678
678
|
const s = this.parser, t = s.json.materials[A];
|
|
@@ -681,7 +681,7 @@ class pn {
|
|
|
681
681
|
const n = [], i = t.extensions[this.name];
|
|
682
682
|
e.specularIntensity = i.specularFactor !== void 0 ? i.specularFactor : 1, i.specularTexture !== void 0 && n.push(s.assignTexture(e, "specularIntensityMap", i.specularTexture));
|
|
683
683
|
const B = i.specularColorFactor || [1, 1, 1];
|
|
684
|
-
return e.specularColor = new EA().setRGB(B[0], B[1], B[2], P), i.specularColorTexture !== void 0 && n.push(s.assignTexture(e, "specularColorMap", i.specularColorTexture,
|
|
684
|
+
return e.specularColor = new EA().setRGB(B[0], B[1], B[2], P), i.specularColorTexture !== void 0 && n.push(s.assignTexture(e, "specularColorMap", i.specularColorTexture, eA)), Promise.all(n);
|
|
685
685
|
}
|
|
686
686
|
}
|
|
687
687
|
class mn {
|
|
@@ -690,7 +690,7 @@ class mn {
|
|
|
690
690
|
}
|
|
691
691
|
getMaterialType(A) {
|
|
692
692
|
const s = this.parser.json.materials[A];
|
|
693
|
-
return !s.extensions || !s.extensions[this.name] ? null :
|
|
693
|
+
return !s.extensions || !s.extensions[this.name] ? null : tA;
|
|
694
694
|
}
|
|
695
695
|
extendMaterialParams(A, e) {
|
|
696
696
|
const s = this.parser, t = s.json.materials[A];
|
|
@@ -706,7 +706,7 @@ class Mn {
|
|
|
706
706
|
}
|
|
707
707
|
getMaterialType(A) {
|
|
708
708
|
const s = this.parser.json.materials[A];
|
|
709
|
-
return !s.extensions || !s.extensions[this.name] ? null :
|
|
709
|
+
return !s.extensions || !s.extensions[this.name] ? null : tA;
|
|
710
710
|
}
|
|
711
711
|
extendMaterialParams(A, e) {
|
|
712
712
|
const s = this.parser, t = s.json.materials[A];
|
|
@@ -901,7 +901,7 @@ class Tn {
|
|
|
901
901
|
for (const I in A.attributes) {
|
|
902
902
|
const a = je[I] || I.toLowerCase();
|
|
903
903
|
if (i[I] !== void 0) {
|
|
904
|
-
const c = s.accessors[A.attributes[I]], Q =
|
|
904
|
+
const c = s.accessors[A.attributes[I]], Q = MA[c.componentType];
|
|
905
905
|
r[a] = Q.name, o[a] = c.normalized === !0;
|
|
906
906
|
}
|
|
907
907
|
}
|
|
@@ -977,7 +977,7 @@ const K = {
|
|
|
977
977
|
TRIANGLE_FAN: 6,
|
|
978
978
|
UNSIGNED_BYTE: 5121,
|
|
979
979
|
UNSIGNED_SHORT: 5123
|
|
980
|
-
},
|
|
980
|
+
}, MA = {
|
|
981
981
|
5120: Int8Array,
|
|
982
982
|
5121: Uint8Array,
|
|
983
983
|
5122: Int16Array,
|
|
@@ -1014,7 +1014,7 @@ const K = {
|
|
|
1014
1014
|
COLOR_0: "color",
|
|
1015
1015
|
WEIGHTS_0: "skinWeight",
|
|
1016
1016
|
JOINTS_0: "skinIndex"
|
|
1017
|
-
},
|
|
1017
|
+
}, nA = {
|
|
1018
1018
|
scale: "scale",
|
|
1019
1019
|
translation: "position",
|
|
1020
1020
|
rotation: "quaternion",
|
|
@@ -1045,7 +1045,7 @@ function hA(C, A, e) {
|
|
|
1045
1045
|
for (const s in e.extensions)
|
|
1046
1046
|
C[s] === void 0 && (A.userData.gltfExtensions = A.userData.gltfExtensions || {}, A.userData.gltfExtensions[s] = e.extensions[s]);
|
|
1047
1047
|
}
|
|
1048
|
-
function
|
|
1048
|
+
function iA(C, A) {
|
|
1049
1049
|
A.extras !== void 0 && (typeof A.extras == "object" ? Object.assign(C.userData, A.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + A.extras));
|
|
1050
1050
|
}
|
|
1051
1051
|
function On(C, A, e) {
|
|
@@ -1133,7 +1133,7 @@ class Xn {
|
|
|
1133
1133
|
constructor(A = {}, e = {}) {
|
|
1134
1134
|
this.json = A, this.extensions = {}, this.plugins = {}, this.options = e, this.cache = new Qn(), 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 = {};
|
|
1135
1135
|
let s = !1, t = !1, n = -1;
|
|
1136
|
-
typeof navigator != "undefined" && (s = /^((?!chrome|android).)*safari/i.test(navigator.userAgent) === !0, t = navigator.userAgent.indexOf("Firefox") > -1, n = t ? navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1] : -1), typeof createImageBitmap == "undefined" || s || t && n < 98 ? this.textureLoader = new Lt(this.options.manager) : this.textureLoader = new us(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new
|
|
1136
|
+
typeof navigator != "undefined" && (s = /^((?!chrome|android).)*safari/i.test(navigator.userAgent) === !0, t = navigator.userAgent.indexOf("Firefox") > -1, n = t ? navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1] : -1), typeof createImageBitmap == "undefined" || s || t && n < 98 ? this.textureLoader = new Lt(this.options.manager) : this.textureLoader = new us(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new FA(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
|
|
1137
1137
|
}
|
|
1138
1138
|
setExtensions(A) {
|
|
1139
1139
|
this.extensions = A;
|
|
@@ -1163,7 +1163,7 @@ class Xn {
|
|
|
1163
1163
|
parser: s,
|
|
1164
1164
|
userData: {}
|
|
1165
1165
|
};
|
|
1166
|
-
return hA(n, B, t),
|
|
1166
|
+
return hA(n, B, t), iA(B, t), Promise.all(s._invokeAll(function(o) {
|
|
1167
1167
|
return o.afterRoot && o.afterRoot(B);
|
|
1168
1168
|
})).then(function() {
|
|
1169
1169
|
for (const o of B.scenes)
|
|
@@ -1351,12 +1351,12 @@ class Xn {
|
|
|
1351
1351
|
loadAccessor(A) {
|
|
1352
1352
|
const e = this, s = this.json, t = this.json.accessors[A];
|
|
1353
1353
|
if (t.bufferView === void 0 && t.sparse === void 0) {
|
|
1354
|
-
const i = Te[t.type], B =
|
|
1354
|
+
const i = Te[t.type], B = MA[t.componentType], o = t.normalized === !0, r = new B(t.count * i);
|
|
1355
1355
|
return Promise.resolve(new VA(r, i, o));
|
|
1356
1356
|
}
|
|
1357
1357
|
const n = [];
|
|
1358
1358
|
return t.bufferView !== void 0 ? n.push(this.getDependency("bufferView", t.bufferView)) : n.push(null), t.sparse !== void 0 && (n.push(this.getDependency("bufferView", t.sparse.indices.bufferView)), n.push(this.getDependency("bufferView", t.sparse.values.bufferView))), Promise.all(n).then(function(i) {
|
|
1359
|
-
const B = i[0], o = Te[t.type], r =
|
|
1359
|
+
const B = i[0], o = Te[t.type], r = MA[t.componentType], I = r.BYTES_PER_ELEMENT, a = I * o, c = t.byteOffset || 0, Q = t.bufferView !== void 0 ? s.bufferViews[t.bufferView].byteStride : void 0, l = t.normalized === !0;
|
|
1360
1360
|
let h, E;
|
|
1361
1361
|
if (Q && Q !== a) {
|
|
1362
1362
|
const d = Math.floor(c / Q), u = "InterleavedBuffer:" + t.bufferView + ":" + t.componentType + ":" + d + ":" + t.count;
|
|
@@ -1365,7 +1365,7 @@ class Xn {
|
|
|
1365
1365
|
} else
|
|
1366
1366
|
B === null ? h = new r(t.count * o) : h = new r(B, c, t.count * o), E = new VA(h, o, l);
|
|
1367
1367
|
if (t.sparse !== void 0) {
|
|
1368
|
-
const d = Te.SCALAR, u =
|
|
1368
|
+
const d = Te.SCALAR, u = MA[t.sparse.indices.componentType], f = t.sparse.indices.byteOffset || 0, D = t.sparse.values.byteOffset || 0, p = new u(i[1], f, t.sparse.count * d), m = new r(i[2], D, t.sparse.count * o);
|
|
1369
1369
|
B !== null && (E = new VA(E.array.slice(), E.itemSize, E.normalized));
|
|
1370
1370
|
for (let M = 0, Y = p.length; M < Y; M++) {
|
|
1371
1371
|
const U = p[M];
|
|
@@ -1504,7 +1504,7 @@ class Xn {
|
|
|
1504
1504
|
const c = a.baseColorFactor;
|
|
1505
1505
|
B.color.setRGB(c[0], c[1], c[2], P), B.opacity = c[3];
|
|
1506
1506
|
}
|
|
1507
|
-
a.baseColorTexture !== void 0 && r.push(e.assignTexture(B, "map", a.baseColorTexture,
|
|
1507
|
+
a.baseColorTexture !== void 0 && r.push(e.assignTexture(B, "map", a.baseColorTexture, eA)), B.metalness = a.metallicFactor !== void 0 ? a.metallicFactor : 1, B.roughness = a.roughnessFactor !== void 0 ? a.roughnessFactor : 1, a.metallicRoughnessTexture !== void 0 && (r.push(e.assignTexture(B, "metalnessMap", a.metallicRoughnessTexture)), r.push(e.assignTexture(B, "roughnessMap", a.metallicRoughnessTexture))), i = this._invokeOne(function(c) {
|
|
1508
1508
|
return c.getMaterialType && c.getMaterialType(A);
|
|
1509
1509
|
}), r.push(Promise.all(this._invokeAll(function(c) {
|
|
1510
1510
|
return c.extendMaterialParams && c.extendMaterialParams(A, B);
|
|
@@ -1520,9 +1520,9 @@ class Xn {
|
|
|
1520
1520
|
const a = n.emissiveFactor;
|
|
1521
1521
|
B.emissive = new EA().setRGB(a[0], a[1], a[2], P);
|
|
1522
1522
|
}
|
|
1523
|
-
return n.emissiveTexture !== void 0 && i !== qA && r.push(e.assignTexture(B, "emissiveMap", n.emissiveTexture,
|
|
1523
|
+
return n.emissiveTexture !== void 0 && i !== qA && r.push(e.assignTexture(B, "emissiveMap", n.emissiveTexture, eA)), Promise.all(r).then(function() {
|
|
1524
1524
|
const a = new i(B);
|
|
1525
|
-
return n.name && (a.name = n.name),
|
|
1525
|
+
return n.name && (a.name = n.name), iA(a, n), e.associations.set(a, { materials: A }), n.extensions && hA(t, a, n), a;
|
|
1526
1526
|
});
|
|
1527
1527
|
}
|
|
1528
1528
|
/** When Object3D instances are targeted by animation, they need unique names. */
|
|
@@ -1586,7 +1586,7 @@ class Xn {
|
|
|
1586
1586
|
d = new Ss(h, u);
|
|
1587
1587
|
else
|
|
1588
1588
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + E.mode);
|
|
1589
|
-
Object.keys(d.geometry.morphAttributes).length > 0 && _n(d, n), d.name = e.createUniqueName(n.name || "mesh_" + A),
|
|
1589
|
+
Object.keys(d.geometry.morphAttributes).length > 0 && _n(d, n), d.name = e.createUniqueName(n.name || "mesh_" + A), iA(d, n), E.extensions && hA(t, d, E), e.assignFinalMaterial(d), a.push(d);
|
|
1590
1590
|
}
|
|
1591
1591
|
for (let Q = 0, l = a.length; Q < l; Q++)
|
|
1592
1592
|
e.associations.set(a[Q], {
|
|
@@ -1614,7 +1614,7 @@ class Xn {
|
|
|
1614
1614
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
1615
1615
|
return;
|
|
1616
1616
|
}
|
|
1617
|
-
return s.type === "perspective" ? e = new Xe(Ls.radToDeg(t.yfov), t.aspectRatio || 1, t.znear || 1, t.zfar || 2e6) : s.type === "orthographic" && (e = new me(-t.xmag, t.xmag, t.ymag, -t.ymag, t.znear, t.zfar)), s.name && (e.name = this.createUniqueName(s.name)),
|
|
1617
|
+
return s.type === "perspective" ? e = new Xe(Ls.radToDeg(t.yfov), t.aspectRatio || 1, t.znear || 1, t.zfar || 2e6) : s.type === "orthographic" && (e = new me(-t.xmag, t.xmag, t.ymag, -t.ymag, t.znear, t.zfar)), s.name && (e.name = this.createUniqueName(s.name)), iA(e, s), Promise.resolve(e);
|
|
1618
1618
|
}
|
|
1619
1619
|
/**
|
|
1620
1620
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
@@ -1726,7 +1726,7 @@ class Xn {
|
|
|
1726
1726
|
if (n.isBone === !0 ? I = new Ts() : r.length > 1 ? I = new jA() : r.length === 1 ? I = r[0] : I = new st(), I !== r[0])
|
|
1727
1727
|
for (let a = 0, c = r.length; a < c; a++)
|
|
1728
1728
|
I.add(r[a]);
|
|
1729
|
-
if (n.name && (I.userData.name = n.name, I.name = i),
|
|
1729
|
+
if (n.name && (I.userData.name = n.name, I.name = i), iA(I, n), n.extensions && hA(s, I, n), n.matrix !== void 0) {
|
|
1730
1730
|
const a = new bA();
|
|
1731
1731
|
a.fromArray(n.matrix), I.applyMatrix4(a);
|
|
1732
1732
|
} else
|
|
@@ -1741,7 +1741,7 @@ class Xn {
|
|
|
1741
1741
|
*/
|
|
1742
1742
|
loadScene(A) {
|
|
1743
1743
|
const e = this.extensions, s = this.json.scenes[A], t = this, n = new jA();
|
|
1744
|
-
s.name && (n.name = t.createUniqueName(s.name)),
|
|
1744
|
+
s.name && (n.name = t.createUniqueName(s.name)), iA(n, s), s.extensions && hA(e, n, s);
|
|
1745
1745
|
const i = s.nodes || [], B = [];
|
|
1746
1746
|
for (let o = 0, r = i.length; o < r; o++)
|
|
1747
1747
|
B.push(t.getDependency("node", i[o]));
|
|
@@ -1762,19 +1762,19 @@ class Xn {
|
|
|
1762
1762
|
}
|
|
1763
1763
|
_createAnimationTracks(A, e, s, t, n) {
|
|
1764
1764
|
const i = [], B = A.name ? A.name : A.uuid, o = [];
|
|
1765
|
-
|
|
1765
|
+
nA[n.path] === nA.weights ? A.traverse(function(c) {
|
|
1766
1766
|
c.morphTargetInfluences && o.push(c.name ? c.name : c.uuid);
|
|
1767
1767
|
}) : o.push(B);
|
|
1768
1768
|
let r;
|
|
1769
|
-
switch (
|
|
1770
|
-
case
|
|
1769
|
+
switch (nA[n.path]) {
|
|
1770
|
+
case nA.weights:
|
|
1771
1771
|
r = It;
|
|
1772
1772
|
break;
|
|
1773
|
-
case
|
|
1773
|
+
case nA.rotation:
|
|
1774
1774
|
r = gt;
|
|
1775
1775
|
break;
|
|
1776
|
-
case
|
|
1777
|
-
case
|
|
1776
|
+
case nA.position:
|
|
1777
|
+
case nA.scale:
|
|
1778
1778
|
r = at;
|
|
1779
1779
|
break;
|
|
1780
1780
|
default:
|
|
@@ -1793,7 +1793,7 @@ class Xn {
|
|
|
1793
1793
|
const I = t.interpolation !== void 0 ? bn[t.interpolation] : xt, a = this._getArrayFromAccessor(s);
|
|
1794
1794
|
for (let c = 0, Q = o.length; c < Q; c++) {
|
|
1795
1795
|
const l = new r(
|
|
1796
|
-
o[c] + "." +
|
|
1796
|
+
o[c] + "." + nA[n.path],
|
|
1797
1797
|
e.array,
|
|
1798
1798
|
a,
|
|
1799
1799
|
I
|
|
@@ -1828,7 +1828,7 @@ function vn(C, A, e) {
|
|
|
1828
1828
|
new y(o[0], o[1], o[2]),
|
|
1829
1829
|
new y(r[0], r[1], r[2])
|
|
1830
1830
|
), B.normalized) {
|
|
1831
|
-
const I = Ze(
|
|
1831
|
+
const I = Ze(MA[B.componentType]);
|
|
1832
1832
|
t.min.multiplyScalar(I), t.max.multiplyScalar(I);
|
|
1833
1833
|
}
|
|
1834
1834
|
} else {
|
|
@@ -1846,7 +1846,7 @@ function vn(C, A, e) {
|
|
|
1846
1846
|
const c = e.json.accessors[a.POSITION], Q = c.min, l = c.max;
|
|
1847
1847
|
if (Q !== void 0 && l !== void 0) {
|
|
1848
1848
|
if (o.setX(Math.max(Math.abs(Q[0]), Math.abs(l[0]))), o.setY(Math.max(Math.abs(Q[1]), Math.abs(l[1]))), o.setZ(Math.max(Math.abs(Q[2]), Math.abs(l[2]))), c.normalized) {
|
|
1849
|
-
const h = Ze(
|
|
1849
|
+
const h = Ze(MA[c.componentType]);
|
|
1850
1850
|
o.multiplyScalar(h);
|
|
1851
1851
|
}
|
|
1852
1852
|
B.max(o);
|
|
@@ -1877,7 +1877,7 @@ function Dt(C, A, e) {
|
|
|
1877
1877
|
});
|
|
1878
1878
|
t.push(i);
|
|
1879
1879
|
}
|
|
1880
|
-
return rt.workingColorSpace !== P && "COLOR_0" in s && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${rt.workingColorSpace}" not supported.`),
|
|
1880
|
+
return rt.workingColorSpace !== P && "COLOR_0" in s && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${rt.workingColorSpace}" not supported.`), iA(C, A), vn(C, A, e), Promise.all(t).then(function() {
|
|
1881
1881
|
return A.targets !== void 0 ? On(C, A.targets, e) : C;
|
|
1882
1882
|
});
|
|
1883
1883
|
}
|
|
@@ -1906,14 +1906,14 @@ class Wn extends et {
|
|
|
1906
1906
|
return this.workerLimit = A, this;
|
|
1907
1907
|
}
|
|
1908
1908
|
load(A, e, s, t) {
|
|
1909
|
-
const n = new
|
|
1909
|
+
const n = new FA(this.manager);
|
|
1910
1910
|
n.setPath(this.path), n.setResponseType("arraybuffer"), n.setRequestHeader(this.requestHeader), n.setWithCredentials(this.withCredentials), n.load(A, (i) => {
|
|
1911
1911
|
this.parse(i, e, t);
|
|
1912
1912
|
}, s, t);
|
|
1913
1913
|
}
|
|
1914
1914
|
parse(A, e, s = () => {
|
|
1915
1915
|
}) {
|
|
1916
|
-
this.decodeDracoFile(A, e, null, null,
|
|
1916
|
+
this.decodeDracoFile(A, e, null, null, eA).catch(s);
|
|
1917
1917
|
}
|
|
1918
1918
|
decodeDracoFile(A, e, s, t, n = P, i = () => {
|
|
1919
1919
|
}) {
|
|
@@ -1957,14 +1957,14 @@ class Wn extends et {
|
|
|
1957
1957
|
return e;
|
|
1958
1958
|
}
|
|
1959
1959
|
_assignVertexColorSpace(A, e) {
|
|
1960
|
-
if (e !==
|
|
1960
|
+
if (e !== eA)
|
|
1961
1961
|
return;
|
|
1962
1962
|
const s = new EA();
|
|
1963
1963
|
for (let t = 0, n = A.count; t < n; t++)
|
|
1964
1964
|
s.fromBufferAttribute(A, t).convertSRGBToLinear(), A.setXYZ(t, s.r, s.g, s.b);
|
|
1965
1965
|
}
|
|
1966
1966
|
_loadLibrary(A, e) {
|
|
1967
|
-
const s = new
|
|
1967
|
+
const s = new FA(this.manager);
|
|
1968
1968
|
return s.setPath(this.decoderPath), s.setResponseType(e), s.setWithCredentials(this.withCredentials), new Promise((t, n) => {
|
|
1969
1969
|
s.load(A, t, void 0, n);
|
|
1970
1970
|
});
|
|
@@ -2230,8 +2230,8 @@ function ni(C) {
|
|
|
2230
2230
|
const d = new PA(C, I, a, !0), u = d._nextUint16(), f = d._nextUint16(), D = d._nextUint32(), p = d._nextUint32(), m = d._nextUint32(), M = d._nextUint32(), Y = [];
|
|
2231
2231
|
for (let H = 0; H < n; H++)
|
|
2232
2232
|
Y.push({ imageFlags: d._nextUint32(), rgbSliceByteOffset: d._nextUint32(), rgbSliceByteLength: d._nextUint32(), alphaSliceByteOffset: d._nextUint32(), alphaSliceByteLength: d._nextUint32() });
|
|
2233
|
-
const U = I + d._offset, W = U + D, KA = W + p, he = KA + m, cA = new Uint8Array(C.buffer, C.byteOffset + U, D), le = new Uint8Array(C.buffer, C.byteOffset + W, p),
|
|
2234
|
-
return e.globalData = { endpointCount: u, selectorCount: f, imageDescs: Y, endpointsData: cA, selectorsData: le, tablesData:
|
|
2233
|
+
const U = I + d._offset, W = U + D, KA = W + p, he = KA + m, cA = new Uint8Array(C.buffer, C.byteOffset + U, D), le = new Uint8Array(C.buffer, C.byteOffset + W, p), sA = new Uint8Array(C.buffer, C.byteOffset + KA, m), de = new Uint8Array(C.buffer, C.byteOffset + he, M);
|
|
2234
|
+
return e.globalData = { endpointCount: u, selectorCount: f, imageDescs: Y, endpointsData: cA, selectorsData: le, tablesData: sA, extendedData: de }, e;
|
|
2235
2235
|
}
|
|
2236
2236
|
let ke, j, ze;
|
|
2237
2237
|
const be = { env: { emscripten_notify_memory_growth: function(C) {
|
|
@@ -2268,7 +2268,7 @@ class v extends et {
|
|
|
2268
2268
|
return this.workerPool.setWorkerLimit(A), this;
|
|
2269
2269
|
}
|
|
2270
2270
|
detectSupportAsync(A) {
|
|
2271
|
-
return
|
|
2271
|
+
return pA(this, null, function* () {
|
|
2272
2272
|
return this.workerConfig = {
|
|
2273
2273
|
astcSupported: yield A.hasFeatureAsync("texture-compression-astc"),
|
|
2274
2274
|
etc1Supported: yield A.hasFeatureAsync("texture-compression-etc1"),
|
|
@@ -2298,9 +2298,9 @@ class v extends et {
|
|
|
2298
2298
|
}
|
|
2299
2299
|
init() {
|
|
2300
2300
|
if (!this.transcoderPending) {
|
|
2301
|
-
const A = new
|
|
2301
|
+
const A = new FA(this.manager);
|
|
2302
2302
|
A.setPath(this.transcoderPath), A.setWithCredentials(this.withCredentials);
|
|
2303
|
-
const e = A.loadAsync("basis_transcoder.js"), s = new
|
|
2303
|
+
const e = A.loadAsync("basis_transcoder.js"), s = new FA(this.manager);
|
|
2304
2304
|
s.setPath(this.transcoderPath), s.setResponseType("arraybuffer"), s.setWithCredentials(this.withCredentials);
|
|
2305
2305
|
const t = s.loadAsync("basis_transcoder.wasm");
|
|
2306
2306
|
this.transcoderPending = Promise.all([e, t]).then(([n, i]) => {
|
|
@@ -2328,7 +2328,7 @@ class v extends et {
|
|
|
2328
2328
|
load(A, e, s, t) {
|
|
2329
2329
|
if (this.workerConfig === null)
|
|
2330
2330
|
throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");
|
|
2331
|
-
const n = new
|
|
2331
|
+
const n = new FA(this.manager);
|
|
2332
2332
|
n.setResponseType("arraybuffer"), n.setWithCredentials(this.withCredentials), n.load(A, (i) => {
|
|
2333
2333
|
if (Ke.has(i))
|
|
2334
2334
|
return Ke.get(i).promise.then(e).catch(t);
|
|
@@ -2354,7 +2354,7 @@ class v extends et {
|
|
|
2354
2354
|
* @return {Promise<CompressedTexture|CompressedArrayTexture|DataTexture|Data3DTexture>}
|
|
2355
2355
|
*/
|
|
2356
2356
|
_createTexture(s) {
|
|
2357
|
-
return
|
|
2357
|
+
return pA(this, arguments, function* (A, e = {}) {
|
|
2358
2358
|
const t = ni(new Uint8Array(A));
|
|
2359
2359
|
if (t.vkFormat !== ti)
|
|
2360
2360
|
return Bi(t);
|
|
@@ -2390,7 +2390,7 @@ v.TranscoderFormat = {
|
|
|
2390
2390
|
RGBA4444: 16
|
|
2391
2391
|
};
|
|
2392
2392
|
v.EngineFormat = {
|
|
2393
|
-
RGBAFormat:
|
|
2393
|
+
RGBAFormat: mA,
|
|
2394
2394
|
RGBA_ASTC_4x4_Format: Ws,
|
|
2395
2395
|
RGBA_BPTC_Format: Vs,
|
|
2396
2396
|
RGBA_ETC2_EAC_Format: js,
|
|
@@ -2444,14 +2444,14 @@ v.BasisWorker = function() {
|
|
|
2444
2444
|
const KA = [], he = [];
|
|
2445
2445
|
for (let cA = 0; cA < m; cA++) {
|
|
2446
2446
|
const le = [];
|
|
2447
|
-
for (let
|
|
2447
|
+
for (let sA = 0; sA < p; sA++) {
|
|
2448
2448
|
const de = [];
|
|
2449
2449
|
let H, N;
|
|
2450
2450
|
for (let V = 0; V < D; V++) {
|
|
2451
|
-
const
|
|
2452
|
-
cA === 0 &&
|
|
2453
|
-
const it = new Uint8Array(h.getImageTranscodedSizeInBytes(
|
|
2454
|
-
if (!h.transcodeImage(it,
|
|
2451
|
+
const RA = h.getImageLevelInfo(sA, V, cA);
|
|
2452
|
+
cA === 0 && sA === 0 && V === 0 && (RA.origWidth % 4 !== 0 || RA.origHeight % 4 !== 0) && console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."), p > 1 ? (H = RA.origWidth, N = RA.origHeight) : (H = RA.width, N = RA.height);
|
|
2453
|
+
const it = new Uint8Array(h.getImageTranscodedSizeInBytes(sA, V, 0, U));
|
|
2454
|
+
if (!h.transcodeImage(it, sA, V, cA, U, 0, -1, -1))
|
|
2455
2455
|
throw E(), new Error("THREE.KTX2Loader: .transcodeImage failed.");
|
|
2456
2456
|
de.push(it);
|
|
2457
2457
|
}
|
|
@@ -2552,11 +2552,11 @@ v.BasisWorker = function() {
|
|
|
2552
2552
|
return E;
|
|
2553
2553
|
}
|
|
2554
2554
|
};
|
|
2555
|
-
const oi = /* @__PURE__ */ new Set([
|
|
2556
|
-
[Zt]:
|
|
2557
|
-
[Wt]:
|
|
2558
|
-
[Yt]:
|
|
2559
|
-
[qt]:
|
|
2555
|
+
const oi = /* @__PURE__ */ new Set([mA, XA, vA]), Pe = {
|
|
2556
|
+
[Zt]: mA,
|
|
2557
|
+
[Wt]: mA,
|
|
2558
|
+
[Yt]: mA,
|
|
2559
|
+
[qt]: mA,
|
|
2560
2560
|
[jt]: XA,
|
|
2561
2561
|
[vt]: XA,
|
|
2562
2562
|
[_t]: XA,
|
|
@@ -2584,12 +2584,12 @@ const oi = /* @__PURE__ */ new Set([pA, XA, vA]), Pe = {
|
|
|
2584
2584
|
[zt]: O
|
|
2585
2585
|
};
|
|
2586
2586
|
function Bi(C) {
|
|
2587
|
-
return
|
|
2587
|
+
return pA(this, null, function* () {
|
|
2588
2588
|
const { vkFormat: A } = C;
|
|
2589
2589
|
if (Pe[A] === void 0)
|
|
2590
2590
|
throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");
|
|
2591
2591
|
let e;
|
|
2592
|
-
C.supercompressionScheme === Ft && (_e || (_e = new Promise((n) =>
|
|
2592
|
+
C.supercompressionScheme === Ft && (_e || (_e = new Promise((n) => pA(this, null, function* () {
|
|
2593
2593
|
const i = new ii();
|
|
2594
2594
|
yield i.init(), n(i);
|
|
2595
2595
|
}))), e = yield _e);
|
|
@@ -2632,7 +2632,7 @@ function Bi(C) {
|
|
|
2632
2632
|
}
|
|
2633
2633
|
function As(C) {
|
|
2634
2634
|
const A = C.dataFormatDescriptor[0];
|
|
2635
|
-
return A.colorPrimaries === Ai ? A.transferFunction === Gt ?
|
|
2635
|
+
return A.colorPrimaries === Ai ? A.transferFunction === Gt ? eA : P : A.colorPrimaries === ei ? A.transferFunction === Gt ? on : Bn : A.colorPrimaries === $n ? Et : (console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${A.colorPrimaries}"`), Et);
|
|
2636
2636
|
}
|
|
2637
2637
|
let Ge;
|
|
2638
2638
|
const ri = () => {
|
|
@@ -2832,10 +2832,10 @@ const ri = () => {
|
|
|
2832
2832
|
}
|
|
2833
2833
|
}, Ge;
|
|
2834
2834
|
};
|
|
2835
|
-
var
|
|
2835
|
+
var JA, te, se, ne;
|
|
2836
2836
|
class Ci {
|
|
2837
2837
|
constructor() {
|
|
2838
|
-
F(this,
|
|
2838
|
+
F(this, JA, new cn());
|
|
2839
2839
|
F(this, te, new Wn().setDecoderPath(
|
|
2840
2840
|
`${w.CDNVersion}/examples/jsm/libs/draco/gltf/`
|
|
2841
2841
|
));
|
|
@@ -2843,10 +2843,10 @@ class Ci {
|
|
|
2843
2843
|
`${w.CDNVersion}/examples/jsm/libs/basis/`
|
|
2844
2844
|
));
|
|
2845
2845
|
F(this, ne, !1);
|
|
2846
|
-
g(this,
|
|
2846
|
+
g(this, JA).setCrossOrigin("anonymous").setDRACOLoader(g(this, te)).setMeshoptDecoder(ri);
|
|
2847
2847
|
}
|
|
2848
2848
|
get gltfLoader() {
|
|
2849
|
-
return g(this,
|
|
2849
|
+
return g(this, JA);
|
|
2850
2850
|
}
|
|
2851
2851
|
get dracoLoader() {
|
|
2852
2852
|
return g(this, te);
|
|
@@ -2855,7 +2855,7 @@ class Ci {
|
|
|
2855
2855
|
return g(this, se);
|
|
2856
2856
|
}
|
|
2857
2857
|
load(...A) {
|
|
2858
|
-
g(this, ne) || (g(this,
|
|
2858
|
+
g(this, ne) || (g(this, JA).setKTX2Loader(
|
|
2859
2859
|
g(this, se).detectSupport(w.webglRenderer)
|
|
2860
2860
|
), G(this, ne, !0));
|
|
2861
2861
|
const [e, s, ...t] = A;
|
|
@@ -2879,7 +2879,7 @@ class Ci {
|
|
|
2879
2879
|
);
|
|
2880
2880
|
}
|
|
2881
2881
|
}
|
|
2882
|
-
|
|
2882
|
+
JA = new WeakMap(), te = new WeakMap(), se = new WeakMap(), ne = new WeakMap();
|
|
2883
2883
|
const ai = new Ci();
|
|
2884
2884
|
var z, L, $, ie;
|
|
2885
2885
|
class Si {
|
|
@@ -2919,35 +2919,36 @@ class Li extends jA {
|
|
|
2919
2919
|
super(), this.add(new Fe(A.planes[0], e, 16711680)), this.add(new Fe(A.planes[1], e, 16711680)), this.add(new Fe(A.planes[2], e, 16711680)), this.add(new Fe(A.planes[3], e, 16711680));
|
|
2920
2920
|
}
|
|
2921
2921
|
}
|
|
2922
|
-
var
|
|
2922
|
+
var HA, uA, TA, oe, Be, aA, UA, re;
|
|
2923
2923
|
class es extends an {
|
|
2924
2924
|
constructor(e) {
|
|
2925
2925
|
super(e);
|
|
2926
|
-
F(this,
|
|
2926
|
+
F(this, HA, new Qt(null));
|
|
2927
2927
|
F(this, uA, new Qt(void 0));
|
|
2928
|
-
F(this,
|
|
2928
|
+
F(this, TA, void 0);
|
|
2929
2929
|
F(this, oe, void 0);
|
|
2930
2930
|
F(this, Be, void 0);
|
|
2931
|
-
F(this,
|
|
2932
|
-
F(this,
|
|
2931
|
+
F(this, aA, void 0);
|
|
2932
|
+
F(this, UA, !1);
|
|
2933
2933
|
F(this, re, () => {
|
|
2934
|
-
if (!(g(this,
|
|
2934
|
+
if (!(g(this, aA) && !g(this, UA)) && (this.current !== this.previous && (g(this, HA).current = null), this.current)) {
|
|
2935
2935
|
const e = g(this, Be) ? this.current.url : this.current.name + this.current.extension;
|
|
2936
|
-
g(this,
|
|
2936
|
+
g(this, aA) || He.setTotal(e, 1), g(this, uA).current = "start", g(this, oe).load(
|
|
2937
2937
|
e,
|
|
2938
2938
|
(s) => {
|
|
2939
|
-
|
|
2939
|
+
var t;
|
|
2940
|
+
g(this, HA).current = ((t = this.processData) == null ? void 0 : t.call(this, s)) || s, g(this, uA).current = "complete", g(this, aA) || He.setLoaded(e, 1);
|
|
2940
2941
|
},
|
|
2941
2942
|
void 0,
|
|
2942
2943
|
() => {
|
|
2943
|
-
g(this,
|
|
2944
|
+
g(this, aA) || (g(this, uA).current = "error", He.setError(e, e));
|
|
2944
2945
|
}
|
|
2945
2946
|
);
|
|
2946
2947
|
}
|
|
2947
2948
|
});
|
|
2948
|
-
G(this,
|
|
2949
|
+
G(this, TA, e.consumer), G(this, oe, e.loader), G(this, Be, e.keepSourceParameters || !1), G(this, aA, e.lazy || !1), this.subscribe(g(this, re)), g(this, TA).addEventListener("added", () => {
|
|
2949
2950
|
this.connect();
|
|
2950
|
-
}), g(this,
|
|
2951
|
+
}), g(this, TA).addEventListener("removed", () => {
|
|
2951
2952
|
this.disconnect();
|
|
2952
2953
|
});
|
|
2953
2954
|
}
|
|
@@ -2955,7 +2956,7 @@ class es extends an {
|
|
|
2955
2956
|
* Resource store.
|
|
2956
2957
|
*/
|
|
2957
2958
|
get data() {
|
|
2958
|
-
return g(this,
|
|
2959
|
+
return g(this, HA);
|
|
2959
2960
|
}
|
|
2960
2961
|
/**
|
|
2961
2962
|
* Loading store.
|
|
@@ -2967,29 +2968,29 @@ class es extends an {
|
|
|
2967
2968
|
* Calling this method will start loading the resource.
|
|
2968
2969
|
*/
|
|
2969
2970
|
lazyLoad() {
|
|
2970
|
-
g(this,
|
|
2971
|
+
g(this, UA) || (G(this, UA, !0), g(this, re).call(this));
|
|
2971
2972
|
}
|
|
2972
2973
|
}
|
|
2973
|
-
|
|
2974
|
-
var
|
|
2974
|
+
HA = new WeakMap(), uA = new WeakMap(), TA = new WeakMap(), oe = new WeakMap(), Be = new WeakMap(), aA = new WeakMap(), UA = new WeakMap(), re = new WeakMap();
|
|
2975
|
+
var fA;
|
|
2975
2976
|
class Ji extends jA {
|
|
2976
2977
|
constructor(e) {
|
|
2977
2978
|
super();
|
|
2978
|
-
F(this,
|
|
2979
|
-
G(this,
|
|
2979
|
+
F(this, fA, void 0);
|
|
2980
|
+
G(this, fA, new es(QA({
|
|
2980
2981
|
loader: ai,
|
|
2981
2982
|
consumer: this
|
|
2982
|
-
}, e))), g(this,
|
|
2983
|
-
s.current ? this.add(...s.current.scene.
|
|
2983
|
+
}, e))), g(this, fA).processData = (s) => (w.cacheAssets && (s.scene = s.scene.clone(!0), s.scenes = s.scenes.map((t) => t.clone(!0))), s), g(this, fA).data.subscribe((s) => {
|
|
2984
|
+
s.current ? this.add(...s.current.scene.children) : this.children.forEach((t) => {
|
|
2984
2985
|
this.remove(t), we(t);
|
|
2985
2986
|
});
|
|
2986
2987
|
});
|
|
2987
2988
|
}
|
|
2988
2989
|
get sourceManager() {
|
|
2989
|
-
return g(this,
|
|
2990
|
+
return g(this, fA);
|
|
2990
2991
|
}
|
|
2991
2992
|
}
|
|
2992
|
-
|
|
2993
|
+
fA = new WeakMap();
|
|
2993
2994
|
function ts(C, A, e) {
|
|
2994
2995
|
const s = A.x, t = A.y, n = e || C.image.width / C.image.height;
|
|
2995
2996
|
let i = 0, B = 0, o = C.offset.x, r = C.offset.y, I = C.rotation, a = C.center.x, c = C.center.y;
|
|
@@ -3105,7 +3106,7 @@ class Qi {
|
|
|
3105
3106
|
}
|
|
3106
3107
|
}
|
|
3107
3108
|
}
|
|
3108
|
-
var
|
|
3109
|
+
var AA, xA, DA;
|
|
3109
3110
|
class ss extends Qe {
|
|
3110
3111
|
constructor(e) {
|
|
3111
3112
|
super(
|
|
@@ -3118,26 +3119,26 @@ class ss extends Qe {
|
|
|
3118
3119
|
),
|
|
3119
3120
|
e.material
|
|
3120
3121
|
);
|
|
3121
|
-
F(this,
|
|
3122
|
+
F(this, AA, void 0);
|
|
3122
3123
|
F(this, xA, void 0);
|
|
3123
|
-
F(this,
|
|
3124
|
-
g(this,
|
|
3124
|
+
F(this, DA, () => {
|
|
3125
|
+
g(this, AA).data.current && g(this, xA) === "cover" && this.onCoverResize(g(this, AA).data.current);
|
|
3125
3126
|
});
|
|
3126
|
-
G(this,
|
|
3127
|
+
G(this, AA, new es(QA({
|
|
3127
3128
|
consumer: this
|
|
3128
|
-
}, e))), G(this, xA, e.
|
|
3129
|
-
NA.subscribe(g(this,
|
|
3129
|
+
}, e))), G(this, xA, e.fit), this.addEventListener("added", () => {
|
|
3130
|
+
NA.subscribe(g(this, DA));
|
|
3130
3131
|
}), this.addEventListener("removed", () => {
|
|
3131
|
-
NA.unsubscribe(g(this,
|
|
3132
|
-
}), g(this,
|
|
3133
|
-
!s.current && s.previous ? s.previous.dispose() : s.current && this.material && (g(this, xA) && (s.current.matrixAutoUpdate = !1), s.current.colorSpace =
|
|
3132
|
+
NA.unsubscribe(g(this, DA));
|
|
3133
|
+
}), g(this, AA).processData = (s) => w.cacheAssets ? s.clone() : s, g(this, AA).data.subscribe((s) => {
|
|
3134
|
+
!s.current && s.previous ? s.previous.dispose() : s.current && this.material && (g(this, xA) && (s.current.matrixAutoUpdate = !1), s.current.colorSpace = eA, s.current.center.set(0.5, 0.5), this.material.map = s.current, this.material.needsUpdate = !0, g(this, DA).call(this));
|
|
3134
3135
|
});
|
|
3135
3136
|
}
|
|
3136
3137
|
get sourceManager() {
|
|
3137
|
-
return g(this,
|
|
3138
|
+
return g(this, AA);
|
|
3138
3139
|
}
|
|
3139
3140
|
updateTexture() {
|
|
3140
|
-
g(this,
|
|
3141
|
+
g(this, DA).call(this);
|
|
3141
3142
|
}
|
|
3142
3143
|
onCoverResize(e) {
|
|
3143
3144
|
ts(e, {
|
|
@@ -3146,11 +3147,11 @@ class ss extends Qe {
|
|
|
3146
3147
|
});
|
|
3147
3148
|
}
|
|
3148
3149
|
}
|
|
3149
|
-
|
|
3150
|
+
AA = new WeakMap(), xA = new WeakMap(), DA = new WeakMap();
|
|
3150
3151
|
class Hi extends ss {
|
|
3151
3152
|
constructor(A) {
|
|
3152
3153
|
super(ue(QA({}, A), {
|
|
3153
|
-
loader:
|
|
3154
|
+
loader: GA
|
|
3154
3155
|
}));
|
|
3155
3156
|
}
|
|
3156
3157
|
}
|
|
@@ -3309,7 +3310,7 @@ export {
|
|
|
3309
3310
|
w as en3,
|
|
3310
3311
|
_ as en3Cache,
|
|
3311
3312
|
ai as en3GLTFLoader,
|
|
3312
|
-
|
|
3313
|
+
GA as en3TextureLoader,
|
|
3313
3314
|
Ni as getCurrentViewport,
|
|
3314
3315
|
xi as traverseMaterials,
|
|
3315
3316
|
Ui as traverseMeshes
|