Drag[en]gine Game Engine  1.0
decDMatrix Class Reference

4x4 Component Matrix double precision. Same as the decDMatrix class but with double precision. More...

#include <decDMatrix.h>

Public Member Functions

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

decDMatrix QuickMultiply (const decDMatrix &matrix) const
 
decDMatrix QuickMultiply (double k) const
 
double QuickDeterminant () const
 
decDMatrix QuickInvert () const
 
decDMatrixQuickAddTo (const decDMatrix &m)
 
decMatrix ToMatrix () const
 
Operators
decDMatrixoperator= (const decDMatrix &m)
 
decDMatrixoperator+= (const decDMatrix &m)
 
decDMatrixoperator-= (const decDMatrix &m)
 
decDMatrixoperator*= (double k)
 
decDMatrixoperator/= (double k)
 
decDMatrixoperator*= (const decDMatrix &m)
 
decDMatrix operator+ (const decDMatrix &m) const
 
decDMatrix operator- (const decDMatrix &m) const
 
decDMatrix operator* (double k) const
 
decDMatrix operator/ (double k) const
 
decDMatrix operator* (const decDMatrix &m) const
 
decDVector operator* (const decDVector &v) const
 
decDVector4 operator* (const decDVector4 &v) const
 

Static Public Member Functions

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

Public Attributes

Cells

The first number indicates the row the second the column.

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

Detailed Description

4x4 Component Matrix double precision. Same as the decDMatrix class but with double precision.

Author
Pl├╝ss Roland
Version
1.0
Date
2014

Constructor & Destructor Documentation

◆ decDMatrix() [1/3]

decDMatrix::decDMatrix ( )

Creates a new matrix initialized to identity.

◆ decDMatrix() [2/3]

decDMatrix::decDMatrix ( const decDMatrix m)

Creates a copy of a matrix.

◆ decDMatrix() [3/3]

decDMatrix::decDMatrix ( const decMatrix m)

Creates a copy of a float matrix.

Member Function Documentation

◆ CreateBiasMatrix()

static decDMatrix decDMatrix::CreateBiasMatrix ( )
static

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

◆ CreateCamera()

