Changeset 4597 in orxonox.OLD for orxonox/trunk/src/lib/graphics/light.cc
- Timestamp:
- Jun 11, 2005, 12:55:48 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/light.cc
r4519 r4597 1 1 2 2 3 /* 3 /* 4 4 orxonox - the future of 3D-vertical-scrollers 5 5 … … 36 36 { 37 37 this->setClassID(CL_LIGHT, "Light"); 38 char tmpName[ 7];39 sprintf(tmpName, "Light %d", lightNumber);38 char tmpName[10]; 39 sprintf(tmpName, "Light[%d]", lightNumber); 40 40 this->setName(tmpName); 41 41 … … 43 43 // enable The light 44 44 glEnable(lightsV[lightNumber]); // postSpawn 45 45 46 46 // set values (defaults) 47 47 this->lightNumber = lightNumber; … … 179 179 /** 180 180 \brief draws this Light. Being a World-entity the possibility to do this lies at hand. 181 */ 181 */ 182 182 void Light::draw() 183 183 { … … 195 195 PRINT(0)(":: %d :: -- reference %p\n", this->lightNumber, this); 196 196 PRINT(0)(" GL-state: "); 197 GLboolean param; 197 GLboolean param; 198 198 glGetBooleanv(lightsV[this->lightNumber], ¶m); 199 199 if (param) … … 201 201 else 202 202 PRINT(0)("OFF\n"); 203 203 204 204 PRINT(0)(" Position: %f/%f/%f\n", this->lightPosition[0], this->lightPosition[1], this->lightPosition[2]); 205 205 PRINT(0)(" DiffuseColor: %f/%f/%f\n", this->diffuseColor[0], this->diffuseColor[1], this->diffuseColor[2]); … … 215 215 \brief standard constructor for a Light 216 216 */ 217 LightManager::LightManager () 217 LightManager::LightManager () 218 218 { 219 219 this->setClassID(CL_LIGHT_MANAGER, "LightManager"); … … 229 229 /** 230 230 \brief standard deconstructor 231 231 232 232 first disables Lighting 233 233 … … 235 235 and in the end sets the singleton Reference to zero. 236 236 */ 237 LightManager::~LightManager () 237 LightManager::~LightManager () 238 238 { 239 239 glDisable(GL_LIGHTING); 240 240 241 241 // this will be done either by worldEntity, or by pNode as each light is one of them 242 242 // for (int i = 0; i < NUMBEROFLIGHTS; i++) … … 270 270 for (int i = 0; i < NUMBEROFLIGHTS; i++) 271 271 if (!this->lights[i]) 272 return addLight(i); 272 return addLight(i); 273 273 PRINTF(1)("no more light slots availiable. All %d already taken\n", NUMBEROFLIGHTS); 274 274 return -1; … … 302 302 { 303 303 if (!this->currentLight) 304 { 304 { 305 305 PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n"); 306 306 return; … … 316 316 { 317 317 if (!this->currentLight) 318 { 318 { 319 319 PRINTF(1)("no Light defined yet. So you cannot delete any Light right now.\n"); 320 320 return; … … 392 392 { 393 393 if (!this->currentLight) 394 { 394 { 395 395 PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n"); 396 396 return; … … 409 409 { 410 410 if (!this->currentLight) 411 { 411 { 412 412 PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n"); 413 413 return; … … 426 426 { 427 427 if (!this->currentLight) 428 { 428 { 429 429 PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n"); 430 430 return; … … 443 443 { 444 444 if (!this->currentLight) 445 { 445 { 446 446 PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n"); 447 447 return; … … 458 458 { 459 459 if (!this->currentLight) 460 { 460 { 461 461 PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n"); 462 462 return; … … 473 473 { 474 474 if (!this->currentLight) 475 { 475 { 476 476 PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n"); 477 477 return; … … 488 488 { 489 489 if (!this->currentLight) 490 { 490 { 491 491 PRINTF(2)("no Light defined yet\n"); 492 492 return Vector(.0, .0, .0); … … 498 498 499 499 /** 500 \returns the Position of Light 500 \returns the Position of Light 501 501 \param lightNumber lightnumber 502 502 */ … … 539 539 if (this->lights[i]) 540 540 { 541 541 this->lights[i]->debug(); 542 542 } 543 543 PRINT(0)("--------------------------------\n");
Note: See TracChangeset
for help on using the changeset viewer.