aboutsummaryrefslogtreecommitdiffstats
path: root/include/sphere.hpp
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2021-03-29 22:25:29 +0200
committerladevieq <ladevie.quentin@gmail.com>2021-03-29 22:25:29 +0200
commitbe5f1133bff5d4c551e2702211acb155d8819fd0 (patch)
treebfd575657188b3ceb3b70dd0225c740035c98e99 /include/sphere.hpp
parentbc1073a020c99ed89967a6b00a9eeb4ab2e160dc (diff)
BVH simple implementation
Diffstat (limited to 'include/sphere.hpp')
-rw-r--r--include/sphere.hpp10
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];
};