-
Notifications
You must be signed in to change notification settings - Fork 1
/
Geometry.h
62 lines (56 loc) · 1.74 KB
/
Geometry.h
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
56
57
58
59
60
61
62
#include "Ray.h"
#include "mat.h"
#include <string>
#include <fstream>
using namespace std;
class Geometry{
public:
virtual bool colision(Ray r, double &t, vec3 &normal);
virtual bool colision(Ray r) const=0;
virtual void setTexture(string filename);
virtual vec3 getColor() const=0;
virtual double getAmbient() const=0;
virtual double getDiffuse() const=0;
virtual double getSpecular() const=0;
virtual double getCosPower() const=0;
virtual double getReflectance()const=0;
virtual double getTransmitance()const=0;
virtual void printSize() const=0;
virtual void printType() const=0;
virtual void setTransform(double sx, double sy, double sz, double tx, double ty, double tz, double rx, double ry, double rz);
virtual void setProperties(int t, double r, double g, double b, double ka, double kd, double ks, double n_s, double refl, double trans, double index);
virtual Ray transform(Ray ray)const;
};
bool Geometry::colision(Ray r, double &t, vec3 &normal){
return false;
}
void Geometry::setTexture(string filename){
}
vec3 Geometry::getColor() const{
return vec3(0,0,0);
}
double Geometry::getAmbient() const{
return -1.0;
}
double Geometry::getDiffuse() const{
return -1.0;
}
double Geometry::getSpecular() const{
return -1.0;
}
double Geometry::getCosPower() const{
return -1;
}
double Geometry::getReflectance()const{
return -1;
}
double Geometry::getTransmitance()const{
return -1;
}
void Geometry::setTransform(double sx, double sy, double sz, double tx, double ty, double tz, double rx, double ry, double rz){
}
void Geometry::setProperties(int t, double r, double g, double b, double ka, double kd, double ks, double n_s, double refl, double trans, double index){
}
Ray Geometry::transform(Ray ray)const{
return ray;
}