pandemonium_engine_docs/classes/class_occludershapepolygon.rst

117 lines
5.8 KiB
ReStructuredText
Raw Normal View History

: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.
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.
Properties
----------
+-------------------------------------------------+---------------------------------------------------------------------------+----------------------------------------------------+
| :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`` |
+-------------------------------------------------+---------------------------------------------------------------------------+----------------------------------------------------+
Methods
-------
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 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 **)** |
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
Property Descriptions
---------------------
.. _class_OccluderShapePolygon_property_hole_points:
- :ref:`PoolVector2Array<class_PoolVector2Array>` **hole_points**
+-----------+--------------------------+
| *Default* | ``PoolVector2Array( )`` |
+-----------+--------------------------+
| *Setter* | set_hole_points(value) |
+-----------+--------------------------+
| *Getter* | get_hole_points() |
+-----------+--------------------------+
Allows changing the hole geometry from code.
----
.. _class_OccluderShapePolygon_property_polygon_points:
- :ref:`PoolVector2Array<class_PoolVector2Array>` **polygon_points**
+-----------+----------------------------------------------------+
| *Default* | ``PoolVector2Array( 1, -1, 1, 1, -1, 1, -1, -1 )`` |
+-----------+----------------------------------------------------+
| *Setter* | set_polygon_points(value) |
+-----------+----------------------------------------------------+
| *Getter* | get_polygon_points() |
+-----------+----------------------------------------------------+
Allows changing the polygon geometry from code.
----
.. _class_OccluderShapePolygon_property_two_way:
- :ref:`bool<class_bool>` **two_way**
+-----------+--------------------+
| *Default* | ``true`` |
+-----------+--------------------+
| *Setter* | set_two_way(value) |
+-----------+--------------------+
| *Getter* | is_two_way() |
+-----------+--------------------+
Specifies whether the occluder should operate from both sides. If ``false``, the occluder will operate one way only.
Method Descriptions
-------------------
.. _class_OccluderShapePolygon_method_set_hole_point:
- void **set_hole_point** **(** :ref:`int<class_int>` index, :ref:`Vector2<class_Vector2>` position **)**
Sets an individual hole point position.
----
.. _class_OccluderShapePolygon_method_set_polygon_point:
- 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.)`