: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/VisibilityNotifier.xml. .. _class_VisibilityNotifier: VisibilityNotifier ================== **Inherits:** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` **Inherited By:** :ref:`VisibilityEnabler` Detects approximately when the node is visible on screen. .. rst-class:: classref-introduction-group Description ----------- The VisibilityNotifier detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a :ref:`Camera`'s view. If you want nodes to be disabled automatically when they exit the screen, use :ref:`VisibilityEnabler` instead. \ **Note:** VisibilityNotifier uses an approximate heuristic for performance reasons. It doesn't take walls and other occlusion into account (unless you are using :ref:`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` node as a child of a :ref:`Camera` node and/or :ref:`Vector3.dot`. .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +---------------------------+---------------------------------------------------------------------+---------------------------------+ | :ref:`AABB` | :ref:`aabb` | ``AABB( -1, -1, -1, 2, 2, 2 )`` | +---------------------------+---------------------------------------------------------------------+---------------------------------+ | :ref:`float` | :ref:`max_distance` | ``0.0`` | +---------------------------+---------------------------------------------------------------------+---------------------------------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-------------------------+---------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_on_screen` **(** **)** |const| | +-------------------------+---------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Signals ------- .. _class_VisibilityNotifier_signal_camera_entered: .. rst-class:: classref-signal **camera_entered** **(** :ref:`Camera` camera **)** Emitted when the VisibilityNotifier enters a :ref:`Camera`'s view. .. rst-class:: classref-item-separator ---- .. _class_VisibilityNotifier_signal_camera_exited: .. rst-class:: classref-signal **camera_exited** **(** :ref:`Camera` camera **)** Emitted when the VisibilityNotifier exits a :ref:`Camera`'s view. .. rst-class:: classref-item-separator ---- .. _class_VisibilityNotifier_signal_screen_entered: .. rst-class:: classref-signal **screen_entered** **(** **)** Emitted when the VisibilityNotifier enters the screen. .. rst-class:: classref-item-separator ---- .. _class_VisibilityNotifier_signal_screen_exited: .. rst-class:: classref-signal **screen_exited** **(** **)** Emitted when the VisibilityNotifier exits the screen. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_VisibilityNotifier_property_aabb: .. rst-class:: classref-property :ref:`AABB` **aabb** = ``AABB( -1, -1, -1, 2, 2, 2 )`` .. rst-class:: classref-property-setget - void **set_aabb** **(** :ref:`AABB` value **)** - :ref:`AABB` **get_aabb** **(** **)** The VisibilityNotifier's bounding box. .. rst-class:: classref-item-separator ---- .. _class_VisibilityNotifier_property_max_distance: .. rst-class:: classref-property :ref:`float` **max_distance** = ``0.0`` .. rst-class:: classref-property-setget - void **set_max_distance** **(** :ref:`float` value **)** - :ref:`float` **get_max_distance** **(** **)** In addition to checking whether a node is on screen or within a :ref:`Camera`'s view, VisibilityNotifier can also optionally check whether a node is within a specified maximum distance when using a :ref:`Camera` with perspective projection. This is useful for throttling the performance requirements of nodes that are far away. \ **Note:** This feature will be disabled if set to 0.0. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_VisibilityNotifier_method_is_on_screen: .. rst-class:: classref-method :ref:`bool` **is_on_screen** **(** **)** |const| If ``true``, the bounding box is on the screen. \ **Note:** It takes one frame for the node's visibility to be assessed once added to the scene tree, so this method will return ``false`` right after it is instantiated, even if it will be on screen in the draw pass. .. |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.)`