public class TLspFog extends ALspGraphicsEffect
GL_EXP
mode. The getDensity()
method computes a fog density
value based on the altitude of the camera and the visibility distance.Constructor and Description |
---|
TLspFog(ILspView aView)
Creates a new fog effect for the given view.
|
Modifier and Type | Method and Description |
---|---|
Color |
getColor()
Returns the fog color.
|
double |
getDensity()
Returns the current fog density in the view.
|
double |
getMaxAltitude()
Returns the altitude above which fog is no longer applied.
|
double |
getMinAltitude()
Returns the altitude below which visibility due to fog is at its lowest value.
|
double |
getVisibilityAtMinAltitude()
Returns the visibility distance when the camera is at or below
getMinAltitude() . |
void |
setColor(Color aColor)
Sets the fog color.
|
void |
setMaxAltitude(double aMaxAltitude)
Sets the altitude above which fog is no longer applied.
|
void |
setMinAltitude(double aMinAltitude)
Sets the altitude below which visibility due to fog is at its lowest value.
|
void |
setVisibilityAtMinAltitude(double aVisibilityAtMinAltitude)
Sets the visibility distance used when the camera is at or below
getMinAltitude() . |
addPropertyChangeListener, equals, firePropertyChange, hashCode, isEnabled, removePropertyChangeListener, setEnabled
public TLspFog(ILspView aView)
aView
- the view in which the fog will be usedpublic double getDensity()
getVisibilityAtMinAltitude()
and the altitude of the camera between getMinAltitude()
and
getMaxAltitude()
. The density fades to zero when the camera reaches the
maximum altitude.
Fog is implemented analogous to OpenGL's fixed-function GL_EXP
fog mode.
This means that for any point in the world, a fog percentage is computed as
1.0 - exp(-d*z)
, where d is the fog density and z is the distance of the
point to the eye.public Color getColor()
public void setColor(Color aColor)
aColor
- the new fog colorpublic double getVisibilityAtMinAltitude()
getMinAltitude()
.
The distance is measured in world units. The default value is 100 km.public void setVisibilityAtMinAltitude(double aVisibilityAtMinAltitude)
getMinAltitude()
.aVisibilityAtMinAltitude
- the minimum visibility distance due to fogpublic double getMinAltitude()
public void setMinAltitude(double aMinAltitude)
aMinAltitude
- the altitude at which minimum visibility is reachedpublic double getMaxAltitude()
public void setMaxAltitude(double aMaxAltitude)
aMaxAltitude
- the altitude above which fog is no longer applied