-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCamera.h
More file actions
34 lines (29 loc) · 661 Bytes
/
Copy pathCamera.h
File metadata and controls
34 lines (29 loc) · 661 Bytes
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
#ifndef CAMERA_H
#define CAMERA_H
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
enum Movement {
Left,
Right,
Forward,
Backward
};
class Camera {
public:
Camera(const glm::vec3 &position, int screenWidth, int screenHeight);
void move(Movement direction, float speed);
void rotate(float xOffset, float yOffset);
glm::mat4 view() const;
glm::mat4 projection() const;
glm::vec3 position() const;
private:
glm::mat4 m_projection;
glm::mat4 m_view;
glm::vec3 m_position;
glm::vec3 m_front;
float m_yaw;
float m_pitch;
};
#endif