Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collision response implementation #2

Open
galoko opened this issue Feb 23, 2019 · 1 comment
Open

Collision response implementation #2

galoko opened this issue Feb 23, 2019 · 1 comment

Comments

@galoko
Copy link

galoko commented Feb 23, 2019

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
Copy link
Author

galoko commented Feb 23, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant