Skylicht Engine
Loading...
Searching...
No Matches
Skylicht::CLight Class Reference

This is the base class for all types of lights. More...

#include <Lighting/CLight.h>

Inheritance diagram for Skylicht::CLight:
Skylicht::CComponentSystem Skylicht::IActivatorObject Skylicht::CAreaLight Skylicht::CDirectionalLight Skylicht::CPointLight Skylicht::CSpotLight

Public Types

enum  ERenderLightType { Realtime = 0 , Baked , Mixed }
enum  ELightType { DirectionalLight = 0 , PointLight , SpotLight , AreaLight }

Public Member Functions

virtual CObjectSerializablecreateSerializable ()
virtual void loadSerializable (CObjectSerializable *object)
const SColorf & getColor ()
void setColor (const SColorf &c)
float getAttenuation ()
float getRadius ()
core::aabbox3df getBBBox ()
ERenderLightType getRenderLightType ()
virtual void setRenderLightType (ERenderLightType type)
int getLightTypeId ()
void setBounce (u32 b)
u32 getBounce ()
void setRadius (float r)
void setSpotAngle (float angle)
float getSplotCutoff ()
void setSpotInnerAngle (float angle)
float getSpotInnerCutof ()
void setSpotExponent (float e)
float getSpotExponent ()
core::vector3df & getDirection ()
bool isCastShadow ()
void setShadow (bool shadow)
bool isDynamicShadow ()
void setDynamicShadow (bool shadow)
void setIntensity (float f)
float getIntensity ()
u32 getLightLayers ()
void setLightLayers (u32 layers)
bool isAffectingDefaultObjects ()
void setLightPriority (u32 priority)
u32 getLightPriority ()
void validate ()
ITexture * getShadowTexture ()
void setShadowTexture (ITexture *tex)
void setShadowMatrices (float *m)
float * getShadowMatrices ()
Public Member Functions inherited from Skylicht::CComponentSystem
const char * getName ()
virtual void reset ()
virtual void initComponent ()=0
virtual void startComponent ()
virtual void updateComponent ()=0
virtual void endUpdate ()
virtual void onEnable (bool b)
virtual void onUpdateCullingLayer (u32 mask)
void setEnable (bool b)
bool isEnable ()
CGameObject * getGameObject ()
void setEnableSerializable (bool b)
bool isSerializable ()
void addLinkComponent (CComponentSystem *comp)
void removeAllLink ()
Public Member Functions inherited from Skylicht::IActivatorObject
virtual ~IActivatorObject ()
 Virtual destructor for polymorphic activator objects.

Protected Attributes

SColorf m_color
 Diffuse color emitted by the light.
float m_attenuation
 Attenuation factors (constant, linear, quadratic).
float m_radius
 Radius of light. Everything within this radius will be lighted.
float m_spotCutoff
 The angle of the spot's outer cone. Ignored for other lights.
float m_spotInnerCutoff
float m_spotExponent
core::vector3df m_direction
 Direction of the light.
bool m_castShadow
 Does the light cast shadows?
bool m_dynamicShadow
 Does this shadow alway updates.
float m_intensity
 Intensity of light.
u32 m_bakeBounce
 Number bounce of light on bake lighting.
ERenderLightType m_renderType
 Light type.
u32 m_lightLayers
 The layers where the light will shine on.
u32 m_lightPriority
 Priority order of lights selected for shaders.
bool m_needValidate
CLightCullingDatam_cullingData
ITexture * m_shadowTex
float * m_shadowMatrices
Protected Attributes inherited from Skylicht::CComponentSystem
CGameObject * m_gameObject
bool m_enable
bool m_serializable
std::vector< CComponentSystem * > m_linkComponent

Additional Inherited Members

Static Public Member Functions inherited from Skylicht::CComponentSystem
static int useComponent (CComponentSystem *used)
Protected Member Functions inherited from Skylicht::CComponentSystem
void setOwner (CGameObject *obj)

Detailed Description

This is the base class for all types of lights.

Member Function Documentation

◆ createSerializable()

virtual CObjectSerializable * Skylicht::CLight::createSerializable ( )
virtual

Reimplemented from Skylicht::CComponentSystem.

◆ loadSerializable()

virtual void Skylicht::CLight::loadSerializable ( CObjectSerializable * object)
virtual

Reimplemented from Skylicht::CComponentSystem.

Member Data Documentation

◆ m_attenuation

float Skylicht::CLight::m_attenuation
protected

Attenuation factors (constant, linear, quadratic).

Changes the light strength fading over distance. Can also be altered by setting the radius, Attenuation will change to 1.f/radius. Can be overridden after radius was set.

◆ m_direction

core::vector3df Skylicht::CLight::m_direction
protected

Direction of the light.

If Type is ELT_POINT, it is ignored. Changed via light scene node's rotation.


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