Skip to content

Create intermediate segments in ConcavePolygonShape2D.

Created by: madmiraal

Fixes #19353, fixes #29320.

A ConcavePolygonShape2D is expected to be similar to a ConvexPolygonShape2D. The description for ConcavePolygonShape2D states:

The main difference between a ConvexPolygonShape2D and a ConcavePolygonShape2D is that a concave polygon assumes it is concave and uses a more complex method of collision detection, and a convex one forces itself to be convex in order to speed up collision detection.

This patch makes them similar by using the points in the PoolVector2Array associated with a ConcavePolygonShape2D to create a contiguous, closed-loop of segments instead of requiring and grouping them into pairs of discontiguous segments, which leaves unexpected holes between the pairs.

Merge request reports