Search Unity

Incorrect Convex Mesh Baking

Discussion in 'Physics' started by joshuacwilde, May 22, 2020.

  1. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    731
    As you can see in the picture, the convex hull generated by unity physics is incorrect. The bright green line is the mesh collider, with the orange line being the mesh used for the mesh renderer (and input into the mesh collider).

    How can I fix this?

    I do checking to ensure that it only generates a convex mesh in the first place. But even assuming it is concave, the convex hull should still totally contain the mesh.
     

    Attached Files:

  2. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    731
    ok so I tried using this : https://github.com/OskarSigvardsson/unity-quickhull to santize the data to be 100% sure it is convex before passing it to the mesh collider, but still have the same exact problem. Definitely appears to be a bug with Unity's convex hull generator, as this one on Github generates correctly.
     
  3. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    731
    Is there anyone from the dev team that could take a look at this? I’m not sure what else I can try to get this fixed.