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.dmat4 Struct

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

## doublem20#

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

## doublem21#

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

## doublem22#

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

## doublem23#

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

## dmat4ZERO#

The Matrix, filled with zeros (0).

## dmat4ONE#

The Matrix, filled with ones (1).

## dmat4IDENTITY#

The Identity matrix.

The First row.

The Second row.

The Third row.

The Fourth row.

## dvec4Column0#

The First column.

## dvec4Column1#

The Second column.

## dvec4Column2#

The Third column.

## dvec4Column3#

The Fourth column.

The X axis.

The Y axis.

The Z axis.

The W axis.

## dvec3Translate#

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.

## doubleDeterminant#

The Determinant of the matrix.

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

Performs equal comparison.

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

Not equal comparison.

## boolEquals ( dmat4 other ) #

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

### Arguments

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

## dmat4operator* ( dmat4 m, double v ) #

Multiplication.

### Arguments

• dmat4 m - Matrix.
• double v - Value.

Multiplication.

Multiplication.

Multiplication.

Multiplication.

Multiplication.

Multiplication.

Multiplication.

Multiplication.

Multiplication.

Multiplication.

Multiplication.

Multiplication.

Multiplication.

Subtraction.

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

Sets the value using the specified argument(s).
Output
``````Resulting matrix:
| m00_  m01_  	m02_	 m03_ |
M=  | m10_  m11_  	m12_     m13_ |
| m20_  m21_    m22_     m23_ |
| m30_  m31_    m32_     m33_ |``````

### Arguments

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

## voidSet ( double m00_, double m10_, double m20_, double m01_, double m11_, double m21_, double m02_, double m12_, double m22_, double m03_, double m13_, double m23_ ) #

Sets the value using the specified argument(s).

### Arguments

• double m00_ - m00_ element.
• double m10_ - m10_ element.
• double m20_ - m20_ element.
• double m01_ - m01_ element.
• double m11_ - m11_ element.
• double m21_ - m21_ element.
• double m02_ - m02_ element.
• double m12_ - m12_ element.
• double m22_ - m22_ element.
• double m03_ - m03_ element.
• double m13_ - m13_ element.
• double m23_ - m23_ element.

## voidSet ( double v ) #

Sets the value using the specified argument(s).

### Arguments

• double v - A double 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 ( dvec3 col0, dvec3 col1, dvec3 col2, dvec3 col3 ) #

Sets the value using the specified argument(s).

### Arguments

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

## voidSet ( quat q ) #

Sets the value using the specified argument(s).

### Arguments

• quat q - Source quaternion.

## voidSet ( mat3 m, dvec3 v ) #

Sets the value using the specified argument(s).

### Arguments

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

## voidSet ( quat q, dvec3 v ) #

Sets the value using the specified argument(s).

### Arguments

• quat q - Source quaternion.
• dvec3 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.

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

Sets the value using the specified argument(s).

### Arguments

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

## voidSet ( int row, int column, double v ) #

Sets the value using the specified argument(s).

### Arguments

• int row - Row index.
• int column - Column index.
• double v - A double value to be used.

## doubleGet ( int row, int column ) #

Returns the matrix element specified by the given row and column.

### Arguments

• int row - Row index.
• int column - Column index.

### Return value

Resulting double 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 ( dvec3 axis, double angle ) #

Sets the rotation matrix for a given axis.

### Arguments

• dvec3 axis - Axis of rotation.
• double angle - Angle, in degrees.

## quatGetRotate ( ) #

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

### Return value

Resulting rotation matrix.

## voidSetRotateX ( double angle ) #

Sets X rotation matrix.

### Arguments

• double angle - Angle, in degrees.

## voidSetRotateY ( double angle ) #

Sets Y rotation matrix.

### Arguments

• double angle - Angle, in degrees.

## voidSetRotateZ ( double angle ) #

Sets Z rotation matrix.

### Arguments

• double angle - Angle, in degrees.

## voidSetRow ( int row, dvec4 v ) #

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

### Arguments

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

## voidSetRow3 ( int row, dvec3 v ) #

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

### Arguments

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

## dvec4GetRow ( int row ) #

Returns the specified matrix row.

### Arguments

• int row - Row index.

Return value.

## dvec3GetRow3 ( int row ) #

Returns the first three elements of the specified matrix row.

### Arguments

• int row - Row index.

### Return value

The dvec3 vector with the first three elements of the specified matrix row.

## voidSetColumn ( int column, dvec4 v ) #

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

### Arguments

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

## voidSetColumn3 ( int column, dvec3 v ) #

Sets the specified column of the matrix using a given three-component dvec3 vector as a source.

### Arguments

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

## dvec4GetColumn ( int column ) #

Returns the specified matrix column.

### Arguments

• int column - Column index.

### Return value

The dvec4 vector with column values.

## dvec3GetColumn3 ( int column ) #

Returns the specified matrix column.

### Arguments

• int column - Column index.

### Return value

The dvec3 vector with column values.

## stringToString ( ) #

Converts the current value to a string value.

### Return value

Resulting string value.
Last update: 2021-12-13