Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8019 in orxonox.OLD for branches/water/src/story_entities


Ignore:
Timestamp:
May 31, 2006, 12:28:27 PM (19 years ago)
Author:
stefalie
Message:

branches/water: refraction render pass

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/water/src/story_entities/game_world.cc

    r7814 r8019  
    513513 */
    514514void GameWorld::renderPassRefraction()
    515 {}
     515{
     516    // clear buffer
     517  glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
     518  glLoadIdentity();
     519
     520  const std::list<BaseObject*>* reflectedWaters;
     521  MappedWater* mw;
     522
     523  if( (reflectedWaters = ClassList::getList(CL_MAPPED_WATER)) != NULL)
     524  {
     525    std::list<BaseObject*>::const_iterator it;
     526    for (it = reflectedWaters->begin(); it != reflectedWaters->end(); it++)
     527    {
     528      mw =  dynamic_cast<MappedWater*>(*it);
     529
     530      // prepare for reflection rendering
     531      mw->activateRefraction();
     532
     533      //camera and light
     534      this->dataTank->localCamera->apply ();
     535      this->dataTank->localCamera->project ();
     536      LightManager::getInstance()->draw();
     537      // draw everything to be included in the reflection
     538      this->drawEntityList(State::getObjectManager()->getReflectionList());
     539//       for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
     540//         this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]));
     541
     542      // clean up from reflection rendering
     543      mw->deactivateRefraction();
     544    }
     545  }
     546}
    516547
    517548
Note: See TracChangeset for help on using the changeset viewer.