source: trunk/VUT/Ogre/include/OgreOctreeHierarchyInterface.h @ 155

Revision 155, 2.5 KB checked in by mattausch, 19 years ago (diff)

added node traversal interface

RevLine 
[59]1#ifndef _OctreeHierarchyInterface_H__
2#define _OctreeHierarchyInterface_H__
3
4#include <OgreOctree.h>
[130]5#include <OgreOctreeSceneManager.h>
6#include "OgreSceneNodeHierarchyInterface.h"
[59]7
8namespace Ogre {
9/**
10        This class implements the hierarchy interface for the Ogre octree hierarchy.
11*/
[130]12class OctreeHierarchyInterface : public SceneNodeHierarchyInterface
[59]13{
14public:
[130]15        OctreeHierarchyInterface(OctreeSceneManager *sm, RenderSystem *rsys);
[59]16       
17        /** Sets the number of nodes in this octree
18                @remark do not confuse this with the OctreeNode class which is derived from SceneNode
19                @param num number of nodes in the octree
20        */
21        void SetNumOctreeNodes(unsigned int num);
22
23        /** Gets the given option for the scene traverser.
24            @remarks
25                See setOption
26        */
27        void PullUpVisibility(GtpVisibility::HierarchyNode *node);
[154]28       
[59]29        /** Traverses given node.
30                @param node current node
[155]31                @remark pushes children on a distance queue.
[59]32        */
[155]33        void TraverseAndRenderNode(GtpVisibility::HierarchyNode *node);
[59]34        void RenderNode(GtpVisibility::HierarchyNode *node);
[74]35        bool IsLeaf(GtpVisibility::HierarchyNode *node) const;
36        bool HasGeometry(GtpVisibility::HierarchyNode *node) const;
[87]37        float GetSquaredDistance(GtpVisibility::HierarchyNode *node) const;
[59]38       
39        void SetNodeVisible(GtpVisibility::HierarchyNode *node, const bool visible);
[74]40        void SetLastVisited(GtpVisibility::HierarchyNode *node, const unsigned int frameId);
[59]41
[74]42        bool IsNodeVisible(GtpVisibility::HierarchyNode *node) const;
43        unsigned int LastVisited(GtpVisibility::HierarchyNode *node) const;
[59]44
[112]45        void VisualizeCulledNode(GtpVisibility::HierarchyNode *node,
46                                                         GtpVisibility::CullingType type);
47
[155]48        void GetNodeGeometryList(GtpVisibility::HierarchyNode *node,
[130]49                                         GtpVisibility::GeometryList *geometryList,
50                                         bool includeChildren);
51
[154]52        void SetNodeId(GtpVisibility::HierarchyNode *node, int id);
53       
54        int GetNodeId(GtpVisibility::HierarchyNode *node);
55
[155]56        GtpVisibility::HierarchyNode *GetNextNode();
57
[59]58protected:
59        /** Returns pointer to the bounding box of the node.
60                @param node current hierarchy node
61                @returns bounding box of current node
62        */
63        AxisAlignedBox *GetBoundingBox(GtpVisibility::HierarchyNode *node);
64        /** Returns squared distance of center of box with respect to the camera .
65                @param cam current camera
66                @param box axis aligned box
67        */
68        Real GetSquaredViewDepth(const Camera* cam, const AxisAlignedBox* box) const;
[155]69
70        int mCurrentOctreePosition;
[59]71};
72} // namespace Ogre
73
74#endif // OctreeHierarchyInterface_H
Note: See TracBrowser for help on using the repository browser.