mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-07-31 17:35:47 +00:00
36 lines
916 B
C++
36 lines
916 B
C++
#ifndef CQUATERNION_H
|
|
#define CQUATERNION_H
|
|
|
|
#include "CVector3f.h"
|
|
|
|
class CQuaternion
|
|
{
|
|
public:
|
|
float w, x, y, z;
|
|
|
|
CQuaternion();
|
|
CQuaternion(float _w, float _x, float _y, float _z);
|
|
|
|
CVector3f XAxis() const;
|
|
CVector3f YAxis() const;
|
|
CVector3f ZAxis() const;
|
|
CQuaternion Inverse() const;
|
|
CVector3f ToEuler() const;
|
|
|
|
// Operators
|
|
CVector3f operator*(const CVector3f& vec) const;
|
|
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 FromRotationMatrix(const CMatrix4f& RotMtx);
|
|
static CQuaternion FromAxes(const CVector3f& X, const CVector3f& Y, const CVector3f& Z);
|
|
|
|
static CQuaternion skIdentity;
|
|
static CQuaternion skZero;
|
|
};
|
|
|
|
#endif // CQUATERNION_H
|