Changeset 8260 in orxonox.OLD for branches/water/src
- Timestamp:
- Jun 8, 2006, 4:03:25 PM (19 years ago)
- Location:
- branches/water/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/water/src/story_entities/game_world.cc
r8249 r8260 135 135 } 136 136 imageSelector->showAll(); 137 imageSelector->setAbsCoor2D(200, 30);137 imageSelector->setAbsCoor2D(200, 200); 138 138 OrxGui::GLGuiHandler::getInstance()->activateCursor(); 139 139 … … 580 580 mw = dynamic_cast<MappedWater*>(*it); 581 581 582 // prepare for reflection rendering583 mw->activateReflection();584 585 582 //camera and light 586 583 this->dataTank->localCamera->apply (); 587 584 this->dataTank->localCamera->project (); 585 586 LightManager::getInstance()->draw(); 587 588 589 // prepare for reflection rendering 590 mw->activateReflection(); 591 592 // draw everything to be included in the reflection 593 this->drawEntityList(State::getObjectManager()->getReflectionList()); 594 // for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i) 595 // this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i])); 596 597 // clean up from reflection rendering 598 mw->deactivateReflection(); 599 } 600 } 601 602 } 603 604 605 /** 606 * refraction rendering for water surfaces 607 */ 608 void GameWorld::renderPassRefraction() 609 { 610 // clear buffer 611 glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); 612 glLoadIdentity(); 613 614 const std::list<BaseObject*>* reflectedWaters; 615 MappedWater* mw; 616 617 if( (reflectedWaters = ClassList::getList(CL_MAPPED_WATER)) != NULL) 618 { 619 std::list<BaseObject*>::const_iterator it; 620 for (it = reflectedWaters->begin(); it != reflectedWaters->end(); it++) 621 { 622 mw = dynamic_cast<MappedWater*>(*it); 623 624 //camera and light 625 this->dataTank->localCamera->apply (); 626 this->dataTank->localCamera->project (); 627 // prepare for reflection rendering 628 mw->activateRefraction(); 629 630 588 631 LightManager::getInstance()->draw(); 589 632 // draw everything to be included in the reflection … … 593 636 594 637 // clean up from reflection rendering 595 mw->deactivateReflection();596 }597 }598 599 }600 601 602 /**603 * refraction rendering for water surfaces604 */605 void GameWorld::renderPassRefraction()606 {607 // clear buffer608 glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);609 glLoadIdentity();610 611 const std::list<BaseObject*>* reflectedWaters;612 MappedWater* mw;613 614 if( (reflectedWaters = ClassList::getList(CL_MAPPED_WATER)) != NULL)615 {616 std::list<BaseObject*>::const_iterator it;617 for (it = reflectedWaters->begin(); it != reflectedWaters->end(); it++)618 {619 mw = dynamic_cast<MappedWater*>(*it);620 621 // prepare for reflection rendering622 mw->activateRefraction();623 624 //camera and light625 this->dataTank->localCamera->apply ();626 this->dataTank->localCamera->project ();627 LightManager::getInstance()->draw();628 // draw everything to be included in the reflection629 this->drawEntityList(State::getObjectManager()->getReflectionList());630 // for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)631 // this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]));632 633 // clean up from reflection rendering634 638 mw->deactivateRefraction(); 635 639 } -
branches/water/src/world_entities/environments/mapped_water.cc
r8249 r8260 242 242 //glEnable(GL_CLIP_PLANE0); 243 243 Vector pos = State::getCameraNode()->getAbsCoor(); 244 //pos.debug(); 245 //PRINTF(0)("waterheight: %f\n", waterHeight); 244 246 if(pos.y > waterHeight) 245 247 { … … 260 262 // but just render it clipped so only the top is drawn. 261 263 double plane[4] = {0.0, 1.0, 0.0, waterHeight}; 262 //glClipPlane(GL_CLIP_PLANE0, plane);264 glClipPlane(GL_CLIP_PLANE0, plane); 263 265 } 264 266 } … … 268 270 { 269 271 //glDisable(GL_CLIP_PLANE0); 270 //glCullFace(GL_BACK);272 glCullFace(GL_BACK); 271 273 272 274 //mat.select(); … … 299 301 //glEnable(GL_CLIP_PLANE0); 300 302 Vector pos = State::getCameraNode()->getAbsCoor(); 303 //pos.debug(); 304 //PRINTF(0)("waterheight: %f\n", waterHeight); 301 305 if(pos.y > waterHeight) 302 306 { … … 306 310 307 311 // Since the world is updside down we need to change the culling to FRONT 308 //glCullFace(GL_FRONT);312 glCullFace(GL_FRONT); 309 313 310 314 // Set our plane equation and turn clipping on … … 360 364 { 361 365 //glDisable(GL_CLIP_PLANE0); 362 //glCullFace(GL_BACK);366 glCullFace(GL_BACK); 363 367 364 368
Note: See TracChangeset
for help on using the changeset viewer.