VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
makVrv::DtOsgSkyObject Class Reference

An OSG implementation of the sky. More...

Inheritance diagram for makVrv::DtOsgSkyObject:
Inheritance graph
[legend]

Classes

class  CloudLayer

Public Member Functions

 DtOsgSkyObject (DtDe &, DtUniqueID id)
 CTOR.
virtual ~DtOsgSkyObject ()
 DTOR.
virtual void setLocation (const DtVector &location)
 Set the location of the viewer where the sky is to be recalculated.
virtual const DtVectorlocation () const
 Get the location of the viewer where the sky is to be recalculated.
virtual void addCloudLayer (int deckType, const DtVector &location, const DtVector &bounds, double density, bool infinite, bool relative)
 Add new cloud layer.
virtual bool cloudLayer (int index, int &deckType, DtVector &location, DtVector &bounds, double &density, bool &infinite, bool &relative) const
 Get the information of a cloud layer.
virtual int cloudLayerCount () const
 Get the number of cloud layers.
virtual void removeCloudLayer (int index)
 Remove a cloud layer.
virtual void removeCloudLayers ()
 Remove all cloud layers.
virtual void sendCloudLayers ()
 Send cloud layers to the scene-graph.
virtual void setCloudLayerEnabled (int index, bool enabled)
 Enable/disable a cloud layer.
virtual float getSunAlpha () const
 Retrieves the visibility of the sun disc, which will be affected by fog.
virtual void setDrawSunAndMoonIntoEnvMap (bool draw)
 Sets whether the sun and moon are rendered into the environment map.
virtual void setCloudLayerPosition (int index, double xCoord, double yCoord)
 Move a cloud layer to a new position.
virtual void setWindDirection (float radians)
 Set wind direction blowing from in radians from north.
virtual float windDirection () const
 Get wind direction blowing from in radians from north.
virtual float windDirectionInDegrees () const
 Get wind direction blowing from in degrees from north.
void setGenerateCubeMaps (bool enabled)
 Toggles automatic generation of cube maps from the sky.
GLuint getCubeMap (const osg::ref_ptr< osg::Camera > camera, const osg::State &state) const
 Retrieve the OpenGL texture ID for a cube map generated from the local sky for a given camera.
GLuint getPrimaryCubeMap () const
 Retrieve the OpenGL texture ID for a cube map generated from the local sky for general use.
void setFogOverride (osg::ref_ptr< osg::Camera > camera, const osg::Vec4f &fogColor, float fogDensity)
 Override fog settings.
void clearFogOverride (osg::ref_ptr< osg::Camera > camera)
 Clear any fog override previously set.
void clearFogOverrideForAllCameras (void)
void setHorizonColor (const osg::Vec4f &horizonColor)
 Set the color at and below the horizon.
void clearHorizonColor ()
 Clear use of a fixed horizon color.
void updatePrecipitation ()
 Update the precipitation in the scene-graph.
DtSilverliningGroupgetDtSilverlining ()
 get Silverlining's Date and Time in the GMT timezone
void enableLighting (osg::ref_ptr< osg::Camera > camera, bool enable)
bool shouldActivateRaindrops () const
 check precipitation bools to see whether to draw the rain post effect
void setAboveWater (bool value)
 needed for god ray generation
bool aboveWater ()
virtual void setAirTurbidity (float turbidity)
virtual float airTurbidity () const
virtual void setAmbientAirTemperature (float temperature)
virtual float ambientAirTemperature () const
virtual void setVisibleDistance (float distance)
virtual float visibleDistance () const
virtual void setFogHeight (float meters)
virtual float fogHeight () const
virtual void setFogColor (const DtVector &color)
virtual const osg::Vec4 & fogColor () const
virtual void setFogThresholdDistance (float distance)
virtual float fogThresholdDistance () const
virtual void setPrecipitationEnabled (bool enabled)
virtual bool precipitationEnabled () const
virtual void setPrecipitationVisibilityEffectsEnabled (bool enabled)
virtual bool precipitationVisibilityEffectsEnabled () const
virtual void setPrecipitationType (int type)
virtual int precipitationType () const
virtual void setPrecipitationIntensity (float intensity)
virtual float precipitationIntensity () const
virtual void setWindSpeed (float metersPerSecond)
virtual float windSpeed () const
virtual void setMinimumWindAltitude (float alt)
virtual float minimumWindAltitude () const
virtual void setMaximumWindAltitude (float alt)
virtual float maximumWindAltitude () const
virtual void setLensFlare (bool enabled)
virtual bool lensFlare () const
virtual void setCrepuscularRays (bool enabled)
virtual bool crepuscularRays () const
virtual void setRainSplashEffect ()
- Public Member Functions inherited from makVrv::DtSkyObject
 DtSkyObject (DtDe &de, DtUniqueID id)
 CTOR.
