diff --git a/include/cglm-mat.h b/include/cglm-mat.h index 10d8047..7bdde93 100644 --- a/include/cglm-mat.h +++ b/include/cglm-mat.h @@ -26,6 +26,21 @@ /* for C only */ #define GLM_MAT4_IDENTITY (mat4)GLM_MAT4_IDENTITY_INIT +/*! + * @brief copy all members of [mat] to [dest] + * + * matrix may not be aligned, u stands for unaligned, this may be useful when + * copying a matrix from external source e.g. asset importer... + * + * @param[in] mat source + * @param[out] dest destination + */ +CGLM_INLINE +void +glm_mat4_udup(mat4 mat, mat4 dest) { + glm__memcpy(float, dest, mat, sizeof(mat4)); +} + /*! * @brief copy all members of [mat] to [dest] * @@ -44,7 +59,7 @@ glm_mat4_dup(mat4 mat, mat4 dest) { _mm_store_ps(dest[2], _mm_load_ps(mat[2])); _mm_store_ps(dest[3], _mm_load_ps(mat[3])); #else - glm__memcpy(float, dest, mat, sizeof(mat4)); + glm_mat4_udup(mat, dest); #endif }