mirror of
https://github.com/recp/cglm.git
synced 2025-10-04 09:08:53 +00:00
improve quat_look
This commit is contained in:
@@ -646,15 +646,12 @@ glm_quat_slerp(versor from, versor to, float t, versor dest) {
|
|||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
void
|
void
|
||||||
glm_quat_look(vec3 eye, versor ori, mat4 dest) {
|
glm_quat_look(vec3 eye, versor ori, mat4 dest) {
|
||||||
CGLM_ALIGN(16) vec4 t;
|
|
||||||
|
|
||||||
/* orientation */
|
/* orientation */
|
||||||
glm_quat_mat4t(ori, dest);
|
glm_quat_mat4t(ori, dest);
|
||||||
|
|
||||||
/* translate */
|
/* translate */
|
||||||
glm_vec4(eye, 1.0f, t);
|
glm_mat4_mulv3(dest, eye, 1.0f, dest[3]);
|
||||||
glm_mat4_mulv(dest, t, t);
|
glm_vec_flipsign(dest[3]);
|
||||||
glm_vec_flipsign_to(t, dest[3]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
Reference in New Issue
Block a user