mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 06:11:29 +03:00
Fixed crash if convex has 0 vertices
(cherry picked from commit 9a67a07a2c)
This commit is contained in:
committed by
Rémi Verschelde
parent
5955526b25
commit
7957a7bd2e
@@ -291,6 +291,9 @@ void ConvexPolygonShapeBullet::setup(const Vector<Vector3> &p_vertices) {
|
||||
}
|
||||
|
||||
btCollisionShape *ConvexPolygonShapeBullet::create_bt_shape(const btVector3 &p_implicit_scale, real_t p_margin) {
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user