From c7c4f8f82c66cfe89b72d176ee51dab8bd30dc95 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Sun, 20 Dec 2020 21:59:33 +0100 Subject: Add hittable interface and hit infos on hit --- include/sphere.hpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 include/sphere.hpp (limited to 'include/sphere.hpp') diff --git a/include/sphere.hpp b/include/sphere.hpp new file mode 100644 index 0000000..5bf0ab9 --- /dev/null +++ b/include/sphere.hpp @@ -0,0 +1,16 @@ +#ifndef __SPHERE_HPP_ +#define __SPHERE_HPP_ + +#include "hittable.hpp" + +class sphere : public hittable { + public: + sphere(point3 center, double radius = 1.0); + + virtual bool hit(const ray& r, double t_min, double t_max, struct hit_info& info) const; + + point3 center; + double radius; +}; + +#endif // !__SPHERE_HPP_ -- cgit v1.3