summaryrefslogtreecommitdiff
path: root/object.h
diff options
context:
space:
mode:
authorKeuin <[email protected]>2022-04-15 12:32:42 +0800
committerKeuin <[email protected]>2022-04-15 12:32:42 +0800
commit4193adbbff4a5b633f59f88367fe1b74aec7789b (patch)
tree25056ac9e028e268193615724dda8c3ac12317d0 /object.h
parent2ed39ad4eb9ebf64768dbf4aeefafc5ebb072ca7 (diff)
Code Refactor:
- Add material class. - Move diffuse routine into separate material classes.
Diffstat (limited to 'object.h')
-rw-r--r--object.h12
1 files changed, 8 insertions, 4 deletions
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 <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