@luma.gl/engine 10.0.0-alpha.1 → 10.0.0-alpha.2
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.dev.js +70 -232
- package/dist/dist.min.js +23 -23
- package/package.json +6 -6
package/dist/dist.dev.js
CHANGED
|
@@ -1117,10 +1117,6 @@ var __exports__ = (() => {
|
|
|
1117
1117
|
toTarget(target) {
|
|
1118
1118
|
return target ? this.to(target) : this;
|
|
1119
1119
|
}
|
|
1120
|
-
/** @deprecated */
|
|
1121
|
-
toFloat32Array() {
|
|
1122
|
-
return new Float32Array(this);
|
|
1123
|
-
}
|
|
1124
1120
|
toString() {
|
|
1125
1121
|
return this.formatString(config);
|
|
1126
1122
|
}
|
|
@@ -1247,51 +1243,6 @@ var __exports__ = (() => {
|
|
|
1247
1243
|
}
|
|
1248
1244
|
return valid;
|
|
1249
1245
|
}
|
|
1250
|
-
// three.js compatibility
|
|
1251
|
-
/** @deprecated */
|
|
1252
|
-
sub(a) {
|
|
1253
|
-
return this.subtract(a);
|
|
1254
|
-
}
|
|
1255
|
-
/** @deprecated */
|
|
1256
|
-
setScalar(a) {
|
|
1257
|
-
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
1258
|
-
this[i] = a;
|
|
1259
|
-
}
|
|
1260
|
-
return this.check();
|
|
1261
|
-
}
|
|
1262
|
-
/** @deprecated */
|
|
1263
|
-
addScalar(a) {
|
|
1264
|
-
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
1265
|
-
this[i] += a;
|
|
1266
|
-
}
|
|
1267
|
-
return this.check();
|
|
1268
|
-
}
|
|
1269
|
-
/** @deprecated */
|
|
1270
|
-
subScalar(a) {
|
|
1271
|
-
return this.addScalar(-a);
|
|
1272
|
-
}
|
|
1273
|
-
/** @deprecated */
|
|
1274
|
-
multiplyScalar(scalar) {
|
|
1275
|
-
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
1276
|
-
this[i] *= scalar;
|
|
1277
|
-
}
|
|
1278
|
-
return this.check();
|
|
1279
|
-
}
|
|
1280
|
-
/** @deprecated */
|
|
1281
|
-
divideScalar(a) {
|
|
1282
|
-
return this.multiplyByScalar(1 / a);
|
|
1283
|
-
}
|
|
1284
|
-
/** @deprecated */
|
|
1285
|
-
clampScalar(min, max) {
|
|
1286
|
-
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
1287
|
-
this[i] = Math.min(Math.max(this[i], min), max);
|
|
1288
|
-
}
|
|
1289
|
-
return this.check();
|
|
1290
|
-
}
|
|
1291
|
-
/** @deprecated */
|
|
1292
|
-
get elements() {
|
|
1293
|
-
return this;
|
|
1294
|
-
}
|
|
1295
1246
|
};
|
|
1296
1247
|
|
|
1297
1248
|
// ../../node_modules/@math.gl/core/dist/lib/validators.js
|
|
@@ -1319,6 +1270,64 @@ var __exports__ = (() => {
|
|
|
1319
1270
|
return v;
|
|
1320
1271
|
}
|
|
1321
1272
|
|
|
1273
|
+
// ../../node_modules/@math.gl/core/dist/classes/base/matrix.js
|
|
1274
|
+
var Matrix = class extends MathArray {
|
|
1275
|
+
// fromObject(object) {
|
|
1276
|
+
// const array = object.elements;
|
|
1277
|
+
// return this.fromRowMajor(array);
|
|
1278
|
+
// }
|
|
1279
|
+
// toObject(object) {
|
|
1280
|
+
// const array = object.elements;
|
|
1281
|
+
// this.toRowMajor(array);
|
|
1282
|
+
// return object;
|
|
1283
|
+
// }
|
|
1284
|
+
// TODO better override formatString?
|
|
1285
|
+
toString() {
|
|
1286
|
+
let string = "[";
|
|
1287
|
+
if (config.printRowMajor) {
|
|
1288
|
+
string += "row-major:";
|
|
1289
|
+
for (let row = 0; row < this.RANK; ++row) {
|
|
1290
|
+
for (let col = 0; col < this.RANK; ++col) {
|
|
1291
|
+
string += ` ${this[col * this.RANK + row]}`;
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
} else {
|
|
1295
|
+
string += "column-major:";
|
|
1296
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
1297
|
+
string += ` ${this[i]}`;
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
string += "]";
|
|
1301
|
+
return string;
|
|
1302
|
+
}
|
|
1303
|
+
getElementIndex(row, col) {
|
|
1304
|
+
return col * this.RANK + row;
|
|
1305
|
+
}
|
|
1306
|
+
// By default assumes row major indices
|
|
1307
|
+
getElement(row, col) {
|
|
1308
|
+
return this[col * this.RANK + row];
|
|
1309
|
+
}
|
|
1310
|
+
// By default assumes row major indices
|
|
1311
|
+
setElement(row, col, value) {
|
|
1312
|
+
this[col * this.RANK + row] = checkNumber(value);
|
|
1313
|
+
return this;
|
|
1314
|
+
}
|
|
1315
|
+
getColumn(columnIndex, result = new Array(this.RANK).fill(-0)) {
|
|
1316
|
+
const firstIndex = columnIndex * this.RANK;
|
|
1317
|
+
for (let i = 0; i < this.RANK; ++i) {
|
|
1318
|
+
result[i] = this[firstIndex + i];
|
|
1319
|
+
}
|
|
1320
|
+
return result;
|
|
1321
|
+
}
|
|
1322
|
+
setColumn(columnIndex, columnVector) {
|
|
1323
|
+
const firstIndex = columnIndex * this.RANK;
|
|
1324
|
+
for (let i = 0; i < this.RANK; ++i) {
|
|
1325
|
+
this[firstIndex + i] = columnVector[i];
|
|
1326
|
+
}
|
|
1327
|
+
return this;
|
|
1328
|
+
}
|
|
1329
|
+
};
|
|
1330
|
+
|
|
1322
1331
|
// ../../node_modules/@math.gl/core/dist/lib/assert.js
|
|
1323
1332
|
function assert(condition, message) {
|
|
1324
1333
|
if (!condition) {
|
|
@@ -1445,24 +1454,18 @@ var __exports__ = (() => {
|
|
|
1445
1454
|
return this.copy(a).multiply(b);
|
|
1446
1455
|
}
|
|
1447
1456
|
addScaledVector(a, b) {
|
|
1448
|
-
|
|
1457
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
1458
|
+
this[i] += a[i] * b;
|
|
1459
|
+
}
|
|
1460
|
+
return this.check();
|
|
1449
1461
|
}
|
|
1450
1462
|
};
|
|
1451
1463
|
|
|
1452
1464
|
// ../../node_modules/@math.gl/core/dist/gl-matrix/common.js
|
|
1453
1465
|
var EPSILON = 1e-6;
|
|
1454
|
-
var ARRAY_TYPE = typeof Float32Array !== "undefined" ? Float32Array : Array;
|
|
1455
1466
|
var degree = Math.PI / 180;
|
|
1456
1467
|
|
|
1457
1468
|
// ../../node_modules/@math.gl/core/dist/gl-matrix/vec2.js
|
|
1458
|
-
function create() {
|
|
1459
|
-
const out = new ARRAY_TYPE(2);
|
|
1460
|
-
if (ARRAY_TYPE != Float32Array) {
|
|
1461
|
-
out[0] = 0;
|
|
1462
|
-
out[1] = 0;
|
|
1463
|
-
}
|
|
1464
|
-
return out;
|
|
1465
|
-
}
|
|
1466
1469
|
function transformMat4(out, a, m) {
|
|
1467
1470
|
const x = a[0];
|
|
1468
1471
|
const y = a[1];
|
|
@@ -1470,32 +1473,6 @@ var __exports__ = (() => {
|
|
|
1470
1473
|
out[1] = m[1] * x + m[5] * y + m[13];
|
|
1471
1474
|
return out;
|
|
1472
1475
|
}
|
|
1473
|
-
var forEach = (function() {
|
|
1474
|
-
const vec = create();
|
|
1475
|
-
return function(a, stride, offset, count, fn, arg) {
|
|
1476
|
-
let i;
|
|
1477
|
-
let l;
|
|
1478
|
-
if (!stride) {
|
|
1479
|
-
stride = 2;
|
|
1480
|
-
}
|
|
1481
|
-
if (!offset) {
|
|
1482
|
-
offset = 0;
|
|
1483
|
-
}
|
|
1484
|
-
if (count) {
|
|
1485
|
-
l = Math.min(count * stride + offset, a.length);
|
|
1486
|
-
} else {
|
|
1487
|
-
l = a.length;
|
|
1488
|
-
}
|
|
1489
|
-
for (i = offset; i < l; i += stride) {
|
|
1490
|
-
vec[0] = a[i];
|
|
1491
|
-
vec[1] = a[i + 1];
|
|
1492
|
-
fn(vec, vec, arg);
|
|
1493
|
-
a[i] = vec[0];
|
|
1494
|
-
a[i + 1] = vec[1];
|
|
1495
|
-
}
|
|
1496
|
-
return a;
|
|
1497
|
-
};
|
|
1498
|
-
})();
|
|
1499
1476
|
|
|
1500
1477
|
// ../../node_modules/@math.gl/core/dist/lib/gl-matrix-extras.js
|
|
1501
1478
|
function vec2_transformMat4AsVector(out, a, m) {
|
|
@@ -1526,15 +1503,6 @@ var __exports__ = (() => {
|
|
|
1526
1503
|
}
|
|
1527
1504
|
|
|
1528
1505
|
// ../../node_modules/@math.gl/core/dist/gl-matrix/vec3.js
|
|
1529
|
-
function create2() {
|
|
1530
|
-
const out = new ARRAY_TYPE(3);
|
|
1531
|
-
if (ARRAY_TYPE != Float32Array) {
|
|
1532
|
-
out[0] = 0;
|
|
1533
|
-
out[1] = 0;
|
|
1534
|
-
out[2] = 0;
|
|
1535
|
-
}
|
|
1536
|
-
return out;
|
|
1537
|
-
}
|
|
1538
1506
|
function dot(a, b) {
|
|
1539
1507
|
return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
|
|
1540
1508
|
}
|
|
@@ -1649,34 +1617,6 @@ var __exports__ = (() => {
|
|
|
1649
1617
|
const cosine = mag && dot(a, b) / mag;
|
|
1650
1618
|
return Math.acos(Math.min(Math.max(cosine, -1), 1));
|
|
1651
1619
|
}
|
|
1652
|
-
var forEach2 = (function() {
|
|
1653
|
-
const vec = create2();
|
|
1654
|
-
return function(a, stride, offset, count, fn, arg) {
|
|
1655
|
-
let i;
|
|
1656
|
-
let l;
|
|
1657
|
-
if (!stride) {
|
|
1658
|
-
stride = 3;
|
|
1659
|
-
}
|
|
1660
|
-
if (!offset) {
|
|
1661
|
-
offset = 0;
|
|
1662
|
-
}
|
|
1663
|
-
if (count) {
|
|
1664
|
-
l = Math.min(count * stride + offset, a.length);
|
|
1665
|
-
} else {
|
|
1666
|
-
l = a.length;
|
|
1667
|
-
}
|
|
1668
|
-
for (i = offset; i < l; i += stride) {
|
|
1669
|
-
vec[0] = a[i];
|
|
1670
|
-
vec[1] = a[i + 1];
|
|
1671
|
-
vec[2] = a[i + 2];
|
|
1672
|
-
fn(vec, vec, arg);
|
|
1673
|
-
a[i] = vec[0];
|
|
1674
|
-
a[i + 1] = vec[1];
|
|
1675
|
-
a[i + 2] = vec[2];
|
|
1676
|
-
}
|
|
1677
|
-
return a;
|
|
1678
|
-
};
|
|
1679
|
-
})();
|
|
1680
1620
|
|
|
1681
1621
|
// ../../node_modules/@math.gl/core/dist/classes/vector3.js
|
|
1682
1622
|
var ORIGIN = [0, 0, 0];
|
|
@@ -1799,64 +1739,6 @@ var __exports__ = (() => {
|
|
|
1799
1739
|
}
|
|
1800
1740
|
};
|
|
1801
1741
|
|
|
1802
|
-
// ../../node_modules/@math.gl/core/dist/classes/base/matrix.js
|
|
1803
|
-
var Matrix = class extends MathArray {
|
|
1804
|
-
// fromObject(object) {
|
|
1805
|
-
// const array = object.elements;
|
|
1806
|
-
// return this.fromRowMajor(array);
|
|
1807
|
-
// }
|
|
1808
|
-
// toObject(object) {
|
|
1809
|
-
// const array = object.elements;
|
|
1810
|
-
// this.toRowMajor(array);
|
|
1811
|
-
// return object;
|
|
1812
|
-
// }
|
|
1813
|
-
// TODO better override formatString?
|
|
1814
|
-
toString() {
|
|
1815
|
-
let string = "[";
|
|
1816
|
-
if (config.printRowMajor) {
|
|
1817
|
-
string += "row-major:";
|
|
1818
|
-
for (let row = 0; row < this.RANK; ++row) {
|
|
1819
|
-
for (let col = 0; col < this.RANK; ++col) {
|
|
1820
|
-
string += ` ${this[col * this.RANK + row]}`;
|
|
1821
|
-
}
|
|
1822
|
-
}
|
|
1823
|
-
} else {
|
|
1824
|
-
string += "column-major:";
|
|
1825
|
-
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
1826
|
-
string += ` ${this[i]}`;
|
|
1827
|
-
}
|
|
1828
|
-
}
|
|
1829
|
-
string += "]";
|
|
1830
|
-
return string;
|
|
1831
|
-
}
|
|
1832
|
-
getElementIndex(row, col) {
|
|
1833
|
-
return col * this.RANK + row;
|
|
1834
|
-
}
|
|
1835
|
-
// By default assumes row major indices
|
|
1836
|
-
getElement(row, col) {
|
|
1837
|
-
return this[col * this.RANK + row];
|
|
1838
|
-
}
|
|
1839
|
-
// By default assumes row major indices
|
|
1840
|
-
setElement(row, col, value) {
|
|
1841
|
-
this[col * this.RANK + row] = checkNumber(value);
|
|
1842
|
-
return this;
|
|
1843
|
-
}
|
|
1844
|
-
getColumn(columnIndex, result = new Array(this.RANK).fill(-0)) {
|
|
1845
|
-
const firstIndex = columnIndex * this.RANK;
|
|
1846
|
-
for (let i = 0; i < this.RANK; ++i) {
|
|
1847
|
-
result[i] = this[firstIndex + i];
|
|
1848
|
-
}
|
|
1849
|
-
return result;
|
|
1850
|
-
}
|
|
1851
|
-
setColumn(columnIndex, columnVector) {
|
|
1852
|
-
const firstIndex = columnIndex * this.RANK;
|
|
1853
|
-
for (let i = 0; i < this.RANK; ++i) {
|
|
1854
|
-
this[firstIndex + i] = columnVector[i];
|
|
1855
|
-
}
|
|
1856
|
-
return this;
|
|
1857
|
-
}
|
|
1858
|
-
};
|
|
1859
|
-
|
|
1860
1742
|
// ../../node_modules/@math.gl/core/dist/gl-matrix/mat4.js
|
|
1861
1743
|
function identity(out) {
|
|
1862
1744
|
out[0] = 1;
|
|
@@ -2482,16 +2364,6 @@ var __exports__ = (() => {
|
|
|
2482
2364
|
}
|
|
2483
2365
|
|
|
2484
2366
|
// ../../node_modules/@math.gl/core/dist/gl-matrix/vec4.js
|
|
2485
|
-
function create3() {
|
|
2486
|
-
const out = new ARRAY_TYPE(4);
|
|
2487
|
-
if (ARRAY_TYPE != Float32Array) {
|
|
2488
|
-
out[0] = 0;
|
|
2489
|
-
out[1] = 0;
|
|
2490
|
-
out[2] = 0;
|
|
2491
|
-
out[3] = 0;
|
|
2492
|
-
}
|
|
2493
|
-
return out;
|
|
2494
|
-
}
|
|
2495
2367
|
function transformMat43(out, a, m) {
|
|
2496
2368
|
const x = a[0];
|
|
2497
2369
|
const y = a[1];
|
|
@@ -2503,36 +2375,6 @@ var __exports__ = (() => {
|
|
|
2503
2375
|
out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;
|
|
2504
2376
|
return out;
|
|
2505
2377
|
}
|
|
2506
|
-
var forEach3 = (function() {
|
|
2507
|
-
const vec = create3();
|
|
2508
|
-
return function(a, stride, offset, count, fn, arg) {
|
|
2509
|
-
let i;
|
|
2510
|
-
let l;
|
|
2511
|
-
if (!stride) {
|
|
2512
|
-
stride = 4;
|
|
2513
|
-
}
|
|
2514
|
-
if (!offset) {
|
|
2515
|
-
offset = 0;
|
|
2516
|
-
}
|
|
2517
|
-
if (count) {
|
|
2518
|
-
l = Math.min(count * stride + offset, a.length);
|
|
2519
|
-
} else {
|
|
2520
|
-
l = a.length;
|
|
2521
|
-
}
|
|
2522
|
-
for (i = offset; i < l; i += stride) {
|
|
2523
|
-
vec[0] = a[i];
|
|
2524
|
-
vec[1] = a[i + 1];
|
|
2525
|
-
vec[2] = a[i + 2];
|
|
2526
|
-
vec[3] = a[i + 3];
|
|
2527
|
-
fn(vec, vec, arg);
|
|
2528
|
-
a[i] = vec[0];
|
|
2529
|
-
a[i + 1] = vec[1];
|
|
2530
|
-
a[i + 2] = vec[2];
|
|
2531
|
-
a[i + 3] = vec[3];
|
|
2532
|
-
}
|
|
2533
|
-
return a;
|
|
2534
|
-
};
|
|
2535
|
-
})();
|
|
2536
2378
|
|
|
2537
2379
|
// ../../node_modules/@math.gl/core/dist/classes/matrix4.js
|
|
2538
2380
|
var INDICES;
|
|
@@ -2685,6 +2527,14 @@ var __exports__ = (() => {
|
|
|
2685
2527
|
fromQuat(this, quaternion);
|
|
2686
2528
|
return this.check();
|
|
2687
2529
|
}
|
|
2530
|
+
/**
|
|
2531
|
+
* Sets this matrix from a 3x3 matrix, with zero translation.
|
|
2532
|
+
* @param matrix3 - 3x3 matrix in column-major order.
|
|
2533
|
+
* @returns This matrix.
|
|
2534
|
+
*/
|
|
2535
|
+
fromMatrix3(matrix3) {
|
|
2536
|
+
return this.set(matrix3[0], matrix3[1], matrix3[2], 0, matrix3[3], matrix3[4], matrix3[5], 0, matrix3[6], matrix3[7], matrix3[8], 0, 0, 0, 0, 1);
|
|
2537
|
+
}
|
|
2688
2538
|
/**
|
|
2689
2539
|
* Generates a frustum matrix with the given bounds
|
|
2690
2540
|
* @param view.left - Left bound of the frustum
|
|
@@ -2985,18 +2835,6 @@ var __exports__ = (() => {
|
|
|
2985
2835
|
checkVector(out, vector.length);
|
|
2986
2836
|
return out;
|
|
2987
2837
|
}
|
|
2988
|
-
/** @deprecated */
|
|
2989
|
-
transformPoint(vector, result) {
|
|
2990
|
-
return this.transformAsPoint(vector, result);
|
|
2991
|
-
}
|
|
2992
|
-
/** @deprecated */
|
|
2993
|
-
transformVector(vector, result) {
|
|
2994
|
-
return this.transformAsPoint(vector, result);
|
|
2995
|
-
}
|
|
2996
|
-
/** @deprecated */
|
|
2997
|
-
transformDirection(vector, result) {
|
|
2998
|
-
return this.transformAsVector(vector, result);
|
|
2999
|
-
}
|
|
3000
2838
|
// three.js math API compatibility
|
|
3001
2839
|
makeRotationX(radians) {
|
|
3002
2840
|
return this.identity().rotateX(radians);
|