GJK can be used for all shapes but what if the points in a figure aren't indexed, then how can we get the Minkowski space by adding the correct pairs of points even though we don't know them, and also there might be too many points in the heightmap? Do some game engines also precompute contact points for static colliders?

  • 1
    \$\begingroup\$ GJK can be used for all convex shapes. Terrain is generally not convex, so it's not an appropriate starting point for considering terrain collisions. Are you specifically thinking of heightmap based terrain, or voxel based, or something else? \$\endgroup\$
    – DMGregory
    Commented Oct 3, 2023 at 22:32
  • \$\begingroup\$ Is the collision of the terrain divided into several more abstract shapes? \$\endgroup\$
    – Nato
    Commented Oct 7, 2023 at 19:03
  • \$\begingroup\$ It can be, but again it depends on your situation. Can you edit your question to clarify what kind of terrain you're working with / how you've built it? \$\endgroup\$
    – DMGregory
    Commented Oct 7, 2023 at 19:30
  • \$\begingroup\$ I have a new idea: all of the terrain's vertices are put into a list, with each one's index being x+y+z, and we try to check a single point against it, which is also in the array. Then we search the array for the 3 closest points to the point we would like to check, then use normal techniques with triangles and points to see if it's inside, would this be efficient enough? \$\endgroup\$
    – Nato
    Commented Jan 13 at 18:11
  • \$\begingroup\$ If you mean that x+y+z as literal addition, that's a terrible idea that will result in a pile of index collisions. I think you'd be better off querying a heightmap, signed distance field, or sparse octree. But as I told you three months ago, to give you accurate help, we need you to edit your question to detail what kind of terrain you're using and how you've built it, plus what needs to collide against it. \$\endgroup\$
    – DMGregory
    Commented Jan 13 at 19:12


You must log in to answer this question.

Browse other questions tagged .