Itasca C++ Interface
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends | List of all members
Quat3 Class Reference

3D quaternion utility class. More...

#include <quat.h>

Public Member Functions

 Quat3 ()
 Default constructor.
 
 Quat3 (const double &w1, const double &x, const double &y, const double &z)
 
 ~Quat3 ()
 Default destructor.
 
 Quat3 (const Quat3 &q)
 Copy constructor.
 
constexpr const Quat3operator= (const Quat3 &q)
 Equality operator.
 
void setQuat (const double &w1, const double &x, const double &y, const double &z)
 Set the real and imaginary parts.
 
const double & w () const
 Access the real part.
 
const double & i () const
 Access the first imaginary part.
 
const double & j () const
 Access the second imaginary part.
 
const double & k () const
 Access the third imaginary part.
 
double & rw ()
 Access a reference to the real part.
 
double & ri ()
 Access a reference to the first imaginary part.
 
double & rj ()
 Access a reference to the second imaginary part.
 
double & rk ()
 Access a reference to the third imaginary part.
 
void reset ()
 Reset the quaternion.
 
void ident ()
 Reset the quaternion to the identity.
 
BASE_EXPORT bool isNull () const
 Returns a boolean indicating whether or not the quaternion is null.
 
BASE_EXPORT DMatrix< 3, 3 > quatToMatrix () const
 Convert the quaternion to a rotation matrix.
 
BASE_EXPORT DVect3 quatToAAngle () const
 Convert to Axis Angle where the magnitude of the axis is the angle in radians.
 
BASE_EXPORT void fromMatrix (const DMatrix< 3, 3 > &)
 Convert a matrix into a quaternion.
 
BASE_EXPORT void fromAxisAngle (const DVect3 &, const double &)
 Take an axis-angle representation and convert it to a quaternion where the angle is in radians.
 
BASE_EXPORT void fromEuler (const DVect3 &)
 
BASE_EXPORT void incrementAxisAngle (const DVect3 &, const double &)
 Increment by this rotation.
 
BASE_EXPORT void spinAboutX (const double &)
 Just spin about the X axis.
 
BASE_EXPORT void spinAboutY (const double &)
 Just spin about the Y axis.
 
BASE_EXPORT void spinAboutZ (const double &)
 Just spin about the Z axis.
 
BASE_EXPORT DVect3 rotate (const DVect3 &v) const
 Rotate a DVect3 by the quaternian to get a new DVect3.
 
BASE_EXPORT DVect3 real () const
 Return the "real" vector part of the quaternian.
 
BASE_EXPORT void fromUnitAxes (const DVect3 &, const DVect3 &)
 Take 2 orthogonal axis for an axis system and convert to a quaternion.
 
BASE_EXPORT void increment (const DAVect3 &)
 Increment the quaternion due to a rotation about the x, y, and z axes by the DAVect.
 
BASE_EXPORT DVect3 e1 () const
 Get component e1 of the rotation matrix.
 
BASE_EXPORT DVect3 e2 () const
 Get component e2 of the rotation matrix.
 
BASE_EXPORT DVect3 e3 () const
 Get component e3 of the rotation matrix.
 
BASE_EXPORT DVect3 quatToEuler () const
 
void conj ()
 Convert the quaternion to the conjugate.
 
Quat3 getConj () const
 Return the conjugate of the quaternion.
 
BASE_EXPORT void normalize ()
 Normalize the quaternion.
 
Quat3 operator* (const double &d) const
 Multiplication by a double.
 
Quat3 operator/ (const double &d) const
 Division by a double.
 
Quat3 operator* (const Quat3 &v) const
 Product of two quaternions.
 
Quat3 operator+ (const Quat3 &v) const
 Addition of two quaternions.
 
Quat3 friend operator* (const DVect3 &v, const Quat3 &q)
 DVect3 times a quaternion, in that order.
 
Quat3 operator* (const DVect3 &v) const
 Quaternion times a DVect3, in that order.
 
const Quat3operator*= (const double &d)
 In place multiplaction by a double.
 
const Quat3operator/= (const double &d)
 In place division by a double.
 
const Quat3operator*= (const Quat3 &v)
 In place multiplication of two quaternions.
 
const Quat3operator+= (const Quat3 &v)
 In place addition of two quaternions.
 
bool operator== (const Quat3 &v) const
 Euality operator.
 

Static Public Member Functions

static BASE_EXPORT Quat3 identity ()
 Returns the identity quaternion.
 
static BASE_EXPORT Quat3 fromVect (const DVect3 &v)
 Convert a DVect3 into a quaternion.
 

Friends

Quat3 operator* (const double &d, const Quat3 &p2)
 Product of a double and a quaternion.
 

Detailed Description

3D quaternion utility class.

Constructor & Destructor Documentation

◆ Quat3()

Quat3::Quat3 ( const double & w1,
const double & x,
const double & y,
const double & z )
inline

Constructor taking 4 double arguments, the first is the real part and the remaining three are the imaginary parts.

Member Function Documentation

◆ fromEuler()

void Quat3::fromEuler ( const DVect3 & e)

Take the Euler representation and convert it to a quaternion (angles in DEGREES). This assumes an X,Y,Z rotation (really Bryant angles)

◆ quatToEuler()

DVect3 Quat3::quatToEuler ( ) const

Convert the quaternion into euler angles in degrees. This assumes and X,Y,Z order (really Bryant angles)


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