caelum::GroundFog Class Reference

#include <GroundFog.h>

Inheritance diagram for caelum::GroundFog:

caelum::CameraBoundElement

List of all members.

Public Types

typedef std::set< Ogre::Pass * > PassSet

Public Member Functions

 GroundFog (Ogre::SceneManager *scene, Ogre::SceneNode *caelumRootNode, const Ogre::String &domeMaterialName="CaelumGroundFogDome", const Ogre::String &domeEntityName="CaelumGroundFogDome")
virtual ~GroundFog ()
PassSetgetPasses ()
const PassSetgetPasses () const
void findFogPassesByName (const Ogre::String &passName=DEFAULT_PASS_NAME)
void setDensity (Ogre::Real density)
 Sets the fog density multiplier.
Ogre::Real getDensity ()
 Get the fog density multiplier.
void setColour (const Ogre::ColourValue &colour)
 Sets fog colour.
Ogre::ColourValue getColour ()
 Gets fog colour.
void setVerticalDecay (Ogre::Real verticalDecay)
 Sets the vertical fog decay constant.
Ogre::Real getVerticalDecay ()
 Get the vertical fog decay constant.
void setGroundLevel (Ogre::Real GroundLevela)
Ogre::Real getGroundLevel ()
void forceUpdate ()
virtual void notifyCameraChanged (Ogre::Camera *cam)
 Handle camera change.

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.

Definition at line 42 of file GroundFog.h.


Member Typedef Documentation

typedef std::set<Ogre::Pass *> caelum::GroundFog::PassSet

Typedef for easier manipulation of a set of Passes.

Definition at line 59 of file GroundFog.h.


Constructor & Destructor Documentation

caelum::GroundFog::GroundFog ( Ogre::SceneManager *  scene,
Ogre::SceneNode *  caelumRootNode,
const Ogre::String &  domeMaterialName = "CaelumGroundFogDome",
const Ogre::String &  domeEntityName = "CaelumGroundFogDome" 
)

Constructor.

Definition at line 28 of file GroundFog.cpp.

References forceUpdate().

caelum::GroundFog::~GroundFog (  )  [virtual]

Virtual destructor.

Definition at line 67 of file GroundFog.cpp.

References setDensity().


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 79 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 83 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 87 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 150 of file GroundFog.cpp.

Ogre::Real caelum::GroundFog::getGroundLevel (  ) 

Get the ground level.

Definition at line 161 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 Fri Jul 11 09:24:53 2008 for Caelum by  doxygen 1.5.6