fix saddle tunnel
This commit is contained in:
parent
5986b5b565
commit
a2adbafec0
6 changed files with 1569 additions and 1126 deletions
|
|
@ -3212,7 +3212,7 @@ int b3Hull2D( b3Point2D* pts, int count, b3Point2D* hull, int flags )
|
|||
}
|
||||
else
|
||||
{
|
||||
b3Weld2D( pts, count );
|
||||
count1 = b3Weld2D( pts, count );
|
||||
}
|
||||
|
||||
bool keepCollinear = ( flags & b3_hull2DKeepCollinear ) != 0;
|
||||
|
|
|
|||
|
|
@ -759,19 +759,19 @@ static b3NeighborResult b3TestNeighbors( const b3Shape* shape, int triangleIndex
|
|||
return b3IsInVertexRegion( vertices, vertexIndex, normal ) ? b3_neighborSkip : b3_neighborSnap;
|
||||
}
|
||||
|
||||
// Check vertex area first to avoid a saddle tunnel.
|
||||
if ( vertexIndex != B3_NULL_INDEX && b3IsInVertexRegion( vertices, vertexIndex, normal ) &&
|
||||
b3IsInVertexCone( shape, triangleIndex, vertexIndex, meshToLocal, normal ) )
|
||||
{
|
||||
return b3_neighborAdmit;
|
||||
}
|
||||
|
||||
if ( convex )
|
||||
{
|
||||
// todo comment
|
||||
return *ownerEdge == B3_NULL_INDEX ? b3_neighborDrop : b3_neighborSkip;
|
||||
}
|
||||
|
||||
// Check vertex.
|
||||
if ( vertexIndex != B3_NULL_INDEX &&
|
||||
b3AdmitsVertexNormal( shape, triangleIndex, vertices, vertexIndex, meshToLocal, normal ) )
|
||||
{
|
||||
return b3_neighborAdmit;
|
||||
}
|
||||
|
||||
return b3_neighborSnap;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue