public class SkyGradientLayer extends AbstractLayer
Modifier and Type | Field and Description |
---|---|
protected float[] |
horizonColor |
protected static int |
SLICES |
protected static int |
STACKS |
protected double |
thickness |
protected float[] |
zenithColor |
Constructor and Description |
---|
SkyGradientLayer()
Renders an atmosphere around the globe
|
Modifier and Type | Method and Description |
---|---|
protected void |
applyDrawProjection(DrawContext dc,
OGLStackHandler ogsh) |
protected void |
applyDrawTransform(DrawContext dc,
OGLStackHandler ogsh) |
protected static Vec4 |
CartesianToSpherical(double x,
double y,
double z)
Converts position in cartesian coordinates (XYZ) to spherical (radius, lat, lon) coordinates.
|
void |
doRender(DrawContext dc) |
protected void |
drawSkyDome(DrawContext dc,
float radius,
double startLat,
double endLat,
int slices,
int stacks,
float zenithOpacity,
float gradientBias)
Draws the sky dome
|
double |
getAtmosphereThickness()
Get the atmosphere thickness in meter
|
Color |
getHorizonColor()
Get the horizon color
|
Color |
getZenithColor()
Get the zenith color
|
void |
setAtmosphereThickness(double thickness)
Set the atmosphere thickness in meter
|
void |
setHorizonColor(Color color)
Set the horizon color
|
void |
setZenithColor(Color color)
Set the zenith color
|
protected static Vec4 |
SphericalToCartesian(double latitude,
double longitude,
double radius)
Converts position in spherical coordinates (lat/lon/altitude) to cartesian (XYZ) coordinates.
|
String |
toString() |
protected void |
updateSkyDome(DrawContext dc) |
createLayerConfigElements, dispose, doPick, doPreRender, getDataFileStore, getExpiryTime, getLayerConfigParams, getMaxActiveAltitude, getMaxEffectiveAltitude, getMinActiveAltitude, getMinEffectiveAltitude, getName, getOpacity, getRestorableState, getScale, getScreenCredit, isAtMaxResolution, isEnabled, isLayerActive, isLayerConfigDocument, isLayerInView, isMultiResolution, isNetworkRetrievalEnabled, isPickEnabled, pick, preRender, render, restoreState, setDataFileStore, setEnabled, setExpiryTime, setMaxActiveAltitude, setMinActiveAltitude, setName, setNetworkRetrievalEnabled, setOpacity, setPickEnabled, setScreenCredit
onMessage, propertyChange
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
propertyChange
onMessage
protected float[] horizonColor
protected static final int SLICES
protected static final int STACKS
protected double thickness
protected float[] zenithColor
public SkyGradientLayer()
protected void applyDrawProjection(DrawContext dc, OGLStackHandler ogsh)
protected void applyDrawTransform(DrawContext dc, OGLStackHandler ogsh)
protected static Vec4 CartesianToSpherical(double x, double y, double z)
x
- X coordinatey
- Y coordinatez
- Z coordinateVec4
point for the spherical coordinates {radius, lat, lon}public void doRender(DrawContext dc)
doRender
in class AbstractLayer
protected void drawSkyDome(DrawContext dc, float radius, double startLat, double endLat, int slices, int stacks, float zenithOpacity, float gradientBias)
dc
- the current DrawContextradius
- the sky dome radiusstartLat
- the horizon latitudeendLat
- the zenith latitudeslices
- the number of slices - vertical divisionsstacks
- the nuber os stacks - horizontal divisionszenithOpacity
- the sky opacity at zenithgradientBias
- determines how fast the sky goes from the horizon color to the zenith color. A value of
1
with produce a balanced gradient, a value greater then 1
will
have the zenith color dominate and a value less then 1
will have the opposite
effect.public double getAtmosphereThickness()
public Color getHorizonColor()
public Color getZenithColor()
public void setAtmosphereThickness(double thickness)
thickness
- the atmosphere thickness in meterpublic void setHorizonColor(Color color)
color
- the horizon colorpublic void setZenithColor(Color color)
color
- the zenith colorprotected static Vec4 SphericalToCartesian(double latitude, double longitude, double radius)
latitude
- Latitude in decimal degreeslongitude
- Longitude in decimal degreesradius
- Radiuspublic String toString()
toString
in class AbstractLayer
protected void updateSkyDome(DrawContext dc)