-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCamera.h
41 lines (30 loc) · 1.08 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
#ifndef MIMEMA_CAMERA_H
#define MIMEMA_CAMERA_H
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/mat4x4.hpp>
#include <glm/gtx/transform.hpp>
#include <glm/gtx/string_cast.hpp>
#include "tracy/Tracy.hpp"
namespace Mimema {
struct Camera {
struct CameraState {
// View Matrix
glm::vec3 cameraPosition = {0, 10, 0};
glm::vec3 cameraTarget = {0, 10, -1};
glm::vec3 upVec = {0, 1, 0};
// Projection Matrix
float fov = 70;
float nearClippingPlane = 1.0f;
float farClippingPlane = 1000.0f;
float aspectRatio = 1;
CameraState() = default;
CameraState(const glm::vec3& cameraPosition, const glm::vec3& cameraTarget, const glm::vec3& upVec,
float fov, float nearClippingPlane, float farClippingPlane, float aspectRatio);
CameraState operator*(float alpha) const;
CameraState operator+(const CameraState& rhs) const;
};
CameraState cameraState;
explicit Camera(CameraState cameraState);
};
}
#endif