Skip to content

Commit

Permalink
Fix issue in SAT algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielChappuis committed Jan 28, 2019
1 parent 6bcb586 commit 528d7bf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/collision/narrowphase/SAT/SATAlgorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
using namespace reactphysics3d;

// Static variables initialization
const decimal SATAlgorithm::SEPARATING_AXIS_RELATIVE_TOLERANCE = decimal(1.02);
const decimal SATAlgorithm::SEPARATING_AXIS_ABSOLUTE_TOLERANCE = decimal(0.005);
const decimal SATAlgorithm::SEPARATING_AXIS_RELATIVE_TOLERANCE = decimal(1.002);
const decimal SATAlgorithm::SEPARATING_AXIS_ABSOLUTE_TOLERANCE = decimal(0.0005);

// Constructor
SATAlgorithm::SATAlgorithm(MemoryAllocator& memoryAllocator) : mMemoryAllocator(memoryAllocator) {
Expand Down Expand Up @@ -698,15 +698,15 @@ bool SATAlgorithm::testCollisionConvexPolyhedronVsConvexPolyhedron(NarrowPhaseIn

// We use penetration axis of polygon 1
isMinPenetrationFaceNormal = true;
minPenetrationDepth = penetrationDepth1;
minPenetrationDepth = std::min(penetrationDepth1, penetrationDepth2);
minFaceIndex = faceIndex1;
isMinPenetrationFaceNormalPolyhedron1 = true;
}
else {

// We use penetration axis of polygon 2
isMinPenetrationFaceNormal = true;
minPenetrationDepth = penetrationDepth2;
minPenetrationDepth = std::min(penetrationDepth1, penetrationDepth2);
minFaceIndex = faceIndex2;
isMinPenetrationFaceNormalPolyhedron1 = false;
}
Expand Down

0 comments on commit 528d7bf

Please sign in to comment.