@lakuna/umath 1.5.0 → 3.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/LICENSE +1 -1
- package/dist/algorithms/greatestCommonDivisor.d.ts.map +1 -1
- package/dist/algorithms/greatestCommonDivisor.js +14 -4
- package/dist/algorithms/greatestCommonDivisor.js.map +1 -1
- package/dist/index.d.ts +15 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/linalg/DualQuaternion.d.ts +131 -154
- package/dist/linalg/DualQuaternion.d.ts.map +1 -1
- package/dist/linalg/DualQuaternion.js +188 -203
- package/dist/linalg/DualQuaternion.js.map +1 -1
- package/dist/linalg/Matrix.d.ts +24 -24
- package/dist/linalg/Matrix.d.ts.map +1 -1
- package/dist/linalg/Matrix2.d.ts +74 -88
- package/dist/linalg/Matrix2.d.ts.map +1 -1
- package/dist/linalg/Matrix2.js +114 -124
- package/dist/linalg/Matrix2.js.map +1 -1
- package/dist/linalg/Matrix3.d.ts +118 -139
- package/dist/linalg/Matrix3.d.ts.map +1 -1
- package/dist/linalg/Matrix3.js +169 -201
- package/dist/linalg/Matrix3.js.map +1 -1
- package/dist/linalg/Matrix4.d.ts +217 -257
- package/dist/linalg/Matrix4.d.ts.map +1 -1
- package/dist/linalg/Matrix4.js +310 -374
- package/dist/linalg/Matrix4.js.map +1 -1
- package/dist/linalg/Quaternion.d.ts +120 -151
- package/dist/linalg/Quaternion.d.ts.map +1 -1
- package/dist/linalg/Quaternion.js +187 -204
- package/dist/linalg/Quaternion.js.map +1 -1
- package/dist/linalg/SlowMatrix.d.ts +5 -5
- package/dist/linalg/SlowMatrix.d.ts.map +1 -1
- package/dist/linalg/SlowMatrix.js +63 -89
- package/dist/linalg/SlowMatrix.js.map +1 -1
- package/dist/linalg/SlowSquareMatrix.d.ts +6 -6
- package/dist/linalg/SlowSquareMatrix.d.ts.map +1 -1
- package/dist/linalg/SlowSquareMatrix.js +15 -15
- package/dist/linalg/SlowSquareMatrix.js.map +1 -1
- package/dist/linalg/SlowVector.d.ts +165 -0
- package/dist/linalg/SlowVector.d.ts.map +1 -0
- package/dist/linalg/SlowVector.js +369 -0
- package/dist/linalg/SlowVector.js.map +1 -0
- package/dist/linalg/SquareMatrix.d.ts +8 -8
- package/dist/linalg/SquareMatrix.d.ts.map +1 -1
- package/dist/linalg/Vector.d.ts +84 -84
- package/dist/linalg/Vector.d.ts.map +1 -1
- package/dist/linalg/Vector2.d.ts +115 -137
- package/dist/linalg/Vector2.d.ts.map +1 -1
- package/dist/linalg/Vector2.js +164 -188
- package/dist/linalg/Vector2.js.map +1 -1
- package/dist/linalg/Vector3.d.ts +141 -167
- package/dist/linalg/Vector3.d.ts.map +1 -1
- package/dist/linalg/Vector3.js +200 -237
- package/dist/linalg/Vector3.js.map +1 -1
- package/dist/linalg/Vector4.d.ts +111 -131
- package/dist/linalg/Vector4.d.ts.map +1 -1
- package/dist/linalg/Vector4.js +163 -187
- package/dist/linalg/Vector4.js.map +1 -1
- package/dist/types/AxisAngle.d.ts +2 -2
- package/dist/types/AxisAngle.d.ts.map +1 -1
- package/dist/types/FieldOfView.d.ts +2 -2
- package/dist/types/FieldOfView.d.ts.map +1 -1
- package/dist/utility/BigNumber.d.ts +21 -11
- package/dist/utility/BigNumber.d.ts.map +1 -1
- package/dist/utility/BigNumber.js +42 -31
- package/dist/utility/BigNumber.js.map +1 -1
- package/dist/utility/MatrixSizeError.d.ts +1 -1
- package/dist/utility/MatrixSizeError.d.ts.map +1 -1
- package/dist/utility/MatrixSizeError.js +1 -1
- package/dist/utility/MatrixSizeError.js.map +1 -1
- package/dist/utility/VectorSizeError.d.ts +12 -0
- package/dist/utility/VectorSizeError.d.ts.map +1 -0
- package/dist/utility/VectorSizeError.js +15 -0
- package/dist/utility/VectorSizeError.js.map +1 -0
- package/dist/utility/createAxisAngleLike.d.ts +10 -0
- package/dist/utility/createAxisAngleLike.d.ts.map +1 -0
- package/dist/utility/createAxisAngleLike.js +10 -0
- package/dist/utility/createAxisAngleLike.js.map +1 -0
- package/package.json +11 -11
- package/src/algorithms/greatestCommonDivisor.ts +19 -7
- package/src/index.ts +24 -13
- package/src/linalg/DualQuaternion.ts +224 -292
- package/src/linalg/Matrix.ts +28 -28
- package/src/linalg/Matrix2.ts +138 -180
- package/src/linalg/Matrix3.ts +211 -286
- package/src/linalg/Matrix4.ts +466 -584
- package/src/linalg/Quaternion.ts +221 -294
- package/src/linalg/SlowMatrix.ts +97 -95
- package/src/linalg/SlowSquareMatrix.ts +19 -18
- package/src/linalg/SlowVector.ts +450 -0
- package/src/linalg/SquareMatrix.ts +9 -9
- package/src/linalg/Vector.ts +90 -90
- package/src/linalg/Vector2.ts +181 -266
- package/src/linalg/Vector3.ts +230 -342
- package/src/linalg/Vector4.ts +183 -257
- package/src/types/AxisAngle.ts +3 -3
- package/src/types/FieldOfView.ts +3 -3
- package/src/utility/BigNumber.ts +63 -41
- package/src/utility/MatrixSizeError.ts +1 -1
- package/src/utility/VectorSizeError.ts +14 -0
- package/src/utility/createAxisAngleLike.ts +14 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type AxisAngle from "../types/AxisAngle.js";
|
|
2
|
+
import createAxisAngleLike from "../utility/createAxisAngleLike.js";
|
|
1
3
|
import { type Matrix3Like } from "./Matrix3.js";
|
|
2
4
|
import Vector3, { type Vector3Like } from "./Vector3.js";
|
|
3
|
-
import type AxisAngle from "../types/AxisAngle.js";
|
|
4
5
|
/**
|
|
5
6
|
* A complex number that is commonly used to describe rotations.
|
|
6
7
|
* @see {@link https://en.wikipedia.org/wiki/Quaternion | Quaternion}
|
|
@@ -383,81 +384,116 @@ export declare const fromRotationTo: <T extends QuaternionLike>(a: Vector3Like,
|
|
|
383
384
|
* @public
|
|
384
385
|
*/
|
|
385
386
|
export default class Quaternion extends Float32Array implements QuaternionLike {
|
|
387
|
+
/** The first component of this quaternion. */
|
|
388
|
+
0: number;
|
|
389
|
+
/** The second component of this quaternion. */
|
|
390
|
+
1: number;
|
|
391
|
+
/** The third component of this quaternion. */
|
|
392
|
+
2: number;
|
|
393
|
+
/** The fourth component of this quaternion. */
|
|
394
|
+
3: number;
|
|
395
|
+
/** The axis and angle that represent this quaternion. */
|
|
396
|
+
get axisAngle(): ReturnType<typeof createAxisAngleLike>;
|
|
397
|
+
set axisAngle(value: AxisAngle);
|
|
398
|
+
/** Get the magnitude (length) of this quaternion. */
|
|
399
|
+
get magnitude(): number;
|
|
400
|
+
/** Get the squared magnitude (length) of this quaternion. */
|
|
401
|
+
get squaredMagnitude(): number;
|
|
386
402
|
/**
|
|
387
|
-
* Create
|
|
388
|
-
* @
|
|
389
|
-
|
|
403
|
+
* Create an identity quaternion.
|
|
404
|
+
* @see {@link https://en.wikipedia.org/wiki/Quaternion | Quaternion}
|
|
405
|
+
*/
|
|
406
|
+
constructor();
|
|
407
|
+
/**
|
|
408
|
+
* Create a quaternion with values corresponding to the given orthonormal set of vectors.
|
|
409
|
+
* @param view - The vector representing the viewing direction.
|
|
410
|
+
* @param right - The vector representing the local "right" direction.
|
|
411
|
+
* @param up - The vector representing the local "up" direction.
|
|
390
412
|
* @returns The quaternion.
|
|
391
|
-
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
392
413
|
*/
|
|
393
|
-
static
|
|
414
|
+
static fromAxes(view: Vector3Like, right: Vector3Like, up: Vector3Like): Quaternion;
|
|
394
415
|
/**
|
|
395
416
|
* Create a quaternion from equivalent z-y'-x" (intrinsic) Tait-Bryan angles.
|
|
396
417
|
* @param z - The z (roll) angle.
|
|
397
418
|
* @param y - The y (pitch) angle.
|
|
398
419
|
* @param x - The x (yaw) angle.
|
|
399
|
-
* @param out - The quaternion to store the result in.
|
|
400
420
|
* @returns The quaternion.
|
|
401
421
|
* @see {@link https://en.wikipedia.org/wiki/Euler_angles | Euler angles}
|
|
402
422
|
*/
|
|
403
|
-
static fromEuler
|
|
423
|
+
static fromEuler(z: number, y: number, x: number): Quaternion;
|
|
424
|
+
/**
|
|
425
|
+
* Create a quaternion from a three-by-three rotation matrix.
|
|
426
|
+
* @param matrix - The matrix.
|
|
427
|
+
* @returns The quaternion.
|
|
428
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
429
|
+
*/
|
|
430
|
+
static fromMatrix3(matrix: Matrix3Like): Quaternion;
|
|
431
|
+
/**
|
|
432
|
+
* Create a unit quaternion that represents the shortest rotation from one unit vector to another.
|
|
433
|
+
* @param a - The first unit vector.
|
|
434
|
+
* @param b - The second unit vector.
|
|
435
|
+
* @returns The unit quaternion.
|
|
436
|
+
*/
|
|
437
|
+
static fromRotationTo(a: Vector3Like, b: Vector3Like): Quaternion;
|
|
404
438
|
/**
|
|
405
439
|
* Create a quaternion with the given values.
|
|
406
440
|
* @param x - The first component.
|
|
407
441
|
* @param y - The second component.
|
|
408
442
|
* @param z - The third component.
|
|
409
443
|
* @param w - The fourth component.
|
|
410
|
-
* @param out - The quaternion to store the result in.
|
|
411
444
|
* @returns A new quaternion.
|
|
412
445
|
*/
|
|
413
|
-
static fromValues
|
|
446
|
+
static fromValues(x: number, y: number, z: number, w: number): Quaternion;
|
|
414
447
|
/**
|
|
415
|
-
*
|
|
416
|
-
* @param
|
|
417
|
-
* @
|
|
418
|
-
|
|
419
|
-
|
|
448
|
+
* Add two quaternions of the same size.
|
|
449
|
+
* @param quaternion - The other quaternion.
|
|
450
|
+
* @returns The sum of the quaternions.
|
|
451
|
+
*/
|
|
452
|
+
add(quaternion: QuaternionLike): Quaternion;
|
|
453
|
+
/**
|
|
454
|
+
* Calculate the fourth component of this unit quaternion from the first three, ignoring the existing fourth component.
|
|
420
455
|
* @returns The quaternion.
|
|
421
456
|
*/
|
|
422
|
-
|
|
457
|
+
calculateW(): Quaternion;
|
|
423
458
|
/**
|
|
424
|
-
*
|
|
425
|
-
* @
|
|
426
|
-
* @param b - The second unit vector.
|
|
427
|
-
* @param out - The quaternion to store the result in.
|
|
428
|
-
* @returns The unit quaternion.
|
|
459
|
+
* Copy the values from this quaternion to another one.
|
|
460
|
+
* @returns The copy.
|
|
429
461
|
*/
|
|
430
|
-
|
|
462
|
+
clone(): Quaternion;
|
|
431
463
|
/**
|
|
432
|
-
*
|
|
433
|
-
* @
|
|
464
|
+
* Calculate the conjugate of this quaternion. If the quaternion is normalized, this is the same as the inverse but faster to calculate.
|
|
465
|
+
* @returns The conjugate.
|
|
434
466
|
*/
|
|
435
|
-
|
|
436
|
-
/** The first component of this quaternion. */
|
|
437
|
-
0: number;
|
|
438
|
-
/** The second component of this quaternion. */
|
|
439
|
-
1: number;
|
|
440
|
-
/** The third component of this quaternion. */
|
|
441
|
-
2: number;
|
|
442
|
-
/** The fourth component of this quaternion. */
|
|
443
|
-
3: number;
|
|
467
|
+
conjugate(): Quaternion;
|
|
444
468
|
/**
|
|
445
|
-
*
|
|
469
|
+
* Copy the values of another quaternion into this one.
|
|
470
|
+
* @param quaternion - The quaternion to copy.
|
|
446
471
|
* @returns This quaternion.
|
|
447
472
|
*/
|
|
448
|
-
|
|
473
|
+
copy(quaternion: QuaternionLike): this;
|
|
449
474
|
/**
|
|
450
|
-
*
|
|
451
|
-
* @param
|
|
452
|
-
* @returns The
|
|
475
|
+
* Calculate the dot product of this and another quaternion.
|
|
476
|
+
* @param quaternion - The other quaternion.
|
|
477
|
+
* @returns The dot product.
|
|
453
478
|
*/
|
|
454
|
-
|
|
479
|
+
dot(quaternion: QuaternionLike): number;
|
|
455
480
|
/**
|
|
456
|
-
*
|
|
457
|
-
* @param
|
|
458
|
-
* @returns
|
|
481
|
+
* Determine whether or not this quaternion is roughly equivalent to another.
|
|
482
|
+
* @param quaternion - The other quaternion.
|
|
483
|
+
* @returns Whether or not the quaternions are equivalent.
|
|
484
|
+
*/
|
|
485
|
+
equals(quaternion: QuaternionLike): boolean;
|
|
486
|
+
/**
|
|
487
|
+
* Determine whether or not this quaternion is exactly equivalent to another.
|
|
488
|
+
* @param quaternion - The other quaternion.
|
|
489
|
+
* @returns Whether or not the quaternions are equivalent.
|
|
490
|
+
*/
|
|
491
|
+
exactEquals(quaternion: QuaternionLike): boolean;
|
|
492
|
+
/**
|
|
493
|
+
* Calculate the exponential of this unit quaternion.
|
|
494
|
+
* @returns The exponential.
|
|
459
495
|
*/
|
|
460
|
-
|
|
496
|
+
exp(): Quaternion;
|
|
461
497
|
/**
|
|
462
498
|
* Get the angular distance between this unit quaternion and another.
|
|
463
499
|
* @param quaternion - The other unit quaternion.
|
|
@@ -465,162 +501,95 @@ export default class Quaternion extends Float32Array implements QuaternionLike {
|
|
|
465
501
|
*/
|
|
466
502
|
getAngle(quaternion: QuaternionLike): number;
|
|
467
503
|
/**
|
|
468
|
-
*
|
|
469
|
-
* @
|
|
470
|
-
* @param out - The quaternion to store the result in.
|
|
471
|
-
* @returns The product.
|
|
472
|
-
*/
|
|
473
|
-
multiply<T extends QuaternionLike = Quaternion>(quaternion: QuaternionLike, out?: T): T;
|
|
474
|
-
/**
|
|
475
|
-
* Rotate this quaternion by the given angle around the X-axis.
|
|
476
|
-
* @param r - The angle in radians.
|
|
477
|
-
* @param out - The quaternion to store the result in.
|
|
478
|
-
* @returns The rotated quaternion.
|
|
504
|
+
* Set this quaternion to the identity.
|
|
505
|
+
* @returns This quaternion.
|
|
479
506
|
*/
|
|
480
|
-
|
|
507
|
+
identity(): this;
|
|
481
508
|
/**
|
|
482
|
-
*
|
|
483
|
-
* @
|
|
484
|
-
* @param out - The quaternion to store the result in.
|
|
485
|
-
* @returns The rotated quaternion.
|
|
509
|
+
* Calculate the inverse of this quaternion. If the quaternion is normalized, the conjugate is the same but faster to calculate.
|
|
510
|
+
* @returns The inverse.
|
|
486
511
|
*/
|
|
487
|
-
|
|
512
|
+
invert(): Quaternion;
|
|
488
513
|
/**
|
|
489
|
-
*
|
|
490
|
-
* @param
|
|
491
|
-
* @param
|
|
492
|
-
* @returns The
|
|
514
|
+
* Perform a linear interpolation between this and another quaternion.
|
|
515
|
+
* @param quaternion - The other quaternion.
|
|
516
|
+
* @param t - The interpolation amount (in `[0,1]`).
|
|
517
|
+
* @returns The interpolated quaternion.
|
|
493
518
|
*/
|
|
494
|
-
|
|
519
|
+
lerp(quaternion: QuaternionLike, t: number): Quaternion;
|
|
495
520
|
/**
|
|
496
|
-
* Calculate the
|
|
497
|
-
* @
|
|
498
|
-
* @returns The quaternion.
|
|
521
|
+
* Calculate the natural logarithm of this unit quaternion.
|
|
522
|
+
* @returns The natural logarithm.
|
|
499
523
|
*/
|
|
500
|
-
|
|
524
|
+
ln(): Quaternion;
|
|
501
525
|
/**
|
|
502
|
-
*
|
|
503
|
-
* @param
|
|
504
|
-
* @returns The
|
|
526
|
+
* Multiply this and another quaternion.
|
|
527
|
+
* @param quaternion - The other quaternion.
|
|
528
|
+
* @returns The product.
|
|
505
529
|
*/
|
|
506
|
-
|
|
530
|
+
multiply(quaternion: QuaternionLike): Quaternion;
|
|
507
531
|
/**
|
|
508
|
-
*
|
|
509
|
-
* @
|
|
510
|
-
* @returns The natural logarithm.
|
|
532
|
+
* Normalize this quaternion.
|
|
533
|
+
* @returns The normalized quaternion.
|
|
511
534
|
*/
|
|
512
|
-
|
|
535
|
+
normalize(): Quaternion;
|
|
513
536
|
/**
|
|
514
537
|
* Calculate a power of this unit quaternion.
|
|
515
538
|
* @param scalar - The amount to scale the quaternion by.
|
|
516
|
-
* @param out - The quaternion to store the result in.
|
|
517
539
|
* @returns The power.
|
|
518
540
|
*/
|
|
519
|
-
pow
|
|
520
|
-
/**
|
|
521
|
-
* Perform a spherical linear interpolation between this and another quaternion.
|
|
522
|
-
* @param quaternion - The other quaternion.
|
|
523
|
-
* @param t - The interpolation amount in `[0,1]`.
|
|
524
|
-
* @param out - The quaternion to store the result in.
|
|
525
|
-
* @returns The interpolated quaternion.
|
|
526
|
-
* @see {@link https://en.wikipedia.org/wiki/Slerp | Slerp}
|
|
527
|
-
*/
|
|
528
|
-
slerp<T extends QuaternionLike = Quaternion>(quaternion: QuaternionLike, t: number, out?: T): T;
|
|
541
|
+
pow(scalar: number): Quaternion;
|
|
529
542
|
/**
|
|
530
543
|
* Set this to a random unit quaternion.
|
|
531
544
|
* @returns A random unit quaternion.
|
|
532
545
|
*/
|
|
533
546
|
random(): this;
|
|
534
547
|
/**
|
|
535
|
-
*
|
|
536
|
-
* @param
|
|
537
|
-
* @returns The
|
|
538
|
-
*/
|
|
539
|
-
invert<T extends QuaternionLike = Quaternion>(out?: T): T;
|
|
540
|
-
/**
|
|
541
|
-
* Calculate the conjugate of this quaternion. If the quaternion is normalized, this is the same as the inverse but faster to calculate.
|
|
542
|
-
* @param out - The quaternion to store the result in.
|
|
543
|
-
* @returns The conjugate.
|
|
544
|
-
*/
|
|
545
|
-
conjugate<T extends QuaternionLike = Quaternion>(out?: T): T;
|
|
546
|
-
/**
|
|
547
|
-
* Copy the values from this quaternion to another one.
|
|
548
|
-
* @param out - The quaternion to store the result in.
|
|
549
|
-
* @returns The copy.
|
|
548
|
+
* Rotate this quaternion by the given angle around the X-axis.
|
|
549
|
+
* @param r - The angle in radians.
|
|
550
|
+
* @returns The rotated quaternion.
|
|
550
551
|
*/
|
|
551
|
-
|
|
552
|
+
rotateX(r: number): Quaternion;
|
|
552
553
|
/**
|
|
553
|
-
*
|
|
554
|
-
* @param
|
|
555
|
-
* @returns
|
|
554
|
+
* Rotate this quaternion by the given angle around the Y-axis.
|
|
555
|
+
* @param r - The angle in radians.
|
|
556
|
+
* @returns The rotated quaternion.
|
|
556
557
|
*/
|
|
557
|
-
|
|
558
|
+
rotateY(r: number): Quaternion;
|
|
558
559
|
/**
|
|
559
|
-
*
|
|
560
|
-
* @param
|
|
561
|
-
* @
|
|
562
|
-
* @returns The sum of the quaternions.
|
|
560
|
+
* Rotate this quaternion by the given angle around the Z-axis.
|
|
561
|
+
* @param r - The angle in radians.
|
|
562
|
+
* @returns The rotated quaternion.
|
|
563
563
|
*/
|
|
564
|
-
|
|
564
|
+
rotateZ(r: number): Quaternion;
|
|
565
565
|
/**
|
|
566
566
|
* Scale this quaternion by a scalar.
|
|
567
567
|
* @param scalar - The scalar.
|
|
568
|
-
* @param out - The quaternion to store the result in.
|
|
569
568
|
* @returns The scaled quaternion.
|
|
570
569
|
*/
|
|
571
|
-
scale
|
|
572
|
-
/**
|
|
573
|
-
* Calculate the dot product of this and another quaternion.
|
|
574
|
-
* @param quaternion - The other quaternion.
|
|
575
|
-
* @returns The dot product.
|
|
576
|
-
*/
|
|
577
|
-
dot(quaternion: QuaternionLike): number;
|
|
570
|
+
scale(scalar: number): Quaternion;
|
|
578
571
|
/**
|
|
579
|
-
* Perform a linear interpolation between this and another quaternion.
|
|
572
|
+
* Perform a spherical linear interpolation between this and another quaternion.
|
|
580
573
|
* @param quaternion - The other quaternion.
|
|
581
|
-
* @param t - The interpolation amount
|
|
582
|
-
* @param out - The quaternion to store the result in.
|
|
574
|
+
* @param t - The interpolation amount in `[0,1]`.
|
|
583
575
|
* @returns The interpolated quaternion.
|
|
576
|
+
* @see {@link https://en.wikipedia.org/wiki/Slerp | Slerp}
|
|
584
577
|
*/
|
|
585
|
-
|
|
586
|
-
/** Get the magnitude (length) of this quaternion. */
|
|
587
|
-
get magnitude(): number;
|
|
588
|
-
/** Get the squared magnitude (length) of this quaternion. */
|
|
589
|
-
get squaredMagnitude(): number;
|
|
590
|
-
/**
|
|
591
|
-
* Normalize this quaternion.
|
|
592
|
-
* @param out - The quaternion to store the result in.
|
|
593
|
-
* @returns The normalized quaternion.
|
|
594
|
-
*/
|
|
595
|
-
normalize<T extends QuaternionLike = Quaternion>(out?: T): T;
|
|
596
|
-
/**
|
|
597
|
-
* Determine whether or not this quaternion is roughly equivalent to another.
|
|
598
|
-
* @param quaternion - The other quaternion.
|
|
599
|
-
* @returns Whether or not the quaternions are equivalent.
|
|
600
|
-
*/
|
|
601
|
-
equals(quaternion: QuaternionLike): boolean;
|
|
602
|
-
/**
|
|
603
|
-
* Determine whether or not this quaternion is exactly equivalent to another.
|
|
604
|
-
* @param quaternion - The other quaternion.
|
|
605
|
-
* @returns Whether or not the quaternions are equivalent.
|
|
606
|
-
*/
|
|
607
|
-
exactEquals(quaternion: QuaternionLike): boolean;
|
|
578
|
+
slerp(quaternion: QuaternionLike, t: number): Quaternion;
|
|
608
579
|
/**
|
|
609
580
|
* Perform a spherical linear interpolation with two control points between this and another quaternion.
|
|
610
581
|
* @param a - The first control point.
|
|
611
582
|
* @param b - The second control point.
|
|
612
583
|
* @param quaternion - The other quaternion.
|
|
613
584
|
* @param t - The interpolation amount in `[0,1]`.
|
|
614
|
-
* @param out - The quaternion to store the result in.
|
|
615
585
|
* @returns The interpolated value.
|
|
616
586
|
* @see {@link https://en.wikipedia.org/wiki/Slerp | Slerp}
|
|
617
587
|
*/
|
|
618
|
-
sqlerp
|
|
588
|
+
sqlerp(a: QuaternionLike, b: QuaternionLike, quaternion: QuaternionLike, t: number): Quaternion;
|
|
619
589
|
/**
|
|
620
590
|
* Convert this quaternion to equivalent z-y'-x" (intrinsic) Tait-Bryan angles.
|
|
621
|
-
* @param out - The vector in which to store the Tait-Bryan angles.
|
|
622
591
|
* @returns The Tait-Bryan angles in degrees in roll (z), pitch (y'), yaw (x") order.
|
|
623
592
|
*/
|
|
624
|
-
toEuler
|
|
593
|
+
toEuler(): Vector3;
|
|
625
594
|
}
|
|
626
595
|
//# sourceMappingURL=Quaternion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Quaternion.d.ts","sourceRoot":"","sources":["../../src/linalg/Quaternion.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Quaternion.d.ts","sourceRoot":"","sources":["../../src/linalg/Quaternion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AAGnD,OAAO,mBAAmB,MAAM,mCAAmC,CAAC;AAEpE,OAAO,EAGN,KAAK,WAAW,EAChB,MAAM,cAAc,CAAC;AACtB,OAA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