virtual ~DtSkyObject ()
 DTOR.
virtual void setDateAndTime (unsigned short year, unsigned char month, unsigned char day, unsigned char hour, unsigned char minutes, double seconds, bool observeDaylightSavings)
 Set the date and time to show the sky.
void setAmbientLightValue (float ambientLightValue)
 This is set by the SilverLining group; it can be accessed only by getting the skyObject through the skyObjectAgent.
float ambientLightValue () const
void setIsDay (bool isDay)
 This is set by the SilverLining group; it can be accessed only by getting the skyObject through the skyObjectAgent.
bool isDay () const

Protected Types

typedef std::vector< CloudLayerCloudLayerList

Protected Member Functions

void updatePrecipitationOSG ()
void updatePrecipitationSilverLining ()
void on_coordinateSystemChanged (const std::string &type)
void applyCurrentSettings ()

Protected Attributes

DtDemyDe
DtSignalConnectionManager mySignals
osg::ref_ptr< DtSilverliningGroupmySilverliningGroup
DtVector myLocation
CloudLayerList myCloudLayerList
osg::ref_ptr
< osgParticle::PrecipitationEffect > 
myPrecipitationEffect
bool myPrecipitationEnabled
int myPrecipitationEffectType
float myPrecipitationIntensity
float myAirTurbidity
float myAirTemperature
float myVisibleDistance
float myFogHeight
osg::Vec4f myFogColor
float myFogThreshold
float myWindSpeed
float myWindDirection
float myWindAltMinimum
float myWindAltMaximum
bool myLensFlareEnabled
bool myCrepuscularRaysEnabled
bool myVisibilitySaved
float mySavedVisibility
bool myAboveWater
bool myPrecipitationVisibilityEffects
osg::ref_ptr< osg::TextureCubeMap > myDefaultCubeMap
- Protected Attributes inherited from makVrv::DtSkyObject
float myAmbientLightValue
bool myIsDay
DtSkyObjectSignalermySignaler

Additional Inherited Members

- Public Types inherited from makVrv::DtSkyObject
enum  PrecipitationType {
  None = 0, Rain = 1, SnowWet = 2, SnowDry = 3,
  Sleet = 4
}
 Precipitation types. More...
- Static Public Attributes inherited from makVrv::DtSkyObject
static const float DefaultDayLightLevel
 Value for daylight visibility.
static const float DefaultFogVisibilityLevel
 Value for fog visibility - standard definition (1000 m.)

Detailed Description

An OSG implementation of the sky.

Member Typedef Documentation

typedef std::vector<CloudLayer> makVrv::DtOsgSkyObject::CloudLayerList
protected

Constructor & Destructor Documentation

makVrv::DtOsgSkyObject::DtOsgSkyObject ( DtDe ,
DtUniqueID  id 
)

CTOR.

virtual makVrv::DtOsgSkyObject::~DtOsgSkyObject ( )
virtual

DTOR.

Member Function Documentation

virtual void makVrv::DtOsgSkyObject::setLocation ( const DtVector location)
virtual

Set the location of the viewer where the sky is to be recalculated.

Parameters
[in]locationis the local coordinate from which to generate the sky. Typically it is the observer location.

Reimplemented from makVrv::DtSkyObject.

virtual const DtVector& makVrv::DtOsgSkyObject::location ( ) const
virtual

Get the location of the viewer where the sky is to be recalculated.

