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:
authorDaniel Stokes <kupomail@gmail.com>2013-07-20 02:11:26 +0400
committerDaniel Stokes <kupomail@gmail.com>2013-07-20 02:11:26 +0400
commit23dccfadf034d9fdc0de451a4fd8a8f9d160f4b0 (patch)
treebb4d820fb66bad3458d0e62d3a36aa42bd9239e3 /source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
parent318aacbc8cf1f80a145fd80e23b3f50cff0d0e44 (diff)
Bge fix [#33016] Blender crashes when I start the game engine
Caused by a bit of a disconnect from the BGE mesh and BMesh.
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);