Overview   Project   Class   Tree   Deprecated   Index 
0 A.D.
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

graphics
Class CLightEnv

   in LightEnv.h
   in LightEnv.cpp

class CLightEnv

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


Field Summary
private float m_Elevation
          m_Elevation: Height of sun above the horizon, in radians.
private float m_Rotation
          m_Rotation: Direction of sun on the compass, in radians.
 RGBColor m_SunColor
          
private CVector3D m_SunDir
          
 RGBColor m_TerrainAmbientColor
          
private float m_TerrainShadowTransparency
          m_TerrainShadowTransparency: Fraction of diffuse light that reaches shadowed terrain.
 RGBColor m_UnitsAmbientColor
          
 
Constructor Summary
CLightEnv()
          ========================================================================= File : LightEnv.
 
Method Summary
private void CalculateSunDirection()
          
 void EvaluateDirect( const CVector3D& normal, RGBColor& color ) const
          EvaluateDirect: Like EvaluateTerrain and EvaluateUnit, but return only the direct sunlight term without ambient.
 void EvaluateTerrain( const CVector3D& normal, RGBColor& color ) const
          EvaluateTerrain: Calculate brightness of a point of the terrain with the given normal vector.
 void EvaluateUnit( const CVector3D& normal, RGBColor& color ) const
          EvaluateUnit: Calculate brightness of a point of a unit with the given normal vector.
 float GetElevation() const
          
 float GetRotation() const
          
 const CVector3D& GetSunDir() const
          
 float GetTerrainShadowTransparency() const
          
 bool operator!=( const CLightEnv& o ) const
          
 bool operator==( const CLightEnv& o ) const
          
 void SetElevation( float f )
          
 void SetRotation( float f )
          
 void SetTerrainShadowTransparency( float f )
          
 

Field Detail

m_Elevation

private float m_Elevation;
m_Elevation: Height of sun above the horizon, in radians. For example, an elevation of PI/2 means the sun is straight up.

m_Rotation

private float m_Rotation;
m_Rotation: 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 PI/2 means the sun is in the direction (1,0,0) (not taking elevation into account).

m_SunColor

public RGBColor m_SunColor;

m_SunDir

private CVector3D m_SunDir;

m_TerrainAmbientColor

public RGBColor m_TerrainAmbientColor;

m_TerrainShadowTransparency

private float m_TerrainShadowTransparency;
m_TerrainShadowTransparency: Fraction of diffuse light that reaches shadowed terrain. A value of 0.0 means shadowed polygons get only ambient light, while a value of 1.0 means shadows don't have any effect at all.

m_UnitsAmbientColor

public RGBColor m_UnitsAmbientColor;


Constructor Detail

CLightEnv

public CLightEnv();
========================================================================= File : LightEnv.cpp Project : Pyrogenesis Description : CLightEnv implementation =========================================================================


Method Detail

CalculateSunDirection

private void CalculateSunDirection();

EvaluateDirect

public void EvaluateDirect( const CVector3D& normal, RGBColor& color ) const;
EvaluateDirect: Like EvaluateTerrain and EvaluateUnit, but return only the direct sunlight term without ambient.
Parameters:
normal - normal vector (must have length 1)
color - resulting color

EvaluateTerrain

public void EvaluateTerrain( const CVector3D& normal, RGBColor& color ) const;
EvaluateTerrain: Calculate brightness of a point of the terrain with the given normal vector. The resulting color contains both ambient and diffuse light.
Parameters:
normal - normal vector (must have length 1)
color - resulting color

EvaluateUnit

public void EvaluateUnit( const CVector3D& normal, RGBColor& color ) const;
EvaluateUnit: Calculate brightness of a point of a unit with the given normal vector. The resulting color contains both ambient and diffuse light.
Parameters:
normal - normal vector (must have length 1)
color - resulting color

GetElevation

public float GetElevation() const;

GetRotation

public float GetRotation() const;

GetSunDir

public const CVector3D& GetSunDir() const;

GetTerrainShadowTransparency

public float GetTerrainShadowTransparency() const;

operator!=

public bool operator!=( const CLightEnv& o ) const;

operator==

public bool operator==( const CLightEnv& o ) const;

SetElevation

public void SetElevation( float f );

SetRotation

public void SetRotation( float f );

SetTerrainShadowTransparency

public void SetTerrainShadowTransparency( float f );

 Overview   Project   Class   Tree   Deprecated   Index 
0 A.D.
Generated on September 04, 2007 at 18:13
CppDoc v2.4.0
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD