Unigine.Unigine::mat4 Struct
mat4 Class
Members
mat4 ( ) #
Default constructor. Produces an identity matrix.explicit mat4 ( const dmat4 & m ) #
Constructor. Initializes the matrix using a given dmat4 source matrix (3x4). The matrix elements are filled using corresponding elements of the source matrix.Arguments
- const dmat4 & m - Source matrix (3x4).
explicit mat4 ( const quat & q ) #
Constructor. Initializes the matrix using a given source quaternion.For the quaternion (x, y, z, w) the corresponding rotation matrix M is defined as follows:
| 1 - 2y² - 2z² 2xy + 2wz 2xz - 2wy 0.0f |
M= | 2xy - 2wz 1 - 2x² - 2z² 2yz + 2wx 0.0f |
| 2xz + 2wy 2yz - 2wx 1 - 2x² - 2y² 0.0f |
| 0.0f 0.0f 0.0f 1.0f |
Arguments
- const quat & q - Source quaternion.
explicit mat4 ( const float * m, int transpose ) #
Constructor. Initializes the matrix using a given pointer to the source matrix.Arguments
- const float * m - Pointer to the source matrix.
- int transpose - If transpose is 0 (by default), the matrix is specified in the column major style.
mat4 & operator*= ( const mat4 & m ) #
Performs matrix multiplication.Arguments
- const mat4 & m - Matrix.
Return value
Resulting matrix.float & operator[] ( int i ) #
Performs array access to the matrix item reference using given item index.Arguments
- int i - Matrix item index.
Return value
Matrix item reference.float operator[] ( int i ) # const
Performs array access to the matrix item using given item index.Arguments
- int i - Matrix item index.
Return value
Matrix item.Last update:
2019-08-16
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)