HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GfQuatd Class Reference

#include <quatd.h>

Public Types

typedef double ScalarType
 
typedef GfVec3d ImaginaryType
 

Public Member Functions

 GfQuatd ()
 Default constructor leaves the quaternion undefined. More...
 
 GfQuatd (double realVal)
 
 GfQuatd (double real, double i, double j, double k)
 Initialize the real and imaginary coefficients. More...
 
 GfQuatd (double real, const GfVec3d &imaginary)
 Initialize the real and imaginary coefficients. More...
 
GF_API GfQuatd (class GfQuatf const &other)
 Implicitly convert from GfQuatf. More...
 
GF_API GfQuatd (class GfQuath const &other)
 Implicitly convert from GfQuath. More...
 
double GetReal () const
 Return the real coefficient. More...
 
void SetReal (double real)
 Set the real coefficient. More...
 
const GfVec3dGetImaginary () const
 Return the imaginary coefficient. More...
 
void SetImaginary (const GfVec3d &imaginary)
 Set the imaginary coefficients. More...
 
void SetImaginary (double i, double j, double k)
 Set the imaginary coefficients. More...
 
double GetLength () const
 Return geometric length of this quaternion. More...
 
GfQuatd GetNormalized (double eps=GF_MIN_VECTOR_LENGTH) const
 
GF_API double Normalize (double eps=GF_MIN_VECTOR_LENGTH)
 
GfQuatd GetConjugate () const
 
GfQuatd GetInverse () const
 
GF_API GfVec3d Transform (const GfVec3d &point) const
 
GfQuatd operator- () const
 Component-wise negation. More...
 
bool operator== (const GfQuatd &q) const
 
bool operator!= (const GfQuatd &q) const
 
GF_API GfQuatdoperator*= (const GfQuatd &q)
 Post-multiply quaternion q into this quaternion. More...
 
GfQuatdoperator*= (double s)
 Multiply this quaternion's coefficients by s. More...
 
GfQuatdoperator/= (double s)
 Divide this quaternion's coefficients by s. More...
 
GfQuatdoperator+= (const GfQuatd &q)
 Add quaternion q to this quaternion. More...
 
GfQuatdoperator-= (const GfQuatd &q)
 Component-wise unary difference operator. More...
 

Static Public Member Functions

static GfQuatd GetZero ()
 
static GfQuatd GetIdentity ()
 

Friends

size_t hash_value (const GfQuatd &q)
 Hash. More...
 
GfQuatd operator+ (const GfQuatd &q1, const GfQuatd &q2)
 Component-wise binary sum operator. More...
 
GfQuatd operator- (const GfQuatd &q1, const GfQuatd &q2)
 Component-wise binary difference operator. More...
 
GfQuatd operator* (const GfQuatd &q1, const GfQuatd &q2)
 Returns the product of quaternions q1 and q2. More...
 
GfQuatd operator* (const GfQuatd &q, double s)
 Returns the product of quaternion q and scalar s. More...
 
GfQuatd operator* (double s, const GfQuatd &q)
 Returns the product of quaternion q and scalar s. More...
 
GfQuatd operator/ (const GfQuatd &q, double s)
 Returns the product of quaternion q and scalar 1 / s. More...
 

Detailed Description

Basic type: a quaternion, a complex number with a real coefficient and three imaginary coefficients, stored as a 3-vector.

Definition at line 59 of file quatd.h.

Member Typedef Documentation

Definition at line 63 of file quatd.h.

typedef double GfQuatd::ScalarType

Definition at line 62 of file quatd.h.

Constructor & Destructor Documentation

GfQuatd::GfQuatd ( )
inline

Default constructor leaves the quaternion undefined.

Definition at line 66 of file quatd.h.

GfQuatd::GfQuatd ( double  realVal)
inlineexplicit

Initialize the real coefficient to realVal and the imaginary coefficients to zero.

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 75 of file quatd.h.

GfQuatd::GfQuatd ( double  real,
double  i,
double  j,
double  k 
)
inline

Initialize the real and imaginary coefficients.

Definition at line 78 of file quatd.h.

GfQuatd::GfQuatd ( double  real,
const GfVec3d imaginary 
)
inline

Initialize the real and imaginary coefficients.

Definition at line 84 of file quatd.h.

GF_API GfQuatd::GfQuatd ( class GfQuatf const &  other)

Implicitly convert from GfQuatf.

GF_API GfQuatd::GfQuatd ( class GfQuath const &  other)

Implicitly convert from GfQuath.

Member Function Documentation

GfQuatd GfQuatd::GetConjugate ( ) const
inline

Return this quaternion's conjugate, which is the quaternion with the same real coefficient and negated imaginary coefficients.

