28 #ifndef PXR_BASE_GF_DUALQUATF_H 29 #define PXR_BASE_GF_DUALQUATF_H 35 #include "pxr/base/gf/api.h" 37 #include "pxr/base/gf/traits.h" 44 PXR_NAMESPACE_OPEN_SCOPE
69 typedef float ScalarType;
81 explicit GfDualQuatf(
float realVal ) : _real( realVal ), _dual( 0 ) {}
87 : _real( real ), _dual( 0 ) {
92 : _real( real ), _dual( dual ) {
142 std::pair<float, float>
GetLength()
const;
188 return ! (*
this == dq);
218 return (*
this) *= 1.0 / s;
281 PXR_NAMESPACE_CLOSE_SCOPE
283 #endif // PXR_BASE_GF_DUALQUATF_H float GfDot(const GfDualQuatf &dq1, const GfDualQuatf &dq2)
Return the dot (inner) product of two dual quaternions.
void SetDual(const GfQuatf &dual)
Sets the dual part of the dual quaternion.
static GfDualQuatf GetZero()
Returns the zero dual quaternion, which has a real part of (0,0,0,0) and a dual part of (0,...
Basic type: a real part quaternion and a dual part quaternion.
GF_API GfDualQuatf GetConjugate() const
Returns the conjugate of this dual quaternion.
GF_API std::ostream & operator<<(std::ostream &out, const GfDualQuatf &dq)
Output a GfDualQuatf using the format ((rw, rx, ry, rz), (dw, dx, dy, dz)).
friend size_t hash_value(const GfDualQuatf &dq)
Hash.
friend GfDualQuatf operator -(const GfDualQuatf &dq1, const GfDualQuatf &dq2)
Component-wise binary difference operator.
GfDualQuatf(const GfQuatf &rotation, const GfVec3f &translation)
This constructor initializes from a rotation and a translation components.
Basic type for a vector of 3 float components.
GF_API GfDualQuatf & operator *=(const GfDualQuatf &dq)
Post-multiplies dual quaternion dq into this dual quaternion.
GfDualQuatf & operator+=(const GfDualQuatf &dq)
Component-wise unary sum operator.
A metafunction with a static const bool member 'value' that is true for GfDualQuat types and false fo...
GF_API GfDualQuatf GetInverse() const
Returns the inverse of this dual quaternion.
bool operator==(const GfDualQuatf &dq) const
Component-wise dual quaternion equality test.
Basic type: a quaternion, a complex number with a real coefficient and three imaginary coefficients,...
static GfQuatf GetIdentity()
Return the identity quaternion, with real coefficient 1 and an imaginary coefficients all zero.
void SetReal(const GfQuatf &real)
Sets the real part of the dual quaternion.
GF_API std::pair< float, float > Normalize(float eps=GF_MIN_VECTOR_LENGTH)
Normalizes this dual quaternion in place.
static GfDualQuatf GetIdentity()
Returns the identity dual quaternion, which has a real part of (1,0,0,0) and a dual part of (0,...
GfDualQuatf(float realVal)
Initialize the real part to realVal and the imaginary part to zero quaternion.
friend GfDualQuatf operator *(const GfDualQuatf &dq1, const GfDualQuatf &dq2)
Returns the product of dual quaternions dq1 and dq2.
friend GfDualQuatf operator *(float s, const GfDualQuatf &dq)
Returns the product of dual quaternion dq and scalar s.
GfDualQuatf & operator/=(float s)
Scales this dual quaternion by 1 / s.
static size_t Combine(Args &&... args)
Produce a hash code by combining the hash codes of several objects.
GF_API GfDualQuatf GetNormalized(float eps=GF_MIN_VECTOR_LENGTH) const
Returns a normalized (unit-length) version of this dual quaternion.
Basic type: a real part quaternion and a dual part quaternion.
GfDualQuatf(const GfQuatf &real, const GfQuatf &dual)
This constructor initializes the real and dual parts.
const GfQuatf & GetDual() const
Returns the dual part of the dual quaternion.
GfDualQuatf & operator -=(const GfDualQuatf &dq)
Component-wise unary difference operator.
const GfQuatf & GetReal() const
Returns the real part of the dual quaternion.
GF_API GfVec3f GetTranslation() const
Get the translation component of this dual quaternion.
GF_API std::pair< float, float > GetLength() const
Returns geometric length of this dual quaternion.
bool operator !=(const GfDualQuatf &dq) const
Component-wise dual quaternion inequality test.
GF_API void SetTranslation(const GfVec3f &translation)
Set the translation component of this dual quaternion.
static GfQuatf GetZero()
Return the zero quaternion, with real coefficient 0 and an imaginary coefficients all zero.
friend GfDualQuatf operator+(const GfDualQuatf &dq1, const GfDualQuatf &dq2)
Component-wise binary sum operator.
GfDualQuatf & operator *=(float s)
Scales this dual quaternion by s.
friend GfDualQuatf operator/(const GfDualQuatf &dq, float s)
Returns the product of dual quaternion dq and scalar 1 / s.
GfDualQuatf()
The default constructor leaves the dual quaternion undefined.
GF_API GfVec3f Transform(const GfVec3f &vec) const
Transforms the row vector vec by the dual quaternion.
Basic type: a real part quaternion and a dual part quaternion.
GfDualQuatf(const GfQuatf &real)
Initialize the real part to real quaternion and the imaginary part to zero quaternion.
friend GfDualQuatf operator *(const GfDualQuatf &dq, float s)
Returns the product of dual quaternion dq and scalar s.
#define GF_MIN_VECTOR_LENGTH
This constant is used to determine whether the length of a vector is too small to handle accurately.