[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
|
---|
| 17 | onm different hierarchy types, while reusing the implementation of the query methods.
|
---|
| 18 | */
|
---|
| 19 | PlatformQueryManager(PlatformHierarchyInterface *hierarchyInterface, Viewport *vp);
|
---|
| 20 |
|
---|
| 21 | /**
|
---|
| 22 | Uses the specified point to execute the visibility query in all directions.
|
---|
| 23 | @sa ComputeCameraVisibility()
|
---|
| 24 | */
|
---|
[154] | 25 | void ComputeFromPointVisibility(const Vector3 &point,
|
---|
[133] | 26 | InfoContainer<GtpVisibility::NodeInfo> *visibleNodes,
|
---|
| 27 | InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry,
|
---|
[154] | 28 | bool relativeVisibility = false);
|
---|
[133] | 29 |
|
---|
| 30 | /**
|
---|
| 31 | Ray shooting interface: finds an intersection with objects in the scene.
|
---|
| 32 |
|
---|
| 33 | @param ray The given input ray (assuming the ray direction is normalized)
|
---|
| 34 |
|
---|
| 35 | @param visibleMeshes List of meshes intersecting the ray
|
---|
| 36 |
|
---|
| 37 | @param isGlobalLine If false only first intersection with opaque object is returned.
|
---|
| 38 | Otherwise all intersections of the ray with the scene are found.
|
---|
| 39 |
|
---|
| 40 | @return true if there is any intersection.
|
---|
| 41 | */
|
---|
| 42 | virtual bool
|
---|
| 43 | ShootRay(const Ray &ray,
|
---|
| 44 | std::vector<Mesh *> *visibleMeshes,
|
---|
| 45 | bool isGlobalLine = false
|
---|
| 46 | );
|
---|
| 47 |
|
---|
[144] | 48 | /** Sets a viewport for rendering.
|
---|
[133] | 49 | */
|
---|
| 50 | void SetViewport(Viewport *vp);
|
---|
| 51 |
|
---|
| 52 | protected:
|
---|
| 53 | Viewport *mViewport;
|
---|
[154] | 54 | bool mWasInitialised;
|
---|
[133] | 55 | };
|
---|
| 56 |
|
---|
| 57 | } // namespace Ogre
|
---|
| 58 |
|
---|
| 59 | #endif // PlatformQueryManager
|
---|