forked from oliyam/3d-stuff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcamera.h
51 lines (43 loc) · 822 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
#pragma once
//camera object ... lol
class camera {
private:
vec3 position;
vec3 rotation;
double focal_length;
float viewfield_x = 16;
float viewfield_y = 9;
string name;
public:
//axes (x,y,z)
vec3 axes[3] = { vec3(1,0,0), vec3(0,1,0), vec3(0,0,1) };
camera()
{
position = vec3(0,0,10);
focal_length = 1;
}
camera(vec3 pos, vec3 rot, double d)
{
position = pos;
rotation = rot;
focal_length = d;
}
//getters
vec3 getPos()
{return position;}
vec3 getRot()
{return rotation;}
double getFocus()
{return focal_length;}
float getViewX()
{return viewfield_x;}
float getViewY()
{return viewfield_y;}
//setters
void setPos(vec3 pos)
{position = pos;}
void setRot(vec3 rot)
{rotation = rot;}
void setFocus(double d)
{focal_length = d;}
};