aboutsummaryrefslogtreecommitdiff
path: root/src/o3d/mesh.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/o3d/mesh.hpp')
-rw-r--r--src/o3d/mesh.hpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/o3d/mesh.hpp b/src/o3d/mesh.hpp
index 2c3a065..525d9bd 100644
--- a/src/o3d/mesh.hpp
+++ b/src/o3d/mesh.hpp
@@ -1,24 +1,29 @@
-#ifndef O3D_MESH_H
-#define O3D_MESH_H
+#ifndef O3D_MESH_HPP
+#define O3D_MESH_HPP
#include <vector>
#include <array>
#include <iterator>
+#include <cstdint>
#include <cstddef>
+#include <tuple>
#include "math/vector.hpp"
+#include "vulkan_utils.hpp"
namespace engine::o3d {
-using engine::math::Vector3, engine::math::Vector4;
-
struct Mesh {
static Mesh plane(float width, float height);
- std::vector<Vector4> vertices;
- std::vector<Vector3> normals;
- std::vector<std::array<std::array<std::size_t, 2>, 3>> indices;
+ std::vector<engine::math::Vector3> vertices;
+ std::vector<engine::math::Vector3> normals;
+ std::vector<std::array<std::array<size_t, 2>, 3>> indices;
+
+ // TODO: find a better way to do this. This workaround is due to the fact that vulkan only
+ // accepts a single index, not an index for each attributes
+ std::tuple<std::vector<engine::vk::Vertex>, std::vector<uint16_t>> linearize_indices() const &;
};
}
-#endif // O3D_MESH_H
+#endif // O3D_MESH_HPP