Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Initial Version and Version 1 of ~archive/LightManager


Ignore:
Timestamp:
Oct 1, 2007, 5:02:26 PM (17 years ago)
Author:
bknecht
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • ~archive/LightManager

    v1 v1  
     1= Lightmanager =
     2A class that handles Lights.
     3
     4A Light is a source that emits light rays (photons)
     5
     6== Usage ==
     7First you have to get the Light Manager up and running by using LightManager::getInstance. This automatically initiates the GL_LIGHTING, and sets some default stuff about the light.
     8Then you will create a new light using:
     9  * int addLight(void);
     10  * int addLight(int lightNumber);
     11
     12now you can operate on the light as follows:
     13  * void setPosition(Vector position);
     14  * void setPosition(GLfloat x, GLfloat y, GLfloat z);
     15  * void setDiffuseColor(GLfloat r, GLfloat g, GLfloat b);
     16  * void setSpecularColor(GLfloat r, GLfloat g, GLfloat b);
     17  * void setAttenuation(float constantAttenuation, float linearAttenuation, float quadraticAttenuation);
     18  * void setSpotDirection(Vector direction);
     19  * void setSpotCutoff(GLfloat cutoff);
     20
     21These functions are preatty selv-explaining, but you can read about them below.
     22If you want to fetch info, or the a Light use:
     23  * Vector getPosition(void) const;
     24  * Vector getPosition(int lightNumber) const;
     25  * Light* getLight(int lightNumber) const;
     26
     27To redraw the light use
     28  * void draw();
     29
     30and to delete one just use
     31  * void deleteLight(void);
     32
     33for some nice output just use:
     34  * void debug(void) const;
     35
     36You can also operate on the single Lights themselves, by first retreaving them with
     37  * Light* getLight(int lightNumber);
     38      and then using the same functions to change settings.