Changeset 1466 for code/branches
- Timestamp:
- May 28, 2008, 11:40:06 PM (16 years ago)
- Location:
- code/branches/network/src/orxonox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/orxonox/GraphicsEngine.cc
r1454 r1466 48 48 #include "console/InGameConsole.h" 49 49 50 #include "core/ConsoleCommand.h" 51 #include <OgreSceneManager.h> 52 #include <OgreCompositorManager.h> 53 #include <OgreViewport.h> 54 50 55 namespace orxonox { 51 56 57 SetConsoleCommandShortcut(GraphicsEngine, CompositorBloomOn).setAccessLevel(AccessLevel::User); 58 SetConsoleCommandShortcut(GraphicsEngine, CompositorMotionBlurOn).setAccessLevel(AccessLevel::User); 59 SetConsoleCommandShortcut(GraphicsEngine, CompositorBloomOff).setAccessLevel(AccessLevel::User); 60 SetConsoleCommandShortcut(GraphicsEngine, CompositorMotionBlurOff).setAccessLevel(AccessLevel::User); 52 61 /** 53 62 @brief Returns the singleton instance and creates it the first time. … … 369 378 CommandExecutor::execute("exit", false); 370 379 } 380 381 //HACK!! 382 void GraphicsEngine::CompositorBloomOn() 383 { 384 Ogre::SceneManager* mSceneMgr = GraphicsEngine::getSingleton().getSceneManager(); 385 Ogre::Viewport* mViewport = mSceneMgr->getCurrentViewport(); 386 Ogre::CompositorManager::getSingleton().addCompositor(mViewport, "Bloom"); 387 Ogre::CompositorManager::getSingleton().setCompositorEnabled(mViewport, "Bloom", true); 388 } 389 void GraphicsEngine::CompositorBloomOff() 390 { 391 Ogre::SceneManager* mSceneMgr = GraphicsEngine::getSingleton().getSceneManager(); 392 Ogre::Viewport* mViewport = mSceneMgr->getCurrentViewport(); 393 Ogre::CompositorManager::getSingleton().setCompositorEnabled(mViewport, "Bloom", false); 394 } 395 396 void GraphicsEngine::CompositorMotionBlurOn() 397 { 398 Ogre::SceneManager* mSceneMgr = GraphicsEngine::getSingleton().getSceneManager(); 399 Ogre::Viewport* mViewport = mSceneMgr->getCurrentViewport(); 400 Ogre::CompositorManager::getSingleton().addCompositor(mViewport, "MotionBlur"); 401 Ogre::CompositorManager::getSingleton().setCompositorEnabled(mViewport, "MotionBlur", true); 402 } 403 void GraphicsEngine::CompositorMotionBlurOff() 404 { 405 Ogre::SceneManager* mSceneMgr = GraphicsEngine::getSingleton().getSceneManager(); 406 Ogre::Viewport* mViewport = mSceneMgr->getCurrentViewport(); 407 Ogre::CompositorManager::getSingleton().setCompositorEnabled(mViewport, "MotionBlur", false); 408 } 371 409 } -
code/branches/network/src/orxonox/GraphicsEngine.h
r1414 r1466 83 83 static GraphicsEngine* getSingletonPtr() { return &getSingleton(); } 84 84 85 //HACK!!! 86 void static CompositorBloomOn(); 87 void static CompositorBloomOff(); 88 void static CompositorMotionBlurOn(); 89 void static CompositorMotionBlurOff(); 90 91 85 92 private: 86 93 // don't mess with singletons -
code/branches/network/src/orxonox/Orxonox.cc
r1454 r1466 70 70 // objects and tools 71 71 #include "hud/HUD.h" 72 #include <Ogre.h> 73 74 #include "GraphicsEngine.h" 72 75 73 76 // FIXME: is this really file scope? … … 340 343 Level* startlevel = new Level("levels/sample.oxw"); 341 344 Loader::open(startlevel); 342 345 346 347 Ogre::SceneManager* mSceneMgr = GraphicsEngine::getSingleton().getSceneManager(); 348 mSceneMgr->setAmbientLight(ColourValue(0.4,0.4,0.4)); 349 Ogre::Light* dirlight = mSceneMgr->createLight("Light1"); 350 351 dirlight->setType(Ogre::Light::LT_DIRECTIONAL); 352 dirlight->setDirection(Vector3( 0, 1, 5 )); 353 dirlight->setDiffuseColour(ColourValue(0.6, 0.6, 0.4)); 354 dirlight->setSpecularColour(ColourValue(1.0, 1.0, 1.0)); 355 343 356 return true; 344 357 } … … 380 393 clock_t time = 0; 381 394 395 //Ogre::SceneManager* mSceneMgr = GraphicsEngine::getSingleton().getSceneManager(); 396 //Ogre::Viewport* mViewport = mSceneMgr->getCurrentViewport(); 397 398 //Ogre::CompositorManager::getSingleton().addCompositor(mViewport, "Bloom"); 399 //Ogre::CompositorManager::getSingleton().addCompositor(mViewport, "MotionBlur"); 400 382 401 COUT(3) << "Orxonox: Starting the main loop." << std::endl; 383 402 while (!bAbort_) -
code/branches/network/src/orxonox/objects/Model.cc
r1293 r1466 34 34 #include "GraphicsEngine.h" 35 35 #include "core/XMLPort.h" 36 37 #include <OgreEntity.h> 38 #include <OgreMesh.h> 39 #include <OgreHardwareVertexBuffer.h> 40 #include <OgreMeshManager.h> 41 36 42 37 43 namespace orxonox … … 77 83 this->mesh_.setMesh(meshSrc_); 78 84 this->attachObject(this->mesh_.getEntity()); 85 86 //HACK!! 87 if ((this->meshSrc_ == "assff.mesh") || (this->meshSrc_ == "ast1.mesh") || (this->meshSrc_ == "ast2.mesh") || (this->meshSrc_ == "ast3.mesh") || (this->meshSrc_ == "ast4.mesh") ||(this->meshSrc_ == "ast5.mesh") || (this->meshSrc_ == "ast6.mesh")) 88 { 89 Ogre::MeshPtr pMesh = this->mesh_.getEntity()->getMesh(); 90 //set Mesh to tangentspace 91 unsigned short src, dest; 92 if (!pMesh->suggestTangentVectorBuildParams(Ogre::VES_TANGENT, src, dest)) 93 { 94 pMesh->buildTangentVectors(Ogre::VES_TANGENT, src, dest); 95 } 96 if ((this->meshSrc_ == "assff.mesh")) 97 { 98 (this->mesh_.getEntity())->setMaterialName("Assff/BumpMap"); 99 } 100 else 101 { 102 (this->mesh_.getEntity())->setMaterialName("Asteroid/BumpMap"); 103 } 104 105 106 } 79 107 COUT(4) << "Loader (Model.cc): Created model" << std::endl; 80 108 }
Note: See TracChangeset
for help on using the changeset viewer.