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