aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_extra_keys.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r4p1.le-101.fr>2020-02-14 19:37:54 +0100
committerRudy Bousset <rbousset@z2r4p1.le-101.fr>2020-02-14 19:37:54 +0100
commit63fff28c5f73c833fdd6c5f1d0fa30dba150390a (patch)
treef4617aed38d9f2127949b323a7f032efcb5d5f3b /src/ft_extra_keys.c
parentChanged rotspeed again (diff)
download42-cub3d-63fff28c5f73c833fdd6c5f1d0fa30dba150390a.tar.gz
42-cub3d-63fff28c5f73c833fdd6c5f1d0fa30dba150390a.tar.bz2
42-cub3d-63fff28c5f73c833fdd6c5f1d0fa30dba150390a.tar.xz
42-cub3d-63fff28c5f73c833fdd6c5f1d0fa30dba150390a.tar.zst
42-cub3d-63fff28c5f73c833fdd6c5f1d0fa30dba150390a.zip
True [W][A][S][D]
Diffstat (limited to '')
-rw-r--r--src/ft_extra_keys.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ft_extra_keys.c b/src/ft_extra_keys.c
index ebcaf48..79c0ed2 100644
--- a/src/ft_extra_keys.c
+++ b/src/ft_extra_keys.c
@@ -13,6 +13,7 @@
#include <cub3d.h>
#include <stdint.h>
#include <math.h>
+#include <stdio.h>
int
ft_left_key(t_cub *clist)
@@ -29,6 +30,8 @@ int
sav_plane_x = pl->plane_x;
pl->plane_x = pl->plane_x * cos(rot_speed) - pl->plane_y * sin(rot_speed);
pl->plane_y = sav_plane_x * sin(rot_speed) + pl->plane_y * cos(rot_speed);
+ printf("dir_x> %f\n", pl->dir_x);
+ printf("dir_y> %f\n", pl->dir_y);
return (0);
}
@@ -47,6 +50,8 @@ int
sav_plane_x = pl->plane_x;
pl->plane_x = pl->plane_x * cos(-rot_speed) - pl->plane_y * sin(-rot_speed);
pl->plane_y = sav_plane_x * sin(-rot_speed) + pl->plane_y * cos(-rot_speed);
+ printf("dir_x> %f\n", pl->dir_x);
+ printf("dir_y> %f\n", pl->dir_y);
return (0);
}