diff --git a/ephysics/body/CollisionBody.hpp b/ephysics/body/CollisionBody.hpp index 17e15c4..27576d6 100644 --- a/ephysics/body/CollisionBody.hpp +++ b/ephysics/body/CollisionBody.hpp @@ -6,6 +6,7 @@ * @copyright 2017, Edouard DUPIN * @license MPL v2.0 (see license file) */ +#pragma once #include #include #include diff --git a/ephysics/collision/narrowphase/EPA/EPAAlgorithm.cpp b/ephysics/collision/narrowphase/EPA/EPAAlgorithm.cpp index afa3068..4cea217 100644 --- a/ephysics/collision/narrowphase/EPA/EPAAlgorithm.cpp +++ b/ephysics/collision/narrowphase/EPA/EPAAlgorithm.cpp @@ -303,7 +303,11 @@ void EPAAlgorithm::computePenetrationDepthAndContactPoints(const Simplex& _simpl EPHY_INFO(" point=" << points[indexNewVertex]); EPHY_INFO("close point=" << triangle->getClosestPoint()); EPHY_INFO(" ==>" << wDotv); - EPHY_ASSERT(wDotv >= 0.0, "depth penetration error"); + if (wDotv < 0.0) { + EPHY_ERROR("depth penetration error " << wDotv); + continue; + } + EPHY_ASSERT(wDotv >= 0.0, "depth penetration error " << wDotv); float wDotVSquare = wDotv * wDotv / triangle->getDistSquare(); if (wDotVSquare < upperBoundSquarePenDepth) { upperBoundSquarePenDepth = wDotVSquare;