@math.gl/core 4.0.0-alpha.4 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -15,4 +15,16 @@ export { config, configure, formatValue, isArray, clone, equals, exactEquals, to
15
15
  export { SphericalCoordinates as _SphericalCoordinates } from './classes/spherical-coordinates';
16
16
  export { Pose as _Pose } from './classes/pose';
17
17
  export { Euler as _Euler } from './classes/euler';
18
+ /** @deprecated Use Matrix3 */
19
+ export * as mat3 from './gl-matrix/mat3';
20
+ /** @deprecated Use Matrix4 */
21
+ export * as mat4 from './gl-matrix/mat4';
22
+ /** @deprecated Use Quaterinion */
23
+ export * as quat from './gl-matrix/quat';
24
+ /** @deprecated UseVector */
25
+ export * as vec2 from './gl-matrix/vec2';
26
+ /** @deprecated Use Vector3 */
27
+ export * as vec3 from './gl-matrix/vec3';
28
+ /** @deprecated Use Vector4 */
29
+ export * as vec4 from './gl-matrix/vec4';
18
30
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,YAAY,EAAC,UAAU,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAE7D,YAAY,EAAC,YAAY,EAAE,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAGjE,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAGhD,OAAO,EAAC,oBAAoB,EAAC,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAC,IAAI,EAAC,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAC,KAAK,EAAC,MAAM,iBAAiB,CAAC;AAEtC,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAG/C,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEpC,OAAO,EAEL,MAAM,EACN,SAAS,EACT,WAAW,EACX,OAAO,EACP,KAAK,EACL,MAAM,EACN,WAAW,EACX,SAAS,EACT,SAAS,EAET,OAAO,EACP,OAAO,EACP,GAAG,EACH,GAAG,EACH,GAAG,EACH,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,WAAW,EACZ,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAC,oBAAoB,IAAI,qBAAqB,EAAC,MAAM,iCAAiC,CAAC;AAC9F,OAAO,EAAC,IAAI,IAAI,KAAK,EAAC,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAC,KAAK,IAAI,MAAM,EAAC,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,YAAY,EAAC,UAAU,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAE7D,YAAY,EAAC,YAAY,EAAE,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAGjE,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAGhD,OAAO,EAAC,oBAAoB,EAAC,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAC,IAAI,EAAC,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAC,KAAK,EAAC,MAAM,iBAAiB,CAAC;AAEtC,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAG/C,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEpC,OAAO,EAEL,MAAM,EACN,SAAS,EACT,WAAW,EACX,OAAO,EACP,KAAK,EACL,MAAM,EACN,WAAW,EACX,SAAS,EACT,SAAS,EAET,OAAO,EACP,OAAO,EACP,GAAG,EACH,GAAG,EACH,GAAG,EACH,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,WAAW,EACZ,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAC,oBAAoB,IAAI,qBAAqB,EAAC,MAAM,iCAAiC,CAAC;AAC9F,OAAO,EAAC,IAAI,IAAI,KAAK,EAAC,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAC,KAAK,IAAI,MAAM,EAAC,MAAM,iBAAiB,CAAC;AAEhD,8BAA8B;AAC9B,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,8BAA8B;AAC9B,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,kCAAkC;AAClC,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,4BAA4B;AAC5B,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,8BAA8B;AAC9B,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,8BAA8B;AAC9B,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC"}
package/dist/index.js CHANGED
@@ -14,4 +14,16 @@ export { config, configure, formatValue, isArray, clone, equals, exactEquals, to
14
14
  export { SphericalCoordinates as _SphericalCoordinates } from "./classes/spherical-coordinates.js";
15
15
  export { Pose as _Pose } from "./classes/pose.js";
16
16
  export { Euler as _Euler } from "./classes/euler.js";
17
+ import * as _mat from "./gl-matrix/mat3.js";
18
+ export { _mat as mat3 };
19
+ import * as _mat2 from "./gl-matrix/mat4.js";
20
+ export { _mat2 as mat4 };
21
+ import * as _quat from "./gl-matrix/quat.js";
22
+ export { _quat as quat };
23
+ import * as _vec from "./gl-matrix/vec2.js";
24
+ export { _vec as vec2 };
25
+ import * as _vec2 from "./gl-matrix/vec3.js";
26
+ export { _vec2 as vec3 };
27
+ import * as _vec3 from "./gl-matrix/vec4.js";
28
+ export { _vec3 as vec4 };
17
29
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["Vector2","Vector3","Vector4","Matrix3","Matrix4","Quaternion","SphericalCoordinates","Pose","Euler","assert","config","configure","formatValue","isArray","clone","equals","exactEquals","toRadians","toDegrees","radians","degrees","sin","cos","tan","asin","acos","atan","clamp","lerp","withEpsilon","_SphericalCoordinates","_Pose","_Euler"],"mappings":"SAQQA,O;SACAC,O;SACAC,O;SACAC,O;SACAC,O;SACAC,U;SAGAC,oB;SACAC,I;SACAC,K;;;SAKAC,M;SAINC,M,EACAC,S,EACAC,W,EACAC,O,EACAC,K,EACAC,M,EACAC,W,EACAC,S,EACAC,S,EAEAC,O,EACAC,O,EACAC,G,EACAC,G,EACAC,G,EACAC,I,EACAC,I,EACAC,I,EACAC,K,EACAC,I,EACAC,W;SAIMvB,oBAAoB,IAAIwB,qB;SACxBvB,IAAI,IAAIwB,K;SACRvB,KAAK,IAAIwB,M","sourcesContent":["// luma.gl, MIT license\n\n// types\nexport type {TypedArray, NumericArray} from '@math.gl/types';\n\nexport type {isTypedArray, isNumericArray} from '@math.gl/types';\n\n// classes\nexport {Vector2} from './classes/vector2';\nexport {Vector3} from './classes/vector3';\nexport {Vector4} from './classes/vector4';\nexport {Matrix3} from './classes/matrix3';\nexport {Matrix4} from './classes/matrix4';\nexport {Quaternion} from './classes/quaternion';\n\n// experimental\nexport {SphericalCoordinates} from './classes/spherical-coordinates';\nexport {Pose} from './classes/pose';\nexport {Euler} from './classes/euler';\n\nexport * as _MathUtils from './lib/math-utils';\n\n// lib\nexport {assert} from './lib/assert';\n\nexport {\n // math.gl global utility methods\n config,\n configure,\n formatValue,\n isArray,\n clone,\n equals,\n exactEquals,\n toRadians,\n toDegrees,\n // math.gl \"GLSL\"-style functions\n radians,\n degrees,\n sin,\n cos,\n tan,\n asin,\n acos,\n atan,\n clamp,\n lerp,\n withEpsilon\n} from './lib/common';\n\n// DEPRECATED\nexport {SphericalCoordinates as _SphericalCoordinates} from './classes/spherical-coordinates';\nexport {Pose as _Pose} from './classes/pose';\nexport {Euler as _Euler} from './classes/euler';\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../src/index.ts"],"names":["Vector2","Vector3","Vector4","Matrix3","Matrix4","Quaternion","SphericalCoordinates","Pose","Euler","assert","config","configure","formatValue","isArray","clone","equals","exactEquals","toRadians","toDegrees","radians","degrees","sin","cos","tan","asin","acos","atan","clamp","lerp","withEpsilon","_SphericalCoordinates","_Pose","_Euler","mat3","mat4","quat","vec2","vec3","vec4"],"mappings":"SAQQA,O;SACAC,O;SACAC,O;SACAC,O;SACAC,O;SACAC,U;SAGAC,oB;SACAC,I;SACAC,K;;;SAKAC,M;SAINC,M,EACAC,S,EACAC,W,EACAC,O,EACAC,K,EACAC,M,EACAC,W,EACAC,S,EACAC,S,EAEAC,O,EACAC,O,EACAC,G,EACAC,G,EACAC,G,EACAC,I,EACAC,I,EACAC,I,EACAC,K,EACAC,I,EACAC,W;SAIMvB,oBAAoB,IAAIwB,qB;SACxBvB,IAAI,IAAIwB,K;SACRvB,KAAK,IAAIwB,M;;iBAGLC,I;;kBAEAC,I;;kBAEAC,I;;iBAEAC,I;;kBAEAC,I;;kBAEAC,I","sourcesContent":["// luma.gl, MIT license\n\n// types\nexport type {TypedArray, NumericArray} from '@math.gl/types';\n\nexport type {isTypedArray, isNumericArray} from '@math.gl/types';\n\n// classes\nexport {Vector2} from './classes/vector2';\nexport {Vector3} from './classes/vector3';\nexport {Vector4} from './classes/vector4';\nexport {Matrix3} from './classes/matrix3';\nexport {Matrix4} from './classes/matrix4';\nexport {Quaternion} from './classes/quaternion';\n\n// experimental\nexport {SphericalCoordinates} from './classes/spherical-coordinates';\nexport {Pose} from './classes/pose';\nexport {Euler} from './classes/euler';\n\nexport * as _MathUtils from './lib/math-utils';\n\n// lib\nexport {assert} from './lib/assert';\n\nexport {\n // math.gl global utility methods\n config,\n configure,\n formatValue,\n isArray,\n clone,\n equals,\n exactEquals,\n toRadians,\n toDegrees,\n // math.gl \"GLSL\"-style functions\n radians,\n degrees,\n sin,\n cos,\n tan,\n asin,\n acos,\n atan,\n clamp,\n lerp,\n withEpsilon\n} from './lib/common';\n\n// DEPRECATED\nexport {SphericalCoordinates as _SphericalCoordinates} from './classes/spherical-coordinates';\nexport {Pose as _Pose} from './classes/pose';\nexport {Euler as _Euler} from './classes/euler';\n\n/** @deprecated Use Matrix3 */\nexport * as mat3 from './gl-matrix/mat3';\n/** @deprecated Use Matrix4 */\nexport * as mat4 from './gl-matrix/mat4';\n/** @deprecated Use Quaterinion */\nexport * as quat from './gl-matrix/quat';\n/** @deprecated UseVector */\nexport * as vec2 from './gl-matrix/vec2';\n/** @deprecated Use Vector3 */\nexport * as vec3 from './gl-matrix/vec3';\n/** @deprecated Use Vector4 */\nexport * as vec4 from './gl-matrix/vec4';\n"],"file":"index.js"}
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
9
- "version": "4.0.0-alpha.4",
9
+ "version": "4.0.0",
10
10
  "keywords": [
11
11
  "webgl",
12
12
  "javascript",
@@ -46,7 +46,7 @@
46
46
  ],
47
47
  "dependencies": {
48
48
  "@babel/runtime": "^7.12.0",
49
- "@math.gl/types": "4.0.0-alpha.4"
49
+ "@math.gl/types": "4.0.0"
50
50
  },
51
- "gitHead": "c58e63bfb9c25cd5a4fb2599b2b52c272ed55c67"
51
+ "gitHead": "b7af99a25965af5112307552084fbaf5d4d53b7d"
52
52
  }
