13,632,483 members
See more:
I've been building a small racing game in C#, and I've hit a bit of a block when it comes to the impulse resolution of the car to car collisions. At the moment, the cars are able to hit and push each-other, but there's no resulting rotation from these collisions.

The problem I'm having is determining the point of impact.

I'm using a set of `Vector2`s to represent the outline of the car. From this, I'm using SAT to determine if there is an collision. While looking for a separating axis, I'm also keeping track of the axis of least penetration, this is the axis that gets used as the normal for the impulse resolution when there is a collision. The axes that I'm using are the normals of the sides of the cars that are being checked for collision.

The collision detection part of this is working very well; the way that the cars are able to shove other cars out of their way isn't too bad either. But, I want the cars to be able to spin out of control when hit at an odd angle.

The best solution I've thought of so far goes something like this:
* CarA is set to the car who's side is being used to determine the normal for the impulse resolution.
* CarB is the other car.
* I push the cars apart to get rid of any penetration (they will still be touching, just not overlapping)
* I use the point of CarB that is nearest to the impacted side of CarA, as the point of impact.

As far as I can tell, this solution seems sound, but I'm being bothered by one thing. What if it's a flat side-to-side hit? A perfect head-on-collision of two cars playing chicken would be a good example of what's bothering me.

Does anyone have any advice on what might be the best course of action for this?
Posted 15-Nov-13 13:53pm
Updated 13-Jul-14 18:09pm
v2

## Solution 1

I ended up using the point of minimum extent along the normal axis, from CarB. It's the possible solution I mentioned in the question. Things are a little bouncy, but I think that has more to do with the constants I'm using. Besides, most people that have tried the game out tend to get a bit of a smile from that, so I think I'll be keeping it that way.
v3

Top Experts
Last 24hrsThis month
 OriginalGriff 450 Jochen Arndt 100 Gerry Schmitz 80 Richard MacCutchan 71 Vincent Maverick Durano 50
 OriginalGriff 3,718 Jochen Arndt 1,890 ppolymorphe 1,503 Richard MacCutchan 1,033 CHill60 811