virtualx-engine-docs/_sources/classes/class_occludershapepolygon.rst.txt

153 lines
6.7 KiB
Text
Raw Permalink Normal View History

2024-10-23 18:41:33 +02:00
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.6/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. Primarily for use by the editor.
\ **Note:** This function will not resize the hole point array. Set :ref:`hole_points<class_OccluderShapePolygon_property_hole_points>` to set the number of points.
.. 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. Primarily for use by the editor.
\ **Note:** This function will not resize the polygon point array. Set :ref:`polygon_points<class_OccluderShapePolygon_property_polygon_points>` to set the number of points.
.. |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.)`