   Capsule - Box Collision Resolution
  Can anyone recommend a good guide and/or algorithm for resolving collision between capsules and boxes (in 2D)?Edit: I've found a pretty good example here of how to handle an OBB and line segment test http://www.gamasutra.com/features/19991018/Gomez_6.htmHowever, I am still searching for how to handle resolving this overlap once I have detected a collision.[Edited by - richardmonette on August 24, 2009 2:09:29 PM]
  A capsule is a box + 2 sphere -- correct?Therefore if you can handle boxes and spheres, you can handle capsules. Not sure if it's the most efficient method but you can start with that if you haven't already.   ;Quote:A capsule is a box + 2 sphere -- correct?Therefore if you can handle boxes and spheres, you can handle capsules.Hm, that doesn't sound right - I don't think there's any way to reduce a capsule-box test to multiple sphere-box tests.A capsule is the Minkowski sum of a sphere and a line segment (it's not a box and two spheres). To test for intersection between a capsule and a box, find the (or a) pair of closest points between the box and the medial segment of the capsule. From this pair of points you can determine whether the two objects are intersecting, and (usually, at least) construct a displacement vector that will resolve the intersection.   ;  What? :POk I must have a very wrong image of a capsule in my head.In 2D I see that as half a disc + box + other half of a disc.In 3D: half sphere + cylinder + other half of a sphereDoesn't that define a capsule?Like on this image (right);Quote:What? :POk I must have a very wrong image of a capsule in my head.In 2D I see that as half a disc + box + other half of a disc.In 3D: half sphere + cylinder + other half of a sphereDoesn't that define a capsule?Like on this image (right)Ah, I see, you were referring to the 2-d version of the problem (which I now see is what the OP is asking about anyway :).   