#ifndef LIGHT_COMPONENT_H #define LIGHT_COMPONENT_H #include #include class LightComponent { public: LightComponent(); ~LightComponent(); // Light properties. glm::vec3 color; float intensity; // Save this light to a YAML node. YAML::Node Save() const { YAML::Node node; node["color"] = YAML::Node(); node["color"].push_back(color.x); node["color"].push_back(color.y); node["color"].push_back(color.z); node["intensity"] = intensity; return node; } // Load this light from a YAML node. void Load(const YAML::Node &node) { if (node["color"]) { color.x = node["color"][0].as(); color.y = node["color"][1].as(); color.z = node["color"][2].as(); } if (node["intensity"]) intensity = node["intensity"].as(); } }; #endif // LIGHT_COMPONENT_H