Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3600 in orxonox.OLD for orxonox/trunk/src


Ignore:
Timestamp:
Mar 18, 2005, 1:02:30 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: nice doxygen-information about the LightManager

Location:
orxonox/trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/light.cc

    r3599 r3600  
    155155   \returns the Position of the Light
    156156*/
    157 Vector Light::getPosition()
     157Vector Light::getPosition() const
    158158{
    159159  return Vector(this->lightPosition[0], this->lightPosition[1], this->lightPosition[2]);
     
    172172   \brief Prints out some nice formated debug information about the Light
    173173*/
    174 void Light::debug(void)
     174void Light::debug(void) const
    175175{
    176176  PRINT(0)(":: %d ::  -- reference %p\n", this->lightNumber, this);
     
    461461   \returns the Position of the Light
    462462*/
    463 Vector LightManager::getPosition(void)
     463Vector LightManager::getPosition(void) const
    464464{
    465465  if (!this->currentLight)
     
    476476   \param lightNumber lightnumber
    477477*/
    478 Vector LightManager::getPosition(int lightNumber)
     478Vector LightManager::getPosition(int lightNumber) const
    479479{
    480480  if (!this->lights[lightNumber])
     
    487487}
    488488
     489/**
     490   \returns a pointer to a Light
     491   \param lightNumber The light to request the pointer from
     492*/
     493Light* LightManager::getLight(int lightNumber) const
     494{
     495  return this->lights[lightNumber];
     496}
    489497
    490498/**
    491499   \brief outputs debug information about the Class and its lights
    492500*/
    493 void LightManager::debug(void)
     501void LightManager::debug(void) const
    494502{
    495503  PRINT(0)("=================================\n");
  • orxonox/trunk/src/light.h

    r3598 r3600  
    3535  void setSpotCutoff(GLfloat cutoff);
    3636
    37   Vector getPosition();
     37  Vector getPosition() const;
    3838  /** \returns the lightNumber*/
    39   int getLightNumber(void) {return this->lightNumber;}
     39  int getLightNumber(void) const {return this->lightNumber;}
    4040 
    4141  virtual void draw();
    4242
    43   void debug(void);
     43  void debug(void) const;
    4444
    4545  // attributes
     
    5959/**
    6060   A Light is a source that emits light rays (photons)
     61
     62   <b>Usage:</b>\n
     63   First you have to get the Light Manager up and running by using LightManager::getInstance.
     64   This automatically initiates the GL_LIGHTING, and sets some default stuff about the light.\n
     65   Then you will create a new light using:
     66   \li int addLight(void);
     67   \li int addLight(int lightNumber);
     68
     69   now you can operate on the light as follows:
     70   \li void setPosition(Vector position);
     71   \li void setPosition(GLfloat x, GLfloat y, GLfloat z);
     72   \li void setDiffuseColor(GLfloat r, GLfloat g, GLfloat b);
     73   \li void setSpecularColor(GLfloat r, GLfloat g, GLfloat b);
     74   \li void setAttenuation(float constantAttenuation, float linearAttenuation, float quadraticAttenuation);
     75   \li void setSpotDirection(Vector direction);
     76   \li void setSpotCutoff(GLfloat cutoff);
     77
     78   These functions are preatty selv-explaining, but you can read about them below.\n
     79   If you want to fetch info, or the a Light use:
     80   \li Vector getPosition(void) const;
     81   \li Vector getPosition(int lightNumber) const;
     82   \li Light* getLight(int LightNumber) const;
     83
     84   To redraw the light use
     85   \li void draw();
     86   
     87   and to delete one just use
     88   \li void deleteLight(void);
     89
     90   for some nice output just use:
     91   \li void debug(void) const;
     92
     93   You can also operate on the single Lights themselves, by first retreaving them with
     94   \li Light* getLight(int LightNumber);
     95   \n
     96   and then using the same functions on this to change settings.
    6197*/
    6298class LightManager : public BaseObject
     
    97133
    98134  // get Attributes
    99   Vector getPosition(void);
    100   Vector getPosition(int lightNumber);
     135  Vector getPosition(void) const;
     136  Vector getPosition(int lightNumber) const;
    101137 
    102   void debug(void);
     138  Light* getLight(int lightNumber) const;
     139 
     140  void debug(void) const;
    103141};
    104142
Note: See TracChangeset for help on using the changeset viewer.