Listener#
The 3D listener — the reference point used by the engine to pan sounds, attenuate by distance, and compute doppler shifts.
Upstream: YSE::listener.
Listener#
class Listener
Singleton 3D listener — the reference point used by the engine to pan sounds, attenuate by distance, and compute doppler shifts.
Update [position] every frame so velocity and doppler stay coherent. Access through [Listener.instance].
Static accessors#
static Listener get instance
Borrowed singleton accessor.
Properties#
Pos get position
set position(Pos value)
Current listener position in world coordinates.
Pos get velocity
Velocity derived from successive [position] updates. Cannot be set directly.
Pos get forward
Forward-facing unit vector of the listener.
Pos get upward
Upward unit vector of the listener.
Methods#
void orient(Pos forward, {Pos up = const Pos(0, 1, 0)})
Set the listener orientation.
[up] defaults to (0, 1, 0) — rotation confined to a horizontal plane.