#ifndef GLTEST_MESH_H #define GLTEST_MESH_H #include "vertex.h" #include "../Shaders/ShaderProgram.h" #include "GLObject.h" #include #include #include #include #include class Mesh: public GLObject { protected: size_t _size; std::vector _xs; std::vector _ys; mutable std::vector _normals; mutable std::array _adjacentTriangles; public: Mesh(ShaderProgram* shader, std::size_t size); virtual ~Mesh(); private: size_t normalIndex(size_t x, size_t y); protected: void generateVertices() const override final; void updateVertices() const override final; void generateIndices() const override final; protected: virtual float heightMap(std::size_t nx, std::size_t ny) const = 0; virtual float heightMap(float fx, float fy) const = 0; }; #endif //GLTEST_MESH_H