diff options
| author | Mel <einebeere@gmail.com> | 2022-10-23 02:48:51 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2022-10-23 02:48:51 +0200 |
| commit | 75a9c87b50cef2f1d749bd9042a9348bc28b4c09 (patch) | |
| tree | 8d82f3cbbb5bdc63c7e5b6431dac3d49b23a478d /src/GFX/Mesh.hpp | |
| parent | 589bfb5cad0052856077ce867f3858ca3741d95d (diff) | |
| download | meowcraft-75a9c87b50cef2f1d749bd9042a9348bc28b4c09.tar.zst meowcraft-75a9c87b50cef2f1d749bd9042a9348bc28b4c09.zip | |
Sun lighting
Diffstat (limited to 'src/GFX/Mesh.hpp')
| -rw-r--r-- | src/GFX/Mesh.hpp | 27 |
1 files changed, 22 insertions, 5 deletions
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<Vector<3>> positions, std::vector<Vector<2>> tex_coords, std::vector<uint32_t> indices) - : m_positions(std::move(positions)), m_tex_coords(std::move(tex_coords)), m_indices(std::move(indices)) {}; - - Mesh(std::vector<Vector<3>> positions, std::vector<Vector<2>> tex_coords) - : m_positions(std::move(positions)), m_tex_coords(std::move(tex_coords)), m_indices() {}; + Mesh( + std::vector<Vector<3>> positions, + std::vector<Vector<3>> normals, + std::vector<Vector<2>> tex_coords, + std::vector<uint32_t> 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<Vector<3>> positions, + std::vector<Vector<3>> normals, + std::vector<Vector<2>> 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<Vector<3>> m_positions; + std::vector<Vector<3>> m_normals; std::vector<Vector<2>> m_tex_coords; std::vector<uint32_t> m_indices; |
