Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4738 in orxonox.OLD for orxonox/trunk/src/lib/graphics/light.cc


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)

File:
1 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}
Note: See TracChangeset for help on using the changeset viewer.