-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSceneObject.h
More file actions
55 lines (33 loc) · 1.14 KB
/
Copy pathSceneObject.h
File metadata and controls
55 lines (33 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef ___SCENEOBJECT_H___
#define ___SCENEOBJECT_H___
#include "Vec3.h"
#include "Ray.h"
#include "Shader.h"
class SceneObject
{
public:
SceneObject();
//add shader param
SceneObject(Color& c, Shader* s) : C(c), S(s) {}
//copy constructor tbd
SceneObject(SceneObject& copy) {}
//add for lambertian shader thing
Color get_color() { return C; }
//set an objects Shader* to be lambertian or other shader type
void set_shader();
Color get_shader(Ray& l, const Color& cl, Ray& cam_ray, Point3 pixel_p) const {
Vec3 norm = normal(pixel_p);
return S->eval(l, cl, cam_ray, norm);
}
virtual ~SceneObject(){}
//if use as bool -1 return value for no intersection
virtual float intersect(const Ray& r) const = 0;
//virtual bool has_intersection(const Ray& r) const = 0;
//get normal at point
virtual Vec3 normal(Point3 P) const = 0;
private:
Color C;
Shader* S;
//maybe add some sort of define for if a sceneobj gets lambertian or phong shading
};
#endif