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 | PlatformQueryManager(hierarchyInterface, vp, queryModes) |
---|
25 | {}
|
---|
26 |
|
---|
27 | void ComputeCameraVisibility(const Camera &camera,
|
---|
28 | NodeInfoContainer *visibleNodes,
|
---|
29 | MeshInfoContainer *visibleGeometry,
|
---|
30 | PatchInfoContainer *visiblePatches,
|
---|
31 | const bool relativeVisibility,
|
---|
32 | const bool approximateVisibility);
|
---|
33 |
|
---|
34 | /** Uses the specified point to execute the visibility query in all directions.
|
---|
35 | @sa ComputeCameraVisibility()
|
---|
36 | */
|
---|
37 | void ComputeFromPointVisibility(const Vector3 &point,
|
---|
38 | NodeInfoContainer *visibleNodes,
|
---|
39 | MeshInfoContainer *visibleGeometry,
|
---|
40 | PatchInfoContainer *visiblePatches,
|
---|
41 | const bool relativeVisibility,
|
---|
42 | const bool approximateVisibility);
|
---|
43 |
|
---|
44 |
|
---|
45 | protected:
|
---|
46 |
|
---|
47 | void CollectGeometryVisibility(GtpVisibility::QueryList::iterator &visQueryIt,
|
---|
48 | GtpVisibility::QueryList::iterator &projQueryIt,
|
---|
49 | GeometryVector *geometryList,
|
---|
50 | MeshInfoContainer *visibleGeometry,
|
---|
51 | bool relativeVisibility);
|
---|
52 |
|
---|
53 | void CollectNodeVisibility(GtpVisibility::QueryList::iterator &visQueryIt,
|
---|
54 | GtpVisibility::QueryList::iterator &projQueryIt,
|
---|
55 | GtpVisibility::NodeVector *nodeList,
|
---|
56 | NodeInfoContainer *visibleNodes,
|
---|
57 | bool relativeVisibility);
|
---|
58 |
|
---|
59 |
|
---|
60 | void CollectPatchVisibility(GtpVisibility::QueryList::iterator &visQueryIt,
|
---|
61 | GtpVisibility::QueryList::iterator &projQueryIt,
|
---|
62 | PatchVector *patchList,
|
---|
63 | PatchInfoContainer *visiblePatches,
|
---|
64 | bool relativeVisibility);
|
---|
65 |
|
---|
66 | void RemoveDuplicateNodes(NodeInfoContainer *visibleNodes);
|
---|
67 | void RemoveDuplicateGeometry(MeshInfoContainer *visibleMesh);
|
---|
68 | void RemoveDuplicatePatches(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 | PatchVector *patchList);
|
---|
76 |
|
---|
77 | };
|
---|
78 |
|
---|
79 | } // namespace Ogre
|
---|
80 |
|
---|
81 | #endif // OcclusionQueriesQueryManager
|
---|