Changeset 8376 in orxonox.OLD for trunk/src/lib/graphics/importer/material.cc
- Timestamp:
- Jun 14, 2006, 12:13:16 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/material.cc
r8370 r8376 132 132 133 133 // setting diffuse color 134 glColor4f (diffuse [0], diffuse[1], diffuse[2], this->transparency);134 glColor4f (diffuse.r(), diffuse.g(), diffuse.b(), diffuse.a()); 135 135 // setting ambient color 136 glMaterialfv(GL_FRONT, GL_AMBIENT, this->ambient);136 glMaterialfv(GL_FRONT, GL_AMBIENT, &this->ambient[0]); 137 137 // setting up Sprecular 138 glMaterialfv(GL_FRONT, GL_SPECULAR, this->specular);138 glMaterialfv(GL_FRONT, GL_SPECULAR, &this->specular[0]); 139 139 // setting up Shininess 140 140 glMaterialf(GL_FRONT, GL_SHININESS, this->shininess); 141 141 142 142 // setting the transparency 143 if (this-> transparency< 1.0 || /* This allows alpha blending of 2D textures with the scene */143 if (this->diffuse.a() < 1.0 || /* This allows alpha blending of 2D textures with the scene */ 144 144 (likely(!this->textures.empty() && this->textures[0].hasAlpha()))) 145 145 { … … 206 206 { 207 207 PRINTF(4)("setting Diffuse Color of Material %s to r=%f g=%f b=%f.\n", this->getName(), r, g, b); 208 this->diffuse[0] = r; 209 this->diffuse[1] = g; 210 this->diffuse[2] = b; 211 this->diffuse[3] = 1.0; 212 208 this->diffuse = Color(r, g, b, this->diffuse.a() ); 213 209 } 214 210 … … 223 219 { 224 220 PRINTF(4)("setting Ambient Color of Material %s to r=%f g=%f b=%f.\n", this->getName(), r, g, b); 225 this->ambient[0] = r; 226 this->ambient[1] = g; 227 this->ambient[2] = b; 228 this->ambient[3] = 1.0; 221 this->ambient = Color(r, g, b, 1.0); 229 222 } 230 223 … … 238 231 { 239 232 PRINTF(4)("setting Specular Color of Material %s to r=%f g=%f b=%f.\n", this->getName(), r, g, b); 240 this->specular[0] = r; 241 this->specular[1] = g; 242 this->specular[2] = b; 243 this->specular[3] = 1.0; 233 this->specular = Color (r, g, b, 1.0); 244 234 } 245 235 … … 260 250 { 261 251 PRINTF(4)("setting Transparency of Material %s to %f.\n", this->getName(), trans); 262 this-> transparency= trans;252 this->diffuse.a() = trans; 263 253 } 264 254 … … 310 300 Texture* tex = dynamic_cast<Texture*>(ResourceManager::getInstance()->load(dMap, IMAGE, RP_GAME, (int)target)); 311 301 if (tex != NULL) 312 this->textures[textureNumber] = *tex;302 this->textures[textureNumber] = *tex; 313 303 else 314 304 this->textures[textureNumber] = Texture(); … … 373 363 * @brief Sets the Materials Ambient Map 374 364 * @todo implement this 375 */365 */ 376 366 void Material::setAmbientMap(const std::string& aMap, GLenum target) 377 367 { … … 383 373 * @brief Sets the Materials Specular Map 384 374 * @param sMap the Name of the Image to Use 385 386 */375 * @todo implement this 376 */ 387 377 void Material::setSpecularMap(const std::string& sMap, GLenum target) 388 378 { … … 395 385 * @param bump the Name of the Image to Use 396 386 * @todo implemet this 397 */387 */ 398 388 void Material::setBump(const std::string& bump) 399 389 {
Note: See TracChangeset
for help on using the changeset viewer.