MCPcopy Create free account
hub / github.com/PDAL/PDAL / timeStep

Method timeStep

filters/private/csf/Cloth.cpp:103–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103double Cloth::timeStep() {
104 int particleCount = static_cast<int>(particles.size());
105 #pragma omp parallel for
106 for (int i = 0; i < particleCount; i++) {
107 particles[i].timeStep();
108 }
109 #pragma omp parallel for
110 for (int j = 0; j < particleCount; j++) {
111 particles[j].satisfyConstraintSelf(constraint_iterations);
112 }
113 double maxDiff = 0;
114
115 for (int i = 0; i < particleCount; i++) {
116 if (particles[i].isMovable()) {
117 double diff = fabs(particles[i].old_pos.f[1] - particles[i].pos.f[1]);
118
119 if (diff > maxDiff)
120 maxDiff = diff;
121 }
122 }
123
124 return maxDiff;
125}
126
127void Cloth::addForce(const Vec3 direction) {
128 for (std::size_t i = 0; i < particles.size(); i++) {

Callers 1

do_filteringMethod · 0.45

Calls 3

satisfyConstraintSelfMethod · 0.80
isMovableMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected