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:
authorCampbell Barton <ideasman42@gmail.com>2013-07-23 12:28:28 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-07-23 12:28:28 +0400
commit28299d98fb93e87b2322d0533395254e2792a86f (patch)
treeb32d6cff39d1cc5f31bfa1201b623dd24dde04ff /source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
parent4a999f9e96965bd4aa45ce4cdd5c225bbf901226 (diff)
svn merge ^/trunk/blender -c58374 -c58406 -c58422 -c58427 -c58436 -c58440 -c58441 -c58463 -c58504 -c58509 -c58512 -c58513 -c58514 -c58516 -c58520 -c58532 -c58534v2.68a
Diffstat (limited to 'source/gameengine/Physics/Bullet/CcdPhysicsController.cpp')
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsController.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
index b389347cdb0..0604157a420 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
@@ -1587,6 +1587,21 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, DerivedMesh* dm,
if (mf->v4 && vert_tag_array[mf->v4] == false) {vert_tag_array[mf->v4] = true; tot_bt_verts++;}
}
}
+
+ /* Can happen with ngons */
+ if (!tot_bt_verts) {
+ m_shapeType = PHY_SHAPE_NONE;
+ m_meshObject = NULL;
+ m_vertexArray.clear();
+ m_polygonIndexArray.clear();
+ m_triFaceArray.clear();
+ m_triFaceUVcoArray.clear();
+ if (free_dm) {
+ dm->release(dm);
+ dm = NULL;
+ }
+ return false;
+ }
m_vertexArray.resize(tot_bt_verts*3);
@@ -1662,6 +1677,21 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, DerivedMesh* dm,
}
}
+ /* Can happen with ngons */
+ if (!tot_bt_verts) {
+ m_shapeType = PHY_SHAPE_NONE;
+ m_meshObject = NULL;
+ m_vertexArray.clear();
+ m_polygonIndexArray.clear();
+ m_triFaceArray.clear();
+ m_triFaceUVcoArray.clear();
+ if (free_dm) {
+ dm->release(dm);
+ dm = NULL;
+ }
+ return false;
+ }
+
m_vertexArray.resize(tot_bt_verts*3);
m_polygonIndexArray.resize(tot_bt_tris);
m_triFaceArray.resize(tot_bt_tris*3);