Unigine.mat3 Struct
mat3 Class
Properties
vec3 AxisX#
The normalized vector representing the X axis.
vec3 AxisY#
The normalized vector representing the Y axis.
vec3 AxisZ#
The normalized vector representing the Z axis.
vec3 Diagonal#
The vector with the elements of the main diagonal.
Members
mat3 ( ) #
Default constructor. Produces an identity matrix.mat3 ( float v ) #
Constructor. Initializes the matrix using a given scalar value.mat3(2.0);
/* Creates a matrix
| 2.0 2.0 2.0 |
| 2.0 2.0 2.0 |
| 2.0 2.0 2.0 |
*/
Arguments
- float v - Scalar value.
mat3 ( mat3 m ) #
Constructor. Initializes the matrix by copying a given source matrix.Arguments
- mat3 m - Source matrix.
mat3 ( mat4 m ) #
Constructor. Initializes the matrix using a given mat4 source matrix (4x4). The matrix elements are filled using corresponding elements of the source matrix.Arguments
- mat4 m - Source matrix (4x4).
mat3 ( 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
- dmat4 m - Source matrix (3x4).
mat3 ( mat3 col0, mat3 col1, mat3 col2 ) #
Constructor. Initializes the matrix using given three vec3 vectors.Resulting matrix:
| col0.x col1.x col2.x |
M= | col0.y col1.y col2.y |
| col0.z col1.z col2.z |
Arguments
- mat3 col0 - Source vector for the first column.
- mat3 col1 - Source vector for the second column
- mat3 col2 - Source vector for the third column
mat3 ( 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 |
M= | 2xy - 2wz 1 - 2x² - 2z² 2yz + 2wx |
| 2xz + 2wy 2yz - 2wx 1 - 2x² - 2y² |
Arguments
- quat q - Source quaternion.
mat3 ( float[] m ) #
Constructor. Initializes the vector using a given pointer to the array of float elements.Resulting matrix:
| m[0] m[3] m[6] |
M= | m[1] m[4] m[7] |
| m[2] m[5] m[8] |
| 0.0f 0.0f 0.0f |
Arguments
- float[] m - Pointer to the array of float elements.
void SetIdentity ( ) #
Sets the matrix equal to the identity matrix.quat GetQuat ( ) #
Returns the quaternion of the matrix values.Return value
Quaternion.void SetRotate ( vec3 axis, float angle ) #
Sets the rotation matrix for a given axis.Arguments
- vec3 axis - Rotation axis.
- float angle - Rotation angle, in degrees.
void SetRotateX ( float angle ) #
Sets X rotation matrix.Arguments
- float angle - Rotation angle, in degrees.
void SetRotateY ( float angle ) #
Sets Y rotation matrix.Arguments
- float angle - Rotation angle, in degrees.
void SetRotateZ ( float angle ) #
Sets Z rotation matrix.Arguments
- float angle - Rotation angle, in degrees.
void SetRow ( int row, vec3 v ) #
Sets the specified row of the matrix using a given vec3 vector as a source.Arguments
- int row - Row.
- vec3 v - Source vector.
vec3 GetRow ( int row ) #
Returns the specified matrix row.Arguments
- int row - Row.
Return value
The vec3 vector with column values.void SetScale ( vec3 v ) #
Fills the scaling matrix using a given vec3 source vector.Scaling matrix:
| v.x 0.0f 0.0f |
S= | 0.0f v.y 0.0f |
| 0.0f 0.0f v.z |
Arguments
- vec3 v - Source vector.
mat3 Operator*= ( float v ) #
Performs scalar multiplication.Arguments
- float v - Scalar value.
Return value
Resulting matrix.mat3 Operator*= ( vec2 v ) #
Performs vector multiplication.Arguments
- vec2 v - Vector.
Return value
Resulting matrix.mat3 Operator*= ( vec3 v ) #
Performs vector multiplication.Arguments
- vec3 v - Vector.
Return value
Resulting matrix.mat3 Operator*= ( dvec2 v ) #
Performs vector multiplication.Arguments
- dvec2 v - Vector.
Return value
Resulting matrix.mat3 Operator*= ( dvec3 v ) #
Performs vector multiplication.Arguments
- dvec3 v - Vector.
Return value
Resulting matrix.mat3 Operator+= ( mat3 m ) #
Performs matrix addition.Arguments
- mat3 m - Matrix.
Return value
Resulting matrix.mat3 Operator- ( ) #
Performs matrix negation.Return value
Resulting matrix.mat3 Operator-= ( mat3 m ) #
Performs matrix subtraction.Arguments
- mat3 m - mat3 matrix.
Return value
Resulting matrix.Last update:
2020-11-24
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)