ConvexPolygonShape2D¶
Inherits: Shape2D < Resource < Reference < Object
Convex polygon shape for 2D physics.
Description¶
Convex polygon shape for 2D physics. A convex polygon, whatever its shape, is internally decomposed into as many convex polygons as needed to ensure all collision checks against it are always done on convex polygons (which are faster to check).
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.
Properties¶
|
Methods¶
void |
set_point_cloud ( PoolVector2Array point_cloud ) |
Property Descriptions¶
PoolVector2Array points = PoolVector2Array( )
void set_points ( PoolVector2Array value )
PoolVector2Array get_points ( )
The polygon's list of vertices. Can be in either clockwise or counterclockwise order. Only set this property with convex hull points, use set_point_cloud to generate a convex hull shape from concave shape points.
Method Descriptions¶
void set_point_cloud ( PoolVector2Array point_cloud )
Based on the set of points provided, this creates and assigns the points property using the convex hull algorithm. Removing all unneeded points. See Geometry.convex_hull_2d for details.