Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Which algorithm Unity uses for creating the 3D convex hull when generating convex Mesh colliders?

Discussion in 'General Graphics' started by louisXV, Nov 14, 2015.

  1. louisXV

    louisXV

    Joined:
    Oct 8, 2015
    Posts:
    10
    I was here wondering. Does anyone know, has any idea or suggestion on the reference for which algorithm Unity currently uses to generate the 3D convex hull when users add Mesh collider component and then select the "convex" option?

    I always like to understand what is going on under the hoods in my applications, but I've been struggling for a while to find that one out.

    Thanks!
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    It's whatever PhysX does, since that's the physics engine Unity uses for 3D.

    --Eric
     
  3. louisXV

    louisXV

    Joined:
    Oct 8, 2015
    Posts:
    10
    That makes sense, of course. The issue is that I was not sure whether PhysX even had its own convex hull implementation. But now that you mention, sounds reasonable since the engine would need a way of creating convex hull bounding polyhedra.
     
  4. macdude2

    macdude2

    Joined:
    Sep 22, 2010
    Posts:
    686
    Look up convex hull algorithms in Google, there's one that takes a series of points and finds the minimal bounding polygon. If I were to guess, they'd be using that one.
     
  5. louisXV

    louisXV

    Joined:
    Oct 8, 2015
    Posts:
    10
    Thanks for your reply, macdude2. The problem is which of the many algorithms that do that. Because there is more than one. And what I am interested in is precise in finding exactly which one.