11#ifndef PXR_BASE_GF_DUALQUATD_H
12#define PXR_BASE_GF_DUALQUATD_H
18#include "pxr/base/gf/api.h"
20#include "pxr/base/gf/traits.h"
27PXR_NAMESPACE_OPEN_SCOPE
52 typedef double ScalarType;
64 explicit GfDualQuatd(
double realVal ) : _real( realVal ), _dual( 0 ) {}
70 : _real( real ), _dual( 0 ) {
75 : _real( real ), _dual( dual ) {
171 return ! (*
this == dq);
201 return (*
this) *= 1.0 / s;
264PXR_NAMESPACE_CLOSE_SCOPE
Basic type: a real part quaternion and a dual part quaternion.
GF_API GfDualQuatd(const GfDualQuath &other)
Implicitly convert from GfDualQuath.
GF_API std::pair< double, double > GetLength() const
Returns geometric length of this dual quaternion.
GF_API std::pair< double, double > Normalize(double eps=GF_MIN_VECTOR_LENGTH)
Normalizes this dual quaternion in place.
GF_API GfDualQuatd GetConjugate() const
Returns the conjugate of this dual quaternion.
bool operator==(const GfDualQuatd &dq) const
Component-wise dual quaternion equality test.
const GfQuatd & GetDual() const
Returns the dual part of the dual quaternion.
GfDualQuatd & operator/=(double s)
Scales this dual quaternion by 1 / s.
GF_API GfDualQuatd GetNormalized(double eps=GF_MIN_VECTOR_LENGTH) const
Returns a normalized (unit-length) version of this dual quaternion.
void SetReal(const GfQuatd &real)
Sets the real part of the dual quaternion.
GfDualQuatd(const GfQuatd &real, const GfQuatd &dual)
This constructor initializes the real and dual parts.
GfDualQuatd & operator-=(const GfDualQuatd &dq)
Component-wise unary difference operator.
GfDualQuatd & operator+=(const GfDualQuatd &dq)
Component-wise unary sum operator.
friend GfDualQuatd operator/(const GfDualQuatd &dq, double s)
Returns the product of dual quaternion dq and scalar 1 / s.
GF_API GfVec3d GetTranslation() const
Get the translation component of this dual quaternion.
friend GfDualQuatd operator+(const GfDualQuatd &dq1, const GfDualQuatd &dq2)
Component-wise binary sum operator.
GfDualQuatd(const GfQuatd &real)
Initialize the real part to real quaternion and the imaginary part to zero quaternion.
GF_API GfDualQuatd GetInverse() const
Returns the inverse of this dual quaternion.
GF_API GfDualQuatd(const GfDualQuatf &other)
Implicitly convert from GfDualQuatf.
const GfQuatd & GetReal() const
Returns the real part of the dual quaternion.
friend GfDualQuatd operator*(const GfDualQuatd &dq1, const GfDualQuatd &dq2)
Returns the product of dual quaternions dq1 and dq2.
GfDualQuatd(const GfQuatd &rotation, const GfVec3d &translation)
This constructor initializes from a rotation and a translation components.
GF_API GfDualQuatd & operator*=(const GfDualQuatd &dq)
Post-multiplies dual quaternion dq into 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,...
GF_API GfVec3d Transform(const GfVec3d &vec) const
Transforms the row vector vec by the dual quaternion.
GF_API void SetTranslation(const GfVec3d &translation)
Set the translation component of this dual quaternion.
bool operator!=(const GfDualQuatd &dq) const
Component-wise dual quaternion inequality test.
GfDualQuatd(double realVal)
Initialize the real part to realVal and the imaginary part to zero quaternion.
friend size_t hash_value(const GfDualQuatd &dq)
Hash.
GfDualQuatd()
The default constructor leaves the dual quaternion undefined.
static GfDualQuatd GetIdentity()
Returns the identity dual quaternion, which has a real part of (1,0,0,0) and a dual part of (0,...
void SetDual(const GfQuatd &dual)
Sets the dual part of the dual quaternion.
friend GfDualQuatd operator-(const GfDualQuatd &dq1, const GfDualQuatd &dq2)
Component-wise binary difference operator.
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 quaternion, a complex number with a real coefficient and three imaginary coefficients,...
static GfQuatd GetIdentity()
Return the identity quaternion, with real coefficient 1 and an imaginary coefficients all zero.
static GfQuatd GetZero()
Return the zero quaternion, with real coefficient 0 and an imaginary coefficients all zero.
Basic type for a vector of 3 double components.
static size_t Combine(Args &&... args)
Produce a hash code by combining the hash codes of several objects.
double GfDot(const GfDualQuatd &dq1, const GfDualQuatd &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].
A metafunction with a static const bool member 'value' that is true for GfDualQuat types and false fo...