diff options
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Physics/Bullet/CcdPhysicsController.cpp | 30 |
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); |