@math.gl/core 3.6.0-alpha.1 → 3.6.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.
Files changed (188) hide show
  1. package/dist/classes/base/math-array.d.ts +61 -31
  2. package/dist/classes/base/math-array.d.ts.map +1 -1
  3. package/dist/classes/base/math-array.js +67 -65
  4. package/dist/classes/base/matrix.d.ts +12 -10
  5. package/dist/classes/base/matrix.d.ts.map +1 -1
  6. package/dist/classes/base/matrix.js +2 -10
  7. package/dist/classes/base/vector.d.ts +37 -25
  8. package/dist/classes/base/vector.d.ts.map +1 -1
  9. package/dist/classes/base/vector.js +17 -24
  10. package/dist/classes/euler.d.ts +59 -55
  11. package/dist/classes/euler.d.ts.map +1 -1
  12. package/dist/classes/euler.js +57 -77
  13. package/dist/classes/matrix3.d.ts +58 -41
  14. package/dist/classes/matrix3.d.ts.map +1 -1
  15. package/dist/classes/matrix3.js +68 -59
  16. package/dist/classes/matrix4.d.ts +214 -90
  17. package/dist/classes/matrix4.d.ts.map +1 -1
  18. package/dist/classes/matrix4.js +252 -171
  19. package/dist/classes/pose.d.ts +29 -26
  20. package/dist/classes/pose.d.ts.map +1 -1
  21. package/dist/classes/pose.js +6 -23
  22. package/dist/classes/quaternion.d.ts +61 -40
  23. package/dist/classes/quaternion.d.ts.map +1 -1
  24. package/dist/classes/quaternion.js +49 -53
  25. package/dist/classes/spherical-coordinates.d.ts +45 -25
  26. package/dist/classes/spherical-coordinates.d.ts.map +1 -1
  27. package/dist/classes/spherical-coordinates.js +30 -24
  28. package/dist/classes/vector2.d.ts +51 -15
  29. package/dist/classes/vector2.d.ts.map +1 -1
  30. package/dist/classes/vector2.js +29 -23
  31. package/dist/classes/vector3.d.ts +47 -32
  32. package/dist/classes/vector3.d.ts.map +1 -1
  33. package/dist/classes/vector3.js +16 -30
  34. package/dist/classes/vector4.d.ts +37 -19
  35. package/dist/classes/vector4.d.ts.map +1 -1
  36. package/dist/classes/vector4.js +12 -24
  37. package/dist/es5/classes/base/math-array.js +248 -179
  38. package/dist/es5/classes/base/math-array.js.map +1 -1
  39. package/dist/es5/classes/base/matrix.js +74 -54
  40. package/dist/es5/classes/base/matrix.js.map +1 -1
  41. package/dist/es5/classes/base/vector.js +167 -121
  42. package/dist/es5/classes/base/vector.js.map +1 -1
  43. package/dist/es5/classes/euler.js +575 -480
  44. package/dist/es5/classes/euler.js.map +1 -1
  45. package/dist/es5/classes/matrix3.js +234 -158
  46. package/dist/es5/classes/matrix3.js.map +1 -1
  47. package/dist/es5/classes/matrix4.js +510 -417
  48. package/dist/es5/classes/matrix4.js.map +1 -1
  49. package/dist/es5/classes/pose.js +126 -101
  50. package/dist/es5/classes/pose.js.map +1 -1
  51. package/dist/es5/classes/quaternion.js +285 -213
  52. package/dist/es5/classes/quaternion.js.map +1 -1
  53. package/dist/es5/classes/spherical-coordinates.js +170 -125
  54. package/dist/es5/classes/spherical-coordinates.js.map +1 -1
  55. package/dist/es5/classes/vector2.js +118 -76
  56. package/dist/es5/classes/vector2.js.map +1 -1
  57. package/dist/es5/classes/vector3.js +171 -119
  58. package/dist/es5/classes/vector3.js.map +1 -1
  59. package/dist/es5/classes/vector4.js +141 -94
  60. package/dist/es5/classes/vector4.js.map +1 -1
  61. package/dist/es5/index.js +34 -34
  62. package/dist/es5/lib/common.js +56 -30
  63. package/dist/es5/lib/common.js.map +1 -1
  64. package/dist/es5/lib/gl-matrix-extras.js +14 -14
  65. package/dist/es5/lib/gl-matrix-extras.js.map +1 -1
  66. package/dist/es5/lib/gl-matrix.d.js +2 -0
  67. package/dist/es5/lib/gl-matrix.d.js.map +1 -0
  68. package/dist/es5/lib/validators.js +5 -3
  69. package/dist/es5/lib/validators.js.map +1 -1
  70. package/dist/esm/classes/base/math-array.js +45 -47
  71. package/dist/esm/classes/base/math-array.js.map +1 -1
  72. package/dist/esm/classes/base/matrix.js +0 -11
  73. package/dist/esm/classes/base/matrix.js.map +1 -1
  74. package/dist/esm/classes/base/vector.js +0 -10
  75. package/dist/esm/classes/base/vector.js.map +1 -1
  76. package/dist/esm/classes/euler.js +61 -48
  77. package/dist/esm/classes/euler.js.map +1 -1
  78. package/dist/esm/classes/matrix3.js +55 -33
  79. package/dist/esm/classes/matrix3.js.map +1 -1
  80. package/dist/esm/classes/matrix4.js +156 -136
  81. package/dist/esm/classes/matrix4.js.map +1 -1
  82. package/dist/esm/classes/pose.js +8 -4
  83. package/dist/esm/classes/pose.js.map +1 -1
  84. package/dist/esm/classes/quaternion.js +37 -27
  85. package/dist/esm/classes/quaternion.js.map +1 -1
  86. package/dist/esm/classes/spherical-coordinates.js +15 -5
  87. package/dist/esm/classes/spherical-coordinates.js.map +1 -1
  88. package/dist/esm/classes/vector2.js.map +1 -1
  89. package/dist/esm/classes/vector3.js +7 -2
  90. package/dist/esm/classes/vector3.js.map +1 -1
  91. package/dist/esm/classes/vector4.js +7 -2
  92. package/dist/esm/classes/vector4.js.map +1 -1
  93. package/dist/esm/lib/common.js +8 -8
  94. package/dist/esm/lib/common.js.map +1 -1
  95. package/dist/esm/lib/gl-matrix-extras.js.map +1 -1
  96. package/dist/esm/lib/gl-matrix.d.js +2 -0
  97. package/dist/esm/lib/gl-matrix.d.js.map +1 -0
  98. package/dist/esm/lib/validators.js.map +1 -1
  99. package/dist/lib/common.d.ts +14 -11
  100. package/dist/lib/common.d.ts.map +1 -1
  101. package/dist/lib/common.js +10 -23
  102. package/dist/lib/gl-matrix-extras.d.ts +6 -5
  103. package/dist/lib/gl-matrix-extras.d.ts.map +1 -1
  104. package/dist/lib/gl-matrix-extras.js +0 -1
  105. package/dist/lib/validators.d.ts +5 -4
  106. package/dist/lib/validators.d.ts.map +1 -1
  107. package/dist/lib/validators.js +0 -19
  108. package/package.json +4 -4
  109. package/src/classes/base/math-array.ts +265 -0
  110. package/src/classes/base/{matrix.js → matrix.ts} +15 -19
  111. package/src/classes/base/{vector.js → vector.ts} +47 -54
  112. package/src/classes/{euler.js → euler.ts} +121 -221
  113. package/src/classes/matrix3.ts +253 -0
  114. package/src/classes/matrix4.ts +668 -0
  115. package/src/classes/{pose.js → pose.ts} +52 -49
  116. package/src/classes/{quaternion.js → quaternion.ts} +107 -95
  117. package/src/classes/{spherical-coordinates.js → spherical-coordinates.ts} +84 -54
  118. package/src/classes/vector2.ts +127 -0
  119. package/src/classes/{vector3.js → vector3.ts} +43 -55
  120. package/src/classes/{vector4.js → vector4.ts} +44 -48
  121. package/src/lib/common.ts +58 -37
  122. package/src/lib/gl-matrix-extras.ts +26 -5
  123. package/src/lib/gl-matrix.d.ts +266 -0
  124. package/src/lib/validators.ts +10 -6
  125. package/dist/es5/classes/base/math-array.d.js +0 -46
  126. package/dist/es5/classes/base/math-array.d.js.map +0 -1
  127. package/dist/es5/classes/base/matrix.d.js +0 -15
  128. package/dist/es5/classes/base/matrix.d.js.map +0 -1
  129. package/dist/es5/classes/base/vector.d.js +0 -24
  130. package/dist/es5/classes/base/vector.d.js.map +0 -1
  131. package/dist/es5/classes/euler.d.js +0 -45
  132. package/dist/es5/classes/euler.d.js.map +0 -1
  133. package/dist/es5/classes/matrix3.d.js +0 -25
  134. package/dist/es5/classes/matrix3.d.js.map +0 -1
  135. package/dist/es5/classes/matrix4.d.js +0 -25
  136. package/dist/es5/classes/matrix4.d.js.map +0 -1
  137. package/dist/es5/classes/pose.d.js +0 -25
  138. package/dist/es5/classes/pose.d.js.map +0 -1
  139. package/dist/es5/classes/quaternion.d.js +0 -27
  140. package/dist/es5/classes/quaternion.d.js.map +0 -1
  141. package/dist/es5/classes/spherical-coordinates.d.js +0 -27
  142. package/dist/es5/classes/spherical-coordinates.d.js.map +0 -1
  143. package/dist/es5/classes/vector2.d.js +0 -18
  144. package/dist/es5/classes/vector2.d.js.map +0 -1
  145. package/dist/es5/classes/vector3.d.js +0 -24
  146. package/dist/es5/classes/vector3.d.js.map +0 -1
  147. package/dist/es5/classes/vector4.d.js +0 -25
  148. package/dist/es5/classes/vector4.d.js.map +0 -1
  149. package/dist/esm/classes/base/math-array.d.js +0 -36
  150. package/dist/esm/classes/base/math-array.d.js.map +0 -1
  151. package/dist/esm/classes/base/matrix.d.js +0 -3
  152. package/dist/esm/classes/base/matrix.d.js.map +0 -1
  153. package/dist/esm/classes/base/vector.d.js +0 -13
  154. package/dist/esm/classes/base/vector.d.js.map +0 -1
  155. package/dist/esm/classes/euler.d.js +0 -55
  156. package/dist/esm/classes/euler.d.js.map +0 -1
  157. package/dist/esm/classes/matrix3.d.js +0 -15
  158. package/dist/esm/classes/matrix3.d.js.map +0 -1
  159. package/dist/esm/classes/matrix4.d.js +0 -15
  160. package/dist/esm/classes/matrix4.d.js.map +0 -1
  161. package/dist/esm/classes/pose.d.js +0 -18
  162. package/dist/esm/classes/pose.d.js.map +0 -1
  163. package/dist/esm/classes/quaternion.d.js +0 -19
  164. package/dist/esm/classes/quaternion.d.js.map +0 -1
  165. package/dist/esm/classes/spherical-coordinates.d.js +0 -22
  166. package/dist/esm/classes/spherical-coordinates.d.js.map +0 -1
  167. package/dist/esm/classes/vector2.d.js +0 -6
  168. package/dist/esm/classes/vector2.d.js.map +0 -1
  169. package/dist/esm/classes/vector3.d.js +0 -13
  170. package/dist/esm/classes/vector3.d.js.map +0 -1
  171. package/dist/esm/classes/vector4.d.js +0 -15
  172. package/dist/esm/classes/vector4.d.js.map +0 -1
  173. package/src/classes/base/math-array.d.ts +0 -55
  174. package/src/classes/base/math-array.js +0 -250
  175. package/src/classes/base/matrix.d.ts +0 -15
  176. package/src/classes/base/vector.d.ts +0 -45
  177. package/src/classes/euler.d.ts +0 -92
  178. package/src/classes/matrix3.d.ts +0 -91
  179. package/src/classes/matrix3.js +0 -225
  180. package/src/classes/matrix4.d.ts +0 -161
  181. package/src/classes/matrix4.js +0 -530
  182. package/src/classes/pose.d.ts +0 -92
  183. package/src/classes/quaternion.d.ts +0 -107
  184. package/src/classes/spherical-coordinates.d.ts +0 -87
  185. package/src/classes/vector2.d.ts +0 -65
  186. package/src/classes/vector2.js +0 -122
  187. package/src/classes/vector3.d.ts +0 -65
  188. package/src/classes/vector4.d.ts +0 -34
@@ -1,28 +1,10 @@
1
1
  // Copyright (c) 2017 Uber Technologies, Inc.
2
- //
3
- // Permission is hereby granted, free of charge, to any person obtaining a copy
4
- // of this software and associated documentation files (the "Software"), to deal
5
- // in the Software without restriction, including without limitation the rights
6
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- // copies of the Software, and to permit persons to whom the Software is
8
- // furnished to do so, subject to the following conditions:
9
- //
10
- // The above copyright notice and this permission notice shall be included in
11
- // all copies or substantial portions of the Software.
12
- //
13
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- // THE SOFTWARE.
2
+ // MIT License
20
3
  import Matrix4 from './matrix4';
21
4
  import Vector3 from './vector3';
22
5
  import Euler from './euler';
23
6
  export default class Pose {
24
- // @ts-ignore TS2740: Type '{}' is missing the following properties from type
25
- constructor({ x = 0, y = 0, z = 0, roll = 0, pitch = 0, yaw = 0, position = undefined, orientation = undefined } = {}) {
7
+ constructor({ x = 0, y = 0, z = 0, roll = 0, pitch = 0, yaw = 0, position, orientation } = {}) {
26
8
  if (Array.isArray(position) && position.length === 3) {
27
9
  this.position = new Vector3(position);
28
10
  }
@@ -30,6 +12,7 @@ export default class Pose {
30
12
  this.position = new Vector3(x, y, z);
31
13
  }
32
14
  if (Array.isArray(orientation) && orientation.length === 4) {
15
+ // @ts-expect-error
33
16
  this.orientation = new Euler(orientation, orientation[3]);
34
17
  }
35
18
  else {
@@ -91,14 +74,15 @@ export default class Pose {
91
74
  return (this.position.exactEquals(pose.position) && this.orientation.exactEquals(pose.orientation));
92
75
  }
93
76
  getTransformationMatrix() {
94
- // setup precomputations for the sin/cos of the angles
77
+ // setup pre computations for the sin/cos of the angles
95
78
  const sr = Math.sin(this.roll);
96
79
  const sp = Math.sin(this.pitch);
97
80
  const sw = Math.sin(this.yaw);
98
81
  const cr = Math.cos(this.roll);
99
82
  const cp = Math.cos(this.pitch);
100
83
  const cw = Math.cos(this.yaw);
101
- const matrix = new Matrix4().setRowMajor(cw * cp, // 0,0
84
+ // Create matrix
85
+ return new Matrix4().setRowMajor(cw * cp, // 0,0
102
86
  -sw * cr + cw * sp * sr, // 0,1
103
87
  sw * sr + cw * sp * cr, // 0,2
104
88
  this.x, // 0,3
@@ -111,7 +95,6 @@ export default class Pose {
111
95
  cp * cr, // 2,2
112
96
  this.z, // 2,3
113
97
  0, 0, 0, 1);
114
- return matrix;
115
98
  }
116
99
  getTransformationMatrixFromPose(pose) {
117
100
  return new Matrix4()
@@ -1,42 +1,63 @@
1
- export default class Quaternion extends MathArray<any> {
2
- constructor(x?: number, y?: number, z?: number, w?: number, ...args: any[]);
3
- copy(array: any): any;
4
- 0: any;
5
- 1: any;
6
- 2: any;
7
- 3: any;
8
- set(x: any, y: any, z: any, w: any): any;
9
- fromMatrix3(m: any): any;
10
- identity(): any;
11
- fromAxisRotation(axis: any, rad: any): any;
12
- setAxisAngle(axis: any, rad: any): any;
13
- set x(arg: any);
14
- get x(): any;
15
- set y(arg: any);
16
- get y(): any;
17
- set z(arg: any);
18
- get z(): any;
19
- set w(arg: any);
20
- get w(): any;
21
- len(): any;
22
- lengthSquared(): any;
23
- dot(a: any, b: any): any;
24
- rotationTo(vectorA: any, vectorB: any): any;
25
- calculateW(): any;
26
- conjugate(): any;
27
- invert(): any;
28
- multiplyRight(a: any, b: any): any;
29
- multiplyLeft(a: any, b: any): any;
30
- normalize(): any;
31
- rotateX(rad: any): any;
32
- rotateY(rad: any): any;
33
- rotateZ(rad: any): any;
34
- slerp(start: any, target: any, ratio: any, ...args: any[]): any;
35
- transformVector4(vector: any, result?: any): any;
36
- lengthSq(): any;
37
- setFromAxisAngle(axis: any, rad: any): any;
38
- premultiply(a: any, b: any): any;
39
- multiply(a: any, b: any): any;
1
+ import MathArray from './base/math-array';
2
+ import { NumericArray } from '@math.gl/types';
3
+ export default class Quaternion extends MathArray {
4
+ constructor(x?: number | Readonly<NumericArray>, y?: number, z?: number, w?: number);
5
+ copy(array: Readonly<NumericArray>): this;
6
+ set(x: number, y: number, z: number, w: number): this;
7
+ fromObject(object: {
8
+ x: number;
9
+ y: number;
10
+ z: number;
11
+ w: number;
12
+ }): this;
13
+ /**
14
+ * Creates a quaternion from the given 3x3 rotation matrix.
15
+ * NOTE: The resultant quaternion is not normalized, so you should
16
+ * be sure to renormalize the quaternion yourself where necessary.
17
+ * @param m
18
+ * @returns
19
+ */
20
+ fromMatrix3(m: Readonly<NumericArray>): this;
21
+ fromAxisRotation(axis: Readonly<NumericArray>, rad: number): this;
22
+ /** Set a quat to the identity quaternion */
23
+ identity(): this;
24
+ setAxisAngle(axis: Readonly<NumericArray>, rad: number): this;
25
+ get ELEMENTS(): number;
26
+ get x(): number;
27
+ set x(value: number);
28
+ get y(): number;
29
+ set y(value: number);
30
+ get z(): number;
31
+ set z(value: number);
32
+ get w(): number;
33
+ set w(value: number);
34
+ len(): number;
35
+ lengthSquared(): number;
36
+ dot(a: Readonly<NumericArray>): number;
37
+ rotationTo(vectorA: NumericArray, vectorB: NumericArray): this;
38
+ add(a: Readonly<NumericArray>): this;
39
+ calculateW(): this;
40
+ conjugate(): this;
41
+ invert(): this;
42
+ lerp(a: Readonly<NumericArray>, b: Readonly<NumericArray> | number, t?: number): this;
43
+ multiplyRight(a: Readonly<NumericArray>): this;
44
+ multiplyLeft(a: Readonly<NumericArray>): this;
45
+ normalize(): this;
46
+ rotateX(rad: number): this;
47
+ rotateY(rad: number): this;
48
+ rotateZ(rad: number): this;
49
+ scale(b: number): this;
50
+ slerp(target: Readonly<NumericArray>, ratio: number): this;
51
+ slerp(start: Readonly<NumericArray>, target: Readonly<NumericArray>, ratio: number): this;
52
+ slerp(params: {
53
+ start: Readonly<NumericArray>;
54
+ target: Readonly<NumericArray>;
55
+ ratio: number;
56
+ }): this;
57
+ transformVector4(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray;
58
+ lengthSq(): number;
59
+ setFromAxisAngle(axis: Readonly<NumericArray>, rad: number): this;
60
+ premultiply(a: Readonly<NumericArray>): this;
61
+ multiply(a: Readonly<NumericArray>): this;
40
62
  }
41
- import MathArray from "./base/math-array";
42
63
  //# sourceMappingURL=quaternion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"quaternion.d.ts","sourceRoot":"","sources":["../../src/classes/quaternion.js"],"names":[],"mappings":"AA+BA;IACE,4EASC;IAED,sBAMC;IALC,OAAkB;IAClB,OAAkB;IAClB,OAAkB;IAClB,OAAkB;IAIpB,yCAMC;IAKD,yBAGC;IAGD,gBAGC;IAED,2CAGC;IASD,uCAEC;IAYD,gBAEC;IAND,aAEC;IAUD,gBAEC;IAND,aAEC;IAUD,gBAEC;IAND,aAEC;IAUD,gBAEC;IAND,aAEC;IASD,WAEC;IAGD,qBAEC;IAID,yBAKC;IAoBD,4CAGC;IAyBD,kBAGC;IAID,iBAGC;IAGD,cAGC;IASD,mCAIC;IAED,kCAIC;IAGD,iBAaC;IAGD,uBAGC;IAGD,uBAGC;IAGD,uBAGC;IASD,gEAgBC;IAED,iDAGC;IAGD,gBAEC;IAED,2CAEC;IAED,iCAEC;IAED,8BAEC;CACF"}
1
+ {"version":3,"file":"quaternion.d.ts","sourceRoot":"","sources":["../../src/classes/quaternion.ts"],"names":[],"mappings":"AAEA,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAK1C,OAAO,EAAC,YAAY,EAAC,MA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GAAG,IAAI;IA8CR,gBAAgB,CACd,MAAM,EAAE,QAAQ,CAAC,YAAY,CAAC,EAC9B,MAAM,GAAE,YAA4B,GACnC,YAAY;IAMf,QAAQ,IAAI,MAAM;IAIlB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAIjE,WAAW,CAAC,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC,GAAG,IAAI;IAI5C,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;CAGnC"}
@@ -1,28 +1,9 @@
1
1
  // Copyright (c) 2017 Uber Technologies, Inc.
2
- //
3
- // Permission is hereby granted, free of charge, to any person obtaining a copy
4
- // of this software and associated documentation files (the "Software"), to deal
5
- // in the Software without restriction, including without limitation the rights
6
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- // copies of the Software, and to permit persons to whom the Software is
8
- // furnished to do so, subject to the following conditions:
9
- //
10
- // The above copyright notice and this permission notice shall be included in
11
- // all copies or substantial portions of the Software.
12
- //
13
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- // THE SOFTWARE.
2
+ // MIT License
20
3
  import MathArray from './base/math-array';
21
4
  import { checkNumber, checkVector } from '../lib/validators';
22
- import assert from '../lib/assert';
23
- // @ts-ignore: error TS2307: Cannot find module 'gl-matrix/...'.
5
+ import Vector4 from './vector4';
24
6
  import * as quat from 'gl-matrix/quat';
25
- // @ts-ignore: error TS2307: Cannot find module 'gl-matrix/...'.
26
7
  import * as vec4 from 'gl-matrix/vec4';
27
8
  const IDENTITY_QUATERNION = [0, 0, 0, 1];
28
9
  export default class Quaternion extends MathArray {
@@ -51,22 +32,33 @@ export default class Quaternion extends MathArray {
51
32
  this[3] = w;
52
33
  return this.check();
53
34
  }
54
- // Creates a quaternion from the given 3x3 rotation matrix.
55
- // NOTE: The resultant quaternion is not normalized, so you should
56
- // be sure to renormalize the quaternion yourself where necessary.
57
- fromMatrix3(m) {
58
- quat.fromMat3(this, m);
35
+ fromObject(object) {
36
+ this[0] = object.x;
37
+ this[1] = object.y;
38
+ this[2] = object.z;
39
+ this[3] = object.w;
59
40
  return this.check();
60
41
  }
61
- // Set a quat to the identity quaternion
62
- identity() {
63
- quat.identity(this);
42
+ /**
43
+ * Creates a quaternion from the given 3x3 rotation matrix.
44
+ * NOTE: The resultant quaternion is not normalized, so you should
45
+ * be sure to renormalize the quaternion yourself where necessary.
46
+ * @param m
47
+ * @returns
48
+ */
49
+ fromMatrix3(m) {
50
+ quat.fromMat3(this, m);
64
51
  return this.check();
65
52
  }
66
53
  fromAxisRotation(axis, rad) {
67
54
  quat.setAxisAngle(this, axis, rad);
68
55
  return this.check();
69
56
  }
57
+ /** Set a quat to the identity quaternion */
58
+ identity() {
59
+ quat.identity(this);
60
+ return this.check();
61
+ }
70
62
  // Set the components of a quat to the given values
71
63
  // set(i, j, k, l) {
72
64
  // quat.set(this, i, j, k, l);
@@ -77,7 +69,6 @@ export default class Quaternion extends MathArray {
77
69
  return this.fromAxisRotation(axis, rad);
78
70
  }
79
71
  // Getters/setters
80
- /* eslint-disable no-multi-spaces, brace-style, no-return-assign */
81
72
  get ELEMENTS() {
82
73
  return 4;
83
74
  }
@@ -105,7 +96,6 @@ export default class Quaternion extends MathArray {
105
96
  set w(value) {
106
97
  this[3] = checkNumber(value);
107
98
  }
108
- /* eslint-enable no-multi-spaces, brace-style, no-return-assign */
109
99
  // Calculates the length of a quat
110
100
  len() {
111
101
  return quat.length(this);
@@ -116,10 +106,7 @@ export default class Quaternion extends MathArray {
116
106
  }
117
107
  // Calculates the dot product of two quat's
118
108
  // @return {Number}
119
- dot(a, b) {
120
- if (b !== undefined) {
121
- throw new Error('Quaternion.dot only takes one argument');
122
- }
109
+ dot(a) {
123
110
  return quat.dot(this, a);
124
111
  }
125
112
  // Gets the rotation axis and angle for a given quaternion.
@@ -153,10 +140,7 @@ export default class Quaternion extends MathArray {
153
140
  // Number;
154
141
  // }
155
142
  // Adds two quat's
156
- add(a, b) {
157
- if (b !== undefined) {
158
- throw new Error('Quaternion.add only takes one argument');
159
- }
143
+ add(a) {
160
144
  quat.add(this, this, a);
161
145
  return this.check();
162
146
  }
@@ -179,17 +163,18 @@ export default class Quaternion extends MathArray {
179
163
  }
180
164
  // Performs a linear interpolation between two quat's
181
165
  lerp(a, b, t) {
166
+ if (t === undefined) {
167
+ return this.lerp(this, a, b);
168
+ }
182
169
  quat.lerp(this, a, b, t);
183
170
  return this.check();
184
171
  }
185
172
  // Multiplies two quat's
186
- multiplyRight(a, b) {
187
- assert(!b); // Quaternion.multiply only takes one argument
173
+ multiplyRight(a) {
188
174
  quat.multiply(this, this, a);
189
175
  return this.check();
190
176
  }
191
- multiplyLeft(a, b) {
192
- assert(!b); // Quaternion.multiply only takes one argument
177
+ multiplyLeft(a) {
193
178
  quat.multiply(this, a, this);
194
179
  return this.check();
195
180
  }
@@ -229,24 +214,35 @@ export default class Quaternion extends MathArray {
229
214
  return this.check();
230
215
  }
231
216
  // Performs a spherical linear interpolation between two quat
232
- slerp(start, target, ratio) {
217
+ slerp(arg0, arg1, arg2) {
218
+ let start;
219
+ let target;
220
+ let ratio;
233
221
  // eslint-disable-next-line prefer-rest-params
234
222
  switch (arguments.length) {
235
223
  case 1: // Deprecated signature ({start, target, ratio})
236
224
  // eslint-disable-next-line prefer-rest-params
237
- ({ start = IDENTITY_QUATERNION, target, ratio } = arguments[0]);
225
+ ({
226
+ start = IDENTITY_QUATERNION,
227
+ target,
228
+ ratio
229
+ } = arg0);
238
230
  break;
239
231
  case 2: // THREE.js compatibility signature (target, ration)
240
- // eslint-disable-next-line prefer-rest-params
241
- [target, ratio] = arguments;
242
232
  start = this; // eslint-disable-line
233
+ target = arg0;
234
+ ratio = arg1;
243
235
  break;
244
- default: // Default signature: (start, target, ratio)
236
+ default:
237
+ // Default signature: (start, target, ratio)
238
+ start = arg0;
239
+ target = arg1;
240
+ ratio = arg2;
245
241
  }
246
242
  quat.slerp(this, start, target, ratio);
247
243
  return this.check();
248
244
  }
249
- transformVector4(vector, result = vector) {
245
+ transformVector4(vector, result = new Vector4()) {
250
246
  vec4.transformQuat(result, vector, this);
251
247
  return checkVector(result, 4);
252
248
  }
@@ -257,10 +253,10 @@ export default class Quaternion extends MathArray {
257
253
  setFromAxisAngle(axis, rad) {
258
254
  return this.setAxisAngle(axis, rad);
259
255
  }
260
- premultiply(a, b) {
261
- return this.multiplyLeft(a, b);
256
+ premultiply(a) {
257
+ return this.multiplyLeft(a);
262
258
  }
263
- multiply(a, b) {
264
- return this.multiplyRight(a, b);
259
+ multiply(a) {
260
+ return this.multiplyRight(a);
265
261
  }
266
262
  }
@@ -1,40 +1,60 @@
1
+ import Vector3 from './vector3';
2
+ import { NumericArray } from '@math.gl/types';
3
+ declare type SphericalCoordinatesOptions = {
4
+ phi?: number;
5
+ theta?: number;
6
+ radius?: number;
7
+ bearing?: number;
8
+ pitch?: number;
9
+ altitude?: number;
10
+ radiusScale?: number;
11
+ };
12
+ declare type FormatOptions = {
13
+ printTypes?: boolean;
14
+ };
15
+ /**
16
+ * The poles (phi) are at the positive and negative y axis.
17
+ * The equator starts at positive z.
18
+ * @link https://en.wikipedia.org/wiki/Spherical_coordinate_system
19
+ */
1
20
  export default class SphericalCoordinates {
2
- constructor({ phi, theta, radius, bearing, pitch, altitude, radiusScale }?: {
3
- phi?: number;
4
- theta?: number;
5
- radius?: number;
6
- bearing?: any;
7
- pitch?: any;
8
- altitude?: any;
9
- radiusScale?: number;
10
- });
11
21
  phi: number;
12
22
  theta: number;
13
- radius: any;
23
+ radius: number;
14
24
  radiusScale: number;
15
- set bearing(arg: number);
25
+ /**
26
+ * Creates a new SphericalCoordinates object
27
+ * @param options
28
+ * @param [options.phi] =0 - rotation around X (latitude)
29
+ * @param [options.theta] =0 - rotation around Y (longitude)
30
+ * @param [options.radius] =1 - Distance from center
31
+ * @param [options.bearing]
32
+ * @param [options.pitch]
33
+ * @param [options.altitude]
34
+ * @param [options.radiusScale] =1
35
+ */
36
+ constructor({ phi, theta, radius, bearing, pitch, altitude, radiusScale }?: SphericalCoordinatesOptions);
37
+ toString(): string;
38
+ formatString({ printTypes }: FormatOptions): string;
39
+ equals(other: SphericalCoordinates): boolean;
40
+ exactEquals(other: SphericalCoordinates): boolean;
16
41
  get bearing(): number;
17
- set pitch(arg: number);
42
+ set bearing(v: number);
18
43
  get pitch(): number;
19
- toString(): string;
20
- formatString({ printTypes }: {
21
- printTypes?: boolean;
22
- }): string;
23
- equals(other: any): boolean;
24
- exactEquals(other: any): boolean;
44
+ set pitch(v: number);
25
45
  get longitude(): number;
26
46
  get latitude(): number;
27
47
  get lng(): number;
28
48
  get lat(): number;
29
49
  get z(): number;
30
- set(radius: any, phi: any, theta: any): SphericalCoordinates;
50
+ set(radius: number, phi: number, theta: number): this;
31
51
  clone(): SphericalCoordinates;
32
- copy(other: any): SphericalCoordinates;
33
- fromLngLatZ([lng, lat, z]: [any, any, any]): void;
34
- fromVector3(v: any): SphericalCoordinates;
52
+ copy(other: SphericalCoordinates): this;
53
+ fromLngLatZ([lng, lat, z]: [number, number, number]): this;
54
+ fromVector3(v: Readonly<NumericArray>): this;
35
55
  toVector3(): Vector3;
36
- makeSafe(): SphericalCoordinates;
37
- check(): SphericalCoordinates;
56
+ makeSafe(): this;
57
+ check(): this;
38
58
  }
39
- import Vector3 from "./vector3";
59
+ export {};
40
60
  //# sourceMappingURL=spherical-coordinates.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spherical-coordinates.d.ts","sourceRoot":"","sources":["../../src/classes/spherical-coordinates.js"],"names":[],"mappings":"AAkCA;IAGE;;;;;;;;OAsBC;IAbC,YAAc;IACd,cAAkB;IAElB,YAAqC;IACrC,oBAAmC;IAsCrC,yBAEC;IALD,sBAEC;IAOD,uBAEC;IALD,oBAEC;IAhCD,mBAEC;IAED;;eAIC;IAED,4BAMC;IAED,iCAEC;IAqBD,wBAEC;IACD,uBAEC;IACD,kBAEC;IACD,kBAEC;IACD,gBAEC;IAGD,6DAKC;IAED,8BAEC;IAED,uCAKC;IAED,kDAIC;IAED,0CAOC;IAED,qBAIC;IAGD,iCAGC;IAED,8BAMC;CACF"}
1
+ {"version":3,"file":"spherical-coordinates.d.ts","sourceRoot":"","sources":["../../src/classes/spherical-coordinates.ts"],"names":[],"mappings":"AAGA,OAAO,OAAO,MAAM,WAAW,CAAC;AAIhC,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAE5C,aAAK,2BAA2B,GAAG;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,aAAK,aAAa,GAAG;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAMF;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,oBAAoB;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IAYpB;;;;;;;;;;OAUG;gBAES,EACV,GAAO,EACP,KAAS,EACT,MAAU,EACV,OAAO,EACP,KAAK,EACL,QAAQ,EACR,WAAiC,EAClC,GAAE,2BAAgC;IAenC,QAAQ,IAAI,MAAM;IAIlB,YAAY,CAAC,EAAC,UAAkB,EAAC,EAAE,aAAa,GAAG,MAAM;IAMzD,MAAM,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO;IAQ5C,WAAW,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO;IAMjD,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,IAAI,OAAO,CAAC,CAAC,EAAE,MAAM,EAEpB;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,KAAK,CAAC,CAAC,EAAE,MAAM,EAElB;IAMD,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,GAAG,IAAI,MAAM,CAEhB;IAED,IAAI,GAAG,IAAI,MAAM,CAEhB;IAED,IAAI,CAAC,IAAI,MAAM,CAEd;IAGD,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAOrD,KAAK,IAAI,oBAAoB;IAI7B,IAAI,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI;IAOvC,WAAW,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAO1D,WAAW,CAAC,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC,GAAG,IAAI;IAS5C,SAAS,IAAI,OAAO;IAOpB,QAAQ,IAAI,IAAI;IAKhB,KAAK,IAAI,IAAI;CAOd"}
@@ -1,36 +1,41 @@
1
1
  // Copyright (c) 2017 Uber Technologies, Inc.
2
- //
3
- // Permission is hereby granted, free of charge, to any person obtaining a copy
4
- // of this software and associated documentation files (the "Software"), to deal
5
- // in the Software without restriction, including without limitation the rights
6
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- // copies of the Software, and to permit persons to whom the Software is
8
- // furnished to do so, subject to the following conditions:
9
- //
10
- // The above copyright notice and this permission notice shall be included in
11
- // all copies or substantial portions of the Software.
12
- //
13
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- // THE SOFTWARE.
2
+ // MIT License
20
3
  // Adaptation of THREE.js Spherical class, under MIT license
4
+ import Vector3 from './vector3';
21
5
  import { formatValue, equals, config } from '../lib/common';
22
6
  import { degrees, radians, clamp } from '../lib/common';
23
- import Vector3 from './vector3';
24
- // @ts-ignore: error TS2307: Cannot find module 'gl-matrix/...'.
25
7
  import * as vec3 from 'gl-matrix/vec3';
26
8
  // TODO - import epsilon
27
9
  const EPSILON = 0.000001;
28
- const EARTH_RADIUS_METERS = 6.371e6;
29
- // Todo [rho, theta, phi] ?
10
+ const EARTH_RADIUS_METERS = 6371000;
11
+ /**
12
+ * The poles (phi) are at the positive and negative y axis.
13
+ * The equator starts at positive z.
14
+ * @link https://en.wikipedia.org/wiki/Spherical_coordinate_system
15
+ */
30
16
  export default class SphericalCoordinates {
31
- // @ts-ignore TS2740: Type '{}' is missing the following properties from type
17
+ // bearing: number;
18
+ // pitch: number;
19
+ // altitude: number;
20
+ // lnglatZ coordinates
21
+ // longitude: number;
22
+ // latitude: number;
23
+ // lng: number;
24
+ // lat: number;
25
+ // z: number;
26
+ /**
27
+ * Creates a new SphericalCoordinates object
28
+ * @param options
29
+ * @param [options.phi] =0 - rotation around X (latitude)
30
+ * @param [options.theta] =0 - rotation around Y (longitude)
31
+ * @param [options.radius] =1 - Distance from center
32
+ * @param [options.bearing]
33
+ * @param [options.pitch]
34
+ * @param [options.altitude]
35
+ * @param [options.radiusScale] =1
36
+ */
32
37
  // eslint-disable-next-line complexity
33
- constructor({ phi = 0, theta = 0, radius = 1, bearing = undefined, pitch = undefined, altitude = undefined, radiusScale = EARTH_RADIUS_METERS } = {}) {
38
+ constructor({ phi = 0, theta = 0, radius = 1, bearing, pitch, altitude, radiusScale = EARTH_RADIUS_METERS } = {}) {
34
39
  this.phi = phi;
35
40
  this.theta = theta;
36
41
  // TODO - silently accepts illegal 0
@@ -113,6 +118,7 @@ export default class SphericalCoordinates {
113
118
  this.radius = 1 + z / this.radiusScale;
114
119
  this.phi = radians(lat);
115
120
  this.theta = radians(lng);
121
+ return this.check();
116
122
  }
117
123
  fromVector3(v) {
118
124
  this.radius = vec3.length(v);
@@ -1,19 +1,55 @@
1
- export default class Vector2 extends Vector<any> {
2
- constructor(x?: number, y?: number, ...args: any[]);
3
- 0: number;
4
- 1: number;
5
- set(x: any, y: any): any;
6
- copy(array: any): any;
7
- fromObject(object: any): any;
8
- toObject(object: any): any;
1
+ import Vector from './base/vector';
2
+ import { NumericArray } from '@math.gl/types';
3
+ /**
4
+ * Two-element vector class.
5
+ * Subclass of Array<number>
6
+ */
7
+ export default class Vector2 extends Vector {
8
+ constructor(x?: number | Readonly<NumericArray>, y?: number);
9
+ set(x: number, y: number): this;
10
+ copy(array: Readonly<NumericArray>): this;
11
+ fromObject(object: {
12
+ x: number;
13
+ y: number;
14
+ }): this;
15
+ toObject(object: {
16
+ x?: number;
17
+ y?: number;
18
+ }): {
19
+ x: number;
20
+ y: number;
21
+ };
22
+ get ELEMENTS(): number;
23
+ /**
24
+ * Returns angle from x axis
25
+ * @returns
26
+ */
9
27
  horizontalAngle(): number;
28
+ /**
29
+ * Returns angle from y axis
30
+ * @returns
31
+ */
10
32
  verticalAngle(): number;
11
- transform(matrix4: any): any;
12
- transformAsPoint(matrix4: any): any;
13
- transformAsVector(matrix4: any): any;
14
- transformByMatrix3(matrix3: any): any;
15
- transformByMatrix2x3(matrix2x3: any): any;
16
- transformByMatrix2(matrix2: any): any;
33
+ /**
34
+ * Transforms as point
35
+ * @param matrix4
36
+ * @returns
37
+ */
38
+ transform(matrix4: Readonly<NumericArray>): this;
39
+ /**
40
+ * transforms as point (4th component is implicitly 1)
41
+ * @param matrix4
42
+ * @returns
43
+ */
44
+ transformAsPoint(matrix4: Readonly<NumericArray>): this;
45
+ /**
46
+ * transforms as vector (4th component is implicitly 0, ignores translation. slightly faster)
47
+ * @param matrix4
48
+ * @returns
49
+ */
50
+ transformAsVector(matrix4: Readonly<NumericArray>): this;
51
+ transformByMatrix3(matrix3: Readonly<NumericArray>): this;
52
+ transformByMatrix2x3(matrix2x3: Readonly<NumericArray>): this;
53
+ transformByMatrix2(matrix2: Readonly<NumericArray>): this;
17
54
  }
18
- import Vector from "./base/vector";
19
55
  //# sourceMappingURL=vector2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vector2.d.ts","sourceRoot":"","sources":["../../src/classes/vector2.js"],"names":[],"mappings":"AA6BA;IAEE,oDAaC;IAHG,UAAW;IACX,UAAW;IAIf,yBAIC;IAED,sBAIC;IAED,6BAQC;IAED,2BAIC;IASD,0BAEC;IAED,wBAEC;IAID,6BAEC;IAGD,oCAGC;IAGD,qCAGC;IAED,sCAGC;IAED,0CAGC;IAED,sCAGC;CACF"}
1
+ {"version":3,"file":"vector2.d.ts","sourceRoot":"","sources":["../../src/classes/vector2.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,eAAe,CAAC;AAMnC,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAE5C;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,M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