[71] | 1 | #ifndef _VisibilityManager_H__
|
---|
| 2 | #define _VisibilityManager_H__
|
---|
[59] | 3 |
|
---|
| 4 | #include "CullingManager.h"
|
---|
| 5 | #include "VisibilityEnvironment.h"
|
---|
| 6 |
|
---|
| 7 | /** This namespace includes all classes which are created by the VUT (Vienna University
|
---|
| 8 | of Technology for the Visibility module of the GTP (GameTools Project) (www.gametools.org),
|
---|
| 9 | and are not directly derived from an Ogre class.
|
---|
| 10 | */
|
---|
| 11 | namespace GtpVisibility {
|
---|
| 12 |
|
---|
[65] | 13 | class QueryManager;
|
---|
| 14 | class PreprocessingManager;
|
---|
| 15 |
|
---|
[59] | 16 | /** This class manages all forms of visibility. It is the main
|
---|
| 17 | class of our visibility module and manages online occlusion culling,
|
---|
| 18 | offline culling, and visibility queries.
|
---|
| 19 | */
|
---|
| 20 | class VisibilityManager
|
---|
| 21 | {
|
---|
| 22 | public:
|
---|
| 23 | /** Constructor taking the visibility environment object as parameter
|
---|
| 24 | @param visEnvironment the visibility environment
|
---|
| 25 | */
|
---|
| 26 | VisibilityManager(VisibilityEnvironment *visEnvironment);
|
---|
| 27 |
|
---|
| 28 | ~VisibilityManager();
|
---|
| 29 | /** Sets the current online occlusion culling manager, e.g.,
|
---|
| 30 | the stop and wait algorithm or coherent hierarchical culling.
|
---|
| 31 | @param ocmType the online occlusion culling manager type
|
---|
| 32 | */
|
---|
| 33 | void SetCullingManager(VisibilityEnvironment::CullingManagerType ocmType);
|
---|
[92] | 34 | /** Returns the current online occlusion culling manager.
|
---|
[59] | 35 | */
|
---|
| 36 | CullingManager *GetCullingManager();
|
---|
[92] | 37 | /** Returns the current online occlusion culling manager type. See set
|
---|
| 38 | */
|
---|
| 39 | VisibilityEnvironment::CullingManagerType GetCullingManagerType();
|
---|
[59] | 40 |
|
---|
| 41 | /** Applies the online visibility culling algorithm on a scene.
|
---|
| 42 | @remark the algorithm depends on the current culling manager.
|
---|
| 43 | */
|
---|
| 44 | void ApplyVisibilityCulling();
|
---|
| 45 |
|
---|
[74] | 46 | /** Sets the threshold for the visibiliy culling algorithm.
|
---|
| 47 | @param visibilityThreshold number of visible pixels where an object
|
---|
| 48 | is still considered invisible.
|
---|
| 49 | @remark automatically sets the threshold of the current and of
|
---|
| 50 | new culling managers to this value.
|
---|
| 51 | */
|
---|
| 52 | void SetVisibilityCullingThreshold(unsigned int threshold);
|
---|
| 53 |
|
---|
[146] | 54 | /** Indicates for how long a frame is considered to be visible.
|
---|
| 55 | @param assumedVisibility estimation for how long visibility is assumed to be valid.
|
---|
[155] | 56 | @remark this option is only valid for the coherent hierarchical culling algorithm
|
---|
[146] | 57 | */
|
---|
[155] | 58 | void SetAssumedVisibilityForChc(unsigned int assumedVisibility);
|
---|
| 59 |
|
---|
[130] | 60 | /** Sets pointer to a query manager.
|
---|
| 61 | */
|
---|
| 62 | void SetQueryManager(QueryManager *queryManager);
|
---|
| 63 | /** see set
|
---|
| 64 | */
|
---|
| 65 | QueryManager *GetQueryManager();
|
---|
[114] | 66 |
|
---|
[59] | 67 | protected:
|
---|
| 68 |
|
---|
[114] | 69 | CullingManager *mCullingManager;
|
---|
| 70 | QueryManager *mQueryManager;
|
---|
| 71 | PreprocessingManager *mPreprocessingManager;
|
---|
| 72 | VisibilityEnvironment *mVisibilityEnvironment;
|
---|
| 73 | VisibilityEnvironment::CullingManagerType mCullingManagerType;
|
---|
[74] | 74 |
|
---|
[114] | 75 | unsigned int mVisibilityThreshold;
|
---|
[155] | 76 | unsigned int mAssumedVisibilityForChc;
|
---|
[59] | 77 | };
|
---|
| 78 | } // namespace GtpVisibility
|
---|
[71] | 79 |
|
---|
[130] | 80 | #endif // VisibilityManager |
---|