MAGE  v0.171.0
Matthias Advanced Game Engine
mage::rendering::OmniLight Class Reference

#include <omni_light.hpp>

Inheritance diagram for mage::rendering::OmniLight:
mage::Component

Public Member Functions

 OmniLight () noexcept
 
 OmniLight (const OmniLight &light) noexcept
 
 OmniLight (OmniLight &&light) noexcept
 
virtual ~OmniLight ()
 
OmniLightoperator= (const OmniLight &light) noexcept
 
OmniLightoperator= (OmniLight &&light) noexcept
 
RGBGetBaseColor () noexcept
 
const RGBGetBaseColor () const noexcept
 
F32 GetPower () const noexcept
 
void SetPower (F32 power) noexcept
 
const RGB GetPowerSpectrum () const noexcept
 
F32 GetIntensity () const noexcept
 
void SetIntensity (F32 intensity) noexcept
 
const RGB GetIntensitySpectrum () const noexcept
 
const AABBGetAABB () const noexcept
 
const BoundingSphereGetBoundingSphere () const noexcept
 
F32 GetRange () const noexcept
 
F32 GetWorldRange () const noexcept
 
void SetRange (F32 range) noexcept
 
bool UseShadows () const noexcept
 
void EnableShadows () noexcept
 
void DissableShadows () noexcept
 
void ToggleShadows () noexcept
 
void SetShadows (bool shadows) noexcept
 
const F32x2 GetClippingPlanes () const noexcept
 
void SetClippingPlanes (F32x2 clipping_planes) noexcept
 
const XMMATRIX XM_CALLCONV GetLightToProjectionMatrix () const noexcept
 
- Public Member Functions inherited from mage::Component
virtual ~Component ()
 
Componentoperator= (const Component &component) noexcept
 
Componentoperator= (Component &&component) noexcept
 
State GetState () const noexcept
 
void SetState (State state) noexcept
 
U64 GetGuid () const noexcept
 
bool HasOwner () const noexcept
 
ProxyPtr< NodeGetOwner () noexcept
 
ProxyPtr< const NodeGetOwner () const noexcept
 

Private Member Functions

void UpdateBoundingVolumes () noexcept
 

Private Attributes

bool m_shadows
 
F32x2 m_clipping_planes
 
AABB m_aabb
 
BoundingSphere m_sphere
 
RGB m_base_color
 
F32 m_intensity
 

Additional Inherited Members

- Protected Member Functions inherited from mage::Component
 Component () noexcept
 
 Component (const Component &component) noexcept
 
 Component (Component &&component) noexcept
 

Detailed Description

A class of omni lights.

Constructor & Destructor Documentation

◆ OmniLight() [1/3]

mage::rendering::OmniLight::OmniLight ( )
noexcept

Constructs an omni light.

◆ OmniLight() [2/3]

mage::rendering::OmniLight::OmniLight ( const OmniLight light)
defaultnoexcept

Constructs an omni light from the given omni light.

Parameters
[in]lightA reference to the omni light to copy.

◆ OmniLight() [3/3]

mage::rendering::OmniLight::OmniLight ( OmniLight &&  light)
defaultnoexcept

Constructs an omni light by moving the given omni light.

Parameters
[in]lightA reference to the omni light to move.

◆ ~OmniLight()

mage::rendering::OmniLight::~OmniLight ( )
virtualdefault

Destructs this omni light.

Member Function Documentation

◆ DissableShadows()

void mage::rendering::OmniLight::DissableShadows ( )
noexcept

Dissables shadows for this omni light.

◆ EnableShadows()

void mage::rendering::OmniLight::EnableShadows ( )
noexcept

Enables shadows for this omni light.

◆ GetAABB()

const AABB& mage::rendering::OmniLight::GetAABB ( ) const
noexcept

Returns the AABB of this omni light.

Returns
A reference to the AABB of this omni light.

◆ GetBaseColor() [1/2]

RGB& mage::rendering::OmniLight::GetBaseColor ( )
noexcept

Returns the (linear) RGB base color of this spotlight.

Returns
A reference to the (linear) base color of this spotlight.

◆ GetBaseColor() [2/2]

const RGB& mage::rendering::OmniLight::GetBaseColor ( ) const
noexcept

Returns the (linear) base color of this spotlight.

Returns
A reference to the (linear) base color of this spotlight.

◆ GetBoundingSphere()

const BoundingSphere& mage::rendering::OmniLight::GetBoundingSphere ( ) const
noexcept

Returns the BoundingSphere of this omni light.

Returns
A reference to the BoundingSphere of this omni light.

◆ GetClippingPlanes()

const F32x2 mage::rendering::OmniLight::GetClippingPlanes ( ) const
noexcept

Returns the clipping planes of this omni light expressed in light space.

