I have searched through a lot of libraries and sources, that include very diverse intersection algorithms, for computer graphics. And I've never found a capsule-box intersection algorithm. Despite that there are algorithms between capsules and many other shapes. I wonder if it's because a capsule can be represented as a cylinder with two spheres at the end, and is cheaper to calculate than doing a capsule box algorithm? Or does some other algorithm cover it? Or is there any other reason?
1 Answer
$\begingroup$
$\endgroup$
2
I am surprised to read that capsule-capsule intersection algorithms are commonly found. This is an arduous problem, with many different cases, and complex high order curves that take quartic equations. Even cylindre-cylindre is daunting.
Caspule-box is easier as it is essentially cutting surfaces with planes, leading to arcs of conics. Anyway, the complete discussion is tedious.
-
$\begingroup$ From what I've found so far, it seems GJK algorithm need to be used for capsule box intersection $\endgroup$ Commented Aug 3, 2023 at 13:19
-
$\begingroup$ @LennyWhite: ok, this is intersection detection, not computation. In 3D, it amounts to checking the shortest distance between two line segments. GJK can be adapted to the capsule-box case. $\endgroup$– user1703Commented Aug 3, 2023 at 16:04