/* render/light.h This file is part of the Osirion project and is distributed under the terms of the GNU General Public License version 2 */ #ifndef __INCLUDED_RENDER_LIGHT_H__ #define __INCLUDED_RENDER_LIGHT_H__ #include "math/vector3f.h" #include "math/color.h" namespace render { /** * @brief paramaters for a single light source * */ class Light { public: /** * @brief default constructor, creates a white light at (0,0,0) * */ Light(); /** * @brief creates a light source with given color and location * */ Light(const math::Vector3f & location, const math::Color & color); /** * @brief destructor */ ~Light(); /* ---- inspectors ----------------------------------------- */ /** * @brief returns the location for this light source * */ inline const math::Vector3f & location() const { return light_location; } /** * @brief returns the color for this light source * */ inline const math::Color & color() const { return light_color; } /** * @brief returns the attenuation settings for this light source * */ inline const math::Vector3f & attenuation() const { return light_attenuation; } /* ---- mutators ------------------------------------------- */ /** * @brief set the location for this light source * @see location() * */ inline void set_location(const math::Vector3f & location) { light_location.assign(location); } /** * @brief set the location for this light source * @see color() * */ inline void set_color(const math::Color & color) { light_color.assign(color); } /** * @brief set the attenuation settings for this light source * */ inline void set_attenuation(const float constant, const float linear, const float quadratic) { light_attenuation.assign(constant, linear, quadratic); } private: math::Vector3f light_location; math::Color light_color; math::Vector3f light_attenuation; }; } #endif