![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cMatrix.h>
Public Types | |
| typedef cMatrixT< DVALUEDEF_t, k_nDim, k_nDim > | SUPER_t |
| typedef cMatrix4x4f | THIS_t |
Public Types inherited from GrayLib::cMatrixT< DVALUEDEF_t, 4, 4 > | |
| typedef DVALUEDEF_t | DVALUE_t |
Public Member Functions | |
| cMatrix4x4f () | |
| cMatrix4x4f (const SUPER_t &src) | |
| cMatrix4x4f (const DVALUE_t *pSrc) | |
| cMatrix4x4f (DVALUE_t n11, DVALUE_t n12=0, DVALUE_t n13=0, DVALUE_t n14=0, DVALUE_t n21=0, DVALUE_t n22=0, DVALUE_t n23=0, DVALUE_t n24=0, DVALUE_t n31=0, DVALUE_t n32=0, DVALUE_t n33=0, DVALUE_t n34=0, DVALUE_t n41=0, DVALUE_t n42=0, DVALUE_t n43=0, DVALUE_t n44=0) | |
| const cVector3f & | GetAxis3 (AXIS_TYPE eAxis) const |
| const cVector4f & | GetAxis4 (int nRow) const |
| const cVector3f & | get_XAxis () const |
| const cVector3f & | get_YAxis () const |
| const cVector3f & | get_ZAxis () const |
| const cVector3f & | get_Translation () const |
| DVALUE_t | get_Scaling1N () const |
| cVector3f | get_ScalingN () const |
| cVector3f | get_ScalingU () const |
| bool | isIdentity () const |
| THIS_t | get_Normalized () const |
| cQuaternionf | get_RotationQ () const |
| DVALUE_t | GetDeterminant () const |
| THIS_t | GetTranspose () const |
| THIS_t | GetInverse (DVALUE_t *pfDeterminant=nullptr) const |
| THIS_t | operator- () const |
| THIS_t | GetMul (const THIS_t &m2) const |
| THIS_t | operator* (const THIS_t &m2) const |
| void | Decompose (cVector3f &vScale, cQuaternionf &qRot, cVector3f &vTrans) const |
| void | InitIdentity () |
| void | InitTranslation (DVALUE_t x, DVALUE_t y, DVALUE_t z) |
| void | InitTranslation (const cVector3f &pt) |
| void | InitScaling (DVALUE_t _x, DVALUE_t _y, DVALUE_t _z) |
| void | InitScaling (const cVector3f &pt) |
| void | InitScaling (DVALUE_t fScale) |
| void | InitRotationQ (const cQuaternionf &q) |
| void | InitRotationX (RADIANf_t fAngleX) |
| void | InitRotationY (RADIANf_t fAngleY) |
| void | InitRotationZ (RADIANf_t fAngleZ) |
| void | InitRotationAxis (const cVector3f &vAxis, RADIANf_t fAngle) |
| void | InitInverse (const THIS_t &m1, DVALUE_t *pfDeterminant=nullptr) |
| void | InitTranspose (const THIS_t &m1) |
| void | InitMul (const THIS_t &m1, const THIS_t &m2) |
| void | InitPerspectiveFovLH (DVALUE_t fovy, DVALUE_t aspect, DVALUE_t zn, DVALUE_t zf) |
| void | InitOrthoOffCenterLH (DVALUE_t l, DVALUE_t r, DVALUE_t b, DVALUE_t t, DVALUE_t zn, DVALUE_t zf) |
| void | InitYawPitchRoll (RADIANf_t yaw, RADIANf_t pitch, RADIANf_t roll) |
| void | InitReflect (const cPlanef &plane) |
| void | InitLookAtLH (const cVector3f &vEye, const cVector3f &vAt, const cVector3f &vUp) |
| void | InitTransformation (const cVector3f *pvScalingCenter=nullptr, const cQuaternionf *pqScalingRotation=nullptr, const cVector3f *pvScaling=nullptr, const cVector3f *pvRotationcenter=nullptr, const cQuaternionf *pqRotation=nullptr, const cVector3f *pvTranslation=nullptr) |
| void | InitTransformation2D (const cVector2f *pvScalingCenter=nullptr, float fScalingRotation=0, const cVector2f *pvScaling=nullptr, const cVector2f *pvRotationCenter=nullptr, RADIANf_t fRotation=0, const cVector2f *pvTranslation=nullptr) |
| cVector3f & | ref_XAxis () |
| cVector3f & | ref_YAxis () |
| cVector3f & | ref_ZAxis () |
| cVector3f & | ref_Translation () |
| cVector3f & | RefAxis3 (AXIS_TYPE eAxis) |
| cVector4f & | RefAxis4 (int nRow) |
| void | SetTranslation (DVALUE_t _x=0, DVALUE_t _y=0, DVALUE_t _z=0) |
| void | SetScaling (DVALUE_t _x, DVALUE_t _y, DVALUE_t _z) |
| void | put_Scaling1 (DVALUE_t fScale=0) |
| void | SetScalingT (DVALUE_t _x, DVALUE_t _y, DVALUE_t _z) |
| void | SetNormalized () |
| void | SetInvert (DVALUE_t *pfDeterminant=nullptr) |
| void | SetTranspose () |
| void | SetMul (const THIS_t &m2) |
| const THIS_t & | operator*= (const THIS_t &m2) |
| UNITTEST_FRIEND (cMatrix) | |
Public Member Functions inherited from GrayLib::cMatrixT< DVALUEDEF_t, 4, 4 > | |
| cMatrixT () noexcept | |
| cMatrixT (const THIS_t &v) noexcept | |
| cMatrixT (const DVALUEDEF_t *pVals) noexcept | |
| bool | IsNear (const THIS_t &v2, DVALUEDEF_t fDist=(DVALUEDEF_t) k_FLT_MIN2) const |
| COMPARE_t | Compare (const THIS_t &v2) const |
| bool | operator== (const THIS_t &v2) const |
| bool | operator!= (const THIS_t &v2) const |
| void | InitMul (const cMatrixT< DVALUEDEF_t, _ROWS, _IDN > &m1, const cMatrixT< DVALUEDEF_t, _IDN, _COLS > &m2) |
| DVALUEDEF_t * | RefRow (int nRow) |
| const DVALUEDEF_t * | GetRow (int nRow) const |
| const DVALUEDEF_t * | GetRow (AXIS_TYPE eAxis) const |
| void | SetRow (int nRow, const DVALUEDEF_t *p) |
| cVecT< DVALUEDEF_t, _COLS > & | RefRowV (int nRow) |
| const cVecT< DVALUEDEF_t, _COLS > & | GetRowV (int nRow) const |
| void | SetRowV (int nRow, const cVecT< DVALUEDEF_t, _COLS > &v) |
| void | CopyColTo (int nCol, DVALUEDEF_t *pV) const |
| void | CopyColToV (int nCol, cVecT< DVALUEDEF_t, _ROWS > &v) const |
| cVecT< DVALUEDEF_t, _ROWS > | GetColV (int nCol) const |
| void | SetCol (int nCol, const DVALUEDEF_t *pV) |
| void | SetColV (int nCol, const cVecT< DVALUEDEF_t, _ROWS > &v) |
Static Public Attributes | |
| static const int | k_nDim = 4 |
| static const THIS_t | k_Identity |
Static Public Attributes inherited from GrayLib::cMatrixT< DVALUEDEF_t, 4, 4 > | |
| static const int | k_nRows |
| static const int | k_nCols |
Additional Inherited Members | |
Public Attributes inherited from GrayLib::cMatrixT< DVALUEDEF_t, 4, 4 > | |
| DVALUEDEF_t | m_a [_ROWS *_COLS] |
| DVALUEDEF_t | m [_ROWS][_COLS] |
| union { | |
| TYPE m_a [_ROWS *_COLS] | |
| TYPE m [_ROWS][_COLS] | |
| }; | |
D3DXMATRIXA16 is 16 byte aligned for speed. D3DX_ALIGN16 XMFLOAT4X4 for better MMX,SSE access same as shader 'float4x4'
| typedef cMatrixT<DVALUEDEF_t, k_nDim, k_nDim> GrayLib::cMatrix4x4f::SUPER_t |
|
inline |
ASSUME no/random/undefined init matrix data.
|
inline |
|
inline |
Array of values. ASSUME >= 16
|
inline |
|
inline |
Get the matrix parts. like: D3DXMatrixDecompose http://www.nabble.com/d3dx9:-Implementation-of-D3DXMatrixDecompose-2-2-td18835368.html
|
inline |
Get the matrix normalized. remove the scaling info.
|
inline |
|
inline |
unify the scale to be locked aspect ratio. Assumes a Identity type matrix
|
inline |
Assumes a Identity type matrix
|
inline |
get magnitudes for scaling portion of matrix. factors out any rotation.
|
inline |
Only really useful for row-major matrices in a left-handed space. (Dx not OpenGL)
|
inline |
GetRight() for D3D Assume axis are stored in DirectX style NOT OpenGL style (which is transposed)
|
inline |
GetUp() for D3D
|
inline |
GetForward() for D3D
Only really useful for row-major matrices in a left-handed space. (Dx not OpenGL)
|
inline |
Get the axis + 1 extra as a cVector4f Only really useful for row-major matrices in a left-handed space. (Dx not OpenGL)
|
inline |
D3DXMatrixDeterminant like D3DXMatrixfDeterminant
|
inline |
|
inline |
Create an identity matrix All zero + scale of 1,1,1. no translation or rotation.
|
inline |
Create an inverted matrix. i.e. M1 * M1inverted = identity matrix
| void GrayLib::cMatrix4x4f::InitLookAtLH | ( | const cVector3f & | vEye, |
| const cVector3f & | vAt, | ||
| const cVector3f & | vUp | ||
| ) |
Left Handed (DirectX) style
Create a matrix with result of multiply of 2 matrices.
|
inline |
For left handed 3d space.
|
inline |
Create a matrix For left handed 3d space.
| void GrayLib::cMatrix4x4f::InitReflect | ( | const cPlanef & | plane | ) |
Create a 3x3 rotation matrix around an arbitrary axis.
|
inline |
Create a rotation matrix Set matrix rotation from quaternion.
|
inline |
Create a rotation matrix around x axis. x = Euler pitch.
|
inline |
Create a rotation matrix around y axis.
|
inline |
Create a rotation matrix around z axis. z=roll=bank
|
inline |
Create a scaling matrix
|
inline |
Create a scaling matrix fScale = 1 = identity.
| void GrayLib::cMatrix4x4f::InitTransformation | ( | const cVector3f * | pvScalingCenter = nullptr, |
| const cQuaternionf * | pqScalingRotation = nullptr, |
||
| const cVector3f * | pvScaling = nullptr, |
||
| const cVector3f * | pvRotationcenter = nullptr, |
||
| const cQuaternionf * | pqRotation = nullptr, |
||
| const cVector3f * | pvTranslation = nullptr |
||
| ) |
| void GrayLib::cMatrix4x4f::InitTransformation2D | ( | const cVector2f * | pvScalingCenter = nullptr, |
| float | fScalingRotation = 0, |
||
| const cVector2f * | pvScaling = nullptr, |
||
| const cVector2f * | pvRotationCenter = nullptr, |
||
| RADIANf_t | fRotation = 0, |
||
| const cVector2f * | pvTranslation = nullptr |
||
| ) |
|
inline |
Create a translation matrix
Create a translation matrix
|
inline |
3x3 matrix for Euler angles. y=yaw=heading,x=pitch,z=roll=bank
|
inline |
test for InitIdentity() D3DXMatrixIdentity test for near identity == IsNear( k_Identity );
|
inline |
|
inline |
Unify the scaling
|
inline |
< AXIS_Trans
|
inline |
< AXIS_X
|
inline |
< AXIS_Y
|
inline |
< AXIS_Z
|
inline |
Invert myself.
|
inline |
multiply against myself. this = this * m2
|
inline |
Normalize the AXIS_TYPE vectors. WEIRD !? easier to just normalize the result of whatever the matrix is used for ?
similar to InitScaling() D3DXMatrixScaling BUT NOT FULL INIT safely does not change the existing rotation.
SetScaling Transposed. Was SetScale3
|
inline |
similar to D3DXMatrixTranslation and InitTranslation() BUT NOT FULL INIT Poke the translation into the matrix. This is safe.
|
inline |
Transpose myself.
| GrayLib::cMatrix4x4f::UNITTEST_FRIEND | ( | cMatrix | ) |
|
static |
|
static |