@math.gl/core 4.0.0 → 4.0.1
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/classes/base/math-array.d.ts +1 -2
- package/dist/classes/base/math-array.js +220 -266
- package/dist/classes/base/matrix.d.ts +1 -2
- package/dist/classes/base/matrix.js +52 -53
- package/dist/classes/base/vector.d.ts +1 -2
- package/dist/classes/base/vector.js +121 -135
- package/dist/classes/euler.d.ts +2 -3
- package/dist/classes/euler.js +462 -533
- package/dist/classes/matrix3.d.ts +2 -3
- package/dist/classes/matrix3.js +185 -190
- package/dist/classes/matrix4.d.ts +1 -2
- package/dist/classes/matrix4.js +516 -452
- package/dist/classes/pose.d.ts +4 -5
- package/dist/classes/pose.js +104 -119
- package/dist/classes/quaternion.d.ts +1 -2
- package/dist/classes/quaternion.js +257 -233
- package/dist/classes/spherical-coordinates.d.ts +3 -4
- package/dist/classes/spherical-coordinates.js +138 -147
- package/dist/classes/vector2.d.ts +1 -2
- package/dist/classes/vector2.js +101 -85
- package/dist/classes/vector3.d.ts +1 -2
- package/dist/classes/vector3.js +125 -136
- package/dist/classes/vector4.d.ts +2 -3
- package/dist/classes/vector4.js +106 -114
- package/dist/gl-matrix/common.d.ts +0 -1
- package/dist/gl-matrix/common.js +38 -6
- package/dist/gl-matrix/mat3.d.ts +0 -1
- package/dist/gl-matrix/mat3.js +699 -425
- package/dist/gl-matrix/mat4.d.ts +0 -1
- package/dist/gl-matrix/mat4.js +1879 -1339
- package/dist/gl-matrix/quat.d.ts +0 -1
- package/dist/gl-matrix/quat.js +655 -257
- package/dist/gl-matrix/vec2.d.ts +0 -1
- package/dist/gl-matrix/vec2.js +529 -212
- package/dist/gl-matrix/vec3.d.ts +0 -1
- package/dist/gl-matrix/vec3.js +703 -335
- package/dist/gl-matrix/vec4.d.ts +0 -1
- package/dist/gl-matrix/vec4.js +579 -293
- package/dist/gl-matrix/wip/index.d.ts +3 -4
- package/dist/gl-matrix/wip/index.js +2 -1
- package/dist/gl-matrix/wip/mat2.d.ts +0 -1
- package/dist/gl-matrix/wip/mat2.js +333 -157
- package/dist/gl-matrix/wip/mat2d.d.ts +0 -1
- package/dist/gl-matrix/wip/mat2d.js +377 -202
- package/dist/gl-matrix/wip/quat2.d.ts +0 -1
- package/dist/gl-matrix/wip/quat2.js +647 -409
- package/dist/index.cjs +60 -100
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +21 -22
- package/dist/index.js +23 -16
- package/dist/lib/assert.d.ts +0 -1
- package/dist/lib/assert.js +3 -4
- package/dist/lib/common.d.ts +2 -3
- package/dist/lib/common.js +163 -134
- package/dist/lib/gl-matrix-extras.d.ts +0 -1
- package/dist/lib/gl-matrix-extras.js +39 -36
- package/dist/lib/math-utils.d.ts +0 -1
- package/dist/lib/math-utils.js +2 -1
- package/dist/lib/validators.d.ts +0 -1
- package/dist/lib/validators.js +22 -25
- package/package.json +5 -6
- package/src/classes/matrix3.ts +1 -1
- package/dist/classes/base/math-array.d.ts.map +0 -1
- package/dist/classes/base/math-array.js.map +0 -1
- package/dist/classes/base/matrix.d.ts.map +0 -1
- package/dist/classes/base/matrix.js.map +0 -1
- package/dist/classes/base/vector.d.ts.map +0 -1
- package/dist/classes/base/vector.js.map +0 -1
- package/dist/classes/euler.d.ts.map +0 -1
- package/dist/classes/euler.js.map +0 -1
- package/dist/classes/matrix3.d.ts.map +0 -1
- package/dist/classes/matrix3.js.map +0 -1
- package/dist/classes/matrix4.d.ts.map +0 -1
- package/dist/classes/matrix4.js.map +0 -1
- package/dist/classes/pose.d.ts.map +0 -1
- package/dist/classes/pose.js.map +0 -1
- package/dist/classes/quaternion.d.ts.map +0 -1
- package/dist/classes/quaternion.js.map +0 -1
- package/dist/classes/spherical-coordinates.d.ts.map +0 -1
- package/dist/classes/spherical-coordinates.js.map +0 -1
- package/dist/classes/vector2.d.ts.map +0 -1
- package/dist/classes/vector2.js.map +0 -1
- package/dist/classes/vector3.d.ts.map +0 -1
- package/dist/classes/vector3.js.map +0 -1
- package/dist/classes/vector4.d.ts.map +0 -1
- package/dist/classes/vector4.js.map +0 -1
- package/dist/gl-matrix/common.d.ts.map +0 -1
- package/dist/gl-matrix/common.js.map +0 -1
- package/dist/gl-matrix/mat3.d.ts.map +0 -1
- package/dist/gl-matrix/mat3.js.map +0 -1
- package/dist/gl-matrix/mat4.d.ts.map +0 -1
- package/dist/gl-matrix/mat4.js.map +0 -1
- package/dist/gl-matrix/quat.d.ts.map +0 -1
- package/dist/gl-matrix/quat.js.map +0 -1
- package/dist/gl-matrix/vec2.d.ts.map +0 -1
- package/dist/gl-matrix/vec2.js.map +0 -1
- package/dist/gl-matrix/vec3.d.ts.map +0 -1
- package/dist/gl-matrix/vec3.js.map +0 -1
- package/dist/gl-matrix/vec4.d.ts.map +0 -1
- package/dist/gl-matrix/vec4.js.map +0 -1
- package/dist/gl-matrix/wip/index.d.ts.map +0 -1
- package/dist/gl-matrix/wip/index.js.map +0 -1
- package/dist/gl-matrix/wip/mat2.d.ts.map +0 -1
- package/dist/gl-matrix/wip/mat2.js.map +0 -1
- package/dist/gl-matrix/wip/mat2d.d.ts.map +0 -1
- package/dist/gl-matrix/wip/mat2d.js.map +0 -1
- package/dist/gl-matrix/wip/quat2.d.ts.map +0 -1
- package/dist/gl-matrix/wip/quat2.js.map +0 -1
- package/dist/gl-matrix/wip/types.d.js +0 -2
- package/dist/gl-matrix/wip/types.d.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/assert.d.ts.map +0 -1
- package/dist/lib/assert.js.map +0 -1
- package/dist/lib/common.d.ts.map +0 -1
- package/dist/lib/common.js.map +0 -1
- package/dist/lib/gl-matrix-extras.d.ts.map +0 -1
- package/dist/lib/gl-matrix-extras.js.map +0 -1
- package/dist/lib/gl-matrix.d.js +0 -2
- package/dist/lib/gl-matrix.d.js.map +0 -1
- package/dist/lib/math-utils.d.ts.map +0 -1
- package/dist/lib/math-utils.js.map +0 -1
- package/dist/lib/validators.d.ts.map +0 -1
- package/dist/lib/validators.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,21 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
5
|
var __export = (target, all) => {
|
|
20
6
|
for (var name in all)
|
|
21
7
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -30,9 +16,9 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
30
16
|
};
|
|
31
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
18
|
|
|
33
|
-
//
|
|
34
|
-
var
|
|
35
|
-
__export(
|
|
19
|
+
// dist/index.js
|
|
20
|
+
var dist_exports = {};
|
|
21
|
+
__export(dist_exports, {
|
|
36
22
|
Euler: () => Euler,
|
|
37
23
|
Matrix3: () => Matrix3,
|
|
38
24
|
Matrix4: () => Matrix4,
|
|
@@ -74,9 +60,9 @@ __export(src_exports, {
|
|
|
74
60
|
vec4: () => vec4_exports,
|
|
75
61
|
withEpsilon: () => withEpsilon
|
|
76
62
|
});
|
|
77
|
-
module.exports = __toCommonJS(
|
|
63
|
+
module.exports = __toCommonJS(dist_exports);
|
|
78
64
|
|
|
79
|
-
//
|
|
65
|
+
// dist/lib/common.js
|
|
80
66
|
var RADIANS_TO_DEGREES = 1 / Math.PI * 180;
|
|
81
67
|
var DEGREES_TO_RADIANS = 1 / 180 * Math.PI;
|
|
82
68
|
var DEFAULT_CONFIG = {
|
|
@@ -88,7 +74,7 @@ var DEFAULT_CONFIG = {
|
|
|
88
74
|
printRowMajor: true,
|
|
89
75
|
_cartographicRadians: false
|
|
90
76
|
};
|
|
91
|
-
globalThis.mathgl = globalThis.mathgl || { config:
|
|
77
|
+
globalThis.mathgl = globalThis.mathgl || { config: { ...DEFAULT_CONFIG } };
|
|
92
78
|
var config = globalThis.mathgl.config;
|
|
93
79
|
function configure(options) {
|
|
94
80
|
Object.assign(config, options);
|
|
@@ -232,7 +218,7 @@ function map(value, func, result) {
|
|
|
232
218
|
return func(value);
|
|
233
219
|
}
|
|
234
220
|
|
|
235
|
-
//
|
|
221
|
+
// dist/classes/base/math-array.js
|
|
236
222
|
var MathArray = class extends Array {
|
|
237
223
|
clone() {
|
|
238
224
|
return new this.constructor().copy(this);
|
|
@@ -419,7 +405,7 @@ var MathArray = class extends Array {
|
|
|
419
405
|
}
|
|
420
406
|
};
|
|
421
407
|
|
|
422
|
-
//
|
|
408
|
+
// dist/lib/validators.js
|
|
423
409
|
function validateVector(v, length5) {
|
|
424
410
|
if (v.length !== length5) {
|
|
425
411
|
return false;
|
|
@@ -444,14 +430,14 @@ function checkVector(v, length5, callerName = "") {
|
|
|
444
430
|
return v;
|
|
445
431
|
}
|
|
446
432
|
|
|
447
|
-
//
|
|
433
|
+
// dist/lib/assert.js
|
|
448
434
|
function assert(condition, message) {
|
|
449
435
|
if (!condition) {
|
|
450
436
|
throw new Error(`math.gl assertion ${message}`);
|
|
451
437
|
}
|
|
452
438
|
}
|
|
453
439
|
|
|
454
|
-
//
|
|
440
|
+
// dist/classes/base/vector.js
|
|
455
441
|
var Vector = class extends MathArray {
|
|
456
442
|
get x() {
|
|
457
443
|
return this[0];
|
|
@@ -556,7 +542,7 @@ var Vector = class extends MathArray {
|
|
|
556
542
|
}
|
|
557
543
|
};
|
|
558
544
|
|
|
559
|
-
//
|
|
545
|
+
// dist/gl-matrix/vec2.js
|
|
560
546
|
var vec2_exports = {};
|
|
561
547
|
__export(vec2_exports, {
|
|
562
548
|
add: () => add,
|
|
@@ -606,7 +592,7 @@ __export(vec2_exports, {
|
|
|
606
592
|
zero: () => zero
|
|
607
593
|
});
|
|
608
594
|
|
|
609
|
-
//
|
|
595
|
+
// dist/gl-matrix/common.js
|
|
610
596
|
var EPSILON = 1e-6;
|
|
611
597
|
var ARRAY_TYPE = typeof Float32Array !== "undefined" ? Float32Array : Array;
|
|
612
598
|
var RANDOM = Math.random;
|
|
@@ -617,7 +603,7 @@ function round2(a) {
|
|
|
617
603
|
}
|
|
618
604
|
var degree = Math.PI / 180;
|
|
619
605
|
|
|
620
|
-
//
|
|
606
|
+
// dist/gl-matrix/vec2.js
|
|
621
607
|
function create() {
|
|
622
608
|
const out = new ARRAY_TYPE(2);
|
|
623
609
|
if (ARRAY_TYPE != Float32Array) {
|
|
@@ -865,7 +851,7 @@ var forEach = function() {
|
|
|
865
851
|
};
|
|
866
852
|
}();
|
|
867
853
|
|
|
868
|
-
//
|
|
854
|
+
// dist/lib/gl-matrix-extras.js
|
|
869
855
|
function vec2_transformMat4AsVector(out, a, m) {
|
|
870
856
|
const x = a[0];
|
|
871
857
|
const y = a[1];
|
|
@@ -912,7 +898,7 @@ function vec4_transformMat3(out, a, m) {
|
|
|
912
898
|
return out;
|
|
913
899
|
}
|
|
914
900
|
|
|
915
|
-
//
|
|
901
|
+
// dist/classes/vector2.js
|
|
916
902
|
var Vector2 = class extends Vector {
|
|
917
903
|
constructor(x = 0, y = 0) {
|
|
918
904
|
super(2);
|
|
@@ -985,7 +971,7 @@ var Vector2 = class extends Vector {
|
|
|
985
971
|
}
|
|
986
972
|
};
|
|
987
973
|
|
|
988
|
-
//
|
|
974
|
+
// dist/gl-matrix/vec3.js
|
|
989
975
|
var vec3_exports = {};
|
|
990
976
|
__export(vec3_exports, {
|
|
991
977
|
add: () => add2,
|
|
@@ -1412,7 +1398,7 @@ var forEach2 = function() {
|
|
|
1412
1398
|
};
|
|
1413
1399
|
}();
|
|
1414
1400
|
|
|
1415
|
-
//
|
|
1401
|
+
// dist/classes/vector3.js
|
|
1416
1402
|
var ORIGIN = [0, 0, 0];
|
|
1417
1403
|
var ZERO;
|
|
1418
1404
|
var Vector3 = class extends Vector {
|
|
@@ -1520,7 +1506,7 @@ var Vector3 = class extends Vector {
|
|
|
1520
1506
|
}
|
|
1521
1507
|
};
|
|
1522
1508
|
|
|
1523
|
-
//
|
|
1509
|
+
// dist/classes/vector4.js
|
|
1524
1510
|
var ZERO2;
|
|
1525
1511
|
var Vector4 = class extends Vector {
|
|
1526
1512
|
static get ZERO() {
|
|
@@ -1618,7 +1604,7 @@ var Vector4 = class extends Vector {
|
|
|
1618
1604
|
}
|
|
1619
1605
|
};
|
|
1620
1606
|
|
|
1621
|
-
//
|
|
1607
|
+
// dist/classes/base/matrix.js
|
|
1622
1608
|
var Matrix = class extends MathArray {
|
|
1623
1609
|
toString() {
|
|
1624
1610
|
let string = "[";
|
|
@@ -1664,7 +1650,7 @@ var Matrix = class extends MathArray {
|
|
|
1664
1650
|
}
|
|
1665
1651
|
};
|
|
1666
1652
|
|
|
1667
|
-
//
|
|
1653
|
+
// dist/gl-matrix/mat3.js
|
|
1668
1654
|
var mat3_exports = {};
|
|
1669
1655
|
__export(mat3_exports, {
|
|
1670
1656
|
add: () => add3,
|
|
@@ -2104,9 +2090,7 @@ function str3(a) {
|
|
|
2104
2090
|
return `mat3(${a[0]}, ${a[1]}, ${a[2]}, ${a[3]}, ${a[4]}, ${a[5]}, ${a[6]}, ${a[7]}, ${a[8]})`;
|
|
2105
2091
|
}
|
|
2106
2092
|
function frob(a) {
|
|
2107
|
-
return Math.sqrt(
|
|
2108
|
-
a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]
|
|
2109
|
-
);
|
|
2093
|
+
return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]);
|
|
2110
2094
|
}
|
|
2111
2095
|
function add3(out, a, b) {
|
|
2112
2096
|
out[0] = a[0] + b[0];
|
|
@@ -2183,8 +2167,9 @@ function equals4(a, b) {
|
|
|
2183
2167
|
var mul3 = multiply3;
|
|
2184
2168
|
var sub3 = subtract3;
|
|
2185
2169
|
|
|
2186
|
-
//
|
|
2187
|
-
var INDICES
|
|
2170
|
+
// dist/classes/matrix3.js
|
|
2171
|
+
var INDICES;
|
|
2172
|
+
(function(INDICES3) {
|
|
2188
2173
|
INDICES3[INDICES3["COL0ROW0"] = 0] = "COL0ROW0";
|
|
2189
2174
|
INDICES3[INDICES3["COL0ROW1"] = 1] = "COL0ROW1";
|
|
2190
2175
|
INDICES3[INDICES3["COL0ROW2"] = 2] = "COL0ROW2";
|
|
@@ -2194,8 +2179,7 @@ var INDICES = /* @__PURE__ */ ((INDICES3) => {
|
|
|
2194
2179
|
INDICES3[INDICES3["COL2ROW0"] = 6] = "COL2ROW0";
|
|
2195
2180
|
INDICES3[INDICES3["COL2ROW1"] = 7] = "COL2ROW1";
|
|
2196
2181
|
INDICES3[INDICES3["COL2ROW2"] = 8] = "COL2ROW2";
|
|
2197
|
-
|
|
2198
|
-
})(INDICES || {});
|
|
2182
|
+
})(INDICES || (INDICES = {}));
|
|
2199
2183
|
var IDENTITY_MATRIX = Object.freeze([1, 0, 0, 0, 1, 0, 0, 0, 1]);
|
|
2200
2184
|
var Matrix3 = class extends Matrix {
|
|
2201
2185
|
static get IDENTITY() {
|
|
@@ -2349,7 +2333,7 @@ function getIdentityMatrix() {
|
|
|
2349
2333
|
return IDENTITY_MATRIX3;
|
|
2350
2334
|
}
|
|
2351
2335
|
|
|
2352
|
-
//
|
|
2336
|
+
// dist/gl-matrix/mat4.js
|
|
2353
2337
|
var mat4_exports = {};
|
|
2354
2338
|
__export(mat4_exports, {
|
|
2355
2339
|
add: () => add4,
|
|
@@ -3701,9 +3685,7 @@ function str4(a) {
|
|
|
3701
3685
|
return `mat4(${a[0]}, ${a[1]}, ${a[2]}, ${a[3]}, ${a[4]}, ${a[5]}, ${a[6]}, ${a[7]}, ${a[8]}, ${a[9]}, ${a[10]}, ${a[11]}, ${a[12]}, ${a[13]}, ${a[14]}, ${a[15]})`;
|
|
3702
3686
|
}
|
|
3703
3687
|
function frob2(a) {
|
|
3704
|
-
return Math.sqrt(
|
|
3705
|
-
a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]
|
|
3706
|
-
);
|
|
3688
|
+
return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]);
|
|
3707
3689
|
}
|
|
3708
3690
|
function add4(out, a, b) {
|
|
3709
3691
|
out[0] = a[0] + b[0];
|
|
@@ -3822,7 +3804,7 @@ function equals5(a, b) {
|
|
|
3822
3804
|
var mul4 = multiply4;
|
|
3823
3805
|
var sub4 = subtract4;
|
|
3824
3806
|
|
|
3825
|
-
//
|
|
3807
|
+
// dist/gl-matrix/vec4.js
|
|
3826
3808
|
var vec4_exports = {};
|
|
3827
3809
|
__export(vec4_exports, {
|
|
3828
3810
|
add: () => add5,
|
|
@@ -4188,8 +4170,9 @@ var forEach3 = function() {
|
|
|
4188
4170
|
};
|
|
4189
4171
|
}();
|
|
4190
4172
|
|
|
4191
|
-
//
|
|
4192
|
-
var INDICES2
|
|
4173
|
+
// dist/classes/matrix4.js
|
|
4174
|
+
var INDICES2;
|
|
4175
|
+
(function(INDICES3) {
|
|
4193
4176
|
INDICES3[INDICES3["COL0ROW0"] = 0] = "COL0ROW0";
|
|
4194
4177
|
INDICES3[INDICES3["COL0ROW1"] = 1] = "COL0ROW1";
|
|
4195
4178
|
INDICES3[INDICES3["COL0ROW2"] = 2] = "COL0ROW2";
|
|
@@ -4206,8 +4189,7 @@ var INDICES2 = /* @__PURE__ */ ((INDICES3) => {
|
|
|
4206
4189
|
INDICES3[INDICES3["COL3ROW1"] = 13] = "COL3ROW1";
|
|
4207
4190
|
INDICES3[INDICES3["COL3ROW2"] = 14] = "COL3ROW2";
|
|
4208
4191
|
INDICES3[INDICES3["COL3ROW3"] = 15] = "COL3ROW3";
|
|
4209
|
-
|
|
4210
|
-
})(INDICES2 || {});
|
|
4192
|
+
})(INDICES2 || (INDICES2 = {}));
|
|
4211
4193
|
var DEFAULT_FOVY = 45 * Math.PI / 180;
|
|
4212
4194
|
var DEFAULT_ASPECT = 1;
|
|
4213
4195
|
var DEFAULT_NEAR = 0.1;
|
|
@@ -4343,13 +4325,7 @@ var Matrix4 = class extends Matrix {
|
|
|
4343
4325
|
return this.check();
|
|
4344
4326
|
}
|
|
4345
4327
|
orthographic(view) {
|
|
4346
|
-
const {
|
|
4347
|
-
fovy = DEFAULT_FOVY,
|
|
4348
|
-
aspect = DEFAULT_ASPECT,
|
|
4349
|
-
focalDistance = 1,
|
|
4350
|
-
near = DEFAULT_NEAR,
|
|
4351
|
-
far = DEFAULT_FAR
|
|
4352
|
-
} = view;
|
|
4328
|
+
const { fovy = DEFAULT_FOVY, aspect = DEFAULT_ASPECT, focalDistance = 1, near = DEFAULT_NEAR, far = DEFAULT_FAR } = view;
|
|
4353
4329
|
checkRadians(fovy);
|
|
4354
4330
|
const halfY = fovy / 2;
|
|
4355
4331
|
const top = focalDistance * Math.tan(halfY);
|
|
@@ -4573,7 +4549,7 @@ function computeInfinitePerspectiveOffCenter(result, left, right, bottom, top, n
|
|
|
4573
4549
|
return result;
|
|
4574
4550
|
}
|
|
4575
4551
|
|
|
4576
|
-
//
|
|
4552
|
+
// dist/gl-matrix/quat.js
|
|
4577
4553
|
var quat_exports = {};
|
|
4578
4554
|
__export(quat_exports, {
|
|
4579
4555
|
add: () => add6,
|
|
@@ -4917,7 +4893,7 @@ var setAxes = function() {
|
|
|
4917
4893
|
};
|
|
4918
4894
|
}();
|
|
4919
4895
|
|
|
4920
|
-
//
|
|
4896
|
+
// dist/classes/quaternion.js
|
|
4921
4897
|
var IDENTITY_QUATERNION = [0, 0, 0, 1];
|
|
4922
4898
|
var Quaternion = class extends MathArray {
|
|
4923
4899
|
constructor(x = 0, y = 0, z = 0, w = 1) {
|
|
@@ -5106,19 +5082,11 @@ var Quaternion = class extends MathArray {
|
|
|
5106
5082
|
}
|
|
5107
5083
|
};
|
|
5108
5084
|
|
|
5109
|
-
//
|
|
5085
|
+
// dist/classes/spherical-coordinates.js
|
|
5110
5086
|
var EPSILON2 = 1e-6;
|
|
5111
5087
|
var EARTH_RADIUS_METERS = 6371e3;
|
|
5112
5088
|
var SphericalCoordinates = class {
|
|
5113
|
-
constructor({
|
|
5114
|
-
phi = 0,
|
|
5115
|
-
theta = 0,
|
|
5116
|
-
radius = 1,
|
|
5117
|
-
bearing,
|
|
5118
|
-
pitch,
|
|
5119
|
-
altitude,
|
|
5120
|
-
radiusScale = EARTH_RADIUS_METERS
|
|
5121
|
-
} = {}) {
|
|
5089
|
+
constructor({ phi = 0, theta = 0, radius = 1, bearing, pitch, altitude, radiusScale = EARTH_RADIUS_METERS } = {}) {
|
|
5122
5090
|
this.phi = phi;
|
|
5123
5091
|
this.theta = theta;
|
|
5124
5092
|
this.radius = radius || altitude || 1;
|
|
@@ -5215,42 +5183,42 @@ var SphericalCoordinates = class {
|
|
|
5215
5183
|
}
|
|
5216
5184
|
};
|
|
5217
5185
|
|
|
5218
|
-
//
|
|
5186
|
+
// dist/classes/euler.js
|
|
5219
5187
|
var ERR_UNKNOWN_ORDER = "Unknown Euler angle order";
|
|
5220
5188
|
var ALMOST_ONE = 0.99999;
|
|
5221
|
-
var RotationOrder
|
|
5189
|
+
var RotationOrder;
|
|
5190
|
+
(function(RotationOrder2) {
|
|
5222
5191
|
RotationOrder2[RotationOrder2["ZYX"] = 0] = "ZYX";
|
|
5223
5192
|
RotationOrder2[RotationOrder2["YXZ"] = 1] = "YXZ";
|
|
5224
5193
|
RotationOrder2[RotationOrder2["XZY"] = 2] = "XZY";
|
|
5225
5194
|
RotationOrder2[RotationOrder2["ZXY"] = 3] = "ZXY";
|
|
5226
5195
|
RotationOrder2[RotationOrder2["YZX"] = 4] = "YZX";
|
|
5227
5196
|
RotationOrder2[RotationOrder2["XYZ"] = 5] = "XYZ";
|
|
5228
|
-
|
|
5229
|
-
})(RotationOrder || {});
|
|
5197
|
+
})(RotationOrder || (RotationOrder = {}));
|
|
5230
5198
|
var Euler = class extends MathArray {
|
|
5231
5199
|
static get ZYX() {
|
|
5232
|
-
return
|
|
5200
|
+
return RotationOrder.ZYX;
|
|
5233
5201
|
}
|
|
5234
5202
|
static get YXZ() {
|
|
5235
|
-
return
|
|
5203
|
+
return RotationOrder.YXZ;
|
|
5236
5204
|
}
|
|
5237
5205
|
static get XZY() {
|
|
5238
|
-
return
|
|
5206
|
+
return RotationOrder.XZY;
|
|
5239
5207
|
}
|
|
5240
5208
|
static get ZXY() {
|
|
5241
|
-
return
|
|
5209
|
+
return RotationOrder.ZXY;
|
|
5242
5210
|
}
|
|
5243
5211
|
static get YZX() {
|
|
5244
|
-
return
|
|
5212
|
+
return RotationOrder.YZX;
|
|
5245
5213
|
}
|
|
5246
5214
|
static get XYZ() {
|
|
5247
|
-
return
|
|
5215
|
+
return RotationOrder.XYZ;
|
|
5248
5216
|
}
|
|
5249
5217
|
static get RollPitchYaw() {
|
|
5250
|
-
return
|
|
5218
|
+
return RotationOrder.ZYX;
|
|
5251
5219
|
}
|
|
5252
5220
|
static get DefaultOrder() {
|
|
5253
|
-
return
|
|
5221
|
+
return RotationOrder.ZYX;
|
|
5254
5222
|
}
|
|
5255
5223
|
static get RotationOrders() {
|
|
5256
5224
|
return RotationOrder;
|
|
@@ -5414,7 +5382,7 @@ var Euler = class extends MathArray {
|
|
|
5414
5382
|
return this.check();
|
|
5415
5383
|
}
|
|
5416
5384
|
fromRollPitchYaw(roll, pitch, yaw) {
|
|
5417
|
-
return this.set(roll, pitch, yaw,
|
|
5385
|
+
return this.set(roll, pitch, yaw, RotationOrder.ZYX);
|
|
5418
5386
|
}
|
|
5419
5387
|
fromRotationMatrix(m, order = Euler.DefaultOrder) {
|
|
5420
5388
|
this._fromRotationMatrix(m, order);
|
|
@@ -5426,17 +5394,17 @@ var Euler = class extends MathArray {
|
|
|
5426
5394
|
getQuaternion() {
|
|
5427
5395
|
const q = new Quaternion();
|
|
5428
5396
|
switch (this[3]) {
|
|
5429
|
-
case
|
|
5397
|
+
case RotationOrder.XYZ:
|
|
5430
5398
|
return q.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);
|
|
5431
|
-
case
|
|
5399
|
+
case RotationOrder.YXZ:
|
|
5432
5400
|
return q.rotateY(this[0]).rotateX(this[1]).rotateZ(this[2]);
|
|
5433
|
-
case
|
|
5401
|
+
case RotationOrder.ZXY:
|
|
5434
5402
|
return q.rotateZ(this[0]).rotateX(this[1]).rotateY(this[2]);
|
|
5435
|
-
case
|
|
5403
|
+
case RotationOrder.ZYX:
|
|
5436
5404
|
return q.rotateZ(this[0]).rotateY(this[1]).rotateX(this[2]);
|
|
5437
|
-
case
|
|
5405
|
+
case RotationOrder.YZX:
|
|
5438
5406
|
return q.rotateY(this[0]).rotateZ(this[1]).rotateX(this[2]);
|
|
5439
|
-
case
|
|
5407
|
+
case RotationOrder.XZY:
|
|
5440
5408
|
return q.rotateX(this[0]).rotateZ(this[1]).rotateY(this[2]);
|
|
5441
5409
|
default:
|
|
5442
5410
|
throw new Error(ERR_UNKNOWN_ORDER);
|
|
@@ -5638,18 +5606,9 @@ function checkOrder(value) {
|
|
|
5638
5606
|
return value;
|
|
5639
5607
|
}
|
|
5640
5608
|
|
|
5641
|
-
//
|
|
5609
|
+
// dist/classes/pose.js
|
|
5642
5610
|
var Pose = class {
|
|
5643
|
-
constructor({
|
|
5644
|
-
x = 0,
|
|
5645
|
-
y = 0,
|
|
5646
|
-
z = 0,
|
|
5647
|
-
roll = 0,
|
|
5648
|
-
pitch = 0,
|
|
5649
|
-
yaw = 0,
|
|
5650
|
-
position,
|
|
5651
|
-
orientation
|
|
5652
|
-
} = {}) {
|
|
5611
|
+
constructor({ x = 0, y = 0, z = 0, roll = 0, pitch = 0, yaw = 0, position, orientation } = {}) {
|
|
5653
5612
|
if (Array.isArray(position) && position.length === 3) {
|
|
5654
5613
|
this.position = new Vector3(position);
|
|
5655
5614
|
} else {
|
|
@@ -5749,7 +5708,7 @@ var Pose = class {
|
|
|
5749
5708
|
}
|
|
5750
5709
|
};
|
|
5751
5710
|
|
|
5752
|
-
//
|
|
5711
|
+
// dist/lib/math-utils.js
|
|
5753
5712
|
var math_utils_exports = {};
|
|
5754
5713
|
__export(math_utils_exports, {
|
|
5755
5714
|
EPSILON1: () => EPSILON1,
|
|
@@ -5801,3 +5760,4 @@ var PI_OVER_TWO = Math.PI / 2;
|
|
|
5801
5760
|
var PI_OVER_FOUR = Math.PI / 4;
|
|
5802
5761
|
var PI_OVER_SIX = Math.PI / 6;
|
|
5803
5762
|
var TWO_PI = Math.PI * 2;
|
|
5763
|
+
//# sourceMappingURL=index.cjs.map
|