@lakuna/umath 1.3.9 → 1.4.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.
- package/README.md +1 -1
- package/dist/algorithms/approx.d.ts +9 -0
- package/dist/algorithms/approx.d.ts.map +1 -0
- package/dist/algorithms/approx.js +12 -0
- package/dist/algorithms/approx.js.map +1 -0
- package/dist/algorithms/approxRelative.d.ts +9 -0
- package/dist/algorithms/approxRelative.d.ts.map +1 -0
- package/dist/algorithms/approxRelative.js +12 -0
- package/dist/algorithms/approxRelative.js.map +1 -0
- package/dist/algorithms/combinations.d.ts +2 -1
- package/dist/algorithms/combinations.d.ts.map +1 -1
- package/dist/algorithms/combinations.js +2 -1
- package/dist/algorithms/combinations.js.map +1 -1
- package/dist/algorithms/degreesToRadians.d.ts +3 -2
- package/dist/algorithms/degreesToRadians.d.ts.map +1 -1
- package/dist/algorithms/degreesToRadians.js +5 -3
- package/dist/algorithms/degreesToRadians.js.map +1 -1
- package/dist/algorithms/factorial.d.ts +2 -1
- package/dist/algorithms/factorial.d.ts.map +1 -1
- package/dist/algorithms/factorial.js +2 -1
- package/dist/algorithms/factorial.js.map +1 -1
- package/dist/algorithms/fibonacci.d.ts +2 -1
- package/dist/algorithms/fibonacci.d.ts.map +1 -1
- package/dist/algorithms/fibonacci.js +6 -2
- package/dist/algorithms/fibonacci.js.map +1 -1
- package/dist/algorithms/greatestCommonDivisor.d.ts +4 -2
- package/dist/algorithms/greatestCommonDivisor.d.ts.map +1 -1
- package/dist/algorithms/greatestCommonDivisor.js +5 -2
- package/dist/algorithms/greatestCommonDivisor.js.map +1 -1
- package/dist/algorithms/hypergeometricPmf.d.ts +3 -2
- package/dist/algorithms/hypergeometricPmf.d.ts.map +1 -1
- package/dist/algorithms/hypergeometricPmf.js +3 -2
- package/dist/algorithms/hypergeometricPmf.js.map +1 -1
- package/dist/algorithms/isPrime.d.ts +2 -1
- package/dist/algorithms/isPrime.d.ts.map +1 -1
- package/dist/algorithms/isPrime.js +2 -1
- package/dist/algorithms/isPrime.js.map +1 -1
- package/dist/algorithms/permutations.d.ts +2 -1
- package/dist/algorithms/permutations.d.ts.map +1 -1
- package/dist/algorithms/permutations.js +2 -1
- package/dist/algorithms/permutations.js.map +1 -1
- package/dist/algorithms/primeFactorization.d.ts +2 -1
- package/dist/algorithms/primeFactorization.d.ts.map +1 -1
- package/dist/algorithms/primeFactorization.js +2 -1
- package/dist/algorithms/primeFactorization.js.map +1 -1
- package/dist/algorithms/radiansToDegrees.d.ts +3 -2
- package/dist/algorithms/radiansToDegrees.d.ts.map +1 -1
- package/dist/algorithms/radiansToDegrees.js +5 -3
- package/dist/algorithms/radiansToDegrees.js.map +1 -1
- package/dist/algorithms/summation.d.ts +2 -1
- package/dist/algorithms/summation.d.ts.map +1 -1
- package/dist/algorithms/summation.js +2 -1
- package/dist/algorithms/summation.js.map +1 -1
- package/dist/linalg/DualQuaternion.d.ts +102 -32
- package/dist/linalg/DualQuaternion.d.ts.map +1 -1
- package/dist/linalg/DualQuaternion.js +243 -272
- package/dist/linalg/DualQuaternion.js.map +1 -1
- package/dist/linalg/Matrix.d.ts +14 -10
- package/dist/linalg/Matrix.d.ts.map +1 -1
- package/dist/linalg/Matrix2.d.ts +74 -51
- package/dist/linalg/Matrix2.d.ts.map +1 -1
- package/dist/linalg/Matrix2.js +95 -171
- package/dist/linalg/Matrix2.js.map +1 -1
- package/dist/linalg/Matrix3.d.ts +122 -72
- package/dist/linalg/Matrix3.d.ts.map +1 -1
- package/dist/linalg/Matrix3.js +186 -355
- package/dist/linalg/Matrix3.js.map +1 -1
- package/dist/linalg/Matrix4.d.ts +266 -149
- package/dist/linalg/Matrix4.d.ts.map +1 -1
- package/dist/linalg/Matrix4.js +512 -852
- package/dist/linalg/Matrix4.js.map +1 -1
- package/dist/linalg/Quaternion.d.ts +252 -34
- package/dist/linalg/Quaternion.d.ts.map +1 -1
- package/dist/linalg/Quaternion.js +436 -166
- package/dist/linalg/Quaternion.js.map +1 -1
- package/dist/linalg/SlowMatrix.d.ts +10 -9
- package/dist/linalg/SlowMatrix.d.ts.map +1 -1
- package/dist/linalg/SlowMatrix.js +10 -9
- package/dist/linalg/SlowMatrix.js.map +1 -1
- package/dist/linalg/SlowSquareMatrix.d.ts +10 -9
- package/dist/linalg/SlowSquareMatrix.d.ts.map +1 -1
- package/dist/linalg/SlowSquareMatrix.js +10 -9
- package/dist/linalg/SlowSquareMatrix.js.map +1 -1
- package/dist/linalg/SquareMatrix.d.ts +6 -5
- package/dist/linalg/SquareMatrix.d.ts.map +1 -1
- package/dist/linalg/Vector.d.ts +8 -4
- package/dist/linalg/Vector.d.ts.map +1 -1
- package/dist/linalg/Vector2.d.ts +82 -31
- package/dist/linalg/Vector2.d.ts.map +1 -1
- package/dist/linalg/Vector2.js +112 -154
- package/dist/linalg/Vector2.js.map +1 -1
- package/dist/linalg/Vector3.d.ts +93 -41
- package/dist/linalg/Vector3.d.ts.map +1 -1
- package/dist/linalg/Vector3.js +171 -282
- package/dist/linalg/Vector3.js.map +1 -1
- package/dist/linalg/Vector4.d.ts +71 -21
- package/dist/linalg/Vector4.d.ts.map +1 -1
- package/dist/linalg/Vector4.js +121 -195
- package/dist/linalg/Vector4.js.map +1 -1
- package/dist/types/AxisAngle.d.ts +4 -1
- package/dist/types/AxisAngle.d.ts.map +1 -1
- package/dist/types/FieldOfView.d.ts +4 -1
- package/dist/types/FieldOfView.d.ts.map +1 -1
- package/dist/utility/BigNumber.d.ts +4 -1
- package/dist/utility/BigNumber.d.ts.map +1 -1
- package/dist/utility/BigNumber.js +4 -1
- package/dist/utility/BigNumber.js.map +1 -1
- package/dist/utility/MagnitudeError.d.ts +4 -1
- package/dist/utility/MagnitudeError.d.ts.map +1 -1
- package/dist/utility/MagnitudeError.js +4 -1
- package/dist/utility/MagnitudeError.js.map +1 -1
- package/dist/utility/MatrixSizeError.d.ts +4 -1
- package/dist/utility/MatrixSizeError.d.ts.map +1 -1
- package/dist/utility/MatrixSizeError.js +4 -1
- package/dist/utility/MatrixSizeError.js.map +1 -1
- package/dist/utility/PartialMatrixError.d.ts +4 -1
- package/dist/utility/PartialMatrixError.d.ts.map +1 -1
- package/dist/utility/PartialMatrixError.js +4 -1
- package/dist/utility/PartialMatrixError.js.map +1 -1
- package/dist/utility/SingularMatrixError.d.ts +2 -1
- package/dist/utility/SingularMatrixError.d.ts.map +1 -1
- package/dist/utility/SingularMatrixError.js +2 -1
- package/dist/utility/SingularMatrixError.js.map +1 -1
- package/dist/utility/epsilon.d.ts +4 -1
- package/dist/utility/epsilon.d.ts.map +1 -1
- package/dist/utility/epsilon.js +4 -1
- package/dist/utility/epsilon.js.map +1 -1
- package/package.json +11 -11
- package/src/algorithms/approx.ts +12 -0
- package/src/algorithms/approxRelative.ts +12 -0
- package/src/algorithms/combinations.ts +2 -1
- package/src/algorithms/degreesToRadians.ts +6 -3
- package/src/algorithms/factorial.ts +3 -1
- package/src/algorithms/fibonacci.ts +7 -2
- package/src/algorithms/greatestCommonDivisor.ts +9 -4
- package/src/algorithms/hypergeometricPmf.ts +3 -2
- package/src/algorithms/isPrime.ts +2 -1
- package/src/algorithms/permutations.ts +2 -1
- package/src/algorithms/primeFactorization.ts +2 -1
- package/src/algorithms/radiansToDegrees.ts +6 -3
- package/src/algorithms/summation.ts +2 -1
- package/src/linalg/DualQuaternion.ts +424 -289
- package/src/linalg/Matrix.ts +14 -10
- package/src/linalg/Matrix2.ts +141 -188
- package/src/linalg/Matrix3.ts +400 -375
- package/src/linalg/Matrix4.ts +1083 -905
- package/src/linalg/Quaternion.ts +706 -188
- package/src/linalg/SlowMatrix.ts +10 -9
- package/src/linalg/SlowSquareMatrix.ts +10 -9
- package/src/linalg/SquareMatrix.ts +6 -5
- package/src/linalg/Vector.ts +8 -4
- package/src/linalg/Vector2.ts +146 -173
- package/src/linalg/Vector3.ts +293 -326
- package/src/linalg/Vector4.ts +227 -215
- package/src/types/AxisAngle.ts +4 -1
- package/src/types/FieldOfView.ts +4 -1
- package/src/utility/BigNumber.ts +6 -3
- package/src/utility/MagnitudeError.ts +4 -1
- package/src/utility/MatrixSizeError.ts +4 -1
- package/src/utility/PartialMatrixError.ts +4 -1
- package/src/utility/SingularMatrixError.ts +2 -1
- package/src/utility/epsilon.ts +4 -1
package/dist/linalg/Matrix4.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ import type { MatrixLike } from "./Matrix.js";
|
|
|
6
6
|
import type SquareMatrix from "./SquareMatrix.js";
|
|
7
7
|
/**
|
|
8
8
|
* Numbers arranged into four columns and four rows.
|
|
9
|
-
* @see
|
|
9
|
+
* @see {@link https://en.wikipedia.org/wiki/Matrix_(mathematics) | Matrix}
|
|
10
|
+
* @public
|
|
10
11
|
*/
|
|
11
12
|
export interface Matrix4Like extends MatrixLike {
|
|
12
13
|
/** The value in the first column and first row. */
|
|
@@ -43,110 +44,155 @@ export interface Matrix4Like extends MatrixLike {
|
|
|
43
44
|
15: number;
|
|
44
45
|
}
|
|
45
46
|
/**
|
|
46
|
-
* Create a
|
|
47
|
-
* @returns A
|
|
47
|
+
* Create a four-by-four matrix-like object.
|
|
48
|
+
* @returns A four-by-four matrix-like object.
|
|
49
|
+
* @public
|
|
48
50
|
*/
|
|
49
51
|
export declare const createMatrix4Like: () => Float32Array & Matrix4Like;
|
|
50
52
|
/**
|
|
51
|
-
* Create a
|
|
53
|
+
* Create a four-by-four matrix with the given values.
|
|
54
|
+
* @param c0r0 - The value in the first column and first row.
|
|
55
|
+
* @param c0r1 - The value in the first column and second row.
|
|
56
|
+
* @param c0r2 - The value in the first column and third row.
|
|
57
|
+
* @param c0r3 - The value in the first column and fourth row.
|
|
58
|
+
* @param c1r0 - The value in the second column and first row.
|
|
59
|
+
* @param c1r1 - The value in the second column and second row.
|
|
60
|
+
* @param c1r2 - The value in the second column and third row.
|
|
61
|
+
* @param c1r3 - The value in the second column and fourth row.
|
|
62
|
+
* @param c2r0 - The value in the third column and first row.
|
|
63
|
+
* @param c2r1 - The value in the third column and second row.
|
|
64
|
+
* @param c2r2 - The value in the third column and third row.
|
|
65
|
+
* @param c2r3 - The value in the third column and fourth row.
|
|
66
|
+
* @param c3r0 - The value in the fourth column and first row.
|
|
67
|
+
* @param c3r1 - The value in the fourth column and second row.
|
|
68
|
+
* @param c3r2 - The value in the fourth column and third row.
|
|
69
|
+
* @param c3r3 - The value in the fourth column and fourth row.
|
|
70
|
+
* @param out - The matrix to store the result in.
|
|
71
|
+
* @returns The matrix.
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
74
|
+
export declare const fromValues: <T extends Matrix4Like>(c0r0: number, c0r1: number, c0r2: number, c0r3: number, c1r0: number, c1r1: number, c1r2: number, c1r3: number, c2r0: number, c2r1: number, c2r2: number, c2r3: number, c3r0: number, c3r1: number, c3r2: number, c3r3: number, out: T) => T;
|
|
75
|
+
/**
|
|
76
|
+
* Create a transformation matrix that represents a translation by the given vector. Equivalent to (but faster than) `translate(identity(out), vector, out)`.
|
|
52
77
|
* @param vector - The translation vector.
|
|
53
78
|
* @param out - The matrix to store the result in.
|
|
54
79
|
* @returns The transformation matrix.
|
|
55
|
-
* @see
|
|
80
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
81
|
+
* @public
|
|
56
82
|
*/
|
|
57
83
|
export declare const fromTranslation: <T extends Matrix4Like>(vector: Vector3Like, out: T) => T;
|
|
58
84
|
/**
|
|
59
|
-
* Create a transformation matrix that represents a scaling by the given vector.
|
|
85
|
+
* Create a transformation matrix that represents a scaling by the given vector. This is equivalent to (but faster than) `scale(identity(out), vector, out)`.
|
|
60
86
|
* @param vector - The scaling vector.
|
|
61
87
|
* @param out - The matrix to store the result in.
|
|
62
88
|
* @returns The transformation matrix.
|
|
63
|
-
* @see
|
|
89
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
90
|
+
* @public
|
|
64
91
|
*/
|
|
65
92
|
export declare const fromScaling: <T extends Matrix4Like>(vector: Vector3Like, out: T) => T;
|
|
66
93
|
/**
|
|
67
94
|
* Reset a matrix to identity.
|
|
68
95
|
* @param out - The matrix to store the result in.
|
|
69
96
|
* @returns The matrix.
|
|
70
|
-
* @see
|
|
97
|
+
* @see {@link https://en.wikipedia.org/wiki/Identity_matrix | Identity matrix}
|
|
98
|
+
* @public
|
|
71
99
|
*/
|
|
72
100
|
export declare const identity: <T extends Matrix4Like>(out: T) => T;
|
|
73
101
|
/**
|
|
74
|
-
* Create a transformation matrix that represents a rotation by the given angle around the
|
|
75
|
-
* @param
|
|
102
|
+
* Create a transformation matrix that represents a rotation by the given angle around the given axis. This is equivalent to (but faster than) `rotate(identity(out), radians, axis, out)`.
|
|
103
|
+
* @param radians - The angle in radians.
|
|
76
104
|
* @param axis - The axis to rotate around.
|
|
77
105
|
* @param out - The matrix to store the result in.
|
|
78
106
|
* @returns The transformation matrix.
|
|
79
|
-
* @see
|
|
107
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
108
|
+
* @public
|
|
80
109
|
*/
|
|
81
|
-
export declare const fromRotation: <T extends Matrix4Like>(
|
|
110
|
+
export declare const fromRotation: <T extends Matrix4Like>(radians: number, axis: Vector3Like, out: T) => T;
|
|
82
111
|
/**
|
|
83
|
-
* Create a transformation matrix that represents a rotation by the given angle around the X-axis.
|
|
84
|
-
* @param
|
|
112
|
+
* Create a transformation matrix that represents a rotation by the given angle around the X-axis. This is equivalent to (but faster than) `rotateX(identity(out), radians, out)`.
|
|
113
|
+
* @param radians - The angle in radians.
|
|
85
114
|
* @param out - The matrix to store the result in.
|
|
86
115
|
* @returns The transformation matrix.
|
|
87
|
-
* @see
|
|
116
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
117
|
+
* @public
|
|
88
118
|
*/
|
|
89
|
-
export declare const fromXRotation: <T extends Matrix4Like>(
|
|
119
|
+
export declare const fromXRotation: <T extends Matrix4Like>(radians: number, out: T) => T;
|
|
90
120
|
/**
|
|
91
|
-
* Create a transformation matrix that represents a rotation by the given angle around the Y-axis.
|
|
92
|
-
* @param
|
|
121
|
+
* Create a transformation matrix that represents a rotation by the given angle around the Y-axis. This is equivalent to (but faster than) `rotateY(identity(out), radians, out)`.
|
|
122
|
+
* @param radians - The angle in radians.
|
|
93
123
|
* @param out - The matrix to store the result in.
|
|
94
124
|
* @returns The transformation matrix.
|
|
95
|
-
* @see
|
|
125
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
126
|
+
* @public
|
|
96
127
|
*/
|
|
97
|
-
export declare const fromYRotation: <T extends Matrix4Like>(
|
|
128
|
+
export declare const fromYRotation: <T extends Matrix4Like>(radians: number, out: T) => T;
|
|
98
129
|
/**
|
|
99
|
-
* Create a transformation matrix that represents a rotation by the given angle around the Z-axis.
|
|
100
|
-
* @param
|
|
130
|
+
* Create a transformation matrix that represents a rotation by the given angle around the Z-axis. This is equivalent to (but faster than) `rotateZ(identity(out), radians, out)`.
|
|
131
|
+
* @param radians - The angle in radians.
|
|
101
132
|
* @param out - The matrix to store the result in.
|
|
102
133
|
* @returns The transformation matrix.
|
|
103
|
-
* @see
|
|
134
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
135
|
+
* @public
|
|
104
136
|
*/
|
|
105
|
-
export declare const fromZRotation: <T extends Matrix4Like>(
|
|
137
|
+
export declare const fromZRotation: <T extends Matrix4Like>(radians: number, out: T) => T;
|
|
106
138
|
/**
|
|
107
|
-
* Create a transformation matrix from the given rotation and translation.
|
|
139
|
+
* Create a transformation matrix from the given rotation and translation. This is equivalent to (but faster than) `multiply(translate(identity(out), translation, out), fromQuaternion(rotation, createMatrix4Like()), out)`.
|
|
108
140
|
* @param rotation - The rotation quaternion.
|
|
109
141
|
* @param translation - The translation vector.
|
|
110
142
|
* @param out - The matrix to store the result in.
|
|
111
143
|
* @returns The transformation matrix.
|
|
112
|
-
* @see
|
|
113
|
-
* @see
|
|
114
|
-
* @see
|
|
144
|
+
* @see {@link https://en.wikipedia.org/wiki/Quaternion | Quaternion}
|
|
145
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
146
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
147
|
+
* @public
|
|
115
148
|
*/
|
|
116
149
|
export declare const fromRotationTranslation: <T extends Matrix4Like>(rotation: QuaternionLike, translation: Vector3Like, out: T) => T;
|
|
117
150
|
/**
|
|
118
|
-
* Create a transformation matrix from the given rotation, translation, and scale.
|
|
151
|
+
* Create a transformation matrix from the given rotation, translation, and scale. This is equivalent to (but faster than) `scale(multiply(translate(identity(out), translation, out), fromQuaternion(rotation, createMatrix4Like()), out), scaling, out)`.
|
|
119
152
|
* @param rotation - The rotation quaternion.
|
|
120
153
|
* @param translation - The translation vector.
|
|
121
154
|
* @param scaling - The scaling vector.
|
|
122
155
|
* @param out - The matrix to store the result in.
|
|
123
156
|
* @returns The transformation matrix.
|
|
124
|
-
* @see
|
|
125
|
-
* @see
|
|
126
|
-
* @see
|
|
157
|
+
* @see {@link https://en.wikipedia.org/wiki/Quaternion | Quaternion}
|
|
158
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
159
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
160
|
+
* @public
|
|
127
161
|
*/
|
|
128
162
|
export declare const fromRotationTranslationScale: <T extends Matrix4Like>(rotation: QuaternionLike, translation: Vector3Like, scaling: Vector3Like, out: T) => T;
|
|
129
163
|
/**
|
|
130
|
-
* Create a transformation matrix from the given rotation, translation, and scale around the given origin.
|
|
164
|
+
* Create a transformation matrix from the given rotation, translation, and scale around the given origin. This is equivalent to (but faster than) `translate(scale(multiply(translate(translate(identity(out), translation, out), origin, out), fromQuaternion(rotation, createMatrix4Like()), out), scaling, out), negate(origin), out)`.
|
|
131
165
|
* @param rotation - The rotation quaternion.
|
|
132
166
|
* @param translation - The translation vector.
|
|
133
167
|
* @param scaling - The scaling vector.
|
|
134
168
|
* @param origin - The origin vector.
|
|
135
169
|
* @param out - The matrix to store the result in.
|
|
136
170
|
* @returns The transformation matrix.
|
|
137
|
-
* @see
|
|
138
|
-
* @see
|
|
139
|
-
* @see
|
|
171
|
+
* @see {@link https://en.wikipedia.org/wiki/Quaternion | Quaternion}
|
|
172
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
173
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
174
|
+
* @public
|
|
140
175
|
*/
|
|
141
176
|
export declare const fromRotationTranslationScaleOrigin: <T extends Matrix4Like>(rotation: QuaternionLike, translation: Vector3Like, scaling: Vector3Like, origin: Vector3Like, out: T) => T;
|
|
177
|
+
/**
|
|
178
|
+
* Create a transformation matrix from a quaternion.
|
|
179
|
+
* @param quaternion - The quaternion.
|
|
180
|
+
* @param out - The matrix to store the result in.
|
|
181
|
+
* @returns The transformation matrix.
|
|
182
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
183
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
184
|
+
* @public
|
|
185
|
+
*/
|
|
186
|
+
export declare const fromQuaternion: <T extends Matrix4Like>(quaternion: QuaternionLike, out: T) => T;
|
|
142
187
|
/**
|
|
143
188
|
* Create a transformation matrix from a dual quaternion.
|
|
144
189
|
* @param quaternion - The dual quaternion.
|
|
145
190
|
* @param out - The matrix to store the result in.
|
|
146
191
|
* @returns The transformation matrix.
|
|
147
|
-
* @see
|
|
148
|
-
* @see
|
|
149
|
-
* @see
|
|
192
|
+
* @see {@link https://en.wikipedia.org/wiki/Dual_quaternion | Dual quaternion}
|
|
193
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
194
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
195
|
+
* @public
|
|
150
196
|
*/
|
|
151
197
|
export declare const fromDualQuaternion: <T extends Matrix4Like>(quaternion: DualQuaternionLike, out: T) => T;
|
|
152
198
|
/**
|
|
@@ -159,22 +205,37 @@ export declare const fromDualQuaternion: <T extends Matrix4Like>(quaternion: Dua
|
|
|
159
205
|
* @param far - The far bound of the frustum.
|
|
160
206
|
* @param out - The matrix to store the result in.
|
|
161
207
|
* @returns The frustum matrix.
|
|
162
|
-
* @see
|
|
163
|
-
* @see
|
|
208
|
+
* @see {@link https://en.wikipedia.org/wiki/Camera_matrix | Camera matrix}
|
|
209
|
+
* @see {@link https://en.wikipedia.org/wiki/3D_projection | 3D projection}
|
|
210
|
+
* @public
|
|
164
211
|
*/
|
|
165
212
|
export declare const frustum: <T extends Matrix4Like>(left: number, right: number, bottom: number, top: number, near: number, far: number, out: T) => T;
|
|
166
213
|
/**
|
|
167
|
-
* Create a perspective projection matrix with the given bounds.
|
|
214
|
+
* Create a perspective projection matrix with the given bounds such that the near and far clip planes correspond to a normalized device coordinate Z range of `[-1, 1]` (OpenGL/WebGL).
|
|
168
215
|
* @param fov - The vertical field of view in radians.
|
|
169
216
|
* @param aspect - The aspect ratio (typically the width of the viewport divided by its height).
|
|
170
217
|
* @param near - The near bound of the frustum. Must be strictly positive.
|
|
171
218
|
* @param far - The far bound of the frustum.
|
|
172
219
|
* @param out - The matrix to store the result in.
|
|
173
220
|
* @returns The perspective projection matrix.
|
|
174
|
-
* @see
|
|
175
|
-
* @see
|
|
221
|
+
* @see {@link https://en.wikipedia.org/wiki/Camera_matrix | Camera matrix}
|
|
222
|
+
* @see {@link https://en.wikipedia.org/wiki/3D_projection | 3D projection}
|
|
223
|
+
* @public
|
|
176
224
|
*/
|
|
177
225
|
export declare const perspective: <T extends Matrix4Like>(fov: number, aspect: number, near: number, far: number, out: T) => T;
|
|
226
|
+
/**
|
|
227
|
+
* Create a perspective projection matrix with the given bounds such that the near and far clip planes correspond to a normalized device coordinate Z range of `[0, 1]` (WebGPU/Vulkan/DirectX/Metal).
|
|
228
|
+
* @param fov - The vertical field of view in radians.
|
|
229
|
+
* @param aspect - The aspect ratio (typically the width of the viewport divided by its height).
|
|
230
|
+
* @param near - The near bound of the frustum. Must be strictly positive.
|
|
231
|
+
* @param far - The far bound of the frustum.
|
|
232
|
+
* @param out - The matrix to store the result in.
|
|
233
|
+
* @returns The perspective projection matrix.
|
|
234
|
+
* @see {@link https://en.wikipedia.org/wiki/Camera_matrix | Camera matrix}
|
|
235
|
+
* @see {@link https://en.wikipedia.org/wiki/3D_projection | 3D projection}
|
|
236
|
+
* @public
|
|
237
|
+
*/
|
|
238
|
+
export declare const perspectiveGpu: <T extends Matrix4Like>(fov: number, aspect: number, near: number, far: number, out: T) => T;
|
|
178
239
|
/**
|
|
179
240
|
* Create a perspective projection matrix from a field of view. Useful for generating projection matrices to be used with the WebXR API.
|
|
180
241
|
* @param fov - The field of view.
|
|
@@ -182,13 +243,14 @@ export declare const perspective: <T extends Matrix4Like>(fov: number, aspect: n
|
|
|
182
243
|
* @param far - The far bound of the frustum.
|
|
183
244
|
* @param out - The matrix to store the result in.
|
|
184
245
|
* @returns The perspective projection matrix.
|
|
185
|
-
* @see
|
|
186
|
-
* @see
|
|
187
|
-
* @see
|
|
246
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/WebXR_Device_API | WebXR API}
|
|
247
|
+
* @see {@link https://en.wikipedia.org/wiki/Camera_matrix | Camera matrix}
|
|
248
|
+
* @see {@link https://en.wikipedia.org/wiki/3D_projection | 3D projection}
|
|
249
|
+
* @public
|
|
188
250
|
*/
|
|
189
251
|
export declare const perspectiveFromFieldOfView: <T extends Matrix4Like>(fov: FieldOfView, near: number, far: number, out: T) => T;
|
|
190
252
|
/**
|
|
191
|
-
* Generate an orthogonal projection matrix with the given bounds.
|
|
253
|
+
* Generate an orthogonal projection matrix with the given bounds such that the near and far clip planes correspond to a normalized device coordinate Z range of `[-1, 1]` (OpenGL/WebGL).
|
|
192
254
|
* @param left - The left bound of the frustum.
|
|
193
255
|
* @param right - The right bound of the frustum.
|
|
194
256
|
* @param bottom - The bottom bound of the frustum.
|
|
@@ -197,10 +259,26 @@ export declare const perspectiveFromFieldOfView: <T extends Matrix4Like>(fov: Fi
|
|
|
197
259
|
* @param far - The far bound of the frustum.
|
|
198
260
|
* @param out - The matrix to store the result in.
|
|
199
261
|
* @returns The frustum matrix.
|
|
200
|
-
* @see
|
|
201
|
-
* @see
|
|
262
|
+
* @see {@link https://en.wikipedia.org/wiki/Camera_matrix | Camera matrix}
|
|
263
|
+
* @see {@link https://en.wikipedia.org/wiki/3D_projection | 3D projection}
|
|
264
|
+
* @public
|
|
202
265
|
*/
|
|
203
266
|
export declare const ortho: <T extends Matrix4Like>(left: number, right: number, bottom: number, top: number, near: number, far: number, out: T) => T;
|
|
267
|
+
/**
|
|
268
|
+
* Generate an orthogonal projection matrix with the given bounds such that the near and far clip planes correspond to a normalized device coordinate Z range of `[0, 1]` (WebGPU/Vulkan/DirectX/Metal).
|
|
269
|
+
* @param left - The left bound of the frustum.
|
|
270
|
+
* @param right - The right bound of the frustum.
|
|
271
|
+
* @param bottom - The bottom bound of the frustum.
|
|
272
|
+
* @param top - The top bound of the frustum.
|
|
273
|
+
* @param near - The near bound of the frustum.
|
|
274
|
+
* @param far - The far bound of the frustum.
|
|
275
|
+
* @param out - The matrix to store the result in.
|
|
276
|
+
* @returns The frustum matrix.
|
|
277
|
+
* @see {@link https://en.wikipedia.org/wiki/Camera_matrix | Camera matrix}
|
|
278
|
+
* @see {@link https://en.wikipedia.org/wiki/3D_projection | 3D projection}
|
|
279
|
+
* @public
|
|
280
|
+
*/
|
|
281
|
+
export declare const orthoGpu: <T extends Matrix4Like>(left: number, right: number, bottom: number, top: number, near: number, far: number, out: T) => T;
|
|
204
282
|
/**
|
|
205
283
|
* Generate a look-at matrix. If you want a matrix that actually makes an object look at another object, use `targetTo` instead.
|
|
206
284
|
* @param eye - The position of the viewer.
|
|
@@ -208,7 +286,8 @@ export declare const ortho: <T extends Matrix4Like>(left: number, right: number,
|
|
|
208
286
|
* @param up - The local up direction.
|
|
209
287
|
* @param out - The matrix to store the result in.
|
|
210
288
|
* @returns The look-at matrix.
|
|
211
|
-
* @see
|
|
289
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
290
|
+
* @public
|
|
212
291
|
*/
|
|
213
292
|
export declare const lookAt: <T extends Matrix4Like>(eye: Vector3Like, center: Vector3Like, up: Vector3Like, out: T) => T;
|
|
214
293
|
/**
|
|
@@ -218,7 +297,8 @@ export declare const lookAt: <T extends Matrix4Like>(eye: Vector3Like, center: V
|
|
|
218
297
|
* @param up - The local up direction.
|
|
219
298
|
* @param out - The matrix to store the result in.
|
|
220
299
|
* @returns The transformation matrix.
|
|
221
|
-
* @see
|
|
300
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
301
|
+
* @public
|
|
222
302
|
*/
|
|
223
303
|
export declare const targetTo: <T extends Matrix4Like>(eye: Vector3Like, target: Vector3Like, up: Vector3Like, out: T) => T;
|
|
224
304
|
/**
|
|
@@ -227,36 +307,16 @@ export declare const targetTo: <T extends Matrix4Like>(eye: Vector3Like, target:
|
|
|
227
307
|
* @param b - The addend.
|
|
228
308
|
* @param out - The matrix to store the result in.
|
|
229
309
|
* @returns The sum.
|
|
230
|
-
* @see
|
|
310
|
+
* @see {@link https://en.wikipedia.org/wiki/Matrix_addition | Matrix addition}
|
|
311
|
+
* @public
|
|
231
312
|
*/
|
|
232
313
|
export declare const add: <T extends Matrix4Like>(a: Matrix4Like, b: Matrix4Like, out: T) => T;
|
|
233
|
-
/**
|
|
234
|
-
* Create a two-by-two matrix with the given values.
|
|
235
|
-
* @param c0r0 - The value in the first column and first row.
|
|
236
|
-
* @param c0r1 - The value in the first column and second row.
|
|
237
|
-
* @param c0r2 - The value in the first column and third row.
|
|
238
|
-
* @param c0r3 - The value in the first column and fourth row.
|
|
239
|
-
* @param c1r0 - The value in the second column and first row.
|
|
240
|
-
* @param c1r1 - The value in the second column and second row.
|
|
241
|
-
* @param c1r2 - The value in the second column and third row.
|
|
242
|
-
* @param c1r3 - The value in the second column and fourth row.
|
|
243
|
-
* @param c2r0 - The value in the third column and first row.
|
|
244
|
-
* @param c2r1 - The value in the third column and second row.
|
|
245
|
-
* @param c2r2 - The value in the third column and third row.
|
|
246
|
-
* @param c2r3 - The value in the third column and fourth row.
|
|
247
|
-
* @param c3r0 - The value in the fourth column and first row.
|
|
248
|
-
* @param c3r1 - The value in the fourth column and second row.
|
|
249
|
-
* @param c3r2 - The value in the fourth column and third row.
|
|
250
|
-
* @param c3r3 - The value in the fourth column and fourth row.
|
|
251
|
-
* @param out - The matrix to store the result in.
|
|
252
|
-
* @returns The matrix.
|
|
253
|
-
*/
|
|
254
|
-
export declare const fromValues: <T extends Matrix4Like>(c0r0: number, c0r1: number, c0r2: number, c0r3: number, c1r0: number, c1r1: number, c1r2: number, c1r3: number, c2r0: number, c2r1: number, c2r2: number, c2r3: number, c3r0: number, c3r1: number, c3r2: number, c3r3: number, out: T) => T;
|
|
255
314
|
/**
|
|
256
315
|
* Determine whether or not two matrices are roughly equivalent.
|
|
257
316
|
* @param a - The first matrix.
|
|
258
317
|
* @param b - The second matrix.
|
|
259
318
|
* @returns Whether or not the matrices are equivalent.
|
|
319
|
+
* @public
|
|
260
320
|
*/
|
|
261
321
|
export declare const equals: (a: Matrix4Like, b: Matrix4Like) => boolean;
|
|
262
322
|
/**
|
|
@@ -264,6 +324,7 @@ export declare const equals: (a: Matrix4Like, b: Matrix4Like) => boolean;
|
|
|
264
324
|
* @param a - The first matrix.
|
|
265
325
|
* @param b - The second matrix.
|
|
266
326
|
* @returns Whether the matrices are equivalent.
|
|
327
|
+
* @public
|
|
267
328
|
*/
|
|
268
329
|
export declare const exactEquals: (a: Matrix4Like, b: Matrix4Like) => boolean;
|
|
269
330
|
/**
|
|
@@ -271,7 +332,8 @@ export declare const exactEquals: (a: Matrix4Like, b: Matrix4Like) => boolean;
|
|
|
271
332
|
* @param matrix - The matrix.
|
|
272
333
|
* @param out - The matrix to store the result in.
|
|
273
334
|
* @returns The adjugate of the matrix.
|
|
274
|
-
* @see
|
|
335
|
+
* @see {@link https://en.wikipedia.org/wiki/Adjugate_matrix | Adjugate matrix}
|
|
336
|
+
* @public
|
|
275
337
|
*/
|
|
276
338
|
export declare const adjoint: <T extends Matrix4Like>(matrix: Matrix4Like, out: T) => T;
|
|
277
339
|
/**
|
|
@@ -279,22 +341,25 @@ export declare const adjoint: <T extends Matrix4Like>(matrix: Matrix4Like, out:
|
|
|
279
341
|
* @param matrix - The matrix to copy.
|
|
280
342
|
* @param out - The matrix to store the result in.
|
|
281
343
|
* @returns This matrix.
|
|
344
|
+
* @public
|
|
282
345
|
*/
|
|
283
346
|
export declare const copy: <T extends Matrix4Like>(matrix: Matrix4Like, out: T) => T;
|
|
284
347
|
/**
|
|
285
348
|
* Calculate the Frobenius norm of a matrix.
|
|
286
349
|
* @param matrix - The matrix.
|
|
287
350
|
* @returns The Frobenius norm.
|
|
288
|
-
* @see
|
|
351
|
+
* @see {@link https://en.wikipedia.org/wiki/Matrix_norm | Matrix norm}
|
|
352
|
+
* @public
|
|
289
353
|
*/
|
|
290
354
|
export declare const frob: (matrix: Matrix4Like) => number;
|
|
291
355
|
/**
|
|
292
356
|
* Multiply two matrices.
|
|
293
|
-
* @param a - The
|
|
294
|
-
* @param b - The
|
|
357
|
+
* @param a - The multiplier.
|
|
358
|
+
* @param b - The multiplicand.
|
|
295
359
|
* @param out - The matrix to store the result in.
|
|
296
360
|
* @returns The product.
|
|
297
|
-
* @see
|
|
361
|
+
* @see {@link https://en.wikipedia.org/wiki/Matrix_multiplication | Matrix multiplication}
|
|
362
|
+
* @public
|
|
298
363
|
*/
|
|
299
364
|
export declare const multiply: <T extends Matrix4Like>(a: Matrix4Like, b: Matrix4Like, out: T) => T;
|
|
300
365
|
/**
|
|
@@ -303,7 +368,8 @@ export declare const multiply: <T extends Matrix4Like>(a: Matrix4Like, b: Matrix
|
|
|
303
368
|
* @param scalar - The multiplier.
|
|
304
369
|
* @param out - The matrix to store the result in.
|
|
305
370
|
* @returns The product.
|
|
306
|
-
* @see
|
|
371
|
+
* @see {@link https://en.wikipedia.org/wiki/Matrix_multiplication | Matrix multiplication}
|
|
372
|
+
* @public
|
|
307
373
|
*/
|
|
308
374
|
export declare const multiplyScalar: <T extends Matrix4Like>(matrix: Matrix4Like, scalar: number, out: T) => T;
|
|
309
375
|
/**
|
|
@@ -313,8 +379,9 @@ export declare const multiplyScalar: <T extends Matrix4Like>(matrix: Matrix4Like
|
|
|
313
379
|
* @param scalar - The multiplier.
|
|
314
380
|
* @param out - The matrix to store the result in.
|
|
315
381
|
* @returns The sum.
|
|
316
|
-
* @see
|
|
317
|
-
* @see
|
|
382
|
+
* @see {@link https://en.wikipedia.org/wiki/Matrix_addition | Matrix addition}
|
|
383
|
+
* @see {@link https://en.wikipedia.org/wiki/Matrix_multiplication | Matrix multiplication}
|
|
384
|
+
* @public
|
|
318
385
|
*/
|
|
319
386
|
export declare const multiplyScalarAndAdd: <T extends Matrix4Like>(a: Matrix4Like, b: Matrix4Like, scalar: number, out: T) => T;
|
|
320
387
|
/**
|
|
@@ -323,7 +390,8 @@ export declare const multiplyScalarAndAdd: <T extends Matrix4Like>(a: Matrix4Lik
|
|
|
323
390
|
* @param b - The subtrahend.
|
|
324
391
|
* @param out - The matrix to store the result in.
|
|
325
392
|
* @returns The difference.
|
|
326
|
-
* @see
|
|
393
|
+
* @see {@link https://en.wikipedia.org/wiki/Matrix_addition | Matrix addition}
|
|
394
|
+
* @public
|
|
327
395
|
*/
|
|
328
396
|
export declare const subtract: <T extends Matrix4Like>(a: Matrix4Like, b: Matrix4Like, out: T) => T;
|
|
329
397
|
/**
|
|
@@ -331,14 +399,16 @@ export declare const subtract: <T extends Matrix4Like>(a: Matrix4Like, b: Matrix
|
|
|
331
399
|
* @param matrix - The matrix.
|
|
332
400
|
* @param out - The matrix to store the result in.
|
|
333
401
|
* @returns The transpose.
|
|
334
|
-
* @see
|
|
402
|
+
* @see {@link https://en.wikipedia.org/wiki/Transpose | Transpose}
|
|
403
|
+
* @public
|
|
335
404
|
*/
|
|
336
405
|
export declare const transpose: <T extends Matrix4Like>(matrix: Matrix4Like, out: T) => T;
|
|
337
406
|
/**
|
|
338
407
|
* Calculate the determinant of a matrix.
|
|
339
408
|
* @param matrix - The matrix.
|
|
340
409
|
* @returns The determinant.
|
|
341
|
-
* @see
|
|
410
|
+
* @see {@link https://en.wikipedia.org/wiki/Determinant | Determinant}
|
|
411
|
+
* @public
|
|
342
412
|
*/
|
|
343
413
|
export declare const determinant: (matrix: Matrix4Like) => number;
|
|
344
414
|
/**
|
|
@@ -346,7 +416,8 @@ export declare const determinant: (matrix: Matrix4Like) => number;
|
|
|
346
416
|
* @param matrix - The matrix.
|
|
347
417
|
* @param out - The matrix to store the result in.
|
|
348
418
|
* @returns The inverted matrix.
|
|
349
|
-
* @see
|
|
419
|
+
* @see {@link https://en.wikipedia.org/wiki/Invertible_matrix | Invertible matrix}
|
|
420
|
+
* @public
|
|
350
421
|
*/
|
|
351
422
|
export declare const invert: <T extends Matrix4Like>(matrix: Matrix4Like, out: T) => T;
|
|
352
423
|
/**
|
|
@@ -355,7 +426,8 @@ export declare const invert: <T extends Matrix4Like>(matrix: Matrix4Like, out: T
|
|
|
355
426
|
* @param vector - The scaling vector.
|
|
356
427
|
* @param out - The matrix to store the result in.
|
|
357
428
|
* @returns The scaled matrix.
|
|
358
|
-
* @see
|
|
429
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
430
|
+
* @public
|
|
359
431
|
*/
|
|
360
432
|
export declare const scale: <T extends Matrix4Like>(matrix: Matrix4Like, vector: Vector3Like, out: T) => T;
|
|
361
433
|
/**
|
|
@@ -364,7 +436,8 @@ export declare const scale: <T extends Matrix4Like>(matrix: Matrix4Like, vector:
|
|
|
364
436
|
* @param vector - The translation vector.
|
|
365
437
|
* @param out - The matrix to store the result in.
|
|
366
438
|
* @returns The translated matrix.
|
|
367
|
-
* @see
|
|
439
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
440
|
+
* @public
|
|
368
441
|
*/
|
|
369
442
|
export declare const translate: <T extends Matrix4Like>(matrix: Matrix4Like, vector: Vector3Like, out: T) => T;
|
|
370
443
|
/**
|
|
@@ -374,7 +447,8 @@ export declare const translate: <T extends Matrix4Like>(matrix: Matrix4Like, vec
|
|
|
374
447
|
* @param axis - The axis.
|
|
375
448
|
* @param out - The matrix to store the result in.
|
|
376
449
|
* @returns The rotated matrix.
|
|
377
|
-
* @see
|
|
450
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
451
|
+
* @public
|
|
378
452
|
*/
|
|
379
453
|
export declare const rotate: <T extends Matrix4Like>(matrix: Matrix4Like, radians: number, axis: Vector3Like, out: T) => T;
|
|
380
454
|
/**
|
|
@@ -383,7 +457,8 @@ export declare const rotate: <T extends Matrix4Like>(matrix: Matrix4Like, radian
|
|
|
383
457
|
* @param r - The angle in radians.
|
|
384
458
|
* @param out - The matrix to store the result in.
|
|
385
459
|
* @returns The rotated matrix.
|
|
386
|
-
* @see
|
|
460
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
461
|
+
* @public
|
|
387
462
|
*/
|
|
388
463
|
export declare const rotateX: <T extends Matrix4Like>(matrix: Matrix4Like, r: number, out: T) => T;
|
|
389
464
|
/**
|
|
@@ -392,7 +467,8 @@ export declare const rotateX: <T extends Matrix4Like>(matrix: Matrix4Like, r: nu
|
|
|
392
467
|
* @param r - The angle in radians.
|
|
393
468
|
* @param out - The matrix to store the result in.
|
|
394
469
|
* @returns The rotated matrix.
|
|
395
|
-
* @see
|
|
470
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
471
|
+
* @public
|
|
396
472
|
*/
|
|
397
473
|
export declare const rotateY: <T extends Matrix4Like>(matrix: Matrix4Like, r: number, out: T) => T;
|
|
398
474
|
/**
|
|
@@ -401,7 +477,8 @@ export declare const rotateY: <T extends Matrix4Like>(matrix: Matrix4Like, r: nu
|
|
|
401
477
|
* @param r - The angle in radians.
|
|
402
478
|
* @param out - The matrix to store the result in.
|
|
403
479
|
* @returns The rotated matrix.
|
|
404
|
-
* @see
|
|
480
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
481
|
+
* @public
|
|
405
482
|
*/
|
|
406
483
|
export declare const rotateZ: <T extends Matrix4Like>(matrix: Matrix4Like, r: number, out: T) => T;
|
|
407
484
|
/**
|
|
@@ -409,7 +486,8 @@ export declare const rotateZ: <T extends Matrix4Like>(matrix: Matrix4Like, r: nu
|
|
|
409
486
|
* @param matrix - The matrix.
|
|
410
487
|
* @param out - The vector to store the result in.
|
|
411
488
|
* @returns The translation vector.
|
|
412
|
-
* @see
|
|
489
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
490
|
+
* @public
|
|
413
491
|
*/
|
|
414
492
|
export declare const getTranslation: <T extends Vector3Like>(matrix: Matrix4Like, out: T) => T;
|
|
415
493
|
/**
|
|
@@ -418,7 +496,8 @@ export declare const getTranslation: <T extends Vector3Like>(matrix: Matrix4Like
|
|
|
418
496
|
* @param translation - The translation vector.
|
|
419
497
|
* @param out - The matrix to store the result in.
|
|
420
498
|
* @returns The transformation matrix.
|
|
421
|
-
* @see
|
|
499
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
500
|
+
* @public
|
|
422
501
|
*/
|
|
423
502
|
export declare const setTranslation: <T extends Matrix4Like>(matrix: Matrix4Like, translation: Vector3Like, out: T) => T;
|
|
424
503
|
/**
|
|
@@ -426,7 +505,8 @@ export declare const setTranslation: <T extends Matrix4Like>(matrix: Matrix4Like
|
|
|
426
505
|
* @param matrix - The matrix.
|
|
427
506
|
* @param out - The vector to store the result in.
|
|
428
507
|
* @returns The scaling vector.
|
|
429
|
-
* @see
|
|
508
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
509
|
+
* @public
|
|
430
510
|
*/
|
|
431
511
|
export declare const getScaling: <T extends Vector3Like>(matrix: Matrix4Like, out: T) => T;
|
|
432
512
|
/**
|
|
@@ -434,12 +514,14 @@ export declare const getScaling: <T extends Vector3Like>(matrix: Matrix4Like, ou
|
|
|
434
514
|
* @param matrix - The matrix.
|
|
435
515
|
* @param out - The quaternion to store the result in.
|
|
436
516
|
* @returns The rotation.
|
|
437
|
-
* @see
|
|
517
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
518
|
+
* @public
|
|
438
519
|
*/
|
|
439
520
|
export declare const getRotation: <T extends QuaternionLike>(matrix: Matrix4Like, out: T) => T;
|
|
440
521
|
/**
|
|
441
522
|
* A four-by-four matrix.
|
|
442
|
-
* @see
|
|
523
|
+
* @see {@link https://en.wikipedia.org/wiki/Matrix_(mathematics) | Matrix}
|
|
524
|
+
* @public
|
|
443
525
|
*/
|
|
444
526
|
export default class Matrix4 extends Float32Array implements SquareMatrix, Matrix4Like {
|
|
445
527
|
/**
|
|
@@ -447,7 +529,7 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
447
529
|
* @param vector - The translation vector.
|
|
448
530
|
* @param out - The matrix to store the result in.
|
|
449
531
|
* @returns The transformation matrix.
|
|
450
|
-
* @see
|
|
532
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
451
533
|
*/
|
|
452
534
|
static fromTranslation<T extends Matrix4Like = Matrix4>(vector: Vector3Like, out?: T): T;
|
|
453
535
|
/**
|
|
@@ -455,7 +537,7 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
455
537
|
* @param vector - The scaling vector.
|
|
456
538
|
* @param out - The matrix to store the result in.
|
|
457
539
|
* @returns The transformation matrix.
|
|
458
|
-
* @see
|
|
540
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
459
541
|
*/
|
|
460
542
|
static fromScaling<T extends Matrix4Like = Matrix4>(vector: Vector3Like, out?: T): T;
|
|
461
543
|
/**
|
|
@@ -464,7 +546,7 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
464
546
|
* @param axis - The axis to rotate around.
|
|
465
547
|
* @param out - The matrix to store the result in.
|
|
466
548
|
* @returns The transformation matrix.
|
|
467
|
-
* @see
|
|
549
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
468
550
|
*/
|
|
469
551
|
static fromRotation<T extends Matrix4Like = Matrix4>(r: number, axis: Vector3Like, out?: T): T;
|
|
470
552
|
/**
|
|
@@ -472,7 +554,7 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
472
554
|
* @param r - The angle in radians.
|
|
473
555
|
* @param out - The matrix to store the result in.
|
|
474
556
|
* @returns The transformation matrix.
|
|
475
|
-
* @see
|
|
557
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
476
558
|
*/
|
|
477
559
|
static fromXRotation<T extends Matrix4Like = Matrix4>(r: number, out?: T): T;
|
|
478
560
|
/**
|
|
@@ -480,7 +562,7 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
480
562
|
* @param r - The angle in radians.
|
|
481
563
|
* @param out - The matrix to store the result in.
|
|
482
564
|
* @returns The transformation matrix.
|
|
483
|
-
* @see
|
|
565
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
484
566
|
*/
|
|
485
567
|
static fromYRotation<T extends Matrix4Like = Matrix4>(r: number, out?: T): T;
|
|
486
568
|
/**
|
|
@@ -488,7 +570,7 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
488
570
|
* @param r - The angle in radians.
|
|
489
571
|
* @param out - The matrix to store the result in.
|
|
490
572
|
* @returns The transformation matrix.
|
|
491
|
-
* @see
|
|
573
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
492
574
|
*/
|
|
493
575
|
static fromZRotation<T extends Matrix4Like = Matrix4>(r: number, out?: T): T;
|
|
494
576
|
/**
|
|
@@ -497,8 +579,8 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
497
579
|
* @param translation - The translation vector.
|
|
498
580
|
* @param out - The matrix to store the result in.
|
|
499
581
|
* @returns The transformation matrix.
|
|
500
|
-
* @see
|
|
501
|
-
* @see
|
|
582
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
583
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
502
584
|
*/
|
|
503
585
|
static fromRotationTranslation<T extends Matrix4Like = Matrix4>(rotation: QuaternionLike, translation: Vector3Like, out?: T): T;
|
|
504
586
|
/**
|
|
@@ -508,8 +590,8 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
508
590
|
* @param scaling - The scaling vector.
|
|
509
591
|
* @param out - The matrix to store the result in.
|
|
510
592
|
* @returns The transformation matrix.
|
|
511
|
-
* @see
|
|
512
|
-
* @see
|
|
593
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
594
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
513
595
|
*/
|
|
514
596
|
static fromRotationTranslationScale<T extends Matrix4Like = Matrix4>(rotation: QuaternionLike, translation: Vector3Like, scaling: Vector3Like, out?: T): T;
|
|
515
597
|
/**
|
|
@@ -520,8 +602,8 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
520
602
|
* @param origin - The origin vector.
|
|
521
603
|
* @param out - The matrix to store the result in.
|
|
522
604
|
* @returns The transformation matrix.
|
|
523
|
-
* @see
|
|
524
|
-
* @see
|
|
605
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
606
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
525
607
|
*/
|
|
526
608
|
static fromRotationTranslationScaleOrigin<T extends Matrix4Like = Matrix4>(rotation: QuaternionLike, translation: Vector3Like, scaling: Vector3Like, origin: Vector3Like, out?: T): T;
|
|
527
609
|
/**
|
|
@@ -529,11 +611,20 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
529
611
|
* @param quaternion - The dual quaternion.
|
|
530
612
|
* @param out - The matrix to store the result in.
|
|
531
613
|
* @returns The transformation matrix.
|
|
532
|
-
* @see
|
|
533
|
-
* @see
|
|
534
|
-
* @see
|
|
614
|
+
* @see {@link https://en.wikipedia.org/wiki/Dual_quaternion | Dual quaternion}
|
|
615
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
616
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
535
617
|
*/
|
|
536
618
|
static fromDualQuaternion<T extends Matrix4Like = Matrix4>(quaternion: DualQuaternionLike, out?: T): T;
|
|
619
|
+
/**
|
|
620
|
+
* Create a transformation matrix from a quaternion.
|
|
621
|
+
* @param quaternion - The quaternion.
|
|
622
|
+
* @param out - The matrix to store the result in.
|
|
623
|
+
* @returns The transformation matrix.
|
|
624
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
625
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
626
|
+
*/
|
|
627
|
+
static fromQuaternion<T extends Matrix4Like = Matrix4>(quaternion: QuaternionLike, out?: T): T;
|
|
537
628
|
/**
|
|
538
629
|
* Generate a frustum matrix with the given bounds.
|
|
539
630
|
* @param left - The left bound of the frustum.
|
|
@@ -544,22 +635,34 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
544
635
|
* @param far - The far bound of the frustum.
|
|
545
636
|
* @param out - The matrix to store the result in.
|
|
546
637
|
* @returns The frustum matrix.
|
|
547
|
-
* @see
|
|
548
|
-
* @see
|
|
638
|
+
* @see {@link https://en.wikipedia.org/wiki/Camera_matrix | Camera matrix}
|
|
639
|
+
* @see {@link https://en.wikipedia.org/wiki/3D_projection | 3D projection}
|
|
549
640
|
*/
|
|
550
641
|
static frustum<T extends Matrix4Like = Matrix4>(left: number, right: number, bottom: number, top: number, near: number, far: number, out?: T): T;
|
|
551
642
|
/**
|
|
552
|
-
* Create a perspective projection matrix with the given bounds.
|
|
643
|
+
* Create a perspective projection matrix with the given bounds such that the near and far clip planes correspond to a normalized device coordinate Z range of `[-1, 1]` (OpenGL/WebGL).
|
|
553
644
|
* @param fov - The vertical field of view in radians.
|
|
554
645
|
* @param aspect - The aspect ratio (typically the width of the viewport divided by its height).
|
|
555
646
|
* @param near - The near bound of the frustum.
|
|
556
647
|
* @param far - The far bound of the frustum.
|
|
557
648
|
* @param out - The matrix to store the result in.
|
|
558
649
|
* @returns The perspective projection matrix.
|
|
559
|
-
* @see
|
|
560
|
-
* @see
|
|
650
|
+
* @see {@link https://en.wikipedia.org/wiki/Camera_matrix | Camera matrix}
|
|
651
|
+
* @see {@link https://en.wikipedia.org/wiki/3D_projection | 3D projection}
|
|
561
652
|
*/
|
|
562
653
|
static perspective<T extends Matrix4Like = Matrix4>(fov: number, aspect: number, near: number, far: number, out?: T): T;
|
|
654
|
+
/**
|
|
655
|
+
* Create a perspective projection matrix with the given bounds such that the near and far clip planes correspond to a normalized device coordinate Z range of `[0, 1]` (WebGPU/Vulkan/DirectX/Metal).
|
|
656
|
+
* @param fov - The vertical field of view in radians.
|
|
657
|
+
* @param aspect - The aspect ratio (typically the width of the viewport divided by its height).
|
|
658
|
+
* @param near - The near bound of the frustum.
|
|
659
|
+
* @param far - The far bound of the frustum.
|
|
660
|
+
* @param out - The matrix to store the result in.
|
|
661
|
+
* @returns The perspective projection matrix.
|
|
662
|
+
* @see {@link https://en.wikipedia.org/wiki/Camera_matrix | Camera matrix}
|
|
663
|
+
* @see {@link https://en.wikipedia.org/wiki/3D_projection | 3D projection}
|
|
664
|
+
*/
|
|
665
|
+
static perspectiveGpu<T extends Matrix4Like = Matrix4>(fov: number, aspect: number, near: number, far: number, out?: T): T;
|
|
563
666
|
/**
|
|
564
667
|
* Create a perspective projection matrix from a field of view. Useful for generating projection matrices to be used with the WebXR API.
|
|
565
668
|
* @param fov - The field of view.
|
|
@@ -567,13 +670,13 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
567
670
|
* @param far - The far bound of the frustum.
|
|
568
671
|
* @param out - The matrix to store the result in.
|
|
569
672
|
* @returns The perspective projection matrix.
|
|
570
|
-
* @see
|
|
571
|
-
* @see
|
|
572
|
-
* @see
|
|
673
|
+
* @see {@link https://en.wikipedia.org/wiki/Camera_matrix | Camera matrix}
|
|
674
|
+
* @see {@link https://en.wikipedia.org/wiki/3D_projection | 3D projection}
|
|
675
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/WebXR_Device_API | WebXR API}
|
|
573
676
|
*/
|
|
574
677
|
static perspectiveFromFieldOfView<T extends Matrix4Like = Matrix4>(fov: FieldOfView, near: number, far: number, out?: T): T;
|
|
575
678
|
/**
|
|
576
|
-
* Generate an orthogonal projection matrix with the given bounds.
|
|
679
|
+
* Generate an orthogonal projection matrix with the given bounds such that the near and far clip planes correspond to a normalized device coordinate Z range of `[-1, 1]` (OpenGL/WebGL).
|
|
577
680
|
* @param left - The left bound of the frustum.
|
|
578
681
|
* @param right - The right bound of the frustum.
|
|
579
682
|
* @param bottom - The bottom bound of the frustum.
|
|
@@ -582,10 +685,24 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
582
685
|
* @param far - The far bound of the frustum.
|
|
583
686
|
* @param out - The matrix to store the result in.
|
|
584
687
|
* @returns The frustum matrix.
|
|
585
|
-
* @see
|
|
586
|
-
* @see
|
|
688
|
+
* @see {@link https://en.wikipedia.org/wiki/Camera_matrix | Camera matrix}
|
|
689
|
+
* @see {@link https://en.wikipedia.org/wiki/3D_projection | 3D projection}
|
|
587
690
|
*/
|
|
588
691
|
static ortho<T extends Matrix4Like = Matrix4>(left: number, right: number, bottom: number, top: number, near: number, far: number, out?: T): T;
|
|
692
|
+
/**
|
|
693
|
+
* Generate an orthogonal projection matrix with the given bounds such that the near and far clip planes correspond to a normalized device coordinate Z range of `[0, 1]` (WebGPU/Vulkan/DirectX/Metal).
|
|
694
|
+
* @param left - The left bound of the frustum.
|
|
695
|
+
* @param right - The right bound of the frustum.
|
|
696
|
+
* @param bottom - The bottom bound of the frustum.
|
|
697
|
+
* @param top - The top bound of the frustum.
|
|
698
|
+
* @param near - The near bound of the frustum.
|
|
699
|
+
* @param far - The far bound of the frustum.
|
|
700
|
+
* @param out - The matrix to store the result in.
|
|
701
|
+
* @returns The frustum matrix.
|
|
702
|
+
* @see {@link https://en.wikipedia.org/wiki/Camera_matrix | Camera matrix}
|
|
703
|
+
* @see {@link https://en.wikipedia.org/wiki/3D_projection | 3D projection}
|
|
704
|
+
*/
|
|
705
|
+
static orthoGpu<T extends Matrix4Like = Matrix4>(left: number, right: number, bottom: number, top: number, near: number, far: number, out?: T): T;
|
|
589
706
|
/**
|
|
590
707
|
* Generate a look-at matrix. If you want a matrix that actually makes an object look at another object, use `targetTo` instead.
|
|
591
708
|
* @param eye - The position of the viewer.
|
|
@@ -593,7 +710,7 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
593
710
|
* @param up - The local up direction.
|
|
594
711
|
* @param out - The matrix to store the result in.
|
|
595
712
|
* @returns The look-at matrix.
|
|
596
|
-
* @see
|
|
713
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
597
714
|
*/
|
|
598
715
|
static lookAt<T extends Matrix4Like = Matrix4>(eye: Vector3Like, center: Vector3Like, up?: Vector3Like, out?: T): T;
|
|
599
716
|
/**
|
|
@@ -603,7 +720,7 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
603
720
|
* @param up - The local up direction.
|
|
604
721
|
* @param out - The matrix to store the result in.
|
|
605
722
|
* @returns The transformation matrix.
|
|
606
|
-
* @see
|
|
723
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
607
724
|
*/
|
|
608
725
|
static targetTo<T extends Matrix4Like = Matrix4>(eye: Vector3Like, target: Vector3Like, up?: Vector3Like, out?: T): T;
|
|
609
726
|
/**
|
|
@@ -630,7 +747,7 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
630
747
|
static fromValues<T extends Matrix4Like = Matrix4>(c0r0: number, c0r1: number, c0r2: number, c0r3: number, c1r0: number, c1r1: number, c1r2: number, c1r3: number, c2r0: number, c2r1: number, c2r2: number, c2r3: number, c3r0: number, c3r1: number, c3r2: number, c3r3: number, out?: T): T;
|
|
631
748
|
/**
|
|
632
749
|
* Create a four-by-four identity matrix.
|
|
633
|
-
* @see
|
|
750
|
+
* @see {@link https://en.wikipedia.org/wiki/Identity_matrix | Identity matrix}
|
|
634
751
|
*/
|
|
635
752
|
constructor();
|
|
636
753
|
/** The value in the first column and first row. */
|
|
@@ -686,14 +803,14 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
686
803
|
* @param matrix - The other matrix.
|
|
687
804
|
* @param out - The matrix to store the result in.
|
|
688
805
|
* @returns The sum of the matrices.
|
|
689
|
-
* @see
|
|
806
|
+
* @see {@link https://en.wikipedia.org/wiki/Matrix_addition | Matrix addition}
|
|
690
807
|
*/
|
|
691
808
|
add<T extends Matrix4Like = Matrix4>(matrix: Matrix4Like, out?: T): T;
|
|
692
809
|
/**
|
|
693
810
|
* Calculate the adjugate of this matrix.
|
|
694
811
|
* @param out - The matrix to store the result in.
|
|
695
812
|
* @returns The adjugate of this matrix.
|
|
696
|
-
* @see
|
|
813
|
+
* @see {@link https://en.wikipedia.org/wiki/Adjugate_matrix | Adjugate matrix}
|
|
697
814
|
*/
|
|
698
815
|
adjoint<T extends Matrix4Like = Matrix4>(out?: T): T;
|
|
699
816
|
/**
|
|
@@ -710,7 +827,7 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
710
827
|
copy(matrix: Matrix4Like): this;
|
|
711
828
|
/**
|
|
712
829
|
* Get the Frobenius norm of this matrix.
|
|
713
|
-
* @see
|
|
830
|
+
* @see {@link https://en.wikipedia.org/wiki/Matrix_norm | Matrix norm}
|
|
714
831
|
*/
|
|
715
832
|
get frob(): number;
|
|
716
833
|
/**
|
|
@@ -718,7 +835,7 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
718
835
|
* @param matrix - The other matrix.
|
|
719
836
|
* @param out - The matrix to store the result in.
|
|
720
837
|
* @returns The product of the matrices.
|
|
721
|
-
* @see
|
|
838
|
+
* @see {@link https://en.wikipedia.org/wiki/Matrix_multiplication | Matrix multiplication}
|
|
722
839
|
*/
|
|
723
840
|
multiply<T extends Matrix4Like = Matrix4>(matrix: Matrix4Like, out?: T): T;
|
|
724
841
|
/**
|
|
@@ -726,7 +843,7 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
726
843
|
* @param scalar - The scalar value.
|
|
727
844
|
* @param out - The matrix to store the result in.
|
|
728
845
|
* @returns The product of the matrix and the scalar value.
|
|
729
|
-
* @see
|
|
846
|
+
* @see {@link https://en.wikipedia.org/wiki/Matrix_multiplication | Matrix multiplication}
|
|
730
847
|
*/
|
|
731
848
|
multiplyScalar<T extends Matrix4Like = Matrix4>(scalar: number, out?: T): T;
|
|
732
849
|
/**
|
|
@@ -735,8 +852,8 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
735
852
|
* @param scalar - The scalar.
|
|
736
853
|
* @param out - The matrix to store the result in.
|
|
737
854
|
* @returns The sum.
|
|
738
|
-
* @see
|
|
739
|
-
* @see
|
|
855
|
+
* @see {@link https://en.wikipedia.org/wiki/Matrix_addition | Matrix addition}
|
|
856
|
+
* @see {@link https://en.wikipedia.org/wiki/Matrix_multiplication | Matrix multiplication}
|
|
740
857
|
*/
|
|
741
858
|
multiplyScalarAndAdd<T extends Matrix4Like = Matrix4>(matrix: Matrix4Like, scalar: number, out?: T): T;
|
|
742
859
|
/**
|
|
@@ -744,32 +861,32 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
744
861
|
* @param matrix - The other matrix.
|
|
745
862
|
* @param out - The matrix to store the result in.
|
|
746
863
|
* @returns The difference between the matrices.
|
|
747
|
-
* @see
|
|
864
|
+
* @see {@link https://en.wikipedia.org/wiki/Matrix_addition | Matrix addition}
|
|
748
865
|
*/
|
|
749
866
|
subtract<T extends Matrix4Like = Matrix4>(matrix: Matrix4Like, out?: T): T;
|
|
750
867
|
/**
|
|
751
868
|
* Transpose this matrix.
|
|
752
869
|
* @param out - The matrix to store the result in.
|
|
753
870
|
* @returns The transpose of this matrix.
|
|
754
|
-
* @see
|
|
871
|
+
* @see {@link https://en.wikipedia.org/wiki/Transpose | Transpose}
|
|
755
872
|
*/
|
|
756
873
|
transpose<T extends Matrix4Like = Matrix4>(out?: T): T;
|
|
757
874
|
/**
|
|
758
875
|
* Get the determinant of this matrix.
|
|
759
|
-
* @see
|
|
876
|
+
* @see {@link https://en.wikipedia.org/wiki/Determinant | Determinant}
|
|
760
877
|
*/
|
|
761
878
|
get determinant(): number;
|
|
762
879
|
/**
|
|
763
880
|
* Reset this matrix to identity.
|
|
764
881
|
* @returns This matrix.
|
|
765
|
-
* @see
|
|
882
|
+
* @see {@link https://en.wikipedia.org/wiki/Identity_matrix | Identity matrix}
|
|
766
883
|
*/
|
|
767
884
|
identity(): this;
|
|
768
885
|
/**
|
|
769
886
|
* Invert this matrix.
|
|
770
887
|
* @param out - The matrix to store the result in.
|
|
771
888
|
* @returns The inverted matrix.
|
|
772
|
-
* @see
|
|
889
|
+
* @see {@link https://en.wikipedia.org/wiki/Invertible_matrix | Invertible matrix}
|
|
773
890
|
*/
|
|
774
891
|
invert<T extends Matrix4Like = Matrix4>(out?: T): T;
|
|
775
892
|
/**
|
|
@@ -777,7 +894,7 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
777
894
|
* @param vector - The scaling vector.
|
|
778
895
|
* @param out - The matrix to store the result in.
|
|
779
896
|
* @returns The scaled matrix.
|
|
780
|
-
* @see
|
|
897
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
781
898
|
*/
|
|
782
899
|
scale<T extends Matrix4Like = Matrix4>(vector: Vector3Like, out?: T): T;
|
|
783
900
|
/**
|
|
@@ -785,7 +902,7 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
785
902
|
* @param vector - The translation vector.
|
|
786
903
|
* @param out - The matrix to store the result in.
|
|
787
904
|
* @returns The translated matrix.
|
|
788
|
-
* @see
|
|
905
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
789
906
|
*/
|
|
790
907
|
translate<T extends Matrix4Like = Matrix4>(vector: Vector3Like, out?: T): T;
|
|
791
908
|
/**
|
|
@@ -794,7 +911,7 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
794
911
|
* @param axis - The axis.
|
|
795
912
|
* @param out - The matrix to store the result in.
|
|
796
913
|
* @returns The rotated matrix.
|
|
797
|
-
* @see
|
|
914
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
798
915
|
*/
|
|
799
916
|
rotate<T extends Matrix4Like = Matrix4>(r: number, axis: Vector3Like, out?: T): T;
|
|
800
917
|
/**
|
|
@@ -802,7 +919,7 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
802
919
|
* @param r - The angle in radians.
|
|
803
920
|
* @param out - The matrix to store the result in.
|
|
804
921
|
* @returns The rotated matrix.
|
|
805
|
-
* @see
|
|
922
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
806
923
|
*/
|
|
807
924
|
rotateX<T extends Matrix4Like = Matrix4>(r: number, out?: T): T;
|
|
808
925
|
/**
|
|
@@ -810,7 +927,7 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
810
927
|
* @param r - The angle in radians.
|
|
811
928
|
* @param out - The matrix to store the result in.
|
|
812
929
|
* @returns The rotated matrix.
|
|
813
|
-
* @see
|
|
930
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
814
931
|
*/
|
|
815
932
|
rotateY<T extends Matrix4Like = Matrix4>(r: number, out?: T): T;
|
|
816
933
|
/**
|
|
@@ -818,14 +935,14 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
818
935
|
* @param r - The angle in radians.
|
|
819
936
|
* @param out - The matrix to store the result in.
|
|
820
937
|
* @returns The rotated matrix.
|
|
821
|
-
* @see
|
|
938
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
822
939
|
*/
|
|
823
940
|
rotateZ<T extends Matrix4Like = Matrix4>(r: number, out?: T): T;
|
|
824
941
|
/**
|
|
825
942
|
* Get the translation vector component of this transformation matrix.
|
|
826
943
|
* @param out - The vector to store the result in.
|
|
827
944
|
* @returns The translation.
|
|
828
|
-
* @see
|
|
945
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
829
946
|
*/
|
|
830
947
|
getTranslation<T extends Vector3Like = Vector3>(out?: T): T;
|
|
831
948
|
/**
|
|
@@ -833,21 +950,21 @@ export default class Matrix4 extends Float32Array implements SquareMatrix, Matri
|
|
|
833
950
|
* @param translation - The translation vector.
|
|
834
951
|
* @param out - The matrix to store the result in.
|
|
835
952
|
* @returns The transformation matrix.
|
|
836
|
-
* @see
|
|
953
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
837
954
|
*/
|
|
838
955
|
setTranslation<T extends Matrix4Like = Matrix4>(translation: Vector3Like, out?: T): T;
|
|
839
956
|
/**
|
|
840
957
|
* Get the scaling vector component of this transformation matrix.
|
|
841
958
|
* @param out - The vector to store the result in.
|
|
842
959
|
* @returns The scaling.
|
|
843
|
-
* @see
|
|
960
|
+
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
844
961
|
*/
|
|
845
962
|
getScaling<T extends Vector3Like = Vector3>(out?: T): T;
|
|
846
963
|
/**
|
|
847
964
|
* Get the scaling vector component of this transformation matrix.
|
|
848
965
|
* @param out - The quaternion to store the result in.
|
|
849
966
|
* @returns The rotation.
|
|
850
|
-
* @see
|
|
967
|
+
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
851
968
|
*/
|
|
852
969
|
getRotation<T extends QuaternionLike = Quaternion>(out?: T): T;
|
|
853
970
|
}
|