#include <MathUtils.h>
Public Types | |
| typedef double | Matrix3x3 [3][3] |
| 3x3 double matrix type | |
| typedef double | Matrix4x4 [4][4] |
| 4x4 double matrix type | |
| typedef double | Vector3 [3] |
| 3 double vector | |
| typedef double | Quaternion [4] |
| 4 double vector used as quaternion | |
| enum | EULER { XYX = 0 + 4 + 0, XYZ = 0 + 4 + 2, XZX = 0 + 8 + 0, XZY = 0 + 8 + 1, YXY = 16 + 0 + 1, YXZ = 16 + 0 + 2, YZX = 16 + 8 + 0, YZY = 16 + 8 + 1, ZXY = 32 + 0 + 1, ZXZ = 32 + 0 + 2, ZYX = 32 + 4 + 0, ZYZ = 32 + 4 + 2 } |
| encodes all possible euler angle sequences More... | |
Public Member Functions | |
| void | translationQuaternionTo4x4Matrix (std::vector< float > &pos, std::vector< float > &quat, MathUtils::Matrix4x4 &mat) |
Static Public Member Functions | |
| static float * | axisAngleToQuaternion (const float *axisa, float *qResult) |
| static std::vector< float > & | axisAngleToQuaternion (const std::vector< float > &axisa, std::vector< float > &qResult) |
| static double * | axisAngleToQuaternion (const double *axisa, Quaternion qResult) |
| static float * | eulerToQuaternion (const float roll, const float pitch, const float yaw, float *qResult) |
| static std::vector< float > & | eulerToQuaternion (const float roll, const float pitch, const float yaw, std::vector< float > &qResult) |
| static float * | eulerToQuaternion (const double alpha, const double beta, const double gamma, const enum MathUtils::EULER sequence, float *qResult) |
| static float * | invertQuaternion (const float *q, float *qResult) |
| static std::vector< float > & | invertQuaternion (const std::vector< float > &q, std::vector< float > &qResult) |
| static float * | matrixToQuaternion (const float matrix[3][3], float *qResult) |
| static std::vector< float > & | matrixToQuaternion (const float matrix[3][3], std::vector< float > &qResult) |
| static float * | multiplyQuaternion (const float *q1, const float *q2, float *qResult) |
| static std::vector< float > & | multiplyQuaternion (const std::vector< float > &q1, const std::vector< float > &q2, std::vector< float > &qResult) |
| static double * | multiplyQuaternion (const Quaternion q1, const Quaternion q2, Quaternion qResult) |
| static float * | normalizeQuaternion (float *q) |
| static std::vector< float > & | normalizeQuaternion (std::vector< float > &q) |
| static double * | normalizeQuaternion (Quaternion q) |
| static float * | rotateVector (const float *q, const float *v, float *vResult) |
| static std::vector< float > & | rotateVector (const std::vector< float > &q, const std::vector< float > &v, std::vector< float > &vResult) |
| static float | determinant (const float matrix[3][3]) |
| static float * | quaternionToAxisAngle (const float *q, float *axisa) |
| static void | quaternionToAxisAngle (std::vector< float > &q, std::vector< float > &axisa) |
| static double | angle (const float *v1, const float *v2, const int dim) |
| static double | angle (const std::vector< float > &v1, const std::vector< float > &v2, const int dim) |
| static double | dot (const float *v1, const float *v2, const int dim) |
| static double | dot (const std::vector< float > &v1, const std::vector< float > &v2, const int dim) |
| static float * | slerp (const float *q1, const float *q2, const float t, float *qResult) |
| static std::vector< float > & | slerp (const std::vector< float > &q1, const std::vector< float > &q2, const float t, std::vector< float > &qResult) |
| static void | quaternionToMatrix (Quaternion &q, Matrix4x4 &m) |
| static void | matrixToQuaternion (Matrix4x4 &matrix, Quaternion &qResult) |
| static void | matrixMultiply (const Matrix4x4 m1, const Matrix4x4 m2, Matrix4x4 &m) |
| static void | matrixMultiply (const Matrix3x3 m1, const Matrix3x3 m2, Matrix3x3 &m) |
| static void | MatrixToEuler (Vector3 angles, const Matrix4x4 colMatrix) |
Static Public Attributes | |
| static const Matrix4x4 | matrix4x4_flipY |
| mirror at the x-z-plane | |
| static const Matrix4x4 | matrix4x4_identity |
| identity matrix | |
| static const double | Pi = 3.1415926535897932385 |
| the nice constant Pi | |
| static const double | E = 2.7182818284590452354 |
| the also nice constant e | |
| static const double | GradToRad = MathUtils::Pi / 180.0 |
| another nice constant to transform grad to radiants | |
|
|
3x3 double matrix type
|
|
|
4x4 double matrix type
|
|
|
4 double vector used as quaternion
|
|
|
3 double vector
|
|
|
encodes all possible euler angle sequences
|
|
||||||||||||||||
|
computes the angle between two n-dimensional vectors.
|
|
||||||||||||||||
|
computes the angle between two n-dimensional vectors.
|
|
||||||||||||
|
converts an axis angle representation into a quaternion. This method operates directly on the arguments. Therefore using the same pointers for several arguments will produce wrong results !
|
|
||||||||||||
|
converts an axis angle representation into a quaternion. This method operates directly on the arguments. Therefore using the same pointers for several arguments will produce wrong results !
|
|
||||||||||||
|
converts an axis angle representation into a quaternion. This method operates directly on the arguments. Therefore using the same pointers for several arguments will produce wrong results !
|
|
|
computes the determinant of a 3x3 matrix.
|
|
||||||||||||||||
|
computes the dot product between two n-dimensional vectors.
|
|
||||||||||||||||
|
computes the dot product between two n-dimensional vectors.
|
|
||||||||||||||||||||||||
|
computes a quaternion from euler angles representing a rotation. This is the general method and supports all euler angle sequences. Use this instead of the old one for more control.
|
|
||||||||||||||||||||
|
computes a quaternion from euler angles representing a rotation.
|
|
||||||||||||||||||||
|
computes a quaternion from euler angles representing a rotation.
|
|
||||||||||||
|
inverts a quaternion. This method operates directly on the arguments. Therefore using the same pointers for several arguments will produce wrong results !
|
|
||||||||||||
|
inverts a quaternion. This method operates directly on the arguments. Therefore using the same pointers for several arguments will produce wrong results !
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
converts a rotational matrix to a quaternion.
|
|
||||||||||||
|
converts a rotational matrix to a quaternion.
|
|
||||||||||||||||
|
multiplies two quaternions and stores result in a third. This method operates directly on the arguments. Therefore using the same pointers for several arguments will produce wrong results !
|
|
||||||||||||||||
|
multiplies two quaternions and stores result in a third. This method operates directly on the arguments. Therefore using the same pointers for several arguments will produce wrong results !
|
|
||||||||||||||||
|
multiplies two quaternions and stores result in a third. This method operates directly on the arguments. Therefore using the same pointers for several arguments will produce wrong results !
|
|
|
normalizes quaternion to unit length. Here the computation is done in place and the parameter is changed !
|
|
|
normalizes quaternion to unit length. Here the computation is done in place and the parameter is changed !
|
|
|
normalizes quaternion to unit length. Here the computation is done in place and the parameter is changed !
|
|
||||||||||||
|
computes the vector and angle representation of a quaternion. This method operates directly on the arguments. Therefore using the same pointers for several arguments will produce wrong results !
|
|
||||||||||||
|
computes the vector and angle representation of a quaternion. This method operates directly on the arguments. Therefore using the same pointers for several arguments will produce wrong results !
|
|
||||||||||||
|
|
|
||||||||||||||||
|
rotates a vector using a given unit quaternion. It does not normalize the quaternion or check for unit length ! This method operates directly on the arguments. Therefore using the same pointers for several arguments will produce wrong results !
|
|
||||||||||||||||
|
rotates a vector using a given unit quaternion. It does not normalize the quaternion or check for unit length ! This method operates directly on the arguments. Therefore using the same pointers for several arguments will produce wrong results !
|
|
||||||||||||||||||||
|
computes the spherical linear interpolation between two quaternions. The formulas used are probably only stable for t in [0,1], but it can be used to calculate extrapolations as well. Moreover the slerp is always computed on the shorter path between the quaternions. This method operates directly on the arguments. Therefore using the same pointers for several arguments will produce wrong results !
|
|
||||||||||||||||||||
|
computes the spherical linear interpolation between two quaternions. The formulas used are probably only stable for t in [0,1], but it can be used to calculate extrapolations as well. Moreover the slerp is always computed on the shorter path between the quaternions. This method operates directly on the arguments. Therefore using the same pointers for several arguments will produce wrong results !
|
|
||||||||||||||||
|
|
|
|
the also nice constant e
|
|
|
another nice constant to transform grad to radiants
|
|
|
Initial value: {{1, 0, 0, 0},
{0,-1, 0, 0},
{0, 0, 1, 0},
{0, 0, 0, 1}}
|
|
|
Initial value: {{1, 0, 0, 0},
{0, 1, 0, 0},
{0, 0, 1, 0},
{0, 0, 0, 1}}
|
|
|
the nice constant Pi
|
1.4.6