[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,
|
---|
| 21 | InfoContainer<GtpVisibility::NodeInfo> *visibleNodes,
|
---|
| 22 | InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry,
|
---|
[159] | 23 | InfoContainer<GtpVisibility::PatchInfo> *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,
|
---|
| 31 | InfoContainer<GtpVisibility::NodeInfo> *visibleNodes,
|
---|
| 32 | InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry,
|
---|
[159] | 33 | InfoContainer<GtpVisibility::PatchInfo> *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, |
---|
| 42 | InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry,
|
---|
| 43 | bool relativeVisibility);
|
---|
| 44 |
|
---|
| 45 | void CollectNodeVisibility(GtpVisibility::QueryList::iterator &visQueryIt, |
---|
| 46 | GtpVisibility::QueryList::iterator &projQueryIt, |
---|
| 47 | GtpVisibility::HierarchyNodeList *nodeList, |
---|
| 48 | InfoContainer<GtpVisibility::NodeInfo> *visibleNodes, |
---|
| 49 | bool relativeVisibility); |
---|
| 50 | |
---|
| 51 | void CollectRelativeGeometryVisibilityForItemBuffer(GtpVisibility::QueryList::iterator &projQueryIt,
|
---|
| 52 | GtpVisibility::GeometryList *geometryList,
|
---|
| 53 | InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry);
|
---|
| 54 |
|
---|
| 55 | void CollectRelativePatchVisibilityForItemBuffer( |
---|
| 56 | GtpVisibility::QueryList::iterator &projQueryIt,
|
---|
| 57 | GtpVisibility::PatchList *patchList,
|
---|
| 58 | InfoContainer<GtpVisibility::PatchInfo> *visiblePatches);
|
---|
| 59 |
|
---|
| 60 | void CollectPatchVisibility(GtpVisibility::QueryList::iterator &visQueryIt, |
---|
| 61 | GtpVisibility::QueryList::iterator &projQueryIt, |
---|
| 62 | GtpVisibility::PatchList *patchList, |
---|
| 63 | InfoContainer<GtpVisibility::PatchInfo> *visiblePatches, |
---|
| 64 | bool relativeVisibility);
|
---|
| 65 |
|
---|
| 66 | void RemoveDuplicateNodes(InfoContainer<GtpVisibility::NodeInfo> *visibleNodes);
|
---|
| 67 | void RemoveDuplicateGeometry(InfoContainer<GtpVisibility::MeshInfo> *visibleMesh);
|
---|
[173] | 68 | void RemoveDuplicatePatches(InfoContainer<GtpVisibility::PatchInfo> *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
|
---|