- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes

# DualQuaternion Class Reference

Search for all occurrences

## Detailed Description

The DualQuaternion class is used to represent rigid transformations in most cases.

It is an alternative to the Matrix class to store transformations which are rigid, i.e. has only rotation and translation part. In this case the dual quaternion is unit. The advantage of the dual quaternion representation over the matrices is that it is easier to do transformation blending, and it only needs 32 bytes in the memory. Disadvangate is that it is limited to rigid transformations only (scaling is not supported).

Definition at line 1358 of file math.h.

`#include <math.h>`

List of all members.

## Public Member Functions
| DualQuaternion (void)
| Constructs a dual quaternion which represents the identical transformation.
| DualQuaternion (const Quaternion &vReal, const Quaternion &vDual)
| Constructs a dual quaternion from two quaternions, using one as the real and the other one as the dual part.
| DualQuaternion (const Vector &vPivot, const Vector &vAxis, float fAngle)
| Constructs a dual quaternion which represents a transformation which is a rotation around a given point in the space with a given rotation axis and a given vector.
| DualQuaternion (float fAngle, float fPitch, const Vector &vDirection, const Vector &vMoment)
| Constructs a dual quaternion which represents a screw motion.
| DualQuaternion (const Vector &vTranslation, const Quaternion &vRotation)
| Construct a dual quaternion which represents a rotation and a translation.
| DualQuaternion (const Matrix &mRigid)
| Constructs a dual quaternion from a matrix which represents a rigid transformation.
Matrix | ToMatrix (void) const
| Converts the dual quaternion into a matrix which represents the same transformation as the quaternion.
Vector | Translation (void) const
| Returns the translation represented by this dual quaternion.
Vector | Transform (const Vector &vPoint) const
| Transform a given point by the dual quaternion.
DualQuaternion | operator+ (const DualQuaternion &vAddition) const
| Returns the sum of two dual quaternions.
DualQuaternion & | operator+= (const DualQuaternion &vAddition)
| Adds a dual quaternion to this dual quaternion.
DualQuaternion | operator- (const DualQuaternion &vAddition) const
| Returns the substraction of two dual quaternions.
DualQuaternion & | operator-= (const DualQuaternion &vAddition)
| Substracts a dual quaternion from this dual quaternion.
DualQuaternion | operator* (const DualQuaternion &vMultiplier) const
| Returns the multiplication of two dual quaternions.
DualQuaternion & | operator*= (const DualQuaternion &vMultiplier)
| Multiplies a quaternion by another one.
DualQuaternion | operator* (float fMultiplier) const
| Returns the product of the dual quaternion and a scalar value.
DualQuaternion & | Normalize (void)
| Normalizes the dual quaternions.
void | ToScrew (float &fAngle, float &fPitch, Vector &vDirection, Vector &vMoment) const
| Converts the transfomation represented by the qual quaternion into a screw motion.
DualQuaternion & | Power (float fExponent)
| Calculates the power of the dual quaternion.
DualQuaternion | Slerp (const DualQuaternion &vTarget, float fWeight) const
| Calculates the weighted average of two dual quaternions.
DualQuaternion & | Conjugate (void)
| Conjugates the dual quaternion using the quaternion conjugation.
DualQuaternion & | DualConjugate (void)
| Conjugates the dual quaternion using the dual conjugation.
DualQuaternion & | DoubleConjugate (void)
| Conjugates the dual quaternion by both the quaternion and dual conjugation.
DualQuaternion & | Invert (void)
| Inverts the dual quaternion.
void | SetIdentity (void)
| Sets the dual quaternion to represents the identical transformaion.
float | operator[] (int iIndex) const
| Returns the stored value inside the dual quaternion.
## Public Attributes
Quaternion | m_vReal
| Content of the dual quaterion as two regular quaternions.
Quaternion | m_vDual

## Constructor & Destructor Documentation

DualQuaternion | ( | void |  | ) | `[inline]`

Constructs a dual quaternion which represents the identical transformation.

Definition at line 1362 of file math.h.

    { SetIdentity(); };

DualQuaternion | ( | const Quaternion & | vReal,
|  | const Quaternion & | vDual
| ) |  | `[inline]`

Constructs a dual quaternion from two quaternions, using one as the real and the other one as the dual part.

Parameters:

  [in] | vReal | Real part.
  [in] | vDual | Dual part.

Definition at line 1365 of file math.h.

        { m_vReal = vReal; m_vDual = vDual; };

DualQuaternion | ( | const Vector & | vPivot,
|  | const Vector & | vAxis,
|  | float | fAngle
| ) |  |

Constructs a dual quaternion which represents a transformation which is a rotation around a given point in the space with a given rotation axis and a given vector.

Parameters:

  [in] | vPivot | Point in the space which is the center of the rotation.
  [in] | vAxis | Axis of the rotation.
  [in] | fAngle | Angle of the rotation in radian.

DualQuaternion | ( | float | fAngle,
|  | float | fPitch,
|  | const Vector & | vDirection,
|  | const Vector & | vMoment
| ) |  |

