|
| Mat4 () |
| Trivial constructor, the matrix is NOT initialized. More...
|
|
template<typename Source > |
| Mat4 (Source *a) |
| Constructor given array of elements, the ordering is in row major form: More...
|
|
template<typename Source > |
| Mat4 (Source a, Source b, Source c, Source d, Source e, Source f, Source g, Source h, Source i, Source j, Source k, Source l, Source m, Source n, Source o, Source p) |
| Constructor given array of elements, the ordering is in row major form: More...
|
|
template<typename Source > |
| Mat4 (const Vec4< Source > &v1, const Vec4< Source > &v2, const Vec4< Source > &v3, const Vec4< Source > &v4) |
| Construct matrix given basis vectors (columns) More...
|
|
| Mat4 (const Mat< 4, T > &m) |
| Copy constructor. More...
|
|
template<typename Source > |
| Mat4 (const Mat4< Source > &m) |
| Conversion constructor. More...
|
|
void | setRow (int i, const Vec4< T > &v) |
| Set ith row to vector v. More...
|
|
Vec4< T > | row (int i) const |
| Get ith row, e.g. Vec4f v = m.row(1);. More...
|
|
void | setCol (int j, const Vec4< T > &v) |
| Set jth column to vector v. More...
|
|
Vec4< T > | col (int j) const |
| Get jth column, e.g. Vec4f v = m.col(0);. More...
|
|
T * | asPointer () |
| Direct access to the internal data. More...
|
|
const T * | asPointer () const |
|
T & | operator() (int i, int j) |
|
T | operator() (int i, int j) const |
|
void | setBasis (const Vec4< T > &v1, const Vec4< T > &v2, const Vec4< T > &v3, const Vec4< T > &v4) |
| Set the columns of "this" matrix to the vectors v1, v2, v3, v4. More...
|
|
void | setZero () |
|
void | setIdentity () |
| Set "this" matrix to identity. More...
|
|
void | setMat3 (const Mat3< T > &m) |
| Set upper left to a Mat3. More...
|
|
Mat3< T > | getMat3 () const |
|
Vec3< T > | getTranslation () const |
| Return the translation component. More...
|
|
void | setTranslation (const Vec3< T > &t) |
|
template<typename Source > |
const Mat4 & | operator= (const Mat4< Source > &m) |
| Assignment operator. More...
|
|
bool | eq (const Mat4 &m, T eps=1.0e-8) const |
| Test if "this" is equivalent to m with tolerance of eps value. More...
|
|
Mat4< T > | operator- () const |
| Negation operator, for e.g. m1 = -m2;. More...
|
|
template<typename S > |
const Mat4< T > & | operator*= (S scalar) |
| Return m, where for . More...
|
|
template<typename S > |
const Mat4< T > & | operator+= (const Mat4< S > &m1) |
| Returns m0, where for . More...
|
|
template<typename S > |
const Mat4< T > & | operator-= (const Mat4< S > &m1) |
| Returns m0, where for . More...
|
|
template<typename S > |
const Mat4< T > & | operator*= (const Mat4< S > &m1) |
| Return m, where for . More...
|
|
Mat4 | transpose () const |
|
Mat4 | inverse (T tolerance=0) const |
|
T | det () const |
| Determinant of matrix. More...
|
|
Mat4 | snapBasis (Axis axis, const Vec3< T > &direction) |
|
template<typename T0 > |
void | setToTranslation (const Vec3< T0 > &v) |
| Sets the matrix to a matrix that translates by v. More...
|
|
template<typename T0 > |
void | preTranslate (const Vec3< T0 > &tr) |
| Left multiples by the specified translation, i.e. Trans * (*this) More...
|
|
template<typename T0 > |
void | postTranslate (const Vec3< T0 > &tr) |
| Right multiplies by the specified translation matrix, i.e. (*this) * Trans. More...
|
|
template<typename T0 > |
void | setToScale (const Vec3< T0 > &v) |
| Sets the matrix to a matrix that scales by v. More...
|
|
template<typename T0 > |
void | preScale (const Vec3< T0 > &v) |
|
template<typename T0 > |
void | postScale (const Vec3< T0 > &v) |
|
void | setToRotation (Axis axis, T angle) |
| Sets the matrix to a rotation about the given axis. More...
|
|
void | setToRotation (const Vec3< T > &axis, T angle) |
| Sets the matrix to a rotation about an arbitrary axis. More...
|
|
void | setToRotation (const Vec3< T > &v1, const Vec3< T > &v2) |
| Sets the matrix to a rotation that maps v1 onto v2 about the cross product of v1 and v2. More...
|
|
void | preRotate (Axis axis, T angle) |
| Left multiplies by a rotation clock-wiseabout the given axis into this matrix. More...
|
|
void | postRotate (Axis axis, T angle) |
| Right multiplies by a rotation clock-wiseabout the given axis into this matrix. More...
|
|
void | setToShear (Axis axis0, Axis axis1, T shearby) |
| Sets the matrix to a shear along axis0 by a fraction of axis1. More...
|
|
void | preShear (Axis axis0, Axis axis1, T shear) |
| Left multiplies a shearing transformation into the matrix. More...
|
|
void | postShear (Axis axis0, Axis axis1, T shear) |
| Right multiplies a shearing transformation into the matrix. More...
|
|
template<typename T0 > |
Vec4< T0 > | transform (const Vec4< T0 > &v) const |
| Transform a Vec4 by post-multiplication. More...
|
|
template<typename T0 > |
Vec3< T0 > | transform (const Vec3< T0 > &v) const |
| Transform a Vec3 by post-multiplication, without homogenous division. More...
|
|
template<typename T0 > |
Vec4< T0 > | pretransform (const Vec4< T0 > &v) const |
| Transform a Vec4 by pre-multiplication. More...
|
|
template<typename T0 > |
Vec3< T0 > | pretransform (const Vec3< T0 > &v) const |
| Transform a Vec3 by pre-multiplication, without homogenous division. More...
|
|
template<typename T0 > |
Vec3< T0 > | transformH (const Vec3< T0 > &p) const |
| Transform a Vec3 by post-multiplication, doing homogenous divison. More...
|
|
template<typename T0 > |
Vec3< T0 > | pretransformH (const Vec3< T0 > &p) const |
| Transform a Vec3 by pre-multiplication, doing homogenous division. More...
|
|
template<typename T0 > |
Vec3< T0 > | transform3x3 (const Vec3< T0 > &v) const |
| Transform a Vec3 by post-multiplication, without translation. More...
|
|
std::string | str (unsigned indentation=0) const |
|
void | write (std::ostream &os) const |
|
void | read (std::istream &is) |
|
|
T * | operator[] (int i) |
|
const T * | operator[] (int i) const |
|
|
(Note that these are not member functions.)
|
template<typename T0 , typename T1 > |
bool | operator== (const Mat4< T0 > &m0, const Mat4< T1 > &m1) |
| Equality operator, does exact floating point comparisons. More...
|
|
template<typename T0 , typename T1 > |
bool | operator!= (const Mat4< T0 > &m0, const Mat4< T1 > &m1) |
| Inequality operator, does exact floating point comparisons. More...
|
|
template<typename S , typename T > |
Mat4< typename promote< S, T >::type > | operator* (S scalar, const Mat4< T > &m) |
| Returns M, where for . More...
|
|
template<typename S , typename T > |
Mat4< typename promote< S, T >::type > | operator* (const Mat4< T > &m, S scalar) |
| Returns M, where for . More...
|
|
template<typename T , typename MT > |
Vec4< typename promote< T, MT >::type > | operator* (const Mat4< MT > &_m, const Vec4< T > &_v) |
| Returns v, where for . More...
|
|
template<typename T , typename MT > |
Vec4< typename promote< T, MT >::type > | operator* (const Vec4< T > &_v, const Mat4< MT > &_m) |
| Returns v, where for . More...
|
|
template<typename T , typename MT > |
Vec3< typename promote< T, MT >::type > | operator* (const Mat4< MT > &_m, const Vec3< T > &_v) |
| Returns v, where for . More...
|
|
template<typename T , typename MT > |
Vec3< typename promote< T, MT >::type > | operator* (const Vec3< T > &_v, const Mat4< MT > &_m) |
| Returns v, where for . More...
|
|
template<typename T0 , typename T1 > |
Mat4< typename promote< T0, T1 >::type > | operator+ (const Mat4< T0 > &m0, const Mat4< T1 > &m1) |
| Returns M, where for . More...
|
|
template<typename T0 , typename T1 > |
Mat4< typename promote< T0, T1 >::type > | operator- (const Mat4< T0 > &m0, const Mat4< T1 > &m1) |
| Returns M, where for . More...
|
|
template<typename T0 , typename T1 > |
Mat4< typename promote< T0, T1 >::type > | operator* (const Mat4< T0 > &m0, const Mat4< T1 > &m1) |
| Returns M, where for . More...
|
|