CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::LightComponent::Accessor Struct Reference

A scene light. More...

#include <CeresEngine/Scene/Light.hpp>

Inheritance diagram for CeresEngine::LightComponent::Accessor:
CeresEngine::Component< T >::Accessor

Public Member Functions

LightType getType () const noexcept
 
void setType (LightType type) noexcept
 
Vector3 getColor () const noexcept
 
void setColor (Vector3 color) noexcept
 
double getStrength () const noexcept
 
void setStrength (double strength) noexcept
 
bool getShouldCastShadows () const noexcept
 
void setShouldCastShadows (bool shouldCastShadows) noexcept
 
double getShadowOcclusionStrength () const noexcept
 
void setShadowOcclusionStrength (double shadowOcclusionStrength) noexcept
 
double getConstant () const noexcept
 
void setConstant (double constant) noexcept
 
double getLinear () const noexcept
 
void setLinear (double linear) noexcept
 
double getQuadratic () const noexcept
 
void setQuadratic (double quadratic) noexcept
 
double getCutOff () const noexcept
 
void setCutOff (double cutOff) noexcept
 
double getOuterCutOff () const noexcept
 
void setOuterCutOff (double outerCutOff) noexcept
 
const RendererLightSettingsgetRendererSettings () const
 A set of settings that should be used by renderer when rendering the light.
 
void setRendererSettings (const RendererLightSettings &rendererSettings)
 A set of settings that should be used by renderer when rendering the light.
 
