diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-02 16:16:45 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-02 16:16:45 +0200 |
commit | f922d1ed3235e3ce61c4e74420ae31354eb829d9 (patch) | |
tree | faa1bea9c60dbbf79b91dded0ce9ef1afd552357 /src/ft_extra_keys.c | |
parent | Correct ray_pos (diff) | |
download | 42-cub3d-f922d1ed3235e3ce61c4e74420ae31354eb829d9.tar.gz 42-cub3d-f922d1ed3235e3ce61c4e74420ae31354eb829d9.tar.bz2 42-cub3d-f922d1ed3235e3ce61c4e74420ae31354eb829d9.tar.xz 42-cub3d-f922d1ed3235e3ce61c4e74420ae31354eb829d9.tar.zst 42-cub3d-f922d1ed3235e3ce61c4e74420ae31354eb829d9.zip |
Revert this if needed, still sprites and collision to do
Diffstat (limited to '')
-rw-r--r-- | src/ft_extra_keys.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ft_extra_keys.c b/src/ft_extra_keys.c index dba1026..1a81820 100644 --- a/src/ft_extra_keys.c +++ b/src/ft_extra_keys.c @@ -28,13 +28,13 @@ int pl = &clist->plist; sav_dir_y = pl->dir_y; - pl->dir_y = pl->dir_y * cos(rot_speed) - pl->dir_x * sin(rot_speed); - pl->dir_x = sav_dir_y * sin(rot_speed) + pl->dir_x * cos(rot_speed); + pl->dir_y = pl->dir_y * cos(-rot_speed) - pl->dir_x * sin(-rot_speed); + pl->dir_x = sav_dir_y * sin(-rot_speed) + pl->dir_x * cos(-rot_speed); 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_y %f\n", pl->dir_y); - printf("dir_x %f\n\n", pl->dir_x); + printf("dir_y %+f\n", pl->dir_y); + printf("dir_x %+f\n\n", pl->dir_x); return (0); } @@ -48,13 +48,13 @@ int pl = &clist->plist; sav_dir_y = pl->dir_y; - pl->dir_y = pl->dir_y * cos(-rot_speed) - pl->dir_x * sin(-rot_speed); - pl->dir_x = sav_dir_y * sin(-rot_speed) + pl->dir_x * cos(-rot_speed); + pl->dir_y = pl->dir_y * cos(rot_speed) - pl->dir_x * sin(rot_speed); + pl->dir_x = sav_dir_y * sin(rot_speed) + pl->dir_x * cos(rot_speed); 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_y %f\n", pl->dir_y); - printf("dir_x %f\n\n", pl->dir_x); + printf("dir_y %+f\n", pl->dir_y); + printf("dir_x %+f\n\n", pl->dir_x); return (0); } |