-
Notifications
You must be signed in to change notification settings - Fork 2
/
Camera.h
50 lines (37 loc) · 1.49 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
////////////////////////////////////////
// Camera.h
////////////////////////////////////////
#pragma once
#include "main.h"
////////////////////////////////////////////////////////////////////////////////
// The Camera class provides a simple means to controlling the 3D camera. It could
// be extended to support more interactive controls. Ultimately. the camera sets the
// GL projection and viewing matrices.
class Camera {
public:
Camera();
void Update();
void Reset();
// Access functions
void SetAspect(float a) {Aspect=a;}
void SetDistance(float d) {Distance=d;}
void SetAzimuth(float a) {Azimuth=a;}
void SetIncline(float i) {Incline=i;}
float GetDistance() {return Distance;}
float GetAzimuth() {return Azimuth;}
float GetIncline() {return Incline;}
const glm::mat4 &GetViewProjectMtx() {return ViewProjectMtx;}
private:
// Perspective controls
float FOV; // Field of View Angle (degrees)
float Aspect; // Aspect Ratio
float NearClip; // Near clipping plane distance
float FarClip; // Far clipping plane distance
// Polar controls
float Distance; // Distance of the camera eye position to the origin (meters)
float Azimuth; // Rotation of the camera eye position around the Y axis (degrees)
float Incline; // Angle of the camera eye position over the XZ plane (degrees)
// Computed data
glm::mat4 ViewProjectMtx;
};
////////////////////////////////////////////////////////////////////////////////