Ignore:
Timestamp:
08/29/06 18:28:00 (18 years ago)
Author:
szydlowski
Message:

Implemented PVS support in kdtree scene manager - not complete, defunct
modified BoundingBoxConverter? to work with KdTreeSceneManager?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTreeSceneManager.h

    r1285 r1296  
    1313#include <OgreSceneManager.h> 
    1414#include <VisibilityManager.h> 
     15#include <ViewCellsManager.h> 
    1516 
    1617#include "OgreKdTree.h" 
     
    123124        virtual bool getShowBoxes(void) const; 
    124125 
     126        /** Recurses the kdtree, adding any nodes intersecting with the  
     127        box/sphere/volume/ray into the given list. 
     128        It ignores the exclude scene node. 
     129        */ 
     130        void findNodesIn( const AxisAlignedBox &box, std::list < SceneNode * > &list, SceneNode *exclude = 0 ) 
     131        { 
     132                if (mKdTree) 
     133                        mKdTree->findNodesIn(box, list, exclude); 
     134        } 
     135        void findNodesIn( const Sphere &sphere, std::list < SceneNode * > &list, SceneNode *exclude = 0 ) 
     136        { 
     137                if (mKdTree) 
     138                        mKdTree->findNodesIn(sphere, list, exclude); 
     139        } 
     140        void findNodesIn( const PlaneBoundedVolume &volume, std::list < SceneNode * > &list, SceneNode *exclude=0 ) 
     141        { 
     142                if (mKdTree) 
     143                        mKdTree->findNodesIn(volume, list, exclude); 
     144        } 
     145        void findNodesIn( const Ray &ray, std::list < SceneNode * > &list, SceneNode *exclude=0 ) 
     146        { 
     147                if (mKdTree) 
     148                        mKdTree->findNodesIn(ray, list, exclude); 
     149        } 
     150 
     151        /************************************************************************/ 
     152        /* Functions for PVS                                                    */ 
     153        /************************************************************************/ 
     154        /** Loads view cells for this particular scene. 
     155        */ 
     156        bool LoadViewCells(const String &filename); 
     157 
    125158        /************************************************************************/ 
    126159        /* Functions for CHC                                                    */ 
     
    168201        void WriteLog(); 
    169202 
    170         /** Switches between simple & enhanced visibility 
    171         */ 
    172         //void setEnhancedVis(bool enhanced); 
    173  
     203        /************************************************************************/ 
     204        /* Functions for PVS                                                    */ 
     205        /************************************************************************/ 
     206        /** Loads / unloads pvs of the view cell to set the visibility in the scene. 
     207        */ 
     208        void applyViewCellPvs(GtpVisibilityPreprocessor::ViewCell *vc, const bool load); 
     209 
     210        /** updates pvs in current frame. 
     211        */ 
     212        void updatePvs(Camera *cam); 
     213 
     214        /** Sets all objects invisible. 
     215        */ 
     216        void SetObjectsVisible(const bool visible); 
    174217 
    175218        /************************************************************************/ 
     
    225268        // if we currently render the item buffer  
    226269        bool mIsItemBufferPhase; 
     270        // delete or clear the renderqueue after each rame? 
     271        bool mDeleteQueueAfterRendering; 
     272 
    227273 
    228274        // remember visited scene nodes for viz 
    229         //KdRenderableList mVisibleNodes; 
    230275        KdTree::NodeList mVisibleNodes; 
    231  
    232         bool mDeleteQueueAfterRendering; 
    233276 
    234277        /************************************************************************/ 
     
    258301        // the method of building the tree 
    259302        KdTree::BuildMethod mBuildMethod; 
     303 
     304        /************************************************************************/ 
     305        /* PVS specific options and members                                     */ 
     306        /************************************************************************/ 
     307 
     308        // The view cell manager 
     309        GtpVisibilityPreprocessor::ViewCellsManager *mViewCellsManager; 
     310 
     311        /// Used to assign Ogre meshes to view cell entries. 
     312        GtpVisibilityPreprocessor::ObjectContainer mObjects; 
     313 
     314        GtpVisibilityPreprocessor::ViewCell *mElementaryViewCell; 
     315        GtpVisibilityPreprocessor::ViewCell *mCurrentViewCell; 
     316 
     317        /// If view cells are loaded. 
     318        bool mViewCellsLoaded; 
     319 
     320        /// If view cells are used. 
     321        bool mUseViewCells; 
     322 
     323        /// if the view cells are filtered 
     324        bool mUseVisibilityFilter; 
    260325}; 
    261326 
Note: See TracChangeset for help on using the changeset viewer.