Returns
the local coordinate from which to generate the sky.
virtual void makVrv::DtOsgSkyObject::addCloudLayer ( int  deckType,
const DtVector location,
const DtVector bounds,
double  density,
bool  infinite,
bool  relative 
)
virtual

Add new cloud layer.

Parameters
[in]deckTypethe type of clouds to add.
[in]locationthe position of clouds.
[in]boundsthe boundary of clouds.
[in]densitythe density of clouds.
[in]infinitea flag defining if the cloud layer is infinite.
[in]relativea flag indicating if the position is relative to the observer.
Returns
the index of the added cloud layer.

Reimplemented from makVrv::DtSkyObject.

virtual bool makVrv::DtOsgSkyObject::cloudLayer ( int  index,
int deckType,
DtVector location,
DtVector bounds,
double density,
bool infinite,
bool relative 
) const
virtual

Get the information of a cloud layer.

Parameters
[in]indexis the index of the cloud layer.
[in]deckTypethe type of clouds to add.
[in]locationthe position of clouds.
[in]boundsthe boundary of clouds.
[in]densitythe density of clouds.
[in]infinitea flag defining if the cloud layer is infinite.
[in]relativea flag defining if the position is relative to the camera.
Return values
trueif cloud layer was found and returned data is valid.
falseotherwise.
virtual int makVrv::DtOsgSkyObject::cloudLayerCount ( ) const
virtual

Get the number of cloud layers.

Reimplemented from makVrv::DtSkyObject.

virtual void makVrv::DtOsgSkyObject::removeCloudLayer ( int  index)
virtual

Remove a cloud layer.

Implements makVrv::DtSkyObject.

virtual void makVrv::DtOsgSkyObject::removeCloudLayers ( )
virtual

Remove all cloud layers.

Implements makVrv::DtSkyObject.

virtual void makVrv::DtOsgSkyObject::sendCloudLayers ( )
virtual

Send cloud layers to the scene-graph.

Note
Scene-graph cloud layers are cleared then re-set.
virtual void makVrv::DtOsgSkyObject::setCloudLayerEnabled ( int  index,
bool  enabled 
)
virtual

Enable/disable a cloud layer.

Implements makVrv::DtSkyObject.

virtual float makVrv::DtOsgSkyObject::getSunAlpha ( ) const
virtual

Retrieves the visibility of the sun disc, which will be affected by fog.

virtual void makVrv::DtOsgSkyObject::setDrawSunAndMoonIntoEnvMap ( bool  draw)
virtual

Sets whether the sun and moon are rendered into the environment map.

virtual void makVrv::DtOsgSkyObject::setAirTurbidity ( float  turbidity)
virtual

Set / Get the air turbidity (haziness/pollution)

Implements makVrv::DtSkyObject.

virtual float makVrv::DtOsgSkyObject::airTurbidity ( ) const
virtual
virtual void makVrv::DtOsgSkyObject::setAmbientAirTemperature ( float  temperature)
virtual

Set / Get the ambient air temperature

Implements makVrv::DtSkyObject.

virtual float makVrv::DtOsgSkyObject::ambientAirTemperature ( ) const
virtual
virtual void makVrv::DtOsgSkyObject::setVisibleDistance ( float  distance)
virtual

Set / Get the visible distance.

Implements makVrv::DtSkyObject.

virtual float makVrv::DtOsgSkyObject::visibleDistance ( ) const
virtual
virtual void makVrv::DtOsgSkyObject::setFogHeight ( float  meters)
virtual

Set / Get the ceiling height of the fog layer.

Implements makVrv::DtSkyObject.

virtual float makVrv::DtOsgSkyObject::fogHeight ( ) const
virtual
virtual void makVrv::DtOsgSkyObject::setFogColor ( const DtVector color)
virtual

Set / Get the fog color (which will be lit based on time of day.) The fog color will blend toward this value once visibility is below the fog threshold distance, otherwise hazy conditions dominated by Rayeligh scattering is assumed.

Implements makVrv::DtSkyObject.

virtual const osg::Vec4& makVrv::DtOsgSkyObject::fogColor ( ) const
virtual
virtual void makVrv::DtOsgSkyObject::setFogThresholdDistance ( float  distance)
virtual

