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

What does PenetrationHandling in ConvexConvexDistanceQueries.ConvexConvex mean?

Discussion in 'Physics for ECS' started by Mr-Mechanical, Dec 11, 2019.

  1. Mr-Mechanical

    Mr-Mechanical

    Joined:
    May 31, 2015
    Posts:
    507
    I'm looking at ConvexConvexDistanceQueries and I'm examining public static unsafe Result ConvexConvex(
    float3* verticesA, int numVerticesA, float3* verticesB, int numVerticesB,
    MTransform aFromB, PenetrationHandling penetrationHandling). How does the PenetrationHandling changed the compuation of the distance?

    Thanks a lot.
     
  2. MaxAbernethy

    MaxAbernethy

    Joined:
    Mar 16, 2019
    Posts:
    53
    Exact3D - does EPA if necessary
    DoNotCompute - no EPA, so if the shapes intersect or nearly intersect, the results will be inaccurate.

    The intention of DoNotCompute is for cases like triggers, where you only want to know whether two shapes are touching and don't need any other information like the distance to separate them. However, it looks to be unused, so it's probably not tested and may not work correctly :)
     
    Mr-Mechanical likes this.