aboutsummaryrefslogtreecommitdiffstats
path: root/include/sphere.hpp
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2020-12-20 21:59:33 +0100
committerladevieq <ladevie.quentin@gmail.com>2020-12-20 21:59:33 +0100
commitc7c4f8f82c66cfe89b72d176ee51dab8bd30dc95 (patch)
treed0c2caeccda953d86806cb7c7b27c8941e0ef845 /include/sphere.hpp
parentfc601fd503ec1ebd08e4daffeb9aa0812aff2b71 (diff)
Add hittable interface and hit infos on hit
Diffstat (limited to 'include/sphere.hpp')
-rw-r--r--include/sphere.hpp16
1 files changed, 16 insertions, 0 deletions
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_