Changeset 92 for trunk/VUT/Ogre/src


Ignore:
Timestamp:
05/11/05 15:29:32 (20 years ago)
Author:
mattausch
Message:

exchanged halfbounding box with full bounding box

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> 
    31#include <OgreCamera.h> 
    42 
    5 #include "OgreSolidHalfBoundingBox.h" 
     3//#include "OgreSolidHalfBoundingBox.h" 
     4#include "OgreSolidBoundingBox.h" 
    65#include "OgrePlatformHierarchyInterface.h" 
    76#include "OgrePlatformOcclusionQuery.h" 
     
    1211//----------------------------------------------------------------------- 
    1312PlatformHierarchyInterface::PlatformHierarchyInterface(SceneManager *sm, RenderSystem *rsys): 
    14 mSceneManager(sm), mRenderSystem(rsys), mSolidHalfBoundingBox(NULL) 
     13mSceneManager(sm), mRenderSystem(rsys), mSolidBoundingBox(NULL)/*, mSolidHalfBoundingBox(NULL)*/ 
    1514{ 
    1615} 
     
    2019        DeleteQueries(); 
    2120 
    22         if(mSolidHalfBoundingBox) 
    23                 delete mSolidHalfBoundingBox; 
     21        if(mSolidBoundingBox) 
     22                delete mSolidBoundingBox; 
    2423} 
    2524//----------------------------------------------------------------------- 
     
    3736 
    3837        //TODO: this should be the full bounding box 
    39         SolidHalfBoundingBox *halfbox = GetSolidHalfBoundingBox(); 
     38        SolidBoundingBox *solidBox = GetSolidBoundingBox(); 
    4039         
    4140        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); 
    4449 
    4550        // 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) 
    4752        { 
    48                 halfbox->SetupBoundingBoxVertices(*box, halfIdx == 1); 
     53                solidBox->SetupBoundingBoxVertices(*box, halfIdx == 1); 
    4954                                 
    50                 halfbox->getRenderOperation(ro); 
    51                 ro.srcRenderable = halfbox; 
     55                solidBox->getRenderOperation(ro); 
     56                ro.srcRenderable = solidBox; 
    5257                mRenderSystem->_render(ro); 
    53         } 
     58        }*/ 
    5459} 
    5560//----------------------------------------------------------------------- 
     
    121126} 
    122127//----------------------------------------------------------------------- 
    123 SolidHalfBoundingBox *PlatformHierarchyInterface::GetSolidHalfBoundingBox() 
     128SolidBoundingBox *PlatformHierarchyInterface::GetSolidBoundingBox() 
    124129{ 
    125         if(!mSolidHalfBoundingBox) 
    126                 mSolidHalfBoundingBox = new SolidHalfBoundingBox; 
     130        if(!mSolidBoundingBox) 
     131                mSolidBoundingBox = new SolidBoundingBox; 
    127132 
    128         return mSolidHalfBoundingBox; 
     133        return mSolidBoundingBox; 
    129134} 
    130135 
  • trunk/VUT/Ogre/src/OgreVisibilityOctreeSceneManager.cpp

    r91 r92  
    55#include <OgreRenderSystem.h> 
    66#include <OgreCamera.h> 
     7#include <OgreLogManager.h> 
    78 
    89#include <windows.h> 
     
    7374        clearSpecialCaseRenderQueues(); 
    7475        SceneManager::_renderVisibleObjects(); 
     76 
     77        // write out stats 
     78        WriteLog(); 
    7579} 
    7680//----------------------------------------------------------------------- 
     
    141145        return mVisibilityManager; 
    142146} 
     147void VisibilityOctreeSceneManager::WriteLog() 
     148{ 
     149        std::stringstream d; 
    143150 
     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} 
    144160}   // namespace Ogre 
Note: See TracChangeset for help on using the changeset viewer.