Quaternion used for 3D rotations. More...
#include <mxvk/include/mxvk/mxvk_math.h>
Public Member Functions | |
| void | Conj () |
| Conjugate this quaternion in place. | |
| void | Conj () |
| Conjugate this quaternion in place. | |
| void | EulerZYX (float theta_x, float theta_y, float theta_z) |
| Build a quaternion from Euler angles in ZYX order, with angles in degrees. | |
| void | EulerZYX (float theta_x, float theta_y, float theta_z) |
| Build a quaternion from Euler angles in ZYX order, with angles in degrees. | |
| void | Inverse () |
| Invert this quaternion in place. | |
| void | Inverse () |
| Invert this quaternion in place. | |
| void | InverseNormal () |
| Invert a unit quaternion by conjugating it. | |
| void | InverseNormal () |
| Invert a unit quaternion by conjugating it. | |
| float | Norm () const |
| Compute the norm. | |
| float | Norm () const |
| Compute the norm. | |
| float | Norm2 () const |
| Compute the squared norm. | |
| float | Norm2 () const |
| Compute the squared norm. | |
| void | Normalize () |
| Normalize this quaternion in place, or reset it to identity if it is too small. | |
| void | Normalize () |
| Normalize this quaternion in place, or reset it to identity if it is too small. | |
| constexpr QuatType | operator* (const QuatType &q) const |
| Multiply two quaternions. | |
| constexpr QuatType | operator* (const QuatType &q) const |
| Multiply two quaternions. | |
| QuatType & | operator*= (const QuatType &q) |
| Multiply this quaternion by another quaternion in place. | |
| QuatType & | operator*= (const QuatType &q) |
| Multiply this quaternion by another quaternion in place. | |
| constexpr QuatType | operator+ (const QuatType &q) const |
| Add two quaternions component-wise. | |
| constexpr QuatType | operator+ (const QuatType &q) const |
| Add two quaternions component-wise. | |
| constexpr QuatType | operator- (const QuatType &q) const |
| Subtract two quaternions component-wise. | |
| constexpr QuatType | operator- (const QuatType &q) const |
| Subtract two quaternions component-wise. | |
| void | QuatToVec3D (float *theta_degrees, vec3D &axis) const |
| Convert this quaternion to axis-angle form. | |
| void | QuatToVec3D (float *theta_degrees, vec3D &axis) const |
| Convert this quaternion to axis-angle form. | |
| constexpr | QuatType () |
| Construct the identity quaternion. | |
| constexpr | QuatType () |
| Construct the identity quaternion. | |
| constexpr | QuatType (float x_value, float y_value, float z_value, float w_value) |
| Construct from explicit quaternion components. | |
| constexpr | QuatType (float x_value, float y_value, float z_value, float w_value) |
| Construct from explicit quaternion components. | |
| void | Scale (float f) |
| Scale all quaternion components in place. | |
| void | Scale (float f) |
| Scale all quaternion components in place. | |
| QuatType | TripleProduct (const QuatType &p1, const QuatType &p2) const |
| Return the quaternion product (*this * p1) * p2. | |
| QuatType | TripleProduct (const QuatType &p1, const QuatType &p2) const |
| Return the quaternion product (*this * p1) * p2. | |
| void | vec3DthetaQuat (float theta_degrees, const vec3D &axis) |
| Build a quaternion from an axis and angle in degrees. | |
| void | vec3DthetaQuat (float theta_degrees, const vec3D &axis) |
| Build a quaternion from an axis and angle in degrees. | |
| void | vec4DthetaQuat (float theta_degrees, const vec4D &axis) |
| Build a quaternion from a 4D axis vector and angle in degrees. | |
| void | vec4DthetaQuat (float theta_degrees, const vec4D &axis) |
| Build a quaternion from a 4D axis vector and angle in degrees. | |
Public Attributes | |
| float | w = 1.0f |
| Scalar component. | |
| float | x = 0.0f |
| X component of the vector part. | |
| float | y = 0.0f |
| Y component of the vector part. | |
| float | z = 0.0f |
| Z component of the vector part. | |
Quaternion used for 3D rotations.
Definition at line 1170 of file mxvk_math.h.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inline |
|
inline |
|
inline |
Build a quaternion from Euler angles in ZYX order, with angles in degrees.
Definition at line 1293 of file mxvk_math.h.
|
inline |
Build a quaternion from Euler angles in ZYX order, with angles in degrees.
Definition at line 1293 of file mxvk_math_eigen.hpp.
|
inline |
Invert this quaternion in place.
Definition at line 1251 of file mxvk_math.h.
|
inline |
|
inline |
Invert a unit quaternion by conjugating it.
Definition at line 1265 of file mxvk_math.h.
|
inline |
Invert a unit quaternion by conjugating it.
Definition at line 1265 of file mxvk_math_eigen.hpp.
|
inlinenodiscard |
Compute the norm.
Definition at line 1235 of file mxvk_math.h.
|
inlinenodiscard |
Compute the norm.
Definition at line 1235 of file mxvk_math_eigen.hpp.
|
inlinenodiscard |
|
inlinenodiscard |
|
inline |
Normalize this quaternion in place, or reset it to identity if it is too small.
Definition at line 1240 of file mxvk_math.h.
|
inline |
Multiply this quaternion by another quaternion in place.
Definition at line 1209 of file mxvk_math.h.
Multiply this quaternion by another quaternion in place.
Definition at line 1209 of file mxvk_math_eigen.hpp.
|
inline |
Convert this quaternion to axis-angle form.
Definition at line 1310 of file mxvk_math.h.
|
inline |
Convert this quaternion to axis-angle form.
Definition at line 1310 of file mxvk_math_eigen.hpp.
|
inline |
|
inline |
|
inlinenodiscard |
Return the quaternion product (*this * p1) * p2.
Definition at line 1270 of file mxvk_math.h.
|
inlinenodiscard |
Return the quaternion product (*this * p1) * p2.
Definition at line 1270 of file mxvk_math_eigen.hpp.
|
inline |
Build a quaternion from an axis and angle in degrees.
Definition at line 1275 of file mxvk_math.h.
|
inline |
Build a quaternion from an axis and angle in degrees.
Definition at line 1275 of file mxvk_math_eigen.hpp.
|
inline |
Build a quaternion from a 4D axis vector and angle in degrees.
Definition at line 1287 of file mxvk_math.h.
|
inline |
Build a quaternion from a 4D axis vector and angle in degrees.
Definition at line 1287 of file mxvk_math_eigen.hpp.
| float mxvk::QuatType::w = 1.0f |
Scalar component.
Definition at line 1182 of file mxvk_math.h.
| float mxvk::QuatType::x = 0.0f |
X component of the vector part.
Definition at line 1173 of file mxvk_math.h.
| float mxvk::QuatType::y = 0.0f |
Y component of the vector part.
Definition at line 1176 of file mxvk_math.h.
| float mxvk::QuatType::z = 0.0f |
Z component of the vector part.
Definition at line 1179 of file mxvk_math.h.