Search code examples
algorithmmathvectorgeometrycollision-detection

Shape casting a capsule against convex polyhedra


Let's say I have a upright capsule shape (swept sphere) that I would like to cast it along a velocity vector. I would like to be able to find the point of contact and a surface normal for any convex shapes it would intersect along this path. I would also like to find the distance the swept caspule traveled to the point of first contact.

Heres a quick diagram of a capsule being casted against a large convex polyhedra (only one face is drawn) enter image description here

What kind of algorithm or process could do this? I assume it would be similar to a sphere-cast, but i can't find much on that either.


Solution

  • Since you are considering capsules and convex polyhedra, I suppose you could use something based on GJK. You would get the point of contact and a surface normal during a collision, and the minimum distance between the objects and the associated witness points if there is no collision.

    You can also take a look at this publication on Interactive and Continuous Collision Detection for Avatars in Virtual Environments.