28 #ifndef PXR_BASE_GF_QUATF_H
29 #define PXR_BASE_GF_QUATF_H
75 explicit GfQuatf (
float realVal) : _imaginary(0), _real(realVal) {}
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_QUATF_H
GfQuatf operator-() const
Component-wise negation.
GfQuatf()
Default constructor leaves the quaternion undefined.
static GfQuatf GetIdentity()
GfQuatf(float real, const GfVec3f &imaginary)
Initialize the real and imaginary coefficients.
float GetLength() const
Return geometric length of this quaternion.
*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
GLdouble GLdouble GLdouble q
GF_API GfQuatf GfSlerp(double alpha, const GfQuatf &q0, const GfQuatf &q1)
GF_API GfQuatf & operator*=(const GfQuatf &q)
Post-multiply quaternion q into this quaternion.
GfQuatf(float real, float i, float j, float k)
Initialize the real and imaginary coefficients.
float GetReal() const
Return the real coefficient.
friend GfQuatf operator*(const GfQuatf &q1, const GfQuatf &q2)
Returns the product of quaternions q1 and q2.
GfQuatf & operator/=(float s)
Divide this quaternion's coefficients by s.
GF_API std::ostream & operator<<(std::ostream &, GfQuatf const &)
bool operator!=(const GfQuatf &q) const
void SetImaginary(const GfVec3f &imaginary)
Set the imaginary coefficients.
void SetReal(float real)
Set the real coefficient.
GfVec3f & Set(float s0, float s1, float s2)
Set all elements with passed arguments.
GLfloat GLfloat GLfloat alpha
float GfDot(const GfQuatf &q1, const GfQuatf &q2)
Return the dot (inner) product of two quaternions.
friend size_t hash_value(const GfQuatf &q)
Hash.
GfQuatf GetInverse() const
GF_API GfVec3f Transform(const GfVec3f &point) const
GfQuatf GetConjugate() 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
#define PXR_NAMESPACE_CLOSE_SCOPE
friend GfQuatf operator+(const GfQuatf &q1, const GfQuatf &q2)
Component-wise binary sum operator.
bool operator==(const GfQuatf &q) const
GfQuatf & operator-=(const GfQuatf &q)
Component-wise unary difference operator.
GfQuatf GetNormalized(float eps=GF_MIN_VECTOR_LENGTH) const
void SetImaginary(float i, float j, float k)
Set the imaginary coefficients.
const GfVec3f & GetImaginary() const
Return the imaginary coefficient.
GF_API float Normalize(float eps=GF_MIN_VECTOR_LENGTH)
friend GfQuatf operator/(const GfQuatf &q, float s)
Returns the product of quaternion q and scalar 1 / s.
GfQuatf & operator+=(const GfQuatf &q)
Add quaternion q to this quaternion.
#define GF_MIN_VECTOR_LENGTH