From 00370c21f107ff2a320fbdef170e24a8b5cda92a Mon Sep 17 00:00:00 2001 From: vimene Date: Wed, 24 Dec 2025 01:38:45 +0100 Subject: added uniform buffers, small tweaks - fixed aspect ratio being the inverse of what it's supposed to be - use std::chrono::high_resolution_clock instead of system_clock - convert ellapsed time to float representing seconds - renamed engine::math::Matrix4::projection to perspective - use [0,1] instead of [-1,1] for the range of z values, to be aligned with vulkan - added engine::math::Matrix4::{look_at,transpose} --- src/vulkan_utils.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/vulkan_utils.hpp') diff --git a/src/vulkan_utils.hpp b/src/vulkan_utils.hpp index dd57afc..1efc73e 100644 --- a/src/vulkan_utils.hpp +++ b/src/vulkan_utils.hpp @@ -9,6 +9,7 @@ #include #include "math/vector.hpp" +#include "math/mat4.hpp" #include "o3d/vertex.hpp" namespace engine::vk { @@ -59,6 +60,11 @@ struct Vertex { engine::math::Vector3 col; }; +// TODO: move to a better place. Also, see TODOs for struct Vertex +struct UniformBufferObject { + alignas(16) engine::math::Matrix4 model, view, proj; +}; + } #endif // VULKAN_UTILS_HPP -- cgit v1.2.3