Skip to content

Commit c89c161

Browse files
committed
EPA: record out of iterations status
1 parent c4574bb commit c89c161

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/narrowphase/gjk.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -1588,7 +1588,8 @@ EPA::SimplexF* EPA::findBest() {
15881588
EPA::Status EPA::evaluate(GJK& gjk, const Vec3f& guess) {
15891589
GJK::Simplex& simplex = *gjk.getSimplex();
15901590
support_func_guess_t hint(gjk.support_hint);
1591-
if ((simplex.rank > 1) && gjk.encloseOrigin()) {
1591+
bool enclosed_origin = gjk.encloseOrigin();
1592+
if ((simplex.rank > 1) && enclosed_origin) {
15921593
while (hull.root) {
15931594
SimplexF* f = hull.root;
15941595
hull.remove(f);
@@ -1662,6 +1663,7 @@ EPA::Status EPA::evaluate(GJK& gjk, const Vec3f& guess) {
16621663
outer = *best;
16631664
}
16641665

1666+
status = ((iterations) < max_iterations) ? status : Failed;
16651667
normal = outer.n;
16661668
depth = outer.d;
16671669
result.rank = 3;

0 commit comments

Comments
 (0)