Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
LightEnvironmentClass Class Reference

#include <lightenvironment.h>

Classes

struct  InputLightStruct
 
struct  OutputLightStruct
 

Public Types

enum  { MAX_LIGHTS = 4 }
 

Public Member Functions

 LightEnvironmentClass (void)
 
 ~LightEnvironmentClass (void)
 
void Reset (const Vector3 &object_center, const Vector3 &scene_ambient)
 
void Add_Light (const LightClass &light)
 
void Pre_Render_Update (const Matrix3D &camera_tm)
 
void Add_Fill_Light (void)
 
void Calculate_Fill_Light (void)
 
void Set_Fill_Intensity (float intensity)
 
const Vector3Get_Equivalent_Ambient (void) const
 
void Set_Output_Ambient (Vector3 &oa)
 
int Get_Light_Count (void) const
 
const Vector3Get_Light_Direction (int i) const
 
const Vector3Get_Light_Diffuse (int i) const
 
bool isPointLight (int i) const
 
float getPointIrad (int i) const
 
float getPointOrad (int i) const
 
const Vector3getPointDiffuse (int i) const
 
const Vector3getPointAmbient (int i) const
 
const Vector3getPointCenter (int i) const
 
bool operator== (const LightEnvironmentClass &that) const
 

Static Public Member Functions

static void Set_Lighting_LOD_Cutoff (float inten)
 
static float Get_Lighting_LOD_Cutoff (void)
 
static int Get_Max_Lights ()
 

Protected Attributes

int LightCount
 
Vector3 ObjectCenter
 
InputLightStruct InputLights [MAX_LIGHTS]
 
Vector3 OutputAmbient
 
OutputLightStruct OutputLights [MAX_LIGHTS]
 
InputLightStruct FillLight
 
float FillIntensity
 

Detailed Description

LightEnvironmentClass This class represents an approximation of the local lighting for a given point. The idea is to collect all of the point light sources affecting an object at any given time and create temporary directional light sources representing them. Any distance or directional attenuation will be precalculated into the overall intensity of the light and a vector from the light source to the center of the bounding sphere of the model will be used as the directional component. In addition, the engine will provide the ambient component which will be determined by a combination of the ambient setting for the level and sampling the light maps in the area.

Notes:

  • will need fast collection of the lights affecting any one given object
  • intensity of these lights should take into account attenuation of the original light
  • intensity should also take into account spot attenuation (no-per vertex atten...)
  • we need the direction of the lights in eye-space
  • the ambient light from all lights should be added into the ambient light (not just scene)

Definition at line 73 of file lightenvironment.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MAX_LIGHTS 

Definition at line 122 of file lightenvironment.h.

Constructor & Destructor Documentation

◆ LightEnvironmentClass()

LightEnvironmentClass::LightEnvironmentClass ( void )

Definition at line 222 of file lightenvironment.cpp.

◆ ~LightEnvironmentClass()

LightEnvironmentClass::~LightEnvironmentClass ( void )

Definition at line 232 of file lightenvironment.cpp.

Member Function Documentation

◆ Add_Fill_Light()

void LightEnvironmentClass::Add_Fill_Light ( void )

Definition at line 343 of file lightenvironment.cpp.

◆ Add_Light()

void LightEnvironmentClass::Add_Light ( const LightClass & light)

Definition at line 245 of file lightenvironment.cpp.

◆ Calculate_Fill_Light()

void LightEnvironmentClass::Calculate_Fill_Light ( void )

Definition at line 379 of file lightenvironment.cpp.

◆ Get_Equivalent_Ambient()

const Vector3 & LightEnvironmentClass::Get_Equivalent_Ambient ( void ) const
inline

Definition at line 101 of file lightenvironment.h.

◆ Get_Light_Count()

int LightEnvironmentClass::Get_Light_Count ( void ) const
inline

Definition at line 103 of file lightenvironment.h.

◆ Get_Light_Diffuse()

const Vector3 & LightEnvironmentClass::Get_Light_Diffuse ( int i) const
inline

Definition at line 105 of file lightenvironment.h.

◆ Get_Light_Direction()

const Vector3 & LightEnvironmentClass::Get_Light_Direction ( int i) const
inline

Definition at line 104 of file lightenvironment.h.

◆ Get_Lighting_LOD_Cutoff()

float LightEnvironmentClass::Get_Lighting_LOD_Cutoff ( void )
static

Definition at line 331 of file lightenvironment.cpp.

◆ Get_Max_Lights()

static int LightEnvironmentClass::Get_Max_Lights ( )
inlinestatic

Definition at line 121 of file lightenvironment.h.

◆ getPointAmbient()

const Vector3 & LightEnvironmentClass::getPointAmbient ( int i) const
inline

Definition at line 111 of file lightenvironment.h.

◆ getPointCenter()

const Vector3 & LightEnvironmentClass::getPointCenter ( int i) const
inline

Definition at line 112 of file lightenvironment.h.

◆ getPointDiffuse()

const Vector3 & LightEnvironmentClass::getPointDiffuse ( int i) const
inline

Definition at line 110 of file lightenvironment.h.

◆ getPointIrad()

float LightEnvironmentClass::getPointIrad ( int i) const
inline

Definition at line 108 of file lightenvironment.h.

◆ getPointOrad()

float LightEnvironmentClass::getPointOrad ( int i) const
inline

Definition at line 109 of file lightenvironment.h.

◆ isPointLight()

bool LightEnvironmentClass::isPointLight ( int i) const
inline

Definition at line 107 of file lightenvironment.h.

◆ operator==()

bool LightEnvironmentClass::operator== ( const LightEnvironmentClass & that) const
inline

Definition at line 124 of file lightenvironment.h.

◆ Pre_Render_Update()

void LightEnvironmentClass::Pre_Render_Update ( const Matrix3D & camera_tm)

Definition at line 305 of file lightenvironment.cpp.

◆ Reset()

void LightEnvironmentClass::Reset ( const Vector3 & object_center,
const Vector3 & scene_ambient )

Definition at line 237 of file lightenvironment.cpp.

◆ Set_Fill_Intensity()

void LightEnvironmentClass::Set_Fill_Intensity ( float intensity)
inline

Definition at line 96 of file lightenvironment.h.

◆ Set_Lighting_LOD_Cutoff()

void LightEnvironmentClass::Set_Lighting_LOD_Cutoff ( float inten)
static

Definition at line 325 of file lightenvironment.cpp.

◆ Set_Output_Ambient()

void LightEnvironmentClass::Set_Output_Ambient ( Vector3 & oa)
inline

Definition at line 102 of file lightenvironment.h.

Member Data Documentation

◆ FillIntensity

float LightEnvironmentClass::FillIntensity
protected

Definition at line 179 of file lightenvironment.h.

◆ FillLight

InputLightStruct LightEnvironmentClass::FillLight
protected

Definition at line 178 of file lightenvironment.h.

◆ InputLights

InputLightStruct LightEnvironmentClass::InputLights[MAX_LIGHTS]
protected

Definition at line 173 of file lightenvironment.h.

◆ LightCount

int LightEnvironmentClass::LightCount
protected

Definition at line 171 of file lightenvironment.h.

◆ ObjectCenter

Vector3 LightEnvironmentClass::ObjectCenter
protected

Definition at line 172 of file lightenvironment.h.

◆ OutputAmbient

Vector3 LightEnvironmentClass::OutputAmbient
protected

Definition at line 175 of file lightenvironment.h.

◆ OutputLights

OutputLightStruct LightEnvironmentClass::OutputLights[MAX_LIGHTS]
protected

Definition at line 176 of file lightenvironment.h.


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