-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCamera.h
More file actions
55 lines (39 loc) · 1.08 KB
/
Camera.h
File metadata and controls
55 lines (39 loc) · 1.08 KB
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
///////////////////////
// Camera class based on samples from learnopengl.com
#include "common.h"
#include "LiteMath.h"
using namespace LiteMath;
enum Movement_Direction
{
FORWARD,
BACKWARD,
LEFT,
RIGHT
};
class Camera
{
public:
float3 pos;
float3 front;
float3 up;
float3 right;
GLfloat yaw;
GLfloat pitch;
GLfloat moveSpeed;
GLfloat mouseSensitivity;
GLfloat zoom;
Camera(float3 a_pos = float3(0.0f, 0.0f, 0.0f), float3 a_up = float3(0.0f, 1.0f, 0.0f),
float3 a_front = float3(0.0f, 0.0f, -1.0f), GLfloat a_yaw = -90.0f, GLfloat a_pitch = 0.0f,
GLfloat a_moveSpeed = 10.0f, GLfloat a_mouseSensitivity = 0.1f, GLfloat a_zoom = 45.0f);
virtual ~Camera() {};
float4x4 GetViewMatrix() const;
void ProcessKeyboard(Movement_Direction dir, GLfloat deltaTime);
void ProcessMouseMove(GLfloat deltaX, GLfloat deltaY, GLboolean limitPitch = true);
void ProcessMouseScroll(GLfloat deltaY);
private:
void updateCameraVectors();
float3 worldUp;
};
#endif