Class AudioComponent

Inheritance Relationships

Base Type

Derived Types

Class Documentation

class AudioComponent : public Component

Component that plays audio according to the listener’s position relative to the component.

Subclassed by MusicComponent, ShortMusicComponent

Public Functions

AudioComponent(Entity &owner, bool playOnStart, float volume, bool isLooping, bool attenuation, AudioSource::AttenuationModel model, ALfloat rolloffFactor, ALfloat referenceDistance, ALfloat maxDistance)
virtual ~AudioComponent()
void update()
bool isPlayOnStart() const
bool isAttenuated()
void setPlaying(bool enabled)
void play()
void stop()
void setLooping(bool enabled)
bool isLooping()
AudioSource *getAudioSource()
RigidBodyComponent *getCollider()
bool setupData()

Perform setting up internal data needed from other components after they have been added to the owning entity.

JSON::json getJSON() const

Get JSON representation of the component data needed to re-construct component from memory.

void draw()

Expose the component data with ImGui.

Protected Functions

void setAudioSource(AudioSource *audioSource)

Protected Attributes

bool m_IsPlayOnStart
bool m_IsLooping
String m_AttenuationModelName = "Linear"