Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FX::FXQuatf Class Reference

Single-precision quaternion. More...

#include <FXQuatf.h>

Public Member Functions

 FXQuatf ()
 Default constructor; value is not initialized.
 
 FXQuatf (const FXQuatf &q)
 Copy constructor.
 
 FXQuatf (const FXfloat v[])
 Construct from array of four floats.
 
 FXQuatf (FXfloat xx, FXfloat yy, FXfloat zz, FXfloat ww)
 Construct from four components.
 
 FXQuatf (const FXVec3f &axis, FXfloat phi)
 Construct from rotation axis and angle in radians.
 
 FXQuatf (const FXVec3f &fr, const FXVec3f &to)
 Construct quaternion from arc between two unit vectors fm and to.
 
 FXQuatf (FXfloat roll, FXfloat pitch, FXfloat yaw)
 Construct from euler angles yaw (z), pitch (y), and roll (x).
 
 FXQuatf (const FXVec3f &ex, const FXVec3f &ey, const FXVec3f &ez)
 Construct quaternion from three orthogonal unit vectors.
 
 FXQuatf (const FXVec3f &rot)
 Construct quaternion from rotation vector rot, representing a rotation by |rot| radians about a unit vector rot/|rot|.
 
FXfloat & operator[] (FXint i)
 Return a non-const reference to the ith element.
 
const FXfloat & operator[] (FXint i) const
 Return a const reference to the ith element.
 
FXQuatfoperator= (const FXQuatf &v)
 Assignment from other quaternion.
 
FXQuatfoperator= (const FXfloat v[])
 Assignment from array of four floats.
 
FXQuatfset (const FXQuatf &v)
 Set value from another quaternion.
 
FXQuatfset (const FXfloat v[])
 Set value from array of four floats.
 
FXQuatfset (FXfloat xx, FXfloat yy, FXfloat zz, FXfloat ww)
 Set value from four components.
 
FXQuatfoperator*= (FXfloat n)
 Assigning operators.
 
FXQuatfoperator/= (FXfloat n)
 
FXQuatfoperator+= (const FXQuatf &v)
 
FXQuatfoperator-= (const FXQuatf &v)
 
FXQuatfoperator*= (const FXQuatf &b)
 
FXQuatfoperator/= (const FXQuatf &b)
 
 operator FXfloat * ()
 Conversion.
 
 operator const FXfloat * () const
 
 operator FXVec3f & ()
 Conversion to 3-vector, axis of rotation.
 
 operator const FXVec3f & () const
 
FXbool operator! () const
 Test if zero.
 
FXQuatf operator+ () const
 Unary.
 
FXQuatf operator- () const
 
FXfloat length2 () const
 Length and square of length.
 
FXfloat length () const
 
FXQuatfadjust ()
 Adjust quaternion length.
 
void setAxisAngle (const FXVec3f &axis, FXfloat phi)
 Set quaternion from axis and angle. More...
 
void getAxisAngle (FXVec3f &axis, FXfloat &phi) const
 Obtain axis and angle from quaternion. More...
 
void setRotation (const FXVec3f &rot)
 Set quaternion from rotation vector rot, representing a rotation by |rot| radians about a unit vector rot/|rot|. More...
 
FXVec3f getRotation () const
 Get rotation vector from quaternion, representing a rotation of |rot| radians about an axis rot/|rot|. More...
 
void setMRP (const FXVec3f &m)
 Set unit quaternion to modified rodrigues parameters. More...
 
FXVec3f getMRP () const
 Return modified rodrigues parameters from unit quaternion.
 
void setRollPitchYaw (FXfloat roll, FXfloat pitch, FXfloat yaw)
 Set quaternion from roll (x), pitch (y), yaw (z), in that order.
 
void getRollPitchYaw (FXfloat &roll, FXfloat &pitch, FXfloat &yaw) const
 Return the roll (x), pitch (y), yaw (z) angles represented by the quaternion.
 
void setYawPitchRoll (FXfloat yaw, FXfloat pitch, FXfloat roll)
 Set quaternion from yaw (z), pitch (y), roll (x), in that order.
 
