Added flameHeight and flameWidth with loading from xml.
This commit is contained in:
parent
5cd13899d6
commit
c4f106bf86
@ -76,6 +76,8 @@
|
||||
<bColour>0.3</bColour>
|
||||
<intensity>4.0</intensity>
|
||||
<flameOffset>-1.5</flameOffset>
|
||||
<flameHeight>3.0</flameHeight>
|
||||
<flameWidth>0.8</flameWidth>
|
||||
</light>
|
||||
</composition>
|
||||
|
||||
|
4
light.cc
4
light.cc
@ -1,10 +1,12 @@
|
||||
#include "light.hh"
|
||||
|
||||
Light::Light(glm::vec3 position, glm::vec3 colour, float intensity, float flameYOffset)
|
||||
Light::Light(glm::vec3 position, glm::vec3 colour, float intensity, float flameYOffset, float flameHeight, float flameWidth)
|
||||
: Entity(position, glm::vec3(0.0f, 0.0f, 0.0f)) {
|
||||
this->colour = colour;
|
||||
this->intensity = intensity;
|
||||
this->flameYOffset = flameYOffset;
|
||||
this->flameHeight = flameHeight;
|
||||
this->flameWidth = flameWidth;
|
||||
}
|
||||
|
||||
Light::Light() {
|
||||
|
4
light.hh
4
light.hh
@ -6,7 +6,7 @@
|
||||
|
||||
class Light : public Entity {
|
||||
public:
|
||||
Light(glm::vec3 position, glm::vec3 colour, float intensity, float flameYOffset = 0.0f);
|
||||
Light(glm::vec3 position, glm::vec3 colour, float intensity, float flameYOffset = 0.0f, float flameHeight = 0.0f, float flameWidth = 0.0f);
|
||||
Light();
|
||||
glm::vec3 getColour();
|
||||
float getIntensity();
|
||||
@ -14,6 +14,8 @@ class Light : public Entity {
|
||||
~Light();
|
||||
private:
|
||||
float flameYOffset;
|
||||
float flameHeight;
|
||||
float flameWidth;
|
||||
float intensity;
|
||||
glm::vec3 colour;
|
||||
};
|
||||
|
@ -299,7 +299,9 @@ void Loader::load(std::string filePath, Level* level, std::string compositionsPa
|
||||
if (flameOffset != NULL){
|
||||
float offset = 0;
|
||||
errorCheck(flameOffset->QueryFloatText(&offset));
|
||||
Light light = Light(lightPosition, lightColour, lightIntensity, offset);
|
||||
float flameHeight = queryBool(xmlLight, "flameHeight");
|
||||
float flameWidth = queryBool(xmlLight, "flameWidth");
|
||||
Light light = Light(lightPosition, lightColour, lightIntensity, offset, flameHeight, flameWidth);
|
||||
level->addLight(light);
|
||||
}
|
||||
else {
|
||||
|
Loading…
Reference in New Issue
Block a user