12345678910111213141516171819202122232425262728293031323334353637 |
- #ifndef QUATERNION_H
- #define QUATERNION_H
- #include "client/math/Vector.h"
- #include "client/math/Matrix.h"
- class Quaternion {
- public:
- Quaternion();
- Quaternion(const Vector& axis, float angle);
-
- Quaternion lerp(float f, const Quaternion& other) const;
- Quaternion slerp(float f, const Quaternion& other) const;
- Quaternion squad(float f, const Quaternion& prev, const Quaternion& next, const Quaternion& nextNext) const;
-
- Matrix toMatrix() const;
- Quaternion& mul(const Quaternion& other);
- private:
- Quaternion(float x, float y, float z, float w);
-
- Quaternion interpolate(float a, float b, const Quaternion& other) const;
- Quaternion& normalize();
-
- Quaternion squadControl(const Quaternion& prev, const Quaternion& next) const;
-
- Quaternion& conjugate();
- Quaternion& log();
- Quaternion& exp();
- Quaternion& mul(float f);
- Quaternion& add(const Quaternion& other);
-
- Vector xyz;
- float w;
- };
- #endif
|