These are some useful math functions. Note that the matrices are stored using the OpenGL convention:
static void plAnglesFromMatrixd |
( |
double |
angles[3], |
|
|
const double |
matrix[16] |
|
) |
| |
|
static |
Extract rotation angles from a 4x4 double matrix. The order of the rotations is:
- roll around x axis
- pitch around y axis
- yaw around z axis
static void plAnglesFromMatrixf |
( |
float |
angles[3], |
|
|
const float |
matrix[16] |
|
) |
| |
|
static |
Extract rotation angles from a 4x4 float matrix. The order of the rotations is:
- roll around x axis
- pitch around y axis
- yaw around z axis
static void plCoordsFromMatrixd |
( |
double |
coords[3], |
|
|
const double |
matrix[16] |
|
) |
| |
|
static |
Extract position coordinates from a 4x4 double matrix. These have the same value as the position coordinates in the quaternion transformation.
static void plCoordsFromMatrixf |
( |
float |
coords[3], |
|
|
const float |
matrix[16] |
|
) |
| |
|
static |
Extract position coordinates from a 4x4 float matrix. These have the same value as the position coordinates in the quaternion transformation.
static void plRelativeTransform |
( |
const double |
a[8], |
|
|
const double |
b[8], |
|
|
double |
c[8] |
|
) |
| |
|
static |
Find the position and orientation of a tool relative to a reference tool. This is done by quaternion division.
- Parameters
-
a | the original tool transformation |
b | the reference tool transformation |
c | the resulting relative transformation |
The pointer c can be the same as pointer a if you want to do the division in-place.
static void plTransformToMatrixd |
( |
const double |
trans[8], |
|
|
double |
matrix[16] |
|
) |
| |
|
static |
Convert a quaternion transformation into a 4x4 double matrix.
static void plTransformToMatrixf |
( |
const double |
trans[8], |
|
|
float |
matrix[16] |
|
) |
| |
|
static |
Convert a quaternion transformation into a 4x4 float matrix.