Changeset 100 for trunk/VUT/Ogre/src
- Timestamp:
- 05/16/05 20:22:32 (20 years ago)
- Location:
- trunk/VUT/Ogre/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp
r94 r100 20 20 DeleteQueries(); 21 21 22 if (mSolidBoundingBox)22 if (mSolidBoundingBox) 23 23 delete mSolidBoundingBox; 24 24 } … … 26 26 void PlatformHierarchyInterface::DeleteQueries() 27 27 { 28 for (int i=0; i < (int)mOcclusionQueries.size(); ++i)28 for (int i=0; i < (int)mOcclusionQueries.size(); ++i) 29 29 delete mOcclusionQueries[i]; 30 30 … … 72 72 GtpVisibility::OcclusionQuery *PlatformHierarchyInterface::GetNextOcclusionQuery() 73 73 { 74 if (mCurrentTestIdx == mOcclusionQueries.size())74 if (mCurrentTestIdx == mOcclusionQueries.size()) 75 75 { 76 76 mOcclusionQueries.push_back(new PlatformOcclusionQuery(mRenderSystem)); … … 87 87 SetCamera(cam); 88 88 89 if (cullCam)89 if (cullCam) 90 90 SetCullCamera(cullCam); 91 91 else … … 143 143 SolidBoundingBox *PlatformHierarchyInterface::GetSolidBoundingBox() 144 144 { 145 if (!mSolidBoundingBox)145 if (!mSolidBoundingBox) 146 146 mSolidBoundingBox = new SolidBoundingBox; 147 147 -
trunk/VUT/Ogre/src/OgreSceneNodeHierarchyInterface.cpp
r94 r100 62 62 SceneNode *sceneNode = static_cast<SceneNode *>(node); 63 63 64 while (sceneNode && !sceneNode->isNodeVisible())64 while (sceneNode && !sceneNode->isNodeVisible()) 65 65 { 66 66 sceneNode->setNodeVisible(true); … … 115 115 AxisAlignedBox *SceneNodeHierarchyInterface::GetBoundingBox(GtpVisibility::HierarchyNode *node) 116 116 { 117 if (node != mPreviousNode)117 if (node != mPreviousNode) 118 118 { 119 119 mPreviousNode = node; 120 121 120 mBox = static_cast<SceneNode *>(node)->_getWorldAABB(); 122 121 } -
trunk/VUT/Ogre/src/OgreSolidBoundingBox.cpp
r97 r100 121 121 m_pMaterial = MaterialManager::getSingleton().getByName("QueryMaterial"); 122 122 123 if (m_pMaterial.isNull())123 if (m_pMaterial.isNull()) 124 124 { 125 125 m_pMaterial = MaterialManager::getSingleton(). -
trunk/VUT/Ogre/src/OgreSolidHalfBoundingBox.cpp
r97 r100 42 42 43 43 // fan 1 44 if (isFirstHalf)44 if (isFirstHalf) 45 45 { 46 46 *pPos++ = min.x; *pPos++ = max.y; *pPos++ = max.z; //011 … … 89 89 m_pMaterial = MaterialManager::getSingleton().getByName("QueryMaterial"); 90 90 91 if (m_pMaterial.isNull())91 if (m_pMaterial.isNull()) 92 92 { 93 93 m_pMaterial = MaterialManager::getSingleton(). -
trunk/VUT/Ogre/src/OgreVisibilityOctreeSceneManager.cpp
r99 r100 12 12 VisibilityOctreeSceneManager::VisibilityOctreeSceneManager( 13 13 GtpVisibility::VisibilityManager *visManager) 14 : mVisibilityManager(visManager), mUseVisibilityCulling(true) 14 : mVisibilityManager(visManager), mUseVisibilityCulling(true), 15 mShowVisualization(false) 15 16 { 16 17 mHierarchyInterface = … … 35 36 mHierarchyInterface->InitFrame(mOctree, mCameraInProgress, 36 37 mCullCamera ? getCamera("CullCamera") : NULL); 37 mVisibilityManager->GetCullingManager()->InitFrame();38 //mVisibilityManager->GetCullingManager()->InitFrame(); 38 39 39 40 // standard scenemanager rendering without hierarchical culling … … 65 66 setSpecialCaseRenderQueueMode(SceneManager::SCRQM_EXCLUDE); 66 67 67 //-- the hierarchical culling algorithm 68 69 /** 70 * the hierarchical culling algorithm 71 **/ 68 72 mVisibilityManager->ApplyVisibilityCulling(); 73 69 74 70 75 #ifdef GTP_VISIBILITY_MODIFIED_OGRE … … 84 89 // we interleave identification and rendering of objects 85 90 // in _renderVisibibleObjects 91 if (!mUseVisibilityCulling) 92 { 93 OctreeSceneManager::_findVisibleObjects(cam, onlyShadowCasters); 94 return; 95 } 96 97 if (mShowVisualization) 98 { 99 100 for ( BoxList::iterator it = mBoxes.begin(); it != mBoxes.end(); ++it ) 101 { 102 getRenderQueue()->addRenderable(*it); 103 } 104 } 105 86 106 getRenderQueue()->clear(); 87 107 mBoxes.clear(); 88 108 mVisible.clear(); 89 90 if(!mUseVisibilityCulling)91 {92 OctreeSceneManager::_findVisibleObjects(cam, onlyShadowCasters);93 }94 109 } 95 110 //----------------------------------------------------------------------- … … 112 127 return true; 113 128 } 114 129 if (key == "ShowVisualization") 130 { 131 mShowVisualization = (*static_cast<const bool *>(val)); 132 return true; 133 } 115 134 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). 116 135 setOption(key, val) || OctreeSceneManager::setOption(key, val); -
trunk/VUT/Ogre/src/OgreVisibilityOptionsManager.cpp
r87 r100 3 3 namespace Ogre { 4 4 //----------------------------------------------------------------------- 5 VisibilityOptionsManager::VisibilityOptionsManager(GtpVisibility::VisibilityManager *visManager, 6 GtpVisibility::HierarchyInterface *hierarchyInterface): 7 mVisibilityManager(visManager), mHierarchyInterface(hierarchyInterface) 5 VisibilityOptionsManager::VisibilityOptionsManager( 6 GtpVisibility::VisibilityManager *visManager, 7 GtpVisibility::HierarchyInterface *hierarchyInterface): 8 mVisibilityManager(visManager), 9 mHierarchyInterface(hierarchyInterface) 8 10 { 9 11 } … … 11 13 bool VisibilityOptionsManager::setOption( const String & key, const void * val ) 12 14 { 13 if ( key == "Algorithm")15 if (key == "Algorithm") 14 16 { 15 17 mVisibilityManager->SetCullingManager(*static_cast<const … … 17 19 return true; 18 20 } 19 if (key == "Threshold")21 if (key == "Threshold") 20 22 { 21 23 mVisibilityManager->SetVisibilityCullingThreshold(*static_cast<const int *>(val)); … … 67 69 } 68 70 //----------------------------------------------------------------------- 69 bool VisibilityOptionsManager::getOptionKeys( StringVector & refKeys)71 bool VisibilityOptionsManager::getOptionKeys(StringVector & refKeys) 70 72 { 71 refKeys.push_back( "NumRenderedNodes");72 refKeys.push_back( "NumTraversedNodes");73 refKeys.push_back( "NumQueryCulledNodes");74 refKeys.push_back( "NumFrustumCulledNodes");73 refKeys.push_back("NumRenderedNodes"); 74 refKeys.push_back("NumTraversedNodes"); 75 refKeys.push_back("NumQueryCulledNodes"); 76 refKeys.push_back("NumFrustumCulledNodes"); 75 77 76 78 return true; -
trunk/VUT/Ogre/src/OgreVisibilitySceneManager.cpp
r99 r100 27 27 // we interleave identification and rendering of objects 28 28 // in _renderVisibibleObjects 29 if (!mUseVisibilityCulling)29 if (!mUseVisibilityCulling) 30 30 { 31 31 SceneManager::_findVisibleObjects(cam, onlyShadowCasters); … … 38 38 mVisibilityManager->GetCullingManager()->InitFrame(); 39 39 40 if (!mUseVisibilityCulling)40 if (!mUseVisibilityCulling) 41 41 { 42 42 SceneManager::_renderVisibleObjects(); -
trunk/VUT/Ogre/src/OgreVisibilitySceneManagerDll.cpp
r94 r100 28 28 //#include <OgreVisibilityDotSceneManager.h> 29 29 #include <OgreHeightmapTerrainPageSource.h> 30 #include <OgreRoot.h> 31 30 32 #include "VisibilityManager.h" 31 33 #include "StopAndWaitCullingManager.h" 32 34 #include "VisibilityEnvironment.h" 33 34 #include <OgreRoot.h>35 35 36 36 GtpVisibility::VisibilityEnvironment *visEnv; -
trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp
r99 r100 7 7 #include <OgreCamera.h> 8 8 #include <OgreLogManager.h> 9 #include <OgreStringConverter.h> 9 10 10 11 #include <windows.h> … … 36 37 mHierarchyInterface->InitFrame(mOctree, mCameraInProgress, 37 38 mCullCamera ? getCamera("CullCamera") : NULL); 38 mVisibilityManager->GetCullingManager()->InitFrame();39 //mVisibilityManager->GetCullingManager()->InitFrame(); 39 40 40 41 // standard scenemanager rendering without hierarchical culling … … 56 57 setSpecialCaseRenderQueueMode(SceneManager::SCRQM_INCLUDE); 57 58 SceneManager::_renderVisibleObjects(); 59 58 60 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 59 61 _deleteRenderedQueueGroups(); … … 65 67 setSpecialCaseRenderQueueMode(SceneManager::SCRQM_EXCLUDE); 66 68 67 //-- the hierarchical culling algorithm 69 70 /** 71 * the hierarchical culling algorithm 72 **/ 68 73 mVisibilityManager->ApplyVisibilityCulling(); 74 69 75 70 76 #ifdef GTP_VISIBILITY_MODIFIED_OGRE … … 83 89 // does nothing if hierarchical culling is used => 84 90 // we interleave identification and rendering of objects 85 // in _renderVisibibleObjects 91 // in _renderVisibibleObjects 92 getRenderQueue()->clear(); 93 94 if (!mUseVisibilityCulling) 95 { 96 OctreeSceneManager::_findVisibleObjects(cam, onlyShadowCasters); 97 return; 98 } 99 100 //-- show visibile scene nodes and octree bounding boxes from last frame 86 101 if (mShowVisualization) 87 102 { 88 for ( BoxList::iterator it = mBoxes.begin(); it != mBoxes.end(); ++it ) 103 // add cull camera for visualization purpose 104 if (mCullCamera) 105 { 106 Camera *c; 107 if ((c = getCamera("CullCamera")) != NULL) 108 { 109 getRenderQueue()->addRenderable(c); 110 } 111 } 112 113 for (NodeList::iterator it = mVisible.begin(); it != mVisible.end(); ++it) 89 114 { 90 115 getRenderQueue()->addRenderable(*it); 91 116 } 92 } 93 94 getRenderQueue()->clear(); 117 for (BoxList::iterator it = mBoxes.begin(); it != mBoxes.end(); ++it) 118 { 119 getRenderQueue()->addRenderable(*it); 120 } 121 } 122 123 mVisible.clear(); 95 124 mBoxes.clear(); 96 mVisible.clear();97 98 if(!mUseVisibilityCulling)99 {100 OctreeSceneManager::_findVisibleObjects(cam, onlyShadowCasters);101 }102 125 } 103 126 //----------------------------------------------------------------------- … … 126 149 return true; 127 150 } 128 151 if (key == "SkyBoxEnabled") 152 { 153 mSkyBoxEnabled = (*static_cast<const bool *>(val)); 154 return true; 155 } 156 if (key == "SkyPlaneEnabled") 157 { 158 mSkyPlaneEnabled = (*static_cast<const bool *>(val)); 159 return true; 160 } 161 if (key == "SkyDomeEnabled") 162 { 163 mSkyDomeEnabled = (*static_cast<const bool *>(val)); 164 return true; 165 } 129 166 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). 130 167 setOption(key, val) || TerrainSceneManager::setOption(key, val); … … 139 176 } 140 177 141 142 178 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). 143 179 getOption(key, val) && TerrainSceneManager::getOption(key, val); … … 169 205 mShowVisualization = showViz; 170 206 } 207 /* 208 //----------------------------------------------------------------------- 209 void SetSkyBoxEnabled(bool enabled) 210 { 211 mSkyBoxEnabled = enabled; 212 } 213 //----------------------------------------------------------------------- 214 void SetSkyPlaneEnabled(bool enabled) 215 { 216 mSkyPlaneEnabled = enabled; 217 } 218 //----------------------------------------------------------------------- 219 void SetSkyDomeEnabled(bool enabled) 220 { 221 mSkyDomeEnabled = enabled; 222 } */ 171 223 //----------------------------------------------------------------------- 172 224 void VisibilityTerrainSceneManager::WriteLog()
Note: See TracChangeset
for help on using the changeset viewer.