#ifndef _VisibilityManager_H__ #define _VisibilityManager_H__ #include "CullingManager.h" #include "VisibilityEnvironment.h" /** This namespace includes all classes which are created by the VUT (Vienna University of Technology for the Visibility module of the GTP (GameTools Project) (www.gametools.org), and are not directly derived from an Ogre class. */ namespace GtpVisibility { class QueryManager; class PreprocessingManager; /** This class manages all forms of visibility. It is the main class of our visibility module and manages online occlusion culling, offline culling, and visibility queries. */ class VisibilityManager { public: /** Constructor taking the visibility environment object as parameter @param visEnvironment the visibility environment */ VisibilityManager(VisibilityEnvironment *visEnvironment); ~VisibilityManager(); /** Sets the current online occlusion culling manager, e.g., the stop and wait algorithm or coherent hierarchical culling. @param ocmType the online occlusion culling manager type */ void SetCullingManager(VisibilityEnvironment::CullingManagerType ocmType); /** Returns the current online occlusion culling manager. */ CullingManager *GetCullingManager(); /** Returns the current online occlusion culling manager type. See set */ VisibilityEnvironment::CullingManagerType GetCullingManagerType(); /** Applies the online visibility culling algorithm on a scene. @remark the algorithm depends on the current culling manager. */ void ApplyVisibilityCulling(); /** Sets the threshold for the visibiliy culling algorithm. @param threshold number of visible pixels where an object is still considered invisible. @remark automatically sets the threshold of the current and of new culling managers to this value. */ void SetVisibilityCullingThreshold(unsigned int threshold); /** Indicates for how long a frame is considered to be visible. @param assumedVisibility estimation for how long visibility is assumed to be valid. @remark this option is only valid for the coherent hierarchical culling algorithm */ void SetAssumedVisibilityForChc(unsigned int assumedVisibility); /** Random candidates per subtree for random update manager. @note these options should rather be given by general parameter system using void * and strings. */ void SetRandomUpdateCandidatesForRuc(unsigned int randomCandidatesForRuc); /** See get */ unsigned int GetAssumedVisibilityForChc(); /* See get */ unsigned int GetRandomUpdateCandidatesForRuc(); /** Sets pointer to a query manager. */ void SetQueryManager(QueryManager *queryManager); /** see set */ QueryManager *GetQueryManager(); void SetTestGeometryForVisibleLeaves(bool testGeometryForLeaves); bool GetTestGeometryForVisibleLeaves(); /** Returns the visibility environment. */ VisibilityEnvironment *GetVisibilityEnvironment(); protected: CullingManager *mCullingManager; QueryManager *mQueryManager; PreprocessingManager *mPreprocessingManager; VisibilityEnvironment *mVisibilityEnvironment; VisibilityEnvironment::CullingManagerType mCullingManagerType; unsigned int mVisibilityThreshold; unsigned int mAssumedVisibilityForChc; unsigned int mRandomCandidatesForRuc; bool mTestGeometryForVisibleLeaves; }; } // namespace GtpVisibility #endif // VisibilityManager