Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Mar 1, 2005, 10:04:01 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: light: added debug-method.
There is something strange about adding multiple lights. I have to read about this some more.

File:
1 edited

Legend:

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

    r3441 r3442  
    311311    return Vector(this->currentLight->lightPosition[0], this->currentLight->lightPosition[1], this->currentLight->lightPosition[2]);
    312312}
     313
     314
     315/**
     316   \brief outputs debug information about the Class and its lights
     317*/
     318void Light::debug(void)
     319{
     320  PRINT(0)("=================================\n");
     321  PRINT(0)("= DEBUG INFORMATION CLASS LIGHT =\n");
     322  PRINT(0)("=================================\n");
     323  PRINT(0)("Reference: %p\n", Light::singletonRef);
     324  if (this->currentLight)
     325    PRINT(0)("current Light Nr: %d\n", this->currentLight->lightNumber);
     326  PRINT(0)("Ambient Color: %f:%f:%f\n", this->ambientColor[0], this->ambientColor[0], this->ambientColor[0]);
     327  PRINT(0)("=== Lights ===\n");
     328  for (int i = 0; i < NUMBEROFLIGHTS; i++)
     329    if (this->lights[i])
     330      {
     331        PRINT(0)(":: %d ::  -- reference %p\n", i, lights[i]);
     332        if (i != lights[i]->lightNumber)
     333          PRINTF(1)(" Lights are out of sync, this really should not happen,\n   %d % should be equal.\n", i, lights[i]->lightNumber);
     334        PRINT(0)(" Position:      %f/%f/%f\n", lights[i]->lightPosition[0], lights[i]->lightPosition[1], lights[i]->lightPosition[2]);
     335        PRINT(0)(" DiffuseColor:  %f/%f/%f\n", lights[i]->diffuseColor[0], lights[i]->diffuseColor[1], lights[i]->diffuseColor[2]);
     336        PRINT(0)(" SpecularColor: %f/%f/%f\n", lights[i]->specularColor[0], lights[i]->specularColor[1], lights[i]->specularColor[2]);
     337        PRINT(0)(" Attenuation:   ");
     338        switch (lights[i]->attenuationType)
     339          {
     340          case CONSTANT:
     341            PRINT(0)("constant");
     342          case LINEAR:
     343            PRINT(0)("linear");
     344            break;
     345          case QUADRATIC:
     346            PRINT(0)("quadratic");
     347            break;
     348          }
     349        PRINT(0)(" with Factor %f\n", lights[i]->attenuationFactor);
     350      }
     351  PRINT(0)("--------------------------------\n");
     352}
Note: See TracChangeset for help on using the changeset viewer.