avoid adding degenerate faces to a Bullet soft body
authorErwin Coumans <blender@erwincoumans.com>
Fri, 26 Sep 2008 21:27:33 +0000 (21:27 +0000)
committerErwin Coumans <blender@erwincoumans.com>
Fri, 26 Sep 2008 21:27:33 +0000 (21:27 +0000)
extern/bullet2/src/BulletSoftBody/btSoftBody.cpp

index 7b7b2da910a052f36391fb6cb307792bfcfaf1c5..fb20cb68f8f199bc0ead31f26de57299edda47b1 100644 (file)
@@ -284,6 +284,13 @@ m_faces.push_back(f);
 //
 void                   btSoftBody::appendFace(int node0,int node1,int node2,Material* mat)
 {
+       if (node0==node1)
+               return;
+       if (node1==node2)
+               return;
+       if (node2==node0)
+               return;
+
        appendFace(-1,mat);
        Face&   f=m_faces[m_faces.size()-1];
        btAssert(node0!=node1);