You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.2 KiB

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