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

Matrix of 3x4 double components.

To use this structure, include the UnigineMathLib.h file.

## dmat4(const dvec3 & col0, const dvec3 & col1, const dvec3 & col2, const dvec3 & col3)

### Arguments

• const dvec3 & col0
• const dvec3 & col1
• const dvec3 & col2
• const dvec3 & col3

## dmat4(const quat & q, const dvec3 & v)

### Arguments

• const quat & q
• const dvec3 & v

## dmat4(const mat3 & m, const dvec3 & v)

### Arguments

• const mat3 & m
• const dvec3 & v

## dmat4(const float * m, int transpose)

### Arguments

• const float * m
• int transpose

## dmat4(const double * m, int transpose)

### Arguments

• const double * m
• int transpose

## dmat4(const mat3 & m)

### Arguments

• const mat3 & m

## dmat4(const mat2 & m)

### Arguments

• const mat2 & m

• double v

## dmat4(const dmat4 & m)

### Arguments

• const dmat4 & m

## dmat4()

Default constructor that produces an identity matrix.

## explicit dmat4(const mat4 & m)

Initialization by a matrix.

### Arguments

• const mat4 & m - The value of the matrix.

## explicit dmat4(const quat & q)

Initialization by a quaternion.

### Arguments

• const quat & q - The value of the quaternion.

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

Set matrix item.

### Arguments

• int row - The row number.
• int column - The column number.
• double v - The matrix item.

## voidset(const float * v, int transpose)

### Arguments

• const float * v
• int transpose

## voidset(const mat2 & m)

### Arguments

• const mat2 & m

## voidset(const mat3 & m)

### Arguments

• const mat3 & m

## voidset(const quat & q, const dvec3 & v)

### Arguments

• const quat & q
• const dvec3 & v

## voidset(const quat & q)

### Arguments

• const quat & q

## voidset(const mat4 & m)

### Arguments

• const mat4 & m

## voidset(const double * v, int transpose)

### Arguments

• const double * v
• int transpose

## voidset(const dmat4 & m)

### Arguments

• const dmat4 & m

## voidset(const mat3 & m, const dvec3 & v)

### Arguments

• const mat3 & m
• const dvec3 & v

## double &get(int row, int column)

Get matrix item.

### Arguments

• int row - The row number.
• int column - The column number.

The matrix item.

## doubleget(int row, int column) const

Get constant matrix item.

### Arguments

• int row - The row number.
• int column - The column number.

The matrix item.

## double *get()

Get a pointer to the matrix.

### Return value

Pointer to the matrix.

## const double *get() const

Get a constant pointer to the matrix.

### Return value

Pointer to the matrix.

## voidget(double * m, int transpose)

### Arguments

• double * m
• int transpose

## voidsetColumn(int column, const dvec4 & v)

Set matrix column.

### Arguments

• int column - The column number.
• const dvec4 & v - Column value.

## dvec4getColumn(int column) const

Get matrix row.

### Arguments

• int column - Row number.

Row value.

## voidsetColumn3(int column, const dvec3 & v)

Sets the new value for the given matrix column.

### Arguments

• int column - Column number.
• const dvec3 & v - Row value.

## dvec3getColumn3(int column) const

Returns the current value of the given matrix column. If such a column does not exist, the matrix identity is returned.

### Arguments

• int column - Column number.

Row value.

## voidsetIdentity()

Set identity matrix.

## voidsetRotate(const dvec3 & axis, double angle)

Set rotation matrix.

### Arguments

• const dvec3 & axis - Rotation axis.
• double angle - Rotation angle (in degrees).

## quatgetRotate() const

Get rotation part of the matrix.

### Return value

Matrix rotation part.

## voidsetRotateX(double angle)

Set X rotation matrix.

### Arguments

• double angle - Rotation angle (in degrees).

## voidsetRotateY(double angle)

Set Y rotation matrix.

### Arguments

• double angle - Rotation angle (in degrees).

## voidsetRotateZ(double angle)

Set Z rotation matrix.

### Arguments

• double angle - Rotation angle (in degrees).

## voidsetRow(int row, const dvec4 & v)

Sets the matrix row.

### Arguments

• int row - The row number.
• const dvec4 & v - Row value.

## dvec4getRow(int row) const

Get matrix row.

### Arguments

• int row - The row number.

Row value.

## voidsetRow3(int row, const dvec3 & v)

Sets the new value for the given matrix row.

### Arguments

• int row - The row number.
• const dvec3 & v - Row value.

## dvec3getRow3(int row) const

Returns the current value of the given matrix row. If such a row does not exist, the matrix identity is returned.

### Arguments

• int row - The row number.

Row value.

## voidsetScale(const dvec3 & v)

Set scale matrix.

### Arguments

• const dvec3 & v - The value of the scaling vector.

## vec3getScale() const

Get scaling part of the matrix.

### Return value

Matrix scaling part.

## voidsetTranslate(const dvec3 & v)

Set translation matrix.

### Arguments

• const dvec3 & v - The value of the translation vector.

## dvec3getTranslate() const

Get translation part of the matrix.

### Return value

Matrix translation part.

## dmat4 &operator*=(const dmat4 & m)

Matrix multiplication.

### Arguments

• const dmat4 & m - The value of the matrix.

### Return value

The resulting matrix.

• double v

## dmat4 &operator+=(const dmat4 & m)

### Arguments

• const dmat4 & m

## dmat4 &operator-=(const dmat4 & m)

### Arguments

• const dmat4 & m

## dmat4 &operator=(const dmat4 & m)

### Arguments

• const dmat4 & m

## double &operator[](int i)

Array access.

### Arguments

• int i - Array item index.

Array item.

## doubleoperator[](int i) const

Constant array access.

### Arguments

• int i - Array item index.

Array item.

## voidsse0(const __m128d & v)

### Arguments

• const __m128d & v

## voidsse1(const __m128d & v)

### Arguments

• const __m128d & v

## voidsse2(const __m128d & v)

### Arguments

• const __m128d & v

## voidsse3(const __m128d & v)

### Arguments

• const __m128d & v

## voidsse4(const __m128d & v)

### Arguments

• const __m128d & v

## voidsse5(const __m128d & v)

### Arguments

• const __m128d & v

## int ZERO

Last update: 2017-07-03