Module sfml::audio::listener [−][src]
The audio listener is the point in the scene from where all the sounds are heard.
The audio listener defines the global properties of the audio environment, it defines where and how sounds and musics are heard.
If View
is the eyes of the user, then listener
is his ears (by the way, they are often
linked together – same position, orientation, etc.).
listener
is a simple interface, which allows to setup the listener in the 3D audio environment
(position, direction and up vector), and to adjust the global volume.
Usage example
use sfml::audio::listener; // Move the listener to the position (1, 0, -5) listener::set_position((1., 0., -5.)); // Make it face the right axis (1, 0, 0) listener::set_direction((1., 0., 0.)); // Reduce the global volume listener::set_global_volume(50.);
Functions
direction | Get the current orientation of the listener in the scene |
global_volume | Get the current value of the global volume |
position | Get the current position of the listener in the scene |
set_direction | Set the orientation of the listener in the scene |
set_global_volume | Change the global volume of all the sounds and musics |
set_position | Set the position of the listener in the scene |
set_up_vector | Set the upward vector of the listener in the scene. |
up_vector | Get the current upward vector of the listener in the scene. (not normalized) |