Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4738 in orxonox.OLD


Ignore:
Timestamp:
Jun 30, 2005, 1:29:59 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: cleanup, renice, and other stuff (doxygen-tags, loadparam)

Location:
orxonox/trunk/src/lib/graphics
Files:
2 edited

Legend:

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

    r4737 r4738  
    3131CREATE_FACTORY(Light);
    3232
    33 //! Definition of the Lights
     33//! Definition of the Lights and their Names
    3434int lightsV[] =
    3535{
     
    4646/**
    4747 * \param root The XML-element to load the Light from
     48
     49  \todo what to do, if no Light-Slots are open anymore ???
    4850 */
    4951 Light::Light(const TiXmlElement* root)
    5052{
     53  PRINTF(4)("initializing Light number %d.\n", this->lightNumber);
     54
    5155  this->lightNumber = LightManager::getInstance()->registerLight(this);
    5256
     
    5660  this->setName(tmpName);
    5761
    58   PRINTF(4)("initializing Light number %d.\n", this->lightNumber);
    5962  // enable The light
    6063  glEnable(lightsV[this->lightNumber]); // postSpawn
     
    6568
    6669  this->loadParams(root);
    67 
    6870}
    6971
     
    9092  LoadParam<Light>(root, "specular-color", this, &Light::setSpecularColor)
    9193      .describe("sets the specular color of the Light (red [0-1], green [0-1], blue [0-1])");
     94
     95  LoadParam<Light>(root, "attenuation", this, &Light::setAttenuation)
     96      .describe("sets the Attenuation of the LightSource (constant Factor, linear Factor, quadratic Factor).");
    9297
    9398  LoadParam<Light>(root, "spot-direction", this, &Light::setSpotDirection)
     
    176181   \brief draws this Light. Being a World-entity the possibility to do this lies at hand.
    177182*/
    178 void Light::draw() const
     183void Light::draw(void) const
    179184{
    180185  float pos[4] = {this->getAbsCoor().x, this->getAbsCoor().y, this->getAbsCoor().z, 1.0};
     
    290295}
    291296
     297/**
     298  \param light the Light to register to the LightManager
     299
     300  This is done explicitely by the constructor of a Light
     301*/
    292302int LightManager::registerLight(Light* light)
    293303{
     
    302312}
    303313
     314/**
     315  \param light The light to unregister from the LightManager
     316
     317  This is done every time a Light is destroyed explicitely by the Light-destructor
     318 */
    304319void LightManager::unregisterLight(Light* light)
    305320{
     
    347362        this->lights[i]->debug();
    348363      }
    349   PRINT(0)("--------------------------------\n");
    350 }
     364  PRINT(0)("-----------------------------LM-\n");
     365}
  • orxonox/trunk/src/lib/graphics/light.h

    r4737 r4738  
    6969   \li new Light();
    7070
     71   if you want to operate on this Light just apply the following functions onto it.
     72       (You can also optain the Light-pointer with LightManager::getInstance()->getLight(lightNumber))
     73
    7174   now you can operate on the light as follows:
    7275   \li void setDiffuseColor(GLfloat r, GLfloat g, GLfloat b);
     
    7881
    7982   To redraw the light use
    80    \li void draw() const;
    81 
    82    and to delete one just use
    83    \li void deleteLight(void);
     83   \li void draw() const; (this is automatically done by the LightManager)
    8484
    8585   for some nice output just use:
    86    \li void debug(void) const;
    87 
    88    You can also operate on the single Lights themselves, by first retreaving them with
    89    \li Light* getLight(int LightNumber) const;
    90    \n
    91    and then using the same functions on this to change settings.
     86   \li void debug(void) const; (either on LightManager for a resume or on any Light for single information.)
    9287*/
    9388class LightManager : public BaseObject
Note: See TracChangeset for help on using the changeset viewer.