Quaternion.h 645 B

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