-
Notifications
You must be signed in to change notification settings - Fork 0
/
CameraBehaviors.hpp
60 lines (39 loc) · 1.11 KB
/
CameraBehaviors.hpp
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
#ifndef __CAMERA_BEHAVIORS_HPP__
#define __CAMERA_BEHAVIORS_HPP__
#include "Camera.hpp"
class StationaryCamera : public Camera {
public:
StationaryCamera(glm::vec3 position);
virtual void Update(float deltaTime) override;
void LookAt(glm::vec3 lookAt, glm::vec3 up = {0.0,1.0,0.0});
};
class HelicopterCamera : public Camera {
float currentAngle;
float radius;
float speed;
public:
HelicopterCamera(float height, float radius, float speed, float focusHeight = 0);
virtual void Update(float deltaTime) override;
};
class FirstPersonCamera : public Camera {
float movementSpeed;
float rotationSpeed;
int input = 0;
glm::vec3 eulerAngles;
glm::vec3 startPos, startEulers;
public:
FirstPersonCamera(glm::vec3 position, float movementSpeed, float rotationSpeed);
virtual void Update(float deltaTime) override;
enum class Input : int {
MoveForward = 1 << 0,
MoveBackward = 1 << 1,
LookUp = 1 << 2,
LookDown = 1 << 3,
LookLeft = 1 << 4,
LookRight = 1 << 5
};
void PressedButton(Input button);
void ReleasedButton(Input button);
void Reset();
};
#endif