A 3x3 matrix. More...
#include <mat3.h>
Public Member Functions | |
mat3 () | |
Creates a new, uninitialized matrix. | |
mat3 (type m00, type m01, type m02, type m10, type m11, type m12, type m20, type m21, type m22) | |
Creates a new matrix with the given components. | |
mat3 (const type *array) | |
Creates a new matrix with the given components in row major order. | |
mat3 (const type array[3][3]) | |
Creates a new matrix with the given components. | |
mat3 (const mat3 &mat) | |
Creates a new matrix as a copy of the given matrix. | |
const type * | coefficients () const |
Returns the coefficients of this matrix. | |
type * | operator[] (int iRow) const |
Returns the row of this matrix whose index is given. | |
vec3< type > | getColumn (int iCol) const |
Returns the column of this matrix whose index is given. | |
void | setColumn (int iCol, const vec3< type > &v) |
Sets the column of this matrix whose index is given. | |
void | fromAxes (const vec3< type > &xAxis, const vec3< type > &yAxis, const vec3< type > &zAxis) |
Sets the columns of this matrix from the 3 given column vectors. | |
mat3 & | operator= (const mat3 &mat) |
Assigns the given matrix to this matrix. | |
bool | operator== (const mat3 &mat) const |
Returns true is this matrix is equal to the given matrix. | |
bool | operator!= (const mat3 &mat) const |
Returns true is this matrix is different from the given matrix. | |
mat3 | operator+ (const mat3 &mat) const |
Returns the sum of this matrix and of the given matrix. | |
mat3 | operator- (const mat3 &mat) const |
Returns the difference of this matrix and of the given matrix. | |
mat3 | operator* (const mat3 &mat) const |
Returns the product of this matrix and of the given matrix. | |
vec3< type > | operator* (const vec3< type > &v) const |
Returns the product of this matrix and of the given vector. | |
vec2< type > | operator* (const vec2< type > &v) const |
Returns the product of this matrix and of the given vector. | |
box3< type > | operator* (const box3< type > &b) const |
Returns the bounding box of the given bounding box, transformed by the linear transformation represented by this matrix. | |
mat3 | operator* (const type scalar) const |
Returns the product of this matrix and of the given scalar. | |
mat3 | operator- () const |
Returns the opposite of this matrix. | |
mat3 | transpose () const |
Returns the transpose of this matrix. | |
bool | inverse (mat3 &mInv, type tolerance=1e-06) const |
Returns true is this matrix has an inverse. | |
mat3 | inverse (type tolerance=1e-06) const |
Returns the inverse of this matrix. | |
type | determinant () const |
Returns the determinant of this matrix. | |
type | trace () const |
Returns the trace of this matrix. | |
template<class t > | |
mat3< t > | cast () const |
Casts this matrix to another base type. | |
Static Public Attributes | |
static const mat3 | ZERO |
The null matrix. | |
static const mat3 | IDENTITY |
The identity matrix. | |
Protected Attributes | |
union { | |
type m [3][3] | |
The matrix coefficients as a 2D array. | |
type _m [9] | |
The matrix coefficients as a 1D array. | |
}; | |
The matrix coeffients. |
A 3x3 matrix.
ork::mat3< type >::mat3 | ( | type | m00, | |
type | m01, | |||
type | m02, | |||
type | m10, | |||
type | m11, | |||
type | m12, | |||
type | m20, | |||
type | m21, | |||
type | m22 | |||
) | [inline] |
Creates a new matrix with the given components.
The first index is the row index, the second one is the column index.
Creates a new matrix with the given components in row major order.
Creates a new matrix with the given components.
The first index is the row index, the second one is the column index.
Creates a new matrix as a copy of the given matrix.
Casts this matrix to another base type.
const type * ork::mat3< type >::coefficients | ( | ) | const [inline] |
Returns the coefficients of this matrix.
type ork::mat3< type >::determinant | ( | ) | const [inline] |
Returns the determinant of this matrix.
void ork::mat3< type >::fromAxes | ( | const vec3< type > & | xAxis, | |
const vec3< type > & | yAxis, | |||
const vec3< type > & | zAxis | |||
) | [inline] |
Sets the columns of this matrix from the 3 given column vectors.
Returns the column of this matrix whose index is given.
mat3< type > ork::mat3< type >::inverse | ( | type | tolerance = 1e-06 |
) | const [inline] |
Returns the inverse of this matrix.
bool ork::mat3< type >::inverse | ( | mat3< type > & | mInv, | |
type | tolerance = 1e-06 | |||
) | const [inline] |
Returns true is this matrix has an inverse.
In this case the inverse matrix is returned in the given matrix parameter.
bool ork::mat3< type >::operator!= | ( | const mat3< type > & | mat | ) | const [inline] |
Returns true is this matrix is different from the given matrix.
mat3< type > ork::mat3< type >::operator* | ( | const type | scalar | ) | const [inline] |
Returns the product of this matrix and of the given scalar.
box3< type > ork::mat3< type >::operator* | ( | const box3< type > & | b | ) | const [inline] |
Returns the bounding box of the given bounding box, transformed by the linear transformation represented by this matrix.
vec3< type > ork::mat3< type >::operator* | ( | const vec3< type > & | v | ) | const [inline] |
Returns the product of this matrix and of the given vector.
mat3< type > ork::mat3< type >::operator* | ( | const mat3< type > & | mat | ) | const [inline] |
Returns the product of this matrix and of the given matrix.
mat3< type > ork::mat3< type >::operator+ | ( | const mat3< type > & | mat | ) | const [inline] |
Returns the sum of this matrix and of the given matrix.
Returns the opposite of this matrix.
mat3< type > ork::mat3< type >::operator- | ( | const mat3< type > & | mat | ) | const [inline] |
Returns the difference of this matrix and of the given matrix.
mat3< type > & ork::mat3< type >::operator= | ( | const mat3< type > & | mat | ) | [inline] |
Assigns the given matrix to this matrix.
bool ork::mat3< type >::operator== | ( | const mat3< type > & | mat | ) | const [inline] |
Returns true is this matrix is equal to the given matrix.
type * ork::mat3< type >::operator[] | ( | int | iRow | ) | const [inline] |
Returns the row of this matrix whose index is given.
void ork::mat3< type >::setColumn | ( | int | iCol, | |
const vec3< type > & | v | |||
) | [inline] |
Sets the column of this matrix whose index is given.
type ork::mat3< type >::trace | ( | ) | const [inline] |
Returns the trace of this matrix.
Returns the transpose of this matrix.
union { ... } [protected] |
The matrix coeffients.
The identity matrix.