I've run into some problems with the two circles + rectangle for a capsule shape, so I'm trying to write a real one. I'm not 100% sure I've gotten everything correct, but I'm stuck on the polygon and edge contacts.
How should the capsule shape collide with edges and polygons? Here's some of the ways a polygon and capsule can intersect. (The red line is the segment that defines the capsule; a capsule is defined as a line segment + radius.)

I really don't know what algorithm to use for this or for edge shapes. Can someone point me in the right direction?
(BTW, I used an algorithm from Game Programming Gems 2, is that kosher on a free project?)
How should the capsule shape collide with edges and polygons? Here's some of the ways a polygon and capsule can intersect. (The red line is the segment that defines the capsule; a capsule is defined as a line segment + radius.)

I really don't know what algorithm to use for this or for edge shapes. Can someone point me in the right direction?
(BTW, I used an algorithm from Game Programming Gems 2, is that kosher on a free project?)