Constructs a dual quaternion which represents a screw motion.

Parameters:

  [in] | fAngle | Angle of the rotation in radian.
  [in] | fPitch |

DualQuaternion | ( | const Vector & | vTranslation,
|  | const Quaternion & | vRotation
| ) |  |

Construct a dual quaternion which represents a rotation and a translation.

Parameters:

  [in] | vTranslation | Translation part of the transformation.
  [in] | vRotation | Rotation part of the transformation.

DualQuaternion | ( | const Matrix & | mRigid | ) |

Constructs a dual quaternion from a matrix which represents a rigid transformation.

See also:
  Matrix::IsRigid()

## Member Function Documentation

Matrix ToMatrix | ( | void |  | ) | const

Search for all occurrences

Converts the dual quaternion into a matrix which represents the same transformation as the quaternion.

Vector Translation | ( | void |  | ) | const

Search for all occurrences

Returns the translation represented by this dual quaternion.

Vector Transform | ( | const Vector & | vPoint | ) | const

Search for all occurrences

Transform a given point by the dual quaternion.

DualQuaternion operator+ | ( | const DualQuaternion & | vAddition | ) | const

Returns the sum of two dual quaternions.

DualQuaternion& operator+= | ( | const DualQuaternion & | vAddition | ) |

Adds a dual quaternion to this dual quaternion.

DualQuaternion operator- | ( | const DualQuaternion & | vAddition | ) | const

Returns the substraction of two dual quaternions.

DualQuaternion& operator-= | ( | const DualQuaternion & | vAddition | ) |

Substracts a dual quaternion from this dual quaternion.

DualQuaternion operator* | ( | const DualQuaternion & | vMultiplier | ) | const

Returns the multiplication of two dual quaternions.

The result is representing the transformation which is the concatenation of the two transformation represented by the two dual quaternions.

DualQuaternion& operator*= | ( | const DualQuaternion & | vMultiplier | ) |

Multiplies a quaternion by another one.

DualQuaternion operator* | ( | float | fMultiplier | ) | const

Returns the product of the dual quaternion and a scalar value.

DualQuaternion& Normalize | ( | void |  | ) |

Search for all occurrences

Normalizes the dual quaternions.

Only normalized dual quaternions are valid representations of rigid transformations.

void ToScrew | ( | float & | fAngle,
|  | float & | fPitch,
|  | Vector & | vDirection,
|  | Vector & | vMoment
| ) |  | const

Search for all occurrences

Converts the transfomation represented by the qual quaternion into a screw motion.

DualQuaternion& Power | ( | float | fExponent | ) |

Search for all occurrences

Calculates the power of the dual quaternion.

DualQuaternion Slerp | ( | const DualQuaternion & | vTarget,
|  | float | fWeight
| ) |  | const

Search for all occurrences

Calculates the weighted average of two dual quaternions.

This is a good quality but slow blending function.

DualQuaternion& Conjugate | ( | void |  | ) |

Search for all occurrences

Conjugates the dual quaternion using the quaternion conjugation.

DualQuaternion& DualConjugate | ( | void |  | ) |

Search for all occurrences

Conjugates the dual quaternion using the dual conjugation.

DualQuaternion& DoubleConjugate | ( | void |  | ) | `[inline]`

Search for all occurrences

Conjugates the dual quaternion by both the quaternion and dual conjugation.

For unit dual quaternions this is the same as Invert().

Definition at line 1449 of file math.h.

    { Conjugate(); DualConjugate(); return *this; };

DualQuaternion& Invert | ( | void |  | ) |

Search for all occurrences

Inverts the dual quaternion.

The result will represent a transformation which is the inverse of the transformation represented by the original dual quaternion.

void SetIdentity | ( | void |  | ) | `[inline]`

Search for all occurrences

Sets the dual quaternion to represents the identical transformaion.

Definition at line 1456 of file math.h.

    { m_vReal.SetIdentity(); m_vDual.SetZero(); };

float operator[] | ( | int | iIndex | ) | const

Returns the stored value inside the dual quaternion.

Parameters:

  [in] | iIndex | Index of the dual quaternion value, must be smaller than 8.

## Member Data Documentation

Quaternion m_vReal

Search for all occurrences

Content of the dual quaterion as two regular quaternions.

These data members of the class can be accessed freely. The dual quaterion is represented with two quaternions, one beeing as the real part and the other is the dual part. In other words, m_vReal holds the rotation component, while the dual part is responsible for the translation part.

Definition at line 1468 of file math.h.

Quaternion m_vDual

Search for all occurrences

Definition at line 1468 of file math.h.

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

- Mudbox/math.h

DualQuaternion DualQuaternion DualQuaternion DualQuaternion DualQuaternion DualQuaternion DualQuaternion DualQuaternion DualQuaternion DualQuaternion
DualQuaternion DualQuaternion DualQuaternion DualQuaternion DualQuaternion DualQuaternion DualQuaternion DualQuaternion DualQuaternion DualQuaternion