return (0);
}
+static const double TRANSLATION_STEP = 0.1;
+static const double ROTATION_STEP = 0.1;
+
int handle_key_press(int keycode, t_session *s)
{
t_element *element;
close_win(s);
}
else if (keycode == XK_Up)
- translate(element, camera->orientation, 0.1);
+ translate(element, camera->orientation, TRANSLATION_STEP);
else if (keycode == XK_Down)
- translate(element, camera->orientation, -0.1);
+ translate(element, camera->orientation, -TRANSLATION_STEP);
else if (keycode == XK_Left)
- translate(element, vec_vec_mul(camera->orientation, camera->up_direction), 0.1);
+ translate(element, vec_vec_mul(camera->orientation, camera->up_direction), TRANSLATION_STEP);
else if (keycode == XK_Right)
- translate(element, vec_vec_mul(camera->orientation, camera->up_direction), -0.1);
+ translate(element, vec_vec_mul(camera->orientation, camera->up_direction), -TRANSLATION_STEP);
else if (keycode == XK_space)
- translate(element, camera->up_direction, 0.1);
+ translate(element, camera->up_direction, TRANSLATION_STEP);
else if (keycode == XK_Shift_L)
- translate(element, camera->up_direction, -0.1);
+ translate(element, camera->up_direction, -TRANSLATION_STEP);
else if (keycode == XK_w)
- rotate(element, vec_vec_mul(camera->orientation, camera->up_direction), -0.1);
+ rotate(element, vec_vec_mul(camera->orientation, camera->up_direction), -ROTATION_STEP);
else if (keycode == XK_s)
- rotate(element, vec_vec_mul(camera->orientation, camera->up_direction), 0.1);
+ rotate(element, vec_vec_mul(camera->orientation, camera->up_direction), ROTATION_STEP);
else if (keycode == XK_a)
- rotate(element, camera->up_direction, -0.1);
+ rotate(element, camera->up_direction, -ROTATION_STEP);
else if (keycode == XK_d)
- rotate(element, camera->up_direction, 0.1);
+ rotate(element, camera->up_direction, ROTATION_STEP);
else if (keycode == XK_e)
- rotate(element, camera->orientation, -0.1);
+ rotate(element, camera->orientation, -ROTATION_STEP);
else if (keycode == XK_q)
- rotate(element, camera->orientation, 0.1);
+ rotate(element, camera->orientation, ROTATION_STEP);
/*
else if (keycode == XK_KP_Add)
else if (keycode == XK_KP_Subtract)