SimpleEngine/include/simpleengine/gfx/model.h

33 lines
962 B
C
Raw Normal View History

#pragma once
2022-09-22 02:52:06 +00:00
#include "mesh.h"
#include "simpleengine/gfx/texture.h"
2022-09-22 02:52:06 +00:00
#include <assimp/material.h>
#include <assimp/mesh.h>
#include <assimp/scene.h>
//#include <assimp/mesh.h>
namespace simpleengine::gfx {
/**
2022-09-22 02:52:06 +00:00
* @brief A Model is a group of Meshes read from the 3D model file.
*
* The engine uses assimp, so all formats that it supports can be found here:
* https://github.com/assimp/assimp/blob/master/doc/Fileformats.md
*
*/
2022-09-22 02:52:06 +00:00
class Model : public simpleengine::Transformable {
protected:
std::string model_directory; // May be needed
public:
2022-09-22 02:52:06 +00:00
std::vector<gfx::Mesh> meshes;
Model(std::string file_path);
void load_model(std::string path);
void process_node(aiNode* node, const aiScene* scene);
gfx::Mesh process_mesh(aiMesh* mesh, const aiScene* scene);
2022-09-22 04:11:12 +00:00
std::vector<Texture> load_material_textures(aiMaterial* material, aiTextureType type);
};
}