From 583c0cb92ffb5d83e2afeb1b49bea0c57ebaec25 Mon Sep 17 00:00:00 2001 From: PedroEdiaz Date: Mon, 4 Nov 2024 20:56:50 -0600 Subject: [PATCH] Use modern scrolling for better UX --- src/input.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/input.c b/src/input.c index a639003..fdb9188 100644 --- a/src/input.c +++ b/src/input.c @@ -107,13 +107,21 @@ void __mouse_callback_input( void __scroll_callback_input(GLFWwindow *window, double xoffset, double yoffset) { versor p = GLM_QUAT_IDENTITY_INIT; + versor r = GLM_QUAT_IDENTITY_INIT; - glm_quatv(p, yoffset * ANGLE, axis[selected_axis]); - + //glm_quatv(p, yoffset * ANGLE, axis[selected_axis]); + glm_quatv(p, yoffset * ANGLE * 2, (vec3){-1,0,0}); + glm_quatv(r, xoffset * ANGLE * 2, (vec3){0,1,0}); glm_quat_mul(p, q, q); + glm_quat_mul(r, q, q); + glm_quat_rotatev(p, axis[0], axis[0]); glm_quat_rotatev(p, axis[1], axis[1]); glm_quat_rotatev(p, axis[2], axis[2]); + + glm_quat_rotatev(r, axis[0], axis[0]); + glm_quat_rotatev(r, axis[1], axis[1]); + glm_quat_rotatev(r, axis[2], axis[2]); } quat_t poll_input(window_t window)