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