#include <CompressedQuaternion.h>
Public Types | |
enum | { CONVERT_VALUE = ((1 << (sizeof(StorageType) << 3)) >> 1) - 1 } |
Public Member Functions | |
MCORE_INLINE | TCompressedQuaternion () |
MCORE_INLINE | TCompressedQuaternion (float xVal, float yVal, float zVal, float wVal) |
MCORE_INLINE | TCompressedQuaternion (const AZ::Quaternion &quat) |
MCORE_INLINE void | FromQuaternion (const AZ::Quaternion &quat) |
MCORE_INLINE void | UnCompress (AZ::Quaternion *output) const |
MCORE_INLINE AZ::Quaternion | ToQuaternion () const |
AZ_INLINE | operator AZ::Quaternion () const |
Public Attributes | |
StorageType | m_x |
StorageType | m_y |
StorageType | m_z |
StorageType | m_w |
The compressed / packed quaternion class. This represents a unit (normalized) quaternion on a packed way, which is 8 bytes per quaternion instead of 16 bytes when using floating point quaternions. Of course we loose a bit of precision, but it isn't too bad for most things. The class provides methods to convert from and to uncompressed quaternions.
MCORE_INLINE TCompressedQuaternion::TCompressedQuaternion | ( | ) |
Default constructor. This sets the quaternion to identity.
MCORE_INLINE TCompressedQuaternion::TCompressedQuaternion | ( | float | xVal, |
float | yVal, | ||
float | zVal, | ||
float | wVal | ||
) |
Create a compressed quaternion from compressed x, y, z, w values.
xVal | The value of x. |
yVal | The value of y. |
zVal | The value of z. |
wVal | The value of w. |
MCORE_INLINE TCompressedQuaternion::TCompressedQuaternion | ( | const AZ::Quaternion & | quat | ) |
Create a compressed quaternion from an uncompressed one. Please note that the uncompressed quaternion has to be normalized or a unit quaternion!
quat | The normalized uncompressed quaternion. |
MCORE_INLINE void TCompressedQuaternion::FromQuaternion | ( | const AZ::Quaternion & | quat | ) |
Update the compressed quaternion from an uncompressed one. Please note that the uncompressed quaternion has to be normalized or a unit quaternion!
quat | The normalized uncompressed quaternion. |
MCORE_INLINE AZ::Quaternion TCompressedQuaternion::ToQuaternion | ( | ) | const |
Convert the compressed quaternion into an uncompressed one. This method works the same as the UnCompress method, but it returns the result instead of specifying the output quaternion.
MCORE_INLINE void TCompressedQuaternion::UnCompress | ( | AZ::Quaternion * | output | ) | const |
Uncompress the compressed quaternion into an uncompressed one.
output | The output uncompressed quaternion to write the result in. |
StorageType MCore::TCompressedQuaternion< StorageType >::m_w |
The compressed/packed quaternion components values.