template<CInvocable< RendererLightSettings & > Func>
decltype(autoupdateRendererSettings (Func &&func) noexcept
 A set of settings that should be used by renderer when rendering the light.
 
- Public Member Functions inherited from CeresEngine::Component< T >::Accessor
 Accessor (const Entity &entity)
 

Static Public Member Functions

template<typename Processor >
static constexpr void reflect (Processor &&RTTI)
 Executes the given processor for every field of the struct.
 

Additional Inherited Members

- Public Attributes inherited from CeresEngine::Component< T >::Accessor
const Entityentity
 
- Protected Types inherited from CeresEngine::Component< T >::Accessor
using C = TC
 
- Protected Member Functions inherited from CeresEngine::Component< T >::Accessor
template<typename T >
auto mutate (T C::*ptr)
 Accesses an element from an existing Component.
 
template<typename MutatorFunc , typename T >
requires (CInvocable<MutatorFunc, T&>)
decltype(automutate (MutatorFunc &&func, T C::*ptr)
 Accesses an element from an existing Component.
 
template<typename T1 , typename T2 , typename... Ts>
Tuple< ComponentFieldMutator< T1, C >, ComponentFieldMutator< T2, C >, ComponentFieldMutator< Ts, C >... > mutate (T1 C::*ptr1, T2 C::*ptr2, Ts C::*... ptrs)
 TODO Write docs.
 
template<typename MutatorFunc , typename T1 , typename T2 , typename... Ts>
Tuple< ComponentFieldMutator< T1, C >, ComponentFieldMutator< T2, C >, ComponentFieldMutator< Ts, C >... > mutate (MutatorFunc &&func, T1 C::*ptr1, T2 C::*ptr2, Ts C::*... ptr)
 
template<typename T >
auto get (T C::*ptr)
 Accesses an element from an existing Component.
 
template<typename T1 , typename T2 , typename... Ts>
Tuple< ComponentFieldMutator< T1, C >, ComponentFieldMutator< T2, C >, ComponentFieldMutator< Ts, C >... > get (T1 C::*ptr1, T2 C::*ptr2, Ts C::*... ptrs)
 Accesses an element from an existing Component.
 
template<typename T >
const Tread (const T C::*ptr) const
 Accesses an element from an existing Component.
 
template<typename T1 , typename T2 , typename... Ts>
Tuple< const T1 &, const T2 &, const Ts &... > read (const T1 C::*ptr1, const T2 C::*ptr2, const Ts C::*... ptrs) const
 TODO Write docs.
 
template<typename T >
const Tget (const T C::*ptr) const
 Accesses an element from an existing Component.
 
template<typename T1 , typename T2 , typename... Ts>
Tuple< const T1 &, const T2 &, const Ts &... > get (const T1 C::*ptr1, const T2 C::*ptr2, const Ts C::*... ptrs) const
 Accesses an element from an existing Component.
 

Detailed Description

A scene light.

of Lights

The power of sun lights is specified in Watts per square meter. The power of point lights, spot lights, and area lights is specified in Watts. But this is not the electrical Watts that consumer light bulbs are rated at. It is Radiant Flux or Radiant Power which is also measured in Watts. It is the energy radiated from the light in the form of visible light.

If you want to set the power to real world values, you have to convert the wattage of consumer bulbs or LED lights to radiant flux, but it is not a straightforward process. The wattage of bulbs means the electrical power required to power them. LED lights have a “Watt equivalent” which is neither the electrical power they require nor the amount of light they put out. Some consumer lights specify lumens or luminous flux which is the radiant flux weighted with the wavelengths perceived by the human eye.

Member Function Documentation

◆ getColor()

Vector3 CeresEngine::LightComponent::Accessor::getColor ( ) const
noexcept
Returns
The light color

◆ getConstant()

double CeresEngine::LightComponent::Accessor::getConstant ( ) const
noexcept
Returns
The spot light constant attenuation constant

◆ getCutOff()

double CeresEngine::LightComponent::Accessor::getCutOff ( ) const
noexcept
Returns
The spot light cutoff angle

◆ getLinear()

double CeresEngine::LightComponent::Accessor::getLinear ( ) const
noexcept
Returns
The spot light linear attenuation constant

◆ getOuterCutOff()

double CeresEngine::LightComponent::Accessor::getOuterCutOff ( ) const
noexcept
Returns
The spot light outer cutoff angle

◆ getQuadratic()

double CeresEngine::LightComponent::Accessor::getQuadratic ( ) const
noexcept
Returns
The point spot quadratic attenuation constant

◆ getRendererSettings()

const RendererLightSettings & CeresEngine::LightComponent::Accessor::getRendererSettings ( ) const

A set of settings that should be used by renderer when rendering the light.

◆ getShadowOcclusionStrength()

double CeresEngine::LightComponent::Accessor::getShadowOcclusionStrength ( ) const
noexcept
Returns
A constant that control the shadow occlusion strength

◆ getShouldCastShadows()

bool CeresEngine::LightComponent::Accessor::getShouldCastShadows ( ) const
noexcept
Returns
True if the light should cast shadows, false if not

◆ getStrength()

double CeresEngine::LightComponent::Accessor::getStrength ( ) const
noexcept
Returns
The light strength

◆ getType()

LightType CeresEngine::LightComponent::Accessor::getType ( ) const
noexcept
Returns
The light type

◆ reflect()

template<typename Processor >
static constexpr void CeresEngine::LightComponent::Accessor::reflect ( Processor &&  RTTI)
inlinestaticconstexpr

Executes the given processor for every field of the struct.

Parameters
RTTIThe processor to be ran for every field.

◆ setColor()

void CeresEngine::LightComponent::Accessor::setColor ( Vector3  color)
noexcept
Parameters
colorThe light color

◆ setConstant()

void CeresEngine::LightComponent::Accessor::setConstant ( double  constant)
noexcept
Parameters
constantThe spot light constant attenuation constant

◆ setCutOff()

void CeresEngine::LightComponent::Accessor::setCutOff ( double  cutOff)
noexcept
Parameters
cutOffThe spot light cutoff angle

◆ setLinear()

void CeresEngine::LightComponent::Accessor::setLinear ( double  linear)
noexcept
Parameters
linearThe spot light linear attenuation constant

◆ setOuterCutOff()

void CeresEngine::LightComponent::Accessor::setOuterCutOff ( double  outerCutOff)
noexcept
Parameters
outerCutOffThe spot light outer cutoff angle

◆ setQuadratic()

void CeresEngine::LightComponent::Accessor::setQuadratic ( double  quadratic)
noexcept
Parameters
quadraticThe spot light quadratic attenuation constant

◆ setRendererSettings()

void CeresEngine::LightComponent::Accessor::setRendererSettings ( const RendererLightSettings rendererSettings)

A set of settings that should be used by renderer when rendering the light.

◆ setShadowOcclusionStrength()

void CeresEngine::LightComponent::Accessor::setShadowOcclusionStrength ( double  shadowOcclusionStrength)
noexcept
Parameters
shadowOcclusionStrengthA constant that control the shadow occlusion strength

◆ setShouldCastShadows()

void CeresEngine::LightComponent::Accessor::setShouldCastShadows ( bool  shouldCastShadows)
noexcept
Parameters
shouldCastShadowsTrue if the light should cast shadows, false if not

◆ setStrength()

void CeresEngine::LightComponent::Accessor::setStrength ( double  strength)
noexcept
Parameters
strengthThe light strength

◆ setType()

void CeresEngine::LightComponent::Accessor::setType ( LightType  type)
noexcept
Parameters
typeThe light type

◆ updateRendererSettings()

template<CInvocable< RendererLightSettings & > Func>
decltype(auto) CeresEngine::LightComponent::Accessor::updateRendererSettings ( Func &&  func)
inlinenoexcept

A set of settings that should be used by renderer when rendering the light.


The documentation for this struct was generated from the following file: