123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- :github_url: hide
- .. DO NOT EDIT THIS FILE!!!
- .. Generated automatically from Godot engine sources.
- .. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
- .. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/OccluderShapePolygon.xml.
- .. _class_OccluderShapePolygon:
- OccluderShapePolygon
- ====================
- **Inherits:** :ref:`OccluderShape<class_OccluderShape>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
- Polygon occlusion primitive for use with the :ref:`Occluder<class_Occluder>` node.
- .. rst-class:: classref-introduction-group
- Description
- -----------
- :ref:`OccluderShape<class_OccluderShape>`\ s are resources used by :ref:`Occluder<class_Occluder>` nodes, allowing geometric occlusion culling.
- 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.
- 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.
- 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.
- .. rst-class:: classref-reftable-group
- Properties
- ----------
- .. table::
- :widths: auto
- +-------------------------------------------------+---------------------------------------------------------------------------+----------------------------------------------------+
- | :ref:`PoolVector2Array<class_PoolVector2Array>` | :ref:`hole_points<class_OccluderShapePolygon_property_hole_points>` | ``PoolVector2Array( )`` |
- +-------------------------------------------------+---------------------------------------------------------------------------+----------------------------------------------------+
- | :ref:`PoolVector2Array<class_PoolVector2Array>` | :ref:`polygon_points<class_OccluderShapePolygon_property_polygon_points>` | ``PoolVector2Array( 1, -1, 1, 1, -1, 1, -1, -1 )`` |
- +-------------------------------------------------+---------------------------------------------------------------------------+----------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`two_way<class_OccluderShapePolygon_property_two_way>` | ``true`` |
- +-------------------------------------------------+---------------------------------------------------------------------------+----------------------------------------------------+
- .. rst-class:: classref-reftable-group
- Methods
- -------
- .. table::
- :widths: auto
- +------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_hole_point<class_OccluderShapePolygon_method_set_hole_point>` **(** :ref:`int<class_int>` index, :ref:`Vector2<class_Vector2>` position **)** |
- +------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_polygon_point<class_OccluderShapePolygon_method_set_polygon_point>` **(** :ref:`int<class_int>` index, :ref:`Vector2<class_Vector2>` position **)** |
- +------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Property Descriptions
- ---------------------
- .. _class_OccluderShapePolygon_property_hole_points:
- .. rst-class:: classref-property
- :ref:`PoolVector2Array<class_PoolVector2Array>` **hole_points** = ``PoolVector2Array( )``
- .. rst-class:: classref-property-setget
- - void **set_hole_points** **(** :ref:`PoolVector2Array<class_PoolVector2Array>` value **)**
- - :ref:`PoolVector2Array<class_PoolVector2Array>` **get_hole_points** **(** **)**
- Allows changing the hole geometry from code.
- .. rst-class:: classref-item-separator
- ----
- .. _class_OccluderShapePolygon_property_polygon_points:
- .. rst-class:: classref-property
- :ref:`PoolVector2Array<class_PoolVector2Array>` **polygon_points** = ``PoolVector2Array( 1, -1, 1, 1, -1, 1, -1, -1 )``
- .. rst-class:: classref-property-setget
- - void **set_polygon_points** **(** :ref:`PoolVector2Array<class_PoolVector2Array>` value **)**
- - :ref:`PoolVector2Array<class_PoolVector2Array>` **get_polygon_points** **(** **)**
- Allows changing the polygon geometry from code.
- .. rst-class:: classref-item-separator
- ----
- .. _class_OccluderShapePolygon_property_two_way:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **two_way** = ``true``
- .. rst-class:: classref-property-setget
- - void **set_two_way** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **is_two_way** **(** **)**
- Specifies whether the occluder should operate from both sides. If ``false``, the occluder will operate one way only.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Method Descriptions
- -------------------
- .. _class_OccluderShapePolygon_method_set_hole_point:
- .. rst-class:: classref-method
- void **set_hole_point** **(** :ref:`int<class_int>` index, :ref:`Vector2<class_Vector2>` position **)**
- Sets an individual hole point position.
- .. rst-class:: classref-item-separator
- ----
- .. _class_OccluderShapePolygon_method_set_polygon_point:
- .. rst-class:: classref-method
- void **set_polygon_point** **(** :ref:`int<class_int>` index, :ref:`Vector2<class_Vector2>` position **)**
- Sets an individual polygon point position.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
|