Drag[en]gine Game Engine  1.0
decMatrix Class Reference

4x4 Component Matrix. Provides matrix calculation on a 4x4 matrix in row major order. The coordinate system used by axis oriented creation functions is a left handed one. The X axis points to the right, the Y axis points up and the Z axis points into the screen. Rotations are always in counter clockwise orientation. Rotation angles are measured in radians. More...

#include <decMatrix.h>

Public Member Functions

Constructors and Destructors
 decMatrix ()
 
 decMatrix (const decMatrix &m)
 
 decMatrix (const decDMatrix &m)
 
Management
void SetIdentity ()
 
void SetTranslation (float x, float y, float z)
 
void SetTranslation (const decVector &t)
 
void SetScale (float sx, float sy, float sz)
 
void SetScale (const decVector &s)
 
void SetRotationX (float arc)
 
void SetRotationY (float arc)
 
void SetRotationZ (float arc)
 
void SetRotation (float rx, float ry, float rz)
 
void SetRotation (const decVector &r)
 
void SetRotationAxis (const decVector &axis, float angle)
 
void SetWorld (const decVector &pos, const decVector &view, const decVector &up)
 
void SetWorld (const decVector &pos, const decQuaternion &orientation)
 
void SetWorld (const decVector &pos, const decQuaternion &orientation, const decVector &scale)
 Set world space matrix. More...
 
void SetCamera (const decVector &pos, const decVector &view, const decVector &up)
 
void SetProjection (int width, int height, float fov, float fovRatio, float znear, float zfar)
 
void SetProjectionInfinite (int width, int height, float fov, float fovRatio, float znear)
 
void SetOrtho (int left, int right, int top, int bottom, int znear, int zfar)
 
void SetClipSpace ()
 
void SetBiasMatrix ()
 
void SetRT (const decVector &rot, const decVector &pos)
 
void SetSRT (const decVector &scale, const decVector &rot, const decVector &pos)
 
void SetSVUT (const decVector &scale, const decVector &view, const decVector &up, const decVector &pos)
 
void SetVU (const decVector &view, const decVector &up)
 
void SetFromQuaternion (const decQuaternion &q)
 
void SetFromQuaternion (const decQuaternion &q, const decVector &pivot)
 
float Determinant () const
 
decMatrix Invert () const
 
decVector GetEulerAngles () const
 
decQuaternion ToQuaternion () const
 
decVector GetPosition () const
 
decVector GetScale () const
 
decVector TransformView () const
 
decVector TransformRight () const
 
decVector TransformUp () const
 
decVector TransformNormal (const decVector &normal) const
 
decVector Transform (float x, float y, float z) const
 
decVector4 Transform (float x, float y, float z, float w) const
 
void Transform (decVector &result, float x, float y, float z) const
 
void Transform (decVector4 &result, float x, float y, float z, float w) const
 
decMatrix GetRotationMatrix () const
 
bool IsEqualTo (const decMatrix &matrix, float threshold=0.0001) const
 
Quick Calculations

Quick calculations are a special set of functions designed to work only with matrices which are non-projective. This kind of matrices have only a rotation part and a translation part. The entire last row has the values 0,0,0,1 . Those functions are the same as the non-quick versions with the difference that calculations are stripped out due to the last row beeing 0,0,0,1 . As the name suggests those functions are faster than the normal ones for projective matrices due to them having less calculations. Only use those functions if you know for sure that your matrices are of the described kind.

decMatrix QuickMultiply (const decMatrix &matrix) const
 
decMatrix QuickMultiply (float k) const
 
float QuickDeterminant () const
 
decMatrix QuickInvert () const
 
decMatrixQuickAddTo (const decMatrix &m)
 
Operators
decMatrixoperator= (const decMatrix &m)
 
decMatrixoperator+= (const decMatrix &m)
 
decMatrixoperator-= (const decMatrix &m)
 
decMatrixoperator*= (float k)
 
decMatrixoperator/= (float k)
 
decMatrixoperator*= (const decMatrix &m)
 
decMatrix operator+ (const decMatrix &m) const
 
decMatrix operator- (const decMatrix &m) const
 
decMatrix operator* (float k) const
 
decMatrix operator/ (float k) const
 
decMatrix operator* (const decMatrix &m) const
 
decVector operator* (const decVector &v) const
 
decVector4 operator* (const decVector4 &v) const
 

Static Public Member Functions

Matrix Creation
static decMatrix CreateIdentity ()
 
static decMatrix CreateTranslation (float x, float y, float z)
 
static decMatrix CreateTranslation (const decVector &t)
 
static decMatrix CreateScale (float sx, float sy, float sz)
 
static decMatrix CreateScale (const decVector &s)
 
static decMatrix CreateRotationX (float arc)
 
static decMatrix CreateRotationY (float arc)
 
static decMatrix CreateRotationZ (float arc)
 
static decMatrix CreateRotation (float rx, float ry, float rz)
 
static decMatrix CreateRotation (const decVector &r)
 
static decMatrix CreateRotationAxis (const decVector &axis, float angle)
 
static decMatrix CreateWorld (const decVector &pos, const decVector &view, const decVector &up)
 
static decMatrix CreateWorld (const decVector &pos, const decQuaternion &orientation)
 
static decMatrix CreateWorld (const decVector &pos, const decQuaternion &orientation, const decVector &scale)
 Create world space matrix. More...
 
static decMatrix CreateCamera (const decVector &pos, const decVector &view, const decVector &up)
 
static decMatrix CreateProjection (int width, int height, float fov, float fovRatio, float znear, float zfar)
 
static decMatrix CreateProjectionInfinite (int width, int height, float fov, float fovRatio, float znear)
 
static decMatrix CreateOrtho (int left, int right, int top, int bottom, int znear, int zfar)
 
static decMatrix CreateClipSpace ()
 
static decMatrix CreateBiasMatrix ()
 
static decMatrix CreateRT (const decVector &rot, const decVector &pos)
 
static decMatrix CreateSRT (const decVector &scale, const decVector &rot, const decVector &pos)
 
static decMatrix CreateSVUT (const decVector &scale, const decVector &view, const decVector &up, const decVector &pos)
 
static decMatrix CreateVU (const decVector &view, const decVector &up)
 
static decMatrix CreateFromQuaternion (const decQuaternion &q)
 
static decMatrix CreateFromQuaternion (const decQuaternion &q, const decVector &pivot)
 

Public Attributes

Cells

The first number indicates the row the second the column.

float a11
 
float a12
 
float a13
 
float a14
 
float a21
 
float a22
 
float a23
 
float a24
 
float a31
 
float a32
 
float a33
 
float a34
 
float a41
 
float a42
 
float a43
 
float a44
 

Detailed Description

4x4 Component Matrix. Provides matrix calculation on a 4x4 matrix in row major order. The coordinate system used by axis oriented creation functions is a left handed one. The X axis points to the right, the Y axis points up and the Z axis points into the screen. Rotations are always in counter clockwise orientation. Rotation angles are measured in radians.

Author
Pl├╝ss Roland
Version
1.0
Date
2014

Constructor & Destructor Documentation

◆ decMatrix() [1/3]

decMatrix::decMatrix ( )

Creates a new matrix initialized to identity.

◆ decMatrix() [2/3]

decMatrix::decMatrix ( const decMatrix m)

Creates a copy of a matrix.

◆ decMatrix() [3/3]

decMatrix::decMatrix ( const decDMatrix m)

Creates a copy of a double matrix.

Member Function Documentation

◆ CreateBiasMatrix()

static decMatrix decMatrix::CreateBiasMatrix ( )
static

Creates a bias matrix which multiplies all coordinates by 0.5 and offsets them by 0.5.

