-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrtraytracer.h
44 lines (30 loc) · 968 Bytes
/
rtraytracer.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
#ifndef RTRAYTRACER_H
#define RTRAYTRACER_H
#include "rtcolor.h"
#include "rtray.h"
#include "rtscene.h"
#include "rtlight.h"
#include "rtcamera.h"
class RTRayTracer
{
public:
RTRayTracer();
/**
* @brief traceRay
* @param ray
* @param depth
* @return
*/
RTColor traceRay(RTRay& ray, int depth, RTLight light);
RTScene getScene() const;
void setScene(const RTScene &value);
private:
RTScene scene;
RTColor shading(RTObject *obj, RTVector &hit, RTLight light);
bool shadowTest(RTRay shadowRay, double distLight, RTObject *hitObject);
RTRay genReflectionRay(RTVector d, RTVector n, RTVector closestPoint);
RTRay genRefractRay(RTVector d, RTVector normal, RTVector closestPoint, double refractionIndex, bool isInside);
RTColor getFragmentColor(RTObject* obj, RTVector hit);
double FresnelTerm(RTVector d, RTVector normal, double indexRefrac, bool isInside);
};
#endif // RTRAYTRACER_H