28 #ifndef PXR_BASE_GF_QUATD_H
29 #define PXR_BASE_GF_QUATD_H
75 explicit GfQuatd (
double realVal) : _imaginary(0), _real(realVal) {}
78 GfQuatd(
double real,
double i,
double j,
double k)
79 : _imaginary(i, j, k), _real(real)
85 : _imaginary(imaginary), _real(real)
115 _imaginary = imaginary;
120 _imaginary.
Set(i, j, k);
183 return !(*
this ==
q);
207 _imaginary += q._imaginary;
214 _imaginary -= q._imaginary;
263 _GetLengthSquared()
const {
264 return GfDot(*
this, *
this);
290 #endif // PXR_BASE_GF_QUATD_H
const GfVec3d & GetImaginary() const
Return the imaginary coefficient.
GfQuatd GetNormalized(double eps=GF_MIN_VECTOR_LENGTH) const
GfQuatd & operator+=(const GfQuatd &q)
Add quaternion q to this quaternion.
GfQuatd()
Default constructor leaves the quaternion undefined.
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
double GfDot(const GfQuatd &q1, const GfQuatd &q2)
Return the dot (inner) product of two quaternions.
GF_API std::ostream & operator<<(std::ostream &, GfQuatd const &)
GfQuatd & operator-=(const GfQuatd &q)
Component-wise unary difference operator.
GLdouble GLdouble GLdouble q
double GetLength() const
Return geometric length of this quaternion.
static GfQuatd GetIdentity()
GF_API GfQuatd GfSlerp(double alpha, const GfQuatd &q0, const GfQuatd &q1)
double GetReal() const
Return the real coefficient.
GF_API GfQuatd & operator*=(const GfQuatd &q)
Post-multiply quaternion q into this quaternion.
GfQuatd GetInverse() const
GfQuatd GetConjugate() const
GLfloat GLfloat GLfloat alpha
GfQuatd(double real, double i, double j, double k)
Initialize the real and imaginary coefficients.
bool operator!=(const GfQuatd &q) const
static size_t Combine(Args &&...args)
Produce a hash code by combining the hash codes of several objects.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
GfQuatd & operator/=(double s)
Divide this quaternion's coefficients by s.
void SetImaginary(const GfVec3d &imaginary)
Set the imaginary coefficients.
GfVec3d & Set(double s0, double s1, double s2)
Set all elements with passed arguments.
friend GfQuatd operator+(const GfQuatd &q1, const GfQuatd &q2)
Component-wise binary sum operator.
void SetImaginary(double i, double j, double k)
Set the imaginary coefficients.
void SetReal(double real)
Set the real coefficient.
friend size_t hash_value(const GfQuatd &q)
Hash.
#define PXR_NAMESPACE_CLOSE_SCOPE
friend GfQuatd operator*(const GfQuatd &q1, const GfQuatd &q2)
Returns the product of quaternions q1 and q2.
GfQuatd operator-() const
Component-wise negation.
GF_API GfVec3d Transform(const GfVec3d &point) const
GF_API double Normalize(double eps=GF_MIN_VECTOR_LENGTH)
GfQuatd(double real, const GfVec3d &imaginary)
Initialize the real and imaginary coefficients.
bool operator==(const GfQuatd &q) const
#define GF_MIN_VECTOR_LENGTH
friend GfQuatd operator/(const GfQuatd &q, double s)
Returns the product of quaternion q and scalar 1 / s.