diff options
author | Keuin <[email protected]> | 2022-04-15 12:32:42 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2022-04-15 12:32:42 +0800 |
commit | 4193adbbff4a5b633f59f88367fe1b74aec7789b (patch) | |
tree | 25056ac9e028e268193615724dda8c3ac12317d0 /object.h | |
parent | 2ed39ad4eb9ebf64768dbf4aeefafc5ebb072ca7 (diff) |
Code Refactor:
- Add material class.
- Move diffuse routine into separate material classes.
Diffstat (limited to 'object.h')
-rw-r--r-- | object.h | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -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 <cstdlib> #include <memory> #include <limits> @@ -18,6 +16,8 @@ #include <iostream> #include <cstdint> +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 |