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