This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Landscape Tool
Sandworm (Experimental)
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
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 ( 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.
Output
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.
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

  • quat q - Source quaternion.

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

  • 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.
Output
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

Return value

Resulting matrix.

mat3 Operator*= ( vec3 v ) #

Performs vector multiplication.

Arguments

Return value

Resulting matrix.

mat3 Operator*= ( dvec2 v ) #

Performs vector multiplication.

Arguments

Return value

Resulting matrix.

mat3 Operator*= ( dvec3 v ) #

Performs vector multiplication.

Arguments

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
Build: ()