2025-04-26 23:05:11 +02:00
|
|
|
module;
|
|
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
#include "VulkanBuffer.h"
|
|
|
|
|
#include <vulkan/vulkan.h>
|
2025-05-05 05:14:47 +02:00
|
|
|
#include <iostream>
|
|
|
|
|
#include <format>
|
2025-04-26 23:05:11 +02:00
|
|
|
|
|
|
|
|
module Crafter.Graphics;
|
2025-05-04 05:15:31 +02:00
|
|
|
import Crafter.Math;
|
2025-05-05 06:00:35 +02:00
|
|
|
import Crafter.Event;
|
2025-04-26 23:05:11 +02:00
|
|
|
using namespace Crafter;
|
|
|
|
|
|
2025-05-04 05:15:31 +02:00
|
|
|
Camera::Camera(float fov, float aspectRatio, float near, float far) {
|
2025-05-05 05:14:47 +02:00
|
|
|
projection = MatrixRowMajor<float, 4, 4, 1>::Perspective(fov, aspectRatio, near, far);
|
2025-05-05 06:00:35 +02:00
|
|
|
view = MatrixRowMajor<float, 4, 4, 1>::Identity();
|
2025-05-05 05:14:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Camera::Update() {
|
|
|
|
|
projectionView = projection*view;
|
2025-05-05 06:00:35 +02:00
|
|
|
onUpdate.Invoke();
|
2025-04-26 23:05:11 +02:00
|
|
|
}
|