Determining relative velocities on impact?

Posted by meds on Game Development See other posts from Game Development or by meds
Published on 2011-01-06T09:22:19Z Indexed on 2011/01/06 10:01 UTC
Read the original article Hit count: 253

Filed under:
|
|

I'm trying to figure out a way to determine the relative velocity of a body colliding with another in a 2D environment.

For example if one body is moving at (1,0) and another traveling behind it collides with it from behind at (2,0) the velocity of the impact relative to the first body was (1,0).

I need a method which takes in two velocities, one velocity belonging to the body the velocity is being measured against, and the other for the impacting body and return the relative velocity.

© Game Development or respective owner

Related posts about XNA

Related posts about physics