- load rudimentary level file
[cyberay] / src / geom.h
index 86a6d23..50784a4 100644 (file)
@@ -17,15 +17,16 @@ struct triangle {
 };
 
 struct aabox {
-       cgm_vec3 p, r;
+       cgm_vec3 vmin, vmax;
 };
 
 struct bvhnode {
        struct aabox aabb;
 
-       struct triangle **faces;
-       int num_faces, max_faces;
+       struct triangle *faces;
+       int num_faces;
 
+       struct bvhnode *next;
        struct bvhnode *sub;
        int num_sub;
 };
@@ -37,6 +38,8 @@ struct rayhit {
        struct material *mtl;
 };
 
+void free_bvh_tree(struct bvhnode *tree);
+
 int ray_triangle(cgm_ray *ray, struct triangle *tri, float tmax, struct rayhit *hit);
 int ray_aabox_any(cgm_ray *ray, struct aabox *box, float tmax);
 int ray_bvhnode(cgm_ray *ray, struct bvhnode *bn, float tmax, struct rayhit *hit);