/** * @file mesh_controller.hpp * @author Piotr Krygier (piotr.krygier@meshsystems.com) * @brief * @version 0.1 * @date 2023-03-29 * * @copyright Copyright (c) 2023 * */ #ifndef RSE_MESH_CONTROLLER_HPP #define RSE_MESH_CONTROLLER_HPP #include #include #include #include #include "vulkan_commons.hpp" namespace rse::graphics::mesh { /* Forward declarations */ struct MeshInstance; struct MeshInstance { uint32_t instance_id; InstanceData instance_data; }; struct Mesh { uint32_t unique_id; const std::vector vertices; std::vector indices; std::map> instances; }; /** * @brief Create a new mesh for provided vertices and indices. * * @param vertices vector of vertices * @param indices indices for mesh * @return uint16_t Mesh identifier. Can be useful for getting vertices, indices and instances */ uint16_t create_mesh(std::vector vertices, std::vector indices); /** * @brief Create a instance for the selected mesh. Instance can have its own location, rotation and scale * * @param mesh_id Mesh id * @param instance_data Transformation info */ void create_mesh_instance(uint16_t mesh_id, InstanceData instance_data); std::vector get_mesh_vertices(uint16_t mesh_id); std::vector get_mesh_indices(uint16_t mesh_id); std::vector get_instance_data_for_mesh(uint16_t mesh_id); } // namespace rse::graphics::mesh #endif