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)
|
||||
{
|
||||
unsigned char tmp;
|
||||
case GLFW_KEY_I:
|
||||
case GLFW_KEY_Z:
|
||||
tmp = projection.w;
|
||||
projection.w = projection.x;
|
||||
projection.x = tmp;
|
||||
|
||||
animate_index = 1;
|
||||
break;
|
||||
case GLFW_KEY_O:
|
||||
case GLFW_KEY_X:
|
||||
tmp = projection.w;
|
||||
projection.w = projection.y;
|
||||
projection.y = tmp;
|
||||
animate_index = 2;
|
||||
break;
|
||||
case GLFW_KEY_P:
|
||||
case GLFW_KEY_C:
|
||||
tmp = projection.w;
|
||||
projection.w = projection.z;
|
||||
projection.z = tmp;
|
||||
@@ -173,32 +173,32 @@ quat_t poll_input(window_t window)
|
||||
{
|
||||
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]);
|
||||
goto end;
|
||||
}
|
||||
if (glfwGetKey((GLFWwindow *)window, 'W') == GLFW_PRESS)
|
||||
if (glfwGetKey((GLFWwindow *)window, 'S') == GLFW_PRESS)
|
||||
{
|
||||
glm_quatv(p, -ANGLE, axis[0]);
|
||||
goto end;
|
||||
}
|
||||
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]);
|
||||
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]);
|
||||
goto end;
|
||||
}
|
||||
if (glfwGetKey((GLFWwindow *)window, 'X') == GLFW_PRESS)
|
||||
if (glfwGetKey((GLFWwindow *)window, 'E') == GLFW_PRESS)
|
||||
{
|
||||
glm_quatv(p, -ANGLE, axis[2]);
|
||||
goto end;
|
||||
|
||||
Reference in New Issue
Block a user