-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcamera.h
More file actions
32 lines (24 loc) · 674 Bytes
/
camera.h
File metadata and controls
32 lines (24 loc) · 674 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
#pragma once
#include <glm/glm.hpp>
struct GLFWwindow;
class Camera
{
public:
Camera(glm::vec3 position = glm::vec3(0.0f, 0.0f, 3.0f));
glm::mat4 getViewMatrix() const;
void processInput(GLFWwindow* window, float deltaTime);
void processMouseMovement(float xoffset, float yoffset, bool constrainPitch = true);
glm::vec3 getPosition() const { return position; }
glm::vec3 getFront() const { return front; }
private:
glm::vec3 position;
glm::vec3 front;
glm::vec3 up;
glm::vec3 right;
glm::vec3 worldUp;
float yaw;
float pitch;
float movementSpeed;
float mouseSensitivity;
void updateCameraVectors();
};