# Unigine.mat4 Struct

Notice
The functions listed below are the members of the Unigine.MathLib namespace.

## floatm00#

The Matrix element in the corresponding row and column mxy = M[x, y]. Provides convenient access to matrix elements.

## floatm10#

The Matrix element in the corresponding row and column mxy = M[x, y]. Provides convenient access to matrix elements.

## floatm20#

The Matrix element in the corresponding row and column mxy = M[x, y]. Provides convenient access to matrix elements.

## floatm30#

The Matrix element in the corresponding row and column mxy = M[x, y]. Provides convenient access to matrix elements.

## floatm01#

The Matrix element in the corresponding row and column mxy = M[x, y]. Provides convenient access to matrix elements.

## floatm11#

The Matrix element in the corresponding row and column mxy = M[x, y]. Provides convenient access to matrix elements.

## floatm21#

The Matrix element in the corresponding row and column mxy = M[x, y]. Provides convenient access to matrix elements.

## floatm31#

The Matrix element in the corresponding row and column mxy = M[x, y]. Provides convenient access to matrix elements.

## floatm02#

The Matrix element in the corresponding row and column mxy = M[x, y]. Provides convenient access to matrix elements.

## floatm12#

The Matrix element in the corresponding row and column mxy = M[x, y]. Provides convenient access to matrix elements.

## floatm22#

The Matrix element in the corresponding row and column mxy = M[x, y]. Provides convenient access to matrix elements.

## floatm32#

The Matrix element in the corresponding row and column mxy = M[x, y]. Provides convenient access to matrix elements.

## floatm03#

The Matrix element in the corresponding row and column mxy = M[x, y]. Provides convenient access to matrix elements.

## floatm13#

The Matrix element in the corresponding row and column mxy = M[x, y]. Provides convenient access to matrix elements.

## floatm23#

The Matrix element in the corresponding row and column mxy = M[x, y]. Provides convenient access to matrix elements.

## floatm33#

The Matrix element in the corresponding row and column mxy = M[x, y]. Provides convenient access to matrix elements.

## mat4ZERO#

The Matrix, filled with zeros (0).

## mat4ONE#

The Matrix, filled with ones (1).

## mat4IDENTITY#

The Identity matrix.

The First row.

The Second row.

The Third row.

The Fourth row.

## vec4Column0#

The First column.

## vec4Column1#

The Second column.

## vec4Column2#

The Third column.

## vec4Column3#

The Fourth column.

The X axis.

The Y axis.

The Z axis.

The W axis.

## vec4Diagonal#

The Vector containing diagonal elements of the matrix.

## vec3Translate#

The Translation part of the matrix. For more information see Matrix Transformations.

## vec3Scale#

The Scaling part of the matrix. For more information see Matrix Transformations.

## floatTrace#

The Trace of the matrix: (sum of its diagonal elements).

## floatDeterminant#

The Determinant of the matrix.

## floatDeterminant3#

The Determinant of the smaller 3x3 matrix.

## booloperator== ( mat4 v0, mat4 v1 ) #

Performs equal comparison.

### Arguments

• mat4 v0 - First value.
• mat4 v1 - Second value.

## booloperator!= ( mat4 v0, mat4 v1 ) #

Not equal comparison.

### Arguments

• mat4 v0 - First value.
• mat4 v1 - Second value.

## boolEquals ( mat4 other ) #

Checks if the vector and the specified argument are equal (epsilon).

### Arguments

• mat4 other - Value to be checked for equality.

Return value.

## boolEquals ( object obj ) #

Checks if the vector and the specified argument are equal (epsilon).

Return value.

## intGetHashCode ( ) #

Returns a hash code for the current object. Serves as the default hash function.

### Return value

Resulting int value.

Subtraction.

## mat4operator* ( mat4 m, float v ) #

Multiplication.

### Arguments

• mat4 m - Matrix.
• float v - Value.

Multiplication.

Multiplication.

Multiplication.

Multiplication.

Multiplication.

Multiplication.

Multiplication.

Multiplication.

Multiplication.

Multiplication.

Multiplication.

Multiplication.

## mat4operator* ( mat4 m0, mat4 m1 ) #

Multiplication.

### Arguments

• mat4 m0 - First value.
• mat4 m1 - Second value.

## mat4operator+ ( mat4 m0, mat4 m1 ) #

### Arguments

• mat4 m0 - First value.
• mat4 m1 - Second value.

## mat4operator- ( mat4 m0, mat4 m1 ) #

Subtraction.

### Arguments

• mat4 m0 - First value.
• mat4 m1 - Second value.

## voidSet ( float m00_, float m10_, float m20_, float m30_, float m01_, float m11_, float m21_, float m31_, float m02_, float m12_, float m22_, float m32_, float m03_, float m13_, float m23_, float m33_ ) #

