2025-04-26 23:05:11 +02:00
|
|
|
module;
|
|
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
#define GLM_FORCE_RADIANS
|
|
|
|
|
#define GLM_FORCE_DEPTH_ZERO_TO_ONE
|
|
|
|
|
#define GLM_ENABLE_EXPERIMENTAL
|
|
|
|
|
#include <glm/glm.hpp>
|
|
|
|
|
#include <glm/gtc/matrix_transform.hpp>
|
|
|
|
|
#include <glm/gtc/matrix_inverse.hpp>
|
|
|
|
|
#include <glm/gtc/type_ptr.hpp>
|
|
|
|
|
#include "VulkanBuffer.h"
|
|
|
|
|
#include "camera.hpp"
|
|
|
|
|
#include <vulkan/vulkan.h>
|
|
|
|
|
|
|
|
|
|
module Crafter.Graphics;
|
|
|
|
|
using namespace Crafter;
|
|
|
|
|
|
2025-04-27 22:16:56 +02:00
|
|
|
Camera::Camera() {
|
2025-04-26 23:05:11 +02:00
|
|
|
old::Camera camera;
|
2025-05-03 06:51:33 +02:00
|
|
|
camera.type = old::Camera::CameraType::firstperson;
|
|
|
|
|
camera.setPerspective(90.0f, 16 / 9, 0.1f, 512.0f);
|
|
|
|
|
camera.setRotation(glm::vec3(180.0f, 150, 0));
|
|
|
|
|
camera.setTranslation(glm::vec3(-100.0f, -130.0f, -100.0f));
|
2025-04-26 23:05:11 +02:00
|
|
|
|
2025-04-27 22:16:56 +02:00
|
|
|
projectionView = camera.matrices.perspective*camera.matrices.view;
|
2025-04-26 23:05:11 +02:00
|
|
|
}
|