◆ CreateCamera()

static decMatrix decMatrix::CreateCamera ( const decVector pos,
const decVector view,
const decVector up 
)
static

Creates a new camera space matrix. A camera space matrix is different from a world space matrix in that it does transform positions from an world coordinate system into a coordinate system where the x axis points right, the y axis up and the z-axis straight into the screen. Best example to understand is a rotation. A world space matrix rotates a vector pointing straight down the z axis into the view vector used to create the matrix. A camera matrix though transforms a vector pointing into the view direction of the camera matrix into a vector pointing straight down the z axis. Hence the camera matrix is kinda the inverse of the world matrix what goes for the final transformation.

Parameters
posPosition of camera
viewView vector of camera not necessary normalized
upUp vector of camera not necessary normalized

◆ CreateClipSpace()

static decMatrix decMatrix::CreateClipSpace ( )
static

Creates a matrix to transform a projection matrix into cliping space. In cliping space the view frustum turns into a cube.

◆ CreateFromQuaternion() [1/2]

static decMatrix decMatrix::CreateFromQuaternion ( const decQuaternion q)
static

Creates a rotation matrix from a quaternion.

Parameters
qRotation quaternion

◆ CreateFromQuaternion() [2/2]

static decMatrix decMatrix::CreateFromQuaternion ( const decQuaternion q,
const decVector pivot 
)
static

Creates a rotation matrix from a quaternion.

◆ CreateIdentity()

static decMatrix decMatrix::CreateIdentity ( )
static

Creates a new identity matrix.

◆ CreateOrtho()

static decMatrix decMatrix::CreateOrtho ( int  left,
int  right,
int  top,
int  bottom,
int  znear,
int  zfar 
)
static

Creates an orthogonal projection matrix.

Parameters
leftLeft cliping plane position
rightRight cliping plane position
topTop cliping plane position
bottomBottom cliping plane position
znearDistance to near cliping plane
zfarDistance to far cliping plane

◆ CreateProjection()

static decMatrix decMatrix::CreateProjection ( int  width,
int  height,
float  fov,
float  fovRatio,
float  znear,
float  zfar 
)
static

Creates a projection matrix based on a finite view frustum. The width and height are used to derive the aspect ratio from.

Parameters
widthWidth of the viewport window
heightHeight of the viewport window
fovVertical field of view of the projection. Indicates the radian angle from the left side of the view frustum to the right side
fovRatioAspect ratio of the horizontal to the vertical field of view.
znearDistance to near cliping plane
zfarDistance to far cliping plane

◆ CreateProjectionInfinite()

static decMatrix decMatrix::CreateProjectionInfinite ( int  width,
int  height,
float  fov,
float  fovRatio,
float  znear 
)
static

Creates a projection matrix based on a infinite view frustum. The width and height are used to derive the aspect ratio from.

Parameters
widthWidth of the viewport window
heightHeight of the viewport window
fovVertical field of view of the projection. Indicates the radian angle from the left side of the view frustum to the right side
fovRatioAspect ratio of the horizontal to the vertical field of view.
znearDistance to near cliping plane

◆ CreateRotation() [1/2]

static decMatrix decMatrix::CreateRotation ( float  rx,
float  ry,
float  rz 
)
static

Creates a new rotation around the all three axes matrix. This matrix is the same as first applying a z axis roation, then an x axis rotation and then an y axis rotation.

◆ CreateRotation() [2/2]

static decMatrix decMatrix::CreateRotation ( const decVector r)
static

Creates a new rotation around the all three axes matrix. This matrix is the same as first applying a z axis roation, then an x axis rotation and then an y axis rotation.

◆ CreateRotationAxis()

static decMatrix decMatrix::CreateRotationAxis ( const decVector axis,
float  angle 
)
static

Creates a new rotation around an arbitrary axis matrix.

◆ CreateRotationX()

