diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2021-03-29 22:25:29 +0200 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2021-03-29 22:25:29 +0200 |
| commit | be5f1133bff5d4c551e2702211acb155d8819fd0 (patch) | |
| tree | bfd575657188b3ceb3b70dd0225c740035c98e99 /include/sphere.hpp | |
| parent | bc1073a020c99ed89967a6b00a9eeb4ab2e160dc (diff) | |
BVH simple implementation
Diffstat (limited to 'include/sphere.hpp')
| -rw-r--r-- | include/sphere.hpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/sphere.hpp b/include/sphere.hpp index a338f2e..28bb0bc 100644 --- a/include/sphere.hpp +++ b/include/sphere.hpp @@ -1,16 +1,22 @@ #ifndef __SPHERE_HPP_ #define __SPHERE_HPP_ +#include "aabb.hpp" #include "material.hpp" -struct sphere{ +struct sphere { sphere() = default; - sphere(point3 center, material material, float radius); + sphere(point3 center, material material, float radius) + : center(center), radius(radius), mat(material), + bounding_box(center, radius) + {} point3 center; material mat; + aabb bounding_box; + float radius; float padding[3]; }; |
