diff options
author | Rudy Bousset <rbousset@z2r5p6.le-101.fr> | 2020-02-14 18:47:19 +0100 |
---|---|---|
committer | Rudy Bousset <rbousset@z2r5p6.le-101.fr> | 2020-02-14 18:47:19 +0100 |
commit | 8e6080e73661cc8747b21b1153e4336796575cf7 (patch) | |
tree | 2eaec487a73f9df1a69627cff23c42746f1b296e /src/ft_detect.c | |
parent | Added turn around keys (diff) | |
download | 42-cub3d-8e6080e73661cc8747b21b1153e4336796575cf7.tar.gz 42-cub3d-8e6080e73661cc8747b21b1153e4336796575cf7.tar.bz2 42-cub3d-8e6080e73661cc8747b21b1153e4336796575cf7.tar.xz 42-cub3d-8e6080e73661cc8747b21b1153e4336796575cf7.tar.zst 42-cub3d-8e6080e73661cc8747b21b1153e4336796575cf7.zip |
Norme is bav
Diffstat (limited to '')
-rw-r--r-- | src/ft_detect.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/ft_detect.c b/src/ft_detect.c index 7153123..bfc4449 100644 --- a/src/ft_detect.c +++ b/src/ft_detect.c @@ -1,9 +1,21 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_detect.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/14 17:22:11 by rbousset #+# #+# */ +/* Updated: 2020/02/14 17:23:42 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + #include <libft.h> #include <cub3d.h> #include <math.h> static void -ft_detection_init_y(t_cub *cl) + ft_detection_init_y(t_cub *cl) { cl->rlist.y_delta_dist = sqrt(1 + (cl->rlist.x_ray_dir * cl->rlist.x_ray_dir) / (cl->rlist.y_ray_dir * @@ -23,7 +35,7 @@ ft_detection_init_y(t_cub *cl) } static void -ft_detection_init_x(t_cub *cl) + ft_detection_init_x(t_cub *cl) { cl->rlist.x_delta_dist = sqrt(1 + (cl->rlist.y_ray_dir * cl->rlist.y_ray_dir) / (cl->rlist.x_ray_dir * @@ -44,10 +56,10 @@ ft_detection_init_x(t_cub *cl) } void -ft_detect(t_cub *cl) + ft_detect(t_cub *cl) { ft_detection_init_x(cl); - cl->rlist.hit = 0; + cl->rlist.hit = 0; while (cl->rlist.hit == 0) { if (cl->rlist.x_side_dist < cl->rlist.y_side_dist) |