2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CAXISANGLE
|
|
|
|
#define _CAXISANGLE
|
2022-09-18 05:55:13 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
2022-10-08 17:39:03 +00:00
|
|
|
#include "Kyoto/Math/CUnitVector3f.hpp"
|
2022-10-09 05:13:17 +00:00
|
|
|
#include "Kyoto/Math/CVector3f.hpp"
|
|
|
|
|
|
|
|
#include <math.h>
|
2022-09-18 05:55:13 +00:00
|
|
|
|
2022-10-05 17:24:06 +00:00
|
|
|
class CAxisAngle {
|
2022-10-08 17:39:03 +00:00
|
|
|
static const CAxisAngle sIdentity;
|
|
|
|
friend CAxisAngle operator+(const CAxisAngle&, const CAxisAngle&);
|
|
|
|
friend CAxisAngle operator*(const CAxisAngle&, const float&);
|
|
|
|
friend CAxisAngle operator*(const float&, const CAxisAngle&);
|
2022-10-09 05:13:17 +00:00
|
|
|
|
2022-09-18 05:55:13 +00:00
|
|
|
public:
|
2022-10-08 17:39:03 +00:00
|
|
|
CAxisAngle() : mVector(CVector3f::Zero()) {}
|
2022-10-05 17:24:06 +00:00
|
|
|
explicit CAxisAngle(const CVector3f& vec);
|
2022-10-08 17:39:03 +00:00
|
|
|
explicit CAxisAngle(const CUnitVector3f& vec, float);
|
2022-10-09 05:37:23 +00:00
|
|
|
CAxisAngle(float x, float y, float z) : mVector(x, y, z) {}
|
2022-10-08 17:39:03 +00:00
|
|
|
void FromVector(const CVector3f& angle);
|
|
|
|
|
2022-10-05 23:06:15 +00:00
|
|
|
static const CAxisAngle& Identity();
|
2022-10-06 20:34:27 +00:00
|
|
|
float GetAngle() const;
|
2022-10-03 11:55:03 +00:00
|
|
|
const CVector3f& GetVector() const;
|
2022-10-05 22:50:12 +00:00
|
|
|
|
2022-10-08 17:39:03 +00:00
|
|
|
const CAxisAngle& operator*=(const float& rhs);
|
2022-10-05 22:50:12 +00:00
|
|
|
const CAxisAngle& operator+=(const CAxisAngle& rhs);
|
2022-10-09 05:13:17 +00:00
|
|
|
|
2022-10-05 17:24:06 +00:00
|
|
|
private:
|
|
|
|
CVector3f mVector;
|
2022-09-18 05:55:13 +00:00
|
|
|
};
|
2022-10-05 16:28:37 +00:00
|
|
|
|
|
|
|
CAxisAngle operator+(const CAxisAngle& lhs, const CAxisAngle& rhs);
|
2022-10-09 05:13:17 +00:00
|
|
|
CAxisAngle operator*(const CAxisAngle& lhs, const float& rhs);
|
2022-10-08 17:39:03 +00:00
|
|
|
CAxisAngle operator*(const float& rhs, const CAxisAngle& lhs);
|
|
|
|
|
2022-09-18 05:55:13 +00:00
|
|
|
CHECK_SIZEOF(CAxisAngle, 0xc)
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CAXISANGLE
|