public class LightEngine extends java.lang.Object implements LinkedWithMap
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
Version
The Version of the light engine.
|
Constructor and Description |
---|
LightEngine() |
LightEngine(int xPos,
int yPos) |
Modifier and Type | Method and Description |
---|---|
void |
calcSimpleLight(HasID[][][] data)
Calculates the light level based on the sun shining straight from the top
|
com.badlogic.gdx.graphics.Color |
getAmbient()
Returns the sum of every light source's ambient light
|
com.badlogic.gdx.graphics.Color |
getColor(Side normal) |
GlobalLightSource |
getMoon() |
GlobalLightSource |
getSun() |
static float |
getVertexBrightness()
Returns the average brightness.
|
boolean |
isInDebug() |
boolean |
isShadingPixelBased()
The light engine can shade the world pixel based or vertext based.
|
void |
onChunkChange(Chunk chunk)
called if a chunk's content (blocks) changes.
|
void |
onMapChange()
called if the map content (blocks) changes.
|
void |
render(GameView view)
Shows the data of the light engine in diagramms.
|
void |
setDebug(boolean debug)
Should diagrams be rendered showing the data of the LE.
|
void |
setToNight() |
void |
setToNoon() |
void |
update(float dt) |
public static final java.lang.String Version
public LightEngine()
public LightEngine(int xPos, int yPos)
xPos
- the x position of the diagrams position (center)yPos
- the y position of the diagrams position (center)public void update(float dt)
dt
- public static float getVertexBrightness()
public GlobalLightSource getSun()
public GlobalLightSource getMoon()
public boolean isShadingPixelBased()
public com.badlogic.gdx.graphics.Color getColor(Side normal)
public com.badlogic.gdx.graphics.Color getAmbient()
public void calcSimpleLight(HasID[][][] data)
data
- public boolean isInDebug()
public void setDebug(boolean debug)
debug
- public void render(GameView view)
view
- public void setToNoon()
public void setToNight()
public void onMapChange()
LinkedWithMap
onMapChange
in interface LinkedWithMap
public void onChunkChange(Chunk chunk)
LinkedWithMap
onChunkChange
in interface LinkedWithMap
chunk
- the chunk that changed