Pyrogenesis  trunk
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
CLightEnv Class Reference

Class CLightEnv: description of a lighting environment - contains all the necessary parameters for representation of the lighting within a scenario. More...

#include <LightEnv.h>

Collaboration diagram for CLightEnv:
Collaboration graph
[legend]

Public Member Functions

 CLightEnv ()
 
float GetElevation () const
 
float GetRotation () const
 
const CVector3DGetSunDir () const
 
const std::string & GetLightingModel () const
 
void SetElevation (float f)
 
void SetRotation (float f)
 
void SetLightingModel (const std::string &model)
 
RGBColor EvaluateUnitScaled (const CVector3D &normal) const
 Calculate brightness of a point of a unit with the given normal vector, for rendering with CPU lighting. More...
 
SColor4ub EvaluateTerrainDiffuseScaled (const CVector3D &normal) const
 Compute the diffuse sun lighting color on terrain, for rendering with CPU lighting. More...
 
SColor4ub EvaluateTerrainDiffuseFactor (const CVector3D &normal) const
 Compute the diffuse sun lighting factor on terrain, for rendering with shader lighting. More...
 
bool operator== (const CLightEnv &o) const
 
bool operator!= (const CLightEnv &o) const
 

Public Attributes

RGBColor m_SunColor
 
RGBColor m_TerrainAmbientColor
 
RGBColor m_UnitsAmbientColor
 
RGBColor m_FogColor
 
float m_FogFactor
 
float m_FogMax
 
float m_Brightness
 
float m_Contrast
 
float m_Saturation
 
float m_Bloom
 

Private Member Functions

void CalculateSunDirection ()
 

Private Attributes

float m_Elevation
 Height of sun above the horizon, in radians. More...
 
float m_Rotation
 Direction of sun on the compass, in radians. More...
 
CVector3D m_SunDir
 Vector corresponding to m_Elevation and m_Rotation. More...
 
std::string m_LightingModel
 A string that shaders use to determine what lighting model to implement. More...
 

Friends

class CMapWriter
 
class CMapReader
 
class CXMLReader
 

Detailed Description

Class CLightEnv: description of a lighting environment - contains all the necessary parameters for representation of the lighting within a scenario.

Constructor & Destructor Documentation

CLightEnv::CLightEnv ( )

Member Function Documentation

void CLightEnv::CalculateSunDirection ( )
private
SColor4ub CLightEnv::EvaluateTerrainDiffuseFactor ( const CVector3D normal) const
inline

Compute the diffuse sun lighting factor on terrain, for rendering with shader lighting.

Parameters
normalnormal vector (must have length 1)
SColor4ub CLightEnv::EvaluateTerrainDiffuseScaled ( const CVector3D normal) const
inline

Compute the diffuse sun lighting color on terrain, for rendering with CPU lighting.

To cope with sun overbrightness, the color is scaled by 0.5.

Parameters
normalnormal vector (must have length 1)
RGBColor CLightEnv::EvaluateUnitScaled ( const CVector3D normal) const
inline

Calculate brightness of a point of a unit with the given normal vector, for rendering with CPU lighting.

The resulting color contains both ambient and diffuse light. To cope with sun overbrightness, the color is scaled by 0.5.

Parameters
normalnormal vector (must have length 1)
float CLightEnv::GetElevation ( ) const
inline
const std::string& CLightEnv::GetLightingModel ( ) const
inline
float CLightEnv::GetRotation ( ) const
inline
const CVector3D& CLightEnv::GetSunDir ( ) const
inline
bool CLightEnv::operator!= ( const CLightEnv o) const
inline
bool CLightEnv::operator== ( const CLightEnv o) const
inline
void CLightEnv::SetElevation ( float  f)
void CLightEnv::SetLightingModel ( const std::string &  model)
inline
void CLightEnv::SetRotation ( float  f)

Friends And Related Function Documentation

friend class CMapReader
friend
friend class CMapWriter
friend
friend class CXMLReader
friend

Member Data Documentation

float CLightEnv::m_Bloom
float CLightEnv::m_Brightness
float CLightEnv::m_Contrast
float CLightEnv::m_Elevation
private

Height of sun above the horizon, in radians.

For example, an elevation of M_PI/2 means the sun is straight up.

RGBColor CLightEnv::m_FogColor
float CLightEnv::m_FogFactor
float CLightEnv::m_FogMax
std::string CLightEnv::m_LightingModel
private

A string that shaders use to determine what lighting model to implement.

Current recognised values are "old" and "standard".

float CLightEnv::m_Rotation
private

Direction of sun on the compass, in radians.

For example, a rotation of zero means the sun is in the direction (0,0,-1) and a rotation of M_PI/2 means the sun is in the direction (1,0,0) (not taking elevation into account).

float CLightEnv::m_Saturation
RGBColor CLightEnv::m_SunColor
CVector3D CLightEnv::m_SunDir
private

Vector corresponding to m_Elevation and m_Rotation.

Updated by CalculateSunDirection.

RGBColor CLightEnv::m_TerrainAmbientColor
RGBColor CLightEnv::m_UnitsAmbientColor

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