Changeset 71 for trunk


Ignore:
Timestamp:
04/29/05 18:32:50 (20 years ago)
Author:
mattausch
Message:
 
Location:
trunk/VUT
Files:
3 added
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibility/include/PreprocessingManager.h

    r67 r71  
    1111namespace GtpVisibility { 
    1212   
    13   /** 
    14      This class defines an interface to the external visibility preprocessor. 
    15      It allows to export the static part of the scene to a file in the XML format 
    16      understood by the preprocessor. By default all the exported meshes are considered 
    17      as scene occluders, whereas occludees are formed by their bounding boxes, 
    18      and bounding boxes of the scene hierarchy. 
     13/** 
     14        This class defines an interface to the external visibility preprocessor. 
     15    It allows to export the static part of the scene to a file in the XML format 
     16    understood by the preprocessor. By default all the exported meshes are considered 
     17    as scene occluders, whereas occludees are formed by their bounding boxes, 
     18    and bounding boxes of the scene hierarchy. 
    1919 
    20      This class also allows to import the preprocessed data with PVS 
    21      information for the viewcells (note that the viewcells are either generated 
    22      automatically by the preprocessor or loaded from a polyhedral definition stored 
    23      in a file (see documentation for the Preprocessor class). 
    24   */ 
     20    This class also allows to import the preprocessed data with PVS 
     21    information for the viewcells (note that the viewcells are either generated 
     22    automatically by the preprocessor or loaded from a polyhedral definition stored 
     23    in a file (see documentation for the Preprocessor class). 
     24*/ 
    2525   
    26   class PreprocessingManager 
    27   { 
    28   public: 
     26class PreprocessingManager 
     27{ 
     28public: 
    2929     
    30     /** 
    31        Constructor taking a HierarchyInterface as argument. 
    32        The HierarchyInterface makes the PreprocessingManager independent from the actual 
    33        scene representation as long as it supports a required set of methods. 
    34      */ 
    35     PreprocessingManager( HierarchyInterface *hierarchyInterface ); 
     30        /** Constructor taking a HierarchyInterface as argument. 
     31        The HierarchyInterface makes the PreprocessingManager independent from the actual 
     32        scene representation as long as it supports a required set of methods. 
     33    */ 
     34    PreprocessingManager(HierarchyInterface *hierarchyInterface); 
    3635     
    3736 
    3837    /** 
    39        Destructor which deletes all data describing static scene visibility. 
     38        Destructor which deletes all data describing static scene visibility. 
    4039    */ 
    4140    virtual ~PreprocessingManager(); 
    4241 
    43     /** 
    44        Export the scene for visibility preprocessing. Exports the hierarchyInterface including 
    45        its bounding boxes + mesh data. Note that the bounding boxes can be used as occludees 
    46        by the extrenal preprocessor. The viewcell data will either be supplied directly to the 
    47        visibility preprocessing standalone module. 
     42    /** Export the scene for visibility preprocessing. Exports the hierarchyInterface including 
     43        its bounding boxes + mesh data. Note that the bounding boxes can be used as occludees 
     44        by the extrenal preprocessor. The viewcell data will either be supplied directly to the 
     45        visibility preprocessing standalone module. 
    4846 
    49        @param filename name of the file to export. 
    50        @return true if the export was succesful. 
     47        @param filename name of the file to export. 
     48        @return true if the export was succesful. 
    5149    */ 
    52     virtual bool ExportScene(const string filename 
    53                              ) = 0; 
     50    virtual bool ExportScene(const string filename) = 0; 
    5451     
    55     /** 
    56        Load preprocessed visibility information. The loaded data is matched with the current 
    57        scene graph. The topology of the current scene graph has to match with the loaded data. 
    58        There is also geometrical check of the bounding boxes. Once loading is succesful the 
    59        PreprocessingManager establishes links from its internal visibility representation 
    60        to the scene graph: no change of this part of the scene graph is allowed; this would 
    61        violate the static scene assumption! 
     52        /** Load preprocessed visibility information. The loaded data is matched with the current 
     53        scene graph. The topology of the current scene graph has to match with the loaded data. 
     54        There is also geometrical check of the bounding boxes. Once loading is succesful the 
     55        PreprocessingManager establishes links from its internal visibility representation 
     56        to the scene graph: no change of this part of the scene graph is allowed; this would 
     57        violate the static scene assumption! 
    6258 
    63        @param filename name of the file to load. 
    64        @return true if the loading was succesful. 
     59        @param filename name of the file to load. 
     60        @return true if the loading was succesful. 
    6561    */ 
    66     virtual bool LoadPreprocessedData(const string filename 
    67                                       ) = 0; 
     62    virtual bool LoadPreprocessedData(const string filename) = 0; 
    6863     
    6964    /**  
  • trunk/VUT/GtpVisibility/include/QueryManager.h

    r65 r71  
    1919    output of the visibility preprocessor. 
    2020*/ 
    21   class QueryManager 
    22   { 
    23   public: 
     21class QueryManager 
     22{ 
     23public: 
    2424    /** Constructor taking a hierarchy interface as an argument. This allows to operate 
    2525        onm different hierarchy types, while reusing the implementation of the query methods. 
     
    7474 
    7575      @return true if there is any intersection.  
    76   */ 
     76        */ 
    7777    virtual bool 
    7878    ShootRay(const Ray &ray, 
     
    8181             ); 
    8282   
    83   /** Sets the scene traverser. 
     83        /** Sets the scene traverser. 
    8484      @remark the scene traverser depends on the type of hierarchyInterface the scene consists of. 
    85   */ 
    86   void SetSceneTraverser(HierarchyInterface *hierarchyInterface ); 
     85        */ 
     86        void SetSceneTraverser(HierarchyInterface *hierarchyInterface ); 
    8787 
    8888protected: 
  • trunk/VUT/GtpVisibility/include/VisibilityEnvironment.h

    r59 r71  
    2020}; 
    2121} // namespace GtpVisibility 
     22 
     23/** @}*/ // end of group Visibility 
     24 
    2225#endif // VisibilityEnvironment_H 
  • trunk/VUT/GtpVisibility/include/VisibilityInfo.h

    r65 r71  
    99namespace GtpVisibility { 
    1010   
    11   /** Class storing the visibility information of a scene node.  
    12    */ 
    13   class NodeInfo { 
    14   public: 
    15     NodeInfo(HierarchyNode *node, 
    16              const float v): 
    17       mNode(node), mVisibility(v) {} 
     11/** Class storing the visibility information of a scene node.  
     12*/ 
     13class NodeInfo  
     14{ 
     15public: 
     16    NodeInfo(HierarchyNode *node,const float v): mNode(node), mVisibility(v) {} 
    1817 
    19   protected: 
     18protected: 
    2019    /** pointer to the scene node */ 
    2120    HierarchyNode *mNode; 
     
    2423        total number of ratsterized pixels */ 
    2524    float mVisibility; 
    26   }; 
     25}; 
    2726   
     27/** Class storing the visibility information of a mesh. 
     28*/ 
     29class MeshInfo  
     30{ 
     31public: 
     32        MeshInfo(Mesh *mesh, const float v): mMesh(mesh), mVisibility(v) {} 
     33 
     34protected: 
     35    /** Pointer to the mesh. 
     36        */ 
     37    Mesh *mMesh; 
     38    /** Node visibility can either be a number of visible pixels or relative 
     39        number of visible pixels (if the hardware queries will provide the 
     40        total number of ratsterized pixels. 
     41        */ 
     42    float mVisibility; 
     43}; 
    2844   
    29   /** Class storing the visibility information of a mesh.  
    30    */ 
    31   class MeshInfo { 
    32   public: 
    33     MeshInfo(Mesh *mesh, 
    34              const float v): 
    35       mMesh(mesh), mVisibility(v) {} 
    36  
    37   protected: 
    38     /** pointer to the scene node */ 
    39     Mesh *mMesh; 
    40     /** node visibility can either be a number of visible pixels or relative 
    41         number of visible pixels (if the hardware queries will provide the 
    42         total number of ratsterized pixels */ 
    43     float mVisibility; 
    44   }; 
    45    
    46   // this define shall be replaced by template typedef 
     45//TODO: this define shall be replaced by template typedef 
    4746#define InfoContainer std::vector 
    4847}; 
  • trunk/VUT/GtpVisibility/include/VisibilityManager.h

    r65 r71  
    1 #ifndef _Manager_H__ 
    2 #define _Manager_H__ 
     1#ifndef _VisibilityManager_H__ 
     2#define _VisibilityManager_H__ 
    33 
    44#include "CullingManager.h" 
    55#include "VisibilityEnvironment.h" 
    6  
    76 
    87/** This namespace includes all classes which are created by the VUT (Vienna University 
     
    109        and are not directly derived from an Ogre class. 
    1110*/ 
    12  
    1311namespace GtpVisibility { 
    1412 
     
    5250}; 
    5351} // namespace GtpVisibility 
     52 
    5453#endif // VisibilityManager 
  • trunk/VUT/GtpVisibility/include/VisibilityMesh.h

    r65 r71  
    99 
    1010 
    11  
    12 #endif 
     11#endif // VisibilityMesh.h 
  • trunk/VUT/GtpVisibility/scripts/GtpVisibility.vcproj

    r64 r71  
    2020                                Name="VCCLCompilerTool" 
    2121                                Optimization="0" 
    22                                 AdditionalIncludeDirectories="..\include" 
     22                                AdditionalIncludeDirectories=""$(OGRE_PATH)/OgreMain/include";..\include" 
    2323                                PreprocessorDefinitions="WIN32;_DEBUG;_LIB" 
    2424                                MinimalRebuild="TRUE" 
     
    106106                        </File> 
    107107                        <File 
     108                                RelativePath="..\src\DummyPreprocessingManager.cpp"> 
     109                        </File> 
     110                        <File 
     111                                RelativePath="..\src\DummyQueryManager.cpp"> 
     112                        </File> 
     113                        <File 
    108114                                RelativePath="..\src\FrustumCullingManager.cpp"> 
    109115                        </File> 
    110116                        <File 
    111117                                RelativePath="..\src\HierarchyInterface.cpp"> 
     118                        </File> 
     119                        <File 
     120                                RelativePath="..\src\PreprocessingManager.cpp"> 
     121                        </File> 
     122                        <File 
     123                                RelativePath="..\src\QueryManager.cpp"> 
    112124                        </File> 
    113125                        <File 
     
    161173                                RelativePath="..\include\VisibilityManager.h"> 
    162174                        </File> 
     175                        <File 
     176                                RelativePath="..\include\VisibilityMesh.h"> 
     177                        </File> 
    163178                </Filter> 
    164179        </Files> 
  • trunk/VUT/GtpVisibility/src/PreprocessingManager.cpp

    r65 r71  
    33namespace GtpVisibility { 
    44   
    5    
    6   bool 
    7   PreprocessingManager::GetPVS( 
    8                                const Vector3 &center, 
    9                                const float radius, 
    10                                InfoContainer<NodeInfo> *visibleNodes, 
    11                                InfoContainer<MeshInfo> *visibleMeshes ) 
    12   { 
     5PreprocessingManager::PreprocessingManager(HierarchyInterface *hierarchyInterface) 
     6{ 
     7} 
     8 
     9PreprocessingManager::~PreprocessingManager() 
     10{ 
     11} 
     12 
     13bool PreprocessingManager::GetPVS(const Vector3 &center, 
     14                                                                  const float radius, 
     15                                                                  InfoContainer<NodeInfo> *visibleNodes, 
     16                                                                  InfoContainer<MeshInfo> *visibleMeshes) 
     17{ 
    1318    vector<int> viewCellIds; 
    14     if (LocateViewCellIds(center, radius, &viewCellIds)) { 
    15       for (vector<int>::iterator ci = viewCellIds.begin(); 
    16            ci != viewCellIds.end(); 
    17            ci++) { 
    18         AddViewCellPVS(*ci, 
    19                        visibleNodes, 
    20                        visibleMeshes ); 
    21         // remove duplicates of the PVS entries if any? 
    22       } 
    23       return true; 
     19    if (LocateViewCellIds(center, radius, &viewCellIds))  
     20        { 
     21                for (vector<int>::iterator ci = viewCellIds.begin(); ci != viewCellIds.end(); ci++)  
     22                { 
     23                        AddViewCellPVS(*ci, visibleNodes, visibleMeshes ); 
     24                        // remove duplicates of the PVS entries if any? 
     25                } 
     26                return true; 
    2427    } 
    2528    return false; 
  • trunk/VUT/GtpVisibility/src/QueryManager.cpp

    r65 r71  
    33 
    44namespace GtpVisibility { 
     5  
     6QueryManager::QueryManager(HierarchyInterface *hierarchyInterface) 
     7{ 
     8} 
     9  
     10bool QueryManager::ShootRay(const Ray &ray, std::vector<Mesh *> *visibleMeshes, bool isGlobalLine) 
     11{ 
     12    // run OGRE ray shooting query 
     13    return false; 
     14} 
    515   
    6   bool 
    7   QueryManager::ShootRay(const Ray &ray, 
    8                          std::vector<Mesh *> *visibleMeshes, 
    9                          bool isGlobalLine 
    10                          ) 
    11   { 
    12     // run OGRE ray shooting query 
    13      
    14  
    15     return false; 
    16   } 
    17    
    18    
    19 }; 
     16} // namespace GtpVisibility 
  • trunk/VUT/Ogre/include/OgrePlatformHierarchyInterface.h

    r59 r71  
    1111#include "OgrePlatformOcclusionQuery.h" 
    1212 
     13/** This namespace contains the Ogre dependent classes. 
     14*/ 
    1315namespace Ogre { 
    1416 
     
    1618        @remark also provides methods for using occlusion queries on the hierarchy nodes 
    1719*/ 
    18  
    1920class PlatformHierarchyInterface: public GtpVisibility::HierarchyInterface 
    2021{ 
  • trunk/VUT/doc/DummyModules/doxyfile_gtp_dummy

    r70 r71  
    2626INLINE_INHERITED_MEMB  = NO 
    2727FULL_PATH_NAMES        = YES 
    28 STRIP_FROM_PATH        = "/cygdrive/d/gametools/gametools/trunk/VUT/" 
     28STRIP_FROM_PATH        = "d:/gametools/trunk/VUT/" 
    2929STRIP_FROM_INC_PATH    =  
    3030SHORT_NAMES            = NO 
  • trunk/VUT/doc/DummyModules/overview.tex

    r70 r71  
    33 
    44 
    5  The visibility work package aims to develop methods for making use of 
     5 The visibility workpackage aims to develop methods for making use of 
    66restricted visibility in large scenes. The major goal of these methods 
    7 is to avoid wasting of the computational power on currently invisible 
    8 parts of the scene. To address this goal we develop new methods for 
    9 online visibility culling and offline visibility preprocessing. The 
    10 online visibility culling is either used to render only visible part 
    11 of the scene or to provide queries which determine visible part of the 
    12 scene in runtime. Visibility preprocessing provides partitioning of the 
    13 view space into view cells and for each view cell it calculates a 
     7is to avoid wasting computational power on currently invisible parts 
     8of the scene. To address this goal, we develop new methods for online 
     9visibility culling and offline visibility preprocessing. The online 
     10visibility culling is either used to render only visible part of the 
     11scene or to provide queries which determine visible parts of the scene 
     12in runtime. Visibility preprocessing provides partitioning of the view 
     13space into view cells, and for each view cell it calculates a 
    1414potentially visible set. 
    1515 
     
    1717\section{Module Class Hierarchy} 
    1818 
    19  The visibility work package consist of a module which is integrated 
     19 The visibility workpackage consists of a module which is integrated 
    2020into the game engine and an external module which deals with 
    2121preprocessing. One of the goals of the design of the module class 
    2222hierarchy has been easy portability of the developed methods to other 
    2323game engines. The resulting class structure clearly separates the 
    24 actual engine dependent parts from the game engine independent 
     24actual engine-dependent parts from the game engine independent 
    2525algorithmic parts.  We have used name spaces to separate the engine 
    2626dependent parts (name space Ogre) from the engine independent parts 
    27 (name space GtpVisibility). The external visibility preprocessing module 
    28 defines its own name space (GtpVisibilityPreprocessor). 
     27(name space GtpVisibility). The external visibility preprocessing 
     28module defines its own name space (GtpVisibilityPreprocessor). 
    2929 
    3030 An overview of the important classes of the visibility work package and 
     
    4343The diagram shows that the module integrated into the engine consists 
    4444of three main parts (CullingManager, QueryManager, 
    45 PreprocessingManager) which are encapsulated in a helper class 
     45PreprocessingManager), which are encapsulated in a helper class 
    4646(Visibility Manager). The helper class then deals with the 
    47 initialization of the contained parts and allows an easy communication 
     47initialization of the contained parts and allows easy communication 
    4848between them. 
    4949 
    5050\section{Visibility Culling} 
    5151 
    52 Visibility culling seamlessly integrates into the rendering 
    53 loop and eliminates most invisible objects from being send to the 
    54 pipeline. Visibility culling is implemented by instances of the CullingManager 
     52Visibility culling seamlessly integrates into the rendering loop and 
     53eliminates most invisible objects from being sent to the pipeline. 
     54Visibility culling is implemented by instances of the CullingManager 
    5555class. We will provide several implementations which can be easily 
    5656switched at runtime and so the best technique for the particular scene 
     
    7878the PreprocessingManager and used inside the engine. 
    7979 
    80  Apart from the scene definition file the preprocessor will be able 
     80 Apart from the scene definition file, the preprocessor will be able 
    8181to import the view cell definition. In this case it will assume the 
    82 view cells have to be described as meshes satisfying set of 
    83 requirements. Alternatively the module can generate view cells by 
     82view cells have to be described as meshes satisfying a set of 
     83requirements. Alternatively, the module can generate view cells by 
    8484automatic view space partitioning. 
    8585 
    8686 
    8787%{\textbullet}\tab\textbf{Construction module for tree multiresolution models.} 
    88  
  • trunk/VUT/scripts/GtpVisibility.sln

    r63 r71  
    2424EndProject 
    2525Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GtpVisibility", "..\GtpVisibility\scripts\GtpVisibility.vcproj", "{101A7691-74F3-48B4-96A3-CF35578F5900}" 
     26        ProjectSection(ProjectDependencies) = postProject 
     27        EndProjectSection 
     28EndProject 
     29Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Preprocessor", "..\GtpVisibilityPreprocessor\scripts\Preprocessor.vcproj", "{101A7691-74F3-48B4-96A3-CF35578F5900}" 
    2630        ProjectSection(ProjectDependencies) = postProject 
    2731        EndProjectSection 
     
    5357                {101A7691-74F3-48B4-96A3-CF35578F5900}.Release.ActiveCfg = Release|Win32 
    5458                {101A7691-74F3-48B4-96A3-CF35578F5900}.Release.Build.0 = Release|Win32 
     59                {101A7691-74F3-48B4-96A3-CF35578F5900}.Debug.ActiveCfg = Debug|Win32 
     60                {101A7691-74F3-48B4-96A3-CF35578F5900}.Debug.Build.0 = Debug|Win32 
     61                {101A7691-74F3-48B4-96A3-CF35578F5900}.Release.ActiveCfg = Release|Win32 
     62                {101A7691-74F3-48B4-96A3-CF35578F5900}.Release.Build.0 = Release|Win32 
    5563        EndGlobalSection 
    5664        GlobalSection(ExtensibilityGlobals) = postSolution 
Note: See TracChangeset for help on using the changeset viewer.