From 75a9c87b50cef2f1d749bd9042a9348bc28b4c09 Mon Sep 17 00:00:00 2001 From: Mel Date: Sun, 23 Oct 2022 02:48:51 +0200 Subject: Sun lighting --- src/GFX/Mesh.hpp | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'src/GFX/Mesh.hpp') diff --git a/src/GFX/Mesh.hpp b/src/GFX/Mesh.hpp index f027c8c..c20b419 100644 --- a/src/GFX/Mesh.hpp +++ b/src/GFX/Mesh.hpp @@ -9,15 +9,31 @@ namespace MC::GFX { class Mesh { public: - Mesh(std::vector> positions, std::vector> tex_coords, std::vector indices) - : m_positions(std::move(positions)), m_tex_coords(std::move(tex_coords)), m_indices(std::move(indices)) {}; - - Mesh(std::vector> positions, std::vector> tex_coords) - : m_positions(std::move(positions)), m_tex_coords(std::move(tex_coords)), m_indices() {}; + Mesh( + std::vector> positions, + std::vector> normals, + std::vector> tex_coords, + std::vector indices + ) : m_positions(std::move(positions)), + m_normals(std::move(normals)), + m_tex_coords(std::move(tex_coords)), + m_indices(std::move(indices)) {}; + + Mesh( + std::vector> positions, + std::vector> normals, + std::vector> tex_coords + ) : m_positions(std::move(positions)), + m_normals(std::move(normals)), + m_tex_coords(std::move(tex_coords)), + m_indices() {}; float* raw(); size_t size(); + float* raw_normals(); + size_t normals_size(); + uint32_t* raw_indices(); size_t indices_size(); @@ -26,6 +42,7 @@ public: private: std::vector> m_positions; + std::vector> m_normals; std::vector> m_tex_coords; std::vector m_indices; -- cgit 1.4.1