static decMatrix decMatrix::CreateRotationX ( float  arc)
static

Creates a new rotation around the x axis matrix.

◆ CreateRotationY()

static decMatrix decMatrix::CreateRotationY ( float  arc)
static

Creates a new rotation around the y axis matrix.

◆ CreateRotationZ()

static decMatrix decMatrix::CreateRotationZ ( float  arc)
static

Creates a new rotation around the z axis matrix.

◆ CreateRT()

static decMatrix decMatrix::CreateRT ( const decVector rot,
const decVector pos 
)
static

Creates a rotation-translation matrix. This is the same as first doing a 3-axis rotation and then a translation.

Parameters
rotRotation vector
posTranslation vector

◆ CreateScale() [1/2]

static decMatrix decMatrix::CreateScale ( float  sx,
float  sy,
float  sz 
)
static

Creates a new scaling matrix.

◆ CreateScale() [2/2]

static decMatrix decMatrix::CreateScale ( const decVector s)
static

Creates a new scaling matrix.

◆ CreateSRT()

static decMatrix decMatrix::CreateSRT ( const decVector scale,
const decVector rot,
const decVector pos 
)
static

Creates a scale-rotation-translation matrix. This is the same as first doing a scaling, then a 3-axis rotation and then a translation.

Parameters
scaleScaling vector
rotRotation vector
posTranslation vector

◆ CreateSVUT()

static decMatrix decMatrix::CreateSVUT ( const decVector scale,
const decVector view,
const decVector up,
const decVector pos 
)
static

Creates a scale-view-up-translation matrix. This is the same as first doing a scaling, then a world space matrix.

Parameters
scaleScaling vector
viewView vector
upUp vector
posTranslation vector

◆ CreateTranslation() [1/2]

static decMatrix decMatrix::CreateTranslation ( float  x,
float  y,
float  z 
)
static

Creates a new translation matrix.

◆ CreateTranslation() [2/2]

static decMatrix decMatrix::CreateTranslation ( const decVector t)
static

Creates a new translation matrix.

◆ CreateVU()

static decMatrix decMatrix::CreateVU ( const decVector view,
const decVector up 
)
static

Creates a view-up matrix. This is the same as doing a world space matrix but with the zero vector as position.

Parameters
viewView vector
upUp vector

◆ CreateWorld() [1/3]

static decMatrix decMatrix::CreateWorld ( const decVector pos,
const decVector view,
const decVector up 
)
static

Creates a new world space matrix. A world matrix is used to transform coordinates from the coordinate system of one object to another one.

Parameters
posPosition of object
viewView vector of object not necessary normalized
upUp vector of object not necessary normalized

◆ CreateWorld() [2/3]

static decMatrix decMatrix::CreateWorld ( const decVector pos,
const decQuaternion orientation 
)
static

Creates a new world space matrix. A world matrix is used to transform coordinates from the coordinate system of one object to another one.

Parameters
posPosition of object
orientationOrientation

◆ CreateWorld() [3/3]

static decMatrix decMatrix::CreateWorld ( const decVector pos,
const decQuaternion orientation,
const decVector scale 
)
static

Create world space matrix.

A world matrix is used to transform coordinates from the object local coordinate system to the world coordinate system.

◆ Determinant()

float decMatrix::Determinant ( ) const

Calculates the determinant of the matrix.

◆ GetEulerAngles()

decVector decMatrix::GetEulerAngles ( ) const

Calculates a set of euler angles producing this matrix if they are used as rotation vector for creating a rotation matrix. The calculated angles are not unique and different rotation vectors lead usually to the same matrix. The calculated rotation vector is garanteed to produce the matrix it has been calculated from. Furthermore there exist ambigious situations where the calculated rotation vector is undefined. You should avoid using this function if you can.

◆ GetPosition()

decVector decMatrix::GetPosition ( ) const

