# What is the "collision normal"?

This topic is 4958 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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 on other sites
Quote:
 Original post by VanKurtI'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

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 on other sites
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 on other sites
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 on other sites
Quote:
 Original post by hannes100Hi, 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 on other sites
thnx alot, there is a lot of to find about it a google... think thats enought :-)

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 13
• 9
• 15
• 14
• 46
• ### Forum Statistics

• Total Topics
634059
• Total Posts
3015292
×