public class Sun
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static float |
SHADOW_ALPHA |
| Constructor and Description |
|---|
Sun()
Track sun position (accuracy of ~1 minute).
|
| Modifier and Type | Method and Description |
|---|---|
int |
getColor()
RGB - the color of sun.
|
java.util.Map<java.lang.Float,java.lang.Integer> |
getColorMap()
Get the colors of day cycle.
|
float |
getLatitude() |
float |
getLongitude() |
float[] |
getPosition() |
float |
getProgress() |
float |
getSunrise() |
float |
getSunset() |
void |
setColor(int color) |
void |
setColorMap(java.util.Map<java.lang.Float,java.lang.Integer> colorMap)
Set the colors of day cycle.
|
void |
setCoordinates(float latitude,
float longitude) |
void |
setDayOfYear(int day)
Customize day of the year.
|
void |
setPosition(float x,
float y,
float z) |
void |
setProgress(float progress)
Customize progress.
|
float |
setProgress(int hour,
int minute,
int second)
Customize progress with specified time.
|
void |
update()
Update sun progress, position and color to current date time.
|
int |
updateColor() |
float[] |
updatePosition()
Very simple normalized sun coordinates.
|
float |
updateProgress()
The progress
of the daylight in range 0 (sunrise) to 1 (sunset) and
of the night in range 1 (sunset) to 2 (sunrise).
|
void |
updateToDay()
Calculate the sunrise and sunset of set day (local time).
|
public int getColor()
public java.util.Map<java.lang.Float,java.lang.Integer> getColorMap()
public float getLatitude()
public float getLongitude()
public float[] getPosition()
public float getProgress()
public float getSunrise()
public float getSunset()
public void setColor(int color)
color - RGB - the color of sun, A - the diffuse of shadowpublic void setColorMap(java.util.Map<java.lang.Float,java.lang.Integer> colorMap)
public void setCoordinates(float latitude,
float longitude)
public void setDayOfYear(int day)
public void setPosition(float x,
float y,
float z)
public void setProgress(float progress)
public float setProgress(int hour,
int minute,
int second)
hour - the hour [0..23]minute - the minute [0..59]second - the second [0..59]public void update()
public int updateColor()
public float[] updatePosition()
public float updateProgress()
public void updateToDay()