Changeset 2810 in orxonox.OLD for orxonox/branches/importer/src/material.cc
- Timestamp:
- Nov 11, 2004, 2:41:03 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/importer/src/material.cc
r2795 r2810 17 17 Material* Material::addMaterial(char* mtlName) 18 18 { 19 if (verbose >=2) 20 printf ("adding Material %s\n", mtlName); 19 21 Material* newMat = new Material(mtlName); 20 22 Material* tmpMat = this; … … 30 32 void Material::init(void) 31 33 { 34 if (verbose >= 3) 35 printf ("initializing new Material\n"); 32 36 nextMat = NULL; 33 37 … … 42 46 void Material::setName (char* mtlName) 43 47 { 48 if (verbose >= 3) 49 printf("setting Material Name to %s", mtlName); 44 50 strcpy(name, mtlName); 45 51 // printf ("adding new Material: %s, %p\n", this->getName(), this); … … 54 60 void Material::setIllum (int illum) 55 61 { 62 if (verbose >= 3) 63 printf("setting illumModel of Material %s to %i", name, illum); 56 64 illumModel = illum; 57 65 // printf ("setting illumModel to: %i\n", illumModel); … … 64 72 void Material::setDiffuse (float r, float g, float b) 65 73 { 74 if (verbose >= 3) 75 printf ("setting Diffuse Color of Material %s to r=%f g=%f b=%f\n", name, r, g, b); 66 76 diffuse[0] = r; 67 77 diffuse[1] = g; … … 69 79 diffuse[3] = 1.0; 70 80 71 // printf ("setting Diffuse Color to r=%f g=%f b=%f\n", r, g, b);72 81 } 73 82 void Material::setDiffuse (char* rgb) … … 80 89 void Material::setAmbient (float r, float g, float b) 81 90 { 91 if (verbose >=3) 92 printf ("setting Ambient Color of Material %s to r=%f g=%f b=%f\n", name, r, g, b); 82 93 ambient[0] = r; 83 94 ambient[1] = g; 84 95 ambient[2] = b; 85 96 ambient[3] = 1.0; 86 // printf ("setting Ambient Color to r=%f g=%f b=%f\n", r, g, b);87 97 } 88 98 void Material::setAmbient (char* rgb) … … 95 105 void Material::setSpecular (float r, float g, float b) 96 106 { 107 if (verbose >= 3) 108 printf ("setting Specular Color of Material %s to r=%f g=%f b=%f\n", name, r, g, b); 97 109 specular[0] = r; 98 110 specular[1] = g; 99 111 specular[2] = b; 100 112 specular[3] = 1.0; 101 //printf ("setting Specular Color to r=%f g=%f b=%f\n", r, g, b); 102 } 113 } 103 114 void Material::setSpecular (char* rgb) 104 115 { … … 111 122 void Material::setTransparency (float trans) 112 123 { 124 if (verbose >= 3) 125 printf ("setting Transparency of Material %s to %f\n", name, trans); 113 126 transparency = trans; 114 127 } … … 123 136 Material* Material::search (char* mtlName) 124 137 { 138 if (verbose >=3) 139 printf ("Searching for material %s", mtlName); 125 140 Material* searcher = this; 126 141 while (searcher != NULL) 127 142 { 143 if (verbose >= 3) 144 printf ("."); 128 145 if (!strcmp (searcher->getName(), mtlName)) 129 return searcher; 146 { 147 if (verbose >= 3) 148 printf ("found.\n"); 149 return searcher; 150 } 130 151 searcher = searcher->nextMat; 131 152 }
Note: See TracChangeset
for help on using the changeset viewer.