added Sphere collision but might be broken and is very messy

This commit is contained in:
any
2026-07-26 14:59:49 +02:00
parent 31f259b4b5
commit 361eaefdb5
7 changed files with 306 additions and 6 deletions
+21 -2
View File
@@ -1,9 +1,28 @@
struct vec3 {
float x, y, z;
double x, y, z;
};
typedef struct vec3 vec3;
struct triangle {
vec3 a, b, c;
vec3 normal;
}; typedef struct triangle triangle;
}; typedef struct triangle triangle;
struct ray {
vec3 origin;
vec3 direction;
}; typedef struct ray ray;
struct sphere {
vec3 origin;
int radius;
}; typedef struct sphere sphere;
struct camera {
vec3 origin;
vec3 direction;
double height;
double width;
double resolutionX;
double resolutionY;
}; typedef struct camera camera;