11#ifndef PXR_BASE_GF_DUALQUATH_H
12#define PXR_BASE_GF_DUALQUATH_H
18#include "pxr/base/gf/api.h"
20#include "pxr/base/gf/traits.h"
28PXR_NAMESPACE_OPEN_SCOPE
71 : _real( real ), _dual( 0 ) {
76 : _real( real ), _dual( dual ) {
172 return ! (*
this == dq);
202 return (*
this) *= 1.0 / s;
265PXR_NAMESPACE_CLOSE_SCOPE
Basic type: a real part quaternion and a dual part quaternion.
Basic type: a real part quaternion and a dual part quaternion.
Basic type: a real part quaternion and a dual part quaternion.
GF_API GfDualQuath GetConjugate() const
Returns the conjugate of this dual quaternion.
const GfQuath & GetDual() const
Returns the dual part of the dual quaternion.
GF_API GfDualQuath(const GfDualQuatf &other)
Construct from GfDualQuatf.
GF_API GfDualQuath GetInverse() const
Returns the inverse of this dual quaternion.
GF_API GfDualQuath & operator*=(const GfDualQuath &dq)
Post-multiplies dual quaternion dq into this dual quaternion.
friend GfDualQuath operator-(const GfDualQuath &dq1, const GfDualQuath &dq2)
Component-wise binary difference operator.
friend size_t hash_value(const GfDualQuath &dq)
Hash.
bool operator!=(const GfDualQuath &dq) const
Component-wise dual quaternion inequality test.
GfDualQuath()
The default constructor leaves the dual quaternion undefined.
GfDualQuath & operator-=(const GfDualQuath &dq)
Component-wise unary difference operator.
GF_API std::pair< GfHalf, GfHalf > GetLength() const
Returns geometric length of this dual quaternion.
GfDualQuath(const GfQuath &real, const GfQuath &dual)
This constructor initializes the real and dual parts.
GfDualQuath(const GfQuath &rotation, const GfVec3h &translation)
This constructor initializes from a rotation and a translation components.
GfDualQuath(const GfQuath &real)
Initialize the real part to real quaternion and the imaginary part to zero quaternion.
GF_API std::pair< GfHalf, GfHalf > Normalize(GfHalf eps=GF_MIN_VECTOR_LENGTH)
Normalizes this dual quaternion in place.
const GfQuath & GetReal() const
Returns the real part of the dual quaternion.
GfDualQuath(GfHalf realVal)
Initialize the real part to realVal and the imaginary part to zero quaternion.
void SetDual(const GfQuath &dual)
Sets the dual part of the dual quaternion.
GF_API GfDualQuath GetNormalized(GfHalf eps=GF_MIN_VECTOR_LENGTH) const
Returns a normalized (unit-length) version of this dual quaternion.
static GfDualQuath GetZero()
Returns the zero dual quaternion, which has a real part of (0,0,0,0) and a dual part of (0,...
friend GfDualQuath operator+(const GfDualQuath &dq1, const GfDualQuath &dq2)
Component-wise binary sum operator.
GF_API GfVec3h GetTranslation() const
Get the translation component of this dual quaternion.
GfDualQuath & operator+=(const GfDualQuath &dq)
Component-wise unary sum operator.
GF_API GfDualQuath(const GfDualQuatd &other)
Construct from GfDualQuatd.
friend GfDualQuath operator/(const GfDualQuath &dq, GfHalf s)
Returns the product of dual quaternion dq and scalar 1 / s.
GF_API GfVec3h Transform(const GfVec3h &vec) const
Transforms the row vector vec by the dual quaternion.
GfDualQuath & operator/=(GfHalf s)
Scales this dual quaternion by 1 / s.
bool operator==(const GfDualQuath &dq) const
Component-wise dual quaternion equality test.
void SetReal(const GfQuath &real)
Sets the real part of the dual quaternion.
friend GfDualQuath operator*(const GfDualQuath &dq1, const GfDualQuath &dq2)
Returns the product of dual quaternions dq1 and dq2.
GF_API void SetTranslation(const GfVec3h &translation)
Set the translation component of this dual quaternion.
static GfDualQuath GetIdentity()
Returns the identity dual quaternion, which has a real part of (1,0,0,0) and a dual part of (0,...
Basic type: a quaternion, a complex number with a real coefficient and three imaginary coefficients,...
static GfQuath GetZero()
Return the zero quaternion, with real coefficient 0 and an imaginary coefficients all zero.
static GfQuath GetIdentity()
Return the identity quaternion, with real coefficient 1 and an imaginary coefficients all zero.
Basic type for a vector of 3 GfHalf components.
static size_t Combine(Args &&... args)
Produce a hash code by combining the hash codes of several objects.
GfHalf GfDot(const GfDualQuath &dq1, const GfDualQuath &dq2)
Return the dot (inner) product of two dual quaternions.
#define GF_MIN_VECTOR_LENGTH
This constant is used to determine whether the length of a vector is too small to handle accurately.
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
This header serves to simply bring in the half float datatype and provide a hash_value function.
pxr_half::half GfHalf
A 16-bit floating point data type.
A metafunction with a static const bool member 'value' that is true for GfDualQuat types and false fo...