Generalizing collision normal between two arbitrary shapes

  • #1

Main Question or Discussion Point

I am working on a physics engine, and I have a question about the collision normal. There are a lot of different ways people say to calculate this, perpendicular to the collision angle, perpendicular to the edge of body 'B', etc. I was wondering if it would be okay to assume the collision normal is always [1,0]. If that is not okay, is this:
  • vector = distance(A.Center, B.Center)
  • angle = atan2(vector.Y, vector.X) + PI / 2
  • normal = [cos(angle), sin(angle)]
 

Answers and Replies

  • #2
haruspex
Science Advisor
Homework Helper
Insights Author
Gold Member
32,741
5,034
Not sure how you are defining collision normal, but basing it on the line joining the mass centres does not sound right.
First, there is the question of the tangent plane at the point of contact. The normal to that could be considered a collision normal.
Next, there is the relative velocity. The direction of that vector is also relevant.
 

Related Threads on Generalizing collision normal between two arbitrary shapes

Replies
4
Views
2K
Replies
5
Views
3K
Replies
2
Views
2K
Replies
2
Views
5K
  • Last Post
Replies
4
Views
948
  • Last Post
Replies
3
Views
2K
  • Last Post
Replies
9
Views
787
  • Last Post
Replies
0
Views
1K
Replies
7
Views
2K
Top