I’m working for collision response for my 2d game. Character is represented by circle and obstacles are represented by Polygons(in my example it would be rotated rectangle for simlification). The problem is when circle collides with vertice of polygon, I know how it must work , but can’t find the vector.
C – the center of the circle.
V – vertice.
P – the center of the polygon.
X – the vector I need to find.
Then I’ll just move my character by vector V.sub(X).
Tried this algorithm, but it gained no result.
http://stackoverflow.com/questions/1073336/circle-line-segment-collision-detection-algorithm
↧
Circle to Polygon collision response
↧