fix: map directions

This commit is contained in:
mcolonna 2024-10-16 18:02:01 +02:00
parent d1f2136b13
commit 571bf80c6e
2 changed files with 7 additions and 7 deletions

6
map.h
View file

@ -3,10 +3,10 @@
/* ::: :::::::: */ /* ::: :::::::: */
/* map.h :+: :+: :+: */ /* map.h :+: :+: :+: */
/* +:+ +:+ +:+ */ /* +:+ +:+ +:+ */
/* By: mcolonna <mcolonna@student.42.fr> +#+ +:+ +#+ */ /* By: mcolonna <mcolonna@student.42perpignan.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/01 13:59:04 by mcolonna #+# #+# */ /* Created: 2024/10/01 13:59:04 by mcolonna #+# #+# */
/* Updated: 2024/10/15 18:22:32 by mcolonna ### ########.fr */ /* Updated: 2024/10/16 17:59:12 by mcolonna ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -99,7 +99,7 @@ typedef struct s_map
/// @brief An 2D array of all the cases. /// @brief An 2D array of all the cases.
/// ///
/// Syntax to get a case: cases[y * width + x] /// Syntax to get a case: cases[y * width + x]
/// x is left to right, y is top to bottom. /// x is west to east, y is north to south.
t_map_case *cases; t_map_case *cases;
/// @brief Represents the player in the map. /// @brief Represents the player in the map.

View file

@ -3,10 +3,10 @@
/* ::: :::::::: */ /* ::: :::::::: */
/* utils.c :+: :+: :+: */ /* utils.c :+: :+: :+: */
/* +:+ +:+ +:+ */ /* +:+ +:+ +:+ */
/* By: mcolonna <mcolonna@student.42.fr> +#+ +:+ +#+ */ /* By: mcolonna <mcolonna@student.42perpignan.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/15 12:38:40 by mcolonna #+# #+# */ /* Created: 2024/10/15 12:38:40 by mcolonna #+# #+# */
/* Updated: 2024/10/15 17:21:16 by mcolonna ### ########.fr */ /* Updated: 2024/10/16 18:01:25 by mcolonna ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -15,8 +15,8 @@
void vector_from_rotation(t_point_double *vec, double angle, double norm) void vector_from_rotation(t_point_double *vec, double angle, double norm)
{ {
vec->x = -cos(angle) * norm; vec->x = sin(angle) * norm;
vec->y = sin(angle) * norm; vec->y = -cos(angle) * norm;
} }
void write_err(const char *str, ...) void write_err(const char *str, ...)