39 XY(
int x1,
int y1) :
x(x1),
y(y1) {}
47 int constraint_iterations;
57 double smoothThreshold;
58 double heightThreshold;
61 std::vector<double> heightvals;
64 std::vector<int> movableIndex;
65 std::vector<std::vector<int>> particle_edges;
68 inline void addConstraint(
85 return particles[index];
107 double smoothThreshold,
108 double heightThreshold,
113 this->heightvals = heightvals;
132 const std::vector<double>& heightvals,
133 std::vector<int>& edgePoints);
137 const std::vector<XY>& connected,
138 const std::vector<std::vector<int>>& neighbors,
139 const std::vector<double>& heightvals);
void saveToFile(std::string path="")
const Particle & getParticle(int x, int y) const
Particle & getParticleByIndex(int index)
void setheightvals(const std::vector< double > &heightvals)
void addForce(const Vec3 &direction)
void findUnmovablePoint(const std::vector< XY > &connected, const std::vector< double > &heightvals, std::vector< int > &edgePoints)
std::vector< double > & getHeightvals()
void saveMovableToFile(std::string path="")
Cloth(const Vec3 &origin_pos, int num_particles_width, int num_particles_height, double step_x, double step_y, double smoothThreshold, double heightThreshold, int rigidness, double time_step)
void handle_slop_connected(const std::vector< int > &edgePoints, const std::vector< XY > &connected, const std::vector< std::vector< int >> &neighbors, const std::vector< double > &heightvals)
Particle & getParticle(int x, int y)
ccMesh * toMesh() const
Converts the cloth to a CC mesh structure.
const Particle getParticleByIndex(int index) const
std::vector< Particle * > neighborsList
static const std::string path