1 | #ifndef _OcclusionQueriesQueryManager_H__
|
---|
2 | #define _OcclusionQueriesQueryManager_H__
|
---|
3 |
|
---|
4 |
|
---|
5 | #include "OgrePlatformQueryManager.h"
|
---|
6 |
|
---|
7 |
|
---|
8 | namespace Ogre {
|
---|
9 |
|
---|
10 | class OgrePlatformHierarchyInterface;
|
---|
11 | class Viewport;
|
---|
12 |
|
---|
13 | /** Class which implements a query manager for Ogre scene queries using occlusion queries.
|
---|
14 | */
|
---|
15 | class __declspec(dllexport) OcclusionQueriesQueryManager: public PlatformQueryManager
|
---|
16 | {
|
---|
17 | public:
|
---|
18 | /** Constructor taking a hierarchy interface as an argument. This allows to operate
|
---|
19 | on different hierarchy types, while reusing the implementation of the query methods.
|
---|
20 | */
|
---|
21 | OcclusionQueriesQueryManager(PlatformHierarchyInterface *hierarchyInterface,
|
---|
22 | Viewport *vp,
|
---|
23 | int queryModes,
|
---|
24 | int itemBufferMode): |
---|
25 | PlatformQueryManager(hierarchyInterface, vp, queryModes), |
---|
26 | mItemBufferMode(itemBufferMode) |
---|
27 | {}
|
---|
28 |
|
---|
29 | void ComputeCameraVisibility(const Camera &camera,
|
---|
30 | NodeInfoContainer *visibleNodes,
|
---|
31 | MeshInfoContainer *visibleGeometry,
|
---|
32 | PatchInfoContainer *visiblePatches,
|
---|
33 | const bool relativeVisibility,
|
---|
34 | const bool approximateVisibility);
|
---|
35 |
|
---|
36 | /** Uses the specified point to execute the visibility query in all directions.
|
---|
37 | @sa ComputeCameraVisibility()
|
---|
38 | */
|
---|
39 | void ComputeFromPointVisibility(const Vector3 &point,
|
---|
40 | NodeInfoContainer *visibleNodes,
|
---|
41 | MeshInfoContainer *visibleGeometry,
|
---|
42 | PatchInfoContainer *visiblePatches,
|
---|
43 | const bool relativeVisibility,
|
---|
44 | const bool approximateVisibility);
|
---|
45 |
|
---|
46 |
|
---|
47 | protected:
|
---|
48 |
|
---|
49 | void CollectGeometryVisibility(GtpVisibility::QueryList::iterator &visQueryIt,
|
---|
50 | GtpVisibility::QueryList::iterator &projQueryIt,
|
---|
51 | GeometryVector *geometryList,
|
---|
52 | MeshInfoContainer *visibleGeometry,
|
---|
53 | bool relativeVisibility);
|
---|
54 |
|
---|
55 | void CollectNodeVisibility(GtpVisibility::QueryList::iterator &visQueryIt,
|
---|
56 | GtpVisibility::QueryList::iterator &projQueryIt,
|
---|
57 | GtpVisibility::NodeVector *nodeList,
|
---|
58 | NodeInfoContainer *visibleNodes,
|
---|
59 | bool relativeVisibility);
|
---|
60 |
|
---|
61 | void CollectRelativeGeometryVisibilityForItemBuffer(GtpVisibility::QueryList::iterator &projQueryIt,
|
---|
62 | GeometryVector *geometryList,
|
---|
63 | MeshInfoContainer *visibleGeometry);
|
---|
64 |
|
---|
65 | void CollectRelativePatchVisibilityForItemBuffer(GtpVisibility::QueryList::iterator &projQueryIt,
|
---|
66 | PatchVector *patchList,
|
---|
67 | PatchInfoContainer *visiblePatches);
|
---|
68 |
|
---|
69 | void CollectPatchVisibility(GtpVisibility::QueryList::iterator &visQueryIt,
|
---|
70 | GtpVisibility::QueryList::iterator &projQueryIt,
|
---|
71 | PatchVector *patchList,
|
---|
72 | PatchInfoContainer *visiblePatches,
|
---|
73 | bool relativeVisibility);
|
---|
74 |
|
---|
75 | void RemoveDuplicateNodes(NodeInfoContainer *visibleNodes);
|
---|
76 | void RemoveDuplicateGeometry(MeshInfoContainer *visibleMesh);
|
---|
77 | void RemoveDuplicatePatches(PatchInfoContainer *visiblePatches);
|
---|
78 |
|
---|
79 | /** Returns the patches of the geometry of a given node.
|
---|
80 | @param node the node containing the patches
|
---|
81 | @param patchList the patches are returned in this list
|
---|
82 | */
|
---|
83 | virtual void GetNodePatchList(GtpVisibility::HierarchyNode *node,
|
---|
84 | PatchVector *patchList);
|
---|
85 |
|
---|
86 | int mItemBufferMode;
|
---|
87 | };
|
---|
88 |
|
---|
89 | } // namespace Ogre
|
---|
90 |
|
---|
91 | #endif // OcclusionQueriesQueryManager
|
---|