16 #include <matrix/vlVector.h>
32 inline DtQuat(
double x,
double y,
double z,
double w);
36 inline DtQuat(
double theta_z,
double theta_y,
double theta_x);
42 inline void set(
double x,
double y,
double z,
double w);
61 inline double length()
const;
85 inline void getMatrix4(
double matrix[16])
const;
89 inline void getMatrix3(
double matrix[9])
const;
129 #include <vrvUtil/DtQuat.inl>
const DtQuat & operator*=(const DtQuat &q)
DtQuat operator/(const DtQuat &q) const
void getMatrix4(double matrix[16]) const
casting to a 4x4 isomorphic matrix for right multiplication with vector
static DtQuat bezier(const DtQuat &q1, const DtQuat &q2, const DtQuat &a, const DtQuat &b, double t)
Shoemake-Bezier interpolation using De Castlejau algorithm.
void invert()
inverts this quaternion
const DtQuat & operator/=(double scale)
const DtQuat & operator-=(const DtQuat &q)
void getMatrix3(double matrix[9]) const
Get a 3x3 rotation matrix.
double length_squared() const
gets the squared length of this quaternion
double length() const
gets the length of this quaternion
DtQuat operator+(const DtQuat &q) const
void conjugate()
computes the conjugate of this quaternion
DtQuat operator*(const DtQuat &q) const
static DtQuat from_axis_angle(const DtVector &axis, double angle)
converts from a normalized axis - angle pair rotation to a quaternion
DtVector xyz
the imaginary components
Definition: DtQuat.h:27
Contains DLL export macros.
static double dot(const DtQuat &q1, const DtQuat &q2)
computes the dot product of 2 quaternions
static DtQuat squad(const DtQuat &q1, const DtQuat &q2, const DtQuat &a, const DtQuat &b, double t)
spherical cubic interpolation
DtQuat exp() const
returns e^quaternion = exp(v*a) = [cos(a),vsin(a)]
DT_DLL_vrfutil double angle(double vec1[3], double vec2[3])
static DtQuat lerp(const DtQuat &q1, const DtQuat &q2, double t)
linear quaternion interpolation
void to_axis_angle(DtVector &axis, double &angle) const
returns the axis and angle of this unit quaternion
const DtQuat & operator+=(const DtQuat &q)
DtVector rotate(const DtVector &v) const
rotates v by this quaternion (quaternion must be unit)
static DtQuat spline(const DtQuat &qnm1, const DtQuat &qn, const DtQuat &qnp1)
Given 3 quaternions, qn-1,qn and qn+1, calculate a control point to be used in spline interpolation...
void set(double x, double y, double z, double w)
Set the quat.
static DtQuat slerpNoInvert(const DtQuat &q1, const DtQuat &q2, double t)
This version of slerp, used by squad, does not check for theta > 90.
double w
the real component
Definition: DtQuat.h:28
A utility Quaternion class.
Definition: DtQuat.h:22
DtQuat & operator=(const DtQuat &q)
basic operations
DtQuat normalized() const
returns the normalized version of this quaternion
void normalize()
normalizes this quaternion
static DtQuat slerp(const DtQuat &q1, const DtQuat &q2, double t)
spherical linear interpolation
DtQuat log() const
returns the logarithm of a quaternion = v*a where q = [cos(a),v*sin(a)]
DtVector euler_angles() const
returns the euler angles from a rotation quaternion