blob: cac0f623cd29aeef83ef117cc528f7a618d99b23 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#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 {
struct Mesh {
static Mesh plane(float width, float height) noexcept;
std::vector<engine::math::Vector3> vertices;
std::vector<engine::math::Vector3> normals;
std::vector<engine::math::Vector2> uvs;
std::vector<std::array<std::array<size_t, 3>, 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 & noexcept;
};
}
#endif // O3D_MESH_HPP
|