[133] | 1 | #ifndef _PlatformQueryManager_H__ |
---|
| 2 | #define _PlatformQueryManager_H__ |
---|
| 3 | |
---|
| 4 | #include "VisibilityInfo.h" |
---|
| 5 | #include "QueryManager.h" |
---|
| 6 | #include "OgrePlatformHierarchyInterface.h" |
---|
| 7 | |
---|
| 8 | namespace Ogre {
|
---|
| 9 |
|
---|
| 10 | /**
|
---|
| 11 | Class which implements the QueryManager for Ogre scene queries.
|
---|
| 12 | */
|
---|
| 13 | class __declspec(dllexport) PlatformQueryManager: public GtpVisibility::QueryManager
|
---|
| 14 | {
|
---|
| 15 | public:
|
---|
| 16 | /** Constructor taking a hierarchy interface as an argument. This allows to operate
|
---|
[171] | 17 | on different hierarchy types, while reusing the implementation of the query methods.
|
---|
[133] | 18 | */
|
---|
[171] | 19 | PlatformQueryManager(PlatformHierarchyInterface *hierarchyInterface,
|
---|
| 20 | Viewport *vp,
|
---|
| 21 | bool renderPatches);
|
---|
[133] | 22 |
|
---|
| 23 | /**
|
---|
| 24 | Uses the specified point to execute the visibility query in all directions.
|
---|
| 25 | @sa ComputeCameraVisibility()
|
---|
| 26 | */
|
---|
[154] | 27 | void ComputeFromPointVisibility(const Vector3 &point,
|
---|
[133] | 28 | InfoContainer<GtpVisibility::NodeInfo> *visibleNodes,
|
---|
| 29 | InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry,
|
---|
[159] | 30 | InfoContainer<GtpVisibility::PatchInfo> *visiblePatches,
|
---|
[154] | 31 | bool relativeVisibility = false);
|
---|
[171] | 32 | |
---|
| 33 | void ComputeCameraVisibility(const Camera &camera, |
---|
| 34 | InfoContainer<GtpVisibility::NodeInfo> *visibleNodes, |
---|
| 35 | InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry, |
---|
| 36 | InfoContainer<GtpVisibility::PatchInfo> *visiblePatches, |
---|
| 37 | bool relativeVisibility = false);
|
---|
| 38 |
|
---|
| 39 | bool ShootRay(const Ray &ray, std::vector<Mesh *> *visibleMeshes, bool isGlobalLine = false);
|
---|
[133] | 40 |
|
---|
[144] | 41 | /** Sets a viewport for rendering.
|
---|
[133] | 42 | */
|
---|
| 43 | void SetViewport(Viewport *vp);
|
---|
| 44 |
|
---|
| 45 | protected:
|
---|
[171] | 46 |
|
---|
[173] | 47 | void CollectItemBufferResults( |
---|
| 48 | InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry, |
---|
| 49 | InfoContainer<GtpVisibility::PatchInfo> *visiblePatches);
|
---|
| 50 |
|
---|
[171] | 51 | void InitItemBuffer(InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry, |
---|
| 52 | InfoContainer<GtpVisibility::PatchInfo> *visiblePatches);
|
---|
| 53 |
|
---|
[133] | 54 | Viewport *mViewport;
|
---|
[154] | 55 | bool mWasInitialised;
|
---|
[171] | 56 | bool mRenderPatches;
|
---|
[133] | 57 | };
|
---|
| 58 |
|
---|
| 59 | } // namespace Ogre
|
---|
| 60 |
|
---|
| 61 | #endif // PlatformQueryManager
|
---|