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