So basically I’m developing a destruction system, following a research paper by Dries Deryckere and it seems the best way to maintain collision on my mesh as well as maintain the ability to bend and destroy it while keeping bugs out, is to use a multi convex hull collision.
So basically I’ll be using this collision on the entire vehicle, i.e around 20 separate meshes. Will this become computationally expensive for my game?
Thank you for the link but my question wasn’t about how to make or import the collision shapes but it was about the performance, which is best, a lot of box or a few convex ?
Boxes are the simplest only being beat by spheres, but if you add a lot then you might as well just use fewer convex.
Boxes are ok if your object fits the shape, but if you have to start box modelling with many of them that sort of defeats the point.
Box collision will check intersections based on a math formula of the origin and width, height and depth which would on its own be faster than a convex check.
But if you have many to do it adds up.
Convex on the other hand has to check if another primitive is within it’s volume of vertices. More expensive to do but if the collision doesn’t have to many verts and follows the shape well the it beats out many boxes.
In order.
Boxes cost the least solely because of branching (for stuff like Chaos this may not be true).
Spheres are 2nd because Pi*r is fairly simple.
Sphiels are 3rd as they combine spheres and boxes.
Ucx is last, as math is done on its definition parameters, which can be rather complex.
However I do think Nvidia implements branching on those too, so a box may cost the same as a UCX if they both define the same box - hypothetically.
All of this really only matters if you have billions of objects in the scene getting checked for collisions. (Well maybe 1000 or so, but just becase the latest engine version are pathetic.)
The engine UCX generation tool is decent, but keep the vertex count as low as you can and just limit to 1 hull whenever possible.
why would you need Pi to check collision with a sphere ? It’s just a center and a radius so in the end you can just check the distance² from the center with the radius², I bet that’s cheaper than all other primitive shapes’ collision checks
Go look it up in the Nvidia developer stuff. They have specific reasons for not checking Diameter as if it were a box prior to refining and looking for the exact sphere collision.
Also, generally using just the center point and a radius you can figure out the precise intersecrion without PI if you know other parameters (like where the intersection is expected to come from).
The Nvidia stuff is helpful if you are trying to develop your own system or if you just want to learn what works in practice vs what works in theory…