#pragma once #include #include #include "util/uix.hpp" #include "assets/components/mesh_vertex_components.hpp" #include "generic/vertex_array_data.hpp" #include "assets/data_stores/material_store.hpp" namespace assets { class mesh_data : public vertex_array_data< mesh_vertex_components::flags, mesh_vertex_components::position, mesh_vertex_components::normal, mesh_vertex_components::tex_coord, mesh_vertex_components::color, mesh_vertex_components::reflectance > { public: using index_type = ztu::u32; using triangle_type = std::array; [[nodiscard]] inline std::vector& positions(); [[nodiscard]] inline std::vector& normals(); [[nodiscard]] inline std::vector& tex_coords(); [[nodiscard]] inline std::vector& colors(); [[nodiscard]] inline std::vector& reflectances(); [[nodiscard]] inline std::vector& triangles(); [[nodiscard]] inline auto& material_id(); [[nodiscard]] inline const std::vector& positions() const; [[nodiscard]] inline const std::vector& normals() const; [[nodiscard]] inline const std::vector& tex_coords() const; [[nodiscard]] inline const std::vector& colors() const; [[nodiscard]] inline const std::vector& reflectances() const; [[nodiscard]] inline const std::vector& triangles() const; [[nodiscard]] inline const auto& material_id() const; inline void clear(); private: std::vector m_triangles{}; material_store::id_type m_material_id{}; }; } #define INCLUDE_DYNAMIC_MESH_DATA_IMPLEMENTATION #include "assets/data/mesh_data.ipp" #undef INCLUDE_DYNAMIC_MESH_DATA_IMPLEMENTATION