Class PointLightSource
- java.lang.Object
-
- com.badlogic.gdx.graphics.g3d.Renderable
-
- com.bombinggames.wurfelengine.core.gameobjects.AbstractGameObject
-
- com.bombinggames.wurfelengine.core.gameobjects.AbstractEntity
-
- com.bombinggames.wurfelengine.core.gameobjects.PointLightSource
-
public class PointLightSource extends AbstractEntity
A light source is an invisible entity which spawns light from one point.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.bombinggames.wurfelengine.core.gameobjects.AbstractEntity
colissionRadius
-
Fields inherited from class com.bombinggames.wurfelengine.core.gameobjects.AbstractGameObject
sprite
-
-
Constructor Summary
Constructors Constructor Description PointLightSource(com.badlogic.gdx.graphics.Color color, float maxRadius, float brightness, GameView view)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisable()Turn light off.voidenable()Turn light on.booleanhandleMessage(com.badlogic.gdx.ai.msg.Telegram msg)booleanisEnabled()Is light on?voidlightNearbyBlocks(float delta)fills the cache by sending rays starting at the positionvoidsetBrightness(float brightness)voidsetPosition(Point pos)keeps the referencevoidsetPosition(Position pos)Set the coordinates without safety check.voidupdate(float dt)Updates the logic of the object.-
Methods inherited from class com.bombinggames.wurfelengine.core.gameobjects.AbstractEntity
addComponent, collidesWith, dispose, getCollidingEntities, getCollidingEntities, getComponents, getComponents, getCoord, getCoveredBlocks, getDimensionZ, getHealth, getLightlevelB, getLightlevelG, getLightlevelR, getMass, getName, getPoint, getPosition, getRegisteredEntities, getSpriteCategory, getSpriteId, getSpriteValue, hasPosition, heal, isIndestructible, isInMemoryArea, isMarkedDS, isOnGround, isSavedPersistent, markAsVisitedDS, registerEngineEntities, registerEntity, removeComponent, removeFromMap, requestChunk, setDamageSounds, setDimensionZ, setHealth, setIndestructible, setLightlevel, setMass, setName, setSavePersistent, setSpriteCategory, setSpriteId, setSpriteValue, setUseRawDelta, shouldBeDisposed, spawn, takeDamage, useRawDelta
-
Methods inherited from class com.bombinggames.wurfelengine.core.gameobjects.AbstractGameObject
getColor, getDepth, getPixmap, getRotation, getScaling, getSprite, getSprite, getSpritesheet, getSpritesheetPath, getTextureDiffuse, getTextureNormal, isHidden, loadSheet, render, render, setColor, setCustomSpritesheet, setHidden, setRotation, setScaling, shouldBeRendered, staticDispose, updateSpriteCache
-
-
-
-
Constructor Detail
-
PointLightSource
public PointLightSource(com.badlogic.gdx.graphics.Color color, float maxRadius, float brightness, GameView view)- Parameters:
color-maxRadius- cut at distance of this amount of meters. boosts game performance if smallerbrightness- empirical factor ~5-30view-
-
-
Method Detail
-
setPosition
public void setPosition(Point pos)
Description copied from class:AbstractEntitykeeps the reference- Overrides:
setPositionin classAbstractEntity
-
setPosition
public void setPosition(Position pos)
Description copied from class:AbstractGameObjectSet the coordinates without safety check. May use different object pointing to the same position.- Overrides:
setPositionin classAbstractEntity- Parameters:
pos- the coordinates you want to set
-
lightNearbyBlocks
public void lightNearbyBlocks(float delta)
fills the cache by sending rays starting at the position- Parameters:
delta-
-
update
public void update(float dt)
Description copied from class:AbstractEntityUpdates the logic of the object.- Overrides:
updatein classAbstractEntity- Parameters:
dt- time since last update in game time
-
enable
public void enable()
Turn light on.
-
disable
public void disable()
Turn light off.
-
isEnabled
public boolean isEnabled()
Is light on?- Returns:
-
setBrightness
public void setBrightness(float brightness)
- Parameters:
brightness- value >= 0
-
handleMessage
public boolean handleMessage(com.badlogic.gdx.ai.msg.Telegram msg)
-
-