NASA World Wind

gov.nasa.worldwind.layers.Earth
Class SkyGradientLayer

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.WWObjectImpl
          extended by gov.nasa.worldwind.layers.AbstractLayer
              extended by gov.nasa.worldwind.layers.Earth.SkyGradientLayer
All Implemented Interfaces:
AVList, Disposable, Layer, WWObject, PropertyChangeListener, EventListener

public class SkyGradientLayer
extends AbstractLayer

Renders an atmosphere around the globe and the sky at low altitude.

Ported from my WW plugin SkyGradient and from WW2DPlusOne.

Note : based on a spherical globe.
Issues : Ellipsoidal globe doesnt match the spherical atmosphere everywhere. Doesnt behave properly when the eye is at negative elevation.


Field Summary
protected  int glListId
           
protected  float[] horizonColor
           
protected  double lastRebuildAltitude
           
protected  double thickness
           
protected  float[] zenithColor
           
 
Fields inherited from class gov.nasa.worldwind.avlist.AVListImpl
changeSupport
 
Constructor Summary
SkyGradientLayer()
          Renders an atmosphere around the globe
 
Method Summary
 void dispose()
           
 void doRender(DrawContext dc)
           
 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
 String toString()
           
 
Methods inherited from class gov.nasa.worldwind.layers.AbstractLayer
doPick, getMaxActiveAltitude, getMinActiveAltitude, getName, getOpacity, isAtMaxResolution, isEnabled, isLayerActive, isLayerInView, isMultiResolution, isPickEnabled, pick, render, setEnabled, setMaxActiveAltitude, setMinActiveAltitude, setName, setOpacity, setPickEnabled
 
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, propertyChange, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gov.nasa.worldwind.avlist.AVList
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 

Field Detail

glListId

protected int glListId

horizonColor

protected float[] horizonColor

lastRebuildAltitude

protected double lastRebuildAltitude

thickness

protected double thickness

zenithColor

protected float[] zenithColor
Constructor Detail

SkyGradientLayer

public SkyGradientLayer()
Renders an atmosphere around the globe

Method Detail

dispose

public void dispose()
Specified by:
dispose in interface Disposable
Overrides:
dispose in class AbstractLayer

doRender

public void doRender(DrawContext dc)
Specified by:
doRender in class AbstractLayer

getAtmosphereThickness

public double getAtmosphereThickness()
Get the atmosphere thickness in meter

Returns:
the atmosphere thickness in meter

getHorizonColor

public Color getHorizonColor()
Get the horizon color

Returns:
the horizon color

getZenithColor

public Color getZenithColor()
Get the zenith color

Returns:
the zenith color

setAtmosphereThickness

public void setAtmosphereThickness(double thickness)
Set the atmosphere thickness in meter

Parameters:
thickness - the atmosphere thickness in meter

setHorizonColor

public void setHorizonColor(Color color)
Set the horizon color

Parameters:
color - the horizon color

setZenithColor

public void setZenithColor(Color color)
Set the zenith color

Parameters:
color - the zenith color

toString

public String toString()
Overrides:
toString in class AbstractLayer

NASA World Wind