Reverted tolerances for ConvexVSConvex
This commit is contained in:
parent
20fe6c4877
commit
5a2401bec2
|
@ -67,8 +67,8 @@ namespace SHADE
|
||||||
|
|
||||||
bool SHCollision::ConvexVsConvex(SHManifold& manifold, const SHCollisionShape& A, const SHCollisionShape& B) noexcept
|
bool SHCollision::ConvexVsConvex(SHManifold& manifold, const SHCollisionShape& A, const SHCollisionShape& B) noexcept
|
||||||
{
|
{
|
||||||
static constexpr float ABSOLUTE_TOLERANCE = 0.0005f;
|
static constexpr float ABSOLUTE_TOLERANCE = 0.01f;
|
||||||
static constexpr float RELATIVE_TOLERANCE = 1.002f;
|
static constexpr float RELATIVE_TOLERANCE = 0.95f;
|
||||||
|
|
||||||
const SHConvexPolyhedron& POLY_A = reinterpret_cast<const SHConvexPolyhedron&>(A);
|
const SHConvexPolyhedron& POLY_A = reinterpret_cast<const SHConvexPolyhedron&>(A);
|
||||||
const SHConvexPolyhedron& POLY_B = reinterpret_cast<const SHConvexPolyhedron&>(B);
|
const SHConvexPolyhedron& POLY_B = reinterpret_cast<const SHConvexPolyhedron&>(B);
|
||||||
|
@ -130,7 +130,7 @@ namespace SHADE
|
||||||
const SHConvexPolyhedron* incidentPoly = nullptr;
|
const SHConvexPolyhedron* incidentPoly = nullptr;
|
||||||
|
|
||||||
SHCollisionUtils::FaceQuery minFaceQuery;
|
SHCollisionUtils::FaceQuery minFaceQuery;
|
||||||
if (FACE_QUERY_A.bestDistance > FACE_QUERY_B.bestDistance * RELATIVE_TOLERANCE + ABSOLUTE_TOLERANCE)
|
if (FACE_QUERY_A.bestDistance + ABSOLUTE_TOLERANCE > FACE_QUERY_B.bestDistance * RELATIVE_TOLERANCE)
|
||||||
{
|
{
|
||||||
minFaceQuery = FACE_QUERY_A;
|
minFaceQuery = FACE_QUERY_A;
|
||||||
referencePoly = &POLY_A;
|
referencePoly = &POLY_A;
|
||||||
|
@ -157,7 +157,7 @@ namespace SHADE
|
||||||
|
|
||||||
// If an edge pair contains the closest distance,vwe ignore any face queries and find the closest points on
|
// If an edge pair contains the closest distance,vwe ignore any face queries and find the closest points on
|
||||||
// each edge and use that as the contact point.
|
// each edge and use that as the contact point.
|
||||||
if (EDGE_QUERY.bestDistance * RELATIVE_TOLERANCE + ABSOLUTE_TOLERANCE > minFaceQuery.bestDistance + ABSOLUTE_TOLERANCE)
|
if (EDGE_QUERY.bestDistance * RELATIVE_TOLERANCE > minFaceQuery.bestDistance + ABSOLUTE_TOLERANCE)
|
||||||
{
|
{
|
||||||
const SHHalfEdgeStructure::HalfEdge& HALF_EDGE_A = POLY_A.GetHalfEdge(EDGE_QUERY.halfEdgeA);
|
const SHHalfEdgeStructure::HalfEdge& HALF_EDGE_A = POLY_A.GetHalfEdge(EDGE_QUERY.halfEdgeA);
|
||||||
const SHHalfEdgeStructure::HalfEdge& HALF_EDGE_B = POLY_B.GetHalfEdge(EDGE_QUERY.halfEdgeB);
|
const SHHalfEdgeStructure::HalfEdge& HALF_EDGE_B = POLY_B.GetHalfEdge(EDGE_QUERY.halfEdgeB);
|
||||||
|
|
Loading…
Reference in New Issue