toytracer/bvh.h
2020-06-08 23:37:10 +02:00

24 lines
530 B
C++

#ifndef BVH_H
#define BVH_H
#include "hittable.h"
class Bvh_node : public Hittable {
public:
Bvh_node();
Bvh_node(
std::vector<std::shared_ptr<Hittable>>& objects,
int start, int end, double time0, double time1);
virtual bool hit(const Ray&, double tmin, double tmax, hit_record& rec) const;
virtual bool bounding_box(double t0, double t1, Aabb& output_box) const;
private:
std::shared_ptr<Hittable> left;
std::shared_ptr<Hittable> right;
Aabb box;
};
#endif // BVH_H