10 struct triangle *faces;
11 int num_faces, max_faces;
13 struct bvhnode *left, *right;
16 /* build_bvh* needs to be called with a pointer to a single-node tree,
17 * containing all the faces, left/right as null, and a pre-computed aabb
19 int build_bvh_sah(struct bvhnode *tree);
20 void free_bvh_tree(struct bvhnode *tree);
22 int ray_bvhnode(cgm_ray *ray, struct bvhnode *bn, float tmax, struct rayhit *hit);