Returns
The clipping planes of this omni light expressed in light space.

◆ GetIntensity()

F32 mage::rendering::OmniLight::GetIntensity ( ) const
noexcept

Returns the radiant intensity of this omni light.

Returns
The radiant intensity in watts per steradians of this omni light.

◆ GetIntensitySpectrum()

const RGB mage::rendering::OmniLight::GetIntensitySpectrum ( ) const
noexcept

Returns the radiant intensity spectrum of this omni light.

Returns
The radiant intensity spectrum of this omni light.

◆ GetLightToProjectionMatrix()

const XMMATRIX XM_CALLCONV mage::rendering::OmniLight::GetLightToProjectionMatrix ( ) const
noexcept

Returns the light-to-projection matrix of the (forward) light camera of this omni light.

Returns
The light-to-projection matrix of the (forward) light camera of this omni light.

◆ GetPower()

F32 mage::rendering::OmniLight::GetPower ( ) const
noexcept

Returns the power of this omni light.

Returns
The power in watts of this omni light.

◆ GetPowerSpectrum()

const RGB mage::rendering::OmniLight::GetPowerSpectrum ( ) const
noexcept

Returns the power spectrum of this omni light.

Returns
The power spectrum of this omni light.

◆ GetRange()

F32 mage::rendering::OmniLight::GetRange ( ) const
noexcept

Returns the range of this omni light expressed in light space.

Returns
The range of this omni light expressed in light space.

◆ GetWorldRange()

F32 mage::rendering::OmniLight::GetWorldRange ( ) const
noexcept

Returns the range of this omni light expressed in world space.

Returns
The range of this omni light expressed in world space.
Note
Non-uniform scaling is not supported for omni lights.

◆ operator=() [1/2]

OmniLight & mage::rendering::OmniLight::operator= ( const OmniLight light)
defaultnoexcept

Copies the given omni light to this omni light.

Parameters
[in]lightA reference to the omni light to copy.
Returns
A reference to the copy of the given omni light (i.e. this omni light).

◆ operator=() [2/2]

OmniLight & mage::rendering::OmniLight::operator= ( OmniLight &&  light)
defaultnoexcept

Moves the given omni light to this omni light.

Parameters
[in]lightA reference to the omni light to move.
Returns
A reference to the moved omni light (i.e. this omni light).

◆ SetClippingPlanes()

void mage::rendering::OmniLight::SetClippingPlanes ( F32x2  clipping_planes)
noexcept

Sets the clipping planes of this omni light expressed in light space to the given clipping planes.

Parameters
[in]clipping_planesThe clipping planes.

◆ SetIntensity()

void mage::rendering::OmniLight::SetIntensity ( F32  intensity)
noexcept

Sets the radiant intensity of this omni light to the given radial intensity.

Parameters
[in]intensityThe radiant intensity in watts per steradians.

◆ SetPower()

void mage::rendering::OmniLight::SetPower ( F32  power)
noexcept

Sets the power of this omni light to the given radiance.

Parameters
[in]powerThe power in watts.

◆ SetRange()

void mage::rendering::OmniLight::SetRange ( F32  range)
noexcept

Sets the range of this omni light to the given value expressed in light space.

Parameters
[in]rangeThe range expressed in light space.

◆ SetShadows()

void mage::rendering::OmniLight::SetShadows ( bool  shadows)
noexcept

Sets shadows for this omni light to the given value.

Parameters
[in]shadowstrue if shadows should be used for this omni light. false otherwise.

◆ ToggleShadows()

void mage::rendering::OmniLight::ToggleShadows ( )
noexcept

Toggles shadows for this omni light.

◆ UpdateBoundingVolumes()

void mage::rendering::OmniLight::UpdateBoundingVolumes ( )
privatenoexcept

Updates the bounding volumes of this omni light.

◆ UseShadows()

bool mage::rendering::OmniLight::UseShadows ( ) const
noexcept

Checks whether shadows should be used for this omni light.

Returns
true if shadows should be used for this omni light. false otherwise.

Member Data Documentation

◆ m_aabb

AABB mage::rendering::OmniLight::m_aabb
private

The AABB of this omni light.

◆ m_base_color

RGB mage::rendering::OmniLight::m_base_color
private

The (linear) base color of this omni light.

◆ m_clipping_planes

F32x2 mage::rendering::OmniLight::m_clipping_planes
private

The clipping planes of this omni light expressed in light space.

◆ m_intensity

F32 mage::rendering::OmniLight::m_intensity
private

The radiant intensity in watts per steradians of this omni light.

◆ m_shadows

bool mage::rendering::OmniLight::m_shadows
private

A flag indicating whether shadows should be calculated or not for this omni light.

◆ m_sphere

BoundingSphere mage::rendering::OmniLight::m_sphere
private

The BoundingSphere of this omni light.