Tizen Native API
6.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 |
Typedef Documentation
A 4x4 floating point matrix.
Function Documentation
void eina_matrix4_array_set | ( | Eina_Matrix4 * | m, |
const double * | v | ||
) |
Sets matrix values using an array.
- Parameters:
-
[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.
- Since (EFL) :
- 1.17
- Since :
- 3.0
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.
- Parameters:
-
[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.
- Since (EFL) :
- 1.24
void eina_matrix4_copy | ( | Eina_Matrix4 * | dst, |
const Eina_Matrix4 * | src | ||
) |
Copies matrix.
- Parameters:
-
[out] dst The matrix copy. [in] src The matrix to copy.
- Since (EFL) :
- 1.17
- Since :
- 3.0
double eina_matrix4_determinant | ( | const Eina_Matrix4 * | m | ) |
Calculates the determinant of the given matrix.
- Parameters:
-
[in] m The matrix.
- Returns:
- The determinant.
This function returns the determinant of the matrix m
. No check is done on m
.
- Since (EFL) :
- 1.16
- Since :
- 3.0
void eina_matrix4_identity | ( | Eina_Matrix4 * | out | ) |
Sets the given matrix to identity.
- Parameters:
-
[out] out The matrix to set.
- Since (EFL) :
- 1.16
- Since :
- 3.0
Eina_Bool eina_matrix4_inverse | ( | Eina_Matrix4 * | out, |
const Eina_Matrix4 * | in | ||
) |
Computes the inverse of the given matrix.
- Parameters:
-
[out] out The inverse matrix. [in] in The matrix.
- Returns:
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.
- Since (EFL) :
- 1.16
- Since :
- 3.0
void eina_matrix4_matrix3_to | ( | Eina_Matrix3 * | m3, |
const Eina_Matrix4 * | m4 | ||
) |
Converts an Eina_Matrix4 into an Eina_Matrix3.
- Parameters:
-
[out] m3 The destination Eina_Matrix3. [in] m4 The source Eina_Matrix4.
- Since (EFL) :
- 1.15
- Since :
- 3.0
void eina_matrix4_multiply | ( | Eina_Matrix4 * | out, |
const Eina_Matrix4 * | mat_a, | ||
const Eina_Matrix4 * | mat_b | ||
) |
Multiplies two matrices with check.
- Parameters:
-
[out] out The resulting matrix. [in] mat_a The first member of the multiplication. [in] mat_b The second member of the multiplication.
- Since (EFL) :
- 1.17
- Since :
- 3.0
void eina_matrix4_multiply_copy | ( | Eina_Matrix4 * | out, |
const Eina_Matrix4 * | mat_a, | ||
const Eina_Matrix4 * | mat_b | ||
) |
Multiplies two matrix.
- Parameters:
-
[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.
- Since (EFL) :
- 1.17
- Since :
- 3.0
Eina_Bool eina_matrix4_normalized | ( | Eina_Matrix4 * | out, |
const Eina_Matrix4 * | in | ||
) |
Normalizes the given matrix.
- Parameters:
-
[out] out The normalized matrix. [in] in The matrix.
- Returns:
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
.
- Since (EFL) :
- 1.16
- Since :
- 3.0
void eina_matrix4_ortho_set | ( | Eina_Matrix4 * | m, |
double | left, | ||
double | right, | ||
double | bottom, | ||
double | top, | ||
double | dnear, | ||
double | dfar | ||
) |
Sets orthogonality matrix.
- Parameters:
-
[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.
- Since (EFL) :
- 1.17
- Since :
- 3.0
void eina_matrix4_rotate | ( | Eina_Matrix4 * | t, |
double | rad, | ||
Eina_Matrix_Axis | axis | ||
) |
Sets the matrix values for a rotation operation.
- Parameters:
-
[out] t Where to store the resulting matrix. [in] rad The number of radians to rotate. [in] axis The Axis of rotation.
- Since (EFL) :
- 1.24
void eina_matrix4_scale | ( | Eina_Matrix4 * | t, |
double | sx, | ||
double | sy, | ||
double | sz | ||
) |
Sets the matrix values for a scaling operation.
- Parameters:
-
[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.
- Since (EFL) :
- 1.24
void eina_matrix4_translate | ( | Eina_Matrix4 * | t, |
double | tx, | ||
double | ty, | ||
double | tz | ||
) |
Sets the matrix values for a translation operation.
- Parameters:
-
[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.
- Since (EFL) :
- 1.24
void eina_matrix4_transpose | ( | Eina_Matrix4 * | out, |
const Eina_Matrix4 * | in | ||
) |
Computes the transpose of the given matrix.
- Parameters:
-
[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.
- Since (EFL) :
- 1.16
- Since :
- 3.0
Eina_Matrix_Type eina_matrix4_type_get | ( | const Eina_Matrix4 * | m | ) |
Returns the type of the given floating point matrix.
- Parameters:
-
[in] m The floating point matrix.
- Returns:
- The type of the matrix.
This function returns the type of the matrix m
. No check is done on m
.
- Since (EFL) :
- 1.15
- Since :
- 3.0
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.
- Parameters:
-
[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
.
- See also:
- eina_matrix4_values_set()
- Since (EFL) :
- 1.15
- Since :
- 3.0
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.
- Parameters:
-
[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
.
- See also:
- eina_matrix4_values_get()
- Since (EFL) :
- 1.15
- Since :
- 3.0