-
Notifications
You must be signed in to change notification settings - Fork 0
/
Camera.hpp
41 lines (33 loc) · 1.17 KB
/
Camera.hpp
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
#ifndef __CAMERA__
#define __CAMERA__
#include "vfield/Direction.hpp"
#include "vfield/Coordinates.hpp"
#include "vfield/Operations.hpp"
#include "vfield/Point.hpp"
#include <math.h>
using namespace std;
//***********************************************************************
// Scene's Camera implementation
//***********************************************************************
class Camera{
private:
Direction up, left, front; // Local camera coordinate system
Point origin; // Origin point
public:
Camera();
Camera(int width, int height, Point target, float FOV, bool hfov);
Camera(Direction u, Direction l, Direction f, Point o);
void setOrigin(Point p);
void setResolution(int h, int w);
void setCoord(Direction u, Direction l, Direction f);
void setAspectRatio(int width, int height);
void setHFOV(float fov);
void setVFOV(float fov);
Direction getUp();
Direction getLeft();
Direction getFront();
Point getOrigin();
Point changeToGlobalCoordinates(Point p) const;
Direction changeToGlobalCoordinates(Direction d) const;
};
#endif