Kochol Game Engine  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
kge::math::Matrix Class Reference

#include <Matrix.h>

Public Member Functions

 Matrix ()
 Constructor: Identity the matrix.
 Matrix (float *f)
 Sazande ba float*.
 Matrix (float f11, float f12, float f13, float f14, float f21, float f22, float f23, float f24, float f31, float f32, float f33, float f34, float f41, float f42, float f43, float f44)
 sazande ba 16 ta float
void Identity ()
 make identity matrix
float operator[] (u32 i) const
bool Inverse ()
 Makes the inverse of this matrix.
bool GetInverse (Matrix &m)
 Create the inverse of this matrix.
const Matrix operator* (const Matrix &m) const
 Zarb do ta matrix dar ham.
Matrixoperator*= (const Matrix &m)
 Zarb do ta matrix dar ham.
Vector operator* (const Vector &v) const
 Tranform a vector with this matrix.
float & operator() (int row, int col)
void Translate (float dx, float dy, float dz)
 Baraye jabe jaee noghat az in estefade mishe.
void RotY (float angle)
 Chrkhesh dore mehvare Y ha.
void Set (float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34, float m41, float m42, float m43, float m44)
 Sets matrix elements.
void SetRotation (const gfx::Vertex3 *v3)
 Build a rotation matrix.
void SetRotation (const float *f)
 Build a rotation matrix.
void SetTranslation (const gfx::Vertex3 *v3)
 Set the translation values of the matrix.
Vector GetTranslation ()
 Get the translation values from the matrix.
void SetTranslation (const float *f)
 Set the translation values of the matrix.
void SetScale (const math::Vector &v)
 Set the scale values of the matrix.
void TransformSphere (const Sphere &sphere, Sphere &result) const
 Transform a sphere.
void TransformBox (const AABB &box, AABB &result) const
 Transform an AABB.
void TransformBox2 (const AABB &box, AABB &result) const
 Transform an AABB.
void InverseTranslateVec (gfx::Vertex3 &v3) const
 Translate a vector based on the inverse matrix.
void InverseRotateVec (gfx::Vertex3 &v3) const
 Rotate a vector using the inverse of the matrix.
void InverseTranslateVec (Vector &v3) const
 Translate a vector based on the inverse matrix.
void InverseRotateVec (Vector &v3) const
 Rotate a vector using the inverse of the matrix.
void TranslateVec (Vector &v3) const
 Translate a vector using this matrix.
void RotateVec (Vector &v3) const
 Rotate a vector using this matrix.
void TransFormVec (Vector &v3) const
 Transform a vector using this matrix.
void TransFormVec2 (Vector &v3) const
 Transform a vector using this matrix.
void TransFormVec2 (gfx::Vertex3 &v3) const
 Transform a vector using this matrix.
void TransFormVec2 (gfx::Vertex3 *v3Out, gfx::Vertex3 *vIn, int size) const
 Transform a vector using this matrix.
void Transform2DVec (kge::gfx::Vertex2 &v2) const
 Transform.
const void operator= (const Matrix &rMat)
 Copy operator.
void SetOrthoLH (float width, float height, float znear, float zfar)
 makes this a left handed Orthogonal projection matrix
void SetOrthoOffscreenLH (float minx, float maxx, float miny, float maxy, float znear, float zfar)
 makes this a left handed Orthogonal projection matrix
void SetPerspectiveLH (float width, float height, float Fov, float Near, float Far)
 Sets the left hand perspective projection matrix.
void SetViewLookatLH (math::Vector &vPos, math::Vector &vPoint, math::Vector &vUp)
 Create a view look at matrix.
void Get4x3Matrix (float *pOut)

Public Attributes

union {
   float   m_fMat [16]
   struct {
      float   _11
      float   _12
      float   _13
      float   _14
      float   _21
      float   _22
      float   _23
      float   _24
      float   _31
      float   _32
      float   _33
      float   _34
      float   _41
      float   _42
      float   _43
      float   _44
   } 
}; 

Detailed Description

Definition at line 29 of file Matrix.h.

Constructor & Destructor Documentation

kge::math::Matrix::Matrix ( )
inline

Constructor: Identity the matrix.

Definition at line 47 of file Matrix.h.

kge::math::Matrix::Matrix ( float *  f)

Sazande ba float*.

kge::math::Matrix::Matrix ( float  f11,
float  f12,
float  f13,
float  f14,
float  f21,
float  f22,
float  f23,
float  f24,
float  f31,
float  f32,
float  f33,
float  f34,
float  f41,
float  f42,
float  f43,
float  f44 
)

sazande ba 16 ta float

Member Function Documentation

void kge::math::Matrix::Get4x3Matrix ( float *  pOut)
bool kge::math::Matrix::GetInverse ( Matrix m)

Create the inverse of this matrix.

Vector kge::math::Matrix::GetTranslation ( )

Get the translation values from the matrix.

void kge::math::Matrix::Identity ( )
inline

make identity matrix

Definition at line 64 of file Matrix.h.

bool kge::math::Matrix::Inverse ( )

Makes the inverse of this matrix.

Referenced by kge::math::Ray::TransformRayInverse().

void kge::math::Matrix::InverseRotateVec ( gfx::Vertex3 v3) const

Rotate a vector using the inverse of the matrix.

void kge::math::Matrix::InverseRotateVec ( Vector v3) const

Rotate a vector using the inverse of the matrix.

void kge::math::Matrix::InverseTranslateVec ( gfx::Vertex3 v3) const

Translate a vector based on the inverse matrix.

void kge::math::Matrix::InverseTranslateVec ( Vector v3) const

Translate a vector based on the inverse matrix.

float& kge::math::Matrix::operator() ( int  row,
int  col 
)
inline

Definition at line 90 of file Matrix.h.

const Matrix kge::math::Matrix::operator* ( const Matrix m) const

Zarb do ta matrix dar ham.

Vector kge::math::Matrix::operator* ( const Vector v) const

Tranform a vector with this matrix.

Matrix& kge::math::Matrix::operator*= ( const Matrix m)

Zarb do ta matrix dar ham.

const void kge::math::Matrix::operator= ( const Matrix rMat)

Copy operator.

float kge::math::Matrix::operator[] ( u32  i) const
inline

Definition at line 70 of file Matrix.h.

void kge::math::Matrix::RotateVec ( Vector v3) const

Rotate a vector using this matrix.

Referenced by kge::math::Ray::TransformRayInverse().

void kge::math::Matrix::RotY ( float  angle)

Chrkhesh dore mehvare Y ha.

void kge::math::Matrix::Set ( float  m11,
float  m12,
float  m13,
float  m14,
float  m21,
float  m22,
float  m23,
float  m24,
float  m31,
float  m32,
float  m33,
float  m34,
float  m41,
float  m42,
float  m43,
float  m44 
)

Sets matrix elements.

void kge::math::Matrix::SetOrthoLH ( float  width,
float  height,
float  znear,
float  zfar 
)

makes this a left handed Orthogonal projection matrix

void kge::math::Matrix::SetOrthoOffscreenLH ( float  minx,
float  maxx,
float  miny,
float  maxy,
float  znear,
float  zfar 
)

makes this a left handed Orthogonal projection matrix

void kge::math::Matrix::SetPerspectiveLH ( float  width,
float  height,
float  Fov,
float  Near,
float  Far 
)

Sets the left hand perspective projection matrix.

void kge::math::Matrix::SetRotation ( const gfx::Vertex3 v3)

Build a rotation matrix.

void kge::math::Matrix::SetRotation ( const float *  f)

Build a rotation matrix.

void kge::math::Matrix::SetScale ( const math::Vector v)

Set the scale values of the matrix.

void kge::math::Matrix::SetTranslation ( const gfx::Vertex3 v3)

Set the translation values of the matrix.

void kge::math::Matrix::SetTranslation ( const float *  f)

Set the translation values of the matrix.

void kge::math::Matrix::SetViewLookatLH ( math::Vector vPos,
math::Vector vPoint,
math::Vector vUp 
)

Create a view look at matrix.

void kge::math::Matrix::Transform2DVec ( kge::gfx::Vertex2 v2) const

Transform.

Transform a 2D vector

void kge::math::Matrix::TransformBox ( const AABB box,
AABB result 
) const

Transform an AABB.

void kge::math::Matrix::TransformBox2 ( const AABB box,
AABB result 
) const

Transform an AABB.

void kge::math::Matrix::TransformSphere ( const Sphere sphere,
Sphere result 
) const

Transform a sphere.

void kge::math::Matrix::TransFormVec ( Vector v3) const
inline

Transform a vector using this matrix.

Definition at line 150 of file Matrix.h.

References kge::math::Vector::x, kge::math::Vector::y, and kge::math::Vector::z.

void kge::math::Matrix::TransFormVec2 ( Vector v3) const

Transform a vector using this matrix.

void kge::math::Matrix::TransFormVec2 ( gfx::Vertex3 v3) const

Transform a vector using this matrix.

void kge::math::Matrix::TransFormVec2 ( gfx::Vertex3 v3Out,
gfx::Vertex3 vIn,
int  size 
) const

Transform a vector using this matrix.

void kge::math::Matrix::Translate ( float  dx,
float  dy,
float  dz 
)

Baraye jabe jaee noghat az in estefade mishe.

void kge::math::Matrix::TranslateVec ( Vector v3) const

Translate a vector using this matrix.

Referenced by kge::math::Ray::TransformRayInverse().

Member Data Documentation

union { ... }
float kge::math::Matrix::_11

Definition at line 39 of file Matrix.h.

float kge::math::Matrix::_12

Definition at line 39 of file Matrix.h.

float kge::math::Matrix::_13

Definition at line 39 of file Matrix.h.

float kge::math::Matrix::_14

Definition at line 39 of file Matrix.h.

float kge::math::Matrix::_21

Definition at line 40 of file Matrix.h.

float kge::math::Matrix::_22

Definition at line 40 of file Matrix.h.

float kge::math::Matrix::_23

Definition at line 40 of file Matrix.h.

float kge::math::Matrix::_24

Definition at line 40 of file Matrix.h.

float kge::math::Matrix::_31

Definition at line 41 of file Matrix.h.

float kge::math::Matrix::_32

Definition at line 41 of file Matrix.h.

float kge::math::Matrix::_33

Definition at line 41 of file Matrix.h.

float kge::math::Matrix::_34

Definition at line 41 of file Matrix.h.

float kge::math::Matrix::_41

Definition at line 42 of file Matrix.h.

float kge::math::Matrix::_42

Definition at line 42 of file Matrix.h.

float kge::math::Matrix::_43

Definition at line 42 of file Matrix.h.

float kge::math::Matrix::_44

Definition at line 42 of file Matrix.h.

float kge::math::Matrix::m_fMat[16]

The documentation for this class was generated from the following file: