Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2810 in orxonox.OLD for orxonox/branches/importer/src/material.cc


Ignore:
Timestamp:
Nov 11, 2004, 2:41:03 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/importer: merged the new importer into the source

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/importer/src/material.cc

    r2795 r2810  
    1717Material* Material::addMaterial(char* mtlName)
    1818{
     19  if (verbose >=2)
     20    printf ("adding Material %s\n", mtlName);
    1921  Material* newMat = new Material(mtlName);
    2022  Material* tmpMat = this;
     
    3032void Material::init(void)
    3133{
     34  if (verbose >= 3)
     35    printf ("initializing new Material\n");
    3236  nextMat = NULL;
    3337
     
    4246void Material::setName (char* mtlName)
    4347{
     48  if (verbose >= 3)
     49    printf("setting Material Name to %s", mtlName);
    4450  strcpy(name, mtlName);
    4551  //  printf ("adding new Material: %s, %p\n", this->getName(), this);
     
    5460void Material::setIllum (int illum)
    5561{
     62  if (verbose >= 3)
     63    printf("setting illumModel of Material %s to %i", name, illum);
    5664  illumModel = illum;
    5765  //  printf ("setting illumModel to: %i\n", illumModel);
     
    6472void Material::setDiffuse (float r, float g, float b)
    6573{
     74  if (verbose >= 3)
     75    printf ("setting Diffuse Color of Material %s to r=%f g=%f b=%f\n", name, r, g, b);
    6676  diffuse[0] = r;
    6777  diffuse[1] = g;
     
    6979  diffuse[3] = 1.0;
    7080
    71   //  printf ("setting Diffuse Color to r=%f g=%f b=%f\n", r, g, b);
    7281}
    7382void Material::setDiffuse (char* rgb)
     
    8089void Material::setAmbient (float r, float g, float b)
    8190{
     91  if (verbose >=3)
     92    printf ("setting Ambient Color of Material %s to r=%f g=%f b=%f\n", name, r, g, b);
    8293  ambient[0] = r;
    8394  ambient[1] = g;
    8495  ambient[2] = b;
    8596  ambient[3] = 1.0;
    86   //  printf ("setting Ambient Color to r=%f g=%f b=%f\n", r, g, b);
    8797}
    8898void Material::setAmbient (char* rgb)
     
    95105void Material::setSpecular (float r, float g, float b)
    96106{
     107  if (verbose >= 3)
     108    printf ("setting Specular Color of Material %s to r=%f g=%f b=%f\n", name, r, g, b);
    97109  specular[0] = r;
    98110  specular[1] = g;
    99111  specular[2] = b;
    100112  specular[3] = 1.0;
    101   //printf ("setting Specular Color to r=%f g=%f b=%f\n", r, g, b);
    102 }
     113 }
    103114void Material::setSpecular (char* rgb)
    104115{
     
    111122void Material::setTransparency (float trans)
    112123{
     124  if (verbose >= 3)
     125    printf ("setting Transparency of Material %s to %f\n", name, trans);
    113126  transparency = trans;
    114127}
     
    123136Material* Material::search (char* mtlName)
    124137{
     138  if (verbose >=3)
     139    printf ("Searching for material %s", mtlName);
    125140  Material* searcher = this;
    126141  while (searcher != NULL)
    127142    {
     143      if (verbose >= 3)
     144        printf (".");
    128145      if (!strcmp (searcher->getName(), mtlName))
    129         return searcher;
     146        {
     147          if (verbose >= 3)
     148            printf ("found.\n");
     149          return searcher;
     150        }
    130151      searcher = searcher->nextMat;
    131152    }
Note: See TracChangeset for help on using the changeset viewer.