2015-07-26 21:39:49 +00:00
|
|
|
#ifndef CQUATERNION_H
|
|
|
|
#define CQUATERNION_H
|
|
|
|
|
|
|
|
#include "CVector3f.h"
|
|
|
|
|
|
|
|
class CQuaternion
|
|
|
|
{
|
|
|
|
public:
|
2015-08-21 02:18:13 +00:00
|
|
|
float w, x, y, z;
|
2015-07-26 21:39:49 +00:00
|
|
|
|
|
|
|
CQuaternion();
|
2015-08-21 02:18:13 +00:00
|
|
|
CQuaternion(float _w, float _x, float _y, float _z);
|
2015-07-26 21:39:49 +00:00
|
|
|
|
2015-08-20 01:01:58 +00:00
|
|
|
CVector3f XAxis();
|
|
|
|
CVector3f YAxis();
|
|
|
|
CVector3f ZAxis();
|
|
|
|
CQuaternion Inverse();
|
2015-08-21 02:18:13 +00:00
|
|
|
CVector3f ToEuler();
|
2015-08-20 01:01:58 +00:00
|
|
|
|
2015-07-26 21:39:49 +00:00
|
|
|
// Operators
|
2015-08-20 01:01:58 +00:00
|
|
|
CVector3f operator*(const CVector3f& vec) const;
|
2015-07-26 21:39:49 +00:00
|
|
|
CQuaternion operator*(const CQuaternion& other) const;
|
|
|
|
void operator *= (const CQuaternion& other);
|
|
|
|
|
|
|
|
// Static
|
|
|
|
static CQuaternion FromEuler(CVector3f euler);
|
|
|
|
static CQuaternion FromAxisAngle(float angle, CVector3f axis);
|
|
|
|
|
|
|
|
static CQuaternion skIdentity;
|
2015-08-20 01:01:58 +00:00
|
|
|
static CQuaternion skZero;
|
2015-07-26 21:39:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CQUATERNION_H
|