This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GfDualQuatf Class Referencefinal

Basic type: a real part quaternion and a dual part quaternion. More...

#include <dualQuatf.h>

Public Types

typedef float ScalarType
 

Public Member Functions

 GfDualQuatf ()
 The default constructor leaves the dual quaternion undefined.
 
 GfDualQuatf (float realVal)
 Initialize the real part to realVal and the imaginary part to zero quaternion.
 
 GfDualQuatf (const GfQuatf &real)
 Initialize the real part to real quaternion and the imaginary part to zero quaternion.
 
 GfDualQuatf (const GfQuatf &real, const GfQuatf &dual)
 This constructor initializes the real and dual parts.
 
 GfDualQuatf (const GfQuatf &rotation, const GfVec3f &translation)
 This constructor initializes from a rotation and a translation components.
 
GF_API GfDualQuatf (const GfDualQuatd &other)
 Construct from GfDualQuatd.
 
GF_API GfDualQuatf (const GfDualQuath &other)
 Implicitly convert from GfDualQuath.
 
void SetReal (const GfQuatf &real)
 Sets the real part of the dual quaternion.
 
void SetDual (const GfQuatf &dual)
 Sets the dual part of the dual quaternion.
 
const GfQuatfGetReal () const
 Returns the real part of the dual quaternion.
 
const GfQuatfGetDual () const
 Returns the dual part of the dual quaternion.
 
GF_API std::pair< float, float > GetLength () const
 Returns geometric length of this dual quaternion.
 
GF_API GfDualQuatf GetNormalized (float eps=GF_MIN_VECTOR_LENGTH) const
 Returns a normalized (unit-length) version of this dual quaternion.
 
GF_API std::pair< float, float > Normalize (float eps=GF_MIN_VECTOR_LENGTH)
 Normalizes this dual quaternion in place.
 
GF_API GfDualQuatf GetConjugate () const
 Returns the conjugate of this dual quaternion.
 
GF_API GfDualQuatf GetInverse () const
 Returns the inverse of this dual quaternion.
 
GF_API void SetTranslation (const GfVec3f &translation)
 Set the translation component of this dual quaternion.
 
GF_API GfVec3f GetTranslation () const
 Get the translation component of this dual quaternion.
 
bool operator== (const GfDualQuatf &dq) const
 Component-wise dual quaternion equality test.
 
bool operator!= (const GfDualQuatf &dq) const
 Component-wise dual quaternion inequality test.
 
GfDualQuatfoperator+= (const GfDualQuatf &dq)
 Component-wise unary sum operator.
 
GfDualQuatfoperator-= (const GfDualQuatf &dq)
 Component-wise unary difference operator.
 
GF_API GfDualQuatfoperator*= (const GfDualQuatf &dq)
 Post-multiplies dual quaternion dq into this dual quaternion.
 
GfDualQuatfoperator*= (float s)
 Scales this dual quaternion by s.
 
GfDualQuatfoperator/= (float s)
 Scales this dual quaternion by 1 / s.
 
GF_API GfVec3f Transform (const GfVec3f &vec) const
 Transforms the row vector vec by the dual quaternion.
 

Static Public Member Functions

static GfDualQuatf GetZero ()
 Returns the zero dual quaternion, which has a real part of (0,0,0,0) and a dual part of (0,0,0,0).
 
static GfDualQuatf GetIdentity ()
 Returns the identity dual quaternion, which has a real part of (1,0,0,0) and a dual part of (0,0,0,0).
 

Friends

size_t hash_value (const GfDualQuatf &dq)
 Hash.
 
GfDualQuatf operator+ (const GfDualQuatf &dq1, const GfDualQuatf &dq2)
 Component-wise binary sum operator.
 
GfDualQuatf operator- (const GfDualQuatf &dq1, const GfDualQuatf &dq2)
 Component-wise binary difference operator.
 
GfDualQuatf operator* (const GfDualQuatf &dq1, const GfDualQuatf &dq2)
 Returns the product of dual quaternions dq1 and dq2.
 
