Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
|
Functions | |
float | rsqrtf (float x) |
Perform a fast, approximate reciprocal square root. | |
float | mathsqrtf (float x) |
Perform a fast, approximate square root. | |
void | mathEulerToQuat (float *q, const float *euler) |
convert euler angles (in radians) to a quaternion. | |
void | mathQuatApply (float *qout, const float *q1, const float *q2) |
Rotate one quaternion by another (and do not normalize) | |
void | mathQuatNormalize (float *qout, const float *qin) |
Normalize a quaternion. | |
void | mathCrossProduct (float *p, const float *a, const float *b) |
Perform a 3D cross product. | |
void | mathRotateVectorByQuaternion (float *pout, const float *q, const float *p) |
Rotate a 3D vector by a quaternion. | |
void | mathRotateVectorByInverseOfQuaternion (float *pout, const float *q, const float *p) |
Rotate a 3D vector by the inverse of a quaternion. | |
void | mathComputeQuaternionDeltaBetweenQuaternions (float *qOut, const float *qFrom, const float *qTo) |
Compute the difference between two quaternions. | |
void | mathQuatFromTwoVectors (float *qOut, const float *v1, const float *v2) |
Compute the quaterntion rotation between two vectors, from v1 to v2. | |
float rsqrtf | ( | float | x | ) |
Perform a fast, approximate reciprocal square root.
x | The number to take a recriprocal square root of. |
float mathsqrtf | ( | float | x | ) |
Perform a fast, approximate square root.
x | The number to take a square root of. |
void mathEulerToQuat | ( | float * | q, |
const float * | euler ) |
convert euler angles (in radians) to a quaternion.
q | Pointer to the wxyz quat (float[4]) to be written. |
euler | Pointer to a float[3] of euler angles. |
void mathQuatApply | ( | float * | qout, |
const float * | q1, | ||
const float * | q2 ) |
Rotate one quaternion by another (and do not normalize)
qout | Pointer to the wxyz quat (float[4]) to be written. |
q1 | First quaternion to be rotated. |
q2 | Quaternion to rotate q1 by. |
void mathQuatNormalize | ( | float * | qout, |
const float * | qin ) |
Normalize a quaternion.
qout | Pointer to the wxyz quat (float[4]) to be written. |
qin | Pointer to the quaterion to normalize. |
void mathCrossProduct | ( | float * | p, |
const float * | a, | ||
const float * | b ) |
Perform a 3D cross product.
p | Pointer to the float[3] output of the cross product (p = a x b) |
a | Pointer to the float[3] of the cross product a vector. |
b | Pointer to the float[3] of the cross product b vector. |
void mathRotateVectorByQuaternion | ( | float * | pout, |
const float * | q, | ||
const float * | p ) |
Rotate a 3D vector by a quaternion.
pout | Pointer to the float[3] output of the rotation |
q | Pointer to the wxyz quaternion (float[4]) of the rotation. |
p | Pointer to the float[3] of the vector to rotates. |
void mathRotateVectorByInverseOfQuaternion | ( | float * | pout, |
const float * | q, | ||
const float * | p ) |
Rotate a 3D vector by the inverse of a quaternion.
pout | Pointer to the float[3] output of the antirotation. |
q | Pointer to the wxyz quaternion (float[4]) opposite of the rotation. |
p | Pointer to the float[3] of the vector to antirotates. |
void mathComputeQuaternionDeltaBetweenQuaternions | ( | float * | qOut, |
const float * | qFrom, | ||
const float * | qTo ) |
Compute the difference between two quaternions.
qOut | Pointer to the float[4] (wxyz) output of the rotation between qFrom and qTo. |
qFrom | is the Quaterntion that you are rotating FROM |
qTo | is the Quaternion that you are rotating TO |
void mathQuatFromTwoVectors | ( | float * | qOut, |
const float * | v1, | ||
const float * | v2 ) |
Compute the quaterntion rotation between two vectors, from v1 to v2.
qOut | Pointer to the float[4] (wxyz) output of the rotation defined by v1 to v2 |
v1 | is the vector you are rotating FROM. THIS MUST BE NORMALIZED. |
v2 | is the vector you are rotating TO. THIS MUST BE NORMALIZED. |