#pragma once #include #include #include // C++ importer interface #include // Output data structure #include // Post processing flags #include #include #include "glclasses.hpp" // TODO: hide assimp inside // and enable/disable // to use own binary format without assimp for speed/compatibiblity // TODO: add lod-options // TODO: add generate from openscad options if models missing namespace endofthejedi { class PolygonModel { public: PolygonModel(const std::string &filename); void clear(); bool import(); bool uploadToOpenGl(); bool bind(Shader &shader); bool render(Shader& shader); private: bool copyVertices(const aiScene *scene); const std::string &filename() const { return m_filename; } private: std::string m_filename; bool m_loaded_from_file; bool m_loaded_to_opengl; bool m_binding_active; // both will hold 3 * numVertices floats std::vector m_data_position; std::vector m_data_normal; size_t m_numVertices; GLuint m_vbo_id_position; GLuint m_vbo_id_normal; }; }