Matrix class and functions.
More...
Matrix class and functions.
MathFu provides a generic Matrix implementation which is specialized for 4x4 matrices to take advantage of optimization opportunities using SIMD instructions.
|
typedef Matrix< float, 4, 3 > | mathfu::AffineTransform |
| A typedef representing a 4x3 float affine transformation. Since the last row ('w' row) of an affine transformation is fixed, this data type only includes the variable information for the transform.
|
|
|
template<class T , int rows, int columns> |
Matrix< T, rows, columns > | operator* (const T &s, const Matrix< T, columns, rows > &m) |
| Multiply each element of a Matrix by a scalar. More...
|
|
template<class T , int rows, int columns> |
Vector< T, rows > | operator* (const Matrix< T, rows, columns > &m, const Vector< T, columns > &v) |
| Multiply a Matrix by a Vector. More...
|
|
template<class T > |
Vector< T, 3 > | operator* (const Matrix< T, 4, 4 > &m, const Vector< T, 3 > &v) |
| Multiply a 4x4 Matrix by a 3-dimensional Vector. More...
|
|
template<class T , int rows, int columns>
Matrix< T, rows, columns > operator* |
( |
const T & |
s, |
|
|
const Matrix< T, columns, rows > & |
m |
|
) |
| |
|
related |
Multiply each element of a Matrix by a scalar.
- Parameters
-
s | Scalar to multiply by. |
m | Matrix to multiply. |
- Returns
- Matrix containing the result.
- Template Parameters
-
T | Type of each element in the Matrix and the scalar type. |
rows | Number of rows in the matrix. |
columns | Number of columns in the matrix. |
template<class T , int rows, int columns>
Vector< T, rows > operator* |
( |
const Matrix< T, rows, columns > & |
m, |
|
|
const Vector< T, columns > & |
v |
|
) |
| |
|
related |
Multiply a Matrix by a Vector.
- Note
- Template specialized versions are implemented for 2x2, 3x3, and 4x4 matrices to increase performance. The 3x3 float is also specialized to supported padded the 3-dimensional Vector in SIMD build configurations.
- Parameters
-
- Returns
- Vector containing the result.
template<class T >
Vector< T, 3 > operator* |
( |
const Matrix< T, 4, 4 > & |
m, |
|
|
const Vector< T, 3 > & |
v |
|
) |
| |
|
related |
Multiply a 4x4 Matrix by a 3-dimensional Vector.
This is provided as a convenience and assumes the vector has a fourth component equal to 1.
- Parameters
-
- Returns
- 3-dimensional Vector result.