diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-01-10 17:25:20 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-01-10 17:25:20 -0300 |
commit | cb9dfd5d28d52f774f1cef9e44927d43e31b2910 (patch) | |
tree | 036c586bae6f65bf2d02b2f635edacfcde76e511 | |
parent | eb7901c8b8182a258efd16acc1db1a8e318a520c (diff) |
avoid crash with empty concavepolygonshape, fixes #3169
-rw-r--r-- | servers/physics/shape_sw.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/servers/physics/shape_sw.cpp b/servers/physics/shape_sw.cpp index d289510cb6..5923f89120 100644 --- a/servers/physics/shape_sw.cpp +++ b/servers/physics/shape_sw.cpp @@ -1354,6 +1354,10 @@ void ConcavePolygonShapeSW::_fill_bvh(_VolumeSW_BVH* p_bvh_tree,BVH* p_bvh_array void ConcavePolygonShapeSW::_setup(DVector<Vector3> p_faces) { int src_face_count=p_faces.size(); + if (src_face_count==0) { + configure(AABB()); + return; + } ERR_FAIL_COND(src_face_count%3); src_face_count/=3; |