mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +00:00
unaligned matrix duplication
This commit is contained in:
@@ -26,6 +26,21 @@
|
|||||||
/* for C only */
|
/* for C only */
|
||||||
#define GLM_MAT4_IDENTITY (mat4)GLM_MAT4_IDENTITY_INIT
|
#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]
|
* @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[2], _mm_load_ps(mat[2]));
|
||||||
_mm_store_ps(dest[3], _mm_load_ps(mat[3]));
|
_mm_store_ps(dest[3], _mm_load_ps(mat[3]));
|
||||||
#else
|
#else
|
||||||
glm__memcpy(float, dest, mat, sizeof(mat4));
|
glm_mat4_udup(mat, dest);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user