class AudioListener

Inherits: Component

Represents a listener that hears audio sources.

For spatial audio the volume and pitch of played audio is determined by the distance, orientation and velocity differences between the source and the listener.

Public

Constructors

AudioListener

AudioListener(const HSceneObject &parent)

Methods

~AudioListener

virtual ~AudioListener() noexcept = default

staticGetRttiStatic

static RTTIType *GetRttiStatic()

GetRtti

RTTIType *GetRtti() const

Returns an interface you can use to access class' Run Time Type Information.

Protected

Constructors

AudioListener

AudioListener()

Methods

OnDestroyed

void OnDestroyed() override

Called once just before the component is destroyed.

Called regardless of the state the component is in.

OnDisabled

void OnDisabled() override

Called every time a component is placed into the Stopped state.

This includes component destruction if component wasn't already in Stopped state during destruction. When called during destruction it is called before OnDestroyed.

OnEnabled

void OnEnabled() override

Called every time a component leaves the Stopped state, if the component is enabled.

This includes component creation if requirements for leaving the Stopped state are met. When called during creation it is called after OnBeginPlay.

OnTransformChanged

void OnTransformChanged(TransformChangedFlags flags) override

Called when the component's parent scene object has changed.

Not called if the component is in Stopped state. Also only called if necessary notify flags are set via SetNotifyFlagsInternal().

Update

void Update() override

Called once per frame.

Only called if the component is in Running state.

RestoreInternal

void RestoreInternal()

Creates the internal representation of the AudioListener and restores the values saved by the Component.

DestroyInternal

void DestroyInternal()

Destroys the internal AudioListener representation.

UpdateTransform

void UpdateTransform()

Updates the transform of the internal AudioListener representation from the transform of the component's scene object.

Fields

mImplementation

SPtr<IAudioListenerImplementation> mImplementation

mLastPosition

Vector3 mLastPosition

mVelocity

Vector3 mVelocity