From a415ef6067c6113c8d1a54d740857280b5dd277f Mon Sep 17 00:00:00 2001 From: "erwin.coumans" Date: Tue, 18 Oct 2011 15:41:14 +0000 Subject: [PATCH] apply patch to fix incorrect co-planar polygon merging Thanks to fastflo for the report/patch. This fixes Issue 557 --- .../btPolyhedralConvexShape.cpp | 46 ++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp b/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp index bbf950f12..82def79cf 100644 --- a/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp +++ b/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp @@ -187,6 +187,7 @@ bool btPolyhedralConvexShape::initializePolyhedralFeatures() } + bool did_merge = false; if (coplanarFaceGroup.size()>1) { //do the merge: use Graham Scan 2d convex hull @@ -235,9 +236,52 @@ bool btPolyhedralConvexShape::initializePolyhedralFeatures() for (int i=0;im_faces.push_back(combinedFace); - } else + } + } + if(!did_merge) { for (int i=0;i