aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_floor_cast.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r6p3.le-101.fr>2020-03-08 20:54:29 +0100
committerRudy Bousset <rbousset@z2r6p3.le-101.fr>2020-03-08 20:54:41 +0100
commit8771817c18a1058c9524e8ba150d65e8fab20a03 (patch)
tree3fe68616719dd502f72045425a67221bdfa67472 /src/ft_floor_cast.c
parentClean af (diff)
download42-cub3d-8771817c18a1058c9524e8ba150d65e8fab20a03.tar.gz
42-cub3d-8771817c18a1058c9524e8ba150d65e8fab20a03.tar.bz2
42-cub3d-8771817c18a1058c9524e8ba150d65e8fab20a03.tar.xz
42-cub3d-8771817c18a1058c9524e8ba150d65e8fab20a03.tar.zst
42-cub3d-8771817c18a1058c9524e8ba150d65e8fab20a03.zip
it will be done
Diffstat (limited to 'src/ft_floor_cast.c')
-rw-r--r--src/ft_floor_cast.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ft_floor_cast.c b/src/ft_floor_cast.c
index a0321d0..1d98e03 100644
--- a/src/ft_floor_cast.c
+++ b/src/ft_floor_cast.c
@@ -16,6 +16,13 @@
void
ft_floor_cast(uint16_t y, t_cub *cl)
{
- (void)y;
- (void)cl;
+ t_ray *rl;
+
+ rl = &cl->rlist;
+ rl->x_f_ray_dir = cl->plist.dir_x - cl->plist.plane_x;
+ rl->y_f_ray_dir = cl->plist.dir_y - cl->plist.plane_y;
+ rl->x_f_ray_dir_bis = cl->plist.dir_x + cl->plist.plane_x;
+ rl->y_f_ray_dir_bis = cl->plist.dir_y + cl->plist.plane_y;
+ rl->p = y - cl->wlist.y_size / 2;
+ cl->plist.pos_z = 0.5 * cl->wlist.y_size;
}