started on the BVH build
[cyberay] / src / geom.h
index 86a6d23..2233c67 100644 (file)
@@ -17,17 +17,7 @@ struct triangle {
 };
 
 struct aabox {
-       cgm_vec3 p, r;
-};
-
-struct bvhnode {
-       struct aabox aabb;
-
-       struct triangle **faces;
-       int num_faces, max_faces;
-
-       struct bvhnode *sub;
-       int num_sub;
+       cgm_vec3 vmin, vmax;
 };
 
 struct rayhit {
@@ -39,6 +29,9 @@ struct rayhit {
 
 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);
+
+void aabox_union(struct aabox *res, struct aabox *a, struct aabox *b);
+float aabox_surf_area(struct aabox *box);
+float surf_area(float dx, float dy, float dz);
 
 #endif /* GEOM_H_ */