This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
Sandworm (Experimental)
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
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
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

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