@loaders.gl/gltf 3.2.7 → 3.3.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.min.js +1494 -38
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/api/gltf-extensions.js +5 -1
- package/dist/es5/lib/api/gltf-extensions.js.map +1 -1
- package/dist/es5/lib/extensions/KHR_texture_transform.js +293 -0
- package/dist/es5/lib/extensions/KHR_texture_transform.js.map +1 -0
- package/dist/es5/lib/extensions/deprecated/EXT_feature_metadata.js +131 -0
- package/dist/es5/lib/extensions/deprecated/EXT_feature_metadata.js.map +1 -0
- package/dist/es5/lib/gltf-utils/gltf-constants.js +3 -0
- package/dist/es5/lib/gltf-utils/gltf-constants.js.map +1 -1
- package/dist/es5/lib/utils/version.js +1 -1
- package/dist/es5/lib/utils/version.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/api/gltf-extensions.js +3 -1
- package/dist/esm/lib/api/gltf-extensions.js.map +1 -1
- package/dist/esm/lib/extensions/KHR_texture_transform.js +218 -0
- package/dist/esm/lib/extensions/KHR_texture_transform.js.map +1 -0
- package/dist/esm/lib/extensions/deprecated/EXT_feature_metadata.js +95 -0
- package/dist/esm/lib/extensions/deprecated/EXT_feature_metadata.js.map +1 -0
- package/dist/esm/lib/gltf-utils/gltf-constants.js +2 -2
- package/dist/esm/lib/gltf-utils/gltf-constants.js.map +1 -1
- package/dist/esm/lib/utils/version.js +1 -1
- package/dist/esm/lib/utils/version.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/api/gltf-extensions.d.ts +5 -0
- package/dist/lib/api/gltf-extensions.d.ts.map +1 -1
- package/dist/lib/api/gltf-extensions.js +5 -1
- package/dist/lib/extensions/KHR_texture_transform.d.ts +13 -0
- package/dist/lib/extensions/KHR_texture_transform.d.ts.map +1 -0
- package/dist/lib/extensions/KHR_texture_transform.js +230 -0
- package/dist/lib/extensions/deprecated/EXT_feature_metadata.d.ts +6 -0
- package/dist/lib/extensions/deprecated/EXT_feature_metadata.d.ts.map +1 -0
- package/dist/lib/extensions/deprecated/EXT_feature_metadata.js +118 -0
- package/dist/lib/gltf-utils/gltf-constants.d.ts +17 -0
- package/dist/lib/gltf-utils/gltf-constants.d.ts.map +1 -1
- package/dist/lib/gltf-utils/gltf-constants.js +5 -5
- package/dist/lib/types/gltf-json-schema.d.ts +386 -2
- package/dist/lib/types/gltf-json-schema.d.ts.map +1 -1
- package/dist/lib/types/gltf-types.d.ts +2 -2
- package/dist/lib/types/gltf-types.d.ts.map +1 -1
- package/package.json +7 -6
- package/src/index.ts +2 -1
- package/src/lib/api/gltf-extensions.ts +13 -2
- package/src/lib/extensions/KHR_texture_transform.ts +305 -0
- package/src/lib/extensions/deprecated/EXT_feature_metadata.ts +163 -0
- package/src/lib/gltf-utils/gltf-constants.ts +2 -2
- package/src/lib/types/gltf-json-schema.ts +431 -2
- package/src/lib/types/gltf-types.ts +4 -2
package/dist/dist.min.js
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
};
|
|
15
15
|
var __export = (target, all) => {
|
|
16
16
|
__markAsModule(target);
|
|
17
|
-
for (var
|
|
18
|
-
__defProp(target,
|
|
17
|
+
for (var name10 in all)
|
|
18
|
+
__defProp(target, name10, { get: all[name10], enumerable: true });
|
|
19
19
|
};
|
|
20
20
|
var __reExport = (target, module, desc) => {
|
|
21
21
|
if (module && typeof module === "object" || typeof module === "function") {
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
var DEFAULT_VERSION, VERSION2;
|
|
73
73
|
var init_version2 = __esm({
|
|
74
74
|
"../worker-utils/src/lib/env-utils/version.ts"() {
|
|
75
|
-
DEFAULT_VERSION = "
|
|
75
|
+
DEFAULT_VERSION = "beta";
|
|
76
76
|
VERSION2 = typeof __VERSION__ !== "undefined" ? __VERSION__ : DEFAULT_VERSION;
|
|
77
77
|
if (typeof __VERSION__ === "undefined") {
|
|
78
78
|
console.error("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
node = __toModule(require_require_utils());
|
|
192
192
|
init_assert2();
|
|
193
193
|
init_version2();
|
|
194
|
-
LATEST = "
|
|
194
|
+
LATEST = "beta";
|
|
195
195
|
VERSION3 = typeof VERSION2 !== "undefined" ? VERSION2 : LATEST;
|
|
196
196
|
loadLibraryPromises = {};
|
|
197
197
|
}
|
|
@@ -200,6 +200,7 @@
|
|
|
200
200
|
// ../worker-utils/src/index.ts
|
|
201
201
|
var init_src = __esm({
|
|
202
202
|
"../worker-utils/src/index.ts"() {
|
|
203
|
+
init_globals2();
|
|
203
204
|
init_library_utils();
|
|
204
205
|
}
|
|
205
206
|
});
|
|
@@ -324,7 +325,7 @@
|
|
|
324
325
|
var VERSION4;
|
|
325
326
|
var init_version3 = __esm({
|
|
326
327
|
"../textures/src/lib/utils/version.ts"() {
|
|
327
|
-
VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "
|
|
328
|
+
VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
|
|
328
329
|
}
|
|
329
330
|
});
|
|
330
331
|
|
|
@@ -753,11 +754,12 @@
|
|
|
753
754
|
var BasisWorkerLoader, BasisLoader;
|
|
754
755
|
var init_basis_loader = __esm({
|
|
755
756
|
"../textures/src/basis-loader.ts"() {
|
|
757
|
+
init_src();
|
|
756
758
|
init_version3();
|
|
757
759
|
init_parse_basis();
|
|
758
760
|
BasisWorkerLoader = {
|
|
759
761
|
name: "Basis",
|
|
760
|
-
id: "basis",
|
|
762
|
+
id: isBrowser2 ? "basis" : "basis-nodejs",
|
|
761
763
|
module: "textures",
|
|
762
764
|
version: VERSION4,
|
|
763
765
|
worker: true,
|
|
@@ -1396,12 +1398,12 @@
|
|
|
1396
1398
|
return extras[key];
|
|
1397
1399
|
}
|
|
1398
1400
|
getExtension(extensionName) {
|
|
1399
|
-
const isExtension = this.getUsedExtensions().find((
|
|
1401
|
+
const isExtension = this.getUsedExtensions().find((name10) => name10 === extensionName);
|
|
1400
1402
|
const extensions = this.json.extensions || {};
|
|
1401
1403
|
return isExtension ? extensions[extensionName] || true : null;
|
|
1402
1404
|
}
|
|
1403
1405
|
getRequiredExtension(extensionName) {
|
|
1404
|
-
const isRequired = this.getRequiredExtensions().find((
|
|
1406
|
+
const isRequired = this.getRequiredExtensions().find((name10) => name10 === extensionName);
|
|
1405
1407
|
return isRequired ? this.getExtension(extensionName) : null;
|
|
1406
1408
|
}
|
|
1407
1409
|
getRequiredExtensions() {
|
|
@@ -2064,6 +2066,7 @@
|
|
|
2064
2066
|
var DEFAULT_DRACO_OPTIONS, DracoLoader;
|
|
2065
2067
|
var init_draco_loader = __esm({
|
|
2066
2068
|
"../draco/src/draco-loader.ts"() {
|
|
2069
|
+
init_src();
|
|
2067
2070
|
init_version5();
|
|
2068
2071
|
DEFAULT_DRACO_OPTIONS = {
|
|
2069
2072
|
draco: {
|
|
@@ -2075,7 +2078,7 @@
|
|
|
2075
2078
|
};
|
|
2076
2079
|
DracoLoader = {
|
|
2077
2080
|
name: "Draco",
|
|
2078
|
-
id: "draco",
|
|
2081
|
+
id: isBrowser2 ? "draco" : "draco-nodejs",
|
|
2079
2082
|
module: "draco",
|
|
2080
2083
|
shapes: ["mesh"],
|
|
2081
2084
|
version: VERSION7,
|
|
@@ -2171,8 +2174,8 @@
|
|
|
2171
2174
|
}
|
|
2172
2175
|
select(...columnNames) {
|
|
2173
2176
|
const nameMap = Object.create(null);
|
|
2174
|
-
for (const
|
|
2175
|
-
nameMap[
|
|
2177
|
+
for (const name10 of columnNames) {
|
|
2178
|
+
nameMap[name10] = true;
|
|
2176
2179
|
}
|
|
2177
2180
|
const selectedFields = this.fields.filter((field) => nameMap[field.name]);
|
|
2178
2181
|
return new Schema(selectedFields, this.metadata);
|
|
@@ -2210,8 +2213,8 @@
|
|
|
2210
2213
|
var init_field = __esm({
|
|
2211
2214
|
"../schema/src/lib/schema/impl/field.ts"() {
|
|
2212
2215
|
Field = class {
|
|
2213
|
-
constructor(
|
|
2214
|
-
this.name =
|
|
2216
|
+
constructor(name10, type, nullable = false, metadata = new Map()) {
|
|
2217
|
+
this.name = name10;
|
|
2215
2218
|
this.type = type;
|
|
2216
2219
|
this.nullable = nullable;
|
|
2217
2220
|
this.metadata = metadata;
|
|
@@ -3134,11 +3137,11 @@
|
|
|
3134
3137
|
// src/lib/gltf-utils/gltf-attribute-utils.ts
|
|
3135
3138
|
function getGLTFAccessors(attributes) {
|
|
3136
3139
|
const accessors = {};
|
|
3137
|
-
for (const
|
|
3138
|
-
const attribute = attributes[
|
|
3139
|
-
if (
|
|
3140
|
+
for (const name10 in attributes) {
|
|
3141
|
+
const attribute = attributes[name10];
|
|
3142
|
+
if (name10 !== "indices") {
|
|
3140
3143
|
const glTFAccessor = getGLTFAccessor(attribute);
|
|
3141
|
-
accessors[
|
|
3144
|
+
accessors[name10] = glTFAccessor;
|
|
3142
3145
|
}
|
|
3143
3146
|
}
|
|
3144
3147
|
return accessors;
|
|
@@ -3301,14 +3304,1378 @@
|
|
|
3301
3304
|
}
|
|
3302
3305
|
});
|
|
3303
3306
|
|
|
3307
|
+
// ../../node_modules/@math.gl/core/dist/esm/lib/assert.js
|
|
3308
|
+
function assert5(condition, message) {
|
|
3309
|
+
if (!condition) {
|
|
3310
|
+
throw new Error("math.gl assertion ".concat(message));
|
|
3311
|
+
}
|
|
3312
|
+
}
|
|
3313
|
+
var init_assert5 = __esm({
|
|
3314
|
+
"../../node_modules/@math.gl/core/dist/esm/lib/assert.js"() {
|
|
3315
|
+
}
|
|
3316
|
+
});
|
|
3317
|
+
|
|
3318
|
+
// ../../node_modules/@math.gl/core/dist/esm/lib/common.js
|
|
3319
|
+
function round(value) {
|
|
3320
|
+
return Math.round(value / config.EPSILON) * config.EPSILON;
|
|
3321
|
+
}
|
|
3322
|
+
function formatValue(value, {
|
|
3323
|
+
precision = config.precision || 4
|
|
3324
|
+
} = {}) {
|
|
3325
|
+
value = round(value);
|
|
3326
|
+
return "".concat(parseFloat(value.toPrecision(precision)));
|
|
3327
|
+
}
|
|
3328
|
+
function isArray(value) {
|
|
3329
|
+
return Array.isArray(value) || ArrayBuffer.isView(value) && !(value instanceof DataView);
|
|
3330
|
+
}
|
|
3331
|
+
function equals(a2, b, epsilon) {
|
|
3332
|
+
const oldEpsilon = config.EPSILON;
|
|
3333
|
+
if (epsilon) {
|
|
3334
|
+
config.EPSILON = epsilon;
|
|
3335
|
+
}
|
|
3336
|
+
try {
|
|
3337
|
+
if (a2 === b) {
|
|
3338
|
+
return true;
|
|
3339
|
+
}
|
|
3340
|
+
if (isArray(a2) && isArray(b)) {
|
|
3341
|
+
if (a2.length !== b.length) {
|
|
3342
|
+
return false;
|
|
3343
|
+
}
|
|
3344
|
+
for (let i2 = 0; i2 < a2.length; ++i2) {
|
|
3345
|
+
if (!equals(a2[i2], b[i2])) {
|
|
3346
|
+
return false;
|
|
3347
|
+
}
|
|
3348
|
+
}
|
|
3349
|
+
return true;
|
|
3350
|
+
}
|
|
3351
|
+
if (a2 && a2.equals) {
|
|
3352
|
+
return a2.equals(b);
|
|
3353
|
+
}
|
|
3354
|
+
if (b && b.equals) {
|
|
3355
|
+
return b.equals(a2);
|
|
3356
|
+
}
|
|
3357
|
+
if (Number.isFinite(a2) && Number.isFinite(b)) {
|
|
3358
|
+
return Math.abs(a2 - b) <= config.EPSILON * Math.max(1, Math.abs(a2), Math.abs(b));
|
|
3359
|
+
}
|
|
3360
|
+
return false;
|
|
3361
|
+
} finally {
|
|
3362
|
+
config.EPSILON = oldEpsilon;
|
|
3363
|
+
}
|
|
3364
|
+
}
|
|
3365
|
+
var RADIANS_TO_DEGREES, DEGREES_TO_RADIANS, config;
|
|
3366
|
+
var init_common = __esm({
|
|
3367
|
+
"../../node_modules/@math.gl/core/dist/esm/lib/common.js"() {
|
|
3368
|
+
RADIANS_TO_DEGREES = 1 / Math.PI * 180;
|
|
3369
|
+
DEGREES_TO_RADIANS = 1 / 180 * Math.PI;
|
|
3370
|
+
config = {};
|
|
3371
|
+
config.EPSILON = 1e-12;
|
|
3372
|
+
config.debug = false;
|
|
3373
|
+
config.precision = 4;
|
|
3374
|
+
config.printTypes = false;
|
|
3375
|
+
config.printDegrees = false;
|
|
3376
|
+
config.printRowMajor = true;
|
|
3377
|
+
}
|
|
3378
|
+
});
|
|
3379
|
+
|
|
3380
|
+
// ../../node_modules/@math.gl/core/dist/esm/classes/base/math-array.js
|
|
3381
|
+
function _extendableBuiltin(cls) {
|
|
3382
|
+
function ExtendableBuiltin() {
|
|
3383
|
+
var instance = Reflect.construct(cls, Array.from(arguments));
|
|
3384
|
+
Object.setPrototypeOf(instance, Object.getPrototypeOf(this));
|
|
3385
|
+
return instance;
|
|
3386
|
+
}
|
|
3387
|
+
ExtendableBuiltin.prototype = Object.create(cls.prototype, {
|
|
3388
|
+
constructor: {
|
|
3389
|
+
value: cls,
|
|
3390
|
+
enumerable: false,
|
|
3391
|
+
writable: true,
|
|
3392
|
+
configurable: true
|
|
3393
|
+
}
|
|
3394
|
+
});
|
|
3395
|
+
if (Object.setPrototypeOf) {
|
|
3396
|
+
Object.setPrototypeOf(ExtendableBuiltin, cls);
|
|
3397
|
+
} else {
|
|
3398
|
+
ExtendableBuiltin.__proto__ = cls;
|
|
3399
|
+
}
|
|
3400
|
+
return ExtendableBuiltin;
|
|
3401
|
+
}
|
|
3402
|
+
var MathArray;
|
|
3403
|
+
var init_math_array = __esm({
|
|
3404
|
+
"../../node_modules/@math.gl/core/dist/esm/classes/base/math-array.js"() {
|
|
3405
|
+
init_common();
|
|
3406
|
+
init_assert5();
|
|
3407
|
+
MathArray = class extends _extendableBuiltin(Array) {
|
|
3408
|
+
get ELEMENTS() {
|
|
3409
|
+
assert5(false);
|
|
3410
|
+
return 0;
|
|
3411
|
+
}
|
|
3412
|
+
clone() {
|
|
3413
|
+
return new this.constructor().copy(this);
|
|
3414
|
+
}
|
|
3415
|
+
from(arrayOrObject) {
|
|
3416
|
+
return Array.isArray(arrayOrObject) ? this.copy(arrayOrObject) : this.fromObject(arrayOrObject);
|
|
3417
|
+
}
|
|
3418
|
+
fromArray(array, offset = 0) {
|
|
3419
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3420
|
+
this[i2] = array[i2 + offset];
|
|
3421
|
+
}
|
|
3422
|
+
return this.check();
|
|
3423
|
+
}
|
|
3424
|
+
to(arrayOrObject) {
|
|
3425
|
+
if (arrayOrObject === this) {
|
|
3426
|
+
return this;
|
|
3427
|
+
}
|
|
3428
|
+
return isArray(arrayOrObject) ? this.toArray(arrayOrObject) : this.toObject(arrayOrObject);
|
|
3429
|
+
}
|
|
3430
|
+
toTarget(target) {
|
|
3431
|
+
return target ? this.to(target) : this;
|
|
3432
|
+
}
|
|
3433
|
+
toArray(array = [], offset = 0) {
|
|
3434
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3435
|
+
array[offset + i2] = this[i2];
|
|
3436
|
+
}
|
|
3437
|
+
return array;
|
|
3438
|
+
}
|
|
3439
|
+
toFloat32Array() {
|
|
3440
|
+
return new Float32Array(this);
|
|
3441
|
+
}
|
|
3442
|
+
toString() {
|
|
3443
|
+
return this.formatString(config);
|
|
3444
|
+
}
|
|
3445
|
+
formatString(opts) {
|
|
3446
|
+
let string = "";
|
|
3447
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3448
|
+
string += (i2 > 0 ? ", " : "") + formatValue(this[i2], opts);
|
|
3449
|
+
}
|
|
3450
|
+
return "".concat(opts.printTypes ? this.constructor.name : "", "[").concat(string, "]");
|
|
3451
|
+
}
|
|
3452
|
+
equals(array) {
|
|
3453
|
+
if (!array || this.length !== array.length) {
|
|
3454
|
+
return false;
|
|
3455
|
+
}
|
|
3456
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3457
|
+
if (!equals(this[i2], array[i2])) {
|
|
3458
|
+
return false;
|
|
3459
|
+
}
|
|
3460
|
+
}
|
|
3461
|
+
return true;
|
|
3462
|
+
}
|
|
3463
|
+
exactEquals(array) {
|
|
3464
|
+
if (!array || this.length !== array.length) {
|
|
3465
|
+
return false;
|
|
3466
|
+
}
|
|
3467
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3468
|
+
if (this[i2] !== array[i2]) {
|
|
3469
|
+
return false;
|
|
3470
|
+
}
|
|
3471
|
+
}
|
|
3472
|
+
return true;
|
|
3473
|
+
}
|
|
3474
|
+
negate() {
|
|
3475
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3476
|
+
this[i2] = -this[i2];
|
|
3477
|
+
}
|
|
3478
|
+
return this.check();
|
|
3479
|
+
}
|
|
3480
|
+
lerp(a2, b, t2) {
|
|
3481
|
+
if (t2 === void 0) {
|
|
3482
|
+
t2 = b;
|
|
3483
|
+
b = a2;
|
|
3484
|
+
a2 = this;
|
|
3485
|
+
}
|
|
3486
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3487
|
+
const ai = a2[i2];
|
|
3488
|
+
this[i2] = ai + t2 * (b[i2] - ai);
|
|
3489
|
+
}
|
|
3490
|
+
return this.check();
|
|
3491
|
+
}
|
|
3492
|
+
min(vector) {
|
|
3493
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3494
|
+
this[i2] = Math.min(vector[i2], this[i2]);
|
|
3495
|
+
}
|
|
3496
|
+
return this.check();
|
|
3497
|
+
}
|
|
3498
|
+
max(vector) {
|
|
3499
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3500
|
+
this[i2] = Math.max(vector[i2], this[i2]);
|
|
3501
|
+
}
|
|
3502
|
+
return this.check();
|
|
3503
|
+
}
|
|
3504
|
+
clamp(minVector, maxVector) {
|
|
3505
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3506
|
+
this[i2] = Math.min(Math.max(this[i2], minVector[i2]), maxVector[i2]);
|
|
3507
|
+
}
|
|
3508
|
+
return this.check();
|
|
3509
|
+
}
|
|
3510
|
+
add(...vectors) {
|
|
3511
|
+
for (const vector of vectors) {
|
|
3512
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3513
|
+
this[i2] += vector[i2];
|
|
3514
|
+
}
|
|
3515
|
+
}
|
|
3516
|
+
return this.check();
|
|
3517
|
+
}
|
|
3518
|
+
subtract(...vectors) {
|
|
3519
|
+
for (const vector of vectors) {
|
|
3520
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3521
|
+
this[i2] -= vector[i2];
|
|
3522
|
+
}
|
|
3523
|
+
}
|
|
3524
|
+
return this.check();
|
|
3525
|
+
}
|
|
3526
|
+
scale(scale2) {
|
|
3527
|
+
if (Array.isArray(scale2)) {
|
|
3528
|
+
return this.multiply(scale2);
|
|
3529
|
+
}
|
|
3530
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3531
|
+
this[i2] *= scale2;
|
|
3532
|
+
}
|
|
3533
|
+
return this.check();
|
|
3534
|
+
}
|
|
3535
|
+
sub(a2) {
|
|
3536
|
+
return this.subtract(a2);
|
|
3537
|
+
}
|
|
3538
|
+
setScalar(a2) {
|
|
3539
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3540
|
+
this[i2] = a2;
|
|
3541
|
+
}
|
|
3542
|
+
return this.check();
|
|
3543
|
+
}
|
|
3544
|
+
addScalar(a2) {
|
|
3545
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3546
|
+
this[i2] += a2;
|
|
3547
|
+
}
|
|
3548
|
+
return this.check();
|
|
3549
|
+
}
|
|
3550
|
+
subScalar(a2) {
|
|
3551
|
+
return this.addScalar(-a2);
|
|
3552
|
+
}
|
|
3553
|
+
multiplyScalar(scalar) {
|
|
3554
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3555
|
+
this[i2] *= scalar;
|
|
3556
|
+
}
|
|
3557
|
+
return this.check();
|
|
3558
|
+
}
|
|
3559
|
+
divideScalar(a2) {
|
|
3560
|
+
return this.scale(1 / a2);
|
|
3561
|
+
}
|
|
3562
|
+
clampScalar(min, max) {
|
|
3563
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3564
|
+
this[i2] = Math.min(Math.max(this[i2], min), max);
|
|
3565
|
+
}
|
|
3566
|
+
return this.check();
|
|
3567
|
+
}
|
|
3568
|
+
multiplyByScalar(scalar) {
|
|
3569
|
+
return this.scale(scalar);
|
|
3570
|
+
}
|
|
3571
|
+
get elements() {
|
|
3572
|
+
return this;
|
|
3573
|
+
}
|
|
3574
|
+
check() {
|
|
3575
|
+
if (config.debug && !this.validate()) {
|
|
3576
|
+
throw new Error("math.gl: ".concat(this.constructor.name, " some fields set to invalid numbers'"));
|
|
3577
|
+
}
|
|
3578
|
+
return this;
|
|
3579
|
+
}
|
|
3580
|
+
validate() {
|
|
3581
|
+
let valid = this.length === this.ELEMENTS;
|
|
3582
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3583
|
+
valid = valid && Number.isFinite(this[i2]);
|
|
3584
|
+
}
|
|
3585
|
+
return valid;
|
|
3586
|
+
}
|
|
3587
|
+
};
|
|
3588
|
+
}
|
|
3589
|
+
});
|
|
3590
|
+
|
|
3591
|
+
// ../../node_modules/@math.gl/core/dist/esm/lib/validators.js
|
|
3592
|
+
function validateVector(v, length) {
|
|
3593
|
+
if (v.length !== length) {
|
|
3594
|
+
return false;
|
|
3595
|
+
}
|
|
3596
|
+
for (let i2 = 0; i2 < v.length; ++i2) {
|
|
3597
|
+
if (!Number.isFinite(v[i2])) {
|
|
3598
|
+
return false;
|
|
3599
|
+
}
|
|
3600
|
+
}
|
|
3601
|
+
return true;
|
|
3602
|
+
}
|
|
3603
|
+
function checkNumber(value) {
|
|
3604
|
+
if (!Number.isFinite(value)) {
|
|
3605
|
+
throw new Error("Invalid number ".concat(value));
|
|
3606
|
+
}
|
|
3607
|
+
return value;
|
|
3608
|
+
}
|
|
3609
|
+
function checkVector(v, length, callerName = "") {
|
|
3610
|
+
if (config.debug && !validateVector(v, length)) {
|
|
3611
|
+
throw new Error("math.gl: ".concat(callerName, " some fields set to invalid numbers'"));
|
|
3612
|
+
}
|
|
3613
|
+
return v;
|
|
3614
|
+
}
|
|
3615
|
+
function deprecated(method, version) {
|
|
3616
|
+
if (!map[method]) {
|
|
3617
|
+
map[method] = true;
|
|
3618
|
+
console.warn("".concat(method, " has been removed in version ").concat(version, ", see upgrade guide for more information"));
|
|
3619
|
+
}
|
|
3620
|
+
}
|
|
3621
|
+
var map;
|
|
3622
|
+
var init_validators = __esm({
|
|
3623
|
+
"../../node_modules/@math.gl/core/dist/esm/lib/validators.js"() {
|
|
3624
|
+
init_common();
|
|
3625
|
+
map = {};
|
|
3626
|
+
}
|
|
3627
|
+
});
|
|
3628
|
+
|
|
3629
|
+
// ../../node_modules/@math.gl/core/dist/esm/classes/base/vector.js
|
|
3630
|
+
var Vector;
|
|
3631
|
+
var init_vector = __esm({
|
|
3632
|
+
"../../node_modules/@math.gl/core/dist/esm/classes/base/vector.js"() {
|
|
3633
|
+
init_math_array();
|
|
3634
|
+
init_validators();
|
|
3635
|
+
init_assert5();
|
|
3636
|
+
Vector = class extends MathArray {
|
|
3637
|
+
get ELEMENTS() {
|
|
3638
|
+
assert5(false);
|
|
3639
|
+
return 0;
|
|
3640
|
+
}
|
|
3641
|
+
copy(vector) {
|
|
3642
|
+
assert5(false);
|
|
3643
|
+
return this;
|
|
3644
|
+
}
|
|
3645
|
+
get x() {
|
|
3646
|
+
return this[0];
|
|
3647
|
+
}
|
|
3648
|
+
set x(value) {
|
|
3649
|
+
this[0] = checkNumber(value);
|
|
3650
|
+
}
|
|
3651
|
+
get y() {
|
|
3652
|
+
return this[1];
|
|
3653
|
+
}
|
|
3654
|
+
set y(value) {
|
|
3655
|
+
this[1] = checkNumber(value);
|
|
3656
|
+
}
|
|
3657
|
+
len() {
|
|
3658
|
+
return Math.sqrt(this.lengthSquared());
|
|
3659
|
+
}
|
|
3660
|
+
magnitude() {
|
|
3661
|
+
return this.len();
|
|
3662
|
+
}
|
|
3663
|
+
lengthSquared() {
|
|
3664
|
+
let length = 0;
|
|
3665
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3666
|
+
length += this[i2] * this[i2];
|
|
3667
|
+
}
|
|
3668
|
+
return length;
|
|
3669
|
+
}
|
|
3670
|
+
magnitudeSquared() {
|
|
3671
|
+
return this.lengthSquared();
|
|
3672
|
+
}
|
|
3673
|
+
distance(mathArray) {
|
|
3674
|
+
return Math.sqrt(this.distanceSquared(mathArray));
|
|
3675
|
+
}
|
|
3676
|
+
distanceSquared(mathArray) {
|
|
3677
|
+
let length = 0;
|
|
3678
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3679
|
+
const dist = this[i2] - mathArray[i2];
|
|
3680
|
+
length += dist * dist;
|
|
3681
|
+
}
|
|
3682
|
+
return checkNumber(length);
|
|
3683
|
+
}
|
|
3684
|
+
dot(mathArray) {
|
|
3685
|
+
let product = 0;
|
|
3686
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3687
|
+
product += this[i2] * mathArray[i2];
|
|
3688
|
+
}
|
|
3689
|
+
return checkNumber(product);
|
|
3690
|
+
}
|
|
3691
|
+
normalize() {
|
|
3692
|
+
const length = this.magnitude();
|
|
3693
|
+
if (length !== 0) {
|
|
3694
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3695
|
+
this[i2] /= length;
|
|
3696
|
+
}
|
|
3697
|
+
}
|
|
3698
|
+
return this.check();
|
|
3699
|
+
}
|
|
3700
|
+
multiply(...vectors) {
|
|
3701
|
+
for (const vector of vectors) {
|
|
3702
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3703
|
+
this[i2] *= vector[i2];
|
|
3704
|
+
}
|
|
3705
|
+
}
|
|
3706
|
+
return this.check();
|
|
3707
|
+
}
|
|
3708
|
+
divide(...vectors) {
|
|
3709
|
+
for (const vector of vectors) {
|
|
3710
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3711
|
+
this[i2] /= vector[i2];
|
|
3712
|
+
}
|
|
3713
|
+
}
|
|
3714
|
+
return this.check();
|
|
3715
|
+
}
|
|
3716
|
+
lengthSq() {
|
|
3717
|
+
return this.lengthSquared();
|
|
3718
|
+
}
|
|
3719
|
+
distanceTo(vector) {
|
|
3720
|
+
return this.distance(vector);
|
|
3721
|
+
}
|
|
3722
|
+
distanceToSquared(vector) {
|
|
3723
|
+
return this.distanceSquared(vector);
|
|
3724
|
+
}
|
|
3725
|
+
getComponent(i2) {
|
|
3726
|
+
assert5(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
|
|
3727
|
+
return checkNumber(this[i2]);
|
|
3728
|
+
}
|
|
3729
|
+
setComponent(i2, value) {
|
|
3730
|
+
assert5(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
|
|
3731
|
+
this[i2] = value;
|
|
3732
|
+
return this.check();
|
|
3733
|
+
}
|
|
3734
|
+
addVectors(a2, b) {
|
|
3735
|
+
return this.copy(a2).add(b);
|
|
3736
|
+
}
|
|
3737
|
+
subVectors(a2, b) {
|
|
3738
|
+
return this.copy(a2).subtract(b);
|
|
3739
|
+
}
|
|
3740
|
+
multiplyVectors(a2, b) {
|
|
3741
|
+
return this.copy(a2).multiply(b);
|
|
3742
|
+
}
|
|
3743
|
+
addScaledVector(a2, b) {
|
|
3744
|
+
return this.add(new this.constructor(a2).multiplyScalar(b));
|
|
3745
|
+
}
|
|
3746
|
+
};
|
|
3747
|
+
}
|
|
3748
|
+
});
|
|
3749
|
+
|
|
3750
|
+
// ../../node_modules/gl-matrix/esm/common.js
|
|
3751
|
+
var ARRAY_TYPE, degree;
|
|
3752
|
+
var init_common2 = __esm({
|
|
3753
|
+
"../../node_modules/gl-matrix/esm/common.js"() {
|
|
3754
|
+
ARRAY_TYPE = typeof Float32Array !== "undefined" ? Float32Array : Array;
|
|
3755
|
+
degree = Math.PI / 180;
|
|
3756
|
+
if (!Math.hypot)
|
|
3757
|
+
Math.hypot = function() {
|
|
3758
|
+
var y = 0, i2 = arguments.length;
|
|
3759
|
+
while (i2--) {
|
|
3760
|
+
y += arguments[i2] * arguments[i2];
|
|
3761
|
+
}
|
|
3762
|
+
return Math.sqrt(y);
|
|
3763
|
+
};
|
|
3764
|
+
}
|
|
3765
|
+
});
|
|
3766
|
+
|
|
3767
|
+
// ../../node_modules/gl-matrix/esm/vec2.js
|
|
3768
|
+
function create() {
|
|
3769
|
+
var out = new ARRAY_TYPE(2);
|
|
3770
|
+
if (ARRAY_TYPE != Float32Array) {
|
|
3771
|
+
out[0] = 0;
|
|
3772
|
+
out[1] = 0;
|
|
3773
|
+
}
|
|
3774
|
+
return out;
|
|
3775
|
+
}
|
|
3776
|
+
function transformMat3(out, a2, m) {
|
|
3777
|
+
var x = a2[0], y = a2[1];
|
|
3778
|
+
out[0] = m[0] * x + m[3] * y + m[6];
|
|
3779
|
+
out[1] = m[1] * x + m[4] * y + m[7];
|
|
3780
|
+
return out;
|
|
3781
|
+
}
|
|
3782
|
+
var forEach;
|
|
3783
|
+
var init_vec2 = __esm({
|
|
3784
|
+
"../../node_modules/gl-matrix/esm/vec2.js"() {
|
|
3785
|
+
init_common2();
|
|
3786
|
+
forEach = function() {
|
|
3787
|
+
var vec = create();
|
|
3788
|
+
return function(a2, stride, offset, count, fn, arg) {
|
|
3789
|
+
var i2, l2;
|
|
3790
|
+
if (!stride) {
|
|
3791
|
+
stride = 2;
|
|
3792
|
+
}
|
|
3793
|
+
if (!offset) {
|
|
3794
|
+
offset = 0;
|
|
3795
|
+
}
|
|
3796
|
+
if (count) {
|
|
3797
|
+
l2 = Math.min(count * stride + offset, a2.length);
|
|
3798
|
+
} else {
|
|
3799
|
+
l2 = a2.length;
|
|
3800
|
+
}
|
|
3801
|
+
for (i2 = offset; i2 < l2; i2 += stride) {
|
|
3802
|
+
vec[0] = a2[i2];
|
|
3803
|
+
vec[1] = a2[i2 + 1];
|
|
3804
|
+
fn(vec, vec, arg);
|
|
3805
|
+
a2[i2] = vec[0];
|
|
3806
|
+
a2[i2 + 1] = vec[1];
|
|
3807
|
+
}
|
|
3808
|
+
return a2;
|
|
3809
|
+
};
|
|
3810
|
+
}();
|
|
3811
|
+
}
|
|
3812
|
+
});
|
|
3813
|
+
|
|
3814
|
+
// ../../node_modules/@math.gl/core/dist/esm/lib/gl-matrix-extras.js
|
|
3815
|
+
function vec3_transformMat4AsVector(out, a2, m) {
|
|
3816
|
+
const x = a2[0];
|
|
3817
|
+
const y = a2[1];
|
|
3818
|
+
const z = a2[2];
|
|
3819
|
+
const w = m[3] * x + m[7] * y + m[11] * z || 1;
|
|
3820
|
+
out[0] = (m[0] * x + m[4] * y + m[8] * z) / w;
|
|
3821
|
+
out[1] = (m[1] * x + m[5] * y + m[9] * z) / w;
|
|
3822
|
+
out[2] = (m[2] * x + m[6] * y + m[10] * z) / w;
|
|
3823
|
+
return out;
|
|
3824
|
+
}
|
|
3825
|
+
function vec3_transformMat2(out, a2, m) {
|
|
3826
|
+
const x = a2[0];
|
|
3827
|
+
const y = a2[1];
|
|
3828
|
+
out[0] = m[0] * x + m[2] * y;
|
|
3829
|
+
out[1] = m[1] * x + m[3] * y;
|
|
3830
|
+
out[2] = a2[2];
|
|
3831
|
+
return out;
|
|
3832
|
+
}
|
|
3833
|
+
function vec4_transformMat3(out, a2, m) {
|
|
3834
|
+
const x = a2[0];
|
|
3835
|
+
const y = a2[1];
|
|
3836
|
+
const z = a2[2];
|
|
3837
|
+
out[0] = m[0] * x + m[3] * y + m[6] * z;
|
|
3838
|
+
out[1] = m[1] * x + m[4] * y + m[7] * z;
|
|
3839
|
+
out[2] = m[2] * x + m[5] * y + m[8] * z;
|
|
3840
|
+
out[3] = a2[3];
|
|
3841
|
+
return out;
|
|
3842
|
+
}
|
|
3843
|
+
var init_gl_matrix_extras = __esm({
|
|
3844
|
+
"../../node_modules/@math.gl/core/dist/esm/lib/gl-matrix-extras.js"() {
|
|
3845
|
+
}
|
|
3846
|
+
});
|
|
3847
|
+
|
|
3848
|
+
// ../../node_modules/gl-matrix/esm/vec3.js
|
|
3849
|
+
function create2() {
|
|
3850
|
+
var out = new ARRAY_TYPE(3);
|
|
3851
|
+
if (ARRAY_TYPE != Float32Array) {
|
|
3852
|
+
out[0] = 0;
|
|
3853
|
+
out[1] = 0;
|
|
3854
|
+
out[2] = 0;
|
|
3855
|
+
}
|
|
3856
|
+
return out;
|
|
3857
|
+
}
|
|
3858
|
+
function dot(a2, b) {
|
|
3859
|
+
return a2[0] * b[0] + a2[1] * b[1] + a2[2] * b[2];
|
|
3860
|
+
}
|
|
3861
|
+
function cross(out, a2, b) {
|
|
3862
|
+
var ax = a2[0], ay = a2[1], az = a2[2];
|
|
3863
|
+
var bx = b[0], by = b[1], bz = b[2];
|
|
3864
|
+
out[0] = ay * bz - az * by;
|
|
3865
|
+
out[1] = az * bx - ax * bz;
|
|
3866
|
+
out[2] = ax * by - ay * bx;
|
|
3867
|
+
return out;
|
|
3868
|
+
}
|
|
3869
|
+
function transformMat4(out, a2, m) {
|
|
3870
|
+
var x = a2[0], y = a2[1], z = a2[2];
|
|
3871
|
+
var w = m[3] * x + m[7] * y + m[11] * z + m[15];
|
|
3872
|
+
w = w || 1;
|
|
3873
|
+
out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;
|
|
3874
|
+
out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;
|
|
3875
|
+
out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;
|
|
3876
|
+
return out;
|
|
3877
|
+
}
|
|
3878
|
+
function transformMat32(out, a2, m) {
|
|
3879
|
+
var x = a2[0], y = a2[1], z = a2[2];
|
|
3880
|
+
out[0] = x * m[0] + y * m[3] + z * m[6];
|
|
3881
|
+
out[1] = x * m[1] + y * m[4] + z * m[7];
|
|
3882
|
+
out[2] = x * m[2] + y * m[5] + z * m[8];
|
|
3883
|
+
return out;
|
|
3884
|
+
}
|
|
3885
|
+
function transformQuat(out, a2, q) {
|
|
3886
|
+
var qx = q[0], qy = q[1], qz = q[2], qw = q[3];
|
|
3887
|
+
var x = a2[0], y = a2[1], z = a2[2];
|
|
3888
|
+
var uvx = qy * z - qz * y, uvy = qz * x - qx * z, uvz = qx * y - qy * x;
|
|
3889
|
+
var uuvx = qy * uvz - qz * uvy, uuvy = qz * uvx - qx * uvz, uuvz = qx * uvy - qy * uvx;
|
|
3890
|
+
var w2 = qw * 2;
|
|
3891
|
+
uvx *= w2;
|
|
3892
|
+
uvy *= w2;
|
|
3893
|
+
uvz *= w2;
|
|
3894
|
+
uuvx *= 2;
|
|
3895
|
+
uuvy *= 2;
|
|
3896
|
+
uuvz *= 2;
|
|
3897
|
+
out[0] = x + uvx + uuvx;
|
|
3898
|
+
out[1] = y + uvy + uuvy;
|
|
3899
|
+
out[2] = z + uvz + uuvz;
|
|
3900
|
+
return out;
|
|
3901
|
+
}
|
|
3902
|
+
function rotateX(out, a2, b, rad) {
|
|
3903
|
+
var p2 = [], r2 = [];
|
|
3904
|
+
p2[0] = a2[0] - b[0];
|
|
3905
|
+
p2[1] = a2[1] - b[1];
|
|
3906
|
+
p2[2] = a2[2] - b[2];
|
|
3907
|
+
r2[0] = p2[0];
|
|
3908
|
+
r2[1] = p2[1] * Math.cos(rad) - p2[2] * Math.sin(rad);
|
|
3909
|
+
r2[2] = p2[1] * Math.sin(rad) + p2[2] * Math.cos(rad);
|
|
3910
|
+
out[0] = r2[0] + b[0];
|
|
3911
|
+
out[1] = r2[1] + b[1];
|
|
3912
|
+
out[2] = r2[2] + b[2];
|
|
3913
|
+
return out;
|
|
3914
|
+
}
|
|
3915
|
+
function rotateY(out, a2, b, rad) {
|
|
3916
|
+
var p2 = [], r2 = [];
|
|
3917
|
+
p2[0] = a2[0] - b[0];
|
|
3918
|
+
p2[1] = a2[1] - b[1];
|
|
3919
|
+
p2[2] = a2[2] - b[2];
|
|
3920
|
+
r2[0] = p2[2] * Math.sin(rad) + p2[0] * Math.cos(rad);
|
|
3921
|
+
r2[1] = p2[1];
|
|
3922
|
+
r2[2] = p2[2] * Math.cos(rad) - p2[0] * Math.sin(rad);
|
|
3923
|
+
out[0] = r2[0] + b[0];
|
|
3924
|
+
out[1] = r2[1] + b[1];
|
|
3925
|
+
out[2] = r2[2] + b[2];
|
|
3926
|
+
return out;
|
|
3927
|
+
}
|
|
3928
|
+
function rotateZ(out, a2, b, rad) {
|
|
3929
|
+
var p2 = [], r2 = [];
|
|
3930
|
+
p2[0] = a2[0] - b[0];
|
|
3931
|
+
p2[1] = a2[1] - b[1];
|
|
3932
|
+
p2[2] = a2[2] - b[2];
|
|
3933
|
+
r2[0] = p2[0] * Math.cos(rad) - p2[1] * Math.sin(rad);
|
|
3934
|
+
r2[1] = p2[0] * Math.sin(rad) + p2[1] * Math.cos(rad);
|
|
3935
|
+
r2[2] = p2[2];
|
|
3936
|
+
out[0] = r2[0] + b[0];
|
|
3937
|
+
out[1] = r2[1] + b[1];
|
|
3938
|
+
out[2] = r2[2] + b[2];
|
|
3939
|
+
return out;
|
|
3940
|
+
}
|
|
3941
|
+
function angle(a2, b) {
|
|
3942
|
+
var ax = a2[0], ay = a2[1], az = a2[2], bx = b[0], by = b[1], bz = b[2], mag1 = Math.sqrt(ax * ax + ay * ay + az * az), mag2 = Math.sqrt(bx * bx + by * by + bz * bz), mag = mag1 * mag2, cosine = mag && dot(a2, b) / mag;
|
|
3943
|
+
return Math.acos(Math.min(Math.max(cosine, -1), 1));
|
|
3944
|
+
}
|
|
3945
|
+
var forEach2;
|
|
3946
|
+
var init_vec3 = __esm({
|
|
3947
|
+
"../../node_modules/gl-matrix/esm/vec3.js"() {
|
|
3948
|
+
init_common2();
|
|
3949
|
+
forEach2 = function() {
|
|
3950
|
+
var vec = create2();
|
|
3951
|
+
return function(a2, stride, offset, count, fn, arg) {
|
|
3952
|
+
var i2, l2;
|
|
3953
|
+
if (!stride) {
|
|
3954
|
+
stride = 3;
|
|
3955
|
+
}
|
|
3956
|
+
if (!offset) {
|
|
3957
|
+
offset = 0;
|
|
3958
|
+
}
|
|
3959
|
+
if (count) {
|
|
3960
|
+
l2 = Math.min(count * stride + offset, a2.length);
|
|
3961
|
+
} else {
|
|
3962
|
+
l2 = a2.length;
|
|
3963
|
+
}
|
|
3964
|
+
for (i2 = offset; i2 < l2; i2 += stride) {
|
|
3965
|
+
vec[0] = a2[i2];
|
|
3966
|
+
vec[1] = a2[i2 + 1];
|
|
3967
|
+
vec[2] = a2[i2 + 2];
|
|
3968
|
+
fn(vec, vec, arg);
|
|
3969
|
+
a2[i2] = vec[0];
|
|
3970
|
+
a2[i2 + 1] = vec[1];
|
|
3971
|
+
a2[i2 + 2] = vec[2];
|
|
3972
|
+
}
|
|
3973
|
+
return a2;
|
|
3974
|
+
};
|
|
3975
|
+
}();
|
|
3976
|
+
}
|
|
3977
|
+
});
|
|
3978
|
+
|
|
3979
|
+
// ../../node_modules/@math.gl/core/dist/esm/classes/vector3.js
|
|
3980
|
+
var ORIGIN, constants, Vector3;
|
|
3981
|
+
var init_vector3 = __esm({
|
|
3982
|
+
"../../node_modules/@math.gl/core/dist/esm/classes/vector3.js"() {
|
|
3983
|
+
init_vector();
|
|
3984
|
+
init_common();
|
|
3985
|
+
init_validators();
|
|
3986
|
+
init_vec3();
|
|
3987
|
+
init_gl_matrix_extras();
|
|
3988
|
+
ORIGIN = [0, 0, 0];
|
|
3989
|
+
constants = {};
|
|
3990
|
+
Vector3 = class extends Vector {
|
|
3991
|
+
static get ZERO() {
|
|
3992
|
+
return constants.ZERO = constants.ZERO || Object.freeze(new Vector3(0, 0, 0, 0));
|
|
3993
|
+
}
|
|
3994
|
+
constructor(x = 0, y = 0, z = 0) {
|
|
3995
|
+
super(-0, -0, -0);
|
|
3996
|
+
if (arguments.length === 1 && isArray(x)) {
|
|
3997
|
+
this.copy(x);
|
|
3998
|
+
} else {
|
|
3999
|
+
if (config.debug) {
|
|
4000
|
+
checkNumber(x);
|
|
4001
|
+
checkNumber(y);
|
|
4002
|
+
checkNumber(z);
|
|
4003
|
+
}
|
|
4004
|
+
this[0] = x;
|
|
4005
|
+
this[1] = y;
|
|
4006
|
+
this[2] = z;
|
|
4007
|
+
}
|
|
4008
|
+
}
|
|
4009
|
+
set(x, y, z) {
|
|
4010
|
+
this[0] = x;
|
|
4011
|
+
this[1] = y;
|
|
4012
|
+
this[2] = z;
|
|
4013
|
+
return this.check();
|
|
4014
|
+
}
|
|
4015
|
+
copy(array) {
|
|
4016
|
+
this[0] = array[0];
|
|
4017
|
+
this[1] = array[1];
|
|
4018
|
+
this[2] = array[2];
|
|
4019
|
+
return this.check();
|
|
4020
|
+
}
|
|
4021
|
+
fromObject(object) {
|
|
4022
|
+
if (config.debug) {
|
|
4023
|
+
checkNumber(object.x);
|
|
4024
|
+
checkNumber(object.y);
|
|
4025
|
+
checkNumber(object.z);
|
|
4026
|
+
}
|
|
4027
|
+
this[0] = object.x;
|
|
4028
|
+
this[1] = object.y;
|
|
4029
|
+
this[2] = object.z;
|
|
4030
|
+
return this.check();
|
|
4031
|
+
}
|
|
4032
|
+
toObject(object) {
|
|
4033
|
+
object.x = this[0];
|
|
4034
|
+
object.y = this[1];
|
|
4035
|
+
object.z = this[2];
|
|
4036
|
+
return object;
|
|
4037
|
+
}
|
|
4038
|
+
get ELEMENTS() {
|
|
4039
|
+
return 3;
|
|
4040
|
+
}
|
|
4041
|
+
get z() {
|
|
4042
|
+
return this[2];
|
|
4043
|
+
}
|
|
4044
|
+
set z(value) {
|
|
4045
|
+
this[2] = checkNumber(value);
|
|
4046
|
+
}
|
|
4047
|
+
angle(vector) {
|
|
4048
|
+
return angle(this, vector);
|
|
4049
|
+
}
|
|
4050
|
+
cross(vector) {
|
|
4051
|
+
cross(this, this, vector);
|
|
4052
|
+
return this.check();
|
|
4053
|
+
}
|
|
4054
|
+
rotateX({
|
|
4055
|
+
radians,
|
|
4056
|
+
origin = ORIGIN
|
|
4057
|
+
}) {
|
|
4058
|
+
rotateX(this, this, origin, radians);
|
|
4059
|
+
return this.check();
|
|
4060
|
+
}
|
|
4061
|
+
rotateY({
|
|
4062
|
+
radians,
|
|
4063
|
+
origin = ORIGIN
|
|
4064
|
+
}) {
|
|
4065
|
+
rotateY(this, this, origin, radians);
|
|
4066
|
+
return this.check();
|
|
4067
|
+
}
|
|
4068
|
+
rotateZ({
|
|
4069
|
+
radians,
|
|
4070
|
+
origin = ORIGIN
|
|
4071
|
+
}) {
|
|
4072
|
+
rotateZ(this, this, origin, radians);
|
|
4073
|
+
return this.check();
|
|
4074
|
+
}
|
|
4075
|
+
transform(matrix4) {
|
|
4076
|
+
return this.transformAsPoint(matrix4);
|
|
4077
|
+
}
|
|
4078
|
+
transformAsPoint(matrix4) {
|
|
4079
|
+
transformMat4(this, this, matrix4);
|
|
4080
|
+
return this.check();
|
|
4081
|
+
}
|
|
4082
|
+
transformAsVector(matrix4) {
|
|
4083
|
+
vec3_transformMat4AsVector(this, this, matrix4);
|
|
4084
|
+
return this.check();
|
|
4085
|
+
}
|
|
4086
|
+
transformByMatrix3(matrix3) {
|
|
4087
|
+
transformMat32(this, this, matrix3);
|
|
4088
|
+
return this.check();
|
|
4089
|
+
}
|
|
4090
|
+
transformByMatrix2(matrix2) {
|
|
4091
|
+
vec3_transformMat2(this, this, matrix2);
|
|
4092
|
+
return this.check();
|
|
4093
|
+
}
|
|
4094
|
+
transformByQuaternion(quaternion) {
|
|
4095
|
+
transformQuat(this, this, quaternion);
|
|
4096
|
+
return this.check();
|
|
4097
|
+
}
|
|
4098
|
+
};
|
|
4099
|
+
}
|
|
4100
|
+
});
|
|
4101
|
+
|
|
4102
|
+
// ../../node_modules/@math.gl/core/dist/esm/classes/base/matrix.js
|
|
4103
|
+
var Matrix;
|
|
4104
|
+
var init_matrix = __esm({
|
|
4105
|
+
"../../node_modules/@math.gl/core/dist/esm/classes/base/matrix.js"() {
|
|
4106
|
+
init_math_array();
|
|
4107
|
+
init_validators();
|
|
4108
|
+
init_common();
|
|
4109
|
+
init_assert5();
|
|
4110
|
+
Matrix = class extends MathArray {
|
|
4111
|
+
get ELEMENTS() {
|
|
4112
|
+
assert5(false);
|
|
4113
|
+
return 0;
|
|
4114
|
+
}
|
|
4115
|
+
get RANK() {
|
|
4116
|
+
assert5(false);
|
|
4117
|
+
return 0;
|
|
4118
|
+
}
|
|
4119
|
+
toString() {
|
|
4120
|
+
let string = "[";
|
|
4121
|
+
if (config.printRowMajor) {
|
|
4122
|
+
string += "row-major:";
|
|
4123
|
+
for (let row = 0; row < this.RANK; ++row) {
|
|
4124
|
+
for (let col = 0; col < this.RANK; ++col) {
|
|
4125
|
+
string += " ".concat(this[col * this.RANK + row]);
|
|
4126
|
+
}
|
|
4127
|
+
}
|
|
4128
|
+
} else {
|
|
4129
|
+
string += "column-major:";
|
|
4130
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
4131
|
+
string += " ".concat(this[i2]);
|
|
4132
|
+
}
|
|
4133
|
+
}
|
|
4134
|
+
string += "]";
|
|
4135
|
+
return string;
|
|
4136
|
+
}
|
|
4137
|
+
getElementIndex(row, col) {
|
|
4138
|
+
return col * this.RANK + row;
|
|
4139
|
+
}
|
|
4140
|
+
getElement(row, col) {
|
|
4141
|
+
return this[col * this.RANK + row];
|
|
4142
|
+
}
|
|
4143
|
+
setElement(row, col, value) {
|
|
4144
|
+
this[col * this.RANK + row] = checkNumber(value);
|
|
4145
|
+
return this;
|
|
4146
|
+
}
|
|
4147
|
+
getColumn(columnIndex, result = new Array(this.RANK).fill(-0)) {
|
|
4148
|
+
const firstIndex = columnIndex * this.RANK;
|
|
4149
|
+
for (let i2 = 0; i2 < this.RANK; ++i2) {
|
|
4150
|
+
result[i2] = this[firstIndex + i2];
|
|
4151
|
+
}
|
|
4152
|
+
return result;
|
|
4153
|
+
}
|
|
4154
|
+
setColumn(columnIndex, columnVector) {
|
|
4155
|
+
const firstIndex = columnIndex * this.RANK;
|
|
4156
|
+
for (let i2 = 0; i2 < this.RANK; ++i2) {
|
|
4157
|
+
this[firstIndex + i2] = columnVector[i2];
|
|
4158
|
+
}
|
|
4159
|
+
return this;
|
|
4160
|
+
}
|
|
4161
|
+
};
|
|
4162
|
+
}
|
|
4163
|
+
});
|
|
4164
|
+
|
|
4165
|
+
// ../../node_modules/gl-matrix/esm/mat3.js
|
|
4166
|
+
function transpose(out, a2) {
|
|
4167
|
+
if (out === a2) {
|
|
4168
|
+
var a01 = a2[1], a02 = a2[2], a12 = a2[5];
|
|
4169
|
+
out[1] = a2[3];
|
|
4170
|
+
out[2] = a2[6];
|
|
4171
|
+
out[3] = a01;
|
|
4172
|
+
out[5] = a2[7];
|
|
4173
|
+
out[6] = a02;
|
|
4174
|
+
out[7] = a12;
|
|
4175
|
+
} else {
|
|
4176
|
+
out[0] = a2[0];
|
|
4177
|
+
out[1] = a2[3];
|
|
4178
|
+
out[2] = a2[6];
|
|
4179
|
+
out[3] = a2[1];
|
|
4180
|
+
out[4] = a2[4];
|
|
4181
|
+
out[5] = a2[7];
|
|
4182
|
+
out[6] = a2[2];
|
|
4183
|
+
out[7] = a2[5];
|
|
4184
|
+
out[8] = a2[8];
|
|
4185
|
+
}
|
|
4186
|
+
return out;
|
|
4187
|
+
}
|
|
4188
|
+
function invert(out, a2) {
|
|
4189
|
+
var a00 = a2[0], a01 = a2[1], a02 = a2[2];
|
|
4190
|
+
var a10 = a2[3], a11 = a2[4], a12 = a2[5];
|
|
4191
|
+
var a20 = a2[6], a21 = a2[7], a22 = a2[8];
|
|
4192
|
+
var b01 = a22 * a11 - a12 * a21;
|
|
4193
|
+
var b11 = -a22 * a10 + a12 * a20;
|
|
4194
|
+
var b21 = a21 * a10 - a11 * a20;
|
|
4195
|
+
var det = a00 * b01 + a01 * b11 + a02 * b21;
|
|
4196
|
+
if (!det) {
|
|
4197
|
+
return null;
|
|
4198
|
+
}
|
|
4199
|
+
det = 1 / det;
|
|
4200
|
+
out[0] = b01 * det;
|
|
4201
|
+
out[1] = (-a22 * a01 + a02 * a21) * det;
|
|
4202
|
+
out[2] = (a12 * a01 - a02 * a11) * det;
|
|
4203
|
+
out[3] = b11 * det;
|
|
4204
|
+
out[4] = (a22 * a00 - a02 * a20) * det;
|
|
4205
|
+
out[5] = (-a12 * a00 + a02 * a10) * det;
|
|
4206
|
+
out[6] = b21 * det;
|
|
4207
|
+
out[7] = (-a21 * a00 + a01 * a20) * det;
|
|
4208
|
+
out[8] = (a11 * a00 - a01 * a10) * det;
|
|
4209
|
+
return out;
|
|
4210
|
+
}
|
|
4211
|
+
function determinant(a2) {
|
|
4212
|
+
var a00 = a2[0], a01 = a2[1], a02 = a2[2];
|
|
4213
|
+
var a10 = a2[3], a11 = a2[4], a12 = a2[5];
|
|
4214
|
+
var a20 = a2[6], a21 = a2[7], a22 = a2[8];
|
|
4215
|
+
return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);
|
|
4216
|
+
}
|
|
4217
|
+
function multiply(out, a2, b) {
|
|
4218
|
+
var a00 = a2[0], a01 = a2[1], a02 = a2[2];
|
|
4219
|
+
var a10 = a2[3], a11 = a2[4], a12 = a2[5];
|
|
4220
|
+
var a20 = a2[6], a21 = a2[7], a22 = a2[8];
|
|
4221
|
+
var b00 = b[0], b01 = b[1], b02 = b[2];
|
|
4222
|
+
var b10 = b[3], b11 = b[4], b12 = b[5];
|
|
4223
|
+
var b20 = b[6], b21 = b[7], b22 = b[8];
|
|
4224
|
+
out[0] = b00 * a00 + b01 * a10 + b02 * a20;
|
|
4225
|
+
out[1] = b00 * a01 + b01 * a11 + b02 * a21;
|
|
4226
|
+
out[2] = b00 * a02 + b01 * a12 + b02 * a22;
|
|
4227
|
+
out[3] = b10 * a00 + b11 * a10 + b12 * a20;
|
|
4228
|
+
out[4] = b10 * a01 + b11 * a11 + b12 * a21;
|
|
4229
|
+
out[5] = b10 * a02 + b11 * a12 + b12 * a22;
|
|
4230
|
+
out[6] = b20 * a00 + b21 * a10 + b22 * a20;
|
|
4231
|
+
out[7] = b20 * a01 + b21 * a11 + b22 * a21;
|
|
4232
|
+
out[8] = b20 * a02 + b21 * a12 + b22 * a22;
|
|
4233
|
+
return out;
|
|
4234
|
+
}
|
|
4235
|
+
function translate(out, a2, v) {
|
|
4236
|
+
var a00 = a2[0], a01 = a2[1], a02 = a2[2], a10 = a2[3], a11 = a2[4], a12 = a2[5], a20 = a2[6], a21 = a2[7], a22 = a2[8], x = v[0], y = v[1];
|
|
4237
|
+
out[0] = a00;
|
|
4238
|
+
out[1] = a01;
|
|
4239
|
+
out[2] = a02;
|
|
4240
|
+
out[3] = a10;
|
|
4241
|
+
out[4] = a11;
|
|
4242
|
+
out[5] = a12;
|
|
4243
|
+
out[6] = x * a00 + y * a10 + a20;
|
|
4244
|
+
out[7] = x * a01 + y * a11 + a21;
|
|
4245
|
+
out[8] = x * a02 + y * a12 + a22;
|
|
4246
|
+
return out;
|
|
4247
|
+
}
|
|
4248
|
+
function rotate(out, a2, rad) {
|
|
4249
|
+
var a00 = a2[0], a01 = a2[1], a02 = a2[2], a10 = a2[3], a11 = a2[4], a12 = a2[5], a20 = a2[6], a21 = a2[7], a22 = a2[8], s2 = Math.sin(rad), c = Math.cos(rad);
|
|
4250
|
+
out[0] = c * a00 + s2 * a10;
|
|
4251
|
+
out[1] = c * a01 + s2 * a11;
|
|
4252
|
+
out[2] = c * a02 + s2 * a12;
|
|
4253
|
+
out[3] = c * a10 - s2 * a00;
|
|
4254
|
+
out[4] = c * a11 - s2 * a01;
|
|
4255
|
+
out[5] = c * a12 - s2 * a02;
|
|
4256
|
+
out[6] = a20;
|
|
4257
|
+
out[7] = a21;
|
|
4258
|
+
out[8] = a22;
|
|
4259
|
+
return out;
|
|
4260
|
+
}
|
|
4261
|
+
function scale(out, a2, v) {
|
|
4262
|
+
var x = v[0], y = v[1];
|
|
4263
|
+
out[0] = x * a2[0];
|
|
4264
|
+
out[1] = x * a2[1];
|
|
4265
|
+
out[2] = x * a2[2];
|
|
4266
|
+
out[3] = y * a2[3];
|
|
4267
|
+
out[4] = y * a2[4];
|
|
4268
|
+
out[5] = y * a2[5];
|
|
4269
|
+
out[6] = a2[6];
|
|
4270
|
+
out[7] = a2[7];
|
|
4271
|
+
out[8] = a2[8];
|
|
4272
|
+
return out;
|
|
4273
|
+
}
|
|
4274
|
+
function fromQuat(out, q) {
|
|
4275
|
+
var x = q[0], y = q[1], z = q[2], w = q[3];
|
|
4276
|
+
var x2 = x + x;
|
|
4277
|
+
var y2 = y + y;
|
|
4278
|
+
var z2 = z + z;
|
|
4279
|
+
var xx = x * x2;
|
|
4280
|
+
var yx = y * x2;
|
|
4281
|
+
var yy = y * y2;
|
|
4282
|
+
var zx = z * x2;
|
|
4283
|
+
var zy = z * y2;
|
|
4284
|
+
var zz = z * z2;
|
|
4285
|
+
var wx = w * x2;
|
|
4286
|
+
var wy = w * y2;
|
|
4287
|
+
var wz = w * z2;
|
|
4288
|
+
out[0] = 1 - yy - zz;
|
|
4289
|
+
out[3] = yx - wz;
|
|
4290
|
+
out[6] = zx + wy;
|
|
4291
|
+
out[1] = yx + wz;
|
|
4292
|
+
out[4] = 1 - xx - zz;
|
|
4293
|
+
out[7] = zy - wx;
|
|
4294
|
+
out[2] = zx - wy;
|
|
4295
|
+
out[5] = zy + wx;
|
|
4296
|
+
out[8] = 1 - xx - yy;
|
|
4297
|
+
return out;
|
|
4298
|
+
}
|
|
4299
|
+
var init_mat3 = __esm({
|
|
4300
|
+
"../../node_modules/gl-matrix/esm/mat3.js"() {
|
|
4301
|
+
}
|
|
4302
|
+
});
|
|
4303
|
+
|
|
4304
|
+
// ../../node_modules/@math.gl/core/dist/esm/classes/matrix3.js
|
|
4305
|
+
var IDENTITY, ZERO, INDICES, constants2, Matrix3;
|
|
4306
|
+
var init_matrix3 = __esm({
|
|
4307
|
+
"../../node_modules/@math.gl/core/dist/esm/classes/matrix3.js"() {
|
|
4308
|
+
init_matrix();
|
|
4309
|
+
init_validators();
|
|
4310
|
+
init_gl_matrix_extras();
|
|
4311
|
+
init_mat3();
|
|
4312
|
+
init_vec2();
|
|
4313
|
+
init_vec3();
|
|
4314
|
+
IDENTITY = Object.freeze([1, 0, 0, 0, 1, 0, 0, 0, 1]);
|
|
4315
|
+
ZERO = Object.freeze([0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
|
4316
|
+
INDICES = Object.freeze({
|
|
4317
|
+
COL0ROW0: 0,
|
|
4318
|
+
COL0ROW1: 1,
|
|
4319
|
+
COL0ROW2: 2,
|
|
4320
|
+
COL1ROW0: 3,
|
|
4321
|
+
COL1ROW1: 4,
|
|
4322
|
+
COL1ROW2: 5,
|
|
4323
|
+
COL2ROW0: 6,
|
|
4324
|
+
COL2ROW1: 7,
|
|
4325
|
+
COL2ROW2: 8
|
|
4326
|
+
});
|
|
4327
|
+
constants2 = {};
|
|
4328
|
+
Matrix3 = class extends Matrix {
|
|
4329
|
+
static get IDENTITY() {
|
|
4330
|
+
constants2.IDENTITY = constants2.IDENTITY || Object.freeze(new Matrix3(IDENTITY));
|
|
4331
|
+
return constants2.IDENTITY;
|
|
4332
|
+
}
|
|
4333
|
+
static get ZERO() {
|
|
4334
|
+
constants2.ZERO = constants2.ZERO || Object.freeze(new Matrix3(ZERO));
|
|
4335
|
+
return constants2.ZERO;
|
|
4336
|
+
}
|
|
4337
|
+
get ELEMENTS() {
|
|
4338
|
+
return 9;
|
|
4339
|
+
}
|
|
4340
|
+
get RANK() {
|
|
4341
|
+
return 3;
|
|
4342
|
+
}
|
|
4343
|
+
get INDICES() {
|
|
4344
|
+
return INDICES;
|
|
4345
|
+
}
|
|
4346
|
+
constructor(array) {
|
|
4347
|
+
super(-0, -0, -0, -0, -0, -0, -0, -0, -0);
|
|
4348
|
+
if (arguments.length === 1 && Array.isArray(array)) {
|
|
4349
|
+
this.copy(array);
|
|
4350
|
+
} else {
|
|
4351
|
+
this.identity();
|
|
4352
|
+
}
|
|
4353
|
+
}
|
|
4354
|
+
copy(array) {
|
|
4355
|
+
this[0] = array[0];
|
|
4356
|
+
this[1] = array[1];
|
|
4357
|
+
this[2] = array[2];
|
|
4358
|
+
this[3] = array[3];
|
|
4359
|
+
this[4] = array[4];
|
|
4360
|
+
this[5] = array[5];
|
|
4361
|
+
this[6] = array[6];
|
|
4362
|
+
this[7] = array[7];
|
|
4363
|
+
this[8] = array[8];
|
|
4364
|
+
return this.check();
|
|
4365
|
+
}
|
|
4366
|
+
set(m00, m10, m20, m01, m11, m21, m02, m12, m22) {
|
|
4367
|
+
this[0] = m00;
|
|
4368
|
+
this[1] = m10;
|
|
4369
|
+
this[2] = m20;
|
|
4370
|
+
this[3] = m01;
|
|
4371
|
+
this[4] = m11;
|
|
4372
|
+
this[5] = m21;
|
|
4373
|
+
this[6] = m02;
|
|
4374
|
+
this[7] = m12;
|
|
4375
|
+
this[8] = m22;
|
|
4376
|
+
return this.check();
|
|
4377
|
+
}
|
|
4378
|
+
setRowMajor(m00, m01, m02, m10, m11, m12, m20, m21, m22) {
|
|
4379
|
+
this[0] = m00;
|
|
4380
|
+
this[1] = m10;
|
|
4381
|
+
this[2] = m20;
|
|
4382
|
+
this[3] = m01;
|
|
4383
|
+
this[4] = m11;
|
|
4384
|
+
this[5] = m21;
|
|
4385
|
+
this[6] = m02;
|
|
4386
|
+
this[7] = m12;
|
|
4387
|
+
this[8] = m22;
|
|
4388
|
+
return this.check();
|
|
4389
|
+
}
|
|
4390
|
+
determinant() {
|
|
4391
|
+
return determinant(this);
|
|
4392
|
+
}
|
|
4393
|
+
identity() {
|
|
4394
|
+
return this.copy(IDENTITY);
|
|
4395
|
+
}
|
|
4396
|
+
fromQuaternion(q) {
|
|
4397
|
+
fromQuat(this, q);
|
|
4398
|
+
return this.check();
|
|
4399
|
+
}
|
|
4400
|
+
transpose() {
|
|
4401
|
+
transpose(this, this);
|
|
4402
|
+
return this.check();
|
|
4403
|
+
}
|
|
4404
|
+
invert() {
|
|
4405
|
+
invert(this, this);
|
|
4406
|
+
return this.check();
|
|
4407
|
+
}
|
|
4408
|
+
multiplyLeft(a2) {
|
|
4409
|
+
multiply(this, a2, this);
|
|
4410
|
+
return this.check();
|
|
4411
|
+
}
|
|
4412
|
+
multiplyRight(a2) {
|
|
4413
|
+
multiply(this, this, a2);
|
|
4414
|
+
return this.check();
|
|
4415
|
+
}
|
|
4416
|
+
rotate(radians) {
|
|
4417
|
+
rotate(this, this, radians);
|
|
4418
|
+
return this.check();
|
|
4419
|
+
}
|
|
4420
|
+
scale(factor) {
|
|
4421
|
+
if (Array.isArray(factor)) {
|
|
4422
|
+
scale(this, this, factor);
|
|
4423
|
+
} else {
|
|
4424
|
+
scale(this, this, [factor, factor, factor]);
|
|
4425
|
+
}
|
|
4426
|
+
return this.check();
|
|
4427
|
+
}
|
|
4428
|
+
translate(vec) {
|
|
4429
|
+
translate(this, this, vec);
|
|
4430
|
+
return this.check();
|
|
4431
|
+
}
|
|
4432
|
+
transform(vector, result) {
|
|
4433
|
+
switch (vector.length) {
|
|
4434
|
+
case 2:
|
|
4435
|
+
result = transformMat3(result || [-0, -0], vector, this);
|
|
4436
|
+
break;
|
|
4437
|
+
case 3:
|
|
4438
|
+
result = transformMat32(result || [-0, -0, -0], vector, this);
|
|
4439
|
+
break;
|
|
4440
|
+
case 4:
|
|
4441
|
+
result = vec4_transformMat3(result || [-0, -0, -0, -0], vector, this);
|
|
4442
|
+
break;
|
|
4443
|
+
default:
|
|
4444
|
+
throw new Error("Illegal vector");
|
|
4445
|
+
}
|
|
4446
|
+
checkVector(result, vector.length);
|
|
4447
|
+
return result;
|
|
4448
|
+
}
|
|
4449
|
+
transformVector(vector, result) {
|
|
4450
|
+
deprecated("Matrix3.transformVector");
|
|
4451
|
+
return this.transform(vector, result);
|
|
4452
|
+
}
|
|
4453
|
+
transformVector2(vector, result) {
|
|
4454
|
+
deprecated("Matrix3.transformVector");
|
|
4455
|
+
return this.transform(vector, result);
|
|
4456
|
+
}
|
|
4457
|
+
transformVector3(vector, result) {
|
|
4458
|
+
deprecated("Matrix3.transformVector");
|
|
4459
|
+
return this.transform(vector, result);
|
|
4460
|
+
}
|
|
4461
|
+
};
|
|
4462
|
+
}
|
|
4463
|
+
});
|
|
4464
|
+
|
|
4465
|
+
// ../../node_modules/@math.gl/core/dist/esm/index.js
|
|
4466
|
+
var globals3, global_3;
|
|
4467
|
+
var init_esm = __esm({
|
|
4468
|
+
"../../node_modules/@math.gl/core/dist/esm/index.js"() {
|
|
4469
|
+
init_common();
|
|
4470
|
+
init_vector3();
|
|
4471
|
+
init_matrix3();
|
|
4472
|
+
globals3 = {
|
|
4473
|
+
self: typeof self !== "undefined" && self,
|
|
4474
|
+
window: typeof window !== "undefined" && window,
|
|
4475
|
+
global: typeof global !== "undefined" && global
|
|
4476
|
+
};
|
|
4477
|
+
global_3 = globals3.global || globals3.self || globals3.window;
|
|
4478
|
+
global_3.mathgl = {
|
|
4479
|
+
config
|
|
4480
|
+
};
|
|
4481
|
+
}
|
|
4482
|
+
});
|
|
4483
|
+
|
|
4484
|
+
// src/lib/gltf-utils/gltf-constants.ts
|
|
4485
|
+
var COMPONENTS, BYTES;
|
|
4486
|
+
var init_gltf_constants = __esm({
|
|
4487
|
+
"src/lib/gltf-utils/gltf-constants.ts"() {
|
|
4488
|
+
COMPONENTS = {
|
|
4489
|
+
SCALAR: 1,
|
|
4490
|
+
VEC2: 2,
|
|
4491
|
+
VEC3: 3,
|
|
4492
|
+
VEC4: 4,
|
|
4493
|
+
MAT2: 4,
|
|
4494
|
+
MAT3: 9,
|
|
4495
|
+
MAT4: 16
|
|
4496
|
+
};
|
|
4497
|
+
BYTES = {
|
|
4498
|
+
5120: 1,
|
|
4499
|
+
5121: 1,
|
|
4500
|
+
5122: 2,
|
|
4501
|
+
5123: 2,
|
|
4502
|
+
5125: 4,
|
|
4503
|
+
5126: 4
|
|
4504
|
+
};
|
|
4505
|
+
}
|
|
4506
|
+
});
|
|
4507
|
+
|
|
4508
|
+
// src/lib/extensions/KHR_texture_transform.ts
|
|
4509
|
+
var KHR_texture_transform_exports = {};
|
|
4510
|
+
__export(KHR_texture_transform_exports, {
|
|
4511
|
+
decode: () => decode4,
|
|
4512
|
+
name: () => name5
|
|
4513
|
+
});
|
|
4514
|
+
async function decode4(gltfData, options) {
|
|
4515
|
+
const gltfScenegraph = new GLTFScenegraph(gltfData);
|
|
4516
|
+
const extension = gltfScenegraph.getExtension(EXT_MESHOPT_TRANSFORM);
|
|
4517
|
+
if (!extension) {
|
|
4518
|
+
return;
|
|
4519
|
+
}
|
|
4520
|
+
const materials = gltfData.json.materials || [];
|
|
4521
|
+
for (let i2 = 0; i2 < materials.length; i2++) {
|
|
4522
|
+
transformTexCoords(i2, gltfData);
|
|
4523
|
+
}
|
|
4524
|
+
}
|
|
4525
|
+
function transformTexCoords(materialIndex, gltfData) {
|
|
4526
|
+
const processedTexCoords = [];
|
|
4527
|
+
const material = gltfData.json.materials?.[materialIndex];
|
|
4528
|
+
const baseColorTexture = material?.pbrMetallicRoughness?.baseColorTexture;
|
|
4529
|
+
if (baseColorTexture) {
|
|
4530
|
+
transformPrimitives(gltfData, materialIndex, baseColorTexture, processedTexCoords);
|
|
4531
|
+
}
|
|
4532
|
+
const emisiveTexture = material?.emissiveTexture;
|
|
4533
|
+
if (emisiveTexture) {
|
|
4534
|
+
transformPrimitives(gltfData, materialIndex, emisiveTexture, processedTexCoords);
|
|
4535
|
+
}
|
|
4536
|
+
const normalTexture = material?.normalTexture;
|
|
4537
|
+
if (normalTexture) {
|
|
4538
|
+
transformPrimitives(gltfData, materialIndex, normalTexture, processedTexCoords);
|
|
4539
|
+
}
|
|
4540
|
+
const occlusionTexture = material?.occlusionTexture;
|
|
4541
|
+
if (occlusionTexture) {
|
|
4542
|
+
transformPrimitives(gltfData, materialIndex, occlusionTexture, processedTexCoords);
|
|
4543
|
+
}
|
|
4544
|
+
const metallicRoughnessTexture = material?.pbrMetallicRoughness?.metallicRoughnessTexture;
|
|
4545
|
+
if (metallicRoughnessTexture) {
|
|
4546
|
+
transformPrimitives(gltfData, materialIndex, metallicRoughnessTexture, processedTexCoords);
|
|
4547
|
+
}
|
|
4548
|
+
}
|
|
4549
|
+
function transformPrimitives(gltfData, materialIndex, texture, processedTexCoords) {
|
|
4550
|
+
const transformParameters = getTransformParameters(texture, processedTexCoords);
|
|
4551
|
+
if (!transformParameters) {
|
|
4552
|
+
return;
|
|
4553
|
+
}
|
|
4554
|
+
const meshes = gltfData.json.meshes || [];
|
|
4555
|
+
for (const mesh of meshes) {
|
|
4556
|
+
for (const primitive of mesh.primitives) {
|
|
4557
|
+
const material = primitive.material;
|
|
4558
|
+
if (Number.isFinite(material) && materialIndex === material) {
|
|
4559
|
+
transformPrimitive(gltfData, primitive, transformParameters);
|
|
4560
|
+
}
|
|
4561
|
+
}
|
|
4562
|
+
}
|
|
4563
|
+
}
|
|
4564
|
+
function getTransformParameters(texture, processedTexCoords) {
|
|
4565
|
+
const textureInfo = texture.extensions?.[EXT_MESHOPT_TRANSFORM];
|
|
4566
|
+
const { texCoord: originalTexCoord = 0 } = texture;
|
|
4567
|
+
const { texCoord = originalTexCoord } = textureInfo;
|
|
4568
|
+
const isProcessed = processedTexCoords.findIndex(([original, newTexCoord]) => original === originalTexCoord && newTexCoord === texCoord) !== -1;
|
|
4569
|
+
if (!isProcessed) {
|
|
4570
|
+
const matrix = makeTransformationMatrix(textureInfo);
|
|
4571
|
+
if (originalTexCoord !== texCoord) {
|
|
4572
|
+
texture.texCoord = texCoord;
|
|
4573
|
+
}
|
|
4574
|
+
processedTexCoords.push([originalTexCoord, texCoord]);
|
|
4575
|
+
return { originalTexCoord, texCoord, matrix };
|
|
4576
|
+
}
|
|
4577
|
+
return null;
|
|
4578
|
+
}
|
|
4579
|
+
function transformPrimitive(gltfData, primitive, transformParameters) {
|
|
4580
|
+
const { originalTexCoord, texCoord, matrix } = transformParameters;
|
|
4581
|
+
const texCoordAccessor = primitive.attributes[`TEXCOORD_${originalTexCoord}`];
|
|
4582
|
+
if (Number.isFinite(texCoordAccessor)) {
|
|
4583
|
+
const accessor = gltfData.json.accessors?.[texCoordAccessor];
|
|
4584
|
+
if (accessor && accessor.bufferView) {
|
|
4585
|
+
const bufferView = gltfData.json.bufferViews?.[accessor.bufferView];
|
|
4586
|
+
if (bufferView) {
|
|
4587
|
+
const { arrayBuffer, byteOffset: bufferByteOffset } = gltfData.buffers[bufferView.buffer];
|
|
4588
|
+
const byteOffset = (bufferByteOffset || 0) + (accessor.byteOffset || 0) + (bufferView.byteOffset || 0);
|
|
4589
|
+
const { ArrayType, length } = getAccessorArrayTypeAndLength(accessor, bufferView);
|
|
4590
|
+
const bytes = BYTES[accessor.componentType];
|
|
4591
|
+
const components = COMPONENTS[accessor.type];
|
|
4592
|
+
const elementAddressScale = bufferView.byteStride || bytes * components;
|
|
4593
|
+
const result = new Float32Array(length);
|
|
4594
|
+
for (let i2 = 0; i2 < accessor.count; i2++) {
|
|
4595
|
+
const uv = new ArrayType(arrayBuffer, byteOffset + i2 * elementAddressScale, 2);
|
|
4596
|
+
scratchVector.set(uv[0], uv[1], 1);
|
|
4597
|
+
scratchVector.transformByMatrix3(matrix);
|
|
4598
|
+
result.set([scratchVector[0], scratchVector[1]], i2 * components);
|
|
4599
|
+
}
|
|
4600
|
+
if (originalTexCoord === texCoord) {
|
|
4601
|
+
updateGltf(accessor, bufferView, gltfData.buffers, result);
|
|
4602
|
+
} else {
|
|
4603
|
+
createAttribute(texCoord, accessor, primitive, gltfData, result);
|
|
4604
|
+
}
|
|
4605
|
+
}
|
|
4606
|
+
}
|
|
4607
|
+
}
|
|
4608
|
+
}
|
|
4609
|
+
function updateGltf(accessor, bufferView, buffers, newTexCoordArray) {
|
|
4610
|
+
accessor.componentType = 5126;
|
|
4611
|
+
buffers.push({
|
|
4612
|
+
arrayBuffer: newTexCoordArray.buffer,
|
|
4613
|
+
byteOffset: 0,
|
|
4614
|
+
byteLength: newTexCoordArray.buffer.byteLength
|
|
4615
|
+
});
|
|
4616
|
+
bufferView.buffer = buffers.length - 1;
|
|
4617
|
+
bufferView.byteLength = newTexCoordArray.buffer.byteLength;
|
|
4618
|
+
bufferView.byteOffset = 0;
|
|
4619
|
+
delete bufferView.byteStride;
|
|
4620
|
+
}
|
|
4621
|
+
function createAttribute(newTexCoord, originalAccessor, primitive, gltfData, newTexCoordArray) {
|
|
4622
|
+
gltfData.buffers.push({
|
|
4623
|
+
arrayBuffer: newTexCoordArray.buffer,
|
|
4624
|
+
byteOffset: 0,
|
|
4625
|
+
byteLength: newTexCoordArray.buffer.byteLength
|
|
4626
|
+
});
|
|
4627
|
+
const bufferViews = gltfData.json.bufferViews;
|
|
4628
|
+
if (!bufferViews) {
|
|
4629
|
+
return;
|
|
4630
|
+
}
|
|
4631
|
+
bufferViews.push({
|
|
4632
|
+
buffer: gltfData.buffers.length - 1,
|
|
4633
|
+
byteLength: newTexCoordArray.buffer.byteLength,
|
|
4634
|
+
byteOffset: 0
|
|
4635
|
+
});
|
|
4636
|
+
const accessors = gltfData.json.accessors;
|
|
4637
|
+
if (!accessors) {
|
|
4638
|
+
return;
|
|
4639
|
+
}
|
|
4640
|
+
accessors.push({
|
|
4641
|
+
bufferView: bufferViews?.length - 1,
|
|
4642
|
+
byteOffset: 0,
|
|
4643
|
+
componentType: 5126,
|
|
4644
|
+
count: originalAccessor.count,
|
|
4645
|
+
type: "VEC2"
|
|
4646
|
+
});
|
|
4647
|
+
primitive.attributes[`TEXCOORD_${newTexCoord}`] = accessors.length - 1;
|
|
4648
|
+
}
|
|
4649
|
+
function makeTransformationMatrix(extensionData) {
|
|
4650
|
+
const { offset = [0, 0], rotation = 0, scale: scale2 = [1, 1] } = extensionData;
|
|
4651
|
+
const translationMatirx = new Matrix3().set(1, 0, 0, 0, 1, 0, offset[0], offset[1], 1);
|
|
4652
|
+
const rotationMatirx = scratchRotationMatrix.set(Math.cos(rotation), Math.sin(rotation), 0, -Math.sin(rotation), Math.cos(rotation), 0, 0, 0, 1);
|
|
4653
|
+
const scaleMatrix = scratchScaleMatrix.set(scale2[0], 0, 0, 0, scale2[1], 0, 0, 0, 1);
|
|
4654
|
+
return translationMatirx.multiplyRight(rotationMatirx).multiplyRight(scaleMatrix);
|
|
4655
|
+
}
|
|
4656
|
+
var EXT_MESHOPT_TRANSFORM, name5, scratchVector, scratchRotationMatrix, scratchScaleMatrix;
|
|
4657
|
+
var init_KHR_texture_transform = __esm({
|
|
4658
|
+
"src/lib/extensions/KHR_texture_transform.ts"() {
|
|
4659
|
+
init_esm();
|
|
4660
|
+
init_gltf_utils();
|
|
4661
|
+
init_gltf_constants();
|
|
4662
|
+
init_gltf_scenegraph();
|
|
4663
|
+
EXT_MESHOPT_TRANSFORM = "KHR_texture_transform";
|
|
4664
|
+
name5 = EXT_MESHOPT_TRANSFORM;
|
|
4665
|
+
scratchVector = new Vector3();
|
|
4666
|
+
scratchRotationMatrix = new Matrix3();
|
|
4667
|
+
scratchScaleMatrix = new Matrix3();
|
|
4668
|
+
}
|
|
4669
|
+
});
|
|
4670
|
+
|
|
3304
4671
|
// src/lib/extensions/deprecated/KHR_lights_punctual.ts
|
|
3305
4672
|
var KHR_lights_punctual_exports = {};
|
|
3306
4673
|
__export(KHR_lights_punctual_exports, {
|
|
3307
|
-
decode: () =>
|
|
4674
|
+
decode: () => decode5,
|
|
3308
4675
|
encode: () => encode2,
|
|
3309
|
-
name: () =>
|
|
4676
|
+
name: () => name6
|
|
3310
4677
|
});
|
|
3311
|
-
async function
|
|
4678
|
+
async function decode5(gltfData) {
|
|
3312
4679
|
const gltfScenegraph = new GLTFScenegraph(gltfData);
|
|
3313
4680
|
const { json } = gltfScenegraph;
|
|
3314
4681
|
const extension = gltfScenegraph.getExtension(KHR_LIGHTS_PUNCTUAL);
|
|
@@ -3341,24 +4708,24 @@
|
|
|
3341
4708
|
delete gltfScenegraph.json.lights;
|
|
3342
4709
|
}
|
|
3343
4710
|
}
|
|
3344
|
-
var KHR_LIGHTS_PUNCTUAL,
|
|
4711
|
+
var KHR_LIGHTS_PUNCTUAL, name6;
|
|
3345
4712
|
var init_KHR_lights_punctual = __esm({
|
|
3346
4713
|
"src/lib/extensions/deprecated/KHR_lights_punctual.ts"() {
|
|
3347
4714
|
init_assert3();
|
|
3348
4715
|
init_gltf_scenegraph();
|
|
3349
4716
|
KHR_LIGHTS_PUNCTUAL = "KHR_lights_punctual";
|
|
3350
|
-
|
|
4717
|
+
name6 = KHR_LIGHTS_PUNCTUAL;
|
|
3351
4718
|
}
|
|
3352
4719
|
});
|
|
3353
4720
|
|
|
3354
4721
|
// src/lib/extensions/deprecated/KHR_materials_unlit.ts
|
|
3355
4722
|
var KHR_materials_unlit_exports = {};
|
|
3356
4723
|
__export(KHR_materials_unlit_exports, {
|
|
3357
|
-
decode: () =>
|
|
4724
|
+
decode: () => decode6,
|
|
3358
4725
|
encode: () => encode3,
|
|
3359
|
-
name: () =>
|
|
4726
|
+
name: () => name7
|
|
3360
4727
|
});
|
|
3361
|
-
async function
|
|
4728
|
+
async function decode6(gltfData) {
|
|
3362
4729
|
const gltfScenegraph = new GLTFScenegraph(gltfData);
|
|
3363
4730
|
const { json } = gltfScenegraph;
|
|
3364
4731
|
gltfScenegraph.removeExtension(KHR_MATERIALS_UNLIT);
|
|
@@ -3383,23 +4750,23 @@
|
|
|
3383
4750
|
}
|
|
3384
4751
|
}
|
|
3385
4752
|
}
|
|
3386
|
-
var KHR_MATERIALS_UNLIT,
|
|
4753
|
+
var KHR_MATERIALS_UNLIT, name7;
|
|
3387
4754
|
var init_KHR_materials_unlit = __esm({
|
|
3388
4755
|
"src/lib/extensions/deprecated/KHR_materials_unlit.ts"() {
|
|
3389
4756
|
init_gltf_scenegraph();
|
|
3390
4757
|
KHR_MATERIALS_UNLIT = "KHR_materials_unlit";
|
|
3391
|
-
|
|
4758
|
+
name7 = KHR_MATERIALS_UNLIT;
|
|
3392
4759
|
}
|
|
3393
4760
|
});
|
|
3394
4761
|
|
|
3395
4762
|
// src/lib/extensions/deprecated/KHR_techniques_webgl.ts
|
|
3396
4763
|
var KHR_techniques_webgl_exports = {};
|
|
3397
4764
|
__export(KHR_techniques_webgl_exports, {
|
|
3398
|
-
decode: () =>
|
|
4765
|
+
decode: () => decode7,
|
|
3399
4766
|
encode: () => encode4,
|
|
3400
|
-
name: () =>
|
|
4767
|
+
name: () => name8
|
|
3401
4768
|
});
|
|
3402
|
-
async function
|
|
4769
|
+
async function decode7(gltfData) {
|
|
3403
4770
|
const gltfScenegraph = new GLTFScenegraph(gltfData);
|
|
3404
4771
|
const { json } = gltfScenegraph;
|
|
3405
4772
|
const extension = gltfScenegraph.getExtension(KHR_TECHNIQUES_WEBGL);
|
|
@@ -3451,12 +4818,97 @@
|
|
|
3451
4818
|
});
|
|
3452
4819
|
return values;
|
|
3453
4820
|
}
|
|
3454
|
-
var KHR_TECHNIQUES_WEBGL,
|
|
4821
|
+
var KHR_TECHNIQUES_WEBGL, name8;
|
|
3455
4822
|
var init_KHR_techniques_webgl = __esm({
|
|
3456
4823
|
"src/lib/extensions/deprecated/KHR_techniques_webgl.ts"() {
|
|
3457
4824
|
init_gltf_scenegraph();
|
|
3458
4825
|
KHR_TECHNIQUES_WEBGL = "KHR_techniques_webgl";
|
|
3459
|
-
|
|
4826
|
+
name8 = KHR_TECHNIQUES_WEBGL;
|
|
4827
|
+
}
|
|
4828
|
+
});
|
|
4829
|
+
|
|
4830
|
+
// src/lib/extensions/deprecated/EXT_feature_metadata.ts
|
|
4831
|
+
var EXT_feature_metadata_exports = {};
|
|
4832
|
+
__export(EXT_feature_metadata_exports, {
|
|
4833
|
+
decode: () => decode8,
|
|
4834
|
+
name: () => name9
|
|
4835
|
+
});
|
|
4836
|
+
async function decode8(gltfData) {
|
|
4837
|
+
const scenegraph = new GLTFScenegraph(gltfData);
|
|
4838
|
+
decodeExtFeatureMetadata(scenegraph);
|
|
4839
|
+
}
|
|
4840
|
+
function decodeExtFeatureMetadata(scenegraph) {
|
|
4841
|
+
const extension = scenegraph.getExtension(EXT_FEATURE_METADATA);
|
|
4842
|
+
const schemaClasses = extension?.schema?.classes;
|
|
4843
|
+
const featureTables = extension?.featureTables;
|
|
4844
|
+
const featureTextures = extension?.featureTextures;
|
|
4845
|
+
if (featureTextures) {
|
|
4846
|
+
console.warn('featureTextures is not yet supported in the "EXT_feature_metadata" extension.');
|
|
4847
|
+
}
|
|
4848
|
+
if (schemaClasses && featureTables) {
|
|
4849
|
+
for (const schemaName in schemaClasses) {
|
|
4850
|
+
const schemaClass = schemaClasses[schemaName];
|
|
4851
|
+
const featureTable = findFeatureTableByName(featureTables, schemaName);
|
|
4852
|
+
if (featureTable) {
|
|
4853
|
+
handleFeatureTableProperties(scenegraph, featureTable, schemaClass);
|
|
4854
|
+
}
|
|
4855
|
+
}
|
|
4856
|
+
}
|
|
4857
|
+
}
|
|
4858
|
+
function handleFeatureTableProperties(scenegraph, featureTable, schemaClass) {
|
|
4859
|
+
for (const propertyName in schemaClass.properties) {
|
|
4860
|
+
const schemaProperty = schemaClass.properties[propertyName];
|
|
4861
|
+
const featureTableProperty = featureTable?.properties?.[propertyName];
|
|
4862
|
+
const numberOfFeatures = featureTable.count;
|
|
4863
|
+
if (featureTableProperty) {
|
|
4864
|
+
const data = getPropertyDataFromBinarySource(scenegraph, schemaProperty, numberOfFeatures, featureTableProperty);
|
|
4865
|
+
featureTableProperty.data = data;
|
|
4866
|
+
}
|
|
4867
|
+
}
|
|
4868
|
+
}
|
|
4869
|
+
function getPropertyDataFromBinarySource(scenegraph, schemaProperty, numberOfFeatures, featureTableProperty) {
|
|
4870
|
+
const bufferView = featureTableProperty.bufferView;
|
|
4871
|
+
let data = scenegraph.getTypedArrayForBufferView(bufferView);
|
|
4872
|
+
switch (schemaProperty.type) {
|
|
4873
|
+
case "STRING": {
|
|
4874
|
+
const stringOffsetBufferView = featureTableProperty.stringOffsetBufferView;
|
|
4875
|
+
const offsetsData = scenegraph.getTypedArrayForBufferView(stringOffsetBufferView);
|
|
4876
|
+
data = getStringAttributes(data, offsetsData, numberOfFeatures);
|
|
4877
|
+
break;
|
|
4878
|
+
}
|
|
4879
|
+
default:
|
|
4880
|
+
}
|
|
4881
|
+
return data;
|
|
4882
|
+
}
|
|
4883
|
+
function findFeatureTableByName(featureTables, schemaClassName) {
|
|
4884
|
+
for (const featureTableName in featureTables) {
|
|
4885
|
+
const featureTable = featureTables[featureTableName];
|
|
4886
|
+
if (featureTable.class === schemaClassName) {
|
|
4887
|
+
return featureTable;
|
|
4888
|
+
}
|
|
4889
|
+
}
|
|
4890
|
+
return null;
|
|
4891
|
+
}
|
|
4892
|
+
function getStringAttributes(data, offsetsData, stringsCount) {
|
|
4893
|
+
const stringsArray = [];
|
|
4894
|
+
const textDecoder = new TextDecoder("utf8");
|
|
4895
|
+
let stringOffset = 0;
|
|
4896
|
+
const bytesPerStringSize = 4;
|
|
4897
|
+
for (let index = 0; index < stringsCount; index++) {
|
|
4898
|
+
const stringByteSize = offsetsData[(index + 1) * bytesPerStringSize] - offsetsData[index * bytesPerStringSize];
|
|
4899
|
+
const stringData = data.subarray(stringOffset, stringByteSize + stringOffset);
|
|
4900
|
+
const stringAttribute = textDecoder.decode(stringData);
|
|
4901
|
+
stringsArray.push(stringAttribute);
|
|
4902
|
+
stringOffset += stringByteSize;
|
|
4903
|
+
}
|
|
4904
|
+
return stringsArray;
|
|
4905
|
+
}
|
|
4906
|
+
var EXT_FEATURE_METADATA, name9;
|
|
4907
|
+
var init_EXT_feature_metadata = __esm({
|
|
4908
|
+
"src/lib/extensions/deprecated/EXT_feature_metadata.ts"() {
|
|
4909
|
+
init_gltf_scenegraph();
|
|
4910
|
+
EXT_FEATURE_METADATA = "EXT_feature_metadata";
|
|
4911
|
+
name9 = EXT_FEATURE_METADATA;
|
|
3460
4912
|
}
|
|
3461
4913
|
});
|
|
3462
4914
|
|
|
@@ -3485,9 +4937,11 @@
|
|
|
3485
4937
|
init_EXT_texture_webp();
|
|
3486
4938
|
init_KHR_texture_basisu();
|
|
3487
4939
|
init_KHR_draco_mesh_compression();
|
|
4940
|
+
init_KHR_texture_transform();
|
|
3488
4941
|
init_KHR_lights_punctual();
|
|
3489
4942
|
init_KHR_materials_unlit();
|
|
3490
4943
|
init_KHR_techniques_webgl();
|
|
4944
|
+
init_EXT_feature_metadata();
|
|
3491
4945
|
EXTENSIONS2 = [
|
|
3492
4946
|
EXT_meshopt_compression_exports,
|
|
3493
4947
|
EXT_texture_webp_exports,
|
|
@@ -3495,7 +4949,9 @@
|
|
|
3495
4949
|
KHR_draco_mesh_compression_exports,
|
|
3496
4950
|
KHR_lights_punctual_exports,
|
|
3497
4951
|
KHR_materials_unlit_exports,
|
|
3498
|
-
KHR_techniques_webgl_exports
|
|
4952
|
+
KHR_techniques_webgl_exports,
|
|
4953
|
+
KHR_texture_transform_exports,
|
|
4954
|
+
EXT_feature_metadata_exports
|
|
3499
4955
|
];
|
|
3500
4956
|
}
|
|
3501
4957
|
});
|
|
@@ -3726,20 +5182,20 @@
|
|
|
3726
5182
|
|
|
3727
5183
|
// src/lib/api/post-process-gltf.ts
|
|
3728
5184
|
function getBytesFromComponentType(componentType) {
|
|
3729
|
-
return
|
|
5185
|
+
return BYTES2[componentType];
|
|
3730
5186
|
}
|
|
3731
5187
|
function getSizeFromAccessorType(type) {
|
|
3732
|
-
return
|
|
5188
|
+
return COMPONENTS2[type];
|
|
3733
5189
|
}
|
|
3734
5190
|
function postProcessGLTF(gltf, options) {
|
|
3735
5191
|
return new GLTFPostProcessor().postProcess(gltf, options);
|
|
3736
5192
|
}
|
|
3737
|
-
var
|
|
5193
|
+
var COMPONENTS2, BYTES2, GL_SAMPLER, SAMPLER_PARAMETER_GLTF_TO_GL, DEFAULT_SAMPLER, GLTFPostProcessor;
|
|
3738
5194
|
var init_post_process_gltf = __esm({
|
|
3739
5195
|
"src/lib/api/post-process-gltf.ts"() {
|
|
3740
5196
|
init_assert3();
|
|
3741
5197
|
init_gltf_utils();
|
|
3742
|
-
|
|
5198
|
+
COMPONENTS2 = {
|
|
3743
5199
|
SCALAR: 1,
|
|
3744
5200
|
VEC2: 2,
|
|
3745
5201
|
VEC3: 3,
|
|
@@ -3748,7 +5204,7 @@
|
|
|
3748
5204
|
MAT3: 9,
|
|
3749
5205
|
MAT4: 16
|
|
3750
5206
|
};
|
|
3751
|
-
|
|
5207
|
+
BYTES2 = {
|
|
3752
5208
|
5120: 1,
|
|
3753
5209
|
5121: 1,
|
|
3754
5210
|
5122: 2,
|