Caelum  0.6.3
Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
Caelum::GroundFog Class Reference

Exponential ground fog system implementation. More...

#include <GroundFog.h>

Inheritance diagram for Caelum::GroundFog:
Inheritance graph
[legend]

Public Types

typedef std::set< Ogre::Pass * > PassSet
 Typedef for easier manipulation of a set of Passes.
 

Public Member Functions

 GroundFog (Ogre::SceneManager *scene, Ogre::SceneNode *caelumRootNode, const Ogre::String &domeMaterialName="CaelumGroundFogDome", const Ogre::String &domeEntityName="CaelumGroundFogDome")
 Constructor.
 
virtual ~GroundFog ()
 Virtual destructor.
 
PassSetgetPasses ()
 Get the set of currently controlled passes. More...
 
const PassSetgetPasses () const
 Get the set of currently controlled passes. More...
 
void findFogPassesByName (const Ogre::String &passName=DEFAULT_PASS_NAME)
 Find caelum fog passes to control by name. More...
 
void setDensity (Ogre::Real density)
 Sets the fog density multiplier.
 
Ogre::Real getDensity () const
 Get the fog density multiplier.
 
void setColour (const Ogre::ColourValue &colour)
 Sets fog colour.
 
const Ogre::ColourValue getColour () const
 Gets fog colour.
 
void setVerticalDecay (Ogre::Real verticalDecay)
 Sets the vertical fog decay constant.
 
Ogre::Real getVerticalDecay () const
 Get the vertical fog decay constant.
 
void setGroundLevel (Ogre::Real GroundLevela)
 Sets the ground level. More...
 
Ogre::Real getGroundLevel () const
 Get the ground level.
 
void forceUpdate ()
 Forces an update of all the passes. More...
 
virtual void notifyCameraChanged (Ogre::Camera *cam)
 Handle camera change.
 
void setQueryFlags (uint flags)
 
uint getQueryFlags () const
 
void setVisibilityFlags (uint flags)
 
uint getVisibilityFlags () const
 
- Public Member Functions inherited from Caelum::CameraBoundElement
 CameraBoundElement ()
 Constructor. More...
 
virtual ~CameraBoundElement ()
 Virtual Destructor.
 
void forceFarRadius (Ogre::Real radius)
 Forces the "far" size of the element to a specific radius. More...
 
bool getAutoRadius () const
 Checks if this element is in auto-radius mode. More...
 
void setAutoRadius ()
 Re-enable auto-radius; if disabled. More...
 

Static Public Attributes

static const Ogre::String DEFAULT_PASS_NAME
 
- Static Public Attributes inherited from Caelum::CameraBoundElement
static const Ogre::Real CAMERA_FAR_DISTANCE_MULTIPLIER
 Camera distances multiplier for the far clipping distance. More...
 
static const Ogre::Real CAMERA_NEAR_DISTANCE_MULTIPLIER
 Camera distances multiplier for the near clipping distance. More...
 

Protected Member Functions

virtual void setFarRadius (Ogre::Real radius)
 Handle far radius.
 

Detailed Description

Exponential ground fog system implementation.

This class controls CaelumGroundFog passes in a potentially large number of materials, changing shader program parameters. This class keeps a list of passes to control; which can be build based on pass name.

This simulates a field of fog where "absorption" at a certain point is exp(-verticalDecay * (h - fogLevel)). This absorption is multiplicative, the total fog alpha is e^(-density * absorption_on_view_path).

You can set verticalDecay to 0 and get standard GL_EXP fog. Don't actually do that though because you'll get a division by 0.

Note
: This is deprecated starting from Caelum 0.4. The DepthComposer class provides similar functionality with less intrusion on your materials.

Member Function Documentation

PassSet& Caelum::GroundFog::getPasses ( )

Get the set of currently controlled passes.

This is provided if you really want to change the set by hand. You should call forceUpdate after modifying this set.

const PassSet& Caelum::GroundFog::getPasses ( ) const

Get the set of currently controlled passes.

This is a const overload which doesn't let you modify the underlying collection.

void Caelum::GroundFog::findFogPassesByName ( const Ogre::String passName = DEFAULT_PASS_NAME)

Find caelum fog passes to control by name.

By default this looks for passes called "CaleumGroundFog".

Note
This calls forceUpdate()
void Caelum::GroundFog::setGroundLevel ( Ogre::Real  GroundLevela)

Sets the ground level.

At ground level 'fogginess' is equal to 1.

void Caelum::GroundFog::forceUpdate ( )

Forces an update of all the passes.

You have to use this if you modify the set of passes by hand, otherwise avoid it.


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