Some new logic, m_Channels and m_Sounds added. Sound is really low...

This commit is contained in:
Stiffly
2014-05-25 01:34:57 +02:00
parent ecbcee0fbf
commit 3a638a356c
5 changed files with 97 additions and 45 deletions
+31 -8
View File
@@ -218,7 +218,7 @@ void GameWorld::Initialize()
{
auto tank = CreateEntity();
auto listener = AddComponent<Components::Listener>(tank);
auto transform = AddComponent<Components::Transform>(tank);
transform->Position = glm::vec3(0, 5, 0);
//transform->Orientation = glm::angleAxis(0.f, glm::vec3(0, 1, 0));
@@ -309,6 +309,7 @@ void GameWorld::Initialize()
auto cameraComp = AddComponent<Components::Camera>(camera);
cameraComp->FarClip = 2000.f;
AddComponent<Components::Input>(camera);
AddComponent<Components::Listener>(tank);
//auto freeSteering = AddComponent<Components::FreeSteering>(camera);
CommitEntity(camera);
}
@@ -688,13 +689,35 @@ void GameWorld::Initialize()
}
}
auto soundEmitter = CreateEntity();
auto transform = AddComponent<Components::Transform>(soundEmitter);
transform->Position = glm::vec3(0,10,0);
transform->Scale = glm::vec3(3);
AddComponent<Components::SoundEmitter>(soundEmitter);
auto model = AddComponent<Components::Model>(soundEmitter);
model->ModelFile = "Models/PlaceHolders/PhysicsTest/PointLight.obj";
{
auto se1 = CreateEntity();
auto transform = AddComponent<Components::Transform>(se1);
transform->Position = glm::vec3(0,10,0);
transform->Scale = glm::vec3(3);
auto emitterComponent = AddComponent<Components::SoundEmitter>(se1);
emitterComponent->Path = "Sounds/WUB.mp3";
emitterComponent->MinDistance = 1.f;
emitterComponent->MaxDistance = 50.f;
emitterComponent->Gain = 1;
auto model = AddComponent<Components::Model>(se1);
model->ModelFile = "Models/PlaceHolders/PhysicsTest/PointLight.obj";
CommitEntity(se1);
}
{
auto se2 = CreateEntity();
auto transform = AddComponent<Components::Transform>(se2);
transform->Position = glm::vec3(100,10,0);
transform->Scale = glm::vec3(3);
auto emitterComponent = AddComponent<Components::SoundEmitter>(se2);
emitterComponent->Path = "Sounds/DarkHorse.mp3";
emitterComponent->Gain = 1;
emitterComponent->MinDistance = 1.f;
emitterComponent->MaxDistance = 50.f;
auto model = AddComponent<Components::Model>(se2);
model->ModelFile = "Models/PlaceHolders/PhysicsTest/PointLight.obj";
CommitEntity(se2);
}
/*for (int x = 0; x < 5; x++)