|
| Quaternion () |
| Default constructor, initializes to identity rotation (aka 0°)
|
|
| Quaternion (const Matrix3 &rot) |
| Construct a quaternion from a rotation matrix.
|
|
| Quaternion (const Ogre::Quaternion &rhs) |
| Copy constructor.
|
|
| Quaternion (const Radian &rfAngle, const Vector3 &rkAxis) |
| Construct a quaternion from an angle/axis.
|
|
| Quaternion (const Vector3 &xaxis, const Vector3 &yaxis, const Vector3 &zaxis) |
| Construct a quaternion from 3 orthonormal local axes.
|
|
| Quaternion (const Vector3 *akAxis) |
| Construct a quaternion from 3 orthonormal local axes.
|
|
| Quaternion (Real *valptr) |
| Construct a quaternion from 4 manual w/x/y/z values.
|
|
| Quaternion (Real fW, Real fX, Real fY, Real fZ) |
| Construct from an explicit list of values.
|
|
Real | Dot (const Quaternion &rkQ) const |
| Returns the dot product of the quaternion.
|
|
bool | equals (const Quaternion &rhs, const Radian &tolerance) const |
| Equality with tolerance (tolerance is max angle difference)
|
|
Quaternion | Exp () const |
| Apply to unit-length quaternion.
|
|
void | FromAngleAxis (const Radian &rfAngle, const Vector3 &rkAxis) |
| Setups the quaternion using the supplied vector, and "roll" around that vector by the specified radians.
|
|
void | FromAxes (const Vector3 &xAxis, const Vector3 &yAxis, const Vector3 &zAxis) |
|
void | FromAxes (const Vector3 *akAxis) |
| Constructs the quaternion using 3 axes, the axes are assumed to be orthonormal.
|
|
void | FromRotationMatrix (const Matrix3 &kRot) |
|
Radian | getPitch (bool reprojectAxis=true) const |
| Calculate the local pitch element of this quaternion.
|
|
Radian | getRoll (bool reprojectAxis=true) const |
| Calculate the local roll element of this quaternion.
|
|
Radian | getYaw (bool reprojectAxis=true) const |
| Calculate the local yaw element of this quaternion.
|
|
Quaternion | Inverse () const |
|
bool | isNaN () const |
| Check whether this quaternion contains valid values.
|
|
Quaternion | Log () const |
|
Real | Norm () const |
| Returns the normal length of this quaternion.
|
|
Real | normalise (void) |
| Normalises this quaternion, and returns the previous length.
|
|
bool | operator!= (const Quaternion &rhs) const |
|
Quaternion | operator* (const Quaternion &rkQ) const |
|
Vector3 | operator* (const Vector3 &rkVector) const |
| Rotation of a vector by a quaternion.
|
|
Quaternion | operator* (Real s) const |
|
Quaternion | operator+ (const Quaternion &rkQ) const |
|
Quaternion | operator- () const |
|
Quaternion | operator- (const Quaternion &rkQ) const |
|
Quaternion & | operator= (const Quaternion &rkQ) |
|
bool | operator== (const Quaternion &rhs) const |
|
Real & | operator[] (const size_t i) |
| Array accessor operator.
|
|
Real | operator[] (const size_t i) const |
| Array accessor operator.
|
|
bool | orientationEquals (const Quaternion &other, Real tolerance=1e-3f) const |
| Compare two quaternions which are assumed to be used as orientations.
|
|
Real * | ptr () |
| Pointer accessor for direct copying.
|
|
const Real * | ptr () const |
| Pointer accessor for direct copying.
|
|
void | swap (Quaternion &other) |
| Exchange the contents of this quaternion with another.
|
|
void | ToAngleAxis (Degree &dAngle, Vector3 &rkAxis) const |
|
void | ToAngleAxis (Radian &rfAngle, Vector3 &rkAxis) const |
|
void | ToAxes (Vector3 &xAxis, Vector3 &yAxis, Vector3 &zAxis) const |
|
void | ToAxes (Vector3 *akAxis) const |
| Gets the 3 orthonormal axes defining the quaternion.
|
|
void | ToRotationMatrix (Matrix3 &kRot) const |
|
Quaternion | UnitInverse () const |
| Apply to non-zero quaternion.
|
|
Vector3 | xAxis (void) const |
| Returns the X orthonormal axis defining the quaternion.
|
|
Vector3 | yAxis (void) const |
| Returns the Y orthonormal axis defining the quaternion.
|
|
Vector3 | zAxis (void) const |
| Returns the Z orthonormal axis defining the quaternion.
|
|
|
static void | Intermediate (const Quaternion &rkQ0, const Quaternion &rkQ1, const Quaternion &rkQ2, Quaternion &rka, Quaternion &rkB) |
| Setup for spherical quadratic interpolation.
|
|
static Quaternion | nlerp (Real fT, const Quaternion &rkP, const Quaternion &rkQ, bool shortestPath=false) |
| Performs Normalised linear interpolation between two quaternions, and returns the result.
|
|
static Quaternion | Slerp (Real fT, const Quaternion &rkP, const Quaternion &rkQ, bool shortestPath=false) |
| Performs Spherical linear interpolation between two quaternions, and returns the result.
|
|
static Quaternion | SlerpExtraSpins (Real fT, const Quaternion &rkP, const Quaternion &rkQ, int iExtraSpins) |
|
static Quaternion | Squad (Real fT, const Quaternion &rkP, const Quaternion &rkA, const Quaternion &rkB, const Quaternion &rkQ, bool shortestPath=false) |
| Spherical quadratic interpolation.
|
|
Performs Spherical linear interpolation between two quaternions, and returns the result.
Slerp ( 0.0f, A, B ) = A Slerp ( 1.0f, A, B ) = B
- Returns
- Interpolated quaternion
Slerp has the proprieties of performing the interpolation at constant velocity, and being torque-minimal (unless shortestPath=false). However, it's NOT commutative, which means Slerp ( 0.75f, A, B ) != Slerp ( 0.25f, B, A ); therefore be careful if your code relies in the order of the operands. This is specially important in IK animation.
Performs Normalised linear interpolation between two quaternions, and returns the result.
nlerp ( 0.0f, A, B ) = A nlerp ( 1.0f, A, B ) = B
Nlerp is faster than Slerp. Nlerp has the proprieties of being commutative (
- See also
- Slerp; commutativity is desired in certain places, like IK animation), and being torque-minimal (unless shortestPath=false). However, it's performing the interpolation at non-constant velocity; sometimes this is desired, sometimes it is not. Having a non-constant velocity can produce a more natural rotation feeling without the need of tweaking the weights; however if your scene relies on the timing of the rotation or assumes it will point at a specific angle at a specific weight value, Slerp is a better choice.