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
 
void SetElevation (float f)
 
void SetRotation (float f)
 
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...
 
bool operator== (const CLightEnv &o) const
 
bool operator!= (const CLightEnv &o) const
 

Public Attributes

RGBColor m_SunColor
 
RGBColor m_AmbientColor
 
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...
 

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

Member Function Documentation

◆ CalculateSunDirection()

void CLightEnv::CalculateSunDirection ( )
private

◆ EvaluateUnitScaled()

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)

◆ GetElevation()

float CLightEnv::GetElevation ( ) const
inline

◆ GetRotation()

float CLightEnv::GetRotation ( ) const
inline

◆ GetSunDir()

const CVector3D& CLightEnv::GetSunDir ( ) const
inline

◆ operator!=()

bool CLightEnv::operator!= ( const CLightEnv o) const
inline

◆ operator==()

bool CLightEnv::operator== ( const CLightEnv o) const
inline

◆ SetElevation()

void CLightEnv::SetElevation ( float  f)

◆ SetRotation()

void CLightEnv::SetRotation ( float  f)

Friends And Related Function Documentation

◆ CMapReader

friend class CMapReader
friend

◆ CMapWriter

friend class CMapWriter
friend

◆ CXMLReader

friend class CXMLReader
friend

Member Data Documentation

◆ m_AmbientColor

RGBColor CLightEnv::m_AmbientColor

◆ m_Bloom

float CLightEnv::m_Bloom

◆ m_Brightness

float CLightEnv::m_Brightness

◆ m_Contrast

float CLightEnv::m_Contrast

◆ m_Elevation

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.

◆ m_FogColor

RGBColor CLightEnv::m_FogColor

◆ m_FogFactor

float CLightEnv::m_FogFactor

◆ m_FogMax

float CLightEnv::m_FogMax

◆ m_Rotation

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

◆ m_Saturation

float CLightEnv::m_Saturation

◆ m_SunColor

RGBColor CLightEnv::m_SunColor

◆ m_SunDir

CVector3D CLightEnv::m_SunDir
private

Vector corresponding to m_Elevation and m_Rotation.

Updated by CalculateSunDirection.


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