From be5f1133bff5d4c551e2702211acb155d8819fd0 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Mon, 29 Mar 2021 22:25:29 +0200 Subject: BVH simple implementation --- include/sphere.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include/sphere.hpp') 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]; }; -- cgit v1.3