clean of debug rays vertical and horizontal

This commit is contained in:
hugogogo
2022-04-28 09:03:23 +02:00
parent 4f0e5fcd00
commit 5e8afcb245
2 changed files with 27 additions and 109 deletions

View File

@@ -36,55 +36,21 @@ static void wall_length(t_rcast *rcast)
rcast->wall.start.x = rcast->ray_nb;
rcast->wall.end.x = rcast->ray_nb;
if (rcast->slope_x == 0)
if (rcast->is_x == 1)
{
// tmp, to draw the map
if (rcast->tmp)
printf("(slope_x == 0) ");
// tmp end
length = (rcast->next_y - rcast->ray_step_y);
}
else if (rcast->slope_y == 0)
{
// tmp, to draw the map
if (rcast->tmp)
printf("(slope_y == 0) ");
// tmp end
length = (rcast->next_x - rcast->ray_step_x);
}
else if (rcast->is_x == 1)
{
// tmp, to draw the map
if (rcast->tmp)
printf("(is_x == 1) ");
// tmp end
length = (rcast->next_x - rcast->ray_step_x) / ft_abs(rcast->slope_y);
length = rcast->next_x - rcast->ray_step_x;
if (rcast->slope_y)
length /= ft_abs(rcast->slope_y);
// length = (double)length * (double)rcast->screen_dist.end.y / (double)rcast->slope_x;
}
else if (rcast->is_x == 0)
{
// tmp, to draw the map
if (rcast->tmp)
printf("(is_x == 0) ");
// tmp end
length = (rcast->next_y - rcast->ray_step_y) / ft_abs(rcast->slope_x);
length = rcast->next_y - rcast->ray_step_y;
if (rcast->slope_x)
length /= ft_abs(rcast->slope_x);
// length = (double)length * (double)rcast->screen_dist.end.y / (double)rcast->slope_y;
}
rcast->ray_len = ft_abs(length);
// tmp, to draw the map
if (rcast->tmp)
printf("length:%i", rcast->ray_len);
// tmp end
}
static void wall_height(t_rcast *rcast)