diff options
Diffstat (limited to 'src/ft_detect.c')
-rw-r--r-- | src/ft_detect.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ft_detect.c b/src/ft_detect.c index 44e5bb2..a944a0f 100644 --- a/src/ft_detect.c +++ b/src/ft_detect.c @@ -17,10 +17,10 @@ void 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 * - cl->rlist.y_ray_dir)); - if (cl->rlist.y_ray_dir < 0) + cl->rlist.y_delta_dist = sqrt(1 + (cl->rlist.y_ray_dir * + cl->rlist.y_ray_dir) / (cl->rlist.x_ray_dir * + cl->rlist.x_ray_dir)); + if (cl->rlist.x_ray_dir < 0) { cl->mlist.y_step = -1; cl->rlist.y_side_dist = (cl->rlist.y_ray_pos - @@ -37,10 +37,10 @@ void void 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 * - cl->rlist.x_ray_dir)); - if (cl->rlist.x_ray_dir < 0) + cl->rlist.x_delta_dist = sqrt(1 + (cl->rlist.x_ray_dir * + cl->rlist.x_ray_dir) / (cl->rlist.y_ray_dir * + cl->rlist.y_ray_dir)); + if (cl->rlist.y_ray_dir < 0) { cl->mlist.x_step = -1; cl->rlist.x_side_dist = (cl->rlist.x_ray_pos - |