Hi, I want to ask if you are planning to add cylinder as simplified collision? I understand why we have box and sphere. I do not understand why we have capsule (useless 99,9% of time) I would really love to see cylinder as collision (useful very often for wood logs and similar things)
Right now I always have to use cylinders as UCX (because capsule is just not OK to have on cylindrical shapes) And of course importing it as well is very needed feature (UCC I guess )
UE4 uses Nvidia’s PhysX as the solution for its physics system. Guess which physics solution doesn’t have a cylinder primitive.
(I didn’t check if there are others that don’t.)
Put this one on Nvidia.
Unless UE4 using another, better, physics solution is somehow in the cards.
Cylinder collision can be added on PhysX level as a custom primitive. It was there in the past but was removed for performance reasons. Basically you take capsule and box, gather collision information from both of them and then filter out points that don’t belong to cylinder shape - it’s slow and doesn’t scale well. You can get very similar results with a convex mesh.
Agree.
One of the main features of primitives is that their collision or overlap is done on basis of just mathematical description of primitive in contrary to convex meshes which involve testing individual triangles for collision.
i don’t think there is an equivalent math formula for cylinder. At least not in such form that would easily map to how PhysX treats primitives.
OK, so as far I know from this reading… making convex hull cylinder made from 6,8,10,12 segments will be faster, than if you make some capsule - boxes = cylinder, or some other mathematical solution?
I’m not mathematician, so I just settle for answer that it’s not so easy solution and so it’s not worth figuring it out
Boxes, Capsules and Spheres can be represented very easily mathematically without needing to use triangles or polygons, that’s why they exist. A capsule can be represented by a line and a distance from that line. The equation to find the distance from a line can be done very quickly, and can be used without any square roots too.
For a cylinder, you can use a couple of dot products to exclude hits in the hemisphere and restrict them to the cap only.
Using a convex hull isn’t the answer, because they are still treated as polygon collisions regardless of the shape.
I just skimmed it. By the looks of it it’s not added because doing so would bloat the entire codebase, so suggests using a convex mesh instead. To be honest, when I last tried that on a large scale for a cone shape, it performed utterly horrendously.
For a cylinder I’d just use a capsule then manually filter out objects by checking against the caps, or for a cone, use a sphere and dot-product. Works for overlap checks but not actual blocking collision of course. Each to their own though.
That would be cool but what i did as a workaround is just add a cylinder mesh set it to overlap all and check trace complex on move and use ccd in its params then used its on cpmponent begin overlap. works just like a box collision but is a cylinder. try it out.
by cylinder mesh i mean the one that ue4 provides in the primitives. the white colored one.
A capsule can be represented by a line and a distance from that line. The equation to find the distance from a line can be done very quickly, and can be used without any square roots too.