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