#ifndef _ItemBufferQueryManager_H__ #define _ItemBufferQueryManager_H__ #include "OgrePlatformQueryManager.h" namespace Ogre { /** Class which implements the QueryManager for Ogre scene queries using an item buffer, i.e., the objects are rendered with their id used as unique color code. After reading back the frame buffer, the visibility information can be established for each object. */ class __declspec(dllexport) ItemBufferQueryManager: public PlatformQueryManager { public: /** Constructor taking a hierarchy interface as an argument. This allows to operate on different hierarchy types, while reusing the implementation of the query methods. @param renderPatches determines if the visibility of either patches or meshes is computed. */ ItemBufferQueryManager(PlatformHierarchyInterface *hierarchyInterface, Viewport *vp, const bool renderPatches); void ComputeCameraVisibility(const Camera &camera, InfoContainer *visibleNodes, InfoContainer *visibleGeometry, InfoContainer *visiblePatches, bool relativeVisibility = false); bool ShootRay(const Ray &ray, std::vector *visibleMeshes, bool isGlobalLine = false); protected: /** Helper function used to initialise item buffer. */ void InitItemBuffer( InfoContainer *visibleNodes, InfoContainer *visibleGeometry, InfoContainer *visiblePatches); /// if patches are used instead of meshes (only one at a time) bool mRenderPatchesForItemBuffer; }; } // namespace Ogre #endif // ItemBufferQueryManager