- #1
StarWarsNerd
- 19
- 1
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)]