-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCamera.h
45 lines (30 loc) · 971 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
#ifndef LEARNINGOPENGL_CAMERA_H
#define LEARNINGOPENGL_CAMERA_H
#include <glm/glm.hpp>
class Camera {
public:
Camera(glm::vec3 globalUpDirection, glm::vec3 position);
[[nodiscard]] glm::mat4 getViewMatrix() const;
[[nodiscard]] glm::mat4 getProjectionMatrix() const;
void processKeyboardInput(const glm::vec3 &axes, float deltaTime);
void processMouseInput(const glm::vec2 &offset);
void processMouseScroll(float offset);
void updateAspectRatio(int width, int height);
void reset();
void setMovementSpeed(float speed);
void setMouseSensitivity(float sensitivity);
const glm::vec3 globalUpDirection;
glm::vec3 position;
glm::vec3 frontDirection;
private:
void updateVectors();
glm::vec3 rightDirection;
glm::vec3 upDirection;
float yaw;
float pitch;
float aspectRatio;
float fieldOfView;
float movementSpeed;
float mouseSensitivity;
};
#endif //LEARNINGOPENGL_CAMERA_H