GfDualQuatf operator* (const GfDualQuatf &dq, float s)
 Returns the product of dual quaternion dq and scalar s.
 
GfDualQuatf operator* (float s, const GfDualQuatf &dq)
 Returns the product of dual quaternion dq and scalar s.
 
GfDualQuatf operator/ (const GfDualQuatf &dq, float s)
 Returns the product of dual quaternion dq and scalar 1 / s.
 

Detailed Description

Basic type: a real part quaternion and a dual part quaternion.

This class represents a generalized dual quaternion that has a real part and a dual part quaternions. Dual quaternions are used to represent a combination of rotation and translation.

References: https://www.cs.utah.edu/~ladislav/kavan06dual/kavan06dual.pdf https://faculty.sites.iastate.edu/jia/files/inline-files/dual-quaternion.pdf

Definition at line 49 of file dualQuatf.h.

Member Typedef Documentation

◆ ScalarType

typedef float ScalarType

Definition at line 52 of file dualQuatf.h.

Constructor & Destructor Documentation

◆ GfDualQuatf() [1/7]

GfDualQuatf ( )
inline

The default constructor leaves the dual quaternion undefined.

Definition at line 55 of file dualQuatf.h.

◆ GfDualQuatf() [2/7]

GfDualQuatf ( float  realVal)
inlineexplicit

Initialize the real part to realVal and the imaginary part to zero quaternion.

Since quaternions typically must be normalized, reasonable values for realVal are -1, 0, or 1. Other values are legal but are likely to be meaningless.

Definition at line 64 of file dualQuatf.h.

◆ GfDualQuatf() [3/7]

GfDualQuatf ( const GfQuatf real)
inlineexplicit

Initialize the real part to real quaternion and the imaginary part to zero quaternion.

Definition at line 69 of file dualQuatf.h.

◆ GfDualQuatf() [4/7]

GfDualQuatf ( const GfQuatf real,
const GfQuatf dual 
)
inline

This constructor initializes the real and dual parts.

Definition at line 74 of file dualQuatf.h.

◆ GfDualQuatf() [5/7]

GfDualQuatf ( const GfQuatf rotation,
const GfVec3f translation 
)
inline

This constructor initializes from a rotation and a translation components.

Definition at line 79 of file dualQuatf.h.

◆ GfDualQuatf() [6/7]

GF_API GfDualQuatf ( const GfDualQuatd other)
explicit

Construct from GfDualQuatd.

◆ GfDualQuatf() [7/7]

GF_API GfDualQuatf ( const GfDualQuath other)

Implicitly convert from GfDualQuath.

Member Function Documentation

◆ GetConjugate()

GF_API GfDualQuatf GetConjugate ( ) const

Returns the conjugate of this dual quaternion.

◆ GetDual()

const GfQuatf & GetDual ( ) const
inline

Returns the dual part of the dual quaternion.

Definition at line 107 of file dualQuatf.h.

◆ GetIdentity()

static GfDualQuatf GetIdentity ( )
inlinestatic

Returns the identity dual quaternion, which has a real part of (1,0,0,0) and a dual part of (0,0,0,0).

Definition at line 119 of file dualQuatf.h.

◆ GetInverse()

GF_API GfDualQuatf GetInverse ( ) const

Returns the inverse of this dual quaternion.

◆ GetLength()

GF_API std::pair< float, float > GetLength ( ) const

Returns geometric length of this dual quaternion.

◆ GetNormalized()

GF_API GfDualQuatf GetNormalized ( float  eps = GF_MIN_VECTOR_LENGTH) const

Returns a normalized (unit-length) version of this dual quaternion.

If the length of this dual quaternion is smaller than eps, this returns the identity dual quaternion.

◆ GetReal()

const GfQuatf & GetReal ( ) const
inline

Returns the real part of the dual quaternion.

Definition at line 102 of file dualQuatf.h.

◆ GetTranslation()

GF_API GfVec3f GetTranslation ( ) const

Get the translation component of this dual quaternion.

◆ GetZero()

static GfDualQuatf GetZero ( )
inlinestatic

