Start day 16, scene refactor.
This commit is contained in:
parent
f2a20876f3
commit
3041ae0172
73 changed files with 14114 additions and 0 deletions
44
16-scene-refactor/src/model.hpp
Normal file
44
16-scene-refactor/src/model.hpp
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
#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::map<std::string, Texture> textures_loaded;
|
||||
std::vector<Mesh> meshes;
|
||||
std::string directory;
|
||||
std::string model_path;
|
||||
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);
|
||||
|
||||
void connect_shader(const Shader& shader);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue