Advertisement

Advanced collision detection

Started by May 30, 2002 04:45 PM
0 comments, last by Drirk 22 years, 8 months ago
I''m working on a 2d simulation of rigid body dynamics. This means a bunch of polygons that are supposed to bounce against each other and requires polygon-polygon collision detection. I want to simulate torque to get accurate spinning effects. Anyway, the algorithm i use for collision detection is described on the top of this page: http://www.gamasutra.com/features/20000210/lander_02.htm ("Don''t cross that line" paragraph). The problem is that this algorith only tells you if you are inside or outside the polygon. Since i want accurate physics i need to know what edge/vertex (the two possible types of collisions are vertex-edge and vertex-vertex) a certain corner of a certain poly collided with. Therefore i need to know the points at which the attacking corner penetrates the the polygon. I do this by modifying the above algo to report not only if a point is inside or outside a poly but also if it is on an edge or on a corner. I use a tolerance value so that the point doesn''t have to be _exactly_ on the corner/edge. Anyway, the problem is that this doesn''t work very well. Collisions are often not detected. Now that you know what requirements i have on my collision detection algo, does anyone have any tips of another algo i can use?
Drirk,

Please search the forum archives for collision detection. You''ll find quite a few threads dealing with similar questions.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net

This topic is closed to new replies.

Advertisement