This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::mat4 Struct

Matrix of 4x4 float components.

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

Unigine::mat4 Structure

Members


mat4 ()

Default constructor that produces an identity matrix.

explicit mat4 (const dmat4 & m)

Initialization by a matrix.

Arguments

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

explicit mat4 (const quat & q)

Initialization by a quaternion.

Arguments

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

explicit mat4 (const float * m, int transpose)

Initialization by a pointer to the matrix.

Arguments

  • const float * m - Pointer to the matrix.
  • int transpose - If transpose is 0 (by default), the matrix is specified in the column major style.

mat4 & operator*= (const mat4 & m)

Matrix multiplication.

Arguments

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

Return value

The resulting matrix.

UNIGINE_INLINE float & operator[] (int i)

Array access.

Arguments

  • int i - Array item index.

Return value

The array item.

UNIGINE_INLINE float operator[] () const

UNIGINE_INLINE void set (int row, int column, float v)

Set matrix item.

Arguments

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

UNIGINE_INLINE float & get (int row, int column)

Get matrix item.

Arguments

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

Return value

The matrix item.

UNIGINE_INLINE float get () const

void set (const float * m, int transpose)

Set matrix.

Arguments

  • const float * m - Pointer to the matrix.
  • int transpose - If transpose is 0 (by default), the matrix is specified in the column major style.

void get (float * m, int transpose) const

Get matrix.

Arguments

  • float * m - Pointer to the matrix.
  • int transpose - If transpose is 0 (by default), the matrix is specified in the column major style.

UNIGINE_INLINE float * get ()

Get a pointer to the matrix.

Return value

Pointer to the matrix.

UNIGINE_INLINE const float * get () const

Get a constant pointer to the matrix.

Return value

Pointer to the matrix.

void setRow (int row, const vec4 & v)

Set matrix row.

Arguments

  • int row - The row number.
  • const vec4 & v - The row value.

void setRow3 ()

vec4 getRow (int row) const

Get matrix row.

Arguments

  • int row - The row number.

Return value

Tme row value.

vec3 getRow3 () const

void setColumn (int column, const vec4 & v)

Set matrix column.

Arguments

  • int column - The column number.
  • const vec4 & v - The column value.

void setColumn3 ()

vec4 getColumn (int column) const

Get matrix column.

Arguments

  • int column - The column number.

Return value

The column value.

vec3 getColumn3 () const

void setIdentity ()

Set identity matrix.

void setTranslate (const vec3 & v)

Set translation matrix.

Arguments

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

void setRotate (const vec3 & axis, float angle)

Set rotation matrix.

Arguments

  • const vec3 & axis - Rotation axis.
  • float angle - Rotation angle (in degrees).

void setRotateX (float angle)

Set X rotation matrix.

Arguments

  • float angle - Rotation angle (in degrees).

void setRotateY (float angle)

Set Y rotation matrix.

Arguments

  • float angle - Rotation angle (in degrees).

void setRotateZ (float angle)

Set Z rotation matrix.

Arguments

  • float angle - Rotation angle (in degrees).

void setScale (const vec3 & v)

Set scale matrix.

Arguments

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

Unigine::mat4:: Union

union {
struct {
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;
};
float mat[16];
};
Last update: 2017-07-03
Build: ()