Changeset 130 for trunk/VUT/Ogre/include


Ignore:
Timestamp:
06/14/05 02:50:05 (19 years ago)
Author:
mattausch
Message:

added visibility queries

Location:
trunk/VUT/Ogre/include
Files:
8 edited

Legend:

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

    r112 r130  
    33 
    44#include <OgreOctree.h> 
    5 #include "OgrePlatformHierarchyInterface.h" 
     5#include <OgreOctreeSceneManager.h> 
     6#include "OgreSceneNodeHierarchyInterface.h" 
    67 
    78namespace Ogre { 
     
    910        This class implements the hierarchy interface for the Ogre octree hierarchy. 
    1011*/ 
    11 class OctreeHierarchyInterface : public PlatformHierarchyInterface 
     12class OctreeHierarchyInterface : public SceneNodeHierarchyInterface 
    1213{ 
    1314public: 
    14         OctreeHierarchyInterface(SceneManager *sm, RenderSystem *rsys); 
     15        OctreeHierarchyInterface(OctreeSceneManager *sm, RenderSystem *rsys); 
    1516         
    1617        /** Sets the number of nodes in this octree  
     
    4647                                                         GtpVisibility::CullingType type); 
    4748 
     49        /*bool FindVisibleObjects(GtpVisibility::HierarchyNode *node,    
     50                                                        InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry,  
     51                                                        bool includeChildren = false);*/ 
     52        void GetGeometry(GtpVisibility::HierarchyNode *node, 
     53                                         GtpVisibility::GeometryList *geometryList,  
     54                                         bool includeChildren); 
     55 
    4856protected: 
    4957        /** Returns pointer to the bounding box of the node. 
     
    5765        */ 
    5866        Real GetSquaredViewDepth(const Camera* cam, const AxisAlignedBox* box) const; 
     67        /** number of octree hierarchy nodes */ 
    5968        unsigned int mNumOctreeNodes; 
    6069}; 
  • trunk/VUT/Ogre/include/OgrePlatformHierarchyInterface.h

    r121 r130  
    1010#include "OgreSolidBoundingBox.h" 
    1111#include "HierarchyInterface.h" 
     12#include "VisibilityInfo.h" 
    1213#include "OgrePlatformOcclusionQuery.h" 
    1314 
     
    5152                @remark If null, the actual camera is used for both viewing and culling          
    5253        */ 
    53         void InitFrame(GtpVisibility::HierarchyNode *root, Camera *cam, Camera *cullCam = NULL, bool leaveTransparentsInQueue = false); 
     54        void InitFrame(GtpVisibility::HierarchyNode *root, Camera *cam, Camera *cullCam = NULL,  
     55                bool leaveTransparentsInQueue = false); 
    5456        /** Checks if the node is visible from the current view frustum. 
    5557                @param node the current node 
     
    7880                GtpVisibility::HierarchyNode *node, const bool wasVisible); 
    7981 
     82        /** Issue a occlusion query for this mesh. 
     83                @param node the current mesh 
     84                @returns occlusion query for this node 
     85        */ 
     86        GtpVisibility::OcclusionQuery *IssueOcclusionQuery(GtpVisibility::Mesh *mesh); 
     87 
    8088        /** If true, the interface finds and renders only objects which are marked as shadow casters. 
    8189                @remark This is important for the shadow texture pass 
    8290        */ 
    8391        void SetOnlyShadowCasters(bool onlyShadowCasters); 
    84         /** see set */ 
     92        /** see set  
     93        */ 
    8594        bool GetOnlyShadowCasters(); 
    86         /** see set */ 
     95        /** see set  
     96        */ 
    8797        bool GetUseOptimization(); 
     98        /** see set 
     99        */ 
     100        SceneManager *GetSceneManager(); 
    88101 
    89         /** true if bounding box query is currently active. */ 
     102        /** see set  
     103        */ 
     104        RenderSystem *GetRenderSystem(); 
     105         
     106        /** true if bounding box query is currently active.  
     107        */ 
    90108    bool IsBoundingBoxQuery(); 
    91109 
     110        /** Finds visible objects of hierarchy node using occlusion queries 
     111        @param node the current scene node 
     112        @param objs the visible objects 
     113        @param includeChildren if the children of current scene nodes should also be traversed 
     114        */ 
     115        /*virtual bool FindVisibleObjects(GtpVisibility::HierarchyNode *node,    
     116                                                                        InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry,  
     117                                                                        bool includeChildren = false) = 0;*/ 
    92118protected: 
    93         /** materials for visualizing frustum and query culled nodes */ 
     119        /** Renders geometry  
     120        */ 
     121        void RenderGeometry(GtpVisibility::Mesh *geom); 
     122 
     123        /** Materials for visualizing frustum and query culled nodes. 
     124        */ 
    94125        void CreateNodeVizMaterials(); 
     126 
     127        /** Deletes all occlusion queries. 
     128        */ 
     129        void DeleteQueries(); 
     130         
     131        /** Renders bounding box of specified node. 
     132                @param box the bounding box of the scene node to be rendered  
     133        */ 
     134        void RenderBoundingBox(AxisAlignedBox *box); 
     135 
     136        /** Returns pointer to current renderable bounding box geometry. 
     137        */ 
     138        SolidBoundingBox *GetSolidBoundingBox(); 
    95139 
    96140        /** A pass that prepares an occlusion query. 
     
    98142                vertex and fragment program. 
    99143        */ 
    100         void SetOcclusionPass(); 
     144        //void SetOcclusionPass(); 
    101145 
    102         /** Deletes all occlusion queries. 
    103         */ 
    104         void DeleteQueries(); 
    105         /** Renders bounding box of specified node. 
    106                 @param box the bounding box of the scene node to be rendered  
    107         */ 
    108         void RenderBoundingBox(AxisAlignedBox *box); 
    109  
    110         /** Returns pointer to current renderable bounding box geometry 
    111         */ 
    112         SolidBoundingBox *GetSolidBoundingBox(); 
    113  
    114         /** Returns pointer to current renderable half bounding box geometry 
    115         */ 
     146        /** Returns pointer to current renderable half bounding box geometry.*/ 
    116147        //SolidHalfBoundingBox *GetSolidHalfBoundingBox(); 
    117148 
    118         /** Renderable of an aabb 
     149        /** Renderable of an aabb. 
    119150        */ 
    120151        SolidBoundingBox *mSolidBoundingBox; 
  • trunk/VUT/Ogre/include/OgreSceneContentGenerator.h

    r107 r130  
    3737        void SetScale(Vector3 scale); 
    3838         
    39         /** the number of created objects */ 
     39        /** The number of created objects */ 
    4040        int GetObjectCount(); 
    4141 
    42         /** writes scene nodes to file */ 
     42        /** Writes scene nodes to file */ 
    4343        bool WriteObjects(const std::string &filename); 
    4444 
    45         /** loads scene nodes from file */ 
     45        /** Loads scene nodes from file */ 
    4646        bool LoadObjects(const std::string &filename); 
    47  
     47        /** Generates a scene object with the specified parameters 
     48                @param position the position of the scene object 
     49                @param orientation the orientation of the scene object 
     50                @param objName the mesh name of the scene object 
     51                @returns the created scene object 
     52        */ 
    4853        SceneNode *GenerateSceneObject(const Vector3 &position,  
    4954                const Quaternion &orientation, const String &objName); 
  • trunk/VUT/Ogre/include/OgreSceneNodeHierarchyInterface.h

    r112 r130  
    33 
    44#include "OgrePlatformHierarchyInterface.h" 
     5#include "VisibilityInfo.h" 
     6#include "QueryManager.h" 
     7 
    58 
    69namespace Ogre { 
     
    3841        void VisualizeCulledNode(GtpVisibility::HierarchyNode *node,  
    3942                                                        GtpVisibility::CullingType type); 
     43 
     44        /*bool FindVisibleObjects(GtpVisibility::HierarchyNode *node,    
     45                                                        InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry,  
     46                                                        bool includeChildren = false);*/ 
     47         
     48        void GetGeometry(GtpVisibility::HierarchyNode *node,     
     49                                         GtpVisibility::GeometryList *geometryList,  
     50                                         bool includeChildren); 
    4051}; 
    4152 
  • trunk/VUT/Ogre/include/OgreTerrainContentGenerator.h

    r110 r130  
    3535        */ 
    3636        SceneNode *GenerateSceneObject(const Vector3 &position,  
    37                 const Vector3 &rotation, const String &objName); 
     37                const Vector3 &rotation, const String &objName, const bool clampToTerrain = true); 
    3838         
    3939        /** offset which is added to objects when put into the terrain */ 
  • trunk/VUT/Ogre/include/OgreVisibilityOctreeSceneManager.h

    r122 r130  
    6565        /** Creates material for depth pass, e.g., a pass that only fills the depth buffer */ 
    6666        void InitDepthPass(); 
     67         
     68        /** Prepares visualization of hierarchical culling. */ 
    6769        void ShowVisualization(Camera *cam); 
    6870        OctreeHierarchyInterface *mHierarchyInterface; 
  • trunk/VUT/Ogre/include/OgreVisibilityOptionsManager.h

    r114 r130  
    22#define _VisibilityOptionsManager_H__ 
    33 
     4 
     5#include <OgreString.h> 
     6#include <OgreStringVector.h> 
    47#include "VisibilityManager.h" 
    58#include "HierarchyInterface.h" 
    6 #include <OgreString.h> 
    7 #include <OgreStringVector.h> 
     9 
    810 
    911namespace Ogre { 
     
    3032                "Algorithm", "Threshold";                        
    3133        */ 
    32         bool setOption( const String &, const void * ); 
     34        bool setOption(const String &, const void *); 
    3335        /** Gets the given option for the scene traverser. 
    3436            @remarks 
    3537            See setOption 
    3638        */ 
    37         bool getOption( const String &, void * ); 
     39        bool getOption(const String &, void *); 
    3840        bool getOptionKeys( StringVector &refKeys ); 
    3941         
  • trunk/VUT/Ogre/include/OgreVisibilityTerrainSceneManager.h

    r129 r130  
    99 
    1010#include "OgreOctreeHierarchyInterface.h" 
     11#include "OgrePlatformQueryManager.h" 
    1112#include "VisibilityManager.h" 
    1213 
     
    1718        using occlusion queries for visibility culling. 
    1819*/ 
    19 class VisibilityTerrainSceneManager: public TerrainSceneManager 
     20class __declspec(dllexport) VisibilityTerrainSceneManager: public TerrainSceneManager 
    2021{ 
    2122public: 
     
    7475        Entity* createEntity(const String& entityName, const String& meshName); 
    7576 
     77        /** Returns pointer to visibility manager */ 
     78        GtpVisibility::VisibilityManager *GetVisibilityManager(); 
     79 
    7680protected: 
    7781         
     
    101105 
    102106        int mCurrentEntityId; 
     107 
     108        PlatformQueryManager *mQueryManager; 
    103109}; 
    104110 
Note: See TracChangeset for help on using the changeset viewer.