Unverified Commit 5eb32cc1 by Rémi Verschelde Committed by GitHub

Merge pull request #21571 from AndreaCatania/zerver

Fixed crash if convex has 0 vertices
parents 39cbb992 9a67a07a
...@@ -340,6 +340,9 @@ void ConvexPolygonShapeBullet::setup(const Vector<Vector3> &p_vertices) { ...@@ -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) { 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)); btCollisionShape *cs(ShapeBullet::create_shape_convex(vertices));
cs->setLocalScaling(p_implicit_scale); cs->setLocalScaling(p_implicit_scale);
prepare(cs); prepare(cs);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment