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?

Location:
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include
Files:
3 edited

Legend:

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

    r933 r1296  
    1212class Entity; 
    1313class OctreeSceneManager; 
     14class KdTreeSceneManager; 
    1415 
    1516/**     Class which converts preprocessor types to OGRE types 
     
    1920public: 
    2021        OgreBoundingBoxConverter(OctreeSceneManager *sm); 
     22        OgreBoundingBoxConverter(KdTreeSceneManager *sm); 
    2123 
    2224        bool IdentifyObjects(const GtpVisibilityPreprocessor::IndexedBoundingBoxContainer &iboxes, 
     
    2830        Entity *FindCorrespondingObject(const AxisAlignedBox &box) const; 
    2931 
    30         OctreeSceneManager *mSceneMgr; 
     32        OctreeSceneManager *mOctSceneMgr; 
     33        KdTreeSceneManager *mKdSceneMgr; 
    3134}; 
    3235 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTree.h

    r1250 r1296  
    561561                //void findVisibleNodes(NodeList& visibleNodes, Camera * cam); 
    562562 
     563                /** Recurses the kdtree, adding any nodes intersecting with the  
     564                box/sphere/volume/ray into the given list. 
     565                It ignores the exclude scene node. 
     566                */ 
     567                void findNodesIn(const AxisAlignedBox &box, std::list<SceneNode *> &list, SceneNode *exclude = 0); 
     568                void findNodesIn(const Sphere &sphere, std::list<SceneNode *> &list, SceneNode *exclude = 0); 
     569                void findNodesIn(const PlaneBoundedVolume &volume, std::list<SceneNode *> &list, SceneNode *exclude = 0); 
     570                void findNodesIn(const Ray &ray, std::list<SceneNode *> &list, SceneNode *exclude = 0); 
     571 
    563572                // self-explanatory ... 
    564573                int getMaxDepth(void) { return mMaxDepth; }; 
    565                 Stats getStats(void) const { return mStats; }; 
     574                const Stats& getStats(void) const { return mStats; }; 
    566575                AxisAlignedBox getBox(void) { if (mKdRoot) return mKdRoot->mAABB; else return AxisAlignedBox(); }; 
    567576                void setBuildMethod(BuildMethod bm) { mBuildMethod = bm; } 
     
    598607                //void recFindVisibleNodes(KdTree::Node * node, NodeList& visibleNodes, Camera * cam); 
    599608 
     609                /** Recurses the kdtree, adding any nodes intersecting with the  
     610                box/sphere/volume/ray into the given list. 
     611                It ignores the exclude scene node. 
     612                */ 
     613                void recFindNodesIn(const AxisAlignedBox &box, std::list<SceneNode *> &list, SceneNode *exclude, Node * node, bool full = false); 
     614                void recFindNodesIn(const Sphere &sphere, std::list<SceneNode *> &list, SceneNode *exclude, Node * node, bool full = false); 
     615                void recFindNodesIn(const PlaneBoundedVolume &volume, std::list<SceneNode *> &list, SceneNode *exclude, Node * node, bool full = false); 
     616                void recFindNodesIn(const Ray &ray, std::list<SceneNode *> &list, SceneNode *exclude, Node * node, bool full = false); 
     617 
    600618                // the root node of the kdtree 
    601619                KdTree::Node * mKdRoot; 
  • 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.