Skip to content
0.2.0-dev Download ZIP
55 lines ·3.2 KB Raw
1<?xml version="1.0" encoding="UTF-8" ?>
2<class name="AudioListener3D" inherits="Node3D" api_type="core" keywords="sound" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3 <brief_description>
4 Overrides the location sounds are heard from.
5 </brief_description>
6 <description>
7 Once added to the scene tree and enabled using [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 [Camera3D].
8 </description>
9 <tutorials>
10 </tutorials>
11 <methods>
12 <method name="clear_current">
13 <return type="void" />
14 <description>
15 Disables the listener to use the current camera's listener instead.
16 </description>
17 </method>
18 <method name="get_listener_transform" qualifiers="const">
19 <return type="Transform3D" />
20 <description>
21 Returns the listener's global orthonormalized [Transform3D].
22 </description>
23 </method>
24 <method name="is_current" qualifiers="const">
25 <return type="bool" />
26 <description>
27 Returns [code]true[/code] if the listener was made current using [method make_current], [code]false[/code] otherwise.
28 [b]Note:[/b] There may be more than one AudioListener3D marked as "current" in the scene tree, but only the one that was made current last will be used.
29 </description>
30 </method>
31 <method name="make_current">
32 <return type="void" />
33 <description>
34 Enables the listener. This will override the current camera's listener.
35 </description>
36 </method>
37 </methods>
38 <members>
39 <member name="doppler_tracking" type="int" setter="set_doppler_tracking" getter="get_doppler_tracking" enum="AudioListener3D.DopplerTracking" default="0">
40 If not [constant DOPPLER_TRACKING_DISABLED], this listener will simulate the [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] for objects changed in particular [code]_process[/code] methods.
41 [b]Note:[/b] The Doppler effect will only be heard on [AudioStreamPlayer3D]s if [member AudioStreamPlayer3D.doppler_tracking] is not set to [constant AudioStreamPlayer3D.DOPPLER_TRACKING_DISABLED].
42 </member>
43 </members>
44 <constants>
45 <constant name="DOPPLER_TRACKING_DISABLED" value="0" enum="DopplerTracking">
46 Disables [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] simulation (default).
47 </constant>
48 <constant name="DOPPLER_TRACKING_IDLE_STEP" value="1" enum="DopplerTracking">
49 Simulate [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] by tracking positions of objects that are changed in [code]_process[/code]. Changes in the relative velocity of this listener compared to those objects affect how audio is perceived (changing the audio's [member AudioStreamPlayer3D.pitch_scale]).
50 </constant>
51 <constant name="DOPPLER_TRACKING_PHYSICS_STEP" value="2" enum="DopplerTracking">
52 Simulate [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] by tracking positions of objects that are changed in [code]_physics_process[/code]. Changes in the relative velocity of this listener compared to those objects affect how audio is perceived (changing the audio's [member AudioStreamPlayer3D.pitch_scale]).
53 </constant>
54 </constants>
55</class>