[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 | void PullUpVisibility(GtpVisibility::HierarchyNode *node);
|
---|
[154] | 28 |
|
---|
[158] | 29 | /** Traverses and renders the given node.
|
---|
[59] | 30 | @param node current node
|
---|
[155] | 31 | @remark pushes children on a distance queue.
|
---|
[59] | 32 | */
|
---|
[158] | 33 | void TraverseNode(GtpVisibility::HierarchyNode *node);
|
---|
| 34 | /** @copydoc HierarchyInterface::RenderNode */
|
---|
[59] | 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 |
|
---|
[155] | 49 | void GetNodeGeometryList(GtpVisibility::HierarchyNode *node,
|
---|
[174] | 50 | GtpVisibility::GeometryList *geometryList,
|
---|
| 51 | bool includeChildren);
|
---|
| 52 |
|
---|
[59] | 53 | protected:
|
---|
| 54 | /** Returns pointer to the bounding box of the node.
|
---|
| 55 | @param node current hierarchy node
|
---|
| 56 | @returns bounding box of current node
|
---|
| 57 | */
|
---|
| 58 | AxisAlignedBox *GetBoundingBox(GtpVisibility::HierarchyNode *node);
|
---|
| 59 | /** Returns squared distance of center of box with respect to the camera .
|
---|
| 60 | @param cam current camera
|
---|
| 61 | @param box axis aligned box
|
---|
| 62 | */
|
---|
| 63 | Real GetSquaredViewDepth(const Camera* cam, const AxisAlignedBox* box) const;
|
---|
| 64 | };
|
---|
| 65 | } // namespace Ogre
|
---|
| 66 |
|
---|
| 67 | #endif // OctreeHierarchyInterface_H |
---|