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

Problem:about "Contact::calculateFrictionImpulse" #15

Open
Hotice83 opened this issue Jan 9, 2013 · 2 comments
Open

Problem:about "Contact::calculateFrictionImpulse" #15

Hotice83 opened this issue Jan 9, 2013 · 2 comments

Comments

@Hotice83
Copy link

Hotice83 commented Jan 9, 2013

please, why add these code for impulseContact.x in dynamic friction:

impulseContact.x = deltaVelocity.data[0] +
deltaVelocity.data[1]_friction_impulseContact.y +
deltaVelocity.data[2]_friction_impulseContact.z;
impulseContact.x = desiredDeltaVelocity / impulseContact.x;

how derive it?
why not use impulseContact directly?
Anyone knows? thanks.

@NolanK
Copy link

NolanK commented Jan 9, 2013

Wow, I was going through the exact same code and I had the same question... I understand why and how the impulse.y and impulse.z are calculated, but like you said, it wasn't explained how or why impulse.x is calculated in dynamic friction.

My initial assumption was to leave it as it was after it was generated from the impulse matrix (like you asked about), but that doesn't work and makes the objects move too fast and explode (testing with a high restitution).

I understand why you need deltaVelocity.data[0], because this is the x component of the first vector in the delta velocity matrix, which represents the amount of velocity per unit of impulse in the direction of the contact normal (the x axis), but adding "deltaVelocity.data[1]_friction_impulseContact.y" and "deltaVelocity.data[2]_friction_impulseContact.z" make no sense to me.

That one line has got me so stumped that I had to do all the work for friction in 3D even though I'm implementing a 2D physics engine, just to get it to work (setting Z=0 for all objects and rotations); I have no idea how to convert that one line to its 2D conterpart.

I know this post doesn't help you much, but I thought I'd share my thoughts on the issue. I find it crazy how I was on the exact same problem today and I just randomly decided to check this site.

Here's to hoping someone can explain it to us.

-Nolan

@e2-dunstan
Copy link

I know this is an old issue, but has anyone found a solution to this? The only one I've found is by just omitting dynamic friction entirely but obviously that means no sliding.

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

3 participants