X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fgeom.h;h=50784a4bcc0281252dafa93fa43357d3ab1a5688;hb=44dd42b26168034afe1763e0490111be3e7025f5;hp=86a6d230c00980d0b98225fc4b3e2d5788ca0d6c;hpb=5caf9953c6c26f649087189222b1359da85d306e;p=cyberay diff --git a/src/geom.h b/src/geom.h index 86a6d23..50784a4 100644 --- a/src/geom.h +++ b/src/geom.h @@ -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);