Skip to main content
gamedev.net
🔒 Locked

Impulse Based Collision Response

Started by Kasya Apr 1, 2009 at 7:26 AM 0 replies 700+ views
Original Post
Kasya
Kasya
Hello, I was reading Eberly's Game Physics Book. I get confused in one place here: Page 248 Please look at the line: A.v = A.p * A.massinv; B.v = A.p * B.massinv; Why there is written A.p in the second line instead of B.p? (B.v = B.p * B.massinv) And can i write impulse inside that response like that:


void ProcessCollidingContact(...) {

//.....

vector impulse = f * N;

A.v += impulse * A.massinv;
B.v -= impulse * B.massinv;

//...

}


Thanks, Kasya
oliii
oliii
looks like a typo. Should be B.p

And yes, you can just add the impulse to the momentums, which is what I usually do.

Note that there could be a reason behind accumulating and caching the momentums, instead of just adding the impulse straight away (iirc, multiple simultaneous contact resolution, things like that).


Everything is better with Metal.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.