NL3D::CVegetableLightEx Class Reference

#include <vegetable_light_ex.h>


Detailed Description

Additional information to light Vegetables. 2 "precomputed" pointLights can additionally light the vegetables.
Author:
Lionel Berenguier

Nevrax France

Date:
2002

Definition at line 48 of file vegetable_light_ex.h.

Public Types

enum  { MaxNumLight = 2 }
 Must not change (hardcoded). More...


Public Member Functions

void computeCurrentColors ()
 Fill Color array according to PointLight[] and PointLightFactor[].

 CVegetableLightEx ()

Data Fields

NLMISC::CRGBA Color [MaxNumLight]
 Current Color of the light.

CVector Direction [MaxNumLight]
 Direction of the light. the direction to the instance should be precomputed.

uint NumLights
 Number Of light currently really enabled.

CPointLightNamedPointLight [MaxNumLight]
 PointLights. Used at CVegetableManager::updateLighting() to get current colors of pointLights.

uint PointLightFactor [MaxNumLight]
 Factor to be multiplied by color of the light. Actually it is the attenuation factor.


Member Enumeration Documentation

anonymous enum
 

Must not change (hardcoded).

Enumeration values:
MaxNumLight 

Definition at line 53 of file vegetable_light_ex.h.

00053 {MaxNumLight= 2};


Constructor & Destructor Documentation

NL3D::CVegetableLightEx::CVegetableLightEx  )  [inline]
 

Definition at line 68 of file vegetable_light_ex.h.

References NumLights.

00069         {
00070                 NumLights= 0;
00071         }


Member Function Documentation

void NL3D::CVegetableLightEx::computeCurrentColors  ) 
 

Fill Color array according to PointLight[] and PointLightFactor[].

Definition at line 37 of file vegetable_light_ex.cpp.

References NL3D::CPointLightNamed::getUnAnimatedDiffuse(), NLMISC::CRGBA::modulateFromui(), NumLights, PointLightFactor, and uint.

Referenced by NL3D::CPatch::generateTileVegetable(), and NL3D::CVegetableManager::updateLightingIGPart().

00038 {
00039         for(uint i=0;i<NumLights;i++)
00040         {
00041                 // get the light.
00042                 CPointLightNamed        *pl= PointLight[i];
00043                 // get the attenuation
00044                 uint    att= PointLightFactor[i];
00045                 // modulate the color with it. Use the Unanimated one!!
00046                 Color[i].modulateFromui(pl->getUnAnimatedDiffuse(), att);
00047         }
00048 }


Field Documentation

NLMISC::CRGBA NL3D::CVegetableLightEx::Color[MaxNumLight]
 

Current Color of the light.

Definition at line 65 of file vegetable_light_ex.h.

Referenced by NL3D::CVegetableManager::addInstance(), and NL3D::CVegetableManager::updateInstanceLighting().

CVector NL3D::CVegetableLightEx::Direction[MaxNumLight]
 

Direction of the light. the direction to the instance should be precomputed.

Definition at line 60 of file vegetable_light_ex.h.

Referenced by NL3D::computeVegetVertexLighting(), NL3D::computeVegetVertexLightingForceBestSided(), and NL3D::CPatch::generateTileVegetable().

uint NL3D::CVegetableLightEx::NumLights
 

Number Of light currently really enabled.

Definition at line 56 of file vegetable_light_ex.h.

Referenced by NL3D::CVegetableManager::addInstance(), computeCurrentColors(), NL3D::computeVegetVertexLighting(), NL3D::computeVegetVertexLightingForceBestSided(), CVegetableLightEx(), NL3D::CPatch::generateTileVegetable(), and NL3D::CVegetableManager::updateInstanceLighting().

CPointLightNamed* NL3D::CVegetableLightEx::PointLight[MaxNumLight]
 

PointLights. Used at CVegetableManager::updateLighting() to get current colors of pointLights.

Definition at line 58 of file vegetable_light_ex.h.

Referenced by NL3D::CPatch::generateTileVegetable().

uint NL3D::CVegetableLightEx::PointLightFactor[MaxNumLight]
 

Factor to be multiplied by color of the light. Actually it is the attenuation factor.

Definition at line 62 of file vegetable_light_ex.h.

Referenced by computeCurrentColors(), and NL3D::CPatch::generateTileVegetable().


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 08:21:35 2004 for NeL by doxygen 1.3.6