Main Page Modules Class Hierarchy Alphabetical List Compound List Compound Members
CSIBCQuaterniond Class Reference
Generic class representing quaternions.
More...
#include <SIBCQuaterniond.h>
List of all members.
Public Methods
- CSIBCQuaterniond ()
- CSIBCQuaterniond (const double in_dW, const double in_dX, const double in_dY, const double in_dZ)
- CSIBCQuaterniond (const CSIBCVector3Dd &in_vct)
- CSIBCQuaterniond (const CSIBCVector4Dd &in_vct)
- bool IsPure (double in_dEpsilon=PICO_EPS) const
- double GetLength () const
- double GetSquaredLength () const
- CSIBCQuaterniond & SetIdentity ()
- bool IsIdentity ()
- CSIBCQuaterniond & Normalize ()
- double GetW () const
- double GetX () const
- double GetY () const
- double GetZ () const
- CSIBCQuaterniond & SetW (const double in_dW)
- CSIBCQuaterniond & SetX (const double in_dX)
- CSIBCQuaterniond & SetY (const double in_dY)
- CSIBCQuaterniond & SetZ (const double in_dZ)
- CSIBCVector4Dd & Get (CSIBCVector4Dd &out_vct) const
- void Get (double &out_dW, double &out_dX, double &out_dY, double &out_dZ) const
- CSIBCQuaterniond & Set (const double in_dW, const double in_dX, const double in_dY, const double in_dZ)
- CSIBCQuaterniond & Set (const CSIBCVector4Dd &in_vct)
- CSIBCQuaterniond & Set (const CSIBCVector3Dd &in_vct)
- CSIBCQuaterniond & Set (const CSIBCQuaterniond &in_quat)
- bool operator== (const CSIBCQuaterniond &in_quat) const
- bool operator!= (const CSIBCQuaterniond &in_quat) const
- CSIBCQuaterniond & Negate ()
- CSIBCQuaterniond & Invert (const CSIBCQuaterniond &in_quat)
- CSIBCQuaterniond & Invert ()
- CSIBCQuaterniond & Conjugate (const CSIBCQuaterniond &in_quat)
- CSIBCQuaterniond & Conjugate ()
- CSIBCQuaterniond & Add (const CSIBCQuaterniond &in_quat)
- CSIBCQuaterniond & Add (const CSIBCQuaterniond &in_quat1, const CSIBCQuaterniond &in_quat2)
- CSIBCQuaterniond & Sub (const CSIBCQuaterniond &in_quat)
- CSIBCQuaterniond & Sub (const CSIBCQuaterniond &in_quat1, const CSIBCQuaterniond &in_quat2)
- CSIBCQuaterniond & Mul (const CSIBCQuaterniond &in_quat1, const CSIBCQuaterniond &in_quat2)
- CSIBCQuaterniond & Mul (const CSIBCQuaterniond &in_quat)
- CSIBCQuaterniond & Mul (const CSIBCVector3Dd &in_quatPure, const CSIBCQuaterniond &in_quat)
- CSIBCQuaterniond & Mul (const CSIBCQuaterniond &in_quat, const CSIBCVector3Dd &in_quatPure)
- CSIBCQuaterniond & Mul (const CSIBCQuaterniond &in_quat, const double in_dFactor)
- CSIBCQuaterniond & Mul (const double in_dFactor, const CSIBCQuaterniond &in_quat)
- CSIBCQuaterniond & Mul (const double in_dFactor)
- CSIBCQuaterniond & Slerp (const CSIBCQuaterniond &in_quatStart, const CSIBCQuaterniond &in_quatEnd, const double in_dU)
- CSIBCQuaterniond & BisectSlerp (const CSIBCQuaterniond &in_quatStart, const CSIBCQuaterniond &in_quatEnd)
- CSIBCQuaterniond & DoubleSlerp (const CSIBCQuaterniond &in_quatStart, const CSIBCQuaterniond &in_quatEnd)
- bool Ln (CSIBCQuaterniond &out_quat)
- bool Exp (CSIBCQuaterniond &out_quat)
- CSIBCQuaterniond & Squad (const CSIBCQuaterniond &in_quatB0, const CSIBCQuaterniond &in_quatS1, const CSIBCQuaterniond &in_quatS2, const CSIBCQuaterniond &in_quatB3, const double in_dU, const double in_dT)
Friends
- bool AreAlmostEqual (const CSIBCQuaterniond &in_quat1, const CSIBCQuaterniond &in_quat2, const double in_dEpsilon=PICO_EPS)
- double GetDot (const CSIBCQuaterniond &in_quat1, const CSIBCQuaterniond &in_quat2)
Detailed Description
Generic class representing quaternions.
The notation used in this quaternion class (W, X, Y, Z) makes the quaternions closely related to 4D vectors (See CSIBCVector4Dd). In general, the quaternion can be thought of as a scalar plus a vector, where the W component is the vector, and X, Y and Z are the coefficients of the I, J and K matricies respectively.
The components of the CSIBCQuaterniond class are represented by doulbe precision floating-point numbers. Its corresponding single precision class, CSIBCQuaternion, has much less functionality, thus this class is preferred.
Constructor & Destructor Documentation
CSIBCQuaterniond::CSIBCQuaterniond |
( |
|
) |
|
|
CSIBCQuaterniond::CSIBCQuaterniond |
( |
const double |
in_dW, |
|
|
const double |
in_dX, |
|
|
const double |
in_dY, |
|
|
const double |
in_dZ |
|
) |
|
|
|
Sets the new quaternion's values to those given as the parameters. -
Parameters:
-
in_dW |
The value for the W component of the quaternion. |
in_dX |
The value for the X component of the quaternion. |
in_dY |
The value for the Y component of the quaternion. |
in_dZ |
The value for the Z component of the quaternion. |
-
See also:
-
CSIBCQuaterniond::Set
|
|
Sets the new quaternion's vector values (X, Y, Z) as the corresponding component values in in_vct , and the W component to zero. -
Parameters:
-
in_vct |
Vector containing values for the new quaternion's vector components. |
-
See also:
-
CSIBCQuaterniond::Set(const CSIBCVector3Dd&)
|
|
Sets the new quaternion's values as their corresponding components in in_vct . -
Parameters:
-
in_vct |
4D Vector containing component values for the new quaternion. |
-
See also:
-
CSIBCQuaterniond::Set(const CSIBCVector4Dd&)
|
Member Function Documentation
CSIBCQuaterniond & CSIBCQuaterniond::Add |
( |
const CSIBCQuaterniond & |
in_quat1, |
|
|
const CSIBCQuaterniond & |
in_quat2 |
|
) |
|
|
|
Adds in_quat1 and in_quat2 and stores the result in this quaternion. -
Parameters:
-
in_quat1 |
First quaternion for addition. |
in_quat2 |
Second quaternion for addition. |
-
Returns:
-
CSIBCQuaterniond& Reference to this quaternion.
-
See also:
-
CSIBCQuaterniond::Add , CSIBCQuaterniond::Sub
|
CSIBCQuaterniond & CSIBCQuaterniond::Add |
( |
const CSIBCQuaterniond & |
in_quat |
) |
|
|
CSIBCQuaterniond& CSIBCQuaterniond::BisectSlerp |
( |
const CSIBCQuaterniond & |
in_quatStart, |
|
|
const CSIBCQuaterniond & |
in_quatEnd |
|
) |
|
|
CSIBCQuaterniond & CSIBCQuaterniond::Conjugate |
( |
|
) |
|
|
CSIBCQuaterniond & CSIBCQuaterniond::Conjugate |
( |
const CSIBCQuaterniond & |
in_quat |
) |
|
|
|
Sets this quaternion to the conjugate of in_quat . A conjugate quaternion is a quaternion that has each of its vector components negated. -
Parameters:
-
in_quat |
Quaternion whose conjugate contains the new values for this quaternion's components. |
-
Returns:
-
CSIBCQuaterniond& Reference to this quaternion.
-
See also:
-
CSIBCQuaterniond::Invert , CSIBCQuaterniond::Conjugate , CSIBCQuaterniond::Normalize
|
CSIBCQuaterniond& CSIBCQuaterniond::DoubleSlerp |
( |
const CSIBCQuaterniond & |
in_quatStart, |
|
|
const CSIBCQuaterniond & |
in_quatEnd |
|
) |
|
|
bool CSIBCQuaterniond::Exp |
( |
CSIBCQuaterniond & |
out_quat |
) |
|
|
void CSIBCQuaterniond::Get |
( |
double & |
out_dW, |
|
|
double & |
out_dX, |
|
|
double & |
out_dY, |
|
|
double & |
out_dZ |
|
) |
const |
|
|
Gets the quaternion values. -
Parameters:
-
out_dW |
double to receive the W component of the quaternion. |
out_dX |
double to receive the X component of the quaternion. |
out_dY |
double to receive the Y component of the quaternion. |
out_dZ |
double to receive the Z component of the quaternion. |
-
See also:
-
CSIBCQuaterniond::Get , CSIBCQuaterniond::Set
|
double CSIBCQuaterniond::GetLength |
( |
|
) |
const |
|
double CSIBCQuaterniond::GetSquaredLength |
( |
|
) |
const |
|
double CSIBCQuaterniond::GetW |
( |
|
) |
const |
|
double CSIBCQuaterniond::GetX |
( |
|
) |
const |
|
double CSIBCQuaterniond::GetY |
( |
|
) |
const |
|
double CSIBCQuaterniond::GetZ |
( |
|
) |
const |
|
CSIBCQuaterniond & CSIBCQuaterniond::Invert |
( |
void |
|
) |
|
|
CSIBCQuaterniond & CSIBCQuaterniond::Invert |
( |
const CSIBCQuaterniond & |
in_quat |
) |
|
|
|
Sets this quaternion to the inverse of the unit quaternion in_quat . Since a unitary input quaternion is assumed, this function is equivalent to CSIBCQuaterniond::Conjugate(const CSIBCQuateriond &). -
Parameters:
-
in_quat |
Quaternion whose inverse contains the new values for this quaternion's components. |
-
Returns:
-
CSIBCQuaterniond& Reference to this quaternion.
-
See also:
-
CSIBCQuaterniond::Invert , CSIBCQuaterniond::Conjugate , CSIBCQuaterniond::Normalize
|
bool CSIBCQuaterniond::IsIdentity |
( |
|
) |
|
|
|
Determines whether this quaternion is the identity quaternion (all components zero, except W is set to one). Note that this function uses exact equality comparison, thus the components must be their exact values. -
Returns:
-
bool true if the quaternion is the identity quaternion, false otherwise.
-
See also:
-
CSIBCQuaterniond::SetIdentity
|
bool CSIBCQuaterniond::IsPure |
( |
double |
in_dEpsilon = PICO_EPS |
) |
const |
|
|
Determines whether this quaternion is a 'pure' quaternion. Pure quaternions have a zero scalar (W) component. Since this function uses floating-point comparison, a threshhold value of in_dEpsilon is used for equality comparison. -
Parameters:
-
in_dEpsilon |
Floating-point comparison error range. Defaults to PICO_EPS. |
-
Returns:
-
bool true if the quaternion is pure, false otherwise.
-
See also:
-
CSIBCQuaterniond::IsIdentity
|
bool CSIBCQuaterniond::Ln |
( |
CSIBCQuaterniond & |
out_quat |
) |
|
|
CSIBCQuaterniond & CSIBCQuaterniond::Mul |
( |
const double |
in_dFactor |
) |
|
|
|
Scales this quaternion by a factor of in_dFactor . -
Parameters:
-
in_dFactor |
Scaling factor to apply to this quaternion. |
-
Returns:
-
CSIBCQuaterniond& Reference to this quaternion.
-
See also:
-
CSIBCQuaterniond::Mul
|
CSIBCQuaterniond & CSIBCQuaterniond::Mul |
( |
const double |
in_dFactor, |
|
|
const CSIBCQuaterniond & |
in_quat |
|
) |
|
|
|
Scales in_quat by a factor of in_dFactor , and stores the result in this quaternion. -
Parameters:
-
in_quat |
Quaternion to scale. |
in_dFactor |
Scaling factor for quaternion. |
-
Returns:
-
CSIBCQuaterniond& Reference to this quaternion.
-
See also:
-
CSIBCQuaterniond::Mul
|
CSIBCQuaterniond & CSIBCQuaterniond::Mul |
( |
const CSIBCQuaterniond & |
in_quat, |
|
|
const double |
in_dFactor |
|
) |
|
|
|
Scales in_quat by a factor of in_dFactor , and stores the result in this quaternion. -
Parameters:
-
in_quat |
Quaternion to scale. |
in_dFactor |
Scaling factor for quaternion. |
-
Returns:
-
CSIBCQuaterniond& Reference to this quaternion.
-
See also:
-
CSIBCQuaterniond::Mul
|
CSIBCQuaterniond & CSIBCQuaterniond::Mul |
( |
const CSIBCQuaterniond & |
in_quat, |
|
|
const CSIBCVector3Dd & |
in_vectPureQuat |
|
) |
|
|
|
Computes the right-multiplication of the quaternion in_quat and the pure quaternion represented by in_quatPure (in_quat * in_quatPure) , and stores the result in this quaternion. -
Parameters:
-
in_quat |
Quaternion for the multiplication (on the left). |
in_quatPure |
Vector representing the vector components of a pure quaternion (W component is zero), for the multiplication (on the right). |
-
Returns:
-
CSIBCQuaterniond& Reference to this quaterion.
-
See also:
-
CSIBCQuaterniond::Mul
|
CSIBCQuaterniond & CSIBCQuaterniond::Mul |
( |
const CSIBCVector3Dd & |
in_vectPureQuat, |
|
|
const CSIBCQuaterniond & |
in_quat |
|
) |
|
|
|
Computes the right-multiplication of the pure quaternion represented by in_quatPure , and the quaternion in_quat (in_quatPure * in_quat) , and stores the result in this quaternion. -
Parameters:
-
in_quatPure |
Vector representing the vector components of a pure quaternion (W component is zero), for the multiplication (on the left). |
in_quat |
Quaternion for the multiplication (on the right). |
-
Returns:
-
CSIBCQuaterniond& Reference to this quaternion.
-
See also:
-
CSIBCQuaterniond::Mul
|
CSIBCQuaterniond & CSIBCQuaterniond::Mul |
( |
const CSIBCQuaterniond & |
in_quat |
) |
|
|
|
Computes the right-multiplication of this quaternion by in_quat (this * in_quat) , and stores the result in this quaternion. -
Parameters:
-
in_quat |
Quaternion for the multiplication (on the right). |
-
Returns:
-
CSIBCQuaterniond& Reference to this quaternion.
-
See also:
-
CSIBCQuaterniond::Mul
|
CSIBCQuaterniond & CSIBCQuaterniond::Mul |
( |
const CSIBCQuaterniond & |
in_quat1, |
|
|
const CSIBCQuaterniond & |
in_quat2 |
|
) |
|
|
|
Computes the right-multiplication of in_quat1 by in_quat2 (in_quat1 * in_quat2) , and stores the result in this quaternion. -
Parameters:
-
in_quat1 |
First quaternion for the multiplication (on the left). |
in_quat2 |
Second quaternion for the multiplication (on the right). |
-
Returns:
-
CSIBCQuaterniond& Reference to this quaternion.
-
See also:
-
CSIBCQuaterniond::Mul
|
CSIBCQuaterniond & CSIBCQuaterniond::Negate |
( |
void |
|
) |
|
|
CSIBCQuaterniond & CSIBCQuaterniond::Normalize |
( |
|
) |
|
|
bool CSIBCQuaterniond::operator!= |
( |
const CSIBCQuaterniond & |
in_quat |
) |
const |
|
|
Determines whether any of the components of this quaternion and in_quat are different. Note that this function does not use floating-point comparison error, thus any difference in component values will result in a true return value. -
Parameters:
-
in_quat |
Quaternion to compare inequality with. |
-
Returns:
-
bool true if the quaternions are not equal, false if they are exactly equal.
-
See also:
-
CSIBCQuaterniond::operator== , CSIBCQuaterniond::AreAlmostEqual
|
bool CSIBCQuaterniond::operator== |
( |
const CSIBCQuaterniond & |
in_quat |
) |
const |
|
|
Determines whether each of the components of this quaternion and in_quat are exactly equal to each other. -
Parameters:
-
in_quat |
Quaternion to compare equality with. |
-
Returns:
-
bool true if the quaternions are exactly equal, false otherwise.
-
See also:
-
CSIBCQuaterniond::AreAlmostEqual , CSIBCQuaterniond::operator!=
|
CSIBCQuaterniond & CSIBCQuaterniond::Set |
( |
const CSIBCQuaterniond & |
in_quat |
) |
|
|
CSIBCQuaterniond & CSIBCQuaterniond::Set |
( |
const CSIBCVector3Dd & |
in_vct |
) |
|
|
|
Sets this quaternion's vector components from the corresponding components of in_vct . The scalar (W) component is set to zero. -
Parameters:
-
in_vct |
Vector containing new values for the quaternion's vector components. |
-
Returns:
-
CSIBCQuaterniond& Reference to this quaternion.
-
See also:
-
CSIBCQuaterniond::Set , CSIBCQuaterniond::Get
|
CSIBCQuaterniond & CSIBCQuaterniond::Set |
( |
const CSIBCVector4Dd & |
in_vct |
) |
|
|
|
Sets this quaternion's components from the corresponding components of in_vct . -
Parameters:
-
in_vct |
Vector containing new values for the quaternion's components. |
-
Returns:
-
CSIBCQuateriond& Reference to this quaternion.
-
See also:
-
CSIBCQuaterniond::Set , CSIBCQuaterniond::Get
|
CSIBCQuaterniond & CSIBCQuaterniond::Set |
( |
const double |
in_dW, |
|
|
const double |
in_dX, |
|
|
const double |
in_dY, |
|
|
const double |
in_dZ |
|
) |
|
|
|
Sets the quaternion values. -
Parameters:
-
in_dW |
New value for the W component of this quaternion. |
in_dX |
New value for the X component of this quaternion. |
in_dY |
New value for the Y component of this quaternion. |
in_dZ |
New value for the Z component of this quaternion. |
-
Returns:
-
CSIBCQuaterniond& Reference to this quaternion.
-
See also:
-
CSIBCQuaterniond::Set , CSIBCQuaterniond::Get
|
CSIBCQuaterniond & CSIBCQuaterniond::SetIdentity |
( |
|
) |
|
|
|
Sets this quaternion to the identity quaternion (all components zero, except W is set to one). -
Returns:
-
CSIBCQuaterniond& Reference to this quaternion.
-
See also:
-
CSIBCQuaterniond::IsIdentity
|
CSIBCQuaterniond & CSIBCQuaterniond::SetW |
( |
const double |
in_dW |
) |
|
|
CSIBCQuaterniond & CSIBCQuaterniond::SetX |
( |
const double |
in_dX |
) |
|
|
CSIBCQuaterniond & CSIBCQuaterniond::SetY |
( |
const double |
in_dY |
) |
|
|
CSIBCQuaterniond & CSIBCQuaterniond::SetZ |
( |
const double |
in_dZ |
) |
|
|
CSIBCQuaterniond & CSIBCQuaterniond::Slerp |
( |
const CSIBCQuaterniond & |
in_quatStart, |
|
|
const CSIBCQuaterniond & |
in_quatEnd, |
|
|
const double |
in_dU |
|
) |
|
|
|
Computes the spherical linear interpolation of two unit quaternions, where in_quatStart and in_quatEnd are the starting and ending quaternions, respectively. The interpolation point bewteen the two vectors is given by in_dU , in the range [0.0f, 1.0f]. The interpolated quaternion is stored in this quaternion. -
Parameters:
-
in_quatStart |
Unit quaternion for the starting interpolation point. |
in_quatEnd |
Unit quaternion for the ending interpolation end. |
in_dU |
Interpolation point between in_quatStart and in_quatEnd . Must be in the range [0.0f, 1.0f]. |
-
Returns:
-
CSIBCQuaterniond& Reference to this quaternion.
|
CSIBCQuaterniond& CSIBCQuaterniond::Squad |
( |
const CSIBCQuaterniond & |
in_quatB0, |
|
|
const CSIBCQuaterniond & |
in_quatS1, |
|
|
const CSIBCQuaterniond & |
in_quatS2, |
|
|
const CSIBCQuaterniond & |
in_quatB3, |
|
|
const double |
in_dU, |
|
|
const double |
in_dT |
|
) |
|
|
CSIBCQuaterniond & CSIBCQuaterniond::Sub |
( |
const CSIBCQuaterniond & |
in_quat1, |
|
|
const CSIBCQuaterniond & |
in_quat2 |
|
) |
|
|
|
Subtracts in_quat2 from in_quat1 and stores the result in this quaterinon. -
Parameters:
-
in_quat1 |
Quaternion for subtraction. |
in_quat2 |
Quaternion to subtract from in_quat1 . |
-
Returns:
-
CSIBCQuaterniond& Reference to this quaternion.
-
See also:
-
CSIBCQuaterniond::Sub , CSIBCQuaterniond::Add
|
CSIBCQuaterniond & CSIBCQuaterniond::Sub |
( |
const CSIBCQuaterniond & |
in_quat |
) |
|
|
|
Subtracts in_quat from this quaternion. -
Parameters:
-
in_quat |
Quaternion to subtract from this quaternion. |
-
Returns:
-
CSIBCQuaterniond& Reference to this quaternion.
-
See also:
-
CSIBCQuaterniond::Sub , CSIBCQuaterniond::Add
|
Friends And Related Function Documentation
bool AreAlmostEqual |
( |
const CSIBCQuaterniond & |
in_quat1, |
|
|
const CSIBCQuaterniond & |
in_quat2, |
|
|
const double |
in_dEpsilon = PICO_EPS |
|
) |
[friend] |
|
|
Determines whether each of the components of in_quat1 and in_quat2 are equal to each other. Since this function uses floating-point comparison, a threshhold value of in_dEpsilon is used for equality comparison. -
Parameters:
-
in_quat1 |
The first quaternion for equality comparison. |
in_quat2 |
The second quaternion for equality comparison. |
in_dEpsilon |
Floating-point comparison error range. Defaults to PICO_EPS. |
-
Returns:
-
bool true if the quaternions are equal, false otherwise.
-
See also:
-
CSIBCQuaterniond::operator== , CSIBCQuaterniond::operator!=
|
double GetDot |
( |
const CSIBCQuaterniond & |
in_quat1, |
|
|
const CSIBCQuaterniond & |
in_quat2 |
|
) |
[friend] |
|
|
Computes the dot product of in_quat1 and in_quat2 . -
Parameters:
-
in_quat1 |
First quaternion for the dot product. |
in_quat2 |
Second quaternion for the dot product. |
-
Returns:
-
double The dot product of
in_quat1 and in_quat2 . |
The documentation for this class was generated from the following files:
- SIBCQuaterniond.h
- SIBCQuaterniond.cpp
© Copyright 2001-2003 Avid Technology, Inc. All rights reserved.
© Copyright 2001-2003 Avid Technology, Inc. All rights reserved.