-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcamera.h
47 lines (41 loc) · 1.35 KB
/
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
#ifndef CAMERA_CLASS_H
#define CAMERA_CLASS_H
//#include<glad/glad.h>
//#include<GLFW/glfw3.h>
#include<glm/glm.hpp>
#include<glm/gtc/matrix_transform.hpp>
#include<glm/gtc/type_ptr.hpp>
#include<glm/gtx/rotate_vector.hpp>
#include<glm/gtx/vector_angle.hpp>
#include <gl/glew.h>
#include"shaderClass.h"
#include <QVector3D>
#include <QVector3D>
#include <QVector3D>
#include <QMatrix4x4>
class Camera
{
public:
// Stores the main vectors of the camera
/*glm::vec3*/QVector3D Position;
/*glm::vec3*/QVector3D Orientation ;// = glm::vec3(0.0f, 0.0f, -1.0f);
/*glm::vec3*/QVector3D Up;// = glm::vec3(0.0f, 1.0f, 0.0f);
/*glm::mat4*/QMatrix4x4 cameraMatrix;// = glm::mat4(1.0f);
// Prevents the camera from jumping around when first clicking left click
bool firstClick = true;
// Stores the width and height of the window
int width;
int height;
// Adjust the speed of the camera and it's sensitivity when looking around
float speed = 0.1f;
float sensitivity = 100.0f;
// Camera constructor to set up initial values
Camera(int width, int height, QVector3D/*glm::vec3*/ position);
// Updates the camera matrix to the Vertex Shader
void updateMatrix(float FOVdeg, float nearPlane, float farPlane);
// Exports the camera matrix to a shader
void Matrix(Shader& shader, const char* uniform);
// Handles camera inputs
//void Inputs(GLFWwindow* window);
};
#endif