-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCamera.h
55 lines (44 loc) · 1.12 KB
/
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
#ifndef __CAMERA_H__
#define __CAMERA_H__
#include "Vector/Vec3.h"
#include "Vector/Helpers.h"
#include "Matrix4.h"
#include <string>
using namespace std;
class Camera
{
public:
int cameraId;
int projectionType; // 1 for perspective, 0 for orthographic
Vec3 pos;
Vec3 gaze;
Vec3 u;
Vec3 v;
Vec3 w;
double left, right, bottom, top;
double near;
double far;
int horRes;
int verRes;
string outputFileName;
Matrix4 cameraTransform;
Matrix4 projectionTransform;
Matrix4 perCamTransform;
Matrix4 viewportTransform;
Camera();
Camera(int cameraId,
int projectionType,
Vec3 pos, Vec3 gaze,
Vec3 u, Vec3 v, Vec3 w,
double left, double right, double bottom, double top,
double near, double far,
int horRes, int verRes,
string outputFileName);
Camera(const Camera &other);
void computeTransforms();
void computeCameraTransform();
void computeProjectionTransform();
void computeViewportTransform();
friend std::ostream &operator<<(std::ostream &os, const Camera &c);
};
#endif