From c1b41b20b0e938152f3e100c7a56cfd5fc49cabf Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 30 Mar 2009 00:40:19 +0000 Subject: r19455 to Re-enable vertex welding for soft-bodies failed even on simple cases like a cube with scrambled mesh data. Please test before committing. m_vertexArray has no doubles now and is not aligned to 3, using m_triFaceArray to get the verts for each face. --- source/gameengine/Physics/Bullet/CcdPhysicsController.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index cc6be9a7ae3..bb2f53a1988 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -1577,10 +1577,14 @@ btCollisionShape* CcdShapeConstructionInfo::CreateBulletShape() btTriangleMesh* collisionMeshData = new btTriangleMesh(true,false); collisionMeshData->m_weldingThreshold = m_weldingThreshold1; bool removeDuplicateVertices=true; - // m_vertexArray is necessarily a multiple of 3 - for (int i=0;iaddTriangle(m_vertexArray[i+2],m_vertexArray[i+1],m_vertexArray[i],removeDuplicateVertices); + // m_vertexArray not in multiple of 3 anymore, use m_triFaceArray + for(int i=0; iaddTriangle( + m_vertexArray[m_triFaceArray[i]], + m_vertexArray[m_triFaceArray[i+1]], + m_vertexArray[m_triFaceArray[i+2]], + removeDuplicateVertices + ); } indexVertexArrays = collisionMeshData; -- cgit v1.2.3