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_floor_cast_inits.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_floor_cast_inits.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ft_floor_cast_inits.c b/src/ft_floor_cast_inits.c index 22c735a..022be1b 100644 --- a/src/ft_floor_cast_inits.c +++ b/src/ft_floor_cast_inits.c @@ -33,9 +33,9 @@ void void ft_floor_cast_inits(uint16_t y, t_ray *rl, t_cub *cl) { - rl->x_f_ray_dir = cl->plist.dir_y - cl->plist.plane_x; + rl->x_f_ray_dir = cl->plist.dir_y + cl->plist.plane_x; rl->y_f_ray_dir = cl->plist.dir_x - cl->plist.plane_y; - rl->x_f_ray_dir_bis = cl->plist.dir_y + cl->plist.plane_x; + rl->x_f_ray_dir_bis = cl->plist.dir_y - cl->plist.plane_x; rl->y_f_ray_dir_bis = cl->plist.dir_x + cl->plist.plane_y; rl->p = y - cl->wlist.y_size / 2; cl->plist.pos_z = 0.5 * cl->wlist.y_size; @@ -44,7 +44,7 @@ void (rl->x_f_ray_dir_bis - rl->x_f_ray_dir) / cl->wlist.x_size; cl->mlist.y_floor_step = rl->row_dist * (rl->y_f_ray_dir_bis - rl->y_f_ray_dir) / cl->wlist.x_size; - rl->x_floor = cl->plist.pos_y + rl->row_dist * rl->x_f_ray_dir; + rl->x_floor = -cl->plist.pos_y + rl->row_dist * rl->x_f_ray_dir; rl->y_floor = cl->plist.pos_x + rl->row_dist * rl->y_f_ray_dir; } |