This class implements a 4D transformation matrix encoded as column-major.
#include <CTransform.h>
Public Member Functions | |
cTransform () | |
cTransform (const cVector3d &a_pos, const cMatrix3d &a_rot) | |
Constructor of cTransform. More... | |
cTransform (const cVector3d &a_pos) | |
Constructor of cTransform. More... | |
cTransform (const cMatrix3d &a_rot) | |
Constructor of cTransform. More... | |
void | setLocalPos (const cVector3d &a_pos) |
This method builds a transformation matrix from a position vector. More... | |
void | setLocalRot (const cMatrix3d &a_rot) |
This method Builds a transformation matrix from a rotation matrix. More... | |
void | set (const cVector3d &a_pos, const cMatrix3d &a_rot) |
This method Builds a transformation matrix from a position vector and a rotation matrix. More... | |
void | set (const double &a_00, const double &a_01, const double &a_02, const double &a_03, const double &a_10, const double &a_11, const double &a_12, const double &a_13, const double &a_20, const double &a_21, const double &a_22, const double &a_23, const double &a_30, const double &a_31, const double &a_32, const double &a_33) |
This method sets values to all elements of this transformation matrix. More... | |
void | setFrustumMatrix (double a_l, double a_r, double a_b, double a_t, double a_n, double a_f) |
This method creates a frustum matrix. More... | |
void | setLookAtMatrix (const double a_eyeX, const double a_eyeY, const double a_eyeZ, const double a_centerX, const double a_centerY, const double a_centerZ, const double a_upX, const double a_upY, const double a_upZ) |
This method build a transformation matrix. More... | |
void | setLookAtMatrix (const cVector3d &a_eye, const cVector3d &a_lookAt, const cVector3d &a_up) |
This method build a transformation matrix. More... | |
void | setPerspectiveMatrix (const double a_fovy, const double a_aspect, const double a_zNear, const double a_zFar) |
This method builds a perspective matrix. More... | |
double * | getData () |
This method returns a pointer to the matrix array in memory. More... | |
cVector3d | getLocalPos () const |
This method returns the translational component of this matrix. More... | |
cMatrix3d | getLocalRot () const |
This method returns the rotation component of this matrix. More... | |
void | copyto (cTransform &a_destination) const |
This method copies all elements of this matrix to another matrix. More... | |
void | copyfrom (const cTransform &a_source) |
This method copies all elements from another matrix to this one. More... | |
void | identity () |
This method builds an identity matrix. More... | |
void | mul (const cTransform &a_matrix) |
This method left-multiplies this matrix with a transformation matrix passed as argument. More... | |
void | mulr (const cTransform &a_matrix, cTransform &a_result) const |
This method left-multiplies this matrix with a transformation matrix passed as argument. More... | |
void | mulr (const cVector3d &a_vector, cVector3d &a_result) const |
This method multiplies this matrix by a vector passed as argument. More... | |
void | trans () |
This method computes the transpose of this matrix. More... | |
void | transr (cTransform &a_result) const |
This method computes the transpose of this matrix. More... | |
bool | invert () |
This method computes the inverse of this matrix. More... | |
std::string | str (const int a_precision) |
This method converts this matrix to a string representation. More... | |
double & | operator() (const int a_index0, const int a_index1) |
An overloaded () operator. More... | |
const double & | operator() (const int a_index0, const int a_index1) const |
An overloaded () operator. More... | |
Public Attributes | |
double | m [4][4] |
Transformation matrix data. More... | |
bool | m_flagTransform |
If true then matrix encodes a translation and rotation matrix. If false matrix is represents a general 4x4. More... | |
|
inline |
Default constructor of cTransform.
Builds a transformation matrix from a position vector and rotation matrix passed as arguments.
a_pos | Position vector. |
a_rot | Rotation matrix. |
|
inline |
Builds a transformation matrix from a position vector passed as argument.
a_pos | Position vector. |
|
inline |
Build transformation matrix from a rotation matrix passed as argument.
a_rot | Rotation matrix. |
|
inline |
This method builds a transformation matrix from a position vector a_pos
passed as argument.
a_pos | Position vector. |
|
inline |
This method Builds a transformation matrix from a rotation matrix a_rot
passed as argument.
a_rot | Rotation matrix. |
This method Builds a transformation matrix from a position vector a_pos
and a rotation matrix a_rot
passed as arguments.
a_pos | Position vector. |
a_rot | Rotation matrix. |
|
inline |
This method sets values passed as arguments to all elements of this transformation matrix.
a_00 | Matrix element (0,0). |
a_01 | Matrix element (0,1). |
a_02 | Matrix element (0,2). |
a_03 | Matrix element (0,3). |
a_10 | Matrix element (1,0). |
a_11 | Matrix element (1,1). |
a_12 | Matrix element (1,2). |
a_13 | Matrix element (1,3). |
a_20 | Matrix element (2,0). |
a_21 | Matrix element (2,1). |
a_22 | Matrix element (2,2). |
a_23 | Matrix element (2,3). |
a_30 | Matrix element (3,0). |
a_31 | Matrix element (3,1). |
a_32 | Matrix element (3,2). |
a_33 | Matrix element (3,3). |
|
inline |
This method creates a frustum matrix, as defined by the OpenGL glFrustum() function.
a_l | Specifies the coordinate for the left clipping plane. |
a_r | Specifies the coordinate for the right plane. |
a_b | Specifies the coordinate for the bottom and top horizontal clipping plane. |
a_t | Specifies the coordinate for the top horizontal clipping plane. |
a_n | Specifies the distance to the near depth clipping plane. Distance must be positive. |
a_f | Specifies the distance to the far depth clipping plane. Distance must be positive. |
|
inline |
This method build a transformation matrix, according to the OpenGL gluLookAt() function.
a_eyeX | Specifies the position of the eye point. |
a_eyeY | Specifies the position of the eye point. |
a_eyeZ | Specifies the position of the eye point. |
a_centerX | Specifies the position of the reference point. |
a_centerY | Specifies the position of the reference point. |
a_centerZ | Specifies the position of the reference point. |
a_upX | Specifies the direction of the up vector. |
a_upY | Specifies the direction of the up vector. |
a_upZ | Specifies the direction of the up vector. |
|
inline |
This method build a transformation matrix, according to the OpenGL gluLookAt() function.
a_eye | Specifies the position of the eye point. |
a_lookAt | Specifies the position of the reference point. |
a_up | Specifies the direction of the up vector. |
|
inline |
This method builds a perspective matrix, according to the OpenGL gluPerspective() function.
a_fovy | Specifies the field of view angle, in degrees, in the y direction. |
a_aspect | Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). |
a_zNear | Specifies the distance from the viewer to the near clipping plane (always positive). |
a_zFar | Specifies the distance from the viewer to the far clipping plane (always positive). |
|
inline |
This method returns a pointer to the matrix array in memory.
|
inline |
This method returns the translational component of this matrix.
|
inline |
This method returns the rotation component of this matrix.
|
inline |
This method copies all elements of this matrix to another matrix a_destination
passed as argument.
a_destination | Destination matrix. |
|
inline |
This method copies all elements of a matrix a_source
passed as argument to this one.
a_source | Source matrix. |
|
inline |
This method builds an identity matrix with ones on the main diagonal and zeros elsewhere.
|
inline |
This method left-multiplies this matrix with a transformation matrix a_matrix
passed as argument.
The result of this operation is stored in this matrix overwriting previous values.
a_matrix | Input matrix. |
|
inline |
This method left-multiplies this matrix with a transformation matrix a_matrix
passed as argument.
The result of this operation is stored in matrix a_result
passed as second argument.
a_matrix | Input matrix. |
a_result | Result matrix. |
This method multiplies this matrix by a vector a_vector
passed as argument.
The result of this operation is stored in vector a_result
passed as second argument.
a_vector | Input vector. |
a_result | Matrix where the result is stored. |
|
inline |
This method computes the transpose of this matrix.
The result of this operation is stored in this matrix overwriting previous values.
|
inline |
This method computes the transpose of this matrix.
The result of this operation is stored in the result matrix a_result
matrix passed as argument.
a_result | Output matrix. |
|
inline |
This method computes the inverse of this matrix.
If the operation succeeds, the result is stored in this matrix.
|
inline |
This method converts this matrix to a string representation. The output springs displays the three column vectors of matrix.
The number of digits after the decimal point are set by argument a_precision
.
a_precision | Number of digits. |
|
inline |
|
inline |
double chai3d::cTransform::m[4][4] |
bool chai3d::cTransform::m_flagTransform |