void getYawPitchRoll (FXfloat &yaw, FXfloat &pitch, FXfloat &roll) const
 Return the yaw (z), pitch (y), roll (x) angles represented by the quaternion.
 
void setRollYawPitch (FXfloat roll, FXfloat yaw, FXfloat pitch)
 Set quaternion from roll (x), yaw (z), pitch (y), in that order.
 
void getRollYawPitch (FXfloat &roll, FXfloat &yaw, FXfloat &pitch) const
 Return the roll (x), yaw (z), pitch (y) angles represented by the quaternion.
 
void setPitchRollYaw (FXfloat pitch, FXfloat roll, FXfloat yaw)
 Set quaternion from pitch (y), roll (x),yaw (z), in that order.
 
void getPitchRollYaw (FXfloat &pitch, FXfloat &roll, FXfloat &yaw) const
 Return the pitch (y), roll (x),yaw (z) angles represented by the quaternion.
 
void setPitchYawRoll (FXfloat pitch, FXfloat yaw, FXfloat roll)
 Set quaternion from pitch (y), yaw (z), roll (x), in that order.
 
void getPitchYawRoll (FXfloat &pitch, FXfloat &yaw, FXfloat &roll) const
 Return the pitch (y), yaw (z), roll (x) angles represented by the quaternion.
 
void setYawRollPitch (FXfloat yaw, FXfloat roll, FXfloat pitch)
 Set quaternion from yaw (z), roll (x), pitch (y), in that order.
 
void getYawRollPitch (FXfloat &yaw, FXfloat &roll, FXfloat &pitch) const
 Return the yaw (z), roll (x), pitch (y) angles represented by the quaternion.
 
void setAxes (const FXVec3f &ex, const FXVec3f &ey, const FXVec3f &ez)
 Set quaternion from axes.
 
void getAxes (FXVec3f &ex, FXVec3f &ey, FXVec3f &ez) const
 Get quaternion axes.
 
FXVec3f getXAxis () const
 Obtain local x axis.
 
FXVec3f getYAxis () const
 Obtain local y axis.
 
FXVec3f getZAxis () const
 Obtain local z axis.
 
FXQuatf exp () const
 Exponentiate quaternion.
 
FXQuatf log () const
 Take logarithm of quaternion.
 
FXQuatf pow (FXfloat t) const
 Power of quaternion.
 
FXQuatf conj () const
 Conjugate quaternion.
 
FXQuatf unitinvert () const
 Invert unit quaternion.
 
FXQuatf invert () const
 Invert quaternion.
 
 ~FXQuatf ()
 Destructor.
 

Public Attributes

FXfloat x
 
FXfloat y
 
FXfloat z
 
FXfloat w
 

Detailed Description

Single-precision quaternion.

Member Function Documentation

◆ getAxisAngle()

void FX::FXQuatf::getAxisAngle ( FXVec3f axis,
FXfloat &  phi 
) const

Obtain axis and angle from quaternion.

Return unit vector and angle of rotation phi, in radians. If identity quaternion (0,0,0,1), return axis as (1,0.0).

◆ getRotation()

FXVec3f FX::FXQuatf::getRotation ( ) const

Get rotation vector from quaternion, representing a rotation of |rot| radians about an axis rot/|rot|.

If quaternion is identity quaternion (0,0,0,1), return (0,0,0).

◆ setAxisAngle()

void FX::FXQuatf::setAxisAngle ( const FXVec3f axis,
FXfloat  phi 
)

Set quaternion from axis and angle.

Quaternion represents a rotation of phi radians about unit vector axis.

◆ setMRP()

void FX::FXQuatf::setMRP ( const FXVec3f m)

Set unit quaternion to modified rodrigues parameters.

Modified Rodriques parameters are defined as MRP = tan(theta/4)*E, where theta is rotation angle (radians), and E is unit axis of rotation.

◆ setRotation()

void FX::FXQuatf::setRotation ( const FXVec3f rot)

Set quaternion from rotation vector rot, representing a rotation by |rot| radians about a unit vector rot/|rot|.

Set to the identity quaternion (0,0,0,1) if the rotation vector is equal to (0,0,0).


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

Copyright © 1997-2020 Jeroen van der Zijp