FastCorotatedFEM
FastCorotatedFEM copied to clipboard
Collision response implementation
Hello! First of all - thank you for your work, it's an excellent real-time FEM simulation. There is only one thing I want to ask about and it is about collision response. In your 2D FEM implementation you use fairly simple direct clamping of particle position, however, when I tried this approach for this simulation it seem to cause a lot of artifacts. So the question is, how to implement proper collision response? Maybe you can point me to some parts of PBD code that do something similuar?
//velocity update
for (int i = nFixedVertices; i < nVerts; i++) {
v[i] = (x[i] - x_old[i]) / dt;
}
//floor constraint (added by me)
for (int i = nFixedVertices; i < nVerts; i++) {
if (x[i].y() < -0.2) {
v[i].y() = 0.0f;
}
}
this does not work at all :(