Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
Loading...
Searching...
No Matches
quaternions.h
Go to the documentation of this file.
1#ifndef _QUATERNIONS_H_
2#define _QUATERNIONS_H_
3
4#include <float.h>
5#include <stddef.h>
6#include <stdint.h>
7
8float rsqrtf(float x);
9float mathsqrtf(float x);
10void mathEulerToQuat(float* q, const float* euler);
11void mathQuatApply(float* qout, const float* q1, const float* q2);
12void mathQuatNormalize(float* qout, const float* qin);
13void mathCrossProduct(float* p, const float* a, const float* b);
14void mathRotateVectorByInverseOfQuaternion(float* pout, const float* q, const float* p);
15void mathRotateVectorByQuaternion(float* pout, const float* q, const float* p);
16void mathComputeQuaternionDeltaBetweenQuaternions(float* qOut, const float* q1, const float* b);
17void mathQuatFromTwoVectors(float* qOut, const float* v1, const float* v2);
18
19#endif
float rsqrtf(float x)
Perform a fast, approximate reciprocal square root.
Definition quaternions.c:11
void mathQuatFromTwoVectors(float *qOut, const float *v1, const float *v2)
Compute the quaterntion rotation between two vectors, from v1 to v2.
Definition quaternions.c:199
float mathsqrtf(float x)
Perform a fast, approximate square root.
Definition quaternions.c:33
void mathEulerToQuat(float *q, const float *euler)
convert euler angles (in radians) to a quaternion.
Definition quaternions.c:58
void mathComputeQuaternionDeltaBetweenQuaternions(float *qOut, const float *q1, const float *b)
Compute the difference between two quaternions.
Definition quaternions.c:179
void mathQuatApply(float *qout, const float *q1, const float *q2)
Rotate one quaternion by another (and do not normalize)
Definition quaternions.c:82
void mathCrossProduct(float *p, const float *a, const float *b)
Perform a 3D cross product.
Definition quaternions.c:118
void mathRotateVectorByInverseOfQuaternion(float *pout, const float *q, const float *p)
Rotate a 3D vector by the inverse of a quaternion.
Definition quaternions.c:156
void mathQuatNormalize(float *qout, const float *qin)
Normalize a quaternion.
Definition quaternions.c:101
void mathRotateVectorByQuaternion(float *pout, const float *q, const float *p)
Rotate a 3D vector by a quaternion.
Definition quaternions.c:134