Monado OpenXR Runtime
Public Member Functions | Static Public Member Functions | Data Fields
Quaternion Class Reference

#include <north_star/distortion/utility_northstar.h>

Public Member Functions

 Quaternion ()
 
 Quaternion (float _x, float _y, float _z, float _w)
 
 Quaternion (const Quaternion &_in)
 
constexpr Quaternionoperator= (const Quaternion &lhr)
 
Quaternion conjugate ()
 
float norm ()
 
Quaternion scale (float s)
 
Quaternion Inverse ()
 
Vector3 Right ()
 
Vector3 Up ()
 
Vector3 Forward ()
 
Vector3 operator* (Vector3 vec)
 
Matrix4x4 ToMatrix4x4 ()
 
Quaternion operator* (const Quaternion &q)
 
Quaternion operator/ (const float div)
 
float SIGN (float x)
 
float NORM (float a, float b, float c, float d)
 

Static Public Member Functions

static Quaternion Identity ()
 
static void ToEulerAngle (const Quaternion &q, float &roll, float &pitch, float &yaw)
 
static Vector3 ToEulerAngles (const Quaternion &in)
 
static Quaternion Euler (const Vector3 &euler)
 
static Quaternion AxisAngle (Vector3 axis, float angle)
 
static Quaternion LookAt (Vector3 sourcePoint, Vector3 destPoint)
 
static Quaternion QuaternionLookRotation (Vector3 forward, Vector3 Up)
 
static Quaternion FromMatrix (const Matrix4x4 m)
 
static Quaternion FromToRotation (Vector3 dir0, Vector3 dir1)
 

Data Fields

float x
 
float y
 
float z
 
float w
 

Constructor & Destructor Documentation

◆ Quaternion() [1/3]

Quaternion::Quaternion ( )
inline

◆ Quaternion() [2/3]

Quaternion::Quaternion ( float  _x,
float  _y,
float  _z,
float  _w 
)
inline

◆ Quaternion() [3/3]

Quaternion::Quaternion ( const Quaternion _in)
inline

References w, x, y, and z.

Member Function Documentation

◆ AxisAngle()

static Quaternion Quaternion::AxisAngle ( Vector3  axis,
float  angle 
)
inlinestatic

References w, Vector3::x, x, Vector3::y, y, Vector3::z, and z.

Referenced by FromToRotation().

◆ conjugate()

Quaternion Quaternion::conjugate ( )
inline

◆ Euler()

static Quaternion Quaternion::Euler ( const Vector3 euler)
inlinestatic

References w, Vector3::x, x, Vector3::y, y, Vector3::z, and z.

◆ Forward()

Vector3 Quaternion::Forward ( )
inline

References Vector3::Forward().

◆ FromMatrix()

static Quaternion Quaternion::FromMatrix ( const Matrix4x4  m)
inlinestatic

◆ FromToRotation()

static Quaternion Quaternion::FromToRotation ( Vector3  dir0,
Vector3  dir1 
)
inlinestatic

◆ Identity()

static Quaternion Quaternion::Identity ( )
inlinestatic

Referenced by Pose::Identity(), and Pose::Pose().

◆ Inverse()

Quaternion Quaternion::Inverse ( )
inline

Referenced by Pose::Inverse().

◆ LookAt()

static Quaternion Quaternion::LookAt ( Vector3  sourcePoint,
Vector3  destPoint 
)
inlinestatic

◆ norm()

float Quaternion::norm ( )
inline

◆ NORM()

float Quaternion::NORM ( float  a,
float  b,
float  c,
float  d 
)
inline

◆ operator*() [1/2]

Vector3 Quaternion::operator* ( Vector3  vec)
inline

References Vector3::x, Vector3::y, and Vector3::z.

◆ operator*() [2/2]

Quaternion Quaternion::operator* ( const Quaternion q)
inline

References w, x, y, and z.

◆ operator/()

Quaternion Quaternion::operator/ ( const float  div)
inline

◆ operator=()

constexpr Quaternion& Quaternion::operator= ( const Quaternion lhr)
inline

References w, x, y, and z.

◆ QuaternionLookRotation()

static Quaternion Quaternion::QuaternionLookRotation ( Vector3  forward,
Vector3  Up 
)
inlinestatic

◆ Right()

Vector3 Quaternion::Right ( )
inline

References Vector3::Right().

◆ scale()

Quaternion Quaternion::scale ( float  s)
inline

◆ SIGN()

float Quaternion::SIGN ( float  x)
inline

◆ ToEulerAngle()

static void Quaternion::ToEulerAngle ( const Quaternion q,
float &  roll,
float &  pitch,
float &  yaw 
)
inlinestatic

References LP_PI, w, x, y, and z.

◆ ToEulerAngles()

static Vector3 Quaternion::ToEulerAngles ( const Quaternion in)
inlinestatic

References LP_PI, w, Vector3::x, x, Vector3::y, y, Vector3::z, and z.

◆ ToMatrix4x4()

Matrix4x4 Quaternion::ToMatrix4x4 ( )
inline

Referenced by Pose::Matrix().

◆ Up()

Vector3 Quaternion::Up ( )
inline

References Vector3::Up().

Field Documentation

◆ w

float Quaternion::w

◆ x

float Quaternion::x

◆ y

float Quaternion::y

◆ z

float Quaternion::z

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