diff options
Diffstat (limited to 'src/ray.h')
-rw-r--r-- | src/ray.h | 20 |
1 files changed, 20 insertions, 0 deletions
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 <stdbool.h> +#include <stdint.h> + +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); |