From 4193adbbff4a5b633f59f88367fe1b74aec7789b Mon Sep 17 00:00:00 2001 From: Keuin Date: Fri, 15 Apr 2022 12:32:42 +0800 Subject: Code Refactor: - Add material class. - Move diffuse routine into separate material classes. --- object.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'object.h') diff --git a/object.h b/object.h index b6e2bbd..26548c5 100644 --- a/object.h +++ b/object.h @@ -5,12 +5,10 @@ #ifndef RT_OBJECT_H #define RT_OBJECT_H -#include "hitlist.h" -#include "viewport.h" -#include "timer.h" -#include "bitmap.h" +#include "material.h" #include "ray.h" #include "vec.h" +#include "bitmap.h" #include #include #include @@ -18,6 +16,8 @@ #include #include +class material; + class object { public: // Will the given ray hit. Returns time t if hits in range [t1, t2]. @@ -36,6 +36,10 @@ public: // subclasses must have virtual destructors virtual ~object() = default; + + // Get this object's material. + virtual material &material() const = 0; }; + #endif //RT_OBJECT_H -- cgit v1.2.3