Quaternion class template for rotations in 3D space Supports Euler conversion, normalization, multiplication, slerp/lerp, and rotation helpers.
More...
#include <MQuaternion.hpp>
|
| | Quat (T m_x, T m_y, T m_z, T m_w) |
| | Constructor from components.
|
| | Quat ()=default |
| | Default constructor (uninitialized).
|
| | ~Quat ()=default |
| T | x () const |
| T | y () const |
| T | z () const |
| T | w () const |
| void | SetX (T newX) |
| void | SetY (T newY) |
| void | SetZ (T newZ) |
| void | SetW (T newW) |
| void | Set (T newX, T newY, T newZ, T newW) |
| Vec3< T > | EulerAngles () const |
| | Convert quaternion to Euler angles (radians).
|
| Quat< T > | Normalized () const |
| | Return normalized quaternion.
|
| T | Magnitude () const |
| | Compute magnitude of quaternion.
|
| T | This (int i) const |
| | Access component by index (0=x,1=y,2=z,3=w).
|
| void | SetLookRotation (const Vec3< T > &forward, const Vec3< T > &up) |
| | Set quaternion from forward and up vectors.
|
| void | ToAngleAxis (T &angle, Vec3< T > &axis) |
| | Extract rotation angle and axis from quaternion.
|
| void | setFromToRotation (const Quat< T > &to) |
| | Set quaternion to represent rotation from this to another quaternion.
|
| bool | Equals (const Quat< T > &q) const |
| | Check equality with another quaternion.
|
| std::string | ToString () const |
| | Return a string representation for debugging.
|
| void | Normalize () |
| | Normalize quaternion in place.
|
| Quat< T > | operator* (const Quat< T > &q) const |
| | Quaternion multiplication (composition of rotations).
|
| bool | operator== (const Maths::Quat< T > &q) const |
| | Equality operator.
|
|
| static Quat< T > | Identity () |
| | Return identity quaternion (no rotation).
|
| static Quat< T > | AngleAxis (T angle, const Quat< T > &axis) |
| static Quat< T > | SlerpUnclamped (const Quat< T > &b, T t) |
| static Quat< T > | LerpUnclamped (const Quat< T > &b, T t) |
| static Quat< T > | FromEuler (const Vec3< T > &eulerRad) |
| static Quat< T > | Slerp (const Quat< T > &a, const Quat< T > &b, T t) |
| static Quat< T > | Lerp (const Quat< T > &a, const Quat< T > &b, T t) |
| static Quat< T > | Cross (const Quat< T > &b) |
| static Quat< T > | Inverse (const Quat< T > &q) |
| static Vec3< T > | MulltiplyQuatVec (const Vec3< T > &v, const Quat< T > &q) |
| | Rotate a vector by quaternion.
|
| static T | Angle (const Quat< T > &a, const Quat< T > &b) |
| | Compute angle between two quaternions.
|
| static T | Dot (const Quat< T > &a, const Quat< T > &b) |
| | Dot product of two quaternions.
|
| static void | LookRotation (const Vec3< T > &forward, const Vec3< T > &up) |
| static void | RotateTowards (const Quat< T > &to, T maxDegreesDelta) |
| static void | FromToRotation (const Quat< T > &to) |
|
| static constexpr T | kEpsilon = static_cast<T>(1e-6) |
| static constexpr T | PI = static_cast<T>(3.14159265358979323846) |
template<typename T = float>
class Maths::Quat< T >
Quaternion class template for rotations in 3D space Supports Euler conversion, normalization, multiplication, slerp/lerp, and rotation helpers.
◆ Quat() [1/2]
template<typename T = float>
Constructor from components.
◆ Quat() [2/2]
template<typename T = float>
Default constructor (uninitialized).
◆ ~Quat()
template<typename T = float>
◆ Angle()
template<typename T = float>
Compute angle between two quaternions.
◆ AngleAxis()
template<typename T = float>
◆ Cross()
template<typename T = float>
◆ Dot()
template<typename T = float>
Dot product of two quaternions.
◆ Equals()
template<typename T = float>
Check equality with another quaternion.
◆ EulerAngles()
template<typename T = float>
Convert quaternion to Euler angles (radians).
INSTANCE PROPERTIES ////////
◆ FromEuler()
template<typename T = float>
◆ FromToRotation()
template<typename T = float>
◆ Identity()
template<typename T = float>
Return identity quaternion (no rotation).
STATIC PROPERTIES ////////
◆ Inverse()
template<typename T = float>
◆ Lerp()
template<typename T = float>
◆ LerpUnclamped()
template<typename T = float>
◆ LookRotation()
template<typename T = float>
◆ Magnitude()
template<typename T = float>
Compute magnitude of quaternion.
◆ MulltiplyQuatVec()
template<typename T = float>
Rotate a vector by quaternion.
◆ Normalize()
template<typename T = float>
Normalize quaternion in place.
◆ Normalized()
template<typename T = float>
Return normalized quaternion.
◆ operator*()
template<typename T = float>
Quaternion multiplication (composition of rotations).
OPERATORS ////////
◆ operator==()
template<typename T = float>
◆ RotateTowards()
template<typename T = float>
| void Maths::Quat< T >::RotateTowards |
( |
const Quat< T > & | to, |
|
|
T | maxDegreesDelta ) |
|
static |
◆ Set()
template<typename T = float>
| void Maths::Quat< T >::Set |
( |
T | newX, |
|
|
T | newY, |
|
|
T | newZ, |
|
|
T | newW ) |
|
inline |
◆ setFromToRotation()
template<typename T = float>
Set quaternion to represent rotation from this to another quaternion.
◆ SetLookRotation()
template<typename T = float>
Set quaternion from forward and up vectors.
PUBLIC METHODS ////////
◆ SetW()
template<typename T = float>
◆ SetX()
template<typename T = float>
◆ SetY()
template<typename T = float>
◆ SetZ()
template<typename T = float>
◆ Slerp()
template<typename T = float>
◆ SlerpUnclamped()
template<typename T = float>
◆ This()
template<typename T = float>
Access component by index (0=x,1=y,2=z,3=w).
◆ ToAngleAxis()
template<typename T = float>
Extract rotation angle and axis from quaternion.
◆ ToString()
template<typename T = float>
Return a string representation for debugging.
◆ w()
template<typename T = float>
◆ x()
template<typename T = float>
◆ y()
template<typename T = float>
◆ z()
template<typename T = float>
◆ kEpsilon
template<typename T = float>
◆ m_w
template<typename T = float>
◆ m_x
template<typename T = float>
◆ m_y
template<typename T = float>
◆ m_z
template<typename T = float>
◆ PI
template<typename T = float>
| T Maths::Quat< T >::PI = static_cast<T>(3.14159265358979323846) |
|
staticconstexpr |
The documentation for this class was generated from the following file: