Toast Engine
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
13namespace toast {
14
21class TOAST_API [[ToastNode, Color("Beige"), Icon("Area")]] SnapshotVolume : public AudioVolume {
22public:
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
30private:
31 void updateInspectorMessages() override;
32 void onVolumeTick() override;
33 void onEnable();
34 void onDisable();
35
36 [[Reflect]]
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}
Type-safe smart pointer for assets.
Definition core_types.hpp:149
Base interface for audio-reactive volumes.
Definition audio_volume.hpp:25
Definition reflect.hpp:244
Fades an FMOD snapshot in and out based on accumulated listener weight.
Definition audio_snapshot_volume.hpp:21
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
What a volume is being evaluated against: a listener, a camera, anything with a position.
Definition volume.hpp:19