35 void rectangle_light::transformed()
44 m_corners[0] = transform *
math::fvec3{-0.5f, -0.5f, 0.0f};
45 m_corners[1] = transform *
math::fvec3{-0.5f, 0.5f, 0.0f};
46 m_corners[2] = transform *
math::fvec3{ 0.5f, 0.5f, 0.0f};
47 m_corners[3] = transform *
math::fvec3{ 0.5f, -0.5f, 0.0f};
54 void rectangle_light::color_updated()
56 m_colored_luminous_flux =
get_color() * m_luminous_flux;
57 m_colored_luminance =
get_color() * m_luminance;
60 void rectangle_light::area_updated() noexcept
63 m_luminance = m_luminous_flux / (m_area * math::pi<float>);
64 m_colored_luminance =
get_color() * m_luminance;
67 void rectangle_light::luminous_flux_updated() noexcept
69 m_colored_luminous_flux =
get_color() * m_luminous_flux;
72 m_luminance = m_luminous_flux / (m_area * math::pi<float>);
73 m_colored_luminance =
get_color() * m_luminance;
76 void rectangle_light::luminance_updated() noexcept
78 m_colored_luminance =
get_color() * m_luminance;
81 m_luminous_flux = m_luminance * (m_area * math::pi<float>);
82 m_colored_luminous_flux =
get_color() * m_luminous_flux;
constexpr const math::fvec3 & get_color() const noexcept
Returns the scene-linear RGB color of the light.
void set_scale(const vector_type &scale)
Sets the scale of the object.
constexpr const vector_type & get_scale() const noexcept
Returns the scale of the object.
constexpr const transform_type & get_transform() const noexcept
Returns the transform of the object.
void set_size(const math::fvec2 &size)
Sets the size of the light.
rectangle_light()
Constructs a rectangular area light.
constexpr element_type & x() noexcept
Returns a reference to the first element.
constexpr element_type & y() noexcept
Returns a reference to the second element.