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

#include <quatf.h>

Public Types

typedef float ScalarType
 
typedef GfVec3f ImaginaryType
 

Public Member Functions

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

Static Public Member Functions

static GfQuatf GetZero ()
 
static GfQuatf GetIdentity ()
 

Friends

size_t hash_value (const GfQuatf &q)
 Hash. More...
 
GfQuatf operator+ (const GfQuatf &q1, const GfQuatf &q2)
 Component-wise binary sum operator. More...
 
GfQuatf operator- (const GfQuatf &q1, const GfQuatf &q2)
 Component-wise binary difference operator. More...
 
GfQuatf operator* (const GfQuatf &q1, const GfQuatf &q2)
 Returns the product of quaternions q1 and q2. More...
 
GfQuatf operator* (const GfQuatf &q, float s)
 Returns the product of quaternion q and scalar s. More...
 
GfQuatf operator* (float s, const GfQuatf &q)
 Returns the product of quaternion q and scalar s. More...
 
GfQuatf operator/ (const GfQuatf &q, float 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 quatf.h.

Member Typedef Documentation

Definition at line 63 of file quatf.h.

Definition at line 62 of file quatf.h.

Constructor & Destructor Documentation

GfQuatf::GfQuatf ( )
inline

Default constructor leaves the quaternion undefined.

Definition at line 66 of file quatf.h.

GfQuatf::GfQuatf ( float  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 quatf.h.

GfQuatf::GfQuatf ( float  real,
float  i,
float  j,
float  k 
)
inline

Initialize the real and imaginary coefficients.

Definition at line 78 of file quatf.h.

GfQuatf::GfQuatf ( float  real,
const GfVec3f imaginary 
)
inline

Initialize the real and imaginary coefficients.

Definition at line 84 of file quatf.h.

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

Construct from GfQuatd.

GF_API GfQuatf::GfQuatf ( class GfQuath const other)

Implicitly convert from GfQuath.

Member Function Documentation

GfQuatf GfQuatf::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 quatf.h.

static GfQuatf GfQuatf::GetIdentity ( )
inlinestatic

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

Definition at line 102 of file quatf.h.

const GfVec3f& GfQuatf::GetImaginary ( ) const
inline

Return the imaginary coefficient.

Definition at line 111 of file quatf.h.

GfQuatf GfQuatf::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 quatf.h.

float GfQuatf::GetLength ( ) const
inline

Return geometric length of this quaternion.

Definition at line 124 of file quatf.h.

GfQuatf GfQuatf::GetNormalized ( float  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 quatf.h.

float GfQuatf::GetReal ( ) const
inline

Return the real coefficient.

Definition at line 105 of file quatf.h.

static GfQuatf GfQuatf::GetZero ( )
inlinestatic

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

Definition at line 98 of file quatf.h.

GF_API float GfQuatf::Normalize ( float  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 GfQuatf::operator!= ( const GfQuatf 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 quatf.h.

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

Post-multiply quaternion q into this quaternion.

GfQuatf& GfQuatf::operator*= ( float  s)
inline

Multiply this quaternion's coefficients by s.

Definition at line 191 of file quatf.h.

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

Add quaternion q to this quaternion.

Definition at line 205 of file quatf.h.

GfQuatf GfQuatf::operator- ( ) const
inline

Component-wise negation.

Definition at line 169 of file quatf.h.

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

Component-wise unary difference operator.

Definition at line 212 of file quatf.h.

GfQuatf& GfQuatf::operator/= ( float  s)
inline

Divide this quaternion's coefficients by s.

Definition at line 198 of file quatf.h.

bool GfQuatf::operator== ( const GfQuatf 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 quatf.h.

void GfQuatf::SetImaginary ( const GfVec3f imaginary)
inline

Set the imaginary coefficients.

Definition at line 114 of file quatf.h.

void GfQuatf::SetImaginary ( float  i,
float  j,
float  k 
)
inline

Set the imaginary coefficients.

Definition at line 119 of file quatf.h.

void GfQuatf::SetReal ( float  real)
inline

Set the real coefficient.

Definition at line 108 of file quatf.h.

GF_API GfVec3f GfQuatf::Transform ( const GfVec3f point) const

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

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

but is more efficient.

Friends And Related Function Documentation

size_t hash_value ( const GfQuatf q)
friend

Hash.

Definition at line 164 of file quatf.h.

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

Returns the product of quaternions q1 and q2.

Definition at line 232 of file quatf.h.

GfQuatf operator* ( const GfQuatf q,
float  s 
)
friend

Returns the product of quaternion q and scalar s.

Definition at line 238 of file quatf.h.

GfQuatf operator* ( float  s,
const GfQuatf q 
)
friend

Returns the product of quaternion q and scalar s.

Definition at line 244 of file quatf.h.

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

Component-wise binary sum operator.

Definition at line 220 of file quatf.h.

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

Component-wise binary difference operator.

Definition at line 226 of file quatf.h.

GfQuatf operator/ ( const GfQuatf q,
float  s 
)
friend

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

Definition at line 250 of file quatf.h.


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