-
Notifications
You must be signed in to change notification settings - Fork 0
/
Camera.h
40 lines (32 loc) · 800 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
#pragma once
#include "Basics.h"
#include "DeviceMemoryManager.h"
#include "imgui/imgui.h"
#include <glfw3.h>
namespace MelonRenderer
{
struct CameraMatrices
{
mat4 view;
mat4 projection;
mat4 viewInverse;
mat4 projectionInverse;
};
class Camera
{
public:
bool Init(DeviceMemoryManager& memoryManager);
bool Tick(CameraMatrices& cameraMatrices);
bool Tick(GLFWwindow* glfwWindow);
VkDescriptorBufferInfo* GetCameraDescriptor();
protected:
CameraMatrices m_cameraMatrices;
const vec3 worldUp = glm::vec3(0.0f, -1.0f, 0.0f);
vec3 m_cameraPosition = vec3(33.f, 34.f, 33.f);
vec3 m_cameraDirection;
VkBuffer m_uniformBuffer;
VkDeviceMemory m_uniformBufferMemory;
VkDescriptorBufferInfo m_uniformBufferDescriptor;
DeviceMemoryManager* m_memoryManager;
};
}