Definition at line 143 of file quatd.h.

static GfQuatd GfQuatd::GetIdentity ( )
inlinestatic

Return the identity quaternion, with real coefficient 1 and an imaginary coefficients all zero.

Definition at line 102 of file quatd.h.

const GfVec3d& GfQuatd::GetImaginary ( ) const
inline

Return the imaginary coefficient.

Definition at line 111 of file quatd.h.

GfQuatd GfQuatd::GetInverse ( ) const
inline

Return this quaternion's inverse, or reciprocal. This is the quaternion's conjugate divided by it's squared length.

Definition at line 149 of file quatd.h.

double GfQuatd::GetLength ( ) const
inline

Return geometric length of this quaternion.

Definition at line 124 of file quatd.h.

GfQuatd GfQuatd::GetNormalized ( double  eps = GF_MIN_VECTOR_LENGTH) const
inline

length of this quaternion is smaller than eps, return the identity quaternion.

Definition at line 129 of file quatd.h.

double GfQuatd::GetReal ( ) const
inline

Return the real coefficient.

Definition at line 105 of file quatd.h.

static GfQuatd GfQuatd::GetZero ( )
inlinestatic

Return the zero quaternion, with real coefficient 0 and an imaginary coefficients all zero.

Definition at line 98 of file quatd.h.

GF_API double GfQuatd::Normalize ( double  eps = GF_MIN_VECTOR_LENGTH)

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

bool GfQuatd::operator!= ( const GfQuatd q) const
inline

Component-wise quaternion inequality test. The real and imaginary parts must match exactly for quaternions to be considered equal.

Definition at line 182 of file quatd.h.

GF_API GfQuatd& GfQuatd::operator*= ( const GfQuatd q)

Post-multiply quaternion q into this quaternion.

GfQuatd& GfQuatd::operator*= ( double  s)
inline

Multiply this quaternion's coefficients by s.

Definition at line 191 of file quatd.h.

GfQuatd& GfQuatd::operator+= ( const GfQuatd q)
inline

Add quaternion q to this quaternion.

Definition at line 205 of file quatd.h.

GfQuatd GfQuatd::operator- ( ) const
inline

Component-wise negation.

Definition at line 169 of file quatd.h.

GfQuatd& GfQuatd::operator-= ( const GfQuatd q)
inline

Component-wise unary difference operator.

Definition at line 212 of file quatd.h.

GfQuatd& GfQuatd::operator/= ( double  s)
inline

Divide this quaternion's coefficients by s.

Definition at line 198 of file quatd.h.

bool GfQuatd::operator== ( const GfQuatd q) const
inline

Component-wise quaternion equality test. The real and imaginary parts must match exactly for quaternions to be considered equal.

Definition at line 175 of file quatd.h.

void GfQuatd::SetImaginary ( const GfVec3d imaginary)
inline

Set the imaginary coefficients.

Definition at line 114 of file quatd.h.

void GfQuatd::SetImaginary ( double  i,
double  j,
double  k 
)
inline

Set the imaginary coefficients.

Definition at line 119 of file quatd.h.

void GfQuatd::SetReal ( double  real)
inline

Set the real coefficient.

Definition at line 108 of file quatd.h.

GF_API GfVec3d GfQuatd::Transform ( const GfVec3d point) const

Transform the GfVec3d point. If the quaternion is normalized, the transformation is a rotation. Given a GfQuatd q, q.Transform(point) is equivalent to:

(q * GfQuatd(0, point) * q.GetInverse()).GetImaginary()

but is more efficient.

Friends And Related Function Documentation

size_t hash_value ( const GfQuatd q)
friend

Hash.

Definition at line 164 of file quatd.h.

GfQuatd operator* ( const GfQuatd q1,
const GfQuatd q2 
)
friend

Returns the product of quaternions q1 and q2.

Definition at line 232 of file quatd.h.

GfQuatd operator* ( const GfQuatd q,
double  s 
)
friend

Returns the product of quaternion q and scalar s.

Definition at line 238 of file quatd.h.

GfQuatd operator* ( double  s,
const GfQuatd q 
)
friend

Returns the product of quaternion q and scalar s.

Definition at line 244 of file quatd.h.

GfQuatd operator+ ( const GfQuatd q1,
const GfQuatd q2 
)
friend

Component-wise binary sum operator.

Definition at line 220 of file quatd.h.

GfQuatd operator- ( const GfQuatd q1,
const GfQuatd q2 
)
friend

Component-wise binary difference operator.

Definition at line 226 of file quatd.h.

GfQuatd operator/ ( const GfQuatd q,
double  s 
)
friend

Returns the product of quaternion q and scalar 1 / s.

Definition at line 250 of file quatd.h.


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