|
Berserk
|
General quaternion math class. More...
#include <TQuat.hpp>

Public Types | |
| using | Vec = TVecN< T, 3 > |
| using | Mat = TMatMxN< T, 4, 4 > |
Public Member Functions | |
| TQuat ()=default | |
| TQuat (T s, const Vec &v) | |
| TQuat (T s, T x, T y, T z) | |
| TQuat (const Vec &axis, T angle) | |
| TQuat (T roll, T yaw, T pitch) | |
| TQuat (const Mat &mat) | |
| TQuat (const TQuat &other)=default | |
| TQuat (TQuat &&other) noexcept=default | |
| ~TQuat ()=default | |
| TQuat & | operator= (const TQuat &other)=default |
| TQuat & | operator= (TQuat &&other) noexcept=default |
| void | Identity () |
| void | Zero () |
| TQuat | operator* (const TQuat &other) const |
| TQuat & | operator*= (T a) |
| TQuat & | operator/= (T a) |
| T | Length2 () const |
| T | Length () const |
| TQuat | Normalized () const |
| TQuat & | Normalize () |
| TQuat | Inverse () const |
| TQuat | Conjugate () const |
| Vec | Rotate (const Vec &v) const |
| Vec | RotateReverse (const Vec &v) const |
| Vec | GetAxisX () const |
| Vec | GetAxisY () const |
| Vec | GetAxisZ () const |
| T | GetAngle () const |
| Mat | AsMatrix () const |
| void | GetAxisAngle (Vec &axis, T &angle) const |
| Crc32Hash | Hash () const |
| bool | operator== (const TQuat &other) const |
| bool | operator!= (const TQuat &other) const |
Static Public Member Functions | |
| static TQuat | Rotation (const Vec &axis, T angle) |
| static T | Dot (const TQuat &a, const TQuat &b) |
| static T | Angle (const TQuat &a, const TQuat &b) |
| static TQuat | Lerp (T t, const TQuat &a, const TQuat &b) |
| static TQuat | Slerp (T t, const TQuat &a, const TQuat &b) |
| static TQuat | Slerp (T t, T ang, const TQuat &a, const TQuat &b) |
| static TQuat | LookAt (const TVecN< T, 3 > &direction, const TVecN< T, 3 > &up) |
| static TQuat | FaceAt (const TVecN< T, 3 > &direction, const TVecN< T, 3 > &up) |
Public Attributes | |
| T | scalar = 1 |
| Vec | vec |
General quaternion math class.
| T | Base type of quaternion elements |
Clockwise rotation around an arbitrary axis
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
| y | |_____ x /
/ /z
Rotation to orient an object with direction and up vectors
| direction | Where to look up (rotates z to this dir) |
| up | Where is up after rotation (rotates y) |
|
inlinestatic |
|
inlinestatic |
| y | |_____ x /
/ /z
Look at view quaternion for camera (in OpenGL style)
| direction | Direction vector of viewing |
| up | Up vector to define orientation |
Clockwise rotation around an arbitrary axis
|
inlinestatic |
|
inlinestatic |