Files
godot-docs/classes/class_occludershapesphere.rst
2022-07-27 15:58:06 +02:00

77 lines
3.7 KiB
ReStructuredText

: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/OccluderShapeSphere.xml.
.. _class_OccluderShapeSphere:
OccluderShapeSphere
===================
**Inherits:** :ref:`OccluderShape<class_OccluderShape>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Spherical 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.
This shape can include multiple spheres. These can be created and deleted either in the Editor inspector or by calling ``set_spheres``. The sphere positions can be set by dragging the handle in the Editor viewport. The radius can be set with the smaller handle.
Properties
----------
+---------------------------+------------------------------------------------------------+-----------------------------+
| :ref:`Array<class_Array>` | :ref:`spheres<class_OccluderShapeSphere_property_spheres>` | ``[ Plane( 0, 0, 0, 1 ) ]`` |
+---------------------------+------------------------------------------------------------+-----------------------------+
Methods
-------
+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_sphere_position<class_OccluderShapeSphere_method_set_sphere_position>` **(** :ref:`int<class_int>` index, :ref:`Vector3<class_Vector3>` position **)** |
+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_sphere_radius<class_OccluderShapeSphere_method_set_sphere_radius>` **(** :ref:`int<class_int>` index, :ref:`float<class_float>` radius **)** |
+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Property Descriptions
---------------------
.. _class_OccluderShapeSphere_property_spheres:
- :ref:`Array<class_Array>` **spheres**
+-----------+-----------------------------+
| *Default* | ``[ Plane( 0, 0, 0, 1 ) ]`` |
+-----------+-----------------------------+
| *Setter* | set_spheres(value) |
+-----------+-----------------------------+
| *Getter* | get_spheres() |
+-----------+-----------------------------+
The sphere data can be accessed as an array of :ref:`Plane<class_Plane>`\ s. The position of each sphere is stored in the ``normal``, and the radius is stored in the ``d`` value of the plane.
Method Descriptions
-------------------
.. _class_OccluderShapeSphere_method_set_sphere_position:
- void **set_sphere_position** **(** :ref:`int<class_int>` index, :ref:`Vector3<class_Vector3>` position **)**
Sets an individual sphere's position.
----
.. _class_OccluderShapeSphere_method_set_sphere_radius:
- void **set_sphere_radius** **(** :ref:`int<class_int>` index, :ref:`float<class_float>` radius **)**
Sets an individual sphere's radius.
.. |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.)`