Set / Get the visibility distance at which atmospheric attenuation is considered to be mostly Rayleigh scattering from small particles, instead of fog. Below this distance, the specified fog color is used, and the sun will start to fade out.

virtual float makVrv::DtOsgSkyObject::fogThresholdDistance ( ) const
virtual
virtual void makVrv::DtOsgSkyObject::setPrecipitationEnabled ( bool  enabled)
virtual

Set / Get whether precipitation is enabled.

Implements makVrv::DtSkyObject.

virtual bool makVrv::DtOsgSkyObject::precipitationEnabled ( ) const
virtual
virtual void makVrv::DtOsgSkyObject::setPrecipitationVisibilityEffectsEnabled ( bool  enabled)
virtual

Set / Get whether precipitation affects visibility.

virtual bool makVrv::DtOsgSkyObject::precipitationVisibilityEffectsEnabled ( ) const
virtual
virtual void makVrv::DtOsgSkyObject::setPrecipitationType ( int  type)
virtual

Set / Get the precipitation type.

Parameters
input0 = none, 1 = rain, 2 = wet snow, 3 = dry snow, 4 = sleet

Implements makVrv::DtSkyObject.

virtual int makVrv::DtOsgSkyObject::precipitationType ( ) const
virtual
virtual void makVrv::DtOsgSkyObject::setPrecipitationIntensity ( float  intensity)
virtual

Set / Get the precipitation intensity.

Implements makVrv::DtSkyObject.

virtual float makVrv::DtOsgSkyObject::precipitationIntensity ( ) const
virtual
virtual void makVrv::DtOsgSkyObject::setCloudLayerPosition ( int  index,
double  xCoord,
double  yCoord 
)
virtual

Move a cloud layer to a new position.

Implements makVrv::DtSkyObject.

virtual void makVrv::DtOsgSkyObject::setWindSpeed ( float  metersPerSecond)
virtual

Set / Get the wind speed in meters per second.

Implements makVrv::DtSkyObject.

virtual float makVrv::DtOsgSkyObject::windSpeed ( ) const
virtual
virtual void makVrv::DtOsgSkyObject::setWindDirection ( float  radians)
virtual

Set wind direction blowing from in radians from north.

Implements makVrv::DtSkyObject.

virtual float makVrv::DtOsgSkyObject::windDirection ( ) const
virtual

Get wind direction blowing from in radians from north.

virtual float makVrv::DtOsgSkyObject::windDirectionInDegrees ( ) const
virtual

Get wind direction blowing from in degrees from north.

this is not a member variable so every time it is called it converts from Radians to Degrees

virtual void makVrv::DtOsgSkyObject::setMinimumWindAltitude ( float  alt)
virtual

Set / Get minimum wind altitude.

virtual float makVrv::DtOsgSkyObject::minimumWindAltitude ( ) const
virtual
virtual void makVrv::DtOsgSkyObject::setMaximumWindAltitude ( float  alt)
virtual

Set / Get maximum wind altitude.

virtual float makVrv::DtOsgSkyObject::maximumWindAltitude ( ) const
virtual
virtual void makVrv::DtOsgSkyObject::setLensFlare ( bool  enabled)
virtual

Set / Get use of lens flare effects.

virtual bool makVrv::DtOsgSkyObject::lensFlare ( ) const
virtual
virtual void makVrv::DtOsgSkyObject::setCrepuscularRays ( bool  enabled)
virtual

Set / Get use of crepuscular rays (sun rays) effects.

virtual bool makVrv::DtOsgSkyObject::crepuscularRays ( ) const
virtual
virtual void makVrv::DtOsgSkyObject::setRainSplashEffect ( )
virtual

Set / Get use of rain splash effects.

void makVrv::DtOsgSkyObject::setGenerateCubeMaps ( bool  enabled)

Toggles automatic generation of cube maps from the sky.

GLuint makVrv::DtOsgSkyObject::getCubeMap ( const osg::ref_ptr< osg::Camera >  camera,
const osg::State &  state 
) const

Retrieve the OpenGL texture ID for a cube map generated from the local sky for a given camera.

GLuint makVrv::DtOsgSkyObject::getPrimaryCubeMap ( ) const

Retrieve the OpenGL texture ID for a cube map generated from the local sky for general use.

void makVrv::DtOsgSkyObject::setFogOverride ( osg::ref_ptr< osg::Camera >  camera,
const osg::Vec4f &  fogColor,
float  fogDensity 
)

Override fog settings.

void makVrv::DtOsgSkyObject::clearFogOverride ( osg::ref_ptr< osg::Camera >  camera)

Clear any fog override previously set.

void makVrv::DtOsgSkyObject::clearFogOverrideForAllCameras ( void  )
void makVrv::DtOsgSkyObject::setHorizonColor ( const osg::Vec4f &  horizonColor)

Set the color at and below the horizon.

void makVrv::DtOsgSkyObject::clearHorizonColor ( )

Clear use of a fixed horizon color.

void makVrv::DtOsgSkyObject::updatePrecipitation ( )

Update the precipitation in the scene-graph.

DtSilverliningGroup* makVrv::DtOsgSkyObject::getDtSilverlining ( )

get Silverlining's Date and Time in the GMT timezone

void makVrv::DtOsgSkyObject::enableLighting ( osg::ref_ptr< osg::Camera >  camera,
bool  enable 
)
bool makVrv::DtOsgSkyObject::shouldActivateRaindrops ( ) const

check precipitation bools to see whether to draw the rain post effect

void makVrv::DtOsgSkyObject::setAboveWater ( bool  value)
inline

needed for god ray generation

bool makVrv::DtOsgSkyObject::aboveWater ( )
inline
void makVrv::DtOsgSkyObject::updatePrecipitationOSG ( )
protected
void makVrv::DtOsgSkyObject::updatePrecipitationSilverLining ( )
protected
void makVrv::DtOsgSkyObject::on_coordinateSystemChanged ( const std::string &  type)
protected
void makVrv::DtOsgSkyObject::applyCurrentSettings ( )
protected

Member Data Documentation

DtDe& makVrv::DtOsgSkyObject::myDe
protected
DtSignalConnectionManager makVrv::DtOsgSkyObject::mySignals
protected
osg::ref_ptr<DtSilverliningGroup> makVrv::DtOsgSkyObject::mySilverliningGroup
protected
DtVector makVrv::DtOsgSkyObject::myLocation
protected
CloudLayerList makVrv::DtOsgSkyObject::myCloudLayerList
protected
osg::ref_ptr<osgParticle::PrecipitationEffect> makVrv::DtOsgSkyObject::myPrecipitationEffect
protected
bool makVrv::DtOsgSkyObject::myPrecipitationEnabled
protected
int makVrv::DtOsgSkyObject::myPrecipitationEffectType
protected
float makVrv::DtOsgSkyObject::myPrecipitationIntensity
protected
float makVrv::DtOsgSkyObject::myAirTurbidity
protected
float makVrv::DtOsgSkyObject::myAirTemperature
protected
float makVrv::DtOsgSkyObject::myVisibleDistance
protected
float makVrv::DtOsgSkyObject::myFogHeight
protected
osg::Vec4f makVrv::DtOsgSkyObject::myFogColor
protected
float makVrv::DtOsgSkyObject::myFogThreshold
protected
float makVrv::DtOsgSkyObject::myWindSpeed
protected
float makVrv::DtOsgSkyObject::myWindDirection
protected
float makVrv::DtOsgSkyObject::myWindAltMinimum
protected
float makVrv::DtOsgSkyObject::myWindAltMaximum
protected
bool makVrv::DtOsgSkyObject::myLensFlareEnabled
protected
bool makVrv::DtOsgSkyObject::myCrepuscularRaysEnabled
protected
bool makVrv::DtOsgSkyObject::myVisibilitySaved
protected
float makVrv::DtOsgSkyObject::mySavedVisibility
protected
bool makVrv::DtOsgSkyObject::myAboveWater
protected
bool makVrv::DtOsgSkyObject::myPrecipitationVisibilityEffects
protected
osg::ref_ptr<osg::TextureCubeMap> makVrv::DtOsgSkyObject::myDefaultCubeMap
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)