aboutsummaryrefslogtreecommitdiff
path: root/src/object.hpp
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2020-08-06 19:21:49 +0200
committerJulian T <julian@jtle.dk>2020-08-06 19:22:37 +0200
commit4348cc9581bfea05359485c5d2d074132d0271da (patch)
tree0c6d92a90ac4cf9acd326f632dcdc962ddca013a /src/object.hpp
parent893176a0b18a2281abe09def716ccc3db5583c3f (diff)
Renders scenes with a single hardcoded light and green objects
Diffstat (limited to 'src/object.hpp')
-rw-r--r--src/object.hpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/object.hpp b/src/object.hpp
index 3194dac..ac5122f 100644
--- a/src/object.hpp
+++ b/src/object.hpp
@@ -8,17 +8,15 @@
class Material {
};
-class Object {
+class Shape {
public:
void setMaterial(std::shared_ptr<Material> m);
- std::shared_ptr<Material> m_mat;
-
virtual Vec3d norm_at(const Vec3d &point, const Vec3d &indir) const = 0;
virtual double intersect(const Ray &ray, bool skip_dist) const = 0;
};
-class Sphere : Object {
+class Sphere : public Shape {
public:
Sphere(Vec3d center, double radius);
Vec3d norm_at(const Vec3d &point, const Vec3d &indir) const;
@@ -29,7 +27,7 @@ class Sphere : Object {
double m_radius;
};
-class Plane : Object {
+class Plane : public Shape {
public:
Plane(Vec3d start, Vec3d norm);
Vec3d norm_at(const Vec3d &point, const Vec3d &indir) const;