quaternion.h
267 static Quaternion slerp(const Quaternion& a, const Quaternion& b, float t, bool allowFlip=true);
268 static Quaternion squad(const Quaternion& a, const Quaternion& tgA, const Quaternion& tgB, const Quaternion& b, float t);
270 static double dot(const Quaternion& a, const Quaternion& b) { return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3]; }
275 static Quaternion squadTangent(const Quaternion& before, const Quaternion& center, const Quaternion& after);
Definition: camera.h:29
Quaternion & operator*=(const Quaternion &q)
Quaternion rotation is composed with q.
Definition: quaternion.h:178
Quaternion inverse() const
Returns the inverse Quaternion (inverse rotation).
Definition: quaternion.h:205
static double dot(const Quaternion &a, const Quaternion &b)
Returns the "dot" product of a and b: a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3].
Definition: quaternion.h:270
void setValue(double q0, double q1, double q2, double q3)
Sets the Quaternion value.
Definition: quaternion.h:125
Quaternion(double q0, double q1, double q2, double q3)
Constructor from the four values of a Quaternion.
Definition: quaternion.h:88
Quaternion(const Vec &axis, double angle)
Constructor from rotation axis (non null) and angle (in radians).
Definition: quaternion.h:76
void setAxisAngle(const Vec &axis, double angle)
Sets the Quaternion as a rotation of axis axis and angle angle (in radians).
Definition: quaternion.h:106
Quaternion normalized() const
Returns a normalized version of the Quaternion.
Definition: quaternion.h:238
friend Vec operator*(const Quaternion &q, const Vec &v)
Returns the image of v by the rotation q.
Definition: quaternion.h:187
The Quaternion class represents 3D rotations and orientations.
Definition: quaternion.h:66
friend Quaternion operator*(const Quaternion &a, const Quaternion &b)
Returns the composition of the a and b rotations.
Definition: quaternion.h:164
Vec rotate(const Vec &v) const
Returns the image of v by the Quaternion rotation.
Definition: quaternion.cpp:76
void invert()
Inverses the Quaternion (same rotation angle(), but negated axis()).
Definition: quaternion.h:210
double operator[](int i) const
Bracket operator, with a constant return value.
Definition: quaternion.h:144