From c7c4f8f82c66cfe89b72d176ee51dab8bd30dc95 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Sun, 20 Dec 2020 21:59:33 +0100 Subject: Add hittable interface and hit infos on hit --- include/hittable_list.hpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 include/hittable_list.hpp (limited to 'include/hittable_list.hpp') diff --git a/include/hittable_list.hpp b/include/hittable_list.hpp new file mode 100644 index 0000000..41d8f4a --- /dev/null +++ b/include/hittable_list.hpp @@ -0,0 +1,21 @@ +#ifndef __HITTABLE_LIST_HPP_ +#define __HITTABLE_LIST_HPP_ + +#include +#include + +#include "hittable.hpp" + +class hittable_list : public hittable { + public: + hittable_list(); + + void add(std::shared_ptr hittable); + void clear(); + + virtual bool hit(const ray&r, double t_min, double t_max, struct hit_info& info) const; + + std::vector> hittables; +}; + +#endif // !__HITTABLE_LIST_HPP_ -- cgit v1.3