-
Notifications
You must be signed in to change notification settings - Fork 0
/
camera.h
53 lines (42 loc) · 913 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
52
#ifndef CAMERA_H
#define CAMERA_H
#include <glm.hpp>
#include <gtc/type_ptr.hpp>
#include <gtc/matrix_transform.hpp>
typedef struct cameraMovementDirection
{
bool Forward;
bool Backward;
bool Left;
bool Right;
bool Up;
bool Down;
}CameraMovementDirection;
extern CameraMovementDirection direction;
class Camera
{
public:
glm::vec3 Position;
glm::vec3 Front;
glm::vec3 Up;
glm::vec3 Right;
glm::vec3 WorldUp;
bool movement;
bool mouse_movement;
bool zooming;
Camera(bool mov, bool mos_mov, bool zoom);
Camera();
glm::mat4 GetViewMatrix();
glm::mat4 GetPerspectiveMatrix(float aspect, float near_plane, float far_plane);
void ProcessMouseScroll(float yoffset);
void ProcessMouseMovement(float xoffset, float yoffset);
void ProcessKeyboard(float deltaTime);
void updateCamera();
private:
float Yaw;
float Pitch;
float MovmentSpeed;
float MouseSensitivity;
float Zoom;
};
#endif