Create matrix_4x4_copy
This commit is contained in:
parent
8b915bbc22
commit
070b7b78b1
|
@ -25,6 +25,15 @@
|
||||||
|
|
||||||
#include <gfx/math/matrix_4x4.h>
|
#include <gfx/math/matrix_4x4.h>
|
||||||
|
|
||||||
|
void matrix_4x4_copy(math_matrix_4x4 *dst, const math_matrix_4x4 *src)
|
||||||
|
{
|
||||||
|
unsigned i, j;
|
||||||
|
|
||||||
|
for (i = 0; i < 4; i++)
|
||||||
|
for (j = 0; j < 4; j++)
|
||||||
|
MAT_ELEM_4X4(*dst, i, j) = MAT_ELEM_4X4(*src, i, j);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sets mat to an identity matrix
|
* Sets mat to an identity matrix
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -35,6 +35,7 @@ typedef struct math_matrix_4x4
|
||||||
|
|
||||||
#define MAT_ELEM_4X4(mat, r, c) ((mat).data[4 * (c) + (r)])
|
#define MAT_ELEM_4X4(mat, r, c) ((mat).data[4 * (c) + (r)])
|
||||||
|
|
||||||
|
void matrix_4x4_copy(math_matrix_4x4 *dst, const math_matrix_4x4 *src);
|
||||||
void matrix_4x4_identity(math_matrix_4x4 *mat);
|
void matrix_4x4_identity(math_matrix_4x4 *mat);
|
||||||
void matrix_4x4_transpose(math_matrix_4x4 *out, const math_matrix_4x4 *in);
|
void matrix_4x4_transpose(math_matrix_4x4 *out, const math_matrix_4x4 *in);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue