sandbox
Loading...
Searching...
No Matches
directional_light.hpp
1// SPDX-License-Identifier: MIT
2#ifndef LIBSBX_SCENES_COMPONENTS_DIRECTIONAL_LIGHT_HPP_
3#define LIBSBX_SCENES_COMPONENTS_DIRECTIONAL_LIGHT_HPP_
4
5#include <libsbx/math/vector3.hpp>
7
8namespace sbx::scenes {
9
11
12public:
13
14 directional_light(const math::vector3& direction, const math::color& color)
15 : _direction{direction},
16 _color{color} { }
17
18 ~directional_light() = default;
19
20 [[nodiscard]] auto direction() const noexcept -> const math::vector3& {
21 return _direction;
22 }
23
24 [[nodiscard]] auto direction() noexcept -> math::vector3& {
25 return _direction;
26 }
27
28 auto set_direction(const math::vector3& direction) noexcept -> void {
29 _direction = math::vector3::normalized(direction);
30 }
31
32 [[nodiscard]] auto color() const noexcept -> const math::color& {
33 return _color;
34 }
35
36 [[nodiscard]] auto color() noexcept -> math::color& {
37 return _color;
38 }
39
40private:
41
42 math::vector3 _direction;
43 math::color _color;
44
45}; // class directional_light
46
47} // namespace sbx::scenes
48
49#endif // LIBSBX_SCENES_COMPONENTS_DIRECTIONAL_LIGHT_HPP_
Definition: vector3.hpp:23
RGBA color value type.
Definition: color.hpp:48
Definition: directional_light.hpp:10
RGBA color representation and utilities.