chai3d::cFog Class Reference

This class implements fog inside the world. More...

#include <CFog.h>

Public Member Functions

 cFog ()
 Constructor of cFog. More...
 
virtual ~cFog ()
 Destructor of cFog. More...
 
virtual void render (cRenderOptions &a_options)
 This method renders the fog using OpenGL. More...
 
void setEnabled (const bool a_enabled)
 This method enables of disables fog. More...
 
bool getEnabled () const
 This method returns true if fog is enabled, false otherwise. More...
 
void setFogMode (const GLint a_fogMode)
 This method sets the fog mode by passing the OpenGL fog mode constant as parameter (GL_LINEAR, GL_EXP, GL_EXP2). More...
 
void setFogModeLINEAR ()
 This method sets the fog mode to GL_LINEAR. More...
 
void setFogModeEXP ()
 This method sets the fog mode to GL_EXP. More...
 
void setFogModeEXP2 ()
 This method sets the fog mode to GL_EXP2. More...
 
GLint getFogMode ()
 This method returns the current fog mode. More...
 
void setProperties (const double a_start, const double a_end, const double a_density)
 This method sets the fog properties. More...
 

Public Attributes

cColorf m_color
 Fog color. More...
 

Protected Attributes

bool m_enabled
 If true, then fog is enabled, false otherwise. More...
 
GLint m_fogMode
 Fog mode. (GL_LINEAR, GL_EXP, GL_EXP2). More...
 
float m_start
 Fog start distance. More...
 
float m_end
 Fog end distance. More...
 
float m_density
 Fog density. More...
 

Detailed Description

This class implements support for OpenGL's fog capability. When fog is enabled, objects that are farther from the viewpoint begin to fade into the fog color. You can control the density of the fog, which determines the rate at which objects fade as the distance increases, as well as the fog's color.

Constructor & Destructor Documentation

chai3d::cFog::cFog ( )

Constructor of cFog.

virtual chai3d::cFog::~cFog ( )
inlinevirtual

Member Function Documentation

void chai3d::cFog::render ( cRenderOptions a_options)
virtual

This method render fog using OpenGL.

Parameters
a_optionsRendering options
void chai3d::cFog::setEnabled ( const bool  a_enabled)
inline
bool chai3d::cFog::getEnabled ( ) const
inline
void chai3d::cFog::setFogMode ( const GLint  a_fogMode)
inline
void chai3d::cFog::setFogModeLINEAR ( )
inline
void chai3d::cFog::setFogModeEXP ( )
inline
void chai3d::cFog::setFogModeEXP2 ( )
inline
GLint chai3d::cFog::getFogMode ( )
inline
void chai3d::cFog::setProperties ( const double  a_start,
const double  a_end,
const double  a_density 
)

This method sets the fog properties.

Parameters
a_startDistance from viewport.
a_endDistance from viewport.
a_densityFog density

Member Data Documentation

cColorf chai3d::cFog::m_color
bool chai3d::cFog::m_enabled
protected
GLint chai3d::cFog::m_fogMode
protected
float chai3d::cFog::m_start
protected
float chai3d::cFog::m_end
protected
float chai3d::cFog::m_density
protected

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