Go to the source code of this file.
|
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 | mathRotateVectorByInverseOfQuaternion (float *pout, const float *q, const float *p) |
| Rotate a 3D vector by the inverse of a quaternion.
|
|
void | mathRotateVectorByQuaternion (float *pout, const float *q, const float *p) |
| Rotate a 3D vector by a quaternion.
|
|
void | mathComputeQuaternionDeltaBetweenQuaternions (float *qOut, const float *q1, const float *b) |
| 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.
|
|
◆ rsqrtf()
Perform a fast, approximate reciprocal square root.
- Parameters
-
x | The number to take a recriprocal square root of. |
- Returns
- approximately 1/sqrt(x)
◆ mathsqrtf()
float mathsqrtf |
( |
float | x | ) |
|
Perform a fast, approximate square root.
- Parameters
-
x | The number to take a square root of. |
- Returns
- approximately sqrt(x) (but is much faster)
◆ mathEulerToQuat()
void mathEulerToQuat |
( |
float * | q, |
|
|
const float * | euler ) |
convert euler angles (in radians) to a quaternion.
- Parameters
-
q | Pointer to the wxyz quat (float[4]) to be written. |
euler | Pointer to a float[3] of euler angles. |
◆ mathQuatApply()
void mathQuatApply |
( |
float * | qout, |
|
|
const float * | q1, |
|
|
const float * | q2 ) |
Rotate one quaternion by another (and do not normalize)
- Parameters
-
qout | Pointer to the wxyz quat (float[4]) to be written. |
q1 | First quaternion to be rotated. |
q2 | Quaternion to rotate q1 by. |
◆ mathQuatNormalize()
void mathQuatNormalize |
( |
float * | qout, |
|
|
const float * | qin ) |
Normalize a quaternion.
- Parameters
-
qout | Pointer to the wxyz quat (float[4]) to be written. |
qin | Pointer to the quaterion to normalize. |
◆ mathCrossProduct()
void mathCrossProduct |
( |
float * | p, |
|
|
const float * | a, |
|
|
const float * | b ) |
Perform a 3D cross product.
- Parameters
-
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. |
◆ mathRotateVectorByInverseOfQuaternion()
void mathRotateVectorByInverseOfQuaternion |
( |
float * | pout, |
|
|
const float * | q, |
|
|
const float * | p ) |
Rotate a 3D vector by the inverse of a quaternion.
- Parameters
-
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. |
◆ mathRotateVectorByQuaternion()
void mathRotateVectorByQuaternion |
( |
float * | pout, |
|
|
const float * | q, |
|
|
const float * | p ) |
Rotate a 3D vector by a quaternion.
- Parameters
-
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. |
◆ mathComputeQuaternionDeltaBetweenQuaternions()
void mathComputeQuaternionDeltaBetweenQuaternions |
( |
float * | qOut, |
|
|
const float * | qFrom, |
|
|
const float * | qTo ) |
Compute the difference between two quaternions.
- Parameters
-
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 |
◆ mathQuatFromTwoVectors()
void mathQuatFromTwoVectors |
( |
float * | qOut, |
|
|
const float * | v1, |
|
|
const float * | v2 ) |
Compute the quaterntion rotation between two vectors, from v1 to v2.
- Parameters
-
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. |