@takram/three-geospatial 0.5.0 → 0.6.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 +14 -0
- package/build/index.cjs +1 -1
- package/build/index.cjs.map +1 -1
- package/build/index.js +359 -373
- package/build/index.js.map +1 -1
- package/build/r3f.cjs.map +1 -1
- package/build/r3f.js.map +1 -1
- package/build/shaders.cjs.map +1 -1
- package/build/shaders.js.map +1 -1
- package/build/shared.cjs.map +1 -1
- package/build/shared.js.map +1 -1
- package/build/shared2.cjs +1 -1
- package/build/shared2.cjs.map +1 -1
- package/build/shared2.js +55 -61
- package/build/shared2.js.map +1 -1
- package/build/shared3.cjs.map +1 -1
- package/build/shared3.js.map +1 -1
- package/build/webgpu.cjs +1 -1
- package/build/webgpu.cjs.map +1 -1
- package/build/webgpu.js +511 -630
- package/build/webgpu.js.map +1 -1
- package/package.json +1 -2
- package/src/EXR3DTextureLoader.ts +1 -1
- package/src/EXRTextureLoader.ts +1 -1
- package/src/webgpu/DownsampleThresholdNode.ts +3 -4
- package/src/webgpu/DualMipmapFilterNode.ts +1 -1
- package/src/webgpu/FnLayout.ts +5 -5
- package/src/webgpu/GaussianBlurNode.ts +3 -3
- package/src/webgpu/HighpVelocityNode.ts +8 -4
- package/src/webgpu/KawaseBlurNode.ts +3 -3
- package/src/webgpu/LensFlareNode.ts +10 -19
- package/src/webgpu/LensGlareNode.ts +8 -11
- package/src/webgpu/MipmapBlurNode.ts +7 -7
- package/src/webgpu/MipmapSurfaceBlurNode.ts +5 -6
- package/src/webgpu/OutputTexture3DNode.ts +1 -5
- package/src/webgpu/OutputTextureNode.ts +1 -4
- package/src/webgpu/RTTextureNode.ts +6 -8
- package/src/webgpu/TemporalAntialiasNode.ts +20 -23
- package/src/webgpu/accessors.ts +8 -10
- package/src/webgpu/generators.ts +7 -9
- package/src/webgpu/math.ts +13 -13
- package/src/webgpu/node.ts +3 -6
- package/src/webgpu/sampling.ts +3 -51
- package/src/webgpu/transformations.ts +30 -35
- package/src/webgpu/utils.ts +9 -9
- package/types/webgpu/DownsampleThresholdNode.d.ts +4 -4
- package/types/webgpu/DualMipmapFilterNode.d.ts +2 -2
- package/types/webgpu/FnLayout.d.ts +3 -3
- package/types/webgpu/GaussianBlurNode.d.ts +2 -2
- package/types/webgpu/HighpVelocityNode.d.ts +2 -3
- package/types/webgpu/KawaseBlurNode.d.ts +2 -2
- package/types/webgpu/LensFlareNode.d.ts +4 -4
- package/types/webgpu/LensGhostNode.d.ts +1 -1
- package/types/webgpu/LensGlareNode.d.ts +5 -5
- package/types/webgpu/LensHaloNode.d.ts +2 -2
- package/types/webgpu/MipmapBlurNode.d.ts +4 -4
- package/types/webgpu/MipmapSurfaceBlurNode.d.ts +3 -3
- package/types/webgpu/OutputTexture3DNode.d.ts +1 -2
- package/types/webgpu/OutputTextureNode.d.ts +1 -2
- package/types/webgpu/RTTextureNode.d.ts +2 -3
- package/types/webgpu/SeparableFilterNode.d.ts +2 -2
- package/types/webgpu/SingleFilterNode.d.ts +1 -1
- package/types/webgpu/TemporalAntialiasNode.d.ts +6 -6
- package/types/webgpu/accessors.d.ts +8 -8
- package/types/webgpu/generators.d.ts +4 -4
- package/types/webgpu/node.d.ts +4 -5
- package/types/webgpu/sampling.d.ts +0 -1
- package/types/webgpu/transformations.d.ts +8 -8
- package/types/webgpu/utils.d.ts +1 -2
package/build/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Loader as K, FileLoader as
|
|
2
|
-
import { i as
|
|
3
|
-
import { E as
|
|
4
|
-
import { a as
|
|
5
|
-
import { EXRLoader as
|
|
6
|
-
import { Q as
|
|
7
|
-
class
|
|
1
|
+
import { Loader as K, FileLoader as He, BufferGeometry as We, BufferAttribute as Wt, Box3 as Ve, Vector3 as U, Sphere as Ye, WebGLRenderer as Xe, LinearFilter as Vt, RGBAFormat as ke, ByteType as qe, UnsignedByteType as Yt, ShortType as Je, UnsignedShortType as $e, IntType as Qe, UnsignedIntType as Ze, HalfFloatType as Ke, FloatType as Xt, MathUtils as _, Material as pt, Data3DTexture as ue, DataTexture as tn, Quaternion as en, Matrix4 as nn, Ray as rn, RepeatWrapping as mt, NearestFilter as kt, RedFormat as sn, Vector2 as de } from "three";
|
|
2
|
+
import { i as ye } from "./shared.js";
|
|
3
|
+
import { E as qt, G as V } from "./shared2.js";
|
|
4
|
+
import { a as hs } from "./shared2.js";
|
|
5
|
+
import { EXRLoader as pe } from "three/addons/loaders/EXRLoader.js";
|
|
6
|
+
import { Q as ls } from "./shared3.js";
|
|
7
|
+
class on extends K {
|
|
8
8
|
load(t, n, r, s) {
|
|
9
|
-
const o = new
|
|
9
|
+
const o = new He(this.manager);
|
|
10
10
|
o.setResponseType("arraybuffer"), o.setRequestHeader(this.requestHeader), o.setPath(this.path), o.setWithCredentials(this.withCredentials), o.load(
|
|
11
11
|
t,
|
|
12
12
|
(i) => {
|
|
13
|
-
|
|
13
|
+
ye(i instanceof ArrayBuffer);
|
|
14
14
|
try {
|
|
15
15
|
n(i);
|
|
16
16
|
} catch (c) {
|
|
@@ -22,7 +22,7 @@ class sn extends K {
|
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function _r(e) {
|
|
26
26
|
const { attributes: t, index: n, boundingBox: r, boundingSphere: s } = e;
|
|
27
27
|
return [
|
|
28
28
|
{ attributes: t, index: n, boundingBox: r, boundingSphere: s },
|
|
@@ -34,40 +34,40 @@ function Sr(e) {
|
|
|
34
34
|
].filter((o) => o != null)
|
|
35
35
|
];
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function Er(e, t = new We()) {
|
|
38
38
|
for (const [n, r] of Object.entries(e.attributes))
|
|
39
39
|
t.setAttribute(
|
|
40
40
|
n,
|
|
41
|
-
new
|
|
41
|
+
new Wt(
|
|
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 Wt(
|
|
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 Ve(
|
|
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 Ye(
|
|
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 Ir(e) {
|
|
68
|
+
return e instanceof Xe ? e.getContext().getExtension("OES_texture_float_linear") != null : e.backend.hasFeature?.("float32-filterable") ?? !1;
|
|
69
69
|
}
|
|
70
|
-
const
|
|
70
|
+
const cn = 128, an = 128, hn = 64, fn = "9627216cc50057994c98a2118f3c4a23765d43b9", Or = `https://media.githubusercontent.com/media/takram-design-engineering/three-geospatial/${fn}/packages/core/assets/stbn.bin`, ln = "This is not an object", un = "This is not a Float16Array object", Jt = "This constructor is not a subclass of Float16Array", Ae = "The constructor property value is not an object", dn = "Species constructor didn't return TypedArray object", yn = "Derived constructor created TypedArray object which was too small length", J = "Attempting to access detached ArrayBuffer", xt = "Cannot convert undefined or null to object", Nt = "Cannot mix BigInt and other types, use explicit conversions", $t = "@@iterator property is not callable", Qt = "Reduce of empty array with no initial value", pn = "The comparison function must be either a function or undefined", St = "Offset is out of bounds";
|
|
71
71
|
function g(e) {
|
|
72
72
|
return (t, ...n) => m(e, t, n);
|
|
73
73
|
}
|
|
@@ -82,38 +82,38 @@ function H(e, t) {
|
|
|
82
82
|
const {
|
|
83
83
|
apply: m,
|
|
84
84
|
construct: k,
|
|
85
|
-
defineProperty:
|
|
86
|
-
get:
|
|
85
|
+
defineProperty: Zt,
|
|
86
|
+
get: _t,
|
|
87
87
|
getOwnPropertyDescriptor: D,
|
|
88
88
|
getPrototypeOf: tt,
|
|
89
|
-
has:
|
|
90
|
-
ownKeys:
|
|
91
|
-
set:
|
|
92
|
-
setPrototypeOf:
|
|
93
|
-
} = Reflect,
|
|
94
|
-
EPSILON:
|
|
95
|
-
MAX_SAFE_INTEGER:
|
|
96
|
-
isFinite:
|
|
89
|
+
has: Rt,
|
|
90
|
+
ownKeys: ge,
|
|
91
|
+
set: Kt,
|
|
92
|
+
setPrototypeOf: we
|
|
93
|
+
} = Reflect, An = Proxy, {
|
|
94
|
+
EPSILON: gn,
|
|
95
|
+
MAX_SAFE_INTEGER: te,
|
|
96
|
+
isFinite: Te,
|
|
97
97
|
isNaN: G
|
|
98
98
|
} = Number, {
|
|
99
|
-
iterator:
|
|
100
|
-
species:
|
|
101
|
-
toStringTag:
|
|
102
|
-
for:
|
|
99
|
+
iterator: x,
|
|
100
|
+
species: wn,
|
|
101
|
+
toStringTag: Mt,
|
|
102
|
+
for: Tn
|
|
103
103
|
} = Symbol, j = Object, {
|
|
104
|
-
create:
|
|
104
|
+
create: At,
|
|
105
105
|
defineProperty: et,
|
|
106
|
-
freeze:
|
|
107
|
-
is:
|
|
108
|
-
} = j,
|
|
106
|
+
freeze: bn,
|
|
107
|
+
is: ee
|
|
108
|
+
} = j, Lt = j.prototype, mn = (
|
|
109
109
|
/** @type {any} */
|
|
110
|
-
|
|
110
|
+
Lt.__lookupGetter__ ? g(
|
|
111
111
|
/** @type {any} */
|
|
112
|
-
|
|
112
|
+
Lt.__lookupGetter__
|
|
113
113
|
) : (e, t) => {
|
|
114
114
|
if (e == null)
|
|
115
115
|
throw w(
|
|
116
|
-
|
|
116
|
+
xt
|
|
117
117
|
);
|
|
118
118
|
let n = j(e);
|
|
119
119
|
do {
|
|
@@ -124,21 +124,21 @@ const {
|
|
|
124
124
|
}
|
|
125
125
|
), L = (
|
|
126
126
|
/** @type {any} */
|
|
127
|
-
j.hasOwn || g(
|
|
128
|
-
),
|
|
129
|
-
|
|
130
|
-
),
|
|
131
|
-
abs:
|
|
132
|
-
trunc:
|
|
133
|
-
} = Math,
|
|
127
|
+
j.hasOwn || g(Lt.hasOwnProperty)
|
|
128
|
+
), be = Array, me = be.isArray, gt = be.prototype, Sn = g(gt.join), _n = g(gt.push), En = g(
|
|
129
|
+
gt.toLocaleString
|
|
130
|
+
), Bt = gt[x], In = g(Bt), {
|
|
131
|
+
abs: On,
|
|
132
|
+
trunc: Se
|
|
133
|
+
} = Math, wt = ArrayBuffer, Pn = wt.isView, _e = wt.prototype, xn = g(_e.slice), Nn = H(_e, "byteLength"), Ut = typeof SharedArrayBuffer < "u" ? SharedArrayBuffer : null, Rn = Ut && H(Ut.prototype, "byteLength"), vt = tt(Uint8Array), Ln = vt.from, b = vt.prototype, Un = b[x], Cn = g(b.keys), Fn = g(
|
|
134
134
|
b.values
|
|
135
|
-
),
|
|
135
|
+
), Mn = g(
|
|
136
136
|
b.entries
|
|
137
|
-
),
|
|
137
|
+
), Bn = g(b.set), ne = g(
|
|
138
138
|
b.reverse
|
|
139
|
-
),
|
|
139
|
+
), vn = g(b.fill), Dn = g(
|
|
140
140
|
b.copyWithin
|
|
141
|
-
),
|
|
141
|
+
), re = g(b.sort), Y = g(b.slice), Gn = g(
|
|
142
142
|
b.subarray
|
|
143
143
|
), T = H(
|
|
144
144
|
b,
|
|
@@ -149,63 +149,63 @@ const {
|
|
|
149
149
|
), d = H(
|
|
150
150
|
b,
|
|
151
151
|
"length"
|
|
152
|
-
),
|
|
152
|
+
), Ee = H(
|
|
153
153
|
b,
|
|
154
|
-
|
|
155
|
-
),
|
|
156
|
-
})().next),
|
|
157
|
-
|
|
158
|
-
), w = TypeError,
|
|
154
|
+
Mt
|
|
155
|
+
), jn = Uint8Array, S = Uint16Array, se = (...e) => m(Ln, S, e), Dt = Uint32Array, zn = Float32Array, F = tt([][x]()), Tt = g(F.next), Hn = g((function* () {
|
|
156
|
+
})().next), Wn = tt(F), Vn = DataView.prototype, Yn = g(
|
|
157
|
+
Vn.getUint16
|
|
158
|
+
), w = TypeError, Et = RangeError, Ie = WeakSet, Oe = Ie.prototype, Xn = g(Oe.add), kn = g(Oe.has), bt = WeakMap, Gt = bt.prototype, at = g(Gt.get), qn = g(Gt.has), jt = g(Gt.set), Pe = new bt(), Jn = At(null, {
|
|
159
159
|
next: {
|
|
160
160
|
value: function() {
|
|
161
|
-
const t = at(
|
|
162
|
-
return
|
|
161
|
+
const t = at(Pe, this);
|
|
162
|
+
return Tt(t);
|
|
163
163
|
}
|
|
164
164
|
},
|
|
165
|
-
[
|
|
165
|
+
[x]: {
|
|
166
166
|
value: function() {
|
|
167
167
|
return this;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
});
|
|
171
171
|
function q(e) {
|
|
172
|
-
if (e[
|
|
172
|
+
if (e[x] === Bt && F.next === Tt)
|
|
173
173
|
return e;
|
|
174
|
-
const t =
|
|
175
|
-
return
|
|
174
|
+
const t = At(Jn);
|
|
175
|
+
return jt(Pe, t, In(e)), t;
|
|
176
176
|
}
|
|
177
|
-
const
|
|
177
|
+
const xe = new bt(), Ne = At(Wn, {
|
|
178
178
|
next: {
|
|
179
179
|
value: function() {
|
|
180
|
-
const t = at(
|
|
181
|
-
return
|
|
180
|
+
const t = at(xe, this);
|
|
181
|
+
return Hn(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 =
|
|
191
|
-
return
|
|
187
|
+
for (const e of ge(F))
|
|
188
|
+
e !== "next" && et(Ne, e, D(F, e));
|
|
189
|
+
function oe(e) {
|
|
190
|
+
const t = At(Ne);
|
|
191
|
+
return jt(xe, 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 ie(e) {
|
|
197
197
|
return e !== null && typeof e == "object";
|
|
198
198
|
}
|
|
199
199
|
function ft(e) {
|
|
200
|
-
return
|
|
200
|
+
return Ee(e) !== void 0;
|
|
201
201
|
}
|
|
202
|
-
function
|
|
203
|
-
const t =
|
|
202
|
+
function Ct(e) {
|
|
203
|
+
const t = Ee(e);
|
|
204
204
|
return t === "BigInt64Array" || t === "BigUint64Array";
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function $n(e) {
|
|
207
207
|
try {
|
|
208
|
-
return
|
|
208
|
+
return me(e) ? !1 : (Nn(
|
|
209
209
|
/** @type {any} */
|
|
210
210
|
e
|
|
211
211
|
), !0);
|
|
@@ -213,11 +213,11 @@ function Jn(e) {
|
|
|
213
213
|
return !1;
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
function
|
|
217
|
-
if (
|
|
216
|
+
function Re(e) {
|
|
217
|
+
if (Ut === null)
|
|
218
218
|
return !1;
|
|
219
219
|
try {
|
|
220
|
-
return
|
|
220
|
+
return Rn(
|
|
221
221
|
/** @type {any} */
|
|
222
222
|
e
|
|
223
223
|
), !0;
|
|
@@ -225,70 +225,70 @@ function Ne(e) {
|
|
|
225
225
|
return !1;
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
|
-
function
|
|
229
|
-
return
|
|
228
|
+
function Qn(e) {
|
|
229
|
+
return $n(e) || Re(e);
|
|
230
230
|
}
|
|
231
|
-
function
|
|
232
|
-
return
|
|
231
|
+
function ce(e) {
|
|
232
|
+
return me(e) ? e[x] === Bt && F.next === Tt : !1;
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
return ft(e) ? e[
|
|
234
|
+
function Zn(e) {
|
|
235
|
+
return ft(e) ? e[x] === Un && F.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 + "" || !Te(t) ? !1 : t === Se(t);
|
|
242
242
|
}
|
|
243
|
-
const lt =
|
|
244
|
-
function
|
|
245
|
-
if (!
|
|
243
|
+
const lt = Tn("__Float16Array__");
|
|
244
|
+
function Kn(e) {
|
|
245
|
+
if (!ie(e))
|
|
246
246
|
return !1;
|
|
247
247
|
const t = tt(e);
|
|
248
|
-
if (!
|
|
248
|
+
if (!ie(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(Ae);
|
|
255
|
+
return Rt(n, lt);
|
|
256
256
|
}
|
|
257
|
-
const
|
|
258
|
-
function
|
|
259
|
-
return e +
|
|
257
|
+
const Ft = 1 / gn;
|
|
258
|
+
function tr(e) {
|
|
259
|
+
return e + Ft - Ft;
|
|
260
260
|
}
|
|
261
|
-
const
|
|
262
|
-
function
|
|
261
|
+
const Le = 6103515625e-14, er = 65504, Ue = 9765625e-10, ae = Ue * Le, nr = Ue * Ft;
|
|
262
|
+
function rr(e) {
|
|
263
263
|
const t = +e;
|
|
264
|
-
if (!
|
|
264
|
+
if (!Te(t) || t === 0)
|
|
265
265
|
return t;
|
|
266
|
-
const n = t > 0 ? 1 : -1, r =
|
|
267
|
-
if (r <
|
|
268
|
-
return n *
|
|
269
|
-
const s = (1 +
|
|
270
|
-
return o >
|
|
266
|
+
const n = t > 0 ? 1 : -1, r = On(t);
|
|
267
|
+
if (r < Le)
|
|
268
|
+
return n * tr(r / ae) * ae;
|
|
269
|
+
const s = (1 + nr) * r, o = s - (s - r);
|
|
270
|
+
return o > er || G(o) ? n * (1 / 0) : n * o;
|
|
271
271
|
}
|
|
272
|
-
const
|
|
272
|
+
const Ce = new wt(4), Fe = new zn(Ce), Me = new Dt(Ce), E = new S(512), I = new jn(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
|
-
function
|
|
278
|
-
|
|
279
|
-
const t =
|
|
277
|
+
function P(e) {
|
|
278
|
+
Fe[0] = rr(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 zt = 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, zt[e] = t | n;
|
|
288
288
|
}
|
|
289
289
|
for (let e = 1024; e < 2048; ++e)
|
|
290
|
-
|
|
291
|
-
const W = new
|
|
290
|
+
zt[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 S(64);
|
|
300
300
|
for (let e = 1; e < 64; ++e)
|
|
301
|
-
e !== 32 && (
|
|
301
|
+
e !== 32 && (Be[e] = 1024);
|
|
302
302
|
function y(e) {
|
|
303
303
|
const t = e >> 10;
|
|
304
|
-
return
|
|
304
|
+
return Me[0] = zt[Be[t] + (e & 1023)] + W[t], Fe[0];
|
|
305
305
|
}
|
|
306
306
|
function R(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
|
|
310
|
+
function It(e) {
|
|
311
311
|
const t = R(e);
|
|
312
|
-
return t < 0 ? 0 : t <
|
|
312
|
+
return t < 0 ? 0 : t < te ? t : te;
|
|
313
313
|
}
|
|
314
314
|
function rt(e, t) {
|
|
315
315
|
if (!ht(e))
|
|
316
|
-
throw w(
|
|
316
|
+
throw w(ln);
|
|
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(Ae);
|
|
322
|
+
const r = n[wn];
|
|
323
323
|
return r ?? t;
|
|
324
324
|
}
|
|
325
325
|
function $(e) {
|
|
326
|
-
if (
|
|
326
|
+
if (Re(e))
|
|
327
327
|
return !1;
|
|
328
328
|
try {
|
|
329
|
-
return
|
|
329
|
+
return xn(e, 0, 0), !1;
|
|
330
330
|
} catch {
|
|
331
331
|
}
|
|
332
332
|
return !0;
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function he(e, t) {
|
|
335
335
|
const n = G(e), r = G(t);
|
|
336
336
|
if (n && r)
|
|
337
337
|
return 0;
|
|
@@ -342,7 +342,7 @@ function ae(e, t) {
|
|
|
342
342
|
if (e > t)
|
|
343
343
|
return 1;
|
|
344
344
|
if (e === 0 && t === 0) {
|
|
345
|
-
const s =
|
|
345
|
+
const s = ee(e, 0), o = ee(t, 0);
|
|
346
346
|
if (!s && o)
|
|
347
347
|
return -1;
|
|
348
348
|
if (s && !o)
|
|
@@ -350,18 +350,18 @@ function ae(e, t) {
|
|
|
350
350
|
}
|
|
351
351
|
return 0;
|
|
352
352
|
}
|
|
353
|
-
const
|
|
353
|
+
const Ht = 2, ut = new bt();
|
|
354
354
|
function v(e) {
|
|
355
|
-
return
|
|
355
|
+
return qn(ut, e) || !Pn(e) && Kn(e);
|
|
356
356
|
}
|
|
357
357
|
function u(e) {
|
|
358
358
|
if (!v(e))
|
|
359
|
-
throw w(
|
|
359
|
+
throw w(un);
|
|
360
360
|
}
|
|
361
361
|
function st(e, t) {
|
|
362
362
|
const n = v(e), r = ft(e);
|
|
363
363
|
if (!n && !r)
|
|
364
|
-
throw w(
|
|
364
|
+
throw w(dn);
|
|
365
365
|
if (typeof t == "number") {
|
|
366
366
|
let s;
|
|
367
367
|
if (n) {
|
|
@@ -371,11 +371,11 @@ function st(e, t) {
|
|
|
371
371
|
s = d(e);
|
|
372
372
|
if (s < t)
|
|
373
373
|
throw w(
|
|
374
|
-
|
|
374
|
+
yn
|
|
375
375
|
);
|
|
376
376
|
}
|
|
377
|
-
if (
|
|
378
|
-
throw w(
|
|
377
|
+
if (Ct(e))
|
|
378
|
+
throw w(Nt);
|
|
379
379
|
}
|
|
380
380
|
function l(e) {
|
|
381
381
|
const t = at(ut, e);
|
|
@@ -400,27 +400,27 @@ function l(e) {
|
|
|
400
400
|
], e.constructor);
|
|
401
401
|
return at(ut, r);
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function fe(e) {
|
|
404
404
|
const t = d(e), n = [];
|
|
405
405
|
for (let r = 0; r < t; ++r)
|
|
406
406
|
n[r] = y(e[r]);
|
|
407
407
|
return n;
|
|
408
408
|
}
|
|
409
|
-
const
|
|
410
|
-
for (const e of
|
|
411
|
-
if (e ===
|
|
409
|
+
const ve = new Ie();
|
|
410
|
+
for (const e of ge(b)) {
|
|
411
|
+
if (e === Mt)
|
|
412
412
|
continue;
|
|
413
413
|
const t = D(b, e);
|
|
414
|
-
L(t, "get") && typeof t.get == "function" &&
|
|
414
|
+
L(t, "get") && typeof t.get == "function" && Xn(ve, t.get);
|
|
415
415
|
}
|
|
416
|
-
const
|
|
416
|
+
const sr = bn(
|
|
417
417
|
/** @type {ProxyHandler<Float16BitsArray>} */
|
|
418
418
|
{
|
|
419
419
|
get(e, t, n) {
|
|
420
|
-
return nt(t) && L(e, t) ? y(
|
|
420
|
+
return nt(t) && L(e, t) ? y(_t(e, t)) : kn(ve, mn(e, t)) ? _t(e, t) : _t(e, t, n);
|
|
421
421
|
},
|
|
422
422
|
set(e, t, n, r) {
|
|
423
|
-
return nt(t) && L(e, t) ?
|
|
423
|
+
return nt(t) && L(e, t) ? Kt(e, t, P(n)) : Kt(e, t, n, r);
|
|
424
424
|
},
|
|
425
425
|
getOwnPropertyDescriptor(e, t) {
|
|
426
426
|
if (nt(t) && L(e, t)) {
|
|
@@ -430,7 +430,7 @@ const rr = Tn(
|
|
|
430
430
|
return D(e, t);
|
|
431
431
|
},
|
|
432
432
|
defineProperty(e, t, n) {
|
|
433
|
-
return nt(t) && L(e, t) && L(n, "value") && (n.value =
|
|
433
|
+
return nt(t) && L(e, t) && L(n, "value") && (n.value = P(n.value)), Zt(e, t, n);
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
);
|
|
@@ -440,36 +440,36 @@ class A {
|
|
|
440
440
|
let s;
|
|
441
441
|
if (v(t))
|
|
442
442
|
s = k(S, [l(t)], new.target);
|
|
443
|
-
else if (ht(t) &&
|
|
443
|
+
else if (ht(t) && !Qn(t)) {
|
|
444
444
|
let i, c;
|
|
445
445
|
if (ft(t)) {
|
|
446
446
|
i = t, c = d(t);
|
|
447
447
|
const a = T(t);
|
|
448
448
|
if ($(a))
|
|
449
449
|
throw w(J);
|
|
450
|
-
if (
|
|
451
|
-
throw w(
|
|
452
|
-
const h = new
|
|
453
|
-
c *
|
|
450
|
+
if (Ct(t))
|
|
451
|
+
throw w(Nt);
|
|
452
|
+
const h = new wt(
|
|
453
|
+
c * Ht
|
|
454
454
|
);
|
|
455
455
|
s = k(S, [h], new.target);
|
|
456
456
|
} else {
|
|
457
|
-
const a = t[
|
|
457
|
+
const a = t[x];
|
|
458
458
|
if (a != null && typeof a != "function")
|
|
459
|
-
throw w(
|
|
460
|
-
a != null ?
|
|
459
|
+
throw w($t);
|
|
460
|
+
a != null ? ce(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 = It(i.length)), s = k(S, [c], new.target);
|
|
463
463
|
}
|
|
464
464
|
for (let a = 0; a < c; ++a)
|
|
465
|
-
s[a] =
|
|
465
|
+
s[a] = P(i[a]);
|
|
466
466
|
} else
|
|
467
467
|
s = k(S, arguments, new.target);
|
|
468
468
|
const o = (
|
|
469
469
|
/** @type {any} */
|
|
470
|
-
new
|
|
470
|
+
new An(s, sr)
|
|
471
471
|
);
|
|
472
|
-
return
|
|
472
|
+
return jt(ut, o, s), o;
|
|
473
473
|
}
|
|
474
474
|
/**
|
|
475
475
|
* limitation: `Object.getOwnPropertyNames(Float16Array)` or `Reflect.ownKeys(Float16Array)` include this key
|
|
@@ -477,9 +477,9 @@ class A {
|
|
|
477
477
|
*/
|
|
478
478
|
static from(t, ...n) {
|
|
479
479
|
const r = this;
|
|
480
|
-
if (!
|
|
480
|
+
if (!Rt(r, lt))
|
|
481
481
|
throw w(
|
|
482
|
-
|
|
482
|
+
Jt
|
|
483
483
|
);
|
|
484
484
|
if (r === A) {
|
|
485
485
|
if (v(t) && n.length === 0) {
|
|
@@ -495,14 +495,14 @@ class A {
|
|
|
495
495
|
if (n.length === 0)
|
|
496
496
|
return new A(
|
|
497
497
|
T(
|
|
498
|
-
|
|
498
|
+
se(t, P)
|
|
499
499
|
)
|
|
500
500
|
);
|
|
501
501
|
const a = n[0], h = n[1];
|
|
502
502
|
return new A(
|
|
503
503
|
T(
|
|
504
|
-
|
|
505
|
-
return
|
|
504
|
+
se(t, function(f, ...p) {
|
|
505
|
+
return P(
|
|
506
506
|
m(a, this, [f, ...q(p)])
|
|
507
507
|
);
|
|
508
508
|
}, h)
|
|
@@ -510,17 +510,17 @@ class A {
|
|
|
510
510
|
);
|
|
511
511
|
}
|
|
512
512
|
let s, o;
|
|
513
|
-
const i = t[
|
|
513
|
+
const i = t[x];
|
|
514
514
|
if (i != null && typeof i != "function")
|
|
515
|
-
throw w(
|
|
515
|
+
throw w($t);
|
|
516
516
|
if (i != null)
|
|
517
|
-
|
|
517
|
+
ce(t) ? (s = t, o = t.length) : Zn(t) ? (s = t, o = d(t)) : (s = [...t], o = s.length);
|
|
518
518
|
else {
|
|
519
519
|
if (t == null)
|
|
520
520
|
throw w(
|
|
521
|
-
|
|
521
|
+
xt
|
|
522
522
|
);
|
|
523
|
-
s = j(t), o =
|
|
523
|
+
s = j(t), o = It(s.length);
|
|
524
524
|
}
|
|
525
525
|
const c = new r(o);
|
|
526
526
|
if (n.length === 0)
|
|
@@ -540,15 +540,15 @@ class A {
|
|
|
540
540
|
*/
|
|
541
541
|
static of(...t) {
|
|
542
542
|
const n = this;
|
|
543
|
-
if (!
|
|
543
|
+
if (!Rt(n, lt))
|
|
544
544
|
throw w(
|
|
545
|
-
|
|
545
|
+
Jt
|
|
546
546
|
);
|
|
547
547
|
const r = t.length;
|
|
548
548
|
if (n === A) {
|
|
549
549
|
const o = new A(r), i = l(o);
|
|
550
550
|
for (let c = 0; c < r; ++c)
|
|
551
|
-
i[c] =
|
|
551
|
+
i[c] = P(t[c]);
|
|
552
552
|
return o;
|
|
553
553
|
}
|
|
554
554
|
const s = new n(r);
|
|
@@ -560,7 +560,7 @@ class A {
|
|
|
560
560
|
keys() {
|
|
561
561
|
u(this);
|
|
562
562
|
const t = l(this);
|
|
563
|
-
return
|
|
563
|
+
return Cn(t);
|
|
564
564
|
}
|
|
565
565
|
/**
|
|
566
566
|
* limitation: returns a object whose prototype is not `%ArrayIteratorPrototype%`
|
|
@@ -569,8 +569,8 @@ class A {
|
|
|
569
569
|
values() {
|
|
570
570
|
u(this);
|
|
571
571
|
const t = l(this);
|
|
572
|
-
return
|
|
573
|
-
for (const n of
|
|
572
|
+
return oe((function* () {
|
|
573
|
+
for (const n of Fn(t))
|
|
574
574
|
yield y(n);
|
|
575
575
|
})());
|
|
576
576
|
}
|
|
@@ -581,8 +581,8 @@ 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 oe((function* () {
|
|
585
|
+
for (const [n, r] of Mn(t))
|
|
586
586
|
yield (
|
|
587
587
|
/** @type {[number, number]} */
|
|
588
588
|
[n, y(r)]
|
|
@@ -601,7 +601,7 @@ class A {
|
|
|
601
601
|
u(this);
|
|
602
602
|
const r = l(this), s = d(r), o = R(t), i = o >= 0 ? o : s + o, c = +n;
|
|
603
603
|
if (i < 0 || i >= s)
|
|
604
|
-
throw
|
|
604
|
+
throw Et(St);
|
|
605
605
|
const a = new S(
|
|
606
606
|
T(r),
|
|
607
607
|
C(r),
|
|
@@ -611,7 +611,7 @@ class A {
|
|
|
611
611
|
Y(a)
|
|
612
612
|
)
|
|
613
613
|
), f = l(h);
|
|
614
|
-
return f[i] =
|
|
614
|
+
return f[i] = P(c), h;
|
|
615
615
|
}
|
|
616
616
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.map */
|
|
617
617
|
map(t, ...n) {
|
|
@@ -621,7 +621,7 @@ class A {
|
|
|
621
621
|
const a = new A(s), h = l(a);
|
|
622
622
|
for (let f = 0; f < s; ++f) {
|
|
623
623
|
const p = y(r[f]);
|
|
624
|
-
h[f] =
|
|
624
|
+
h[f] = P(
|
|
625
625
|
m(t, o, [p, f, this])
|
|
626
626
|
);
|
|
627
627
|
}
|
|
@@ -644,7 +644,7 @@ class A {
|
|
|
644
644
|
const r = l(this), s = d(r), o = n[0], i = [];
|
|
645
645
|
for (let h = 0; h < s; ++h) {
|
|
646
646
|
const f = y(r[h]);
|
|
647
|
-
m(t, o, [f, h, this]) &&
|
|
647
|
+
m(t, o, [f, h, this]) && _n(i, f);
|
|
648
648
|
}
|
|
649
649
|
const c = rt(r, A), a = new c(i);
|
|
650
650
|
return st(a), /** @type {any} */
|
|
@@ -655,7 +655,7 @@ class A {
|
|
|
655
655
|
u(this);
|
|
656
656
|
const r = l(this), s = d(r);
|
|
657
657
|
if (s === 0 && n.length === 0)
|
|
658
|
-
throw w(
|
|
658
|
+
throw w(Qt);
|
|
659
659
|
let o, i;
|
|
660
660
|
n.length === 0 ? (o = y(r[0]), i = 1) : (o = n[0], i = 0);
|
|
661
661
|
for (let c = i; c < s; ++c)
|
|
@@ -672,7 +672,7 @@ class A {
|
|
|
672
672
|
u(this);
|
|
673
673
|
const r = l(this), s = d(r);
|
|
674
674
|
if (s === 0 && n.length === 0)
|
|
675
|
-
throw w(
|
|
675
|
+
throw w(Qt);
|
|
676
676
|
let o, i;
|
|
677
677
|
n.length === 0 ? (o = y(r[s - 1]), i = s - 2) : (o = n[0], i = s - 1);
|
|
678
678
|
for (let c = i; c >= 0; --c)
|
|
@@ -768,17 +768,17 @@ class A {
|
|
|
768
768
|
u(this);
|
|
769
769
|
const r = l(this), s = R(n[0]);
|
|
770
770
|
if (s < 0)
|
|
771
|
-
throw
|
|
771
|
+
throw Et(St);
|
|
772
772
|
if (t == null)
|
|
773
773
|
throw w(
|
|
774
|
-
|
|
774
|
+
xt
|
|
775
775
|
);
|
|
776
|
-
if (
|
|
776
|
+
if (Ct(t))
|
|
777
777
|
throw w(
|
|
778
|
-
|
|
778
|
+
Nt
|
|
779
779
|
);
|
|
780
780
|
if (v(t))
|
|
781
|
-
return
|
|
781
|
+
return Bn(
|
|
782
782
|
l(this),
|
|
783
783
|
l(t),
|
|
784
784
|
s
|
|
@@ -788,17 +788,17 @@ class A {
|
|
|
788
788
|
if ($(a))
|
|
789
789
|
throw w(J);
|
|
790
790
|
}
|
|
791
|
-
const o = d(r), i = j(t), c =
|
|
791
|
+
const o = d(r), i = j(t), c = It(i.length);
|
|
792
792
|
if (s === 1 / 0 || c + s > o)
|
|
793
|
-
throw
|
|
793
|
+
throw Et(St);
|
|
794
794
|
for (let a = 0; a < c; ++a)
|
|
795
|
-
r[a + s] =
|
|
795
|
+
r[a + s] = 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 ne(t), this;
|
|
802
802
|
}
|
|
803
803
|
/** @see https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toReversed */
|
|
804
804
|
toReversed() {
|
|
@@ -812,15 +812,15 @@ class A {
|
|
|
812
812
|
Y(n)
|
|
813
813
|
)
|
|
814
814
|
), s = l(r);
|
|
815
|
-
return
|
|
815
|
+
return ne(s), 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 vn(
|
|
822
822
|
r,
|
|
823
|
-
|
|
823
|
+
P(t),
|
|
824
824
|
...q(n)
|
|
825
825
|
), this;
|
|
826
826
|
}
|
|
@@ -828,21 +828,21 @@ class A {
|
|
|
828
828
|
copyWithin(t, n, ...r) {
|
|
829
829
|
u(this);
|
|
830
830
|
const s = l(this);
|
|
831
|
-
return
|
|
831
|
+
return Dn(s, t, n, ...q(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 : he;
|
|
837
|
+
return re(n, (s, o) => r(y(s), y(o))), 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(pn);
|
|
845
|
+
const r = t !== void 0 ? t : he, s = new S(
|
|
846
846
|
T(n),
|
|
847
847
|
C(n),
|
|
848
848
|
d(n)
|
|
@@ -851,21 +851,21 @@ class A {
|
|
|
851
851
|
Y(s)
|
|
852
852
|
)
|
|
853
853
|
), i = l(o);
|
|
854
|
-
return
|
|
854
|
+
return re(i, (c, a) => r(y(c), y(a))), o;
|
|
855
855
|
}
|
|
856
856
|
/** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.slice */
|
|
857
857
|
slice(t, n) {
|
|
858
858
|
u(this);
|
|
859
859
|
const r = l(this), s = rt(r, A);
|
|
860
860
|
if (s === A) {
|
|
861
|
-
const
|
|
861
|
+
const ze = new S(
|
|
862
862
|
T(r),
|
|
863
863
|
C(r),
|
|
864
864
|
d(r)
|
|
865
865
|
);
|
|
866
866
|
return new A(
|
|
867
867
|
T(
|
|
868
|
-
Y(
|
|
868
|
+
Y(ze, t, n)
|
|
869
869
|
)
|
|
870
870
|
);
|
|
871
871
|
}
|
|
@@ -877,8 +877,8 @@ class A {
|
|
|
877
877
|
const f = h - a > 0 ? h - a : 0, p = new s(f);
|
|
878
878
|
if (st(p, f), f === 0)
|
|
879
879
|
return p;
|
|
880
|
-
const
|
|
881
|
-
if ($(
|
|
880
|
+
const O = T(r);
|
|
881
|
+
if ($(O))
|
|
882
882
|
throw w(J);
|
|
883
883
|
let B = 0;
|
|
884
884
|
for (; a < h; )
|
|
@@ -895,7 +895,7 @@ class A {
|
|
|
895
895
|
T(r),
|
|
896
896
|
C(r),
|
|
897
897
|
d(r)
|
|
898
|
-
), i =
|
|
898
|
+
), i = Gn(o, t, n), c = new s(
|
|
899
899
|
T(i),
|
|
900
900
|
C(i),
|
|
901
901
|
d(i)
|
|
@@ -948,17 +948,17 @@ 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 = fe(n);
|
|
952
|
+
return Sn(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 = fe(n);
|
|
958
|
+
return En(r, ...q(t));
|
|
959
959
|
}
|
|
960
960
|
/** @see https://tc39.es/ecma262/#sec-get-%typedarray%.prototype-@@tostringtag */
|
|
961
|
-
get [
|
|
961
|
+
get [Mt]() {
|
|
962
962
|
if (v(this))
|
|
963
963
|
return (
|
|
964
964
|
/** @type {any} */
|
|
@@ -967,35 +967,34 @@ class A {
|
|
|
967
967
|
}
|
|
968
968
|
}
|
|
969
969
|
et(A, "BYTES_PER_ELEMENT", {
|
|
970
|
-
value:
|
|
970
|
+
value: Ht
|
|
971
971
|
});
|
|
972
972
|
et(A, lt, {});
|
|
973
|
-
|
|
973
|
+
we(A, vt);
|
|
974
974
|
const dt = A.prototype;
|
|
975
975
|
et(dt, "BYTES_PER_ELEMENT", {
|
|
976
|
-
value:
|
|
976
|
+
value: Ht
|
|
977
977
|
});
|
|
978
|
-
et(dt,
|
|
978
|
+
et(dt, x, {
|
|
979
979
|
value: dt.values,
|
|
980
980
|
writable: !0,
|
|
981
981
|
configurable: !0
|
|
982
982
|
});
|
|
983
|
-
|
|
984
|
-
function
|
|
983
|
+
we(dt, b);
|
|
984
|
+
function or(e, t, ...n) {
|
|
985
985
|
return y(
|
|
986
|
-
|
|
986
|
+
Yn(e, t, ...q(n))
|
|
987
987
|
);
|
|
988
988
|
}
|
|
989
|
-
function
|
|
989
|
+
function Pr(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
|
|
993
|
-
parser;
|
|
992
|
+
class ir extends K {
|
|
994
993
|
constructor(t, n) {
|
|
995
994
|
super(n), this.parser = t;
|
|
996
995
|
}
|
|
997
996
|
load(t, n, r, s) {
|
|
998
|
-
const o = new
|
|
997
|
+
const o = new on(this.manager);
|
|
999
998
|
o.setRequestHeader(this.requestHeader), o.setPath(this.path), o.setWithCredentials(this.withCredentials), o.load(
|
|
1000
999
|
t,
|
|
1001
1000
|
(i) => {
|
|
@@ -1010,56 +1009,53 @@ class or extends K {
|
|
|
1010
1009
|
);
|
|
1011
1010
|
}
|
|
1012
1011
|
}
|
|
1013
|
-
function
|
|
1014
|
-
const t = e instanceof Int8Array ?
|
|
1015
|
-
return
|
|
1012
|
+
function cr(e) {
|
|
1013
|
+
const t = e instanceof Int8Array ? qe : e instanceof Uint8Array ? Yt : e instanceof Uint8ClampedArray ? Yt : e instanceof Int16Array ? Je : e instanceof Uint16Array ? $e : e instanceof Int32Array ? Qe : e instanceof Uint32Array ? Ze : e instanceof A ? Ke : e instanceof Float32Array ? Xt : e instanceof Float64Array ? Xt : null;
|
|
1014
|
+
return ye(t != null), t;
|
|
1016
1015
|
}
|
|
1017
|
-
class
|
|
1018
|
-
textureClass;
|
|
1019
|
-
parser;
|
|
1020
|
-
options;
|
|
1016
|
+
class ar extends K {
|
|
1021
1017
|
constructor(t, n, r = {}, s) {
|
|
1022
1018
|
super(s), this.textureClass = t, this.parser = n, this.options = {
|
|
1023
|
-
format:
|
|
1024
|
-
minFilter:
|
|
1025
|
-
magFilter:
|
|
1019
|
+
format: ke,
|
|
1020
|
+
minFilter: Vt,
|
|
1021
|
+
magFilter: Vt,
|
|
1026
1022
|
...r
|
|
1027
1023
|
};
|
|
1028
1024
|
}
|
|
1029
1025
|
load(t, n, r, s) {
|
|
1030
|
-
const o = new this.textureClass(), i = new
|
|
1026
|
+
const o = new this.textureClass(), i = new ir(this.parser, this.manager);
|
|
1031
1027
|
return i.setRequestHeader(this.requestHeader), i.setPath(this.path), i.setWithCredentials(this.withCredentials), i.load(
|
|
1032
1028
|
t,
|
|
1033
1029
|
(c) => {
|
|
1034
1030
|
o.image.data = c instanceof A ? new Uint16Array(c.buffer) : c;
|
|
1035
1031
|
const { width: a, height: h, depth: f, ...p } = this.options;
|
|
1036
|
-
a != null && (o.image.width = a), h != null && (o.image.height = h), "depth" in o.image && f != null && (o.image.depth = f), o.type =
|
|
1032
|
+
a != null && (o.image.width = a), h != null && (o.image.height = h), "depth" in o.image && f != null && (o.image.depth = f), o.type = cr(c), Object.assign(o, p), o.needsUpdate = !0, n?.(o);
|
|
1037
1033
|
},
|
|
1038
1034
|
r,
|
|
1039
1035
|
s
|
|
1040
1036
|
), o;
|
|
1041
1037
|
}
|
|
1042
1038
|
}
|
|
1043
|
-
const z = _.clamp,
|
|
1044
|
-
function
|
|
1039
|
+
const z = _.clamp, xr = _.euclideanModulo, Nr = _.inverseLerp, Rr = _.lerp, Lr = _.degToRad, Ur = _.radToDeg, Cr = _.isPowerOfTwo, Fr = _.ceilPowerOfTwo, Mr = _.floorPowerOfTwo, Br = _.normalize;
|
|
1040
|
+
function vr(e, t, n, r = 0, s = 1) {
|
|
1045
1041
|
return _.mapLinear(e, t, n, r, s);
|
|
1046
1042
|
}
|
|
1047
|
-
function
|
|
1043
|
+
function Dr(e, t, n, r = 0, s = 1) {
|
|
1048
1044
|
return z(_.mapLinear(e, t, n, r, s), r, s);
|
|
1049
1045
|
}
|
|
1050
|
-
function
|
|
1046
|
+
function Gr(e, t, n) {
|
|
1051
1047
|
return n <= e ? 0 : n >= t ? 1 : (n = (n - e) / (t - e), n * n * (3 - 2 * n));
|
|
1052
1048
|
}
|
|
1053
|
-
function
|
|
1049
|
+
function jr(e) {
|
|
1054
1050
|
return Math.min(Math.max(e, 0), 1);
|
|
1055
1051
|
}
|
|
1056
|
-
function
|
|
1052
|
+
function zr(e, t, n, r = n) {
|
|
1057
1053
|
const s = Math.abs(e - t);
|
|
1058
1054
|
return s <= r || s <= n * Math.max(Math.abs(e), Math.abs(t));
|
|
1059
1055
|
}
|
|
1060
|
-
function
|
|
1056
|
+
function Hr(e) {
|
|
1061
1057
|
return (t, n) => {
|
|
1062
|
-
t instanceof
|
|
1058
|
+
t instanceof pt ? Object.defineProperty(t, n, {
|
|
1063
1059
|
enumerable: !0,
|
|
1064
1060
|
get() {
|
|
1065
1061
|
return this.defines?.[e] != null;
|
|
@@ -1078,12 +1074,12 @@ function zr(e) {
|
|
|
1078
1074
|
});
|
|
1079
1075
|
};
|
|
1080
1076
|
}
|
|
1081
|
-
function
|
|
1077
|
+
function Wr(e, {
|
|
1082
1078
|
min: t = Number.MIN_SAFE_INTEGER,
|
|
1083
1079
|
max: n = Number.MAX_SAFE_INTEGER
|
|
1084
1080
|
} = {}) {
|
|
1085
1081
|
return (r, s) => {
|
|
1086
|
-
r instanceof
|
|
1082
|
+
r instanceof pt ? Object.defineProperty(r, s, {
|
|
1087
1083
|
enumerable: !0,
|
|
1088
1084
|
get() {
|
|
1089
1085
|
const o = this.defines?.[e];
|
|
@@ -1106,13 +1102,13 @@ function Hr(e, {
|
|
|
1106
1102
|
});
|
|
1107
1103
|
};
|
|
1108
1104
|
}
|
|
1109
|
-
function
|
|
1105
|
+
function Vr(e, {
|
|
1110
1106
|
min: t = -1 / 0,
|
|
1111
1107
|
max: n = 1 / 0,
|
|
1112
1108
|
precision: r = 7
|
|
1113
1109
|
} = {}) {
|
|
1114
1110
|
return (s, o) => {
|
|
1115
|
-
s instanceof
|
|
1111
|
+
s instanceof pt ? Object.defineProperty(s, o, {
|
|
1116
1112
|
enumerable: !0,
|
|
1117
1113
|
get() {
|
|
1118
1114
|
const i = this.defines?.[e];
|
|
@@ -1135,9 +1131,9 @@ function Wr(e, {
|
|
|
1135
1131
|
});
|
|
1136
1132
|
};
|
|
1137
1133
|
}
|
|
1138
|
-
function
|
|
1134
|
+
function Yr(e, { validate: t } = {}) {
|
|
1139
1135
|
return (n, r) => {
|
|
1140
|
-
n instanceof
|
|
1136
|
+
n instanceof pt ? Object.defineProperty(n, r, {
|
|
1141
1137
|
enumerable: !0,
|
|
1142
1138
|
get() {
|
|
1143
1139
|
return this.defines?.[e] ?? "";
|
|
@@ -1168,7 +1164,7 @@ function Vr(e, { validate: t } = {}) {
|
|
|
1168
1164
|
});
|
|
1169
1165
|
};
|
|
1170
1166
|
}
|
|
1171
|
-
function
|
|
1167
|
+
function Xr(e, ...t) {
|
|
1172
1168
|
const n = {};
|
|
1173
1169
|
for (let r = 0; r < t.length; r += 2) {
|
|
1174
1170
|
const s = t[r], o = t[r + 1];
|
|
@@ -1183,7 +1179,7 @@ function Yr(e, ...t) {
|
|
|
1183
1179
|
}
|
|
1184
1180
|
return Object.defineProperties(e, n), e;
|
|
1185
1181
|
}
|
|
1186
|
-
function
|
|
1182
|
+
function kr(e, t, n) {
|
|
1187
1183
|
const r = {};
|
|
1188
1184
|
for (const s of n)
|
|
1189
1185
|
r[s] = {
|
|
@@ -1195,13 +1191,12 @@ function Xr(e, t, n) {
|
|
|
1195
1191
|
};
|
|
1196
1192
|
return Object.defineProperties(e, r), e;
|
|
1197
1193
|
}
|
|
1198
|
-
class
|
|
1199
|
-
options;
|
|
1194
|
+
class qr extends K {
|
|
1200
1195
|
constructor(t = {}, n) {
|
|
1201
1196
|
super(n), this.options = t;
|
|
1202
1197
|
}
|
|
1203
1198
|
load(t, n, r, s) {
|
|
1204
|
-
const { width: o, height: i, depth: c } = this.options, a = new
|
|
1199
|
+
const { width: o, height: i, depth: c } = this.options, a = new ue(null, o, i, c), h = new pe(this.manager);
|
|
1205
1200
|
return h.setRequestHeader(this.requestHeader), h.setPath(this.path), h.setWithCredentials(this.withCredentials), h.load(
|
|
1206
1201
|
t,
|
|
1207
1202
|
(f) => {
|
|
@@ -1214,8 +1209,8 @@ class kr extends K {
|
|
|
1214
1209
|
}, a.type = f.type, a.format = f.format, a.colorSpace = f.colorSpace, a.needsUpdate = !0;
|
|
1215
1210
|
try {
|
|
1216
1211
|
n?.(a);
|
|
1217
|
-
} catch (
|
|
1218
|
-
s != null ? s(
|
|
1212
|
+
} catch (O) {
|
|
1213
|
+
s != null ? s(O) : console.error(O), this.manager.itemError(t);
|
|
1219
1214
|
}
|
|
1220
1215
|
},
|
|
1221
1216
|
r,
|
|
@@ -1223,13 +1218,12 @@ class kr extends K {
|
|
|
1223
1218
|
), a;
|
|
1224
1219
|
}
|
|
1225
1220
|
}
|
|
1226
|
-
class
|
|
1227
|
-
options;
|
|
1221
|
+
class Jr extends K {
|
|
1228
1222
|
constructor(t = {}, n) {
|
|
1229
1223
|
super(n), this.options = t;
|
|
1230
1224
|
}
|
|
1231
1225
|
load(t, n, r, s) {
|
|
1232
|
-
const { width: o, height: i } = this.options, c = new
|
|
1226
|
+
const { width: o, height: i } = this.options, c = new tn(null, o, i), a = new pe(this.manager);
|
|
1233
1227
|
return a.setRequestHeader(this.requestHeader), a.setPath(this.path), a.setWithCredentials(this.withCredentials), a.load(
|
|
1234
1228
|
t,
|
|
1235
1229
|
(h) => {
|
|
@@ -1250,17 +1244,8 @@ class qr extends K {
|
|
|
1250
1244
|
), c;
|
|
1251
1245
|
}
|
|
1252
1246
|
}
|
|
1253
|
-
const
|
|
1254
|
-
class
|
|
1255
|
-
// Distance from the target.
|
|
1256
|
-
_distance;
|
|
1257
|
-
// Radians from the local east direction relative from true north, measured
|
|
1258
|
-
// clockwise (90 degrees is true north, and -90 is true south).
|
|
1259
|
-
heading;
|
|
1260
|
-
// Radians from the local horizon plane, measured with positive values looking
|
|
1261
|
-
// up (90 degrees is straight up, -90 is straight down).
|
|
1262
|
-
_pitch;
|
|
1263
|
-
roll;
|
|
1247
|
+
const Ot = 1e-6, ot = /* @__PURE__ */ new U(), it = /* @__PURE__ */ new U(), N = /* @__PURE__ */ new U(), X = /* @__PURE__ */ new U(), Pt = /* @__PURE__ */ new U(), hr = /* @__PURE__ */ new U(), fr = /* @__PURE__ */ new nn(), lr = /* @__PURE__ */ new en(), ur = /* @__PURE__ */ new rn();
|
|
1248
|
+
class De {
|
|
1264
1249
|
constructor(t = 0, n = 0, r = 0, s = 0) {
|
|
1265
1250
|
this.distance = t, this.heading = n, this.pitch = r, this.roll = s;
|
|
1266
1251
|
}
|
|
@@ -1268,19 +1253,19 @@ class ve {
|
|
|
1268
1253
|
return this._distance;
|
|
1269
1254
|
}
|
|
1270
1255
|
set distance(t) {
|
|
1271
|
-
this._distance = Math.max(t,
|
|
1256
|
+
this._distance = Math.max(t, Ot);
|
|
1272
1257
|
}
|
|
1273
1258
|
get pitch() {
|
|
1274
1259
|
return this._pitch;
|
|
1275
1260
|
}
|
|
1276
1261
|
set pitch(t) {
|
|
1277
|
-
this._pitch = z(t, -Math.PI / 2 +
|
|
1262
|
+
this._pitch = z(t, -Math.PI / 2 + Ot, Math.PI / 2 - Ot);
|
|
1278
1263
|
}
|
|
1279
1264
|
set(t, n, r, s) {
|
|
1280
1265
|
return this.distance = t, this.heading = n, this.pitch = r, s != null && (this.roll = s), this;
|
|
1281
1266
|
}
|
|
1282
1267
|
clone() {
|
|
1283
|
-
return new
|
|
1268
|
+
return new De(this.distance, this.heading, this.pitch, this.roll);
|
|
1284
1269
|
}
|
|
1285
1270
|
copy(t) {
|
|
1286
1271
|
return this.distance = t.distance, this.heading = t.heading, this.pitch = t.pitch, this.roll = t.roll, this;
|
|
@@ -1288,7 +1273,7 @@ class ve {
|
|
|
1288
1273
|
equals(t) {
|
|
1289
1274
|
return t.distance === this.distance && t.heading === this.heading && t.pitch === this.pitch && t.roll === this.roll;
|
|
1290
1275
|
}
|
|
1291
|
-
decompose(t, n, r, s, o =
|
|
1276
|
+
decompose(t, n, r, s, o = qt.WGS84) {
|
|
1292
1277
|
o.getEastNorthUpVectors(
|
|
1293
1278
|
t,
|
|
1294
1279
|
ot,
|
|
@@ -1296,20 +1281,20 @@ class ve {
|
|
|
1296
1281
|
N
|
|
1297
1282
|
), s?.copy(N);
|
|
1298
1283
|
const i = X.copy(ot).multiplyScalar(Math.cos(this.heading)).add(
|
|
1299
|
-
|
|
1300
|
-
).multiplyScalar(Math.cos(this.pitch)).add(
|
|
1284
|
+
Pt.copy(it).multiplyScalar(Math.sin(this.heading))
|
|
1285
|
+
).multiplyScalar(Math.cos(this.pitch)).add(Pt.copy(N).multiplyScalar(Math.sin(this.pitch))).normalize().multiplyScalar(this.distance);
|
|
1301
1286
|
if (n.copy(t).sub(i), this.roll !== 0) {
|
|
1302
1287
|
const c = X.copy(t).sub(n).normalize();
|
|
1303
1288
|
N.applyQuaternion(
|
|
1304
|
-
|
|
1289
|
+
lr.setFromAxisAngle(c, this.roll)
|
|
1305
1290
|
);
|
|
1306
1291
|
}
|
|
1307
1292
|
r.setFromRotationMatrix(
|
|
1308
|
-
|
|
1293
|
+
fr.lookAt(n, t, N)
|
|
1309
1294
|
);
|
|
1310
1295
|
}
|
|
1311
|
-
setFromCamera(t, n =
|
|
1312
|
-
const r = X.setFromMatrixPosition(t.matrixWorld), s =
|
|
1296
|
+
setFromCamera(t, n = qt.WGS84) {
|
|
1297
|
+
const r = X.setFromMatrixPosition(t.matrixWorld), s = Pt.set(0, 0, 0.5).unproject(t).sub(r).normalize(), o = n.getIntersection(ur.set(r, s));
|
|
1313
1298
|
if (o == null)
|
|
1314
1299
|
return;
|
|
1315
1300
|
this.distance = r.distanceTo(o), n.getEastNorthUpVectors(
|
|
@@ -1321,20 +1306,14 @@ class ve {
|
|
|
1321
1306
|
it.dot(s),
|
|
1322
1307
|
ot.dot(s)
|
|
1323
1308
|
), this.pitch = Math.asin(N.dot(s));
|
|
1324
|
-
const i = X.copy(t.up).applyQuaternion(t.quaternion), c =
|
|
1309
|
+
const i = X.copy(t.up).applyQuaternion(t.quaternion), c = hr.copy(s).multiplyScalar(-i.dot(s)).add(i).normalize(), a = X.copy(s).multiplyScalar(-N.dot(s)).add(N).normalize(), h = a.dot(c), f = s.dot(a.cross(c));
|
|
1325
1310
|
return this.roll = Math.atan2(f, h), this;
|
|
1326
1311
|
}
|
|
1327
1312
|
}
|
|
1328
|
-
class Q {
|
|
1313
|
+
const Q = class Q {
|
|
1329
1314
|
constructor(t = 0, n = 0, r = 0, s = 0) {
|
|
1330
1315
|
this.west = t, this.south = n, this.east = r, this.north = s;
|
|
1331
1316
|
}
|
|
1332
|
-
static MAX = /* @__PURE__ */ new Q(
|
|
1333
|
-
V.MIN_LONGITUDE,
|
|
1334
|
-
V.MIN_LATITUDE,
|
|
1335
|
-
V.MAX_LONGITUDE,
|
|
1336
|
-
V.MAX_LATITUDE
|
|
1337
|
-
);
|
|
1338
1317
|
get width() {
|
|
1339
1318
|
let t = this.east;
|
|
1340
1319
|
return t < this.west && (t += Math.PI * 2), t - this.west;
|
|
@@ -1369,60 +1348,67 @@ class Q {
|
|
|
1369
1348
|
*[Symbol.iterator]() {
|
|
1370
1349
|
yield this.west, yield this.south, yield this.east, yield this.north;
|
|
1371
1350
|
}
|
|
1372
|
-
}
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1351
|
+
};
|
|
1352
|
+
Q.MAX = /* @__PURE__ */ new Q(
|
|
1353
|
+
V.MIN_LONGITUDE,
|
|
1354
|
+
V.MIN_LATITUDE,
|
|
1355
|
+
V.MAX_LONGITUDE,
|
|
1356
|
+
V.MAX_LATITUDE
|
|
1357
|
+
);
|
|
1358
|
+
let yt = Q;
|
|
1359
|
+
const dr = /^[ \t]*#include +"([\w\d./]+)"/gm;
|
|
1360
|
+
function yr(e, t) {
|
|
1361
|
+
return e.replace(dr, (n, r) => {
|
|
1376
1362
|
const o = r.split("/").reduce(
|
|
1377
1363
|
(i, c) => typeof i != "string" && i != null ? i[c] : void 0,
|
|
1378
1364
|
t
|
|
1379
1365
|
);
|
|
1380
1366
|
if (typeof o != "string")
|
|
1381
1367
|
throw new Error(`Could not find include for ${r}.`);
|
|
1382
|
-
return
|
|
1368
|
+
return yr(o, t);
|
|
1383
1369
|
});
|
|
1384
1370
|
}
|
|
1385
1371
|
let ct;
|
|
1386
|
-
function
|
|
1372
|
+
function pr() {
|
|
1387
1373
|
if (ct != null)
|
|
1388
1374
|
return ct;
|
|
1389
1375
|
const e = new Uint32Array([268435456]);
|
|
1390
1376
|
return ct = new Uint8Array(e.buffer, e.byteOffset, e.byteLength)[0] === 0, ct;
|
|
1391
1377
|
}
|
|
1392
1378
|
function M(e, t, n, r = !0) {
|
|
1393
|
-
if (r ===
|
|
1379
|
+
if (r === pr())
|
|
1394
1380
|
return new t(e);
|
|
1395
1381
|
const s = Object.assign(new DataView(e), {
|
|
1396
1382
|
getFloat16(i, c) {
|
|
1397
|
-
return
|
|
1383
|
+
return or(this, i, c);
|
|
1398
1384
|
}
|
|
1399
1385
|
}), o = new t(s.byteLength / t.BYTES_PER_ELEMENT);
|
|
1400
1386
|
for (let i = 0, c = 0; i < o.length; ++i, c += t.BYTES_PER_ELEMENT)
|
|
1401
1387
|
o[i] = s[n](c, r);
|
|
1402
1388
|
return o;
|
|
1403
1389
|
}
|
|
1404
|
-
const
|
|
1405
|
-
class
|
|
1390
|
+
const Ar = (e) => new Uint8Array(e), $r = (e) => new Int8Array(e), Qr = (e, t) => M(e, Uint16Array, "getUint16", t), Zr = (e, t) => M(e, Int16Array, "getInt16", t), Kr = (e, t) => M(e, Int32Array, "getInt32", t), ts = (e, t) => M(e, Uint32Array, "getUint32", t), es = (e, t) => M(e, A, "getFloat16", t), ns = (e, t) => M(e, Float32Array, "getFloat32", t), rs = (e, t) => M(e, Float64Array, "getFloat64", t);
|
|
1391
|
+
class ss extends ar {
|
|
1406
1392
|
constructor(t) {
|
|
1407
1393
|
super(
|
|
1408
|
-
|
|
1409
|
-
|
|
1394
|
+
ue,
|
|
1395
|
+
Ar,
|
|
1410
1396
|
{
|
|
1411
|
-
format:
|
|
1412
|
-
minFilter:
|
|
1413
|
-
magFilter:
|
|
1414
|
-
wrapS:
|
|
1415
|
-
wrapT:
|
|
1416
|
-
wrapR:
|
|
1417
|
-
width:
|
|
1418
|
-
height:
|
|
1419
|
-
depth:
|
|
1397
|
+
format: sn,
|
|
1398
|
+
minFilter: kt,
|
|
1399
|
+
magFilter: kt,
|
|
1400
|
+
wrapS: mt,
|
|
1401
|
+
wrapT: mt,
|
|
1402
|
+
wrapR: mt,
|
|
1403
|
+
width: cn,
|
|
1404
|
+
height: an,
|
|
1405
|
+
depth: hn
|
|
1420
1406
|
},
|
|
1421
1407
|
t
|
|
1422
1408
|
);
|
|
1423
1409
|
}
|
|
1424
1410
|
}
|
|
1425
|
-
function*
|
|
1411
|
+
function* Ge(e, t, n, r, s) {
|
|
1426
1412
|
if (n >= r)
|
|
1427
1413
|
return;
|
|
1428
1414
|
const o = 2 ** n, i = n + 1, c = 2 ** i, a = Math.floor(e / o * c), h = Math.floor(t / o * c), f = [
|
|
@@ -1433,8 +1419,8 @@ function* De(e, t, n, r, s) {
|
|
|
1433
1419
|
];
|
|
1434
1420
|
if (i < r)
|
|
1435
1421
|
for (const p of f)
|
|
1436
|
-
for (const
|
|
1437
|
-
yield
|
|
1422
|
+
for (const O of Ge(...p, r, s))
|
|
1423
|
+
yield O;
|
|
1438
1424
|
else
|
|
1439
1425
|
for (const p of f)
|
|
1440
1426
|
yield (s ?? new Z()).set(...p);
|
|
@@ -1461,7 +1447,7 @@ class Z {
|
|
|
1461
1447
|
}
|
|
1462
1448
|
*traverseChildren(t, n) {
|
|
1463
1449
|
const { x: r, y: s, z: o } = this;
|
|
1464
|
-
for (const i of
|
|
1450
|
+
for (const i of Ge(r, s, o, o + t, n))
|
|
1465
1451
|
yield i;
|
|
1466
1452
|
}
|
|
1467
1453
|
fromArray(t, n = 0) {
|
|
@@ -1474,104 +1460,104 @@ class Z {
|
|
|
1474
1460
|
yield this.x, yield this.y, yield this.z;
|
|
1475
1461
|
}
|
|
1476
1462
|
}
|
|
1477
|
-
const
|
|
1478
|
-
class
|
|
1479
|
-
constructor(t = 2, n = 1, r =
|
|
1463
|
+
const le = /* @__PURE__ */ new de();
|
|
1464
|
+
class je {
|
|
1465
|
+
constructor(t = 2, n = 1, r = yt.MAX) {
|
|
1480
1466
|
this.width = t, this.height = n, this.rectangle = r;
|
|
1481
1467
|
}
|
|
1482
1468
|
clone() {
|
|
1483
|
-
return new
|
|
1469
|
+
return new je(this.width, this.height, this.rectangle.clone());
|
|
1484
1470
|
}
|
|
1485
1471
|
copy(t) {
|
|
1486
1472
|
return this.width = t.width, this.height = t.height, this.rectangle.copy(t.rectangle), this;
|
|
1487
1473
|
}
|
|
1488
|
-
getSize(t, n = new
|
|
1474
|
+
getSize(t, n = new de()) {
|
|
1489
1475
|
return n.set(this.width << t, this.height << t);
|
|
1490
1476
|
}
|
|
1491
1477
|
// Reference: https://github.com/CesiumGS/cesium/blob/1.122/packages/engine/Source/Core/GeographicTilingScheme.js#L210
|
|
1492
1478
|
getTile(t, n, r = new Z()) {
|
|
1493
|
-
const s = this.getSize(n,
|
|
1479
|
+
const s = this.getSize(n, le), { rectangle: o } = this, i = o.width / s.x, c = o.height / s.y, { west: a, south: h, east: f } = o;
|
|
1494
1480
|
let p = t.longitude;
|
|
1495
1481
|
f < a && (p += Math.PI * 2);
|
|
1496
|
-
let
|
|
1497
|
-
|
|
1482
|
+
let O = Math.floor((p - a) / i);
|
|
1483
|
+
O >= s.x && (O = s.x - 1);
|
|
1498
1484
|
let B = Math.floor((t.latitude - h) / c);
|
|
1499
|
-
return B >= s.y && (B = s.y - 1), r.x =
|
|
1485
|
+
return B >= s.y && (B = s.y - 1), r.x = O, r.y = B, r.z = n, r;
|
|
1500
1486
|
}
|
|
1501
1487
|
// Reference: https://github.com/CesiumGS/cesium/blob/1.122/packages/engine/Source/Core/GeographicTilingScheme.js#L169
|
|
1502
|
-
getRectangle(t, n = new
|
|
1503
|
-
const r = this.getSize(t.z,
|
|
1488
|
+
getRectangle(t, n = new yt()) {
|
|
1489
|
+
const r = this.getSize(t.z, le), { rectangle: s } = this, o = s.width / r.x, i = s.height / r.y, { west: c, north: a } = s;
|
|
1504
1490
|
return n.west = t.x * o + c, n.east = (t.x + 1) * o + c, n.north = a - (r.y - t.y - 1) * i, n.south = a - (r.y - t.y) * i, n;
|
|
1505
1491
|
}
|
|
1506
1492
|
}
|
|
1507
|
-
function
|
|
1493
|
+
function os(e) {
|
|
1508
1494
|
}
|
|
1509
|
-
const
|
|
1510
|
-
function
|
|
1495
|
+
const gr = /#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;
|
|
1496
|
+
function wr(e, t, n, r) {
|
|
1511
1497
|
let s = "";
|
|
1512
1498
|
for (let o = parseInt(t, 10); o < parseInt(n, 10); ++o)
|
|
1513
1499
|
s += r.replace(/\[\s*i\s*\]/g, "[" + o + "]").replace(/UNROLLED_LOOP_INDEX/g, `${o}`);
|
|
1514
1500
|
return s;
|
|
1515
1501
|
}
|
|
1516
|
-
function
|
|
1517
|
-
return e.replace(
|
|
1502
|
+
function is(e) {
|
|
1503
|
+
return e.replace(gr, wr);
|
|
1518
1504
|
}
|
|
1519
1505
|
export {
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1506
|
+
on as ArrayBufferLoader,
|
|
1507
|
+
Or as DEFAULT_STBN_URL,
|
|
1508
|
+
ar as DataTextureLoader,
|
|
1509
|
+
qr as EXR3DTextureLoader,
|
|
1510
|
+
Jr as EXRTextureLoader,
|
|
1511
|
+
qt as Ellipsoid,
|
|
1512
|
+
hs as EllipsoidGeometry,
|
|
1527
1513
|
A as Float16Array,
|
|
1528
1514
|
V as Geodetic,
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1515
|
+
De as PointOfView,
|
|
1516
|
+
ls as QuadGeometry,
|
|
1517
|
+
yt as Rectangle,
|
|
1518
|
+
ss as STBNLoader,
|
|
1519
|
+
hn as STBN_TEXTURE_DEPTH,
|
|
1520
|
+
an as STBN_TEXTURE_HEIGHT,
|
|
1521
|
+
cn as STBN_TEXTURE_WIDTH,
|
|
1536
1522
|
Z as TileCoordinate,
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1523
|
+
je as TilingScheme,
|
|
1524
|
+
ir as TypedArrayLoader,
|
|
1525
|
+
Fr as ceilPowerOfTwo,
|
|
1540
1526
|
z as clamp,
|
|
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
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1527
|
+
zr as closeTo,
|
|
1528
|
+
Hr as define,
|
|
1529
|
+
Yr as defineExpression,
|
|
1530
|
+
Vr as defineFloat,
|
|
1531
|
+
Wr as defineInt,
|
|
1532
|
+
Xr as definePropertyShorthand,
|
|
1533
|
+
kr as defineUniformShorthand,
|
|
1534
|
+
Ur as degrees,
|
|
1535
|
+
xr as euclideanModulo,
|
|
1536
|
+
Mr as floorPowerOfTwo,
|
|
1537
|
+
Er as fromBufferGeometryLike,
|
|
1538
|
+
Nr as inverseLerp,
|
|
1539
|
+
Ir as isFloatLinearSupported,
|
|
1540
|
+
Cr as isPowerOfTwo,
|
|
1541
|
+
Pr as isTypedArray,
|
|
1542
|
+
Rr as lerp,
|
|
1543
|
+
Br as normalize,
|
|
1544
|
+
es as parseFloat16Array,
|
|
1545
|
+
ns as parseFloat32Array,
|
|
1546
|
+
rs as parseFloat64Array,
|
|
1547
|
+
Zr as parseInt16Array,
|
|
1548
|
+
Kr as parseInt32Array,
|
|
1549
|
+
$r as parseInt8Array,
|
|
1550
|
+
Qr as parseUint16Array,
|
|
1551
|
+
ts as parseUint32Array,
|
|
1552
|
+
Ar as parseUint8Array,
|
|
1553
|
+
Lr as radians,
|
|
1554
|
+
os as reinterpretType,
|
|
1555
|
+
vr as remap,
|
|
1556
|
+
Dr as remapClamped,
|
|
1557
|
+
yr as resolveIncludes,
|
|
1558
|
+
jr as saturate,
|
|
1559
|
+
Gr as smoothstep,
|
|
1560
|
+
_r as toBufferGeometryLike,
|
|
1561
|
+
is as unrollLoops
|
|
1576
1562
|
};
|
|
1577
1563
|
//# sourceMappingURL=index.js.map
|