class_visibilitynotifier.rst 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the VisibilityNotifier.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_VisibilityNotifier:
  6. VisibilityNotifier
  7. ==================
  8. **Inherits:** :ref:`CullInstance<class_CullInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Inherited By:** :ref:`VisibilityEnabler<class_VisibilityEnabler>`
  10. Detects approximately when the node is visible on screen.
  11. Description
  12. -----------
  13. 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<class_Camera>`'s view.
  14. If you want nodes to be disabled automatically when they exit the screen, use :ref:`VisibilityEnabler<class_VisibilityEnabler>` instead.
  15. **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<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>`.
  16. Properties
  17. ----------
  18. +-------------------------+-----------------------------------------------------+---------------------------------+
  19. | :ref:`AABB<class_AABB>` | :ref:`aabb<class_VisibilityNotifier_property_aabb>` | ``AABB( -1, -1, -1, 2, 2, 2 )`` |
  20. +-------------------------+-----------------------------------------------------+---------------------------------+
  21. Methods
  22. -------
  23. +-------------------------+---------------------------------------------------------------------------------------+
  24. | :ref:`bool<class_bool>` | :ref:`is_on_screen<class_VisibilityNotifier_method_is_on_screen>` **(** **)** |const| |
  25. +-------------------------+---------------------------------------------------------------------------------------+
  26. Signals
  27. -------
  28. .. _class_VisibilityNotifier_signal_camera_entered:
  29. - **camera_entered** **(** :ref:`Camera<class_Camera>` camera **)**
  30. Emitted when the VisibilityNotifier enters a :ref:`Camera<class_Camera>`'s view.
  31. ----
  32. .. _class_VisibilityNotifier_signal_camera_exited:
  33. - **camera_exited** **(** :ref:`Camera<class_Camera>` camera **)**
  34. Emitted when the VisibilityNotifier exits a :ref:`Camera<class_Camera>`'s view.
  35. ----
  36. .. _class_VisibilityNotifier_signal_screen_entered:
  37. - **screen_entered** **(** **)**
  38. Emitted when the VisibilityNotifier enters the screen.
  39. ----
  40. .. _class_VisibilityNotifier_signal_screen_exited:
  41. - **screen_exited** **(** **)**
  42. Emitted when the VisibilityNotifier exits the screen.
  43. Property Descriptions
  44. ---------------------
  45. .. _class_VisibilityNotifier_property_aabb:
  46. - :ref:`AABB<class_AABB>` **aabb**
  47. +-----------+---------------------------------+
  48. | *Default* | ``AABB( -1, -1, -1, 2, 2, 2 )`` |
  49. +-----------+---------------------------------+
  50. | *Setter* | set_aabb(value) |
  51. +-----------+---------------------------------+
  52. | *Getter* | get_aabb() |
  53. +-----------+---------------------------------+
  54. The VisibilityNotifier's bounding box.
  55. Method Descriptions
  56. -------------------
  57. .. _class_VisibilityNotifier_method_is_on_screen:
  58. - :ref:`bool<class_bool>` **is_on_screen** **(** **)** |const|
  59. If ``true``, the bounding box is on the screen.
  60. **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.
  61. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  62. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  63. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`