add rotate with mouse
This commit is contained in:
parent
a2a0a91495
commit
f77a4446b6
5 changed files with 32 additions and 8 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: mc <mc@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/31 17:00:59 by mc #+# #+# */
|
||||
/* Updated: 2024/10/31 18:15:13 by mc ### ########.fr */
|
||||
/* Updated: 2024/11/07 17:10:50 by mc ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
# define MOVE_SPEED 0.05 // Player oves by N cases by tick
|
||||
# define ROT_SPEED_DIVIDE_PI 64 // Player turns by pi/N rad by tick
|
||||
# define MOUSE_ROTATION_SPEED 0.001 // rad/px
|
||||
# define HITBOX 0.25 // Hitbox of N cases around player.
|
||||
|
||||
# define COLOR_CEILING 0x29f8ff // TODO get from cub file
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: mc <mc@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/17 14:43:09 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/11/07 14:26:28 by mc ### ########.fr */
|
||||
/* Updated: 2024/11/07 17:13:28 by mc ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -23,6 +23,7 @@ typedef struct s_input_actions
|
|||
bool up;
|
||||
bool down;
|
||||
bool quit;
|
||||
int rotate;
|
||||
} t_input_actions;
|
||||
|
||||
/// @brief Modified by the input of the user. A value becomes true
|
||||
|
|
@ -43,7 +44,8 @@ int hook_keyrelease(int keycode);
|
|||
|
||||
/// @brief To handle the input of a window.
|
||||
///
|
||||
/// @param mlx_ptr mlx connection identifier
|
||||
/// @param win_ptr Reference to the window to use.
|
||||
void input_init(void *win_ptr);
|
||||
void input_init(void *mlx_ptr, void *win_ptr);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue