vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
audio_source.h
1#pragma once
2
3#include "core/reflect.h"
4
5#include "resource/asset/audio_clip_asset.h"
6
7namespace Vkm::Engine {
8
18 AudioClipHandle clip;
19
20 float volume = 1.0f;
21 float pitch = 1.0f;
22 bool loop = false;
23
27 bool spatial = true;
28
35 bool playOnStart = true;
36
40 float minDistance = 1.0f;
41
47 float maxDistance = 50.0f;
48
49 bool playing = false;
50 bool started = false;
51};
52
53} // namespace Vkm::Engine
54
55VKM_REFLECT_BEGIN(::Vkm::Engine::AudioSource)
56 VKM_F(clip)
57 VKM_F(volume)
58 VKM_F(pitch)
59 VKM_F(loop)
60 VKM_F(spatial)
61 VKM_F(playOnStart)
62 VKM_F(minDistance)
63 VKM_F(maxDistance)
64VKM_REFLECT_END()
A sound emitter: one clip, how loud, and where it is heard from.
Definition audio_source.h:17
bool started
Whether playOnStart has been honoured; session state.
Definition audio_source.h:50
bool spatial
Whether the source is positioned in the world or mixed flat at constant volume.
Definition audio_source.h:27
bool playOnStart
Start playing on the first frame the simulation runs.
Definition audio_source.h:35
float volume
Linear gain, multiplied into the listener's own.
Definition audio_source.h:20
float maxDistance
Distance at which the source is inaudible.
Definition audio_source.h:47
bool playing
Session state.
Definition audio_source.h:49
bool loop
Restart at the end instead of finishing.
Definition audio_source.h:22
float pitch
Playback rate multiplier; also shifts the pitch. Must be > 0.
Definition audio_source.h:21
float minDistance
Radius inside which the source is at full volume: the size of the emitter.
Definition audio_source.h:40