Class PointLightSource



  • public class PointLightSource
    extends AbstractEntity
    A light source is an invisible entity which spawns light from one point.
    See Also:
    Serialized Form
    • 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 smaller
        brightness - empirical factor ~5-30
        view -
    • Method Detail

      • 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 class AbstractEntity
        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 class AbstractEntity
        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)