#include <K3dMatrix.h>
Inheritance diagram for K3dMatrix:
Public Member Functions | |
K3dMatrix () | |
K3dMatrix (const float afMatrix[16]) | |
~K3dMatrix () | |
int & | GetId () |
Get or set matrix index in global data. | |
void | LoadIdentity () |
void | ResetRotation () |
void | ResetTranslation () |
float * | Matrix () |
const float * | Matrix () const |
float * | GetMatrix () |
void | SetMatrix (const float *_pfMatrix, const int _iSize=16) |
Set matrix from float array. | |
void | SetMatrix (const K3dMatrix &_rkMatrix, const int _iSize=16) |
Set matrix from another matrix. | |
void | SetRow (const K3dVector4 &_rkRow, const int _iRow) |
void | SetColumn (const K3dVector4 &_rkColumn, const int _iRow) |
void | GetRow (K3dVector4 &_rkRow, const int _iRow) |
void | GetColumn (K3dVector4 &_rkColumn, const int _iColumn) |
float & | operator[] (int index) |
float | operator() (int iRow, int iCol) const |
float & | operator() (int iRow, int iCol) |
K3dMatrix & | operator= (const K3dMatrix &_rkM) |
bool | operator== (K3dMatrix &rkM) |
bool | operator!= (K3dMatrix &rkM) |
bool | operator< (K3dMatrix &rkM) |
bool | operator<= (K3dMatrix &rkM) |
bool | operator> (K3dMatrix &rkM) |
bool | operator>= (K3dMatrix &rkM) |
int | CompareArrays (K3dMatrix &rkV) |
K3dMatrix | operator+ (K3dMatrix &rkM) |
K3dMatrix | operator- (K3dMatrix &rkM) |
K3dMatrix | operator * (K3dMatrix &rkMatrix) |
K3dMatrix | operator * (float fScalar) |
K3dMatrix | operator * (const float afMatrix[16]) |
K3dVector3 | operator * (K3dVector3 &rkV) |
K3dMatrix | operator- () |
K3dMatrix & | operator+= (K3dMatrix &rkM) |
K3dMatrix & | operator-= (K3dMatrix &rkM) |
K3dMatrix & | operator *= (float fScalar) |
K3dMatrix & | operator/= (float fScalar) |
void | Multiply (K3dMatrix &_rkMat) |
Multiply two matrices. Multiply current matrix with param matrix. Result is in changed current matrix. | |
void | MultiplyTranspose (K3dMatrix &_rkMat) |
Multiply transpose two matrices (OpenGL matrices). | |
void | MultiplyRow (const float fScalar, const int iRow) |
void | MultiplyColumn (const float fScalar, const int iColumn) |
void | AddRow (const int iRow1, const int iRow2) |
void | Translation (const float *translation) |
void | Translation (const K3dVector3 &_rkVector) |
void | InverseTranslation (const K3dVector3 &_rkVector) |
Set matrix inverse translation from 3D vector. | |
void | Rotation (K3dVector3 &_rkAngle) |
void | Rotation (const float *pfAngle) |
void | InverseRotation (K3dVector3 &_rkAngle) |
void | InverseRotation (const float *pfAngle) |
void | RotationX (const float fAngle) |
void | RotationXGL (const float _fAngle) |
Calculate OpenGL X rotation matrix. | |
void | RotationY (const float fAngle) |
void | RotationYGL (const float _fAngle) |
Calculate OpenGL Y rotation matrix. | |
void | RotationZ (const float fAngle) |
void | RotationZGL (const float _fAngle) |
Calculate OpenGL Z rotation matrix. | |
void | Scale (K3dVector3 &_rkVector) |
void | GetVector (K3dVector3 &_rkVector) |
int | GetScalarIndex (const int iRow, const int iCol) |
void | ChangeVector (K3dVector3 &_rkVec) |
void | ChangeVectorTran (K3dVector3 &_rkVec) |
void | TranslateVector (K3dVector3 &_rkVec) |
void | ChangeVectorGL (K3dVector3 &_rkVec) |
Change OpenGL vector by matrix. | |
void | ChangeVectorX (K3dVector3 &_rkVec) |
void | ChangeVectorXGL (K3dVector3 &_rkVec) |
Change X vector coordination by OpenGL matrix. | |
void | ChangeVectorY (K3dVector3 &_rkVec) |
void | ChangeVectorYGL (K3dVector3 &_rkVec) |
Change Y vector coordination by OpenGL matrix. | |
void | ChangeVectorZ (K3dVector3 &_rkVec) |
void | ChangeVectorZGL (K3dVector3 &_rkVec) |
Change X vector coordination by OpenGL matrix. | |
float | Determinant () |
void | Inverse () |
Create inverse matrix. | |
void | InverseGL () |
void | FlipRowToColumn (const K3dMatrix &_rkMatrix) |
void | Rotation (const K3dVector3 &_rkAxis, const float fAngle) |
void | RotationGL (const K3dVector3 &_rkAxis, const float fAngle) |
K3dVector3 | LinearSystem (const K3dVector4 &_rkEq1, const K3dVector4 &_rkEq2, const K3dVector4 &_rkEq3) |
void | ToOrFromGL () |
void | MultMatrixVec (const K3dVector3 &_rkSrc, K3dVector3 &rkDst) |
void | MultMatrixVec (K3dVector3 &rkSrcAndDst) |
void | MultVecMatrix (const K3dVector3 &rkSrc, K3dVector3 &rkDst) |
void | MultVecMatrix (K3dVector3 &rkSrcAndDst) |
void | MultMatrixDir (const K3dVector3 &rkSrc, K3dVector3 &rkDst) |
void | MultMatrixDir (K3dVector3 &rkSrcAndDst) |
void | MultDirMatrix (const K3dVector3 &rkSrc, K3dVector3 &rkDst) |
void | MultDirMatrix (K3dVector3 &rkSrcAndDst) |
void | GetTranslation (K3dVector3 &_rkTranslation) |
Get translation vector from matrix. | |
Private Attributes | |
float | m_afMatrix [16] |
Main matrix. | |
int | m_iId |
Matrix index in global data. |
Definition at line 39 of file K3dMatrix.h.
K3dMatrix::K3dMatrix | ( | ) |
K3dMatrix::K3dMatrix | ( | const float | afMatrix[16] | ) |
K3dMatrix::~K3dMatrix | ( | ) |
Definition at line 49 of file K3dMatrix.cpp.
int& K3dMatrix::GetId | ( | ) | [inline] |
Get or set matrix index in global data.
Definition at line 63 of file K3dMatrix.h.
References m_iId.
Referenced by K3dMatrixBuild::CreateNewMatrix().
void K3dMatrix::LoadIdentity | ( | ) | [inline] |
Definition at line 295 of file K3dMatrix.h.
References m_afMatrix.
Referenced by K3dMatrix(), and operator/=().
void K3dMatrix::ResetRotation | ( | ) | [inline] |
void K3dMatrix::ResetTranslation | ( | ) | [inline] |
Definition at line 317 of file K3dMatrix.h.
References m_afMatrix.
Referenced by K3dPlaneWork::UpdateMatrix(), and K3dLineMove::UpdateMatrix().
float * K3dMatrix::Matrix | ( | ) | [inline] |
const float * K3dMatrix::Matrix | ( | ) | const [inline] |
float* K3dMatrix::GetMatrix | ( | ) | [inline] |
Definition at line 79 of file K3dMatrix.h.
References m_afMatrix.
Referenced by K3dDrawLine::DrawLines(), K3dDrawPlane::DrawPlanes(), K3dDrawSphere::DrawSpheres(), K3dFontBmp::DrawValue(), and K3dCamera::Look().
void K3dMatrix::SetMatrix | ( | const float * | _pfMatrix, | |
const int | _iSize = 16 | |||
) |
Set matrix from float array.
*_pfMatrix | Float array | |
_iSize | Size of float array, default 16 |
Definition at line 58 of file K3dMatrix.cpp.
References m_afMatrix.
Referenced by Multiply(), MultiplyTranspose(), and operator *().
void K3dMatrix::SetMatrix | ( | const K3dMatrix & | _rkMatrix, | |
const int | _iSize = 16 | |||
) |
Set matrix from another matrix.
&_rkMatrix | Another matrix | |
_iSize | Matrix size, default 16 |
Definition at line 72 of file K3dMatrix.cpp.
References m_afMatrix.
void K3dMatrix::SetRow | ( | const K3dVector4 & | _rkRow, | |
const int | _iRow | |||
) |
Definition at line 84 of file K3dMatrix.cpp.
References m_afMatrix.
Referenced by AddRow(), and LinearSystem().
void K3dMatrix::SetColumn | ( | const K3dVector4 & | _rkColumn, | |
const int | _iRow | |||
) |
void K3dMatrix::GetRow | ( | K3dVector4 & | _rkRow, | |
const int | _iRow | |||
) |
Definition at line 123 of file K3dMatrix.cpp.
References m_afMatrix.
Referenced by AddRow(), and LinearSystem().
void K3dMatrix::GetColumn | ( | K3dVector4 & | _rkColumn, | |
const int | _iColumn | |||
) |
float & K3dMatrix::operator[] | ( | int | index | ) | [inline] |
float K3dMatrix::operator() | ( | int | iRow, | |
int | iCol | |||
) | const [inline] |
float & K3dMatrix::operator() | ( | int | iRow, | |
int | iCol | |||
) | [inline] |
bool K3dMatrix::operator== | ( | K3dMatrix & | rkM | ) | [inline] |
bool K3dMatrix::operator!= | ( | K3dMatrix & | rkM | ) | [inline] |
bool K3dMatrix::operator< | ( | K3dMatrix & | rkM | ) | [inline] |
bool K3dMatrix::operator<= | ( | K3dMatrix & | rkM | ) | [inline] |
bool K3dMatrix::operator> | ( | K3dMatrix & | rkM | ) | [inline] |
bool K3dMatrix::operator>= | ( | K3dMatrix & | rkM | ) | [inline] |
int K3dMatrix::CompareArrays | ( | K3dMatrix & | rkV | ) |
Definition at line 250 of file K3dMatrix.cpp.
References m_afMatrix.
Referenced by operator<(), operator<=(), operator>(), and operator>=().
K3dMatrix K3dMatrix::operator * | ( | float | fScalar | ) |
K3dMatrix K3dMatrix::operator * | ( | const float | afMatrix[16] | ) | [inline] |
K3dVector3 K3dMatrix::operator * | ( | K3dVector3 & | rkV | ) | [inline] |
K3dMatrix K3dMatrix::operator- | ( | ) |
K3dMatrix & K3dMatrix::operator *= | ( | float | fScalar | ) |
K3dMatrix & K3dMatrix::operator/= | ( | float | fScalar | ) |
void K3dMatrix::Multiply | ( | K3dMatrix & | _rkMat | ) | [inline] |
Multiply two matrices. Multiply current matrix with param matrix. Result is in changed current matrix.
Definition at line 445 of file K3dMatrix.h.
References m_afMatrix, and SetMatrix().
Referenced by K3dCamera::ChangeMatrix(), K3dDrawLine::DrawLines(), K3dDrawPlane::DrawPlanes(), and K3dDrawSphere::DrawSpheres().
void K3dMatrix::MultiplyTranspose | ( | K3dMatrix & | _rkMat | ) | [inline] |
Multiply transpose two matrices (OpenGL matrices).
Definition at line 476 of file K3dMatrix.h.
References m_afMatrix, and SetMatrix().
Referenced by K3dCamera::ChangeMatrix(), and K3dCamera::SetStrafeDirection().
void K3dMatrix::MultiplyRow | ( | const float | fScalar, | |
const int | iRow | |||
) |
void K3dMatrix::MultiplyColumn | ( | const float | fScalar, | |
const int | iColumn | |||
) |
void K3dMatrix::AddRow | ( | const int | iRow1, | |
const int | iRow2 | |||
) | [inline] |
Definition at line 507 of file K3dMatrix.h.
References GetRow(), and SetRow().
Referenced by LinearSystem().
void K3dMatrix::Translation | ( | const float * | translation | ) | [inline] |
Definition at line 537 of file K3dMatrix.h.
References m_afMatrix.
Referenced by K3dSphereMove::SetRenderMatrix(), K3dPlaneMove::SetRenderMatrix(), and K3dLineMove::SetRenderMatrix().
void K3dMatrix::Translation | ( | const K3dVector3 & | _rkVector | ) | [inline] |
void K3dMatrix::InverseTranslation | ( | const K3dVector3 & | _rkVector | ) | [inline] |
Set matrix inverse translation from 3D vector.
Definition at line 557 of file K3dMatrix.h.
References m_afMatrix.
Referenced by K3dCamera::ChangeMatrix().
void K3dMatrix::Rotation | ( | K3dVector3 & | _rkAngle | ) | [inline] |
Definition at line 595 of file K3dMatrix.h.
References m_afMatrix.
Referenced by K3dMatrixWork::RotationArbitraryVector(), K3dMatrixWork::RotationForwardVector(), K3dMatrixWork::RotationRightVector(), and K3dMatrixWork::RotationUpVector().
void K3dMatrix::Rotation | ( | const float * | pfAngle | ) | [inline] |
void K3dMatrix::InverseRotation | ( | K3dVector3 & | _rkAngle | ) | [inline] |
void K3dMatrix::InverseRotation | ( | const float * | pfAngle | ) | [inline] |
void K3dMatrix::RotationX | ( | const float | fAngle | ) | [inline] |
void K3dMatrix::RotationXGL | ( | const float | _fAngle | ) | [inline] |
Calculate OpenGL X rotation matrix.
_fAngle | Rotation vector |
Definition at line 725 of file K3dMatrix.h.
References m_afMatrix.
Referenced by K3dCamera::ChangeMatrix(), and K3dCamera::SetStrafeDirection().
void K3dMatrix::RotationY | ( | const float | fAngle | ) | [inline] |
void K3dMatrix::RotationYGL | ( | const float | _fAngle | ) | [inline] |
Calculate OpenGL Y rotation matrix.
_fAngle | Rotation vector |
Definition at line 754 of file K3dMatrix.h.
References m_afMatrix.
Referenced by K3dCamera::ChangeMatrix(), and K3dCamera::SetStrafeDirection().
void K3dMatrix::RotationZ | ( | const float | fAngle | ) | [inline] |
void K3dMatrix::RotationZGL | ( | const float | _fAngle | ) | [inline] |
Calculate OpenGL Z rotation matrix.
_fAngle | Rotation vector |
Definition at line 783 of file K3dMatrix.h.
References m_afMatrix.
void K3dMatrix::Scale | ( | K3dVector3 & | _rkVector | ) | [inline] |
void K3dMatrix::GetVector | ( | K3dVector3 & | _rkVector | ) | [inline] |
int K3dMatrix::GetScalarIndex | ( | const int | iRow, | |
const int | iCol | |||
) | [inline] |
void K3dMatrix::ChangeVector | ( | K3dVector3 & | _rkVec | ) | [inline] |
Definition at line 851 of file K3dMatrix.h.
References m_afMatrix.
Referenced by K3dCamera::ChangeMatrix(), and operator *().
void K3dMatrix::ChangeVectorTran | ( | K3dVector3 & | _rkVec | ) | [inline] |
void K3dMatrix::TranslateVector | ( | K3dVector3 & | _rkVec | ) | [inline] |
void K3dMatrix::ChangeVectorGL | ( | K3dVector3 & | _rkVec | ) | [inline] |
Change OpenGL vector by matrix.
Definition at line 902 of file K3dMatrix.h.
References m_afMatrix.
Referenced by K3dCamera::ChangeMatrix(), K3dPlaneWork::UpdateMatrix(), and K3dLineMove::UpdateMatrix().
void K3dMatrix::ChangeVectorX | ( | K3dVector3 & | _rkVec | ) | [inline] |
void K3dMatrix::ChangeVectorXGL | ( | K3dVector3 & | _rkVec | ) | [inline] |
Change X vector coordination by OpenGL matrix.
_rkVec | Vector to which change X coordination |
Definition at line 929 of file K3dMatrix.h.
References m_afMatrix.
Referenced by K3dCamera::ChangeMatrix(), and K3dCamera::SetStrafeDirection().
void K3dMatrix::ChangeVectorY | ( | K3dVector3 & | _rkVec | ) | [inline] |
void K3dMatrix::ChangeVectorYGL | ( | K3dVector3 & | _rkVec | ) | [inline] |
Change Y vector coordination by OpenGL matrix.
_rkVec | Vector to which change Y coordination |
Definition at line 950 of file K3dMatrix.h.
References m_afMatrix.
Referenced by K3dCamera::ChangeMatrix().
void K3dMatrix::ChangeVectorZ | ( | K3dVector3 & | _rkVec | ) | [inline] |
void K3dMatrix::ChangeVectorZGL | ( | K3dVector3 & | _rkVec | ) | [inline] |
Change X vector coordination by OpenGL matrix.
_rkVec | Vector to which change X coordination |
Definition at line 971 of file K3dMatrix.h.
References m_afMatrix.
Referenced by K3dCamera::ChangeMatrix(), and K3dCamera::SetStrafeDirection().
float K3dMatrix::Determinant | ( | ) | [inline] |
void K3dMatrix::Inverse | ( | ) | [inline] |
Create inverse matrix.
Definition at line 1002 of file K3dMatrix.h.
References m_afMatrix.
Referenced by K3dCamera::ChangeMatrix().
void K3dMatrix::InverseGL | ( | ) | [inline] |
void K3dMatrix::FlipRowToColumn | ( | const K3dMatrix & | _rkMatrix | ) | [inline] |
void K3dMatrix::Rotation | ( | const K3dVector3 & | _rkAxis, | |
const float | fAngle | |||
) | [inline] |
Definition at line 1121 of file K3dMatrix.h.
References K3dVector3::GetX(), K3dVector3::GetY(), K3dVector3::GetZ(), and m_afMatrix.
void K3dMatrix::RotationGL | ( | const K3dVector3 & | _rkAxis, | |
const float | fAngle | |||
) | [inline] |
Definition at line 1152 of file K3dMatrix.h.
References K3dVector3::GetX(), K3dVector3::GetY(), K3dVector3::GetZ(), and m_afMatrix.
Referenced by K3dMatrixWork::RotationArbitraryVectorGL(), K3dMatrixWork::RotationForwardVectorGL(), K3dMatrixWork::RotationRightVectorGL(), and K3dMatrixWork::RotationUpVectorGL().
K3dVector3 K3dMatrix::LinearSystem | ( | const K3dVector4 & | _rkEq1, | |
const K3dVector4 & | _rkEq2, | |||
const K3dVector4 & | _rkEq3 | |||
) | [inline] |
Definition at line 1179 of file K3dMatrix.h.
References AddRow(), GetRow(), MultiplyRow(), and SetRow().
void K3dMatrix::ToOrFromGL | ( | ) | [inline] |
void K3dMatrix::MultMatrixVec | ( | const K3dVector3 & | _rkSrc, | |
K3dVector3 & | rkDst | |||
) | [inline] |
void K3dMatrix::MultMatrixVec | ( | K3dVector3 & | rkSrcAndDst | ) | [inline] |
void K3dMatrix::MultVecMatrix | ( | const K3dVector3 & | rkSrc, | |
K3dVector3 & | rkDst | |||
) | [inline] |
void K3dMatrix::MultVecMatrix | ( | K3dVector3 & | rkSrcAndDst | ) | [inline] |
void K3dMatrix::MultMatrixDir | ( | const K3dVector3 & | rkSrc, | |
K3dVector3 & | rkDst | |||
) | [inline] |
void K3dMatrix::MultMatrixDir | ( | K3dVector3 & | rkSrcAndDst | ) | [inline] |
void K3dMatrix::MultDirMatrix | ( | const K3dVector3 & | rkSrc, | |
K3dVector3 & | rkDst | |||
) | [inline] |
void K3dMatrix::MultDirMatrix | ( | K3dVector3 & | rkSrcAndDst | ) | [inline] |
void K3dMatrix::GetTranslation | ( | K3dVector3 & | _rkTranslation | ) | [inline] |
Get translation vector from matrix.
_rkTranslation | Input output translation vector |
Definition at line 227 of file K3dMatrix.h.
References m_afMatrix.
Referenced by K3dPlaneWork::UpdateMatrix(), and K3dLineMove::UpdateMatrix().
float K3dMatrix::m_afMatrix[16] [private] |
Main matrix.
Definition at line 55 of file K3dMatrix.h.
Referenced by ChangeVector(), ChangeVectorGL(), ChangeVectorTran(), ChangeVectorX(), ChangeVectorXGL(), ChangeVectorY(), ChangeVectorYGL(), ChangeVectorZ(), ChangeVectorZGL(), CompareArrays(), Determinant(), FlipRowToColumn(), GetColumn(), GetMatrix(), GetRow(), GetTranslation(), GetVector(), Inverse(), InverseGL(), InverseRotation(), InverseTranslation(), K3dMatrix(), LoadIdentity(), Matrix(), MultDirMatrix(), Multiply(), MultiplyColumn(), MultiplyRow(), MultiplyTranspose(), MultMatrixDir(), MultMatrixVec(), MultVecMatrix(), operator *(), operator *=(), operator!=(), operator()(), operator+(), operator+=(), operator-(), operator-=(), operator/=(), operator=(), operator==(), operator[](), ResetRotation(), ResetTranslation(), Rotation(), RotationGL(), RotationX(), RotationXGL(), RotationY(), RotationYGL(), RotationZ(), RotationZGL(), Scale(), SetColumn(), SetMatrix(), SetRow(), ToOrFromGL(), TranslateVector(), and Translation().
int K3dMatrix::m_iId [private] |