Sign in to follow this  
VanKurt

What is the "collision normal"?

Recommended Posts

VanKurt    133
I'm currently reading 2Physics for game developers" but there's one thing I don't really understand: What is the collision normal? In the circle example it is just the difference between the circle's centers, normalized. But with convex n-gons things are strange: 1) When there's an vertex/vertex contact the collision normal is calculated exactly like in the circle example. 2) When there's a vertex edge contact the collision normal (as far as I understood) is a vector perpendicular to the edge. And that's what confuses me :-) What exactly is the collision normal? And in which case is it calculated which way??? Thanks for your help! :-D

Share this post


Link to post
Share on other sites
Ilici    862
Quote:
Original post by VanKurt
I'm currently reading 2Physics for game developers" but there's one thing I don't really understand: What is the collision normal?

In the circle example it is just the difference between the circle's centers, normalized.
But with convex n-gons things are strange:

1) When there's an vertex/vertex contact the collision normal is calculated exactly like in the circle example.

2) When there's a vertex edge contact the collision normal (as far as I understood) is a vector perpendicular to the edge.

And that's what confuses me :-)
What exactly is the collision normal? And in which case is it calculated which way???

Thanks for your help! :-D


I think you answered your own question.

The collision normal is a vector which is used to calculate impulses after the collision. If you take a look at the impulse calculations you'll see the collision normal being used. Basically in a collision (in a simple case), velocities get reflected about the collision normal.

The collision normal is calculated depending on the type of collision that has occured. If the collision was vertex-vertex this is a degenerate case and there is an infinite choice of collision normals. To counter this problem you're better or considering this collision as a vertex-edge collision by choosing an edge on either of the polygons. I'm not sure if this will produce very good results but it's worth a try.

In the vertex-edge collision the collision normal is the perpendicular to the collision edge.

Share this post


Link to post
Share on other sites
Squirm    481
In a real collision between two circular objects, each will compress slightly near the point of contact, a force will be applied, and they will be pushed apart. The direction of this force, averaged over the entire collision, is used in rigid body simulations as the direction of the impulse force we use in its place, and is the direction from one circles center to the others.

The most common case in a game is something colliding with a plane/triangle/polygon/whatever which presents a flat surface, and in general the best normal in this case is the normal to the surface.

As for vertex striking vertex, well, you try doing that in real life. For the sake of a physics engine, pretend it's a couple of circles and hope it looks ok (infact, hope it very rarely happens ;).

Share this post


Link to post
Share on other sites
hannes100    122
Hi, i also have a problem with the surface normal vector.
What to do by an edge/edge collision ?. If the 2 surfaces are balls, one take the vector between the center Point of the balls. This vector defenetly goes through the collision point.... but if we take two surfaces with arbitrary mass centers, this is not true in generall. So what vector do i have to take here ?
Moreover, if the surfaces aren't differentiable at that points, which could be the fact by 2 polygons or by aproximated surfaces, a normal vector doesn't exist..
so what vector to take ?
thnx

Share this post


Link to post
Share on other sites
b34r    365
Quote:
Original post by hannes100
Hi, i also have a problem with the surface normal vector.
What to do by an edge/edge collision ?. If the 2 surfaces are balls, one take the vector between the center Point of the balls. This vector defenetly goes through the collision point.... but if we take two surfaces with arbitrary mass centers, this is not true in generall. So what vector do i have to take here ?
Moreover, if the surfaces aren't differentiable at that points, which could be the fact by 2 polygons or by aproximated surfaces, a normal vector doesn't exist..
so what vector to take ?
thnx


A good approximation to the collision normal can be found when using the Separating Axis Theorem (not mentionned in Physics for Game Developers) by using the axis with maximum overlap as the collision normal direction. There's plenty of ways to do it but it drove me mad trying to do it with manual heuristics. The SAT easily gives a correct, and most importantly consistent, collision normal over time.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this