Retrieves the position of the matrix. This is the same as transforming the vector ( 0,0,0 ) by this matrix but faster.

◆ GetRotationMatrix()

decMatrix decMatrix::GetRotationMatrix ( ) const

Retrieves the rotation part of the matrix. The result is a 4x4 identity matrix with the upper left 3x3 copied from this matrix.

◆ GetScale()

decVector decMatrix::GetScale ( ) const

Retrieves the scaling of the matrix. This works only if the matrix is the product of translations, rotations and scaling. The returned scaling is always positive.

◆ Invert()

decMatrix decMatrix::Invert ( ) const

Retrieves the inverse of this matrix if the inverse is possible.

◆ IsEqualTo()

bool decMatrix::IsEqualTo ( const decMatrix matrix,
float  threshold = 0.0001 
) const

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

◆ operator*() [1/4]

decMatrix decMatrix::operator* ( float  k) const

Retrieves a new matrix with this matrix scaled by k.

◆ operator*() [2/4]

decMatrix decMatrix::operator* ( const decMatrix m) const

Retrieves a new matrix with this matrix multiplied with another one.

◆ operator*() [3/4]

decVector decMatrix::operator* ( const decVector v) const

Transforms vector by this matrix.

◆ operator*() [4/4]

decVector4 decMatrix::operator* ( const decVector4 v) const

Transforms 4 component vector by this matrix.

◆ operator*=() [1/2]

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

Multiplies the cells of this matrix with a value k.

◆ operator*=() [2/2]

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

Multiplies this matrix with another one.

◆ operator+()

decMatrix decMatrix::operator+ ( const decMatrix m) const

Retrieves a new matrix with the sum of this matrix with another one.

◆ operator+=()

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

Adds the cells of another matrix to this one.

◆ operator-()

decMatrix decMatrix::operator- ( const decMatrix m) const

Retrieves a new matrix with the difference of this matrix to another one.

◆ operator-=()

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

Subtracts the cells of another matrix from this vector.

◆ operator/()

decMatrix decMatrix::operator/ ( float  k) const

Retrieves a new matrix with this matrix divided by k. If k is 0 an exception is thrown.

◆ operator/=()

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

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

◆ operator=()

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

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

◆ QuickAddTo()

decMatrix& decMatrix::QuickAddTo ( const decMatrix m)

Quick cell wise adds another matrix to this matrix.

◆ QuickDeterminant()

float decMatrix::QuickDeterminant ( ) const

Quick calculates the determinant of this matrix.

◆ QuickInvert()

decMatrix decMatrix::QuickInvert ( ) const

Quick calculates the inverse of this matrix.

◆ QuickMultiply() [1/2]

decMatrix decMatrix::QuickMultiply ( const decMatrix matrix) const

Quick multiplies this matrix with another one.

◆ QuickMultiply() [2/2]

decMatrix decMatrix::QuickMultiply ( float  k) const

Quick multiplies this matrix with a value k.

◆ SetBiasMatrix()

void decMatrix::SetBiasMatrix ( )

Sets bias matrix which multiplies all coordinates by 0.5 and offsets them by 0.5.

◆ SetCamera()

void decMatrix::SetCamera ( const decVector pos,
const decVector view,
const decVector up 
)

Sets camera space matrix. A camera space matrix is different from a world space matrix in that it does transform positions from an world coordinate system into a coordinate system where the x axis points right, the y axis up and the z-axis straight into the screen. Best example to understand is a rotation. A world space matrix rotates a vector pointing straight down the z axis into the view vector used to create the matrix. A camera matrix though transforms a vector pointing into the view direction of the camera matrix into a vector pointing straight down the z axis. Hence the camera matrix is kinda the inverse of the world matrix what goes for the final transformation.

Parameters
posPosition of camera
viewView vector of camera not necessary normalized
upUp vector of camera not necessary normalized

◆ SetClipSpace()

void decMatrix::SetClipSpace ( )

