This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

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.
Source code (UnigineScript)
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 ( const mat3 & m ) #

Constructor. Initializes the matrix by copying a given source matrix.

Arguments

  • const mat3 & m - Source matrix.

mat3 ( const 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

  • const mat4 & m - Source matrix (4x4).

mat3 ( 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).

mat3 ( const vec3 & col0, const vec3 & col1, const vec3 & col2 ) #

Constructor. Initializes the matrix using given three vec3 vectors.
Output
Resulting matrix: 
    | col0.x  	 col1.x	  	col2.x | 
M=  | col0.y   	 col1.y     col2.y |
    | col0.z   	 col1.z     col2.z |

Arguments

  • const vec3 & col0 - Source vector for the first column.
  • const vec3 & col1 - Source vector for the second column
  • const vec3 & col2 - Source vector for the third column

mat3 ( const quat & q ) #

Constructor. Initializes the matrix using a given source quaternion.
Output
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

  • const quat & q - Source quaternion.

mat3 ( const float * m ) #

Constructor. Initializes the vector using a given pointer to the array of float elements.
Output
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

  • const float * m - Pointer to the array of float elements.

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+= ( const mat3 & m ) #

Performs matrix addition.

Arguments

  • const mat3 & m - Matrix.

Return value

Resulting matrix.

mat3 Operator- ( ) #

Performs matrix negation.

Return value

Resulting matrix.

mat3 & Operator-= ( const mat3 & m ) #

Performs matrix subtraction.

Arguments

  • const mat3 & m - mat3 matrix.

Return value

Resulting matrix.
Last update: 2020-05-19
Build: ()