123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #ifndef DD_MATRIX_H
- #define DD_MATRIX_H
- /* a series of functions to manipulate a 4x4 matrix.
- * a matrix can be created anyway the programmer likes, as long as they
- * pass a pointer to it.
- * these functions allow transformation, scale and rotation (experimental)
- */
- /* identity matrix
- * identity : makes an identity matrix
- * identityt : makes an identity matrix, except from translation
- (so it cancels rotation and scale)
- */
- void dd_matrix_identity (float mat[16]);
- void dd_matrix_identityt(float mat[16]);
- /* Translate - Seperated in add, set and multiply
- * add : adds fixed translation to the matrix
- * set : sets (overwrites) fixed translation to the matrix
- * multiply : creates a new matrix with given translation and
- multiplies the given matrix with it
- */
- void dd_matrix_translatea(float mat[16], float x, float y, float z);
- void dd_matrix_translates(float mat[16], float x, float y, float z);
- void dd_matrix_translatem(float mat[16], float x, float y, float z);
- /* Scale - Seperated in add and set */
- void dd_matrix_scalea(float mat[16], float x, float y, float z);
- void dd_matrix_scales(float mat[16], float x, float y, float z);
- /* Rotate - experimental functions */
- void dd_matrix_rotate_x(float mat[16], float rad);
- void dd_matrix_rotate_y(float mat[16], float rad);
- void dd_matrix_rotate_z(float mat[16], float rad);
- void dd_matrix_rotatelocal_x(float mat[16], float rad);
- void dd_matrix_rotatelocal_y(float mat[16], float rad);
- void dd_matrix_rotatelocal_z(float mat[16], float rad);
- /* Matrix multiplication */
- void dd_matrix_mult(float mat1[16], float mat2[16]);
- void dd_matrix_copy(float mat1[16], float mat2[16]);
- /* Getters */
- float dd_matrix_x(float mat[16]);
- float dd_matrix_y(float mat[16]);
- float dd_matrix_z(float mat[16]);
- /* Print matrix - don't use this */
- void dd_matrix_print(float mat[16]);
- /* these are experimental, they are meant to behave like glPush glPop and glMatrixMultf */
- void dd_matrix_push();
- void dd_matrix_pop ();
- void dd_matrix_globalmult(float mat[16]);
- void dd_matrix_globalset(float mat[16]);
- #endif
|