42 lines
1 KiB
C++
42 lines
1 KiB
C++
#pragma once
|
|
#include <glad/glad.h>
|
|
#include <glm/glm.hpp>
|
|
#include <glm/gtc/matrix_transform.hpp>
|
|
#include <stb_image.h>
|
|
#include <assimp/Importer.hpp>
|
|
#include <assimp/scene.h>
|
|
#include <assimp/postprocess.h>
|
|
|
|
#include <mesh.hpp>
|
|
#include <shader.hpp>
|
|
|
|
#include <vector>
|
|
#include <string>
|
|
#include <fstream>
|
|
#include <sstream>
|
|
#include <iostream>
|
|
#include <map>
|
|
#include <vector>
|
|
|
|
struct Model {
|
|
std::string directory;
|
|
std::string model_path;
|
|
std::map<std::string, Texture> textures_loaded;
|
|
std::vector<Mesh> meshes;
|
|
TextureCounts texture_counts;
|
|
bool gammaCorrection;
|
|
|
|
Model(const std::string& directory, const std::string& model_path) :
|
|
directory(directory), model_path(model_path)
|
|
{
|
|
load_model();
|
|
}
|
|
|
|
void draw(Shader &shader);
|
|
|
|
void load_model();
|
|
void process_node(const aiScene *scene, aiNode *node);
|
|
Mesh process_mesh(const aiScene *scene, aiMesh *mesh);
|
|
|
|
void load_material_textures(const aiScene *scene, std::vector<Texture>& textures, aiMaterial *mat, aiTextureType type, std::string typeName);
|
|
};
|