diff --git a/Escape-the-Dawn/Systems/SoundSystem.h b/Escape-the-Dawn/Systems/SoundSystem.h index 33b51d9..126bb89 100644 --- a/Escape-the-Dawn/Systems/SoundSystem.h +++ b/Escape-the-Dawn/Systems/SoundSystem.h @@ -2,6 +2,7 @@ #define SoundEmitter_h__ #include "System.h" +#include "Systems/TransformSystem.h" #include "Components/Transform.h" #include "Components/SoundEmitter.h" #include diff --git a/Escape-the-Dawn/Systems/SoundsSystem.cpp b/Escape-the-Dawn/Systems/SoundsSystem.cpp index 864bff5..cc68156 100644 --- a/Escape-the-Dawn/Systems/SoundsSystem.cpp +++ b/Escape-the-Dawn/Systems/SoundsSystem.cpp @@ -64,7 +64,8 @@ void Systems::SoundSystem::UpdateEntity(double dt, EntityID entity, EntityID par alSourcef(source, AL_PITCH, soundEmitter->Pitch); alSourcei(source, AL_LOOPING, soundEmitter->Loop); - glm::vec3 emitterPos = transformComponent->Position; + auto transformSystem = m_World->GetSystem("TransformSystem"); + glm::vec3 emitterPos = transformSystem->AbsolutePosition(entity); ALfloat sourcePos[3] = { emitterPos.x, emitterPos.y, -emitterPos.z }; glm::vec3 emitterVel= transformComponent->Velocity;