169 lines
6.7 KiB
Text
169 lines
6.7 KiB
Text
|
: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/VisibilityEnabler.xml.
|
||
|
|
||
|
.. _class_VisibilityEnabler:
|
||
|
|
||
|
VisibilityEnabler
|
||
|
=================
|
||
|
|
||
|
**Inherits:** :ref:`VisibilityNotifier<class_VisibilityNotifier>` **<** :ref:`CullInstance<class_CullInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
||
|
|
||
|
Enables certain nodes only when approximately visible.
|
||
|
|
||
|
.. rst-class:: classref-introduction-group
|
||
|
|
||
|
Description
|
||
|
-----------
|
||
|
|
||
|
The VisibilityEnabler will disable :ref:`RigidBody<class_RigidBody>` and :ref:`AnimationPlayer<class_AnimationPlayer>` nodes when they are not visible. It will only affect other nodes within the same scene as the VisibilityEnabler itself.
|
||
|
|
||
|
If you just want to receive notifications, use :ref:`VisibilityNotifier<class_VisibilityNotifier>` instead.
|
||
|
|
||
|
\ **Note:** VisibilityEnabler uses an approximate heuristic for performance reasons. It doesn't take walls and other occlusion into account (unless you are using :ref:`Portal<class_Portal>`\ s). The heuristic is an implementation detail and may change in future versions. If you need precise visibility checking, use another method such as adding an :ref:`Area<class_Area>` node as a child of a :ref:`Camera<class_Camera>` node and/or :ref:`Vector3.dot<class_Vector3_method_dot>`.
|
||
|
|
||
|
\ **Note:** VisibilityEnabler will not affect nodes added after scene initialization.
|
||
|
|
||
|
.. rst-class:: classref-reftable-group
|
||
|
|
||
|
Properties
|
||
|
----------
|
||
|
|
||
|
.. table::
|
||
|
:widths: auto
|
||
|
|
||
|
+-------------------------+----------------------------------------------------------------------------+----------+
|
||
|
| :ref:`bool<class_bool>` | :ref:`freeze_bodies<class_VisibilityEnabler_property_freeze_bodies>` | ``true`` |
|
||
|
+-------------------------+----------------------------------------------------------------------------+----------+
|
||
|
| :ref:`bool<class_bool>` | :ref:`pause_animations<class_VisibilityEnabler_property_pause_animations>` | ``true`` |
|
||
|
+-------------------------+----------------------------------------------------------------------------+----------+
|
||
|
|
||
|
.. rst-class:: classref-reftable-group
|
||
|
|
||
|
Methods
|
||
|
-------
|
||
|
|
||
|
.. table::
|
||
|
:widths: auto
|
||
|
|
||
|
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| :ref:`bool<class_bool>` | :ref:`is_enabler_enabled<class_VisibilityEnabler_method_is_enabler_enabled>` **(** :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enabler **)** |const| |
|
||
|
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| void | :ref:`set_enabler<class_VisibilityEnabler_method_set_enabler>` **(** :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enabler, :ref:`bool<class_bool>` enabled **)** |
|
||
|
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
|
||
|
.. rst-class:: classref-section-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. rst-class:: classref-descriptions-group
|
||
|
|
||
|
Enumerations
|
||
|
------------
|
||
|
|
||
|
.. _enum_VisibilityEnabler_Enabler:
|
||
|
|
||
|
.. rst-class:: classref-enumeration
|
||
|
|
||
|
enum **Enabler**:
|
||
|
|
||
|
.. _class_VisibilityEnabler_constant_ENABLER_PAUSE_ANIMATIONS:
|
||
|
|
||
|
.. rst-class:: classref-enumeration-constant
|
||
|
|
||
|
:ref:`Enabler<enum_VisibilityEnabler_Enabler>` **ENABLER_PAUSE_ANIMATIONS** = ``0``
|
||
|
|
||
|
This enabler will pause :ref:`AnimationPlayer<class_AnimationPlayer>` nodes.
|
||
|
|
||
|
.. _class_VisibilityEnabler_constant_ENABLER_FREEZE_BODIES:
|
||
|
|
||
|
.. rst-class:: classref-enumeration-constant
|
||
|
|
||
|
:ref:`Enabler<enum_VisibilityEnabler_Enabler>` **ENABLER_FREEZE_BODIES** = ``1``
|
||
|
|
||
|
This enabler will freeze :ref:`RigidBody<class_RigidBody>` nodes.
|
||
|
|
||
|
.. _class_VisibilityEnabler_constant_ENABLER_MAX:
|
||
|
|
||
|
.. rst-class:: classref-enumeration-constant
|
||
|
|
||
|
:ref:`Enabler<enum_VisibilityEnabler_Enabler>` **ENABLER_MAX** = ``2``
|
||
|
|
||
|
Represents the size of the :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enum.
|
||
|
|
||
|
.. rst-class:: classref-section-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. rst-class:: classref-descriptions-group
|
||
|
|
||
|
Property Descriptions
|
||
|
---------------------
|
||
|
|
||
|
.. _class_VisibilityEnabler_property_freeze_bodies:
|
||
|
|
||
|
.. rst-class:: classref-property
|
||
|
|
||
|
:ref:`bool<class_bool>` **freeze_bodies** = ``true``
|
||
|
|
||
|
.. rst-class:: classref-property-setget
|
||
|
|
||
|
- void **set_enabler** **(** :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enabler, :ref:`bool<class_bool>` enabled **)**
|
||
|
- :ref:`bool<class_bool>` **is_enabler_enabled** **(** :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enabler **)** |const|
|
||
|
|
||
|
If ``true``, :ref:`RigidBody<class_RigidBody>` nodes will be paused.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_VisibilityEnabler_property_pause_animations:
|
||
|
|
||
|
.. rst-class:: classref-property
|
||
|
|
||
|
:ref:`bool<class_bool>` **pause_animations** = ``true``
|
||
|
|
||
|
.. rst-class:: classref-property-setget
|
||
|
|
||
|
- void **set_enabler** **(** :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enabler, :ref:`bool<class_bool>` enabled **)**
|
||
|
- :ref:`bool<class_bool>` **is_enabler_enabled** **(** :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enabler **)** |const|
|
||
|
|
||
|
If ``true``, :ref:`AnimationPlayer<class_AnimationPlayer>` nodes will be paused.
|
||
|
|
||
|
.. rst-class:: classref-section-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. rst-class:: classref-descriptions-group
|
||
|
|
||
|
Method Descriptions
|
||
|
-------------------
|
||
|
|
||
|
.. _class_VisibilityEnabler_method_is_enabler_enabled:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
:ref:`bool<class_bool>` **is_enabler_enabled** **(** :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enabler **)** |const|
|
||
|
|
||
|
Returns whether the enabler identified by given :ref:`Enabler<enum_VisibilityEnabler_Enabler>` constant is active.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_VisibilityEnabler_method_set_enabler:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
void **set_enabler** **(** :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enabler, :ref:`bool<class_bool>` enabled **)**
|
||
|
|
||
|
Sets active state of the enabler identified by given :ref:`Enabler<enum_VisibilityEnabler_Enabler>` constant.
|
||
|
|
||
|
.. |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.)`
|