func for make matrix identity

This commit is contained in:
Recep Aslantas
2017-05-29 20:52:38 +03:00
parent 3728102644
commit 3fbf590d39
6 changed files with 62 additions and 0 deletions

View File

@@ -74,6 +74,27 @@ glm_mat4_copy(mat4 mat, mat4 dest) {
#endif
}
/*!
* @brief make given matrix identity. It is identical with below,
* but it is more easy to do that with this func especially for members
* e.g. glm_mat4_identity(aStruct->aMatrix);
*
* @code
* glm_mat4_copy(GLM_MAT4_IDENTITY, mat); // C only
*
* // or
* mat4 mat = GLM_MAT4_IDENTITY_INIT;
* @endcode
*
* @param[in, out] mat destination
*/
CGLM_INLINE
void
glm_mat4_identity(mat4 mat) {
mat4 t = GLM_MAT4_IDENTITY_INIT;
glm_mat4_copy(t, mat);
}
/*!
* @brief copy upper-left of mat4 to mat3
*