[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,
|
---|
| 23 | int queryModes,
|
---|
[2280] | 24 | int itemBufferMode): |
---|
| 25 | PlatformQueryManager(hierarchyInterface, vp, queryModes), |
---|
| 26 | mItemBufferMode(itemBufferMode) |
---|
| 27 | {}
|
---|
| 28 |
|
---|
[154] | 29 | void ComputeCameraVisibility(const Camera &camera,
|
---|
[2280] | 30 | NodeInfoContainer *visibleNodes,
|
---|
| 31 | MeshInfoContainer *visibleGeometry,
|
---|
| 32 | PatchInfoContainer *visiblePatches,
|
---|
[2255] | 33 | const bool relativeVisibility,
|
---|
| 34 | const bool approximateVisibility);
|
---|
[154] | 35 |
|
---|
[2280] | 36 | /** Uses the specified point to execute the visibility query in all directions.
|
---|
| 37 | @sa ComputeCameraVisibility()
|
---|
[154] | 38 | */
|
---|
| 39 | void ComputeFromPointVisibility(const Vector3 &point,
|
---|
[2280] | 40 | NodeInfoContainer *visibleNodes,
|
---|
| 41 | MeshInfoContainer *visibleGeometry,
|
---|
| 42 | PatchInfoContainer *visiblePatches,
|
---|
[2255] | 43 | const bool relativeVisibility,
|
---|
| 44 | const bool approximateVisibility);
|
---|
[154] | 45 |
|
---|
[171] | 46 |
|
---|
| 47 | protected:
|
---|
| 48 |
|
---|
[2280] | 49 | void CollectGeometryVisibility(GtpVisibility::QueryList::iterator &visQueryIt,
|
---|
| 50 | GtpVisibility::QueryList::iterator &projQueryIt,
|
---|
| 51 | GeometryVector *geometryList,
|
---|
| 52 | MeshInfoContainer *visibleGeometry,
|
---|
[171] | 53 | bool relativeVisibility);
|
---|
| 54 |
|
---|
[2280] | 55 | void CollectNodeVisibility(GtpVisibility::QueryList::iterator &visQueryIt,
|
---|
| 56 | GtpVisibility::QueryList::iterator &projQueryIt,
|
---|
| 57 | GtpVisibility::NodeVector *nodeList,
|
---|
| 58 | NodeInfoContainer *visibleNodes,
|
---|
| 59 | bool relativeVisibility);
|
---|
| 60 |
|
---|
[171] | 61 | void CollectRelativeGeometryVisibilityForItemBuffer(GtpVisibility::QueryList::iterator &projQueryIt,
|
---|
[2280] | 62 | GeometryVector *geometryList,
|
---|
| 63 | MeshInfoContainer *visibleGeometry);
|
---|
[171] | 64 |
|
---|
[2280] | 65 | void CollectRelativePatchVisibilityForItemBuffer(GtpVisibility::QueryList::iterator &projQueryIt,
|
---|
| 66 | PatchVector *patchList,
|
---|
| 67 | PatchInfoContainer *visiblePatches);
|
---|
[171] | 68 |
|
---|
[2280] | 69 | void CollectPatchVisibility(GtpVisibility::QueryList::iterator &visQueryIt,
|
---|
| 70 | GtpVisibility::QueryList::iterator &projQueryIt,
|
---|
| 71 | PatchVector *patchList,
|
---|
| 72 | PatchInfoContainer *visiblePatches,
|
---|
[171] | 73 | bool relativeVisibility);
|
---|
| 74 |
|
---|
[2280] | 75 | void RemoveDuplicateNodes(NodeInfoContainer *visibleNodes);
|
---|
| 76 | void RemoveDuplicateGeometry(MeshInfoContainer *visibleMesh);
|
---|
| 77 | void RemoveDuplicatePatches(PatchInfoContainer *visiblePatches);
|
---|
[171] | 78 |
|
---|
[174] | 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,
|
---|
[2280] | 84 | PatchVector *patchList);
|
---|
[174] | 85 |
|
---|
| 86 | int mItemBufferMode;
|
---|
[154] | 87 | };
|
---|
| 88 |
|
---|
| 89 | } // namespace Ogre
|
---|
| 90 |
|
---|
| 91 | #endif // OcclusionQueriesQueryManager
|
---|