Libprimis
Imprimis' 3D destroyable world engine
|
floating point 4x4 array object More...
#include <geom.h>
Public Member Functions | |
template<class T , class U > | |
T | transformnormal (const U &in) const |
template<class T , class U > | |
T | transform (const U &in) const |
template<class T > | |
vec | perspectivetransform (const T &in) const |
template<class T > | |
void | mult (const matrix4 &x, const matrix4 &y) |
matrix4 (const float *m) | |
matrix4 (const vec &a, const vec &b, const vec &c=vec(0, 0, 1)) | |
matrix4 (const vec4< float > &a, const vec4< float > &b, const vec4< float > &c, const vec4< float > &d=vec4< float >(0, 0, 0, 1)) | |
matrix4 (const matrix4x3 &m) | |
matrix4 (const matrix3 &rot, const vec &trans) | |
void | mul (const matrix4 &x, const matrix3 &y) |
void | mul (const matrix3 &y) |
void | mul (const matrix4 &x, const matrix4 &y) |
Sets this matrix to the product of the two matrices provided. | |
void | mul (const matrix4 &y) |
Sets this matrix to the product of this and another matrix. | |
void | muld (const matrix4 &x, const matrix4 &y) |
Sets this matrix to the product of the two matrices provided. | |
void | muld (const matrix4 &y) |
Sets this matrix to the product of this and another matrix. | |
void | rotate_around_x (float ck, float sk) |
void | rotate_around_x (float angle) |
void | rotate_around_x (const vec2 &sc) |
void | rotate_around_y (float ck, float sk) |
void | rotate_around_y (float angle) |
void | rotate_around_y (const vec2 &sc) |
void | rotate_around_z (float ck, float sk) |
void | rotate_around_z (float angle) |
void | rotate_around_z (const vec2 &sc) |
void | rotate (float ck, float sk, const vec &axis) |
void | rotate (float angle, const vec &dir) |
void | rotate (const vec2 &sc, const vec &dir) |
void | identity () |
Sets the matrix to I, the identity matrix. | |
void | settranslation (const vec &v) |
void | settranslation (float x, float y, float z) |
void | translate (const vec &p) |
void | translate (float x, float y, float z) |
void | translate (const vec &p, float scale) |
void | setscale (float x, float y, float z) |
void | setscale (const vec &v) |
void | setscale (float n) |
void | scale (float x, float y, float z) |
void | scale (const vec &v) |
void | scale (float n) |
void | scalez (float k) |
void | jitter (float x, float y) |
void | transpose () |
Transposes the matrix along the diagonal. | |
void | transpose (const matrix4 &m) |
Copies the transpose of the given matrix4 to this | |
void | frustum (float left, float right, float bottom, float top, float znear, float zfar) |
void | perspective (float fovy, float aspect, float znear, float zfar) |
void | ortho (float left, float right, float bottom, float top, float znear, float zfar) |
void | transform (const vec &in, vec &out) const |
void | transform (const vec4< float > &in, vec &out) const |
void | transform (const vec &in, vec4< float > &out) const |
void | transform (const vec4< float > &in, vec4< float > &out) const |
void | transformnormal (const vec &in, vec &out) const |
void | transformnormal (const vec &in, vec4< float > &out) const |
void | transposedtransform (const vec &in, vec &out) const |
void | transposedtransformnormal (const vec &in, vec &out) const |
void | transposedtransform (const plane &in, plane &out) const |
vec | gettranslation () const |
vec4< float > | rowx () const |
Returns the first row of the matrix. | |
vec4< float > | rowy () const |
Returns the second row of the matrix. | |
vec4< float > | rowz () const |
Returns the third row of the matrix. | |
vec4< float > | roww () const |
Returns the fourth row of the matrix. | |
bool | invert (const matrix4 &m, double mindet=1.0e-12) |
Sets this matrix to the inverse of the provided matrix. | |
matrix4 | inverse (double mindet=1.0e-12) const |
Returns the inverse of the matrix. | |
vec2 | lineardepthscale () const |
Public Attributes | |
vec4< float > | a |
vec4< float > | b |
vec4< float > | c |
vec4< float > | d |
floating point 4x4 array object
void matrix4::identity | ( | ) |
Sets the matrix to I, the identity matrix.
Sets the matrix to I, with the form as follows:
matrix4 matrix4::inverse | ( | double | mindet = 1.0e-12 | ) | const |
Returns the inverse of the matrix.
Returns a zero matrix if the matrix is singular.
mindet | the determinant value at which matrices are considered singular |
bool matrix4::invert | ( | const matrix4 & | m, |
double | mindet = 1.0e-12 ) |
Sets this matrix to the inverse of the provided matrix.
Sets the matrix values to the inverse of the provided matrix A*A^-1 = I returns false if singular (or nearly singular to within tolerance of mindet) or true if matrix was inverted successfully
m | a matrix4 object to be inverted and assigned to the object |
mindet | the determinant value at which matrices are considered singular |
Sets this matrix to the product of the two matrices provided.
The original contents of the matrix are disregarded. All calculations at single precision (float).
x | the first matrix to multiply |
y | the second matrix to multiply |
void matrix4::mul | ( | const matrix4 & | y | ) |
Sets this matrix to the product of this and another matrix.
The original contents of the matrix are the left element in the product. All calculations at single precision (float).
y | the second matrix to multiply |
Sets this matrix to the product of the two matrices provided.
The original contents of the matrix are disregarded. Uses double precision to perform calculations, and is narrowed at the end to float.
x | the first matrix to multiply |
y | the second matrix to multiply |
void matrix4::muld | ( | const matrix4 & | y | ) |
Sets this matrix to the product of this and another matrix.
The original contents of the matrix are the left element in the product. Uses double precision to perform calculations, and is narrowed at the end to float.
y | the second matrix to multiply |
vec4< float > matrix4::roww | ( | ) | const |
Returns the fourth row of the matrix.
Returns the fourth value of each column vector that makes up the matrix.
vec4< float > matrix4::rowx | ( | ) | const |
Returns the first row of the matrix.
Returns the first value of each column vector that makes up the matrix.
vec4< float > matrix4::rowy | ( | ) | const |
Returns the second row of the matrix.
Returns the second value of each column vector that makes up the matrix.
vec4< float > matrix4::rowz | ( | ) | const |
Returns the third row of the matrix.
Returns the third value of each column vector that makes up the matrix.
void matrix4::transpose | ( | ) |
Transposes the matrix along the diagonal.
Transforms the matrix like so (letters are just arbitrary value placeholders)
void matrix4::transpose | ( | const matrix4 & | m | ) |
Copies the transpose of the given matrix4 to this
Copies the transform of the matrix passed like so (letters are just arbitrary value placeholders) to this
object.