nlib
|
The class with the collection of functions that handle quaternions. More...
#include "nn/nlib/simd/SimdQuaternion.h"
Static Public Member Functions | |
static SimdQuaternion | Identity () noexcept |
Returns a unit quaternion (0, 0, 0, 1). | |
static SimdQuaternion | Conjugate (SimdQuaternionArg q) noexcept |
Returns a conjugate quaternion(-x, -y, -z, w). | |
static f128 | Length (SimdQuaternionArg q) noexcept |
Returns the size of a quaternion. More... | |
static f128 | LengthSq (SimdQuaternionArg q) noexcept |
Returns the square of the size of a quaternion. More... | |
static f128 | RecpLength (SimdQuaternionArg q) noexcept |
Returns the reciprocal of the size of a quaternion. More... | |
static SimdQuaternion | Normalize (SimdQuaternionArg q) noexcept |
Normalizes a quaternion. More... | |
static SimdQuaternion | NormalizeEst (SimdQuaternionArg q) noexcept |
Normalizes a quaternion with relatively low precision. More... | |
static SimdQuaternion | Inverse (SimdQuaternionArg q) noexcept |
Calculates an inverse of a quaternion. More... | |
static SimdQuaternion | Ln (SimdQuaternionArg q_normalized) noexcept |
Calculates a natural logarithm of a normalized quaternion. More... | |
static SimdQuaternion | Exp (SimdQuaternionArg q) noexcept |
Calculates the exponential of a quaternion. More... | |
static bool | IsIdentity (SimdQuaternionArg q) noexcept |
Determines whether a quaternion is a unit quaternion. More... | |
static bool | IsInfinite (SimdQuaternionArg q) noexcept |
Determines whether a quaternion has infinite elements. More... | |
static bool | IsNaN (SimdQuaternionArg q) noexcept |
Determines whether a quaternion has non-numeric elements. More... | |
static bool | CmpEq (SimdQuaternionArg q0, SimdQuaternionArg q1) noexcept |
Determines whether two quaternions are equal. More... | |
static bool | CmpNe (SimdQuaternionArg q0, SimdQuaternionArg q1) noexcept |
Determines whether two quaternions are unequal. More... | |
static f128 | Dot (SimdQuaternionArg q0, SimdQuaternionArg q1) noexcept |
Calculates the inner product of two quaternions. More... | |
static SimdQuaternion | Mult (SimdQuaternionArg q0, SimdQuaternionArg q1) noexcept |
Performs multiplication on two quaternions. More... | |
static SimdQuaternion | FromRotationAxisAndSinCos (SimdVectorArg axis_normalized, float sin_half_rad, float cos_half_rad) noexcept |
Calculates a quaternion from the axis and half of the angle of rotation (sin/cos ) around the axis. More... | |
static SimdQuaternion | FromRotationMatrix (SimdMatrixArg m) noexcept |
Calculates a quaternion from a rotation matrix. More... | |
static SimdQuaternion | FromRotationZXY (SimdVectorArg sin_half_xyz, SimdVectorArg cos_half_xyz) noexcept |
Calculates a quaternion from half of the angle of rotation sin/cos ) around each of the ZXY axes. More... | |
static SimdVector | ToAxisAngle (float *rad, SimdQuaternion q) noexcept |
Calculates the rotation axis vector and the rotation angle in radians from the quaternion. More... | |
static SimdQuaternion | Slerp (SimdQuaternionArg q0_normalized, SimdQuaternionArg q1_normalized, float t) noexcept |
Performs spherical linear interpolation on quaternions. More... | |
static SimdQuaternion | Squad (SimdQuaternionArg q0_normalized, SimdQuaternionArg q1_normalized, SimdQuaternionArg q2_normalized, SimdQuaternionArg q3_normalized, float t) noexcept |
Performs spherical quadrangle interpolation (squad) on quaternions. More... | |
static void | SquadSetup (SimdQuaternion *a, SimdQuaternion *b, SimdQuaternion *c, SimdQuaternionArg q0, SimdQuaternionArg q1, SimdQuaternionArg q2, SimdQuaternionArg q3) noexcept |
Calculates the quaternions for performing spherical quadrangle interpolation (squad) on quaternions. More... | |
static SimdQuaternion | BaryCentric (SimdQuaternionArg q0, SimdQuaternionArg q1, SimdQuaternionArg q2, float f, float g) noexcept |
Calculates the barycentric coordinates for quaternions. More... | |
The class with the collection of functions that handle quaternions.
Definition at line 25 of file SimdQuaternion.h.
|
staticnoexcept |
Calculates the barycentric coordinates for quaternions.
[in] | q0 | A normalized quaternion. |
[in] | q1 | A normalized quaternion. |
[in] | q2 | A normalized quaternion. |
[in] | f | Interpolation factor. |
[in] | g | Interpolation factor. |
|
staticnoexcept |
Determines whether two quaternions are equal.
[in] | q0 | A quaternion. |
[in] | q1 | A quaternion. |
true
if q0 and q1 are equal, or false
otherwise.
|
staticnoexcept |
Determines whether two quaternions are unequal.
[in] | q0 | A quaternion. |
[in] | q1 | A quaternion. |
true
if q0 and q1 are not equal, or false
otherwise.
|
staticnoexcept |
Calculates the inner product of two quaternions.
[in] | q0 | A quaternion. |
[in] | q1 | A quaternion. |
|
staticnoexcept |
Calculates the exponential of a quaternion.
[in] | q | A quaternion. The w element is ignored in this calculation. |
|
staticnoexcept |
Calculates a quaternion from the axis and half of the angle of rotation (sin/cos
) around the axis.
[in] | axis_normalized | A normalized 3D rotation axis vector. |
[in] | sin_half_rad | Passes sin(rad/2) , where rad is the angle of rotation. |
[in] | cos_half_rad | Passes cos(rad/2) , where rad is the angle of rotation. |
|
staticnoexcept |
Calculates a quaternion from a rotation matrix.
[in] | m | The rotation matrix. |
|
staticnoexcept |
Calculates a quaternion from half of the angle of rotation sin/cos
) around each of the ZXY axes.
[in] | sin_half_xyz | A three-dimensional vector (sin(rad_x/2), sin(rad_y/2), sin(rad_z/2) ). |
[in] | cos_half_xyz | A three-dimensional vector (cos(rad_x/2), cos(rad_y/2), cos(rad_z/2) ) |
|
staticnoexcept |
Calculates an inverse of a quaternion.
[in] | q | A quaternion. |
|
staticnoexcept |
Determines whether a quaternion is a unit quaternion.
[in] | q | A quaternion. |
true
if the quaternion is a unit quaternion, or false
otherwise.
|
staticnoexcept |
Determines whether a quaternion has infinite elements.
[in] | q | A quaternion. |
true
if the quaternion has infinite elements, or false
otherwise.
|
staticnoexcept |
Determines whether a quaternion has non-numeric elements.
[in] | q | A quaternion. |
true
if the quaternion has non-numeric elements, or false
otherwise.
|
staticnoexcept |
Returns the size of a quaternion.
[in] | q | A quaternion. |
|
staticnoexcept |
Returns the square of the size of a quaternion.
[in] | q | A quaternion. |
|
staticnoexcept |
Calculates a natural logarithm of a normalized quaternion.
[in] | q_normalized | Normalized quaternion. |
|
staticnoexcept |
Performs multiplication on two quaternions.
[in] | q0 | A quaternion. |
[in] | q1 | A quaternion. |
|
staticnoexcept |
Normalizes a quaternion.
[in] | q | A quaternion. |
|
staticnoexcept |
Normalizes a quaternion with relatively low precision.
[in] | q | A quaternion. |
|
staticnoexcept |
Returns the reciprocal of the size of a quaternion.
[in] | q | A quaternion. |
|
staticnoexcept |
Performs spherical linear interpolation on quaternions.
[in] | q0_normalized | A normalized quaternion. |
[in] | q1_normalized | A normalized quaternion. |
[in] | t | Interpolation factor. |
0
, and q1_normalized if t is 1
.
|
staticnoexcept |
Performs spherical quadrangle interpolation (squad) on quaternions.
[in] | q0_normalized | A normalized quaternion. |
[in] | q1_normalized | A normalized quaternion. |
[in] | q2_normalized | A normalized quaternion. |
[in] | q3_normalized | A normalized quaternion. |
[in] | t | Interpolation factor. |
|
staticnoexcept |
Calculates the quaternions for performing spherical quadrangle interpolation (squad) on quaternions.
[out] | a | Output quaternion. |
[out] | b | Output quaternion. |
[out] | c | Output quaternion. |
[in] | q0 | Input quaternion. |
[in] | q1 | Input quaternion. |
[in] | q2 | Input quaternion. |
[in] | q3 | Input quaternion. |
|
staticnoexcept |
Calculates the rotation axis vector and the rotation angle in radians from the quaternion.
[out] | rad | The rotation angle. |
[in] | q | A quaternion. |
© 2012-2017 Nintendo Co., Ltd. All rights reserved.