From edec8789a919372207c530ae1a3c98c05ec07aed Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Sat, 22 Apr 2023 12:35:09 -0400 Subject: move raycastign to its own file --- src/ray.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/ray.h (limited to 'src/ray.h') diff --git a/src/ray.h b/src/ray.h new file mode 100644 index 0000000..8ad2638 --- /dev/null +++ b/src/ray.h @@ -0,0 +1,20 @@ +#pragma once + +#include +#include + +typedef struct { + float x, y; +} v2; + +typedef struct { + int x, y; +} v2i; + + +float v2_cross(v2 a, v2 b); +float v2_len(v2 a); +float v2_square_dist(v2 a, v2 b); +v2 v2_add(v2 a, v2 b); + +uint32_t cast_ray(v2 pos, float theta, v2* hit_pos); -- cgit v1.2.3-freya