#ifndef _OctreeHierarchyInterface_H__ #define _OctreeHierarchyInterface_H__ #include #include #include "OgreSceneNodeHierarchyInterface.h" namespace Ogre { /** This class implements the hierarchy interface for the Ogre octree hierarchy. */ class OctreeHierarchyInterface : public SceneNodeHierarchyInterface { public: OctreeHierarchyInterface(OctreeSceneManager *sm, RenderSystem *rsys); /** Sets the number of nodes in this octree @remark do not confuse this with the OctreeNode class which is derived from SceneNode @param num number of nodes in the octree */ void SetNumOctreeNodes(unsigned int num); /** Gets the given option for the scene traverser. @remarks See setOption */ void PullUpVisibility(GtpVisibility::HierarchyNode *node) const; /** Traverses and renders the given node. @param node current node @remark pushes children on a distance queue. */ void TraverseNode(GtpVisibility::HierarchyNode *node); /** @copydoc HierarchyInterface::RenderNode */ void RenderNode(GtpVisibility::HierarchyNode *node); bool IsLeaf(GtpVisibility::HierarchyNode *node) const; bool HasGeometry(GtpVisibility::HierarchyNode *node) const; float GetSquaredDistance(GtpVisibility::HierarchyNode *node) const; void SetNodeVisible(GtpVisibility::HierarchyNode *node, const bool visible) const; void SetLastVisited(GtpVisibility::HierarchyNode *node, const unsigned int frameId) const; bool IsNodeVisible(GtpVisibility::HierarchyNode *node) const; unsigned int LastVisited(GtpVisibility::HierarchyNode *node) const; void VisualizeCulledNode(GtpVisibility::HierarchyNode *node, GtpVisibility::CullingType type) const; void GetNodeGeometryList(GtpVisibility::HierarchyNode *node, GtpVisibility::GeometryList *geometryList, bool includeChildren); protected: /** Returns pointer to the bounding box of the node. @param node current hierarchy node @returns bounding box of current node */ AxisAlignedBox *GetBoundingBox(GtpVisibility::HierarchyNode *node); /** Returns squared distance of center of box with respect to the camera . @param cam current camera @param box axis aligned box */ Real GetSquaredViewDepth(const Camera* cam, const AxisAlignedBox* box) const; }; } // namespace Ogre #endif // OctreeHierarchyInterface_H