Changeset 11795 for code/branches/cegui0.8_ogre1.9/src/orxonox
- Timestamp:
- Feb 21, 2018, 12:03:52 AM (7 years ago)
- Location:
- code/branches/cegui0.8_ogre1.9
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cegui0.8_ogre1.9
- Property svn:mergeinfo changed
/code/branches/cegui0.8 (added) merged: 11110,11118,11121,11124 /code/branches/ogre1.9 (added) merged: 11125-11132,11211,11453-11454
- Property svn:mergeinfo changed
-
code/branches/cegui0.8_ogre1.9/src/orxonox/CMakeLists.txt
r11704 r11795 71 71 LINK_LIBRARIES 72 72 ${OGRE_LIBRARY} 73 ${OGRE_OVERLAY_LIBRARY} 73 74 ${CEGUI} 74 75 ${LUA5.1_LIBRARY} -
code/branches/cegui0.8_ogre1.9/src/orxonox/RenderQueueListener.cc
r11080 r11795 83 83 renderSystem->setStencilBufferParams(Ogre::CMPF_ALWAYS_PASS, 84 84 STENCIL_VALUE_FOR_GLOW, STENCIL_FULL_MASK, 85 #if OGRE_VERSION >= 0x010900 86 STENCIL_FULL_MASK, 87 #endif 85 88 Ogre::SOP_KEEP,Ogre::SOP_KEEP,Ogre::SOP_REPLACE,false); 86 89 } … … 91 94 renderSystem->setStencilBufferParams(Ogre::CMPF_NOT_EQUAL, 92 95 STENCIL_VALUE_FOR_GLOW, STENCIL_FULL_MASK, 96 #if OGRE_VERSION >= 0x010900 97 STENCIL_FULL_MASK, 98 #endif 93 99 Ogre::SOP_KEEP,Ogre::SOP_KEEP,Ogre::SOP_REPLACE,false); 94 100 } -
code/branches/cegui0.8_ogre1.9/src/orxonox/Scene.cc
r11085 r11795 40 40 #include <OgreSceneManagerEnumerator.h> 41 41 #include <OgreSceneNode.h> 42 #if OGRE_VERSION >= 0x010900 43 # include <Overlay/OgreOverlaySystem.h> 44 #endif 42 45 43 46 #include <BulletCollision/BroadphaseCollision/btAxisSweep3.h> … … 90 93 this->renderQueueListener_ = new RenderQueueListener(); 91 94 this->sceneManager_->addRenderQueueListener(this->renderQueueListener_);//add our own renderQueueListener 95 #if OGRE_VERSION >= 0x010900 96 this->sceneManager_->addRenderQueueListener(GraphicsManager::getInstance().getOverlaySystem()); 97 #endif 92 98 93 99 this->radar_ = new Radar(); … … 134 140 if (GameMode::showsGraphics()) 135 141 { 142 #if OGRE_VERSION >= 0x010900 143 this->sceneManager_->removeRenderQueueListener(GraphicsManager::getInstance().getOverlaySystem()); 144 #endif 136 145 this->sceneManager_->removeRenderQueueListener(this->renderQueueListener_); 137 146 delete this->renderQueueListener_; -
code/branches/cegui0.8_ogre1.9/src/orxonox/chat/ChatInputHandler.cc
r11083 r11795 131 131 /* GET WINDOW POINTERS */ 132 132 #if CEGUI_VERSION >= 0x000800 133 input = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "orxonox/ChatBox/input" ); 134 inputonly = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "orxonox/ChatBox-inputonly/input" ); 135 CEGUI::Window *history = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "orxonox/ChatBox/history" ); 133 //input = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "ChatBox/input" ); 134 //const CEGUI::Window* root = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild("MenuRootWindow"); 135 //std::cout << "Count: " << root->getChildCount() << std::endl; 136 //for (int i = 0; i < root->getChildCount(); ++i) { 137 // std::cout << "Child: " << root->getChildAtIdx(i)->getName() << std::endl; 138 //} 139 for (auto iterator = CEGUI::WindowManager::getSingleton().getIterator(); !iterator.isAtEnd(); iterator++) { 140 CEGUI::Window* currentWindow = iterator.getCurrentValue(); 141 if (currentWindow->getName().compare("ChatBox") == 0) { 142 input = currentWindow->getChild("frame")->getChild("input"); 143 CEGUI::Window* history = currentWindow->getChild("frame")->getChild("history"); 144 lb_history = dynamic_cast<CEGUI::Listbox*>(history); 145 } else if (currentWindow->getName().compare("ChatBox-inputonly") == 0) { 146 inputonly = currentWindow->getChild("input"); 147 } 148 } 149 150 //input = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "ChatBox" )->getChild("frame")->getChild("input"); 151 //inputonly = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "orxonox/ChatBox-inputonly/input" ); 152 //CEGUI::Window *history = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "orxonox/ChatBox/history" ); 136 153 #else 137 154 input = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox/input" ); 138 155 inputonly = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox-inputonly/input" ); 139 156 CEGUI::Window *history = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox/history" ); 140 #endif141 157 142 158 /* cast it to a listbox */ 143 159 lb_history = dynamic_cast<CEGUI::Listbox*>(history); 160 #endif 144 161 145 162 /* assert wee */ -
code/branches/cegui0.8_ogre1.9/src/orxonox/controllers/NewHumanController.cc
r11071 r11795 397 397 try 398 398 { 399 wePtr = orxonox_cast<WorldEntity*>(Ogre::any_cast<OrxonoxClass*>(itr->movable->getUserAny())); 399 #if OGRE_VERSION >= 0x010900 400 const Ogre::Any& any = itr->movable->getUserObjectBindings().getUserAny(); 401 #else 402 const Ogre::Any& any = itr->movable->getUserAny(); 403 #endif 404 wePtr = orxonox_cast<WorldEntity*>(Ogre::any_cast<OrxonoxClass*>(any)); 400 405 } 401 406 catch (...) -
code/branches/cegui0.8_ogre1.9/src/orxonox/graphics/AnimatedModel.cc
r9667 r11795 49 49 AnimatedModel::~AnimatedModel() 50 50 { 51 if (this->isInitialized() && this-> mesh_.getEntity())52 this->detachOgreObject(this-> mesh_.getEntity());51 if (this->isInitialized() && this->getMesh().getEntity()) 52 this->detachOgreObject(this->getMesh().getEntity()); 53 53 } 54 54 … … 66 66 if (GameMode::showsGraphics()) 67 67 { 68 if (this-> mesh_.getEntity())69 this->detachOgreObject(this-> mesh_.getEntity());68 if (this->getMesh().getEntity()) 69 this->detachOgreObject(this->getMesh().getEntity()); 70 70 71 this-> mesh_.setMeshSource(this->getScene()->getSceneManager(), this->meshSrc_);71 this->getMesh().setMeshSource(this->getScene()->getSceneManager(), this->getMeshSource()); 72 72 73 if (this-> mesh_.getEntity())73 if (this->getMesh().getEntity()) 74 74 { 75 this->attachOgreObject(this-> mesh_.getEntity());76 this-> mesh_.getEntity()->setCastShadows(this->bCastShadows_);75 this->attachOgreObject(this->getMesh().getEntity()); 76 this->getMesh().getEntity()->setCastShadows(this->getCastShadows()); 77 77 this->setAnimationState(this->bAnimLoop_, this->bAnimEnabled_, this->anims_); 78 this-> mesh_.setVisible(this->isVisible());78 this->getMesh().setVisible(this->isVisible()); 79 79 } 80 80 } … … 89 89 if(state!="") 90 90 { 91 if(this-> mesh_.getEntity()->getAnimationState(state))91 if(this->getMesh().getEntity()->getAnimationState(state)) 92 92 { 93 Ogre::AnimationState* as = this-> mesh_.getEntity()->getAnimationState(state);93 Ogre::AnimationState* as = this->getMesh().getEntity()->getAnimationState(state); 94 94 as->setLoop(loop); 95 95 as->setEnabled(enabled); … … 109 109 void AnimatedModel::tick(float dt) 110 110 { 111 if(this-> mesh_.getEntity()->getAnimationState(anims_))111 if(this->getMesh().getEntity()->getAnimationState(anims_)) 112 112 { 113 113 // Test to change Material at runtime! 114 114 115 // Ogre::MaterialPtr mat = this-> mesh_.getEntity()->getSubEntity(0)->getMaterial();115 // Ogre::MaterialPtr mat = this->getMesh().getEntity()->getSubEntity(0)->getMaterial(); 116 116 // mat->setDiffuse(0.4, 0.3, 0.1, 0.1); 117 117 // mat->setAmbient(0.3, 0.7, 0.8); … … 121 121 // mat->setSceneBlending(sbt); 122 122 123 Ogre::AnimationState* as = this-> mesh_.getEntity()->getAnimationState(anims_);123 Ogre::AnimationState* as = this->getMesh().getEntity()->getAnimationState(anims_); 124 124 as->addTime(dt); 125 125 } -
code/branches/cegui0.8_ogre1.9/src/orxonox/graphics/Camera.cc
r9667 r11795 62 62 63 63 this->camera_ = this->getScene()->getSceneManager()->createCamera(getUniqueNumberString()); 64 static_cast<Ogre::MovableObject*>(this->camera_)->setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(this))); 64 Ogre::MovableObject* movable = static_cast<Ogre::MovableObject*>(this->camera_); 65 #if OGRE_VERSION >= 0x010900 66 movable->getUserObjectBindings().setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(this))); 67 #else 68 movable->setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(this))); 69 #endif 65 70 this->cameraNode_ = this->getScene()->getRootSceneNode()->createChildSceneNode(); 66 71 this->attachNode(this->cameraNode_); -
code/branches/cegui0.8_ogre1.9/src/orxonox/graphics/Model.cc
r11783 r11795 30 30 31 31 #include <OgreEntity.h> 32 #include <OgreProgressiveMesh.h> 32 #if OGRE_VERSION >= 0x010900 33 # include <OgreProgressiveMeshGenerator.h> 34 # include <OgreDistanceLodStrategy.h> 35 #else 36 # include <OgreProgressiveMesh.h> 37 #endif 33 38 34 39 #include "core/CoreIncludes.h" … … 203 208 { 204 209 float volume = this->mesh_.getEntity()->getBoundingBox().volume(); 205 /*206 float scaleFactor = 1;207 208 BaseObject* creatorPtr = this;209 210 while(creatorPtr!=nullptr&&orxonox_cast<WorldEntity*>(creatorPtr))211 {212 scaleFactor *= getBiggestScale(((WorldEntity*) creatorPtr)->getScale3D());213 creatorPtr = creatorPtr->getCreator();214 }215 orxout() << "name: " << this->meshSrc_ << "scaleFactor: " << scaleFactor << ", volume: " << volume << endl;216 */217 210 orxout(verbose, context::lod) << "Setting lodLevel for " << this->meshSrc_<< " with lodLevel_: " << this->lodLevel_ <<" and volume: "<< volume << ":" << endl; 218 211 219 #if OGRE_VERSION >= 0x010800 212 #if OGRE_VERSION >= 0x010900 213 Ogre::LodConfig::LodLevelList distList; 214 #elif OGRE_VERSION >= 0x010800 220 215 Ogre::ProgressiveMesh::LodValueList distList; 221 216 #elif OGRE_VERSION >= 0x010700 … … 227 222 if( lodLevel_>0 ) 228 223 { 229 // float factor = scaleFactor*5/lodLevel_;230 224 float factor = pow(volume, 2.0f / 3.0f) * 15.0f / lodLevel_; 231 225 232 226 orxout(verbose, context::lod) << "LodLevel set with factor: " << factor << endl; 233 227 234 distList.push_back(70.0f*factor);235 distList.push_back(140.0f*factor);236 distList.push_back(170.0f*factor);237 distList.push_back(200.0f*factor);238 distList.push_back(230.0f*factor);239 distList.push_back(250.0f*factor);240 distList.push_back(270.0f*factor);241 distList.push_back(290.0f*factor);242 distList.push_back(310.0f*factor);243 distList.push_back(330.0f*factor);228 addLodDistanceToList(distList, 70.0f*factor); 229 addLodDistanceToList(distList, 140.0f*factor); 230 addLodDistanceToList(distList, 170.0f*factor); 231 addLodDistanceToList(distList, 200.0f*factor); 232 addLodDistanceToList(distList, 230.0f*factor); 233 addLodDistanceToList(distList, 250.0f*factor); 234 addLodDistanceToList(distList, 270.0f*factor); 235 addLodDistanceToList(distList, 290.0f*factor); 236 addLodDistanceToList(distList, 310.0f*factor); 237 addLodDistanceToList(distList, 330.0f*factor); 244 238 while(distList.size()>this->numLodLevels_) 245 239 distList.pop_back(); … … 247 241 248 242 //Generiert LOD-Levels 249 #if OGRE_VERSION >= 0x010800 243 #if OGRE_VERSION >= 0x010900 244 Ogre::LodConfig config; 245 config.mesh = this->mesh_.getEntity()->getMesh(); 246 config.levels = distList; 247 config.strategy = Ogre::DistanceLodSphereStrategy::getSingletonPtr(); 248 249 Ogre::ProgressiveMeshGenerator generator; 250 generator.generateLodLevels(config); 251 #elif OGRE_VERSION >= 0x010800 250 252 Ogre::ProgressiveMesh::generateLodLevels(this->mesh_.getEntity()->getMesh().get(), distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL, 251 253 this->lodReductionRate_); … … 270 272 #endif 271 273 } 274 275 template <class T> 276 void Model::addLodDistanceToList(T& list, float distance) 277 { 278 #if OGRE_VERSION >= 0x010900 279 list.push_back({distance, Ogre::LodLevel::VRM_COLLAPSE_COST, this->lodReductionRate_, 0, false}); 280 #else 281 list.push_back(distance); 282 #endif 283 } 272 284 } -
code/branches/cegui0.8_ogre1.9/src/orxonox/graphics/Model.h
r11783 r11795 89 89 90 90 protected: 91 inline Mesh& getMesh() 92 { return this->mesh_; } 93 94 inline void setLodEnabled(bool bLodEnabled) 95 { this->bLodEnabled_ = bLodEnabled; } 96 97 private: 91 98 /** 92 99 @brief … … 108 115 //LoD 109 116 void enableLod(); 117 118 template <class T> 119 void addLodDistanceToList(T& list, float distance); 110 120 111 121 inline void setLodLevel(float lodLevel) -
code/branches/cegui0.8_ogre1.9/src/orxonox/overlays/InGameConsole.cc
r11071 r11795 32 32 #include <algorithm> 33 33 #include <string> 34 #include <OgreOverlay.h> 35 #include <OgreOverlayElement.h> 36 #include <OgreOverlayManager.h> 37 #include <OgreOverlayContainer.h> 38 #include <OgreBorderPanelOverlayElement.h> 39 #include <OgreTextAreaOverlayElement.h> 40 #include <OgreFontManager.h> 41 #include <OgreFont.h> 34 #include <OgrePrerequisites.h> 35 #if OGRE_VERSION >= 0x010900 36 # include <Overlay/OgreOverlay.h> 37 # include <Overlay/OgreOverlayElement.h> 38 # include <Overlay/OgreOverlayManager.h> 39 # include <Overlay/OgreOverlayContainer.h> 40 # include <Overlay/OgreBorderPanelOverlayElement.h> 41 # include <Overlay/OgreTextAreaOverlayElement.h> 42 # include <Overlay/OgreFontManager.h> 43 # include <Overlay/OgreFont.h> 44 #else 45 # include <OgreOverlay.h> 46 # include <OgreOverlayElement.h> 47 # include <OgreOverlayManager.h> 48 # include <OgreOverlayContainer.h> 49 # include <OgreBorderPanelOverlayElement.h> 50 # include <OgreTextAreaOverlayElement.h> 51 # include <OgreFontManager.h> 52 # include <OgreFont.h> 53 #endif 42 54 43 55 #include "util/Clock.h" -
code/branches/cegui0.8_ogre1.9/src/orxonox/overlays/OrxonoxOverlay.cc
r11099 r11795 35 35 36 36 #include <cmath> 37 #include <OgreOverlay.h> 38 #include <OgreOverlayManager.h> 39 #include <OgrePanelOverlayElement.h> 37 #if OGRE_VERSION >= 0x010900 38 # include <Overlay/OgreOverlay.h> 39 # include <Overlay/OgreOverlayManager.h> 40 # include <Overlay/OgrePanelOverlayElement.h> 41 #else 42 # include <OgreOverlay.h> 43 # include <OgreOverlayManager.h> 44 # include <OgrePanelOverlayElement.h> 45 #endif 40 46 #include <OgreRenderWindow.h> 41 47 #include <OgreMaterialManager.h> -
code/branches/cegui0.8_ogre1.9/src/orxonox/worldentities/WorldEntity.cc
r11083 r11795 548 548 { 549 549 this->node_->attachObject(object); 550 #if OGRE_VERSION >= 0x010900 551 object->getUserObjectBindings().setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(this))); 552 #else 550 553 object->setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(this))); 554 #endif 551 555 } 552 556 … … 563 567 void WorldEntity::detachOgreObject(Ogre::MovableObject* object) 564 568 { 569 #if OGRE_VERSION >= 0x010900 570 object->getUserObjectBindings().setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(nullptr))); 571 #else 565 572 object->setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(nullptr))); 573 #endif 566 574 this->node_->detachObject(object); 567 575 }
Note: See TracChangeset
for help on using the changeset viewer.