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

Unigine::quat Struct

Quaternion.

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

Unigine::quat Structure

Members


UNIGINE_INLINE quat ()

Default constructor that produces an identity quaternion.

UNIGINE_INLINE quat (const quat & q)

Initialization by a quaternion.

Arguments

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

quat (const vec3 & axis, float angle)

Initialization by axis and angle values.

Arguments

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

UNIGINE_INLINE quat (float x, float y, float z, float w)

Initialization by scalars.

Arguments

  • float x - X component of the quaternion.
  • float y - Y component of the quaternion.
  • float z - Z component of the quaternion.
  • float w - W component of the quaternion.

explicit quat (const mat4 & m)

Initialization by a matrix.

Arguments

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

explicit quat (const dmat4 & m)

Initialization by a matrix.

Arguments

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

explicit quat (const float * q)

Initialization by a pointer to the quaternion.

Arguments

  • const float * q - Pointer to the quaternion.

UNIGINE_INLINE float & operator[] (int i)

Array access.

Arguments

  • int i - Array item index.

Return value

The array item.

UNIGINE_INLINE float operator[] (int i) const

Constant array access.

Arguments

  • int i - Array item index.

Return value

The array item.

UNIGINE_INLINE void set (float x_, float y_, float z_, float w_)

Set quaternion.

Arguments

  • float x_ - X component of the quaternion.
  • float y_ - Y component of the quaternion.
  • float z_ - Z component of the quaternion.
  • float w_ - W component of the quaternion.

UNIGINE_INLINE void set (const float * q)

Set quaternion.

Arguments

  • const float * q - Pointer to the quaternion.

UNIGINE_INLINE void get (float * q) const

Get quaternion.

Arguments

  • float * q - Pointer to the quaternion.

UNIGINE_INLINE float * get ()

Get a pointer to the quaternion.

Return value

Pointer to the quaternion.

UNIGINE_INLINE const float * get () const

Get a constant pointer to the quaternion.

Return value

Pointer to the quaternion.

Unigine::quat:: Union

union {
struct {
float x;
float y;
float z;
float w;
};
float q[4];
};
Last update: 2017-07-03