[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 | */
|
---|
[171] | 17 | OcclusionQueriesQueryManager(PlatformHierarchyInterface *hierarchyInterface,
|
---|
| 18 | Viewport *vp,
|
---|
| 19 | bool renderPatches,
|
---|
| 20 | bool useItemBufferForGeometry);
|
---|
[154] | 21 |
|
---|
| 22 | void ComputeCameraVisibility(const Camera &camera,
|
---|
| 23 | InfoContainer<GtpVisibility::NodeInfo> *visibleNodes,
|
---|
| 24 | InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry,
|
---|
[159] | 25 | InfoContainer<GtpVisibility::PatchInfo> *visiblePatches,
|
---|
[154] | 26 | bool relativeVisibility = false);
|
---|
| 27 |
|
---|
| 28 | /**
|
---|
| 29 | Uses the specified point to execute the visibility query in all directions.
|
---|
| 30 | @sa ComputeCameraVisibility()
|
---|
| 31 | */
|
---|
| 32 | void ComputeFromPointVisibility(const Vector3 &point,
|
---|
| 33 | InfoContainer<GtpVisibility::NodeInfo> *visibleNodes,
|
---|
| 34 | InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry,
|
---|
[159] | 35 | InfoContainer<GtpVisibility::PatchInfo> *visiblePatches,
|
---|
[154] | 36 | bool relativeVisibility = false);
|
---|
| 37 |
|
---|
[171] | 38 |
|
---|
| 39 | protected:
|
---|
| 40 |
|
---|
| 41 | void CollectGeometryVisibility(GtpVisibility::QueryList::iterator &visQueryIt, |
---|
| 42 | GtpVisibility::QueryList::iterator &projQueryIt, |
---|
| 43 | GtpVisibility::GeometryList *geometryList, |
---|
| 44 | InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry,
|
---|
| 45 | bool relativeVisibility);
|
---|
| 46 |
|
---|
| 47 | void CollectNodeVisibility(GtpVisibility::QueryList::iterator &visQueryIt, |
---|
| 48 | GtpVisibility::QueryList::iterator &projQueryIt, |
---|
| 49 | GtpVisibility::HierarchyNodeList *nodeList, |
---|
| 50 | InfoContainer<GtpVisibility::NodeInfo> *visibleNodes, |
---|
| 51 | bool relativeVisibility); |
---|
| 52 | |
---|
| 53 | void CollectRelativeGeometryVisibilityForItemBuffer(GtpVisibility::QueryList::iterator &projQueryIt,
|
---|
| 54 | GtpVisibility::GeometryList *geometryList,
|
---|
| 55 | InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry);
|
---|
| 56 |
|
---|
| 57 | void CollectRelativePatchVisibilityForItemBuffer( |
---|
| 58 | GtpVisibility::QueryList::iterator &projQueryIt,
|
---|
| 59 | GtpVisibility::PatchList *patchList,
|
---|
| 60 | InfoContainer<GtpVisibility::PatchInfo> *visiblePatches);
|
---|
| 61 |
|
---|
| 62 | void CollectPatchVisibility(GtpVisibility::QueryList::iterator &visQueryIt, |
---|
| 63 | GtpVisibility::QueryList::iterator &projQueryIt, |
---|
| 64 | GtpVisibility::PatchList *patchList, |
---|
| 65 | InfoContainer<GtpVisibility::PatchInfo> *visiblePatches, |
---|
| 66 | bool relativeVisibility);
|
---|
| 67 |
|
---|
| 68 | void RemoveDuplicateNodes(InfoContainer<GtpVisibility::NodeInfo> *visibleNodes);
|
---|
| 69 | void RemoveDuplicateGeometry(InfoContainer<GtpVisibility::MeshInfo> *visibleMesh);
|
---|
| 70 |
|
---|
| 71 | bool mUseItemBuffer;
|
---|
[154] | 72 | };
|
---|
| 73 |
|
---|
| 74 | } // namespace Ogre
|
---|
| 75 |
|
---|
| 76 | #endif // OcclusionQueriesQueryManager
|
---|