소스 검색

avoid crash with empty concavepolygonshape, fixes #3169

Juan Linietsky 9 년 전
부모
커밋
cb9dfd5d28
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      servers/physics/shape_sw.cpp

+ 4 - 0
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;