24 #ifndef PXR_BASE_GF_ROTATION_H
25 #define PXR_BASE_GF_ROTATION_H
90 if (!
GfIsClose(_axis * _axis, 1.0, 1e-10))
115 _axis.
Set(1.0, 0.0, 0.0);
133 return GfQuaternion(quat.GetReal(), quat.GetImaginary());
187 double *thetaSw =
nullptr,
189 const double *swShift=
nullptr);
210 double targetTw,
double targetFB,
double targetLR,
double targetSw,
211 double *thetaTw,
double *thetaFB,
double *thetaLR,
double *thetaSw);
231 return (_axis == r._axis &&
240 return ! (*
this ==
r);
270 return rTmp *=
scale;
283 return rTmp /=
scale;
300 #endif // PXR_BASE_GF_ROTATION_H
GF_API GfVec3f TransformDir(const GfVec3f &vec) const
Transforms row vector vec by the rotation, returning the result.
GfRotation & SetAxisAngle(const GfVec3d &axis, double angle)
Sets the rotation to be angle degrees about axis.
GfRotation GetInverse() const
Returns the inverse of this rotation.
bool operator!=(const GfRotation &r) const
SIM_API const UT_StringHolder angle
GF_API GfQuatd GetQuat() const
Returns the rotation expressed as a quaternion.
GfRotation(const GfQuatd &quat)
GfRotation(const GfQuaternion &quaternion)
This constructor initializes the rotation from a quaternion.
friend size_t hash_value(const GfRotation &r)
Hash.
GA_API const UT_StringHolder rot
double GetReal() const
Returns the real part of the quaternion.
GF_API GfRotation(const GfVec3d &rotateFrom, const GfVec3d &rotateTo)
GF_API GfRotation & SetQuat(const GfQuatd &quat)
GLfloat GLfloat GLfloat v2
friend GfRotation operator*(const GfRotation &r1, const GfRotation &r2)
Returns composite rotation of rotations r1 and r2.
GA_API const UT_StringHolder scale
GfRotation()
The default constructor leaves the rotation undefined.
GF_API GfRotation & SetRotateInto(const GfVec3d &rotateFrom, const GfVec3d &rotateTo)
GfRotation & SetQuaternion(const GfQuaternion &quat)
Sets the rotation from a quaternion.
GF_API std::ostream & operator<<(std::ostream &, const GfRotation &)
GfRotation & SetIdentity()
GfRotation & operator/=(double scale)
Scales rotation angle by dividing by scale.
PXR_NAMESPACE_OPEN_SCOPE bool GfIsClose(double a, double b, double epsilon)
GfQuaternion GetQuaternion() const
Returns the rotation expressed as a quaternion.
static GF_API void DecomposeRotation(const GfMatrix4d &rot, const GfVec3d &TwAxis, const GfVec3d &FBAxis, const GfVec3d &LRAxis, double handedness, double *thetaTw, double *thetaFB, double *thetaLR, double *thetaSw=nullptr, bool useHint=false, const double *swShift=nullptr)
GF_API GfRotation & operator*=(const GfRotation &r)
Post-multiplies rotation r into this rotation.
GfRotation(const GfVec3d &axis, double angle)
friend GfRotation operator/(const GfRotation &r, double scale)
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
GfVec3d & Set(double s0, double s1, double s2)
Set all elements with passed arguments.
bool operator==(const GfRotation &r) const
const GfVec3d & GetAxis() const
Returns the axis of rotation.
#define PXR_NAMESPACE_CLOSE_SCOPE
GF_API GfVec3d Decompose(const GfVec3d &axis0, const GfVec3d &axis1, const GfVec3d &axis2) const
static GF_API void MatchClosestEulerRotation(double targetTw, double targetFB, double targetLR, double targetSw, double *thetaTw, double *thetaFB, double *thetaLR, double *thetaSw)
static GF_API GfRotation RotateOntoProjected(const GfVec3d &v1, const GfVec3d &v2, const GfVec3d &axis)
const GfVec3d & GetImaginary() const
Returns the imaginary part of the quaternion.
double GetAngle() const
Returns the rotation angle in degrees.