#include <spDimensionMatrix4.hpp>
Public Member Functions | |
matrix4 () | |
matrix4 (const T(&Other)[16]) | |
matrix4 (const matrix4< T > &Other) | |
matrix4 (const matrix3< T > &Other) | |
matrix4 (const obbox3d< T > &Box) | |
matrix4 (T m1n1, T m2n1, T m3n1, T m4n1, T m1n2, T m2n2, T m3n2, T m4n2, T m1n3, T m2n3, T m3n3, T m4n3, T m1n4, T m2n4, T m3n4, T m4n4) | |
matrix4 (const vector4d< T > &XDirection, const vector4d< T > &YDirection, const vector4d< T > &ZDirection, const vector4d< T > &Position) | |
~matrix4 () | |
const T | operator() (u32 row, u32 col) const |
T & | operator() (u32 row, u32 col) |
const T | operator[] (u32 i) const |
Returns the matrix component value at the specified offset (or rather index) 'i'. | |
T & | operator[] (u32 i) |
bool | operator== (const matrix4< T > &Other) |
bool | operator!= (const matrix4< T > &Other) |
matrix4< T > & | operator= (const T(&Other)[16]) |
matrix4< T > & | operator= (const matrix4< T > &Other) |
matrix4< T > & | operator= (T Scalar) |
matrix4< T > | operator+ (const matrix4< T > &mltMatrix) const |
matrix4< T > & | operator+= (const matrix4< T > &mltMatrix) |
matrix4< T > | operator- (const matrix4< T > &mltMatrix) const |
matrix4< T > & | operator-= (const matrix4< T > &mltMatrix) |
matrix4< T > | operator* (const matrix4< T > &mltMatrix) const |
matrix4< T > | operator* (T Scalar) const |
matrix4< T > & | operator*= (const matrix4< T > &mltMatrix) |
matrix4< T > & | operator*= (T Scalar) |
vector3d< T > | operator* (const vector3d< T > &Vector) const |
point2d< T > | operator* (const point2d< T > &Vector) const |
triangle3d< T > | operator* (const triangle3d< T > &Triangle) const |
triangle3d< T > | operator* (const triangle3d< T, vector3d< T > * > &Triangle) const |
plane3d< T > | operator* (const plane3d< T > &Plane) const |
obbox3d< T > | operator* (const obbox3d< T > &Box) const |
line3d< T > | operator* (const line3d< T > &Line) const |
point2d< T > | vecRotate (const point2d< T > &Vector) const |
Returns the rotated specified vector. i.e. the vector will be multiplied with the 2x2 matrix. | |
point2d< T > | vecRotateInverse (const point2d< T > &Vector) const |
Returns the rotated specified vector. i.e. the vector will be multiplied with the inversed 2x2 matrix. | |
vector3d< T > | vecRotate (const vector3d< T > &Vector) const |
Returns the rotated specified vector. i.e. the vector will be multiplied with the 3x3 matrix. | |
vector3d< T > | vecRotateInverse (const vector3d< T > &Vector) const |
Returns the inverse rotated specified vector. i.e. the vector will be multiplied with the inversed 3x3 matrix. | |
void | clear () |
Clear the matrix. i.e. each component is set to 0. | |
matrix4< T > & | reset () |
matrix4< T > & | reset (const vector3d< T > &InitPosition, const vector3d< T > &InitScale=T(1)) |
void | multiplySingleMatrix (const T(&Other)[4]) |
Multiplies this matrix with a 1x4 matrix. | |
void | matrixLookAt (const vector3d< T > &Position, const vector3d< T > &LookAt, const vector3d< T > &upVector) |
bool | getInverse (matrix4< T > &InverseMat) const |
bool | setInverse () |
matrix4< T > | getInverse () const |
matrix4< T > & | translate (const vector3d< T > &Vector) |
matrix4< T > & | scale (const vector3d< T > &Vector) |
matrix4< T > & | rotate (const T Angle, vector3d< T > Rotation) |
matrix4< T > & | rotateX (const T Angle) |
matrix4< T > & | rotateY (const T Angle) |
matrix4< T > & | rotateZ (const T Angle) |
void | rotateYXZ (const vector3df &Rotation) |
void | rotateZXY (const vector3df &Rotation) |
void | setRotation (vector3d< T > Rotation, bool UseDegrees=true) |
void | setInverseRotation (vector3df Rotation, bool UseDegrees=true) |
void | setTextureRotation (const T &Degree) |
void | setPerspectiveLH (T FieldOfView, T Aspect, T Near, T Far) |
void | setPerspectiveRH (T FieldOfView, T Aspect, T Near, T Far) |
void | setOrthoLH (T Left, T Right, T Top, T Bottom, T Near, T Far) |
void | setOrthoRH (T Left, T Right, T Top, T Bottom, T Near, T Far) |
void | make2Dimensional (s32 Width, s32 Height, s32 ScreenWidth, s32 ScreenHeight) |
void | makeViewport (const rect2di &Viewport, const f32 DepthScale=1.0f) |
vector4d< T > | getRow (s32 Position) const |
void | setRow (s32 Position, const vector4d< T > &Vec) |
vector4d< T > | getColumn (s32 Position) const |
void | setColumn (s32 Position, const vector4d< T > &Vec) |
void | setPosition (const vector3d< T > &Position) |
vector3d< T > | getPosition () const |
void | setScale (const vector3d< T > &Scale) |
vector3d< T > | getScale () const |
Returns the matrix scaling vector. | |
vector3d< T > | getRotation () const |
matrix4< T > | getRotationMatrix () const |
matrix4< T > | getPositionMatrix () const |
matrix4< T > | getPositionScaleMatrix () const |
matrix4< T > | getPositionRotationMatrix () const |
matrix4< T > | getTransposed () const |
void | getTransposed (matrix4< T > &Other) const |
matrix4< T > | getTextureMatrix () const |
matrix4< T > | interpolate (const matrix4< T > &Other, f32 seek) const |
bool | isIdentity () const |
bool | equal (const matrix4< T > &Other) const |
const T * | getArray () const |
T * | getArray () |
matrix3< T > | get3x3 () const |
matrix2< T > | get2x2 () const |
template<typename B > | |
matrix4< B > | cast () const |
Static Public Member Functions | |
static vector3d< T > | getProjection (const vector3d< T > ObjectPosition, const rect2di &Viewport, const matrix4< T > &ProjectionMatrix, const matrix4< T > &ModelviewMatrix) |
Public Attributes | |
T | M [16] |
The matrix memory buffer. | |
Static Public Attributes | |
static const matrix4< T > | IDENTITY |
Identity 4x4 matrix. |
This is the 4x4 matrix class. The engine uses left-handed coordinate systems and the matrix data is stored in the following form:
// Vectors: // x y z w // / 0 4 8 12 \ // | 1 5 9 13 | // | 2 6 10 14 | // \ 3 7 11 15 /
A matrix has by default its identity where the member 0, 5, 10 and 15 have a value of 1.0 and all the others 0.0.
sp::dim::matrix4< T >::matrix4 | ( | ) | [inline] |
sp::dim::matrix4< T >::matrix4 | ( | const T(&) | Other[16] | ) | [inline] |
sp::dim::matrix4< T >::matrix4 | ( | const matrix4< T > & | Other | ) | [inline] |
sp::dim::matrix4< T >::matrix4 | ( | const matrix3< T > & | Other | ) |
sp::dim::matrix4< T >::matrix4 | ( | const obbox3d< T > & | Box | ) | [inline] |
sp::dim::matrix4< T >::matrix4 | ( | T | m1n1, | |
T | m2n1, | |||
T | m3n1, | |||
T | m4n1, | |||
T | m1n2, | |||
T | m2n2, | |||
T | m3n2, | |||
T | m4n2, | |||
T | m1n3, | |||
T | m2n3, | |||
T | m3n3, | |||
T | m4n3, | |||
T | m1n4, | |||
T | m2n4, | |||
T | m3n4, | |||
T | m4n4 | |||
) | [inline] |
sp::dim::matrix4< T >::matrix4 | ( | const vector4d< T > & | XDirection, | |
const vector4d< T > & | YDirection, | |||
const vector4d< T > & | ZDirection, | |||
const vector4d< T > & | Position | |||
) | [inline] |
sp::dim::matrix4< T >::~matrix4 | ( | ) | [inline] |
matrix4<B> sp::dim::matrix4< T >::cast | ( | ) | const [inline] |
void sp::dim::matrix4< T >::clear | ( | ) | [inline] |
Clear the matrix. i.e. each component is set to 0.
bool sp::dim::matrix4< T >::equal | ( | const matrix4< T > & | Other | ) | const [inline] |
matrix2<T> sp::dim::matrix4< T >::get2x2 | ( | ) | const [inline] |
matrix3<T> sp::dim::matrix4< T >::get3x3 | ( | ) | const [inline] |
T* sp::dim::matrix4< T >::getArray | ( | ) | [inline] |
const T* sp::dim::matrix4< T >::getArray | ( | ) | const [inline] |
vector4d<T> sp::dim::matrix4< T >::getColumn | ( | s32 | Position | ) | const [inline] |
bool sp::dim::matrix4< T >::getInverse | ( | matrix4< T > & | InverseMat | ) | const [inline] |
matrix4<T> sp::dim::matrix4< T >::getInverse | ( | ) | const [inline] |
vector3d<T> sp::dim::matrix4< T >::getPosition | ( | ) | const [inline] |
matrix4<T> sp::dim::matrix4< T >::getPositionMatrix | ( | ) | const [inline] |
matrix4<T> sp::dim::matrix4< T >::getPositionRotationMatrix | ( | ) | const [inline] |
matrix4<T> sp::dim::matrix4< T >::getPositionScaleMatrix | ( | ) | const [inline] |
static vector3d<T> sp::dim::matrix4< T >::getProjection | ( | const vector3d< T > | ObjectPosition, | |
const rect2di & | Viewport, | |||
const matrix4< T > & | ProjectionMatrix, | |||
const matrix4< T > & | ModelviewMatrix | |||
) | [inline, static] |
vector3d<T> sp::dim::matrix4< T >::getRotation | ( | ) | const [inline] |
matrix4<T> sp::dim::matrix4< T >::getRotationMatrix | ( | ) | const [inline] |
vector4d<T> sp::dim::matrix4< T >::getRow | ( | s32 | Position | ) | const [inline] |
vector3d<T> sp::dim::matrix4< T >::getScale | ( | ) | const [inline] |
Returns the matrix scaling vector.
matrix4<T> sp::dim::matrix4< T >::getTextureMatrix | ( | ) | const [inline] |
matrix4<T> sp::dim::matrix4< T >::getTransposed | ( | ) | const [inline] |
void sp::dim::matrix4< T >::getTransposed | ( | matrix4< T > & | Other | ) | const [inline] |
matrix4<T> sp::dim::matrix4< T >::interpolate | ( | const matrix4< T > & | Other, | |
f32 | seek | |||
) | const [inline] |
bool sp::dim::matrix4< T >::isIdentity | ( | ) | const [inline] |
void sp::dim::matrix4< T >::make2Dimensional | ( | s32 | Width, | |
s32 | Height, | |||
s32 | ScreenWidth, | |||
s32 | ScreenHeight | |||
) | [inline] |
void sp::dim::matrix4< T >::makeViewport | ( | const rect2di & | Viewport, | |
const f32 | DepthScale = 1.0f | |||
) | [inline] |
void sp::dim::matrix4< T >::matrixLookAt | ( | const vector3d< T > & | Position, | |
const vector3d< T > & | LookAt, | |||
const vector3d< T > & | upVector | |||
) | [inline] |
void sp::dim::matrix4< T >::multiplySingleMatrix | ( | const T(&) | Other[4] | ) | [inline] |
Multiplies this matrix with a 1x4 matrix.
bool sp::dim::matrix4< T >::operator!= | ( | const matrix4< T > & | Other | ) | [inline] |
const T sp::dim::matrix4< T >::operator() | ( | u32 | row, | |
u32 | col | |||
) | const [inline] |
row,: | Row of the wanted component in the range [0 .. 3]. | |
col,: | Column of the wanted component in the range [0 .. 3]. |
T& sp::dim::matrix4< T >::operator() | ( | u32 | row, | |
u32 | col | |||
) | [inline] |
vector3d<T> sp::dim::matrix4< T >::operator* | ( | const vector3d< T > & | Vector | ) | const [inline] |
point2d<T> sp::dim::matrix4< T >::operator* | ( | const point2d< T > & | Vector | ) | const [inline] |
triangle3d<T> sp::dim::matrix4< T >::operator* | ( | const triangle3d< T > & | Triangle | ) | const [inline] |
triangle3d<T> sp::dim::matrix4< T >::operator* | ( | const triangle3d< T, vector3d< T > * > & | Triangle | ) | const [inline] |
plane3d<T> sp::dim::matrix4< T >::operator* | ( | const plane3d< T > & | Plane | ) | const [inline] |
obbox3d<T> sp::dim::matrix4< T >::operator* | ( | const obbox3d< T > & | Box | ) | const [inline] |
line3d<T> sp::dim::matrix4< T >::operator* | ( | const line3d< T > & | Line | ) | const [inline] |
matrix4<T> sp::dim::matrix4< T >::operator* | ( | const matrix4< T > & | mltMatrix | ) | const [inline] |
matrix4<T> sp::dim::matrix4< T >::operator* | ( | T | Scalar | ) | const [inline] |
matrix4<T>& sp::dim::matrix4< T >::operator*= | ( | T | Scalar | ) | [inline] |
matrix4<T>& sp::dim::matrix4< T >::operator*= | ( | const matrix4< T > & | mltMatrix | ) | [inline] |
matrix4<T> sp::dim::matrix4< T >::operator+ | ( | const matrix4< T > & | mltMatrix | ) | const [inline] |
matrix4<T>& sp::dim::matrix4< T >::operator+= | ( | const matrix4< T > & | mltMatrix | ) | [inline] |
matrix4<T> sp::dim::matrix4< T >::operator- | ( | const matrix4< T > & | mltMatrix | ) | const [inline] |
matrix4<T>& sp::dim::matrix4< T >::operator-= | ( | const matrix4< T > & | mltMatrix | ) | [inline] |
matrix4<T>& sp::dim::matrix4< T >::operator= | ( | const matrix4< T > & | Other | ) | [inline] |
matrix4<T>& sp::dim::matrix4< T >::operator= | ( | const T(&) | Other[16] | ) | [inline] |
matrix4<T>& sp::dim::matrix4< T >::operator= | ( | T | Scalar | ) | [inline] |
bool sp::dim::matrix4< T >::operator== | ( | const matrix4< T > & | Other | ) | [inline] |
T& sp::dim::matrix4< T >::operator[] | ( | u32 | i | ) | [inline] |
const T sp::dim::matrix4< T >::operator[] | ( | u32 | i | ) | const [inline] |
Returns the matrix component value at the specified offset (or rather index) 'i'.
matrix4<T>& sp::dim::matrix4< T >::reset | ( | ) | [inline] |
Loads the matrix's identity.
( 1 0 0 0 ) | 0 1 0 0 | | 0 0 1 0 | ( 0 0 0 1 )
matrix4<T>& sp::dim::matrix4< T >::reset | ( | const vector3d< T > & | InitPosition, | |
const vector3d< T > & | InitScale = T(1) | |||
) | [inline] |
Loads the matrix's identity and sets an initial position (xyz) and scaling (whp).
( w 0 0 x ) | 0 h 0 y | | 0 0 d z | ( 0 0 0 1 )
matrix4<T>& sp::dim::matrix4< T >::rotate | ( | const T | Angle, | |
vector3d< T > | Rotation | |||
) | [inline] |
matrix4<T>& sp::dim::matrix4< T >::rotateX | ( | const T | Angle | ) | [inline] |
matrix4<T>& sp::dim::matrix4< T >::rotateY | ( | const T | Angle | ) | [inline] |
void sp::dim::matrix4< T >::rotateYXZ | ( | const vector3df & | Rotation | ) | [inline] |
matrix4<T>& sp::dim::matrix4< T >::rotateZ | ( | const T | Angle | ) | [inline] |
void sp::dim::matrix4< T >::rotateZXY | ( | const vector3df & | Rotation | ) | [inline] |
matrix4<T>& sp::dim::matrix4< T >::scale | ( | const vector3d< T > & | Vector | ) | [inline] |
void sp::dim::matrix4< T >::setColumn | ( | s32 | Position, | |
const vector4d< T > & | Vec | |||
) | [inline] |
bool sp::dim::matrix4< T >::setInverse | ( | ) | [inline] |
void sp::dim::matrix4< T >::setInverseRotation | ( | vector3df | Rotation, | |
bool | UseDegrees = true | |||
) | [inline] |
void sp::dim::matrix4< T >::setOrthoLH | ( | T | Left, | |
T | Right, | |||
T | Top, | |||
T | Bottom, | |||
T | Near, | |||
T | Far | |||
) | [inline] |
void sp::dim::matrix4< T >::setOrthoRH | ( | T | Left, | |
T | Right, | |||
T | Top, | |||
T | Bottom, | |||
T | Near, | |||
T | Far | |||
) | [inline] |
void sp::dim::matrix4< T >::setPerspectiveLH | ( | T | FieldOfView, | |
T | Aspect, | |||
T | Near, | |||
T | Far | |||
) | [inline] |
void sp::dim::matrix4< T >::setPerspectiveRH | ( | T | FieldOfView, | |
T | Aspect, | |||
T | Near, | |||
T | Far | |||
) | [inline] |
void sp::dim::matrix4< T >::setPosition | ( | const vector3d< T > & | Position | ) | [inline] |
void sp::dim::matrix4< T >::setRotation | ( | vector3d< T > | Rotation, | |
bool | UseDegrees = true | |||
) | [inline] |
void sp::dim::matrix4< T >::setRow | ( | s32 | Position, | |
const vector4d< T > & | Vec | |||
) | [inline] |
void sp::dim::matrix4< T >::setScale | ( | const vector3d< T > & | Scale | ) | [inline] |
void sp::dim::matrix4< T >::setTextureRotation | ( | const T & | Degree | ) | [inline] |
matrix4<T>& sp::dim::matrix4< T >::translate | ( | const vector3d< T > & | Vector | ) | [inline] |
point2d<T> sp::dim::matrix4< T >::vecRotate | ( | const point2d< T > & | Vector | ) | const [inline] |
Returns the rotated specified vector. i.e. the vector will be multiplied with the 2x2 matrix.
vector3d<T> sp::dim::matrix4< T >::vecRotate | ( | const vector3d< T > & | Vector | ) | const [inline] |
Returns the rotated specified vector. i.e. the vector will be multiplied with the 3x3 matrix.
point2d<T> sp::dim::matrix4< T >::vecRotateInverse | ( | const point2d< T > & | Vector | ) | const [inline] |
Returns the rotated specified vector. i.e. the vector will be multiplied with the inversed 2x2 matrix.
vector3d<T> sp::dim::matrix4< T >::vecRotateInverse | ( | const vector3d< T > & | Vector | ) | const [inline] |
Returns the inverse rotated specified vector. i.e. the vector will be multiplied with the inversed 3x3 matrix.
const matrix4< T > sp::dim::matrix4< T >::IDENTITY [static] |
Identity 4x4 matrix.
T sp::dim::matrix4< T >::M[16] |
The matrix memory buffer.