Sen API
Sen Libraries
Loading...
Searching...
No Matches
sen::util::Quat< T > Class Template Reference

Quaternion. Represents the orientation of an object in space. More...

#include <quat.h>

Public Member Functions

 Quat () noexcept=default
 Quat (T x, T y, T z, T w) noexcept
 Quat (T angle, const Vec3< T > &axis) noexcept
 Quat (T yaw, T pitch, T bank) noexcept
 Quat (const Vec3< T > &eulerAngles) noexcept
 ~Quat ()=default
bool operator== (const Quat &v) const noexcept
bool operator!= (const Quat &v) const noexcept
bool operator< (const Quat &v) const noexcept
Quat operator* (T rhs) const
Quat & operator*= (T rhs) noexcept
Quat operator* (const Quat &rhs) const noexcept
Vec3< T > operator* (const Vec3< T > &v) const noexcept
Quat & operator*= (const Quat &rhs) noexcept
Quat operator/ (const Quat &denom) const noexcept
Quat & operator/= (const Quat &denom) noexcept
Quat operator+ (const Quat &rhs) const noexcept
Quat operator/ (const T rhs) const noexcept
Quat & operator/= (T rhs) noexcept
Quat & operator+= (const Quat &rhs) noexcept
Quat operator- (const Quat &rhs) const noexcept
Quat & operator-= (const Quat &rhs) noexcept
Quat operator- () const noexcept
T dot (const Quat< T > &other) const noexcept
Vec3< T > asVec3 () const noexcept
void set (T x, T y, T z, T w) noexcept
T getX () const noexcept
T getY () const noexcept
T getZ () const noexcept
T getW () const noexcept
void setX (T x) noexcept
void setY (T y) noexcept
void setZ (T z) noexcept
void setW (T w) noexcept
bool zeroRotation () const noexcept
T length () const noexcept
T length2 () const noexcept
Quat conj () const
 returns the conjugate of a quaternion which is obtained by negating the imaginary components while keeping the real component unchanged
Quat inverse () const
 returns the inverse of a quaternion q, denoted as q-1, is defined such that the product of q and its inverse yields the identity quaternion.
void makeRotate (T angle, T x, T y, T z) noexcept
void makeRotate (T angle, const Vec3< T > &vec) noexcept
void makeRotate (const Vec3< T > &from, const Vec3< T > &to) noexcept
void makeRotate (T angle1, const Vec3< T > &axis1, T angle2, const Vec3< T > &axis2, T angle3, const Vec3< T > &axis3) noexcept
void makeRotateFromEulerYPB (T yaw, T pitch, T bank) noexcept
void makeRotateFromEulerYPB (const Vec3< T > &eulerAngles) noexcept
void getRotate (T &angle, T &x, T &y, T &z) const noexcept
void getRotate (T &angle, Vec3< T > &vec) const noexcept
Vec3< T > getRotateInEulerYPB () const noexcept
void slerp (T t, const Quat &from, const Quat &to) noexcept
 Performs spherical linear interpolation (slerp) between two quaternions.

Static Public Member Functions

static Quat makeAxisRotation (T angle, const Vec3< T > &axis) noexcept
 Returns the quaternion for a rotation of an angle about an axis.

Detailed Description

template<typename T>
class sen::util::Quat< T >

Quaternion. Represents the orientation of an object in space.

Constructor & Destructor Documentation

◆ Quat() [1/5]

template<typename T>
sen::util::Quat< T >::Quat ( )
defaultnoexcept

◆ Quat() [2/5]

template<typename T>
sen::util::Quat< T >::Quat ( T x,
T y,
T z,
T w )
inlinenoexcept

◆ Quat() [3/5]

template<typename T>
sen::util::Quat< T >::Quat ( T angle,
const Vec3< T > & axis )
inlinenoexcept

◆ Quat() [4/5]

template<typename T>
sen::util::Quat< T >::Quat ( T yaw,
T pitch,
T bank )
inlinenoexcept

◆ Quat() [5/5]

template<typename T>
sen::util::Quat< T >::Quat ( const Vec3< T > & eulerAngles)
inlineexplicitnoexcept

◆ ~Quat()

template<typename T>
sen::util::Quat< T >::~Quat ( )
default

Member Function Documentation

◆ operator==()

template<typename T>
bool sen::util::Quat< T >::operator== ( const Quat< T > & v) const
inlinenoexcept

◆ operator!=()

template<typename T>
bool sen::util::Quat< T >::operator!= ( const Quat< T > & v) const
inlinenoexcept

◆ operator<()

template<typename T>
bool sen::util::Quat< T >::operator< ( const Quat< T > & v) const
inlinenoexcept

◆ operator*() [1/3]

template<typename T>
Quat< T > sen::util::Quat< T >::operator* ( T rhs) const
inline

◆ operator*=() [1/2]

template<typename T>
Quat< T > & sen::util::Quat< T >::operator*= ( T rhs)
inlinenoexcept

◆ operator*() [2/3]

template<typename T>
Quat< T > sen::util::Quat< T >::operator* ( const Quat< T > & rhs) const
inlinenoexcept

◆ operator*() [3/3]

template<typename T>
Vec3< T > sen::util::Quat< T >::operator* ( const Vec3< T > & v) const
inlinenoexcept

◆ operator*=() [2/2]

template<typename T>
Quat< T > & sen::util::Quat< T >::operator*= ( const Quat< T > & rhs)
inlinenoexcept

◆ operator/() [1/2]

template<typename T>
Quat< T > sen::util::Quat< T >::operator/ ( const Quat< T > & denom) const
inlinenoexcept

◆ operator/=() [1/2]

template<typename T>
Quat< T > & sen::util::Quat< T >::operator/= ( const Quat< T > & denom)
inlinenoexcept

