|
| Quaternion () |
| Does NOT zero-initialize values. More...
|
|
| Quaternion (const Quaternion &rhs) |
|
| Quaternion (T scalar, T x, T y, T z) |
| Set values directly. More...
|
|
| Quaternion (T scalar, const Vector< T, 3, true > &vector) |
| Sets the scalar part (w) and the vector part (xyz). This is not AxisAngle rotation. More...
|
|
| Quaternion (T scalar, const Vector< T, 3, false > &vector) |
| Sets the scalar part (w) and the vector part (xyz). This is not AxisAngle rotation. More...
|
|
| Quaternion (const Vector< T, 3, true > &vector) |
| Sets the scalar part to zero, and the vector part to given argument. More...
|
|
template<class U , bool P> |
| Quaternion (const Quaternion< U, P > &rhs) |
|
template<class U , eMatrixOrder Order, eMatrixLayout Layout, bool PackedA> |
| Quaternion (const Matrix< U, 3, 3, Order, Layout, PackedA > &rhs) |
| Convert a rotation matrix to equivalent quaternion. More...
|
|
template<class U , eMatrixLayout Layout, bool PackedA> |
| Quaternion (const Matrix< U, 3, 4, eMatrixOrder::PRECEDE_VECTOR, Layout, PackedA > &rhs) |
| Convert a rotation matrix to equivalent quaternion. More...
|
|
template<class U , eMatrixLayout Layout, bool PackedA> |
| Quaternion (const Matrix< U, 4, 3, eMatrixOrder::FOLLOW_VECTOR, Layout, PackedA > &rhs) |
| Convert a rotation matrix to equivalent quaternion. More...
|
|
template<class U , eMatrixOrder Order, eMatrixLayout Layout, bool PackedA> |
| Quaternion (const Matrix< U, 4, 4, Order, Layout, PackedA > &rhs) |
| Convert a rotation matrix to equivalent quaternion. More...
|
|
| Quaternion (const Vector< T, 4, false > &vec) |
|
Quaternion & | operator= (const Quaternion &rhs) |
|
template<class U , bool P> |
Quaternion & | operator= (const Quaternion< U, P > &rhs) |
| Convert from quaternion with different base type and packing. More...
|
|
template<class U , eMatrixOrder Order, eMatrixLayout Layout, bool PackedA> |
Quaternion & | operator= (const Matrix< U, 3, 3, Order, Layout, PackedA > &rhs) |
| Convert a rotation matrix to equivalent quaternion. More...
|
|
template<class U , eMatrixLayout Layout, bool PackedA> |
Quaternion & | operator= (const Matrix< U, 3, 4, eMatrixOrder::PRECEDE_VECTOR, Layout, PackedA > &rhs) |
| Convert a rotation matrix to equivalent quaternion. More...
|
|
template<class U , eMatrixLayout Layout, bool PackedA> |
Quaternion & | operator= (const Matrix< U, 4, 3, eMatrixOrder::FOLLOW_VECTOR, Layout, PackedA > &rhs) |
| Convert a rotation matrix to equivalent quaternion. More...
|
|
template<class U , eMatrixOrder Order, eMatrixLayout Layout, bool PackedA> |
Quaternion & | operator= (const Matrix< U, 4, 4, Order, Layout, PackedA > &rhs) |
| Convert a rotation matrix to equivalent quaternion. More...
|
|
const T | ScalarPart () const |
| Returns the scalar part (w) of (w + xi + yj + zk). More...
|
|
const Vector< T, 3, Packed > | VectorPart () const |
| Returns the vector part (x, y, z) of (w + xi + yj + zk). More...
|
|
const T | Angle () const |
| Returns the angle of the rotation represented by quaternion. More...
|
|
const Vector< T, 3, Packed > | Axis () const |
| Returns the axis of rotation represented by quaternion. More...
|
|
template<class U , eMatrixOrder Order, eMatrixLayout Layout, bool PackedA> |
| operator Matrix< U, 3, 3, Order, Layout, PackedA > () const |
| Creates a rotation matrix equivalent to the quaternion. More...
|
|
template<class U , eMatrixLayout Layout, bool PackedA> |
| operator Matrix< U, 3, 4, eMatrixOrder::PRECEDE_VECTOR, Layout, PackedA > () const |
| Creates a rotation matrix equivalent to the quaternion. More...
|
|
template<class U , eMatrixLayout Layout, bool PackedA> |
| operator Matrix< U, 4, 3, eMatrixOrder::FOLLOW_VECTOR, Layout, PackedA > () const |
| Creates a rotation matrix equivalent to the quaternion. More...
|
|
template<class U , eMatrixOrder Order, eMatrixLayout Layout, bool PackedA> |
| operator Matrix< U, 4, 4, Order, Layout, PackedA > () const |
| Creates a rotation matrix equivalent to the quaternion. More...
|
|
template<class U , bool PackedA> |
| operator Vector< U, 3, PackedA > () const |
| Truncates the quaternion to the vector part (x, y, z). More...
|
|
template<class T, bool Packed = false>
class mathter::Quaternion< T, Packed >
Allows you to do quaternion math and represent rotation in a compact way.
- Template Parameters
-
T | The scalar type of w, x, y and z. Use a builtin or custom floating or fixed point type. |
Packed | If true, tightly packs quaternion members and disables padding due to overalignment in arrays. Disables SIMD optimization. |
These are plain mathematical quaternions, so expect the operations to work as mathematically defined. There are helper functions to represent rotation with quaternions.