Drag[en]gine Game Engine
1.21
|
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 () | |
Create new matrix initialized to identity. More... | |
decDMatrix (const decDMatrix &m) | |
Create copy of a matrix. More... | |
decDMatrix (const decMatrix &m) | |
Create copy of a float matrix. More... | |
Management | |
void | SetIdentity () |
Sets identity matrix. More... | |
void | SetTranslation (double x, double y, double z) |
Sets translation matrix. More... | |
void | SetTranslation (const decDVector &t) |
Sets translation matrix. More... | |
void | SetScale (double sx, double sy, double sz) |
Sets scaling matrix. More... | |
void | SetScale (const decDVector &s) |
Sets scaling matrix. More... | |
void | SetRotationX (double arc) |
Sets rotation around the x axis matrix. More... | |
void | SetRotationY (double arc) |
Sets rotation around the y axis matrix. More... | |
void | SetRotationZ (double arc) |
Sets rotation around the z axis matrix. More... | |
void | SetRotation (double rx, double ry, double rz) |
Set rotation around the all three axes matrix. More... | |
void | SetRotation (const decDVector &r) |
Set rotation around the all three axes matrix. More... | |
void | SetRotationAxis (const decDVector &axis, double angle) |
Sets rotation around an arbitrary axis matrix. More... | |
void | SetWorld (const decDVector &pos, const decDVector &view, const decDVector &up) |
Set world space matrix. More... | |
void | SetWorld (const decDVector &pos, const decQuaternion &orientation) |
Set world space matrix. More... | |
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) |
Set camera space matrix. More... | |
void | SetProjection (int width, int height, double fov, double fovRatio, double znear, double zfar) |
Set projection matrix based on a finite view frustum. More... | |
void | SetProjectionInfinite (int width, int height, double fov, double fovRatio, double znear) |
Set projection matrix based on a infinite view frustum. More... | |
void | SetOrtho (int left, int right, int top, int bottom, int znear, int zfar) |
Set orthogonal projection matrix. More... | |
void | SetClipSpace () |
Set matrix to transform a projection matrix into cliping space. More... | |
void | SetBiasMatrix () |
Set bias matrix which multiplies all coordinates by 0.5 and offsets them by 0.5. More... | |
void | SetRT (const decDVector &rot, const decDVector &pos) |
Set rotation-translation matrix. More... | |
void | SetST (const decDVector &scale, const decDVector &translate) |
Set scale-translation matrix. More... | |
void | SetSRT (const decDVector &scale, const decDVector &rot, const decDVector &pos) |
Set scale-rotation-translation matrix. More... | |
void | SetSVUT (const decDVector &scale, const decDVector &view, const decDVector &up, const decDVector &pos) |
Set scale-view-up-translation matrix. More... | |
void | SetVU (const decDVector &view, const decDVector &up) |
Set view-up matrix. More... | |
void | SetFromQuaternion (const decQuaternion &q) |
Set rotation matrix from a quaternion. More... | |
void | SetFromQuaternion (const decQuaternion &q, const decDVector &pivot) |
Set rotation matrix from a quaternion. More... | |
void | Set (const decMatrix &matrix) |
Set matrix from a single precision matrix. More... | |
double | Determinant () const |
Calculates the determinant of the matrix. More... | |
decDMatrix | Invert () const |
Inverse of this matrix if the inverse is possible. More... | |
decDMatrix | Transpose () const |
Transpose of this matrix. More... | |
decDVector | GetEulerAngles () const |
Calculate set of euler angles producing this matrix if they are used as rotation vector for creating a rotation matrix. More... | |
decQuaternion | ToQuaternion () const |
Convert matrix into a rotation quaternion. More... | |
decDVector | GetScale () const |
Scaling of the matrix. More... | |
decDVector | GetPosition () const |
Position of the matrix. More... | |
decDVector | TransformView () const |
View vector of this matrix. More... | |
decDVector | TransformRight () const |
Right vector of this matrix. More... | |
decDVector | TransformUp () const |
Up vector of this matrix. More... | |
decDVector | TransformNormal (const decDVector &normal) const |
Transform normal by this matrix. More... | |
decDVector | Transform (double x, double y, double z) const |
Transforms a vector. More... | |
decDVector4 | Transform (double x, double y, double z, double w) const |
Transforms a vector. More... | |
void | Transform (decDVector &result, double x, double y, double z) const |
Transforms a vector. More... | |
void | Transform (decDVector4 &result, double x, double y, double z, double w) const |
Transforms a vector. More... | |
decDMatrix | GetRotationMatrix () const |
Rotation part of the matrix. More... | |
void | Normalize () |
Normalize matrix. More... | |
decDMatrix | Normalized () const |
Normalize matrix. More... | |
bool | IsEqualTo (const decDMatrix &matrix, double threshold=DVECTOR_THRESHOLD) const |
Matrix is cell wise equal to anither one in respect to a threshold. More... | |
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 |
Quick multiplies this matrix with another one. More... | |
decDMatrix | QuickMultiplyRotation (const decDMatrix &matrix) const |
Quick multiplies this matrix rotation part with another one. More... | |
decDMatrix | QuickMultiply (double k) const |
Quick multiplies this matrix with a value k. More... | |
double | QuickDeterminant () const |
Quick calculates the determinant of this matrix. More... | |
decDMatrix | QuickInvert () const |
Quick calculates the inverse of this matrix. More... | |
decDMatrix & | QuickAddTo (const decDMatrix &m) |
Quick cell wise adds another matrix to this matrix. More... | |
decMatrix | ToMatrix () const |
Converts to a single precision matrix with possible loss of precision. More... | |
Operators | |
decDMatrix & | operator= (const decDMatrix &m) |
Set cells of this matrix to the values of another one. More... | |
decDMatrix & | operator+= (const decDMatrix &m) |
Adds the cells of another matrix to this one. More... | |
decDMatrix & | operator-= (const decDMatrix &m) |
Subtracts the cells of another matrix from this vector. More... | |
decDMatrix & | operator*= (double k) |
Multiplies the cells of this matrix with a value k. More... | |
decDMatrix & | operator/= (double k) |
Divide cells of this matrix by a value k. More... | |
decDMatrix & | operator*= (const decDMatrix &m) |
Multiplies this matrix with another one. More... | |
decDMatrix | operator+ (const decDMatrix &m) const |
Retrieves a new matrix with the sum of this matrix with another one. More... | |
decDMatrix | operator- (const decDMatrix &m) const |
Retrieves a new matrix with the difference of this matrix to another one. More... | |
decDMatrix | operator* (double k) const |
Retrieves a new matrix with this matrix scaled by k. More... | |
decDMatrix | operator/ (double k) const |
Retrieves a new matrix with this matrix divided by k. If k is 0 an exception is thrown. More... | |
decDMatrix | operator* (const decDMatrix &m) const |
Retrieves a new matrix with this matrix multiplied with another one. More... | |
decDVector | operator* (const decDVector &v) const |
Transforms vector by this matrix. More... | |
decDVector4 | operator* (const decDVector4 &v) const |
Transforms 4 component vector by this matrix. More... | |
Static Public Member Functions | |
Matrix Creation | |
static decDMatrix | CreateIdentity () |
Create new identity matrix. More... | |
static decDMatrix | CreateTranslation (double x, double y, double z) |
Create new translation matrix. More... | |
static decDMatrix | CreateTranslation (const decDVector &t) |
Create new translation matrix. More... | |
static decDMatrix | CreateScale (double sx, double sy, double sz) |
Create new scaling matrix. More... | |
static decDMatrix | CreateScale (const decDVector &s) |
Create new scaling matrix. More... | |
static decDMatrix | CreateRotationX (double arc) |
Create new rotation around the x axis matrix. More... | |
static decDMatrix | CreateRotationY (double arc) |
Create new rotation around the y axis matrix. More... | |
static decDMatrix | CreateRotationZ (double arc) |
Create new rotation around the z axis matrix. More... | |
static decDMatrix | CreateRotation (double rx, double ry, double rz) |
Create new rotation around the all three axes matrix. More... | |
static decDMatrix | CreateRotation (const decDVector &r) |
Create new rotation around the all three axes matrix. More... | |
static decDMatrix | CreateRotationAxis (const decDVector &axis, double angle) |
Create new rotation around an arbitrary axis matrix. More... | |
static decDMatrix | CreateWorld (const decDVector &pos, const decDVector &view, const decDVector &up) |
Create new world space matrix. More... | |
static decDMatrix | CreateWorld (const decDVector &pos, const decQuaternion &orientation) |
Create new world space matrix. More... | |
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) |
Create new camera space matrix. More... | |
static decDMatrix | CreateProjection (int width, int height, double fov, double fovRatio, double znear, double zfar) |
Create projection matrix based on a finite view frustum. More... | |
static decDMatrix | CreateProjectionInfinite (int width, int height, double fov, double fovRatio, double znear) |
Create projection matrix based on a infinite view frustum. More... | |
static decDMatrix | CreateOrtho (int left, int right, int top, int bottom, int znear, int zfar) |
Create orthogonal projection matrix. More... | |
static decDMatrix | CreateClipSpace () |
Create matrix to transform a projection matrix into cliping space. More... | |
static decDMatrix | CreateBiasMatrix () |
Create bias matrix which multiplies all coordinates by 0.5 and offsets them by 0.5. More... | |
static decDMatrix | CreateRT (const decDVector &rot, const decDVector &pos) |
Create rotation-translation matrix. More... | |
static decDMatrix | CreateST (const decDVector &scale, const decDVector &translate) |
Create scale-translation matrix. More... | |
static decDMatrix | CreateSRT (const decDVector &scale, const decDVector &rot, const decDVector &pos) |
Create scale-rotation-translation matrix. More... | |
static decDMatrix | CreateSVUT (const decDVector &scale, const decDVector &view, const decDVector &up, const decDVector &pos) |
Create scale-view-up-translation matrix. More... | |
static decDMatrix | CreateVU (const decDVector &view, const decDVector &up) |
Create view-up matrix. More... | |
static decDMatrix | CreateFromQuaternion (const decQuaternion &q) |
Create rotation matrix from a quaternion. More... | |
static decDMatrix | CreateFromQuaternion (const decQuaternion &q, const decDVector &pivot) |
Create rotation matrix from a quaternion. More... | |
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 |
4x4 Component Matrix double precision. Same as the decDMatrix class but with double precision.
decDMatrix::decDMatrix | ( | ) |
Create new matrix initialized to identity.
decDMatrix::decDMatrix | ( | const decDMatrix & | m | ) |
Create copy of a matrix.
decDMatrix::decDMatrix | ( | const decMatrix & | m | ) |
Create copy of a float matrix.
|
static |
Create bias matrix which multiplies all coordinates by 0.5 and offsets them by 0.5.
|
static |
Create 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.
pos | Position of camera |
view | View vector of camera not necessary normalized |
up | Up vector of camera not necessary normalized |
|
static |
Create matrix to transform a projection matrix into cliping space.
In cliping space the view frustum turns into a cube.
|
static |
Create rotation matrix from a quaternion.
q | Rotation quaternion |
|
static |
Create rotation matrix from a quaternion.
|
static |
Create new identity matrix.
|
static |
Create orthogonal projection matrix.
left | Left cliping plane position |
right | Right cliping plane position |
top | Top cliping plane position |
bottom | Bottom cliping plane position |
znear | Distance to near cliping plane |
zfar | Distance to far cliping plane |
|
static |
Create projection matrix based on a finite view frustum.
The width and height are used to derive the aspect ratio from.
width | Width of the viewport window |
height | Height of the viewport window |
fov | Vertical field of view of the projection. Indicates the radian angle from the left side of the view frustum to the right side |
fovRatio | Aspect ratio of the horizontal to the vertical field of view. |
znear | Distance to near cliping plane |
zfar | Distance to far cliping plane |
|
static |
Create projection matrix based on a infinite view frustum.
The width and height are used to derive the aspect ratio from.
width | Width of the viewport window |
height | Height of the viewport window |
fov | Vertical field of view of the projection. Indicates the radian angle from the left side of the view frustum to the right side |
fovRatio | Aspect ratio of the horizontal to the vertical field of view. |
znear | Distance to near cliping plane |
|
static |
Create 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.
|
static |
Create 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.
|
static |
Create new rotation around an arbitrary axis matrix.
|
static |
Create new rotation around the x axis matrix.
|
static |
Create new rotation around the y axis matrix.
|
static |
Create new rotation around the z axis matrix.
|
static |
Create rotation-translation matrix.
This is the same as first doing a 3-axis rotation and then a translation.
rot | Rotation vector |
pos | Translation vector |
|
static |
Create new scaling matrix.
|
static |
Create new scaling matrix.
|
static |
Create scale-rotation-translation matrix.
This is the same as first doing a scaling, then a 3-axis rotation and then a translation.
scale | Scaling vector |
rot | Rotation vector |
pos | Translation vector |
|
static |
Create scale-translation matrix.
This is the same as first doing a scaling and then a translation.
|
static |
Create scale-view-up-translation matrix.
This is the same as first doing a scaling, then a world space matrix.
scale | Scaling vector |
view | View vector |
up | Up vector |
pos | Translation vector |
|
static |
Create new translation matrix.
|
static |
Create new translation matrix.
|
static |
Create view-up matrix.
This is the same as doing a world space matrix but with the zero vector as position.
view | View vector |
up | Up vector |
|
static |
Create new world space matrix.
A world matrix is used to transform coordinates from the coordinate system of one object to another one.
pos | Position of object |
view | View vector of object not necessary normalized |
up | Up vector of object not necessary normalized |
|
static |
Create new world space matrix.
A world matrix is used to transform coordinates from the coordinate system of one object to another one.
pos | Position of object |
orientation | Orientation |
|
static |
Create world space matrix.
A world matrix is used to transform coordinates from the object local coordinate system to the world coordinate system.
double decDMatrix::Determinant | ( | ) | const |
Calculates the determinant of the matrix.
decDVector decDMatrix::GetEulerAngles | ( | ) | const |
Calculate 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 ambiguous situations where the calculated rotation vector is undefined. You should avoid using this function if you can.
decDVector decDMatrix::GetPosition | ( | ) | const |
Position of the matrix.
This is the same as transforming the vector (0,0,0) by this matrix but faster.
decDMatrix decDMatrix::GetRotationMatrix | ( | ) | const |
Rotation part of the matrix.
The result is a 4x4 identity matrix with the upper left 3x3 copied from this matrix.
decDVector decDMatrix::GetScale | ( | ) | const |
Scaling of the matrix.
This works only if the matrix is the product of translations, rotations and scaling. The returned scaling is always positive.
decDMatrix decDMatrix::Invert | ( | ) | const |
Inverse of this matrix if the inverse is possible.
bool decDMatrix::IsEqualTo | ( | const decDMatrix & | matrix, |
double | threshold = DVECTOR_THRESHOLD |
||
) | const |
Matrix is cell wise equal to anither one in respect to a threshold.
void decDMatrix::Normalize | ( | ) |
Normalize matrix.
Modifies matrix with scaling removed. Only normalized matrices are safe to be used with the GetEulerAngles() and ToQuaternion() calls since scaling interferes with the calculation.
This calls the same as this code
but is safe against 0-scaling. In such a case a 0-rotation matrix is set.
decDMatrix decDMatrix::Normalized | ( | ) | const |
Normalize matrix.
Returns matrix with scaling removed. Only normalized matrices are safe to be used with the GetEulerAngles() and ToQuaternion() calls since scaling interferes with the calculation.
This calls the same as this code
but is safe against 0-scaling. In such a case a 0-rotation matrix is created.
decDMatrix decDMatrix::operator* | ( | const decDMatrix & | m | ) | const |
Retrieves a new matrix with this matrix multiplied with another one.
decDVector decDMatrix::operator* | ( | const decDVector & | v | ) | const |
Transforms vector by this matrix.
decDVector4 decDMatrix::operator* | ( | const decDVector4 & | v | ) | const |
Transforms 4 component vector by this matrix.
decDMatrix decDMatrix::operator* | ( | double | k | ) | const |
Retrieves a new matrix with this matrix scaled by k.
decDMatrix& decDMatrix::operator*= | ( | const decDMatrix & | m | ) |
Multiplies this matrix with another one.
decDMatrix& decDMatrix::operator*= | ( | double | k | ) |
Multiplies the cells of this matrix with a value k.
decDMatrix decDMatrix::operator+ | ( | const decDMatrix & | m | ) | const |
Retrieves a new matrix with the sum of this matrix with another one.
decDMatrix& decDMatrix::operator+= | ( | const decDMatrix & | m | ) |
Adds the cells of another matrix to this one.
decDMatrix decDMatrix::operator- | ( | const decDMatrix & | m | ) | const |
Retrieves a new matrix with the difference of this matrix to another one.
decDMatrix& decDMatrix::operator-= | ( | const decDMatrix & | m | ) |
Subtracts the cells of another matrix from this vector.
decDMatrix decDMatrix::operator/ | ( | double | k | ) | const |
Retrieves a new matrix with this matrix divided by k. If k is 0 an exception is thrown.
decDMatrix& decDMatrix::operator/= | ( | double | k | ) |
Divide cells of this matrix by a value k.
If the value k is 0 an exception is thrown.
decDMatrix& decDMatrix::operator= | ( | const decDMatrix & | m | ) |
Set cells of this matrix to the values of another one.
decDMatrix& decDMatrix::QuickAddTo | ( | const decDMatrix & | m | ) |
Quick cell wise adds another matrix to this matrix.
double decDMatrix::QuickDeterminant | ( | ) | const |
Quick calculates the determinant of this matrix.
decDMatrix decDMatrix::QuickInvert | ( | ) | const |
Quick calculates the inverse of this matrix.
decDMatrix decDMatrix::QuickMultiply | ( | const decDMatrix & | matrix | ) | const |
Quick multiplies this matrix with another one.
decDMatrix decDMatrix::QuickMultiply | ( | double | k | ) | const |
Quick multiplies this matrix with a value k.
decDMatrix decDMatrix::QuickMultiplyRotation | ( | const decDMatrix & | matrix | ) | const |
Quick multiplies this matrix rotation part with another one.
void decDMatrix::Set | ( | const decMatrix & | matrix | ) |
Set matrix from a single precision matrix.
void decDMatrix::SetBiasMatrix | ( | ) |
Set bias matrix which multiplies all coordinates by 0.5 and offsets them by 0.5.
void decDMatrix::SetCamera | ( | const decDVector & | pos, |
const decDVector & | view, | ||
const decDVector & | up | ||
) |
Set 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.
pos | Position of camera |
view | View vector of camera not necessary normalized |
up | Up vector of camera not necessary normalized |
void decDMatrix::SetClipSpace | ( | ) |
Set matrix to transform a projection matrix into cliping space.
In cliping space the view frustum turns into a cube.
void decDMatrix::SetFromQuaternion | ( | const decQuaternion & | q | ) |
Set rotation matrix from a quaternion.
q | Rotation quaternion |
void decDMatrix::SetFromQuaternion | ( | const decQuaternion & | q, |
const decDVector & | pivot | ||
) |
Set rotation matrix from a quaternion.
void decDMatrix::SetIdentity | ( | ) |
Sets identity matrix.
void decDMatrix::SetOrtho | ( | int | left, |
int | right, | ||
int | top, | ||
int | bottom, | ||
int | znear, | ||
int | zfar | ||
) |
Set orthogonal projection matrix.
left | Left cliping plane position |
right | Right cliping plane position |
top | Top cliping plane position |
bottom | Bottom cliping plane position |
znear | Distance to near cliping plane |
zfar | Distance to far cliping plane |
void decDMatrix::SetProjection | ( | int | width, |
int | height, | ||
double | fov, | ||
double | fovRatio, | ||
double | znear, | ||
double | zfar | ||
) |
Set projection matrix based on a finite view frustum.
The width and height are used to derive the aspect ratio from.
width | Width of the viewport window |
height | Height of the viewport window |
fov | Vertical field of view of the projection. Indicates the radian angle from the left side of the view frustum to the right side |
fovRatio | Aspect ratio of the horizontal to the vertical field of view. |
znear | Distance to near cliping plane |
zfar | Distance to far cliping plane |
void decDMatrix::SetProjectionInfinite | ( | int | width, |
int | height, | ||
double | fov, | ||
double | fovRatio, | ||
double | znear | ||
) |
Set projection matrix based on a infinite view frustum.
The width and height are used to derive the aspect ratio from.
width | Width of the viewport window |
height | Height of the viewport window |
fov | Vertical field of view of the projection. Indicates the radian angle from the left side of the view frustum to the right side |
fovRatio | Aspect ratio of the horizontal to the vertical field of view. |
znear | Distance to near cliping plane |
void decDMatrix::SetRotation | ( | const decDVector & | r | ) |
Set 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.
void decDMatrix::SetRotation | ( | double | rx, |
double | ry, | ||
double | rz | ||
) |
Set 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.
void decDMatrix::SetRotationAxis | ( | const decDVector & | axis, |
double | angle | ||
) |
Sets rotation around an arbitrary axis matrix.
void decDMatrix::SetRotationX | ( | double | arc | ) |
Sets rotation around the x axis matrix.
void decDMatrix::SetRotationY | ( | double | arc | ) |
Sets rotation around the y axis matrix.
void decDMatrix::SetRotationZ | ( | double | arc | ) |
Sets rotation around the z axis matrix.
void decDMatrix::SetRT | ( | const decDVector & | rot, |
const decDVector & | pos | ||
) |
Set rotation-translation matrix.
This is the same as first doing a 3-axis rotation and then a translation.
rot | Rotation vector |
pos | Translation vector |
void decDMatrix::SetScale | ( | const decDVector & | s | ) |
Sets scaling matrix.
void decDMatrix::SetScale | ( | double | sx, |
double | sy, | ||
double | sz | ||
) |
Sets scaling matrix.
void decDMatrix::SetSRT | ( | const decDVector & | scale, |
const decDVector & | rot, | ||
const decDVector & | pos | ||
) |
Set scale-rotation-translation matrix.
This is the same as first doing a scaling, then a 3-axis rotation and then a translation.
scale | Scaling vector |
rot | Rotation vector |
pos | Translation vector |
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.
void decDMatrix::SetSVUT | ( | const decDVector & | scale, |
const decDVector & | view, | ||
const decDVector & | up, | ||
const decDVector & | pos | ||
) |
Set scale-view-up-translation matrix.
This is the same as first doing a scaling, then a world space matrix.
scale | Scaling vector |
view | View vector |
up | Up vector |
pos | Translation vector |
void decDMatrix::SetTranslation | ( | const decDVector & | t | ) |
Sets translation matrix.
void decDMatrix::SetTranslation | ( | double | x, |
double | y, | ||
double | z | ||
) |
Sets translation matrix.
void decDMatrix::SetVU | ( | const decDVector & | view, |
const decDVector & | up | ||
) |
Set view-up matrix.
This is the same as doing a world space matrix but with the zero vector as position.
view | View vector |
up | Up vector |
void decDMatrix::SetWorld | ( | const decDVector & | pos, |
const decDVector & | view, | ||
const decDVector & | up | ||
) |
Set world space matrix.
A world matrix is used to transform coordinates from the coordinate system of
pos | Position of object |
view | View vector of object not necessary normalized |
up | Up vector of object not necessary normalized |
void decDMatrix::SetWorld | ( | const decDVector & | pos, |
const decQuaternion & | orientation | ||
) |
Set world space matrix.
A world matrix is used to transform coordinates from the coordinate system of one object to another one.
pos | Position of object |
orientation | Orientation |
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.
decMatrix decDMatrix::ToMatrix | ( | ) | const |
Converts to a single precision matrix with possible loss of precision.
decQuaternion decDMatrix::ToQuaternion | ( | ) | const |
Convert matrix into a rotation quaternion.
This conversion is well defined in contrast to the rotation vector function.
void decDMatrix::Transform | ( | decDVector & | result, |
double | x, | ||
double | y, | ||
double | z | ||
) | const |
Transforms a vector.
void decDMatrix::Transform | ( | decDVector4 & | result, |
double | x, | ||
double | y, | ||
double | z, | ||
double | w | ||
) | const |
Transforms a vector.
decDVector decDMatrix::Transform | ( | double | x, |
double | y, | ||
double | z | ||
) | const |
Transforms a vector.
decDVector4 decDMatrix::Transform | ( | double | x, |
double | y, | ||
double | z, | ||
double | w | ||
) | const |
Transforms a vector.
decDVector decDMatrix::TransformNormal | ( | const decDVector & | normal | ) | const |
Transform normal by this matrix.
This is the same as transforming the normal by only the rotation part of it.
decDVector decDMatrix::TransformRight | ( | ) | const |
Right vector of this matrix.
This is the same as transforing the vector (1,0,0) by this matrix but faster.
decDVector decDMatrix::TransformUp | ( | ) | const |
Up vector of this matrix.
This is the same as transforing the vector (0,1,0) by this matrix but faster.
decDVector decDMatrix::TransformView | ( | ) | const |
View vector of this matrix.
This is the same as transforing the vector (0,0,1) by this matrix but faster.
decDMatrix decDMatrix::Transpose | ( | ) | const |
Transpose of this matrix.
double decDMatrix::a11 |
double decDMatrix::a12 |
double decDMatrix::a13 |
double decDMatrix::a14 |
double decDMatrix::a21 |
double decDMatrix::a22 |
double decDMatrix::a23 |
double decDMatrix::a24 |
double decDMatrix::a31 |
double decDMatrix::a32 |
double decDMatrix::a33 |
double decDMatrix::a34 |
double decDMatrix::a41 |
double decDMatrix::a42 |
double decDMatrix::a43 |
double decDMatrix::a44 |