feat(input): more intuitive inputs
This commit is contained in:
24
src/input.c
24
src/input.c
@@ -69,20 +69,20 @@ void __key_callback_input(
|
|||||||
switch (key)
|
switch (key)
|
||||||
{
|
{
|
||||||
unsigned char tmp;
|
unsigned char tmp;
|
||||||
case GLFW_KEY_I:
|
case GLFW_KEY_Z:
|
||||||
tmp = projection.w;
|
tmp = projection.w;
|
||||||
projection.w = projection.x;
|
projection.w = projection.x;
|
||||||
projection.x = tmp;
|
projection.x = tmp;
|
||||||
|
|
||||||
animate_index = 1;
|
animate_index = 1;
|
||||||
break;
|
break;
|
||||||
case GLFW_KEY_O:
|
case GLFW_KEY_X:
|
||||||
tmp = projection.w;
|
tmp = projection.w;
|
||||||
projection.w = projection.y;
|
projection.w = projection.y;
|
||||||
projection.y = tmp;
|
projection.y = tmp;
|
||||||
animate_index = 2;
|
animate_index = 2;
|
||||||
break;
|
break;
|
||||||
case GLFW_KEY_P:
|
case GLFW_KEY_C:
|
||||||
tmp = projection.w;
|
tmp = projection.w;
|
||||||
projection.w = projection.z;
|
projection.w = projection.z;
|
||||||
projection.z = tmp;
|
projection.z = tmp;
|
||||||
@@ -173,32 +173,32 @@ quat_t poll_input(window_t window)
|
|||||||
{
|
{
|
||||||
versor p = GLM_QUAT_IDENTITY_INIT;
|
versor p = GLM_QUAT_IDENTITY_INIT;
|
||||||
|
|
||||||
if (glfwGetKey((GLFWwindow *)window, 'Q') == GLFW_PRESS)
|
if (glfwGetKey((GLFWwindow *)window, 'W') == GLFW_PRESS)
|
||||||
{
|
{
|
||||||
glm_quatv(p, ANGLE, axis[0]);
|
glm_quatv(p, ANGLE, axis[0]);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if (glfwGetKey((GLFWwindow *)window, 'W') == GLFW_PRESS)
|
if (glfwGetKey((GLFWwindow *)window, 'S') == GLFW_PRESS)
|
||||||
{
|
{
|
||||||
glm_quatv(p, -ANGLE, axis[0]);
|
glm_quatv(p, -ANGLE, axis[0]);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if (glfwGetKey((GLFWwindow *)window, 'A') == GLFW_PRESS)
|
if (glfwGetKey((GLFWwindow *)window, 'A') == GLFW_PRESS)
|
||||||
{
|
|
||||||
glm_quatv(p, ANGLE, axis[1]);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
if (glfwGetKey((GLFWwindow *)window, 'S') == GLFW_PRESS)
|
|
||||||
{
|
{
|
||||||
glm_quatv(p, -ANGLE, axis[1]);
|
glm_quatv(p, -ANGLE, axis[1]);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if (glfwGetKey((GLFWwindow *)window, 'Z') == GLFW_PRESS)
|
if (glfwGetKey((GLFWwindow *)window, 'D') == GLFW_PRESS)
|
||||||
|
{
|
||||||
|
glm_quatv(p, ANGLE, axis[1]);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
if (glfwGetKey((GLFWwindow *)window, 'Q') == GLFW_PRESS)
|
||||||
{
|
{
|
||||||
glm_quatv(p, ANGLE, axis[2]);
|
glm_quatv(p, ANGLE, axis[2]);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if (glfwGetKey((GLFWwindow *)window, 'X') == GLFW_PRESS)
|
if (glfwGetKey((GLFWwindow *)window, 'E') == GLFW_PRESS)
|
||||||
{
|
{
|
||||||
glm_quatv(p, -ANGLE, axis[2]);
|
glm_quatv(p, -ANGLE, axis[2]);
|
||||||
goto end;
|
goto end;
|
||||||
|
|||||||
Reference in New Issue
Block a user