-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsphere.h
43 lines (40 loc) · 1.38 KB
/
sphere.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
#ifndef SPHERE_H_INCLUDED
#define SPHERE_H_INCLUDED
#include "ray.h"
#include "light.h"
#include <list>
#include "types.h"
class Ray;
class Sphere
{
private:
coord_t center;
float radius;
float reflection_fact;
float non_ambient_fact;
rgb_value_t colour;
bool is_glass;
float brechzahl;
rgb_value_t shade_non_reflective(Ray* ray, Light* light, std::list<Sphere*>* sphereList, coord_t* point);
rgb_value_t shade_reflective(Ray* ray, Light* light, std::list<Sphere*>* sphereList, coord_t* point, int ref_cnt);
rgb_value_t shade_glass(Ray* ray, Light* light, std::list<Sphere*>* sphereList, coord_t* point, int ref_cnt);
public:
Sphere(coord_t* center_coord, float* rad, float* ref_fact, rgb_value_t* col, float* nonamb_fact, bool glass, float* bz);
~Sphere(){}
void setCenter(coord_t* coord);
void setRadius(float* rad);
void setReflectionFactor(float* fact);
void setNonAmbientFactor(float* fact);
void setColour(rgb_value_t* col);
void setGlass(bool glass);
bool getGlass();
void setBrechzahl(float* num);
float getBrechzahl();
coord_t getCenter();
float getRadius();
rgb_value_t getColour();
float getReflectionFactor();
bool intersectsWithRay(Ray* ray, float* t);
rgb_value_t shade(Ray* ray, Light* light, std::list<Sphere*>* sphereList, coord_t* point, int ref_cnt);
};
#endif // SPHERE_H_INCLUDED