-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSurface.h
More file actions
52 lines (33 loc) · 1.16 KB
/
Copy pathSurface.h
File metadata and controls
52 lines (33 loc) · 1.16 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
//
// Created by Jiang Kairong on 3/7/18.
//
#ifndef PROG03_INLINEBOOL_SURFACE_H
#define PROG03_INLINEBOOL_SURFACE_H
#include "Matrix.h"
#include "Ray.h"
#include "Color.h"
struct IntersectionInfo;
class Surface {
public:
const ColorRGB32f &getColorAmbient() const;
void setColorAmbient(const ColorRGB32f &colorAmbient);
const ColorRGB32f &getColorDiffuse() const;
void setColorDiffuse(const ColorRGB32f &colorDiffuse);
const ColorRGB32f &getColorSpecular() const;
void setColorSpecular(const ColorRGB32f &colorSpecular);
double getPhongExponent() const;
void setPhongExponent(double phongExponent);
Surface(const ColorRGB32f &colorAmbient, const ColorRGB32f &colorDiffuse, const ColorRGB32f &colorSpecular,
double phongExponent);
virtual bool intersect(const Ray& ray, IntersectionInfo& info) = 0;
bool updateIntersectInfo(IntersectionInfo& info, const Ray& ray, double t);
protected:
ColorRGB32f colorAmbient, colorDiffuse, colorSpecular;
double phongExponent;
};
struct IntersectionInfo {
Surface* hitObject = nullptr;
Vector3d hitPoint = Vector3d();
Vector3d hitNormal = Vector3d();
};
#endif //PROG03_INLINEBOOL_SURFACE_H