#include <glm/glm.hpp>
#include <assimp/scene.h>
#include <assimp/Importer.hpp>
+#include "material.hpp"
class Model {
struct Mesh {
Mesh(const aiMesh *aiMesh, GLuint progId);
- GLuint vao;
- GLuint numIndices;
+ GLuint progId, vao, numIndices;
+ unsigned int materialIndex;
};
public:
class Node {
public:
Node(const aiNode &aiNode, GLuint progId);
- void draw(const std::vector<Mesh> &meshes, glm::mat4 parentModel) const;
+ void draw(const std::vector<Mesh> &meshes, const std::vector<Material> &materials, glm::mat4 parentModel) const;
const std::vector<Node*> &getChildren() const { return children; }
Node* findNode(const aiNode &aiNode);
glm::mat4 model = glm::mat4(1);
std::vector<Mesh> meshes;
Node *root;
+
+ std::vector<Material> materials;
+
void loadModel(const std::string &path);
Assimp::Importer importer;