mirror of
https://github.com/recp/cglm.git
synced 2025-10-04 09:08:53 +00:00
quat: mat4_mul_quat helper
* the quaternion is used as right matrix
This commit is contained in:
@@ -45,6 +45,7 @@
|
|||||||
#define cglm_mat_h
|
#define cglm_mat_h
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include "quat.h"
|
||||||
|
|
||||||
#ifdef CGLM_SSE_FP
|
#ifdef CGLM_SSE_FP
|
||||||
# include "simd/sse2/mat4.h"
|
# include "simd/sse2/mat4.h"
|
||||||
@@ -318,6 +319,21 @@ glm_mat4_mulv(mat4 m, vec4 v, vec4 dest) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief multiply mat4 with quaternion and store in dest vector
|
||||||
|
*
|
||||||
|
* @param[in] m left matrix
|
||||||
|
* @param[in] q quaternion as right matrix
|
||||||
|
* @param[out] dest destination matrix
|
||||||
|
*/
|
||||||
|
CGLM_INLINE
|
||||||
|
void
|
||||||
|
glm_mat4_mulq(mat4 m, versor q, mat4 dest) {
|
||||||
|
mat4 rot;
|
||||||
|
glm_quat_mat4(q, rot);
|
||||||
|
glm_mat4_mul(m, rot, dest);
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief multiply vector with mat4's mat3 part(rotation)
|
* @brief multiply vector with mat4's mat3 part(rotation)
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user