diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2021-01-09 20:42:24 +0100 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2021-01-09 20:43:09 +0100 |
| commit | 2db0d27e7f1744443958717c19b732eed57455f2 (patch) | |
| tree | 839b8ea513c8c239f015071ab083bd50f03854a5 /src/hittable_list.cpp | |
| parent | 4379b46b46563c5a709df8d567ef75affc3fd31c (diff) | |
Replace old classes with compute shader structs
Diffstat (limited to 'src/hittable_list.cpp')
| -rw-r--r-- | src/hittable_list.cpp | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/hittable_list.cpp b/src/hittable_list.cpp deleted file mode 100644 index 9140304..0000000 --- a/src/hittable_list.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include "hittable_list.hpp" - -hittable_list::hittable_list() {}; - -void hittable_list::add(std::shared_ptr<hittable> hittable) { - hittables.push_back(hittable); -} - -void hittable_list::clear() { - hittables.clear(); -} - - -bool hittable_list::hit(const ray& r, double t_min, double t_max, struct hit_info& info) const { - struct hit_info temp_info; - bool hit_anything = false; - double closest_hit = t_max; - - for (auto& hittable: hittables) { - if (hittable->hit(r, t_min, closest_hit, temp_info)) { - hit_anything = true; - closest_hit = temp_info.t; - info = temp_info; - } - } - - return hit_anything; -} |
