Toast Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
audio_snapshot_volume.hpp
Go to the documentation of this file.
1
8
#pragma once
9
10
#include "
../assets.hpp
"
11
#include "audio_volume.hpp"
12
13
namespace
toast {
14
21
class
TOAST_API [[ToastNode, Color(
"Beige"
), Icon(
"Area"
)]]
SnapshotVolume
:
public
AudioVolume
{
22
public
:
23
auto
evaluateTarget
(
const
VolumeTarget
& target,
float
weight = 1.0f) ->
bool
override
;
24
25
void
resetAccumulators()
override
;
26
27
void
onAudioTargetEnter(
const
VolumeTarget
& target)
override
;
28
void
onAudioTargetExit(
const
VolumeTarget
& target)
override
;
29
30
private
:
31
void
updateInspectorMessages()
override
;
32
void
onVolumeTick()
override
;
33
void
onEnable();
34
void
onDisable();
35
36
[[
Reflect
]]
37
assets::Handle<assets::AudioSnapshot>
m_snapshot;
38
39
[[
Reflect
, Unit(
"s"
)]]
40
float
m_fade_in = 0.2f;
41
42
[[
Reflect
, Unit(
"s"
)]]
43
float
m_fade_out = 0.2f;
44
45
float
m_accumulated_weight = 0.0f;
46
float
m_current_intensity = 0.0f;
47
};
48
49
}
assets.hpp
assets::Handle
Type-safe smart pointer for assets.
Definition
core_types.hpp:149
toast::AudioVolume
Base interface for audio-reactive volumes.
Definition
audio_volume.hpp:25
toast::Reflect
Definition
reflect.hpp:244
toast::SnapshotVolume
Fades an FMOD snapshot in and out based on accumulated listener weight.
Definition
audio_snapshot_volume.hpp:21
toast::SnapshotVolume::evaluateTarget
auto evaluateTarget(const VolumeTarget &target, float weight=1.0f) -> bool override
Evaluates if a target is inside the volume or not.
Definition
audio_snapshot_volume.cpp:36
toast::VolumeTarget
What a volume is being evaluated against: a listener, a camera, anything with a position.
Definition
volume.hpp:19
engine
src
toast
audio
nodes
audio_snapshot_volume.hpp
Generated by
1.17.0