/* * Copyright (C) 2021 Christopher J. Howard * * This file is part of Antkeeper source code. * * Antkeeper source code is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Antkeeper source code is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Antkeeper source code. If not, see . */ #ifndef ANTKEEPER_SCENE_LIGHT_HPP #define ANTKEEPER_SCENE_LIGHT_HPP #include "scene/object.hpp" #include "geom/sphere.hpp" #include "utility/fundamental-types.hpp" namespace scene { enum class light_type { ambient, directional, point, spot }; class light: public object { public: typedef geom::sphere sphere_type; light(); virtual light_type get_light_type() const = 0; void set_color(const float3& color); void set_intensity(float intensity); virtual const bounding_volume_type& get_bounds() const; const float3& get_color() const; float get_intensity() const; const float3& get_scaled_color() const; const tween& get_color_tween() const; const tween& get_intensity_tween() const; const tween& get_scaled_color_tween() const; /// @copydoc object_base::update_tweens(); virtual void update_tweens(); private: virtual void transformed(); tween color; tween intensity; tween scaled_color; sphere_type bounds; }; inline const typename object_base::bounding_volume_type& light::get_bounds() const { return bounds; } inline const float3& light::get_color() const { return color[1]; } inline float light::get_intensity() const { return intensity[1]; } inline const float3& light::get_scaled_color() const { return scaled_color[1]; } inline const tween& light::get_color_tween() const { return color; } inline const tween& light::get_intensity_tween() const { return intensity; } inline const tween& light::get_scaled_color_tween() const { return scaled_color; } } // namespace scene #endif // ANTKEEPER_SCENE_LIGHT_HPP