◆ operator+()

template<typename T>
Quat< T > sen::util::Quat< T >::operator+ ( const Quat< T > & rhs) const
inlinenoexcept

◆ operator/() [2/2]

template<typename T>
Quat< T > sen::util::Quat< T >::operator/ ( const T rhs) const
inlinenoexcept

◆ operator/=() [2/2]

template<typename T>
Quat< T > & sen::util::Quat< T >::operator/= ( T rhs)
inlinenoexcept

◆ operator+=()

template<typename T>
Quat< T > & sen::util::Quat< T >::operator+= ( const Quat< T > & rhs)
inlinenoexcept

◆ operator-() [1/2]

template<typename T>
Quat< T > sen::util::Quat< T >::operator- ( const Quat< T > & rhs) const
inlinenoexcept

◆ operator-=()

template<typename T>
Quat< T > & sen::util::Quat< T >::operator-= ( const Quat< T > & rhs)
inlinenoexcept

◆ operator-() [2/2]

template<typename T>
Quat< T > sen::util::Quat< T >::operator- ( ) const
inlinenoexcept

◆ dot()

template<typename T>
T sen::util::Quat< T >::dot ( const Quat< T > & other) const
nodiscardnoexcept

◆ asVec3()

template<typename T>
Vec3< T > sen::util::Quat< T >::asVec3 ( ) const
inlinenodiscardnoexcept

◆ set()

template<typename T>
void sen::util::Quat< T >::set ( T x,
T y,
T z,
T w )
inlinenoexcept

◆ getX()

template<typename T>
T sen::util::Quat< T >::getX ( ) const
inlinenodiscardnoexcept

◆ getY()

template<typename T>
T sen::util::Quat< T >::getY ( ) const
inlinenodiscardnoexcept

◆ getZ()

template<typename T>
T sen::util::Quat< T >::getZ ( ) const
inlinenodiscardnoexcept

◆ getW()

template<typename T>
T sen::util::Quat< T >::getW ( ) const
inlinenodiscardnoexcept

◆ setX()

template<typename T>
void sen::util::Quat< T >::setX ( T x)
inlinenoexcept

◆ setY()

template<typename T>
void sen::util::Quat< T >::setY ( T y)
inlinenoexcept

◆ setZ()

template<typename T>
void sen::util::Quat< T >::setZ ( T z)
inlinenoexcept

◆ setW()

template<typename T>
void sen::util::Quat< T >::setW ( T w)
inlinenoexcept

◆ zeroRotation()

template<typename T>
bool sen::util::Quat< T >::zeroRotation ( ) const
inlinenodiscardnoexcept

◆ length()

template<typename T>
T sen::util::Quat< T >::length ( ) const
inlinenodiscardnoexcept

◆ length2()

template<typename T>
T sen::util::Quat< T >::length2 ( ) const
inlinenodiscardnoexcept

◆ conj()

template<typename T>
Quat< T > sen::util::Quat< T >::conj ( ) const
inlinenodiscard

returns the conjugate of a quaternion which is obtained by negating the imaginary components while keeping the real component unchanged

◆ inverse()

template<typename T>
Quat< T > sen::util::Quat< T >::inverse ( ) const
inlinenodiscard

returns the inverse of a quaternion q, denoted as q-1, is defined such that the product of q and its inverse yields the identity quaternion.

◆ makeRotate() [1/4]

template<typename T>
void sen::util::Quat< T >::makeRotate ( T angle,
T x,
T y,
T z )
inlinenoexcept

◆ makeRotate() [2/4]

template<typename T>
void sen::util::Quat< T >::makeRotate ( T angle,
const Vec3< T > & vec )
inlinenoexcept

◆ makeRotate() [3/4]

template<typename T>
void sen::util::Quat< T >::makeRotate ( const Vec3< T > & from,
const Vec3< T > & to )
inlinenoexcept

◆ makeAxisRotation()

template<typename T>
Quat< T > sen::util::Quat< T >::makeAxisRotation ( T angle,
const Vec3< T > & axis )
inlinestaticnodiscardnoexcept

Returns the quaternion for a rotation of an angle about an axis.

◆ makeRotate() [4/4]

template<typename T>
void sen::util::Quat< T >::makeRotate ( T angle1,
const Vec3< T > & axis1,
T angle2,
const Vec3< T > & axis2,
T angle3,
const Vec3< T > & axis3 )
inlinenoexcept

◆ makeRotateFromEulerYPB() [1/2]

template<typename T>
void sen::util::Quat< T >::makeRotateFromEulerYPB ( T yaw,
T pitch,
T bank )
inlinenoexcept

◆ makeRotateFromEulerYPB() [2/2]

template<typename T>
void sen::util::Quat< T >::makeRotateFromEulerYPB ( const Vec3< T > & eulerAngles)
inlinenoexcept

◆ getRotate() [1/2]

template<typename T>
void sen::util::Quat< T >::getRotate ( T & angle,
T & x,
T & y,
T & z ) const
inlinenoexcept

◆ getRotate() [2/2]

template<typename T>
void sen::util::Quat< T >::getRotate ( T & angle,
Vec3< T > & vec ) const
inlinenoexcept

◆ getRotateInEulerYPB()

template<typename T>
Vec3< T > sen::util::Quat< T >::getRotateInEulerYPB ( ) const
inlinenodiscardnoexcept

◆ slerp()

template<typename T>
void sen::util::Quat< T >::slerp ( T t,
const Quat< T > & from,
const Quat< T > & to )
inlinenoexcept

Performs spherical linear interpolation (slerp) between two quaternions.

Parameters
tinterpolation step.
fromStarting quaternion.
toEnding quaternion.

The documentation for this class was generated from the following file: