22 #ifndef INCLUDED_LIGHTENV
23 #define INCLUDED_LIGHTENV
131 int c =
clamp((
int)(dot * 255), 0, 255);
155 return !(*
this == o);
162 #endif // INCLUDED_LIGHTENV
float GetElevation() const
const CVector3D & GetSunDir() const
void CalculateSunDirection()
RGBColor m_TerrainAmbientColor
const std::string & GetLightingModel() const
float Dot(const CVector3D &vector) const
SColor4ub EvaluateTerrainDiffuseScaled(const CVector3D &normal) const
Compute the diffuse sun lighting color on terrain, for rendering with CPU lighting.
std::string m_LightingModel
A string that shaders use to determine what lighting model to implement.
void SetElevation(float f)
float m_Elevation
Height of sun above the horizon, in radians.
RGBColor EvaluateUnitScaled(const CVector3D &normal) const
Calculate brightness of a point of a unit with the given normal vector, for rendering with CPU lighti...
RGBColor m_UnitsAmbientColor
float m_Rotation
Direction of sun on the compass, in radians.
SColor4ub(* ConvertRGBColorTo4ub)(const RGBColor &src)
void SetLightingModel(const std::string &model)
float GetRotation() const
void SetRotation(float f)
bool operator!=(const CLightEnv &o) const
SColor4ub EvaluateTerrainDiffuseFactor(const CVector3D &normal) const
Compute the diffuse sun lighting factor on terrain, for rendering with shader lighting.
bool operator==(const CLightEnv &o) const
Class CLightEnv: description of a lighting environment - contains all the necessary parameters for re...
T clamp(T value, T min, T max)
CVector3D m_SunDir
Vector corresponding to m_Elevation and m_Rotation.