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: 03.07.2017
Помогите сделать статью лучше
Была ли эта статья полезной?
(или выберите слово/фразу и нажмите Ctrl+Enter