class_occludershapepolygon.rst 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/OccluderShapePolygon.xml.
  6. .. _class_OccluderShapePolygon:
  7. OccluderShapePolygon
  8. ====================
  9. **Inherits:** :ref:`OccluderShape<class_OccluderShape>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  10. Polygon occlusion primitive for use with the :ref:`Occluder<class_Occluder>` node.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. :ref:`OccluderShape<class_OccluderShape>`\ s are resources used by :ref:`Occluder<class_Occluder>` nodes, allowing geometric occlusion culling.
  15. The polygon must be a convex polygon. The polygon points can be created and deleted either in the Editor inspector or by calling ``set_polygon_points``. The points of the edges can be set by dragging the handles in the Editor viewport.
  16. Additionally each polygon occluder can optionally support a single hole. If you add at least three points in the Editor inspector to the hole, you can drag the edge points of the hole in the Editor viewport.
  17. In general, the lower the number of edges in polygons and holes, the faster the system will operate at runtime, so in most cases you will want to use 4 points for each.
  18. .. rst-class:: classref-reftable-group
  19. Properties
  20. ----------
  21. .. table::
  22. :widths: auto
  23. +-------------------------------------------------+---------------------------------------------------------------------------+----------------------------------------------------+
  24. | :ref:`PoolVector2Array<class_PoolVector2Array>` | :ref:`hole_points<class_OccluderShapePolygon_property_hole_points>` | ``PoolVector2Array( )`` |
  25. +-------------------------------------------------+---------------------------------------------------------------------------+----------------------------------------------------+
  26. | :ref:`PoolVector2Array<class_PoolVector2Array>` | :ref:`polygon_points<class_OccluderShapePolygon_property_polygon_points>` | ``PoolVector2Array( 1, -1, 1, 1, -1, 1, -1, -1 )`` |
  27. +-------------------------------------------------+---------------------------------------------------------------------------+----------------------------------------------------+
  28. | :ref:`bool<class_bool>` | :ref:`two_way<class_OccluderShapePolygon_property_two_way>` | ``true`` |
  29. +-------------------------------------------------+---------------------------------------------------------------------------+----------------------------------------------------+
  30. .. rst-class:: classref-reftable-group
  31. Methods
  32. -------
  33. .. table::
  34. :widths: auto
  35. +------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | void | :ref:`set_hole_point<class_OccluderShapePolygon_method_set_hole_point>` **(** :ref:`int<class_int>` index, :ref:`Vector2<class_Vector2>` position **)** |
  37. +------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | void | :ref:`set_polygon_point<class_OccluderShapePolygon_method_set_polygon_point>` **(** :ref:`int<class_int>` index, :ref:`Vector2<class_Vector2>` position **)** |
  39. +------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. .. rst-class:: classref-section-separator
  41. ----
  42. .. rst-class:: classref-descriptions-group
  43. Property Descriptions
  44. ---------------------
  45. .. _class_OccluderShapePolygon_property_hole_points:
  46. .. rst-class:: classref-property
  47. :ref:`PoolVector2Array<class_PoolVector2Array>` **hole_points** = ``PoolVector2Array( )``
  48. .. rst-class:: classref-property-setget
  49. - void **set_hole_points** **(** :ref:`PoolVector2Array<class_PoolVector2Array>` value **)**
  50. - :ref:`PoolVector2Array<class_PoolVector2Array>` **get_hole_points** **(** **)**
  51. Allows changing the hole geometry from code.
  52. .. rst-class:: classref-item-separator
  53. ----
  54. .. _class_OccluderShapePolygon_property_polygon_points:
  55. .. rst-class:: classref-property
  56. :ref:`PoolVector2Array<class_PoolVector2Array>` **polygon_points** = ``PoolVector2Array( 1, -1, 1, 1, -1, 1, -1, -1 )``
  57. .. rst-class:: classref-property-setget
  58. - void **set_polygon_points** **(** :ref:`PoolVector2Array<class_PoolVector2Array>` value **)**
  59. - :ref:`PoolVector2Array<class_PoolVector2Array>` **get_polygon_points** **(** **)**
  60. Allows changing the polygon geometry from code.
  61. .. rst-class:: classref-item-separator
  62. ----
  63. .. _class_OccluderShapePolygon_property_two_way:
  64. .. rst-class:: classref-property
  65. :ref:`bool<class_bool>` **two_way** = ``true``
  66. .. rst-class:: classref-property-setget
  67. - void **set_two_way** **(** :ref:`bool<class_bool>` value **)**
  68. - :ref:`bool<class_bool>` **is_two_way** **(** **)**
  69. Specifies whether the occluder should operate from both sides. If ``false``, the occluder will operate one way only.
  70. .. rst-class:: classref-section-separator
  71. ----
  72. .. rst-class:: classref-descriptions-group
  73. Method Descriptions
  74. -------------------
  75. .. _class_OccluderShapePolygon_method_set_hole_point:
  76. .. rst-class:: classref-method
  77. void **set_hole_point** **(** :ref:`int<class_int>` index, :ref:`Vector2<class_Vector2>` position **)**
  78. Sets an individual hole point position.
  79. .. rst-class:: classref-item-separator
  80. ----
  81. .. _class_OccluderShapePolygon_method_set_polygon_point:
  82. .. rst-class:: classref-method
  83. void **set_polygon_point** **(** :ref:`int<class_int>` index, :ref:`Vector2<class_Vector2>` position **)**
  84. Sets an individual polygon point position.
  85. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  86. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  87. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  88. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`