Terrain Engine 2D  1.10
A 2D Block Engine
TerrainEngine2D.Lighting.AdvancedRaycastLight Class Reference

A light generated by raycasting to collider edges More...

Inheritance diagram for TerrainEngine2D.Lighting.AdvancedRaycastLight:
TerrainEngine2D.Lighting.RaycastLight TerrainEngine2D.Lighting.LightSource

Public Attributes

float RaycastOffset = 0.001f
 Offset of raycasts from the terrain edge point More...
 
float RaycastHitThreshold = 0.5f
 The threshold of whether the correct raycast point was hit More...
 
- Public Attributes inherited from TerrainEngine2D.Lighting.RaycastLight
float LightAngle = 360
 The lights field of view angle More...
 
LayerMask ObstacleMask
 Objects which the light More...
 
float EdgeLightBleed = 0
 Amount of light that bleeds into the terrain More...
 
float Resolution = 0.2f
 The amount of light rays per degree More...
 
- Public Attributes inherited from TerrainEngine2D.Lighting.LightSource
Color LightColor = new Color32(237, 231, 217, 173)
 Color of the light source More...
 
int LightRadius = 10
 Distance light can travel More...
 
int SmoothingIterations
 Number of points to average across the light mesh for smoothing More...
 
float FlickerRate = 0
 Speed of light flickering More...
 
float FlickerRateVary = 0.1f
 Amount the flicker light rate varies More...
 
float FlickerScalingRadius = 0.1f
 The flicker scaling radius More...
 

Protected Member Functions

override void CalculateLighting ()
 Calculate the light mesh points More...
 
override void CreateMesh ()
 Add the light points to the mesh More...
 
- Protected Member Functions inherited from TerrainEngine2D.Lighting.RaycastLight
override void CalculateLighting ()
 Calculate the light points More...
 
override void SmoothPoints ()
 Smooth the light mesh points by point averaging More...
 
override void CreateMesh ()
 Add the light points to the mesh More...
 
- Protected Member Functions inherited from TerrainEngine2D.Lighting.LightSource
virtual void OnEnable ()
 
virtual void Awake ()
 
virtual void Start ()
 
virtual void LateUpdate ()
 
void UpdateMesh ()
 Update the light mesh More...
 
Vector2 AngleToDirection (float angleInDegrees, bool globalAngle)
 Converts a given angle in degrees to a direction More...
 

Additional Inherited Members

- Public Member Functions inherited from TerrainEngine2D.Lighting.LightSource
void UpdateLight ()
 Update the light mesh More...
 
- Protected Attributes inherited from TerrainEngine2D.Lighting.LightSource
World world
 
List< Vector2 > lightPoints
 
Mesh mesh
 
List< Vector3 > vertices
 
List< int > triangles
 
List< Vector2 > uvs
 
List< Color32 > colors32
 
- Properties inherited from TerrainEngine2D.Lighting.LightSource
bool Dynamic [get]
 Update the light dynamically More...
 

Detailed Description

A light generated by raycasting to collider edges

Member Function Documentation

◆ CalculateLighting()

override void TerrainEngine2D.Lighting.AdvancedRaycastLight.CalculateLighting ( )
protectedvirtual

Calculate the light mesh points

Reimplemented from TerrainEngine2D.Lighting.LightSource.

◆ CreateMesh()

override void TerrainEngine2D.Lighting.AdvancedRaycastLight.CreateMesh ( )
protectedvirtual

Add the light points to the mesh

Reimplemented from TerrainEngine2D.Lighting.LightSource.

Member Data Documentation

◆ RaycastHitThreshold

float TerrainEngine2D.Lighting.AdvancedRaycastLight.RaycastHitThreshold = 0.5f

The threshold of whether the correct raycast point was hit

◆ RaycastOffset

float TerrainEngine2D.Lighting.AdvancedRaycastLight.RaycastOffset = 0.001f

Offset of raycasts from the terrain edge point


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