/* * mesh.h * - wrapper for assimp http://www.assimp.org */ #pragma once #include #include "animation.h" #include "util.h" #include "util_image.h" struct meMeshInfo { glm::mat4 model_transform; // NOTE: vertices, normals, and tex_coords have the same count uint num_vertices; glm::vec3* vertices; glm::vec3* normals; glm::vec3* texture_coords; // NOTE: stay aligned with other buffers uint num_indices; uint* indices; util_image diffuse_texture; node_animation* node_anim; }; struct meMeshGroup { // TODO: this should be one big allocation since the mesh doesn't change // while running meMeshInfo** meshes; uint num_meshes; }; bool meInitAssimp(); // NOTE: meshes loaded from assimp require texture coordinates, and a diffuse // texture, which can be a seperate file, or embedded in the input file bool meLoadFromFile(meMeshGroup& mesh_group, const char* filepath); void meFreeMeshGroup(meMeshGroup& mesh_group); void meShutdownAssimp();