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.
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "point.hpp"
|
|
|
|
#include "connection.hpp"
|
|
|
|
#include "vec.hpp"
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
struct Cloth {
|
|
|
|
Vec2 startpos;
|
|
|
|
Vec2 dimensions;
|
|
|
|
std::vector<Point*> points;
|
|
|
|
std::vector<Connection*> connections;
|
|
|
|
};
|
|
|
|
|
|
|
|
Cloth* new_cloth(Vec2 startpos, Vec2 dimensions, unsigned int spacing);
|
|
|
|
void destroy_cloth(Cloth* cloth);
|
|
|
|
void compute_cloth_forces(Cloth* cloth, Vec2f gravity_vec);
|
|
|
|
void satisfy_cloth_constraints(Cloth* cloth, Vec2 top_left, Vec2 bottom_right);
|