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 | InfoContainer<GtpVisibility::NodeInfo> *visibleNodes,
|
---|
28 | InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry,
|
---|
29 | InfoContainer<GtpVisibility::PatchInfo> *visiblePatches,
|
---|
30 | bool relativeVisibility = false);
|
---|
31 | |
---|
32 | void ComputeCameraVisibility(const Camera &camera, |
---|
33 | InfoContainer<GtpVisibility::NodeInfo> *visibleNodes, |
---|
34 | InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry, |
---|
35 | InfoContainer<GtpVisibility::PatchInfo> *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 |
|
---|
46 | void CollectItemBufferResults( |
---|
47 | InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry, |
---|
48 | InfoContainer<GtpVisibility::PatchInfo> *visiblePatches);
|
---|
49 |
|
---|
50 | void InitItemBuffer(InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry, |
---|
51 | InfoContainer<GtpVisibility::PatchInfo> *visiblePatches);
|
---|
52 |
|
---|
53 | Viewport *mViewport;
|
---|
54 |
|
---|
55 | bool mWasInitialised;
|
---|
56 | };
|
---|
57 |
|
---|
58 | } // namespace Ogre
|
---|
59 |
|
---|
60 | #endif // PlatformQueryManager
|
---|