Antkeeper  0.0.1
Public Member Functions | List of all members
scene::rectangle_light Class Reference

Rectangular area light. More...

#include <rectangle-light.hpp>

Inheritance diagram for scene::rectangle_light:
scene::light scene::object< light > scene::object_base

Public Member Functions

 rectangle_light ()
 Constructs a rectangular area light. More...
 
light_type get_light_type () const noexcept override
 Returns light_type::rectangle. More...
 
void set_size (const math::fvec2 &size)
 Sets the size of the light. More...
 
void set_luminous_flux (float luminous_flux) noexcept
 Sets the luminous flux of the light. More...
 
void set_luminance (float luminance) noexcept
 Sets the luminance of the light. More...
 
constexpr math::fvec2 get_size () const noexcept
 Returns the dimensions of the light. More...
 
constexpr float get_luminous_flux () const noexcept
 Returns the luminous flux of the light. More...
 
constexpr const math::fvec3get_colored_luminous_flux () const noexcept
 Returns the color-modulated luminous flux of the light. More...
 
constexpr float get_luminance () const noexcept
 Returns the luminance of the light. More...
 
constexpr const math::fvec3get_colored_luminance () const noexcept
 Returns the color-modulated luminance of the light. More...
 
constexpr std::span< const math::fvec3, 4 > get_corners () const noexcept
 Returns the world-space positions of the light corners. More...
 
- Public Member Functions inherited from scene::light
const aabb_typeget_bounds () const noexcept override
 Returns the bounds of the object. More...
 
void set_color (const math::fvec3 &color)
 Sets the color of the light. More...
 
void set_color_temperature (float temperature)
 Sets the color of the light from a color temperature. More...
 
constexpr const math::fvec3get_color () const noexcept
 Returns the scene-linear RGB color of the light. More...
 
- Public Member Functions inherited from scene::object< light >
const std::size_t get_object_type_id () const noexcept final
 Returns the type ID for this scene object type. More...
 
- Public Member Functions inherited from scene::object_base
virtual void render (render::context &ctx) const
 Adds render operations to a render context. More...
 
void look_at (const vector_type &position, const vector_type &target, const vector_type &up)
 
constexpr void set_layer_mask (std::uint32_t mask) noexcept
 Sets the layer mask of the object. More...
 
void set_transform (const transform_type &transform)
 Sets the transform of the object. More...
 
void set_translation (const vector_type &translation)
 Sets the translation of the object. More...
 
void set_rotation (const quaternion_type &rotation)
 Sets the rotation of the object. More...
 
constexpr std::uint32_t get_layer_mask () const noexcept
 Returns the layer mask of the object. More...
 
constexpr const transform_typeget_transform () const noexcept
 Returns the transform of the object. More...
 
constexpr const vector_typeget_translation () const noexcept
 Returns the translation of the object. More...
 
constexpr const quaternion_typeget_rotation () const noexcept
 Returns the rotation of the object. More...
 
constexpr const vector_typeget_scale () const noexcept
 Returns the scale of the object. More...
 
void set_scale (const vector_type &scale)
 Sets the scale of the object. More...
 
void set_scale (float scale)
 Sets the scale of the object. More...
 

Additional Inherited Members

- Public Types inherited from scene::object_base
using vector_type = math::fvec3
 
using quaternion_type = math::fquat
 
using transform_type = math::transform< float >
 
using aabb_type = geom::box< float >
 
- Static Public Attributes inherited from scene::object< light >
static const std::atomic< std::size_t > object_type_id
 Unique type ID for this scene object type. More...
 
- Static Protected Member Functions inherited from scene::object_base
static std::size_t next_object_type_id ()
 
- Protected Attributes inherited from scene::object_base
std::uint32_t m_layer_mask {1}
 
transform_type m_transform {transform_type::identity()}
 

Detailed Description

Rectangular area light.

Definition at line 31 of file rectangle-light.hpp.

Constructor & Destructor Documentation

◆ rectangle_light()

scene::rectangle_light::rectangle_light ( )

Constructs a rectangular area light.

Definition at line 25 of file rectangle-light.cpp.

Member Function Documentation

◆ get_colored_luminance()

constexpr const math::fvec3& scene::rectangle_light::get_colored_luminance ( ) const
inlineconstexprnoexcept

Returns the color-modulated luminance of the light.

Definition at line 97 of file rectangle-light.hpp.

◆ get_colored_luminous_flux()

constexpr const math::fvec3& scene::rectangle_light::get_colored_luminous_flux ( ) const
inlineconstexprnoexcept

Returns the color-modulated luminous flux of the light.

Definition at line 85 of file rectangle-light.hpp.

◆ get_corners()

constexpr std::span<const math::fvec3, 4> scene::rectangle_light::get_corners ( ) const
inlineconstexprnoexcept

Returns the world-space positions of the light corners.

Definition at line 103 of file rectangle-light.hpp.

◆ get_light_type()

light_type scene::rectangle_light::get_light_type ( ) const
inlineoverridevirtualnoexcept

Returns light_type::rectangle.

Implements scene::light.

Definition at line 38 of file rectangle-light.hpp.

◆ get_luminance()

constexpr float scene::rectangle_light::get_luminance ( ) const
inlineconstexprnoexcept

Returns the luminance of the light.

Definition at line 91 of file rectangle-light.hpp.

◆ get_luminous_flux()

constexpr float scene::rectangle_light::get_luminous_flux ( ) const
inlineconstexprnoexcept

Returns the luminous flux of the light.

Definition at line 79 of file rectangle-light.hpp.

◆ get_size()

constexpr math::fvec2 scene::rectangle_light::get_size ( ) const
inlineconstexprnoexcept

Returns the dimensions of the light.

Definition at line 73 of file rectangle-light.hpp.

◆ set_luminance()

void scene::rectangle_light::set_luminance ( float  luminance)
inlinenoexcept

Sets the luminance of the light.

Parameters
luminanceLuminance.

Definition at line 66 of file rectangle-light.hpp.

◆ set_luminous_flux()

void scene::rectangle_light::set_luminous_flux ( float  luminous_flux)
inlinenoexcept

Sets the luminous flux of the light.

Parameters
luminous_fluxLuminous flux.

Definition at line 55 of file rectangle-light.hpp.

◆ set_size()

void scene::rectangle_light::set_size ( const math::fvec2 size)

Sets the size of the light.

Parameters
sizeDimensions of the light.

Definition at line 30 of file rectangle-light.cpp.


The documentation for this class was generated from the following files: