aptechka 0.5.14 → 0.5.15
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.cjs +7 -7
- package/lib/en3/index.js +80 -74
- package/package.json +1 -1
package/lib/en3/index.js
CHANGED
|
@@ -2,7 +2,7 @@ var is = Object.defineProperty, os = Object.defineProperties;
|
|
|
2
2
|
var Bs = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var ot = Object.getOwnPropertySymbols;
|
|
4
4
|
var rs = Object.prototype.hasOwnProperty, Cs = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var Bt = (C, A, e) => A in C ? is(C, A, { enumerable: !0, configurable: !0, writable: !0, value: e }) : C[A] = e,
|
|
5
|
+
var Bt = (C, A, e) => A in C ? is(C, A, { enumerable: !0, configurable: !0, writable: !0, value: e }) : C[A] = e, nA = (C, A) => {
|
|
6
6
|
for (var e in A || (A = {}))
|
|
7
7
|
rs.call(A, e) && Bt(C, e, A[e]);
|
|
8
8
|
if (ot)
|
|
@@ -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 FA, Color 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 cA, 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, BA, rA, wA, CA, aA;
|
|
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, oA, void 0);
|
|
74
73
|
F(this, BA, void 0);
|
|
75
|
-
F(this, wA, void 0);
|
|
76
74
|
F(this, rA, void 0);
|
|
75
|
+
F(this, wA, void 0);
|
|
77
76
|
F(this, CA, void 0);
|
|
78
|
-
|
|
77
|
+
F(this, aA, 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, BA, []), G(this, rA, (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, CA, St(e == null ? void 0 : e.sizeElement) || document.documentElement), this.beforeRenderCallback = e == null ? void 0 : e.beforeRender, G(this, aA, new Ve(g(this, CA))), g(this, aA).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, aA);
|
|
93
93
|
}
|
|
94
94
|
get cameraDistance() {
|
|
95
|
-
return g(this,
|
|
95
|
+
return g(this, rA);
|
|
96
96
|
}
|
|
97
97
|
set cameraDistance(A) {
|
|
98
|
-
G(this,
|
|
98
|
+
G(this, rA, A), this.resize();
|
|
99
99
|
}
|
|
100
100
|
get sizeElement() {
|
|
101
|
-
return g(this,
|
|
101
|
+
return g(this, CA);
|
|
102
102
|
}
|
|
103
103
|
get isClipped() {
|
|
104
|
-
return g(this,
|
|
104
|
+
return g(this, CA) !== 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, aA);
|
|
108
|
+
g(this, J).position.z = g(this, rA), 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, rA)) * (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, BA).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, aA).destroy();
|
|
114
114
|
}
|
|
115
115
|
attachToHTMLElement(A, e, s) {
|
|
116
|
-
const t = new Ve(A, ue(
|
|
117
|
-
containerElement: g(this,
|
|
116
|
+
const t = new Ve(A, ue(nA({}, s), {
|
|
117
|
+
containerElement: g(this, CA),
|
|
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, BA).push(e), e;
|
|
122
122
|
}
|
|
123
123
|
detachFromHTMLElement(A) {
|
|
124
|
-
G(this,
|
|
124
|
+
G(this, BA, g(this, BA).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,7 +131,7 @@ 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(), BA = new WeakMap(), rA = new WeakMap(), wA = new WeakMap(), CA = new WeakMap(), aA = new WeakMap();
|
|
135
135
|
const _ = /* @__PURE__ */ new Map();
|
|
136
136
|
var ye, Z, S, x, yA, SA, LA, zA, dA, $A, Ae, ee;
|
|
137
137
|
class In {
|
|
@@ -197,7 +197,7 @@ class In {
|
|
|
197
197
|
z-index: -1;
|
|
198
198
|
`, g(this, Z).append(g(this, S).domElement), g(this, x).set(
|
|
199
199
|
"default",
|
|
200
|
-
new ht("default",
|
|
200
|
+
new ht("default", nA({
|
|
201
201
|
sizeElement: g(this, Z)
|
|
202
202
|
}, A == null ? void 0 : A.view))
|
|
203
203
|
), G(this, $A, (A == null ? void 0 : A.cacheAssets) || !1), G(this, dA, !0), NA.subscribe(g(this, Ae), yt.EN3), kA.subscribe(g(this, ee), { order: At.EN3 });
|
|
@@ -496,7 +496,7 @@ class hn {
|
|
|
496
496
|
return t;
|
|
497
497
|
const n = e.json, o = ((n.extensions && n.extensions[this.name] || {}).lights || [])[A];
|
|
498
498
|
let r;
|
|
499
|
-
const I = new
|
|
499
|
+
const I = new cA(16777215);
|
|
500
500
|
o.color !== void 0 && I.setRGB(o.color[0], o.color[1], o.color[2], P);
|
|
501
501
|
const a = o.range !== void 0 ? o.range : 0;
|
|
502
502
|
switch (o.type) {
|
|
@@ -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, oA(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")
|
|
@@ -534,7 +534,7 @@ class ln {
|
|
|
534
534
|
}
|
|
535
535
|
extendParams(A, e, s) {
|
|
536
536
|
const t = [];
|
|
537
|
-
A.color = new
|
|
537
|
+
A.color = new cA(1, 1, 1), A.opacity = 1;
|
|
538
538
|
const n = e.pbrMetallicRoughness;
|
|
539
539
|
if (n) {
|
|
540
540
|
if (Array.isArray(n.baseColorFactor)) {
|
|
@@ -607,7 +607,7 @@ class Dn {
|
|
|
607
607
|
if (!t.extensions || !t.extensions[this.name])
|
|
608
608
|
return Promise.resolve();
|
|
609
609
|
const n = [];
|
|
610
|
-
e.sheenColor = new
|
|
610
|
+
e.sheenColor = new cA(0, 0, 0), e.sheenRoughness = 0, e.sheen = 1;
|
|
611
611
|
const i = t.extensions[this.name];
|
|
612
612
|
if (i.sheenColorFactor !== void 0) {
|
|
613
613
|
const B = i.sheenColorFactor;
|
|
@@ -647,7 +647,7 @@ class Gn {
|
|
|
647
647
|
const n = [], i = t.extensions[this.name];
|
|
648
648
|
e.thickness = i.thicknessFactor !== void 0 ? i.thicknessFactor : 0, i.thicknessTexture !== void 0 && n.push(s.assignTexture(e, "thicknessMap", i.thicknessTexture)), e.attenuationDistance = i.attenuationDistance || 1 / 0;
|
|
649
649
|
const B = i.attenuationColor || [1, 1, 1];
|
|
650
|
-
return e.attenuationColor = new
|
|
650
|
+
return e.attenuationColor = new cA().setRGB(B[0], B[1], B[2], P), Promise.all(n);
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
653
|
class Rn {
|
|
@@ -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
|
|
684
|
+
return e.specularColor = new cA().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 {
|
|
@@ -1014,7 +1014,7 @@ const K = {
|
|
|
1014
1014
|
COLOR_0: "color",
|
|
1015
1015
|
WEIGHTS_0: "skinWeight",
|
|
1016
1016
|
JOINTS_0: "skinIndex"
|
|
1017
|
-
},
|
|
1017
|
+
}, iA = {
|
|
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 oA(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) {
|
|
@@ -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), oA(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)
|
|
@@ -1500,7 +1500,7 @@ class Xn {
|
|
|
1500
1500
|
i = a.getMaterialType(), r.push(a.extendParams(B, n, e));
|
|
1501
1501
|
} else {
|
|
1502
1502
|
const a = n.pbrMetallicRoughness || {};
|
|
1503
|
-
if (B.color = new
|
|
1503
|
+
if (B.color = new cA(1, 1, 1), B.opacity = 1, Array.isArray(a.baseColorFactor)) {
|
|
1504
1504
|
const c = a.baseColorFactor;
|
|
1505
1505
|
B.color.setRGB(c[0], c[1], c[2], P), B.opacity = c[3];
|
|
1506
1506
|
}
|
|
@@ -1518,11 +1518,11 @@ class Xn {
|
|
|
1518
1518
|
}
|
|
1519
1519
|
if (n.occlusionTexture !== void 0 && i !== qA && (r.push(e.assignTexture(B, "aoMap", n.occlusionTexture)), n.occlusionTexture.strength !== void 0 && (B.aoMapIntensity = n.occlusionTexture.strength)), n.emissiveFactor !== void 0 && i !== qA) {
|
|
1520
1520
|
const a = n.emissiveFactor;
|
|
1521
|
-
B.emissive = new
|
|
1521
|
+
B.emissive = new cA().setRGB(a[0], a[1], a[2], P);
|
|
1522
1522
|
}
|
|
1523
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), oA(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), oA(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)), oA(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), oA(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)), oA(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
|
+
iA[n.path] === iA.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 (iA[n.path]) {
|
|
1770
|
+
case iA.weights:
|
|
1771
1771
|
r = It;
|
|
1772
1772
|
break;
|
|
1773
|
-
case
|
|
1773
|
+
case iA.rotation:
|
|
1774
1774
|
r = gt;
|
|
1775
1775
|
break;
|
|
1776
|
-
case
|
|
1777
|
-
case
|
|
1776
|
+
case iA.position:
|
|
1777
|
+
case iA.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] + "." + iA[n.path],
|
|
1797
1797
|
e.array,
|
|
1798
1798
|
a,
|
|
1799
1799
|
I
|
|
@@ -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.`), oA(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
|
}
|
|
@@ -1959,7 +1959,7 @@ class Wn extends et {
|
|
|
1959
1959
|
_assignVertexColorSpace(A, e) {
|
|
1960
1960
|
if (e !== eA)
|
|
1961
1961
|
return;
|
|
1962
|
-
const s = new
|
|
1962
|
+
const s = new cA();
|
|
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
|
}
|
|
@@ -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,
|
|
2234
|
-
return e.globalData = { endpointCount: u, selectorCount: f, imageDescs: Y, endpointsData:
|
|
2233
|
+
const U = I + d._offset, W = U + D, KA = W + p, he = KA + m, QA = 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: QA, 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) {
|
|
@@ -2442,16 +2442,16 @@ v.BasisWorker = function() {
|
|
|
2442
2442
|
if (!h.startTranscoding())
|
|
2443
2443
|
throw E(), new Error("THREE.KTX2Loader: .startTranscoding failed");
|
|
2444
2444
|
const KA = [], he = [];
|
|
2445
|
-
for (let
|
|
2445
|
+
for (let QA = 0; QA < m; QA++) {
|
|
2446
2446
|
const le = [];
|
|
2447
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 RA = h.getImageLevelInfo(sA, V,
|
|
2452
|
-
|
|
2451
|
+
const RA = h.getImageLevelInfo(sA, V, QA);
|
|
2452
|
+
QA === 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
2453
|
const it = new Uint8Array(h.getImageTranscodedSizeInBytes(sA, V, 0, U));
|
|
2454
|
-
if (!h.transcodeImage(it, sA, V,
|
|
2454
|
+
if (!h.transcodeImage(it, sA, V, QA, U, 0, -1, -1))
|
|
2455
2455
|
throw E(), new Error("THREE.KTX2Loader: .transcodeImage failed.");
|
|
2456
2456
|
de.push(it);
|
|
2457
2457
|
}
|
|
@@ -2919,7 +2919,7 @@ 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 HA, uA, TA, oe, Be,
|
|
2922
|
+
var HA, uA, TA, oe, Be, IA, UA, re;
|
|
2923
2923
|
class es extends an {
|
|
2924
2924
|
constructor(e) {
|
|
2925
2925
|
super(e);
|
|
@@ -2928,25 +2928,25 @@ class es extends an {
|
|
|
2928
2928
|
F(this, TA, void 0);
|
|
2929
2929
|
F(this, oe, void 0);
|
|
2930
2930
|
F(this, Be, void 0);
|
|
2931
|
-
F(this,
|
|
2931
|
+
F(this, IA, void 0);
|
|
2932
2932
|
F(this, UA, !1);
|
|
2933
2933
|
F(this, re, () => {
|
|
2934
|
-
if (!(g(this,
|
|
2934
|
+
if (!(g(this, IA) && !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, IA) || 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,
|
|
2940
|
+
g(this, HA).current = ((t = this.processData) == null ? void 0 : t.call(this, s)) || s, g(this, uA).current = "complete", g(this, IA) || He.setLoaded(e, 1);
|
|
2941
2941
|
},
|
|
2942
2942
|
void 0,
|
|
2943
2943
|
() => {
|
|
2944
|
-
g(this,
|
|
2944
|
+
g(this, IA) || (g(this, uA).current = "error", He.setError(e, e));
|
|
2945
2945
|
}
|
|
2946
2946
|
);
|
|
2947
2947
|
}
|
|
2948
2948
|
});
|
|
2949
|
-
G(this, TA, e.consumer), G(this, oe, e.loader), G(this, Be, e.keepSourceParameters || !1), G(this,
|
|
2949
|
+
G(this, TA, e.consumer), G(this, oe, e.loader), G(this, Be, e.keepSourceParameters || !1), G(this, IA, e.lazy || !1), this.subscribe(g(this, re)), g(this, TA).addEventListener("added", () => {
|
|
2950
2950
|
this.connect();
|
|
2951
2951
|
}), g(this, TA).addEventListener("removed", () => {
|
|
2952
2952
|
this.disconnect();
|
|
@@ -2971,16 +2971,22 @@ class es extends an {
|
|
|
2971
2971
|
g(this, UA) || (G(this, UA, !0), g(this, re).call(this));
|
|
2972
2972
|
}
|
|
2973
2973
|
}
|
|
2974
|
-
HA = new WeakMap(), uA = new WeakMap(), TA = new WeakMap(), oe = new WeakMap(), Be = new WeakMap(),
|
|
2974
|
+
HA = new WeakMap(), uA = new WeakMap(), TA = new WeakMap(), oe = new WeakMap(), Be = new WeakMap(), IA = new WeakMap(), UA = new WeakMap(), re = new WeakMap();
|
|
2975
2975
|
var fA;
|
|
2976
2976
|
class Ji extends jA {
|
|
2977
2977
|
constructor(e) {
|
|
2978
2978
|
super();
|
|
2979
2979
|
F(this, fA, void 0);
|
|
2980
|
-
G(this, fA, new es(
|
|
2980
|
+
G(this, fA, new es(nA({
|
|
2981
2981
|
loader: ai,
|
|
2982
2982
|
consumer: this
|
|
2983
|
-
}, e))), g(this, fA).processData = (s) =>
|
|
2983
|
+
}, e))), g(this, fA).processData = (s) => {
|
|
2984
|
+
if (w.cacheAssets) {
|
|
2985
|
+
const t = nA({}, s);
|
|
2986
|
+
return t.scene = s.scene.clone(!0), t.scenes = s.scenes.map((n) => s.scene === n ? t.scene : n.clone(!0)), t;
|
|
2987
|
+
}
|
|
2988
|
+
return s;
|
|
2989
|
+
}, g(this, fA).data.subscribe((s) => {
|
|
2984
2990
|
s.current ? this.add(...s.current.scene.children) : this.children.forEach((t) => {
|
|
2985
2991
|
this.remove(t), we(t);
|
|
2986
2992
|
});
|
|
@@ -3124,7 +3130,7 @@ class ss extends Qe {
|
|
|
3124
3130
|
F(this, DA, () => {
|
|
3125
3131
|
g(this, AA).data.current && g(this, xA) === "cover" && this.onCoverResize(g(this, AA).data.current);
|
|
3126
3132
|
});
|
|
3127
|
-
G(this, AA, new es(
|
|
3133
|
+
G(this, AA, new es(nA({
|
|
3128
3134
|
consumer: this
|
|
3129
3135
|
}, e))), G(this, xA, e.fit), this.addEventListener("added", () => {
|
|
3130
3136
|
NA.subscribe(g(this, DA));
|
|
@@ -3150,7 +3156,7 @@ class ss extends Qe {
|
|
|
3150
3156
|
AA = new WeakMap(), xA = new WeakMap(), DA = new WeakMap();
|
|
3151
3157
|
class Hi extends ss {
|
|
3152
3158
|
constructor(A) {
|
|
3153
|
-
super(ue(
|
|
3159
|
+
super(ue(nA({}, A), {
|
|
3154
3160
|
loader: GA
|
|
3155
3161
|
}));
|
|
3156
3162
|
}
|
|
@@ -3168,7 +3174,7 @@ class hi {
|
|
|
3168
3174
|
var Ce, ae, Ie;
|
|
3169
3175
|
class Ti extends ss {
|
|
3170
3176
|
constructor(e) {
|
|
3171
|
-
super(ue(
|
|
3177
|
+
super(ue(nA({}, e), {
|
|
3172
3178
|
loader: new hi()
|
|
3173
3179
|
}));
|
|
3174
3180
|
F(this, Ce, void 0);
|
|
@@ -3249,22 +3255,22 @@ X = new WeakMap(), Se = new WeakSet(), ns = function() {
|
|
|
3249
3255
|
g(k, X).setSize(w.width, w.height);
|
|
3250
3256
|
});
|
|
3251
3257
|
let wt = k;
|
|
3252
|
-
var
|
|
3258
|
+
var gA, EA, ce, $e;
|
|
3253
3259
|
class ki {
|
|
3254
3260
|
constructor(A) {
|
|
3255
3261
|
F(this, ce);
|
|
3256
|
-
F(this, IA, void 0);
|
|
3257
3262
|
F(this, gA, void 0);
|
|
3258
|
-
|
|
3263
|
+
F(this, EA, void 0);
|
|
3264
|
+
G(this, gA, A.material), G(this, EA, A.uniforms || {}), g(this, gA).userData.uniforms = g(this, EA);
|
|
3259
3265
|
let e;
|
|
3260
3266
|
const s = () => {
|
|
3261
3267
|
e == null || e();
|
|
3262
3268
|
};
|
|
3263
|
-
g(this,
|
|
3269
|
+
g(this, gA).addEventListener("dispose", s), g(this, gA).onBeforeCompile = (t) => {
|
|
3264
3270
|
var n;
|
|
3265
3271
|
e == null || e();
|
|
3266
|
-
for (const i in g(this,
|
|
3267
|
-
t.uniforms[i] = g(this,
|
|
3272
|
+
for (const i in g(this, EA))
|
|
3273
|
+
t.uniforms[i] = g(this, EA)[i];
|
|
3268
3274
|
A.vertextDeclarations && (t.vertexShader = `
|
|
3269
3275
|
${A.vertextDeclarations}
|
|
3270
3276
|
${t.vertexShader}
|
|
@@ -3275,13 +3281,13 @@ class ki {
|
|
|
3275
3281
|
};
|
|
3276
3282
|
}
|
|
3277
3283
|
get material() {
|
|
3278
|
-
return g(this,
|
|
3284
|
+
return g(this, gA);
|
|
3279
3285
|
}
|
|
3280
3286
|
get uniforms() {
|
|
3281
|
-
return g(this,
|
|
3287
|
+
return g(this, EA);
|
|
3282
3288
|
}
|
|
3283
3289
|
}
|
|
3284
|
-
|
|
3290
|
+
gA = new WeakMap(), EA = new WeakMap(), ce = new WeakSet(), $e = function(A, e, s) {
|
|
3285
3291
|
const t = e === "vertex" ? "vertexChunk" : "fragmentChunk", n = e === "vertex" ? "vertexShader" : "fragmentShader";
|
|
3286
3292
|
s[t] && (s[t].replace ? A[n] = A[n].replace(
|
|
3287
3293
|
`#include <${s[t].replace}>`,
|