OpenGL-utility/include/model/model.hpp

32 lines
643 B
C++
Raw Normal View History

2021-01-30 04:02:15 +01:00
#ifndef MODEL_HPP
#define MODEL_HPP
#include <vector>
#include <core.hpp>
#include <shader.hpp>
#include <model/mesh.hpp>
#include <assimp/scene.h>
namespace oglu
{
class OGLU_API Model
{
public:
Model(const std::string& path);
void Render(Shader& shader);
private:
std::vector<Texture> loaded;
std::vector<Mesh> meshes;
std::string directory;
void LoadModel(const std::string& path);
void ProcessNode(aiNode* node, const aiScene* scene);
Mesh ProcessMesh(aiMesh* mesh, const aiScene* scene);
std::vector<Texture> LoadMaterialTextures(aiMaterial* mat, aiTextureType type, const std::string& typeName);
};
}
#endif