From 57e2e404bc209a90897de987e381d258e66ea580 Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Mon, 10 Mar 2014 04:44:35 +0100 Subject: [PATCH] HALLELUJAH --- Escape-the-Dawn/Systems/SoundsSystem.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Escape-the-Dawn/Systems/SoundsSystem.cpp b/Escape-the-Dawn/Systems/SoundsSystem.cpp index aac7de2..6f34e8c 100644 --- a/Escape-the-Dawn/Systems/SoundsSystem.cpp +++ b/Escape-the-Dawn/Systems/SoundsSystem.cpp @@ -37,10 +37,10 @@ void Systems::SoundSystem::UpdateEntity(double dt, EntityID entity, EntityID par if (entityName == "Camera") { glm::vec3 playerPos = transformComponent->Position; - ALfloat listenerPos[3] = { playerPos.x, playerPos.y, playerPos.z }; + ALfloat listenerPos[3] = { playerPos.x, playerPos.y, -playerPos.z }; glm::vec3 playerVel = transformComponent->Velocity; - ALfloat listenerVel[3] = { playerVel.x, playerVel.y, playerVel.z }; + ALfloat listenerVel[3] = { playerVel.x, playerVel.y, -playerVel.z }; glm::fquat playerQuatOri = transformComponent->Orientation; glm::vec3 playerOriFW = glm::rotate(playerQuatOri, glm::vec3(0, 0, -1)); @@ -63,10 +63,10 @@ void Systems::SoundSystem::UpdateEntity(double dt, EntityID entity, EntityID par alSourcei(source, AL_LOOPING, soundEmitter->Loop); glm::vec3 emitterPos = transformComponent->Position; - ALfloat sourcePos[3] = { emitterPos.x, emitterPos.y, emitterPos.z }; + ALfloat sourcePos[3] = { emitterPos.x, emitterPos.y, -emitterPos.z }; glm::vec3 emitterVel= transformComponent->Position; - ALfloat sourceVel[3] = { emitterVel.x, emitterVel.y, emitterVel.z }; + ALfloat sourceVel[3] = { emitterVel.x, emitterVel.y, -emitterVel.z }; alSourcefv(source, AL_POSITION, sourcePos); alSourcefv(source, AL_VELOCITY, sourceVel); @@ -170,11 +170,5 @@ ALuint Systems::SoundSystem::CreateSource() ALuint source; alGenSources((ALuint)1, &source); - alSourcef(source, AL_GAIN, 1); //Volume - alSourcef(source, AL_PITCH, 1); - alSourcei(source, AL_LOOPING, AL_FALSE); - alSource3f(source, AL_POSITION, 0, 0, 0); - alSource3f(source, AL_VELOCITY, 0, 0, 0); - return source; } \ No newline at end of file