24 #ifndef PXR_BASE_GF_QUATERNION_H
25 #define PXR_BASE_GF_QUATERNION_H
64 : _real(realVal), _imaginary(0)
70 : _real(real), _imaginary(imaginary) {
80 _imaginary = imaginary;
140 return ! (*
this ==
q);
153 return (*
this) *= 1.0 /
s;
159 _imaginary += q._imaginary;
166 _imaginary -= q._imaginary;
231 double _GetLengthSquared()
const {
232 return (_real * _real +
GfDot(_imaginary, _imaginary));
253 #endif // PXR_BASE_GF_QUATERNION_H
GfQuaternion & operator/=(double s)
Scales this quaternion by 1 / s.
GF_API GfQuaternion & operator*=(const GfQuaternion &q)
Post-multiplies quaternion q into this quaternion.
void SetReal(double real)
Sets the real part of the quaternion.
friend size_t hash_value(const GfQuaternion &q)
Hash.
GF_API GfQuaternion GfSlerp(double alpha, const GfQuaternion &q0, const GfQuaternion &q1)
GF_API GfQuaternion GetNormalized(double eps=GF_MIN_VECTOR_LENGTH) const
GfQuaternion()
The default constructor leaves the quaternion undefined.
friend GfQuaternion operator+(const GfQuaternion &q1, const GfQuaternion &q2)
Component-wise binary sum operator.
GF_API friend GfQuaternion GfSlerp(double alpha, const GfQuaternion &q0, const GfQuaternion &q1)
double GetReal() const
Returns the real part of the quaternion.
bool operator==(const GfQuaternion &q) const
GLdouble GLdouble GLdouble q
GF_API GfQuaternion GetInverse() const
Returns the inverse of this quaternion.
GfQuaternion & operator+=(const GfQuaternion &q)
Component-wise unary sum operator.
GF_API std::ostream & operator<<(std::ostream &out, const GfQuaternion &q)
double GfDot(const GfQuaternion &q1, const GfQuaternion &q2)
Returns the dot (inner) product of two quaternions.
friend GfQuaternion operator*(const GfQuaternion &q1, const GfQuaternion &q2)
Returns the product of quaternions q1 and q2.
GLfloat GLfloat GLfloat alpha
GfQuaternion(int realVal)
void SetImaginary(const GfVec3d &imaginary)
Sets the imaginary part of the quaternion.
static GfQuaternion GetZero()
friend GfQuaternion operator/(const GfQuaternion &q, double s)
Returns the product of quaternion q and scalar 1 / s.
GfQuaternion(double real, const GfVec3d &imaginary)
This constructor initializes the real and imaginary parts.
friend GfQuaternion operator-(const GfQuaternion &q1, const GfQuaternion &q2)
Component-wise binary difference operator.
GF_API double Normalize(double eps=GF_MIN_VECTOR_LENGTH)
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
static GfQuaternion GetIdentity()
#define PXR_NAMESPACE_CLOSE_SCOPE
bool operator!=(const GfQuaternion &q) const
GfQuaternion & operator-=(const GfQuaternion &q)
Component-wise unary difference operator.
const GfVec3d & GetImaginary() const
Returns the imaginary part of the quaternion.
#define GF_MIN_VECTOR_LENGTH
GF_API double GetLength() const
Returns geometric length of this quaternion.