X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=csgray;a=blobdiff_plain;f=src%2Fgeom.h;fp=src%2Fgeom.h;h=e3865d22b8bd758df9297aa5c1a09729ff34efb2;hp=7405fa3b27cab735ff8930b4b0e5096bff0bbe7b;hb=f4f8d2071921bb09ff0408fe70f0599cb1263319;hpb=7abe0c51fc87e90674427c5ac5848f394af4575a diff --git a/src/geom.h b/src/geom.h index 7405fa3..e3865d2 100644 --- a/src/geom.h +++ b/src/geom.h @@ -14,22 +14,28 @@ struct hit { float x, y, z; float nx, ny, nz; csg_object *o; +}; + +struct hinterv { + struct hit end[2]; + csg_object *o; - struct hit *next; + struct hinterv *next; }; -struct hit *alloc_hit(void); -void free_hit(struct hit *hit); -void free_hit_list(struct hit *hit); -struct hit *ray_intersect(struct ray *ray, csg_object *o); +struct hinterv *alloc_hits(int n); +void free_hit(struct hinterv *hv); +void free_hit_list(struct hinterv *hv); + +struct hinterv *ray_intersect(struct ray *ray, csg_object *o); -struct hit *ray_sphere(struct ray *ray, csg_object *o); -struct hit *ray_cylinder(struct ray *ray, csg_object *o); -struct hit *ray_plane(struct ray *ray, csg_object *o); -struct hit *ray_csg_un(struct ray *ray, csg_object *o); -struct hit *ray_csg_isect(struct ray *ray, csg_object *o); -struct hit *ray_csg_sub(struct ray *ray, csg_object *o); +struct hinterv *ray_sphere(struct ray *ray, csg_object *o); +struct hinterv *ray_cylinder(struct ray *ray, csg_object *o); +struct hinterv *ray_plane(struct ray *ray, csg_object *o); +struct hinterv *ray_csg_un(struct ray *ray, csg_object *o); +struct hinterv *ray_csg_isect(struct ray *ray, csg_object *o); +struct hinterv *ray_csg_sub(struct ray *ray, csg_object *o); void xform_ray(struct ray *ray, float *mat);