#ifndef _PlatformQueryManager_H__ #define _PlatformQueryManager_H__ #include "VisibilityInfo.h" #include "QueryManager.h" #include "OgrePlatformHierarchyInterface.h" namespace Ogre { /** Class which implements the QueryManager for Ogre scene queries. */ class __declspec(dllexport) PlatformQueryManager: public GtpVisibility::QueryManager { public: /** Constructor taking a hierarchy interface as an argument. This allows to operate onm different hierarchy types, while reusing the implementation of the query methods. */ PlatformQueryManager(PlatformHierarchyInterface *hierarchyInterface, Viewport *vp); /** Computes restricted visibility from point by using an explicit camera to execute the visibility query. @param camera The camera to be used @param visibleNodes Pointer to the container where visible nodes should be added. This set is formed of visible leafs or fully visible interior nodes. If NULL no visible nodes are not evaluated. @param visibleGeometry Pointer to the container where visible meshes should be added. If NULL no visible meshes are not evaluated. @param projectedPixels If true the visibility member for NodeInfo and MeshInfo represent relative visibility; i.e. the number of visible pixels divided by the the number of projected pixels. @return true if the corresponding PVS exists. */ virtual void ComputeCameraVisibility(const Camera &camera, InfoContainer *visibleNodes, InfoContainer *visibleGeometry, bool relativeVisibility = false ); /** Uses the specified point to execute the visibility query in all directions. @sa ComputeCameraVisibility() */ virtual void ComputeFromPointVisibility(const Vector3 &point, InfoContainer *visibleNodes, InfoContainer *visibleGeometry, bool relativeVisibility = false ); /** Ray shooting interface: finds an intersection with objects in the scene. @param ray The given input ray (assuming the ray direction is normalized) @param visibleMeshes List of meshes intersecting the ray @param isGlobalLine If false only first intersection with opaque object is returned. Otherwise all intersections of the ray with the scene are found. @return true if there is any intersection. */ virtual bool ShootRay(const Ray &ray, std::vector *visibleMeshes, bool isGlobalLine = false ); /** Sets a viewport for rendering. */ void SetViewport(Viewport *vp); protected: Viewport *mViewport; }; } // namespace Ogre #endif // PlatformQueryManager