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