"Flat" capsule collision detection

If it's not ZDoom, it goes here.

"Flat" capsule collision detection

Postby Apeirogon » Tue Dec 15, 2020 3:30 pm

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?
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: "Flat" capsule collision detection

Postby Darkcrafter » Thu Dec 17, 2020 4:26 am

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.
User avatar
Darkcrafter
 
Joined: 23 Sep 2017
Location: South Russia
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: "Flat" capsule collision detection

Postby Apeirogon » Sat Dec 19, 2020 3:08 pm

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?".
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017


Return to Off-Topic

Who is online

Users browsing this forum: No registered users and 1 guest