Changeset 92 for trunk/VUT/Ogre


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
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/Ogre/include/OgrePlatformHierarchyInterface.h

    r86 r92  
    77#include <OgreRenderSystem.h> 
    88 
    9 #include "OgreSolidHalfBoundingBox.h" 
     9//#include "OgreSolidHalfBoundingBox.h" 
     10#include "OgreSolidBoundingBox.h" 
    1011#include "HierarchyInterface.h" 
    1112#include "OgrePlatformOcclusionQuery.h" 
     
    8182        /** Returns pointer to current renderable half bounding box geometry 
    8283        */ 
    83         SolidHalfBoundingBox *GetSolidHalfBoundingBox(); 
     84        //SolidHalfBoundingBox *GetSolidHalfBoundingBox(); 
     85        /** Returns pointer to current renderable bounding box geometry 
     86        */ 
     87        SolidBoundingBox *GetSolidBoundingBox(); 
    8488 
    8589        /** one renderable half of an aabb.  
    8690        */ 
    87         SolidHalfBoundingBox *mSolidHalfBoundingBox; 
     91        SolidBoundingBox *mSolidBoundingBox; 
    8892 
    8993        SceneManager *mSceneManager; 
  • trunk/VUT/Ogre/include/OgreSolidHalfBoundingBox.h

    r86 r92  
    66namespace Ogre { 
    77 
    8 /** Allows the rendering of one half of a solid bounding box. 
     8/** The renderable of one half of a solid bounding box. 
    99    @remarks 
    10         This class builds a wireframe renderable from a given aabb. A pointer to this class can be 
     10        This class builds a solid renderable from a given aabb. A pointer to this class can be 
    1111                added to a render queue to display the bounding box of an object. 
    1212*/ 
  • trunk/VUT/Ogre/include/OgreVisibilityOctreeSceneManager.h

    r87 r92  
    5050        GtpVisibility::VisibilityManager *getVisibilityManager( void ); 
    5151 
     52        //writes out into the Ogre log file 
     53        void WriteLog(); 
     54 
    5255protected: 
    5356         
  • trunk/VUT/Ogre/include/OgreVisibilityTerrainSceneManager.h

    r87 r92  
    5353        GtpVisibility::VisibilityManager *getVisibilityManager(); 
    5454         
     55        //writes out statis into the Ogre log file 
     56        void WriteLog(); 
     57 
    5558protected: 
    56  
     59         
    5760        OctreeHierarchyInterface *mHierarchyInterface; 
    5861        GtpVisibility::VisibilityManager *mVisibilityManager; 
  • trunk/VUT/Ogre/scripts/Plugin_VisibilitySceneManager.vcproj

    r74 r92  
    196196                                </File> 
    197197                                <File 
     198                                        RelativePath="..\include\OgreSolidBoundingBox.h"> 
     199                                </File> 
     200                                <File 
    198201                                        RelativePath="..\include\OgreSolidHalfBoundingBox.h"> 
    199202                                </File> 
     
    216219                                <File 
    217220                                        RelativePath="..\src\OgreSceneNodeHierarchyInterface.cpp"> 
     221                                </File> 
     222                                <File 
     223                                        RelativePath="..\src\OgreSolidBoundingBox.cpp"> 
    218224                                </File> 
    219225                                <File 
  • 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.