#pragma once #include #include #include #include #include #include "mesh.h" #include "shader.h" #include class Model { public: enum MODELSTATUS { LOADING, LOADED, ERR }; private: std::vector _meshes; std::vector _texturesLoaded; std::string _directory; MODELSTATUS _status = LOADING; // smallest point glm::vec3 _left_down_back = glm::vec3(3e36f, 3e36f, 3e36f); // largest point glm::vec3 _right_up_front = -_left_down_back; public: Model(std::string path); ~Model(); public: inline MODELSTATUS status() const { return _status; } // maybe we can check if boundary has not been set yet // Do remember to ensure you have called check_boundary inline glm::vec3 get_upper_bound() { return _right_up_front; } // Do remember to ensure you have called check_boundary inline glm::vec3 get_lower_bound() { return _left_down_back; } private: void loadModel(std::string path); void processNode(aiNode* node, const aiScene* scene); Mesh processMesh(aiMesh* mesh, const aiScene* scene); std::vector loadMaterialTextures(aiMaterial* mat, aiTextureType type, TextureType textureType); public: void render(const ShaderProgram& shader) const; void check_boundary(); // maybe we can encapsure a function to get both upper and lower bound? };