Hi, I've been researching convex/concave collision algorithms and am looking for some direction. When it comes to convex/convex, things are pretty easy to research (practically any Google search will return you GJK!), but I'm not entirely sure the optimal path for collisions between convex and arbitrary concave objects. Note for my purposes, I would be using a triangle mesh to describe the concave objects. From what I've seen online there are two options:
- a) Run Convex/Triangle intersection test against your convex object and every triangle in the mesh (making sure to respect the normal direction of the triangle). This can be optimized by precomputing the triangle mesh into a Bounding Volume Hierarchy, like a BSP Tree or Octree.
- b) Decompose the triangle mesh into a set of convex objects.
These kind of feel the same to me at a high level, since if you partition the space in A you're basically just decomposing your mesh into smaller objects anyways? The difference I see is that the object at the lowest level of the tree in B is much more efficient to test against, since it's just a single convex hull as opposed to a bunch of triangles in A. However, I'm guessing that building correct convex hulls that properly wrap the mesh could be more difficult to implement than A.
My use case is primarily for (ellipsoid or capsule) character collision (and other convex game objects) with world meshes. I'm leaning towards A for it's simplicity, but I wanted to get some input on possible options beforehand. As well, if A is a good option, is a BSP Tree the best way to go based on my use case?
Any input is appreciated, thanks very much.
Erik