ASL
|
A Quaternion representing an orientation or rotation in 3D space.
#include <Quaternion.h>
Public Member Functions | |
Quaternion_ (T w, T x, T y, T z) | |
Creates a quaternion from its 4 elements. | |
Quaternion_ (T w, const Vec3_< T > &v) | |
Creates a quaternion from a scalar and a vector. | |
T | angle () const |
Returns the angle rotated by this quaternion. | |
Vec3_< T > | axis () const |
Returns the normalized axis of rotation of this quaternion. | |
Vec3_< T > | axisAngle () const |
Returns the axis-angle representation of the rotation equivalent to this quaternion (a vector aligned with the rotation axis and with length equal to the rotation angle) | |
Matrix4_< T > | matrix () const |
Returns a transform matrix equivalent to the rotation of this quaternion. | |
Quaternion_ | operator- () const |
Returns this quaternion negated. | |
Quaternion_ | conj () const |
Returns the conjugate of this quaternion. | |
Quaternion_ | operator* (T t) const |
Returns this quaternion multiplied by a scalar. | |
Quaternion_ | operator/ (T t) const |
Returns this quaternion divided by a scalar. | |
T | length () const |
Returns the length (norm) of this quaternion. | |
T | length2 () const |
Returns the length (norm) of this quaternion squared. | |
Quaternion_ | inverse () const |
Returns the inverse of this quaternion. | |
Vec3_< T > | operator* (const Vec3_< T > &v) const |
Returns the given vector rotated by this quaterion. | |
T | operator* (const Quaternion_ &q) const |
Returns the dot product of this quaternion and q. | |
Quaternion_ | operator^ (const Quaternion_ &q) const |
Returns the product of this quaternion and q, representing the rotation q followed by this rotation. | |
Quaternion_ | slerp (const Quaternion_ &q, T t) const |
Returns an interpolated quaternion between this and b at the given interpolation factor t in [0..1]. | |
Static Public Member Functions | |
static Quaternion_ | fromAxisAngle (const Vec3_< T > &axis, T angle) |
Creates a quaternion representing a rotation of angle angle around axis axis | |
static Quaternion_ | fromAxisAngleU (const Vec3_< T > &axis, T angle) |
Creates a quaternion representing a rotation of angle angle around axis axis of length one | |
static Quaternion_ | fromAxisAngle (const Vec3_< T > &v) |
Creates a quaternion from a rotation vector (aligned with the rotation axis and with length equal to the rotation angle) | |