blob: 7bf0a6c1e6777beec55cc01f29b37274312a467d (
plain)
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
|
#pragma once
#include <glm/glm.hpp>
#include <string>
class Camera {
public:
std::string name;
glm::vec3 eye;
glm::vec3 target;
// --- Orthographic settings ---
float pixelsPerMeter;
// --- Orthographic settings ---
// ---- Perspective settings ---
/// In radians
float fov;
// ---- Perspective settings ---
bool perspective;
public:
Camera();
void SetEyePos(glm::vec3 pos);
void SetTargetPos(glm::vec3 pos);
void SetTargetDirection(glm::vec3 lookVector);
bool HasPerspective() const { return perspective; }
void SetHasPerspective(bool perspective);
glm::mat4 CalcViewMatrix() const;
glm::mat4 CalcProjectionMatrix() const;
};
|