class LightComponent
Light component class.
File location: framework/cauldron/framework/inc/core/components/lightcomponent.h
Construction
Return type |
Description |
---|---|
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.
|
GetData ()
Component data accessor.
|
|
const LightComponentData & |
GetData () const
|
LightType |
GetType () const
Gets the light type.
|
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 |
GetShadowResolution () const
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.
|
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 |
GetCascadesCount () const
Gets the light cascade count.
|
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 () const
Gets the light direction.
|
|
void |
SetDirty ()
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 & |
GetViewProjection () const
Gets the light view projection matrix.
|
const Mat4 & |
GetInverseView () const
Gets the light inverse view matrix.
|
const Mat4 & |
GetInverseProjection () const
Gets the light inverse projection matrix.
|
const Mat4 & |
GetInverseViewProjection () const
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
LightComponent (
Entity * pOwner,
ComponentData * pData,
LightComponentMgr * pManager
)
Constructor.
Methods
Update
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
LightComponentData & GetData ()
Component data accessor.
GetType
Gets the light type.
GetColor
Vec3 GetColor () const
Gets the light color.
GetIntensity
Gets the light intensity.
GetRange
Gets the light range.
GetDepthBias
Gets the light depth bias.
GetInnerAngle
Gets the light inner cone angle.
GetOuterAngle
Gets the light outer cone angle.
GetShadowResolution
Gets the light shadow map resolution.
GetShadowMapIndex
Gets the light shadow map index.
GetShadowMapCellIndex
Gets the light shadow map cell index.
GetShadowMapRect
Rect GetShadowMapRect (int index = 0) const
Gets the light shadow map rect.
GetShadowProjection
const Mat4 & GetShadowProjection (int index = 0) const
Gets the light projection matrix for the shadow.
GetShadowViewProjection
const Mat4 & GetShadowViewProjection (int index = 0) const
Gets the light view projection matrix for the shadow.
GetCascadesCount
Gets the light cascade count.
GetShadowMapCount
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
Vec3 GetDirection () const
Gets the light direction.
SetDirty
Sets the light as dirty.
GetView
const Mat4 & GetView () const
Gets the light view matrix.
GetProjection
const Mat4 & GetProjection () const
Gets the light projection matrix.
GetViewProjection
const Mat4 & GetViewProjection () const
Gets the light view projection matrix.
GetInverseView
const Mat4 & GetInverseView () const
Gets the light inverse view matrix.
GetInverseProjection
const Mat4 & GetInverseProjection () const
Gets the light inverse projection matrix.
GetInverseViewProjection
const Mat4 & GetInverseViewProjection () const
Gets the light inverse view projection matrix.
SetupCascades
Sets up the light’s shadow map cascades.