-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCamera.h
49 lines (40 loc) · 998 Bytes
/
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
48
#pragma once
#include "EMath.h"
#include "SDL.h"
using namespace Elite;
class Camera
{
public:
Camera(const FPoint3 pos, float angleDeg);
~Camera() = default;
Camera(const Camera& other) = delete;
Camera(Camera&& other) = delete;
Camera& operator=(Camera&& other) = delete;
Camera& operator=(const Camera& other) = delete;
float GetFOV() const;
FMatrix4 GetONB();
FPoint3 GetPos() const;
float Update(float elapsedSec);
private:
FPoint3 m_Position;
FVector3 m_Forward;
FVector3 m_WorldUp;
FVector3 m_Velocity;
FMatrix4 m_ONB;
FMatrix4 m_RotM;
float m_FOV;
bool m_ShouldRotate;
int mouseX{};
int mouseY{};
float m_PitchAngle;
float m_YawAngle; // x-axis, y-axis (resp.)
void CalculateLookAt();
void MoveRight(float elapsedSec);
void MoveLeft(float elapsedSec);
void MoveForward(float elapsedSec);
void MoveBackward(float elapsedSec);
void MoveUp(float elapsedSec);
void MoveDown(float elapsedSec);
void Pitch(float elapsedSec);
void Yaw(float elapsedSec);
};