Sets the value using the specified argument(s).

### Arguments

• float m00_ - m00_ element.
• float m10_ - m10_ element.
• float m20_ - m20_ element.
• float m30_ - m30_ element.
• float m01_ - m01_ element.
• float m11_ - m11_ element.
• float m21_ - m21_ element.
• float m31_ - m31_ element.
• float m02_ - m02_ element.
• float m12_ - m12_ element.
• float m22_ - m22_ element.
• float m32_ - m32_ element.
• float m03_ - m03_ element.
• float m13_ - m13_ element.
• float m23_ - m23_ element.
• float m33_ - m33_ element.

## voidSet ( float v ) #

Sets the value using the specified argument(s).

### Arguments

• float v - A float value to be used.

## voidSet ( mat2 m ) #

Sets the value using the specified argument(s).

### Arguments

• mat2 m - Source matrix.

## voidSet ( mat3 m ) #

Sets the value using the specified argument(s).

### Arguments

• mat3 m - Source matrix.

## voidSet ( mat4 m ) #

Sets the value using the specified argument(s).

### Arguments

• mat4 m - Source matrix.

## voidSet ( dmat4 m ) #

Sets the value using the specified argument(s).

## voidSet ( vec4 col0, vec4 col1, vec4 col2, vec4 col3 ) #

Sets the value using the specified argument(s).

### Arguments

• vec4 col0 - First column.
• vec4 col1 - Second column.
• vec4 col2 - Third column.
• vec4 col3 - Fourth column.

## voidSet ( quat q ) #

Sets the value using the specified argument(s).

### Arguments

• quat q - Source quaternion.

## voidSet ( mat3 m, vec3 v ) #

Sets the value using the specified argument(s).

### Arguments

• mat3 m - Source matrix.
• vec3 v - Source vector.

## voidSet ( quat q, vec3 v ) #

Sets the value using the specified argument(s).

### Arguments

• quat q - Source quaternion.
• vec3 v - Source vector.

## voidSet ( float[] m, bool transpose ) #

Sets the value using the specified argument(s).

### Arguments

• float[] m - Source matrix.
• bool transpose - true - to transpose the resulting matrix, false -not to transpose.

## voidSetRow ( int row, vec4 v ) #

Sets the specified row of the matrix using a given vec4 vector as a source.

### Arguments

• int row - Row index.
• vec4 v - Source vector.

## voidSetRow3 ( int row, vec3 v ) #

Sets the specified row of the matrix using a given three-component vec3 vector as a source, the last element of the row remains as is.

### Arguments

• int row - Row index.
• vec3 v - Source vector.

## vec4GetRow ( int row ) #

Returns the specified matrix row.

### Arguments

• int row - Row index.

Return value.

## vec3GetRow3 ( int row ) #

Returns the first three elements of the specified matrix row.

### Arguments

• int row - Row index.

Return value.

## voidSetColumn ( int column, vec4 v ) #

Sets the specified column of the matrix using a given vec4 vector as a source.

### Arguments

• int column - Column index.
• vec4 v - Source vector.

## voidSetColumn3 ( int column, vec3 v ) #

Sets the specified column of the matrix using a given three-component vec3 vector as a source, the last element of the column remains as is.

### Arguments

• int column - Column index.
• vec3 v - Source vector.

## vec4GetColumn ( int column ) #

Returns the specified matrix column.

### Arguments

• int column - Column index.

Return value.

## vec3GetColumn3 ( int column ) #

Returns the XYZ components of the specified matrix column.

### Arguments

• int column - Column index.

Return value.

## voidClear ( ) #

Clears the value by setting all components/elements to 0.

## voidSetZero ( ) #

Sets all matrix elements equal to 0.

## voidSetIdentity ( ) #

Sets the matrix equal to the identity matrix.

## voidSetRotate ( vec3 axis, float angle ) #

Sets the rotation matrix for a given axis.

### Arguments

• vec3 axis - Axis of rotation.
• float angle - Angle, in degrees.

## quatGetRotate ( ) #

Returns the quaternion, representing the rotation part of the matrix.

### Return value

Resulting rotation matrix.

## voidSetRotateX ( float angle ) #

Sets X rotation matrix.

### Arguments

• float angle - Angle, in degrees.

## voidSetRotateY ( float angle ) #

Sets Y rotation matrix.

### Arguments

• float angle - Angle, in degrees.

## voidSetRotateZ ( float angle ) #

Set Z rotation matrix.

### Arguments

• float angle - Angle, in degrees.

## stringToString ( ) #

Converts the current value to a string value.

### Return value

Resulting string value.
Last update: 2021-08-24