40 lines
962 B
C++
40 lines
962 B
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>
|
|
|
|
unsigned int TextureFromFile(const std::string& path, const std::string& directory, bool gamma = false);
|
|
|
|
struct Model {
|
|
std::vector<Texture> textures_loaded;
|
|
std::vector<Mesh> meshes;
|
|
std::string directory;
|
|
bool gammaCorrection;
|
|
|
|
Model(const char *path) {
|
|
loadModel(path);
|
|
}
|
|
|
|
void Draw(Shader &shader);
|
|
|
|
void loadModel(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, std::string typeName);
|
|
};
|