#pragma once #include "application.hpp" #include "constraints.hpp" #include class SoftBody; class Buffer; class Simulation : public Application { public: Simulation(); ~Simulation(); private: unique_ptr vertexBuffer; unique_ptr faceBuffer; unique_ptr edgeBuffer; unique_ptr triangleBuffer; unique_ptr tetrahedronBuffer; void createMeshBuffers(); struct SizeInformation { uint32_t vertexCount; uint32_t faceCount; uint32_t edgeCount; uint32_t triangleCount; uint32_t tetrahedronCount; }; unique_ptr sizeInformationBuffer; struct Properties { glm::vec3 gravity; float dt; uint32_t k; }; unique_ptr propertiesBuffer; Properties properties {}; struct PBDPushData { uint32_t state; ConstraintData::Partition edgePartition; ConstraintData::Partition tetrahedronPartition; }; ConstraintData constraintData {}; unique_ptr pbdPipeline; unique_ptr normalPipeline; void createComputePipelines(); vector> softBodies; void recordDrawCommands() override; void recordComputeCommands(VkCommandBuffer cmdBuffer) override; };