Changeset 92 for trunk/VUT/Ogre/src
- Timestamp:
- 05/11/05 15:29:32 (20 years ago)
- Location:
- trunk/VUT/Ogre/src
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp
r91 r92 1 //#include <OgreMath.h>2 //#include <OgreIteratorWrappers.h>3 1 #include <OgreCamera.h> 4 2 5 #include "OgreSolidHalfBoundingBox.h" 3 //#include "OgreSolidHalfBoundingBox.h" 4 #include "OgreSolidBoundingBox.h" 6 5 #include "OgrePlatformHierarchyInterface.h" 7 6 #include "OgrePlatformOcclusionQuery.h" … … 12 11 //----------------------------------------------------------------------- 13 12 PlatformHierarchyInterface::PlatformHierarchyInterface(SceneManager *sm, RenderSystem *rsys): 14 mSceneManager(sm), mRenderSystem(rsys), mSolid HalfBoundingBox(NULL)13 mSceneManager(sm), mRenderSystem(rsys), mSolidBoundingBox(NULL)/*, mSolidHalfBoundingBox(NULL)*/ 15 14 { 16 15 } … … 20 19 DeleteQueries(); 21 20 22 if(mSolid HalfBoundingBox)23 delete mSolid HalfBoundingBox;21 if(mSolidBoundingBox) 22 delete mSolidBoundingBox; 24 23 } 25 24 //----------------------------------------------------------------------- … … 37 36 38 37 //TODO: this should be the full bounding box 39 Solid HalfBoundingBox *halfbox = GetSolidHalfBoundingBox();38 SolidBoundingBox *solidBox = GetSolidBoundingBox(); 40 39 41 40 mRenderSystem->_setWorldMatrix(Ogre::Matrix4::IDENTITY); 42 mSceneManager->useRenderableViewProjMode(halfbox); 43 mSceneManager->setPass(halfbox->getTechnique()->getPass(0)); 41 mSceneManager->useRenderableViewProjMode(solidBox); 42 mSceneManager->setPass(solidBox->getTechnique()->getPass(0)); 43 44 solidBox->SetupBoundingBoxVertices(*box); 45 46 solidBox->getRenderOperation(ro); 47 ro.srcRenderable = solidBox; 48 mRenderSystem->_render(ro); 44 49 45 50 // Render two halfes of the bounding box (using triangle fans) 46 for(int halfIdx = 0; halfIdx < 2; ++halfIdx)51 /*for(int halfIdx = 0; halfIdx < 2; ++halfIdx) 47 52 { 48 halfbox->SetupBoundingBoxVertices(*box, halfIdx == 1);53 solidBox->SetupBoundingBoxVertices(*box, halfIdx == 1); 49 54 50 halfbox->getRenderOperation(ro);51 ro.srcRenderable = halfbox;55 solidBox->getRenderOperation(ro); 56 ro.srcRenderable = solidBox; 52 57 mRenderSystem->_render(ro); 53 } 58 }*/ 54 59 } 55 60 //----------------------------------------------------------------------- … … 121 126 } 122 127 //----------------------------------------------------------------------- 123 Solid HalfBoundingBox *PlatformHierarchyInterface::GetSolidHalfBoundingBox()128 SolidBoundingBox *PlatformHierarchyInterface::GetSolidBoundingBox() 124 129 { 125 if(!mSolid HalfBoundingBox)126 mSolid HalfBoundingBox = new SolidHalfBoundingBox;130 if(!mSolidBoundingBox) 131 mSolidBoundingBox = new SolidBoundingBox; 127 132 128 return mSolid HalfBoundingBox;133 return mSolidBoundingBox; 129 134 } 130 135 -
trunk/VUT/Ogre/src/OgreVisibilityOctreeSceneManager.cpp
r91 r92 5 5 #include <OgreRenderSystem.h> 6 6 #include <OgreCamera.h> 7 #include <OgreLogManager.h> 7 8 8 9 #include <windows.h> … … 73 74 clearSpecialCaseRenderQueues(); 74 75 SceneManager::_renderVisibleObjects(); 76 77 // write out stats 78 WriteLog(); 75 79 } 76 80 //----------------------------------------------------------------------- … … 141 145 return mVisibilityManager; 142 146 } 147 void VisibilityOctreeSceneManager::WriteLog() 148 { 149 std::stringstream d; 143 150 151 d << "Algorithm type: " << mVisibilityManager->GetCullingManagerType() << ", " 152 << "Hierarchy nodes: " << mNumOctreeNodes << ", " << "Traversed nodes: " << mHierarchyInterface->GetNumTraversedNodes() << ", " 153 << "Rendered nodes: " << mHierarchyInterface->GetNumRenderedNodes() << ", " 154 << "Query culled nodes: " << mVisibilityManager->GetCullingManager()->GetNumQueryCulledNodes() << ", " 155 << "Frustum culled nodes: " << mVisibilityManager->GetCullingManager()->GetNumFrustumCulledNodes() << ", " 156 << "Queries issued: " << mVisibilityManager->GetCullingManager()->GetNumQueriesIssued() << "\n"; 157 158 LogManager::getSingleton().logMessage(d.str()); 159 } 144 160 } // namespace Ogre
Note: See TracChangeset
for help on using the changeset viewer.