class_convexpolygonshape2d.rst 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_ConvexPolygonShape2D:
  4. ConvexPolygonShape2D
  5. ====================
  6. **Inherits:** :ref:`Shape2D<class_shape2d>` **<** :ref:`Resource<class_resource>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. Convex Polygon Shape for 2D physics.
  11. Member Functions
  12. ----------------
  13. +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  14. | :ref:`Vector2Array<class_vector2array>` | :ref:`get_points<class_ConvexPolygonShape2D_get_points>` **(** **)** const |
  15. +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  16. | void | :ref:`set_point_cloud<class_ConvexPolygonShape2D_set_point_cloud>` **(** :ref:`Vector2Array<class_vector2array>` point_cloud **)** |
  17. +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  18. | void | :ref:`set_points<class_ConvexPolygonShape2D_set_points>` **(** :ref:`Vector2Array<class_vector2array>` points **)** |
  19. +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  20. Description
  21. -----------
  22. 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).
  23. The main difference between a :ref:`ConvexPolygonShape2D<class_convexpolygonshape2d>` and a :ref:`ConcavePolygonShape2D<class_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.
  24. Member Function Description
  25. ---------------------------
  26. .. _class_ConvexPolygonShape2D_get_points:
  27. - :ref:`Vector2Array<class_vector2array>` **get_points** **(** **)** const
  28. Return a list of points in either clockwise or counter clockwise order, forming a convex polygon.
  29. .. _class_ConvexPolygonShape2D_set_point_cloud:
  30. - void **set_point_cloud** **(** :ref:`Vector2Array<class_vector2array>` point_cloud **)**
  31. Currently, this method does nothing.
  32. .. _class_ConvexPolygonShape2D_set_points:
  33. - void **set_points** **(** :ref:`Vector2Array<class_vector2array>` points **)**
  34. Set a list of points in either clockwise or counter clockwise order, forming a convex polygon.