2015-07-26 21:39:49 +00:00
|
|
|
#ifndef CQUATERNION_H
|
|
|
|
#define CQUATERNION_H
|
|
|
|
|
|
|
|
#include "CVector3f.h"
|
|
|
|
|
|
|
|
class CQuaternion
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
float x, y, z, w;
|
|
|
|
|
|
|
|
CQuaternion();
|
|
|
|
CQuaternion(float _x, float _y, float _z, float _w);
|
|
|
|
|
2015-08-20 01:01:58 +00:00
|
|
|
CVector3f XAxis();
|
|
|
|
CVector3f YAxis();
|
|
|
|
CVector3f ZAxis();
|
|
|
|
CQuaternion Inverse();
|
|
|
|
|
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
|