MCPcopy Create free account
hub / github.com/Overload-Technologies/Overload / Update

Method Update

Sources/OvAudio/src/OvAudio/Core/AudioEngine.cpp:52–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52void OvAudio::Core::AudioEngine::Update()
53{
54 if (!IsValid())
55 {
56 return;
57 }
58
59 for (const auto& source : m_audioSources)
60 {
61 source.get().Update();
62 }
63
64 // Defines the listener position using the last listener created (If any)
65 const auto listener = FindMainListener();
66
67 if (listener.has_value())
68 {
69 const auto& transform = listener->GetTransform();
70 const auto& pos = transform.GetWorldPosition();
71 const auto at = transform.GetWorldForward() * -1.0f;
72 m_backend->set3dListenerPosition(pos.x, pos.y, pos.z);
73 m_backend->set3dListenerAt(at.x, at.y, at.z);
74 }
75 else
76 {
77 m_backend->set3dListenerPosition(0.0f, 0.0f, 0.0f);
78 m_backend->set3dListenerAt(0.0f, 0.0f, -1.0f);
79 }
80
81 m_backend->update3dAudio();
82}
83
84void OvAudio::Core::AudioEngine::Suspend()
85{

Callers

nothing calls this directly

Calls 6

set3dListenerPositionMethod · 0.80
set3dListenerAtMethod · 0.80
update3dAudioMethod · 0.80
getMethod · 0.45
has_valueMethod · 0.45
GetWorldForwardMethod · 0.45

Tested by

no test coverage detected