-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcamera.h
55 lines (40 loc) · 1012 Bytes
/
camera.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
/*
* File: camera.h
* Author: Shubham
*
* The camera to raytrace a scene
*
* Created on January 29, 2015, 12:44 AM
*/
#ifndef CAMERA_H
#define CAMERA_H
#include "ray.h"
#include <vector>
using namespace std;
/*
* Renders the field. Handles the actual raymarching, yields an array of colours.
* Hopefully will eventually be parallelized on the GPU
*/
class Camera {
private:
int width, height;
Vector3f h_dir, v_dir;
vector<Vector4f> colors;
Vector4f getDir(float, float);
void renderPixel(int, int);
Vector4f trace(ray_t, int d);
void setColor(int, int, const Vector4f&);
void write();
public:
int nSteps;
int maxBounces;
float near, left, right, top, bottom;
float step_disance;
Vector4f background, ambient;
Vector3f up;
string out;
Vector3f pos, dir;
void resln(int, int);
void render();
};
#endif /* CAMERA_H */