diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-03-30 04:40:19 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-03-30 04:40:19 +0400 |
commit | c1b41b20b0e938152f3e100c7a56cfd5fc49cabf (patch) | |
tree | 20cc810907ab7130fb7a00f8ef14b6586cda5156 | |
parent | b182778e7155abe09bd2101b851fb1178c9babb8 (diff) |
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.
-rw-r--r-- | source/gameengine/Physics/Bullet/CcdPhysicsController.cpp | 12 |
1 files 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;i<m_vertexArray.size(); i+=3 ) - { - collisionMeshData->addTriangle(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; i<m_triFaceArray.size(); i+=3) { + collisionMeshData->addTriangle( + m_vertexArray[m_triFaceArray[i]], + m_vertexArray[m_triFaceArray[i+1]], + m_vertexArray[m_triFaceArray[i+2]], + removeDuplicateVertices + ); } indexVertexArrays = collisionMeshData; |