X-Git-Url: http://git.lukelau.me/?p=opengl.git;a=blobdiff_plain;f=model.hpp;h=a39c70a0651eb8043cd14bbb9ea4e0567bba85d9;hp=98c630e83306e36c72053760629eba52d52970e4;hb=37cba564a96018a5500e942498d4e48c0ebe73ed;hpb=ba5e08bf25de722d907748ce55b27a45b2b270bf;ds=inline diff --git a/model.hpp b/model.hpp index 98c630e..a39c70a 100644 --- a/model.hpp +++ b/model.hpp @@ -7,13 +7,14 @@ #include #include #include +#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: @@ -23,7 +24,7 @@ class Model { class Node { public: Node(const aiNode &aiNode, GLuint progId); - void draw(const std::vector &meshes, glm::mat4 parentModel) const; + void draw(const std::vector &meshes, const std::vector &materials, glm::mat4 parentModel) const; const std::vector &getChildren() const { return children; } Node* findNode(const aiNode &aiNode); glm::mat4 model = glm::mat4(1); @@ -43,6 +44,9 @@ class Model { std::vector meshes; Node *root; + + std::vector materials; + void loadModel(const std::string &path); Assimp::Importer importer;