Tizen Native API
5.5
|
Definition and operations for 4x4 matrices.
Functions | |
Eina_Matrix_Type | eina_matrix4_type_get (const Eina_Matrix4 *m) |
Returns the type of the given floating point matrix. | |
void | eina_matrix4_values_set (Eina_Matrix4 *m, double xx, double xy, double xz, double xw, double yx, double yy, double yz, double yw, double zx, double zy, double zz, double zw, double wx, double wy, double wz, double ww) |
Sets the values of the coefficients of the given floating point matrix. | |
void | eina_matrix4_values_get (const Eina_Matrix4 *m, double *xx, double *xy, double *xz, double *xw, double *yx, double *yy, double *yz, double *yw, double *zx, double *zy, double *zz, double *zw, double *wx, double *wy, double *wz, double *ww) |
Gets the values of the coefficients of the given floating point matrix. | |
double | eina_matrix4_determinant (const Eina_Matrix4 *m) |
Calculates the determinant of the given matrix. | |
Eina_Bool | eina_matrix4_normalized (Eina_Matrix4 *out, const Eina_Matrix4 *in) |
Normalizes the given matrix. | |
Eina_Bool | eina_matrix4_inverse (Eina_Matrix4 *out, const Eina_Matrix4 *in) |
Computes the inverse of the given matrix. | |
void | eina_matrix4_transpose (Eina_Matrix4 *out, const Eina_Matrix4 *in) |
Computes the transpose of the given matrix. | |
void | eina_matrix4_matrix3_to (Eina_Matrix3 *m3, const Eina_Matrix4 *m4) |
Converts an Eina_Matrix4 into an Eina_Matrix3. | |
void | eina_matrix4_identity (Eina_Matrix4 *out) |
Sets the given matrix to identity. | |
void | eina_matrix4_multiply_copy (Eina_Matrix4 *out, const Eina_Matrix4 *mat_a, const Eina_Matrix4 *mat_b) |
Multiplies two matrix. | |
void | eina_matrix4_array_set (Eina_Matrix4 *m, const double *v) |
Sets matrix values using an array. | |
void | eina_matrix4_copy (Eina_Matrix4 *dst, const Eina_Matrix4 *src) |
Copies matrix. | |
void | eina_matrix4_multiply (Eina_Matrix4 *out, const Eina_Matrix4 *mat_a, const Eina_Matrix4 *mat_b) |
Multiplies two matrices with check. | |
void | eina_matrix4_ortho_set (Eina_Matrix4 *m, double left, double right, double bottom, double top, double dnear, double dfar) |
Sets orthogonality matrix. | |
void | eina_matrix4_compose (const Eina_Matrix4 *mat_a, const Eina_Matrix4 *mat_b, Eina_Matrix4 *out) |
Sets out as the matrix multiplication (composition) of two matrices. | |
void | eina_matrix4_translate (Eina_Matrix4 *t, double tx, double ty, double tz) |
Sets the matrix values for a translation operation. | |
void | eina_matrix4_scale (Eina_Matrix4 *t, double sx, double sy, double sz) |
Sets the matrix values for a scaling operation. | |
void | eina_matrix4_rotate (Eina_Matrix4 *t, double rad, Eina_Matrix_Axis axis) |
Sets the matrix values for a rotation operation. | |
Typedefs | |
typedef struct _Eina_Matrix4 | Eina_Matrix4 |
A 4x4 floating point matrix.
void eina_matrix4_array_set | ( | Eina_Matrix4 * | m, |
const double * | v | ||
) |
Sets matrix values using an array.
[out] | m | The result matrix. |
[in] | v | The the array[16] of values. |
Uses the first 16 elements in the given C array v
to set the values in the matrix m
. The values will be set in the order of the elements in the Eina_Matrix4 structure.
void eina_matrix4_compose | ( | const Eina_Matrix4 * | mat_a, |
const Eina_Matrix4 * | mat_b, | ||
Eina_Matrix4 * | out | ||
) |
Sets out as the matrix multiplication (composition) of two matrices.
[in] | mat_a | The first matrix. Must be non-NULL. |
[in] | mat_b | The second matrix. Must be non-NULL. |
[out] | out | The results matrix. |
In matrix multiplication, AB, the resultant matrix is created from the rows of A multiplied against the columns of B and summed. This is not commutative; i.e. AB != BA, so the ordering of arguments m1
and m2
matters.
void eina_matrix4_copy | ( | Eina_Matrix4 * | dst, |
const Eina_Matrix4 * | src | ||
) |
Copies matrix.
[out] | dst | The matrix copy. |
[in] | src | The matrix to copy. |
double eina_matrix4_determinant | ( | const Eina_Matrix4 * | m | ) |
Calculates the determinant of the given matrix.
[in] | m | The matrix. |
This function returns the determinant of the matrix m
. No check is done on m
.
void eina_matrix4_identity | ( | Eina_Matrix4 * | out | ) |
Sets the given matrix to identity.
[out] | out | The matrix to set. |
Eina_Bool eina_matrix4_inverse | ( | Eina_Matrix4 * | out, |
const Eina_Matrix4 * | in | ||
) |
Computes the inverse of the given matrix.
[out] | out | The inverse matrix. |
[in] | in | The matrix. |
EINA_TRUE
on success, EINA_FALSE
otherwise.This function inverts the matrix in
and stores the result in out
. No check is done on in
or out
. If in
cannot be inverted, then EINA_FALSE
is returned.
void eina_matrix4_matrix3_to | ( | Eina_Matrix3 * | m3, |
const Eina_Matrix4 * | m4 | ||
) |
Converts an Eina_Matrix4 into an Eina_Matrix3.
[out] | m3 | The destination Eina_Matrix3. |
[in] | m4 | The source Eina_Matrix4. |
void eina_matrix4_multiply | ( | Eina_Matrix4 * | out, |
const Eina_Matrix4 * | mat_a, | ||
const Eina_Matrix4 * | mat_b | ||
) |
Multiplies two matrices with check.
[out] | out | The resulting matrix. |
[in] | mat_a | The first member of the multiplication. |
[in] | mat_b | The second member of the multiplication. |
void eina_matrix4_multiply_copy | ( | Eina_Matrix4 * | out, |
const Eina_Matrix4 * | mat_a, | ||
const Eina_Matrix4 * | mat_b | ||
) |
Multiplies two matrix.
[out] | out | The resulting matrix. |
[in] | mat_a | The first member of the multiplication. |
[in] | mat_b | The second member of the multiplication. |
Safely multiplies mat_a
and mat_b
by checking if the out
parameter points to either of them, and if so uses a temporary matrix for the intermediary calculations.
Eina_Bool eina_matrix4_normalized | ( | Eina_Matrix4 * | out, |
const Eina_Matrix4 * | in | ||
) |
Normalizes the given matrix.
[out] | out | The normalized matrix. |
[in] | in | The matrix. |
EINA_FALSE
if matrix could not be normalized, EINA_TRUE
otherwise.This function returns the determinant of the matrix in
. No check is done on in
.
void eina_matrix4_ortho_set | ( | Eina_Matrix4 * | m, |
double | left, | ||
double | right, | ||
double | bottom, | ||
double | top, | ||
double | dnear, | ||
double | dfar | ||
) |
Sets orthogonality matrix.
[out] | m | The resulting matrix. |
[in] | right | The right value. |
[in] | left | The left value. |
[in] | bottom | The bottom value. |
[in] | top | The top value. |
[in] | dnear | The dnear value. |
[in] | dfar | The dfar value. |
void eina_matrix4_rotate | ( | Eina_Matrix4 * | t, |
double | rad, | ||
Eina_Matrix_Axis | axis | ||
) |
Sets the matrix values for a rotation operation.
[out] | t | Where to store the resulting matrix. |
[in] | rad | The number of radians to rotate. |
[in] | axis | The Axis of rotation. |
void eina_matrix4_scale | ( | Eina_Matrix4 * | t, |
double | sx, | ||
double | sy, | ||
double | sz | ||
) |
Sets the matrix values for a scaling operation.
[out] | t | Where to store the resulting matrix. |
[in] | sx | The X coordinate scaling factor. |
[in] | sy | The Y coordinate scaling factor. |
[in] | sz | The Z coordinate scaling factor. |
void eina_matrix4_translate | ( | Eina_Matrix4 * | t, |
double | tx, | ||
double | ty, | ||
double | tz | ||
) |
Sets the matrix values for a translation operation.
[out] | t | Where to store the resulting matrix. |
[in] | tx | The X coordinate translation. |
[in] | ty | The Y coordinate translation. |
[in] | tz | The Z coordinate translation. |
void eina_matrix4_transpose | ( | Eina_Matrix4 * | out, |
const Eina_Matrix4 * | in | ||
) |
Computes the transpose of the given matrix.
[out] | out | The transposed matrix. |
[in] | in | The source matrix. |
This function transposes the matrix in
and stores the result in out
. No check is done on in
or out
. The transpose of a matrix essentially flips a matrix over its diagonal.
Eina_Matrix_Type eina_matrix4_type_get | ( | const Eina_Matrix4 * | m | ) |
Returns the type of the given floating point matrix.
[in] | m | The floating point matrix. |
This function returns the type of the matrix m
. No check is done on m
.
void eina_matrix4_values_get | ( | const Eina_Matrix4 * | m, |
double * | xx, | ||
double * | xy, | ||
double * | xz, | ||
double * | xw, | ||
double * | yx, | ||
double * | yy, | ||
double * | yz, | ||
double * | yw, | ||
double * | zx, | ||
double * | zy, | ||
double * | zz, | ||
double * | zw, | ||
double * | wx, | ||
double * | wy, | ||
double * | wz, | ||
double * | ww | ||
) |
Gets the values of the coefficients of the given floating point matrix.
[in] | m | The floating point matrix. |
[out] | xx | The first coefficient value. |
[out] | xy | The second coefficient value. |
[out] | xz | The third coefficient value. |
[out] | xw | The fourth coefficient value. |
[out] | yx | The fifth coefficient value. |
[out] | yy | The sixth coefficient value. |
[out] | yz | The seventh coefficient value. |
[out] | yw | The eighth coefficient value. |
[out] | zx | The ninth coefficient value. |
[out] | zy | The tenth coefficient value. |
[out] | zz | The eleventh coefficient value. |
[out] | zw | The twelfth coefficient value. |
[out] | wx | The thirteenth coefficient value. |
[out] | wy | The fourteenth coefficient value. |
[out] | wz | The fifteenth coefficient value. |
[out] | ww | The sixteenth coefficient value. |
This function gets the values of the coefficients of the matrix m
. No check is done on m
.
void eina_matrix4_values_set | ( | Eina_Matrix4 * | m, |
double | xx, | ||
double | xy, | ||
double | xz, | ||
double | xw, | ||
double | yx, | ||
double | yy, | ||
double | yz, | ||
double | yw, | ||
double | zx, | ||
double | zy, | ||
double | zz, | ||
double | zw, | ||
double | wx, | ||
double | wy, | ||
double | wz, | ||
double | ww | ||
) |
Sets the values of the coefficients of the given floating point matrix.
[out] | m | The floating point matrix. |
[in] | xx | The first coefficient value. |
[in] | xy | The second coefficient value. |
[in] | xz | The third coefficient value. |
[in] | xw | The fourth coefficient value. |
[in] | yx | The fifth coefficient value. |
[in] | yy | The sixth coefficient value. |
[in] | yz | The seventh coefficient value. |
[in] | yw | The eighth coefficient value. |
[in] | zx | The ninth coefficient value. |
[in] | zy | The tenth coefficient value. |
[in] | zz | The eleventh coefficient value. |
[in] | zw | The twelfth coefficient value. |
[in] | wx | The thirteenth coefficient value. |
[in] | wy | The fourteenth coefficient value. |
[in] | wz | The fifteenth coefficient value. |
[in] | ww | The sixteenth coefficient value. |
This function sets the values of the coefficients of the matrix m
. No check is done on m
.