ConvexPolygonShape2D

Inherits: Shape2D < Resource < Reference < Object

Category: Core

Brief Description

Convex Polygon Shape for 2D physics.

Member Functions

Vector2Array get_points ( ) const
void set_point_cloud ( Vector2Array point_cloud )
void set_points ( Vector2Array points )

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.

Member Function Description

Vector2Array get_points ( ) const

Return a list of points in either clockwise or counter clockwise order, forming a convex polygon.

void set_point_cloud ( Vector2Array point_cloud )

Currently, this method does nothing.

void set_points ( Vector2Array points )

Set a list of points in either clockwise or counter clockwise order, forming a convex polygon.

© 2014–2020 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
https://docs.godotengine.org/en/2.1/classes/class_convexpolygonshape2d.html