Caelum::GroundFog Class Reference

Exponential ground fog system implementation. More...

#include <GroundFog.h>

Inheritance diagram for Caelum::GroundFog:

Caelum::CameraBoundElement

List of all members.

Classes

struct  DomeFogParams
struct  FogParamsBase
 Params references.
struct  PassFogParams

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.
const PassSetgetPasses () const
 Get the set of currently controlled passes.
void findFogPassesByName (const Ogre::String &passName=DEFAULT_PASS_NAME)
 Find caelum fog passes to control by name.
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.
Ogre::Real getGroundLevel () const
 Get the ground level.
void forceUpdate ()
 Forces an update of all the passes.
virtual void notifyCameraChanged (Ogre::Camera *cam)
 Handle camera change.
void setQueryFlags (uint flags)
uint getQueryFlags () const
void setVisibilityFlags (uint flags)
uint getVisibilityFlags () const

Static Public Attributes

static const Ogre::String DEFAULT_PASS_NAME = "CaelumGroundFog"

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.

Definition at line 47 of file GroundFog.h.


Member Function Documentation

GroundFog::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.

Definition at line 69 of file GroundFog.cpp.

const GroundFog::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.

Definition at line 73 of file GroundFog.cpp.

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()

Definition at line 77 of file GroundFog.cpp.

References forceUpdate().

void Caelum::GroundFog::setGroundLevel ( Ogre::Real  GroundLevela  ) 

Sets the ground level.

At ground level 'fogginess' is equal to 1.

Definition at line 144 of file GroundFog.cpp.

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.

Definition at line 165 of file GroundFog.cpp.

Referenced by findFogPassesByName(), and GroundFog().


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

Generated on Sun Aug 9 10:24:22 2009 for Caelum by  doxygen 1.5.9