-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCamera.h
More file actions
68 lines (53 loc) · 1.56 KB
/
Copy pathCamera.h
File metadata and controls
68 lines (53 loc) · 1.56 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef CAMERA_CLASS_H
#define CAMERA_CLASS_H
#define GLM_ENABLE_EXPERIMENTAL
#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 "shaderClass.h"
#include "BoxCollider.h"
//honestly this is shaping more out to be a player than a camera ;-;
class Camera
{
public:
glm::vec3 Position;
glm::vec3 Orientation = glm::vec3(0.0f, 0.0f, -1.0f);
glm::vec3 Up = glm::vec3(0.0f, 1.0f, 0.0f);
glm::mat4 cameraMatrix = glm::mat4(1.0f);
//controls
bool firstClick = false;
bool wasMouseClicked = false;
bool firstSpace = false;
bool wasSpaceClicked = false;
bool alreadyJumped = false;
//Tilt
float currentTilt = 0.0f;
float targetTilt = 0.0f;
float tiltAmount = 0.05f;
float tiltSpeed = 5.0f;
// jif peanut butter movement
glm::vec3 moveVelocity = glm::vec3(0.0f);
float moveAcceleration = 150.0f;
float moveFriction = 6.0f;
float maxMoveSpeed = 35.0f;
//controls
int width;
int height;
float sensitivity = 300.0f;
//this is for gravity
float Acceleration = 40.0f;
float JumpVelocity = 18.0f;
float Velocity = 0.0f;
float maxVelocity = 200.0f;
Camera(int width, int height, glm::vec3 position);
void RigidBody(float deltaTime);
void Matrix(Shader& shader, const char* uniform);
void updateMatrix(float FOVdeg, float nearPlane, float farPlane);
void Inputs(GLFWwindow* window, float deltaTime);
void CollisionPush(BoxCollider* collider);
};
#endif