소스 검색

Merge pull request #21571 from AndreaCatania/zerver

Fixed crash if convex has 0 vertices
Rémi Verschelde 7 년 전
부모
커밋
5eb32cc179
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      modules/bullet/shape_bullet.cpp

+ 3 - 0
modules/bullet/shape_bullet.cpp

@@ -340,6 +340,9 @@ void ConvexPolygonShapeBullet::setup(const Vector<Vector3> &p_vertices) {
 }
 
 btCollisionShape *ConvexPolygonShapeBullet::create_bt_shape(const btVector3 &p_implicit_scale, real_t p_extra_edge) {
+	if (!vertices.size())
+		// This is necessary since 0 vertices
+		return prepare(ShapeBullet::create_shape_empty());
 	btCollisionShape *cs(ShapeBullet::create_shape_convex(vertices));
 	cs->setLocalScaling(p_implicit_scale);
 	prepare(cs);