In lack of camera entity I created a Listener cube to test 3D sound. Works fine. Updates listener pos each tick.

This commit is contained in:
stiffly
2016-01-07 16:03:33 +01:00
parent d8c4c6e5ff
commit 2838446072
3 changed files with 25 additions and 9 deletions
+8 -1
View File
@@ -65,7 +65,14 @@ Game::Game(int argc, char* argv[])
networkFunction();
}
EVENT_SUBSCRIBE_MEMBER(m_EInputCommand, &Game::debugOnInputCommand);
m_SoundSystem = new SoundSystem(m_EventBroker);
m_SoundSystem = new SoundSystem(m_World, m_EventBroker);
auto soundListenerCube = m_World->CreateEntity();
m_World->AttachComponent(soundListenerCube, "Listener");
m_World->AttachComponent(soundListenerCube, "Transform");
auto model = m_World->AttachComponent(soundListenerCube, "Model");
model["Resource"] = "Models/Core/UnitCube.obj";
model["Color"] = glm::vec4(1, 0, 0, 1);
m_LastTime = glfwGetTime();
}