Public Member Functions | Private Attributes | Friends | List of all members
karto::Quaternion Class Reference

#include <Karto.h>

Public Member Functions

void FromEulerAngles (kt_double yaw, kt_double pitch, kt_double roll)
 
kt_double GetW () const
 
kt_double GetX () const
 
kt_double GetY () const
 
kt_double GetZ () const
 
kt_bool operator!= (const Quaternion &rOther) const
 
Quaternionoperator= (const Quaternion &rQuaternion)
 
kt_bool operator== (const Quaternion &rOther) const
 
 Quaternion ()
 
 Quaternion (kt_double x, kt_double y, kt_double z, kt_double w)
 
 Quaternion (const Quaternion &rQuaternion)
 
void SetW (kt_double w)
 
void SetX (kt_double x)
 
void SetY (kt_double y)
 
void SetZ (kt_double z)
 
void ToEulerAngles (kt_double &rYaw, kt_double &rPitch, kt_double &rRoll) const
 

Private Attributes

kt_double m_Values [4]
 

Friends

std::ostream & operator<< (std::ostream &rStream, const Quaternion &rQuaternion)
 

Detailed Description

Defines an orientation as a quaternion rotation using the positive Z axis as the zero reference.
Q = w + ix + jy + kz
w = c_1 * c_2 * c_3 - s_1 * s_2 * s_3
x = s_1 * s_2 * c_3 + c_1 * c_2 * s_3
y = s_1 * c_2 * c_3 + c_1 * s_2 * s_3
z = c_1 * s_2 * c_3 - s_1 * c_2 * s_3
where
c_1 = cos(theta/2)
c_2 = cos(phi/2)
c_3 = cos(psi/2)
s_1 = sin(theta/2)
s_2 = sin(phi/2)
s_3 = sin(psi/2)
and
theta is the angle of rotation about the Y axis measured from the Z axis.
phi is the angle of rotation about the Z axis measured from the X axis.
psi is the angle of rotation about the X axis measured from the Y axis.
(All angles are right-handed.)

Definition at line 1500 of file Karto.h.

Constructor & Destructor Documentation

karto::Quaternion::Quaternion ( )
inline

Create a quaternion with default (x=0, y=0, z=0, w=1) values

Definition at line 1506 of file Karto.h.

karto::Quaternion::Quaternion ( kt_double  x,
kt_double  y,
kt_double  z,
kt_double  w 
)
inline

Create a quaternion using x, y, z, w values.

Parameters
x
y
z
w

Definition at line 1521 of file Karto.h.

karto::Quaternion::Quaternion ( const Quaternion rQuaternion)
inline

Copy constructor

Definition at line 1532 of file Karto.h.

Member Function Documentation

void karto::Quaternion::FromEulerAngles ( kt_double  yaw,
kt_double  pitch,
kt_double  roll 
)
inline

Set x,y,z,w values of the quaternion based on Euler angles. Source: http://www.euclideanspace.com/maths/geometry/rotations/conversions/eulerToQuaternion/index.htm

Parameters
yaw
pitch
roll

Definition at line 1657 of file Karto.h.

kt_double karto::Quaternion::GetW ( ) const
inline

Returns the W-value

Returns
Return the W-value of the quaternion

Definition at line 1599 of file Karto.h.

kt_double karto::Quaternion::GetX ( ) const
inline

Returns the X-value

Returns
Return the X-value of the quaternion

Definition at line 1545 of file Karto.h.

kt_double karto::Quaternion::GetY ( ) const
inline

Returns the Y-value

Returns
Return the Y-value of the quaternion

Definition at line 1563 of file Karto.h.

kt_double karto::Quaternion::GetZ ( ) const
inline

Returns the Z-value

Returns
Return the Z-value of the quaternion

Definition at line 1581 of file Karto.h.

kt_bool karto::Quaternion::operator!= ( const Quaternion rOther) const
inline

Inequality operator returns true if any of the corresponding x, y, z, w values of each quaternion not the same.

Parameters
rOther

Definition at line 1709 of file Karto.h.

Quaternion& karto::Quaternion::operator= ( const Quaternion rQuaternion)
inline

Assignment operator

Parameters
rQuaternion

Definition at line 1683 of file Karto.h.

kt_bool karto::Quaternion::operator== ( const Quaternion rOther) const
inline

Equality operator returns true if the corresponding x, y, z, w values of each quaternion are the same values.

Parameters
rOther

Definition at line 1697 of file Karto.h.

void karto::Quaternion::SetW ( kt_double  w)
inline

Sets the W-value

Parameters
wW-value of the quaternion

Definition at line 1608 of file Karto.h.

void karto::Quaternion::SetX ( kt_double  x)
inline

Sets the X-value

Parameters
xX-value of the quaternion

Definition at line 1554 of file Karto.h.

void karto::Quaternion::SetY ( kt_double  y)
inline

Sets the Y-value

Parameters
yY-value of the quaternion

Definition at line 1572 of file Karto.h.

void karto::Quaternion::SetZ ( kt_double  z)
inline

Sets the Z-value

Parameters
zZ-value of the quaternion

Definition at line 1590 of file Karto.h.

void karto::Quaternion::ToEulerAngles ( kt_double rYaw,
kt_double rPitch,
kt_double rRoll 
) const
inline

Converts this quaternion into Euler angles Source: http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/index.htm

Parameters
rYaw
rPitch
rRoll

Definition at line 1620 of file Karto.h.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  rStream,
const Quaternion rQuaternion 
)
friend

Write this quaternion onto output stream

Parameters
rStreamoutput stream
rQuaternion

Definition at line 1722 of file Karto.h.

Member Data Documentation

kt_double karto::Quaternion::m_Values[4]
private

Definition at line 1732 of file Karto.h.


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


open_karto
Author(s):
autogenerated on Mon Jun 10 2019 14:02:19