Drag[en]gine Game Engine  1.21
decTexMatrix2 Class Reference

3x2 component texture matrix in row major order. More...

#include <decTexMatrix2.h>

Public Member Functions

Constructors and Destructors
 decTexMatrix2 ()
 Create identity matrix. More...
 
Management
void SetIdentity ()
 Set identity matrix. More...
 
void SetTranslation (float u, float v)
 Set translation matrix. More...
 
void SetTranslation (const decVector2 &translation)
 Set translation matrix. More...
 
void SetScale (float su, float sv)
 Set scaling matrix. More...
 
void SetScale (const decVector2 &scaling)
 Set scaling matrix. More...
 
void SetRotation (float rotation)
 Set rotation matrix. More...
 
void SetShear (float shearU, float shearV)
 Set shear matrix. More...
 
void SetShear (const decVector2 &shear)
 Set shear matrix. More...
 
void SetST (float su, float sv, float tu, float tv)
 Set scale-translation matrix. More...
 
void SetST (const decVector2 &scaling, const decVector2 &translation)
 Set scale-translation matrix. More...
 
void SetSRT (float su, float sv, float rotation, float tu, float tv)
 Set scale-rotation-translation matrix. More...
 
void SetSRT (const decVector2 &scaling, float rotation, const decVector2 &translation)
 Set scale-rotation-translation matrix. More...
 
void SetCenterSRT (float su, float sv, float rotation, float tu, float tv)
 Set scale-rotation-translation matrix. More...
 
void SetCenterSRT (const decVector2 &scaling, float rotation, const decVector2 &translation)
 Set center scale-rotation-translation matrix. More...
 
bool IsEqualTo (const decTexMatrix2 &matrix, float threshold=TEXEL_THRESHOLD) const
 Determines if this matrix is cell wise equal to anither one in respect to a threshold. More...
 
float Determinant () const
 Determinant. More...
 
decTexMatrix Invert () const
 Inverse of matrix. More...
 
decTexMatrix ToTexMatrix () const
 Convert to 3x3 texture matrix. More...
 
decVector2 GetPosition () const
 Position part of matrix. More...
 
decVector2 GetAxisX () const
 X axis part of matrix. More...
 
decVector2 GetAxisY () const
 Y axis part of matrix. More...
 
decVector2 GetScaling () const
 Scaling of X and Y axis. More...
 
float GetRotation () const
 Rotation in degrees. More...
 
float GetShearing () const
 Shearing in X direction. More...
 
decTexMatrix2 GetRotationMatrix () const
 Rotation part of matrix. More...
 
Operators
decTexMatrix2operator= (const decTexMatrix2 &m)
 Set cells of this matrix to the values of another one. More...
 
decTexMatrix2operator+= (const decTexMatrix2 &m)
 Add cells of another matrix to this one. More...
 
decTexMatrix2operator-= (const decTexMatrix2 &m)
 Subtract cells of another matrix from this vector. More...
 
decTexMatrix2operator*= (float k)
 Multiply cells of this matrix with a value k. More...
 
decTexMatrix2operator/= (float k)
 Divide cells of this matrix by a value k. If the value k is 0 an exception is thrown. More...
 
decTexMatrix2operator*= (const decTexMatrix2 &m)
 Multiply matrix with another one. More...
 
decTexMatrix2 operator+ (const decTexMatrix2 &m) const
 Matrix with the sum of this matrix with another one. More...
 
decTexMatrix2 operator- (const decTexMatrix2 &m) const
 Matrix with the difference of this matrix to another one. More...
 
decTexMatrix2 operator* (float k) const
 Matrix with this matrix scaled by k. More...
 
decTexMatrix2 operator/ (float k) const
 Matrix with this matrix divided by k. If k is 0 an exception is thrown. More...
 
decTexMatrix2 operator* (const decTexMatrix2 &m) const
 Matrix with this matrix multiplied with another one. More...
 
decVector2 operator* (const decVector2 &v) const
 Transform vector by this matrix. More...
 

Static Public Member Functions

Matrix Creation
static decTexMatrix2 CreateIdentity ()
 Create identity matrix. More...
 
static decTexMatrix2 CreateTranslation (float u, float v)
 Create translation matrix. More...
 
static decTexMatrix2 CreateTranslation (const decVector2 &translation)
 Create translation matrix. More...
 
static decTexMatrix2 CreateScale (float su, float sv)
 Create scaling matrix. More...
 
static decTexMatrix2 CreateScale (const decVector2 &scaling)
 Create scaling matrix. More...
 
static decTexMatrix2 CreateRotation (float rotation)
 Create rotation matrix. More...
 
static decTexMatrix2 CreateShear (float shearU, float shearV)
 Create shear matrix. More...
 
static decTexMatrix2 CreateShear (const decVector2 &shear)
 Create shear matrix. More...
 
static decTexMatrix2 CreateST (float su, float sv, float tu, float tv)
 Create scale-translation matrix. More...
 
static decTexMatrix2 CreateST (const decVector2 &scaling, const decVector2 &translation)
 Create scale-translation matrix. More...
 
static decTexMatrix2 CreateSRT (float su, float sv, float rotation, float tu, float tv)
 Create scale-rotation-translation matrix. More...
 
static decTexMatrix2 CreateSRT (const decVector2 &scaling, float rotation, const decVector2 &translation)
 Create scale-rotation-translation matrix. More...
 
static decTexMatrix2 CreateCenterSRT (float su, float sv, float rotation, float tu, float tv)
 Create center scale-rotation-translation matrix. More...
 
static decTexMatrix2 CreateCenterSRT (const decVector2 &scaling, float rotation, const decVector2 &translation)
 Create center scale-rotation-translation matrix. More...
 
static decTexMatrix2 CreateCenterRotation (float rotation)
 Create center rotation matrix. More...
 

Public Attributes

float a11
 
float a12
 
float a13
 
float a21
 
float a22
 
float a23
 

Detailed Description

3x2 component texture matrix in row major order.

Constructor & Destructor Documentation

◆ decTexMatrix2()

decTexMatrix2::decTexMatrix2 ( )

Create identity matrix.

Member Function Documentation

◆ CreateCenterRotation()

static decTexMatrix2 decTexMatrix2::CreateCenterRotation ( float  rotation)
static

Create center rotation matrix.

◆ CreateCenterSRT() [1/2]

static decTexMatrix2 decTexMatrix2::CreateCenterSRT ( const decVector2 scaling,
float  rotation,
const decVector2 translation 
)
static

Create center scale-rotation-translation matrix.

◆ CreateCenterSRT() [2/2]

static decTexMatrix2 decTexMatrix2::CreateCenterSRT ( float  su,
float  sv,
float  rotation,
float  tu,
float  tv 
)
static

Create center scale-rotation-translation matrix.

◆ CreateIdentity()

static decTexMatrix2 decTexMatrix2::CreateIdentity ( )
static

Create identity matrix.

◆ CreateRotation()

static decTexMatrix2 decTexMatrix2::CreateRotation ( float  rotation)
static

Create rotation matrix.

◆ CreateScale() [1/2]

static decTexMatrix2 decTexMatrix2::CreateScale ( const decVector2 scaling)
static

Create scaling matrix.

◆ CreateScale() [2/2]

static decTexMatrix2 decTexMatrix2::CreateScale ( float  su,
float  sv 
)
static

Create scaling matrix.

◆ CreateShear() [1/2]

static decTexMatrix2 decTexMatrix2::CreateShear ( const decVector2 shear)
static

Create shear matrix.

◆ CreateShear() [2/2]

static decTexMatrix2 decTexMatrix2::CreateShear ( float  shearU,
float  shearV 
)
static

Create shear matrix.

◆ CreateSRT() [1/2]

static decTexMatrix2 decTexMatrix2::CreateSRT ( const decVector2 scaling,
float  rotation,
const decVector2 translation 
)
static

Create scale-rotation-translation matrix.

◆ CreateSRT() [2/2]

static decTexMatrix2 decTexMatrix2::CreateSRT ( float  su,
float  sv,
float  rotation,
float  tu,
float  tv 
)
static

Create scale-rotation-translation matrix.

◆ CreateST() [1/2]

static decTexMatrix2 decTexMatrix2::CreateST ( const decVector2 scaling,
const decVector2 translation 
)
static

Create scale-translation matrix.

◆ CreateST() [2/2]

static decTexMatrix2 decTexMatrix2::CreateST ( float  su,
float  sv,
float  tu,
float  tv 
)
static

Create scale-translation matrix.

◆ CreateTranslation() [1/2]

static decTexMatrix2 decTexMatrix2::CreateTranslation ( const decVector2 translation)
static

Create translation matrix.

◆ CreateTranslation() [2/2]

static decTexMatrix2 decTexMatrix2::CreateTranslation ( float  u,
float  v 
)
static

Create translation matrix.

◆ Determinant()

float decTexMatrix2::Determinant ( ) const

Determinant.

◆ GetAxisX()

decVector2 decTexMatrix2::GetAxisX ( ) const

X axis part of matrix.

◆ GetAxisY()

decVector2 decTexMatrix2::GetAxisY ( ) const

Y axis part of matrix.

◆ GetPosition()

decVector2 decTexMatrix2::GetPosition ( ) const

Position part of matrix.

◆ GetRotation()

float decTexMatrix2::GetRotation ( ) const

Rotation in degrees.

◆ GetRotationMatrix()

decTexMatrix2 decTexMatrix2::GetRotationMatrix ( ) const

Rotation part of matrix.

Returns
Identity matrix with upper left 2x2 copied from this matrix.

◆ GetScaling()

decVector2 decTexMatrix2::GetScaling ( ) const

Scaling of X and Y axis.

◆ GetShearing()

float decTexMatrix2::GetShearing ( ) const

