yage.core.math.quatrn
Authors:
Eric Poggel, Matt Peterson
License:
LGPL v3
- struct
Quatrn
;
- A quaternion class.
Quaternion are 4 dimensional constructs often used in rotation to avoid
gimbal lock. This is named
Quatrn
instead of Quaternion for easier typing.
This is defined as a struct instead of a class so it can be created and
destroyed without dynamic memory allocation.
See Also:
Wikipedia: Quaternion
The Matrix and Quaternion Faq
- static Quatrn
opCall
();
- Create a unit Quaternion.
- static Quatrn
opCall
(float x, float y, float z, float w);
- Create a Quaternion from four values.
- static Quatrn
opCall
(float[] s);
- Create a Quaternion from an array of floats.
- static Quatrn
opCall
(Vec3f axis);
- Create a Quaternion from a rotation axis Vec3f.
- static Quatrn
opCall
(Matrix m);
- Create a Quaternion from a rotation Matrix.
- Quatrn
opMul
(Quatrn b);
- Multiply this quaternion by another and return the result.
The result is the sum of both quaternion rotations.
Note that quaternion multiplication is not cumulative.
- bool
almostEqual
(Quatrn s, float fudge = 0.0001F);
- Is this Quatrn equal to Quatrn s, discarding relative error fudge.
- Quatrn
conjugate
();
- Return the
conjugate
the Quaternion
- Quatrn
inverse
();
- Return the
inverse
of the Quaternion.
This is the equivalent of the Quaternion's rotation in reverse.
- float
length
();
- Get the magnitude of the Quaternion.
- Quatrn
normalize
();
- Return a normalized version of the Quaternion.
- void*
ptr
();
- Quatrn
rotate
(Quatrn q);
- Return a new Quaternion that is the sum of the current rotation and the
new rotation of the parameter.
- Quatrn
rotateAbsolute
(Quatrn q);
- Return a new Quaternion that is the sum of the current rotation and the
new rotation of the parameter, rotating in absolute worldspace coordinates.
- Quatrn
rotateEuler
(Vec3f euler);
- Return a new Quaternion that is the sum of the current rotation and the
new rotation of the Vec3f of euler angles, rotating first by x, then y, then z.
- Quatrn
rotateEulerAbsolute
(Vec3f euler);
- Return a new Quaternion that is the sum of the current rotation and the
new rotation of the Vec3f of euler angles, rotating first by x, then y,
then z, rotating around the absolute worldspace axis
- Quatrn
slerp
(Quatrn q, float interp);
- Return a rotation that is interpolated between this Quaternion and
the Quatrn q.
- Vec3f
toAxis
();
- Create a Vec3f rotation axis from this Quaternion
- Matrix
toMatrix
();
- Create a rotation Matrix from this quaternion.
- char[]
toString
();
- Return a string representation of this quaternion for human reading.
|