Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3602 in orxonox.OLD for orxonox/trunk/src/light.cc


Ignore:
Timestamp:
Mar 18, 2005, 10:07:40 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: A Presentation, that the light-class can be handled as PNode, see the second level (push x) to see the effect

File:
1 edited

Legend:

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

    r3600 r3602  
    3333Light::Light(int lightNumber)
    3434{
     35  this->setClassName("Light");
     36  char tmpName[7];
     37  sprintf(tmpName, "Light%d", lightNumber);
     38  this->setName(tmpName);
     39
    3540  PRINTF(4)("initializing Light number %d.\n", lightNumber);
    3641  // enable The light
     
    165170void Light::draw()
    166171{
    167   float pos[3] = {this->getAbsCoor ().x, this->getAbsCoor().y, this->getAbsCoor().z};
     172  float pos[4] = {this->getAbsCoor().x, this->getAbsCoor().y, this->getAbsCoor().z, 1.0};
     173  PRINTF(4)("Drawing The Lights new Position at %f %f %f\n", pos[0], pos[1], pos[2]);
    168174  glLightfv(lightsV[this->lightNumber], GL_POSITION, pos);
    169175}
     
    331337  glMatrixMode(GL_MODELVIEW);
    332338  glLoadIdentity();
    333   for (int i; i < NUMBEROFLIGHTS; i++)
     339  PRINTF(4)("Drawing the Lights\n");
     340  for (int i = 0; i < NUMBEROFLIGHTS; i++)
    334341    if (this->lights[i])
    335         lights[i]->draw();
     342      lights[i]->draw();
    336343}
    337344
Note: See TracChangeset for help on using the changeset viewer.