Collision Detection with concave-Polygons

Post: #1
I am currently writing an 2D-Action game, which needs me to check for collisions between Polygons and the Players Bounding box.
I currently use an algorythm which adds all the angles from a Point to the various Points of the Polygon. It is true (collides) when the angle is > 360∞.
The problem is, that this algorythm doesn't work with concave Polygons, which are required for my game.
Is there another way to do it, so that it works for concave Polygons too?

Quote this message in a reply
Posts: 204
Joined: 2002.09
Post: #2

I just implemented this myself. This article describes everything you should need:

Quote this message in a reply
Posts: 304
Joined: 2002.04
Post: #3
well - all concave polygons can be broken down into convex polygons (or triangles) - and then you could collide with those instead. There are some libraries for this (google "triangulation code").

A polygon can intersect with a rectangle - and yet the four corner points of the rectangle are still outside of the polygon - and the vertecies of your polygon are outside of the rectangle - so its possible you will miss collisions - but not likely.

Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Optimize the collision detection alaslipknot 1 5,761 May 12, 2013 08:02 PM
Last Post: SethWillits
  Collision detection tutorial ThemsAllTook 7 27,455 Nov 5, 2011 05:20 PM
Last Post: SethWillits
  Cutting and Splitting Polygons Maedi 3 9,707 Sep 13, 2011 07:40 AM
Last Post: Skorche
  Help with Collision Detection..(i'm almost there) carmine 1 6,563 Jun 29, 2011 12:33 PM
Last Post: ThemsAllTook
  Time Delta, collision detection mk12 19 23,644 Sep 8, 2010 06:40 PM
Last Post: AnotherJake