1234567891011121314151617181920212223242526272829303132333435 |
- #ifndef CORE_QUATERNION_H
- #define CORE_QUATERNION_H
- #include "core/Vector.h"
- typedef struct {
- CoreVector3 xyz;
- float w;
- } CoreQuaternion;
- #define CORE_UNIT_QUATERNION ((CoreQuaternion){{{0.0f, 0.0f, 0.0f}}, 1.0f})
- CoreQuaternion* coreAxisAngleQ(CoreQuaternion* q, const CoreVector3* axis,
- float angle);
- CoreQuaternion* coreLerpQ(CoreQuaternion* q, const CoreQuaternion* a, float f,
- const CoreQuaternion* b);
- CoreQuaternion* coreMulSetQ(CoreQuaternion* q, const CoreQuaternion* other);
- CoreQuaternion* coreMulQ(CoreQuaternion* q, const CoreQuaternion* a,
- const CoreQuaternion* b);
- CoreVector3* coreMulQV3(CoreVector3* r, const CoreQuaternion* q,
- const CoreVector3* v);
- size_t coreToStringQ(const CoreQuaternion* q, char* buffer, size_t n);
- #ifdef IMPORT_CORE
- #define Quaternion CoreQuaternion
- #define UNIT_QUATERNION CORE_UNIT_QUATERNION
- #define axisAngleQ coreAxisAngleQ
- #define lerpQ coreLerpQ
- #define mulSetQ coreMulSetQ
- #define mulQ coreMulQ
- #define mulQV3 coreMulQV3
- #define toStringQ coreToStringQ
- #endif
- #endif
|