Changeset 3438
- Timestamp:
- 02/21/10 14:47:32 (5 months ago)
- Location:
- plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZOgre/src
- Files:
-
- 7 modified
-
Camera.cpp (modified) (9 diffs)
-
RenderingCanvas.cpp (modified) (10 diffs)
-
RenderingCanvas.hpp (modified) (2 diffs)
-
RenderingService.cpp (modified) (2 diffs)
-
RenderingView.cpp (modified) (3 diffs)
-
SceneService.cpp (modified) (1 diff)
-
ZOgreModule.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZOgre/src/Camera.cpp
r3435 r3438 31 31 #include <Zen/Core/Math/Vector3.hpp> 32 32 33 #include <iostream> 34 33 35 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 34 36 namespace Zen { … … 59 61 Camera::setAspectRatio(const Math::Real& _ratio) 60 62 { 63 std::cout << "OGRE: Ogre::Camera::setAspectRatio(_ratio);" << std::endl;; 61 64 m_camera.setAspectRatio(_ratio); 62 65 } … … 67 70 { 68 71 Ogre::Radian fov(_fov); 72 std::cout << "OGRE: Ogre::Camera::setFOVy(fov);" << std::endl;; 69 73 m_camera.setFOVy(fov); 70 74 } … … 74 78 Camera::setNearClipDistance(const Math::Real _nearDistance) 75 79 { 80 std::cout << "OGRE: Ogre::Camera::setNearClipDistance(_nearDistance);" << std::endl;; 76 81 m_camera.setNearClipDistance(_nearDistance); 77 82 } … … 81 86 Camera::setFarClipDistance(const Math::Real _farDistance) 82 87 { 88 std::cout << "OGRE: Ogre::Camera::setFarClipDistance(_farDistance);" << std::endl;; 83 89 m_camera.setFarClipDistance(_farDistance); 84 90 } … … 97 103 if (m_pSceneNode) 98 104 { 105 std::cout << "OGRE: Ogre::SceneNode::setPosition(_x, _y, _z);" << std::endl;; 99 106 m_pSceneNode->setPosition(_x, _y, _z); 100 107 } 101 108 else 102 109 { 110 std::cout << "OGRE: Ogre::Camera::setPosition(_x, _y, _z);" << std::endl;; 103 111 m_camera.setPosition(_x, _y, _z); 104 112 } … … 127 135 Camera::setDirection(const Math::Real _x, const Math::Real _y, const Math::Real _z) 128 136 { 137 std::cout << "OGRE: Ogre::SceneNode::setDirection(_x, _y, _z);" << std::endl;; 129 138 m_camera.setDirection(_x, _y, _z); 130 139 } … … 156 165 Camera::lookAt(const Math::Real _x, const Math::Real _y, const Math::Real _z) 157 166 { 167 std::cout << "OGRE: Ogre::SceneNode::lookAt(_x, _y, _z);" << std::endl;; 158 168 m_camera.lookAt(_x, _y, _z); 159 169 } … … 246 256 if(m_pSceneNode) 247 257 { 258 std::cout << "OGRE: Ogre::SceneNode::_update(true, false);" << std::endl;; 259 248 260 m_pSceneNode->getParentSceneNode()->_update(true,false); 249 261 } -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZOgre/src/RenderingCanvas.cpp
r3435 r3438 36 36 37 37 #include <OgreRenderSystem.h> 38 #include <OgreWindowEventUtilities.h> 38 39 39 40 #include <stddef.h> … … 53 54 { 54 55 // Get the default scene manager 56 std::cout << "OGRE: Ogre::Root::getSingleton().getSceneManager(\"default\");" << std::endl; 55 57 m_pSceneManager = Ogre::Root::getSingleton().getSceneManager("default"); 56 58 57 59 assert(m_pSceneManager != NULL); 60 61 std::cout << "Using scene type " << m_pSceneManager->getTypeName() << std::endl; 58 62 59 63 // Create the default camera … … 61 65 62 66 std::cout << "adding Viewport" << std::endl; 67 std::cout << "OGRE: Ogre::RenderWindow::addViewPort(&m_pCurrentCamera->getOgreCamera());" << std::endl; 63 68 m_pViewPort = _pView->getRenderWindow().addViewport(&m_pCurrentCamera->getOgreCamera()); 64 69 65 m_pSceneManager->setViewport(m_pViewPort);66 67 // Select the camera, just in case somehow another camera was created.68 std::cout << "selectCamera" << std::endl;69 selectCamera("default");70 //m_pSceneManager->setViewport(m_pViewPort); 71 72 //// Select the camera, just in case somehow another camera was created. 73 //std::cout << "selectCamera" << std::endl; 74 //selectCamera("default"); 70 75 71 76 // HACK Why do we have to do this on Linux? … … 73 78 { 74 79 std::cout << "RenderingCanvas::RenderingCanvas(): Warning! OGRE RenderSystem viewPort was not set. Why not?" << std::endl; 80 std::cout << "OGRE: Ogre::Root::getSingleton().getRenderSystem()->_setViewport(m_pViewPort);" << std::endl; 75 81 Ogre::Root::getSingleton().getRenderSystem()->_setViewport(m_pViewPort); 76 82 assert(m_pViewPort); … … 78 84 } 79 85 86 // HACK This should only be done for windows apps 87 Ogre::RenderSystem* const pRenderSystem = Ogre::Root::getSingleton().getRenderSystem(); 88 pRenderSystem->setWaitForVerticalBlank(false); 89 m_pRenderingView->getRenderWindow().setActive(true); 90 m_pRenderingView->getRenderWindow().setVisible(true); 91 80 92 std::cout << "setting background color" << std::endl; 93 std::cout << "OGRE: Ogre::Viewport::setBackgroundColour(Ogre::ColourValue(0.5f, 0.0f, 0.0f));" << std::endl; 81 94 m_pViewPort->setBackgroundColour(Ogre::ColourValue(0.5f, 0.0f, 0.0f)); 82 95 … … 123 136 { 124 137 std::cout << "RenderingCanvas::resize(): " << _x << " " << _y << " " << _width << " " << _height << std::endl; 138 std::cout << "OGRE: Ogre::RenderWindow::reposition(_x, _y);" << std::endl; 125 139 m_pRenderingView->getRenderWindow().reposition(_x, _y); 140 std::cout << "OGRE: Ogre::RenderWindow::resize(_width, _height);" << std::endl; 126 141 m_pRenderingView->getRenderWindow().resize(_width, _height); 127 142 143 std::cout << "OGRE: Ogre::RenderWindow::windowMovedOrResized();" << std::endl; 128 144 m_pRenderingView->getRenderWindow().windowMovedOrResized(); 129 145 … … 228 244 { 229 245 // Camera wasn't found, so create it 246 std::cout << "OGRE: Ogre::SceneManager::createCamera(_name);" << std::endl; 230 247 Ogre::Camera* pOgreCamera = m_pSceneManager->createCamera(_name); 231 248 assert(pOgreCamera); … … 236 253 237 254 // Default the aspect ratio 238 pCamera->setAspectRatio((Ogre::Real)getWidth() / (Ogre::Real)getHeight()); 239 240 std::cout << "Creating camera " << getWidth() << " x " << getHeight() << std::endl; 255 //pCamera->setAspectRatio((Ogre::Real)getWidth() / (Ogre::Real)getHeight()); 241 256 242 257 // If the current camera hasn't been set, set it … … 300 315 std::cout << "found it, getting the ogre camera" << std::endl; 301 316 // Set the current camera for this viewport 317 std::cout << "OGRE: Ogre::Viewport::setCamera(&iter->second->getOgreCamera());" << std::endl; 302 318 m_pViewPort->setCamera(&iter->second->getOgreCamera()); 303 319 … … 439 455 440 456 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 457 void 458 RenderingCanvas::pumpSystemMessages() 459 { 460 Ogre::WindowEventUtilities::messagePump(); 461 } 462 463 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 441 464 } // namespace ZOgre 442 465 } // namespace Zen -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZOgre/src/RenderingCanvas.hpp
r2430 r3438 74 74 75 75 virtual void querySceneNodes(Math::Real _x, Math::Real _y, I_SceneNodeVisitor& _visitor); 76 77 virtual void pumpSystemMessages(); 76 78 /// @} 77 79 … … 122 124 // TODO This should be abstracted into an I_InputService 123 125 OIS::Keyboard* m_pKeyboard; 124 #endif // deprecated 126 #endif // deprecated 125 127 126 128 std::map< std::string, bool > m_compositors; -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZOgre/src/RenderingService.cpp
r3409 r3438 47 47 48 48 // TODO Where should this go? 49 49 std::cout << "OGRE: m_root.restoreConfig()" << std::endl; 50 50 if (m_root.restoreConfig()) 51 51 { … … 53 53 std::cout << "Rendering configuration loaded from file 'ogre.cfg'. Delete it to show dialog at startup." << std::endl; 54 54 m_root.initialise(false); 55 Ogre::ResourceGroupManager::getSingleton().addResourceLocation("./materials/textures", "FileSystem", "General", false); 55 56 return; 56 57 } 57 58 58 59 // there was no valid ogre.cfg file to read from, so let's show the dialog 60 std::cout << "OGRE: m_root.showConfigDialog()" << std::endl; 59 61 if (m_root.showConfigDialog()) 60 62 { 61 63 std::cout << "Rendering configuration loaded from on-screen dialog." << std::endl; 62 64 m_root.initialise(false); 65 Ogre::ResourceGroupManager::getSingleton().addResourceLocation("./materials/textures", "FileSystem", "General", false); 63 66 return; 64 67 } -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZOgre/src/RenderingView.cpp
r3420 r3438 31 31 32 32 #include <iostream> 33 #include <sstream> 33 34 34 35 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ … … 78 79 { 79 80 Ogre::Root::getSingleton().getRenderSystem()->setConfigOption("Full Screen", "No"); 80 Ogre::Root::getSingleton().getRenderSystem()->setConfigOption("Video Mode", "800 x 600"); 81 82 std::stringstream str; 83 str << _width << " x " << _height; 84 Ogre::Root::getSingleton().getRenderSystem()->setConfigOption("Video Mode", str.str()); 81 85 } 82 86 87 std::cout << "OGRE: Ogre::Root::getSingleton().initialise(!useParentWindow, _windowName.c_str());" << std::endl; 83 88 Ogre::Root::getSingleton().initialise(!useParentWindow, _windowName.c_str()); 84 89 85 90 if (useParentWindow) 86 91 { 92 std::cout << "OGRE: m_root.createRenderWindow(_windowName.c_str(), _width, _height, false, &nvpl);" << std::endl; 87 93 m_pRenderWindow = m_root.createRenderWindow(_windowName.c_str(), _width, _height, false, &nvpl); 88 94 } 89 95 else 90 96 { 97 std::cout << "OGRE: m_root.getAutoCreatedWindow();" << std::endl; 91 98 m_pRenderWindow = m_root.getAutoCreatedWindow(); 92 99 } 100 101 // Dunno why this is done. 102 std::cout << "OGRE: Ogre::RenderWindow::removeAllViewports()" << std::endl; 103 m_pRenderWindow->removeAllViewports(); 93 104 94 105 // Set the window value in the _context … … 100 111 { 101 112 // TODO This might be different depending on the OS. 113 std::cout << "OGRE: Ogre::RenderWindow::getCustomAttribute(\"WINDOW\", &pContext->m_pHandle);" << std::endl; 102 114 m_pRenderWindow->getCustomAttribute("WINDOW", &pContext->m_pHandle); 103 115 } -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZOgre/src/SceneService.cpp
r3409 r3438 51 51 assert(!sm_bCreated); 52 52 sm_bCreated = true; 53 std::cout << "OGRE: Ogre::Root::getSingleton().createSceneManager(_sceneType, _name);" << std::endl; 53 54 m_pSceneManager = Ogre::Root::getSingleton().createSceneManager(_sceneType, _name); 54 55 assert(m_pSceneManager != NULL); 56 55 57 } 56 58 -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZOgre/src/ZOgreModule.cpp
r2945 r3438 89 89 90 90 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 91 ZOgreModule& 91 ZOgreModule& 92 92 ZOgreModule::instance() 93 93 { … … 100 100 if (pRoot == NULL) 101 101 { 102 std::cout << "OGRE: new Ogre::Root();" << std::endl; 102 103 #ifdef _DEBUG 103 104 pRoot = new Ogre::Root("plugins-debug.cfg", "ogre.cfg", "Ogre.log"); … … 111 112 112 113 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 113 Zen::Plugins::I_Module::plugin_name_collection_type& 114 Zen::Plugins::I_Module::plugin_name_collection_type& 114 115 ZOgreModule::getPluginNames() 115 116 { … … 121 122 ZOgreModule::getPlugin(const plugin_name_type& _PluginName) 122 123 { 123 // TODO: Return the appropriate plugin; 124 // TODO: Return the appropriate plugin; 124 125 // For now since only one type is supported then return that. 125 126 return m_pPlugin; … … 127 128 128 129 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 129 void 130 void 130 131 ZOgreModule::destroyPlugin(Plugins::I_Module::plugin_ptr_type _pPlugin) 131 132 {