Shearing in X direction.

Due to rotation only X direction shearing can be retrieved. Y is 0.

◆ Invert()

decTexMatrix decTexMatrix2::Invert ( ) const

Inverse of matrix.

◆ IsEqualTo()

bool decTexMatrix2::IsEqualTo ( const decTexMatrix2 matrix,
float  threshold = TEXEL_THRESHOLD 
) const

Determines if this matrix is cell wise equal to anither one in respect to a threshold.

◆ operator*() [1/3]

decTexMatrix2 decTexMatrix2::operator* ( const decTexMatrix2 m) const

Matrix with this matrix multiplied with another one.

◆ operator*() [2/3]

decVector2 decTexMatrix2::operator* ( const decVector2 v) const

Transform vector by this matrix.

◆ operator*() [3/3]

decTexMatrix2 decTexMatrix2::operator* ( float  k) const

Matrix with this matrix scaled by k.

◆ operator*=() [1/2]

decTexMatrix2& decTexMatrix2::operator*= ( const decTexMatrix2 m)

Multiply matrix with another one.

◆ operator*=() [2/2]

decTexMatrix2& decTexMatrix2::operator*= ( float  k)

Multiply cells of this matrix with a value k.

◆ operator+()

decTexMatrix2 decTexMatrix2::operator+ ( const decTexMatrix2 m) const

Matrix with the sum of this matrix with another one.

◆ operator+=()

decTexMatrix2& decTexMatrix2::operator+= ( const decTexMatrix2 m)

Add cells of another matrix to this one.

◆ operator-()

decTexMatrix2 decTexMatrix2::operator- ( const decTexMatrix2 m) const

Matrix with the difference of this matrix to another one.

◆ operator-=()

decTexMatrix2& decTexMatrix2::operator-= ( const decTexMatrix2 m)

Subtract cells of another matrix from this vector.

◆ operator/()

decTexMatrix2 decTexMatrix2::operator/ ( float  k) const

Matrix with this matrix divided by k. If k is 0 an exception is thrown.

◆ operator/=()

decTexMatrix2& decTexMatrix2::operator/= ( float  k)

Divide cells of this matrix by a value k. If the value k is 0 an exception is thrown.

◆ operator=()

decTexMatrix2& decTexMatrix2::operator= ( const decTexMatrix2 m)

Set cells of this matrix to the values of another one.

◆ SetCenterSRT() [1/2]

void decTexMatrix2::SetCenterSRT ( const decVector2 scaling,
float  rotation,
const decVector2 translation 
)

Set center scale-rotation-translation matrix.

◆ SetCenterSRT() [2/2]

void decTexMatrix2::SetCenterSRT ( float  su,
float  sv,
float  rotation,
float  tu,
float  tv 
)

Set scale-rotation-translation matrix.

◆ SetIdentity()

void decTexMatrix2::SetIdentity ( )

Set identity matrix.

◆ SetRotation()

void decTexMatrix2::SetRotation ( float  rotation)

Set rotation matrix.

◆ SetScale() [1/2]

void decTexMatrix2::SetScale ( const decVector2 scaling)

Set scaling matrix.

◆ SetScale() [2/2]

void decTexMatrix2::SetScale ( float  su,
float  sv 
)

Set scaling matrix.

◆ SetShear() [1/2]

void decTexMatrix2::SetShear ( const decVector2 shear)

Set shear matrix.

◆ SetShear() [2/2]

void decTexMatrix2::SetShear ( float  shearU,
float  shearV 
)

Set shear matrix.

◆ SetSRT() [1/2]

void decTexMatrix2::SetSRT ( const decVector2 scaling,
float  rotation,
const decVector2 translation 
)

Set scale-rotation-translation matrix.

◆ SetSRT() [2/2]

void decTexMatrix2::SetSRT ( float  su,
float  sv,
float  rotation,
float  tu,
float  tv 
)

Set scale-rotation-translation matrix.

◆ SetST() [1/2]

void decTexMatrix2::SetST ( const decVector2 scaling,
const decVector2 translation 
)

Set scale-translation matrix.

◆ SetST() [2/2]

void decTexMatrix2::SetST ( float  su,
float  sv,
float  tu,
float  tv 
)

Set scale-translation matrix.

◆ SetTranslation() [1/2]

void decTexMatrix2::SetTranslation ( const decVector2 translation)

Set translation matrix.

◆ SetTranslation() [2/2]

void decTexMatrix2::SetTranslation ( float  u,
float  v 
)

Set translation matrix.

◆ ToTexMatrix()

decTexMatrix decTexMatrix2::ToTexMatrix ( ) const

Convert to 3x3 texture matrix.

Member Data Documentation

◆ a11

float decTexMatrix2::a11

◆ a12

float decTexMatrix2::a12

◆ a13

float decTexMatrix2::a13

◆ a21

float decTexMatrix2::a21

◆ a22

float decTexMatrix2::a22

◆ a23

float decTexMatrix2::a23

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