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