Quaternion.h 603 B

1234567891011121314151617181920212223242526
  1. #ifndef QUATERNION_H
  2. #define QUATERNION_H
  3. #include "client/math/Vector.h"
  4. #include "client/math/Matrix.h"
  5. class Quaternion {
  6. public:
  7. Quaternion();
  8. Quaternion(float x, float y, float z, float w);
  9. Quaternion(const Vector& axis, float angle);
  10. Quaternion lerp(float f, const Quaternion& other) const;
  11. Quaternion slerp(float f, const Quaternion& other) const;
  12. void normalize();
  13. Matrix toMatrix() const;
  14. void mul(const Quaternion& other);
  15. private:
  16. Quaternion interpolate(float a, float b, const Quaternion& other) const;
  17. Vector xyz;
  18. float w;
  19. };
  20. #endif