# Swept 3d capsule intersection with AABB, what am I actually supposed to use to accomplish this?

I'm trying to figure out how to do continuous collision with a capsule (which would represent a collision volume for a player for example).

Given how common the capsule is in many game engines, and the fact it is merely a circle swept along a line, I would assume that even just normal collision between it any boxes, triangles/arbitrary facets would be abundant, however, I'm having a hard time finding anything on capsule collision.

Somehow I guess I could figure out the swept volume/object intersection (box + 4 capsule collision detection), and binary search my way down to an approximate collision, but this seems far from ideal, especially given the simple shapes involved. I feel given the shapes I should be able to intersect directly and receive the results. I'm not sure how to figure out "where" something intersected along with a swept series with other methods (like GJK).

For my case, I'm currently focused on just AABB collisions and vertically oriented swept 3D capsules, which I hope to resolve (move capsule appropriately back with AABB collision).

• If your capsule is vertical and your boxes axis-aligned, you can reduce this to a circle versus AABB rectangle in 2D. If there's no collision in 2D, you're done. If there is, you might still fit above/underneath in 3D, so in those cases you can take the end of the capsule closest to the box and fire it as a sphere vs AABB test. Commented Jan 16, 2021 at 13:26
• This is the article I used long ago when starting with collision. Essentially what the author did was translate the player's ellipsoid (or could be a capsule) into a unit sphere (size of 1). The rest of the world gets translated by the same matrix and the collision detection gets simplified to just a line-face intersection test. Basically, you remove the capsule from the equation and would do a line-box intersection test. peroxide.dk/papers/collision/collision.pdf Commented Sep 14, 2021 at 15:30