linearly 0.36.0 → 0.37.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.
Files changed (47) hide show
  1. package/lib/esm/mat2.d.ts +1 -1
  2. package/lib/esm/mat2.d.ts.map +1 -1
  3. package/lib/esm/mat2.js +3 -2
  4. package/lib/esm/mat2d.d.ts.map +1 -1
  5. package/lib/esm/mat2d.js +4 -5
  6. package/lib/esm/mat3.d.ts.map +1 -1
  7. package/lib/esm/mat3.js +16 -15
  8. package/lib/esm/mat4.d.ts.map +1 -1
  9. package/lib/esm/mat4.js +18 -17
  10. package/lib/esm/quat.js +3 -3
  11. package/lib/esm/scalar.d.ts +6 -35
  12. package/lib/esm/scalar.d.ts.map +1 -1
  13. package/lib/esm/scalar.js +11 -53
  14. package/package.json +9 -4
  15. package/lib/cjs/common.d.ts +0 -16
  16. package/lib/cjs/common.d.ts.map +0 -1
  17. package/lib/cjs/common.js +0 -70
  18. package/lib/cjs/index.d.ts +0 -10
  19. package/lib/cjs/index.d.ts.map +0 -1
  20. package/lib/cjs/index.js +0 -22
  21. package/lib/cjs/mat2.d.ts +0 -272
  22. package/lib/cjs/mat2.d.ts.map +0 -1
  23. package/lib/cjs/mat2.js +0 -473
  24. package/lib/cjs/mat2d.d.ts +0 -329
  25. package/lib/cjs/mat2d.d.ts.map +0 -1
  26. package/lib/cjs/mat2d.js +0 -641
  27. package/lib/cjs/mat3.d.ts +0 -295
  28. package/lib/cjs/mat3.d.ts.map +0 -1
  29. package/lib/cjs/mat3.js +0 -670
  30. package/lib/cjs/mat4.d.ts +0 -532
  31. package/lib/cjs/mat4.d.ts.map +0 -1
  32. package/lib/cjs/mat4.js +0 -1576
  33. package/lib/cjs/quat.d.ts +0 -334
  34. package/lib/cjs/quat.d.ts.map +0 -1
  35. package/lib/cjs/quat.js +0 -802
  36. package/lib/cjs/scalar.d.ts +0 -501
  37. package/lib/cjs/scalar.d.ts.map +0 -1
  38. package/lib/cjs/scalar.js +0 -728
  39. package/lib/cjs/vec2.d.ts +0 -664
  40. package/lib/cjs/vec2.d.ts.map +0 -1
  41. package/lib/cjs/vec2.js +0 -1247
  42. package/lib/cjs/vec3.d.ts +0 -660
  43. package/lib/cjs/vec3.d.ts.map +0 -1
  44. package/lib/cjs/vec3.js +0 -1329
  45. package/lib/cjs/vec4.d.ts +0 -552
  46. package/lib/cjs/vec4.d.ts.map +0 -1
  47. package/lib/cjs/vec4.js +0 -1200
