[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 |
|
---|
| 8 | namespace Ogre {
|
---|
| 9 | /**
|
---|
| 10 | This class implements the hierarchy interface for the Ogre octree hierarchy.
|
---|
| 11 | */
|
---|
[130] | 12 | class OctreeHierarchyInterface : public SceneNodeHierarchyInterface
|
---|
[59] | 13 | {
|
---|
| 14 | public:
|
---|
[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 | //bool getOption( const String &, void * );
|
---|
| 28 | //bool getOptionKeys( StringVector &refKeys );
|
---|
| 29 | void PullUpVisibility(GtpVisibility::HierarchyNode *node);
|
---|
| 30 | /** Traverses given node.
|
---|
| 31 | @param node current node
|
---|
| 32 | @remark pushes children on distance queue
|
---|
| 33 | */
|
---|
| 34 | void TraverseNode(GtpVisibility::HierarchyNode *node);
|
---|
| 35 | void RenderNode(GtpVisibility::HierarchyNode *node);
|
---|
[74] | 36 | bool IsLeaf(GtpVisibility::HierarchyNode *node) const;
|
---|
| 37 | bool HasGeometry(GtpVisibility::HierarchyNode *node) const;
|
---|
[87] | 38 | float GetSquaredDistance(GtpVisibility::HierarchyNode *node) const;
|
---|
[59] | 39 |
|
---|
| 40 | void SetNodeVisible(GtpVisibility::HierarchyNode *node, const bool visible);
|
---|
[74] | 41 | void SetLastVisited(GtpVisibility::HierarchyNode *node, const unsigned int frameId);
|
---|
[59] | 42 |
|
---|
[74] | 43 | bool IsNodeVisible(GtpVisibility::HierarchyNode *node) const;
|
---|
| 44 | unsigned int LastVisited(GtpVisibility::HierarchyNode *node) const;
|
---|
[59] | 45 |
|
---|
[112] | 46 | void VisualizeCulledNode(GtpVisibility::HierarchyNode *node,
|
---|
| 47 | GtpVisibility::CullingType type);
|
---|
| 48 |
|
---|
[130] | 49 | /*bool FindVisibleObjects(GtpVisibility::HierarchyNode *node,
|
---|
| 50 | InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry,
|
---|
| 51 | bool includeChildren = false);*/
|
---|
| 52 | void GetGeometry(GtpVisibility::HierarchyNode *node,
|
---|
| 53 | GtpVisibility::GeometryList *geometryList,
|
---|
| 54 | bool includeChildren);
|
---|
| 55 |
|
---|
[59] | 56 | protected:
|
---|
| 57 | /** Returns pointer to the bounding box of the node.
|
---|
| 58 | @param node current hierarchy node
|
---|
| 59 | @returns bounding box of current node
|
---|
| 60 | */
|
---|
| 61 | AxisAlignedBox *GetBoundingBox(GtpVisibility::HierarchyNode *node);
|
---|
| 62 | /** Returns squared distance of center of box with respect to the camera .
|
---|
| 63 | @param cam current camera
|
---|
| 64 | @param box axis aligned box
|
---|
| 65 | */
|
---|
| 66 | Real GetSquaredViewDepth(const Camera* cam, const AxisAlignedBox* box) const;
|
---|
[130] | 67 | /** number of octree hierarchy nodes */
|
---|
[59] | 68 | unsigned int mNumOctreeNodes;
|
---|
| 69 | };
|
---|
| 70 | } // namespace Ogre
|
---|
| 71 |
|
---|
| 72 | #endif // OctreeHierarchyInterface_H |
---|