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
|
---|
17 | on different hierarchy types, while reusing the implementation of the query methods.
|
---|
18 | */
|
---|
19 | PlatformQueryManager(PlatformHierarchyInterface *hierarchyInterface,
|
---|
20 | Viewport *vp, int queryModes);
|
---|
21 |
|
---|
22 | /**
|
---|
23 | Uses the specified point to execute the visibility query in all directions.
|
---|
24 | @sa ComputeCameraVisibility()
|
---|
25 | */
|
---|
26 | void ComputeFromPointVisibility(const Vector3 &point,
|
---|
27 | GtpVisibility::NodeInfoContainer *visibleNodes,
|
---|
28 | GtpVisibility::MeshInfoContainer *visibleGeometry,
|
---|
29 | GtpVisibility::PatchInfoContainer *visiblePatches,
|
---|
30 | bool relativeVisibility = false);
|
---|
31 |
|
---|
32 | void ComputeCameraVisibility(const Camera &camera,
|
---|
33 | GtpVisibility::NodeInfoContainer *visibleNodes,
|
---|
34 | GtpVisibility::MeshInfoContainer *visibleGeometry,
|
---|
35 | GtpVisibility::PatchInfoContainer *visiblePatches,
|
---|
36 | bool relativeVisibility = false);
|
---|
37 |
|
---|
38 | bool ShootRay(const Ray &ray, std::vector<Mesh *> *visibleMeshes, bool isGlobalLine = false);
|
---|
39 |
|
---|
40 | /** Sets a viewport for rendering.
|
---|
41 | */
|
---|
42 | void SetViewport(Viewport *vp);
|
---|
43 |
|
---|
44 | protected:
|
---|
45 | #ifdef ITEM_BUFFER
|
---|
46 | void CollectItemBufferResults(
|
---|
47 | GtpVisibility::MeshInfoContainer *visibleGeometry,
|
---|
48 | GtpVisibility::PatchInfoContainer *visiblePatches);
|
---|
49 |
|
---|
50 | void InitItemBuffer(GtpVisibility::MeshInfoContainer *visibleGeometry,
|
---|
51 | GtpVisibility::PatchInfoContainer *visiblePatches);
|
---|
52 | #endif // ITEM_BUFFER
|
---|
53 |
|
---|
54 | Viewport *mViewport;
|
---|
55 |
|
---|
56 | bool mWasInitialised;
|
---|
57 | };
|
---|
58 |
|
---|
59 | } // namespace Ogre
|
---|
60 |
|
---|
61 | #endif // PlatformQueryManager
|
---|