Sets matrix to transform a projection matrix into cliping space. In cliping space the view frustum turns into a cube.

◆ SetFromQuaternion() [1/2]

void decMatrix::SetFromQuaternion ( const decQuaternion q)

Sets rotation matrix from a quaternion.

Parameters
qRotation quaternion

◆ SetFromQuaternion() [2/2]

void decMatrix::SetFromQuaternion ( const decQuaternion q,
const decVector pivot 
)

Sets rotation matrix from a quaternion.

◆ SetIdentity()

void decMatrix::SetIdentity ( )

Sets identity matrix.

◆ SetOrtho()

void decMatrix::SetOrtho ( int  left,
int  right,
int  top,
int  bottom,
int  znear,
int  zfar 
)

Sets orthogonal projection matrix.

Parameters
leftLeft cliping plane position
rightRight cliping plane position
topTop cliping plane position
bottomBottom cliping plane position
znearDistance to near cliping plane
zfarDistance to far cliping plane

◆ SetProjection()

void decMatrix::SetProjection ( int  width,
int  height,
float  fov,
float  fovRatio,
float  znear,
float  zfar 
)

Sets projection matrix based on a finite view frustum. The width and height are used to derive the aspect ratio from.

Parameters
widthWidth of the viewport window
heightHeight of the viewport window
fovVertical field of view of the projection. Indicates the radian angle from the left side of the view frustum to the right side
fovRatioAspect ratio of the horizontal to the vertical field of view.
znearDistance to near cliping plane
zfarDistance to far cliping plane

◆ SetProjectionInfinite()

void decMatrix::SetProjectionInfinite ( int  width,
int  height,
float  fov,
float  fovRatio,
float  znear 
)

Sets projection matrix based on a infinite view frustum. The width and height are used to derive the aspect ratio from.

Parameters
widthWidth of the viewport window
heightHeight of the viewport window
fovVertical field of view of the projection. Indicates the radian angle from the left side of the view frustum to the right side
fovRatioAspect ratio of the horizontal to the vertical field of view.
znearDistance to near cliping plane

◆ SetRotation() [1/2]

void decMatrix::SetRotation ( float  rx,
float  ry,
float  rz 
)

Sets rotation around the all three axes matrix. This matrix is the same as first applying a z axis roation, then an x axis rotation and then an y axis rotation.

◆ SetRotation() [2/2]

void decMatrix::SetRotation ( const decVector r)

Sets rotation around the all three axes matrix. This matrix is the same as first applying a z axis roation, then an x axis rotation and then an y axis rotation.

◆ SetRotationAxis()

void decMatrix::SetRotationAxis ( const decVector axis,
float  angle 
)

Sets rotation around an arbitrary axis matrix.

◆ SetRotationX()

void decMatrix::SetRotationX ( float  arc)

Sets rotation around the x axis matrix.

◆ SetRotationY()

void decMatrix::SetRotationY ( float  arc)

Sets rotation around the y axis matrix.

◆ SetRotationZ()

void decMatrix::SetRotationZ ( float  arc)

Sets rotation around the z axis matrix.

◆ SetRT()

void decMatrix::SetRT ( const decVector rot,
const decVector pos 
)

Sets rotation-translation matrix. This is the same as first doing a 3-axis rotation and then a translation.

Parameters
rotRotation vector
posTranslation vector

◆ SetScale() [1/2]

void decMatrix::SetScale ( float  sx,
float  sy,
float  sz 
)

Sets scaling matrix.

◆ SetScale() [2/2]

void decMatrix::SetScale ( const decVector s)

Sets scaling matrix.

◆ SetSRT()

void decMatrix::SetSRT ( const decVector scale,
const decVector rot,
const decVector pos 
)

Sets scale-rotation-translation matrix. This is the same as first doing a scaling, then a 3-axis rotation and then a translation.

