/* ----------------------------------------------------------------------------- This source file is part of the GameTools Project http://www.gametools.org Author: Martin Szydlowski ----------------------------------------------------------------------------- */ #ifndef _OgreBvHierarchyInterface_H_ #define _OgreBvHierarchyInterface_H_ #include "OgrePlatformHierarchyInterface.h" namespace Ogre { class BvHierarchySceneManager; class BvHierarchyInterface : public PlatformHierarchyInterface { public: BvHierarchyInterface(BvHierarchySceneManager *sm, RenderSystem *rsys); virtual ~BvHierarchyInterface() {}; /** Returns true if current node is leaf of the hierarchy. @param node hierarchy node @returns true if node is leaf */ virtual bool IsLeaf(GtpVisibility::HierarchyNode *node) const; /** Traverses and renders the hierarchy from the given node. @param node the hierarchy node */ virtual void TraverseNode(GtpVisibility::HierarchyNode *node); /** Renders the given hierarchy node. @param node current hierarchy node to be rendered */ virtual void RenderNode(GtpVisibility::HierarchyNode *node); /** Pulls up the visibility from the current node recursively to the parent nodes. @param node the current node */ virtual void PullUpVisibility(GtpVisibility::HierarchyNode *node) const; /** Returns distance of the node to the view plane. @param node the hierarchy node */ virtual float GetSquaredDistance(GtpVisibility::HierarchyNode *node) const; /** Returns pointer to bounding box of node. @param node current hierarchy node @returns bounding box of current node */ virtual AxisAlignedBox *GetBoundingBox(GtpVisibility::HierarchyNode *node); /** Returns true if there is renderable geometry attached to this node @param node the current node @returns if the node has renderable geometry */ virtual bool HasGeometry(GtpVisibility::HierarchyNode *node) const; /** Sets the visible flag for this node. @param node the current node @param visible the visible flag */ virtual void SetNodeVisible(GtpVisibility::HierarchyNode *node, const bool visible) const; /** Returns true if node has the visible flag set. See set */ virtual bool IsNodeVisible(GtpVisibility::HierarchyNode *node) const; /** Sets the last visited frame id for this node. @param node the current node @param frameId the current frame id */ virtual void SetLastVisited(GtpVisibility::HierarchyNode *node, const unsigned int frameId) const; /** Returns frame id when this node was last visited by the traverser. See set */ virtual unsigned int LastVisited(GtpVisibility::HierarchyNode *node) const; /** Visualization of a culled node, dependent on the culling type. @param node the hierarchy node to be visualized @param type can be one of FRUSTUM_CULLED, QUERY_CULLED */ virtual void VisualizeCulledNode(GtpVisibility::HierarchyNode *node, GtpVisibility::CullingType type) const; /** Returns the geometry of a given hierarchy node. @param node the hierarchy node containing the geometry @param geometryList geometry is returned in this list @param includeChildren if the geometry of the children should be taken into account */ virtual void GetNodeGeometryList(GtpVisibility::HierarchyNode *node, GtpVisibility::GeometryVector *geometryList, bool includeChildren); void DetermineFullVisibility(GtpVisibility::HierarchyNode *node) const {} void TraverseNode2(GtpVisibility::HierarchyNode *node) {} bool IsNodeFullyVisible(GtpVisibility::HierarchyNode *node) const { return false;} GtpVisibility::HierarchyNode *GetRandomLeaf(GtpVisibility::HierarchyNode *root) { return NULL;} }; } // namespace Ogre #endif // _OgreBvHierarchyInterface_H_