- Timestamp:
- Dec 7, 2008, 4:18:11 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy2/src/orxonox/objects/worldentities/Camera.cc
r2171 r2350 37 37 #include <OgreSceneNode.h> 38 38 #include <OgreViewport.h> 39 #include <OgreCompositorManager.h> 40 #include <OgreResource.h> 39 41 40 42 #include "util/Exception.h" … … 42 44 #include "core/ConfigValueIncludes.h" 43 45 #include "objects/Scene.h" 46 #include "tools/Shader.h" 44 47 #include "CameraManager.h" 45 48 … … 75 78 { 76 79 this->releaseFocus(); 80 this->getScene()->getSceneManager()->destroyCamera(this->camera_); 77 81 } 78 82 } … … 122 126 void Camera::setFocus(Ogre::Viewport* viewport) 123 127 { 128 // This workaround is needed to avoid weird behaviour with active compositors while 129 // switching the camera (like freezing the image) 130 // 131 // Last known Ogre version needing this workaround: 132 // 1.4.8 133 134 // deactivate all compositors 135 { 136 Ogre::ResourceManager::ResourceMapIterator iterator = Ogre::CompositorManager::getSingleton().getResourceIterator(); 137 while (iterator.hasMoreElements()) 138 Ogre::CompositorManager::getSingleton().setCompositorEnabled(viewport, iterator.getNext()->getName(), false); 139 } 140 124 141 this->bHasFocus_ = true; 125 142 viewport->setCamera(this->camera_); 143 144 // reactivate all visible compositors 145 { 146 for (ObjectList<Shader>::iterator it = ObjectList<Shader>::begin(); it != ObjectList<Shader>::end(); ++it) 147 it->updateVisibility(); 148 } 126 149 } 127 150 }
Note: See TracChangeset
for help on using the changeset viewer.