class_listener.rst 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/Listener.xml.
  6. .. _class_Listener:
  7. Listener
  8. ========
  9. **Inherits:** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Overrides the location sounds are heard from.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Once added to the scene tree and enabled using :ref:`make_current<class_Listener_method_make_current>`, this node will override the location sounds are heard from. This can be used to listen from a location different from the :ref:`Camera<class_Camera>`.
  15. .. rst-class:: classref-reftable-group
  16. Methods
  17. -------
  18. .. table::
  19. :widths: auto
  20. +-----------------------------------+-------------------------------------------------------------------------------------------------+
  21. | void | :ref:`clear_current<class_Listener_method_clear_current>` **(** **)** |
  22. +-----------------------------------+-------------------------------------------------------------------------------------------------+
  23. | :ref:`Transform<class_Transform>` | :ref:`get_listener_transform<class_Listener_method_get_listener_transform>` **(** **)** |const| |
  24. +-----------------------------------+-------------------------------------------------------------------------------------------------+
  25. | :ref:`bool<class_bool>` | :ref:`is_current<class_Listener_method_is_current>` **(** **)** |const| |
  26. +-----------------------------------+-------------------------------------------------------------------------------------------------+
  27. | void | :ref:`make_current<class_Listener_method_make_current>` **(** **)** |
  28. +-----------------------------------+-------------------------------------------------------------------------------------------------+
  29. .. rst-class:: classref-section-separator
  30. ----
  31. .. rst-class:: classref-descriptions-group
  32. Method Descriptions
  33. -------------------
  34. .. _class_Listener_method_clear_current:
  35. .. rst-class:: classref-method
  36. void **clear_current** **(** **)**
  37. Disables the listener to use the current camera's listener instead.
  38. .. rst-class:: classref-item-separator
  39. ----
  40. .. _class_Listener_method_get_listener_transform:
  41. .. rst-class:: classref-method
  42. :ref:`Transform<class_Transform>` **get_listener_transform** **(** **)** |const|
  43. Returns the listener's global orthonormalized :ref:`Transform<class_Transform>`.
  44. .. rst-class:: classref-item-separator
  45. ----
  46. .. _class_Listener_method_is_current:
  47. .. rst-class:: classref-method
  48. :ref:`bool<class_bool>` **is_current** **(** **)** |const|
  49. Returns ``true`` if the listener was made current using :ref:`make_current<class_Listener_method_make_current>`, ``false`` otherwise.
  50. \ **Note:** There may be more than one Listener marked as "current" in the scene tree, but only the one that was made current last will be used.
  51. .. rst-class:: classref-item-separator
  52. ----
  53. .. _class_Listener_method_make_current:
  54. .. rst-class:: classref-method
  55. void **make_current** **(** **)**
  56. Enables the listener. This will override the current camera's listener.
  57. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  58. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  59. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  60. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`