#ifndef _OctreeHierarchyInterface_H__ #define _OctreeHierarchyInterface_H__ #include #include "OgrePlatformHierarchyInterface.h" namespace Ogre { /** This class implements the hierarchy interface for the Ogre octree hierarchy. */ class OctreeHierarchyInterface : public PlatformHierarchyInterface { public: OctreeHierarchyInterface(SceneManager *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 */ //bool getOption( const String &, void * ); //bool getOptionKeys( StringVector &refKeys ); void PullUpVisibility(GtpVisibility::HierarchyNode *node); /** Traverses given node. @param node current node @remark pushes children on distance queue */ void TraverseNode(GtpVisibility::HierarchyNode *node); void RenderNode(GtpVisibility::HierarchyNode *node); bool IsLeaf(GtpVisibility::HierarchyNode *node); bool HasGeometry(GtpVisibility::HierarchyNode *node); bool HasGreaterDistance(GtpVisibility::HierarchyNode *node1, GtpVisibility::HierarchyNode *node2); void SetNodeVisible(GtpVisibility::HierarchyNode *node, const bool visible); void SetLastVisited(GtpVisibility::HierarchyNode *node, const int frameId); bool IsNodeVisible(GtpVisibility::HierarchyNode *node); int LastVisited(GtpVisibility::HierarchyNode *node); 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; unsigned int mNumOctreeNodes; }; } // namespace Ogre #endif // OctreeHierarchyInterface_H