static decDMatrix decDMatrix::CreateCamera ( const decDVector pos,
const decDVector view,
const decDVector 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 decDMatrix decDMatrix::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 decDMatrix decDMatrix::CreateFromQuaternion ( const decQuaternion q)
static

Creates a rotation matrix from a quaternion.

Parameters
qRotation quaternion

◆ CreateFromQuaternion() [2/2]

static decDMatrix decDMatrix::CreateFromQuaternion ( const decQuaternion q,
const decDVector pivot 
)
static

Creates a rotation matrix from a quaternion.

◆ CreateIdentity()

static decDMatrix decDMatrix::CreateIdentity ( )
static

Creates a new identity matrix.

◆ CreateOrtho()

static decDMatrix decDMatrix::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 decDMatrix decDMatrix::CreateProjection ( int  width,
int  height,
double  fov,
double  fovRatio,
double  znear,
double  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 decDMatrix decDMatrix::CreateProjectionInfinite ( int  width,
int  height,
double  fov,
double  fovRatio,
double  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 decDMatrix decDMatrix::CreateRotation ( double  rx,
double  ry,
double  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 decDMatrix decDMatrix::CreateRotation ( const decDVector 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 decDMatrix decDMatrix::CreateRotationAxis ( const decDVector axis,
double  angle 
)
static

Creates a new rotation around an arbitrary axis matrix.

◆ CreateRotationX()

static decDMatrix decDMatrix::CreateRotationX ( double  arc)
static

Creates a new rotation around the x axis matrix.

◆ CreateRotationY()

static decDMatrix decDMatrix::CreateRotationY ( double  arc)
static

Creates a new rotation around the y axis matrix.

◆ CreateRotationZ()

static decDMatrix decDMatrix::CreateRotationZ ( double  arc)
static

Creates a new rotation around the z axis matrix.

◆ CreateRT()

static decDMatrix decDMatrix::CreateRT ( const decDVector rot,
const decDVector 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 decDMatrix decDMatrix::CreateScale ( double  sx,
double  sy,
double  sz 
)
static

Creates a new scaling matrix.

◆ CreateScale() [2/2]

static decDMatrix decDMatrix::CreateScale ( const decDVector s)
static

Creates a new scaling matrix.

◆ CreateSRT()

static decDMatrix decDMatrix::CreateSRT ( const decDVector scale,
const decDVector rot,
const decDVector 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

◆ CreateST()

static decDMatrix decDMatrix::CreateST ( const decDVector scale,
const decDVector translate 
)
static

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

◆ CreateSVUT()

static decDMatrix decDMatrix::CreateSVUT ( const decDVector scale,
const decDVector view,
const decDVector up,
const decDVector 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 decDMatrix decDMatrix::CreateTranslation ( double  x,
double  y,
double  z 
)
static

Creates a new translation matrix.

◆ CreateTranslation() [2/2]

static decDMatrix decDMatrix::CreateTranslation ( const decDVector t)
static

Creates a new translation matrix.

◆ CreateVU()

static decDMatrix decDMatrix::CreateVU ( const decDVector view,
const decDVector 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 decDMatrix decDMatrix::CreateWorld ( const decDVector pos,
const decDVector view,
const decDVector 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 decDMatrix decDMatrix::CreateWorld ( const decDVector 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 decDMatrix decDMatrix::CreateWorld ( const decDVector pos,
const decQuaternion orientation,
const decDVector 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()

double decDMatrix::Determinant ( ) const

Calculates the determinant of the matrix.

◆ GetEulerAngles()

decDVector decDMatrix::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()

decDVector decDMatrix::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()

decDMatrix decDMatrix::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()

decDVector decDMatrix::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()

decDMatrix decDMatrix::Invert ( ) const

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

◆ IsEqualTo()

bool decDMatrix::IsEqualTo ( const decDMatrix matrix,
double  threshold = DVECTOR_THRESHOLD 
) const

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

◆ operator*() [1/4]

decDMatrix decDMatrix::operator* ( double  k) const

Retrieves a new matrix with this matrix scaled by k.

◆ operator*() [2/4]

decDMatrix decDMatrix::operator* ( const decDMatrix m) const

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

◆ operator*() [3/4]

decDVector decDMatrix::operator* ( const decDVector v) const

Transforms vector by this matrix.

◆ operator*() [4/4]

decDVector4 decDMatrix::operator* ( const decDVector4 v) const

Transforms 4 component vector by this matrix.

◆ operator*=() [1/2]

decDMatrix& decDMatrix::operator*= ( double  k)

Multiplies the cells of this matrix with a value k.

◆ operator*=() [2/2]

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

Multiplies this matrix with another one.

◆ operator+()

decDMatrix decDMatrix::operator+ ( const decDMatrix m) const

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

◆ operator+=()

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

Adds the cells of another matrix to this one.

◆ operator-()

decDMatrix decDMatrix::operator- ( const decDMatrix m) const

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

◆ operator-=()

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

Subtracts the cells of another matrix from this vector.

◆ operator/()

decDMatrix decDMatrix::operator/ ( double  k) const

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

◆ operator/=()

decDMatrix& decDMatrix::operator/= ( double  k)

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

◆ operator=()

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

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

◆ QuickAddTo()

decDMatrix& decDMatrix::QuickAddTo ( const decDMatrix m)

Quick cell wise adds another matrix to this matrix.

◆ QuickDeterminant()

double decDMatrix::QuickDeterminant ( ) const

Quick calculates the determinant of this matrix.

◆ QuickInvert()

decDMatrix decDMatrix::QuickInvert ( ) const

Quick calculates the inverse of this matrix.

◆ QuickMultiply() [1/2]

decDMatrix decDMatrix::QuickMultiply ( const decDMatrix matrix) const

Quick multiplies this matrix with another one.

◆ QuickMultiply() [2/2]

decDMatrix decDMatrix::QuickMultiply ( double  k) const

Quick multiplies this matrix with a value k.

◆ Set()

void decDMatrix::Set ( const decMatrix matrix)

Set matrix from a single precision matrix.

◆ SetBiasMatrix()

void decDMatrix::SetBiasMatrix ( )

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

◆ SetCamera()

void decDMatrix::SetCamera ( const decDVector pos,
const decDVector view,
const decDVector 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 decDMatrix::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 decDMatrix::SetFromQuaternion ( const decQuaternion q)

Sets rotation matrix from a quaternion.

Parameters
qRotation quaternion

◆ SetFromQuaternion() [2/2]

void decDMatrix::SetFromQuaternion ( const decQuaternion q,
const decDVector pivot 
)

Sets rotation matrix from a quaternion.

◆ SetIdentity()

void decDMatrix::SetIdentity ( )

Sets identity matrix.

◆ SetOrtho()

void decDMatrix::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 decDMatrix::SetProjection ( int  width,
int  height,
double  fov,
double  fovRatio,
double  znear,
double  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 decDMatrix::SetProjectionInfinite ( int  width,
int  height,
double  fov,
double  fovRatio,
double  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 decDMatrix::SetRotation ( double  rx,
double  ry,
double  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 decDMatrix::SetRotation ( const decDVector 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 decDMatrix::SetRotationAxis ( const decDVector axis,
double  angle 
)

Sets rotation around an arbitrary axis matrix.

◆ SetRotationX()

void decDMatrix::SetRotationX ( double  arc)

Sets rotation around the x axis matrix.

◆ SetRotationY()

void decDMatrix::SetRotationY ( double  arc)

Sets rotation around the y axis matrix.

◆ SetRotationZ()

void decDMatrix::SetRotationZ ( double  arc)

Sets rotation around the z axis matrix.

◆ SetRT()

void decDMatrix::SetRT ( const decDVector rot,
const decDVector 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 decDMatrix::SetScale ( double  sx,
double  sy,
double  sz 
)

Sets scaling matrix.

◆ SetScale() [2/2]

void decDMatrix::SetScale ( const decDVector s)

Sets scaling matrix.

◆ SetSRT()

void decDMatrix::SetSRT ( const decDVector scale,
const decDVector rot,
const decDVector 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

◆ SetST()

void decDMatrix::SetST ( const decDVector scale,
const decDVector translate 
)

Set scale-translation matrix. This is the same as first doing a scaling and then a translation.

◆ SetSVUT()

void decDMatrix::SetSVUT ( const decDVector scale,
const decDVector view,
const decDVector up,
const decDVector 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 decDMatrix::SetTranslation ( double  x,
double  y,
double  z 
)

Sets translation matrix.

◆ SetTranslation() [2/2]

void decDMatrix::SetTranslation ( const decDVector t)

Sets translation matrix.

◆ SetVU()

void decDMatrix::SetVU ( const decDVector view,
const decDVector 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 decDMatrix::SetWorld ( const decDVector pos,
const decDVector view,
const decDVector 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 decDMatrix::SetWorld ( const decDVector 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 decDMatrix::SetWorld ( const decDVector pos,
const decQuaternion orientation,
const decDVector scale 
)

Set world space matrix.

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

◆ ToMatrix()

decMatrix decDMatrix::ToMatrix ( ) const

Converts to a single precision matrix with possible loss of precision.

◆ ToQuaternion()

decQuaternion decDMatrix::ToQuaternion ( ) const

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

◆ Transform() [1/4]

decDVector decDMatrix::Transform ( double  x,
double  y,
double  z 
) const

Transforms a vector.

◆ Transform() [2/4]

decDVector4 decDMatrix::Transform ( double  x,
double  y,
double  z,
double  w 
) const

◆ Transform() [3/4]

void decDMatrix::Transform ( decDVector result,
double  x,
double  y,
double  z 
) const

◆ Transform() [4/4]

void decDMatrix::Transform ( decDVector4 result,
double  x,
double  y,
double  z,
double  w 
) const

◆ TransformNormal()

decDVector decDMatrix::TransformNormal ( const decDVector normal) const

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

◆ TransformRight()

decDVector decDMatrix::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()

decDVector decDMatrix::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()

decDVector decDMatrix::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.

◆ Transpose()

decDMatrix decDMatrix::Transpose ( ) const

Retrieves the transpose of this matrix.

Member Data Documentation

◆ a11

double decDMatrix::a11

◆ a12

double decDMatrix::a12

◆ a13

double decDMatrix::a13

◆ a14

double decDMatrix::a14

◆ a21

double decDMatrix::a21

◆ a22

double decDMatrix::a22

◆ a23

double decDMatrix::a23

◆ a24

double decDMatrix::a24

◆ a31

double decDMatrix::a31

◆ a32

double decDMatrix::a32

◆ a33

double decDMatrix::a33

◆ a34

double decDMatrix::a34

◆ a41

double decDMatrix::a41

◆ a42

double decDMatrix::a42

◆ a43

double decDMatrix::a43

◆ a44

double decDMatrix::a44

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