class_visibilityenabler.rst 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/VisibilityEnabler.xml.
  6. .. _class_VisibilityEnabler:
  7. VisibilityEnabler
  8. =================
  9. **Inherits:** :ref:`VisibilityNotifier<class_VisibilityNotifier>` **<** :ref:`CullInstance<class_CullInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Enables certain nodes only when approximately visible.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 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.
  15. If you just want to receive notifications, use :ref:`VisibilityNotifier<class_VisibilityNotifier>` instead.
  16. \ **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>`.
  17. \ **Note:** VisibilityEnabler will not affect nodes added after scene initialization.
  18. .. rst-class:: classref-reftable-group
  19. Properties
  20. ----------
  21. .. table::
  22. :widths: auto
  23. +-------------------------+----------------------------------------------------------------------------+----------+
  24. | :ref:`bool<class_bool>` | :ref:`freeze_bodies<class_VisibilityEnabler_property_freeze_bodies>` | ``true`` |
  25. +-------------------------+----------------------------------------------------------------------------+----------+
  26. | :ref:`bool<class_bool>` | :ref:`pause_animations<class_VisibilityEnabler_property_pause_animations>` | ``true`` |
  27. +-------------------------+----------------------------------------------------------------------------+----------+
  28. .. rst-class:: classref-reftable-group
  29. Methods
  30. -------
  31. .. table::
  32. :widths: auto
  33. +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`bool<class_bool>` | :ref:`is_enabler_enabled<class_VisibilityEnabler_method_is_enabler_enabled>` **(** :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enabler **)** |const| |
  35. +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | void | :ref:`set_enabler<class_VisibilityEnabler_method_set_enabler>` **(** :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enabler, :ref:`bool<class_bool>` enabled **)** |
  37. +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. .. rst-class:: classref-section-separator
  39. ----
  40. .. rst-class:: classref-descriptions-group
  41. Enumerations
  42. ------------
  43. .. _enum_VisibilityEnabler_Enabler:
  44. .. rst-class:: classref-enumeration
  45. enum **Enabler**:
  46. .. _class_VisibilityEnabler_constant_ENABLER_PAUSE_ANIMATIONS:
  47. .. rst-class:: classref-enumeration-constant
  48. :ref:`Enabler<enum_VisibilityEnabler_Enabler>` **ENABLER_PAUSE_ANIMATIONS** = ``0``
  49. This enabler will pause :ref:`AnimationPlayer<class_AnimationPlayer>` nodes.
  50. .. _class_VisibilityEnabler_constant_ENABLER_FREEZE_BODIES:
  51. .. rst-class:: classref-enumeration-constant
  52. :ref:`Enabler<enum_VisibilityEnabler_Enabler>` **ENABLER_FREEZE_BODIES** = ``1``
  53. This enabler will freeze :ref:`RigidBody<class_RigidBody>` nodes.
  54. .. _class_VisibilityEnabler_constant_ENABLER_MAX:
  55. .. rst-class:: classref-enumeration-constant
  56. :ref:`Enabler<enum_VisibilityEnabler_Enabler>` **ENABLER_MAX** = ``2``
  57. Represents the size of the :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enum.
  58. .. rst-class:: classref-section-separator
  59. ----
  60. .. rst-class:: classref-descriptions-group
  61. Property Descriptions
  62. ---------------------
  63. .. _class_VisibilityEnabler_property_freeze_bodies:
  64. .. rst-class:: classref-property
  65. :ref:`bool<class_bool>` **freeze_bodies** = ``true``
  66. .. rst-class:: classref-property-setget
  67. - void **set_enabler** **(** :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enabler, :ref:`bool<class_bool>` enabled **)**
  68. - :ref:`bool<class_bool>` **is_enabler_enabled** **(** :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enabler **)** |const|
  69. If ``true``, :ref:`RigidBody<class_RigidBody>` nodes will be paused.
  70. .. rst-class:: classref-item-separator
  71. ----
  72. .. _class_VisibilityEnabler_property_pause_animations:
  73. .. rst-class:: classref-property
  74. :ref:`bool<class_bool>` **pause_animations** = ``true``
  75. .. rst-class:: classref-property-setget
  76. - void **set_enabler** **(** :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enabler, :ref:`bool<class_bool>` enabled **)**
  77. - :ref:`bool<class_bool>` **is_enabler_enabled** **(** :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enabler **)** |const|
  78. If ``true``, :ref:`AnimationPlayer<class_AnimationPlayer>` nodes will be paused.
  79. .. rst-class:: classref-section-separator
  80. ----
  81. .. rst-class:: classref-descriptions-group
  82. Method Descriptions
  83. -------------------
  84. .. _class_VisibilityEnabler_method_is_enabler_enabled:
  85. .. rst-class:: classref-method
  86. :ref:`bool<class_bool>` **is_enabler_enabled** **(** :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enabler **)** |const|
  87. Returns whether the enabler identified by given :ref:`Enabler<enum_VisibilityEnabler_Enabler>` constant is active.
  88. .. rst-class:: classref-item-separator
  89. ----
  90. .. _class_VisibilityEnabler_method_set_enabler:
  91. .. rst-class:: classref-method
  92. void **set_enabler** **(** :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enabler, :ref:`bool<class_bool>` enabled **)**
  93. Sets active state of the enabler identified by given :ref:`Enabler<enum_VisibilityEnabler_Enabler>` constant.
  94. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  95. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  96. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  97. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`