@takram/three-geospatial 0.7.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/README.md +1 -1
- package/build/index.cjs +1 -1
- package/build/index.cjs.map +1 -1
- package/build/index.js +580 -598
- package/build/index.js.map +1 -1
- package/build/r3f.cjs +1 -1
- package/build/r3f.js +1 -1
- package/build/shared2.cjs +1 -1
- package/build/shared2.cjs.map +1 -1
- package/build/shared2.js +27 -212
- package/build/shared2.js.map +1 -1
- package/build/shared3.cjs +1 -1
- package/build/shared3.cjs.map +1 -1
- package/build/shared3.js +213 -8
- package/build/shared3.js.map +1 -1
- package/build/webgpu.cjs +6 -1
- package/build/webgpu.cjs.map +1 -1
- package/build/webgpu.js +1111 -768
- package/build/webgpu.js.map +1 -1
- package/package.json +1 -1
- package/src/EllipsoidGeometry.ts +1 -1
- package/src/PointOfView.ts +12 -5
- package/src/STBNLoader.ts +41 -19
- package/src/unrollLoops.ts +1 -1
- package/src/webgpu/CascadedShadowMapsNode.ts +48 -0
- package/src/webgpu/DualMipmapFilterNode.ts +8 -4
- package/src/webgpu/FilterNode.ts +5 -3
- package/src/webgpu/FnLayout.ts +17 -16
- package/src/webgpu/HighpVelocityNode.ts +9 -4
- package/src/webgpu/LensFlareNode.ts +12 -16
- package/src/webgpu/LensGlareNode.ts +28 -32
- package/src/webgpu/LensHaloNode.ts +2 -1
- package/src/webgpu/OutputTexture3DNode.ts +10 -0
- package/src/webgpu/OutputTextureNode.ts +10 -0
- package/src/webgpu/STBNTextureNode.ts +58 -0
- package/src/webgpu/ScreenSpaceShadowNode.ts +685 -0
- package/src/webgpu/SeparableFilterNode.ts +8 -5
- package/src/webgpu/SingleFilterNode.ts +5 -2
- package/src/webgpu/StorageTexture3DNode.ts +30 -0
- package/src/webgpu/TemporalAntialiasNode.ts +178 -137
- package/src/webgpu/accessors.ts +75 -36
- package/src/webgpu/debug.ts +38 -47
- package/src/webgpu/events.ts +18 -0
- package/src/webgpu/index.ts +5 -1
- package/src/webgpu/math.ts +116 -15
- package/src/webgpu/sampling.ts +39 -5
- package/src/webgpu/transformations.ts +71 -44
- package/types/PointOfView.d.ts +1 -1
- package/types/STBNLoader.d.ts +3 -4
- package/types/webgpu/CascadedShadowMapsNode.d.ts +13 -0
- package/types/webgpu/DualMipmapFilterNode.d.ts +1 -2
- package/types/webgpu/FnLayout.d.ts +4 -4
- package/types/webgpu/HighpVelocityNode.d.ts +1 -0
- package/types/webgpu/LensFlareNode.d.ts +2 -3
- package/types/webgpu/LensGlareNode.d.ts +1 -1
- package/types/webgpu/STBNTextureNode.d.ts +9 -0
- package/types/webgpu/ScreenSpaceShadowNode.d.ts +33 -0
- package/types/webgpu/SeparableFilterNode.d.ts +2 -3
- package/types/webgpu/SingleFilterNode.d.ts +1 -2
- package/types/webgpu/StorageTexture3DNode.d.ts +9 -0
- package/types/webgpu/TemporalAntialiasNode.d.ts +9 -10
- package/types/webgpu/accessors.d.ts +9 -8
- package/types/webgpu/debug.d.ts +4 -3
- package/types/webgpu/events.d.ts +3 -0
- package/types/webgpu/index.d.ts +5 -1
- package/types/webgpu/math.d.ts +3 -0
- package/types/webgpu/sampling.d.ts +2 -1
- package/types/webgpu/transformations.d.ts +7 -10
- package/src/webgpu/RTTextureNode.ts +0 -130
- package/types/webgpu/RTTextureNode.d.ts +0 -22
package/build/index.js
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
import { Loader as K, FileLoader as
|
|
2
|
-
import { i as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
class
|
|
8
|
-
load(t, n, r,
|
|
9
|
-
const
|
|
10
|
-
|
|
1
|
+
import { Loader as K, FileLoader as ze, BufferGeometry as He, BufferAttribute as Ht, Box3 as We, Vector3 as U, Sphere as Ve, WebGLRenderer as Ye, LinearFilter as Wt, RGBAFormat as Xe, ByteType as qe, UnsignedByteType as Vt, ShortType as ke, UnsignedShortType as Je, IntType as $e, UnsignedIntType as Qe, HalfFloatType as Ze, FloatType as Yt, MathUtils as _, Material as pt, Data3DTexture as Ke, DataTexture as tn, Quaternion as en, Matrix4 as nn, Ray as rn, Vector2 as ue } from "three";
|
|
2
|
+
import { i as ye } from "./shared.js";
|
|
3
|
+
import { D as ns, Q as rs, S as ss, a as os, b as is, c as cs } from "./shared2.js";
|
|
4
|
+
import { E as Xt, G as V } from "./shared3.js";
|
|
5
|
+
import { a as hs } from "./shared3.js";
|
|
6
|
+
import { EXRLoader as de } from "three/addons/loaders/EXRLoader.js";
|
|
7
|
+
class sn extends K {
|
|
8
|
+
load(t, n, r, o) {
|
|
9
|
+
const s = new ze(this.manager);
|
|
10
|
+
s.setResponseType("arraybuffer"), s.setRequestHeader(this.requestHeader), s.setPath(this.path), s.setWithCredentials(this.withCredentials), s.load(
|
|
11
11
|
t,
|
|
12
12
|
(i) => {
|
|
13
|
-
|
|
13
|
+
ye(i instanceof ArrayBuffer);
|
|
14
14
|
try {
|
|
15
15
|
n(i);
|
|
16
16
|
} catch (c) {
|
|
17
|
-
|
|
17
|
+
o != null ? o(c) : console.error(c), this.manager.itemError(t);
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
r,
|
|
21
|
-
|
|
21
|
+
o
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
const { attributes: t, index: n, boundingBox: r, boundingSphere:
|
|
25
|
+
function Ar(e) {
|
|
26
|
+
const { attributes: t, index: n, boundingBox: r, boundingSphere: o } = e;
|
|
27
27
|
return [
|
|
28
|
-
{ attributes: t, index: n, boundingBox: r, boundingSphere:
|
|
28
|
+
{ attributes: t, index: n, boundingBox: r, boundingSphere: o },
|
|
29
29
|
[
|
|
30
30
|
...Object.values(e.attributes).map(
|
|
31
|
-
(
|
|
31
|
+
(s) => s.array.buffer
|
|
32
32
|
),
|
|
33
33
|
e.index?.array.buffer
|
|
34
|
-
].filter((
|
|
34
|
+
].filter((s) => s != null)
|
|
35
35
|
];
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function gr(e, t = new He()) {
|
|
38
38
|
for (const [n, r] of Object.entries(e.attributes))
|
|
39
39
|
t.setAttribute(
|
|
40
40
|
n,
|
|
41
|
-
new
|
|
41
|
+
new Ht(
|
|
42
42
|
r.array,
|
|
43
43
|
r.itemSize,
|
|
44
44
|
r.normalized
|
|
45
45
|
)
|
|
46
46
|
);
|
|
47
|
-
if (t.index = e.index != null ? new
|
|
47
|
+
if (t.index = e.index != null ? new Ht(
|
|
48
48
|
e.index.array,
|
|
49
49
|
e.index.itemSize,
|
|
50
50
|
e.index.normalized
|
|
51
51
|
) : null, e.boundingBox != null) {
|
|
52
52
|
const { min: n, max: r } = e.boundingBox;
|
|
53
|
-
t.boundingBox = new
|
|
53
|
+
t.boundingBox = new We(
|
|
54
54
|
new U(n.x, n.y, n.z),
|
|
55
55
|
new U(r.x, r.y, r.z)
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
58
|
if (e.boundingSphere != null) {
|
|
59
59
|
const { center: n, radius: r } = e.boundingSphere;
|
|
60
|
-
t.boundingSphere = new
|
|
60
|
+
t.boundingSphere = new Ve(
|
|
61
61
|
new U(n.x, n.y, n.z),
|
|
62
62
|
r
|
|
63
63
|
);
|
|
64
64
|
}
|
|
65
65
|
return t;
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
return e instanceof
|
|
67
|
+
function wr(e) {
|
|
68
|
+
return e instanceof Ye ? e.getContext().getExtension("OES_texture_float_linear") != null : e.backend.hasFeature?.("float32-filterable") ?? !1;
|
|
69
69
|
}
|
|
70
|
-
const
|
|
70
|
+
const on = "This is not an object", cn = "This is not a Float16Array object", qt = "This constructor is not a subclass of Float16Array", pe = "The constructor property value is not an object", an = "Species constructor didn't return TypedArray object", hn = "Derived constructor created TypedArray object which was too small length", J = "Attempting to access detached ArrayBuffer", Pt = "Cannot convert undefined or null to object", xt = "Cannot mix BigInt and other types, use explicit conversions", kt = "@@iterator property is not callable", Jt = "Reduce of empty array with no initial value", fn = "The comparison function must be either a function or undefined", St = "Offset is out of bounds";
|
|
71
71
|
function g(e) {
|
|
72
|
-
return (t, ...n) =>
|
|
72
|
+
return (t, ...n) => S(e, t, n);
|
|
73
73
|
}
|
|
74
74
|
function H(e, t) {
|
|
75
75
|
return g(
|
|
@@ -80,32 +80,32 @@ function H(e, t) {
|
|
|
80
80
|
);
|
|
81
81
|
}
|
|
82
82
|
const {
|
|
83
|
-
apply:
|
|
84
|
-
construct:
|
|
85
|
-
defineProperty:
|
|
86
|
-
get:
|
|
83
|
+
apply: S,
|
|
84
|
+
construct: q,
|
|
85
|
+
defineProperty: $t,
|
|
86
|
+
get: mt,
|
|
87
87
|
getOwnPropertyDescriptor: v,
|
|
88
88
|
getPrototypeOf: tt,
|
|
89
|
-
has:
|
|
90
|
-
ownKeys:
|
|
91
|
-
set:
|
|
92
|
-
setPrototypeOf:
|
|
93
|
-
} = Reflect,
|
|
94
|
-
EPSILON:
|
|
95
|
-
MAX_SAFE_INTEGER:
|
|
96
|
-
isFinite:
|
|
89
|
+
has: Nt,
|
|
90
|
+
ownKeys: Ae,
|
|
91
|
+
set: Qt,
|
|
92
|
+
setPrototypeOf: ge
|
|
93
|
+
} = Reflect, ln = Proxy, {
|
|
94
|
+
EPSILON: un,
|
|
95
|
+
MAX_SAFE_INTEGER: Zt,
|
|
96
|
+
isFinite: we,
|
|
97
97
|
isNaN: G
|
|
98
98
|
} = Number, {
|
|
99
99
|
iterator: x,
|
|
100
|
-
species:
|
|
100
|
+
species: yn,
|
|
101
101
|
toStringTag: Mt,
|
|
102
|
-
for:
|
|
102
|
+
for: dn
|
|
103
103
|
} = Symbol, j = Object, {
|
|
104
104
|
create: At,
|
|
105
105
|
defineProperty: et,
|
|
106
|
-
freeze:
|
|
107
|
-
is:
|
|
108
|
-
} = j, Lt = j.prototype,
|
|
106
|
+
freeze: pn,
|
|
107
|
+
is: Kt
|
|
108
|
+
} = j, Lt = j.prototype, An = (
|
|
109
109
|
/** @type {any} */
|
|
110
110
|
Lt.__lookupGetter__ ? g(
|
|
111
111
|
/** @type {any} */
|
|
@@ -113,32 +113,32 @@ const {
|
|
|
113
113
|
) : (e, t) => {
|
|
114
114
|
if (e == null)
|
|
115
115
|
throw w(
|
|
116
|
-
|
|
116
|
+
Pt
|
|
117
117
|
);
|
|
118
118
|
let n = j(e);
|
|
119
119
|
do {
|
|
120
120
|
const r = v(n, t);
|
|
121
121
|
if (r !== void 0)
|
|
122
|
-
return
|
|
122
|
+
return R(r, "get") ? r.get : void 0;
|
|
123
123
|
} while ((n = tt(n)) !== null);
|
|
124
124
|
}
|
|
125
|
-
),
|
|
125
|
+
), R = (
|
|
126
126
|
/** @type {any} */
|
|
127
127
|
j.hasOwn || g(Lt.hasOwnProperty)
|
|
128
|
-
),
|
|
128
|
+
), Te = Array, be = Te.isArray, gt = Te.prototype, gn = g(gt.join), wn = g(gt.push), Tn = g(
|
|
129
129
|
gt.toLocaleString
|
|
130
|
-
), Bt = gt[x],
|
|
131
|
-
abs:
|
|
132
|
-
trunc:
|
|
133
|
-
} = Math, wt = ArrayBuffer,
|
|
130
|
+
), Bt = gt[x], bn = g(Bt), {
|
|
131
|
+
abs: Sn,
|
|
132
|
+
trunc: Se
|
|
133
|
+
} = Math, wt = ArrayBuffer, mn = wt.isView, me = wt.prototype, _n = g(me.slice), En = H(me, "byteLength"), Rt = typeof SharedArrayBuffer < "u" ? SharedArrayBuffer : null, In = Rt && H(Rt.prototype, "byteLength"), Ft = tt(Uint8Array), On = Ft.from, b = Ft.prototype, Pn = b[x], xn = g(b.keys), Nn = g(
|
|
134
134
|
b.values
|
|
135
|
-
),
|
|
135
|
+
), Ln = g(
|
|
136
136
|
b.entries
|
|
137
|
-
),
|
|
137
|
+
), Rn = g(b.set), te = g(
|
|
138
138
|
b.reverse
|
|
139
|
-
),
|
|
139
|
+
), Un = g(b.fill), Cn = g(
|
|
140
140
|
b.copyWithin
|
|
141
|
-
),
|
|
141
|
+
), ee = g(b.sort), Y = g(b.slice), Mn = g(
|
|
142
142
|
b.subarray
|
|
143
143
|
), T = H(
|
|
144
144
|
b,
|
|
@@ -149,16 +149,16 @@ const {
|
|
|
149
149
|
), y = H(
|
|
150
150
|
b,
|
|
151
151
|
"length"
|
|
152
|
-
),
|
|
152
|
+
), _e = H(
|
|
153
153
|
b,
|
|
154
154
|
Mt
|
|
155
|
-
),
|
|
156
|
-
})().next),
|
|
157
|
-
|
|
158
|
-
), w = TypeError,
|
|
155
|
+
), Bn = Uint8Array, m = Uint16Array, ne = (...e) => S(On, m, e), Dt = Uint32Array, Fn = Float32Array, M = tt([][x]()), Tt = g(M.next), Dn = g((function* () {
|
|
156
|
+
})().next), vn = tt(M), Gn = DataView.prototype, jn = g(
|
|
157
|
+
Gn.getUint16
|
|
158
|
+
), w = TypeError, _t = RangeError, Ee = WeakSet, Ie = Ee.prototype, zn = g(Ie.add), Hn = g(Ie.has), bt = WeakMap, vt = bt.prototype, at = g(vt.get), Wn = g(vt.has), Gt = g(vt.set), Oe = new bt(), Vn = At(null, {
|
|
159
159
|
next: {
|
|
160
160
|
value: function() {
|
|
161
|
-
const t = at(
|
|
161
|
+
const t = at(Oe, this);
|
|
162
162
|
return Tt(t);
|
|
163
163
|
}
|
|
164
164
|
},
|
|
@@ -168,44 +168,44 @@ const {
|
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
});
|
|
171
|
-
function
|
|
172
|
-
if (e[x] === Bt &&
|
|
171
|
+
function k(e) {
|
|
172
|
+
if (e[x] === Bt && M.next === Tt)
|
|
173
173
|
return e;
|
|
174
|
-
const t = At(
|
|
175
|
-
return
|
|
174
|
+
const t = At(Vn);
|
|
175
|
+
return Gt(Oe, t, bn(e)), t;
|
|
176
176
|
}
|
|
177
|
-
const
|
|
177
|
+
const Pe = new bt(), xe = At(vn, {
|
|
178
178
|
next: {
|
|
179
179
|
value: function() {
|
|
180
|
-
const t = at(
|
|
181
|
-
return
|
|
180
|
+
const t = at(Pe, this);
|
|
181
|
+
return Dn(t);
|
|
182
182
|
},
|
|
183
183
|
writable: !0,
|
|
184
184
|
configurable: !0
|
|
185
185
|
}
|
|
186
186
|
});
|
|
187
|
-
for (const e of
|
|
188
|
-
e !== "next" && et(
|
|
189
|
-
function
|
|
190
|
-
const t = At(
|
|
191
|
-
return
|
|
187
|
+
for (const e of Ae(M))
|
|
188
|
+
e !== "next" && et(xe, e, v(M, e));
|
|
189
|
+
function re(e) {
|
|
190
|
+
const t = At(xe);
|
|
191
|
+
return Gt(Pe, t, e), t;
|
|
192
192
|
}
|
|
193
193
|
function ht(e) {
|
|
194
194
|
return e !== null && typeof e == "object" || typeof e == "function";
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function se(e) {
|
|
197
197
|
return e !== null && typeof e == "object";
|
|
198
198
|
}
|
|
199
199
|
function ft(e) {
|
|
200
|
-
return
|
|
200
|
+
return _e(e) !== void 0;
|
|
201
201
|
}
|
|
202
|
-
function
|
|
203
|
-
const t =
|
|
202
|
+
function Ut(e) {
|
|
203
|
+
const t = _e(e);
|
|
204
204
|
return t === "BigInt64Array" || t === "BigUint64Array";
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function Yn(e) {
|
|
207
207
|
try {
|
|
208
|
-
return
|
|
208
|
+
return be(e) ? !1 : (En(
|
|
209
209
|
/** @type {any} */
|
|
210
210
|
e
|
|
211
211
|
), !0);
|
|
@@ -213,11 +213,11 @@ function Zn(e) {
|
|
|
213
213
|
return !1;
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
function
|
|
217
|
-
if (
|
|
216
|
+
function Ne(e) {
|
|
217
|
+
if (Rt === null)
|
|
218
218
|
return !1;
|
|
219
219
|
try {
|
|
220
|
-
return
|
|
220
|
+
return In(
|
|
221
221
|
/** @type {any} */
|
|
222
222
|
e
|
|
223
223
|
), !0;
|
|
@@ -225,70 +225,70 @@ function Ue(e) {
|
|
|
225
225
|
return !1;
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
|
-
function
|
|
229
|
-
return
|
|
228
|
+
function Xn(e) {
|
|
229
|
+
return Yn(e) || Ne(e);
|
|
230
230
|
}
|
|
231
|
-
function
|
|
232
|
-
return
|
|
231
|
+
function oe(e) {
|
|
232
|
+
return be(e) ? e[x] === Bt && M.next === Tt : !1;
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
return ft(e) ? e[x] ===
|
|
234
|
+
function qn(e) {
|
|
235
|
+
return ft(e) ? e[x] === Pn && M.next === Tt : !1;
|
|
236
236
|
}
|
|
237
237
|
function nt(e) {
|
|
238
238
|
if (typeof e != "string")
|
|
239
239
|
return !1;
|
|
240
240
|
const t = +e;
|
|
241
|
-
return e !== t + "" || !
|
|
241
|
+
return e !== t + "" || !we(t) ? !1 : t === Se(t);
|
|
242
242
|
}
|
|
243
|
-
const lt =
|
|
244
|
-
function
|
|
245
|
-
if (!
|
|
243
|
+
const lt = dn("__Float16Array__");
|
|
244
|
+
function kn(e) {
|
|
245
|
+
if (!se(e))
|
|
246
246
|
return !1;
|
|
247
247
|
const t = tt(e);
|
|
248
|
-
if (!
|
|
248
|
+
if (!se(t))
|
|
249
249
|
return !1;
|
|
250
250
|
const n = t.constructor;
|
|
251
251
|
if (n === void 0)
|
|
252
252
|
return !1;
|
|
253
253
|
if (!ht(n))
|
|
254
|
-
throw w(
|
|
255
|
-
return
|
|
254
|
+
throw w(pe);
|
|
255
|
+
return Nt(n, lt);
|
|
256
256
|
}
|
|
257
|
-
const
|
|
258
|
-
function
|
|
259
|
-
return e +
|
|
257
|
+
const Ct = 1 / un;
|
|
258
|
+
function Jn(e) {
|
|
259
|
+
return e + Ct - Ct;
|
|
260
260
|
}
|
|
261
|
-
const
|
|
262
|
-
function
|
|
261
|
+
const Le = 6103515625e-14, $n = 65504, Re = 9765625e-10, ie = Re * Le, Qn = Re * Ct;
|
|
262
|
+
function Zn(e) {
|
|
263
263
|
const t = +e;
|
|
264
|
-
if (!
|
|
264
|
+
if (!we(t) || t === 0)
|
|
265
265
|
return t;
|
|
266
|
-
const n = t > 0 ? 1 : -1, r =
|
|
267
|
-
if (r <
|
|
268
|
-
return n *
|
|
269
|
-
const
|
|
270
|
-
return
|
|
266
|
+
const n = t > 0 ? 1 : -1, r = Sn(t);
|
|
267
|
+
if (r < Le)
|
|
268
|
+
return n * Jn(r / ie) * ie;
|
|
269
|
+
const o = (1 + Qn) * r, s = o - (o - r);
|
|
270
|
+
return s > $n || G(s) ? n * (1 / 0) : n * s;
|
|
271
271
|
}
|
|
272
|
-
const
|
|
272
|
+
const Ue = new wt(4), Ce = new Fn(Ue), Me = new Dt(Ue), E = new m(512), I = new Bn(512);
|
|
273
273
|
for (let e = 0; e < 256; ++e) {
|
|
274
274
|
const t = e - 127;
|
|
275
275
|
t < -24 ? (E[e] = 0, E[e | 256] = 32768, I[e] = 24, I[e | 256] = 24) : t < -14 ? (E[e] = 1024 >> -t - 14, E[e | 256] = 1024 >> -t - 14 | 32768, I[e] = -t - 1, I[e | 256] = -t - 1) : t <= 15 ? (E[e] = t + 15 << 10, E[e | 256] = t + 15 << 10 | 32768, I[e] = 13, I[e | 256] = 13) : t < 128 ? (E[e] = 31744, E[e | 256] = 64512, I[e] = 24, I[e | 256] = 24) : (E[e] = 31744, E[e | 256] = 64512, I[e] = 13, I[e | 256] = 13);
|
|
276
276
|
}
|
|
277
277
|
function P(e) {
|
|
278
|
-
|
|
279
|
-
const t =
|
|
278
|
+
Ce[0] = Zn(e);
|
|
279
|
+
const t = Me[0], n = t >> 23 & 511;
|
|
280
280
|
return E[n] + ((t & 8388607) >> I[n]);
|
|
281
281
|
}
|
|
282
|
-
const
|
|
282
|
+
const jt = new Dt(2048);
|
|
283
283
|
for (let e = 1; e < 1024; ++e) {
|
|
284
284
|
let t = e << 13, n = 0;
|
|
285
285
|
for (; (t & 8388608) === 0; )
|
|
286
286
|
t <<= 1, n -= 8388608;
|
|
287
|
-
t &= -8388609, n += 947912704,
|
|
287
|
+
t &= -8388609, n += 947912704, jt[e] = t | n;
|
|
288
288
|
}
|
|
289
289
|
for (let e = 1024; e < 2048; ++e)
|
|
290
|
-
|
|
291
|
-
const W = new
|
|
290
|
+
jt[e] = 939524096 + (e - 1024 << 13);
|
|
291
|
+
const W = new Dt(64);
|
|
292
292
|
for (let e = 1; e < 31; ++e)
|
|
293
293
|
W[e] = e << 23;
|
|
294
294
|
W[31] = 1199570944;
|
|
@@ -296,42 +296,42 @@ W[32] = 2147483648;
|
|
|
296
296
|
for (let e = 33; e < 63; ++e)
|
|
297
297
|
W[e] = 2147483648 + (e - 32 << 23);
|
|
298
298
|
W[63] = 3347054592;
|
|
299
|
-
const
|
|
299
|
+
const Be = new m(64);
|
|
300
300
|
for (let e = 1; e < 64; ++e)
|
|
301
|
-
e !== 32 && (
|
|
302
|
-
function
|
|
301
|
+
e !== 32 && (Be[e] = 1024);
|
|
302
|
+
function p(e) {
|
|
303
303
|
const t = e >> 10;
|
|
304
|
-
return
|
|
304
|
+
return Me[0] = jt[Be[t] + (e & 1023)] + W[t], Ce[0];
|
|
305
305
|
}
|
|
306
|
-
function
|
|
306
|
+
function L(e) {
|
|
307
307
|
const t = +e;
|
|
308
|
-
return G(t) || t === 0 ? 0 :
|
|
308
|
+
return G(t) || t === 0 ? 0 : Se(t);
|
|
309
309
|
}
|
|
310
|
-
function
|
|
311
|
-
const t =
|
|
312
|
-
return t < 0 ? 0 : t <
|
|
310
|
+
function Et(e) {
|
|
311
|
+
const t = L(e);
|
|
312
|
+
return t < 0 ? 0 : t < Zt ? t : Zt;
|
|
313
313
|
}
|
|
314
314
|
function rt(e, t) {
|
|
315
315
|
if (!ht(e))
|
|
316
|
-
throw w(
|
|
316
|
+
throw w(on);
|
|
317
317
|
const n = e.constructor;
|
|
318
318
|
if (n === void 0)
|
|
319
319
|
return t;
|
|
320
320
|
if (!ht(n))
|
|
321
|
-
throw w(
|
|
322
|
-
const r = n[
|
|
321
|
+
throw w(pe);
|
|
322
|
+
const r = n[yn];
|
|
323
323
|
return r ?? t;
|
|
324
324
|
}
|
|
325
325
|
function $(e) {
|
|
326
|
-
if (
|
|
326
|
+
if (Ne(e))
|
|
327
327
|
return !1;
|
|
328
328
|
try {
|
|
329
|
-
return
|
|
329
|
+
return _n(e, 0, 0), !1;
|
|
330
330
|
} catch {
|
|
331
331
|
}
|
|
332
332
|
return !0;
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function ce(e, t) {
|
|
335
335
|
const n = G(e), r = G(t);
|
|
336
336
|
if (n && r)
|
|
337
337
|
return 0;
|
|
@@ -342,46 +342,46 @@ function he(e, t) {
|
|
|
342
342
|
if (e > t)
|
|
343
343
|
return 1;
|
|
344
344
|
if (e === 0 && t === 0) {
|
|
345
|
-
const
|
|
346
|
-
if (!
|
|
345
|
+
const o = Kt(e, 0), s = Kt(t, 0);
|
|
346
|
+
if (!o && s)
|
|
347
347
|
return -1;
|
|
348
|
-
if (
|
|
348
|
+
if (o && !s)
|
|
349
349
|
return 1;
|
|
350
350
|
}
|
|
351
351
|
return 0;
|
|
352
352
|
}
|
|
353
|
-
const
|
|
353
|
+
const zt = 2, ut = new bt();
|
|
354
354
|
function D(e) {
|
|
355
|
-
return
|
|
355
|
+
return Wn(ut, e) || !mn(e) && kn(e);
|
|
356
356
|
}
|
|
357
357
|
function u(e) {
|
|
358
358
|
if (!D(e))
|
|
359
|
-
throw w(
|
|
359
|
+
throw w(cn);
|
|
360
360
|
}
|
|
361
361
|
function st(e, t) {
|
|
362
362
|
const n = D(e), r = ft(e);
|
|
363
363
|
if (!n && !r)
|
|
364
|
-
throw w(
|
|
364
|
+
throw w(an);
|
|
365
365
|
if (typeof t == "number") {
|
|
366
|
-
let
|
|
366
|
+
let o;
|
|
367
367
|
if (n) {
|
|
368
|
-
const
|
|
369
|
-
|
|
368
|
+
const s = l(e);
|
|
369
|
+
o = y(s);
|
|
370
370
|
} else
|
|
371
|
-
|
|
372
|
-
if (
|
|
371
|
+
o = y(e);
|
|
372
|
+
if (o < t)
|
|
373
373
|
throw w(
|
|
374
|
-
|
|
374
|
+
hn
|
|
375
375
|
);
|
|
376
376
|
}
|
|
377
|
-
if (
|
|
378
|
-
throw w(
|
|
377
|
+
if (Ut(e))
|
|
378
|
+
throw w(xt);
|
|
379
379
|
}
|
|
380
380
|
function l(e) {
|
|
381
381
|
const t = at(ut, e);
|
|
382
382
|
if (t !== void 0) {
|
|
383
|
-
const
|
|
384
|
-
if ($(
|
|
383
|
+
const o = T(t);
|
|
384
|
+
if ($(o))
|
|
385
385
|
throw w(J);
|
|
386
386
|
return t;
|
|
387
387
|
}
|
|
@@ -391,7 +391,7 @@ function l(e) {
|
|
|
391
391
|
);
|
|
392
392
|
if ($(n))
|
|
393
393
|
throw w(J);
|
|
394
|
-
const r =
|
|
394
|
+
const r = q(A, [
|
|
395
395
|
n,
|
|
396
396
|
/** @type {any} */
|
|
397
397
|
e.byteOffset,
|
|
@@ -400,76 +400,76 @@ function l(e) {
|
|
|
400
400
|
], e.constructor);
|
|
401
401
|
return at(ut, r);
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function ae(e) {
|
|
404
404
|
const t = y(e), n = [];
|
|
405
405
|
for (let r = 0; r < t; ++r)
|
|
406
|
-
n[r] =
|
|
406
|
+
n[r] = p(e[r]);
|
|
407
407
|
return n;
|
|
408
408
|
}
|
|
409
|
-
const
|
|
410
|
-
for (const e of
|
|
409
|
+
const Fe = new Ee();
|
|
410
|
+
for (const e of Ae(b)) {
|
|
411
411
|
if (e === Mt)
|
|
412
412
|
continue;
|
|
413
413
|
const t = v(b, e);
|
|
414
|
-
|
|
414
|
+
R(t, "get") && typeof t.get == "function" && zn(Fe, t.get);
|
|
415
415
|
}
|
|
416
|
-
const
|
|
416
|
+
const Kn = pn(
|
|
417
417
|
/** @type {ProxyHandler<Float16BitsArray>} */
|
|
418
418
|
{
|
|
419
419
|
get(e, t, n) {
|
|
420
|
-
return nt(t) &&
|
|
420
|
+
return nt(t) && R(e, t) ? p(mt(e, t)) : Hn(Fe, An(e, t)) ? mt(e, t) : mt(e, t, n);
|
|
421
421
|
},
|
|
422
422
|
set(e, t, n, r) {
|
|
423
|
-
return nt(t) &&
|
|
423
|
+
return nt(t) && R(e, t) ? Qt(e, t, P(n)) : Qt(e, t, n, r);
|
|
424
424
|
},
|
|
425
425
|
getOwnPropertyDescriptor(e, t) {
|
|
426
|
-
if (nt(t) &&
|
|
426
|
+
if (nt(t) && R(e, t)) {
|
|
427
427
|
const n = v(e, t);
|
|
428
|
-
return n.value =
|
|
428
|
+
return n.value = p(n.value), n;
|
|
429
429
|
}
|
|
430
430
|
return v(e, t);
|
|
431
431
|
},
|
|
432
432
|
defineProperty(e, t, n) {
|
|
433
|
-
return nt(t) &&
|
|
433
|
+
return nt(t) && R(e, t) && R(n, "value") && (n.value = P(n.value)), $t(e, t, n);
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
);
|
|
437
437
|
class A {
|
|
438
438
|
/** @see https://tc39.es/ecma262/#sec-typedarray */
|
|
439
439
|
constructor(t, n, r) {
|
|
440
|
-
let
|
|
440
|
+
let o;
|
|
441
441
|
if (D(t))
|
|
442
|
-
|
|
443
|
-
else if (ht(t) && !
|
|
442
|
+
o = q(m, [l(t)], new.target);
|
|
443
|
+
else if (ht(t) && !Xn(t)) {
|
|
444
444
|
let i, c;
|
|
445
445
|
if (ft(t)) {
|
|
446
446
|
i = t, c = y(t);
|
|
447
447
|
const a = T(t);
|
|
448
448
|
if ($(a))
|
|
449
449
|
throw w(J);
|
|
450
|
-
if (
|
|
451
|
-
throw w(
|
|
450
|
+
if (Ut(t))
|
|
451
|
+
throw w(xt);
|
|
452
452
|
const h = new wt(
|
|
453
|
-
c *
|
|
453
|
+
c * zt
|
|
454
454
|
);
|
|
455
|
-
|
|
455
|
+
o = q(m, [h], new.target);
|
|
456
456
|
} else {
|
|
457
457
|
const a = t[x];
|
|
458
458
|
if (a != null && typeof a != "function")
|
|
459
|
-
throw w(
|
|
460
|
-
a != null ?
|
|
459
|
+
throw w(kt);
|
|
460
|
+
a != null ? oe(t) ? (i = t, c = t.length) : (i = [.../** @type {Iterable<unknown>} */
|
|
461
461
|
t], c = i.length) : (i = /** @type {ArrayLike<unknown>} */
|
|
462
|
-
t, c =
|
|
462
|
+
t, c = Et(i.length)), o = q(m, [c], new.target);
|
|
463
463
|
}
|
|
464
464
|
for (let a = 0; a < c; ++a)
|
|
465
|
-
|
|
465
|
+
o[a] = P(i[a]);
|
|
466
466
|
} else
|
|
467
|
-
|
|
468
|
-
const
|
|
467
|
+
o = q(m, arguments, new.target);
|
|
468
|
+
const s = (
|
|
469
469
|
/** @type {any} */
|
|
470
|
-
new
|
|
470
|
+
new ln(o, Kn)
|
|
471
471
|
);
|
|
472
|
-
return
|
|
472
|
+
return Gt(ut, s, o), s;
|
|
473
473
|
}
|
|
474
474
|
/**
|
|
475
475
|
* limitation: `Object.getOwnPropertyNames(Float16Array)` or `Reflect.ownKeys(Float16Array)` include this key
|
|
@@ -477,60 +477,60 @@ class A {
|
|
|
477
477
|
*/
|
|
478
478
|
static from(t, ...n) {
|
|
479
479
|
const r = this;
|
|
480
|
-
if (!
|
|
480
|
+
if (!Nt(r, lt))
|
|
481
481
|
throw w(
|
|
482
|
-
|
|
482
|
+
qt
|
|
483
483
|
);
|
|
484
484
|
if (r === A) {
|
|
485
485
|
if (D(t) && n.length === 0) {
|
|
486
|
-
const f = l(t),
|
|
486
|
+
const f = l(t), d = new m(
|
|
487
487
|
T(f),
|
|
488
488
|
C(f),
|
|
489
489
|
y(f)
|
|
490
490
|
);
|
|
491
491
|
return new A(
|
|
492
|
-
T(Y(
|
|
492
|
+
T(Y(d))
|
|
493
493
|
);
|
|
494
494
|
}
|
|
495
495
|
if (n.length === 0)
|
|
496
496
|
return new A(
|
|
497
497
|
T(
|
|
498
|
-
|
|
498
|
+
ne(t, P)
|
|
499
499
|
)
|
|
500
500
|
);
|
|
501
501
|
const a = n[0], h = n[1];
|
|
502
502
|
return new A(
|
|
503
503
|
T(
|
|
504
|
-
|
|
504
|
+
ne(t, function(f, ...d) {
|
|
505
505
|
return P(
|
|
506
|
-
|
|
506
|
+
S(a, this, [f, ...k(d)])
|
|
507
507
|
);
|
|
508
508
|
}, h)
|
|
509
509
|
)
|
|
510
510
|
);
|
|
511
511
|
}
|
|
512
|
-
let
|
|
512
|
+
let o, s;
|
|
513
513
|
const i = t[x];
|
|
514
514
|
if (i != null && typeof i != "function")
|
|
515
|
-
throw w(
|
|
515
|
+
throw w(kt);
|
|
516
516
|
if (i != null)
|
|
517
|
-
|
|
517
|
+
oe(t) ? (o = t, s = t.length) : qn(t) ? (o = t, s = y(t)) : (o = [...t], s = o.length);
|
|
518
518
|
else {
|
|
519
519
|
if (t == null)
|
|
520
520
|
throw w(
|
|
521
|
-
|
|
521
|
+
Pt
|
|
522
522
|
);
|
|
523
|
-
|
|
523
|
+
o = j(t), s = Et(o.length);
|
|
524
524
|
}
|
|
525
|
-
const c = new r(
|
|
525
|
+
const c = new r(s);
|
|
526
526
|
if (n.length === 0)
|
|
527
|
-
for (let a = 0; a <
|
|
527
|
+
for (let a = 0; a < s; ++a)
|
|
528
528
|
c[a] = /** @type {number} */
|
|
529
|
-
|
|
529
|
+
o[a];
|
|
530
530
|
else {
|
|
531
531
|
const a = n[0], h = n[1];
|
|
532
|
-
for (let f = 0; f <
|
|
533
|
-
c[f] =
|
|
532
|
+
for (let f = 0; f < s; ++f)
|
|
533
|
+
c[f] = S(a, h, [o[f], f]);
|
|
534
534
|
}
|
|
535
535
|
return c;
|
|
536
536
|
}
|
|
@@ -540,27 +540,27 @@ class A {
|
|
|
540
540
|
*/
|
|
541
541
|
static of(...t) {
|
|
542
542
|
const n = this;
|
|
543
|
-
if (!
|
|
543
|
+
if (!Nt(n, lt))
|
|
544
544
|
throw w(
|
|
545
|
-
|
|
545
|
+
qt
|
|
546
546
|
);
|
|
547
547
|
const r = t.length;
|
|
548
548
|
if (n === A) {
|
|
549
|
-
const
|
|
549
|
+
const s = new A(r), i = l(s);
|
|
550
550
|
for (let c = 0; c < r; ++c)
|
|
551
551
|
i[c] = P(t[c]);
|
|
552
|
-
return
|
|
552
|
+
return s;
|
|
553
553
|
}
|
|
554
|
-
const
|
|
555
|
-
for (let
|
|
556
|
-
s
|
|
557
|
-
return
|
|
554
|
+
const o = new n(r);
|
|
555
|
+
for (let s = 0; s < r; ++s)
|
|
556
|
+
o[s] = t[s];
|
|
557
|
+
return o;
|
|
558
558
|
}
|
|
559
559
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.keys */
|
|
560
560
|
keys() {
|
|
561
561
|
u(this);
|
|
562
562
|
const t = l(this);
|
|
563
|
-
return
|
|
563
|
+
return xn(t);
|
|
564
564
|
}
|
|
565
565
|
/**
|
|
566
566
|
* limitation: returns a object whose prototype is not `%ArrayIteratorPrototype%`
|
|
@@ -569,9 +569,9 @@ class A {
|
|
|
569
569
|
values() {
|
|
570
570
|
u(this);
|
|
571
571
|
const t = l(this);
|
|
572
|
-
return
|
|
573
|
-
for (const n of
|
|
574
|
-
yield
|
|
572
|
+
return re((function* () {
|
|
573
|
+
for (const n of Nn(t))
|
|
574
|
+
yield p(n);
|
|
575
575
|
})());
|
|
576
576
|
}
|
|
577
577
|
/**
|
|
@@ -581,28 +581,28 @@ class A {
|
|
|
581
581
|
entries() {
|
|
582
582
|
u(this);
|
|
583
583
|
const t = l(this);
|
|
584
|
-
return
|
|
585
|
-
for (const [n, r] of
|
|
584
|
+
return re((function* () {
|
|
585
|
+
for (const [n, r] of Ln(t))
|
|
586
586
|
yield (
|
|
587
587
|
/** @type {[number, number]} */
|
|
588
|
-
[n,
|
|
588
|
+
[n, p(r)]
|
|
589
589
|
);
|
|
590
590
|
})());
|
|
591
591
|
}
|
|
592
592
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.at */
|
|
593
593
|
at(t) {
|
|
594
594
|
u(this);
|
|
595
|
-
const n = l(this), r = y(n),
|
|
596
|
-
if (!(
|
|
597
|
-
return
|
|
595
|
+
const n = l(this), r = y(n), o = L(t), s = o >= 0 ? o : r + o;
|
|
596
|
+
if (!(s < 0 || s >= r))
|
|
597
|
+
return p(n[s]);
|
|
598
598
|
}
|
|
599
599
|
/** @see https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.with */
|
|
600
600
|
with(t, n) {
|
|
601
601
|
u(this);
|
|
602
|
-
const r = l(this),
|
|
603
|
-
if (i < 0 || i >=
|
|
604
|
-
throw
|
|
605
|
-
const a = new
|
|
602
|
+
const r = l(this), o = y(r), s = L(t), i = s >= 0 ? s : o + s, c = +n;
|
|
603
|
+
if (i < 0 || i >= o)
|
|
604
|
+
throw _t(St);
|
|
605
|
+
const a = new m(
|
|
606
606
|
T(r),
|
|
607
607
|
C(r),
|
|
608
608
|
y(r)
|
|
@@ -616,22 +616,22 @@ class A {
|
|
|
616
616
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.map */
|
|
617
617
|
map(t, ...n) {
|
|
618
618
|
u(this);
|
|
619
|
-
const r = l(this),
|
|
619
|
+
const r = l(this), o = y(r), s = n[0], i = rt(r, A);
|
|
620
620
|
if (i === A) {
|
|
621
|
-
const a = new A(
|
|
622
|
-
for (let f = 0; f <
|
|
623
|
-
const
|
|
621
|
+
const a = new A(o), h = l(a);
|
|
622
|
+
for (let f = 0; f < o; ++f) {
|
|
623
|
+
const d = p(r[f]);
|
|
624
624
|
h[f] = P(
|
|
625
|
-
|
|
625
|
+
S(t, s, [d, f, this])
|
|
626
626
|
);
|
|
627
627
|
}
|
|
628
628
|
return a;
|
|
629
629
|
}
|
|
630
|
-
const c = new i(
|
|
631
|
-
st(c,
|
|
632
|
-
for (let a = 0; a <
|
|
633
|
-
const h =
|
|
634
|
-
c[a] =
|
|
630
|
+
const c = new i(o);
|
|
631
|
+
st(c, o);
|
|
632
|
+
for (let a = 0; a < o; ++a) {
|
|
633
|
+
const h = p(r[a]);
|
|
634
|
+
c[a] = S(t, s, [h, a, this]);
|
|
635
635
|
}
|
|
636
636
|
return (
|
|
637
637
|
/** @type {any} */
|
|
@@ -641,10 +641,10 @@ class A {
|
|
|
641
641
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.filter */
|
|
642
642
|
filter(t, ...n) {
|
|
643
643
|
u(this);
|
|
644
|
-
const r = l(this),
|
|
645
|
-
for (let h = 0; h <
|
|
646
|
-
const f =
|
|
647
|
-
|
|
644
|
+
const r = l(this), o = y(r), s = n[0], i = [];
|
|
645
|
+
for (let h = 0; h < o; ++h) {
|
|
646
|
+
const f = p(r[h]);
|
|
647
|
+
S(t, s, [f, h, this]) && wn(i, f);
|
|
648
648
|
}
|
|
649
649
|
const c = rt(r, A), a = new c(i);
|
|
650
650
|
return st(a), /** @type {any} */
|
|
@@ -653,44 +653,44 @@ class A {
|
|
|
653
653
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduce */
|
|
654
654
|
reduce(t, ...n) {
|
|
655
655
|
u(this);
|
|
656
|
-
const r = l(this),
|
|
657
|
-
if (
|
|
658
|
-
throw w(
|
|
659
|
-
let
|
|
660
|
-
n.length === 0 ? (
|
|
661
|
-
for (let c = i; c <
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
656
|
+
const r = l(this), o = y(r);
|
|
657
|
+
if (o === 0 && n.length === 0)
|
|
658
|
+
throw w(Jt);
|
|
659
|
+
let s, i;
|
|
660
|
+
n.length === 0 ? (s = p(r[0]), i = 1) : (s = n[0], i = 0);
|
|
661
|
+
for (let c = i; c < o; ++c)
|
|
662
|
+
s = t(
|
|
663
|
+
s,
|
|
664
|
+
p(r[c]),
|
|
665
665
|
c,
|
|
666
666
|
this
|
|
667
667
|
);
|
|
668
|
-
return
|
|
668
|
+
return s;
|
|
669
669
|
}
|
|
670
670
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduceright */
|
|
671
671
|
reduceRight(t, ...n) {
|
|
672
672
|
u(this);
|
|
673
|
-
const r = l(this),
|
|
674
|
-
if (
|
|
675
|
-
throw w(
|
|
676
|
-
let
|
|
677
|
-
n.length === 0 ? (
|
|
673
|
+
const r = l(this), o = y(r);
|
|
674
|
+
if (o === 0 && n.length === 0)
|
|
675
|
+
throw w(Jt);
|
|
676
|
+
let s, i;
|
|
677
|
+
n.length === 0 ? (s = p(r[o - 1]), i = o - 2) : (s = n[0], i = o - 1);
|
|
678
678
|
for (let c = i; c >= 0; --c)
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
679
|
+
s = t(
|
|
680
|
+
s,
|
|
681
|
+
p(r[c]),
|
|
682
682
|
c,
|
|
683
683
|
this
|
|
684
684
|
);
|
|
685
|
-
return
|
|
685
|
+
return s;
|
|
686
686
|
}
|
|
687
687
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.foreach */
|
|
688
688
|
forEach(t, ...n) {
|
|
689
689
|
u(this);
|
|
690
|
-
const r = l(this),
|
|
691
|
-
for (let i = 0; i <
|
|
692
|
-
|
|
693
|
-
|
|
690
|
+
const r = l(this), o = y(r), s = n[0];
|
|
691
|
+
for (let i = 0; i < o; ++i)
|
|
692
|
+
S(t, s, [
|
|
693
|
+
p(r[i]),
|
|
694
694
|
i,
|
|
695
695
|
this
|
|
696
696
|
]);
|
|
@@ -698,20 +698,20 @@ class A {
|
|
|
698
698
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.find */
|
|
699
699
|
find(t, ...n) {
|
|
700
700
|
u(this);
|
|
701
|
-
const r = l(this),
|
|
702
|
-
for (let i = 0; i <
|
|
703
|
-
const c =
|
|
704
|
-
if (
|
|
701
|
+
const r = l(this), o = y(r), s = n[0];
|
|
702
|
+
for (let i = 0; i < o; ++i) {
|
|
703
|
+
const c = p(r[i]);
|
|
704
|
+
if (S(t, s, [c, i, this]))
|
|
705
705
|
return c;
|
|
706
706
|
}
|
|
707
707
|
}
|
|
708
708
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.findindex */
|
|
709
709
|
findIndex(t, ...n) {
|
|
710
710
|
u(this);
|
|
711
|
-
const r = l(this),
|
|
712
|
-
for (let i = 0; i <
|
|
713
|
-
const c =
|
|
714
|
-
if (
|
|
711
|
+
const r = l(this), o = y(r), s = n[0];
|
|
712
|
+
for (let i = 0; i < o; ++i) {
|
|
713
|
+
const c = p(r[i]);
|
|
714
|
+
if (S(t, s, [c, i, this]))
|
|
715
715
|
return i;
|
|
716
716
|
}
|
|
717
717
|
return -1;
|
|
@@ -719,20 +719,20 @@ class A {
|
|
|
719
719
|
/** @see https://tc39.es/proposal-array-find-from-last/index.html#sec-%typedarray%.prototype.findlast */
|
|
720
720
|
findLast(t, ...n) {
|
|
721
721
|
u(this);
|
|
722
|
-
const r = l(this),
|
|
723
|
-
for (let i =
|
|
724
|
-
const c =
|
|
725
|
-
if (
|
|
722
|
+
const r = l(this), o = y(r), s = n[0];
|
|
723
|
+
for (let i = o - 1; i >= 0; --i) {
|
|
724
|
+
const c = p(r[i]);
|
|
725
|
+
if (S(t, s, [c, i, this]))
|
|
726
726
|
return c;
|
|
727
727
|
}
|
|
728
728
|
}
|
|
729
729
|
/** @see https://tc39.es/proposal-array-find-from-last/index.html#sec-%typedarray%.prototype.findlastindex */
|
|
730
730
|
findLastIndex(t, ...n) {
|
|
731
731
|
u(this);
|
|
732
|
-
const r = l(this),
|
|
733
|
-
for (let i =
|
|
734
|
-
const c =
|
|
735
|
-
if (
|
|
732
|
+
const r = l(this), o = y(r), s = n[0];
|
|
733
|
+
for (let i = o - 1; i >= 0; --i) {
|
|
734
|
+
const c = p(r[i]);
|
|
735
|
+
if (S(t, s, [c, i, this]))
|
|
736
736
|
return i;
|
|
737
737
|
}
|
|
738
738
|
return -1;
|
|
@@ -740,10 +740,10 @@ class A {
|
|
|
740
740
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.every */
|
|
741
741
|
every(t, ...n) {
|
|
742
742
|
u(this);
|
|
743
|
-
const r = l(this),
|
|
744
|
-
for (let i = 0; i <
|
|
745
|
-
if (!
|
|
746
|
-
|
|
743
|
+
const r = l(this), o = y(r), s = n[0];
|
|
744
|
+
for (let i = 0; i < o; ++i)
|
|
745
|
+
if (!S(t, s, [
|
|
746
|
+
p(r[i]),
|
|
747
747
|
i,
|
|
748
748
|
this
|
|
749
749
|
]))
|
|
@@ -753,10 +753,10 @@ class A {
|
|
|
753
753
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.some */
|
|
754
754
|
some(t, ...n) {
|
|
755
755
|
u(this);
|
|
756
|
-
const r = l(this),
|
|
757
|
-
for (let i = 0; i <
|
|
758
|
-
if (
|
|
759
|
-
|
|
756
|
+
const r = l(this), o = y(r), s = n[0];
|
|
757
|
+
for (let i = 0; i < o; ++i)
|
|
758
|
+
if (S(t, s, [
|
|
759
|
+
p(r[i]),
|
|
760
760
|
i,
|
|
761
761
|
this
|
|
762
762
|
]))
|
|
@@ -766,44 +766,44 @@ class A {
|
|
|
766
766
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.set */
|
|
767
767
|
set(t, ...n) {
|
|
768
768
|
u(this);
|
|
769
|
-
const r = l(this),
|
|
770
|
-
if (
|
|
771
|
-
throw
|
|
769
|
+
const r = l(this), o = L(n[0]);
|
|
770
|
+
if (o < 0)
|
|
771
|
+
throw _t(St);
|
|
772
772
|
if (t == null)
|
|
773
773
|
throw w(
|
|
774
|
-
|
|
774
|
+
Pt
|
|
775
775
|
);
|
|
776
|
-
if (
|
|
776
|
+
if (Ut(t))
|
|
777
777
|
throw w(
|
|
778
|
-
|
|
778
|
+
xt
|
|
779
779
|
);
|
|
780
780
|
if (D(t))
|
|
781
|
-
return
|
|
781
|
+
return Rn(
|
|
782
782
|
l(this),
|
|
783
783
|
l(t),
|
|
784
|
-
|
|
784
|
+
o
|
|
785
785
|
);
|
|
786
786
|
if (ft(t)) {
|
|
787
787
|
const a = T(t);
|
|
788
788
|
if ($(a))
|
|
789
789
|
throw w(J);
|
|
790
790
|
}
|
|
791
|
-
const
|
|
792
|
-
if (
|
|
793
|
-
throw
|
|
791
|
+
const s = y(r), i = j(t), c = Et(i.length);
|
|
792
|
+
if (o === 1 / 0 || c + o > s)
|
|
793
|
+
throw _t(St);
|
|
794
794
|
for (let a = 0; a < c; ++a)
|
|
795
|
-
r[a +
|
|
795
|
+
r[a + o] = P(i[a]);
|
|
796
796
|
}
|
|
797
797
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.reverse */
|
|
798
798
|
reverse() {
|
|
799
799
|
u(this);
|
|
800
800
|
const t = l(this);
|
|
801
|
-
return
|
|
801
|
+
return te(t), this;
|
|
802
802
|
}
|
|
803
803
|
/** @see https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toReversed */
|
|
804
804
|
toReversed() {
|
|
805
805
|
u(this);
|
|
806
|
-
const t = l(this), n = new
|
|
806
|
+
const t = l(this), n = new m(
|
|
807
807
|
T(t),
|
|
808
808
|
C(t),
|
|
809
809
|
y(t)
|
|
@@ -811,91 +811,91 @@ class A {
|
|
|
811
811
|
T(
|
|
812
812
|
Y(n)
|
|
813
813
|
)
|
|
814
|
-
),
|
|
815
|
-
return
|
|
814
|
+
), o = l(r);
|
|
815
|
+
return te(o), r;
|
|
816
816
|
}
|
|
817
817
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill */
|
|
818
818
|
fill(t, ...n) {
|
|
819
819
|
u(this);
|
|
820
820
|
const r = l(this);
|
|
821
|
-
return
|
|
821
|
+
return Un(
|
|
822
822
|
r,
|
|
823
823
|
P(t),
|
|
824
|
-
...
|
|
824
|
+
...k(n)
|
|
825
825
|
), this;
|
|
826
826
|
}
|
|
827
827
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.copywithin */
|
|
828
828
|
copyWithin(t, n, ...r) {
|
|
829
829
|
u(this);
|
|
830
|
-
const
|
|
831
|
-
return
|
|
830
|
+
const o = l(this);
|
|
831
|
+
return Cn(o, t, n, ...k(r)), this;
|
|
832
832
|
}
|
|
833
833
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort */
|
|
834
834
|
sort(t) {
|
|
835
835
|
u(this);
|
|
836
|
-
const n = l(this), r = t !== void 0 ? t :
|
|
837
|
-
return
|
|
836
|
+
const n = l(this), r = t !== void 0 ? t : ce;
|
|
837
|
+
return ee(n, (o, s) => r(p(o), p(s))), this;
|
|
838
838
|
}
|
|
839
839
|
/** @see https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toSorted */
|
|
840
840
|
toSorted(t) {
|
|
841
841
|
u(this);
|
|
842
842
|
const n = l(this);
|
|
843
843
|
if (t !== void 0 && typeof t != "function")
|
|
844
|
-
throw new w(
|
|
845
|
-
const r = t !== void 0 ? t :
|
|
844
|
+
throw new w(fn);
|
|
845
|
+
const r = t !== void 0 ? t : ce, o = new m(
|
|
846
846
|
T(n),
|
|
847
847
|
C(n),
|
|
848
848
|
y(n)
|
|
849
|
-
),
|
|
849
|
+
), s = new A(
|
|
850
850
|
T(
|
|
851
|
-
Y(
|
|
851
|
+
Y(o)
|
|
852
852
|
)
|
|
853
|
-
), i = l(
|
|
854
|
-
return
|
|
853
|
+
), i = l(s);
|
|
854
|
+
return ee(i, (c, a) => r(p(c), p(a))), s;
|
|
855
855
|
}
|
|
856
856
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.slice */
|
|
857
857
|
slice(t, n) {
|
|
858
858
|
u(this);
|
|
859
|
-
const r = l(this),
|
|
860
|
-
if (
|
|
861
|
-
const
|
|
859
|
+
const r = l(this), o = rt(r, A);
|
|
860
|
+
if (o === A) {
|
|
861
|
+
const je = new m(
|
|
862
862
|
T(r),
|
|
863
863
|
C(r),
|
|
864
864
|
y(r)
|
|
865
865
|
);
|
|
866
866
|
return new A(
|
|
867
867
|
T(
|
|
868
|
-
Y(
|
|
868
|
+
Y(je, t, n)
|
|
869
869
|
)
|
|
870
870
|
);
|
|
871
871
|
}
|
|
872
|
-
const
|
|
872
|
+
const s = y(r), i = L(t), c = n === void 0 ? s : L(n);
|
|
873
873
|
let a;
|
|
874
|
-
i === -1 / 0 ? a = 0 : i < 0 ? a =
|
|
874
|
+
i === -1 / 0 ? a = 0 : i < 0 ? a = s + i > 0 ? s + i : 0 : a = s < i ? s : i;
|
|
875
875
|
let h;
|
|
876
|
-
c === -1 / 0 ? h = 0 : c < 0 ? h =
|
|
877
|
-
const f = h - a > 0 ? h - a : 0,
|
|
878
|
-
if (st(
|
|
879
|
-
return
|
|
876
|
+
c === -1 / 0 ? h = 0 : c < 0 ? h = s + c > 0 ? s + c : 0 : h = s < c ? s : c;
|
|
877
|
+
const f = h - a > 0 ? h - a : 0, d = new o(f);
|
|
878
|
+
if (st(d, f), f === 0)
|
|
879
|
+
return d;
|
|
880
880
|
const O = T(r);
|
|
881
881
|
if ($(O))
|
|
882
882
|
throw w(J);
|
|
883
|
-
let
|
|
883
|
+
let F = 0;
|
|
884
884
|
for (; a < h; )
|
|
885
|
-
|
|
885
|
+
d[F] = p(r[a]), ++a, ++F;
|
|
886
886
|
return (
|
|
887
887
|
/** @type {any} */
|
|
888
|
-
|
|
888
|
+
d
|
|
889
889
|
);
|
|
890
890
|
}
|
|
891
891
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray */
|
|
892
892
|
subarray(t, n) {
|
|
893
893
|
u(this);
|
|
894
|
-
const r = l(this),
|
|
894
|
+
const r = l(this), o = rt(r, A), s = new m(
|
|
895
895
|
T(r),
|
|
896
896
|
C(r),
|
|
897
897
|
y(r)
|
|
898
|
-
), i =
|
|
898
|
+
), i = Mn(s, t, n), c = new o(
|
|
899
899
|
T(i),
|
|
900
900
|
C(i),
|
|
901
901
|
y(i)
|
|
@@ -906,40 +906,40 @@ class A {
|
|
|
906
906
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.indexof */
|
|
907
907
|
indexOf(t, ...n) {
|
|
908
908
|
u(this);
|
|
909
|
-
const r = l(this),
|
|
910
|
-
let
|
|
911
|
-
if (
|
|
909
|
+
const r = l(this), o = y(r);
|
|
910
|
+
let s = L(n[0]);
|
|
911
|
+
if (s === 1 / 0)
|
|
912
912
|
return -1;
|
|
913
|
-
|
|
914
|
-
for (let i =
|
|
915
|
-
if (
|
|
913
|
+
s < 0 && (s += o, s < 0 && (s = 0));
|
|
914
|
+
for (let i = s; i < o; ++i)
|
|
915
|
+
if (R(r, i) && p(r[i]) === t)
|
|
916
916
|
return i;
|
|
917
917
|
return -1;
|
|
918
918
|
}
|
|
919
919
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.lastindexof */
|
|
920
920
|
lastIndexOf(t, ...n) {
|
|
921
921
|
u(this);
|
|
922
|
-
const r = l(this),
|
|
923
|
-
let
|
|
924
|
-
if (
|
|
922
|
+
const r = l(this), o = y(r);
|
|
923
|
+
let s = n.length >= 1 ? L(n[0]) : o - 1;
|
|
924
|
+
if (s === -1 / 0)
|
|
925
925
|
return -1;
|
|
926
|
-
|
|
927
|
-
for (let i =
|
|
928
|
-
if (
|
|
926
|
+
s >= 0 ? s = s < o - 1 ? s : o - 1 : s += o;
|
|
927
|
+
for (let i = s; i >= 0; --i)
|
|
928
|
+
if (R(r, i) && p(r[i]) === t)
|
|
929
929
|
return i;
|
|
930
930
|
return -1;
|
|
931
931
|
}
|
|
932
932
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.includes */
|
|
933
933
|
includes(t, ...n) {
|
|
934
934
|
u(this);
|
|
935
|
-
const r = l(this),
|
|
936
|
-
let
|
|
937
|
-
if (
|
|
935
|
+
const r = l(this), o = y(r);
|
|
936
|
+
let s = L(n[0]);
|
|
937
|
+
if (s === 1 / 0)
|
|
938
938
|
return !1;
|
|
939
|
-
|
|
939
|
+
s < 0 && (s += o, s < 0 && (s = 0));
|
|
940
940
|
const i = G(t);
|
|
941
|
-
for (let c =
|
|
942
|
-
const a =
|
|
941
|
+
for (let c = s; c < o; ++c) {
|
|
942
|
+
const a = p(r[c]);
|
|
943
943
|
if (i && G(a) || a === t)
|
|
944
944
|
return !0;
|
|
945
945
|
}
|
|
@@ -948,14 +948,14 @@ class A {
|
|
|
948
948
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.join */
|
|
949
949
|
join(t) {
|
|
950
950
|
u(this);
|
|
951
|
-
const n = l(this), r =
|
|
952
|
-
return
|
|
951
|
+
const n = l(this), r = ae(n);
|
|
952
|
+
return gn(r, t);
|
|
953
953
|
}
|
|
954
954
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.tolocalestring */
|
|
955
955
|
toLocaleString(...t) {
|
|
956
956
|
u(this);
|
|
957
|
-
const n = l(this), r =
|
|
958
|
-
return
|
|
957
|
+
const n = l(this), r = ae(n);
|
|
958
|
+
return Tn(r, ...k(t));
|
|
959
959
|
}
|
|
960
960
|
/** @see https://tc39.es/ecma262/#sec-get-%typedarray%.prototype-@@tostringtag */
|
|
961
961
|
get [Mt]() {
|
|
@@ -967,93 +967,93 @@ class A {
|
|
|
967
967
|
}
|
|
968
968
|
}
|
|
969
969
|
et(A, "BYTES_PER_ELEMENT", {
|
|
970
|
-
value:
|
|
970
|
+
value: zt
|
|
971
971
|
});
|
|
972
972
|
et(A, lt, {});
|
|
973
|
-
|
|
973
|
+
ge(A, Ft);
|
|
974
974
|
const yt = A.prototype;
|
|
975
975
|
et(yt, "BYTES_PER_ELEMENT", {
|
|
976
|
-
value:
|
|
976
|
+
value: zt
|
|
977
977
|
});
|
|
978
978
|
et(yt, x, {
|
|
979
979
|
value: yt.values,
|
|
980
980
|
writable: !0,
|
|
981
981
|
configurable: !0
|
|
982
982
|
});
|
|
983
|
-
|
|
984
|
-
function
|
|
985
|
-
return
|
|
986
|
-
|
|
983
|
+
ge(yt, b);
|
|
984
|
+
function tr(e, t, ...n) {
|
|
985
|
+
return p(
|
|
986
|
+
jn(e, t, ...k(n))
|
|
987
987
|
);
|
|
988
988
|
}
|
|
989
|
-
function
|
|
989
|
+
function Tr(e) {
|
|
990
990
|
return e instanceof Int8Array || e instanceof Uint8Array || e instanceof Uint8ClampedArray || e instanceof Int16Array || e instanceof Uint16Array || e instanceof Int32Array || e instanceof Uint32Array || e instanceof A || e instanceof Float32Array || e instanceof Float64Array;
|
|
991
991
|
}
|
|
992
|
-
class
|
|
992
|
+
class er extends K {
|
|
993
993
|
constructor(t, n) {
|
|
994
994
|
super(n), this.parser = t;
|
|
995
995
|
}
|
|
996
|
-
load(t, n, r,
|
|
997
|
-
const
|
|
998
|
-
|
|
996
|
+
load(t, n, r, o) {
|
|
997
|
+
const s = new sn(this.manager);
|
|
998
|
+
s.setRequestHeader(this.requestHeader), s.setPath(this.path), s.setWithCredentials(this.withCredentials), s.load(
|
|
999
999
|
t,
|
|
1000
1000
|
(i) => {
|
|
1001
1001
|
try {
|
|
1002
1002
|
n(this.parser(i));
|
|
1003
1003
|
} catch (c) {
|
|
1004
|
-
|
|
1004
|
+
o != null ? o(c) : console.error(c), this.manager.itemError(t);
|
|
1005
1005
|
}
|
|
1006
1006
|
},
|
|
1007
1007
|
r,
|
|
1008
|
-
|
|
1008
|
+
o
|
|
1009
1009
|
);
|
|
1010
1010
|
}
|
|
1011
1011
|
}
|
|
1012
|
-
function
|
|
1013
|
-
const t = e instanceof Int8Array ?
|
|
1014
|
-
return
|
|
1015
|
-
}
|
|
1016
|
-
class
|
|
1017
|
-
constructor(t, n, r = {},
|
|
1018
|
-
super(
|
|
1019
|
-
format:
|
|
1020
|
-
minFilter:
|
|
1021
|
-
magFilter:
|
|
1012
|
+
function nr(e) {
|
|
1013
|
+
const t = e instanceof Int8Array ? qe : e instanceof Uint8Array ? Vt : e instanceof Uint8ClampedArray ? Vt : e instanceof Int16Array ? ke : e instanceof Uint16Array ? Je : e instanceof Int32Array ? $e : e instanceof Uint32Array ? Qe : e instanceof A ? Ze : e instanceof Float32Array ? Yt : e instanceof Float64Array ? Yt : null;
|
|
1014
|
+
return ye(t != null), t;
|
|
1015
|
+
}
|
|
1016
|
+
class br extends K {
|
|
1017
|
+
constructor(t, n, r = {}, o) {
|
|
1018
|
+
super(o), this.textureClass = t, this.parser = n, this.options = {
|
|
1019
|
+
format: Xe,
|
|
1020
|
+
minFilter: Wt,
|
|
1021
|
+
magFilter: Wt,
|
|
1022
1022
|
...r
|
|
1023
1023
|
};
|
|
1024
1024
|
}
|
|
1025
|
-
load(t, n, r,
|
|
1026
|
-
const
|
|
1025
|
+
load(t, n, r, o) {
|
|
1026
|
+
const s = new this.textureClass(), i = new er(this.parser, this.manager);
|
|
1027
1027
|
return i.setRequestHeader(this.requestHeader), i.setPath(this.path), i.setWithCredentials(this.withCredentials), i.load(
|
|
1028
1028
|
t,
|
|
1029
1029
|
(c) => {
|
|
1030
|
-
|
|
1031
|
-
const { width: a, height: h, depth: f, ...
|
|
1032
|
-
a != null && (
|
|
1030
|
+
s.image.data = c instanceof A ? new Uint16Array(c.buffer) : c;
|
|
1031
|
+
const { width: a, height: h, depth: f, ...d } = this.options;
|
|
1032
|
+
a != null && (s.image.width = a), h != null && (s.image.height = h), "depth" in s.image && f != null && (s.image.depth = f), s.type = nr(c), Object.assign(s, d), s.needsUpdate = !0, n?.(s);
|
|
1033
1033
|
},
|
|
1034
1034
|
r,
|
|
1035
|
-
|
|
1036
|
-
),
|
|
1035
|
+
o
|
|
1036
|
+
), s;
|
|
1037
1037
|
}
|
|
1038
1038
|
}
|
|
1039
|
-
const z = _.clamp,
|
|
1040
|
-
function
|
|
1041
|
-
return _.mapLinear(e, t, n, r,
|
|
1039
|
+
const z = _.clamp, Sr = _.euclideanModulo, mr = _.inverseLerp, _r = _.lerp, Er = _.degToRad, Ir = _.radToDeg, Or = _.isPowerOfTwo, Pr = _.ceilPowerOfTwo, xr = _.floorPowerOfTwo, Nr = _.normalize;
|
|
1040
|
+
function Lr(e, t, n, r = 0, o = 1) {
|
|
1041
|
+
return _.mapLinear(e, t, n, r, o);
|
|
1042
1042
|
}
|
|
1043
|
-
function
|
|
1044
|
-
return z(_.mapLinear(e, t, n, r,
|
|
1043
|
+
function Rr(e, t, n, r = 0, o = 1) {
|
|
1044
|
+
return z(_.mapLinear(e, t, n, r, o), r, o);
|
|
1045
1045
|
}
|
|
1046
|
-
function
|
|
1046
|
+
function Ur(e, t, n) {
|
|
1047
1047
|
return n <= e ? 0 : n >= t ? 1 : (n = (n - e) / (t - e), n * n * (3 - 2 * n));
|
|
1048
1048
|
}
|
|
1049
|
-
function
|
|
1049
|
+
function Cr(e) {
|
|
1050
1050
|
return Math.min(Math.max(e, 0), 1);
|
|
1051
1051
|
}
|
|
1052
|
-
function
|
|
1053
|
-
const
|
|
1054
|
-
return
|
|
1052
|
+
function Mr(e, t, n, r = n) {
|
|
1053
|
+
const o = Math.abs(e - t);
|
|
1054
|
+
return o <= r || o <= n * Math.max(Math.abs(e), Math.abs(t));
|
|
1055
1055
|
}
|
|
1056
|
-
function
|
|
1056
|
+
function Br(e) {
|
|
1057
1057
|
return (t, n) => {
|
|
1058
1058
|
t instanceof pt ? Object.defineProperty(t, n, {
|
|
1059
1059
|
enumerable: !0,
|
|
@@ -1074,83 +1074,83 @@ function Vr(e) {
|
|
|
1074
1074
|
});
|
|
1075
1075
|
};
|
|
1076
1076
|
}
|
|
1077
|
-
function
|
|
1077
|
+
function he(e) {
|
|
1078
1078
|
return typeof e == "number" ? Math.floor(e) : typeof e == "string" ? parseInt(e, 10) : typeof e == "boolean" ? +e : 0;
|
|
1079
1079
|
}
|
|
1080
|
-
function
|
|
1080
|
+
function Fr(e, {
|
|
1081
1081
|
min: t = Number.MIN_SAFE_INTEGER,
|
|
1082
1082
|
max: n = Number.MAX_SAFE_INTEGER
|
|
1083
1083
|
} = {}) {
|
|
1084
|
-
return (r,
|
|
1085
|
-
r instanceof pt ? Object.defineProperty(r,
|
|
1084
|
+
return (r, o) => {
|
|
1085
|
+
r instanceof pt ? Object.defineProperty(r, o, {
|
|
1086
1086
|
enumerable: !0,
|
|
1087
1087
|
get() {
|
|
1088
|
-
const
|
|
1089
|
-
return
|
|
1088
|
+
const s = this.defines?.[e];
|
|
1089
|
+
return s != null ? he(s) : 0;
|
|
1090
1090
|
},
|
|
1091
|
-
set(
|
|
1092
|
-
const i = this[
|
|
1093
|
-
|
|
1091
|
+
set(s) {
|
|
1092
|
+
const i = this[o];
|
|
1093
|
+
s !== i && (this.defines ??= {}, this.defines[e] = z(s, t, n).toFixed(0), this.needsUpdate = !0);
|
|
1094
1094
|
}
|
|
1095
|
-
}) : Object.defineProperty(r,
|
|
1095
|
+
}) : Object.defineProperty(r, o, {
|
|
1096
1096
|
enumerable: !0,
|
|
1097
1097
|
get() {
|
|
1098
|
-
const
|
|
1099
|
-
return
|
|
1098
|
+
const s = this.defines.get(e);
|
|
1099
|
+
return s != null ? he(s) : 0;
|
|
1100
1100
|
},
|
|
1101
|
-
set(
|
|
1102
|
-
const i = this[
|
|
1103
|
-
|
|
1101
|
+
set(s) {
|
|
1102
|
+
const i = this[o];
|
|
1103
|
+
s !== i && (this.defines.set(e, z(s, t, n).toFixed(0)), this.setChanged());
|
|
1104
1104
|
}
|
|
1105
1105
|
});
|
|
1106
1106
|
};
|
|
1107
1107
|
}
|
|
1108
|
-
function
|
|
1108
|
+
function fe(e) {
|
|
1109
1109
|
return typeof e == "number" ? e : typeof e == "string" ? parseFloat(e) : typeof e == "boolean" ? +e : 0;
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1111
|
+
function Dr(e, {
|
|
1112
1112
|
min: t = -1 / 0,
|
|
1113
1113
|
max: n = 1 / 0,
|
|
1114
1114
|
precision: r = 7
|
|
1115
1115
|
} = {}) {
|
|
1116
|
-
return (
|
|
1117
|
-
|
|
1116
|
+
return (o, s) => {
|
|
1117
|
+
o instanceof pt ? Object.defineProperty(o, s, {
|
|
1118
1118
|
enumerable: !0,
|
|
1119
1119
|
get() {
|
|
1120
1120
|
const i = this.defines?.[e];
|
|
1121
|
-
return i != null ?
|
|
1121
|
+
return i != null ? fe(i) : 0;
|
|
1122
1122
|
},
|
|
1123
1123
|
set(i) {
|
|
1124
|
-
const c = this[
|
|
1124
|
+
const c = this[s];
|
|
1125
1125
|
i !== c && (this.defines ??= {}, this.defines[e] = z(i, t, n).toFixed(r), this.needsUpdate = !0);
|
|
1126
1126
|
}
|
|
1127
|
-
}) : Object.defineProperty(
|
|
1127
|
+
}) : Object.defineProperty(o, s, {
|
|
1128
1128
|
enumerable: !0,
|
|
1129
1129
|
get() {
|
|
1130
1130
|
const i = this.defines.get(e);
|
|
1131
|
-
return i != null ?
|
|
1131
|
+
return i != null ? fe(i) : 0;
|
|
1132
1132
|
},
|
|
1133
1133
|
set(i) {
|
|
1134
|
-
const c = this[
|
|
1134
|
+
const c = this[s];
|
|
1135
1135
|
i !== c && (this.defines.set(e, z(i, t, n).toFixed(r)), this.setChanged());
|
|
1136
1136
|
}
|
|
1137
1137
|
});
|
|
1138
1138
|
};
|
|
1139
1139
|
}
|
|
1140
|
-
function
|
|
1140
|
+
function vr(e, { validate: t } = {}) {
|
|
1141
1141
|
return (n, r) => {
|
|
1142
1142
|
n instanceof pt ? Object.defineProperty(n, r, {
|
|
1143
1143
|
enumerable: !0,
|
|
1144
1144
|
get() {
|
|
1145
1145
|
return this.defines?.[e];
|
|
1146
1146
|
},
|
|
1147
|
-
set(
|
|
1148
|
-
if (
|
|
1149
|
-
if (t?.(
|
|
1150
|
-
console.error(`Expression validation failed: ${
|
|
1147
|
+
set(o) {
|
|
1148
|
+
if (o !== this[r]) {
|
|
1149
|
+
if (t?.(o) === !1) {
|
|
1150
|
+
console.error(`Expression validation failed: ${o}`);
|
|
1151
1151
|
return;
|
|
1152
1152
|
}
|
|
1153
|
-
this.defines ??= {}, this.defines[e] =
|
|
1153
|
+
this.defines ??= {}, this.defines[e] = o, this.needsUpdate = !0;
|
|
1154
1154
|
}
|
|
1155
1155
|
}
|
|
1156
1156
|
}) : Object.defineProperty(n, r, {
|
|
@@ -1158,120 +1158,120 @@ function kr(e, { validate: t } = {}) {
|
|
|
1158
1158
|
get() {
|
|
1159
1159
|
return this.defines.get(e);
|
|
1160
1160
|
},
|
|
1161
|
-
set(
|
|
1162
|
-
if (
|
|
1163
|
-
if (t?.(
|
|
1164
|
-
console.error(`Expression validation failed: ${
|
|
1161
|
+
set(o) {
|
|
1162
|
+
if (o !== this[r]) {
|
|
1163
|
+
if (t?.(o) === !1) {
|
|
1164
|
+
console.error(`Expression validation failed: ${o}`);
|
|
1165
1165
|
return;
|
|
1166
1166
|
}
|
|
1167
|
-
this.defines.set(e,
|
|
1167
|
+
this.defines.set(e, o), this.setChanged();
|
|
1168
1168
|
}
|
|
1169
1169
|
}
|
|
1170
1170
|
});
|
|
1171
1171
|
};
|
|
1172
1172
|
}
|
|
1173
|
-
function
|
|
1173
|
+
function Gr(e, ...t) {
|
|
1174
1174
|
const n = {};
|
|
1175
1175
|
for (let r = 0; r < t.length; r += 2) {
|
|
1176
|
-
const
|
|
1177
|
-
for (const i of
|
|
1176
|
+
const o = t[r], s = t[r + 1];
|
|
1177
|
+
for (const i of s)
|
|
1178
1178
|
n[i] = {
|
|
1179
1179
|
enumerable: !0,
|
|
1180
|
-
get: () =>
|
|
1180
|
+
get: () => o[i],
|
|
1181
1181
|
set: (c) => {
|
|
1182
|
-
|
|
1182
|
+
o[i] = c;
|
|
1183
1183
|
}
|
|
1184
1184
|
};
|
|
1185
1185
|
}
|
|
1186
1186
|
return Object.defineProperties(e, n), e;
|
|
1187
1187
|
}
|
|
1188
|
-
function
|
|
1188
|
+
function jr(e, t, n) {
|
|
1189
1189
|
const r = {};
|
|
1190
|
-
for (const
|
|
1191
|
-
r[
|
|
1190
|
+
for (const o of n)
|
|
1191
|
+
r[o] = {
|
|
1192
1192
|
enumerable: !0,
|
|
1193
|
-
get: () => t.uniforms[
|
|
1194
|
-
set: (
|
|
1195
|
-
t.uniforms[
|
|
1193
|
+
get: () => t.uniforms[o].value,
|
|
1194
|
+
set: (s) => {
|
|
1195
|
+
t.uniforms[o].value = s;
|
|
1196
1196
|
}
|
|
1197
1197
|
};
|
|
1198
1198
|
return Object.defineProperties(e, r), e;
|
|
1199
1199
|
}
|
|
1200
|
-
class
|
|
1200
|
+
class zr extends K {
|
|
1201
1201
|
constructor(t = {}, n) {
|
|
1202
1202
|
super(n), this.options = t;
|
|
1203
1203
|
}
|
|
1204
|
-
load(t, n, r,
|
|
1205
|
-
const { width:
|
|
1204
|
+
load(t, n, r, o) {
|
|
1205
|
+
const { width: s, height: i, depth: c } = this.options, a = new Ke(null, s, i, c), h = new de(this.manager);
|
|
1206
1206
|
return h.setRequestHeader(this.requestHeader), h.setPath(this.path), h.setWithCredentials(this.withCredentials), h.load(
|
|
1207
1207
|
t,
|
|
1208
1208
|
(f) => {
|
|
1209
|
-
const { image:
|
|
1209
|
+
const { image: d } = f;
|
|
1210
1210
|
a.image = {
|
|
1211
|
-
data:
|
|
1212
|
-
width:
|
|
1213
|
-
height: i ??
|
|
1214
|
-
depth: c ?? Math.sqrt(
|
|
1211
|
+
data: d.data,
|
|
1212
|
+
width: s ?? d.width,
|
|
1213
|
+
height: i ?? d.height,
|
|
1214
|
+
depth: c ?? Math.sqrt(d.height)
|
|
1215
1215
|
}, a.type = f.type, a.format = f.format, a.colorSpace = f.colorSpace, a.needsUpdate = !0;
|
|
1216
1216
|
try {
|
|
1217
1217
|
n?.(a);
|
|
1218
1218
|
} catch (O) {
|
|
1219
|
-
|
|
1219
|
+
o != null ? o(O) : console.error(O), this.manager.itemError(t);
|
|
1220
1220
|
}
|
|
1221
1221
|
},
|
|
1222
1222
|
r,
|
|
1223
|
-
|
|
1223
|
+
o
|
|
1224
1224
|
), a;
|
|
1225
1225
|
}
|
|
1226
1226
|
}
|
|
1227
|
-
class
|
|
1227
|
+
class Hr extends K {
|
|
1228
1228
|
constructor(t = {}, n) {
|
|
1229
1229
|
super(n), this.options = t;
|
|
1230
1230
|
}
|
|
1231
|
-
load(t, n, r,
|
|
1232
|
-
const { width:
|
|
1231
|
+
load(t, n, r, o) {
|
|
1232
|
+
const { width: s, height: i } = this.options, c = new tn(null, s, i), a = new de(this.manager);
|
|
1233
1233
|
return a.setRequestHeader(this.requestHeader), a.setPath(this.path), a.setWithCredentials(this.withCredentials), a.load(
|
|
1234
1234
|
t,
|
|
1235
1235
|
(h) => {
|
|
1236
1236
|
const { image: f } = h;
|
|
1237
1237
|
c.image = {
|
|
1238
1238
|
data: f.data,
|
|
1239
|
-
width:
|
|
1239
|
+
width: s ?? f.width,
|
|
1240
1240
|
height: i ?? f.height
|
|
1241
1241
|
}, c.type = h.type, c.format = h.format, c.colorSpace = h.colorSpace, c.needsUpdate = !0;
|
|
1242
1242
|
try {
|
|
1243
1243
|
n?.(c);
|
|
1244
|
-
} catch (
|
|
1245
|
-
|
|
1244
|
+
} catch (d) {
|
|
1245
|
+
o != null ? o(d) : console.error(d), this.manager.itemError(t);
|
|
1246
1246
|
}
|
|
1247
1247
|
},
|
|
1248
1248
|
r,
|
|
1249
|
-
|
|
1249
|
+
o
|
|
1250
1250
|
), c;
|
|
1251
1251
|
}
|
|
1252
1252
|
}
|
|
1253
|
-
const
|
|
1254
|
-
class
|
|
1255
|
-
constructor(t = 0, n = 0, r = 0,
|
|
1256
|
-
this.distance = t, this.heading = n, this.pitch = r, this.roll =
|
|
1253
|
+
const It = 1e-6, ot = /* @__PURE__ */ new U(), it = /* @__PURE__ */ new U(), N = /* @__PURE__ */ new U(), X = /* @__PURE__ */ new U(), Ot = /* @__PURE__ */ new U(), rr = /* @__PURE__ */ new U(), sr = /* @__PURE__ */ new nn(), or = /* @__PURE__ */ new en(), ir = /* @__PURE__ */ new rn();
|
|
1254
|
+
class De {
|
|
1255
|
+
constructor(t = 0, n = 0, r = 0, o = 0) {
|
|
1256
|
+
this.distance = t, this.heading = n, this.pitch = r, this.roll = o;
|
|
1257
1257
|
}
|
|
1258
1258
|
get distance() {
|
|
1259
1259
|
return this._distance;
|
|
1260
1260
|
}
|
|
1261
1261
|
set distance(t) {
|
|
1262
|
-
this._distance = Math.max(t,
|
|
1262
|
+
this._distance = Math.max(t, It);
|
|
1263
1263
|
}
|
|
1264
1264
|
get pitch() {
|
|
1265
1265
|
return this._pitch;
|
|
1266
1266
|
}
|
|
1267
1267
|
set pitch(t) {
|
|
1268
|
-
this._pitch = z(t, -Math.PI / 2 +
|
|
1268
|
+
this._pitch = z(t, -Math.PI / 2 + It, Math.PI / 2 - It);
|
|
1269
1269
|
}
|
|
1270
|
-
set(t, n, r,
|
|
1271
|
-
return this.distance = t, this.heading = n, this.pitch = r,
|
|
1270
|
+
set(t, n, r, o) {
|
|
1271
|
+
return this.distance = t, this.heading = n, this.pitch = r, o != null && (this.roll = o), this;
|
|
1272
1272
|
}
|
|
1273
1273
|
clone() {
|
|
1274
|
-
return new
|
|
1274
|
+
return new De(this.distance, this.heading, this.pitch, this.roll);
|
|
1275
1275
|
}
|
|
1276
1276
|
copy(t) {
|
|
1277
1277
|
return this.distance = t.distance, this.heading = t.heading, this.pitch = t.pitch, this.roll = t.roll, this;
|
|
@@ -1279,32 +1279,34 @@ class je {
|
|
|
1279
1279
|
equals(t) {
|
|
1280
1280
|
return t.distance === this.distance && t.heading === this.heading && t.pitch === this.pitch && t.roll === this.roll;
|
|
1281
1281
|
}
|
|
1282
|
-
decompose(t, n, r,
|
|
1283
|
-
|
|
1282
|
+
decompose(t, n, r, o, s = Xt.WGS84) {
|
|
1283
|
+
s.getEastNorthUpVectors(
|
|
1284
1284
|
t,
|
|
1285
1285
|
ot,
|
|
1286
1286
|
it,
|
|
1287
1287
|
N
|
|
1288
|
-
),
|
|
1288
|
+
), o?.copy(N);
|
|
1289
1289
|
const i = X.copy(ot).multiplyScalar(Math.cos(this.heading)).add(
|
|
1290
|
-
|
|
1291
|
-
).multiplyScalar(Math.cos(this.pitch)).add(
|
|
1290
|
+
Ot.copy(it).multiplyScalar(Math.sin(this.heading))
|
|
1291
|
+
).multiplyScalar(Math.cos(this.pitch)).add(Ot.copy(N).multiplyScalar(Math.sin(this.pitch))).normalize().multiplyScalar(this.distance);
|
|
1292
1292
|
if (n.copy(t).sub(i), this.roll !== 0) {
|
|
1293
1293
|
const c = X.copy(t).sub(n).normalize();
|
|
1294
1294
|
N.applyQuaternion(
|
|
1295
|
-
|
|
1295
|
+
or.setFromAxisAngle(c, this.roll)
|
|
1296
1296
|
);
|
|
1297
1297
|
}
|
|
1298
1298
|
r.setFromRotationMatrix(
|
|
1299
|
-
|
|
1299
|
+
sr.lookAt(n, t, N)
|
|
1300
1300
|
);
|
|
1301
1301
|
}
|
|
1302
|
-
setFromCamera(t, n =
|
|
1303
|
-
const
|
|
1304
|
-
|
|
1302
|
+
setFromCamera(t, n = Xt.WGS84, r) {
|
|
1303
|
+
const o = X.setFromMatrixPosition(t.matrixWorld), s = Ot.set(0, 0, 0.5).unproject(t).sub(o).normalize(), i = n.getIntersection(
|
|
1304
|
+
ir.set(o, s)
|
|
1305
|
+
);
|
|
1306
|
+
if (i == null)
|
|
1305
1307
|
return;
|
|
1306
|
-
this.distance =
|
|
1307
|
-
|
|
1308
|
+
r?.copy(i), this.distance = o.distanceTo(i), n.getEastNorthUpVectors(
|
|
1309
|
+
i,
|
|
1308
1310
|
ot,
|
|
1309
1311
|
it,
|
|
1310
1312
|
N
|
|
@@ -1312,13 +1314,13 @@ class je {
|
|
|
1312
1314
|
it.dot(s),
|
|
1313
1315
|
ot.dot(s)
|
|
1314
1316
|
), this.pitch = Math.asin(N.dot(s));
|
|
1315
|
-
const
|
|
1316
|
-
return this.roll = Math.atan2(
|
|
1317
|
+
const c = X.copy(t.up).applyQuaternion(t.quaternion), a = rr.copy(s).multiplyScalar(-c.dot(s)).add(c).normalize(), h = X.copy(s).multiplyScalar(-N.dot(s)).add(N).normalize(), f = h.dot(a), d = s.dot(h.cross(a));
|
|
1318
|
+
return this.roll = Math.atan2(d, f), this;
|
|
1317
1319
|
}
|
|
1318
1320
|
}
|
|
1319
1321
|
const Q = class Q {
|
|
1320
|
-
constructor(t = 0, n = 0, r = 0,
|
|
1321
|
-
this.west = t, this.south = n, this.east = r, this.north =
|
|
1322
|
+
constructor(t = 0, n = 0, r = 0, o = 0) {
|
|
1323
|
+
this.west = t, this.south = n, this.east = r, this.north = o;
|
|
1322
1324
|
}
|
|
1323
1325
|
get width() {
|
|
1324
1326
|
let t = this.east;
|
|
@@ -1327,8 +1329,8 @@ const Q = class Q {
|
|
|
1327
1329
|
get height() {
|
|
1328
1330
|
return this.north - this.south;
|
|
1329
1331
|
}
|
|
1330
|
-
set(t, n, r,
|
|
1331
|
-
return this.west = t, this.south = n, this.east = r, this.north =
|
|
1332
|
+
set(t, n, r, o) {
|
|
1333
|
+
return this.west = t, this.south = n, this.east = r, this.north = o, this;
|
|
1332
1334
|
}
|
|
1333
1335
|
clone() {
|
|
1334
1336
|
return new Q(this.west, this.south, this.east, this.north);
|
|
@@ -1362,74 +1364,34 @@ Q.MAX = /* @__PURE__ */ new Q(
|
|
|
1362
1364
|
V.MAX_LATITUDE
|
|
1363
1365
|
);
|
|
1364
1366
|
let dt = Q;
|
|
1365
|
-
const
|
|
1366
|
-
function
|
|
1367
|
-
return e.replace(
|
|
1368
|
-
const
|
|
1367
|
+
const cr = /^[ \t]*#include +"([\w\d./]+)"/gm;
|
|
1368
|
+
function ar(e, t) {
|
|
1369
|
+
return e.replace(cr, (n, r) => {
|
|
1370
|
+
const s = r.split("/").reduce(
|
|
1369
1371
|
(i, c) => typeof i != "string" && i != null ? i[c] : void 0,
|
|
1370
1372
|
t
|
|
1371
1373
|
);
|
|
1372
|
-
if (typeof
|
|
1374
|
+
if (typeof s != "string")
|
|
1373
1375
|
throw new Error(`Could not find include for ${r}.`);
|
|
1374
|
-
return
|
|
1376
|
+
return ar(s, t);
|
|
1375
1377
|
});
|
|
1376
1378
|
}
|
|
1377
|
-
|
|
1378
|
-
function gr() {
|
|
1379
|
-
if (ct != null)
|
|
1380
|
-
return ct;
|
|
1381
|
-
const e = new Uint32Array([268435456]);
|
|
1382
|
-
return ct = new Uint8Array(e.buffer, e.byteOffset, e.byteLength)[0] === 0, ct;
|
|
1383
|
-
}
|
|
1384
|
-
function M(e, t, n, r = !0) {
|
|
1385
|
-
if (r === gr())
|
|
1386
|
-
return new t(e);
|
|
1387
|
-
const s = Object.assign(new DataView(e), {
|
|
1388
|
-
getFloat16(i, c) {
|
|
1389
|
-
return cr(this, i, c);
|
|
1390
|
-
}
|
|
1391
|
-
}), o = new t(s.byteLength / t.BYTES_PER_ELEMENT);
|
|
1392
|
-
for (let i = 0, c = 0; i < o.length; ++i, c += t.BYTES_PER_ELEMENT)
|
|
1393
|
-
o[i] = s[n](c, r);
|
|
1394
|
-
return o;
|
|
1395
|
-
}
|
|
1396
|
-
const wr = (e) => new Uint8Array(e), Zr = (e) => new Int8Array(e), Kr = (e, t) => M(e, Uint16Array, "getUint16", t), ts = (e, t) => M(e, Int16Array, "getInt16", t), es = (e, t) => M(e, Int32Array, "getInt32", t), ns = (e, t) => M(e, Uint32Array, "getUint32", t), rs = (e, t) => M(e, A, "getFloat16", t), ss = (e, t) => M(e, Float32Array, "getFloat32", t), os = (e, t) => M(e, Float64Array, "getFloat64", t);
|
|
1397
|
-
class is extends fr {
|
|
1398
|
-
constructor(t) {
|
|
1399
|
-
super(
|
|
1400
|
-
de,
|
|
1401
|
-
wr,
|
|
1402
|
-
{
|
|
1403
|
-
format: cn,
|
|
1404
|
-
minFilter: kt,
|
|
1405
|
-
magFilter: kt,
|
|
1406
|
-
wrapS: mt,
|
|
1407
|
-
wrapT: mt,
|
|
1408
|
-
wrapR: mt,
|
|
1409
|
-
width: hn,
|
|
1410
|
-
height: fn,
|
|
1411
|
-
depth: ln
|
|
1412
|
-
},
|
|
1413
|
-
t
|
|
1414
|
-
);
|
|
1415
|
-
}
|
|
1416
|
-
}
|
|
1417
|
-
function* ze(e, t, n, r, s) {
|
|
1379
|
+
function* ve(e, t, n, r, o) {
|
|
1418
1380
|
if (n >= r)
|
|
1419
1381
|
return;
|
|
1420
|
-
const
|
|
1382
|
+
const s = 2 ** n, i = n + 1, c = 2 ** i, a = Math.floor(e / s * c), h = Math.floor(t / s * c), f = [
|
|
1421
1383
|
[a, h, i],
|
|
1422
1384
|
[a + 1, h, i],
|
|
1423
1385
|
[a, h + 1, i],
|
|
1424
1386
|
[a + 1, h + 1, i]
|
|
1425
1387
|
];
|
|
1426
1388
|
if (i < r)
|
|
1427
|
-
for (const
|
|
1428
|
-
for (const O of
|
|
1389
|
+
for (const d of f)
|
|
1390
|
+
for (const O of ve(...d, r, o))
|
|
1429
1391
|
yield O;
|
|
1430
1392
|
else
|
|
1431
|
-
for (const
|
|
1432
|
-
yield (
|
|
1393
|
+
for (const d of f)
|
|
1394
|
+
yield (o ?? new Z()).set(...d);
|
|
1433
1395
|
}
|
|
1434
1396
|
class Z {
|
|
1435
1397
|
constructor(t = 0, n = 0, r = 0) {
|
|
@@ -1448,12 +1410,12 @@ class Z {
|
|
|
1448
1410
|
return t.x === this.x && t.y === this.y && t.z === this.z;
|
|
1449
1411
|
}
|
|
1450
1412
|
getParent(t = new Z()) {
|
|
1451
|
-
const n = 2 ** this.z, r = this.x / n,
|
|
1452
|
-
return t.set(Math.floor(r * i), Math.floor(
|
|
1413
|
+
const n = 2 ** this.z, r = this.x / n, o = this.y / n, s = this.z - 1, i = 2 ** s;
|
|
1414
|
+
return t.set(Math.floor(r * i), Math.floor(o * i), s);
|
|
1453
1415
|
}
|
|
1454
1416
|
*traverseChildren(t, n) {
|
|
1455
|
-
const { x: r, y:
|
|
1456
|
-
for (const i of
|
|
1417
|
+
const { x: r, y: o, z: s } = this;
|
|
1418
|
+
for (const i of ve(r, o, s, s + t, n))
|
|
1457
1419
|
yield i;
|
|
1458
1420
|
}
|
|
1459
1421
|
fromArray(t, n = 0) {
|
|
@@ -1466,104 +1428,124 @@ class Z {
|
|
|
1466
1428
|
yield this.x, yield this.y, yield this.z;
|
|
1467
1429
|
}
|
|
1468
1430
|
}
|
|
1469
|
-
const
|
|
1470
|
-
class
|
|
1431
|
+
const le = /* @__PURE__ */ new ue();
|
|
1432
|
+
class Ge {
|
|
1471
1433
|
constructor(t = 2, n = 1, r = dt.MAX) {
|
|
1472
1434
|
this.width = t, this.height = n, this.rectangle = r;
|
|
1473
1435
|
}
|
|
1474
1436
|
clone() {
|
|
1475
|
-
return new
|
|
1437
|
+
return new Ge(this.width, this.height, this.rectangle.clone());
|
|
1476
1438
|
}
|
|
1477
1439
|
copy(t) {
|
|
1478
1440
|
return this.width = t.width, this.height = t.height, this.rectangle.copy(t.rectangle), this;
|
|
1479
1441
|
}
|
|
1480
|
-
getSize(t, n = new
|
|
1442
|
+
getSize(t, n = new ue()) {
|
|
1481
1443
|
return n.set(this.width << t, this.height << t);
|
|
1482
1444
|
}
|
|
1483
1445
|
// Reference: https://github.com/CesiumGS/cesium/blob/1.122/packages/engine/Source/Core/GeographicTilingScheme.js#L210
|
|
1484
1446
|
getTile(t, n, r = new Z()) {
|
|
1485
|
-
const
|
|
1486
|
-
let
|
|
1487
|
-
f < a && (
|
|
1488
|
-
let O = Math.floor((
|
|
1489
|
-
O >=
|
|
1490
|
-
let
|
|
1491
|
-
return
|
|
1447
|
+
const o = this.getSize(n, le), { rectangle: s } = this, i = s.width / o.x, c = s.height / o.y, { west: a, south: h, east: f } = s;
|
|
1448
|
+
let d = t.longitude;
|
|
1449
|
+
f < a && (d += Math.PI * 2);
|
|
1450
|
+
let O = Math.floor((d - a) / i);
|
|
1451
|
+
O >= o.x && (O = o.x - 1);
|
|
1452
|
+
let F = Math.floor((t.latitude - h) / c);
|
|
1453
|
+
return F >= o.y && (F = o.y - 1), r.x = O, r.y = F, r.z = n, r;
|
|
1492
1454
|
}
|
|
1493
1455
|
// Reference: https://github.com/CesiumGS/cesium/blob/1.122/packages/engine/Source/Core/GeographicTilingScheme.js#L169
|
|
1494
1456
|
getRectangle(t, n = new dt()) {
|
|
1495
|
-
const r = this.getSize(t.z,
|
|
1496
|
-
return n.west = t.x *
|
|
1457
|
+
const r = this.getSize(t.z, le), { rectangle: o } = this, s = o.width / r.x, i = o.height / r.y, { west: c, north: a } = o;
|
|
1458
|
+
return n.west = t.x * s + c, n.east = (t.x + 1) * s + c, n.north = a - (r.y - t.y - 1) * i, n.south = a - (r.y - t.y) * i, n;
|
|
1497
1459
|
}
|
|
1498
1460
|
}
|
|
1499
|
-
|
|
1461
|
+
let ct;
|
|
1462
|
+
function hr() {
|
|
1463
|
+
if (ct != null)
|
|
1464
|
+
return ct;
|
|
1465
|
+
const e = new Uint32Array([268435456]);
|
|
1466
|
+
return ct = new Uint8Array(e.buffer, e.byteOffset, e.byteLength)[0] === 0, ct;
|
|
1500
1467
|
}
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1468
|
+
function B(e, t, n, r = !0) {
|
|
1469
|
+
if (r === hr())
|
|
1470
|
+
return new t(e);
|
|
1471
|
+
const o = Object.assign(new DataView(e), {
|
|
1472
|
+
getFloat16(i, c) {
|
|
1473
|
+
return tr(this, i, c);
|
|
1474
|
+
}
|
|
1475
|
+
}), s = new t(o.byteLength / t.BYTES_PER_ELEMENT);
|
|
1476
|
+
for (let i = 0, c = 0; i < s.length; ++i, c += t.BYTES_PER_ELEMENT)
|
|
1477
|
+
s[i] = o[n](c, r);
|
|
1506
1478
|
return s;
|
|
1507
1479
|
}
|
|
1508
|
-
|
|
1509
|
-
|
|
1480
|
+
const Wr = (e) => new Uint8Array(e), Vr = (e) => new Int8Array(e), Yr = (e, t) => B(e, Uint16Array, "getUint16", t), Xr = (e, t) => B(e, Int16Array, "getInt16", t), qr = (e, t) => B(e, Int32Array, "getInt32", t), kr = (e, t) => B(e, Uint32Array, "getUint32", t), Jr = (e, t) => B(e, A, "getFloat16", t), $r = (e, t) => B(e, Float32Array, "getFloat32", t), Qr = (e, t) => B(e, Float64Array, "getFloat64", t);
|
|
1481
|
+
function Zr(e) {
|
|
1482
|
+
}
|
|
1483
|
+
const fr = /#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*(?:i\s*\+\+|\+\+\s*i)\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;
|
|
1484
|
+
function lr(e, t, n, r) {
|
|
1485
|
+
let o = "";
|
|
1486
|
+
for (let s = parseInt(t, 10); s < parseInt(n, 10); ++s)
|
|
1487
|
+
o += r.replace(/\[\s*i\s*\]/g, `[${s}]`).replace(/UNROLLED_LOOP_INDEX/g, `${s}`);
|
|
1488
|
+
return o;
|
|
1489
|
+
}
|
|
1490
|
+
function Kr(e) {
|
|
1491
|
+
return e.replace(fr, lr);
|
|
1510
1492
|
}
|
|
1511
1493
|
export {
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1494
|
+
sn as ArrayBufferLoader,
|
|
1495
|
+
ns as DEFAULT_STBN_URL,
|
|
1496
|
+
br as DataTextureLoader,
|
|
1497
|
+
zr as EXR3DTextureLoader,
|
|
1498
|
+
Hr as EXRTextureLoader,
|
|
1499
|
+
Xt as Ellipsoid,
|
|
1500
|
+
hs as EllipsoidGeometry,
|
|
1519
1501
|
A as Float16Array,
|
|
1520
1502
|
V as Geodetic,
|
|
1521
|
-
|
|
1522
|
-
|
|
1503
|
+
De as PointOfView,
|
|
1504
|
+
rs as QuadGeometry,
|
|
1523
1505
|
dt as Rectangle,
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1506
|
+
ss as STBNLoader,
|
|
1507
|
+
os as STBN_TEXTURE_DEPTH,
|
|
1508
|
+
is as STBN_TEXTURE_HEIGHT,
|
|
1509
|
+
cs as STBN_TEXTURE_WIDTH,
|
|
1528
1510
|
Z as TileCoordinate,
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1511
|
+
Ge as TilingScheme,
|
|
1512
|
+
er as TypedArrayLoader,
|
|
1513
|
+
Pr as ceilPowerOfTwo,
|
|
1532
1514
|
z as clamp,
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1515
|
+
Mr as closeTo,
|
|
1516
|
+
Br as define,
|
|
1517
|
+
vr as defineExpression,
|
|
1518
|
+
Dr as defineFloat,
|
|
1519
|
+
Fr as defineInt,
|
|
1520
|
+
Gr as definePropertyShorthand,
|
|
1521
|
+
jr as defineUniformShorthand,
|
|
1522
|
+
Ir as degrees,
|
|
1523
|
+
Sr as euclideanModulo,
|
|
1524
|
+
xr as floorPowerOfTwo,
|
|
1525
|
+
gr as fromBufferGeometryLike,
|
|
1526
|
+
mr as inverseLerp,
|
|
1527
|
+
wr as isFloatLinearSupported,
|
|
1528
|
+
Or as isPowerOfTwo,
|
|
1529
|
+
Tr as isTypedArray,
|
|
1530
|
+
_r as lerp,
|
|
1531
|
+
Nr as normalize,
|
|
1532
|
+
Jr as parseFloat16Array,
|
|
1533
|
+
$r as parseFloat32Array,
|
|
1534
|
+
Qr as parseFloat64Array,
|
|
1535
|
+
Xr as parseInt16Array,
|
|
1536
|
+
qr as parseInt32Array,
|
|
1537
|
+
Vr as parseInt8Array,
|
|
1538
|
+
Yr as parseUint16Array,
|
|
1539
|
+
kr as parseUint32Array,
|
|
1540
|
+
Wr as parseUint8Array,
|
|
1541
|
+
Er as radians,
|
|
1542
|
+
Zr as reinterpretType,
|
|
1543
|
+
Lr as remap,
|
|
1544
|
+
Rr as remapClamped,
|
|
1545
|
+
ar as resolveIncludes,
|
|
1546
|
+
Cr as saturate,
|
|
1547
|
+
Ur as smoothstep,
|
|
1548
|
+
Ar as toBufferGeometryLike,
|
|
1549
|
+
Kr as unrollLoops
|
|
1568
1550
|
};
|
|
1569
1551
|
//# sourceMappingURL=index.js.map
|