3x3 matrix class More...
#include <PxMat33.h>
Static Public Member Functions | |
PX_DEPRECATED PX_CUDA_CALLABLE static PX_INLINE PxMat33 | createIdentity () |
PX_DEPRECATED PX_CUDA_CALLABLE static PX_INLINE PxMat33 | createZero () |
PX_CUDA_CALLABLE static PX_INLINE PxMat33 | createDiagonal (const PxVec3 &d) |
Construct from diagonal, off-diagonals are zero. More... | |
Public Attributes | |
PxVec3 | column0 |
PxVec3 | column1 |
PxVec3 | column2 |
Friends | |
PxMat33 | operator* (PxReal, const PxMat33 &) |
3x3 matrix class
Some clarifications, as there have been much confusion about matrix formats etc in the past.
Short:
Long: Given three base vectors a, b and c the matrix is stored as
|a.x b.x c.x| |a.y b.y c.y| |a.z b.z c.z|
Vectors are treated as columns, so the vector v is
|x| |y| |z|
And matrices are applied before the vector (pre-multiplication) v' = M*v
|x'| |a.x b.x c.x| |x| |a.x*x + b.x*y + c.x*z| |y'| = |a.y b.y c.y| * |y| = |a.y*x + b.y*y + c.y*z| |z'| |a.z b.z c.z| |z| |a.z*x + b.z*y + c.z*z|
Physical storage and indexing: To be compatible with popular 3d rendering APIs (read D3d and OpenGL) the physical indexing is
|0 3 6| |1 4 7| |2 5 8|
index = column*3 + row
which in C++ translates to M[column][row]
The mathematical indexing is M_row,column and this is what is used for _-notation so _12 is 1st row, second column and operator(row, column)!
|
inline |
Default constructor.
|
inline |
identity constructor
References PX_UNUSED().
|
inline |
zero constructor
References PX_UNUSED().
|
inline |
Construct from three base vectors.
|
inlineexplicit |
constructor from a scalar, which generates a multiple of the identity matrix
|
inlineexplicit |
Construct from float[9].
|
inlineexplicit |
|
inline |
Copy constructor.
|
inlinestatic |
|
inlinestatic |
References PxIdentity.
|
inlinestatic |
References PxZero.
|
inline |
|
inline |
Get determinant.
|
inline |
|
inline |
Get transposed matrix.
Referenced by PxMeshScale::toMat33().
|
inline |
Element access, mathematical way!
|
inline |
Element access, mathematical way!
|
inline |
Scalar multiplication.
|
inline |
Matrix vector multiplication (returns 'this->transform(vec)')
|
inline |
|
inline |
Equals scalar multiplication.
|
inline |
Equals matrix multiplication.
|
inline |
|
inline |
|
inline |
Unary minus.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Transform vector by matrix transpose, v' = M^t*v.
PxVec3 PxMat33::column0 |
Referenced by PxBounds3::basisExtent(), getInverse(), operator*(), operator+(), operator+=(), operator-(), operator-=(), operator=(), operator==(), and PxMeshScale::toMat33().
PxVec3 PxMat33::column1 |
Referenced by PxBounds3::basisExtent(), getInverse(), operator*(), operator+(), operator+=(), operator-(), operator-=(), operator=(), operator==(), and PxMeshScale::toMat33().
PxVec3 PxMat33::column2 |
Referenced by PxBounds3::basisExtent(), getInverse(), operator*(), operator+(), operator+=(), operator-(), operator-=(), operator=(), operator==(), and PxMeshScale::toMat33().