#include <ovalgebra.h>
Public Member Functions | |
OVm4 () | |
Empty constructor, sets identity matrix. | |
OVm4 (float *m) | |
Constructor from array of 16 floats. | |
OVm4 (float e00, float e01, float e02, float e03, float e10, float e11, float e12, float e13, float e20, float e21, float e22, float e23, float e30, float e31, float e32, float e33) | |
Constructor from 16 elements. | |
~OVm4 () | |
Destructor. | |
operator float * () | |
Automatic typecast operator. Enables use of OVm4 in glFunc[v]() functions. | |
float & | operator[] (int index) |
Linear access operator. 'int' and 'unsigned int' as well as const declared versions avaliable. | |
float & | operator[] (unsigned int index) |
const float & | operator[] (int index) const |
const float & | operator[] (unsigned int index) const |
float & | operator() (int row, int col) |
Access operator. 'int' and 'unsigned int' as well as const declared versions avaliable. | |
float & | operator() (unsigned int row, unsigned int col) |
const float & | operator() (int row, int col) const |
const float & | operator() (unsigned int row, unsigned int col) const |
OVm4 | operator * (const float f) |
Operator for multiplication with scalar. | |
OVv4 | operator * (const OVv4 &v) |
Operator for multiplication with vector. This function could easily be re-implemented using an array of floats instead of OV4f. | |
OVm4 | operator * (const OVm4 &a) |
Operator for multiplication with 4x4 matrix. This function could easily be re-implemented using an array of floats instead of OVm4. | |
void | operator= (const float *a) |
= operator. This function could easily be re-implemented using an array of floats instead of OVm3. | |
OVv16 | Get () |
Use only if OV16f is wanted, else use overloaded typecast (OVm4 -> float*). | |
OVv4 | GetRow (int index) |
Access operator for entire row of matrix. | |
OVv4 | GetCol (int index) |
Access operator for entire column of matrix. | |
void | Set (float *a) |
Sets matrix elements. | |
void | SetRow (int index, float *v) |
Sets one row of matrix elements. | |
void | SetCol (int index, float *v) |
Sets one column of matrix elements. | |
void | Print () |
Prints matrix to commandline. | |
void | Clear () |
Clears matrix to 0. | |
void | SetToIdentityMatrix () |
Sets matrix to identity. | |
void | SetToTranslationMatrix (float tx, float ty, float tz) |
Sets matrix to translation matrix. Multiplication will perform a translation of (tx,ty,tz) units. | |
void | SetToRotationMatrix (float theta, float x, float y, float z) |
Sets matrix to rotation matrix. Multiplication will perform a rotation of theta degrees (radians?) around (x,y,z) axis. | |
float | GetDeterminant () |
Determinant of object matrix. | |
OVm4 | GetTranspose () |
Transpose of object matrix. | |
OVm4 | GetInverse () |
Inverse of object matrix. Using adjoint transpose matrices to calculate inverse. | |
Protected Member Functions | |
float | Det3x3 (float &e00, float &e01, float &e02, float &e10, float &e11, float &e12, float &e20, float &e21, float &e22) |
Determinant of any 3x3 matrix. | |
float | Det4x4 (float &e00, float &e01, float &e02, float &e03, float &e10, float &e11, float &e12, float &e13, float &e20, float &e21, float &e22, float &e23, float &e30, float &e31, float &e32, float &e33) |
Determinant of any 4x4 matrix. Using piecewise 3x3 determinants. | |
Private Attributes | |
float | e [16] |
OV::OVm4::OVm4 | ( | ) | [inline] |
Empty constructor, sets identity matrix.
OV::OVm4::OVm4 | ( | float * | m | ) | [inline] |
Constructor from array of 16 floats.
OV::OVm4::OVm4 | ( | float | e00, | |
float | e01, | |||
float | e02, | |||
float | e03, | |||
float | e10, | |||
float | e11, | |||
float | e12, | |||
float | e13, | |||
float | e20, | |||
float | e21, | |||
float | e22, | |||
float | e23, | |||
float | e30, | |||
float | e31, | |||
float | e32, | |||
float | e33 | |||
) |
Constructor from 16 elements.
eXX | = eRC, element (R,C) in matrix. |
OV::OVm4::~OVm4 | ( | ) | [inline] |
Destructor.
OV::OVm4::operator float * | ( | ) | [inline] |
Automatic typecast operator. Enables use of OVm4 in glFunc[v]() functions.
float& OV::OVm4::operator[] | ( | int | index | ) | [inline] |
Linear access operator. 'int' and 'unsigned int' as well as const declared versions avaliable.
index | Linear index of element. |
float& OV::OVm4::operator[] | ( | unsigned int | index | ) | [inline] |
const float& OV::OVm4::operator[] | ( | int | index | ) | const [inline] |
const float& OV::OVm4::operator[] | ( | unsigned int | index | ) | const [inline] |
float& OV::OVm4::operator() | ( | int | row, | |
int | col | |||
) | [inline] |
Access operator. 'int' and 'unsigned int' as well as const declared versions avaliable.
row | Row index of element. | |
col | Column index of element. |
float& OV::OVm4::operator() | ( | unsigned int | row, | |
unsigned int | col | |||
) | [inline] |
const float& OV::OVm4::operator() | ( | int | row, | |
int | col | |||
) | const [inline] |
const float& OV::OVm4::operator() | ( | unsigned int | row, | |
unsigned int | col | |||
) | const [inline] |
OVm4 OV::OVm4::operator * | ( | const float | f | ) |
Operator for multiplication with scalar.
f | Constant scalar. |
Operator for multiplication with vector. This function could easily be re-implemented using an array of floats instead of OV4f.
v | Constant reference to vector. |
void OV::OVm4::operator= | ( | const float * | a | ) |
= operator. This function could easily be re-implemented using an array of floats instead of OVm3.
m | Constant reference to matrix. |
OVv16 OV::OVm4::Get | ( | ) | [inline] |
Use only if OV16f is wanted, else use overloaded typecast (OVm4 -> float*).
OVv4 OV::OVm4::GetRow | ( | int | index | ) |
Access operator for entire row of matrix.
index | Row index. |
OVv4 OV::OVm4::GetCol | ( | int | index | ) |
Access operator for entire column of matrix.
index | Column index. |
void OV::OVm4::Set | ( | float * | a | ) |
Sets matrix elements.
a | Array of 16 floats. |
void OV::OVm4::SetRow | ( | int | index, | |
float * | v | |||
) |
Sets one row of matrix elements.
index | Row index. | |
v | Contains the elements to which the row should be set |
void OV::OVm4::SetCol | ( | int | index, | |
float * | v | |||
) |
Sets one column of matrix elements.
index | Column index. | |
v | Contains the elements to which the column should be set |
void OV::OVm4::Print | ( | ) |
Prints matrix to commandline.
void OV::OVm4::Clear | ( | ) |
Clears matrix to 0.
void OV::OVm4::SetToIdentityMatrix | ( | ) |
Sets matrix to identity.
void OV::OVm4::SetToTranslationMatrix | ( | float | tx, | |
float | ty, | |||
float | tz | |||
) |
Sets matrix to translation matrix. Multiplication will perform a translation of (tx,ty,tz) units.
tx | Translation in x. | |
ty | Translation in y. | |
tz | Translation in z. |
void OV::OVm4::SetToRotationMatrix | ( | float | theta, | |
float | x, | |||
float | y, | |||
float | z | |||
) |
Sets matrix to rotation matrix. Multiplication will perform a rotation of theta degrees (radians?) around (x,y,z) axis.
theta | Angle of rotation. | |
x | x-coordinate of rotation axis. | |
y | y-coordinate of rotation axis. | |
z | y-coordinate of rotation axis. |
float OV::OVm4::GetDeterminant | ( | ) |
Determinant of object matrix.
OVm4 OV::OVm4::GetInverse | ( | ) |
Inverse of object matrix. Using adjoint transpose matrices to calculate inverse.
float OV::OVm4::Det3x3 | ( | float & | e00, | |
float & | e01, | |||
float & | e02, | |||
float & | e10, | |||
float & | e11, | |||
float & | e12, | |||
float & | e20, | |||
float & | e21, | |||
float & | e22 | |||
) | [inline, protected] |
Determinant of any 3x3 matrix.
eXX | eXX = eRC, element (R,C) in matrix. |
float OV::OVm4::Det4x4 | ( | float & | e00, | |
float & | e01, | |||
float & | e02, | |||
float & | e03, | |||
float & | e10, | |||
float & | e11, | |||
float & | e12, | |||
float & | e13, | |||
float & | e20, | |||
float & | e21, | |||
float & | e22, | |||
float & | e23, | |||
float & | e30, | |||
float & | e31, | |||
float & | e32, | |||
float & | e33 | |||
) | [inline, protected] |
Determinant of any 4x4 matrix. Using piecewise 3x3 determinants.
eXX | eXX = eRC, element (R,C) in matrix. |
float OV::OVm4::e[16] [private] |
Array of matrix elements.