From 96d6ff59d1614a8fabe520c7fd41527bbfc44b74 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Mon, 2 Oct 2017 23:32:06 +0200 Subject: [PATCH] [DEV] remove an assert ==> create some eratic comportment, and coorect build after licence change --- ephysics/body/CollisionBody.hpp | 1 + ephysics/collision/narrowphase/EPA/EPAAlgorithm.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) 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;