mirror of
https://github.com/recp/cglm.git
synced 2025-12-24 04:22:36 +00:00
func for make matrix identity
This commit is contained in:
@@ -25,6 +25,10 @@ CGLM_EXPORT
|
||||
void
|
||||
glmc_mat4_copy(mat4 mat, mat4 dest);
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
glmc_mat4_identity(mat4 mat);
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
glmc_mat4_pick3(mat4 mat, mat3 dest);
|
||||
|
||||
@@ -20,6 +20,10 @@ CGLM_EXPORT
|
||||
void
|
||||
glmc_mat3_copy(mat3 mat, mat3 dest);
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
glmc_mat3_identity(mat3 mat);
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
glmc_mat3_mul(mat3 m1, mat3 m2, mat3 dest);
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
@@ -38,6 +38,27 @@ glm_mat3_copy(mat3 mat, mat3 dest) {
|
||||
glm__memcpy(float, dest, mat, sizeof(mat3));
|
||||
}
|
||||
|
||||
/*!
|
||||
* @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_mat3_identity(aStruct->aMatrix);
|
||||
*
|
||||
* @code
|
||||
* glm_mat3_copy(GLM_MAT3_IDENTITY, mat); // C only
|
||||
*
|
||||
* // or
|
||||
* mat3 mat = GLM_MAT3_IDENTITY_INIT;
|
||||
* @endcode
|
||||
*
|
||||
* @param[in, out] mat destination
|
||||
*/
|
||||
CGLM_INLINE
|
||||
void
|
||||
glm_mat3_identity(mat3 mat) {
|
||||
mat3 t = GLM_MAT3_IDENTITY_INIT;
|
||||
glm_mat3_copy(t, mat);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief multiply m1 and m2 to dest
|
||||
*
|
||||
|
||||
@@ -19,6 +19,12 @@ glmc_mat4_copy(mat4 mat, mat4 dest) {
|
||||
glm_mat4_copy(mat, dest);
|
||||
}
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
glmc_mat4_identity(mat4 mat) {
|
||||
glm_mat4_identity(mat);
|
||||
}
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
glmc_mat4_pick3(mat4 mat, mat3 dest) {
|
||||
|
||||
@@ -13,6 +13,12 @@ glmc_mat3_copy(mat3 mat, mat3 dest) {
|
||||
glm_mat3_copy(mat, dest);
|
||||
}
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
glmc_mat3_identity(mat3 mat) {
|
||||
glm_mat3_identity(mat);
|
||||
}
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
glmc_mat3_mul(mat3 m1, mat3 m2, mat3 dest) {
|
||||
|
||||
Reference in New Issue
Block a user