class LightComponent

Light component class.

File location: framework/cauldron/framework/inc/core/components/lightcomponent.h

Construction

Return type

Description

LightComponent ( Entity * pOwner, ComponentData * pData, LightComponentMgr * pManager )
Constructor.

Methods

Return type

Description

void

Update (double deltaTime)
Component update. Updates only execute when the light is marked as dirty. This occurs if the light moves, or has any of it’s core parameters changed.

LightComponentData &

Component data accessor.

const LightComponentData &

GetData () const

LightType

GetType () const
Gets the light type.

Vec3

GetColor () const
Gets the light color.

float

GetIntensity () const
Gets the light intensity.

float

GetRange () const
Gets the light range.

float

GetDepthBias () const
Gets the light depth bias.

float

GetInnerAngle () const
Gets the light inner cone angle.

float

GetOuterAngle () const
Gets the light outer cone angle.

int32_t

Gets the light shadow map resolution.

int

GetShadowMapIndex (int index = 0) const
Gets the light shadow map index.

int32_t

GetShadowMapCellIndex (int index = 0) const
Gets the light shadow map cell index.

Rect

GetShadowMapRect (int index = 0) const
Gets the light shadow map rect.

const Mat4 &

GetShadowProjection (int index = 0) const
Gets the light projection matrix for the shadow.

const Mat4 &

GetShadowViewProjection (int index = 0) const
Gets the light view projection matrix for the shadow.

int

Gets the light cascade count.

int

Gets the light shadow map count. This 1 for anything besides directional lights. The count for directional lights is dependent on the number of cascades configured.

Vec3

GetDirection () const
Gets the light direction.

void

Sets the light as dirty.

const Mat4 &

GetView () const
Gets the light view matrix.

const Mat4 &

GetProjection () const
Gets the light projection matrix.

const Mat4 &

Gets the light view projection matrix.

const Mat4 &

Gets the light inverse view matrix.

const Mat4 &

Gets the light inverse projection matrix.

const Mat4 &

Gets the light inverse view projection matrix.

void

SetupCascades ( int numCascades, const std::vector<float>& cascadeSplitPoints, bool moveLightTexelSize )
Sets up the light’s shadow map cascades.

Detailed description

Light component class. Implements lighting functionality for a given entity.

Construction

LightComponent

Copied!

LightComponent (
    Entity * pOwner,
    ComponentData * pData,
    LightComponentMgr * pManager
)

Constructor.


Methods

Update

Copied!

virtual void Update (double deltaTime)

Component update. Updates only execute when the light is marked as dirty. This occurs if the light moves, or has any of it’s core parameters changed.


GetData

Copied!

LightComponentData & GetData ()

Component data accessor.


GetType

Copied!

LightType  GetType () const

Gets the light type.


GetColor

Copied!

Vec3  GetColor () const

Gets the light color.


GetIntensity

Copied!

float GetIntensity () const

Gets the light intensity.


GetRange

Copied!

float GetRange () const

Gets the light range.


GetDepthBias

Copied!

float GetDepthBias () const

Gets the light depth bias.


GetInnerAngle

Copied!

float GetInnerAngle () const

Gets the light inner cone angle.


GetOuterAngle

Copied!

float GetOuterAngle () const

Gets the light outer cone angle.


GetShadowResolution

Copied!

int32_t GetShadowResolution () const

Gets the light shadow map resolution.


GetShadowMapIndex

Copied!

int GetShadowMapIndex (int index = 0) const

Gets the light shadow map index.


GetShadowMapCellIndex

Copied!

int32_t GetShadowMapCellIndex (int index = 0) const

Gets the light shadow map cell index.


GetShadowMapRect

Copied!

Rect  GetShadowMapRect (int index = 0) const

Gets the light shadow map rect.


GetShadowProjection

Copied!

const Mat4 & GetShadowProjection (int index = 0) const

Gets the light projection matrix for the shadow.


GetShadowViewProjection

Copied!

const Mat4 & GetShadowViewProjection (int index = 0) const

Gets the light view projection matrix for the shadow.


GetCascadesCount

Copied!

int GetCascadesCount () const

Gets the light cascade count.


GetShadowMapCount

Copied!

int GetShadowMapCount () const

Gets the light shadow map count. This 1 for anything besides directional lights. The count for directional lights is dependent on the number of cascades configured.


GetDirection

Copied!

Vec3  GetDirection () const

Gets the light direction.


SetDirty

Copied!

void SetDirty ()

Sets the light as dirty.


GetView

Copied!

const Mat4 & GetView () const

Gets the light view matrix.


GetProjection

Copied!

const Mat4 & GetProjection () const

Gets the light projection matrix.


GetViewProjection

Copied!

const Mat4 & GetViewProjection () const

Gets the light view projection matrix.


GetInverseView

Copied!

const Mat4 & GetInverseView () const

Gets the light inverse view matrix.


GetInverseProjection

Copied!

const Mat4 & GetInverseProjection () const

Gets the light inverse projection matrix.


GetInverseViewProjection

Copied!

const Mat4 & GetInverseViewProjection () const

Gets the light inverse view projection matrix.


SetupCascades

Copied!

void SetupCascades (
    int numCascades,
    const std::vector<float>& cascadeSplitPoints,
    bool moveLightTexelSize
)

Sets up the light’s shadow map cascades.