@math.gl/core 4.0.0 → 4.1.0-alpha.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.
Files changed (147) hide show
  1. package/dist/classes/base/math-array.d.ts +1 -2
  2. package/dist/classes/base/math-array.js +223 -266
  3. package/dist/classes/base/matrix.d.ts +1 -2
  4. package/dist/classes/base/matrix.js +56 -53
  5. package/dist/classes/base/vector.d.ts +1 -2
  6. package/dist/classes/base/vector.js +125 -135
  7. package/dist/classes/euler.d.ts +2 -3
  8. package/dist/classes/euler.js +464 -533
  9. package/dist/classes/matrix3.d.ts +9 -4
  10. package/dist/classes/matrix3.js +191 -190
  11. package/dist/classes/matrix4.d.ts +8 -4
  12. package/dist/classes/matrix4.js +521 -452
  13. package/dist/classes/pose.d.ts +4 -5
  14. package/dist/classes/pose.js +106 -119
  15. package/dist/classes/quaternion.d.ts +1 -2
  16. package/dist/classes/quaternion.js +261 -233
  17. package/dist/classes/spherical-coordinates.d.ts +3 -4
  18. package/dist/classes/spherical-coordinates.js +142 -147
  19. package/dist/classes/vector2.d.ts +6 -5
  20. package/dist/classes/vector2.js +103 -85
  21. package/dist/classes/vector3.d.ts +6 -5
  22. package/dist/classes/vector3.js +129 -136
  23. package/dist/classes/vector4.d.ts +7 -6
  24. package/dist/classes/vector4.js +108 -114
  25. package/dist/gl-matrix/common.d.ts +0 -1
  26. package/dist/gl-matrix/common.js +38 -6
  27. package/dist/gl-matrix/mat3.d.ts +0 -1
  28. package/dist/gl-matrix/mat3.js +699 -425
  29. package/dist/gl-matrix/mat4.d.ts +0 -1
  30. package/dist/gl-matrix/mat4.js +1879 -1339
  31. package/dist/gl-matrix/quat.d.ts +0 -1
  32. package/dist/gl-matrix/quat.js +655 -257
  33. package/dist/gl-matrix/vec2.d.ts +0 -1
  34. package/dist/gl-matrix/vec2.js +529 -212
  35. package/dist/gl-matrix/vec3.d.ts +0 -1
  36. package/dist/gl-matrix/vec3.js +703 -335
  37. package/dist/gl-matrix/vec4.d.ts +0 -1
  38. package/dist/gl-matrix/vec4.js +579 -293
  39. package/dist/gl-matrix/wip/index.d.ts +3 -4
  40. package/dist/gl-matrix/wip/index.js +5 -1
  41. package/dist/gl-matrix/wip/mat2.d.ts +1 -2
  42. package/dist/gl-matrix/wip/mat2.js +336 -157
  43. package/dist/gl-matrix/wip/mat2d.d.ts +0 -1
  44. package/dist/gl-matrix/wip/mat2d.js +380 -202
  45. package/dist/gl-matrix/wip/quat2.d.ts +0 -1
  46. package/dist/gl-matrix/wip/quat2.js +650 -409
  47. package/dist/index.cjs +60 -100
  48. package/dist/index.cjs.map +7 -0
  49. package/dist/index.d.ts +27 -23
  50. package/dist/index.js +25 -16
  51. package/dist/lib/assert.d.ts +0 -1
  52. package/dist/lib/assert.js +6 -4
  53. package/dist/lib/common.d.ts +2 -3
  54. package/dist/lib/common.js +165 -134
  55. package/dist/lib/gl-matrix-extras.d.ts +0 -1
  56. package/dist/lib/gl-matrix-extras.js +42 -36
  57. package/dist/lib/math-utils.d.ts +0 -1
  58. package/dist/lib/math-utils.js +5 -1
  59. package/dist/lib/validators.d.ts +0 -1
  60. package/dist/lib/validators.js +25 -25
  61. package/package.json +5 -6
  62. package/src/classes/base/math-array.ts +4 -1
  63. package/src/classes/base/matrix.ts +4 -1
  64. package/src/classes/base/vector.ts +4 -1
  65. package/src/classes/euler.ts +4 -1
  66. package/src/classes/matrix3.ts +12 -3
  67. package/src/classes/matrix4.ts +11 -3
  68. package/src/classes/pose.ts +4 -1
  69. package/src/classes/quaternion.ts +4 -1
  70. package/src/classes/spherical-coordinates.ts +4 -1
  71. package/src/classes/vector2.ts +11 -4
  72. package/src/classes/vector3.ts +10 -4
  73. package/src/classes/vector4.ts +9 -4
  74. package/src/gl-matrix/wip/index.js +4 -0
  75. package/src/gl-matrix/wip/mat2.js +4 -0
  76. package/src/gl-matrix/wip/mat2d.js +4 -0
  77. package/src/gl-matrix/wip/quat2.ts +4 -0
  78. package/src/index.ts +10 -2
  79. package/src/lib/assert.ts +4 -0
  80. package/src/lib/common.ts +3 -1
  81. package/src/lib/gl-matrix-extras.ts +4 -0
  82. package/src/lib/gl-matrix.d.ts +4 -0
  83. package/src/lib/math-utils.ts +4 -0
  84. package/src/lib/validators.ts +4 -19
  85. package/dist/classes/base/math-array.d.ts.map +0 -1
  86. package/dist/classes/base/math-array.js.map +0 -1
  87. package/dist/classes/base/matrix.d.ts.map +0 -1
  88. package/dist/classes/base/matrix.js.map +0 -1
  89. package/dist/classes/base/vector.d.ts.map +0 -1
  90. package/dist/classes/base/vector.js.map +0 -1
  91. package/dist/classes/euler.d.ts.map +0 -1
  92. package/dist/classes/euler.js.map +0 -1
  93. package/dist/classes/matrix3.d.ts.map +0 -1
  94. package/dist/classes/matrix3.js.map +0 -1
  95. package/dist/classes/matrix4.d.ts.map +0 -1
  96. package/dist/classes/matrix4.js.map +0 -1
  97. package/dist/classes/pose.d.ts.map +0 -1
  98. package/dist/classes/pose.js.map +0 -1
  99. package/dist/classes/quaternion.d.ts.map +0 -1
  100. package/dist/classes/quaternion.js.map +0 -1
  101. package/dist/classes/spherical-coordinates.d.ts.map +0 -1
  102. package/dist/classes/spherical-coordinates.js.map +0 -1
  103. package/dist/classes/vector2.d.ts.map +0 -1
  104. package/dist/classes/vector2.js.map +0 -1
  105. package/dist/classes/vector3.d.ts.map +0 -1
  106. package/dist/classes/vector3.js.map +0 -1
  107. package/dist/classes/vector4.d.ts.map +0 -1
  108. package/dist/classes/vector4.js.map +0 -1
  109. package/dist/gl-matrix/common.d.ts.map +0 -1
  110. package/dist/gl-matrix/common.js.map +0 -1
  111. package/dist/gl-matrix/mat3.d.ts.map +0 -1
  112. package/dist/gl-matrix/mat3.js.map +0 -1
  113. package/dist/gl-matrix/mat4.d.ts.map +0 -1
  114. package/dist/gl-matrix/mat4.js.map +0 -1
  115. package/dist/gl-matrix/quat.d.ts.map +0 -1
  116. package/dist/gl-matrix/quat.js.map +0 -1
  117. package/dist/gl-matrix/vec2.d.ts.map +0 -1
  118. package/dist/gl-matrix/vec2.js.map +0 -1
  119. package/dist/gl-matrix/vec3.d.ts.map +0 -1
  120. package/dist/gl-matrix/vec3.js.map +0 -1
  121. package/dist/gl-matrix/vec4.d.ts.map +0 -1
  122. package/dist/gl-matrix/vec4.js.map +0 -1
  123. package/dist/gl-matrix/wip/index.d.ts.map +0 -1
  124. package/dist/gl-matrix/wip/index.js.map +0 -1
  125. package/dist/gl-matrix/wip/mat2.d.ts.map +0 -1
  126. package/dist/gl-matrix/wip/mat2.js.map +0 -1
  127. package/dist/gl-matrix/wip/mat2d.d.ts.map +0 -1
  128. package/dist/gl-matrix/wip/mat2d.js.map +0 -1
  129. package/dist/gl-matrix/wip/quat2.d.ts.map +0 -1
  130. package/dist/gl-matrix/wip/quat2.js.map +0 -1
  131. package/dist/gl-matrix/wip/types.d.js +0 -2
  132. package/dist/gl-matrix/wip/types.d.js.map +0 -1
  133. package/dist/index.d.ts.map +0 -1
  134. package/dist/index.js.map +0 -1
  135. package/dist/lib/assert.d.ts.map +0 -1
  136. package/dist/lib/assert.js.map +0 -1
  137. package/dist/lib/common.d.ts.map +0 -1
  138. package/dist/lib/common.js.map +0 -1
  139. package/dist/lib/gl-matrix-extras.d.ts.map +0 -1
  140. package/dist/lib/gl-matrix-extras.js.map +0 -1
  141. package/dist/lib/gl-matrix.d.js +0 -2
  142. package/dist/lib/gl-matrix.d.js.map +0 -1
  143. package/dist/lib/math-utils.d.ts.map +0 -1
  144. package/dist/lib/math-utils.js.map +0 -1
  145. package/dist/lib/validators.d.ts.map +0 -1
  146. package/dist/lib/validators.js.map +0 -1
  147. package/src/gl-matrix/wip/types.d.ts +0 -93
@@ -1,240 +1,268 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ // Copyright (c) 2017 Uber Technologies, Inc.
1
5
  import { MathArray } from "./base/math-array.js";
2
6
  import { checkNumber, checkVector } from "../lib/validators.js";
3
7
  import { Vector4 } from "./vector4.js";
4
- import { fromMat3 as quat_fromMat3, setAxisAngle as quat_setAxisAngle, identity as quat_identity, length as quat_length, squaredLength as quat_squaredLength, dot as quat_dot, rotationTo as quat_rotationTo, add as quat_add, calculateW as quat_calculateW, conjugate as quat_conjugate, invert as quat_invert, lerp as quat_lerp, multiply as quat_multiply, rotateX as quat_rotateX, rotateY as quat_rotateY, rotateZ as quat_rotateZ, scale as quat_scale, slerp as quat_slerp } from "../gl-matrix/quat.js";
8
+ // @ts-ignore gl-matrix types...
9
+ import { fromMat3 as quat_fromMat3, setAxisAngle as quat_setAxisAngle, identity as quat_identity, length as quat_length, squaredLength as quat_squaredLength, dot as quat_dot,
10
+ // getAxisAngle as quat_getAxisAngle,
11
+ rotationTo as quat_rotationTo, add as quat_add, calculateW as quat_calculateW, conjugate as quat_conjugate, invert as quat_invert, lerp as quat_lerp, multiply as quat_multiply, rotateX as quat_rotateX, rotateY as quat_rotateY, rotateZ as quat_rotateZ, scale as quat_scale, slerp as quat_slerp } from "../gl-matrix/quat.js";
12
+ // @ts-ignore gl-matrix types...
5
13
  import { transformQuat as vec4_transformQuat } from "../gl-matrix/vec4.js";
6
14
  const IDENTITY_QUATERNION = [0, 0, 0, 1];
7
15
  export class Quaternion extends MathArray {
8
- constructor(x = 0, y = 0, z = 0, w = 1) {
9
- super(-0, -0, -0, -0);
10
-
11
- if (Array.isArray(x) && arguments.length === 1) {
12
- this.copy(x);
13
- } else {
14
- this.set(x, y, z, w);
15
- }
16
- }
17
-
18
- copy(array) {
19
- this[0] = array[0];
20
- this[1] = array[1];
21
- this[2] = array[2];
22
- this[3] = array[3];
23
- return this.check();
24
- }
25
-
26
- set(x, y, z, w) {
27
- this[0] = x;
28
- this[1] = y;
29
- this[2] = z;
30
- this[3] = w;
31
- return this.check();
32
- }
33
-
34
- fromObject(object) {
35
- this[0] = object.x;
36
- this[1] = object.y;
37
- this[2] = object.z;
38
- this[3] = object.w;
39
- return this.check();
40
- }
41
-
42
- fromMatrix3(m) {
43
- quat_fromMat3(this, m);
44
- return this.check();
45
- }
46
-
47
- fromAxisRotation(axis, rad) {
48
- quat_setAxisAngle(this, axis, rad);
49
- return this.check();
50
- }
51
-
52
- identity() {
53
- quat_identity(this);
54
- return this.check();
55
- }
56
-
57
- setAxisAngle(axis, rad) {
58
- return this.fromAxisRotation(axis, rad);
59
- }
60
-
61
- get ELEMENTS() {
62
- return 4;
63
- }
64
-
65
- get x() {
66
- return this[0];
67
- }
68
-
69
- set x(value) {
70
- this[0] = checkNumber(value);
71
- }
72
-
73
- get y() {
74
- return this[1];
75
- }
76
-
77
- set y(value) {
78
- this[1] = checkNumber(value);
79
- }
80
-
81
- get z() {
82
- return this[2];
83
- }
84
-
85
- set z(value) {
86
- this[2] = checkNumber(value);
87
- }
88
-
89
- get w() {
90
- return this[3];
91
- }
92
-
93
- set w(value) {
94
- this[3] = checkNumber(value);
95
- }
96
-
97
- len() {
98
- return quat_length(this);
99
- }
100
-
101
- lengthSquared() {
102
- return quat_squaredLength(this);
103
- }
104
-
105
- dot(a) {
106
- return quat_dot(this, a);
107
- }
108
-
109
- rotationTo(vectorA, vectorB) {
110
- quat_rotationTo(this, vectorA, vectorB);
111
- return this.check();
112
- }
113
-
114
- add(a) {
115
- quat_add(this, this, a);
116
- return this.check();
117
- }
118
-
119
- calculateW() {
120
- quat_calculateW(this, this);
121
- return this.check();
122
- }
123
-
124
- conjugate() {
125
- quat_conjugate(this, this);
126
- return this.check();
127
- }
128
-
129
- invert() {
130
- quat_invert(this, this);
131
- return this.check();
132
- }
133
-
134
- lerp(a, b, t) {
135
- if (t === undefined) {
136
- return this.lerp(this, a, b);
137
- }
138
-
139
- quat_lerp(this, a, b, t);
140
- return this.check();
141
- }
142
-
143
- multiplyRight(a) {
144
- quat_multiply(this, this, a);
145
- return this.check();
146
- }
147
-
148
- multiplyLeft(a) {
149
- quat_multiply(this, a, this);
150
- return this.check();
151
- }
152
-
153
- normalize() {
154
- const length = this.len();
155
- const l = length > 0 ? 1 / length : 0;
156
- this[0] = this[0] * l;
157
- this[1] = this[1] * l;
158
- this[2] = this[2] * l;
159
- this[3] = this[3] * l;
160
-
161
- if (length === 0) {
162
- this[3] = 1;
163
- }
164
-
165
- return this.check();
166
- }
167
-
168
- rotateX(rad) {
169
- quat_rotateX(this, this, rad);
170
- return this.check();
171
- }
172
-
173
- rotateY(rad) {
174
- quat_rotateY(this, this, rad);
175
- return this.check();
176
- }
177
-
178
- rotateZ(rad) {
179
- quat_rotateZ(this, this, rad);
180
- return this.check();
181
- }
182
-
183
- scale(b) {
184
- quat_scale(this, this, b);
185
- return this.check();
186
- }
187
-
188
- slerp(arg0, arg1, arg2) {
189
- let start;
190
- let target;
191
- let ratio;
192
-
193
- switch (arguments.length) {
194
- case 1:
195
- ({
196
- start = IDENTITY_QUATERNION,
197
- target,
198
- ratio
199
- } = arg0);
200
- break;
201
-
202
- case 2:
203
- start = this;
204
- target = arg0;
205
- ratio = arg1;
206
- break;
207
-
208
- default:
209
- start = arg0;
210
- target = arg1;
211
- ratio = arg2;
212
- }
213
-
214
- quat_slerp(this, start, target, ratio);
215
- return this.check();
216
- }
217
-
218
- transformVector4(vector, result = new Vector4()) {
219
- vec4_transformQuat(result, vector, this);
220
- return checkVector(result, 4);
221
- }
222
-
223
- lengthSq() {
224
- return this.lengthSquared();
225
- }
226
-
227
- setFromAxisAngle(axis, rad) {
228
- return this.setAxisAngle(axis, rad);
229
- }
230
-
231
- premultiply(a) {
232
- return this.multiplyLeft(a);
233
- }
234
-
235
- multiply(a) {
236
- return this.multiplyRight(a);
237
- }
238
-
16
+ constructor(x = 0, y = 0, z = 0, w = 1) {
17
+ // PERF NOTE: initialize elements as double precision numbers
18
+ super(-0, -0, -0, -0);
19
+ // eslint-disable-next-line prefer-rest-params
20
+ if (Array.isArray(x) && arguments.length === 1) {
21
+ this.copy(x);
22
+ }
23
+ else {
24
+ this.set(x, y, z, w);
25
+ }
26
+ }
27
+ copy(array) {
28
+ this[0] = array[0];
29
+ this[1] = array[1];
30
+ this[2] = array[2];
31
+ this[3] = array[3];
32
+ return this.check();
33
+ }
34
+ set(x, y, z, w) {
35
+ this[0] = x;
36
+ this[1] = y;
37
+ this[2] = z;
38
+ this[3] = w;
39
+ return this.check();
40
+ }
41
+ fromObject(object) {
42
+ this[0] = object.x;
43
+ this[1] = object.y;
44
+ this[2] = object.z;
45
+ this[3] = object.w;
46
+ return this.check();
47
+ }
48
+ /**
49
+ * Creates a quaternion from the given 3x3 rotation matrix.
50
+ * NOTE: The resultant quaternion is not normalized, so you should
51
+ * be sure to renormalize the quaternion yourself where necessary.
52
+ * @param m
53
+ * @returns
54
+ */
55
+ fromMatrix3(m) {
56
+ quat_fromMat3(this, m);
57
+ return this.check();
58
+ }
59
+ fromAxisRotation(axis, rad) {
60
+ quat_setAxisAngle(this, axis, rad);
61
+ return this.check();
62
+ }
63
+ /** Set a quat to the identity quaternion */
64
+ identity() {
65
+ quat_identity(this);
66
+ return this.check();
67
+ }
68
+ // Set the components of a quat to the given values
69
+ // set(i, j, k, l) {
70
+ // quat_set(this, i, j, k, l);
71
+ // return this.check();
72
+ // }
73
+ // Sets a quat from the given angle and rotation axis, then returns it.
74
+ setAxisAngle(axis, rad) {
75
+ return this.fromAxisRotation(axis, rad);
76
+ }
77
+ // Getters/setters
78
+ get ELEMENTS() {
79
+ return 4;
80
+ }
81
+ get x() {
82
+ return this[0];
83
+ }
84
+ set x(value) {
85
+ this[0] = checkNumber(value);
86
+ }
87
+ get y() {
88
+ return this[1];
89
+ }
90
+ set y(value) {
91
+ this[1] = checkNumber(value);
92
+ }
93
+ get z() {
94
+ return this[2];
95
+ }
96
+ set z(value) {
97
+ this[2] = checkNumber(value);
98
+ }
99
+ get w() {
100
+ return this[3];
101
+ }
102
+ set w(value) {
103
+ this[3] = checkNumber(value);
104
+ }
105
+ // Calculates the length of a quat
106
+ len() {
107
+ return quat_length(this);
108
+ }
109
+ // Calculates the squared length of a quat
110
+ lengthSquared() {
111
+ return quat_squaredLength(this);
112
+ }
113
+ // Calculates the dot product of two quat's
114
+ // @return {Number}
115
+ dot(a) {
116
+ return quat_dot(this, a);
117
+ }
118
+ // Gets the rotation axis and angle for a given quaternion.
119
+ // If a quaternion is created with setAxisAngle, this method will
120
+ // return the same values as providied in the original parameter
121
+ // list OR functionally equivalent values.
122
+ // Example: The quaternion formed by axis [0, 0, 1] and angle -90
123
+ // is the same as the quaternion formed by [0, 0, 1] and 270.
124
+ // This method favors the latter.
125
+ // @return {{[x,y,z], Number}}
126
+ // getAxisAngle() {
127
+ // const axis = [];
128
+ // // const angle = quat_getAxisAngle(axis, this);
129
+ // return {axis, angle};
130
+ // }
131
+ // MODIFIERS
132
+ // Sets a quaternion to represent the shortest rotation from one vector
133
+ // to another. Both vectors are assumed to be unit length.
134
+ rotationTo(vectorA, vectorB) {
135
+ quat_rotationTo(this, vectorA, vectorB);
136
+ return this.check();
137
+ }
138
+ // Sets the specified quaternion with values corresponding to the given axes.
139
+ // Each axis is a vec3 and is expected to be unit length and perpendicular
140
+ // to all other specified axes.
141
+ // setAxes() {
142
+ // Number
143
+ // }
144
+ // Performs a spherical linear interpolation with two control points
145
+ // sqlerp() {
146
+ // Number;
147
+ // }
148
+ // Adds two quat's
149
+ add(a) {
150
+ quat_add(this, this, a);
151
+ return this.check();
152
+ }
153
+ // Calculates the W component of a quat from the X, Y, and Z components.
154
+ // Any existing W component will be ignored.
155
+ calculateW() {
156
+ quat_calculateW(this, this);
157
+ return this.check();
158
+ }
159
+ // Calculates the conjugate of a quat If the quaternion is normalized,
160
+ // this function is faster than quat_invert and produces the same result.
161
+ conjugate() {
162
+ quat_conjugate(this, this);
163
+ return this.check();
164
+ }
165
+ // Calculates the inverse of a quat
166
+ invert() {
167
+ quat_invert(this, this);
168
+ return this.check();
169
+ }
170
+ // Performs a linear interpolation between two quat's
171
+ lerp(a, b, t) {
172
+ if (t === undefined) {
173
+ return this.lerp(this, a, b);
174
+ }
175
+ quat_lerp(this, a, b, t);
176
+ return this.check();
177
+ }
178
+ // Multiplies two quat's
179
+ multiplyRight(a) {
180
+ quat_multiply(this, this, a);
181
+ return this.check();
182
+ }
183
+ multiplyLeft(a) {
184
+ quat_multiply(this, a, this);
185
+ return this.check();
186
+ }
187
+ // Normalize a quat
188
+ normalize() {
189
+ // Handle 0 case
190
+ const length = this.len();
191
+ const l = length > 0 ? 1 / length : 0;
192
+ this[0] = this[0] * l;
193
+ this[1] = this[1] * l;
194
+ this[2] = this[2] * l;
195
+ this[3] = this[3] * l;
196
+ // Set to [0, 0, 0, 1] if length is 0
197
+ if (length === 0) {
198
+ this[3] = 1;
199
+ }
200
+ return this.check();
201
+ }
202
+ // Rotates a quaternion by the given angle about the X axis
203
+ rotateX(rad) {
204
+ quat_rotateX(this, this, rad);
205
+ return this.check();
206
+ }
207
+ // Rotates a quaternion by the given angle about the Y axis
208
+ rotateY(rad) {
209
+ quat_rotateY(this, this, rad);
210
+ return this.check();
211
+ }
212
+ // Rotates a quaternion by the given angle about the Z axis
213
+ rotateZ(rad) {
214
+ quat_rotateZ(this, this, rad);
215
+ return this.check();
216
+ }
217
+ // Scales a quat by a scalar number
218
+ scale(b) {
219
+ quat_scale(this, this, b);
220
+ return this.check();
221
+ }
222
+ // Performs a spherical linear interpolation between two quat
223
+ slerp(arg0, arg1, arg2) {
224
+ let start;
225
+ let target;
226
+ let ratio;
227
+ // eslint-disable-next-line prefer-rest-params
228
+ switch (arguments.length) {
229
+ case 1: // Deprecated signature ({start, target, ratio})
230
+ // eslint-disable-next-line prefer-rest-params
231
+ ({
232
+ start = IDENTITY_QUATERNION,
233
+ target,
234
+ ratio
235
+ } = arg0);
236
+ break;
237
+ case 2: // THREE.js compatibility signature (target, ration)
238
+ start = this; // eslint-disable-line
239
+ target = arg0;
240
+ ratio = arg1;
241
+ break;
242
+ default:
243
+ // Default signature: (start, target, ratio)
244
+ start = arg0;
245
+ target = arg1;
246
+ ratio = arg2;
247
+ }
248
+ quat_slerp(this, start, target, ratio);
249
+ return this.check();
250
+ }
251
+ transformVector4(vector, result = new Vector4()) {
252
+ vec4_transformQuat(result, vector, this);
253
+ return checkVector(result, 4);
254
+ }
255
+ // THREE.js Math API compatibility
256
+ lengthSq() {
257
+ return this.lengthSquared();
258
+ }
259
+ setFromAxisAngle(axis, rad) {
260
+ return this.setAxisAngle(axis, rad);
261
+ }
262
+ premultiply(a) {
263
+ return this.multiplyLeft(a);
264
+ }
265
+ multiply(a) {
266
+ return this.multiplyRight(a);
267
+ }
239
268
  }
240
- //# sourceMappingURL=quaternion.js.map
@@ -1,6 +1,6 @@
1
1
  import { NumericArray } from '@math.gl/types';
2
- import { Vector3 } from './vector3';
3
- declare type SphericalCoordinatesOptions = {
2
+ import { Vector3 } from "./vector3.js";
3
+ type SphericalCoordinatesOptions = {
4
4
  phi?: number;
5
5
  theta?: number;
6
6
  radius?: number;
@@ -9,7 +9,7 @@ declare type SphericalCoordinatesOptions = {
9
9
  altitude?: number;
10
10
  radiusScale?: number;
11
11
  };
12
- declare type FormatOptions = {
12
+ type FormatOptions = {
13
13
  printTypes?: boolean;
14
14
  };
15
15
  /**
@@ -57,4 +57,3 @@ export declare class SphericalCoordinates {
57
57
  check(): this;
58
58
  }
59
59
  export {};
60
- //# sourceMappingURL=spherical-coordinates.d.ts.map