Class LightProcessor
Process LightComponent stored in an EntityManager by providing grouped lights per types/shadows.
public class LightProcessor : EntityProcessor<LightComponent, RenderLight>, IEntityComponentRenderProcessor
- Inheritance
-
LightProcessor
- Implements
- Inherited Members
Constructors
LightProcessor()
Initializes a new instance of the LightProcessor class.
public LightProcessor()
Fields
DefaultDirection
The default direction of a light vector is (x,y,z) = (0,0,-1)
public static readonly Vector3 DefaultDirection
Field Value
Properties
Lights
Gets the active lights.
public RenderLightCollection Lights { get; }
Property Value
- RenderLightCollection
The lights.
VisibilityGroup
public VisibilityGroup VisibilityGroup { get; set; }
Property Value
Methods
Draw(RenderContext)
Performs work related to this processor.
public override void Draw(RenderContext context)
Parameters
context
RenderContext
GenerateComponentData(Entity, LightComponent)
Generates associated data to the given entity.
protected override RenderLight GenerateComponentData(Entity entity, LightComponent component)
Parameters
entity
EntityThe entity.
component
LightComponent
Returns
- RenderLight
The associated data.
GetRenderLight(LightComponent)
public RenderLight GetRenderLight(LightComponent lightComponent)
Parameters
lightComponent
LightComponent
Returns
IsAssociatedDataValid(Entity, LightComponent, RenderLight)
Checks if the current associated data is valid, or if readding the entity is required.
protected override bool IsAssociatedDataValid(Entity entity, LightComponent component, RenderLight associatedData)
Parameters
entity
EntityThe entity.
component
LightComponentassociatedData
RenderLightThe associated data.
Returns
- bool
True if the change in associated data requires the entity to be readded, false otherwise.
OnSystemAdd()
Run when this EntityProcessor is added to an EntityManager.
protected override void OnSystemAdd()
OnSystemRemove()
Run when this EntityProcessor is removed from an EntityManager.
protected override void OnSystemRemove()