FastCorotatedFEM icon indicating copy to clipboard operation
FastCorotatedFEM copied to clipboard

Collision response implementation

Open galoko opened this issue 6 years ago • 1 comments

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?

galoko avatar Feb 23 '19 14:02 galoko

	//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 :(

galoko avatar Feb 23 '19 15:02 galoko