package/lib/cjs/quat.d.ts DELETED
@@ -1,334 +0,0 @@
1
- import * as Common from './common';
2
- import type { mat3 } from './mat3';
3
- import { mat4 } from './mat4';
4
- import { vec3 } from './vec3';
5
- import { vec4 } from './vec4';
6
- /**
7
- * Represents rotation in 3D space with the quaternion format XYZW.
8
- * @category Types
9
- */
10
- export type quat = readonly [x: number, y: number, z: number, w: number];
11
- /**
12
- * Functions for {@link quat}, a format for representing rotation in 3D space.
13
- * @category Modules
14
- */
15
- export declare namespace quat {
16
- /**
17
- * Mutable version of {@link quat}
18
- * @category Types
19
- */
20
- type Mutable = [x: number, y: number, z: number, w: number];
21
- /**
22
- * Creates a new quaternion from given elements
23
- * @category Generators
24
- */
25
- function of(x: number, y: number, z: number, w: number): quat;
26
- /**
27
- * Creates a mutable clone of given quat
28
- * @category Generators
29
- */
30
- function clone(a: quat): Mutable;
31
- /**
32
- * Constrain each component to lie between min and max
33
- * @see https://thebookofshaders.com/glossary/?search=clamp
34
- */
35
- function clamp(q: quat, min: number, max: number): quat;
36
- /**
37
- * Clamps each component to [0, 1]
38
- */
39
- function clamp01(q: quat): quat;
40
- /**
41
- * Clamps each component to [-1, 1]
42
- */
43
- function clamp11(q: quat): quat;
44
- /**
45
- * The identity quaternion.
46
- * @category Constants
47
- *
48
- * @shorthands
49
- * - {@link id}
50
- * - {@link ident}
51
- */
52
- const identity: quat;
53
- /**
54
- * Alias for {@link identity}
55
- * @category Shorthands
56
- */
57
- const I: quat;
58
- /**
59
- * Alias for {@link identity}
60
- * @category Shorthands
61
- */
62
- const id: quat;
63
- /**
64
- * Alias for {@link identity}
65
- * @category Shorthands
66
- */
67
- const ident: quat;
68
- /**
69
- * The zero quaternion.
70
- * @category Constants
71
- */
72
- const zero: quat;
73
- /**
74
- * Sets a quat from the given angle and rotation axis,
75
- * then returns it.
76
- * @category Generators
77
- * @param axis the axis around which to rotate
78
- * @param deg the angle in degrees
79
- **/
80
- function fromAxisAngle(axis: vec3, deg: number): quat;
81
- /**
82
- * Gets the rotation axis and angle for a given
83
- * quaternion. If a quaternion is created with
84
- * fromAxisAngle, this method will return the same
85
- * values as provided in the original parameter list
86
- * OR functionally equivalent values.
87
- * Example: The quaternion formed by axis [0, 0, 1] and
88
- * angle -90 is the same as the quaternion formed by
89
- * [0, 0, 1] and 270. This method favors the latter.
90
- *
91
- * @param q Quaternion to be decomposed
92
- */
93
- function axisAngle(q: quat): {
94
- axis: vec3;
95
- deg: number;
96
- };
97
- /**
98
- * Gets the angular distance between two unit quaternions
99
- *
100
- * @param a Origin unit quaternion
101
- * @param b Destination unit quaternion
102
- * @return Angle, in degrees, between the two quaternions
103
- */
104
- function angle(a: quat, b: quat): number;
105
- /**
106
- * Multiplies given quat's
107
- *
108
- * @param a the first operand
109
- * @param b the second operand
110
- *
111
- * @shorthands
112
- * - {@link mul}
113
- */
114
- function multiply(...qs: quat[]): quat;
115
- /**
116
- * Alias for {@link multiply}
117
- * @category Shorthands
118
- */
119
- const mul: typeof multiply;
120
- /**
121
- * Rotates a quaternion by the given angle about the X axis
122
- *
123
- * @param a quat to rotate
124
- * @param deg angle to rotate, in degrees
125
- */
126
- function rotateX(a: quat, deg: number): quat;
127
- /**
128
- * Rotates a quaternion by the given angle about the Y axis
129
- *
130
- * @param a quat to rotate
131
- * @param deg angle to rotate, in degrees
132
- */
133
- function rotateY(a: quat, deg: number): quat;
134
- /**
135
- * Rotates a quaternion by the given angle about the Z axis
136
- *
137
- * @param a quat to rotate
138
- * @param deg angle (in degrees) to rotate
139
- */
140
- function rotateZ(a: quat, deg: number): quat;
141
- /**
142
- * Calculates the W component of a quat from the X, Y, and Z components.
143
- * Assumes that quaternion is 1 unit in length.
144
- * Any existing W component will be ignored.
145
- */
146
- function calculateW(q: quat): quat;
147
- /**
148
- * Calculate the exponential of a unit quaternion.
149
- */
150
- function exp(q: quat): quat;
151
- /**
152
- * Calculate the natural logarithm of a unit quaternion.
153
- */
154
- function ln(a: quat): quat;
155
- /**
156
- * Calculate the scalar power of a unit quaternion.
157
- */
158
- function pow(a: quat, b: number): quat;
159
- /**
160
- * Performs a spherical linear interpolation between two quat
161
- *
162
- * @param a the first operand
163
- * @param b the second operand
164
- * @param t interpolation amount, in the range [0-1], between the two inputs
165
- */
166
- function slerp(a: quat, b: quat, t: number): quat;
167
- /**
168
- * Calculates the inverse of a quat
169
- */
170
- function invert(q: quat): quat;
171
- /**
172
- * Calculates the conjugate of a quat
173
- * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.
174
- */
175
- function conjugate(a: quat): quat;
176
- /**
177
- * Creates a quaternion from the given 3x3 rotation matrix.
178
- *
179
- * NOTE: The resultant quaternion is not normalized, so you should be sure
180
- * to renormalize the quaternion yourself where necessary.
181
- * @category Generators
182
- */
183
- function fromMat3(m: mat3): quat;
184
- /**
185
- * Creates a quaternion from the given 4x4 affine matrix. The translation portion of the matrix is ignored. Same as mat4. Alias for {@link mat4.getRotation}.
186
- */
187
- const fromMat4: typeof mat4.getRotation;
188
- /**
189
- * Creates a quaternion from a normalized direction vector and an up vector.
190
- * Equivalent to GLM's `glm::quatLookAt`.
191
- *
192
- * @param direction Normalized direction vector (forward)
193
- * @param up Up vector, default is vec3.unitY
194
- * @category Generators
195
- */
196
- function lookAt(direction: vec3, up?: vec3): quat;
197
- /**
198
- * Creates a quaternion from the given euler angle x, y, z using the provided intrinsic order for the conversion.
199
- *
200
- * @param deg Angles to rotate around X, Y, Z axes in degree.
201
- * @param order Intrinsic order for conversion, default is zyx.
202
- * @category Generators
203
- */
204
- function fromEuler(deg: vec3, order?: Common.AngleOrder): number[];
205
- /**
206
- * Extracts Euler angles from a quaternion. This is the inverse of {@link fromEuler}.
207
- * Equivalent to GLM's `glm::eulerAngles`.
208
- *
209
- * @param q The quaternion to extract Euler angles from
210
- * @param order Intrinsic order for conversion, default is zyx
211
- * @returns Euler angles in degrees as vec3 [x, y, z]
212
- */
213
- function toEuler(q: quat, order?: Common.AngleOrder): vec3;
214
- /**
215
- * Performs a normalized linear interpolation (nlerp) between two quaternions.
216
- * Faster than {@link slerp} and sufficient for small rotation differences.
217
- *
218
- * @param a the first operand
219
- * @param b the second operand
220
- * @param t interpolation amount, in the range [0-1], between the two inputs
221
- */
222
- function lerp(a: quat, b: quat, t: number): quat;
223
- /**
224
- * Adds given quat's
225
- */
226
- const add: (a: quat, b: quat) => quat;
227
- /**
228
- * Scales a quat by a scalar number
229
- */
230
- const scale: (a: quat, b: number) => quat;
231
- /**
232
- * Calculates the dot product of two quat's
233
- */
234
- const dot: (a: quat, b: quat) => number;
235
- /**
236
- * Calculates the length of a quat
237
- *
238
- * @param a vector to calculate length of
239
- * @returns length of a
240
- *
241
- * @shorthands
242
- * - {@link len}
243
- */
244
- const length: typeof vec4.length;
245
- /**
246
- * Alias for {@link length}
247
- * @category Shorthands
248
- */
249
- const len: typeof vec4.length;
250
- /**
251
- * Calculates the squared length of a quat
252
- *
253
- * @param a vector to calculate squared length of
254
- * @returns squared length of a
255
- *
256
- * @shorthands
257
- * - {@link sqrLen}
258
- */
259
- const squaredLength: typeof vec4.squaredLength;
260
- /**
261
- * Alias for {@link squaredLength}
262
- * @category Shorthands
263
- */
264
- const sqrLen: typeof vec4.squaredLength;
265
- /**
266
- * Normalize a quat
267
- *
268
- * @param a quaternion to normalize
269
- */
270
- const normalize: typeof vec4.normalize;
271
- /**
272
- * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with `===`)
273
- *
274
- * @shorthands
275
- * - {@link eq}
276
- */
277
- const exactEquals: typeof vec4.exactEquals;
278
- /**
279
- * Alias for {@link exactEquals}
280
- * @category Shorthands
281
- */
282
- const eq: typeof vec4.exactEquals;
283
- /**
284
- * Returns whether or not the quaternions point approximately to the same direction. Both quaternions are assumed to be unit length.
285
- *
286
- * @shorthands
287
- * - {@link approx}
288
- * - {@link equals}
289
- */
290
- function approxEquals(a: quat, b: quat): boolean;
291
- /**
292
- * Alias for {@link approxEquals}
293
- * @category Shorthands
294
- */
295
- const approx: typeof approxEquals;
296
- /**
297
- * Alias for {@link approxEquals}. This is provided for compatibility with gl-matrix.
298
- * @category Shorthands
299
- * @deprecated Use {@link approxEquals} instead
300
- */
301
- const equals: typeof approxEquals;
302
- /**
303
- * Sets a quaternion to represent the shortest rotation from one
304
- * vector to another.
305
- *
306
- * Both vectors are assumed to be unit length.
307
- *
308
- * @param a the initial vector
309
- * @param b the destination vector
310
- * @category Generators
311
- */
312
- const rotationTo: (a: vec3, b: vec3) => quat;
313
- /**
314
- * Performs a spherical linear interpolation with two control points
315
- *
316
- * @param a the first operand
317
- * @param b the second operand
318
- * @param c the third operand
319
- * @param d the fourth operand
320
- * @param t interpolation amount, in the range [0-1], between the two inputs
321
- */
322
- function sqlerp(a: quat, b: quat, c: quat, d: quat, t: number): quat;
323
- /**
324
- * Sets the specified quaternion with values corresponding to the given
325
- * axes. Each axis is a vec3 and is expected to be unit length and
326
- * perpendicular to all other specified axes.
327
- *
328
- * @param view the vector representing the viewing direction
329
- * @param right the vector representing the local "right" direction
330
- * @param up the vector representing the local "up" direction
331
- */
332
- function setAxes(view: vec3, right: vec3, up: vec3): quat;
333
- }
334
- //# sourceMappingURL=quat.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"quat.d.ts","sourceRoot":"","sources":["../../src/quat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAClC,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAA;AAChC,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAA;AA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