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