/** * @file mesh_controller.h * @author Piotr Krygier (piotr.krygier@meshsystems.com) * @brief * @version 0.1 * @date 2023-03-29 * * @copyright Copyright (c) 2023 * */ #ifndef MESH_CONTROLLER_H #define MESH_CONTROLLER_H #include "vulkan_commons.h" #include "graphics_context.h" #include "utilities/commons.h" /** * @brief Create a new mesh for provided vertices and indices. * * @param vertices vector of vertices * @param indices indices for mesh * @param vertices_num vertices count * @param indices_num indices count * @return uint16_t Mesh identifier. Can be useful for getting vertices, indices and instances */ uint16_t create_mesh(struct graphics_context_t* context, struct vertex_t* vertices, uint16_t* indices, size_t vertices_num, size_t indices_num); /** * @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 */ rse_err_t create_mesh_instance(struct graphics_context_t* context, uint16_t mesh_id, struct instance_data_t instance_data); /** * @brief Get the vertex count for mesh with mesh_id ID * * @param mesh_id Mesh identifier * @return size_t Number of vertices */ size_t get_vertices_count(struct graphics_context_t* context, uint16_t mesh_id); /** * @brief Get the index count for mesh with mesh_id ID * * @param mesh_id Mesh identifier * @return size_t Number of indices */ size_t get_indices_count(struct graphics_context_t* context, uint16_t mesh_id); /** * @brief Get the instance count for mesh with mesh_id ID * * @param mesh_id Mesh identifier * @return size_t Number of instances */ size_t get_instances_count(struct graphics_context_t* context, uint16_t mesh_id); /** * @brief Get vertex offset in vertex buffer for selected mesh * * @param mesh_id Mesh identifies * @return size_t Offset */ size_t get_vertex_offset(struct graphics_context_t* context, uint16_t mesh_id); #endif /* MESH_CONTROLLER_H */