Archived
1
0

🏗️」 wip(Raycasting): Should be working but not

This commit is contained in:
2024-10-30 16:33:14 +01:00
parent efa0d6fbbd
commit 90c84c7b37
13 changed files with 281 additions and 247 deletions

32
src/raycasting/vectwo.c Normal file
View File

@ -0,0 +1,32 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* vectwo.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/26 15:47:29 by adjoly #+# #+# */
/* Updated: 2024/10/28 15:20:24 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "game/vectwo.h"
#include <math.h>
float vec2_dist(t_vec2 first, t_vec2 second)
{
return (sqrt(powf(second.x - first.x, 2) + powf(second.y - first.y, 2)));
}
void vec2_add(t_vec2 *first, t_vec2 second)
{
first->x += second.x;
first->y += second.y;
}
void vec2_sub(t_vec2 *first, t_vec2 second)
{
first->x -= second.x;
first->y -= second.y;
}