Page 1 of 1

"Flat" capsule collision detection

Posted: Tue Dec 15, 2020 3:30 pm
by Apeirogon
Maybe someone here have worked with something like this, so...
I work on some simple capsule-capsule/capsule-plane collision detection algorithm. It already work on most cases, but not in one edge case.
What I should do if capsule "height" is much smaller than its "radius"? I mean, it have radius >9000 units and height only 1 unit. In such case default solution "get length of normal from capsule 'axis' to the plane/from one capsule to another" is wont work because radius (if it still can be named radius) is not constant and depends from direction in which it measures.
I should use some "fake" radius and made some kind of AND volumetric intersection of two spheres? Or in this case I should switch to the cylinder-plane/cylinder-capsule collision detection method? Or there are some other way?

Re: "Flat" capsule collision detection

Posted: Thu Dec 17, 2020 4:26 am
by Darkcrafter
Doesn't capsule come from cube with chamfered edges? Surely there will be no radius then. But there will be width, length, height and amount of chamfering.

Re: "Flat" capsule collision detection

Posted: Sat Dec 19, 2020 3:08 pm
by Apeirogon
No, its just an extension over simple sphere collision detection. For sphere case its just "is there are something at distance x (radius), or closer, from some point in space?" while for capsule its "is there are something at distance x (again, radius), or closer, from some line segment in space?".