25 lines
484 B
C++
25 lines
484 B
C++
#ifndef BOX_H
|
|
#define BOX_H
|
|
|
|
#include "vec3.h"
|
|
#include "hittable.h"
|
|
#include "hittable_list.h"
|
|
|
|
class Box : public Hittable {
|
|
public:
|
|
Box() {}
|
|
|
|
Box(const Point3& p0, const Point3& p1, std::shared_ptr<Material> ptr);
|
|
|
|
virtual bool hit(const Ray& r, double t0, double t1, hit_record& rec) const;
|
|
|
|
virtual bool bounding_box(double t0, double t1, Aabb& output_box) const;
|
|
|
|
private:
|
|
Point3 box_min;
|
|
Point3 box_max;
|
|
Hittable_list sides;
|
|
};
|
|
|
|
#endif // BOX_H
|