pub unsafe extern "C" fn phys_PxComputeTriangleMeshPenetration(
    direction: *mut PxVec3,
    depth: *mut f32,
    geom: *const PxGeometry,
    geomPose: *const PxTransform,
    meshGeom: *const PxTriangleMeshGeometry,
    meshPose: *const PxTransform,
    maxIter: u32,
    usedIter: *mut u32
) -> bool
Expand description

Computes an approximate minimum translational distance (MTD) between a geometry object and a mesh.

This iterative function computes an approximate vector that can be used to depenetrate a geom object from a triangle mesh. Returned depenetration vector should be applied to ‘geom’, to get out of the mesh.

The function works best when the amount of overlap between the geom object and the mesh is small. If the geom object’s center goes inside the mesh, backface culling usually kicks in, no overlap is detected, and the function does not compute an MTD vector.

The function early exits if no overlap is detected after a depenetration attempt. This means that if maxIter = N, the code will attempt at most N iterations but it might exit earlier if depenetration has been successful. Usually N = 4 gives good results.

True if the MTD has successfully been computed, i.e. if objects do overlap.