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

Fix generalized inverse mass in velocity solve #47

Merged
merged 1 commit into from
Jun 18, 2023

Conversation

Jondolf
Copy link
Owner

@Jondolf Jondolf commented Jun 18, 2023

Fixes #29.

The generalized inverse mass was being calculated based on the contact normal and not delta_v, so it didn't take dynamic friction into account.

In cases where the physics units used were larger, this caused explosive behaviour. Below is the move_marbles example, modified to use pixels instead of 3D units.

Previously it exploded when moving the marbles:

2023-06-18.14-49-05.mp4

Now it works as expected:

2023-06-18.14-49-40.mp4

@Jondolf Jondolf added C-Enhancement New feature or request C-Bug Something isn't working and removed C-Enhancement New feature or request labels Jun 18, 2023
@Jondolf Jondolf merged commit d58a58a into main Jun 18, 2023
@Jondolf Jondolf deleted the velocity-solve-correct-general-inverse-mass branch June 18, 2023 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong generalized inverse masses in solve_vel
1 participant