2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CNUQUATERNION
|
|
|
|
#define _CNUQUATERNION
|
2022-09-18 05:55:13 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
2022-10-05 16:28:37 +00:00
|
|
|
class CMatrix3f;
|
2022-10-17 23:53:49 +00:00
|
|
|
class CVector3f;
|
|
|
|
class CQuaternion;
|
|
|
|
|
2022-09-18 05:55:13 +00:00
|
|
|
class CNUQuaternion {
|
|
|
|
public:
|
2022-10-09 05:37:23 +00:00
|
|
|
CNUQuaternion(float w, float x, float y, float z) : w(w), x(x), y(y), z(z) {}
|
2022-10-17 23:53:49 +00:00
|
|
|
CNUQuaternion(float, const CVector3f&);
|
2022-09-18 05:55:13 +00:00
|
|
|
|
2022-10-05 16:28:37 +00:00
|
|
|
static CNUQuaternion BuildFromMatrix3f(const CMatrix3f& matrix);
|
2022-10-05 22:50:12 +00:00
|
|
|
static CNUQuaternion BuildFromQuaternion(const CQuaternion& quat);
|
2022-10-09 05:13:17 +00:00
|
|
|
|
2022-10-17 23:53:49 +00:00
|
|
|
CNUQuaternion operator*(const CNUQuaternion&) const;
|
|
|
|
|
2022-09-18 05:55:13 +00:00
|
|
|
private:
|
2022-10-09 05:37:23 +00:00
|
|
|
float w;
|
|
|
|
float x;
|
|
|
|
float y;
|
|
|
|
float z;
|
2022-09-18 05:55:13 +00:00
|
|
|
};
|
|
|
|
|
2022-10-17 23:53:49 +00:00
|
|
|
CNUQuaternion operator*(float f, const CNUQuaternion&);
|
|
|
|
CNUQuaternion operator*(const CNUQuaternion&, float f);
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CNUQUATERNION
|