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

wrong calculation of total inverse mass #54

Open
cosfer65 opened this issue Oct 28, 2020 · 1 comment
Open

wrong calculation of total inverse mass #54

cosfer65 opened this issue Oct 28, 2020 · 1 comment

Comments

@cosfer65
Copy link

in function void ParticleContact::resolveInterpenetration(real duration) (pcontacts.cpp around line 100)
you calculate total inverse mass like this
// The movement of each object is based on their inverse mass, so
// total that.
real totalInverseMass = particle[0]->getInverseMass();
if (particle[1]) totalInverseMass += particle[1]->getInverseMass();

I think this is mathematically wrong since 1/mass1 + 1/mass2 is not the same as 1/(mass1+mass2) as I think you mean. Browsing through the code I saw the same calculation in a number of points.

@LucasCampos
Copy link
Contributor

This seems to be related to issue #13

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

2 participants