Unravel Engine C++ Reference
Loading...
Searching...
No Matches
unravel::light_component Class Reference

Class that contains core light data, used for rendering and other purposes. More...

#include <light_component.h>

Inheritance diagram for unravel::light_component:
unravel::component_crtp< light_component > unravel::basic_component

Public Member Functions

auto get_light () const -> const light &
 Gets the light object.
 
void set_light (const light &l)
 Sets the light object.
 
auto get_bounds () const -> math::bbox
 Gets the bounding box of the light object.
 
auto get_bounds_sphere () const -> math::bsphere
 
auto get_bounds_precise (const math::vec3 &light_direction) const -> math::bbox
 Gets the bounding box of the light object.
 
auto get_bounds_sphere_precise (const math::vec3 &light_direction) const -> math::bsphere
 
auto compute_projected_sphere_rect (irect32_t &rect, const math::vec3 &light_position, const math::vec3 &light_direction, const math::vec3 &view_origin, const math::transform &view, const math::transform &proj) -> int
 Computes the projected sphere rectangle.
 
auto get_shadowmap_generator () -> shadow::shadowmap_generator &
 Gets the shadow map generator.
 
- Public Member Functions inherited from unravel::basic_component
void touch ()
 Marks the component as 'touched'.
 

Additional Inherited Members

- Public Types inherited from unravel::component_crtp< light_component >
using base
 
- Public Attributes inherited from unravel::basic_component
bool eto {}
 Disable empty type optimizations.
 
- Static Public Attributes inherited from unravel::component_crtp< light_component >
static constexpr bool in_place_delete
 Indicates if the component can be deleted in place.
 

Detailed Description

Class that contains core light data, used for rendering and other purposes.

Definition at line 14 of file light_component.h.

Member Function Documentation

◆ compute_projected_sphere_rect()

int unravel::light_component::compute_projected_sphere_rect ( irect32_t & rect,
const math::vec3 & light_position,
const math::vec3 & light_direction,
const math::vec3 & view_origin,
const math::transform & view,
const math::transform & proj ) -> int

Computes the projected sphere rectangle.

Parameters
[out]rectReference to the rectangle to be computed.
[in]light_positionThe position of the light.
[in]light_directionThe direction of the light.
[in]view_originThe origin of the view.
[in]viewThe view transform.
[in]projThe projection transform.
Returns
An integer indicating the result of the computation.

Definition at line 81 of file light_component.cpp.

◆ get_bounds()

auto unravel::light_component::get_bounds ( ) const -> math::bbox

Gets the bounding box of the light object.

Definition at line 65 of file light_component.cpp.

◆ get_bounds_precise()

auto unravel::light_component::get_bounds_precise ( const math::vec3 & light_direction) const -> math::bbox

Gets the bounding box of the light object.

Definition at line 73 of file light_component.cpp.

◆ get_bounds_sphere()

auto unravel::light_component::get_bounds_sphere ( ) const -> math::bsphere

Definition at line 55 of file light_component.cpp.

◆ get_bounds_sphere_precise()

auto unravel::light_component::get_bounds_sphere_precise ( const math::vec3 & light_direction) const -> math::bsphere

Definition at line 60 of file light_component.cpp.

◆ get_light()

const light & unravel::light_component::get_light ( ) const -> const light&

Gets the light object.

Returns
A constant reference to the light object.

Definition at line 4 of file light_component.cpp.

◆ get_shadowmap_generator()

auto unravel::light_component::get_shadowmap_generator ( ) -> shadow::shadowmap_generator&

Gets the shadow map generator.

Returns
A reference to the shadow map generator.

Definition at line 130 of file light_component.cpp.

◆ set_light()

void unravel::light_component::set_light ( const light & l)

Sets the light object.

Parameters
[in]lThe light object to set.

Definition at line 9 of file light_component.cpp.


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