Changeset 8312 in orxonox.OLD for trunk/src/story_entities
- Timestamp:
- Jun 11, 2006, 12:49:25 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/story_entities/game_world.cc
r8271 r8312 407 407 if( likely(this->dataTank->gameRule != NULL)) 408 408 this->dataTank->gameRule->tick(this->dtS); 409 409 410 } 410 411 } … … 514 515 mw = dynamic_cast<MappedWater*>(*it); 515 516 516 // prepare for reflection rendering517 mw->activateReflection();518 519 517 //camera and light 520 518 this->dataTank->localCamera->apply (); 521 519 this->dataTank->localCamera->project (); 520 521 LightManager::getInstance()->draw(); 522 523 524 // prepare for reflection rendering 525 mw->activateReflection(); 526 527 // draw everything to be included in the reflection 528 this->drawEntityList(State::getObjectManager()->getReflectionList()); 529 // for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i) 530 // this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i])); 531 532 // clean up from reflection rendering 533 mw->deactivateReflection(); 534 } 535 } 536 537 } 538 539 540 /** 541 * refraction rendering for water surfaces 542 */ 543 void GameWorld::renderPassRefraction() 544 { 545 // clear buffer 546 glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); 547 glLoadIdentity(); 548 549 const std::list<BaseObject*>* reflectedWaters; 550 MappedWater* mw; 551 552 if( (reflectedWaters = ClassList::getList(CL_MAPPED_WATER)) != NULL) 553 { 554 std::list<BaseObject*>::const_iterator it; 555 for (it = reflectedWaters->begin(); it != reflectedWaters->end(); it++) 556 { 557 mw = dynamic_cast<MappedWater*>(*it); 558 559 //camera and light 560 this->dataTank->localCamera->apply (); 561 this->dataTank->localCamera->project (); 562 // prepare for reflection rendering 563 mw->activateRefraction(); 564 565 522 566 LightManager::getInstance()->draw(); 523 567 // draw everything to be included in the reflection … … 527 571 528 572 // clean up from reflection rendering 529 mw->deactivateReflection();530 }531 }532 533 }534 535 536 /**537 * refraction rendering for water surfaces538 */539 void GameWorld::renderPassRefraction()540 {541 542 // clear buffer543 glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);544 glLoadIdentity();545 546 const std::list<BaseObject*>* reflectedWaters;547 MappedWater* mw;548 549 if( (reflectedWaters = ClassList::getList(CL_MAPPED_WATER)) != NULL)550 {551 std::list<BaseObject*>::const_iterator it;552 for (it = reflectedWaters->begin(); it != reflectedWaters->end(); it++)553 {554 mw = dynamic_cast<MappedWater*>(*it);555 556 // prepare for reflection rendering557 mw->activateRefraction();558 559 //camera and light560 this->dataTank->localCamera->apply ();561 this->dataTank->localCamera->project ();562 LightManager::getInstance()->draw();563 // draw everything to be included in the reflection564 this->drawEntityList(State::getObjectManager()->getReflectionList());565 // for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)566 // this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]));567 568 // clean up from reflection rendering569 573 mw->deactivateRefraction(); 570 574 } … … 583 587 584 588 585 //glEnable(GL_DEPTH_TEST);586 //glEnable(GL_LIGHTING);589 glEnable(GL_DEPTH_TEST); 590 glEnable(GL_LIGHTING); 587 591 588 592 // set camera
Note: See TracChangeset
for help on using the changeset viewer.