diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2020-12-20 21:59:33 +0100 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2020-12-20 21:59:33 +0100 |
| commit | c7c4f8f82c66cfe89b72d176ee51dab8bd30dc95 (patch) | |
| tree | d0c2caeccda953d86806cb7c7b27c8941e0ef845 /include/hittable_list.hpp | |
| parent | fc601fd503ec1ebd08e4daffeb9aa0812aff2b71 (diff) | |
Add hittable interface and hit infos on hit
Diffstat (limited to 'include/hittable_list.hpp')
| -rw-r--r-- | include/hittable_list.hpp | 21 |
1 files changed, 21 insertions, 0 deletions
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 <vector> +#include <memory> + +#include "hittable.hpp" + +class hittable_list : public hittable { + public: + hittable_list(); + + void add(std::shared_ptr<hittable> hittable); + void clear(); + + virtual bool hit(const ray&r, double t_min, double t_max, struct hit_info& info) const; + + std::vector<std::shared_ptr<hittable>> hittables; +}; + +#endif // !__HITTABLE_LIST_HPP_ |
