28 #ifndef PXR_BASE_GF_QUATF_H
29 #define PXR_BASE_GF_QUATF_H
40 #include <hboost/functional/hash.hpp>
76 explicit GfQuatf (
float realVal) : _imaginary(0), _real(realVal) {}
79 GfQuatf(
float real,
float i,
float j,
float k)
80 : _imaginary(i, j, k), _real(real)
86 : _imaginary(imaginary), _real(real)
112 _imaginary = imaginary;
117 _imaginary.
Set(i, j, k);
162 size_t h = hboost::hash<ScalarType>()(q.
GetReal());
182 return !(*
this ==
q);
206 _imaginary += q._imaginary;
213 _imaginary -= q._imaginary;
262 _GetLengthSquared()
const {
263 return GfDot(*
this, *
this);
289 #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
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.
GLdouble GLdouble GLdouble GLdouble q
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.
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
GLfloat GLfloat GLfloat GLfloat h
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE
GLsizei const GLfloat * value
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)
GLfloat GLfloat GLfloat alpha
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