mirror of
https://github.com/recp/cglm.git
synced 2025-12-24 20:34:58 +00:00
mat4 pick transposed mat3
This commit is contained in:
@@ -85,6 +85,30 @@ glm_mat4_pick3(mat4 mat, mat3 dest) {
|
||||
dest[2][2] = mat[2][2];
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief copy upper-left of mat4 to mat3 (transposed)
|
||||
*
|
||||
* the postfix t stands for transpose
|
||||
*
|
||||
* @param[in] mat source
|
||||
* @param[out] dest destination
|
||||
*/
|
||||
CGLM_INLINE
|
||||
void
|
||||
glm_mat4_pick3t(mat4 mat, mat3 dest) {
|
||||
dest[0][0] = mat[0][0];
|
||||
dest[0][1] = mat[1][0];
|
||||
dest[0][2] = mat[2][0];
|
||||
|
||||
dest[1][0] = mat[0][1];
|
||||
dest[1][1] = mat[1][1];
|
||||
dest[1][2] = mat[2][1];
|
||||
|
||||
dest[2][0] = mat[0][2];
|
||||
dest[2][1] = mat[1][2];
|
||||
dest[2][2] = mat[2][2];
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief copy mat3 to mat4's upper-left
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user