Quaternion.h 660 B

123456789101112131415161718192021
  1. #ifndef CORE_QUATERNION_H
  2. #define CORE_QUATERNION_H
  3. #include "core/Vector.h"
  4. typedef struct {
  5. Vector3 xyz;
  6. float w;
  7. } Quaternion;
  8. #define UNIT_QUATERNION ((Quaternion){{{0.0f, 0.0f, 0.0f}}, 1.0f})
  9. Quaternion* axisAngleQ(Quaternion* q, const Vector3* axis, float angle);
  10. Quaternion* lerpQ(Quaternion* q, const Quaternion* a, float f,
  11. const Quaternion* b);
  12. Quaternion* mulSetQ(Quaternion* q, const Quaternion* other);
  13. Quaternion* mulQ(Quaternion* q, const Quaternion* a, const Quaternion* b);
  14. Vector3* mulQV3(Vector3* r, const Quaternion* q, const Vector3* v);
  15. size_t toStringQ(const Quaternion* q, char* buffer, size_t n);
  16. #endif