@@ -1,6 +1,7 @@
1
1
  // @eslint-disable
2
2
  // @ts-nocheck
3
3
 
4
+ import type {NumericArray} from '@math.gl/types';
4
5
  import * as glMatrix from './common.js';
5
6
 
6
7
  /**
@@ -11,7 +12,7 @@ import * as glMatrix from './common.js';
11
12
  /**
12
13
  * Creates a new, empty vec2
13
14
  *
14
- * @returns {vec2} a new 2D vector
15
+ * @returns {NumericArray} a new 2D vector
15
16
  */
16
17
  export function create() {
17
18
  const out = new glMatrix.ARRAY_TYPE(2);
@@ -25,8 +26,8 @@ export function create() {
25
26
  /**
26
27
  * Creates a new vec2 initialized with values from an existing vector
27
28
  *
28
- * @param {ReadonlyVec2} a vector to clone
29
- * @returns {vec2} a new 2D vector
29
+ * @param {Readonly<NumericArray>} a vector to clone
30
+ * @returns {NumericArray} a new 2D vector
30
31
  */
31
32
  export function clone(a) {
32
33
  const out = new glMatrix.ARRAY_TYPE(2);
@@ -40,7 +41,7 @@ export function clone(a) {
40
41
  *
41
42
  * @param {Number} x X component
42
43
  * @param {Number} y Y component
43
- * @returns {vec2} a new 2D vector
44
+ * @returns {NumericArray} a new 2D vector
44
45
  */
45
46
  export function fromValues(x, y) {
46
47
  const out = new glMatrix.ARRAY_TYPE(2);
@@ -52,9 +53,9 @@ export function fromValues(x, y) {
52
53
  /**
53
54
  * Copy the values from one vec2 to another
54
55
  *
55
- * @param {vec2} out the receiving vector
56
- * @param {ReadonlyVec2} a the source vector
57
- * @returns {vec2} out
56
+ * @param {NumericArray} out the receiving vector
57
+ * @param {Readonly<NumericArray>} a the source vector
58
+ * @returns {NumericArray} out
58
59
  */
59
60
  export function copy(out, a) {
60
61
  out[0] = a[0];
@@ -65,10 +66,10 @@ export function copy(out, a) {
65
66
  /**
66
67
  * Set the components of a vec2 to the given values
67
68
  *
68
- * @param {vec2} out the receiving vector
69
+ * @param {NumericArray} out the receiving vector
69
70
  * @param {Number} x X component
70
71
  * @param {Number} y Y component
71
- * @returns {vec2} out
72
+ * @returns {NumericArray} out
72
73
  */
73
74
  export function set(out, x, y) {
74
75
  out[0] = x;
@@ -79,10 +80,10 @@ export function set(out, x, y) {
79
80
  /**
80
81
  * Adds two vec2's
81
82
  *
82
- * @param {vec2} out the receiving vector
83
- * @param {ReadonlyVec2} a the first operand
84
- * @param {ReadonlyVec2} b the second operand
85
- * @returns {vec2} out
83
+ * @param {NumericArray} out the receiving vector
84
+ * @param {Readonly<NumericArray>} a the first operand
85
+ * @param {Readonly<NumericArray>} b the second operand
86
+ * @returns {NumericArray} out
86
87
  */
87
88
  export function add(out, a, b) {
88
89
  out[0] = a[0] + b[0];
@@ -93,10 +94,10 @@ export function add(out, a, b) {
93
94
  /**
94
95
  * Subtracts vector b from vector a
95
96
  *
96
- * @param {vec2} out the receiving vector
97
- * @param {ReadonlyVec2} a the first operand
98
- * @param {ReadonlyVec2} b the second operand
99
- * @returns {vec2} out
97
+ * @param {NumericArray} out the receiving vector
98
+ * @param {Readonly<NumericArray>} a the first operand
99
+ * @param {Readonly<NumericArray>} b the second operand
100
+ * @returns {NumericArray} out
100
101
  */
101
102
  export function subtract(out, a, b) {
102
103
  out[0] = a[0] - b[0];
@@ -107,10 +108,10 @@ export function subtract(out, a, b) {
107
108
  /**
108
109
  * Multiplies two vec2's
109
110
  *
110
- * @param {vec2} out the receiving vector
111
- * @param {ReadonlyVec2} a the first operand
112
- * @param {ReadonlyVec2} b the second operand
113
- * @returns {vec2} out
111
+ * @param {NumericArray} out the receiving vector
112
+ * @param {Readonly<NumericArray>} a the first operand
113
+ * @param {Readonly<NumericArray>} b the second operand
114
+ * @returns {NumericArray} out
114
115
  */
115
116
  export function multiply(out, a, b) {
116
117
  out[0] = a[0] * b[0];
@@ -121,10 +122,10 @@ export function multiply(out, a, b) {
121
122
  /**
122
123
  * Divides two vec2's
123
124
  *
124
- * @param {vec2} out the receiving vector
125
- * @param {ReadonlyVec2} a the first operand
126
- * @param {ReadonlyVec2} b the second operand
127
- * @returns {vec2} out
125
+ * @param {NumericArray} out the receiving vector
126
+ * @param {Readonly<NumericArray>} a the first operand
127
+ * @param {Readonly<NumericArray>} b the second operand
128
+ * @returns {NumericArray} out
128
129
  */
129
130
  export function divide(out, a, b) {
130
131
  out[0] = a[0] / b[0];
@@ -135,9 +136,9 @@ export function divide(out, a, b) {
135
136
  /**
136
137
  * Math.ceil the components of a vec2
137
138
  *
138
- * @param {vec2} out the receiving vector
139
- * @param {ReadonlyVec2} a vector to ceil
140
- * @returns {vec2} out
139
+ * @param {NumericArray} out the receiving vector
140
+ * @param {Readonly<NumericArray>} a vector to ceil
141
+ * @returns {NumericArray} out
141
142
  */
142
143
  export function ceil(out, a) {
143
144
  out[0] = Math.ceil(a[0]);
@@ -148,9 +149,9 @@ export function ceil(out, a) {
148
149
  /**
149
150
  * Math.floor the components of a vec2
150
151
  *
151
- * @param {vec2} out the receiving vector
152
- * @param {ReadonlyVec2} a vector to floor
153
- * @returns {vec2} out
152
+ * @param {NumericArray} out the receiving vector
153
+ * @param {Readonly<NumericArray>} a vector to floor
154
+ * @returns {NumericArray} out
154
155
  */
155
156
  export function floor(out, a) {
156
157
  out[0] = Math.floor(a[0]);
@@ -161,10 +162,10 @@ export function floor(out, a) {
161
162
  /**
162
163
  * Returns the minimum of two vec2's
163
164
  *
164
- * @param {vec2} out the receiving vector
165
- * @param {ReadonlyVec2} a the first operand
166
- * @param {ReadonlyVec2} b the second operand
167
- * @returns {vec2} out
165
+ * @param {NumericArray} out the receiving vector
166
+ * @param {Readonly<NumericArray>} a the first operand
167
+ * @param {Readonly<NumericArray>} b the second operand
168
+ * @returns {NumericArray} out
168
169
  */
169
170
  export function min(out, a, b) {
170
171
  out[0] = Math.min(a[0], b[0]);
@@ -175,10 +176,10 @@ export function min(out, a, b) {
175
176
  /**
176
177
  * Returns the maximum of two vec2's
177
178
  *
178
- * @param {vec2} out the receiving vector
179
- * @param {ReadonlyVec2} a the first operand
180
- * @param {ReadonlyVec2} b the second operand
181
- * @returns {vec2} out
179
+ * @param {NumericArray} out the receiving vector
180
+ * @param {Readonly<NumericArray>} a the first operand
181
+ * @param {Readonly<NumericArray>} b the second operand
182
+ * @returns {NumericArray} out
182
183
  */
183
184
  export function max(out, a, b) {
184
185
  out[0] = Math.max(a[0], b[0]);
@@ -189,9 +190,9 @@ export function max(out, a, b) {
189
190
  /**
190
191
  * symmetric round the components of a vec2
191
192
  *
192
- * @param {vec2} out the receiving vector
193
- * @param {ReadonlyVec2} a vector to round
194
- * @returns {vec2} out
193
+ * @param {NumericArray} out the receiving vector
194
+ * @param {Readonly<NumericArray>} a vector to round
195
+ * @returns {NumericArray} out
195
196
  */
196
197
  export function round(out, a) {
197
198
  out[0] = glMatrix.round(a[0]);
@@ -202,10 +203,10 @@ export function round(out, a) {
202
203
  /**
203
204
  * Scales a vec2 by a scalar number
204
205
  *
205
- * @param {vec2} out the receiving vector
206
- * @param {ReadonlyVec2} a the vector to scale
206
+ * @param {NumericArray} out the receiving vector
207
+ * @param {Readonly<NumericArray>} a the vector to scale
207
208
  * @param {Number} b amount to scale the vector by
208
- * @returns {vec2} out
209
+ * @returns {NumericArray} out
209
210
  */
210
211
  export function scale(out, a, b) {
211
212
  out[0] = a[0] * b;
@@ -216,11 +217,11 @@ export function scale(out, a, b) {
216
217
  /**
217
218
  * Adds two vec2's after scaling the second operand by a scalar value
218
219
  *
219
- * @param {vec2} out the receiving vector
220
- * @param {ReadonlyVec2} a the first operand
221
- * @param {ReadonlyVec2} b the second operand
220
+ * @param {NumericArray} out the receiving vector
221
+ * @param {Readonly<NumericArray>} a the first operand
222
+ * @param {Readonly<NumericArray>} b the second operand
222
223
  * @param {Number} scale the amount to scale b by before adding
223
- * @returns {vec2} out
224
+ * @returns {NumericArray} out
224
225
  */
225
226
  export function scaleAndAdd(out, a, b, scale) {
226
227
  out[0] = a[0] + b[0] * scale;
@@ -231,8 +232,8 @@ export function scaleAndAdd(out, a, b, scale) {
231
232
  /**
232
233
  * Calculates the euclidian distance between two vec2's
233
234
  *
234
- * @param {ReadonlyVec2} a the first operand
235
- * @param {ReadonlyVec2} b the second operand
235
+ * @param {Readonly<NumericArray>} a the first operand
236
+ * @param {Readonly<NumericArray>} b the second operand
236
237
  * @returns {Number} distance between a and b
237
238
  */
238
239
  export function distance(a, b) {
@@ -244,8 +245,8 @@ export function distance(a, b) {
244
245
  /**
245
246
  * Calculates the squared euclidian distance between two vec2's
246
247
  *
247
- * @param {ReadonlyVec2} a the first operand
248
- * @param {ReadonlyVec2} b the second operand
248
+ * @param {Readonly<NumericArray>} a the first operand
249
+ * @param {Readonly<NumericArray>} b the second operand
249
250
  * @returns {Number} squared distance between a and b
250
251
  */
251
252
  export function squaredDistance(a, b) {
@@ -257,7 +258,7 @@ export function squaredDistance(a, b) {
257
258
  /**
258
259
  * Calculates the length of a vec2
259
260
  *
260
- * @param {ReadonlyVec2} a vector to calculate length of
261
+ * @param {Readonly<NumericArray>} a vector to calculate length of
261
262
  * @returns {Number} length of a
262
263
  */
263
264
  export function length(a) {
@@ -269,7 +270,7 @@ export function length(a) {
269
270
  /**
270
271
  * Calculates the squared length of a vec2
271
272
  *
272
- * @param {ReadonlyVec2} a vector to calculate squared length of
273
+ * @param {Readonly<NumericArray>} a vector to calculate squared length of
273
274
  * @returns {Number} squared length of a
274
275
  */
275
276
  export function squaredLength(a) {
@@ -281,9 +282,9 @@ export function squaredLength(a) {
281
282
  /**
282
283
  * Negates the components of a vec2
283
284
  *
284
- * @param {vec2} out the receiving vector
285
- * @param {ReadonlyVec2} a vector to negate
286
- * @returns {vec2} out
285
+ * @param {NumericArray} out the receiving vector
286
+ * @param {Readonly<NumericArray>} a vector to negate
287
+ * @returns {NumericArray} out
287
288
  */
288
289
  export function negate(out, a) {
289
290
  out[0] = -a[0];
@@ -294,9 +295,9 @@ export function negate(out, a) {
294
295
  /**
295
296
  * Returns the inverse of the components of a vec2
296
297
  *
297
- * @param {vec2} out the receiving vector
298
- * @param {ReadonlyVec2} a vector to invert
299
- * @returns {vec2} out
298
+ * @param {NumericArray} out the receiving vector
299
+ * @param {Readonly<NumericArray>} a vector to invert
300
+ * @returns {NumericArray} out
300
301
  */
301
302
  export function inverse(out, a) {
302
303
  out[0] = 1.0 / a[0];
@@ -307,9 +308,9 @@ export function inverse(out, a) {
307
308
  /**
308
309
  * Normalize a vec2
309
310
  *
310
- * @param {vec2} out the receiving vector
311
- * @param {ReadonlyVec2} a vector to normalize
312
- * @returns {vec2} out
311
+ * @param {NumericArray} out the receiving vector
312
+ * @param {Readonly<NumericArray>} a vector to normalize
313
+ * @returns {NumericArray} out
313
314
  */
314
315
  export function normalize(out, a) {
315
316
  const x = a[0];
@@ -327,8 +328,8 @@ export function normalize(out, a) {
327
328
  /**
328
329
  * Calculates the dot product of two vec2's
329
330
  *
330
- * @param {ReadonlyVec2} a the first operand
331
- * @param {ReadonlyVec2} b the second operand
331
+ * @param {Readonly<NumericArray>} a the first operand
332
+ * @param {Readonly<NumericArray>} b the second operand
332
333
  * @returns {Number} dot product of a and b
333
334
  */
334
335
  export function dot(a, b) {
@@ -340,8 +341,8 @@ export function dot(a, b) {
340
341
  * Note that the cross product must by definition produce a 3D vector
341
342
  *
342
343
  * @param {vec3} out the receiving vector
343
- * @param {ReadonlyVec2} a the first operand
344
- * @param {ReadonlyVec2} b the second operand
344
+ * @param {Readonly<NumericArray>} a the first operand
345
+ * @param {Readonly<NumericArray>} b the second operand
345
346
  * @returns {vec3} out
346
347
  */
347
348
  export function cross(out, a, b) {
@@ -354,11 +355,11 @@ export function cross(out, a, b) {
354
355
  /**
355
356
  * Performs a linear interpolation between two vec2's
356
357
  *
357
- * @param {vec2} out the receiving vector
358
- * @param {ReadonlyVec2} a the first operand
359
- * @param {ReadonlyVec2} b the second operand
358
+ * @param {NumericArray} out the receiving vector
359
+ * @param {Readonly<NumericArray>} a the first operand
360
+ * @param {Readonly<NumericArray>} b the second operand
360
361
  * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
361
- * @returns {vec2} out
362
+ * @returns {NumericArray} out
362
363
  */
363
364
  export function lerp(out, a, b, t) {
364
365
  const ax = a[0];
@@ -371,9 +372,9 @@ export function lerp(out, a, b, t) {
371
372
  /**
372
373
  * Generates a random vector with the given scale
373
374
  *
374
- * @param {vec2} out the receiving vector
375
+ * @param {NumericArray} out the receiving vector
375
376
  * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned
376
- * @returns {vec2} out
377
+ * @returns {NumericArray} out
377
378
  */
378
379
  export function random(out, scale) {
379
380
  scale = scale === undefined ? 1.0 : scale;
@@ -386,10 +387,10 @@ export function random(out, scale) {
386
387
  /**
387
388
  * Transforms the vec2 with a mat2
388
389
  *
389
- * @param {vec2} out the receiving vector
390
- * @param {ReadonlyVec2} a the vector to transform
390
+ * @param {NumericArray} out the receiving vector
391
+ * @param {Readonly<NumericArray>} a the vector to transform
391
392
  * @param {ReadonlyMat2} m matrix to transform with
392
- * @returns {vec2} out
393
+ * @returns {NumericArray} out
393
394
  */
394
395
  export function transformMat2(out, a, m) {
395
396
  const x = a[0];
@@ -402,10 +403,10 @@ export function transformMat2(out, a, m) {
402
403
  /**
403
404
  * Transforms the vec2 with a mat2d
404
405
  *
405
- * @param {vec2} out the receiving vector
406
- * @param {ReadonlyVec2} a the vector to transform
406
+ * @param {NumericArray} out the receiving vector
407
+ * @param {Readonly<NumericArray>} a the vector to transform
407
408
  * @param {ReadonlyMat2d} m matrix to transform with
408
- * @returns {vec2} out
409
+ * @returns {NumericArray} out
409
410
  */
410
411
  export function transformMat2d(out, a, m) {
411
412
  const x = a[0];
@@ -419,10 +420,10 @@ export function transformMat2d(out, a, m) {
419
420
  * Transforms the vec2 with a mat3
420
421
  * 3rd vector component is implicitly '1'
421
422
  *
422
- * @param {vec2} out the receiving vector
423
- * @param {ReadonlyVec2} a the vector to transform
423
+ * @param {NumericArray} out the receiving vector
424
+ * @param {Readonly<NumericArray>} a the vector to transform
424
425
  * @param {ReadonlyMat3} m matrix to transform with
425
- * @returns {vec2} out
426
+ * @returns {NumericArray} out
426
427
  */
427
428
  export function transformMat3(out, a, m) {
428
429
  const x = a[0];
@@ -437,10 +438,10 @@ export function transformMat3(out, a, m) {
437
438
  * 3rd vector component is implicitly '0'
438
439
  * 4th vector component is implicitly '1'
439
440
  *
440
- * @param {vec2} out the receiving vector
441
- * @param {ReadonlyVec2} a the vector to transform
441
+ * @param {NumericArray} out the receiving vector
442
+ * @param {Readonly<NumericArray>} a the vector to transform
442
443
  * @param {ReadonlyMat4} m matrix to transform with
443
- * @returns {vec2} out
444
+ * @returns {NumericArray} out
444
445
  */
445
446
  export function transformMat4(out, a, m) {
446
447
  const x = a[0];
@@ -452,11 +453,11 @@ export function transformMat4(out, a, m) {
452
453
 
453
454
  /**
454
455
  * Rotate a 2D vector
455
- * @param {vec2} out The receiving vec2
456
- * @param {ReadonlyVec2} a The vec2 point to rotate
457
- * @param {ReadonlyVec2} b The origin of the rotation
456
+ * @param {NumericArray} out The receiving vec2
457
+ * @param {Readonly<NumericArray>} a The vec2 point to rotate
458
+ * @param {Readonly<NumericArray>} b The origin of the rotation
458
459
  * @param {Number} rad The angle of rotation in radians
459
- * @returns {vec2} out
460
+ * @returns {NumericArray} out
460
461
  */
461
462
  export function rotate(out, a, b, rad) {
462
463
  // Translate point to the origin
@@ -474,8 +475,8 @@ export function rotate(out, a, b, rad) {
474
475
 
475
476
  /**
476
477
  * Get the angle between two 2D vectors
477
- * @param {ReadonlyVec2} a The first operand
478
- * @param {ReadonlyVec2} b The second operand
478
+ * @param {Readonly<NumericArray>} a The first operand
479
+ * @param {Readonly<NumericArray>} b The second operand
479
480
  * @returns {Number} The angle in radians
480
481
  */
481
482
  export function angle(a, b) {
@@ -494,8 +495,8 @@ export function angle(a, b) {
494
495
  /**
495
496
  * Set the components of a vec2 to zero
496
497
  *
497
- * @param {vec2} out the receiving vector
498
- * @returns {vec2} out
498
+ * @param {NumericArray} out the receiving vector
499
+ * @returns {NumericArray} out
499
500
  */
500
501
  export function zero(out) {
501
502
  out[0] = 0.0;
@@ -506,7 +507,7 @@ export function zero(out) {
506
507
  /**
507
508
  * Returns a string representation of a vector
508
509
  *
509
- * @param {ReadonlyVec2} a vector to represent as a string
510
+ * @param {Readonly<NumericArray>} a vector to represent as a string
510
511
  * @returns {String} string representation of the vector
511
512
  */
512
513
  export function str(a) {
@@ -516,8 +517,8 @@ export function str(a) {
516
517
  /**
517
518
  * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)
518
519
  *
519
- * @param {ReadonlyVec2} a The first vector.
520
- * @param {ReadonlyVec2} b The second vector.
520
+ * @param {Readonly<NumericArray>} a The first vector.
521
+ * @param {Readonly<NumericArray>} b The second vector.
521
522
  * @returns {Boolean} True if the vectors are equal, false otherwise.
522
523
  */
523
524
  export function exactEquals(a, b) {
@@ -527,8 +528,8 @@ export function exactEquals(a, b) {
527
528
  /**
528
529
  * Returns whether or not the vectors have approximately the same elements in the same position.
529
530
  *
530
- * @param {ReadonlyVec2} a The first vector.
531
- * @param {ReadonlyVec2} b The second vector.
531
+ * @param {Readonly<NumericArray>} a The first vector.
532
+ * @param {Readonly<NumericArray>} b The second vector.
532
533
  * @returns {Boolean} True if the vectors are equal, false otherwise.
533
534
  */
534
535
  export function equals(a, b) {
package/src/index.ts CHANGED
@@ -52,3 +52,16 @@ export {
52
52
  export {SphericalCoordinates as _SphericalCoordinates} from './classes/spherical-coordinates';
53
53
  export {Pose as _Pose} from './classes/pose';
54
54
  export {Euler as _Euler} from './classes/euler';
55
+
56
+ /** @deprecated Use Matrix3 */
57
+ export * as mat3 from './gl-matrix/mat3';
58
+ /** @deprecated Use Matrix4 */
59
+ export * as mat4 from './gl-matrix/mat4';
60
+ /** @deprecated Use Quaterinion */
61
+ export * as quat from './gl-matrix/quat';
62
+ /** @deprecated UseVector */
63
+ export * as vec2 from './gl-matrix/vec2';
64
+ /** @deprecated Use Vector3 */
65
+ export * as vec3 from './gl-matrix/vec3';
66
+ /** @deprecated Use Vector4 */
67
+ export * as vec4 from './gl-matrix/vec4';
@@ -10,6 +10,7 @@ type NumericArray =
10
10
  | Float64Array
11
11
  | number[];
12
12
 
13
+ /*
13
14
  declare module 'gl-matrix/vec2' {
14
15
  function length(a: Readonly<NumericArray>): number;
15
16
  function negate<T extends NumericArray>(out: T, a: Readonly<NumericArray>): T;
@@ -264,3 +265,4 @@ declare module 'gl-matrix/quat' {
264
265
  function rotateY<T extends NumericArray>(out: T, a: Readonly<NumericArray>, rad: number): T;
265
266
  function rotateZ<T extends NumericArray>(out: T, a: Readonly<NumericArray>, rad: number): T;
266
267
  }
268
+ */
File without changes
File without changes
File without changes
File without changes