Quaternion.h 566 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(float x, float y, float z, float w);
  8. Quaternion(Vector unitAxis, float angle);
  9. Quaternion lerp(float f, const Quaternion& other) const;
  10. Quaternion slerp(float f, const Quaternion& other) const;
  11. void normalize();
  12. Matrix toMatrix() const;
  13. private:
  14. Quaternion interpolate(float a, float b, const Quaternion& other) const;
  15. float x;
  16. float y;
  17. float z;
  18. float w;
  19. };
  20. #endif