Class GlobalLightSource
- java.lang.Object
-
- com.bombinggames.wurfelengine.core.lightengine.GlobalLightSource
-
- Direct Known Subclasses:
Moon
public class GlobalLightSource extends java.lang.Object
Something shiny infinetelly far away. Stores postiion and color.
-
-
Constructor Summary
Constructors Constructor Description GlobalLightSource(float azimuth, float height, com.badlogic.gdx.graphics.Color tone, com.badlogic.gdx.graphics.Color ambient, float brghtFac, int amplitudeHeight)
A GlobalLightSource can be the moon, the sun or even something new.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.badlogic.gdx.graphics.Color
getAmbient()
Returns the ambient light the GLS emits.float
getAzimuth()
origin is left sidefloat
getAzimuthSpeed()
float
getHeight()
current height above horizoncom.badlogic.gdx.graphics.Color
getLight()
Returns the diffuse light which this object emits.int
getMaxAngle()
com.badlogic.gdx.math.Vector3
getNormal()
float
getPower()
A light source shines can shine brighter and darker.com.badlogic.gdx.graphics.Color
getTone()
void
setAzimuth(float azimuth)
The longitudinal positionvoid
setFixedPosition(boolean fixedPosition)
void
setHeight(float height)
The Latitude posiiton.void
setTone(com.badlogic.gdx.graphics.Color tone)
void
update(float dt)
-
-
-
Constructor Detail
-
GlobalLightSource
public GlobalLightSource(float azimuth, float height, com.badlogic.gdx.graphics.Color tone, com.badlogic.gdx.graphics.Color ambient, float brghtFac, int amplitudeHeight)
A GlobalLightSource can be the moon, the sun or even something new.- Parameters:
azimuth
- The starting position in degrees from left. CCWheight
- The starting position in degrees above the horizon.tone
- the starting color of the light. With this parameter you do not controll its brightness.ambient
- color vectorbrghtFac
- brightness factor 0.5f is default. the higher the brighteramplitudeHeight
- the maximum degree during a day the LightSource rises
-
-
Method Detail
-
getPower
public float getPower()
A light source shines can shine brighter and darker. This amplitude is called power. What it real emits says the resulting light.- Returns:
- a value between 0 and 1
-
getTone
public com.badlogic.gdx.graphics.Color getTone()
- Returns:
-
getHeight
public float getHeight()
current height above horizon- Returns:
- in degrees 0-360°
-
getAzimuth
public float getAzimuth()
origin is left side- Returns:
- in degrees 0-360°
-
getAzimuthSpeed
public float getAzimuthSpeed()
- Returns:
-
getMaxAngle
public int getMaxAngle()
- Returns:
-
setHeight
public void setHeight(float height)
The Latitude posiiton.- Parameters:
height
- in degrees 0-360°
-
setAzimuth
public void setAzimuth(float azimuth)
The longitudinal position- Parameters:
azimuth
- in degrees 0-360°
-
setTone
public void setTone(com.badlogic.gdx.graphics.Color tone)
- Parameters:
tone
-
-
setFixedPosition
public void setFixedPosition(boolean fixedPosition)
- Parameters:
fixedPosition
- if true does not move
-
update
public void update(float dt)
- Parameters:
dt
-
-
getLight
public com.badlogic.gdx.graphics.Color getLight()
Returns the diffuse light which this object emits.- Returns:
- copy safe
-
getAmbient
public com.badlogic.gdx.graphics.Color getAmbient()
Returns the ambient light the GLS emits.- Returns:
- copy safe
-
getNormal
public com.badlogic.gdx.math.Vector3 getNormal()
- Returns:
- the normal of the GlobalLightSource
-
-