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(PlatformHierarchyInterface *hierarchyInterface, Viewport *vp, |
---|
18 | int queryModes, int itemBufferMode);
|
---|
19 |
|
---|
20 | void ComputeCameraVisibility(const Camera &camera,
|
---|
21 | GtpVisibility::NodeInfoContainer *visibleNodes,
|
---|
22 | GtpVisibility::MeshInfoContainer *visibleGeometry,
|
---|
23 | GtpVisibility::PatchInfoContainer *visiblePatches,
|
---|
24 | bool relativeVisibility = false);
|
---|
25 |
|
---|
26 | /**
|
---|
27 | Uses the specified point to execute the visibility query in all directions.
|
---|
28 | @sa ComputeCameraVisibility()
|
---|
29 | */
|
---|
30 | void ComputeFromPointVisibility(const Vector3 &point,
|
---|
31 | GtpVisibility::NodeInfoContainer *visibleNodes,
|
---|
32 | GtpVisibility::MeshInfoContainer *visibleGeometry,
|
---|
33 | GtpVisibility::PatchInfoContainer *visiblePatches,
|
---|
34 | bool relativeVisibility = false);
|
---|
35 |
|
---|
36 |
|
---|
37 | protected:
|
---|
38 |
|
---|
39 | void CollectGeometryVisibility(GtpVisibility::QueryList::iterator &visQueryIt, |
---|
40 | GtpVisibility::QueryList::iterator &projQueryIt, |
---|
41 | GtpVisibility::GeometryList *geometryList, |
---|
42 | GtpVisibility::MeshInfoContainer *visibleGeometry,
|
---|
43 | bool relativeVisibility);
|
---|
44 |
|
---|
45 | void CollectNodeVisibility(GtpVisibility::QueryList::iterator &visQueryIt, |
---|
46 | GtpVisibility::QueryList::iterator &projQueryIt, |
---|
47 | GtpVisibility::HierarchyNodeList *nodeList, |
---|
48 | GtpVisibility::NodeInfoContainer *visibleNodes, |
---|
49 | bool relativeVisibility); |
---|
50 | |
---|
51 | void CollectRelativeGeometryVisibilityForItemBuffer(GtpVisibility::QueryList::iterator &projQueryIt,
|
---|
52 | GtpVisibility::GeometryList *geometryList,
|
---|
53 | GtpVisibility::MeshInfoContainer *visibleGeometry);
|
---|
54 |
|
---|
55 | void CollectRelativePatchVisibilityForItemBuffer( |
---|
56 | GtpVisibility::QueryList::iterator &projQueryIt,
|
---|
57 | GtpVisibility::PatchList *patchList,
|
---|
58 | GtpVisibility::PatchInfoContainer *visiblePatches);
|
---|
59 |
|
---|
60 | void CollectPatchVisibility(GtpVisibility::QueryList::iterator &visQueryIt, |
---|
61 | GtpVisibility::QueryList::iterator &projQueryIt, |
---|
62 | GtpVisibility::PatchList *patchList, |
---|
63 | GtpVisibility::PatchInfoContainer *visiblePatches, |
---|
64 | bool relativeVisibility);
|
---|
65 |
|
---|
66 | void RemoveDuplicateNodes(GtpVisibility::NodeInfoContainer *visibleNodes);
|
---|
67 | void RemoveDuplicateGeometry(GtpVisibility::MeshInfoContainer *visibleMesh);
|
---|
68 | void RemoveDuplicatePatches(GtpVisibility::PatchInfoContainer *visiblePatches);
|
---|
69 |
|
---|
70 | /** Returns the patches of the geometry of a given node.
|
---|
71 | @param node the node containing the patches
|
---|
72 | @param patchList the patches are returned in this list
|
---|
73 | */
|
---|
74 | virtual void GetNodePatchList(GtpVisibility::HierarchyNode *node,
|
---|
75 | GtpVisibility::PatchList *patchList);
|
---|
76 |
|
---|
77 | int mItemBufferMode;
|
---|
78 | };
|
---|
79 |
|
---|
80 | } // namespace Ogre
|
---|
81 |
|
---|
82 | #endif // OcclusionQueriesQueryManager
|
---|