Added loading of flames.

This commit is contained in:
Steffen Fündgens 2015-02-17 12:54:21 +01:00
parent f92c7bf6c3
commit af9f6d6933
2 changed files with 9 additions and 0 deletions

View File

@ -75,6 +75,7 @@
<gColour>1.0</gColour>
<bColour>1.0</bColour>
<intensity>4.0</intensity>
<flameOffset>0.5</flameOffset>
</light>
</composition>

View File

@ -374,6 +374,14 @@ void Loader::load(std::string filePath, Level* level, std::string compositionsPa
glm::vec3 lightPosition = compPos + glm::vec3(rotatedLightOffset.x,rotatedLightOffset.y,rotatedLightOffset.z);
Light light = Light(lightPosition, lightColour, lightIntensity);
level->addLight(light);
XMLElement* flameOffset = NULL;
flameOffset = xmlLight->FirstChildElement("flameOffset");
if (flameOffset != NULL){
float offset = 0;
errorCheck(flameOffset->QueryFloatText(&offset));
Flame flame = Flame(offset, lightPosition, glm::vec3(0,0,0));
level->addFlame(flame);
}
}//iterating over all lights of the composition
}//corect composition found
}//iterating over all compositions in Compositions.xml