class RED::Matrix
Homogeneous 4x4 Matrix for graphical operations. More...
#include <REDMatrix.h>
Inherits: Object.
Public functions:
Matrix ( const RED::Vector3 & iCol0, const RED::Vector3 & iCol1, const RED::Vector3 & iCol2, const RED::Vector3 & iCol3 ) | |
Matrix ( const RED::Vector4 & iCol0, const RED::Vector4 & iCol1, const RED::Vector4 & iCol2, const RED::Vector4 & iCol3 ) | |
Matrix ( ) | |
Matrix ( const float * iCol0, const float * iCol1, const float * iCol2, const float * iCol3 ) | |
Matrix ( const double * iCol0, const double * iCol1, const double * iCol2, const double * iCol3 ) | |
Matrix ( const float * iMat ) | |
Matrix ( double iTranslationX, double iTranslationY, double iScaleX, double iScaleY, double iRotationZ ) | |
Matrix ( const double * iMat ) | |
virtual | ~Matrix ( ) |
virtual void * | As ( const RED::CID & iCID ) |
virtual const void * | As ( const RED::CID & iCID ) const |
template< class T_As > const T_As * | As ( ) const |
template< class T_As > T_As * | As ( ) |
RED::Vector3 | AxisScaling ( ) const |
double | Determinant ( ) const |
RED::Vector4 | GetColumn ( int iColumn ) const |
void | GetColumn ( float oColumn[4], int iColumn ) const |
void | GetColumn ( double oColumn[4], int iColumn ) const |
void | GetColumnMajorMatrix ( float oMat[16] ) const |
void | GetColumnMajorMatrix ( double oMat[16] ) const |
RED_RC | GetInvert ( RED::Matrix & oInverted ) const |
void | GetLineMajorMatrix ( double oMat[16] ) const |
void | GetLineMajorMatrix ( float oMat[16] ) const |
void | GetTranslation ( double oTranslation[3] ) const |
RED::Vector3 | GetTranslation ( ) const |
void | GetTranslation ( float oTranslation[3] ) const |
RED_RC | GetUVDecomposition ( double & oTranslationX, double & oTranslationY, double & oScalingX, double & oScalingY, double & oRotation ) const |
RED_RC | Invert ( ) |
bool | IsDirect ( ) const |
bool | IsIdentity ( double iTolerance = 0.0 ) const |
void | Multiply ( double oVector[3], const double iVector[3] ) const |
void | Multiply ( double oVector[3], const float iVector[3] ) const |
void | Multiply ( float oVector[3], const float iVector[3] ) const |
void | Multiply ( double oVector[3], const RED::Vector3 & iVector ) const |
void | Multiply ( double oVector[3], const RED::Vector4 & iVector ) const |
void | Multiply ( float oVector[3], const RED::Vector3 & iVector ) const |
void | Multiply ( float oVector[3], const RED::Vector4 & iVector ) const |
void | Multiply4 ( double oVector[4], const float iVector[4] ) const |
void | Multiply4 ( float oVector[4], const float iVector[4] ) const |
void | Multiply4 ( double oVector[4], const RED::Vector3 & iVector ) const |
void | Multiply4 ( double oVector[4], const RED::Vector4 & iVector ) const |
void | Multiply4 ( float oVector[4], const RED::Vector3 & iVector ) const |
void | Multiply4 ( float oVector[4], const RED::Vector4 & iVector ) const |
void | Multiply4 ( double oVector[4], const double iVector[4] ) const |
void | Multiply4w1 ( double oVector[4], const float iVector[3] ) const |
void | Multiply4w1 ( double oVector[4], const RED::Vector3 & iVector ) const |
void | Multiply4w1 ( float oVector[4], const float iVector[3] ) const |
void | Multiply4w1 ( float oVector[4], const double iVector[3] ) const |
void | Multiply4w1 ( float oVector[4], const RED::Vector3 & iVector ) const |
void | Multiply4w1 ( double oVector[4], const double iVector[3] ) const |
bool | operator!= ( const RED::Matrix & iOperand ) const |
RED::Matrix | operator* ( const RED::Matrix & iOperand ) const |
RED::Vector4 | operator* ( const RED::Vector3 & iOperand ) const |
RED::Vector4 | operator* ( const RED::Vector4 & iOperand ) const |
void | operator*= ( const RED::Matrix & iOperand ) |
RED::Matrix | operator+ ( const RED::Matrix & iOperand ) const |
void | operator+= ( const RED::Matrix & iOperand ) |
RED::Matrix | operator- ( ) const |
RED::Matrix | operator- ( const RED::Matrix & iOperand ) const |
void | operator-= ( const RED::Matrix & iOperand ) |
bool | operator== ( const RED::Matrix & iOperand ) const |
RED_RC | OrthographicViewmappingMatrix ( double iLeft, double iRight, double iBottom, double iTop, double iDNear, double iDFar ) |
RED_RC | PerspectiveViewmappingMatrix ( double iLeft, double iRight, double iBottom, double iTop, double iDNear, double iDFar ) |
void | Reset ( ) |
RED::Vector3 | Rotate ( const RED::Vector3 & iVector ) const |
void | Rotate ( double oVector[3], const double iVector[3] ) const |
void | Rotate ( double oVector[3], const float iVector[3] ) const |
void | Rotate ( double oVector[3], const RED::Vector3 & iVector ) const |
void | Rotate ( float oVector[3], const RED::Vector3 & iVector ) const |
void | Rotate ( float oVector[3], const float iVector[3] ) const |
RED::Vector3 | RotateNormalize ( const RED::Vector3 & iVector ) const |
void | RotateNormalize ( float oVector[3], const float iVector[3] ) const |
void | RotateNormalize ( float oVector[3], const RED::Vector3 & iVector ) const |
void | RotateNormalize ( double oVector[3], const double iVector[3] ) const |
void | RotateNormalize ( double oVector[3], const float iVector[3] ) const |
void | RotateNormalize ( double oVector[3], const RED::Vector3 & iVector ) const |
RED_RC | RotationAngleMatrix ( const double iCenter[3], double iAx, double iAy, double iAz ) |
RED_RC | RotationAngleMatrix ( const float iCenter[3], float iAx, float iAy, float iAz ) |
RED_RC | RotationAngleMatrix ( const RED::Vector3 & iCenter, float iAx, float iAy, float iAz ) |
RED_RC | RotationAxisMatrix ( const RED::Vector3 & iCenter, const RED::Vector3 & iAxis, double iAngle ) |
RED_RC | RotationAxisMatrix ( const double iCenter[3], const double iAxis[3], double iAngle ) |
RED_RC | RotationAxisMatrix ( const float iCenter[3], const float iAxis[3], float iAngle ) |
void | Scale ( const float iScale[3] ) |
void | Scale ( const double iScale[3] ) |
void | Scale ( const RED::Vector3 & iScale ) |
double | Scaling ( ) const |
void | ScalingAxisMatrix ( const float iCenter[3], const float iScale[3] ) |
void | ScalingAxisMatrix ( const double iCenter[3], const double iScale[3] ) |
void | ScalingAxisMatrix ( const RED::Vector3 & iCenter, const RED::Vector3 & iScale ) |
void | SetColumn ( int iColumn, const double iVector[4] ) |
void | SetColumn ( int iColumn, const RED::Vector3 & iVector ) |
void | SetColumn ( int iColumn, const RED::Vector4 & iVector ) |
void | SetColumn ( int iColumn, const float iVector[4] ) |
void | SetColumnMajorMatrix ( const float iMat[16] ) |
void | SetColumnMajorMatrix ( const double iMat[16] ) |
void | SetLineMajorMatrix ( const double iMat[16] ) |
void | SetLineMajorMatrix ( const float iMat[16] ) |
void | SetTranslation ( const double iTranslation[3] ) |
void | SetTranslation ( const RED::Vector3 & iTranslation ) |
void | SetTranslation ( const float iTranslation[3] ) |
void | Translate ( const float iTranslate[3] ) |
void | Translate ( const double iTranslate[3] ) |
void | Translate ( const RED::Vector3 & iTranslate ) |
void | Transpose ( ) |
Public static functions:
static RED::CID | GetClassID ( ) |
Public variables:
double | _mat [4][4] |
Public static variables:
static const RED::Matrix | IDENTITY |
static const RED::Matrix | ZERO |
Detailed description:
Homogeneous 4x4 Matrix for graphical operations.
The RED::Matrix defines all transformations that are applicable to 3d objects using homogeneous coordinates.
Matrix coordinates are stored in a 4x4 float array.
Orientation convention is matx[row][column] (line major), so we access the following elements at these positions in the array:
(0,0) | (0,1) | (0,2) | (0,3) |
(1,0) | (1,1) | (1,2) | (1,3) |
(2,0) | (2,1) | (2,2) | (2,3) |
(3,0) | (3,1) | (3,2) | (3,3) |
Vectors are each representing one column. For example second matrix vector is made of [(0,1), (1,1), (2,1), (3,1)]. Translation is stored by [(0,3), (1,3), (2,3)].
The matrix is stored in double precision.
Functions documentation
public RED::Matrix::Matrix | ( | const RED::Vector3 & | iCol0, |
const RED::Vector3 & | iCol1, | ||
const RED::Vector3 & | iCol2, | ||
const RED::Vector3 & | iCol3 | ||
) |
Matrix construction method by column vectors.
Builds a matrix using the 4 provided column vectors. The 4-th column member is implicitly set to 0.0 for the 3 base columns and 1.0 for 'iCol3' (the translation).
Parameters:
iCol0: | First matrix column: 00 10 20 (0.0f). |
iCol1: | Second matrix column: 01 11 21 (0.0f). |
iCol2: | Third matrix column: 02 12 22 (0.0f). |
iCol3: | Fourth matrix column: 03 13 23 (1.0f). |
public RED::Matrix::Matrix | ( | const RED::Vector4 & | iCol0, |
const RED::Vector4 & | iCol1, | ||
const RED::Vector4 & | iCol2, | ||
const RED::Vector4 & | iCol3 | ||
) |
Matrix construction method by column vectors.
Builds a matrix using the 4 provided column vectors.
Parameters:
iCol0: | First matrix column. |
iCol1: | Second matrix column. |
iCol2: | Third matrix column |
iCol3: | Fourth matrix column. |
public RED::Matrix::Matrix | ( | ) |
Matrix construction method.
Builds an identity matrix.
public RED::Matrix::Matrix | ( | const float * | iCol0, |
const float * | iCol1, | ||
const float * | iCol2, | ||
const float * | iCol3 | ||
) |
Matrix construction method by column vectors.
Builds a matrix using the 4 provided column vectors.
Parameters:
iCol0: | First matrix column - 4 terms. |
iCol1: | Second matrix column - 4 terms. |
iCol2: | Third matrix column - 4 terms. |
iCol3: | Fourth matrix column - 4 terms. |
public RED::Matrix::Matrix | ( | const double * | iCol0, |
const double * | iCol1, | ||
const double * | iCol2, | ||
const double * | iCol3 | ||
) |
Matrix construction method by column vectors.
Builds a matrix using the 4 provided column vectors.
Parameters:
iCol0: | First matrix column - 4 terms. |
iCol1: | Second matrix column - 4 terms. |
iCol2: | Third matrix column - 4 terms. |
iCol3: | Fourth matrix column - 4 terms. |
public RED::Matrix::Matrix | ( | const float * | iMat | ) |
Matrix construction method from a floating point array.
Constructs a matrix given the 'iMat' array parameter. If the 'iMat' parameter is set to NULL, a zero matrix is constructed.
Parameters:
iMat: | A 16 float array that must respect the line major memory order: 00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33. |
public RED::Matrix::Matrix | ( | double | iTranslationX, |
double | iTranslationY, | ||
double | iScaleX, | ||
double | iScaleY, | ||
double | iRotationZ | ||
) |
UV transformation matrix construction helper.
This method lets you create a 'standard' uv transformation matrix. The pivot of the concatenated transformations is hard-coded to be at (0.5, 0.5, 0.0), i.e the center of the texture.
Allowed operations are xy-translation, xy-scaling and z-rotation. Please, note that only positive (or null) scaling values are allowed.
This is the prefered method for creating uv transformation matrices as parameters can later be retrieved using the RED::Matrix::GetUVDecomposition method and mapped to material controller properties.
Parameters:
iTranslationX: | translation along the x-axis. |
iTranslationY: | translation along the y-axis. |
iScaleX: | scaling along the x-axis. |
iScaleY: | scaling along the y-axis. |
iRotationZ: | rotation angle in radians around the z-axis. |
public RED::Matrix::Matrix | ( | const double * | iMat | ) |
Matrix construction method from a double precision floating point array.
Constructs a matrix given the 'iMat' array parameter. If the 'iMat' parameter is set to NULL, a zero matrix is constructed.
Parameters:
iMat: | A 16 double precision float array that must respect the line major memory order: 00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33. |
public virtual RED::Matrix::~Matrix | ( | ) |
Matrix destruction method.
public static RED::CID RED::Matrix::GetClassID | ( | ) |
Reimplements: RED::Object::GetClassID.
public virtual void * RED::Matrix::As | ( | const RED::CID & | iCID | ) |
Converts the object to an instance of the given type.
Parameters:
iCID: | Requested class. |
Returns:
Reimplements: RED::Object::As.
public virtual const void * RED::Matrix::As | ( | const RED::CID & | iCID | ) const |
Converts the object to an instance of the given type.
Parameters:
iCID: | Requested class. |
Returns:
Reimplements: RED::Object::As.
template< class T_As > public const T_As * RED::Matrix::As | ( | ) const |
Template version of the as const method.
Simply set T to be the class you want to retrieve an interface to.
Returns:
Reimplements: RED::Object::As.
template< class T_As > public T_As * RED::Matrix::As | ( | ) |
Template version of the as method.
Simply set T to be the class you want to retrieve an interface to.
Returns:
Reimplements: RED::Object::As.
public RED::Vector3 RED::Matrix::AxisScaling | ( | ) const |
Computes differential axis scaling.
Returns the per axis (e.g. column vector) scaling of the matrix.
Returns:
public double RED::Matrix::Determinant | ( | ) const |
Computes matrix determinant - rotation part.
Returns:
public RED::Vector4 RED::Matrix::GetColumn | ( | int | iColumn | ) const |
Retrieves a matrix column vector.
Parameters:
iColumn: | The column vector number in [0,3]. |
Returns:
public void RED::Matrix::GetColumn | ( | float | oColumn[4], |
int | iColumn | ||
) | const |
Retrieves a matrix column vector.
Parameters:
oColumn: | The column vector. |
iColumn: | The column vector number in [0,3]. |
public void RED::Matrix::GetColumn | ( | double | oColumn[4], |
int | iColumn | ||
) | const |
Retrieves a matrix column vector.
Parameters:
oColumn: | The column vector. |
iColumn: | The column vector number in [0,3]. |
public void RED::Matrix::GetColumnMajorMatrix | ( | float | oMat[16] | ) const |
Returns the matrix under the column major convention.
This method returns the 16 float matrix tab under the column major convention.
Line major memory order: 00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33.
Column major version of the same array: 00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33.
Parameters:
oMat: | Allocated 16 float array filled with the transposed '_mat'. |
public void RED::Matrix::GetColumnMajorMatrix | ( | double | oMat[16] | ) const |
Returns the matrix under the column major convention.
This method returns the 16 float matrix tab under the column major convention.
Line major memory order: 00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33.
Column major version of the same array: 00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33.
Parameters:
oMat: | Allocated 16 float array filled with the transposed '_mat'. |
public RED_RC RED::Matrix::GetInvert | ( | RED::Matrix & | oInverted | ) const |
public void RED::Matrix::GetLineMajorMatrix | ( | double | oMat[16] | ) const |
Returns the matrix array using the line major convention.
This method returns the 16 float matrix tab under the line major convention.
Line major memory order: 00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33.
Column major version of the same array: 00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33.
Parameters:
oMat: | A 16 float array filled with the matrix elements. |
public void RED::Matrix::GetLineMajorMatrix | ( | float | oMat[16] | ) const |
Returns the matrix array using the line major convention.
This method returns the 16 float matrix tab under the line major convention.
Line major memory order: 00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33.
Column major version of the same array: 00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33.
Parameters:
oMat: | A 16 float array filled with the matrix elements. |
public void RED::Matrix::GetTranslation | ( | double | oTranslation[3] | ) const |
Gets the matrix translation vector.
Parameters:
oTranslation: | The translation vector. |
public RED::Vector3 RED::Matrix::GetTranslation | ( | ) const |
Gets the matrix translation vector.
Returns:
public void RED::Matrix::GetTranslation | ( | float | oTranslation[3] | ) const |
Gets the matrix translation vector.
Parameters:
oTranslation: | The translation vector. |
public RED_RC RED::Matrix::GetUVDecomposition | ( | double & | oTranslationX, |
double & | oTranslationY, | ||
double & | oScalingX, | ||
double & | oScalingY, | ||
double & | oRotation | ||
) | const |
Returns the xy-offset, xy-scaling and z-rotation informations from a uv coordinates transform matrix.
When using matrices for uv mapping transformations, it may be useful to extract back the offset, scaling and rotation informations (to be used along with a material controller for example).
This method works only for matrices encoding 2D scaling (along x & y), 2D translation (along x & y) and rotation around the z-axis. If a matrix encoding another kind of transformation is used as input to the method, the result will be undetermined.
Parameters:
oTranslationX: | reference to the returned translation along the x-axis. |
oTranslationY: | reference to the returned translation along the y-axis. |
oScalingX: | reference to the returned scaling along the x-axis (should be positive or null). |
oScalingY: | reference to the returned scaling along the y-axis (should be positive or null). |
oRotation: | reference to the returned z-rotation angle in radians. |
Returns:
public RED_RC RED::Matrix::Invert | ( | ) |
public bool RED::Matrix::IsDirect | ( | ) const |
Tests whether 'this' is direct or not.
Returns:
public bool RED::Matrix::IsIdentity | ( | double | iTolerance = 0.0 | ) const |
Tests whether 'this' is equal to the identity matrix or not.
Parameters:
iTolerance: | Perform the comparison at a given tolerance. |
Returns:
public void RED::Matrix::Multiply | ( | double | oVector[3], |
const double | iVector[3] | ||
) | const |
Non homogeneous multiplication of a vector by the matrix.
The destination address can't be the same as the source address.
Parameters:
oVector: | The resulting vector. |
iVector: | The input vector. |
public void RED::Matrix::Multiply | ( | double | oVector[3], |
const float | iVector[3] | ||
) | const |
Non homogeneous multiplication of a vector by the matrix.
The destination address can't be the same as the source address.
Parameters:
oVector: | The resulting vector. |
iVector: | The input vector. |
public void RED::Matrix::Multiply | ( | float | oVector[3], |
const float | iVector[3] | ||
) | const |
Non homogeneous multiplication of a vector by the matrix.
The destination address can't be the same as the source address.
Parameters:
oVector: | The resulting vector. |
iVector: | The input vector. |
public void RED::Matrix::Multiply | ( | double | oVector[3], |
const RED::Vector3 & | iVector | ||
) | const |
Non homogeneous multiplication of a vector by the matrix.
Parameters:
oVector: | The resulting vector. |
iVector: | The input vector. |
public void RED::Matrix::Multiply | ( | double | oVector[3], |
const RED::Vector4 & | iVector | ||
) | const |
Non homogeneous multiplication of a vector by the matrix.
Parameters:
oVector: | The resulting vector. |
iVector: | The input vector (the w component is ignored). |
public void RED::Matrix::Multiply | ( | float | oVector[3], |
const RED::Vector3 & | iVector | ||
) | const |
Non homogeneous multiplication of a vector by the matrix.
Parameters:
oVector: | The resulting vector. |
iVector: | The input vector. |
public void RED::Matrix::Multiply | ( | float | oVector[3], |
const RED::Vector4 & | iVector | ||
) | const |
Non homogeneous multiplication of a vector by the matrix.
Parameters:
oVector: | The resulting vector. |
iVector: | The input vector (the w component is ignored). |
public void RED::Matrix::Multiply4 | ( | double | oVector[4], |
const float | iVector[4] | ||
) | const |
Homogeneous multiplication of a vector by the matrix.
The destination address can't be the same as the source address.
Parameters:
oVector: | The resulting vector. |
iVector: | The input vector. |
public void RED::Matrix::Multiply4 | ( | float | oVector[4], |
const float | iVector[4] | ||
) | const |
Homogeneous multiplication of a vector by the matrix.
The destination address can't be the same as the source address.
Parameters:
oVector: | The resulting vector. |
iVector: | The input vector. |
public void RED::Matrix::Multiply4 | ( | double | oVector[4], |
const RED::Vector3 & | iVector | ||
) | const |
Homogeneous multiplication of a vector by the matrix.
Parameters:
oVector: | The resulting vector. |
iVector: | The input vector. |
public void RED::Matrix::Multiply4 | ( | double | oVector[4], |
const RED::Vector4 & | iVector | ||
) | const |
Homogeneous multiplication of a vector by the matrix.
Parameters:
oVector: | The resulting vector. |
iVector: | The input vector. |
public void RED::Matrix::Multiply4 | ( | float | oVector[4], |
const RED::Vector3 & | iVector | ||
) | const |
Homogeneous multiplication of a vector by the matrix.
Parameters:
oVector: | The resulting vector. |
iVector: | The input vector. |
public void RED::Matrix::Multiply4 | ( | float | oVector[4], |
const RED::Vector4 & | iVector | ||
) | const |
Homogeneous multiplication of a vector by the matrix.
Parameters:
oVector: | The resulting vector. |
iVector: | The input vector. |
public void RED::Matrix::Multiply4 | ( | double | oVector[4], |
const double | iVector[4] | ||
) | const |
Homogeneous multiplication of a vector by the matrix.
The destination address can't be the same as the source address.
Parameters:
oVector: | The resulting vector. |
iVector: | The input vector. |
public void RED::Matrix::Multiply4w1 | ( | double | oVector[4], |
const float | iVector[3] | ||
) | const |
Homogeneous multiplication of a vector by the matrix.
iVector is assumed to have a homogeneous coordinate equal to 1.0.
Parameters:
oVector: | The resulting vector. |
iVector: | The input vector (x,y,z,1). |
public void RED::Matrix::Multiply4w1 | ( | double | oVector[4], |
const RED::Vector3 & | iVector | ||
) | const |
Homogeneous multiplication of a vector by the matrix.
iVector is assumed to have a homogeneous coordinate equal to 1.0.
Parameters:
oVector: | The resulting vector. |
iVector: | The input vector (x,y,z,1). |
public void RED::Matrix::Multiply4w1 | ( | float | oVector[4], |
const float | iVector[3] | ||
) | const |
Homogeneous multiplication of a vector by the matrix.
iVector is assumed to have a homogeneous coordinate equal to 1.0.
Parameters:
oVector: | The resulting vector. |
iVector: | The input vector (x,y,z,1). |
public void RED::Matrix::Multiply4w1 | ( | float | oVector[4], |
const double | iVector[3] | ||
) | const |
Homogeneous multiplication of a vector by the matrix.
iVector is assumed to have a homogeneous coordinate equal to 1.0.
Parameters:
oVector: | The resulting vector. |
iVector: | The input vector (x,y,z,1). |
public void RED::Matrix::Multiply4w1 | ( | float | oVector[4], |
const RED::Vector3 & | iVector | ||
) | const |
Homogeneous multiplication of a vector by the matrix.
iVector is assumed to have a homogeneous coordinate equal to 1.0.
Parameters:
oVector: | The resulting vector. |
iVector: | The input vector (x,y,z,1). |
public void RED::Matrix::Multiply4w1 | ( | double | oVector[4], |
const double | iVector[3] | ||
) | const |
Homogeneous multiplication of a vector by the matrix.
iVector is assumed to have a homogeneous coordinate equal to 1.0.
Parameters:
oVector: | The resulting vector. |
iVector: | The input vector (x,y,z,1). |
public bool RED::Matrix::operator!= | ( | const RED::Matrix & | iOperand | ) const |
Difference test operator.
Parameters:
iOperand: | The source matrix compared to this. |
Returns:
public RED::Matrix RED::Matrix::operator* | ( | const RED::Matrix & | iOperand | ) const |
Matrix multiplication operator.
Returns:
public RED::Vector4 RED::Matrix::operator* | ( | const RED::Vector3 & | iOperand | ) const |
Homogeneous multiplication of a vector by the matrix.
Returns:
public RED::Vector4 RED::Matrix::operator* | ( | const RED::Vector4 & | iOperand | ) const |
Homogeneous multiplication of a vector by the matrix.
Returns:
public void RED::Matrix::operator*= | ( | const RED::Matrix & | iOperand | ) |
Matrix multiplication operator.
Multiplt this by iOperand.
public RED::Matrix RED::Matrix::operator+ | ( | const RED::Matrix & | iOperand | ) const |
Matrix addition operator.
Returns:
public void RED::Matrix::operator+= | ( | const RED::Matrix & | iOperand | ) |
Matrix addition operator.
Adds the contents of iOperand to this.
public RED::Matrix RED::Matrix::operator- | ( | ) const |
Returns the opposite of the matrix.
Returns:
public RED::Matrix RED::Matrix::operator- | ( | const RED::Matrix & | iOperand | ) const |
Matrix subtraction operator.
Returns:
public void RED::Matrix::operator-= | ( | const RED::Matrix & | iOperand | ) |
Matrix subtraction operator.
Subtract the contents of iOperand to this.
public bool RED::Matrix::operator== | ( | const RED::Matrix & | iOperand | ) const |
Equality test operator.
Parameters:
iOperand: | The source matrix compared to this. |
Returns:
public RED_RC RED::Matrix::OrthographicViewmappingMatrix | ( | double | iLeft, |
double | iRight, | ||
double | iBottom, | ||
double | iTop, | ||
double | iDNear, | ||
double | iDFar | ||
) |
Sets the matrix to a parallel viewmapping transformation matrix.
This method sets the content of This to define a parallel viewmapping transformation. The content of the matrix is as follows, provided a frustum defined by (l,r,b,t,n,f):
2/(r-l) | 0 | 0 | -(r+l)/(r-l) |
0 | 2/(t-b) | 0 | -(t+b)/(t-b) |
0 | 0 | -2/(f-n) | -(f+n)/(f-n) |
0 | 0 | 0 | 1 |
Where (l,b,n) is the coordinate set of the lower left near corner of the viewing parallelogram, and (r,t,f) the coordinates of it's top right far corner (that are coordinates of the pyramid clip planes either).
Parameters:
iLeft: | Coordinate of the left vertical clipping plane. |
iRight: | Coordinate of the right vertical clipping plane. |
iBottom: | Coordinate of the bottom horizontal clipping plane. |
iTop: | Coordinate of the top horizontal clipping plane. |
iDNear: | Distance to the near depth clipping plane. |
iDFar: | Distance to the far depth clipping plane. |
public RED_RC RED::Matrix::PerspectiveViewmappingMatrix | ( | double | iLeft, |
double | iRight, | ||
double | iBottom, | ||
double | iTop, | ||
double | iDNear, | ||
double | iDFar | ||
) |
Sets the matrix to a perspective frustum viewmapping transformation matrix.
This method sets the content of This to define a perspective viewmapping transformation. The content of the matrix is as follows, provided a frustum defined by (l,r,b,t,n,f):
2n/(r-l) | 0 | (r+l)/(r-l) | 0 |
0 | 2n/(t-b) | (t+b)/(t-b) | 0 |
0 | 0 | -(f+n)/(f-n) | -2fn/(f-n) |
0 | 0 | -1 | 0 |
Where (l,b,n) is the coordinate set of the lower left near corner of the viewing pyramid, and (r,t,f) the coordinates of it's top right far corner (that are coordinates of the pyramid clip planes either).
Parameters:
iLeft: | Coordinate of the left vertical clipping plane. |
iRight: | Coordinate of the right vertical clipping plane. |
iBottom: | Coordinate of the bottom horizontal clipping plane. |
iTop: | Coordinate of the top horizontal clipping plane. |
iDNear: | Distance to the near depth clipping plane. |
iDFar: | Distance to the far depth clipping plane. |
public void RED::Matrix::Reset | ( | ) |
Resets the matrix to the identity.
public RED::Vector3 RED::Matrix::Rotate | ( | const RED::Vector3 & | iVector | ) const |
Rotation of the source vector by the matrix.
The matrix is reduced to a [3x3] rotation matrix and is applied to iVector.
Parameters:
iVector: | The input vector. |
Returns:
public void RED::Matrix::Rotate | ( | double | oVector[3], |
const double | iVector[3] | ||
) | const |
Rotation of the source vector by the matrix.
The matrix is reduced to a [3x3] rotation matrix and is applied to iVector. The destination address can't be the same as the source address.
Parameters:
oVector: | The resulting rotated vector. |
iVector: | The input vector. |
public void RED::Matrix::Rotate | ( | double | oVector[3], |
const float | iVector[3] | ||
) | const |
Rotation of the source vector by the matrix.
The matrix is reduced to a [3x3] rotation matrix and is applied to iVector. The destination address can't be the same as the source address.
Parameters:
oVector: | The resulting rotated vector. |
iVector: | The input vector. |
public void RED::Matrix::Rotate | ( | double | oVector[3], |
const RED::Vector3 & | iVector | ||
) | const |
Rotation of the source vector by the matrix.
The matrix is reduced to a [3x3] rotation matrix and is applied to iVector. The destination address can't be the same as the source address.
Parameters:
oVector: | The resulting rotated vector. |
iVector: | The input vector. |
public void RED::Matrix::Rotate | ( | float | oVector[3], |
const RED::Vector3 & | iVector | ||
) | const |
Rotation of the source vector by the matrix.
The matrix is reduced to a [3x3] rotation matrix and is applied to iVector.
Parameters:
oVector: | The resulting rotated vector. |
iVector: | The input vector. |
public void RED::Matrix::Rotate | ( | float | oVector[3], |
const float | iVector[3] | ||
) | const |
Rotation of the source vector by the matrix.
The matrix is reduced to a [3x3] rotation matrix and is applied to iVector. The destination address can't be the same as the source address.
Parameters:
oVector: | The resulting rotated vector. |
iVector: | The input vector. |
public RED::Vector3 RED::Matrix::RotateNormalize | ( | const RED::Vector3 & | iVector | ) const |
Rotation of the source vector by the matrix, normalization of the result.
The matrix is reduced to a [3x3] rotation matrix and is applied to iVector.
Parameters:
iVector: | The input vector. |
Returns:
public void RED::Matrix::RotateNormalize | ( | float | oVector[3], |
const float | iVector[3] | ||
) | const |
Rotation of the source vector by the matrix, normalization of the result.
The matrix is reduced to a [3x3] rotation matrix and is applied to iVector. The destination address can't be the same as the source address.
Parameters:
oVector: | The resulting rotated vector. |
iVector: | The input vector. |
public void RED::Matrix::RotateNormalize | ( | float | oVector[3], |
const RED::Vector3 & | iVector | ||
) | const |
Rotation of the source vector by the matrix, normalization of the result.
The matrix is reduced to a [3x3] rotation matrix and is applied to iVector.
Parameters:
oVector: | The resulting rotated vector. |
iVector: | The input vector. |
public void RED::Matrix::RotateNormalize | ( | double | oVector[3], |
const double | iVector[3] | ||
) | const |
Rotation of the source vector by the matrix, normalization of the result.
The matrix is reduced to a [3x3] rotation matrix and is applied to iVector. The destination address can't be the same as the source address.
Parameters:
oVector: | The resulting rotated vector. |
iVector: | The input vector. |
public void RED::Matrix::RotateNormalize | ( | double | oVector[3], |
const float | iVector[3] | ||
) | const |
Rotation of the source vector by the matrix, normalization of the result.
The matrix is reduced to a [3x3] rotation matrix and is applied to iVector. The destination address can't be the same as the source address.
Parameters:
oVector: | The resulting rotated vector. |
iVector: | The input vector. |
public void RED::Matrix::RotateNormalize | ( | double | oVector[3], |
const RED::Vector3 & | iVector | ||
) | const |
Rotation of the source vector by the matrix, normalization of the result.
The matrix is reduced to a [3x3] rotation matrix and is applied to iVector.
Parameters:
oVector: | The resulting rotated vector. |
iVector: | The input vector. |
public RED_RC RED::Matrix::RotationAngleMatrix | ( | const double | iCenter[3], |
double | iAx, | ||
double | iAy, | ||
double | iAz | ||
) |
Defines a cumulated rotation matrix around each axis.
This method sets the matrix parameters to a rotation matrix defined by three cumulated rotation operations. Let be (Mx,My,Mz) the three column vectors of the matrix. We perform the following operations:
- A rotation around Mx of iAx, resulting in: (Mx,My',Mz').
- A rotation around My' of iAy, resulting in: (Mx',My',Mz'').
- A rotation around Mz'' of iAz, resulting in: (Mx'',My'',Mz'').
- A translation of 'iCenter'.
Parameters:
iCenter: | Center of the rotation matrix. |
iAx: | Angle of rotation around Mx in radians. |
iAy: | Angle of rotation around My' in radians. |
iAz: | Angle of rotation around Mz'' in radians. |
Returns:
public RED_RC RED::Matrix::RotationAngleMatrix | ( | const float | iCenter[3], |
float | iAx, | ||
float | iAy, | ||
float | iAz | ||
) |
Defines a cumulated rotation matrix around each axis.
This method sets the matrix parameters to a rotation matrix defined by three cumulated rotation operations. Let be (Mx,My,Mz) the three column vectors of the matrix. We perform the following operations:
- A rotation around Mx of iAx, resulting in: (Mx,My',Mz').
- A rotation around My' of iAy, resulting in: (Mx',My',Mz'').
- A rotation around Mz'' of iAz, resulting in: (Mx'',My'',Mz'').
- A translation of 'iCenter'.
Parameters:
iCenter: | Center of the rotation matrix. |
iAx: | Angle of rotation around Mx in radians. |
iAy: | Angle of rotation around My' in radians. |
iAz: | Angle of rotation around Mz'' in radians. |
Returns:
public RED_RC RED::Matrix::RotationAngleMatrix | ( | const RED::Vector3 & | iCenter, |
float | iAx, | ||
float | iAy, | ||
float | iAz | ||
) |
Defines a cumulated rotation matrix around each axis.
This method sets the matrix parameters to a rotation matrix defined by three cumulated rotation operations. Let be (Mx,My,Mz) the three column vectors of the matrix. We perform the following operations:
- A rotation around Mx of iAx, resulting in: (Mx,My',Mz').
- A rotation around My' of iAy, resulting in: (Mx',My',Mz'').
- A rotation around Mz'' of iAz, resulting in: (Mx'',My'',Mz'').
- A translation of 'iCenter'.
Parameters:
iCenter: | Center of the rotation matrix. |
iAx: | Angle of rotation around Mx in radians. |
iAy: | Angle of rotation around My' in radians. |
iAz: | Angle of rotation around Mz'' in radians. |
Returns:
public RED_RC RED::Matrix::RotationAxisMatrix | ( | const RED::Vector3 & | iCenter, |
const RED::Vector3 & | iAxis, | ||
double | iAngle | ||
) |
Sets the matrix to the definition of a central rotation.
This method sets all matrix parameters to the definition of an axial rotation around 'iCenter' / 'iAxis', rotating of 'iAngle'.
Parameters:
iCenter: | The rotation axis definition point. |
iAxis: | The rotation axis definition direction. |
iAngle: | The angle of rotation around ( 'iCenter', 'iAxis' ) in radians. |
Returns:
public RED_RC RED::Matrix::RotationAxisMatrix | ( | const double | iCenter[3], |
const double | iAxis[3], | ||
double | iAngle | ||
) |
Sets the matrix to the definition of a central rotation.
This method sets all matrix parameters to the definition of an axial rotation around 'iCenter' / 'iAxis', rotating of 'iAngle'.
Parameters:
iCenter: | The rotation axis definition point. |
iAxis: | The rotation axis definition direction. |
iAngle: | The angle of rotation around ( 'iCenter', 'iAxis' ) in radians. |
Returns:
public RED_RC RED::Matrix::RotationAxisMatrix | ( | const float | iCenter[3], |
const float | iAxis[3], | ||
float | iAngle | ||
) |
Sets the matrix to the definition of a central rotation.
This method sets all matrix parameters to the definition of an axial rotation around 'iCenter' / 'iAxis', rotating of 'iAngle'.
Parameters:
iCenter: | The rotation axis definition point. |
iAxis: | The rotation axis definition direction. |
iAngle: | The angle of rotation around ( 'iCenter', 'iAxis' ) in radians. |
Returns:
public void RED::Matrix::Scale | ( | const float | iScale[3] | ) |
Scales the matrix by a per-vector component.
This method multiplies each column of the matrix (excepted the translation) by the provided axial scaling vector.
Parameters:
iScale: | RED::Vector3 scaling vector. |
public void RED::Matrix::Scale | ( | const double | iScale[3] | ) |
Scales the matrix by a per-vector component.
This method multiplies each column of the matrix (excepted the translation) by the provided axial scaling vector.
Parameters:
iScale: | RED::Vector3 scaling vector. |
public void RED::Matrix::Scale | ( | const RED::Vector3 & | iScale | ) |
Scales the matrix by a per-vector component.
This method multiplies each column of the matrix (excepted the translation) by the provided axial scaling vector.
Parameters:
iScale: | RED::Vector3 scaling vector. |
public double RED::Matrix::Scaling | ( | ) const |
Computes maximal matrix scaling.
Returns:
public void RED::Matrix::ScalingAxisMatrix | ( | const float | iCenter[3], |
const float | iScale[3] | ||
) |
Defines a central scaling matrix.
This method sets a central scaling matrix around 'iCenter', of 'iScale' axial scaling.
Parameters:
iCenter: | The scaling center. |
iScale: | The axis scaling factor applied. |
public void RED::Matrix::ScalingAxisMatrix | ( | const double | iCenter[3], |
const double | iScale[3] | ||
) |
Defines a central scaling matrix.
This method sets a central scaling matrix around 'iCenter', of 'iScale' axial scaling.
Parameters:
iCenter: | The scaling center. |
iScale: | The axis scaling factor applied. |
public void RED::Matrix::ScalingAxisMatrix | ( | const RED::Vector3 & | iCenter, |
const RED::Vector3 & | iScale | ||
) |
Defines a central scaling matrix.
This method sets a central scaling matrix around 'iCenter', of 'iScale' axial scaling.
Parameters:
iCenter: | The scaling center. |
iScale: | The axis scaling factor applied. |
public void RED::Matrix::SetColumn | ( | int | iColumn, |
const double | iVector[4] | ||
) |
SetColumn: Set a matrix column vector.
Parameters:
iColumn: | The column vector number in [0,3]. |
iVector: | The column vector. |
public void RED::Matrix::SetColumn | ( | int | iColumn, |
const RED::Vector3 & | iVector | ||
) |
Sets a matrix column vector.
The 4th vector component is set to 0.0 for columns 0, 1, 2 and is set to 1.0 for the column number 3.
Parameters:
iColumn: | The column vector number in [0,3]. |
iVector: | The column vector. |
public void RED::Matrix::SetColumn | ( | int | iColumn, |
const RED::Vector4 & | iVector | ||
) |
Sets a matrix column vector.
Parameters:
iColumn: | The column vector number in [0,3]. |
iVector: | The column vector. |
public void RED::Matrix::SetColumn | ( | int | iColumn, |
const float | iVector[4] | ||
) |
Sets a matrix column vector.
Parameters:
iColumn: | The column vector number in [0,3]. |
iVector: | The column vector. |
public void RED::Matrix::SetColumnMajorMatrix | ( | const float | iMat[16] | ) |
Defines a matrix from a column major matrix array.
Parameters:
iMat: | Column major matrix array. |
public void RED::Matrix::SetColumnMajorMatrix | ( | const double | iMat[16] | ) |
Defines a matrix from a column major matrix array.
Parameters:
iMat: | Column major matrix array. |
public void RED::Matrix::SetLineMajorMatrix | ( | const double | iMat[16] | ) |
Defines a matrix from a line major matrix array.
Parameters:
iMat: | Line major matrix array. |
public void RED::Matrix::SetLineMajorMatrix | ( | const float | iMat[16] | ) |
Defines a matrix from a line major matrix array.
Parameters:
iMat: | Line major matrix array. |
public void RED::Matrix::SetTranslation | ( | const double | iTranslation[3] | ) |
Sets the matrix translation column.
Parameters:
iTranslation: | The translation vector. |
public void RED::Matrix::SetTranslation | ( | const RED::Vector3 & | iTranslation | ) |
Sets the matrix translation column.
Parameters:
iTranslation: | The translation vector. |
public void RED::Matrix::SetTranslation | ( | const float | iTranslation[3] | ) |
Sets the matrix translation column.
Parameters:
iTranslation: | The translation vector. |
public void RED::Matrix::Translate | ( | const float | iTranslate[3] | ) |
Translates the matrix by a translation vector.
Adds iTranslate to the current matrix translation.
Parameters:
iTranslate: | Translation vector. |
public void RED::Matrix::Translate | ( | const double | iTranslate[3] | ) |
Translates the matrix by a translation vector.
Adds iTranslate to the current matrix translation.
Parameters:
iTranslate: | Translation vector. |
public void RED::Matrix::Translate | ( | const RED::Vector3 & | iTranslate | ) |
Translates the matrix by a translation vector.
Adds iTranslate to the current matrix translation.
Parameters:
iTranslate: | Translation vector. |
public void RED::Matrix::Transpose | ( | ) |
Transposition of the rotation part of the matrix.
Computes the transposed matrix of this, replacing the previous matrix contents.
Variables documentation
Matrix elements.
Identity matrix.
Zero matrix.