123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- :github_url: hide
- .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
- .. DO NOT EDIT THIS FILE, but the Listener.xml source instead.
- .. The source is found in doc/classes or modules/<name>/doc_classes.
- .. _class_Listener:
- Listener
- ========
- **Inherits:** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
- Overrides the location sounds are heard from.
- Description
- -----------
- 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>`.
- Methods
- -------
- +-----------------------------------+-------------------------------------------------------------------------------------------------+
- | void | :ref:`clear_current<class_Listener_method_clear_current>` **(** **)** |
- +-----------------------------------+-------------------------------------------------------------------------------------------------+
- | :ref:`Transform<class_Transform>` | :ref:`get_listener_transform<class_Listener_method_get_listener_transform>` **(** **)** |const| |
- +-----------------------------------+-------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_current<class_Listener_method_is_current>` **(** **)** |const| |
- +-----------------------------------+-------------------------------------------------------------------------------------------------+
- | void | :ref:`make_current<class_Listener_method_make_current>` **(** **)** |
- +-----------------------------------+-------------------------------------------------------------------------------------------------+
- Method Descriptions
- -------------------
- .. _class_Listener_method_clear_current:
- - void **clear_current** **(** **)**
- Disables the listener to use the current camera's listener instead.
- ----
- .. _class_Listener_method_get_listener_transform:
- - :ref:`Transform<class_Transform>` **get_listener_transform** **(** **)** |const|
- Returns the listener's global orthonormalized :ref:`Transform<class_Transform>`.
- ----
- .. _class_Listener_method_is_current:
- - :ref:`bool<class_bool>` **is_current** **(** **)** |const|
- Returns ``true`` if the listener was made current using :ref:`make_current<class_Listener_method_make_current>`, ``false`` otherwise.
- **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.
- ----
- .. _class_Listener_method_make_current:
- - void **make_current** **(** **)**
- Enables the listener. This will override the current camera's listener.
- .. |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.)`
|