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 void
disable()
Turn light off.void
enable()
Turn light on.boolean
handleMessage(com.badlogic.gdx.ai.msg.Telegram msg)
boolean
isEnabled()
Is light on?void
lightNearbyBlocks(float delta)
fills the cache by sending rays starting at the positionvoid
setBrightness(float brightness)
void
setPosition(Point pos)
keeps the referencevoid
setPosition(Position pos)
Set the coordinates without safety check.void
update(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:AbstractEntity
keeps the reference- Overrides:
setPosition
in classAbstractEntity
-
setPosition
public void setPosition(Position pos)
Description copied from class:AbstractGameObject
Set the coordinates without safety check. May use different object pointing to the same position.- Overrides:
setPosition
in 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:AbstractEntity
Updates the logic of the object.- Overrides:
update
in 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)
-
-