Barotrauma Client Doc
Barotrauma.Lights.LightManager Class Reference

Public Member Functions

 LightManager (GraphicsDevice graphics)
 
void AddLight (LightSource light)
 
void RemoveLight (LightSource light)
 
void OnMapLoaded ()
 
void Update (float deltaTime)
 
void AddRayCastTask (LightSource lightSource, Vector2 drawPos, float rotation)
 
void DebugDrawVertices (SpriteBatch spriteBatch)
 
void RenderLightMap (GraphicsDevice graphics, SpriteBatch spriteBatch, Camera cam, RenderTarget2D backgroundObstructor=null)
 
void UpdateObstructVision (GraphicsDevice graphics, SpriteBatch spriteBatch, Camera cam, Vector2 lookAtPosition)
 
void DebugDrawLos (SpriteBatch spriteBatch, Camera cam)
 
void ClearLights ()
 

Public Attributes

Color AmbientLight
 
bool DebugLos
 
bool LosEnabled = true
 
float LosAlpha = 1f
 
LosMode LosMode = LosMode.Transparent
 
bool LightingEnabled = true
 
bool ObstructVision
 

Properties

static Entity ViewTarget [get, set]
 
RenderTarget2D LightMap [get]
 
RenderTarget2D LimbLightMap [get]
 
RenderTarget2D LosTexture [get]
 
RenderTarget2D HighlightMap [get]
 
Effect LosEffect [get]
 
Effect SolidColorEffect [get]
 
IEnumerable< LightSourceLights [get]
 
static int ActiveLightCount [get]
 

Detailed Description

Definition at line 12 of file LightManager.cs.

Constructor & Destructor Documentation

◆ LightManager()

Barotrauma.Lights.LightManager.LightManager ( GraphicsDevice  graphics)

Definition at line 90 of file LightManager.cs.

Member Function Documentation

◆ AddLight()

void Barotrauma.Lights.LightManager.AddLight ( LightSource  light)

Definition at line 157 of file LightManager.cs.

◆ AddRayCastTask()

void Barotrauma.Lights.LightManager.AddRayCastTask ( LightSource  lightSource,
Vector2  drawPos,
float  rotation 
)

Definition at line 213 of file LightManager.cs.

◆ ClearLights()

void Barotrauma.Lights.LightManager.ClearLights ( )

Definition at line 814 of file LightManager.cs.

◆ DebugDrawLos()

void Barotrauma.Lights.LightManager.DebugDrawLos ( SpriteBatch  spriteBatch,
Camera  cam 
)

Definition at line 799 of file LightManager.cs.

◆ DebugDrawVertices()

void Barotrauma.Lights.LightManager.DebugDrawVertices ( SpriteBatch  spriteBatch)

Definition at line 237 of file LightManager.cs.

◆ OnMapLoaded()

void Barotrauma.Lights.LightManager.OnMapLoaded ( )

Definition at line 167 of file LightManager.cs.

◆ RemoveLight()

void Barotrauma.Lights.LightManager.RemoveLight ( LightSource  light)

Definition at line 162 of file LightManager.cs.

◆ RenderLightMap()

void Barotrauma.Lights.LightManager.RenderLightMap ( GraphicsDevice  graphics,
SpriteBatch  spriteBatch,
Camera  cam,
RenderTarget2D  backgroundObstructor = null 
)

Definition at line 246 of file LightManager.cs.

◆ Update()

void Barotrauma.Lights.LightManager.Update ( float  deltaTime)

Definition at line 181 of file LightManager.cs.

◆ UpdateObstructVision()

void Barotrauma.Lights.LightManager.UpdateObstructVision ( GraphicsDevice  graphics,
SpriteBatch  spriteBatch,
Camera  cam,
Vector2  lookAtPosition 
)

Definition at line 683 of file LightManager.cs.

Member Data Documentation

◆ AmbientLight

Color Barotrauma.Lights.LightManager.AmbientLight

Definition at line 33 of file LightManager.cs.

◆ DebugLos

bool Barotrauma.Lights.LightManager.DebugLos

Definition at line 65 of file LightManager.cs.

◆ LightingEnabled

bool Barotrauma.Lights.LightManager.LightingEnabled = true

Definition at line 71 of file LightManager.cs.

◆ LosAlpha

float Barotrauma.Lights.LightManager.LosAlpha = 1f

Definition at line 68 of file LightManager.cs.

◆ LosEnabled

bool Barotrauma.Lights.LightManager.LosEnabled = true

Definition at line 67 of file LightManager.cs.

◆ LosMode

LosMode Barotrauma.Lights.LightManager.LosMode = LosMode.Transparent

Definition at line 69 of file LightManager.cs.

◆ ObstructVision

bool Barotrauma.Lights.LightManager.ObstructVision

Definition at line 73 of file LightManager.cs.

Property Documentation

◆ ActiveLightCount

int Barotrauma.Lights.LightManager.ActiveLightCount
staticget

Definition at line 179 of file LightManager.cs.

◆ HighlightMap

RenderTarget2D Barotrauma.Lights.LightManager.HighlightMap
get

Definition at line 50 of file LightManager.cs.

◆ LightMap

RenderTarget2D Barotrauma.Lights.LightManager.LightMap
get

Definition at line 35 of file LightManager.cs.

◆ Lights

IEnumerable<LightSource> Barotrauma.Lights.LightManager.Lights
get

Definition at line 85 of file LightManager.cs.

◆ LimbLightMap

RenderTarget2D Barotrauma.Lights.LightManager.LimbLightMap
get

Definition at line 40 of file LightManager.cs.

◆ LosEffect

Effect Barotrauma.Lights.LightManager.LosEffect
get

Definition at line 60 of file LightManager.cs.

◆ LosTexture

RenderTarget2D Barotrauma.Lights.LightManager.LosTexture
get

Definition at line 45 of file LightManager.cs.

◆ SolidColorEffect

Effect Barotrauma.Lights.LightManager.SolidColorEffect
get

Definition at line 61 of file LightManager.cs.

◆ ViewTarget

Entity Barotrauma.Lights.LightManager.ViewTarget
staticgetset

Definition at line 29 of file LightManager.cs.