17#ifndef AEONGAMES_QUATERNION_H
18#define AEONGAMES_QUATERNION_H
44 DLL
Quaternion (
float w,
float x,
float y,
float z );
52 DLL
void Get (
float* aData )
const;
70 DLL
float operator[] (
const size_t aIndex )
const;
102 float mQuaternion[4] {1.0f, 0.0f, 0.0f, 0.0f};
109 DLL
const Quaternion
operator* (
const Quaternion& lhs,
const Quaternion& rhs );
115 DLL
const Vector3
operator* (
const Quaternion& lhs,
const Vector3& rhs );
121 DLL
bool operator== (
const Quaternion& lhs,
const Quaternion& rhs );
132 DLL
const Quaternion
LerpQuats (
const Quaternion& q1,
const Quaternion& q2,
double interpolation );
142 DLL
const Quaternion
NlerpQuats (
const Quaternion& q1,
const Quaternion& q2,
double interpolation );
149 DLL
const Quaternion
SlerpQuats (
const Quaternion& q1,
const Quaternion& q2,
float interpolation );
3 by 3 matrix in colum mayor order.
4 by 4 matrix in colum mayor order.
DLL Quaternion & operator=(const float *aLhs)
Assign from a raw float array.
DLL Vector3 GetEuler() const
Get the Euler angle representation of this quaternion.
DLL ~Quaternion()
destructor.
static DLL const Quaternion GetFromEuler(const Vector3 &aEuler)
Create a quaternion from Euler angles.
DLL Quaternion & operator*=(const Quaternion &lhs)
Multiply this quaternion by another quaternion.
static DLL const Quaternion GetFromAxisAngle(float angle, float x, float y, float z)
Create a quaternion from an axis-angle representation.
DLL Matrix4x4 GetMatrix4x4() const
Convert the quaternion to a 4x4 rotation matrix.
DLL Matrix3x3 GetMatrix3x3() const
Convert the quaternion to a 3x3 rotation matrix.
DLL Quaternion & SetEuler(const Vector3 &aEuler)
Set the quaternion from Euler angles.
DLL Quaternion & Normalize()
Normalize this quaternion in place.
DLL void Get(float *aData) const
Copy the quaternion components to a float array.
DLL Quaternion()
Default constructor.
DLL float operator[](const size_t aIndex) const
Access a quaternion component by index (const).
<- This is here just for the literals
DLL const Matrix3x3 operator*(const Matrix3x3 &lhs, const Matrix3x3 &rhs)
Multiplies two 3x3 matrices. Multiplies two 3x3 matrices.
DLL const Quaternion NlerpQuats(const Quaternion &q1, const Quaternion &q2, double interpolation)
Linearly interpolate between two quaternions return the normalized result.
DLL const Quaternion LerpQuats(const Quaternion &q1, const Quaternion &q2, double interpolation)
Linearly interpolate between two quaternions.
DLL const Quaternion SlerpQuats(const Quaternion &q1, const Quaternion &q2, float interpolation)
Spherical Linear interpolation between two quaternions.
DLL const bool operator==(const Matrix3x3 &lhs, const Matrix3x3 &rhs)
Compare two 3x3 matrices for equality.