-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCamera.h
47 lines (36 loc) · 937 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
/* THE CAMERA FILE - DEFINES A CAMERA DIRECTION AND POSITON IN A RAYTRACER */
#ifndef _Camera_H
#define _Camera_H
//Includes
#include "Vect.h"
//The Camera class
class Camera {
//campos - The camera position
//camdir - The dirextion the camera is facing
//camright, camdown - Used in camera ray calculations
Vect campos, camdir, camright, camdown;
public:
//Constructor functions
Camera ();
Camera (Vect, Vect, Vect, Vect);
//Method functions
//Getters
Vect getCameraPosition () { return campos; }
Vect getCameraDirection () { return camdir; }
Vect getCameraRight () { return camright; }
Vect getCameraDown () { return camdown; }
};
//Sets the default camera
Camera::Camera () {
campos = Vect(0,0,0);
camdir = Vect(0,0,1);
camright = Vect(0,0,0);
camdown = Vect(0,0,0);
}
Camera::Camera (Vect pos, Vect dir, Vect right, Vect down) {
campos = pos;
camdir = dir;
camright = right;
camdown = down;
}
#endif