Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/gameengine/Physics')
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsController.cpp12
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;