Parameters
scaleScaling vector
rotRotation vector
posTranslation vector

◆ SetSVUT()

void decMatrix::SetSVUT ( const decVector scale,
const decVector view,
const decVector up,
const decVector pos 
)

Sets scale-view-up-translation matrix. This is the same as first doing a scaling, then a world space matrix.

Parameters
scaleScaling vector
viewView vector
upUp vector
posTranslation vector

◆ SetTranslation() [1/2]

void decMatrix::SetTranslation ( float  x,
float  y,
float  z 
)

Sets translation matrix.

◆ SetTranslation() [2/2]

void decMatrix::SetTranslation ( const decVector t)

Sets translation matrix.

◆ SetVU()

void decMatrix::SetVU ( const decVector view,
const decVector up 
)

Sets view-up matrix. This is the same as doing a world space matrix but with the zero vector as position.

Parameters
viewView vector
upUp vector

◆ SetWorld() [1/3]

void decMatrix::SetWorld ( const decVector pos,
const decVector view,
const decVector up 
)

Sets world space matrix. A world matrix is used to transform coordinates from the coordinate system of one object to another one.

Parameters
posPosition of object
viewView vector of object not necessary normalized
upUp vector of object not necessary normalized

◆ SetWorld() [2/3]

void decMatrix::SetWorld ( const decVector pos,
const decQuaternion orientation 
)

Sets world space matrix. A world matrix is used to transform coordinates from the coordinate system of one object to another one.

Parameters
posPosition of object
orientationOrientation

◆ SetWorld() [3/3]

void decMatrix::SetWorld ( const decVector pos,
const decQuaternion orientation,
const decVector scale 
)

Set world space matrix.

A world matrix is used to transform coordinates from the object local coordinate system to the world coordinate system.

◆ ToQuaternion()

decQuaternion decMatrix::ToQuaternion ( ) const

Converts the matrix into a rotation quaternion. This conversion is well defined in contrast to the rotation vector function.

◆ Transform() [1/4]

decVector decMatrix::Transform ( float  x,
float  y,
float  z 
) const

Transforms a vector.

◆ Transform() [2/4]

decVector4 decMatrix::Transform ( float  x,
float  y,
float  z,
float  w 
) const

◆ Transform() [3/4]

void decMatrix::Transform ( decVector result,
float  x,
float  y,
float  z 
) const

◆ Transform() [4/4]

void decMatrix::Transform ( decVector4 result,
float  x,
float  y,
float  z,
float  w 
) const

◆ TransformNormal()

decVector decMatrix::TransformNormal ( const decVector normal) const

Transforms a normal by this matrix. This is the same as transforming the normal by only the rotation part of it.

◆ TransformRight()

decVector decMatrix::TransformRight ( ) const

Retrieves the right vector of this matrix. This is the same as transforing the vector ( 1,0,0 ) by this matrix but faster.

◆ TransformUp()

decVector decMatrix::TransformUp ( ) const

Retrieves the up vector of this matrix. This is the same as transforing the vector ( 0,1,0 ) by this matrix but faster.

◆ TransformView()

decVector decMatrix::TransformView ( ) const

Retrieves the view vector of this matrix. This is the same as transforing the vector ( 0,0,1 ) by this matrix but faster.

Member Data Documentation

◆ a11

float decMatrix::a11

◆ a12

float decMatrix::a12

◆ a13

float decMatrix::a13

◆ a14

float decMatrix::a14

◆ a21

float decMatrix::a21

◆ a22

float decMatrix::a22

◆ a23

float decMatrix::a23

◆ a24

float decMatrix::a24

◆ a31

float decMatrix::a31

◆ a32

float decMatrix::a32

◆ a33

float decMatrix::a33

◆ a34

float decMatrix::a34

◆ a41

float decMatrix::a41

◆ a42

float decMatrix::a42

◆ a43

float decMatrix::a43

◆ a44

float decMatrix::a44

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