Returns the zero dual quaternion, which has a real part of (0,0,0,0) and a dual part of (0,0,0,0).

Definition at line 113 of file dualQuatf.h.

◆ Normalize()

GF_API std::pair< float, float > Normalize ( float  eps = GF_MIN_VECTOR_LENGTH)

Normalizes this dual quaternion in place.

Normalizes this dual quaternion in place to unit length, returning the length before normalization. If the length of this dual quaternion is smaller than eps, this sets the dual quaternion to identity.

◆ operator!=()

bool operator!= ( const GfDualQuatf dq) const
inline

Component-wise dual quaternion inequality test.

The real and dual parts must match exactly for dual quaternions to be considered equal.

Definition at line 170 of file dualQuatf.h.

◆ operator*=() [1/2]

GF_API GfDualQuatf & operator*= ( const GfDualQuatf dq)

Post-multiplies dual quaternion dq into this dual quaternion.

◆ operator*=() [2/2]

GfDualQuatf & operator*= ( float  s)
inline

Scales this dual quaternion by s.

Definition at line 193 of file dualQuatf.h.

◆ operator+=()

GfDualQuatf & operator+= ( const GfDualQuatf dq)
inline

Component-wise unary sum operator.

Definition at line 175 of file dualQuatf.h.

◆ operator-=()

GfDualQuatf & operator-= ( const GfDualQuatf dq)
inline

Component-wise unary difference operator.

Definition at line 182 of file dualQuatf.h.

◆ operator/=()

GfDualQuatf & operator/= ( float  s)
inline

Scales this dual quaternion by 1 / s.

Definition at line 200 of file dualQuatf.h.

◆ operator==()

bool operator== ( const GfDualQuatf dq) const
inline

Component-wise dual quaternion equality test.

The real and dual parts must match exactly for dual quaternions to be considered equal.

Definition at line 163 of file dualQuatf.h.

◆ SetDual()

void SetDual ( const GfQuatf dual)
inline

Sets the dual part of the dual quaternion.

Definition at line 97 of file dualQuatf.h.

◆ SetReal()

void SetReal ( const GfQuatf real)
inline

Sets the real part of the dual quaternion.

Definition at line 92 of file dualQuatf.h.

◆ SetTranslation()

GF_API void SetTranslation ( const GfVec3f translation)

Set the translation component of this dual quaternion.

◆ Transform()

GF_API GfVec3f Transform ( const GfVec3f vec) const

Transforms the row vector vec by the dual quaternion.

Friends And Related Function Documentation

◆ hash_value

size_t hash_value ( const GfDualQuatf dq)
friend

Hash.

Definition at line 157 of file dualQuatf.h.

◆ operator* [1/3]

GfDualQuatf operator* ( const GfDualQuatf dq,
float  s 
)
friend

Returns the product of dual quaternion dq and scalar s.

Definition at line 226 of file dualQuatf.h.

◆ operator* [2/3]

GfDualQuatf operator* ( const GfDualQuatf dq1,
const GfDualQuatf dq2 
)
friend

Returns the product of dual quaternions dq1 and dq2.

Definition at line 219 of file dualQuatf.h.

◆ operator* [3/3]

GfDualQuatf operator* ( float  s,
const GfDualQuatf dq 
)
friend

Returns the product of dual quaternion dq and scalar s.

Definition at line 232 of file dualQuatf.h.

◆ operator+

GfDualQuatf operator+ ( const GfDualQuatf dq1,
const GfDualQuatf dq2 
)
friend

Component-wise binary sum operator.

Definition at line 205 of file dualQuatf.h.

◆ operator-

GfDualQuatf operator- ( const GfDualQuatf dq1,
const GfDualQuatf dq2 
)
friend

Component-wise binary difference operator.

Definition at line 212 of file dualQuatf.h.

◆ operator/

GfDualQuatf operator/ ( const GfDualQuatf dq,
float  s 
)
friend

Returns the product of dual quaternion dq and scalar 1 / s.

Definition at line 238 of file dualQuatf.h.


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