Fixing moving shadows of flames once again.

This commit is contained in:
Faerbit 2015-06-02 20:15:48 +02:00
parent bedc836cb0
commit 5f779ea3d5
2 changed files with 2 additions and 2 deletions

View File

@ -272,7 +272,7 @@ void main()
for(int i = 0; i<lightCount; i++) { for(int i = 0; i<lightCount; i++) {
vec3 lightPos = vec3(0.0, 0.0, 0.0); vec3 lightPos = vec3(0.0, 0.0, 0.0);
if (isFlame[i] == true) { if (isFlame[i] == true) {
lightPos = vec3(lightSources[i].x + 0.75*movement.y , lightSources[i].y, lightSources[i].z + 0.75*movement.x); lightPos = vec3(lightSources[i].x - 0.75*movement.y , lightSources[i].y, lightSources[i].z + 0.75*movement.x);
} }
else { else {
lightPos = lightSources[i]; lightPos = lightSources[i];

View File

@ -398,7 +398,7 @@ void Graphics::render(double time)
glm::vec3 position = glm::vec3(0.0f); glm::vec3 position = glm::vec3(0.0f);
if (std::get<0>(renderQueue.at(i_pointlight))->isFlame()) { if (std::get<0>(renderQueue.at(i_pointlight))->isFlame()) {
position = std::get<0>(renderQueue.at(i_pointlight))->getPosition(); position = std::get<0>(renderQueue.at(i_pointlight))->getPosition();
position = glm::vec3(position.x + 0.75f*wind.x, position.y, position.z + 0.75f*wind.y); position = glm::vec3(position.x - 0.75f*wind.y, position.y, position.z + 0.75f*wind.x);
} }
else { else {
position = std::get<0>(renderQueue.at(i_pointlight))->getPosition(); position = std::get<0>(renderQueue.at(i_pointlight))->getPosition();